-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from mishankov/trim
Trim manipulation
- Loading branch information
Showing
9 changed files
with
127 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ Available manipulations: | |
- Compose | ||
- Slice | ||
- Split-compose | ||
- Trim | ||
- Split-join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts"> | ||
interface Option { | ||
value: string; | ||
label: string; | ||
} | ||
export let options: Option[]; | ||
export let selected: string; | ||
</script> | ||
|
||
<div> | ||
{#each options as option} | ||
<label> | ||
<input type="radio" bind:group={selected} value={option.value} /> | ||
{option.label} | ||
</label> | ||
{/each} | ||
</div> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
label { | ||
display: flex; | ||
gap: 5px; | ||
align-items: center; | ||
} | ||
input { | ||
margin: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script lang="ts" context="module"> | ||
import type { ManipulationBase } from '..'; | ||
import RadioButton from '$lib/components/RadioButton.svelte'; | ||
export interface TrimManipulation extends ManipulationBase { | ||
type: 'trim'; | ||
trimType: string; | ||
} | ||
const options = [ | ||
{ | ||
value: 'leading', | ||
label: 'Leading' | ||
}, | ||
{ | ||
value: 'trailing', | ||
label: 'Trailing' | ||
}, | ||
{ | ||
value: 'all', | ||
label: 'All' | ||
} | ||
]; | ||
</script> | ||
|
||
<script lang="ts"> | ||
export let { trimType }: TrimManipulation = { trimType: 'all', type: 'trim' }; | ||
</script> | ||
|
||
<div> | ||
<span>Trim </span> | ||
<RadioButton bind:selected={trimType} {options} /> | ||
</div> | ||
|
||
<style> | ||
div { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters