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,361 @@
|
|
|
1
|
+
import { ref as G, shallowRef as R, computed as f, watch as J, nextTick as Me, toRaw as de, onDeactivated as Se, onBeforeUnmount as we, onActivated as Ce } from "vue";
|
|
2
|
+
import { useTree as Ae } from "./useTree.js";
|
|
3
|
+
import { treeLocale as Ne, treeKeys as j, treeKey as W, treeField as Te } from "./tree.js";
|
|
4
|
+
import { treeSelectFields as Ee, treeSelectForest as Pe, selectTreeIndex as De } from "./treeSelect.js";
|
|
5
|
+
const ie = (l, s) => l.length === s.length && l.every((x, i) => x === s[i]), re = (l) => j(
|
|
6
|
+
(Array.isArray(l) ? l : l == null ? [] : [l]).flatMap(
|
|
7
|
+
(s) => W(s) ? s === "" ? [] : [s] : s && typeof s == "object" && W(s.value) ? [s.value] : []
|
|
8
|
+
)
|
|
9
|
+
);
|
|
10
|
+
function Oe(l, s, x, i, oe) {
|
|
11
|
+
const k = G(!0), X = R(l.defaultValue ?? null), Y = G(l.defaultSearchValue ?? ""), O = R(), V = G(!1), T = R(), Z = R(/* @__PURE__ */ new Map()), E = f(
|
|
12
|
+
() => l.modelValue === void 0 ? X.value : l.modelValue
|
|
13
|
+
), h = f(() => re(E.value)), K = f(
|
|
14
|
+
() => !!l.multiple || !!l.checkable || Array.isArray(E.value)
|
|
15
|
+
), P = f(() => l.searchValue ?? Y.value), y = f(
|
|
16
|
+
() => !k.value || s.value || !!l.readonly || !!l.loading
|
|
17
|
+
), _ = f(() => Ee(l)), $ = f(
|
|
18
|
+
() => Pe(O.value ?? l.nodes, l)
|
|
19
|
+
), L = f(() => {
|
|
20
|
+
var e, t, a, n;
|
|
21
|
+
return {
|
|
22
|
+
...Ne,
|
|
23
|
+
...l.locale,
|
|
24
|
+
search: l.searchPlaceholder ?? ((e = l.locale) == null ? void 0 : e.search) ?? "搜索节点",
|
|
25
|
+
empty: l.emptyText ?? ((t = l.locale) == null ? void 0 : t.empty) ?? "暂无节点",
|
|
26
|
+
noMatch: l.noMatchText ?? ((a = l.locale) == null ? void 0 : a.noMatch) ?? "无匹配节点",
|
|
27
|
+
loading: l.loadingText ?? ((n = l.locale) == null ? void 0 : n.loading) ?? "加载中"
|
|
28
|
+
};
|
|
29
|
+
}), q = (e) => typeof l.nodeKey == "function" ? l.nodeKey(e) : Te(
|
|
30
|
+
e,
|
|
31
|
+
typeof l.nodeKey == "string" ? l.nodeKey : _.value.id
|
|
32
|
+
), v = (e) => $.value.raw.get(q(e)) ?? e, fe = f(() => {
|
|
33
|
+
const e = l.loadChildren;
|
|
34
|
+
return e ? (t, a) => e(v(t), a) : void 0;
|
|
35
|
+
}), he = {
|
|
36
|
+
get nodes() {
|
|
37
|
+
return $.value.nodes;
|
|
38
|
+
},
|
|
39
|
+
get modelValue() {
|
|
40
|
+
return K.value ? h.value : h.value[0] ?? null;
|
|
41
|
+
},
|
|
42
|
+
get checkedKeys() {
|
|
43
|
+
return l.checkable ? h.value : [];
|
|
44
|
+
},
|
|
45
|
+
get multiple() {
|
|
46
|
+
return K.value;
|
|
47
|
+
},
|
|
48
|
+
get checkable() {
|
|
49
|
+
return l.checkable;
|
|
50
|
+
},
|
|
51
|
+
get checkStrictly() {
|
|
52
|
+
return l.checkStrictly;
|
|
53
|
+
},
|
|
54
|
+
get fieldNames() {
|
|
55
|
+
return _.value;
|
|
56
|
+
},
|
|
57
|
+
get nodeKey() {
|
|
58
|
+
return l.nodeKey;
|
|
59
|
+
},
|
|
60
|
+
inheritDisabled: !0,
|
|
61
|
+
get searchValue() {
|
|
62
|
+
return P.value;
|
|
63
|
+
},
|
|
64
|
+
get filterNode() {
|
|
65
|
+
return l.remote ? () => !0 : l.filterNode ? (e, t) => l.filterNode(e, v(t)) : void 0;
|
|
66
|
+
},
|
|
67
|
+
get filterMode() {
|
|
68
|
+
return l.filterMode;
|
|
69
|
+
},
|
|
70
|
+
get showMatchedChildren() {
|
|
71
|
+
return l.showMatchedChildren;
|
|
72
|
+
},
|
|
73
|
+
get expandedKeys() {
|
|
74
|
+
return l.expandedKeys;
|
|
75
|
+
},
|
|
76
|
+
get defaultExpandedKeys() {
|
|
77
|
+
return l.defaultExpandedKeys;
|
|
78
|
+
},
|
|
79
|
+
get defaultExpandAll() {
|
|
80
|
+
return l.defaultExpandAll ?? !0;
|
|
81
|
+
},
|
|
82
|
+
get autoExpandParent() {
|
|
83
|
+
return l.autoExpandParent;
|
|
84
|
+
},
|
|
85
|
+
get accordion() {
|
|
86
|
+
return l.accordion;
|
|
87
|
+
},
|
|
88
|
+
get loadedKeys() {
|
|
89
|
+
return l.loadedKeys;
|
|
90
|
+
},
|
|
91
|
+
get loadChildren() {
|
|
92
|
+
return fe.value;
|
|
93
|
+
},
|
|
94
|
+
get locale() {
|
|
95
|
+
return L.value;
|
|
96
|
+
}
|
|
97
|
+
}, se = f(() => y.value || V.value), d = Ae(
|
|
98
|
+
he,
|
|
99
|
+
se,
|
|
100
|
+
(e, ...t) => {
|
|
101
|
+
if (e === "select") {
|
|
102
|
+
const [a, n] = t;
|
|
103
|
+
M(
|
|
104
|
+
n.selectedKeys,
|
|
105
|
+
"select",
|
|
106
|
+
v(a),
|
|
107
|
+
n.event
|
|
108
|
+
).then((u) => {
|
|
109
|
+
u && i(
|
|
110
|
+
n.selected ? "select" : "deselect",
|
|
111
|
+
q(a),
|
|
112
|
+
v(a),
|
|
113
|
+
n
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
} else if (e === "check") {
|
|
117
|
+
const [a, n] = t;
|
|
118
|
+
M(
|
|
119
|
+
D(a),
|
|
120
|
+
"check",
|
|
121
|
+
n.node ? v(n.node) : void 0,
|
|
122
|
+
n.event,
|
|
123
|
+
void 0,
|
|
124
|
+
n.halfCheckedKeys
|
|
125
|
+
);
|
|
126
|
+
} else e === "check-change" ? i("check", {
|
|
127
|
+
...t[0],
|
|
128
|
+
node: t[0].node ? v(t[0].node) : void 0,
|
|
129
|
+
checkedNodes: t[0].checkedNodes.map(v),
|
|
130
|
+
halfCheckedNodes: t[0].halfCheckedNodes.map(v)
|
|
131
|
+
}) : e === "update:searchValue" ? ne(t[0]) : [
|
|
132
|
+
"update:expandedKeys",
|
|
133
|
+
"update:loadedKeys",
|
|
134
|
+
"node-expand",
|
|
135
|
+
"node-collapse",
|
|
136
|
+
"load-error",
|
|
137
|
+
"children-loaded",
|
|
138
|
+
"load"
|
|
139
|
+
].includes(e) && (e === "load-error" || e === "children-loaded" || e === "load" ? i(e, { ...t[0], node: v(t[0].node) }) : e === "node-expand" || e === "node-collapse" ? i(e, v(t[0]), t[1]) : i(e, ...t));
|
|
140
|
+
},
|
|
141
|
+
() => {
|
|
142
|
+
},
|
|
143
|
+
{ loadActive: x }
|
|
144
|
+
), p = f(
|
|
145
|
+
() => De(l.cacheData ?? [], l)
|
|
146
|
+
);
|
|
147
|
+
function H(e) {
|
|
148
|
+
const t = /* @__PURE__ */ new Map();
|
|
149
|
+
for (const a of Array.isArray(e) ? e : [e])
|
|
150
|
+
a && typeof a == "object" && !Array.isArray(a) && W(a.value) && t.set(a.value, a);
|
|
151
|
+
return t;
|
|
152
|
+
}
|
|
153
|
+
const ee = f(() => H(E.value)), B = (e) => ee.value.get(e);
|
|
154
|
+
function m(e) {
|
|
155
|
+
const t = d.index.value.map.get(e) ?? p.value.map.get(e), a = Z.value.get(e), n = B(e);
|
|
156
|
+
return {
|
|
157
|
+
value: e,
|
|
158
|
+
label: (n == null ? void 0 : n.label) ?? (t == null ? void 0 : t.label) ?? (a == null ? void 0 : a.label) ?? String(e),
|
|
159
|
+
node: t ? v(t.node) : a == null ? void 0 : a.node,
|
|
160
|
+
disabled: !!(t != null && t.disabled || l.checkable && t && (t.checkboxDisabled || !t.checkable) || n != null && n.disabled || (n == null ? void 0 : n.disabled) === void 0 && (a != null && a.disabled) && !t),
|
|
161
|
+
missing: !d.index.value.map.has(e)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
J(
|
|
165
|
+
[h, d.index, p],
|
|
166
|
+
() => {
|
|
167
|
+
const e = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const t of h.value) e.set(t, m(t));
|
|
169
|
+
Z.value = e;
|
|
170
|
+
},
|
|
171
|
+
{ immediate: !0 }
|
|
172
|
+
);
|
|
173
|
+
function D(e) {
|
|
174
|
+
if (!l.checkable) return j(e);
|
|
175
|
+
const t = new Set(e), a = l.leafOnly ? "child" : l.checkStrictly ? "all" : l.showCheckedStrategy ?? "child";
|
|
176
|
+
return j(e).filter((n) => {
|
|
177
|
+
const u = d.index.value.map.get(n);
|
|
178
|
+
if (!u || m(n).disabled) return !0;
|
|
179
|
+
if (a === "child") return !u.children.length;
|
|
180
|
+
if (a === "parent") {
|
|
181
|
+
let r = u.parent;
|
|
182
|
+
for (; r !== void 0; ) {
|
|
183
|
+
const c = d.index.value.map.get(r);
|
|
184
|
+
if (!c || c.checkboxDisabled || !c.checkable) break;
|
|
185
|
+
if (t.has(r)) return !1;
|
|
186
|
+
r = c.parent;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return !0;
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
const le = f(
|
|
193
|
+
() => l.checkable ? D([...d.checked.value]) : h.value
|
|
194
|
+
), ve = f(() => le.value.map(m)), te = f(() => y.value || V.value);
|
|
195
|
+
let ae = 0, Q = 0;
|
|
196
|
+
function me(e, t) {
|
|
197
|
+
const a = t === void 0 ? ee.value : H(t), n = e.map(
|
|
198
|
+
(u) => {
|
|
199
|
+
var r;
|
|
200
|
+
return l.labelInValue ? {
|
|
201
|
+
value: u,
|
|
202
|
+
label: ((r = a.get(u)) == null ? void 0 : r.label) ?? m(u).label
|
|
203
|
+
} : u;
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
return K.value ? n : n[0] ?? (l.clearValue !== void 0 ? l.clearValue : l.labelInValue ? null : "");
|
|
207
|
+
}
|
|
208
|
+
async function M(e, t, a, n, u, r) {
|
|
209
|
+
if (y.value) return !1;
|
|
210
|
+
let c = j(e);
|
|
211
|
+
K.value || (c = c.slice(0, 1));
|
|
212
|
+
const g = new Set(c), xe = new Set(h.value);
|
|
213
|
+
for (const o of K.value ? h.value : [])
|
|
214
|
+
m(o).disabled && !g.has(o) && (c.push(o), g.add(o));
|
|
215
|
+
const z = Number.isFinite(l.multipleLimit) ? Math.max(0, Math.floor(l.multipleLimit)) : 0;
|
|
216
|
+
if (K.value && z && c.length > z && c.some((o) => !xe.has(o)))
|
|
217
|
+
return i("limit", z), !1;
|
|
218
|
+
const C = me(c, u), b = l.labelInValue ? H(C) : void 0, ke = !!l.labelInValue && c.some(
|
|
219
|
+
(o) => {
|
|
220
|
+
var A, N;
|
|
221
|
+
return ((A = b == null ? void 0 : b.get(o)) == null ? void 0 : A.label) !== ((N = B(o)) == null ? void 0 : N.label);
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
if (ie(c, h.value) && !ke) return !1;
|
|
225
|
+
const Ke = ++ae, Ve = Q;
|
|
226
|
+
l.modelValue === void 0 && (X.value = C);
|
|
227
|
+
const ue = {
|
|
228
|
+
reason: t,
|
|
229
|
+
node: a,
|
|
230
|
+
values: c,
|
|
231
|
+
items: c.map((o) => ({
|
|
232
|
+
...m(o),
|
|
233
|
+
...b != null && b.has(o) ? { label: b.get(o).label } : {}
|
|
234
|
+
})),
|
|
235
|
+
halfCheckedKeys: r ?? d.getHalfCheckedKeys(),
|
|
236
|
+
event: n
|
|
237
|
+
};
|
|
238
|
+
return i("update:modelValue", C), i("change", C, ue), await Me(), !k.value || y.value || Ve !== Q || Ke !== ae || !ie(c, h.value) || l.labelInValue && c.some(
|
|
239
|
+
(o) => {
|
|
240
|
+
var A, N;
|
|
241
|
+
return de((A = b == null ? void 0 : b.get(o)) == null ? void 0 : A.label) !== de((N = B(o)) == null ? void 0 : N.label);
|
|
242
|
+
}
|
|
243
|
+
) ? !1 : (i("value-change", C, {
|
|
244
|
+
...ue,
|
|
245
|
+
items: c.map(m),
|
|
246
|
+
halfCheckedKeys: d.getHalfCheckedKeys()
|
|
247
|
+
}), l.validateEvent !== !1 && oe(), !0);
|
|
248
|
+
}
|
|
249
|
+
function be() {
|
|
250
|
+
return M(
|
|
251
|
+
h.value.filter((e) => m(e).disabled),
|
|
252
|
+
"clear"
|
|
253
|
+
).then((e) => (e && i("clear"), e));
|
|
254
|
+
}
|
|
255
|
+
function ye(e) {
|
|
256
|
+
if (y.value || l.removable === !1 || m(e).disabled)
|
|
257
|
+
return Promise.resolve(!1);
|
|
258
|
+
let t = h.value.filter((a) => a !== e);
|
|
259
|
+
if (l.checkable && !l.checkStrictly && d.index.value.map.has(e)) {
|
|
260
|
+
const a = new Set(d.checked.value), n = [e];
|
|
261
|
+
for (; n.length; ) {
|
|
262
|
+
const u = n.pop(), r = d.index.value.map.get(u);
|
|
263
|
+
if (!(!r || r.checkboxDisabled || !r.checkable)) {
|
|
264
|
+
a.delete(u);
|
|
265
|
+
for (const c of r.children) n.push(c);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
for (const u of d.ancestors(e)) a.delete(u);
|
|
269
|
+
t = D([...a]);
|
|
270
|
+
}
|
|
271
|
+
return M(t, "remove", m(e).node).then((a) => (a && i("remove-tag", e, m(e).node), a));
|
|
272
|
+
}
|
|
273
|
+
function ge(e, t) {
|
|
274
|
+
return te.value || e.disabled ? Promise.resolve(!1) : l.checkable ? !e.checkable || e.checkboxDisabled ? Promise.resolve(!1) : d.setChecked(
|
|
275
|
+
e.key,
|
|
276
|
+
!d.checked.value.has(e.key),
|
|
277
|
+
!l.checkStrictly,
|
|
278
|
+
t
|
|
279
|
+
) : !e.selectable || l.leafOnly && e.hasChildren ? (e.hasChildren && d.expandNode(e.key, !d.expanded.value.has(e.key)), Promise.resolve(!1)) : d.selectNode(e, t);
|
|
280
|
+
}
|
|
281
|
+
function ne(e) {
|
|
282
|
+
y.value || (l.searchValue === void 0 && (Y.value = e), i("update:searchValue", e), i("search", e));
|
|
283
|
+
}
|
|
284
|
+
let S, I, w = 0;
|
|
285
|
+
function F() {
|
|
286
|
+
w++, clearTimeout(I), I = void 0, S == null || S.abort(), S = void 0, V.value = !1;
|
|
287
|
+
}
|
|
288
|
+
async function U(e = !1) {
|
|
289
|
+
if (F(), !x.value || y.value || !l.remote || !l.remoteMethod)
|
|
290
|
+
return;
|
|
291
|
+
const t = w, a = new AbortController(), n = l.remoteMethod, u = P.value;
|
|
292
|
+
S = a, T.value = void 0, V.value = !0;
|
|
293
|
+
const r = async () => {
|
|
294
|
+
I = void 0;
|
|
295
|
+
try {
|
|
296
|
+
const g = await n(u, { signal: a.signal });
|
|
297
|
+
if (a.signal.aborted || !k.value || t !== w || n !== l.remoteMethod || !x.value)
|
|
298
|
+
return;
|
|
299
|
+
if (g !== void 0) {
|
|
300
|
+
if (!Array.isArray(g))
|
|
301
|
+
throw new TypeError(
|
|
302
|
+
"remoteMethod must return an array or undefined"
|
|
303
|
+
);
|
|
304
|
+
O.value = g;
|
|
305
|
+
}
|
|
306
|
+
i("search-complete", u);
|
|
307
|
+
} catch (g) {
|
|
308
|
+
if (a.signal.aborted || !k.value || t !== w)
|
|
309
|
+
return;
|
|
310
|
+
T.value = g, i("search-error", g, u);
|
|
311
|
+
} finally {
|
|
312
|
+
t === w && (V.value = !1, S = void 0);
|
|
313
|
+
}
|
|
314
|
+
}, c = e ? 0 : Number.isFinite(l.debounce) ? Math.min(5e3, Math.max(0, l.debounce)) : 250;
|
|
315
|
+
c ? I = setTimeout(r, c) : await r();
|
|
316
|
+
}
|
|
317
|
+
J([P, () => l.remoteMethod, () => l.remote, x], () => {
|
|
318
|
+
l.remote ? U() : (F(), O.value = void 0, T.value = void 0);
|
|
319
|
+
}), J(
|
|
320
|
+
y,
|
|
321
|
+
(e) => {
|
|
322
|
+
e && F();
|
|
323
|
+
},
|
|
324
|
+
{ flush: "sync" }
|
|
325
|
+
);
|
|
326
|
+
function ce() {
|
|
327
|
+
k.value = !1, Q++, F();
|
|
328
|
+
}
|
|
329
|
+
return Se(ce), we(ce), Ce(() => {
|
|
330
|
+
k.value = !0, x.value && U();
|
|
331
|
+
}), {
|
|
332
|
+
tree: d,
|
|
333
|
+
live: k,
|
|
334
|
+
current: E,
|
|
335
|
+
values: h,
|
|
336
|
+
multiple: K,
|
|
337
|
+
query: P,
|
|
338
|
+
items: ve,
|
|
339
|
+
displayKeys: le,
|
|
340
|
+
busy: te,
|
|
341
|
+
blocked: y,
|
|
342
|
+
words: L,
|
|
343
|
+
remotePending: V,
|
|
344
|
+
remoteError: T,
|
|
345
|
+
rawNode: v,
|
|
346
|
+
keyOf: q,
|
|
347
|
+
item: m,
|
|
348
|
+
pick: ge,
|
|
349
|
+
filter: ne,
|
|
350
|
+
clear: be,
|
|
351
|
+
removeTag: ye,
|
|
352
|
+
request: M,
|
|
353
|
+
project: D,
|
|
354
|
+
retrySearch: () => U(!0),
|
|
355
|
+
setValue: (e) => M(re(e), "api", void 0, void 0, e)
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
export {
|
|
359
|
+
re as treeSelectValueKeys,
|
|
360
|
+
Oe as useTreeSelect
|
|
361
|
+
};
|
package/dist/config.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { computed as a, toValue as s, provide as m, getCurrentInstance as i, inject as f } from "vue";
|
|
2
|
+
const u = Symbol("hys-ui-config"), r = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function h(t) {
|
|
4
|
+
const e = c(), n = { theme: t.theme ?? e.theme, motion: t.motion ?? e.motion };
|
|
5
|
+
m(u, n);
|
|
6
|
+
const o = i();
|
|
7
|
+
o && r.set(o, n);
|
|
6
8
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
+
function c() {
|
|
10
|
+
const t = i();
|
|
11
|
+
return t && r.get(t) || f(u, {});
|
|
9
12
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
return { "data-hys-ui": "", "data-hys-theme":
|
|
13
|
+
function d() {
|
|
14
|
+
const t = c();
|
|
15
|
+
return a(() => {
|
|
16
|
+
const e = s(t.theme), n = s(t.motion);
|
|
17
|
+
return { "data-hys-ui": "", "data-hys-theme": e && ["blue", "dark", "green", "purple", "orange", "forest"].includes(e) ? e : "blue", "data-hys-motion": n && ["full", "subtle", "off"].includes(n) ? n : "subtle" };
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
20
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
h as provideHysConfig,
|
|
22
|
+
c as useHysConfig,
|
|
23
|
+
d as useHysRootAttrs
|
|
21
24
|
};
|