-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start working on support for date range filter and some filters fixes
- Loading branch information
1 parent
d7053c0
commit b3156c1
Showing
12 changed files
with
66 additions
and
48 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
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
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
23 changes: 0 additions & 23 deletions
23
src/lib/themes/svelte/carbon/FilterComponents/DateFilter.svelte
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/lib/themes/svelte/carbon/FilterComponents/DateRangeFilter.svelte
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,27 @@ | ||
<script lang="ts"> | ||
import { _ } from 'svelte-i18n'; | ||
import DatePickerInput from 'carbon-components-svelte/src/DatePicker/DatePickerInput.svelte'; | ||
import DatePicker from 'carbon-components-svelte/src/DatePicker/DatePicker.svelte'; | ||
import type { DateRangeFilter } from '$lib/Filter'; | ||
import FilterContainer from '$lib/themes/svelte/carbon/FilterComponents/Internal/FilterContainer.svelte'; | ||
export let filter: DateRangeFilter; | ||
export let value: undefined|string|Array<string>; | ||
let from: string = '' ; | ||
let to: string = '' ; | ||
// Extracted from Carbon's DatePicker types | ||
type ChangeEvent = string | { | ||
selectedDates: [dateFrom: Date, dateTo?: Date | undefined]; | ||
dateStr: string | { from: string; to: string; }; | ||
}; | ||
</script> | ||
|
||
<FilterContainer {filter}> | ||
<DatePicker datePickerType="range" bind:valueFrom={from} bind:valueTo={to}> | ||
<DatePickerInput labelText={$_('filters.date.from')} name={filter.field + '[0]'} value={from || ''} /> | ||
<DatePickerInput labelText={$_('filters.date.to')} name={filter.field + '[1]'} value={to || ''} /> | ||
</DatePicker> | ||
</FilterContainer> |
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
Empty file.
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