hys-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function h(n, t = "YYYY-MM-DD") {
|
|
2
|
+
if (n instanceof Date)
|
|
3
|
+
return Number.isFinite(n.getTime()) ? f(n.getFullYear(), n.getMonth(), n.getDate()) : void 0;
|
|
4
|
+
if (typeof n != "string") return;
|
|
5
|
+
let e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(n);
|
|
6
|
+
if (!e && t !== "YYYY-MM-DD") {
|
|
7
|
+
const d = [], u = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/YYYY|MM|DD/g, (y) => (d.push(y), y === "YYYY" ? "(\\d{4})" : "(\\d{2})"));
|
|
8
|
+
if (d.length !== 3 || new Set(d).size !== 3) return;
|
|
9
|
+
const s = new RegExp("^" + u + "$").exec(n);
|
|
10
|
+
s && (e = [
|
|
11
|
+
s[0],
|
|
12
|
+
s[d.indexOf("YYYY") + 1],
|
|
13
|
+
s[d.indexOf("MM") + 1],
|
|
14
|
+
s[d.indexOf("DD") + 1]
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
if (!e) return;
|
|
18
|
+
const a = +e[1], o = +e[2] - 1, c = +e[3];
|
|
19
|
+
if (a < 1 || a > 9999 || o < 0 || o > 11 || c < 1 || c > 31) return;
|
|
20
|
+
const Y = f(a, o, c), i = new Date(Y * 864e5);
|
|
21
|
+
if (i.getUTCFullYear() === a && i.getUTCMonth() === o && i.getUTCDate() === c)
|
|
22
|
+
return Y;
|
|
23
|
+
}
|
|
24
|
+
function f(n, t, e) {
|
|
25
|
+
const a = /* @__PURE__ */ new Date(0);
|
|
26
|
+
return a.setUTCFullYear(n, t, e), a.setUTCHours(0, 0, 0, 0), a.getTime() / 864e5;
|
|
27
|
+
}
|
|
28
|
+
function r(n) {
|
|
29
|
+
const t = new Date(n * 864e5);
|
|
30
|
+
return {
|
|
31
|
+
year: t.getUTCFullYear(),
|
|
32
|
+
month: t.getUTCMonth(),
|
|
33
|
+
day: t.getUTCDate(),
|
|
34
|
+
weekday: t.getUTCDay()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function l(n) {
|
|
38
|
+
const t = r(n);
|
|
39
|
+
return `${String(t.year).padStart(4, "0")}-${String(t.month + 1).padStart(2, "0")}-${String(t.day).padStart(2, "0")}`;
|
|
40
|
+
}
|
|
41
|
+
function p(n) {
|
|
42
|
+
const t = r(n), e = /* @__PURE__ */ new Date(0);
|
|
43
|
+
return e.setFullYear(t.year, t.month, t.day), e.setHours(0, 0, 0, 0), e;
|
|
44
|
+
}
|
|
45
|
+
function M(n, t) {
|
|
46
|
+
const e = r(n);
|
|
47
|
+
return t.replace(
|
|
48
|
+
/YYYY|MM|DD/g,
|
|
49
|
+
(a) => a === "YYYY" ? String(e.year).padStart(4, "0") : String(a === "MM" ? e.month + 1 : e.day).padStart(2, "0")
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function m(n, t) {
|
|
53
|
+
const e = r(n), a = r(f(e.year, e.month + t, 1)), o = r(f(a.year, a.month + 1, 0)).day;
|
|
54
|
+
return f(a.year, a.month, Math.min(e.day, o));
|
|
55
|
+
}
|
|
56
|
+
function w(n, t, e) {
|
|
57
|
+
return [
|
|
58
|
+
n - (r(n).weekday - e + 7) % 7,
|
|
59
|
+
t + (e + 6 - r(t).weekday + 7) % 7
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
function S(n) {
|
|
63
|
+
const t = (r(n).weekday + 6) % 7, e = n + 3 - t, a = r(e).year;
|
|
64
|
+
return 1 + Math.floor((e - f(a, 0, 1)) / 7);
|
|
65
|
+
}
|
|
66
|
+
function T(n, t, e) {
|
|
67
|
+
const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const c of n) {
|
|
69
|
+
const Y = h(c.date), i = h(c.end ?? c.date);
|
|
70
|
+
if (Y === void 0 || i === void 0 || i < Y || i < t || Y > e)
|
|
71
|
+
continue;
|
|
72
|
+
const d = /* @__PURE__ */ new Set();
|
|
73
|
+
for (let u = Math.max(Y, t); u <= Math.min(i, e); u++) {
|
|
74
|
+
const s = a.get(u) ?? [];
|
|
75
|
+
s.push(c), a.set(u, s);
|
|
76
|
+
const y = r(u), g = y.year * 12 + y.month;
|
|
77
|
+
if (!d.has(g)) {
|
|
78
|
+
const D = o.get(g) ?? [];
|
|
79
|
+
D.push(c), o.set(g, D), d.add(g);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { dates: a, months: o };
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
p as calendarDate,
|
|
87
|
+
h as calendarDay,
|
|
88
|
+
T as calendarEvents,
|
|
89
|
+
M as calendarFormat,
|
|
90
|
+
l as calendarISO,
|
|
91
|
+
r as calendarParts,
|
|
92
|
+
m as calendarShift,
|
|
93
|
+
S as calendarWeek,
|
|
94
|
+
w as calendarWeeks,
|
|
95
|
+
f as civilDay
|
|
96
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { treeField as n, treeKey as m } from "./tree.js";
|
|
2
|
+
const L = (r) => JSON.stringify(r.map((e) => [typeof e, e]));
|
|
3
|
+
function P(r) {
|
|
4
|
+
try {
|
|
5
|
+
const e = JSON.parse(r);
|
|
6
|
+
return Array.isArray(e) && e.every(
|
|
7
|
+
(l) => Array.isArray(l) && l.length === 2 && m(l[1]) && typeof l[1] === l[0]
|
|
8
|
+
) ? e.map((l) => l[1]) : [];
|
|
9
|
+
} catch {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const j = (r) => Array.isArray(r) && r.every(m), B = {
|
|
14
|
+
panel: "级联选择",
|
|
15
|
+
search: "搜索分类",
|
|
16
|
+
empty: "暂无分类",
|
|
17
|
+
noMatch: "无匹配分类",
|
|
18
|
+
loading: "加载中",
|
|
19
|
+
loadError: "加载失败",
|
|
20
|
+
retry: "重试",
|
|
21
|
+
clear: "清空选择",
|
|
22
|
+
close: "关闭",
|
|
23
|
+
level: "第{level}级",
|
|
24
|
+
expand: "展开 {label}",
|
|
25
|
+
remove: "移除 {label}",
|
|
26
|
+
more: "另外 {count} 项",
|
|
27
|
+
limit: "最多选择 {count} 项"
|
|
28
|
+
};
|
|
29
|
+
function F(r, e, l) {
|
|
30
|
+
var A, w, x, C, S, k, K;
|
|
31
|
+
const i = {
|
|
32
|
+
value: "value",
|
|
33
|
+
label: "label",
|
|
34
|
+
children: "children",
|
|
35
|
+
disabled: "disabled",
|
|
36
|
+
leaf: "isLeaf",
|
|
37
|
+
hasChildren: "hasChildren",
|
|
38
|
+
...e.fieldNames
|
|
39
|
+
}, g = [], o = /* @__PURE__ */ new Map(), h = new Set((l == null ? void 0 : l.nodes) ?? []), c = [...r].reverse().map((t) => ({ node: t, parent: l, target: g }));
|
|
40
|
+
for (; c.length; ) {
|
|
41
|
+
const t = c.pop(), { node: a } = t;
|
|
42
|
+
if (t.exit) {
|
|
43
|
+
h.delete(a);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!a || typeof a != "object" || h.has(a)) continue;
|
|
47
|
+
const f = typeof e.valueKey == "function" ? e.valueKey(a) : n(a, e.valueKey ?? i.value);
|
|
48
|
+
if (!m(f)) continue;
|
|
49
|
+
const M = [...((A = t.parent) == null ? void 0 : A.path) ?? [], f], y = L(M);
|
|
50
|
+
if (o.has(y)) continue;
|
|
51
|
+
const u = [...((w = t.parent) == null ? void 0 : w.nodes) ?? [], a], N = String(n(a, i.label) ?? f), d = n(a, i.children), E = ((x = e.leafMethod) == null ? void 0 : x.call(e, a, u)) ?? n(a, i.leaf) ?? ((C = e.fieldNames) != null && C.leaf ? void 0 : n(a, "leaf")), v = E === !0, J = E === !1, s = {
|
|
52
|
+
value: y,
|
|
53
|
+
label: N,
|
|
54
|
+
raw: a,
|
|
55
|
+
path: M,
|
|
56
|
+
labels: [...((S = t.parent) == null ? void 0 : S.labels) ?? [], N],
|
|
57
|
+
nodes: u,
|
|
58
|
+
disabled: !!((k = t.parent) != null && k.disabled || n(a, i.disabled) || (K = e.disabledMethod) != null && K.call(e, a, u)),
|
|
59
|
+
isLeaf: v,
|
|
60
|
+
hasChildren: !v && !!(Array.isArray(d) && d.length || n(a, i.hasChildren) || J),
|
|
61
|
+
children: []
|
|
62
|
+
};
|
|
63
|
+
if (o.set(y, s), t.target.push(s), h.add(a), c.push({ ...t, exit: !0 }), !v && Array.isArray(d))
|
|
64
|
+
for (let b = d.length - 1; b >= 0; b--)
|
|
65
|
+
c.push({
|
|
66
|
+
node: d[b],
|
|
67
|
+
parent: s,
|
|
68
|
+
target: s.children
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return { roots: g, map: o };
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
F as cascaderEntries,
|
|
75
|
+
P as cascaderPath,
|
|
76
|
+
L as cascaderToken,
|
|
77
|
+
B as cascaderWords,
|
|
78
|
+
j as validCascaderPath
|
|
79
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const s = Symbol(
|
|
2
|
+
"hys-ui-checkbox-group"
|
|
3
|
+
);
|
|
4
|
+
function c(e) {
|
|
5
|
+
return typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
|
|
6
|
+
}
|
|
7
|
+
function u(e) {
|
|
8
|
+
return typeof e + ":" + String(e);
|
|
9
|
+
}
|
|
10
|
+
function y(e) {
|
|
11
|
+
return Array.isArray(e) ? [...new Set(e.filter(c))] : [];
|
|
12
|
+
}
|
|
13
|
+
function b(e, o = {}) {
|
|
14
|
+
const a = /* @__PURE__ */ new Set(), i = [];
|
|
15
|
+
if (!Array.isArray(e)) return i;
|
|
16
|
+
for (const r of e) {
|
|
17
|
+
const n = c(r) ? { label: String(r), value: r } : r;
|
|
18
|
+
if (!n || typeof n != "object") continue;
|
|
19
|
+
const t = n[o.value ?? "value"];
|
|
20
|
+
!c(t) || a.has(u(t)) || (a.add(u(t)), i.push({
|
|
21
|
+
...n,
|
|
22
|
+
label: String(n[o.label ?? "label"] ?? t),
|
|
23
|
+
value: t,
|
|
24
|
+
disabled: !!n[o.disabled ?? "disabled"],
|
|
25
|
+
indeterminate: !!n[o.indeterminate ?? "indeterminate"]
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
return i;
|
|
29
|
+
}
|
|
30
|
+
const f = Symbol("hys-ui-radio-group");
|
|
31
|
+
export {
|
|
32
|
+
s as checkboxGroupKey,
|
|
33
|
+
u as choiceKey,
|
|
34
|
+
b as choiceOptions,
|
|
35
|
+
c as isChoice,
|
|
36
|
+
f as radioGroupKey,
|
|
37
|
+
y as uniqueChoices
|
|
38
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { shallowRef as B, inject as C, computed as R, watch as x, onActivated as E, onDeactivated as L, onBeforeUnmount as M, onMounted as T, onUpdated as U, nextTick as j } from "vue";
|
|
2
|
+
import { formKey as b } from "./formContext.js";
|
|
3
|
+
function D(r, v, f = Object.is, c) {
|
|
4
|
+
const i = B(v()), t = C(b, void 0), l = R(
|
|
5
|
+
() => r.modelValue === void 0 ? i.value : r.modelValue
|
|
6
|
+
);
|
|
7
|
+
let n = !0, s = 0, u;
|
|
8
|
+
function o() {
|
|
9
|
+
s++, u = void 0, c == null || c();
|
|
10
|
+
}
|
|
11
|
+
async function a(e, m, h, V = !1) {
|
|
12
|
+
if (!n || f(l.value, e)) return !1;
|
|
13
|
+
const k = ++s;
|
|
14
|
+
return u = { value: e, version: k }, r.modelValue === void 0 && (i.value = e), m(e), V && h(e), await j(), !n || k !== s || (u = void 0, !f(l.value, e)) ? !1 : (V || h(e), !0);
|
|
15
|
+
}
|
|
16
|
+
function d() {
|
|
17
|
+
o(), r.modelValue === void 0 && (i.value = v());
|
|
18
|
+
}
|
|
19
|
+
return x(
|
|
20
|
+
() => r.modelValue,
|
|
21
|
+
(e) => {
|
|
22
|
+
u && f(e, u.value) || o();
|
|
23
|
+
},
|
|
24
|
+
{ flush: "sync" }
|
|
25
|
+
), x(
|
|
26
|
+
() => t == null ? void 0 : t.resetting.value,
|
|
27
|
+
(e) => {
|
|
28
|
+
e && o();
|
|
29
|
+
},
|
|
30
|
+
{ flush: "sync" }
|
|
31
|
+
), E(() => {
|
|
32
|
+
n = !0;
|
|
33
|
+
}), L(() => {
|
|
34
|
+
n = !1, o();
|
|
35
|
+
}), M(() => {
|
|
36
|
+
n = !1, o();
|
|
37
|
+
}), { current: l, commit: a, reset: d, invalidate: o, isLive: () => n };
|
|
38
|
+
}
|
|
39
|
+
function F(r, v, f, c) {
|
|
40
|
+
let i = !0, t, l = 0;
|
|
41
|
+
function n(o) {
|
|
42
|
+
const a = l;
|
|
43
|
+
queueMicrotask(() => {
|
|
44
|
+
!i || a !== l || o.defaultPrevented || (v(), j(() => f == null ? void 0 : f()));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function s() {
|
|
48
|
+
l++, t == null || t.removeEventListener("reset", n), t = void 0;
|
|
49
|
+
}
|
|
50
|
+
function u() {
|
|
51
|
+
var e, m;
|
|
52
|
+
if (!i) return;
|
|
53
|
+
const o = c == null ? void 0 : c(), a = o ? document.getElementById(o) : ((e = r.value) == null ? void 0 : e.form) || ((m = r.value) == null ? void 0 : m.closest("form")), d = a instanceof HTMLFormElement ? a : void 0;
|
|
54
|
+
d !== t && (s(), t = d, t == null || t.addEventListener("reset", n));
|
|
55
|
+
}
|
|
56
|
+
T(u), U(u), E(() => {
|
|
57
|
+
i = !0, u();
|
|
58
|
+
}), L(() => {
|
|
59
|
+
i = !1, s();
|
|
60
|
+
}), M(() => {
|
|
61
|
+
i = !1, s();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
D as useChoiceModel,
|
|
66
|
+
F as useChoiceNativeReset
|
|
67
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { calendarDate as C, calendarParts as u, civilDay as d, calendarISO as g, calendarDay as N, calendarShift as A } from "./calendar.js";
|
|
2
|
+
const P = {
|
|
3
|
+
open: void 0,
|
|
4
|
+
showConfirm: void 0,
|
|
5
|
+
type: "date",
|
|
6
|
+
clearable: !1,
|
|
7
|
+
editable: !1,
|
|
8
|
+
bordered: !0,
|
|
9
|
+
firstDayOfWeek: 1,
|
|
10
|
+
locale: "zh-CN",
|
|
11
|
+
showAdjacentDays: !0,
|
|
12
|
+
showToday: !0,
|
|
13
|
+
showNow: !0,
|
|
14
|
+
showFooter: !0,
|
|
15
|
+
showSeconds: !0,
|
|
16
|
+
singlePanel: !0,
|
|
17
|
+
rangeSeparator: " 至 ",
|
|
18
|
+
hourStep: 1,
|
|
19
|
+
minuteStep: 1,
|
|
20
|
+
secondStep: 1,
|
|
21
|
+
rangeValidation: "endpoints",
|
|
22
|
+
validateEvent: !0,
|
|
23
|
+
appendTo: "body"
|
|
24
|
+
}, Q = {
|
|
25
|
+
today: "今天",
|
|
26
|
+
now: "此刻",
|
|
27
|
+
clear: "清空",
|
|
28
|
+
cancel: "取消",
|
|
29
|
+
close: "关闭",
|
|
30
|
+
confirm: "确定",
|
|
31
|
+
start: "开始日期",
|
|
32
|
+
end: "结束日期",
|
|
33
|
+
chooseStart: "请选择开始日期",
|
|
34
|
+
chooseEnd: "请选择结束日期",
|
|
35
|
+
invalid: "请选择有效日期",
|
|
36
|
+
week: "周",
|
|
37
|
+
year: "选择年份",
|
|
38
|
+
month: "选择月份",
|
|
39
|
+
back: "返回日期",
|
|
40
|
+
prevMonth: "上个月",
|
|
41
|
+
nextMonth: "下个月",
|
|
42
|
+
prevYear: "上一年",
|
|
43
|
+
nextYear: "下一年",
|
|
44
|
+
hour: "时",
|
|
45
|
+
minute: "分",
|
|
46
|
+
second: "秒",
|
|
47
|
+
empty: "选择日期",
|
|
48
|
+
limit: "最多选择 {count} 项"
|
|
49
|
+
}, b = {
|
|
50
|
+
today: "Today",
|
|
51
|
+
now: "Now",
|
|
52
|
+
clear: "Clear",
|
|
53
|
+
cancel: "Cancel",
|
|
54
|
+
close: "Close",
|
|
55
|
+
confirm: "OK",
|
|
56
|
+
start: "Start date",
|
|
57
|
+
end: "End date",
|
|
58
|
+
chooseStart: "Choose a start date",
|
|
59
|
+
chooseEnd: "Choose an end date",
|
|
60
|
+
invalid: "Choose a valid date",
|
|
61
|
+
week: "Wk",
|
|
62
|
+
year: "Choose year",
|
|
63
|
+
month: "Choose month",
|
|
64
|
+
back: "Back to dates",
|
|
65
|
+
prevMonth: "Previous month",
|
|
66
|
+
nextMonth: "Next month",
|
|
67
|
+
prevYear: "Previous year",
|
|
68
|
+
nextYear: "Next year",
|
|
69
|
+
hour: "Hour",
|
|
70
|
+
minute: "Minute",
|
|
71
|
+
second: "Second",
|
|
72
|
+
empty: "Choose a date",
|
|
73
|
+
limit: "Select up to {count} items"
|
|
74
|
+
}, M = d(1, 0, 1), S = d(9999, 11, 31), D = (e) => e === "datetime" || !e ? "date" : e.replace(/s$/, ""), F = (e) => ["dates", "weeks", "months", "quarters", "years"].includes(e ?? "");
|
|
75
|
+
function O(e, t = !1) {
|
|
76
|
+
return t ? "YYYY-MM-DD HH:mm:ss" : D(e) === "year" ? "YYYY" : D(e) === "month" ? "YYYY-MM" : D(e) === "quarter" ? "YYYY-[Q]Q" : "YYYY-MM-DD";
|
|
77
|
+
}
|
|
78
|
+
function $(e, t, i = 1) {
|
|
79
|
+
const n = u(e);
|
|
80
|
+
if (t === "year")
|
|
81
|
+
return [d(n.year, 0, 1), d(n.year, 11, 31)];
|
|
82
|
+
if (t === "quarter") {
|
|
83
|
+
const r = Math.floor(n.month / 3) * 3;
|
|
84
|
+
return [d(n.year, r, 1), d(n.year, r + 3, 0)];
|
|
85
|
+
}
|
|
86
|
+
if (t === "month")
|
|
87
|
+
return [d(n.year, n.month, 1), d(n.year, n.month + 1, 0)];
|
|
88
|
+
if (t === "week") {
|
|
89
|
+
const r = e - (n.weekday - i + 7) % 7;
|
|
90
|
+
return [Math.max(M, r), Math.min(S, r + 6)];
|
|
91
|
+
}
|
|
92
|
+
return [e, e];
|
|
93
|
+
}
|
|
94
|
+
function v(e) {
|
|
95
|
+
const t = /^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(e ?? "");
|
|
96
|
+
return t && +t[1] < 24 && +t[2] < 60 && +(t[3] ?? 0) < 60 ? +t[1] * 3600 + +t[2] * 60 + +(t[3] ?? 0) : 0;
|
|
97
|
+
}
|
|
98
|
+
const G = /\[[^\]]*\]|YYYY|GGGG|MM|DD|HH|mm|ss|WW|Q/g;
|
|
99
|
+
function W(e, t = 1, i = 4) {
|
|
100
|
+
t = Number.isFinite(t) ? (Math.trunc(t) % 7 + 7) % 7 : 1, i = Number.isFinite(i) ? Math.max(1, Math.min(7, Math.trunc(i))) : 4;
|
|
101
|
+
const n = (l) => {
|
|
102
|
+
const h = d(l, 0, i);
|
|
103
|
+
return h - (u(h).weekday - t + 7) % 7;
|
|
104
|
+
}, r = e - (u(e).weekday - t + 7) % 7;
|
|
105
|
+
let o = u(e).year;
|
|
106
|
+
r < n(o) ? o-- : r >= n(o + 1) && o++;
|
|
107
|
+
const m = Math.max(M, r), c = Math.min(S, r + 6);
|
|
108
|
+
return {
|
|
109
|
+
year: o,
|
|
110
|
+
week: Math.floor((r - n(o)) / 7) + 1,
|
|
111
|
+
start: g(m),
|
|
112
|
+
end: g(c),
|
|
113
|
+
dates: Array.from(
|
|
114
|
+
{ length: Math.max(0, c - m + 1) },
|
|
115
|
+
(l, h) => g(m + h)
|
|
116
|
+
)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function q(e, t, i = 1, n = 4) {
|
|
120
|
+
const r = u(e.day), o = W(e.day, i, n), m = {
|
|
121
|
+
YYYY: String(r.year).padStart(4, "0"),
|
|
122
|
+
GGGG: String(o.year).padStart(4, "0"),
|
|
123
|
+
MM: String(r.month + 1).padStart(2, "0"),
|
|
124
|
+
DD: String(r.day).padStart(2, "0"),
|
|
125
|
+
HH: String(Math.floor(e.second / 3600)).padStart(2, "0"),
|
|
126
|
+
mm: String(Math.floor(e.second / 60) % 60).padStart(2, "0"),
|
|
127
|
+
ss: String(e.second % 60).padStart(2, "0"),
|
|
128
|
+
WW: String(o.week).padStart(2, "0"),
|
|
129
|
+
Q: String(Math.floor(r.month / 3) + 1)
|
|
130
|
+
};
|
|
131
|
+
return t.replace(
|
|
132
|
+
G,
|
|
133
|
+
(c) => c.startsWith("[") ? c.slice(1, -1) : m[c]
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function E(e, t = "YYYY-MM-DD", i = 1, n = 4) {
|
|
137
|
+
if (e instanceof Date || typeof e == "number") {
|
|
138
|
+
const a = e instanceof Date ? e : new Date(e);
|
|
139
|
+
if (!Number.isFinite(a.getTime())) return;
|
|
140
|
+
const s = N(a);
|
|
141
|
+
return s === void 0 ? void 0 : {
|
|
142
|
+
day: s,
|
|
143
|
+
second: a.getHours() * 3600 + a.getMinutes() * 60 + a.getSeconds()
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (typeof e != "string" || !e.trim()) return;
|
|
147
|
+
if (t === "x" || t === "X")
|
|
148
|
+
return /^-?\d+(?:\.\d+)?$/.test(e) ? E(Number(e) * (t === "X" ? 1e3 : 1)) : void 0;
|
|
149
|
+
const r = {}, o = [];
|
|
150
|
+
let m = 0, c = "";
|
|
151
|
+
for (const a of t.matchAll(G)) {
|
|
152
|
+
c += w(t.slice(m, a.index));
|
|
153
|
+
const s = a[0];
|
|
154
|
+
s.startsWith("[") ? c += w(s.slice(1, -1)) : (o.push(s), c += s === "Q" ? "(\\d)" : s === "YYYY" || s === "GGGG" ? "(\\d{4})" : "(\\d{2})"), m = a.index + s.length;
|
|
155
|
+
}
|
|
156
|
+
c += w(t.slice(m));
|
|
157
|
+
const l = new RegExp("^" + c + "$").exec(e);
|
|
158
|
+
if (!l || !o.some((a) => a === "YYYY" || a === "GGGG") || new Set(o).size !== o.length)
|
|
159
|
+
return;
|
|
160
|
+
o.forEach((a, s) => r[a] = +l[s + 1]);
|
|
161
|
+
const h = r.YYYY ?? r.GGGG, Y = r.MM ?? (r.Q ? (r.Q - 1) * 3 + 1 : 1), y = r.DD ?? 1, p = r.HH ?? 0, k = r.mm ?? 0, x = r.ss ?? 0;
|
|
162
|
+
if (h < 1 || h > 9999 || Y < 1 || Y > 12 || y < 1 || y > 31 || p > 23 || k > 59 || x > 59 || r.Q !== void 0 && (r.Q < 1 || r.Q > 4))
|
|
163
|
+
return;
|
|
164
|
+
let f = d(h, Y - 1, y);
|
|
165
|
+
if (r.WW !== void 0) {
|
|
166
|
+
if (r.WW < 1 || r.WW > 53) return;
|
|
167
|
+
const a = d(
|
|
168
|
+
h,
|
|
169
|
+
0,
|
|
170
|
+
Math.max(1, Math.min(7, Math.trunc(n)))
|
|
171
|
+
);
|
|
172
|
+
f = a - (u(a).weekday - i + 7) % 7 + (r.WW - 1) * 7;
|
|
173
|
+
const s = W(f, i, n);
|
|
174
|
+
if (s.week !== r.WW || s.year !== h) return;
|
|
175
|
+
} else if (u(f).month !== Y - 1 || u(f).day !== y)
|
|
176
|
+
return;
|
|
177
|
+
if (!(f < M || f > S))
|
|
178
|
+
return { day: f, second: p * 3600 + k * 60 + x };
|
|
179
|
+
}
|
|
180
|
+
function w(e) {
|
|
181
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
182
|
+
}
|
|
183
|
+
function I(e) {
|
|
184
|
+
const t = C(e.day);
|
|
185
|
+
return t.setHours(
|
|
186
|
+
Math.floor(e.second / 3600),
|
|
187
|
+
Math.floor(e.second / 60) % 60,
|
|
188
|
+
e.second % 60,
|
|
189
|
+
0
|
|
190
|
+
), t;
|
|
191
|
+
}
|
|
192
|
+
function T(e, t) {
|
|
193
|
+
return e instanceof Date && t instanceof Date ? e.getTime() === t.getTime() : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((i, n) => T(i, t[n])) : Object.is(e, t);
|
|
194
|
+
}
|
|
195
|
+
function z(e) {
|
|
196
|
+
return e instanceof Date ? new Date(e) : Array.isArray(e) ? e.map((t) => t instanceof Date ? new Date(t) : t) : e;
|
|
197
|
+
}
|
|
198
|
+
function X(e) {
|
|
199
|
+
try {
|
|
200
|
+
return new Intl.DateTimeFormat(e, { month: "long" });
|
|
201
|
+
} catch {
|
|
202
|
+
return new Intl.DateTimeFormat("zh-CN", { month: "long" });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function _(e, t) {
|
|
206
|
+
return Math.max(M, Math.min(S, A(e, t)));
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
S as DATE_MAX,
|
|
210
|
+
M as DATE_MIN,
|
|
211
|
+
z as dateClone,
|
|
212
|
+
T as dateEqual,
|
|
213
|
+
q as dateFormat,
|
|
214
|
+
X as dateLocale,
|
|
215
|
+
F as dateMultiple,
|
|
216
|
+
I as dateNative,
|
|
217
|
+
O as datePattern,
|
|
218
|
+
$ as datePeriod,
|
|
219
|
+
P as datePickerDefaults,
|
|
220
|
+
b as datePickerEnglish,
|
|
221
|
+
Q as datePickerWords,
|
|
222
|
+
E as datePoint,
|
|
223
|
+
_ as dateShift,
|
|
224
|
+
v as dateTimeSeconds,
|
|
225
|
+
D as dateUnit,
|
|
226
|
+
W as dateWeek
|
|
227
|
+
};
|
|
@@ -1,5 +1,96 @@
|
|
|
1
|
-
|
|
1
|
+
import { inject as d, computed as n } from "vue";
|
|
2
|
+
const b = Symbol("hys-ui-form"), c = Symbol("hys-ui-field");
|
|
3
|
+
function p() {
|
|
4
|
+
const e = d(c, void 0);
|
|
5
|
+
return {
|
|
6
|
+
id: n(() => e == null ? void 0 : e.id.value),
|
|
7
|
+
label: n(() => e == null ? void 0 : e.label.value),
|
|
8
|
+
disabled: n(() => {
|
|
9
|
+
var t;
|
|
10
|
+
return ((t = e == null ? void 0 : e.disabled) == null ? void 0 : t.value) ?? !1;
|
|
11
|
+
}),
|
|
12
|
+
size: n(() => {
|
|
13
|
+
var t;
|
|
14
|
+
return ((t = e == null ? void 0 : e.size) == null ? void 0 : t.value) ?? "md";
|
|
15
|
+
}),
|
|
16
|
+
required: n(() => (e == null ? void 0 : e.required.value) ?? !1),
|
|
17
|
+
invalid: n(() => {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = e == null ? void 0 : e.invalid) == null ? void 0 : t.value) ?? !!(e != null && e.error.value);
|
|
20
|
+
}),
|
|
21
|
+
status: n(() => {
|
|
22
|
+
var t;
|
|
23
|
+
return ((t = e == null ? void 0 : e.status) == null ? void 0 : t.value) ?? "idle";
|
|
24
|
+
}),
|
|
25
|
+
error: n(() => e == null ? void 0 : e.error.value),
|
|
26
|
+
describedBy: n(() => e == null ? void 0 : e.describedBy.value),
|
|
27
|
+
validate: (t) => {
|
|
28
|
+
var a;
|
|
29
|
+
return ((a = e == null ? void 0 : e.validate) == null ? void 0 : a.call(e, t)) ?? Promise.resolve(!0);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function y(e) {
|
|
34
|
+
const t = d(b, void 0), a = d(c, void 0);
|
|
35
|
+
return {
|
|
36
|
+
disabled: n(
|
|
37
|
+
() => {
|
|
38
|
+
var s;
|
|
39
|
+
return !!(e.disabled || t != null && t.disabled.value || (s = a == null ? void 0 : a.disabled) != null && s.value);
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
size: n(
|
|
43
|
+
() => {
|
|
44
|
+
var s;
|
|
45
|
+
return e.size ?? ((s = a == null ? void 0 : a.size) == null ? void 0 : s.value) ?? (t == null ? void 0 : t.size.value) ?? "md";
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
label: n(() => a == null ? void 0 : a.label.value)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function l(e) {
|
|
52
|
+
return Array.isArray(e) ? e.map(String).join(".") : String(e).replace(
|
|
53
|
+
/\[(?:"([^"\]]+)"|'([^'\]]+)'|(\d+))\]/g,
|
|
54
|
+
(t, a, s, u) => "." + (a ?? s ?? u)
|
|
55
|
+
).replace(/^\./, "");
|
|
56
|
+
}
|
|
57
|
+
function m(e, t) {
|
|
58
|
+
return l(t).split(".").reduce(
|
|
59
|
+
(a, s) => a != null && Object.prototype.hasOwnProperty.call(Object(a), s) ? a[s] : void 0,
|
|
60
|
+
e
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function h(e, t, a) {
|
|
64
|
+
const s = l(t).split(".");
|
|
65
|
+
if (s.some(
|
|
66
|
+
(o) => ["__proto__", "prototype", "constructor"].includes(o)
|
|
67
|
+
))
|
|
68
|
+
return;
|
|
69
|
+
const u = s.pop();
|
|
70
|
+
let r = e;
|
|
71
|
+
for (let o = 0; o < s.length; o++) {
|
|
72
|
+
const i = s[o];
|
|
73
|
+
(!r[i] || typeof r[i] != "object") && (r[i] = /^\d+$/.test(s[o + 1] ?? u) ? [] : {}), r = r[i];
|
|
74
|
+
}
|
|
75
|
+
r[u] = a;
|
|
76
|
+
}
|
|
77
|
+
function x(e) {
|
|
78
|
+
if (!e || e.closest("[inert],fieldset[disabled]") || e.getAttribute("aria-disabled") === "true")
|
|
79
|
+
return;
|
|
80
|
+
const t = e.matches(
|
|
81
|
+
'input:not([type="hidden"]):not([hidden]),button,textarea,select,a[href],[tabindex],[contenteditable="true"]'
|
|
82
|
+
) ? e : e.querySelector(
|
|
83
|
+
'input:checked:not(:disabled),input:not(:disabled):not([type="hidden"]):not([hidden]),button:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
84
|
+
);
|
|
85
|
+
t == null || t.focus();
|
|
86
|
+
}
|
|
2
87
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
88
|
+
c as fieldKey,
|
|
89
|
+
x as focusHysField,
|
|
90
|
+
b as formKey,
|
|
91
|
+
l as formPath,
|
|
92
|
+
m as formValue,
|
|
93
|
+
h as setFormValue,
|
|
94
|
+
y as useHysControlState,
|
|
95
|
+
p as useHysFormItemContext
|
|
5
96
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ref as d, watch as a, onMounted as u, onActivated as c, onDeactivated as m, onBeforeUnmount as p, computed as h } from "vue";
|
|
2
|
+
const s = [
|
|
3
|
+
["xs", 0],
|
|
4
|
+
["sm", 576],
|
|
5
|
+
["md", 768],
|
|
6
|
+
["lg", 992],
|
|
7
|
+
["xl", 1200],
|
|
8
|
+
["xxl", 1600]
|
|
9
|
+
];
|
|
10
|
+
function v(t, r, e = 1) {
|
|
11
|
+
let o = typeof t == "number" ? t : e;
|
|
12
|
+
if (t && typeof t == "object")
|
|
13
|
+
for (const [n, i] of s)
|
|
14
|
+
r >= i && t[n] !== void 0 && (o = t[n]);
|
|
15
|
+
return Math.max(1, Math.min(24, Math.floor(Number(o) || e)));
|
|
16
|
+
}
|
|
17
|
+
function l(t, r) {
|
|
18
|
+
if (!t) return;
|
|
19
|
+
let e = { span: t.span, offset: t.offset };
|
|
20
|
+
for (const [o, n] of s)
|
|
21
|
+
if (r >= n && t[o] !== void 0) {
|
|
22
|
+
const i = t[o];
|
|
23
|
+
e = {
|
|
24
|
+
...e,
|
|
25
|
+
...typeof i == "number" ? { span: i } : i
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
span: Math.max(0, Math.min(24, Math.floor(e.span ?? 24))),
|
|
30
|
+
offset: Math.max(0, Math.min(23, Math.floor(e.offset ?? 0)))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function M(t) {
|
|
34
|
+
const r = d(0);
|
|
35
|
+
let e, o = !0;
|
|
36
|
+
const n = () => {
|
|
37
|
+
t.value && (r.value = t.value.clientWidth || t.value.getBoundingClientRect().width);
|
|
38
|
+
};
|
|
39
|
+
function i() {
|
|
40
|
+
f(), !(!o || !t.value) && (n(), typeof ResizeObserver < "u" ? (e = new ResizeObserver(n), e.observe(t.value)) : typeof window < "u" && window.addEventListener("resize", n));
|
|
41
|
+
}
|
|
42
|
+
function f() {
|
|
43
|
+
e == null || e.disconnect(), e = void 0, typeof window < "u" && window.removeEventListener("resize", n);
|
|
44
|
+
}
|
|
45
|
+
return a(t, i), u(i), c(() => {
|
|
46
|
+
o = !0, i();
|
|
47
|
+
}), m(() => {
|
|
48
|
+
o = !1, f();
|
|
49
|
+
}), p(() => {
|
|
50
|
+
o = !1, f();
|
|
51
|
+
}), h(() => r.value);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
l as resolveFormCol,
|
|
55
|
+
v as resolveFormGrid,
|
|
56
|
+
M as useFormWidth
|
|
57
|
+
};
|