legato-ui 0.0.0-stage → 1.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/CHANGELOG.md +399 -0
- package/LICENSE +21 -0
- package/README.md +110 -2
- package/bin/gavia-theme.mjs +17 -0
- package/bin/theme-cli.mjs +75 -0
- package/dist/chunks/BovMd2iJ.js +1082 -0
- package/dist/chunks/CC86JZu0.js +45 -0
- package/dist/chunks/Cyf5vHOa.js +21 -0
- package/dist/chunks/Dq46i43b.js +11 -0
- package/dist/chunks/KbPin6nM.js +602 -0
- package/dist/chunks/U27hmRqd.js +6548 -0
- package/dist/components/WlAccordion.vue.d.ts +42 -0
- package/dist/components/WlAlert.vue.d.ts +75 -0
- package/dist/components/WlAutocomplete.vue.d.ts +118 -0
- package/dist/components/WlAvatar.vue.d.ts +64 -0
- package/dist/components/WlBadge.vue.d.ts +63 -0
- package/dist/components/WlBreadcrumbs.vue.d.ts +69 -0
- package/dist/components/WlButton.vue.d.ts +109 -0
- package/dist/components/WlButtonGroup.vue.d.ts +44 -0
- package/dist/components/WlCalendar.vue.d.ts +63 -0
- package/dist/components/WlCard.vue.d.ts +66 -0
- package/dist/components/WlCheckbox.vue.d.ts +63 -0
- package/dist/components/WlCheckboxGroup.vue.d.ts +98 -0
- package/dist/components/WlChip.vue.d.ts +99 -0
- package/dist/components/WlColorPicker.vue.d.ts +98 -0
- package/dist/components/WlCommandPalette.vue.d.ts +137 -0
- package/dist/components/WlConfirmDialog.vue.d.ts +55 -0
- package/dist/components/WlContextMenu.vue.d.ts +65 -0
- package/dist/components/WlDatePicker.vue.d.ts +101 -0
- package/dist/components/WlDialog.vue.d.ts +124 -0
- package/dist/components/WlDivider.vue.d.ts +28 -0
- package/dist/components/WlDrawer.vue.d.ts +131 -0
- package/dist/components/WlEmpty.vue.d.ts +44 -0
- package/dist/components/WlField.vue.d.ts +72 -0
- package/dist/components/WlFilePicker.vue.d.ts +96 -0
- package/dist/components/WlFileUpload.vue.d.ts +109 -0
- package/dist/components/WlFilterBar.vue.d.ts +142 -0
- package/dist/components/WlIcon.vue.d.ts +49 -0
- package/dist/components/WlIconButton.vue.d.ts +103 -0
- package/dist/components/WlInput.vue.d.ts +106 -0
- package/dist/components/WlLink.vue.d.ts +79 -0
- package/dist/components/WlMenu.vue.d.ts +61 -0
- package/dist/components/WlMultiSelect.vue.d.ts +137 -0
- package/dist/components/WlNavItem.vue.d.ts +105 -0
- package/dist/components/WlNumberInput.vue.d.ts +149 -0
- package/dist/components/WlPageHeader.vue.d.ts +100 -0
- package/dist/components/WlPagination.vue.d.ts +75 -0
- package/dist/components/WlPasswordInput.vue.d.ts +90 -0
- package/dist/components/WlPill.vue.d.ts +58 -0
- package/dist/components/WlPopover.vue.d.ts +110 -0
- package/dist/components/WlProgress.vue.d.ts +77 -0
- package/dist/components/WlRadio.vue.d.ts +60 -0
- package/dist/components/WlRadioGroup.vue.d.ts +97 -0
- package/dist/components/WlSegmented.vue.d.ts +65 -0
- package/dist/components/WlSelect.vue.d.ts +114 -0
- package/dist/components/WlSidebar.vue.d.ts +139 -0
- package/dist/components/WlSkeleton.vue.d.ts +53 -0
- package/dist/components/WlSlider.vue.d.ts +132 -0
- package/dist/components/WlSpinner.vue.d.ts +48 -0
- package/dist/components/WlStatCard.vue.d.ts +67 -0
- package/dist/components/WlSteps.vue.d.ts +68 -0
- package/dist/components/WlSwitch.vue.d.ts +104 -0
- package/dist/components/WlTable.vue.d.ts +82 -0
- package/dist/components/WlTabs.vue.d.ts +60 -0
- package/dist/components/WlTag.vue.d.ts +97 -0
- package/dist/components/WlTagsInput.vue.d.ts +148 -0
- package/dist/components/WlTextarea.vue.d.ts +100 -0
- package/dist/components/WlTimePicker.vue.d.ts +98 -0
- package/dist/components/WlToast.vue.d.ts +71 -0
- package/dist/components/WlToolbar.vue.d.ts +88 -0
- package/dist/components/WlTooltip.vue.d.ts +102 -0
- package/dist/components/choice-group-contracts.d.ts +70 -0
- package/dist/components/generic-contracts.d.ts +148 -0
- package/dist/components/index.d.ts +60 -0
- package/dist/components/internal/MenuPanel.vue.d.ts +38 -0
- package/dist/components/native-contracts.d.ts +204 -0
- package/dist/composables/index.d.ts +22 -0
- package/dist/composables/useNativeFilePicker.d.ts +8 -0
- package/dist/composables/useWlAnnouncer.d.ts +4 -0
- package/dist/composables/useWlClipboard.d.ts +7 -0
- package/dist/composables/useWlConfirm.d.ts +29 -0
- package/dist/composables/useWlControllable.d.ts +17 -0
- package/dist/composables/useWlHotkey.d.ts +8 -0
- package/dist/composables/useWlMediaQuery.d.ts +7 -0
- package/dist/composables/useWlOverlay.d.ts +13 -0
- package/dist/composables/useWlResultsAnnouncement.d.ts +7 -0
- package/dist/composables/useWlTheme.d.ts +30 -0
- package/dist/composables/useWlToast.d.ts +48 -0
- package/dist/composables/useWlTypeahead.d.ts +13 -0
- package/dist/composables.js +118 -0
- package/dist/config.d.ts +41 -0
- package/dist/design-system/index.d.ts +8 -0
- package/dist/design-system/tokens.generated.d.ts +5899 -0
- package/dist/design-system/types.d.ts +34 -0
- package/dist/design-tokens.json +6684 -0
- package/dist/directives/tooltip.d.ts +10 -0
- package/dist/field-types.d.ts +17 -0
- package/dist/iconNames.d.ts +5 -0
- package/dist/icons.generated.d.ts +3 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +14122 -0
- package/dist/input-expose-types.d.ts +5 -0
- package/dist/locale-types.d.ts +153 -0
- package/dist/locale.d.ts +17 -0
- package/dist/manifest/actions.d.ts +1 -0
- package/dist/manifest/composites.d.ts +1 -0
- package/dist/manifest/containers.d.ts +1 -0
- package/dist/manifest/data.d.ts +1 -0
- package/dist/manifest/feedback.d.ts +1 -0
- package/dist/manifest/index.d.ts +17 -0
- package/dist/manifest/inputs.d.ts +1 -0
- package/dist/manifest/misc.d.ts +1 -0
- package/dist/manifest/navigation.d.ts +1 -0
- package/dist/manifest/types.d.ts +50 -0
- package/dist/manifest/values.d.ts +17 -0
- package/dist/manifest.json +6323 -0
- package/dist/model-types.d.ts +12 -0
- package/dist/native-types.d.ts +36 -0
- package/dist/navigation-types.d.ts +118 -0
- package/dist/overlay-types.d.ts +36 -0
- package/dist/picker-types.d.ts +34 -0
- package/dist/pt-types.d.ts +557 -0
- package/dist/selection-types.d.ts +33 -0
- package/dist/services/confirmation.d.ts +31 -0
- package/dist/services/toast.d.ts +53 -0
- package/dist/table-types.d.ts +70 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/palette.d.ts +43 -0
- package/dist/theme/types.d.ts +34 -0
- package/dist/theme-generator.js +198 -0
- package/dist/theme.d.ts +12 -0
- package/dist/types.d.ts +73 -0
- package/dist/utils/accessibility.d.ts +2 -0
- package/dist/utils/anchoredOverlay.d.ts +28 -0
- package/dist/utils/appCleanup.d.ts +3 -0
- package/dist/utils/attrs.d.ts +2 -0
- package/dist/utils/bodyScrollLock.d.ts +5 -0
- package/dist/utils/buttonGroup.d.ts +10 -0
- package/dist/utils/color.d.ts +11 -0
- package/dist/utils/colorPicker.d.ts +9 -0
- package/dist/utils/date.d.ts +8 -0
- package/dist/utils/dateInputFormat.d.ts +8 -0
- package/dist/utils/development.d.ts +1 -0
- package/dist/utils/format.d.ts +28 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/initials.d.ts +1 -0
- package/dist/utils/inputAttrs.d.ts +14 -0
- package/dist/utils/inputCounter.d.ts +6 -0
- package/dist/utils/menu.d.ts +10 -0
- package/dist/utils/merge.d.ts +8 -0
- package/dist/utils/number.d.ts +6 -0
- package/dist/utils/optionGroups.d.ts +13 -0
- package/dist/utils/options.d.ts +21 -0
- package/dist/utils/overlayLifecycle.d.ts +24 -0
- package/dist/utils/overlayProps.d.ts +6 -0
- package/dist/utils/overlayStack.d.ts +23 -0
- package/dist/utils/overlayTransition.d.ts +4 -0
- package/dist/utils/parseNumber.d.ts +2 -0
- package/dist/utils/rovingFocus.d.ts +13 -0
- package/dist/utils/templateTeleport.vue.d.ts +11 -0
- package/dist/utils/templateTransition.vue.d.ts +3 -0
- package/dist/utils/timeInputFormat.d.ts +7 -0
- package/dist/utils/useWlId.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/fonts/gavia/FONTLOG.txt +17 -0
- package/fonts/gavia/Gavia-Bold.woff2 +0 -0
- package/fonts/gavia/Gavia-BoldItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-Light.woff2 +0 -0
- package/fonts/gavia/Gavia-LightItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-Medium.woff2 +0 -0
- package/fonts/gavia/Gavia-MediumItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-Regular.woff2 +0 -0
- package/fonts/gavia/Gavia-RegularItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-SemiBold.woff2 +0 -0
- package/fonts/gavia/Gavia-SemiBoldItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-Thin.woff2 +0 -0
- package/fonts/gavia/Gavia-ThinItalic.woff2 +0 -0
- package/fonts/gavia/Gavia-Variable-Core.woff2 +0 -0
- package/fonts/gavia/Gavia-Variable-Italic-Core.woff2 +0 -0
- package/fonts/gavia/Gavia-Variable-Italic.woff2 +0 -0
- package/fonts/gavia/Gavia-Variable.woff2 +0 -0
- package/fonts/gavia/OFL.txt +94 -0
- package/fonts/gavia/Onest-OFL.txt +93 -0
- package/fonts/gavia/VARIABLE-FONTLOG.txt +11 -0
- package/fonts/gavia/manifest.json +225 -0
- package/package.json +108 -3
- package/styles/base.css +589 -0
- package/styles/components/actions-and-pagination.css +12 -0
- package/styles/components/controls.css +72 -0
- package/styles/components/core.css +4070 -0
- package/styles/components/menu.css +33 -0
- package/styles/components/pickers.css +46 -0
- package/styles/fonts/gavia.css +307 -0
- package/styles/fonts/legato.css +167 -0
- package/styles/primitives.css +37 -0
- package/styles/reset.css +93 -0
- package/themes/gavia-dark.css +549 -0
- package/themes/gavia.css +549 -0
- package/themes/graphite.css +549 -0
- package/themes/legato-dark.css +549 -0
- package/themes/legato.css +549 -0
- package/themes/newspaper.css +549 -0
- package/themes/white.css +551 -0
|
@@ -0,0 +1,1082 @@
|
|
|
1
|
+
import { i as e, t, w as n } from "./KbPin6nM.js";
|
|
2
|
+
import { computed as r, effectScope as i, getCurrentInstance as a, inject as o, isReactive as s, nextTick as c, normalizeClass as l, onBeforeUnmount as u, onMounted as d, onScopeDispose as f, ref as p, shallowReactive as m, shallowRef as h, toRaw as g, watch as _, watchEffect as v } from "vue";
|
|
3
|
+
//#region src/composables/useWlControllable.ts
|
|
4
|
+
function y(e) {
|
|
5
|
+
let t = h(e.defaultValue);
|
|
6
|
+
return r({
|
|
7
|
+
get: () => e.value() === void 0 ? t.value : e.value(),
|
|
8
|
+
set: (n) => {
|
|
9
|
+
e.value() === void 0 && (t.value = n), e.onChange?.(n);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function b(e = {}) {
|
|
14
|
+
let t = y({
|
|
15
|
+
value: e.value ?? (() => void 0),
|
|
16
|
+
defaultValue: e.defaultValue ?? !1,
|
|
17
|
+
onChange: e.onChange
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
isOpen: t,
|
|
21
|
+
open: () => {
|
|
22
|
+
t.value = !0;
|
|
23
|
+
},
|
|
24
|
+
close: () => {
|
|
25
|
+
t.value = !1;
|
|
26
|
+
},
|
|
27
|
+
toggle: () => {
|
|
28
|
+
t.value = !t.value;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/theme.ts
|
|
34
|
+
var x = (...e) => e.filter(Boolean).join(" ");
|
|
35
|
+
function S(e = {}) {
|
|
36
|
+
return t({
|
|
37
|
+
checkbox: {
|
|
38
|
+
input: { class: "wl-check-input" },
|
|
39
|
+
box: (e) => ({ class: x("wl-checkbox__box", e.context.checked && "is-checked", e.context.indeterminate && "is-indeterminate") }),
|
|
40
|
+
icon: { class: "wl-checkbox__icon" }
|
|
41
|
+
},
|
|
42
|
+
radio: {
|
|
43
|
+
input: { class: "wl-check-input" },
|
|
44
|
+
box: (e) => ({ class: x("wl-radio__box", e.context.checked && "is-checked") }),
|
|
45
|
+
icon: { class: "wl-radio__icon" }
|
|
46
|
+
},
|
|
47
|
+
switch: {
|
|
48
|
+
input: { class: "wl-check-input" },
|
|
49
|
+
slider: (e) => ({ class: x("wl-switch__slider", e.context.checked && "is-checked") }),
|
|
50
|
+
handle: { class: "wl-switch__handle" }
|
|
51
|
+
},
|
|
52
|
+
select: {
|
|
53
|
+
label: { class: "wl-select__label" },
|
|
54
|
+
clearIcon: { class: "wl-select__clear" },
|
|
55
|
+
dropdown: { class: "wl-select__dropdown" },
|
|
56
|
+
dropdownIcon: { class: "wl-select__dropdown-icon" },
|
|
57
|
+
overlay: { class: "wl-overlay wl-select-overlay" },
|
|
58
|
+
listContainer: { class: "wl-select__list-container" },
|
|
59
|
+
list: { class: "wl-select__list" },
|
|
60
|
+
option: { class: "wl-select__option" },
|
|
61
|
+
optionLabel: { class: "wl-select__option-label" },
|
|
62
|
+
emptyMessage: { class: "wl-select__empty" }
|
|
63
|
+
},
|
|
64
|
+
multiselect: {
|
|
65
|
+
labelContainer: { class: "wl-multiselect__label-container" },
|
|
66
|
+
label: { class: "wl-multiselect__label" },
|
|
67
|
+
clearIcon: { class: "wl-multiselect__clear" },
|
|
68
|
+
chipItem: { class: "wl-multiselect__chip-item" },
|
|
69
|
+
chip: {
|
|
70
|
+
root: { class: "wl-multiselect__chip" },
|
|
71
|
+
label: { class: "wl-multiselect__chip-label" },
|
|
72
|
+
removeIcon: { class: "wl-multiselect__chip-remove" }
|
|
73
|
+
},
|
|
74
|
+
dropdown: { class: "wl-multiselect__dropdown" },
|
|
75
|
+
dropdownIcon: { class: "wl-multiselect__dropdown-icon" },
|
|
76
|
+
overlay: { class: "wl-overlay wl-multiselect-overlay" },
|
|
77
|
+
header: { class: "wl-multiselect__header" },
|
|
78
|
+
filter: { root: { class: "wl-input wl-input--sm wl-multiselect__filter" } },
|
|
79
|
+
filterIcon: { class: "wl-multiselect__filter-icon" },
|
|
80
|
+
listContainer: { class: "wl-select__list-container" },
|
|
81
|
+
list: { class: "wl-select__list" },
|
|
82
|
+
option: { class: "wl-select__option" },
|
|
83
|
+
optionLabel: { class: "wl-select__option-label" },
|
|
84
|
+
emptyMessage: { class: "wl-select__empty" }
|
|
85
|
+
},
|
|
86
|
+
autocomplete: {
|
|
87
|
+
inputMultiple: { class: "wl-autocomplete__multiple" },
|
|
88
|
+
chipItem: { class: "wl-multiselect__chip-item" },
|
|
89
|
+
chip: {
|
|
90
|
+
root: { class: "wl-multiselect__chip" },
|
|
91
|
+
label: { class: "wl-multiselect__chip-label" },
|
|
92
|
+
removeIcon: { class: "wl-multiselect__chip-remove" }
|
|
93
|
+
},
|
|
94
|
+
input: { class: "wl-autocomplete__inner-input" },
|
|
95
|
+
inputChip: { class: "wl-autocomplete__inner-input" },
|
|
96
|
+
dropdown: { class: "wl-btn wl-autocomplete__dropdown" },
|
|
97
|
+
dropdownIcon: { class: "wl-autocomplete__dropdown-icon" },
|
|
98
|
+
overlay: { class: "wl-overlay wl-autocomplete-overlay" },
|
|
99
|
+
listContainer: { class: "wl-select__list-container" },
|
|
100
|
+
list: { class: "wl-select__list" },
|
|
101
|
+
option: { class: "wl-select__option" },
|
|
102
|
+
emptyMessage: { class: "wl-select__empty" }
|
|
103
|
+
},
|
|
104
|
+
card: {
|
|
105
|
+
header: { class: "wl-card__header" },
|
|
106
|
+
body: { class: "wl-card__body" },
|
|
107
|
+
caption: { class: "wl-card__caption" },
|
|
108
|
+
title: { class: "wl-card__title" },
|
|
109
|
+
subtitle: { class: "wl-card__subtitle" },
|
|
110
|
+
content: { class: "wl-card__content" },
|
|
111
|
+
footer: { class: "wl-card__footer" }
|
|
112
|
+
},
|
|
113
|
+
dialog: {
|
|
114
|
+
mask: { class: "wl-mask wl-dialog-mask" },
|
|
115
|
+
header: { class: "wl-dialog__header" },
|
|
116
|
+
title: { class: "wl-dialog__title" },
|
|
117
|
+
headerActions: { class: "wl-dialog__actions" },
|
|
118
|
+
content: { class: "wl-dialog__content" },
|
|
119
|
+
footer: { class: "wl-dialog__footer" },
|
|
120
|
+
closeButton: {
|
|
121
|
+
root: { class: "wl-overlay-close" },
|
|
122
|
+
icon: { class: "wl-overlay-close__icon" }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
confirmdialog: {
|
|
126
|
+
mask: { class: "wl-mask wl-dialog-mask" },
|
|
127
|
+
header: { class: "wl-dialog__header" },
|
|
128
|
+
title: { class: "wl-dialog__title" },
|
|
129
|
+
content: { class: "wl-dialog__content wl-confirm__content" },
|
|
130
|
+
icon: { class: "wl-confirm__icon" },
|
|
131
|
+
message: { class: "wl-confirm__message" },
|
|
132
|
+
footer: { class: "wl-dialog__footer" }
|
|
133
|
+
},
|
|
134
|
+
drawer: {
|
|
135
|
+
mask: { class: "wl-mask wl-drawer-mask" },
|
|
136
|
+
header: { class: "wl-drawer__header" },
|
|
137
|
+
title: { class: "wl-drawer__title" },
|
|
138
|
+
content: { class: "wl-drawer__content" },
|
|
139
|
+
footer: { class: "wl-drawer__footer" },
|
|
140
|
+
closeButton: {
|
|
141
|
+
root: { class: "wl-overlay-close" },
|
|
142
|
+
icon: { class: "wl-overlay-close__icon" }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
progress: {
|
|
146
|
+
value: { class: "wl-progress__value" },
|
|
147
|
+
label: { class: "wl-progress__label" }
|
|
148
|
+
},
|
|
149
|
+
avatar: {
|
|
150
|
+
label: { class: "wl-avatar__label" },
|
|
151
|
+
image: { class: "wl-avatar__img" }
|
|
152
|
+
},
|
|
153
|
+
tag: { label: { class: "wl-tag__label" } },
|
|
154
|
+
divider: { content: { class: "wl-divider__content" } },
|
|
155
|
+
tabs: {
|
|
156
|
+
content: { class: "wl-tabs__content" },
|
|
157
|
+
tabList: { class: "wl-tabs__list" },
|
|
158
|
+
activeBar: { class: "wl-tabs__active-bar" },
|
|
159
|
+
panels: { root: { class: "wl-tabs__panels" } },
|
|
160
|
+
panel: { root: { class: "wl-tabs__panel" } }
|
|
161
|
+
},
|
|
162
|
+
tooltip: {
|
|
163
|
+
root: { class: "wl-tooltip" },
|
|
164
|
+
text: { class: "wl-tooltip__text" },
|
|
165
|
+
arrow: { class: "wl-tooltip__arrow" }
|
|
166
|
+
},
|
|
167
|
+
segmented: { item: {
|
|
168
|
+
root: (e) => ({ class: x("wl-segmented__item", e.context.active && "is-active") }),
|
|
169
|
+
content: { class: "wl-segmented__item-content" }
|
|
170
|
+
} },
|
|
171
|
+
breadcrumbs: {
|
|
172
|
+
list: { class: "wl-breadcrumbs__list" },
|
|
173
|
+
item: { class: "wl-breadcrumbs__item" },
|
|
174
|
+
separator: { class: "wl-breadcrumbs__separator" }
|
|
175
|
+
},
|
|
176
|
+
menu: {
|
|
177
|
+
list: { class: "wl-menu__list" },
|
|
178
|
+
submenuLabel: { class: "wl-menu__head" },
|
|
179
|
+
item: { class: "wl-menu__item" },
|
|
180
|
+
itemContent: { class: "wl-menu__item-content" },
|
|
181
|
+
itemLink: { class: "wl-menu__link" },
|
|
182
|
+
separator: { class: "wl-menu__sep" }
|
|
183
|
+
},
|
|
184
|
+
popover: { content: { class: "wl-popover__content" } },
|
|
185
|
+
toast: {
|
|
186
|
+
message: { class: "wl-toast__message" },
|
|
187
|
+
messageContent: { class: "wl-toast__content" },
|
|
188
|
+
messageIcon: { class: "wl-toast__icon" },
|
|
189
|
+
messageText: { class: "wl-toast__text" },
|
|
190
|
+
summary: { class: "wl-toast__summary" },
|
|
191
|
+
detail: { class: "wl-toast__detail" },
|
|
192
|
+
closeButton: { class: "wl-toast__close" },
|
|
193
|
+
closeIcon: { class: "wl-toast__close-icon" }
|
|
194
|
+
},
|
|
195
|
+
table: {
|
|
196
|
+
table: { class: "wl-table__table" },
|
|
197
|
+
thead: { class: "wl-table__head" },
|
|
198
|
+
tbody: { class: "wl-table__body" },
|
|
199
|
+
bodyRow: { class: "wl-table__row" },
|
|
200
|
+
emptyMessage: { class: "wl-table__empty" },
|
|
201
|
+
emptyMessageCell: { class: "wl-table__empty-cell" },
|
|
202
|
+
mask: { class: "wl-table__mask" },
|
|
203
|
+
loadingIcon: { class: "wl-table__loading" }
|
|
204
|
+
},
|
|
205
|
+
datepicker: {
|
|
206
|
+
startLabel: { class: "wl-dp__endpoint-label" },
|
|
207
|
+
endLabel: { class: "wl-dp__endpoint-label" },
|
|
208
|
+
endInput: { class: "wl-input wl-dp__input" },
|
|
209
|
+
rangeHint: { class: "wl-dp__range-hint" },
|
|
210
|
+
dropdown: { class: "wl-dp__trigger" },
|
|
211
|
+
dropdownIcon: { class: "wl-dp__trigger-icon" },
|
|
212
|
+
panel: { class: "wl-overlay wl-dp__panel" },
|
|
213
|
+
calendarContainer: { class: "wl-dp__container" },
|
|
214
|
+
calendar: { class: "wl-dp__calendar" },
|
|
215
|
+
header: { class: "wl-dp__header" },
|
|
216
|
+
title: { class: "wl-dp__title" },
|
|
217
|
+
selectMonth: { class: "wl-dp__view-btn" },
|
|
218
|
+
selectYear: { class: "wl-dp__view-btn" },
|
|
219
|
+
prevButton: {
|
|
220
|
+
root: { class: "wl-dp__nav" },
|
|
221
|
+
icon: { class: "wl-dp__nav-icon" }
|
|
222
|
+
},
|
|
223
|
+
nextButton: {
|
|
224
|
+
root: { class: "wl-dp__nav" },
|
|
225
|
+
icon: { class: "wl-dp__nav-icon" }
|
|
226
|
+
},
|
|
227
|
+
dayView: { class: "wl-dp__table" },
|
|
228
|
+
monthView: { class: "wl-dp__choices" },
|
|
229
|
+
month: { class: "wl-dp__choice" },
|
|
230
|
+
yearView: { class: "wl-dp__choices" },
|
|
231
|
+
year: { class: "wl-dp__choice" },
|
|
232
|
+
tableHeaderCell: { class: "wl-dp__wd-cell" },
|
|
233
|
+
weekDay: { class: "wl-dp__weekday" },
|
|
234
|
+
dayCell: { class: "wl-dp__day-cell" },
|
|
235
|
+
day: (e) => ({ class: x("wl-dp__day", e.context.selected && "is-selected", e.context.inRange && "is-in-range", e.context.today && "is-today", e.context.otherMonth && "is-muted", e.context.disabled && "is-disabled") })
|
|
236
|
+
}
|
|
237
|
+
}, e);
|
|
238
|
+
}
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/config.ts
|
|
241
|
+
var C = Symbol("wl-config"), w = /* @__PURE__ */ S(), T = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), te = Object.freeze({}), D = /* @__PURE__ */ new Map();
|
|
242
|
+
function O(e = {}) {
|
|
243
|
+
return s(e) ? e : m({ ...e });
|
|
244
|
+
}
|
|
245
|
+
function k() {
|
|
246
|
+
let e = o(C, void 0);
|
|
247
|
+
if (e) return e;
|
|
248
|
+
let t = a()?.appContext.app;
|
|
249
|
+
if (!t) return O();
|
|
250
|
+
let n = T.get(t);
|
|
251
|
+
return n || (n = O(), T.set(t, n)), n;
|
|
252
|
+
}
|
|
253
|
+
var ne = { install(e, t = {}) {
|
|
254
|
+
let n = O(t);
|
|
255
|
+
T.set(e, n), e.provide(C, n);
|
|
256
|
+
} };
|
|
257
|
+
function re() {
|
|
258
|
+
let e = k();
|
|
259
|
+
return {
|
|
260
|
+
setLocale: (t) => {
|
|
261
|
+
e.locale = t;
|
|
262
|
+
},
|
|
263
|
+
setMotion: (t) => {
|
|
264
|
+
e.motion = t;
|
|
265
|
+
},
|
|
266
|
+
setPt: (t) => {
|
|
267
|
+
e.pt = t;
|
|
268
|
+
},
|
|
269
|
+
setIcons: (t) => {
|
|
270
|
+
e.icons = t;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
function A(e) {
|
|
275
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
276
|
+
}
|
|
277
|
+
function j(e, t) {
|
|
278
|
+
return t.split(".").reduce((e, t) => A(e)[t], e);
|
|
279
|
+
}
|
|
280
|
+
function M(e, t) {
|
|
281
|
+
return A(typeof e == "function" ? e({ context: t }) : e);
|
|
282
|
+
}
|
|
283
|
+
function N(e, t) {
|
|
284
|
+
let r = k();
|
|
285
|
+
return (i, a) => {
|
|
286
|
+
if (r.pt?.[e] === void 0 && t.value === void 0) {
|
|
287
|
+
let t = j(w[e], i);
|
|
288
|
+
if (typeof t != "function" || a === void 0) {
|
|
289
|
+
let r = `${e}.${i}`, a = D.get(r);
|
|
290
|
+
return a || (a = n(M(t, {})), a.class !== void 0 && (a.class = l(a.class)), Object.freeze(a), D.set(r, a)), a;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return ie(e, i, r, t.value, a);
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
function ie(e, t, r = {}, i, a = {}) {
|
|
297
|
+
return n(M(j(w[e], t), a), M(j(r.pt?.[e], t), a), M(j(i, t), a));
|
|
298
|
+
}
|
|
299
|
+
function P(e) {
|
|
300
|
+
let t = e?.$?.appContext;
|
|
301
|
+
return t?.provides?.[C] ?? (t?.app ? T.get(t.app) : void 0) ?? {};
|
|
302
|
+
}
|
|
303
|
+
function F() {
|
|
304
|
+
let t = k(), n = E.get(t);
|
|
305
|
+
return n || (n = i(!0).run(() => r(() => e(t.locale))), E.set(t, n)), n;
|
|
306
|
+
}
|
|
307
|
+
function ae(e) {
|
|
308
|
+
let t = k();
|
|
309
|
+
return r(() => e.value ?? t.motion ?? !0);
|
|
310
|
+
}
|
|
311
|
+
function oe() {
|
|
312
|
+
let e = k();
|
|
313
|
+
return r(() => e.linkComponent);
|
|
314
|
+
}
|
|
315
|
+
function se() {
|
|
316
|
+
let e = k(), t = ee.get(e);
|
|
317
|
+
return t || (t = i(!0).run(() => r(() => e.icons ?? te)), ee.set(e, t)), t;
|
|
318
|
+
}
|
|
319
|
+
function ce() {
|
|
320
|
+
return k().idPrefix;
|
|
321
|
+
}
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region src/utils/appCleanup.ts
|
|
324
|
+
var I = /* @__PURE__ */ new WeakMap();
|
|
325
|
+
function le(e, t) {
|
|
326
|
+
let n = I.get(e);
|
|
327
|
+
if (!n) {
|
|
328
|
+
n = /* @__PURE__ */ new Set(), I.set(e, n);
|
|
329
|
+
let t = e.unmount.bind(e);
|
|
330
|
+
e.unmount = () => {
|
|
331
|
+
let n = I.get(e);
|
|
332
|
+
I.delete(e);
|
|
333
|
+
try {
|
|
334
|
+
n?.forEach((e) => e());
|
|
335
|
+
} finally {
|
|
336
|
+
t();
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
n.add(t);
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/composables/useWlAnnouncer.ts
|
|
344
|
+
var L = /* @__PURE__ */ new WeakMap();
|
|
345
|
+
function ue() {
|
|
346
|
+
let e = a()?.appContext.app;
|
|
347
|
+
function t() {
|
|
348
|
+
if (!e || typeof document > "u") return;
|
|
349
|
+
let t = L.get(e);
|
|
350
|
+
if (!t) {
|
|
351
|
+
let n = (e) => {
|
|
352
|
+
let t = document.createElement("div");
|
|
353
|
+
return t.className = "wl-sr-only", t.setAttribute("data-wl-announcer", ""), t.setAttribute("aria-live", e), t.setAttribute("aria-atomic", "true"), document.body.append(t), t;
|
|
354
|
+
};
|
|
355
|
+
t = {
|
|
356
|
+
polite: n("polite"),
|
|
357
|
+
assertive: n("assertive"),
|
|
358
|
+
revision: 0
|
|
359
|
+
}, L.set(e, t), le(e, () => {
|
|
360
|
+
let t = L.get(e);
|
|
361
|
+
t && (t.revision++, t.polite.remove(), t.assertive.remove()), L.delete(e);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
return t;
|
|
365
|
+
}
|
|
366
|
+
return { async announce(e, n = "polite") {
|
|
367
|
+
let r = t();
|
|
368
|
+
if (!r) return;
|
|
369
|
+
let i = ++r.revision;
|
|
370
|
+
r[n].textContent = "", await c(), r.revision === i && r[n].isConnected && (r[n].textContent = e);
|
|
371
|
+
} };
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/utils/overlayStack.ts
|
|
375
|
+
var R = [], de = /* @__PURE__ */ new Set(), z;
|
|
376
|
+
function B(e) {
|
|
377
|
+
let t = R.lastIndexOf(e);
|
|
378
|
+
t >= 0 && R.splice(t, 1), U();
|
|
379
|
+
}
|
|
380
|
+
function fe(e) {
|
|
381
|
+
let t = R.lastIndexOf(e);
|
|
382
|
+
t >= 0 && R.splice(t, 1), R.push(e), U();
|
|
383
|
+
}
|
|
384
|
+
function pe(e) {
|
|
385
|
+
let t = R.filter((e) => e.visible());
|
|
386
|
+
return t[t.length - 1] === e;
|
|
387
|
+
}
|
|
388
|
+
function me(e) {
|
|
389
|
+
let t = R.filter((e) => e.visible() && e.trapFocus?.());
|
|
390
|
+
return t[t.length - 1] === e;
|
|
391
|
+
}
|
|
392
|
+
function V(e, t, n = /* @__PURE__ */ new Set()) {
|
|
393
|
+
if (e === t || n.has(e)) return !1;
|
|
394
|
+
n.add(e);
|
|
395
|
+
let r = e.panel(), i = t.anchor();
|
|
396
|
+
return !r || !i ? !1 : r.contains(i) ? !0 : R.some((e) => e !== t && e.visible() && r.contains(e.anchor()) && V(e, t, n));
|
|
397
|
+
}
|
|
398
|
+
function he(e, t) {
|
|
399
|
+
let n = R.filter((e) => e.visible()), r = n[n.length - 1];
|
|
400
|
+
return r && t && [r.panel(), ...H(r)].some((e) => e?.contains(t)) ? !0 : !r || r === e || !r.modal?.() && V(e, r);
|
|
401
|
+
}
|
|
402
|
+
function H(e) {
|
|
403
|
+
return R.filter((t) => t.visible() && V(e, t)).map((e) => e.panel()).filter((e) => e !== null);
|
|
404
|
+
}
|
|
405
|
+
function U() {
|
|
406
|
+
if (typeof document > "u") return;
|
|
407
|
+
let e = [...R].reverse().find((e) => e.visible() && e.modal?.() && e.panel()?.isConnected), t = /* @__PURE__ */ new Set();
|
|
408
|
+
if (e) {
|
|
409
|
+
let n = [
|
|
410
|
+
e.panel(),
|
|
411
|
+
e.backdrop?.(),
|
|
412
|
+
...H(e),
|
|
413
|
+
...document.querySelectorAll("[data-wl-announcer]")
|
|
414
|
+
].filter((e) => e instanceof HTMLElement && e.isConnected);
|
|
415
|
+
function r(e) {
|
|
416
|
+
for (let i of Array.from(e.children)) i instanceof HTMLElement && !n.includes(i) && (n.some((e) => i.contains(e)) ? r(i) : t.add(i));
|
|
417
|
+
}
|
|
418
|
+
r(document.body), !z && typeof MutationObserver < "u" && (z = new MutationObserver(U), z.observe(document.body, {
|
|
419
|
+
childList: !0,
|
|
420
|
+
subtree: !0
|
|
421
|
+
}));
|
|
422
|
+
} else z?.disconnect(), z = void 0;
|
|
423
|
+
for (let e of de) t.has(e) || (e.getAttribute("inert") === "" && e.removeAttribute("inert"), de.delete(e));
|
|
424
|
+
for (let e of t) e.hasAttribute("inert") || (e.setAttribute("inert", ""), de.add(e));
|
|
425
|
+
}
|
|
426
|
+
function ge(e, t, n = /* @__PURE__ */ new Set()) {
|
|
427
|
+
if (!e.visible() || n.has(e)) return !1;
|
|
428
|
+
n.add(e);
|
|
429
|
+
let r = e.panel();
|
|
430
|
+
return r?.contains(t) || e.anchor()?.contains(t) ? !0 : R.some((i) => i !== e && i.visible() && r?.contains(i.anchor()) && ge(i, t, n));
|
|
431
|
+
}
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region src/utils/anchoredOverlay.ts
|
|
434
|
+
function W(e, t) {
|
|
435
|
+
return typeof e == "function" ? e() : e ?? t;
|
|
436
|
+
}
|
|
437
|
+
function _e(e = {}) {
|
|
438
|
+
let t = p(!1), n = p(null), r = p(null), i = p({}), a = p("bottom"), o = p({}), s = null, l = !1, f = !1, m = !1, h, g, v = null, y = null, b = 0, x = p(0), S = -1, C = /* @__PURE__ */ new WeakMap(), w = 0, T = 0, E = {
|
|
439
|
+
token: Symbol("wl-anchored-overlay"),
|
|
440
|
+
visible: () => t.value,
|
|
441
|
+
panel: () => r.value,
|
|
442
|
+
anchor: () => n.value
|
|
443
|
+
};
|
|
444
|
+
function ee(e) {
|
|
445
|
+
let t = e.style.getPropertyValue("z-index"), n = e.style.getPropertyPriority("z-index"), r = i.value.zIndex, a = r !== void 0 && t === r;
|
|
446
|
+
a || C.set(e, {
|
|
447
|
+
value: t,
|
|
448
|
+
priority: n
|
|
449
|
+
});
|
|
450
|
+
let o = C.get(e);
|
|
451
|
+
a && (o?.value ? e.style.setProperty("z-index", o.value, o.priority) : e.style.removeProperty("z-index"));
|
|
452
|
+
try {
|
|
453
|
+
return Number.parseInt(getComputedStyle(e).zIndex, 10) || 0;
|
|
454
|
+
} finally {
|
|
455
|
+
a && e.style.setProperty("z-index", t, n);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function te() {
|
|
459
|
+
w = 0, T = r.value ? ee(r.value) : 0;
|
|
460
|
+
for (let e = n.value?.parentElement; e; e = e.parentElement) {
|
|
461
|
+
let t = Number.parseInt(getComputedStyle(e).zIndex, 10);
|
|
462
|
+
Number.isFinite(t) && (w = Math.max(w, t));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
function D() {
|
|
466
|
+
if (!t.value || !l || !n.value || !r.value) return;
|
|
467
|
+
let s = e.anchorRect?.() ?? n.value.getBoundingClientRect(), c = r.value.offsetWidth || s.width, u = r.value.offsetHeight, d = W(e.offset, 4), f = Number.isFinite(d) ? Math.max(0, d) : 4, p = W(e.align, "start"), m = W(e.placement, "auto"), h = {
|
|
468
|
+
top: s.top,
|
|
469
|
+
bottom: window.innerHeight - s.bottom,
|
|
470
|
+
left: s.left,
|
|
471
|
+
right: window.innerWidth - s.right
|
|
472
|
+
}, g = m === "auto" ? "bottom" : m, _ = {
|
|
473
|
+
top: "bottom",
|
|
474
|
+
bottom: "top",
|
|
475
|
+
left: "right",
|
|
476
|
+
right: "left"
|
|
477
|
+
}, v = (g === "left" || g === "right" ? c : u) + f + 4;
|
|
478
|
+
h[g] < v && h[_[g]] > h[g] && (g = _[g]);
|
|
479
|
+
let y = (e, t, n) => p === "center" ? e + (t - n) / 2 : p === "end" ? e + t - n : e, b = g === "bottom" ? s.bottom + f : g === "top" ? s.top - u - f : y(s.top, s.height, u), x = g === "right" ? s.right + f : g === "left" ? s.left - c - f : y(s.left, s.width, c), S = Math.max(4, Math.min(b, window.innerHeight - u - 4)), C = Math.max(4, Math.min(x, window.innerWidth - c - 4));
|
|
480
|
+
a.value = g, o.value = g === "top" || g === "bottom" ? { left: `${Math.max(8, Math.min(s.left + s.width / 2 - C, c - 8))}px` } : { top: `${Math.max(8, Math.min(s.top + s.height / 2 - S, u - 8))}px` }, i.value = {
|
|
481
|
+
position: "fixed",
|
|
482
|
+
top: `${S}px`,
|
|
483
|
+
left: `${C}px`,
|
|
484
|
+
minWidth: `${s.width}px`,
|
|
485
|
+
zIndex: String(Math.max(T, w + 1))
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
function O() {
|
|
489
|
+
if (!l || !f || !t.value || !v || !y || v !== n.value || y !== r.value || h !== void 0) return;
|
|
490
|
+
let e = b;
|
|
491
|
+
h = window.requestAnimationFrame(() => {
|
|
492
|
+
e === b && (h = void 0, v === n.value && y === r.value && D());
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
function k() {
|
|
496
|
+
b += 1, h !== void 0 && window.cancelAnimationFrame(h), h = void 0, g?.disconnect(), g = void 0, v = null, y = null;
|
|
497
|
+
}
|
|
498
|
+
function ne() {
|
|
499
|
+
f && (document.removeEventListener("pointerdown", P), document.removeEventListener("keydown", F), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0), f = !1), k();
|
|
500
|
+
}
|
|
501
|
+
function re() {
|
|
502
|
+
l && !f && (f = !0, fe(E), document.addEventListener("pointerdown", P), document.addEventListener("keydown", F), window.addEventListener("resize", O), window.addEventListener("scroll", O, !0));
|
|
503
|
+
}
|
|
504
|
+
function A() {
|
|
505
|
+
if (l && t.value && f) {
|
|
506
|
+
if (!n.value || !r.value) k(), U();
|
|
507
|
+
else if (v !== n.value || y !== r.value || S !== x.value) {
|
|
508
|
+
if (k(), v = n.value, y = r.value, S = x.value, te(), D(), U(), typeof ResizeObserver < "u") {
|
|
509
|
+
let e = b;
|
|
510
|
+
g = new ResizeObserver(() => {
|
|
511
|
+
e === b && O();
|
|
512
|
+
}), g.observe(y), g.observe(v);
|
|
513
|
+
}
|
|
514
|
+
m || (m = !0, e.onOpen?.());
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function j(t = !0) {
|
|
519
|
+
ne(), B(E);
|
|
520
|
+
let n = m;
|
|
521
|
+
m = !1, n && t && e.onClose?.();
|
|
522
|
+
}
|
|
523
|
+
function M(e) {
|
|
524
|
+
let r = e?.currentTarget ?? e?.target;
|
|
525
|
+
r instanceof HTMLElement && (n.value = r), s = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : n.value, t.value ? x.value += 1 : (i.value = {}, t.value = !0);
|
|
526
|
+
}
|
|
527
|
+
function N(e) {
|
|
528
|
+
t.value && e instanceof KeyboardEvent && e.key === "Escape" && e.preventDefault(), t.value = !1;
|
|
529
|
+
}
|
|
530
|
+
function ie(e) {
|
|
531
|
+
t.value ? N() : M(e);
|
|
532
|
+
}
|
|
533
|
+
function P(n) {
|
|
534
|
+
let r = W(e.dismissible, !0);
|
|
535
|
+
if (!t.value || r === !1) return;
|
|
536
|
+
let i = n.target;
|
|
537
|
+
i instanceof Node && !ge(E, i) && N();
|
|
538
|
+
}
|
|
539
|
+
function F(n) {
|
|
540
|
+
!n.defaultPrevented && t.value && pe(E) && n.key === "Escape" && W(e.closeOnEscape, !0) !== !1 && (n.preventDefault(), N(n), s?.isConnected && s.focus());
|
|
541
|
+
}
|
|
542
|
+
return _(t, (e) => {
|
|
543
|
+
e ? re() : j();
|
|
544
|
+
}, { flush: "sync" }), _([
|
|
545
|
+
t,
|
|
546
|
+
n,
|
|
547
|
+
r,
|
|
548
|
+
x
|
|
549
|
+
], A, { flush: "post" }), _(() => [
|
|
550
|
+
W(e.placement, "auto"),
|
|
551
|
+
W(e.align, "start"),
|
|
552
|
+
W(e.offset, 4)
|
|
553
|
+
], () => {
|
|
554
|
+
t.value && O();
|
|
555
|
+
}), d(() => {
|
|
556
|
+
l = !0, t.value && (re(), c(A));
|
|
557
|
+
}), u(() => {
|
|
558
|
+
l = !1, j(!1);
|
|
559
|
+
}), {
|
|
560
|
+
visible: t,
|
|
561
|
+
anchor: n,
|
|
562
|
+
panel: r,
|
|
563
|
+
style: i,
|
|
564
|
+
placement: a,
|
|
565
|
+
arrowStyle: o,
|
|
566
|
+
show: M,
|
|
567
|
+
hide: N,
|
|
568
|
+
toggle: ie
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
//#endregion
|
|
572
|
+
//#region src/composables/useWlTypeahead.ts
|
|
573
|
+
function ve(e) {
|
|
574
|
+
let t = "", n;
|
|
575
|
+
function r() {
|
|
576
|
+
n !== void 0 && clearTimeout(n), t = "", n = void 0;
|
|
577
|
+
}
|
|
578
|
+
f(r);
|
|
579
|
+
function i(i) {
|
|
580
|
+
if (i.key.length !== 1 || i.ctrlKey || i.metaKey || i.altKey || i.isComposing) return;
|
|
581
|
+
let a = i.target;
|
|
582
|
+
if (typeof HTMLElement < "u" && a instanceof HTMLElement && (a instanceof HTMLInputElement && !a.readOnly || a instanceof HTMLTextAreaElement || a.isContentEditable)) return;
|
|
583
|
+
t += i.key.toLocaleLowerCase(), n !== void 0 && clearTimeout(n), n = setTimeout(r, e.delay ?? 500);
|
|
584
|
+
let o = [...t].every((e) => e === t[0]) ? t[0] : t, s = e.count(), c = o.length > 1 ? e.active() : e.active() + 1;
|
|
585
|
+
for (let t = 0; t < s; t++) {
|
|
586
|
+
let n = ((c + t) % s + s) % s;
|
|
587
|
+
if (!e.isDisabled?.(n) && e.label(n).toLocaleLowerCase().startsWith(o)) {
|
|
588
|
+
i.preventDefault(), e.onMatch(n);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
return {
|
|
594
|
+
onKeydown: i,
|
|
595
|
+
reset: r
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/utils/options.ts
|
|
600
|
+
function G(e, t) {
|
|
601
|
+
return e && typeof e == "object" ? e[t] : void 0;
|
|
602
|
+
}
|
|
603
|
+
function ye(e, t) {
|
|
604
|
+
return typeof t == "function" ? t(e) : typeof t == "string" ? G(e, t) : e;
|
|
605
|
+
}
|
|
606
|
+
function be(e, t) {
|
|
607
|
+
let n = typeof t == "function" ? t(e) : typeof t == "string" ? G(e, t) : G(e, "label") ?? e;
|
|
608
|
+
return n == null ? "" : String(n);
|
|
609
|
+
}
|
|
610
|
+
function xe(e, t) {
|
|
611
|
+
return typeof t == "function" ? t(e) : typeof t == "string" && !!G(e, t);
|
|
612
|
+
}
|
|
613
|
+
function Se(e, t, n, r = e) {
|
|
614
|
+
let i = typeof t == "function" ? t(e) : typeof t == "string" ? G(e, t) : r;
|
|
615
|
+
return typeof i == "string" || typeof i == "number" || typeof i == "symbol" ? i : typeof i == "boolean" || typeof i == "bigint" ? `${typeof i}:${String(i)}` : n;
|
|
616
|
+
}
|
|
617
|
+
function Ce(e) {
|
|
618
|
+
let t = p(0), n = ve({
|
|
619
|
+
count: e.count,
|
|
620
|
+
label: (t) => e.label?.(t) ?? "",
|
|
621
|
+
active: () => t.value,
|
|
622
|
+
isDisabled: e.isDisabled,
|
|
623
|
+
onMatch: (e) => {
|
|
624
|
+
t.value = e;
|
|
625
|
+
}
|
|
626
|
+
}), i = (t) => `${e.listId()}-option-${t}`, a = r(() => t.value >= 0 && t.value < e.count() && !e.isDisabled?.(t.value) ? i(t.value) : void 0);
|
|
627
|
+
function o(t, n, r = !0) {
|
|
628
|
+
let i = e.count();
|
|
629
|
+
for (let a = 0; a < i; a++) {
|
|
630
|
+
let o = t + n * a;
|
|
631
|
+
if (!r && (o < 0 || o >= i)) break;
|
|
632
|
+
let s = (o % i + i) % i;
|
|
633
|
+
if (!e.isDisabled?.(s)) return s;
|
|
634
|
+
}
|
|
635
|
+
return -1;
|
|
636
|
+
}
|
|
637
|
+
v(() => {
|
|
638
|
+
(t.value < 0 || t.value >= e.count() || e.isDisabled?.(t.value)) && (t.value = o(Math.max(0, Math.min(t.value, e.count() - 1)), 1));
|
|
639
|
+
}), _([
|
|
640
|
+
t,
|
|
641
|
+
e.count,
|
|
642
|
+
e.list,
|
|
643
|
+
e.listId
|
|
644
|
+
], async () => {
|
|
645
|
+
if (e.list.value || n.reset(), await c(), !a.value || !e.list.value) return;
|
|
646
|
+
let t = [...e.list.value.querySelectorAll("[role=\"option\"]")].find((e) => e.id === a.value);
|
|
647
|
+
typeof t?.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
|
|
648
|
+
}, { flush: "post" });
|
|
649
|
+
function s(r) {
|
|
650
|
+
if (r.key === "Escape") {
|
|
651
|
+
e.onClose(r);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
let i = e.count();
|
|
655
|
+
if (i) {
|
|
656
|
+
if (r.key === "ArrowDown" || r.key === "ArrowUp" || r.key === "Home" || r.key === "End") r.preventDefault(), t.value = r.key === "Home" ? o(0, 1) : r.key === "End" ? o(i - 1, -1) : r.key === "ArrowDown" ? o(t.value + 1, 1) : o(t.value < 0 ? i - 1 : t.value - 1, -1);
|
|
657
|
+
else if (r.key === "Enter") r.preventDefault(), a.value && e.onSelect(t.value);
|
|
658
|
+
else if (r.key === "PageDown" || r.key === "PageUp") {
|
|
659
|
+
r.preventDefault();
|
|
660
|
+
let e = r.key === "PageDown" ? 1 : -1, n = Math.max(0, Math.min(i - 1, t.value + e * 10)), a = o(n, e, !1);
|
|
661
|
+
t.value = a < 0 ? o(n, e === 1 ? -1 : 1, !1) : a;
|
|
662
|
+
} else e.label && n.onKeydown(r);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return {
|
|
666
|
+
active: t,
|
|
667
|
+
optionId: i,
|
|
668
|
+
activeDescendant: a,
|
|
669
|
+
onKeydown: s
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region src/utils/useWlId.ts
|
|
674
|
+
var we = /* @__PURE__ */ new WeakMap();
|
|
675
|
+
function Te() {
|
|
676
|
+
let e = a();
|
|
677
|
+
if (!e) throw Error("Legato UI IDs must be generated during component setup");
|
|
678
|
+
let t = e.appContext, n = we.get(e.root) ?? 0;
|
|
679
|
+
return we.set(e.root, n + 1), `${t.config.idPrefix || ce() || "v"}-${n}`;
|
|
680
|
+
}
|
|
681
|
+
//#endregion
|
|
682
|
+
//#region src/composables/useWlHotkey.ts
|
|
683
|
+
function Ee(e, t, n = {}) {
|
|
684
|
+
let r = e.toLowerCase().split("+").map((e) => e.trim()), i = r.pop(), a = null;
|
|
685
|
+
function o(e) {
|
|
686
|
+
if (!(e instanceof KeyboardEvent) || e.defaultPrevented || n.enabled?.() === !1) return;
|
|
687
|
+
let a = e.composedPath().some((e) => e instanceof HTMLElement && (e.matches("input, textarea, select") || e.isContentEditable || e.getAttribute("contenteditable") === "true"));
|
|
688
|
+
(n.allowInInputs || !a) && e.key.toLowerCase() === i && e.altKey === r.includes("alt") && e.shiftKey === r.includes("shift") && ((r.includes("mod") ? !(e.ctrlKey || e.metaKey) : e.ctrlKey !== r.includes("ctrl") || e.metaKey !== r.includes("meta")) || (n.preventDefault !== !1 && e.preventDefault(), t(e)));
|
|
689
|
+
}
|
|
690
|
+
d(() => {
|
|
691
|
+
a = n.target?.() ?? document, a.addEventListener("keydown", o);
|
|
692
|
+
}), u(() => a?.removeEventListener("keydown", o));
|
|
693
|
+
}
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region src/utils/bodyScrollLock.ts
|
|
696
|
+
var K = 0;
|
|
697
|
+
function De(e, t) {
|
|
698
|
+
return {
|
|
699
|
+
value: e.getPropertyValue(t),
|
|
700
|
+
priority: e.getPropertyPriority(t)
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
function Oe(e, t, n) {
|
|
704
|
+
n.value ? e.setProperty(t, n.value, n.priority) : e.removeProperty(t);
|
|
705
|
+
}
|
|
706
|
+
var q, J, Y = !1, X, Z = !1;
|
|
707
|
+
function ke() {
|
|
708
|
+
if (typeof document > "u") return () => void 0;
|
|
709
|
+
if (K === 0) {
|
|
710
|
+
let e = document.documentElement, t = document.body, n = t.getBoundingClientRect().width, r = window.innerWidth > e.clientWidth, i = getComputedStyle(e).getPropertyValue("scrollbar-gutter");
|
|
711
|
+
Y = r && !i.includes("stable"), Y && (J = De(e.style, "scrollbar-gutter"), e.style.setProperty("scrollbar-gutter", "stable", "important"));
|
|
712
|
+
let a = getComputedStyle(t).paddingRight;
|
|
713
|
+
q = De(t.style, "overflow"), t.style.setProperty("overflow", "hidden", "important");
|
|
714
|
+
let o = t.getBoundingClientRect().width - n;
|
|
715
|
+
Z = o > 0, Z && (X = De(t.style, "padding-right"), t.style.setProperty("padding-right", `calc(${a} + ${o}px)`, "important"));
|
|
716
|
+
}
|
|
717
|
+
K += 1;
|
|
718
|
+
let e = !1;
|
|
719
|
+
return () => {
|
|
720
|
+
e || typeof document > "u" || (e = !0, K = Math.max(0, K - 1), K === 0 && (q && Oe(document.body.style, "overflow", q), Z && X && Oe(document.body.style, "padding-right", X), Y && J && Oe(document.documentElement.style, "scrollbar-gutter", J), q = void 0, X = void 0, J = void 0, Z = !1, Y = !1));
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
//#endregion
|
|
724
|
+
//#region src/utils/overlayLifecycle.ts
|
|
725
|
+
var Ae = [
|
|
726
|
+
"a[href]:not([aria-disabled=\"true\"])",
|
|
727
|
+
"button:not([disabled])",
|
|
728
|
+
"input:not([disabled])",
|
|
729
|
+
"select:not([disabled])",
|
|
730
|
+
"textarea:not([disabled])",
|
|
731
|
+
"area[href]",
|
|
732
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
733
|
+
"details > summary:first-of-type",
|
|
734
|
+
"audio[controls]",
|
|
735
|
+
"video[controls]",
|
|
736
|
+
"iframe",
|
|
737
|
+
"object",
|
|
738
|
+
"embed",
|
|
739
|
+
"[tabindex]"
|
|
740
|
+
].join(", ");
|
|
741
|
+
function Q(e, t) {
|
|
742
|
+
return typeof e == "function" ? e() : e ?? t;
|
|
743
|
+
}
|
|
744
|
+
function je(e) {
|
|
745
|
+
return e ? Array.from(e.querySelectorAll(Ae)).filter((e) => {
|
|
746
|
+
if (e.matches(":disabled, [aria-disabled=\"true\"], input[type=\"hidden\"]") || e.hasAttribute("tabindex") && e.tabIndex < 0 || e.closest("[hidden], [aria-hidden=\"true\"], [inert]")) return !1;
|
|
747
|
+
for (let t = e; t; t = t.parentElement) {
|
|
748
|
+
let n = getComputedStyle(t);
|
|
749
|
+
if (n.display === "none" || t === e && (n.visibility === "hidden" || n.visibility === "collapse") || t.tagName === "DETAILS" && !t.hasAttribute("open") && !t.querySelector(":scope > summary")?.contains(e)) return !1;
|
|
750
|
+
}
|
|
751
|
+
return !0;
|
|
752
|
+
}) : [];
|
|
753
|
+
}
|
|
754
|
+
function Me(e) {
|
|
755
|
+
let t = je(e);
|
|
756
|
+
return t.find((e) => e.hasAttribute("autofocus")) ?? t[0] ?? e;
|
|
757
|
+
}
|
|
758
|
+
function Ne(e, t, n = []) {
|
|
759
|
+
if (!t) return;
|
|
760
|
+
let r = [t, ...n], i = [...new Set(r.flatMap(je))], a = r.some((e) => e.contains(document.activeElement));
|
|
761
|
+
if (!i.length) {
|
|
762
|
+
e.preventDefault(), t.focus();
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
let o = i[0], s = i[i.length - 1];
|
|
766
|
+
e.shiftKey && (document.activeElement === o || document.activeElement === t || !a) ? (e.preventDefault(), s.focus()) : !e.shiftKey && (document.activeElement === s || !a) && (e.preventDefault(), o.focus());
|
|
767
|
+
}
|
|
768
|
+
function Pe(e) {
|
|
769
|
+
let t = !1, n = !1, r = !1, i = 0, a = null, o, s = {
|
|
770
|
+
token: Symbol("wl-overlay"),
|
|
771
|
+
visible: () => n && e.visible.value,
|
|
772
|
+
panel: () => e.container.value,
|
|
773
|
+
anchor: () => a,
|
|
774
|
+
trapFocus: () => Q(e.trapFocus, !0),
|
|
775
|
+
modal: () => Q(e.modal, e.container.value?.getAttribute("aria-modal") === "true"),
|
|
776
|
+
backdrop: e.backdrop
|
|
777
|
+
};
|
|
778
|
+
function l() {
|
|
779
|
+
e.visible.value && (e.visible.value = !1);
|
|
780
|
+
}
|
|
781
|
+
async function f() {
|
|
782
|
+
if (n) return;
|
|
783
|
+
if (e.enabled && !e.enabled()) {
|
|
784
|
+
l();
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
let t = ++i;
|
|
788
|
+
n = !0, a = document.activeElement instanceof HTMLElement ? document.activeElement : null, fe(s), document.addEventListener("keydown", m), Q(e.lockScroll, !1) && (o = ke()), e.onBeforeOpen?.(), await c(), n && t === i && e.visible.value && (U(), (e.initialFocus?.() ?? Me(e.container.value))?.focus(), r = !0, e.onOpen?.());
|
|
789
|
+
}
|
|
790
|
+
async function p(l = !0) {
|
|
791
|
+
if (!n) return;
|
|
792
|
+
i += 1;
|
|
793
|
+
let u = i;
|
|
794
|
+
n = !1;
|
|
795
|
+
let d = a;
|
|
796
|
+
a = null, B(s), document.removeEventListener("keydown", m), o?.(), o = void 0, r && e.onClose?.(), r = !1, await c(), !n && t && u === i && l && he(s, d) && e.restoreFocus !== !1 && d?.isConnected && d.focus();
|
|
797
|
+
}
|
|
798
|
+
function m(t) {
|
|
799
|
+
if (n && !t.defaultPrevented && (t.key !== "Escape" || pe(s))) {
|
|
800
|
+
if (t.key === "Escape" && Q(e.closeOnEscape, !0)) t.preventDefault(), t.stopPropagation(), l();
|
|
801
|
+
else if (t.key === "Tab" && me(s)) {
|
|
802
|
+
let n = e.container.value?.contains(document.activeElement) ? [] : H(s);
|
|
803
|
+
Ne(t, e.container.value, n);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
return _(e.visible, async (e, n) => {
|
|
808
|
+
t && (e ? await f() : n && await p());
|
|
809
|
+
}), _(() => [e.container.value, s.modal()], () => {
|
|
810
|
+
n && U();
|
|
811
|
+
}, { flush: "post" }), _(() => Q(e.lockScroll, !1), (e) => {
|
|
812
|
+
n && (e && !o ? o = ke() : e || (o?.(), o = void 0));
|
|
813
|
+
}, { flush: "post" }), d(async () => {
|
|
814
|
+
t = !0, e.visible.value && await f();
|
|
815
|
+
}), u(() => {
|
|
816
|
+
let c = he(s, a);
|
|
817
|
+
t = !1, i += 1, document.removeEventListener("keydown", m), B(s), o?.(), o = void 0, n && c && e.restoreFocus !== !1 && a?.isConnected && a.focus(), n = !1, r = !1, a = null;
|
|
818
|
+
}), { requestClose: l };
|
|
819
|
+
}
|
|
820
|
+
//#endregion
|
|
821
|
+
//#region src/utils/rovingFocus.ts
|
|
822
|
+
function Fe(e) {
|
|
823
|
+
let t = p(0);
|
|
824
|
+
function n(t, n, r = !0) {
|
|
825
|
+
let i = e.count();
|
|
826
|
+
for (let a = 0; a < i; a++) {
|
|
827
|
+
let o = t + n * a;
|
|
828
|
+
if (!r && (o < 0 || o >= i)) break;
|
|
829
|
+
let s = (o % i + i) % i;
|
|
830
|
+
if (!e.isDisabled(s)) return s;
|
|
831
|
+
}
|
|
832
|
+
return -1;
|
|
833
|
+
}
|
|
834
|
+
v(() => {
|
|
835
|
+
(t.value < 0 || t.value >= e.count() || e.isDisabled(t.value)) && (t.value = n(0, 1));
|
|
836
|
+
});
|
|
837
|
+
function r(r) {
|
|
838
|
+
let i = typeof e.orientation == "function" ? e.orientation() : e.orientation, a = i === "horizontal" ? "ArrowLeft" : "ArrowUp", o = i === "horizontal" ? "ArrowRight" : "ArrowDown", s = typeof e.loop == "function" ? e.loop() : e.loop ?? !0;
|
|
839
|
+
if (![
|
|
840
|
+
a,
|
|
841
|
+
o,
|
|
842
|
+
"Home",
|
|
843
|
+
"End"
|
|
844
|
+
].includes(r.key)) return;
|
|
845
|
+
r.preventDefault();
|
|
846
|
+
let l = r.key === "Home" ? n(0, 1) : r.key === "End" ? n(e.count() - 1, -1) : r.key === o ? n(t.value + 1, 1, s) : n(t.value - 1, -1, s);
|
|
847
|
+
l < 0 || (t.value = l, c(() => e.focus(l)));
|
|
848
|
+
}
|
|
849
|
+
return {
|
|
850
|
+
active: t,
|
|
851
|
+
tabIndex: (n) => n === t.value && !e.isDisabled(n) ? 0 : -1,
|
|
852
|
+
onKeydown: r
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
//#endregion
|
|
856
|
+
//#region src/utils/development.ts
|
|
857
|
+
function Ie() {
|
|
858
|
+
try {
|
|
859
|
+
return process.env.NODE_ENV !== "production";
|
|
860
|
+
} catch {
|
|
861
|
+
return !1;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region src/services/confirmation.ts
|
|
866
|
+
var Le = Symbol("wl-confirmation"), Re = { install(e) {
|
|
867
|
+
let t = p(null), n;
|
|
868
|
+
function r(e, r = !1) {
|
|
869
|
+
let i = t.value, a = n;
|
|
870
|
+
t.value = null, n = void 0, a?.(e), r && (e ? i?.accept?.() : i?.reject?.());
|
|
871
|
+
}
|
|
872
|
+
le(e, () => r(!1)), e.provide(Le, {
|
|
873
|
+
current: t,
|
|
874
|
+
require(e) {
|
|
875
|
+
r(!1), t.value = e;
|
|
876
|
+
},
|
|
877
|
+
request(e) {
|
|
878
|
+
return r(!1), t.value = e, new Promise((e) => {
|
|
879
|
+
n = e;
|
|
880
|
+
});
|
|
881
|
+
},
|
|
882
|
+
accept: () => r(!0, !0),
|
|
883
|
+
reject: () => r(!1, !0),
|
|
884
|
+
cancel(e) {
|
|
885
|
+
g(t.value) === g(e) && r(!1);
|
|
886
|
+
},
|
|
887
|
+
close() {
|
|
888
|
+
r(!1);
|
|
889
|
+
},
|
|
890
|
+
closeGroup(e) {
|
|
891
|
+
t.value?.group === e && r(!1);
|
|
892
|
+
}
|
|
893
|
+
});
|
|
894
|
+
} };
|
|
895
|
+
function ze() {
|
|
896
|
+
let e = o(Le, null);
|
|
897
|
+
if (!e) throw Error("Install WlConfirmationService before using WlConfirmDialog");
|
|
898
|
+
return e;
|
|
899
|
+
}
|
|
900
|
+
//#endregion
|
|
901
|
+
//#region src/services/toast.ts
|
|
902
|
+
var Be = Symbol("wl-toast"), Ve = {
|
|
903
|
+
success: "success",
|
|
904
|
+
info: "info",
|
|
905
|
+
warn: "warning",
|
|
906
|
+
error: "danger"
|
|
907
|
+
}, He = {
|
|
908
|
+
neutral: "info",
|
|
909
|
+
accent: "info",
|
|
910
|
+
info: "info",
|
|
911
|
+
success: "success",
|
|
912
|
+
warning: "warn",
|
|
913
|
+
danger: "error"
|
|
914
|
+
};
|
|
915
|
+
function Ue(e) {
|
|
916
|
+
return e.tone ?? Ve[e.severity];
|
|
917
|
+
}
|
|
918
|
+
function We(e) {
|
|
919
|
+
return He[e];
|
|
920
|
+
}
|
|
921
|
+
function $(e, t) {
|
|
922
|
+
return e !== void 0 && Number.isFinite(e) && e >= 0 ? e : t;
|
|
923
|
+
}
|
|
924
|
+
var Ge = { install(e, t = {}) {
|
|
925
|
+
let n = p([]), r = 0, i = !1, a = /* @__PURE__ */ new Map(), o = (e) => e === "danger" ? $(t.errorLife, $(t.life, 8e3)) : $(t.life, 5e3);
|
|
926
|
+
function s() {
|
|
927
|
+
!i && Ie() && (i = !0, console.warn("[Legato UI] Toast severity is deprecated; use tone instead."));
|
|
928
|
+
}
|
|
929
|
+
function c(e) {
|
|
930
|
+
e.timer !== void 0 && clearTimeout(e.timer), e.timer = void 0;
|
|
931
|
+
}
|
|
932
|
+
let l = (e) => {
|
|
933
|
+
let t = a.get(e);
|
|
934
|
+
t && c(t), a.delete(e), n.value = n.value.filter((t) => t.id !== e);
|
|
935
|
+
};
|
|
936
|
+
function u(e, t) {
|
|
937
|
+
t.sticky || t.paused.size || (t.startedAt = Date.now(), t.timer = setTimeout(() => l(e), t.remaining));
|
|
938
|
+
}
|
|
939
|
+
function d(e, t) {
|
|
940
|
+
let n = a.get(e.id);
|
|
941
|
+
n && c(n);
|
|
942
|
+
let r = {
|
|
943
|
+
remaining: t,
|
|
944
|
+
startedAt: Date.now(),
|
|
945
|
+
sticky: t === 0,
|
|
946
|
+
paused: n?.paused ?? /* @__PURE__ */ new Set()
|
|
947
|
+
};
|
|
948
|
+
a.set(e.id, r), u(e.id, r);
|
|
949
|
+
}
|
|
950
|
+
le(e, () => {
|
|
951
|
+
a.forEach(c), a.clear(), n.value = [];
|
|
952
|
+
}), e.provide(Be, {
|
|
953
|
+
messages: n,
|
|
954
|
+
remove: l,
|
|
955
|
+
update(e, t, r = !1) {
|
|
956
|
+
let i = n.value.find((t) => t.id === e);
|
|
957
|
+
if (!i) return;
|
|
958
|
+
t.severity !== void 0 && t.tone === void 0 && s();
|
|
959
|
+
let a = Ue(i), c = t.tone ?? (t.severity === void 0 ? a : Ve[t.severity]);
|
|
960
|
+
t.summary !== void 0 && (i.summary = t.summary), i.tone = c, i.severity = We(c), Object.prototype.hasOwnProperty.call(t, "detail") && (i.detail = t.detail), Object.prototype.hasOwnProperty.call(t, "action") && (i.action = t.action), (r || t.life !== void 0 || c !== a) && (i.life = $(t.life, o(c)), d(i, i.life));
|
|
961
|
+
},
|
|
962
|
+
pause(e, t = "manual") {
|
|
963
|
+
let n = a.get(e);
|
|
964
|
+
n && !n.paused.has(t) && (n.timer !== void 0 && (n.remaining = Math.max(0, n.remaining - (Date.now() - n.startedAt)), c(n)), n.paused.add(t));
|
|
965
|
+
},
|
|
966
|
+
resume(e, t = "manual") {
|
|
967
|
+
let n = a.get(e);
|
|
968
|
+
n && n.paused.delete(t) && !n.paused.size && u(e, n);
|
|
969
|
+
},
|
|
970
|
+
clear(e) {
|
|
971
|
+
for (let t of n.value) t.group === e && l(t.id);
|
|
972
|
+
},
|
|
973
|
+
add(e, t = e.life) {
|
|
974
|
+
e.tone === void 0 && s();
|
|
975
|
+
let i = ++r, a = Ue(e), c = $(t, o(a)), l = {
|
|
976
|
+
...e,
|
|
977
|
+
id: i,
|
|
978
|
+
tone: a,
|
|
979
|
+
severity: We(a),
|
|
980
|
+
life: c
|
|
981
|
+
};
|
|
982
|
+
return n.value.push(l), d(l, c), i;
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
} };
|
|
986
|
+
function Ke() {
|
|
987
|
+
let e = o(Be, null);
|
|
988
|
+
if (!e) throw Error("Install WlToastService before using WlToast");
|
|
989
|
+
return e;
|
|
990
|
+
}
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region src/composables/useWlConfirm.ts
|
|
993
|
+
function qe() {
|
|
994
|
+
let e = ze(), t = F(), n = /* @__PURE__ */ new Set();
|
|
995
|
+
f(() => {
|
|
996
|
+
n.forEach((t) => e.cancel(t)), n.clear();
|
|
997
|
+
});
|
|
998
|
+
let r = (r, i) => {
|
|
999
|
+
let a = r.tone ?? (i ? "danger" : "accent"), o = {
|
|
1000
|
+
header: r.header ?? t.value.confirmation,
|
|
1001
|
+
message: r.message,
|
|
1002
|
+
group: r.group,
|
|
1003
|
+
acceptLabel: r.acceptLabel ?? t.value.accept,
|
|
1004
|
+
rejectLabel: r.rejectLabel ?? t.value.reject,
|
|
1005
|
+
tone: a,
|
|
1006
|
+
danger: a === "danger",
|
|
1007
|
+
accept: r.accept,
|
|
1008
|
+
reject: r.reject
|
|
1009
|
+
};
|
|
1010
|
+
return n.add(o), e.request(o).then((e) => (n.delete(o), e));
|
|
1011
|
+
};
|
|
1012
|
+
return {
|
|
1013
|
+
confirm: (e) => r(e, !1),
|
|
1014
|
+
confirmDanger: (e) => r(e, !0),
|
|
1015
|
+
close: e.close,
|
|
1016
|
+
closeGroup: e.closeGroup
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
//#endregion
|
|
1020
|
+
//#region src/composables/useWlToast.ts
|
|
1021
|
+
function Je(e) {
|
|
1022
|
+
return typeof e == "string" ? { summary: e } : e;
|
|
1023
|
+
}
|
|
1024
|
+
function Ye(e = {}) {
|
|
1025
|
+
let t = Ke(), n = (n) => (r, i) => {
|
|
1026
|
+
let a = typeof i == "string" ? { detail: i } : i, o = a?.tone ?? n;
|
|
1027
|
+
return t.add({
|
|
1028
|
+
...a,
|
|
1029
|
+
tone: o,
|
|
1030
|
+
severity: We(o),
|
|
1031
|
+
summary: r,
|
|
1032
|
+
group: e.group
|
|
1033
|
+
});
|
|
1034
|
+
}, r = (n) => t.messages.value.some((t) => t.id === n && t.group === e.group), i = (e, n, i = !1) => {
|
|
1035
|
+
r(e) && t.update(e, n, i);
|
|
1036
|
+
}, a = n("success"), o = n("info"), s = n("warning"), c = n("danger");
|
|
1037
|
+
return {
|
|
1038
|
+
show: o,
|
|
1039
|
+
success: a,
|
|
1040
|
+
info: o,
|
|
1041
|
+
warning: s,
|
|
1042
|
+
error: c,
|
|
1043
|
+
ok: a,
|
|
1044
|
+
warn: s,
|
|
1045
|
+
err: c,
|
|
1046
|
+
update: i,
|
|
1047
|
+
dismiss: (e) => {
|
|
1048
|
+
r(e) && t.remove(e);
|
|
1049
|
+
},
|
|
1050
|
+
promise(n, r) {
|
|
1051
|
+
let a = Je(r.loading), o = t.add({
|
|
1052
|
+
...a,
|
|
1053
|
+
tone: a.tone ?? "info",
|
|
1054
|
+
severity: "info",
|
|
1055
|
+
life: 0,
|
|
1056
|
+
group: e.group
|
|
1057
|
+
});
|
|
1058
|
+
return n.then((e) => {
|
|
1059
|
+
let t = Je(typeof r.success == "function" ? r.success(e) : r.success);
|
|
1060
|
+
return i(o, {
|
|
1061
|
+
...t,
|
|
1062
|
+
tone: t.tone ?? "success",
|
|
1063
|
+
severity: "success",
|
|
1064
|
+
detail: t.detail,
|
|
1065
|
+
action: t.action
|
|
1066
|
+
}, !0), e;
|
|
1067
|
+
}, (e) => {
|
|
1068
|
+
let t = Je(typeof r.error == "function" ? r.error(e) : r.error);
|
|
1069
|
+
throw i(o, {
|
|
1070
|
+
...t,
|
|
1071
|
+
tone: t.tone ?? "danger",
|
|
1072
|
+
severity: "error",
|
|
1073
|
+
detail: t.detail,
|
|
1074
|
+
action: t.action
|
|
1075
|
+
}, !0), e;
|
|
1076
|
+
});
|
|
1077
|
+
},
|
|
1078
|
+
clear: () => t.clear(e.group)
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
//#endregion
|
|
1082
|
+
export { N as A, ne as C, oe as D, se as E, S as M, y as N, F as O, b as P, ue as S, re as T, ye as _, Ke as a, _e as b, Ie as c, ke as d, Ee as f, be as g, Se as h, Ue as i, P as j, ae as k, Fe as l, xe as m, qe as n, Re as o, Te as p, Ge as r, ze as s, Ye as t, Pe as u, Ce as v, ie as w, ge as x, ve as y };
|