@xleddyl/443-components-vue 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -20
- package/dist/chart/BarChart.vue.d.ts +6 -6
- package/dist/chart/ChartLegend.vue.d.ts +16 -16
- package/dist/chart/ChartPanel.vue +10 -6
- package/dist/chart/ChartPanel.vue.d.ts +6 -8
- package/dist/chart/ChartSummary.vue.d.ts +6 -6
- package/dist/chart/DoughnutChart.vue.d.ts +6 -6
- package/dist/chart/LineChart.vue.d.ts +6 -6
- package/dist/components/core/Button.vue +3 -1
- package/dist/components/core/Button.vue.d.ts +6 -6
- package/dist/components/core/FormField.vue.d.ts +6 -6
- package/dist/components/core/Icon.vue +9 -1
- package/dist/components/core/Icon.vue.d.ts +4 -4
- package/dist/components/core/Input.vue +6 -3
- package/dist/components/core/Input.vue.d.ts +18 -19
- package/dist/components/core/Kbd.vue.d.ts +6 -6
- package/dist/components/core/Root.vue.d.ts +10 -10
- package/dist/components/core/Spinner.vue +7 -3
- package/dist/components/core/Spinner.vue.d.ts +6 -7
- package/dist/components/core/Textarea.vue +36 -23
- package/dist/components/core/Textarea.vue.d.ts +31 -21
- package/dist/components/core/VisuallyHidden.vue.d.ts +10 -10
- package/dist/components/data/Avatar.vue +4 -2
- package/dist/components/data/Avatar.vue.d.ts +6 -6
- package/dist/components/data/AvatarGroup.vue +5 -2
- package/dist/components/data/AvatarGroup.vue.d.ts +7 -8
- package/dist/components/data/Badge.vue.d.ts +6 -6
- package/dist/components/data/DescriptionList.vue +7 -3
- package/dist/components/data/DescriptionList.vue.d.ts +7 -8
- package/dist/components/data/FilterPills.vue +13 -4
- package/dist/components/data/FilterPills.vue.d.ts +16 -18
- package/dist/components/data/Pagination.vue +23 -14
- package/dist/components/data/Pagination.vue.d.ts +16 -23
- package/dist/components/data/Stat.vue +9 -6
- package/dist/components/data/Stat.vue.d.ts +10 -13
- package/dist/components/data/Table.vue +12 -7
- package/dist/components/data/Tag.vue +7 -4
- package/dist/components/data/Tag.vue.d.ts +16 -17
- package/dist/components/data/Timeline.vue.d.ts +6 -6
- package/dist/components/data/Tree.vue +5 -2
- package/dist/components/data/Tree.vue.d.ts +16 -17
- package/dist/components/feedback/Alert.vue +5 -2
- package/dist/components/feedback/Alert.vue.d.ts +14 -15
- package/dist/components/feedback/EmptyState.vue.d.ts +7 -7
- package/dist/components/feedback/LoadingOverlay.vue +8 -4
- package/dist/components/feedback/LoadingOverlay.vue.d.ts +6 -7
- package/dist/components/feedback/Meter.vue.d.ts +6 -6
- package/dist/components/feedback/Progress.vue +6 -3
- package/dist/components/feedback/Progress.vue.d.ts +6 -7
- package/dist/components/feedback/ProgressRing.vue +5 -2
- package/dist/components/feedback/ProgressRing.vue.d.ts +6 -7
- package/dist/components/feedback/Skeleton.vue.d.ts +6 -6
- package/dist/components/forms/Calendar.vue +16 -11
- package/dist/components/forms/Calendar.vue.d.ts +17 -21
- package/dist/components/forms/ColorInput.vue +8 -4
- package/dist/components/forms/ColorInput.vue.d.ts +18 -20
- package/dist/components/forms/Combobox.vue +31 -19
- package/dist/components/forms/Combobox.vue.d.ts +2 -2
- package/dist/components/forms/DateInput.vue.d.ts +16 -16
- package/dist/components/forms/DatePicker.vue +17 -11
- package/dist/components/forms/DatePicker.vue.d.ts +14 -18
- package/dist/components/forms/FileInput.vue +23 -13
- package/dist/components/forms/FileInput.vue.d.ts +17 -23
- package/dist/components/forms/InputAddon.vue.d.ts +6 -6
- package/dist/components/forms/InputGroup.vue.d.ts +6 -6
- package/dist/components/forms/NumberInput.vue +15 -10
- package/dist/components/forms/NumberInput.vue.d.ts +16 -19
- package/dist/components/forms/PasswordInput.vue +21 -13
- package/dist/components/forms/PasswordInput.vue.d.ts +14 -20
- package/dist/components/forms/PinInput.vue +7 -2
- package/dist/components/forms/PinInput.vue.d.ts +18 -16
- package/dist/components/forms/Radio.vue.d.ts +6 -6
- package/dist/components/forms/Slider.vue.d.ts +18 -18
- package/dist/components/forms/Switch.vue.d.ts +16 -16
- package/dist/components/forms/TimeInput.vue.d.ts +16 -16
- package/dist/components/layout/Accordion.vue.d.ts +16 -16
- package/dist/components/layout/AppShell.vue +11 -6
- package/dist/components/layout/AppShell.vue.d.ts +16 -19
- package/dist/components/layout/Breadcrumbs.vue +5 -2
- package/dist/components/layout/Breadcrumbs.vue.d.ts +6 -7
- package/dist/components/layout/Card.vue.d.ts +8 -8
- package/dist/components/layout/CopyButton.vue +11 -6
- package/dist/components/layout/CopyButton.vue.d.ts +16 -18
- package/dist/components/layout/Grid.vue.d.ts +7 -7
- package/dist/components/layout/NavLink.vue.d.ts +10 -10
- package/dist/components/layout/PageHeader.vue.d.ts +6 -6
- package/dist/components/layout/Separator.vue.d.ts +6 -6
- package/dist/components/layout/Sidebar.vue +10 -5
- package/dist/components/layout/Sidebar.vue.d.ts +7 -11
- package/dist/components/layout/SidebarSection.vue.d.ts +6 -6
- package/dist/components/layout/Stack.vue.d.ts +10 -10
- package/dist/components/layout/Tabs.vue.d.ts +16 -16
- package/dist/components/layout/ThemeSwitch.vue +12 -6
- package/dist/components/layout/ThemeSwitch.vue.d.ts +6 -7
- package/dist/components/layout/Toolbar.vue.d.ts +6 -6
- package/dist/components/overlays/CommandPalette.vue +38 -24
- package/dist/components/overlays/CommandPalette.vue.d.ts +18 -30
- package/dist/components/overlays/ConfirmDialog.vue +14 -9
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +12 -15
- package/dist/components/overlays/ConfirmHost.vue +6 -3
- package/dist/components/overlays/ConfirmHost.vue.d.ts +16 -16
- package/dist/components/overlays/ContextMenu.vue +6 -3
- package/dist/components/overlays/ContextMenu.vue.d.ts +11 -13
- package/dist/components/overlays/Drawer.vue +1 -1
- package/dist/components/overlays/Drawer.vue.d.ts +10 -11
- package/dist/components/overlays/DropdownMenu.vue.d.ts +10 -10
- package/dist/components/overlays/HoverCard.vue.d.ts +16 -16
- package/dist/components/overlays/Modal.vue +1 -1
- package/dist/components/overlays/Modal.vue.d.ts +10 -11
- package/dist/components/overlays/OverlayHost.vue.d.ts +1 -1
- package/dist/components/overlays/Popover.vue.d.ts +16 -16
- package/dist/components/overlays/Toaster.vue +8 -4
- package/dist/components/overlays/Toaster.vue.d.ts +8 -10
- package/dist/components/overlays/Tooltip.vue.d.ts +6 -6
- package/dist/components/templates/AccountMenu.vue +5 -2
- package/dist/components/templates/AccountMenu.vue.d.ts +18 -19
- package/dist/components/templates/AppearanceSettings.vue +26 -12
- package/dist/components/templates/AppearanceSettings.vue.d.ts +7 -11
- package/dist/components/templates/AuthLayout.vue +11 -7
- package/dist/components/templates/AuthLayout.vue.d.ts +6 -9
- package/dist/components/templates/Brand.vue.d.ts +10 -10
- package/dist/components/templates/DashboardLayout.vue +25 -16
- package/dist/components/templates/DashboardLayout.vue.d.ts +12 -24
- package/dist/components/templates/DashboardPage.vue +7 -3
- package/dist/components/templates/DashboardPage.vue.d.ts +6 -7
- package/dist/components/templates/DetailPage.vue +14 -8
- package/dist/components/templates/DetailPage.vue.d.ts +14 -18
- package/dist/components/templates/EmptyPage.vue +15 -8
- package/dist/components/templates/EmptyPage.vue.d.ts +7 -11
- package/dist/components/templates/ErrorPage.vue +32 -25
- package/dist/components/templates/ErrorPage.vue.d.ts +6 -6
- package/dist/components/templates/FormPage.vue +19 -11
- package/dist/components/templates/FormPage.vue.d.ts +3 -3
- package/dist/components/templates/ListPage.vue +39 -23
- package/dist/components/templates/ListPage.vue.d.ts +2 -2
- package/dist/components/templates/NotFoundPage.vue +4 -4
- package/dist/components/templates/NotFoundPage.vue.d.ts +1 -1
- package/dist/components/templates/SaveBar.vue +20 -11
- package/dist/components/templates/SaveBar.vue.d.ts +16 -19
- package/dist/components/templates/SettingsGroup.vue.d.ts +7 -7
- package/dist/components/templates/SettingsModal.vue +29 -21
- package/dist/components/templates/SettingsModal.vue.d.ts +15 -25
- package/dist/components/templates/SettingsPage.vue +8 -5
- package/dist/components/templates/SettingsPage.vue.d.ts +18 -21
- package/dist/components/templates/SettingsSection.vue +7 -3
- package/dist/components/templates/SettingsSection.vue.d.ts +8 -9
- package/dist/composables/core.d.ts +1 -0
- package/dist/composables/core.mjs +1 -0
- package/dist/composables/useAlert.mjs +3 -1
- package/dist/composables/useConfirm.mjs +5 -3
- package/dist/composables/useDirtyGuard.mjs +7 -5
- package/dist/composables/useForm.d.ts +4 -1
- package/dist/composables/useForm.mjs +33 -16
- package/dist/composables/useIcons.d.ts +4 -0
- package/dist/composables/useIcons.mjs +10 -0
- package/dist/composables/useLocale.d.ts +11 -0
- package/dist/composables/useLocale.mjs +26 -0
- package/dist/composables/usePasswordStrength.mjs +11 -7
- package/dist/composables/usePrompt.mjs +3 -1
- package/dist/editor/RichTextEditor.vue +20 -14
- package/dist/editor/RichTextEditor.vue.d.ts +22 -15
- package/dist/editor/index.d.ts +0 -1
- package/dist/editor/index.mjs +0 -1
- package/dist/editor/types.d.ts +3 -18
- package/dist/grid/DataGrid.vue +11 -2
- package/dist/grid/GridToolbar.vue +6 -2
- package/dist/grid/GridToolbar.vue.d.ts +21 -20
- package/dist/grid/cells/BadgeCell.vue.d.ts +6 -6
- package/dist/grid/cells/BooleanCell.vue +5 -2
- package/dist/grid/cells/BooleanCell.vue.d.ts +6 -6
- package/dist/grid/cells/DateCell.vue +4 -1
- package/dist/grid/cells/DateCell.vue.d.ts +6 -6
- package/dist/grid/cells/ImageCell.vue.d.ts +6 -6
- package/dist/grid/cells/LinkCell.vue.d.ts +6 -6
- package/dist/grid/index.d.ts +0 -1
- package/dist/grid/index.mjs +0 -1
- package/dist/grid/types.d.ts +5 -17
- package/dist/icons/collections.d.ts +39 -0
- package/dist/icons/collections.mjs +67 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +11 -1
- package/dist/internal/feedback/LoadingHost.vue +6 -3
- package/dist/internal/feedback/LoadingHost.vue.d.ts +0 -1
- package/dist/internal/forms/files.mjs +1 -1
- package/dist/internal/forms/standard-schema.d.ts +26 -0
- package/dist/internal/forms/standard-schema.mjs +21 -0
- package/dist/internal/keys.d.ts +4 -1
- package/dist/internal/keys.mjs +2 -0
- package/dist/internal/overlays/DialogFrame.vue +5 -2
- package/dist/internal/overlays/DialogFrame.vue.d.ts +14 -14
- package/dist/internal/overlays/MenuList.vue.d.ts +16 -16
- package/dist/internal/overlays/OverlayView.vue.d.ts +16 -16
- package/dist/internal/overlays/confirm.d.ts +3 -0
- package/dist/locale/en.d.ts +2 -0
- package/dist/locale/en.mjs +284 -0
- package/dist/locale/index.d.ts +16 -0
- package/dist/locale/index.mjs +50 -0
- package/dist/locale/it.d.ts +2 -0
- package/dist/locale/it.mjs +284 -0
- package/dist/locale/types.d.ts +292 -0
- package/dist/locale/types.mjs +0 -0
- package/dist/nuxt/module.d.ts +14 -0
- package/dist/nuxt/module.mjs +136 -8
- package/dist/nuxt/runtime/layouts/auth.vue.d.ts +16 -16
- package/dist/nuxt/runtime/layouts/dashboard.vue.d.ts +16 -16
- package/dist/nuxt/runtime/locale.d.ts +2 -0
- package/dist/nuxt/runtime/locale.mjs +20 -0
- package/dist/styles/core/icon.css +4 -0
- package/dist/styles/core/textarea.css +21 -0
- package/package.json +1 -1
- package/dist/editor/messages.d.ts +0 -2
- package/dist/editor/messages.mjs +0 -18
- package/dist/grid/messages.d.ts +0 -3
- package/dist/grid/messages.mjs +0 -21
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
dir?: string | undefined | undefined;
|
|
11
11
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
12
12
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
13
|
-
enterKeyHint?: "search" | "done" | "
|
|
13
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
14
14
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
15
15
|
id?: string | undefined | undefined;
|
|
16
16
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -56,7 +56,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
56
56
|
'aria-colindex'?: (string | number) | undefined;
|
|
57
57
|
'aria-colspan'?: (string | number) | undefined;
|
|
58
58
|
'aria-controls'?: string | undefined | undefined;
|
|
59
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
59
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
60
60
|
'aria-describedby'?: string | undefined | undefined;
|
|
61
61
|
'aria-details'?: string | undefined | undefined;
|
|
62
62
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -65,7 +65,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
65
65
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
66
66
|
'aria-flowto'?: string | undefined | undefined;
|
|
67
67
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
68
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
68
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
69
69
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
70
70
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
71
71
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -204,7 +204,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
204
204
|
dir?: string | undefined | undefined;
|
|
205
205
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
206
206
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
207
|
-
enterKeyHint?: "search" | "done" | "
|
|
207
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
208
208
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
209
209
|
id?: string | undefined | undefined;
|
|
210
210
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -250,7 +250,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
250
250
|
'aria-colindex'?: (string | number) | undefined;
|
|
251
251
|
'aria-colspan'?: (string | number) | undefined;
|
|
252
252
|
'aria-controls'?: string | undefined | undefined;
|
|
253
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
253
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
254
254
|
'aria-describedby'?: string | undefined | undefined;
|
|
255
255
|
'aria-details'?: string | undefined | undefined;
|
|
256
256
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -259,7 +259,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
259
259
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
260
260
|
'aria-flowto'?: string | undefined | undefined;
|
|
261
261
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
262
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
262
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
263
263
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
264
264
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
265
265
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
<script setup>
|
|
9
9
|
import { computed } from "vue";
|
|
10
10
|
import Icon from "../../components/core/Icon.vue";
|
|
11
|
-
import {
|
|
11
|
+
import { en } from "../../locale/en";
|
|
12
12
|
const props = defineProps({
|
|
13
13
|
params: { type: Object, required: true }
|
|
14
14
|
});
|
|
15
15
|
const value = computed(() => Boolean(props.params.value));
|
|
16
|
+
const messages = computed(
|
|
17
|
+
() => props.params.context?.messages ?? en.messages.grid
|
|
18
|
+
);
|
|
16
19
|
const label = computed(
|
|
17
|
-
() => value.value ? props.params.trueLabel ??
|
|
20
|
+
() => value.value ? props.params.trueLabel ?? messages.value.yes : props.params.falseLabel ?? messages.value.no
|
|
18
21
|
);
|
|
19
22
|
</script>
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
dir?: string | undefined | undefined;
|
|
11
11
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
12
12
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
13
|
-
enterKeyHint?: "search" | "done" | "
|
|
13
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
14
14
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
15
15
|
id?: string | undefined | undefined;
|
|
16
16
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -56,7 +56,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
56
56
|
'aria-colindex'?: (string | number) | undefined;
|
|
57
57
|
'aria-colspan'?: (string | number) | undefined;
|
|
58
58
|
'aria-controls'?: string | undefined | undefined;
|
|
59
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
59
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
60
60
|
'aria-describedby'?: string | undefined | undefined;
|
|
61
61
|
'aria-details'?: string | undefined | undefined;
|
|
62
62
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -65,7 +65,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
65
65
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
66
66
|
'aria-flowto'?: string | undefined | undefined;
|
|
67
67
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
68
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
68
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
69
69
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
70
70
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
71
71
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -204,7 +204,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
204
204
|
dir?: string | undefined | undefined;
|
|
205
205
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
206
206
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
207
|
-
enterKeyHint?: "search" | "done" | "
|
|
207
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
208
208
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
209
209
|
id?: string | undefined | undefined;
|
|
210
210
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -250,7 +250,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
250
250
|
'aria-colindex'?: (string | number) | undefined;
|
|
251
251
|
'aria-colspan'?: (string | number) | undefined;
|
|
252
252
|
'aria-controls'?: string | undefined | undefined;
|
|
253
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
253
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
254
254
|
'aria-describedby'?: string | undefined | undefined;
|
|
255
255
|
'aria-details'?: string | undefined | undefined;
|
|
256
256
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -259,7 +259,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
259
259
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
260
260
|
'aria-flowto'?: string | undefined | undefined;
|
|
261
261
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
262
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
262
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
263
263
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
264
264
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
265
265
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -15,8 +15,11 @@ const date = computed(() => {
|
|
|
15
15
|
const parsed = raw instanceof Date ? raw : new Date(raw);
|
|
16
16
|
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
17
17
|
});
|
|
18
|
+
const locale = computed(
|
|
19
|
+
() => props.params.locale ?? props.params.context?.locale
|
|
20
|
+
);
|
|
18
21
|
const formatted = computed(
|
|
19
|
-
() => date.value ? dateTimeFormat(
|
|
22
|
+
() => date.value ? dateTimeFormat(locale.value, props.params.options ?? { dateStyle: "medium" }).format(
|
|
20
23
|
date.value
|
|
21
24
|
) : ""
|
|
22
25
|
);
|
|
@@ -11,7 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
11
11
|
dir?: string | undefined | undefined;
|
|
12
12
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
13
13
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
14
|
-
enterKeyHint?: "search" | "done" | "
|
|
14
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
15
15
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
16
16
|
id?: string | undefined | undefined;
|
|
17
17
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -57,7 +57,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
57
57
|
'aria-colindex'?: (string | number) | undefined;
|
|
58
58
|
'aria-colspan'?: (string | number) | undefined;
|
|
59
59
|
'aria-controls'?: string | undefined | undefined;
|
|
60
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
60
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
61
61
|
'aria-describedby'?: string | undefined | undefined;
|
|
62
62
|
'aria-details'?: string | undefined | undefined;
|
|
63
63
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -66,7 +66,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
66
66
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
67
67
|
'aria-flowto'?: string | undefined | undefined;
|
|
68
68
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
69
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
69
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
70
70
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
71
71
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
72
72
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -206,7 +206,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
206
206
|
dir?: string | undefined | undefined;
|
|
207
207
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
208
208
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
209
|
-
enterKeyHint?: "search" | "done" | "
|
|
209
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
210
210
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
211
211
|
id?: string | undefined | undefined;
|
|
212
212
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -252,7 +252,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
252
252
|
'aria-colindex'?: (string | number) | undefined;
|
|
253
253
|
'aria-colspan'?: (string | number) | undefined;
|
|
254
254
|
'aria-controls'?: string | undefined | undefined;
|
|
255
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
255
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
256
256
|
'aria-describedby'?: string | undefined | undefined;
|
|
257
257
|
'aria-details'?: string | undefined | undefined;
|
|
258
258
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -261,7 +261,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
261
261
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
262
262
|
'aria-flowto'?: string | undefined | undefined;
|
|
263
263
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
264
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
264
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
265
265
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
266
266
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
267
267
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -22,7 +22,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
22
22
|
dir?: string | undefined | undefined;
|
|
23
23
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
24
24
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
25
|
-
enterKeyHint?: "search" | "done" | "
|
|
25
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
26
26
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
27
27
|
id?: string | undefined | undefined;
|
|
28
28
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -68,7 +68,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
68
68
|
'aria-colindex'?: (string | number) | undefined;
|
|
69
69
|
'aria-colspan'?: (string | number) | undefined;
|
|
70
70
|
'aria-controls'?: string | undefined | undefined;
|
|
71
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
71
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
72
72
|
'aria-describedby'?: string | undefined | undefined;
|
|
73
73
|
'aria-details'?: string | undefined | undefined;
|
|
74
74
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -77,7 +77,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
77
77
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
78
78
|
'aria-flowto'?: string | undefined | undefined;
|
|
79
79
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
80
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
80
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
81
81
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
82
82
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
83
83
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -228,7 +228,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
228
228
|
dir?: string | undefined | undefined;
|
|
229
229
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
230
230
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
231
|
-
enterKeyHint?: "search" | "done" | "
|
|
231
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
232
232
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
233
233
|
id?: string | undefined | undefined;
|
|
234
234
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -274,7 +274,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
274
274
|
'aria-colindex'?: (string | number) | undefined;
|
|
275
275
|
'aria-colspan'?: (string | number) | undefined;
|
|
276
276
|
'aria-controls'?: string | undefined | undefined;
|
|
277
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
277
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
278
278
|
'aria-describedby'?: string | undefined | undefined;
|
|
279
279
|
'aria-details'?: string | undefined | undefined;
|
|
280
280
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -283,7 +283,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
283
283
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
284
284
|
'aria-flowto'?: string | undefined | undefined;
|
|
285
285
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
286
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
286
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
287
287
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
288
288
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
289
289
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
19
19
|
dir?: string | undefined | undefined;
|
|
20
20
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
21
21
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
22
|
-
enterKeyHint?: "search" | "done" | "
|
|
22
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
23
23
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
24
24
|
id?: string | undefined | undefined;
|
|
25
25
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -65,7 +65,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
65
65
|
'aria-colindex'?: (string | number) | undefined;
|
|
66
66
|
'aria-colspan'?: (string | number) | undefined;
|
|
67
67
|
'aria-controls'?: string | undefined | undefined;
|
|
68
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
68
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
69
69
|
'aria-describedby'?: string | undefined | undefined;
|
|
70
70
|
'aria-details'?: string | undefined | undefined;
|
|
71
71
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -74,7 +74,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
74
74
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
75
75
|
'aria-flowto'?: string | undefined | undefined;
|
|
76
76
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
77
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
77
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
78
78
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
79
79
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
80
80
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
|
@@ -222,7 +222,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
222
222
|
dir?: string | undefined | undefined;
|
|
223
223
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
224
224
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
225
|
-
enterKeyHint?: "search" | "done" | "
|
|
225
|
+
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
226
226
|
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
227
227
|
id?: string | undefined | undefined;
|
|
228
228
|
inert?: (boolean | "true" | "false") | undefined;
|
|
@@ -268,7 +268,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
268
268
|
'aria-colindex'?: (string | number) | undefined;
|
|
269
269
|
'aria-colspan'?: (string | number) | undefined;
|
|
270
270
|
'aria-controls'?: string | undefined | undefined;
|
|
271
|
-
'aria-current'?: "location" | "time" | (boolean | "true" | "false") | "
|
|
271
|
+
'aria-current'?: "page" | "location" | "time" | (boolean | "true" | "false") | "step" | "date" | undefined;
|
|
272
272
|
'aria-describedby'?: string | undefined | undefined;
|
|
273
273
|
'aria-details'?: string | undefined | undefined;
|
|
274
274
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -277,7 +277,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
277
277
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
278
278
|
'aria-flowto'?: string | undefined | undefined;
|
|
279
279
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
280
|
-
'aria-haspopup'?: "dialog" | "menu" | (boolean | "true" | "false") | "listbox" |
|
|
280
|
+
'aria-haspopup'?: "grid" | "tree" | "dialog" | "menu" | (boolean | "true" | "false") | "listbox" | undefined;
|
|
281
281
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
282
282
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
283
283
|
'aria-keyshortcuts'?: string | undefined | undefined;
|
package/dist/grid/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export { default as DateCell } from './cells/DateCell.vue';
|
|
|
5
5
|
export { default as BadgeCell } from './cells/BadgeCell.vue';
|
|
6
6
|
export { default as ImageCell } from './cells/ImageCell.vue';
|
|
7
7
|
export { default as LinkCell } from './cells/LinkCell.vue';
|
|
8
|
-
export { defaultGridMessages } from './messages';
|
|
9
8
|
export { registerGridModules } from './modules';
|
|
10
9
|
export { createGridTheme } from './theme';
|
|
11
10
|
export type * from './types';
|
package/dist/grid/index.mjs
CHANGED
|
@@ -5,6 +5,5 @@ export { default as DateCell } from "./cells/DateCell.vue";
|
|
|
5
5
|
export { default as BadgeCell } from "./cells/BadgeCell.vue";
|
|
6
6
|
export { default as ImageCell } from "./cells/ImageCell.vue";
|
|
7
7
|
export { default as LinkCell } from "./cells/LinkCell.vue";
|
|
8
|
-
export { defaultGridMessages } from "./messages.mjs";
|
|
9
8
|
export { registerGridModules } from "./modules.mjs";
|
|
10
9
|
export { createGridTheme } from "./theme.mjs";
|
package/dist/grid/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColDef, GridApi, ICellRendererParams } from 'ag-grid-community';
|
|
2
2
|
import type { Tone } from '../components/core/types';
|
|
3
|
+
import type { KMessages } from '../locale/types';
|
|
3
4
|
export type GridDensity = 'compact' | 'normal' | 'comfortable';
|
|
4
5
|
export type GridSelection = boolean | 'single' | 'multiple';
|
|
5
6
|
export type GridSortDirection = 'asc' | 'desc';
|
|
@@ -7,23 +8,10 @@ export interface GridSortChange {
|
|
|
7
8
|
column: string;
|
|
8
9
|
direction: GridSortDirection;
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
clearSearch: string;
|
|
15
|
-
toolbar: string;
|
|
16
|
-
columns: string;
|
|
17
|
-
resetColumns: string;
|
|
18
|
-
exportCsv: string;
|
|
19
|
-
rowsPerPage: string;
|
|
20
|
-
previousPage: string;
|
|
21
|
-
nextPage: string;
|
|
22
|
-
pageStatus: string;
|
|
23
|
-
selected: string;
|
|
24
|
-
copied: string;
|
|
25
|
-
yes: string;
|
|
26
|
-
no: string;
|
|
11
|
+
export type GridMessages = KMessages['grid'];
|
|
12
|
+
export interface GridCellContext {
|
|
13
|
+
messages: GridMessages;
|
|
14
|
+
locale: string;
|
|
27
15
|
}
|
|
28
16
|
export type GridColumn<T> = ColDef<T>;
|
|
29
17
|
export interface GridColumnState {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface IconifyIcon {
|
|
2
|
+
body: string;
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
left?: number;
|
|
6
|
+
top?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IconifyCollection {
|
|
9
|
+
prefix: string;
|
|
10
|
+
icons: Record<string, IconifyIcon>;
|
|
11
|
+
aliases?: Record<string, {
|
|
12
|
+
parent: string;
|
|
13
|
+
}>;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
}
|
|
17
|
+
export type IconCollectionSource = IconifyCollection | (() => Promise<IconifyCollection | {
|
|
18
|
+
default: IconifyCollection;
|
|
19
|
+
}>);
|
|
20
|
+
export interface CollectionSvg {
|
|
21
|
+
attrs: Record<string, string>;
|
|
22
|
+
inner: string;
|
|
23
|
+
}
|
|
24
|
+
export type CollectionLookup = {
|
|
25
|
+
status: 'ready';
|
|
26
|
+
svg: CollectionSvg;
|
|
27
|
+
} | {
|
|
28
|
+
status: 'loading';
|
|
29
|
+
} | null;
|
|
30
|
+
export declare function registerIconCollection(prefix: string, source: IconCollectionSource): void;
|
|
31
|
+
export declare function registerIconCollection(collection: IconifyCollection): void;
|
|
32
|
+
export declare function setDefaultIconCollection(prefix: string | undefined): void;
|
|
33
|
+
export declare function hasIconCollection(prefix: string): boolean;
|
|
34
|
+
export declare function loadIconCollection(prefix: string): Promise<void>;
|
|
35
|
+
export declare function splitIconName(name: string): {
|
|
36
|
+
prefix: string;
|
|
37
|
+
icon: string;
|
|
38
|
+
} | null;
|
|
39
|
+
export declare function lookupCollectionIcon(name: string): CollectionLookup;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { shallowReactive } from "vue";
|
|
2
|
+
const sources = /* @__PURE__ */ new Map();
|
|
3
|
+
const loaded = shallowReactive(/* @__PURE__ */ new Map());
|
|
4
|
+
const pending = /* @__PURE__ */ new Map();
|
|
5
|
+
const defaults = shallowReactive({ collection: void 0 });
|
|
6
|
+
export function registerIconCollection(input, source) {
|
|
7
|
+
if (typeof input !== "string") {
|
|
8
|
+
sources.set(input.prefix, input);
|
|
9
|
+
loaded.set(input.prefix, input);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
sources.set(input, source);
|
|
13
|
+
if (typeof source === "object") loaded.set(input, source);
|
|
14
|
+
}
|
|
15
|
+
export function setDefaultIconCollection(prefix) {
|
|
16
|
+
defaults.collection = prefix;
|
|
17
|
+
}
|
|
18
|
+
export function hasIconCollection(prefix) {
|
|
19
|
+
return sources.has(prefix);
|
|
20
|
+
}
|
|
21
|
+
export function loadIconCollection(prefix) {
|
|
22
|
+
if (loaded.has(prefix)) return Promise.resolve();
|
|
23
|
+
const existing = pending.get(prefix);
|
|
24
|
+
if (existing) return existing;
|
|
25
|
+
const source = sources.get(prefix);
|
|
26
|
+
if (!source) return Promise.resolve();
|
|
27
|
+
const task = (async () => {
|
|
28
|
+
const result = typeof source === "function" ? await source() : source;
|
|
29
|
+
const collection = "default" in result ? result.default : result;
|
|
30
|
+
loaded.set(prefix, collection);
|
|
31
|
+
})().finally(() => pending.delete(prefix));
|
|
32
|
+
pending.set(prefix, task);
|
|
33
|
+
return task;
|
|
34
|
+
}
|
|
35
|
+
function findIcon(collection, name, depth = 0) {
|
|
36
|
+
const icon = collection.icons[name];
|
|
37
|
+
if (icon) return icon;
|
|
38
|
+
const alias = collection.aliases?.[name];
|
|
39
|
+
if (!alias || depth > 4) return void 0;
|
|
40
|
+
return findIcon(collection, alias.parent, depth + 1);
|
|
41
|
+
}
|
|
42
|
+
export function splitIconName(name) {
|
|
43
|
+
const index = name.indexOf(":");
|
|
44
|
+
if (index > 0) return { prefix: name.slice(0, index), icon: name.slice(index + 1) };
|
|
45
|
+
if (defaults.collection) return { prefix: defaults.collection, icon: name };
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
export function lookupCollectionIcon(name) {
|
|
49
|
+
const parts = splitIconName(name);
|
|
50
|
+
if (!parts || !sources.has(parts.prefix)) return null;
|
|
51
|
+
const collection = loaded.get(parts.prefix);
|
|
52
|
+
if (!collection) {
|
|
53
|
+
void loadIconCollection(parts.prefix);
|
|
54
|
+
return { status: "loading" };
|
|
55
|
+
}
|
|
56
|
+
const icon = findIcon(collection, parts.icon);
|
|
57
|
+
if (!icon) return null;
|
|
58
|
+
const width = icon.width ?? collection.width ?? 16;
|
|
59
|
+
const height = icon.height ?? collection.height ?? 16;
|
|
60
|
+
return {
|
|
61
|
+
status: "ready",
|
|
62
|
+
svg: {
|
|
63
|
+
attrs: { viewBox: `${icon.left ?? 0} ${icon.top ?? 0} ${width} ${height}` },
|
|
64
|
+
inner: icon.body
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export * from './components/overlays';
|
|
|
7
7
|
export * from './components/templates';
|
|
8
8
|
export * from './composables';
|
|
9
9
|
export { builtinIcons } from './icons/builtin';
|
|
10
|
+
export { builtinLocales, defineLocale, en, it } from './locale';
|
|
11
|
+
export type { DefineLocaleOptions } from './locale';
|
|
12
|
+
export type * from './locale/types';
|
|
10
13
|
export type { BuiltinIconName } from './icons/builtin';
|
|
11
|
-
export { FIELD_KEY, FORM_KEY, ICONS_KEY, LINK_KEY, PRESET_KEY, THEME_KEY } from './internal/keys';
|
|
14
|
+
export { FIELD_KEY, FORM_KEY, ICON_USAGE_KEY, ICONS_KEY, LINK_KEY, LOCALE_KEY, PRESET_KEY, THEME_KEY, } from './internal/keys';
|
|
12
15
|
export type * from './types/dom';
|
package/dist/index.mjs
CHANGED
|
@@ -7,4 +7,14 @@ export * from "./components/overlays/index.mjs";
|
|
|
7
7
|
export * from "./components/templates/index.mjs";
|
|
8
8
|
export * from "./composables/index.mjs";
|
|
9
9
|
export { builtinIcons } from "./icons/builtin.mjs";
|
|
10
|
-
export {
|
|
10
|
+
export { builtinLocales, defineLocale, en, it } from "./locale/index.mjs";
|
|
11
|
+
export {
|
|
12
|
+
FIELD_KEY,
|
|
13
|
+
FORM_KEY,
|
|
14
|
+
ICON_USAGE_KEY,
|
|
15
|
+
ICONS_KEY,
|
|
16
|
+
LINK_KEY,
|
|
17
|
+
LOCALE_KEY,
|
|
18
|
+
PRESET_KEY,
|
|
19
|
+
THEME_KEY
|
|
20
|
+
} from "./internal/keys.mjs";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:class="{ 'is-done': phase === 'done' }"
|
|
9
9
|
:style="{ '--k-loading-progress': String(progress) }"
|
|
10
10
|
role="progressbar"
|
|
11
|
-
:aria-label="
|
|
11
|
+
:aria-label="barLabel"
|
|
12
12
|
:aria-hidden="phase === 'idle' ? 'true' : void 0"
|
|
13
13
|
>
|
|
14
14
|
<span class="k-loading-bar-fill" />
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
<script setup>
|
|
32
32
|
import { computed, nextTick, onBeforeUnmount, ref, useTemplateRef, watch } from "vue";
|
|
33
33
|
import Spinner from "../../components/core/Spinner.vue";
|
|
34
|
+
import { useLocale } from "../../composables/useLocale";
|
|
34
35
|
import { isPopoverOpen, supportsPopover } from "../floating/support";
|
|
35
36
|
import { modalStack } from "../overlays/dialog";
|
|
36
37
|
import { useHostClaim } from "../overlays/host";
|
|
@@ -38,8 +39,10 @@ import { loadingTasks } from "./loading";
|
|
|
38
39
|
const props = defineProps({
|
|
39
40
|
bar: { type: Boolean, required: false, default: true },
|
|
40
41
|
delay: { type: Number, required: false, default: 150 },
|
|
41
|
-
label: { type: String, required: false
|
|
42
|
+
label: { type: String, required: false }
|
|
42
43
|
});
|
|
44
|
+
const { t } = useLocale();
|
|
45
|
+
const barLabel = computed(() => props.label ?? t("common.loading"));
|
|
43
46
|
const active = useHostClaim("loading");
|
|
44
47
|
const barRef = useTemplateRef("barRef");
|
|
45
48
|
const screenRef = useTemplateRef("screenRef");
|
|
@@ -48,7 +51,7 @@ const progress = ref(0);
|
|
|
48
51
|
const screenOpen = ref(false);
|
|
49
52
|
const busy = computed(() => loadingTasks.length > 0);
|
|
50
53
|
const blockingTask = computed(() => loadingTasks.find((task) => task.blocking));
|
|
51
|
-
const screenLabel = computed(() => blockingTask.value?.label ??
|
|
54
|
+
const screenLabel = computed(() => blockingTask.value?.label ?? barLabel.value);
|
|
52
55
|
let showTimer;
|
|
53
56
|
let trickleTimer;
|
|
54
57
|
let hideTimer;
|
|
@@ -4,7 +4,6 @@ type __VLS_Props = {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
-
label: string;
|
|
8
7
|
bar: boolean;
|
|
9
8
|
delay: number;
|
|
10
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -14,7 +14,7 @@ export function matchesAccept(file, accept) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
17
|
-
export function formatBytes(bytes, locale
|
|
17
|
+
export function formatBytes(bytes, locale) {
|
|
18
18
|
let value = bytes;
|
|
19
19
|
let unit = 0;
|
|
20
20
|
while (value >= 1024 && unit < units.length - 1) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface StandardSchemaIssue {
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly path?: ReadonlyArray<PropertyKey | {
|
|
4
|
+
readonly key: PropertyKey;
|
|
5
|
+
}> | undefined;
|
|
6
|
+
}
|
|
7
|
+
export type StandardSchemaResult<Output> = {
|
|
8
|
+
readonly value: Output;
|
|
9
|
+
readonly issues?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
readonly issues: ReadonlyArray<StandardSchemaIssue>;
|
|
12
|
+
};
|
|
13
|
+
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
14
|
+
readonly '~standard': {
|
|
15
|
+
readonly version: 1;
|
|
16
|
+
readonly vendor: string;
|
|
17
|
+
readonly validate: (value: unknown) => StandardSchemaResult<Output> | Promise<StandardSchemaResult<Output>>;
|
|
18
|
+
readonly types?: {
|
|
19
|
+
readonly input: Input;
|
|
20
|
+
readonly output: Output;
|
|
21
|
+
} | undefined;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare function isStandardSchema(value: unknown): value is StandardSchemaV1;
|
|
25
|
+
export declare function runStandardSchema(schema: StandardSchemaV1, value: unknown): Promise<readonly StandardSchemaIssue[]>;
|
|
26
|
+
export declare function issuesByField(issues: ReadonlyArray<StandardSchemaIssue>): Record<string, string>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function isStandardSchema(value) {
|
|
2
|
+
return typeof value === "object" && value !== null && "~standard" in value;
|
|
3
|
+
}
|
|
4
|
+
function issueField(issue) {
|
|
5
|
+
const segment = issue.path?.[0];
|
|
6
|
+
if (segment === void 0) return void 0;
|
|
7
|
+
const key = typeof segment === "object" ? segment.key : segment;
|
|
8
|
+
return typeof key === "symbol" ? void 0 : String(key);
|
|
9
|
+
}
|
|
10
|
+
export async function runStandardSchema(schema, value) {
|
|
11
|
+
const result = await schema["~standard"].validate(value);
|
|
12
|
+
return result.issues ?? [];
|
|
13
|
+
}
|
|
14
|
+
export function issuesByField(issues) {
|
|
15
|
+
const errors = {};
|
|
16
|
+
for (const issue of issues) {
|
|
17
|
+
const field = issueField(issue);
|
|
18
|
+
if (field !== void 0 && !(field in errors)) errors[field] = issue.message;
|
|
19
|
+
}
|
|
20
|
+
return errors;
|
|
21
|
+
}
|
package/dist/internal/keys.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import type { Component, InjectionKey, Ref } from 'vue';
|
|
1
|
+
import type { Component, ComputedRef, InjectionKey, Ref } from 'vue';
|
|
2
2
|
import type { FieldContext } from '../composables/useField';
|
|
3
3
|
import type { FormContext } from '../composables/useForm';
|
|
4
4
|
import type { IconRegistry } from '../composables/useIcons';
|
|
5
5
|
import type { ThemePreference } from '../composables/useTheme';
|
|
6
|
+
import type { KLocale } from '../locale/types';
|
|
6
7
|
import type { ThemePreset } from './core/preset-data';
|
|
7
8
|
export declare const ICONS_KEY: InjectionKey<IconRegistry>;
|
|
9
|
+
export declare const ICON_USAGE_KEY: InjectionKey<Set<string>>;
|
|
8
10
|
export declare const THEME_KEY: InjectionKey<Ref<ThemePreference>>;
|
|
9
11
|
export declare const PRESET_KEY: InjectionKey<Ref<ThemePreset>>;
|
|
10
12
|
export declare const LINK_KEY: InjectionKey<Component>;
|
|
11
13
|
export declare const FIELD_KEY: InjectionKey<FieldContext>;
|
|
12
14
|
export declare const ROOT_KEY: InjectionKey<true>;
|
|
13
15
|
export declare const FORM_KEY: InjectionKey<FormContext>;
|
|
16
|
+
export declare const LOCALE_KEY: InjectionKey<ComputedRef<KLocale>>;
|