hys-ui 0.2.0 → 0.4.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 +59 -0
- package/README.md +68 -59
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -142
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +491 -85
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +291 -63
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +118 -80
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/config.js +11 -11
- package/dist/index.js +175 -153
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +185 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +7 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +119 -6
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +22 -3
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const m = (t, n = 0, r = 1) => Math.max(n, Math.min(r, t)), M = (t) => t.trim() !== "" && Number.isFinite(Number(t)) ? Number(t) : void 0;
|
|
2
|
+
function v(t, n) {
|
|
3
|
+
const r = t.endsWith("%"), s = M(r ? t.slice(0, -1) : t);
|
|
4
|
+
return s === void 0 ? void 0 : m(s / (r ? 100 : n));
|
|
5
|
+
}
|
|
6
|
+
function x(t) {
|
|
7
|
+
var s;
|
|
8
|
+
const n = t.match(/^([-+]?(?:\d*\.)?\d+)(deg|rad|turn|grad)?$/i);
|
|
9
|
+
return n ? (Number(n[1]) * ({ deg: 1, rad: 180 / Math.PI, turn: 360, grad: 0.9 }[((s = n[2]) == null ? void 0 : s.toLowerCase()) ?? "deg"] ?? 1) % 360 + 360) % 360 : void 0;
|
|
10
|
+
}
|
|
11
|
+
function l(t, n, r, s = 1) {
|
|
12
|
+
const e = Math.max(t, n, r), i = Math.min(t, n, r), o = e - i;
|
|
13
|
+
let a = 0;
|
|
14
|
+
return o && (a = (e === t ? (n - r) / o + (n < r ? 6 : 0) : e === n ? (r - t) / o + 2 : (t - n) / o + 4) * 60), { h: a, s: e ? o / e : 0, v: e, a: m(s) };
|
|
15
|
+
}
|
|
16
|
+
function b(t) {
|
|
17
|
+
const n = m(t.s), r = m(t.v), s = (t.h % 360 + 360) % 360, e = (i) => {
|
|
18
|
+
const o = (i + s / 60) % 6;
|
|
19
|
+
return m(r - r * n * Math.max(0, Math.min(o, 4 - o, 1)));
|
|
20
|
+
};
|
|
21
|
+
return [e(5), e(3), e(1)];
|
|
22
|
+
}
|
|
23
|
+
function y(t) {
|
|
24
|
+
if (typeof t != "string") return;
|
|
25
|
+
const n = t.trim().toLowerCase();
|
|
26
|
+
if (n === "transparent") return { h: 0, s: 0, v: 0, a: 0 };
|
|
27
|
+
const r = {
|
|
28
|
+
red: "#ff0000",
|
|
29
|
+
green: "#008000",
|
|
30
|
+
blue: "#0000ff",
|
|
31
|
+
black: "#000000",
|
|
32
|
+
white: "#ffffff",
|
|
33
|
+
yellow: "#ffff00",
|
|
34
|
+
orange: "#ffa500",
|
|
35
|
+
purple: "#800080",
|
|
36
|
+
rebeccapurple: "#663399",
|
|
37
|
+
gray: "#808080",
|
|
38
|
+
grey: "#808080",
|
|
39
|
+
cyan: "#00ffff",
|
|
40
|
+
magenta: "#ff00ff",
|
|
41
|
+
lime: "#00ff00",
|
|
42
|
+
navy: "#000080",
|
|
43
|
+
teal: "#008080",
|
|
44
|
+
pink: "#ffc0cb"
|
|
45
|
+
};
|
|
46
|
+
if (r[n]) return y(r[n]);
|
|
47
|
+
const s = n.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i);
|
|
48
|
+
if (s) {
|
|
49
|
+
const u = s[1].length <= 4 ? [...s[1]].map((f) => f + f).join("") : s[1];
|
|
50
|
+
return l(
|
|
51
|
+
...[0, 2, 4].map((f) => parseInt(u.slice(f, f + 2), 16) / 255),
|
|
52
|
+
u.length === 8 ? parseInt(u.slice(6, 8), 16) / 255 : 1
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const e = n.match(/^(rgba?|hsla?|hsva?)\(([^()]*)\)$/);
|
|
56
|
+
if (!e) return;
|
|
57
|
+
const i = e[2].trim().replace(/\s*[,/]\s*/g, " ").split(/\s+/);
|
|
58
|
+
if (i.length < 3 || i.length > 4) return;
|
|
59
|
+
const o = i[3] === void 0 ? 1 : v(i[3], 1);
|
|
60
|
+
if (o === void 0) return;
|
|
61
|
+
if (e[1].startsWith("rgb")) {
|
|
62
|
+
const u = i.slice(0, 3).map((f) => v(f, 255));
|
|
63
|
+
return u.some((f) => f === void 0) ? void 0 : l(...u, o);
|
|
64
|
+
}
|
|
65
|
+
const a = x(i[0]), d = v(i[1], 100), c = v(i[2], 100);
|
|
66
|
+
if (a === void 0 || d === void 0 || c === void 0) return;
|
|
67
|
+
if (e[1].startsWith("hsv")) return { h: a, s: d, v: c, a: o };
|
|
68
|
+
const g = c, p = g + d * Math.min(g, 1 - g);
|
|
69
|
+
return { h: a, s: p ? 2 * (1 - g / p) : 0, v: p, a: o };
|
|
70
|
+
}
|
|
71
|
+
const h = (t, n = 1) => Number(t.toFixed(n));
|
|
72
|
+
function C(t, n = "hex", r = !1) {
|
|
73
|
+
const s = b(t), e = h(m(t.a), 3), i = s.map((c) => Math.round(c * 255)), o = h((t.h % 360 + 360) % 360);
|
|
74
|
+
if (n === "hex")
|
|
75
|
+
return "#" + i.map((c) => c.toString(16).padStart(2, "0")).join("") + (r ? Math.round(e * 255).toString(16).padStart(2, "0") : "");
|
|
76
|
+
if (n === "rgb")
|
|
77
|
+
return (r ? "rgba(" : "rgb(") + i.join(", ") + (r ? ", " + e : "") + ")";
|
|
78
|
+
if (n === "hsv")
|
|
79
|
+
return (r ? "hsva(" : "hsv(") + o + ", " + h(t.s * 100) + "%, " + h(t.v * 100) + "%" + (r ? ", " + e : "") + ")";
|
|
80
|
+
const a = t.v * (1 - t.s / 2), d = a > 0 && a < 1 ? (t.v - a) / Math.min(a, 1 - a) : 0;
|
|
81
|
+
return (r ? "hsla(" : "hsl(") + o + ", " + h(d * 100) + "%, " + h(a * 100) + "%" + (r ? ", " + e : "") + ")";
|
|
82
|
+
}
|
|
83
|
+
const N = (t) => C(t, "rgb", !0);
|
|
84
|
+
function w(t, n) {
|
|
85
|
+
if (!t || !n) return t === n;
|
|
86
|
+
const r = b(t), s = b(n);
|
|
87
|
+
return r.every((e, i) => Math.abs(e - s[i]) <= 1 / 255) && Math.abs(t.a - n.a) <= 4e-3;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
m as colorClamp,
|
|
91
|
+
N as colorCss,
|
|
92
|
+
l as colorFromRgb,
|
|
93
|
+
b as colorRgb,
|
|
94
|
+
C as formatColor,
|
|
95
|
+
y as parseColor,
|
|
96
|
+
w as sameColor
|
|
97
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const g = (e) => typeof e == "string" || typeof e == "number" && Number.isFinite(e), u = (e) => typeof e + ":" + e, w = (e, i) => typeof e == "number" && Number.isFinite(e) && e >= 1 ? Math.floor(e) : i;
|
|
2
|
+
function l(e, i) {
|
|
3
|
+
const r = e;
|
|
4
|
+
return Object.hasOwn(r, i) ? r[i] : i.split(".").reduce(
|
|
5
|
+
(d, s) => d && typeof d == "object" && Object.hasOwn(d, s) ? d[s] : void 0,
|
|
6
|
+
r
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function y(e, i) {
|
|
10
|
+
return typeof i.field == "function" ? i.field(e) : l(e, i.field ?? i.key);
|
|
11
|
+
}
|
|
12
|
+
function b(e, i, r) {
|
|
13
|
+
const d = e.map(
|
|
14
|
+
(c, f) => typeof i == "function" ? i(c, f + r) : l(c, i)
|
|
15
|
+
), s = new Set(d.filter(g)), h = /* @__PURE__ */ new Set();
|
|
16
|
+
return e.map((c, f) => {
|
|
17
|
+
const p = d[f];
|
|
18
|
+
let t = f + r;
|
|
19
|
+
if (g(p) && !h.has(p)) t = p;
|
|
20
|
+
else {
|
|
21
|
+
for (; s.has(t); ) t = "row:" + t;
|
|
22
|
+
s.add(t);
|
|
23
|
+
}
|
|
24
|
+
return h.add(t), { row: c, id: t, index: f + r };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function k(e, i, r) {
|
|
28
|
+
const d = new Set(e.map(({ id: t }) => t)), s = /* @__PURE__ */ new Map();
|
|
29
|
+
for (const { row: t, id: o } of e) {
|
|
30
|
+
const n = l(t, i);
|
|
31
|
+
g(n) && n !== o && d.has(n) && s.set(o, n);
|
|
32
|
+
}
|
|
33
|
+
const h = /* @__PURE__ */ new Set();
|
|
34
|
+
for (const { id: t } of e) {
|
|
35
|
+
const o = /* @__PURE__ */ new Set();
|
|
36
|
+
let n = t;
|
|
37
|
+
for (; n !== void 0 && !h.has(n); ) {
|
|
38
|
+
if (o.has(n)) {
|
|
39
|
+
s.delete(n);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
o.add(n), n = s.get(n);
|
|
43
|
+
}
|
|
44
|
+
for (const a of o) h.add(a);
|
|
45
|
+
}
|
|
46
|
+
const c = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const t of e) {
|
|
48
|
+
const o = s.get(t.id), n = c.get(o);
|
|
49
|
+
n ? n.push(t) : c.set(o, [t]);
|
|
50
|
+
}
|
|
51
|
+
const f = (c.get(void 0) ?? []).map((t) => ({ row: t, depth: 0 })).reverse(), p = [];
|
|
52
|
+
for (; f.length; ) {
|
|
53
|
+
const { row: t, depth: o } = f.pop(), n = c.get(t.id);
|
|
54
|
+
if (p.push({ ...t, depth: o, hasChildren: !!(n != null && n.length) }), n && r.has(t.id))
|
|
55
|
+
for (let a = n.length - 1; a >= 0; a--)
|
|
56
|
+
f.push({ row: n[a], depth: o + 1 });
|
|
57
|
+
}
|
|
58
|
+
return p;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
l as gridField,
|
|
62
|
+
g as gridKey,
|
|
63
|
+
b as gridRows,
|
|
64
|
+
u as gridToken,
|
|
65
|
+
k as gridTree,
|
|
66
|
+
y as gridValue,
|
|
67
|
+
w as positiveInteger
|
|
68
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const i = {
|
|
2
|
+
xs: 280,
|
|
3
|
+
sm: 360,
|
|
4
|
+
md: 520,
|
|
5
|
+
lg: 736,
|
|
6
|
+
xl: 960,
|
|
7
|
+
full: "100%"
|
|
8
|
+
}, n = (t) => t === "top" || t === "bottom";
|
|
9
|
+
function r(t) {
|
|
10
|
+
const e = t.size ?? "md";
|
|
11
|
+
return (n(t.placement) ? t.height ?? t.width : t.width) ?? (typeof e == "string" && Object.hasOwn(i, e) ? i[e] : e);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
r as drawerSize,
|
|
15
|
+
i as drawerSizes,
|
|
16
|
+
n as drawerVertical
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
if (t)
|
|
3
|
+
try {
|
|
4
|
+
const e = new URL(t, document.baseURI);
|
|
5
|
+
if (["http:", "https:", "blob:"].includes(e.protocol) || /^data:image\//i.test(t))
|
|
6
|
+
return e.href;
|
|
7
|
+
} catch {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const i = (t, e, n, r) => Number.isFinite(t) ? Math.max(n, Math.min(r, t)) : e;
|
|
11
|
+
export {
|
|
12
|
+
c as feedbackImage,
|
|
13
|
+
i as feedbackNumber
|
|
14
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function B(t, x, u, y, o, e, F) {
|
|
2
|
+
const { width: f, height: n } = u, m = Math.min(x.width, Math.max(0, f - 2 * e)), s = Math.min(x.height, Math.max(0, n - 2 * e)), [j, l] = y.split("-"), b = {
|
|
3
|
+
top: t.top - o,
|
|
4
|
+
bottom: n - t.bottom - o,
|
|
5
|
+
left: t.left - o,
|
|
6
|
+
right: f - t.right - o
|
|
7
|
+
}, k = { top: "bottom", bottom: "top", left: "right", right: "left" }, i = j, M = i === "top" || i === "bottom", c = k[i], h = F && b[i] < (M ? s : m) && b[c] > b[i] ? c : i, v = (p, r, w) => l === "start" ? p : l === "end" ? r - w : (p + r - w) / 2, q = M ? v(t.left, t.right, m) : h === "left" ? t.left - m - o : t.right + o, A = M ? h === "top" ? t.top - s - o : t.bottom + o : v(t.top, t.bottom, s);
|
|
8
|
+
return {
|
|
9
|
+
width: m,
|
|
10
|
+
height: s,
|
|
11
|
+
x: Math.max(e, Math.min(q, f - m - e)),
|
|
12
|
+
y: Math.max(e, Math.min(A, n - s - e)),
|
|
13
|
+
placement: l ? h + "-" + l : h
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
B as positionFloating
|
|
18
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function M(e) {
|
|
2
|
+
var s;
|
|
3
|
+
const i = typeof e.prefix == "string" ? [e.prefix] : e.prefix ?? ((s = e.triggers) != null && s.length ? [] : ["@"]), r = /* @__PURE__ */ new Map();
|
|
4
|
+
for (const n of i) n && r.set(n, { prefix: n });
|
|
5
|
+
for (const n of e.triggers ?? [])
|
|
6
|
+
n.prefix && r.set(n.prefix, n);
|
|
7
|
+
return [...r.values()].sort((n, t) => t.prefix.length - n.prefix.length);
|
|
8
|
+
}
|
|
9
|
+
function w(e, i, r, s) {
|
|
10
|
+
const n = Math.max(0, Math.min(e.length, Math.trunc(i) || 0)), t = e.slice(0, n);
|
|
11
|
+
let o;
|
|
12
|
+
for (const f of r) {
|
|
13
|
+
const { prefix: u } = f, a = f.match ?? s.matchTrigger, c = a == null ? void 0 : a({ text: e, caret: n, prefix: u });
|
|
14
|
+
if (a && !c) continue;
|
|
15
|
+
const l = (c == null ? void 0 : c.start) ?? t.lastIndexOf(u);
|
|
16
|
+
if (!Number.isInteger(l) || l < 0 || l + u.length > n || !t.startsWith(u, l) || o && l < o.start + o.prefix.length) continue;
|
|
17
|
+
const h = f.boundary ?? s.boundary;
|
|
18
|
+
if (typeof h == "function" && !h(e, l) || h === "word" && /[\p{L}\p{N}\p{M}_]$/u.test(t.slice(0, l)))
|
|
19
|
+
continue;
|
|
20
|
+
const p = (c == null ? void 0 : c.query) ?? t.slice(l + u.length), x = f.allowSpaces ?? s.allowSpaces, g = f.split ?? s.split;
|
|
21
|
+
!a && (/[\r\n]/.test(p) || !x && /\s/.test(p) || g && (!x || /\S/.test(g)) && p.includes(g) || r.some((m) => p.includes(m.prefix))) || (o = { prefix: u, query: p, start: l, end: n });
|
|
22
|
+
}
|
|
23
|
+
return o;
|
|
24
|
+
}
|
|
25
|
+
function d(e, i) {
|
|
26
|
+
const r = i.filter(
|
|
27
|
+
(t) => t && typeof t.text == "string" && t.text.length > 0 && (typeof t.id == "string" || typeof t.id == "number") && (typeof t.value == "string" || typeof t.value == "number") && typeof t.label == "string" && typeof t.type == "string" && typeof t.prefix == "string" && Number.isInteger(t.start) && Number.isInteger(t.end) && t.start >= 0 && t.end <= e.length && t.start < t.end && e.slice(t.start, t.end) === t.text
|
|
28
|
+
).sort((t, o) => t.start - o.start || o.end - t.end), s = [];
|
|
29
|
+
let n = 0;
|
|
30
|
+
for (const t of r)
|
|
31
|
+
t.start < n || (s.push({ ...t }), n = t.end);
|
|
32
|
+
return s;
|
|
33
|
+
}
|
|
34
|
+
function S(e) {
|
|
35
|
+
return JSON.stringify({
|
|
36
|
+
text: e.text,
|
|
37
|
+
entities: d(e.text, e.entities)
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function b(e) {
|
|
41
|
+
const i = JSON.parse(e);
|
|
42
|
+
if (!i || typeof i != "object" || !("text" in i) || typeof i.text != "string" || !("entities" in i) || !Array.isArray(i.entities))
|
|
43
|
+
throw new TypeError("Invalid Mention document");
|
|
44
|
+
return {
|
|
45
|
+
text: i.text,
|
|
46
|
+
entities: d(i.text, i.entities)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function v(e, i, r) {
|
|
50
|
+
if (!r && e.text === i) return e.entities;
|
|
51
|
+
let s = (r == null ? void 0 : r.start) ?? 0, n = (r == null ? void 0 : r.end) ?? e.text.length;
|
|
52
|
+
if (!r) {
|
|
53
|
+
const o = Math.min(e.text.length, i.length);
|
|
54
|
+
for (; s < o && e.text[s] === i[s]; ) s++;
|
|
55
|
+
let f = i.length;
|
|
56
|
+
for (; n > s && f > s && e.text[n - 1] === i[f - 1]; )
|
|
57
|
+
n--, f--;
|
|
58
|
+
}
|
|
59
|
+
const t = i.length - e.text.length;
|
|
60
|
+
return e.entities.flatMap((o) => o.end <= s ? [o] : o.start >= n ? [
|
|
61
|
+
{ ...o, start: o.start + t, end: o.end + t }
|
|
62
|
+
] : []);
|
|
63
|
+
}
|
|
64
|
+
function N(e, i) {
|
|
65
|
+
const r = [];
|
|
66
|
+
let s = 0;
|
|
67
|
+
for (const n of i)
|
|
68
|
+
s < n.start && r.push({ text: e.slice(s, n.start), start: s }), r.push({ text: n.text, start: n.start, entity: n }), s = n.end;
|
|
69
|
+
return (s < e.length || !r.length) && r.push({ text: e.slice(s), start: s }), r;
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
b as deserializeMentionDocument,
|
|
73
|
+
w as matchMention,
|
|
74
|
+
N as mentionSegments,
|
|
75
|
+
M as mentionTriggers,
|
|
76
|
+
d as normalizeMentionEntities,
|
|
77
|
+
v as rebaseMentionEntities,
|
|
78
|
+
S as serializeMentionDocument
|
|
79
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function p(t) {
|
|
2
|
+
return t.tagName === "INPUT" || t.tagName === "TEXTAREA";
|
|
3
|
+
}
|
|
4
|
+
function E(t, n) {
|
|
5
|
+
var d;
|
|
6
|
+
if (p(t))
|
|
7
|
+
return {
|
|
8
|
+
start: t.selectionStart ?? n,
|
|
9
|
+
end: t.selectionEnd ?? n
|
|
10
|
+
};
|
|
11
|
+
const r = (d = t.ownerDocument.defaultView) == null ? void 0 : d.getSelection();
|
|
12
|
+
if (!(r != null && r.rangeCount)) return { start: n, end: n };
|
|
13
|
+
const e = r.getRangeAt(0);
|
|
14
|
+
if (!t.contains(e.startContainer) || !t.contains(e.endContainer))
|
|
15
|
+
return { start: n, end: n };
|
|
16
|
+
const o = t.ownerDocument.createRange();
|
|
17
|
+
o.selectNodeContents(t), o.setEnd(e.startContainer, e.startOffset);
|
|
18
|
+
const s = o.toString().length;
|
|
19
|
+
return { start: s, end: s + e.toString().length };
|
|
20
|
+
}
|
|
21
|
+
function A(t, n) {
|
|
22
|
+
var u;
|
|
23
|
+
if (p(t)) {
|
|
24
|
+
t.setSelectionRange(n.start, n.end);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const r = t.ownerDocument, e = (u = r.defaultView) == null ? void 0 : u.getSelection();
|
|
28
|
+
if (!e) return;
|
|
29
|
+
function o(R) {
|
|
30
|
+
var N, S;
|
|
31
|
+
const f = r.createTreeWalker(t, 4);
|
|
32
|
+
let c = R;
|
|
33
|
+
for (let i = f.nextNode(); i; i = f.nextNode()) {
|
|
34
|
+
const h = ((N = i.textContent) == null ? void 0 : N.length) ?? 0;
|
|
35
|
+
if (c <= h) {
|
|
36
|
+
const a = (S = i.parentElement) == null ? void 0 : S.closest(
|
|
37
|
+
"[data-mention-entity]"
|
|
38
|
+
);
|
|
39
|
+
if (a != null && a.parentNode) {
|
|
40
|
+
const C = Array.from(a.parentNode.childNodes).indexOf(
|
|
41
|
+
a
|
|
42
|
+
);
|
|
43
|
+
return [a.parentNode, C + (c > 0 ? 1 : 0)];
|
|
44
|
+
}
|
|
45
|
+
return [i, Math.max(0, c)];
|
|
46
|
+
}
|
|
47
|
+
c -= h;
|
|
48
|
+
}
|
|
49
|
+
return [t, t.childNodes.length];
|
|
50
|
+
}
|
|
51
|
+
const [s, d] = o(n.start), [w, x] = o(n.end), g = r.createRange();
|
|
52
|
+
g.setStart(s, d), g.setEnd(w, x), e.removeAllRanges(), e.addRange(g);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
p as isNativeMentionInput,
|
|
56
|
+
E as readMentionSelection,
|
|
57
|
+
A as writeMentionSelection
|
|
58
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { toRaw as O } from "vue";
|
|
2
|
+
const h = (o) => typeof o + ":" + o;
|
|
3
|
+
function K(o) {
|
|
4
|
+
return [
|
|
5
|
+
...new Set(
|
|
6
|
+
(o ?? []).filter(
|
|
7
|
+
(t) => typeof t == "string" || typeof t == "number" && Number.isFinite(t)
|
|
8
|
+
)
|
|
9
|
+
)
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
const A = (o, t) => o.length === t.length && o.every((n, d) => n === t[d]);
|
|
13
|
+
function R(o, t) {
|
|
14
|
+
let n = o;
|
|
15
|
+
for (const d of t.split(".")) {
|
|
16
|
+
if (!n || typeof n != "object" || !Object.prototype.hasOwnProperty.call(n, d))
|
|
17
|
+
return;
|
|
18
|
+
n = n[d];
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
const G = (o, t) => o === "_blank" ? [
|
|
23
|
+
...new Set(
|
|
24
|
+
(t ?? "").split(/\s+/).filter(Boolean).concat("noopener", "noreferrer")
|
|
25
|
+
)
|
|
26
|
+
].join(" ") : t;
|
|
27
|
+
function M(o, t = {}) {
|
|
28
|
+
const n = [], d = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new WeakSet();
|
|
29
|
+
let w = 0;
|
|
30
|
+
function b(c, s, j = !1, m = 0) {
|
|
31
|
+
if (m > 32) return [];
|
|
32
|
+
const v = [];
|
|
33
|
+
for (const u of c) {
|
|
34
|
+
if (!u || typeof u != "object" || g.has(u)) continue;
|
|
35
|
+
g.add(u);
|
|
36
|
+
const e = (r) => R(u, t[r] ?? r);
|
|
37
|
+
if (e("hidden")) continue;
|
|
38
|
+
const p = e("value"), l = typeof p == "string" || typeof p == "number" && Number.isFinite(p) ? p : void 0, k = e("type"), i = ["divider", "group", "checkbox", "radio"].includes(
|
|
39
|
+
String(k)
|
|
40
|
+
) ? k : "item";
|
|
41
|
+
if (i !== "divider" && i !== "group" && (l === void 0 || d.has(h(l))))
|
|
42
|
+
continue;
|
|
43
|
+
i !== "divider" && i !== "group" && d.add(h(l));
|
|
44
|
+
const a = (r) => String(e(r) ?? ""), y = e("icon"), S = e("children"), f = {
|
|
45
|
+
id: l === void 0 || i === "group" || i === "divider" ? "structure-" + ++w : encodeURIComponent(h(l)),
|
|
46
|
+
raw: u,
|
|
47
|
+
key: l,
|
|
48
|
+
label: a("label"),
|
|
49
|
+
type: i,
|
|
50
|
+
disabled: j || !!e("disabled"),
|
|
51
|
+
danger: !!e("danger"),
|
|
52
|
+
icon: y && (typeof y == "object" || typeof y == "function") ? O(y) : void 0,
|
|
53
|
+
description: a("description"),
|
|
54
|
+
shortcut: a("shortcut"),
|
|
55
|
+
href: e("href") == null ? void 0 : a("href"),
|
|
56
|
+
target: e("target") == null ? void 0 : a("target"),
|
|
57
|
+
rel: e("rel") == null ? void 0 : a("rel"),
|
|
58
|
+
radioGroup: e("radioGroup"),
|
|
59
|
+
checked: !!e("checked"),
|
|
60
|
+
closeOnSelect: typeof e("closeOnSelect") == "boolean" ? e("closeOnSelect") : void 0,
|
|
61
|
+
children: [],
|
|
62
|
+
parents: s,
|
|
63
|
+
path: s.map((r) => r.raw).concat(u),
|
|
64
|
+
keys: s.flatMap((r) => r.key === void 0 ? [] : [r.key]).concat(l === void 0 ? [] : [l]),
|
|
65
|
+
level: s.length
|
|
66
|
+
};
|
|
67
|
+
if (v.push(f), n.push(f), Array.isArray(S) && i !== "divider") {
|
|
68
|
+
const r = b(
|
|
69
|
+
S,
|
|
70
|
+
i === "group" ? s : s.concat(f),
|
|
71
|
+
f.disabled,
|
|
72
|
+
m + 1
|
|
73
|
+
);
|
|
74
|
+
i === "group" ? v.push(...r) : f.children = r;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return v;
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
roots: b(o, []),
|
|
81
|
+
all: n,
|
|
82
|
+
byKey: new Map(
|
|
83
|
+
n.filter(
|
|
84
|
+
(c) => c.key !== void 0 && c.type !== "divider" && c.type !== "group"
|
|
85
|
+
).map((c) => [h(c.key), c])
|
|
86
|
+
)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
R as menuField,
|
|
91
|
+
K as menuKeys,
|
|
92
|
+
A as menuKeysEqual,
|
|
93
|
+
M as menuRows,
|
|
94
|
+
G as menuSafeRel,
|
|
95
|
+
h as menuToken
|
|
96
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const d = {
|
|
2
|
+
xs: 360,
|
|
3
|
+
sm: 440,
|
|
4
|
+
md: 560,
|
|
5
|
+
lg: 720,
|
|
6
|
+
xl: 960,
|
|
7
|
+
"2xl": 1200,
|
|
8
|
+
full: "100%"
|
|
9
|
+
}, i = (t) => t.width ?? d[t.size ?? "md"], m = (t) => typeof t == "number" ? Number.isFinite(t) && t >= 0 ? t + "px" : void 0 : t;
|
|
10
|
+
export {
|
|
11
|
+
m as modalLength,
|
|
12
|
+
i as modalWidth,
|
|
13
|
+
d as modalWidths
|
|
14
|
+
};
|
|
@@ -1,25 +1,55 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { computed as f, ref as h } from "vue";
|
|
2
|
+
const v = Symbol(
|
|
3
|
+
"hys-ui-overlay-owner"
|
|
4
|
+
), t = [], l = h(0);
|
|
5
|
+
function b(o, d, m) {
|
|
6
|
+
const n = Symbol(o);
|
|
7
|
+
t.push({ id: n, kind: o, dismiss: d, base: m }), l.value = t.length;
|
|
8
|
+
const g = f(() => {
|
|
9
|
+
var r;
|
|
10
|
+
l.value;
|
|
11
|
+
let e = -2;
|
|
12
|
+
for (const i of t) {
|
|
13
|
+
const u = (r = i.base) == null ? void 0 : r.call(i);
|
|
14
|
+
if (e = Math.max(
|
|
15
|
+
e + 2,
|
|
16
|
+
Number.isFinite(u) ? Math.max(0, u) : i.kind === "floating" ? 1200 : 100
|
|
17
|
+
), i.id === n) return e;
|
|
18
|
+
}
|
|
19
|
+
return o === "floating" ? 1200 : 100;
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
id: n,
|
|
23
|
+
zIndex: g,
|
|
24
|
+
isTop: () => {
|
|
25
|
+
var e;
|
|
26
|
+
return ((e = t.at(-1)) == null ? void 0 : e.id) === n;
|
|
27
|
+
},
|
|
28
|
+
unregister: () => {
|
|
29
|
+
const e = t.findIndex((r) => r.id === n);
|
|
30
|
+
e >= 0 && t.splice(e, 1), l.value = t.length;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
12
33
|
}
|
|
13
|
-
let
|
|
14
|
-
function
|
|
15
|
-
|
|
34
|
+
let a = 0, c = "", s = "", y = "";
|
|
35
|
+
function w() {
|
|
36
|
+
if (a++ === 0) {
|
|
37
|
+
c = document.body.style.overflow, s = document.body.style.paddingRight, y = document.body.style.getPropertyPriority("padding-right");
|
|
38
|
+
const d = document.documentElement.clientWidth > 0 ? Math.max(0, window.innerWidth - document.documentElement.clientWidth) : 0;
|
|
39
|
+
d && (document.body.style.paddingRight = (parseFloat(getComputedStyle(document.body).paddingRight) || 0) + d + "px"), document.body.style.overflow = "hidden";
|
|
40
|
+
}
|
|
16
41
|
let o = !1;
|
|
17
42
|
return () => {
|
|
18
|
-
o || (o = !0, --
|
|
43
|
+
o || (o = !0, --a === 0 && (document.body.style.overflow = c, document.body.style.setProperty(
|
|
44
|
+
"padding-right",
|
|
45
|
+
s,
|
|
46
|
+
y
|
|
47
|
+
)));
|
|
19
48
|
};
|
|
20
49
|
}
|
|
21
50
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
w as lockBodyScroll,
|
|
52
|
+
l as overlayCount,
|
|
53
|
+
v as overlayOwnerKey,
|
|
54
|
+
b as registerOverlay
|
|
25
55
|
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
const a = (t) => Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0, h = (t, o, e, i) => Number.isFinite(t) ? Math.max(e, Math.min(i, t)) : o, u = "var(--hys-ui-primary,var(--hys-ui-theme-primary))", y = (t) => ({
|
|
2
|
+
normal: u,
|
|
3
|
+
active: u,
|
|
4
|
+
success: "var(--hys-ui-success,var(--hys-ui-theme-success,#16a46e))",
|
|
5
|
+
warning: "var(--hys-ui-warning,var(--hys-ui-theme-warning,#d9860c))",
|
|
6
|
+
error: "var(--hys-ui-red,var(--hys-ui-theme-red,#ed4556))"
|
|
7
|
+
})[t] || u, f = (t, o) => typeof t == "string" && t.trim() ? t.trim() : o;
|
|
8
|
+
function m(t) {
|
|
9
|
+
return typeof t == "number" ? Number.isFinite(t) ? (t % 360 + 360) % 360 : 90 : {
|
|
10
|
+
"to top": 0,
|
|
11
|
+
"to top right": 45,
|
|
12
|
+
"to right": 90,
|
|
13
|
+
"to bottom right": 135,
|
|
14
|
+
"to bottom": 180,
|
|
15
|
+
"to bottom left": 225,
|
|
16
|
+
"to left": 270,
|
|
17
|
+
"to top left": 315
|
|
18
|
+
}[t ?? "to right"] ?? 90;
|
|
19
|
+
}
|
|
20
|
+
function p(t, o, e) {
|
|
21
|
+
var i;
|
|
22
|
+
if (typeof t == "function")
|
|
23
|
+
try {
|
|
24
|
+
return { color: f(t(o), e) };
|
|
25
|
+
} catch {
|
|
26
|
+
return { color: e };
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(t)) {
|
|
29
|
+
if (t.every((r) => typeof r == "string")) {
|
|
30
|
+
const r = t.filter(
|
|
31
|
+
(n) => n.trim()
|
|
32
|
+
);
|
|
33
|
+
return r.length > 1 ? {
|
|
34
|
+
color: r[0],
|
|
35
|
+
gradient: {
|
|
36
|
+
angle: 90,
|
|
37
|
+
stops: r.map((n, c) => ({
|
|
38
|
+
offset: c / (r.length - 1) * 100,
|
|
39
|
+
color: n
|
|
40
|
+
}))
|
|
41
|
+
}
|
|
42
|
+
} : { color: r[0] || e };
|
|
43
|
+
}
|
|
44
|
+
const s = t.filter(
|
|
45
|
+
(r) => r && Number.isFinite(r.value) && typeof r.color == "string" && r.color.trim()
|
|
46
|
+
).map((r) => ({ ...r, value: a(r.value) })).sort((r, n) => r.value - n.value);
|
|
47
|
+
return {
|
|
48
|
+
color: ((i = s.find((r) => o <= r.value) ?? s.at(-1)) == null ? void 0 : i.color) || e
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (t && typeof t == "object") {
|
|
52
|
+
const s = t, r = [
|
|
53
|
+
{ offset: 0, color: f(s.from, e) },
|
|
54
|
+
...(s.stops ?? []).filter(
|
|
55
|
+
(n) => n && Number.isFinite(n.offset) && typeof n.color == "string" && n.color.trim()
|
|
56
|
+
).map((n) => ({
|
|
57
|
+
offset: a(n.offset),
|
|
58
|
+
color: n.color
|
|
59
|
+
})),
|
|
60
|
+
{ offset: 100, color: f(s.to, e) }
|
|
61
|
+
].sort((n, c) => n.offset - c.offset);
|
|
62
|
+
return {
|
|
63
|
+
color: r[0].color,
|
|
64
|
+
gradient: { stops: r, angle: m(s.direction) }
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return { color: f(t, e) };
|
|
68
|
+
}
|
|
69
|
+
function $(t) {
|
|
70
|
+
return t.gradient ? `linear-gradient(${t.gradient.angle}deg,${t.gradient.stops.map((o) => `${o.color} ${o.offset}%`).join(",")})` : t.color;
|
|
71
|
+
}
|
|
72
|
+
function l(t) {
|
|
73
|
+
const o = t * Math.PI / 180, e = Math.sin(o) * 50, i = -Math.cos(o) * 50;
|
|
74
|
+
return { x1: 50 - e, y1: 50 - i, x2: 50 + e, y2: 50 + i };
|
|
75
|
+
}
|
|
76
|
+
function M(t, o, e) {
|
|
77
|
+
const i = (s) => {
|
|
78
|
+
const r = s * Math.PI / 180;
|
|
79
|
+
return `${+(50 + t * Math.cos(r)).toFixed(5)} ${+(50 + t * Math.sin(r)).toFixed(5)}`;
|
|
80
|
+
};
|
|
81
|
+
return e <= 0 ? "" : e >= 359.99999 ? `M ${i(o)} A ${t} ${t} 0 1 1 ${i(o + 180)} A ${t} ${t} 0 1 1 ${i(o + 360)}` : `M ${i(o)} A ${t} ${t} 0 ${e > 180 ? 1 : 0} 1 ${i(o + e)}`;
|
|
82
|
+
}
|
|
83
|
+
let g = 0;
|
|
84
|
+
const v = () => `hys-ui-progress-${++g}`;
|
|
85
|
+
export {
|
|
86
|
+
M as progressArc,
|
|
87
|
+
$ as progressCssPaint,
|
|
88
|
+
l as progressGradientCoordinates,
|
|
89
|
+
v as progressId,
|
|
90
|
+
h as progressNumber,
|
|
91
|
+
p as progressPaint,
|
|
92
|
+
a as progressPercent,
|
|
93
|
+
y as progressStatusColor
|
|
94
|
+
};
|