hys-ui 0.1.1 → 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 +111 -0
- package/README.md +3 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- 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 -27
- 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 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- 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 +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- 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/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +399 -392
- 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/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1369 -272
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- 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 +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- 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 -185
- 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/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1473 -88
- 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 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- 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 -302
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- 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 +77 -76
- 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 +92 -7
- 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/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/useFloating.js +97 -51
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -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/index.js +149 -139
- 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 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- 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 +50 -39
- 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/HysFileManager/HysFileManager.vue.d.ts +2 -2
- 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 +82 -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 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- 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 +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- 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 -20
- 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 +1 -1
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -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 +3 -3
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- 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 +133 -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/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/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 +33 -7
- package/package.json +2 -1
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import K from "
|
|
4
|
-
|
|
1
|
+
import { defineComponent as k, computed as y, openBlock as I, createBlock as g, mergeProps as v, unref as p } from "vue";
|
|
2
|
+
import { useHysControlState as B } from "../../composables/formContext.js";
|
|
3
|
+
import { useHysRootAttrs as K } from "../../config.js";
|
|
4
|
+
import V from "../HysTree/HysTree.vue.js";
|
|
5
|
+
const C = /* @__PURE__ */ k({
|
|
5
6
|
__name: "HysOrgTree",
|
|
6
7
|
props: {
|
|
7
8
|
nodes: {},
|
|
8
9
|
modelValue: {},
|
|
9
10
|
searchable: { type: Boolean, default: !0 },
|
|
10
11
|
checkable: { type: Boolean },
|
|
11
|
-
checkedKeys: {}
|
|
12
|
+
checkedKeys: {},
|
|
13
|
+
disabled: { type: Boolean }
|
|
12
14
|
},
|
|
13
15
|
emits: ["update:modelValue", "update:checkedKeys"],
|
|
14
|
-
setup(d, { emit:
|
|
15
|
-
const
|
|
16
|
-
var
|
|
17
|
-
const
|
|
18
|
-
for (const e of
|
|
16
|
+
setup(d, { emit: m }) {
|
|
17
|
+
const f = K(), n = d, { disabled: h } = B(n), l = m, b = y(() => {
|
|
18
|
+
var c;
|
|
19
|
+
const o = /* @__PURE__ */ new Map();
|
|
20
|
+
for (const e of n.nodes) o.has(e.id) || o.set(e.id, e);
|
|
19
21
|
const t = /* @__PURE__ */ new Map();
|
|
20
|
-
for (const e of
|
|
21
|
-
const
|
|
22
|
-
for (const e of
|
|
23
|
-
const
|
|
22
|
+
for (const e of o.values()) t.has(e.id) || t.set(e.id, { id: e.id, label: e.name, disabled: e.disabled, children: [] });
|
|
23
|
+
const a = [];
|
|
24
|
+
for (const e of o.values()) {
|
|
25
|
+
const r = t.get(e.id);
|
|
24
26
|
if (e.parentId && e.parentId !== e.id && t.has(e.parentId)) {
|
|
25
27
|
let s = e.parentId;
|
|
26
|
-
const
|
|
28
|
+
const i = /* @__PURE__ */ new Set([e.id]);
|
|
27
29
|
let u = !1;
|
|
28
30
|
for (; s; ) {
|
|
29
|
-
if (
|
|
31
|
+
if (i.has(s)) {
|
|
30
32
|
u = !0;
|
|
31
33
|
break;
|
|
32
34
|
}
|
|
33
|
-
|
|
35
|
+
i.add(s), s = ((c = o.get(s)) == null ? void 0 : c.parentId) || "";
|
|
34
36
|
}
|
|
35
37
|
if (!u) {
|
|
36
|
-
t.get(e.parentId).children.push(
|
|
38
|
+
t.get(e.parentId).children.push(r);
|
|
37
39
|
continue;
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
a.push(r);
|
|
41
43
|
}
|
|
42
|
-
return
|
|
44
|
+
return a;
|
|
43
45
|
});
|
|
44
|
-
return (
|
|
45
|
-
nodes:
|
|
46
|
+
return (o, t) => (I(), g(V, v(p(f), {
|
|
47
|
+
nodes: b.value,
|
|
46
48
|
"model-value": d.modelValue,
|
|
47
49
|
"checked-keys": d.checkedKeys,
|
|
48
50
|
checkable: d.checkable,
|
|
49
51
|
searchable: d.searchable !== !1,
|
|
52
|
+
disabled: p(h),
|
|
50
53
|
"default-expand-all": "",
|
|
51
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
52
|
-
"onUpdate:checkedKeys": t[1] || (t[1] = (
|
|
53
|
-
}), null, 16, ["nodes", "model-value", "checked-keys", "checkable", "searchable"]));
|
|
54
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => l("update:modelValue", a)),
|
|
55
|
+
"onUpdate:checkedKeys": t[1] || (t[1] = (a) => l("update:checkedKeys", a))
|
|
56
|
+
}), null, 16, ["nodes", "model-value", "checked-keys", "checkable", "searchable", "disabled"]));
|
|
54
57
|
}
|
|
55
58
|
});
|
|
56
59
|
export {
|
|
57
|
-
|
|
60
|
+
C as default
|
|
58
61
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysPagination2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dba949dd"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -167,6 +167,7 @@ const te = ["aria-busy"], le = {
|
|
|
167
167
|
d.showSizeChanger ? (v(), c("label", re, [
|
|
168
168
|
V(g(n.value.perPage) + " ", 1),
|
|
169
169
|
o(ee, {
|
|
170
|
+
size: "sm",
|
|
170
171
|
"model-value": String(h.value),
|
|
171
172
|
options: R.value.map((t) => ({ label: String(t), value: String(t) })),
|
|
172
173
|
disabled: r.value,
|
|
@@ -181,6 +182,7 @@ const te = ["aria-busy"], le = {
|
|
|
181
182
|
}, [
|
|
182
183
|
B("span", null, g(n.value.jump), 1),
|
|
183
184
|
o(ae, {
|
|
185
|
+
size: "sm",
|
|
184
186
|
modelValue: x.value,
|
|
185
187
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => x.value = t),
|
|
186
188
|
onInput: e[5] || (e[5] = (t) => m.value = t),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysPermissionMatrix2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ad2dfd08"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, openBlock as a, createElementBlock as d, mergeProps as w, unref as y, createElementVNode as u, createBlock as f, Fragment as s, createTextVNode as k, renderList as v, toDisplayString as C, createVNode as H } from "vue";
|
|
2
|
+
import { useHysControlState as N } from "../../composables/formContext.js";
|
|
2
3
|
import b from "../HysCheckbox/HysCheckbox.vue.js";
|
|
3
|
-
import { useHysRootAttrs as
|
|
4
|
-
const
|
|
4
|
+
import { useHysRootAttrs as D } from "../../config.js";
|
|
5
|
+
const E = { class: "hys-ui-ent-matrix" }, L = /* @__PURE__ */ S({
|
|
5
6
|
__name: "HysPermissionMatrix",
|
|
6
7
|
props: {
|
|
7
8
|
roles: {},
|
|
@@ -12,83 +13,83 @@ const N = { class: "hys-ui-ent-matrix" }, R = /* @__PURE__ */ A({
|
|
|
12
13
|
showSelectAll: { type: Boolean, default: !0 }
|
|
13
14
|
},
|
|
14
15
|
emits: ["update:modelValue", "change"],
|
|
15
|
-
setup(l, { emit:
|
|
16
|
-
const
|
|
17
|
-
function i(t,
|
|
18
|
-
return (t ? [t] :
|
|
19
|
-
}
|
|
20
|
-
function m(t) {
|
|
21
|
-
return t.length > 0 && t.every((d) => u.modelValue[d]);
|
|
16
|
+
setup(l, { emit: V }) {
|
|
17
|
+
const r = l, { disabled: m } = N(r), x = V, A = D();
|
|
18
|
+
function i(t, o) {
|
|
19
|
+
return (t ? [t] : r.resources).flatMap((e) => (o ? [o] : r.roles).map((n) => e + ":" + n));
|
|
22
20
|
}
|
|
23
21
|
function h(t) {
|
|
24
|
-
return
|
|
22
|
+
return t.length > 0 && t.every((o) => r.modelValue[o]);
|
|
23
|
+
}
|
|
24
|
+
function g(t) {
|
|
25
|
+
return !h(t) && t.some((o) => r.modelValue[o]);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
const e = { ...
|
|
29
|
-
for (const n of t) e[n] =
|
|
30
|
-
|
|
27
|
+
function c(t, o) {
|
|
28
|
+
if (m.value || r.readonly) return;
|
|
29
|
+
const e = { ...r.modelValue };
|
|
30
|
+
for (const n of t) e[n] = o;
|
|
31
|
+
x("update:modelValue", e), x("change", e);
|
|
31
32
|
}
|
|
32
|
-
return (t,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
l.showSelectAll ? (a(),
|
|
33
|
+
return (t, o) => (a(), d("div", w(y(A), { class: "hys-ui-ent-table-scroll" }), [
|
|
34
|
+
u("table", E, [
|
|
35
|
+
u("thead", null, [
|
|
36
|
+
u("tr", null, [
|
|
37
|
+
u("th", null, [
|
|
38
|
+
l.showSelectAll ? (a(), f(b, {
|
|
38
39
|
key: 0,
|
|
39
40
|
class: "hys-ui-matrix-group",
|
|
40
|
-
"model-value":
|
|
41
|
-
indeterminate:
|
|
42
|
-
disabled:
|
|
41
|
+
"model-value": h(i()),
|
|
42
|
+
indeterminate: g(i()),
|
|
43
|
+
disabled: y(m) || !l.roles.length || !l.resources.length,
|
|
43
44
|
readonly: l.readonly,
|
|
44
45
|
"aria-label": "全选所有权限",
|
|
45
46
|
label: "资源 / 角色",
|
|
46
|
-
onChange:
|
|
47
|
-
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly"])) : (a(),
|
|
48
|
-
|
|
47
|
+
onChange: o[0] || (o[0] = (e) => c(i(), e))
|
|
48
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly"])) : (a(), d(s, { key: 1 }, [
|
|
49
|
+
k("资源 / 角色")
|
|
49
50
|
], 64))
|
|
50
51
|
]),
|
|
51
|
-
(a(!0),
|
|
52
|
-
l.showSelectAll ? (a(),
|
|
52
|
+
(a(!0), d(s, null, v(l.roles, (e) => (a(), d("th", { key: e }, [
|
|
53
|
+
l.showSelectAll ? (a(), f(b, {
|
|
53
54
|
key: 0,
|
|
54
55
|
class: "hys-ui-matrix-group",
|
|
55
|
-
"model-value":
|
|
56
|
-
indeterminate:
|
|
57
|
-
disabled:
|
|
56
|
+
"model-value": h(i(void 0, e)),
|
|
57
|
+
indeterminate: g(i(void 0, e)),
|
|
58
|
+
disabled: y(m) || !l.resources.length,
|
|
58
59
|
readonly: l.readonly,
|
|
59
60
|
"aria-label": "全选角色 " + e,
|
|
60
61
|
label: e,
|
|
61
|
-
onChange: (n) =>
|
|
62
|
-
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(),
|
|
63
|
-
|
|
62
|
+
onChange: (n) => c(i(void 0, e), n)
|
|
63
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(), d(s, { key: 1 }, [
|
|
64
|
+
k(C(e), 1)
|
|
64
65
|
], 64))
|
|
65
66
|
]))), 128))
|
|
66
67
|
])
|
|
67
68
|
]),
|
|
68
|
-
|
|
69
|
-
(a(!0),
|
|
70
|
-
|
|
71
|
-
l.showSelectAll ? (a(),
|
|
69
|
+
u("tbody", null, [
|
|
70
|
+
(a(!0), d(s, null, v(l.resources, (e) => (a(), d("tr", { key: e }, [
|
|
71
|
+
u("th", null, [
|
|
72
|
+
l.showSelectAll ? (a(), f(b, {
|
|
72
73
|
key: 0,
|
|
73
74
|
class: "hys-ui-matrix-group",
|
|
74
|
-
"model-value":
|
|
75
|
-
indeterminate:
|
|
76
|
-
disabled:
|
|
75
|
+
"model-value": h(i(e)),
|
|
76
|
+
indeterminate: g(i(e)),
|
|
77
|
+
disabled: y(m) || !l.roles.length,
|
|
77
78
|
readonly: l.readonly,
|
|
78
79
|
"aria-label": "全选资源 " + e,
|
|
79
80
|
label: e,
|
|
80
|
-
onChange: (n) =>
|
|
81
|
-
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(),
|
|
82
|
-
|
|
81
|
+
onChange: (n) => c(i(e), n)
|
|
82
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "readonly", "aria-label", "label", "onChange"])) : (a(), d(s, { key: 1 }, [
|
|
83
|
+
k(C(e), 1)
|
|
83
84
|
], 64))
|
|
84
85
|
]),
|
|
85
|
-
(a(!0),
|
|
86
|
-
|
|
86
|
+
(a(!0), d(s, null, v(l.roles, (n) => (a(), d("td", { key: n }, [
|
|
87
|
+
H(b, {
|
|
87
88
|
"aria-label": e + " - " + n,
|
|
88
89
|
"model-value": !!l.modelValue[e + ":" + n],
|
|
89
|
-
disabled:
|
|
90
|
+
disabled: y(m),
|
|
90
91
|
readonly: l.readonly,
|
|
91
|
-
onChange: (
|
|
92
|
+
onChange: (B) => c([e + ":" + n], B)
|
|
92
93
|
}, null, 8, ["aria-label", "model-value", "disabled", "readonly", "onChange"])
|
|
93
94
|
]))), 128))
|
|
94
95
|
]))), 128))
|
|
@@ -98,5 +99,5 @@ const N = { class: "hys-ui-ent-matrix" }, R = /* @__PURE__ */ A({
|
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
export {
|
|
101
|
-
|
|
102
|
+
L as default
|
|
102
103
|
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { defineComponent as Y, inject as M, useAttrs as Z, ref as p, useId as g, computed as d, watch as _, onMounted as ee, onActivated as ae, onDeactivated as te, onBeforeUnmount as le, openBlock as O, createElementBlock as R, mergeProps as I, unref as l, createElementVNode as S, renderSlot as $, createTextVNode as oe, toDisplayString as K, createCommentVNode as ie } from "vue";
|
|
2
|
+
import { fieldKey as re, useHysControlState as de } from "../../composables/formContext.js";
|
|
3
|
+
import { radioGroupKey as ue, isChoice as se } from "../../composables/choice.js";
|
|
4
|
+
import { useChoiceModel as ne, useChoiceNativeReset as ve } from "../../composables/choiceModel.js";
|
|
5
|
+
import { useHysRootAttrs as ce } from "../../config.js";
|
|
6
|
+
const fe = ["data-status"], be = ["id", "data-hys-ui-radio-controlled", "name", "form", "value", "checked", "disabled", "required", "aria-readonly", "aria-label", "aria-invalid", "aria-describedby", "tabindex"], me = {
|
|
7
|
+
class: "hys-ui-radio-box",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, ye = { class: "hys-ui-radio-label" }, he = ["id"], Ee = /* @__PURE__ */ Y({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "HysRadio",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: { default: void 0 },
|
|
14
|
+
defaultValue: { default: void 0 },
|
|
15
|
+
value: { default: void 0 },
|
|
16
|
+
label: {},
|
|
17
|
+
disabled: { type: Boolean },
|
|
18
|
+
readonly: { type: Boolean },
|
|
19
|
+
size: {},
|
|
20
|
+
button: { type: Boolean, default: void 0 },
|
|
21
|
+
border: { type: Boolean, default: void 0 },
|
|
22
|
+
buttonStyle: {},
|
|
23
|
+
name: {},
|
|
24
|
+
form: {},
|
|
25
|
+
required: { type: Boolean },
|
|
26
|
+
ariaLabel: {},
|
|
27
|
+
tabindex: {},
|
|
28
|
+
focusable: { type: Boolean, default: !0 },
|
|
29
|
+
autofocus: { type: Boolean },
|
|
30
|
+
error: {},
|
|
31
|
+
status: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
34
|
+
setup(i, { expose: T, emit: U }) {
|
|
35
|
+
const t = i, m = U, e = M(ue, void 0), s = M(re, void 0), y = Z(), W = ce(), u = p(), q = g(), A = de(t), x = ne(
|
|
36
|
+
t,
|
|
37
|
+
() => t.defaultValue ?? null
|
|
38
|
+
), n = d(() => se(t.value) ? t.value : "on"), v = d(
|
|
39
|
+
() => (e ? e.value.value : x.current.value) === n.value
|
|
40
|
+
), h = d(() => A.disabled.value || !!(e != null && e.disabled.value)), C = d(() => t.readonly || (e == null ? void 0 : e.readonly.value)), F = d(() => t.size ?? (e == null ? void 0 : e.size.value) ?? A.size.value), G = d(() => t.button ?? (e == null ? void 0 : e.button.value) ?? !1), P = d(() => t.border ?? (e == null ? void 0 : e.border.value) ?? !1), J = d(
|
|
41
|
+
() => t.buttonStyle ? t.buttonStyle === "solid" : (e == null ? void 0 : e.solid.value) ?? !1
|
|
42
|
+
), E = d(
|
|
43
|
+
() => {
|
|
44
|
+
var a, o;
|
|
45
|
+
return t.error || t.status === "error" || !e && ((a = s == null ? void 0 : s.invalid) != null && a.value) ? "error" : t.status ?? (e == null ? void 0 : e.status.value) ?? ((o = s == null ? void 0 : s.status) == null ? void 0 : o.value);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
function c() {
|
|
49
|
+
u.value && (u.value.checked = v.value);
|
|
50
|
+
}
|
|
51
|
+
async function j() {
|
|
52
|
+
var k, V;
|
|
53
|
+
if (!x.isLive() || h.value || C.value || v.value)
|
|
54
|
+
return c(), !1;
|
|
55
|
+
const a = e == null ? void 0 : e.select(n.value);
|
|
56
|
+
e && m("change", n.value);
|
|
57
|
+
const o = a ? await a : await x.commit(
|
|
58
|
+
n.value,
|
|
59
|
+
(r) => m("update:modelValue", r),
|
|
60
|
+
(r) => m("change", r),
|
|
61
|
+
!0
|
|
62
|
+
);
|
|
63
|
+
c();
|
|
64
|
+
const B = (k = u.value) == null ? void 0 : k.name;
|
|
65
|
+
if (!e && B)
|
|
66
|
+
for (const r of document.getElementsByName(B))
|
|
67
|
+
r instanceof HTMLInputElement && r.type === "radio" && r.form === ((V = u.value) == null ? void 0 : V.form) && r.hasAttribute("data-hys-ui-radio-controlled") && r.dispatchEvent(new Event("hys-ui-radio-sync"));
|
|
68
|
+
return o;
|
|
69
|
+
}
|
|
70
|
+
let b;
|
|
71
|
+
function w() {
|
|
72
|
+
e && !b && (b = e.register({
|
|
73
|
+
input: u,
|
|
74
|
+
value: d(() => n.value),
|
|
75
|
+
disabled: d(() => !!t.disabled),
|
|
76
|
+
locked: d(() => !!t.disabled || !!t.readonly)
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
function z() {
|
|
80
|
+
b == null || b(), b = void 0;
|
|
81
|
+
}
|
|
82
|
+
_(v, c, { flush: "post" }), ve(
|
|
83
|
+
u,
|
|
84
|
+
x.reset,
|
|
85
|
+
c,
|
|
86
|
+
() => t.form ?? (e == null ? void 0 : e.form.value)
|
|
87
|
+
), ee(() => {
|
|
88
|
+
var a;
|
|
89
|
+
c(), w(), t.autofocus && !h.value && ((a = u.value) == null || a.focus());
|
|
90
|
+
}), ae(w), te(z), le(z);
|
|
91
|
+
const Q = () => Object.fromEntries(
|
|
92
|
+
Object.entries(y).filter(
|
|
93
|
+
([a]) => a === "id" || a.startsWith("aria-")
|
|
94
|
+
)
|
|
95
|
+
), X = () => Object.fromEntries(
|
|
96
|
+
Object.entries(y).filter(
|
|
97
|
+
([a]) => a !== "id" && !a.startsWith("aria-")
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
return T({
|
|
101
|
+
input: u,
|
|
102
|
+
checked: v,
|
|
103
|
+
focus: (a) => {
|
|
104
|
+
var o;
|
|
105
|
+
h.value || (o = u.value) == null || o.focus(a);
|
|
106
|
+
},
|
|
107
|
+
blur: () => {
|
|
108
|
+
var a;
|
|
109
|
+
return (a = u.value) == null ? void 0 : a.blur();
|
|
110
|
+
},
|
|
111
|
+
select: j
|
|
112
|
+
}), (a, o) => {
|
|
113
|
+
var B, k, V, r, H, N, D, L;
|
|
114
|
+
return O(), R("label", I({ ...l(W), ...X() }, {
|
|
115
|
+
class: ["hys-ui-radio-option", [
|
|
116
|
+
"hys-ui-radio-" + F.value,
|
|
117
|
+
{
|
|
118
|
+
"hys-ui-radio-option-disabled": h.value,
|
|
119
|
+
"hys-ui-radio-option-readonly": C.value,
|
|
120
|
+
"hys-ui-radio-bordered": P.value,
|
|
121
|
+
"hys-ui-radio-button": G.value,
|
|
122
|
+
"hys-ui-radio-solid": J.value,
|
|
123
|
+
"hys-ui-radio-selected": v.value,
|
|
124
|
+
"hys-ui-radio-error": E.value === "error"
|
|
125
|
+
}
|
|
126
|
+
]],
|
|
127
|
+
"data-status": E.value,
|
|
128
|
+
onMousedown: o[3] || (o[3] = (f) => !i.focusable && f.preventDefault())
|
|
129
|
+
}), [
|
|
130
|
+
S("input", I({
|
|
131
|
+
ref_key: "input",
|
|
132
|
+
ref: u
|
|
133
|
+
}, Q(), {
|
|
134
|
+
class: "hys-ui-radio-native",
|
|
135
|
+
type: "radio",
|
|
136
|
+
id: l(y).id || (l(e) || (B = l(s)) == null ? void 0 : B.id.value),
|
|
137
|
+
"data-hys-ui-field-managed": "",
|
|
138
|
+
"data-hys-ui-radio-controlled": i.modelValue !== void 0 ? "" : void 0,
|
|
139
|
+
name: ((k = l(e)) == null ? void 0 : k.name.value) || i.name,
|
|
140
|
+
form: i.form || ((V = l(e)) == null ? void 0 : V.form.value),
|
|
141
|
+
value: String(n.value),
|
|
142
|
+
checked: v.value,
|
|
143
|
+
disabled: h.value,
|
|
144
|
+
required: i.required || ((r = l(e)) == null ? void 0 : r.required.value) || !l(e) && ((H = l(s)) == null ? void 0 : H.required.value),
|
|
145
|
+
"aria-readonly": C.value || void 0,
|
|
146
|
+
"aria-label": i.ariaLabel || l(y)["aria-label"] || i.label || (!i.label && !a.$slots.default && !l(e) ? (N = l(s)) == null ? void 0 : N.label.value : void 0),
|
|
147
|
+
"aria-invalid": E.value === "error" || void 0,
|
|
148
|
+
"aria-describedby": [
|
|
149
|
+
l(y)["aria-describedby"],
|
|
150
|
+
i.error ? l(q) : void 0,
|
|
151
|
+
l(e) || (D = l(s)) == null ? void 0 : D.describedBy.value
|
|
152
|
+
].filter(Boolean).join(" ") || void 0,
|
|
153
|
+
tabindex: i.focusable ? i.tabindex ?? ((L = l(e)) == null ? void 0 : L.tabindex(n.value)) : -1,
|
|
154
|
+
onClick: o[0] || (o[0] = (f) => C.value && f.preventDefault()),
|
|
155
|
+
onChange: j,
|
|
156
|
+
onHysUiRadioSync: c,
|
|
157
|
+
onFocus: o[1] || (o[1] = (f) => m("focus", f)),
|
|
158
|
+
onBlur: o[2] || (o[2] = (f) => m("blur", f))
|
|
159
|
+
}), null, 16, be),
|
|
160
|
+
S("span", me, [
|
|
161
|
+
$(a.$slots, "icon", { checked: v.value }, void 0, !0)
|
|
162
|
+
]),
|
|
163
|
+
S("span", ye, [
|
|
164
|
+
$(a.$slots, "default", {}, () => [
|
|
165
|
+
oe(K(i.label), 1)
|
|
166
|
+
], !0)
|
|
167
|
+
]),
|
|
168
|
+
i.error ? (O(), R("small", {
|
|
169
|
+
key: 0,
|
|
170
|
+
id: l(q),
|
|
171
|
+
class: "hys-ui-radio-error-text",
|
|
172
|
+
role: "alert"
|
|
173
|
+
}, K(i.error), 9, he)) : ie("", !0)
|
|
174
|
+
], 16, fe);
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
export {
|
|
179
|
+
Ee as default
|
|
180
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysRadioGroup2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f34c441a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|