-
Notifications
You must be signed in to change notification settings - Fork 3
feat(filter): migrate plugin #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
oeninghe-dataport
wants to merge
27
commits into
next
Choose a base branch
from
vue3/migrate-plugin-filter
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8dc462a
Bump @commitlint/cli from 20.2.0 to 20.3.0
dependabot[bot] 0328f14
ci(iceberg): make tsc acknowledge vitest-caused node types
oeninghe-dataport 07048a5
fix(core): enforce usage of `Icon` type
oeninghe-dataport 2fa72f1
feat(filter): migrate plugin
oeninghe-dataport 6aabb56
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin cd23d05
fix(filter): use correct import for export store
dopenguin 56ea116
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin 9c92633
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin e6916db
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin 25d11ec
style: apply new linting rule for self-closing
oeninghe-dataport b7b6c3b
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin 0d1200c
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin 52c14f3
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin e973288
fix(filter): remove bottom padding that was mitigation for a fixed bug
oeninghe-dataport 1a1516e
fix(filter): use sensible defaults for user-defined locales
oeninghe-dataport 7c65f97
docs(filter): recommend l10n
oeninghe-dataport 8daf691
fix(filter): show layer name instead of ID
oeninghe-dataport 0fb038b
fix(filter): show layer name if only one layer is offered
oeninghe-dataport bdb3cd6
refactor(filter): use `PluginId` as namespace for i18n
oeninghe-dataport 952f425
refactor: move `getVectorSource` to global lib functions
oeninghe-dataport e573790
refactor(filter): move common getters to store
oeninghe-dataport 49d36bb
refactor(filter): introduce store logic for time-related filters
oeninghe-dataport 20d3c31
fix: reserve space for border in KernBlockButtonX
oeninghe-dataport 36777db
chore(filter): add missing store files
oeninghe-dataport ac723a0
refactor: show focus for KernBlockButtonX
oeninghe-dataport 715c37b
chore: remove now unused @ts-expect-error directives
oeninghe-dataport 01f8943
Merge branch 'next' into vue3/migrate-plugin-filter
dopenguin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| <template> | ||
| <button | ||
| class="kern-btn kern-btn--block kern-btn--tertiary" | ||
| @click="emit('click')" | ||
| > | ||
| <span | ||
| v-if="props.icon" | ||
| :class="{ 'kern-icon': true, [props.icon]: true }" | ||
| aria-hidden="true" | ||
| /> | ||
| <span class="kern-label">{{ props.label }}</span> | ||
| </button> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import type { Icon } from '@/core' | ||
|
|
||
| const props = defineProps<{ | ||
| icon?: Icon | false | ||
| label: string | ||
| }>() | ||
|
|
||
| const emit = defineEmits<{ | ||
| click: [] | ||
| }>() | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .kern-btn--tertiary { | ||
| background-color: #edf1fa; | ||
| justify-content: left; | ||
|
|
||
| .kern-label { | ||
| text-decoration: none; | ||
| } | ||
| } | ||
| </style> |
This file contains hidden or 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,46 @@ | ||
| <template> | ||
| <input :id="id" v-model="model" type="checkbox" /> | ||
| <label :for="id" class="kern-btn kern-btn--block kern-btn--tertiary"> | ||
| <span | ||
| v-if="props.icon" | ||
| :class="{ 'kern-icon': true, [props.icon]: true }" | ||
| aria-hidden="true" | ||
| /> | ||
| <span class="kern-label">{{ props.label }}</span> | ||
| </label> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { useId } from 'vue' | ||
|
|
||
| import type { Icon } from '@/core' | ||
|
|
||
| const props = defineProps<{ | ||
| icon?: Icon | false | ||
| label: string | ||
| }>() | ||
|
|
||
| const model = defineModel<boolean>({ required: true }) | ||
|
|
||
| const id = useId() | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .kern-btn--tertiary { | ||
| background-color: #edf1fa; | ||
| justify-content: left; | ||
|
|
||
| .kern-label { | ||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
| input[type='checkbox'] { | ||
| display: none; | ||
|
|
||
| &:checked + label { | ||
| border: var(--kern-metric-border-width-default) solid | ||
| var(--kern-color-action-default); | ||
| } | ||
| } | ||
| </style> |
This file contains hidden or 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,60 @@ | ||
| <template> | ||
| <template v-for="item of props.items" :key="item.value"> | ||
| <input | ||
| :id="id + '*' + item.value" | ||
| v-model="model" | ||
| type="radio" | ||
| :name="id" | ||
| :value="item.value" | ||
| /> | ||
| <label | ||
| :for="id + '*' + item.value" | ||
| class="kern-btn kern-btn--block kern-btn--tertiary" | ||
| > | ||
| <span | ||
| v-if="item.icon" | ||
| :class="{ 'kern-icon': true, [item.icon]: true }" | ||
| aria-hidden="true" | ||
| /> | ||
| <span class="kern-label">{{ item.label }}</span> | ||
| </label> | ||
| </template> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { useId } from 'vue' | ||
|
|
||
| import type { Icon } from '@/core' | ||
|
|
||
| const props = defineProps<{ | ||
| items: { | ||
| value: string | ||
| label: string | ||
| icon?: Icon | false | ||
| }[] | ||
| }>() | ||
|
|
||
| const model = defineModel<string>({ required: true }) | ||
|
|
||
| const id = useId() | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .kern-btn--tertiary { | ||
| background-color: #edf1fa; | ||
| justify-content: left; | ||
|
|
||
| .kern-label { | ||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
| input[type='radio'] { | ||
| display: none; | ||
|
|
||
| &:checked + label { | ||
| border: var(--kern-metric-border-width-default) solid | ||
| var(--kern-color-action-default); | ||
| } | ||
| } | ||
| </style> |
This file contains hidden or 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,29 @@ | ||
| <template> | ||
| <input | ||
| v-model="inputModel" | ||
| type="date" | ||
| class="kern-form-input__input" | ||
| :min="dateToString(props.min ?? null)" | ||
| :max="dateToString(props.max ?? null)" | ||
| /> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { computed } from 'vue' | ||
|
|
||
| import { dateToString, stringToDate } from '@/lib/dateUtils' | ||
|
|
||
| const props = defineProps<{ | ||
| min?: Date | ||
| max?: Date | ||
| }>() | ||
|
|
||
| const model = defineModel<Date | null>({ required: true }) | ||
|
|
||
| const inputModel = computed({ | ||
| get: () => dateToString(model.value), | ||
| set: (value) => { | ||
| model.value = stringToDate(value) | ||
| }, | ||
| }) | ||
| </script> |
This file contains hidden or 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,28 @@ | ||
| <template> | ||
| <div class="range-picker"> | ||
| <KernDatePicker v-model="start" v-bind="props" /> | ||
| – | ||
| <KernDatePicker v-model="end" v-bind="props" /> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import KernDatePicker from './KernDatePicker.ce.vue' | ||
|
|
||
| const props = defineProps<{ | ||
| min?: Date | ||
| max?: Date | ||
| }>() | ||
|
|
||
| const start = defineModel<Date | null>('start', { required: true }) | ||
| const end = defineModel<Date | null>('end', { required: true }) | ||
| </script> | ||
|
|
||
| <style scoped> | ||
| .range-picker { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| margin: 0.3em 0; | ||
| } | ||
| </style> |
This file contains hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| export function dateToString(date: Date | null) { | ||
| if (date === null) { | ||
| return '' | ||
| } | ||
| return [date.getFullYear(), date.getMonth() + 1, date.getDate()] | ||
| .map((v) => v.toString().padStart(2, '0')) | ||
| .join('-') | ||
| } | ||
|
|
||
| export function stringToDate(date: string) { | ||
| if (date.length === 0) { | ||
| return null | ||
| } | ||
| const [y, m, d] = date.split('-') | ||
| return new Date(Number(y), Number(m) - 1, Number(d)) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.