@dao-style/core 0.0.1-beta.1 → 0.0.1-beta.12
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/README.md +5 -5
- package/dist/components/action-icon/action-icon.vue.d.ts +35 -0
- package/dist/components/action-icon/index.d.ts +1 -0
- package/dist/components/action-icon/test/action-icon.spec.d.ts +1 -0
- package/dist/components/breadcrumb/breadcrumb-item-props.d.ts +16 -0
- package/dist/components/breadcrumb/breadcrumb-item.vue.d.ts +24 -0
- package/dist/components/breadcrumb/breadcrumb-props.d.ts +40 -0
- package/dist/components/breadcrumb/breadcrumb.vue.d.ts +64 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/test/breadcrumb-item.spec.d.ts +1 -0
- package/dist/components/breadcrumb/test/breadcrumb.spec.d.ts +1 -0
- package/dist/components/button/button-group.vue.d.ts +2 -0
- package/dist/components/button/button.vue.d.ts +77 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/props.d.ts +40 -0
- package/dist/components/button/test/button.spec.d.ts +1 -0
- package/dist/components/card/card-item.vue.d.ts +2 -0
- package/dist/components/card/card.vue.d.ts +44 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/test/card.spec.d.ts +1 -0
- package/dist/components/card/types.d.ts +1 -0
- package/dist/components/checkbox/checkbox-group.vue.d.ts +26 -0
- package/dist/components/checkbox/checkbox.vue.d.ts +73 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/test/checkbox-group.spec.d.ts +1 -0
- package/dist/components/checkbox/test/checkbox.spec.d.ts +1 -0
- package/dist/components/checkbox/test/utils.d.ts +6 -0
- package/dist/components/dialog/dialog-footer.vue.d.ts +33 -0
- package/dist/components/dialog/dialog-header.vue.d.ts +24 -0
- package/dist/components/dialog/dialog.vue.d.ts +133 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/test/dialog-footer.spec.d.ts +1 -0
- package/dist/components/dialog/test/dialog-header.spec.d.ts +1 -0
- package/dist/components/dialog/test/dialog.spec.d.ts +1 -0
- package/dist/components/drawer/drawer.vue.d.ts +84 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/props.d.ts +41 -0
- package/dist/components/drawer/test/drawer.spec.d.ts +1 -0
- package/dist/components/dropdown/dropdown-item.vue.d.ts +36 -0
- package/dist/components/dropdown/dropdown-menu.vue.d.ts +2 -0
- package/dist/components/dropdown/dropdown.vue.d.ts +51 -0
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/dropdown/test/dropdown-item.spec.d.ts +1 -0
- package/dist/components/dropdown/test/dropdown-menu.spec.d.ts +1 -0
- package/dist/components/dropdown/test/dropdown.spec.d.ts +1 -0
- package/dist/components/expansion/expansion-item.vue.d.ts +36 -0
- package/dist/components/expansion/expansion.vue.d.ts +29 -0
- package/dist/components/expansion/index.d.ts +3 -0
- package/dist/components/expansion/props.d.ts +30 -0
- package/dist/components/expansion/test/expansion-item.spec.d.ts +1 -0
- package/dist/components/expansion/test/expansion.spec.d.ts +1 -0
- package/dist/components/form/form-group.vue.d.ts +13 -0
- package/dist/components/form/form-item.vue.d.ts +51 -0
- package/dist/components/form/form.vue.d.ts +22 -0
- package/dist/components/form/index.d.ts +3 -0
- package/dist/components/form/test/form-group.spec.d.ts +1 -0
- package/dist/components/form/test/form-item.spec.d.ts +1 -0
- package/dist/components/form/test/form.spec.d.ts +1 -0
- package/dist/components/header/header.vue.d.ts +26 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/props.d.ts +15 -0
- package/dist/components/header/test/header.spec.d.ts +1 -0
- package/dist/components/icon/icon.vue.d.ts +19 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/svg.d.ts +1 -0
- package/dist/components/icon/test/icon.spec.d.ts +1 -0
- package/dist/components/index.d.ts +25 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/input.vue.d.ts +103 -0
- package/dist/components/input/props.d.ts +47 -0
- package/dist/components/input/test/input.spec.d.ts +1 -0
- package/dist/components/message/index.d.ts +1 -0
- package/dist/components/message/message.vue.d.ts +53 -0
- package/dist/components/message/props.d.ts +25 -0
- package/dist/components/message/test/message.spec.d.ts +1 -0
- package/dist/components/message/types.d.ts +1 -0
- package/dist/components/nav/index.d.ts +4 -0
- package/dist/components/nav/nav-head.vue.d.ts +34 -0
- package/dist/components/nav/nav-item.vue.d.ts +68 -0
- package/dist/components/nav/nav-sub.vue.d.ts +80 -0
- package/dist/components/nav/nav.vue.d.ts +33 -0
- package/dist/components/nav/props.d.ts +98 -0
- package/dist/components/nav/test/nav-head.spec.d.ts +1 -0
- package/dist/components/nav/test/nav-item.spec.d.ts +1 -0
- package/dist/components/nav/test/nav-sub.spec.d.ts +1 -0
- package/dist/components/nav/test/nav.spec.d.ts +1 -0
- package/dist/components/nav/types.d.ts +13 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/pagination-props.d.ts +39 -0
- package/dist/components/pagination/pagination.vue.d.ts +82 -0
- package/dist/components/pagination/test/pagination.spec.d.ts +1 -0
- package/dist/components/plugin.d.ts +5 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/popover.vue.d.ts +120 -0
- package/dist/components/popover/test/popover.spec.d.ts +1 -0
- package/dist/components/popper/index.d.ts +1 -0
- package/dist/components/popper/popper-content.vue.d.ts +57 -0
- package/dist/components/popper/popper-props.d.ts +74 -0
- package/dist/components/popper/popper.vue.d.ts +123 -0
- package/dist/components/popper/test/popper.spec.d.ts +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/progress.vue.d.ts +38 -0
- package/dist/components/progress/test/progress.spec.d.ts +1 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio-group.vue.d.ts +33 -0
- package/dist/components/radio/radio.vue.d.ts +55 -0
- package/dist/components/radio/test/radio-group.spec.d.ts +1 -0
- package/dist/components/radio/test/radio.spec.d.ts +1 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/option.vue.d.ts +32 -0
- package/dist/components/select/select.vue.d.ts +229 -0
- package/dist/components/select/test/option.spec.d.ts +1 -0
- package/dist/components/select/test/select.spec.d.ts +1 -0
- package/dist/components/select/types.d.ts +22 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/switch.vue.d.ts +62 -0
- package/dist/components/switch/test/switch.spec.d.ts +1 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/resizer.vue.d.ts +33 -0
- package/dist/components/table/table-props.d.ts +66 -0
- package/dist/components/table/table.vue.d.ts +188 -0
- package/dist/components/table/test/table.spec.d.ts +1 -0
- package/dist/components/table/type.d.ts +20 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/tab-item.vue.d.ts +30 -0
- package/dist/components/tabs/tab-nav.vue.d.ts +33 -0
- package/dist/components/tabs/tabs.vue.d.ts +43 -0
- package/dist/components/tabs/test/tabs.spec.d.ts +1 -0
- package/dist/components/tabs/types.d.ts +9 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/test/tooltip.spec.d.ts +1 -0
- package/dist/components/tooltip/tooltip-props.d.ts +60 -0
- package/dist/components/tooltip/tooltip.vue.d.ts +120 -0
- package/dist/dao-style.es.js +2488 -929
- package/dist/dao-style.umd.js +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/style.css +1 -1
- package/dist/styles/color/alias.json +67 -0
- package/dist/styles/color/alias.scss +37 -0
- package/dist/styles/color/var.json +146 -0
- package/dist/styles/color/var.scss +119 -0
- package/dist/utils/assist.d.ts +13 -0
- package/dist/utils/constant.d.ts +20 -0
- package/dist/utils/copy-content.d.ts +2 -0
- package/dist/utils/is-nullish.d.ts +1 -0
- package/package.json +17 -16
- package/volar.d.ts +50 -0
package/dist/dao-style.es.js
CHANGED
|
@@ -17,7 +17,60 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass,
|
|
20
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, createElementVNode, unref, resolveComponent, Fragment, createBlock, createTextVNode, toDisplayString, ref, inject, watchEffect, mergeProps, provide, toRefs, createVNode, withCtx, watch, Transition, withModifiers, normalizeStyle, withDirectives, vShow, withKeys, getCurrentInstance, onMounted, onBeforeUnmount, Teleport, nextTick, reactive, renderList, vModelText, toRef, onUnmounted, h } from "vue";
|
|
21
|
+
import { isArray, isSet, looseIndexOf, looseEqual, isFunction, NOOP } from "@vue/shared";
|
|
22
|
+
var actionIcon_vue_vue_type_style_index_0_lang = "";
|
|
23
|
+
var _export_sfc = (sfc, props) => {
|
|
24
|
+
for (const [key, val] of props) {
|
|
25
|
+
sfc[key] = val;
|
|
26
|
+
}
|
|
27
|
+
return sfc;
|
|
28
|
+
};
|
|
29
|
+
const _sfc_main$I = defineComponent({
|
|
30
|
+
name: "DaoActionIcon",
|
|
31
|
+
props: {
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ""
|
|
35
|
+
},
|
|
36
|
+
type: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "button",
|
|
39
|
+
validator: (value) => ["button", "divider"].includes(value)
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
emits: ["click"],
|
|
47
|
+
setup(props, { emit }) {
|
|
48
|
+
const isDivider = props.type === "divider";
|
|
49
|
+
const handleClick = (event) => emit("click", event);
|
|
50
|
+
const realDisabled = computed(() => isDivider || props.disabled);
|
|
51
|
+
return {
|
|
52
|
+
handleClick,
|
|
53
|
+
isDivider,
|
|
54
|
+
realDisabled
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const _hoisted_1$x = ["disabled"];
|
|
59
|
+
function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
|
|
60
|
+
return openBlock(), createElementBlock("button", {
|
|
61
|
+
class: normalizeClass(["dao-action-icon", `dao-action-icon--type-${_ctx.type}`]),
|
|
62
|
+
disabled: _ctx.realDisabled,
|
|
63
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
64
|
+
}, [
|
|
65
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
66
|
+
!_ctx.isDivider ? (openBlock(), createElementBlock("i", {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: normalizeClass(["dao-action-icon__iconfont", _ctx.name])
|
|
69
|
+
}, null, 2)) : createCommentVNode("", true)
|
|
70
|
+
])
|
|
71
|
+
], 10, _hoisted_1$x);
|
|
72
|
+
}
|
|
73
|
+
var DaoActionIcon = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$F]]);
|
|
21
74
|
const BUTTON_TYPES = ["primary", "secondary", "tertiary", "ghost", "danger"];
|
|
22
75
|
var buttonProps = {
|
|
23
76
|
type: {
|
|
@@ -56,13 +109,7 @@ var buttonProps = {
|
|
|
56
109
|
}
|
|
57
110
|
};
|
|
58
111
|
var icon_scss_vue_type_style_index_0_src_lang = "";
|
|
59
|
-
|
|
60
|
-
for (const [key, val] of props) {
|
|
61
|
-
sfc[key] = val;
|
|
62
|
-
}
|
|
63
|
-
return sfc;
|
|
64
|
-
};
|
|
65
|
-
const _sfc_main$v = defineComponent({
|
|
112
|
+
const _sfc_main$H = defineComponent({
|
|
66
113
|
name: "DaoIcon",
|
|
67
114
|
props: {
|
|
68
115
|
name: {
|
|
@@ -75,55 +122,31 @@ const _sfc_main$v = defineComponent({
|
|
|
75
122
|
}
|
|
76
123
|
}
|
|
77
124
|
});
|
|
78
|
-
const _hoisted_1$
|
|
125
|
+
const _hoisted_1$w = {
|
|
79
126
|
key: 1,
|
|
80
|
-
class: "dao-icon"
|
|
127
|
+
class: "dao-icon dao-svg-icon"
|
|
81
128
|
};
|
|
82
|
-
const _hoisted_2$
|
|
83
|
-
function _sfc_render$
|
|
129
|
+
const _hoisted_2$l = ["xlink:href"];
|
|
130
|
+
function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
84
131
|
return _ctx.useFont ? (openBlock(), createElementBlock("i", {
|
|
85
132
|
key: 0,
|
|
86
133
|
class: normalizeClass(["dao-icon dao-iconfont", _ctx.name])
|
|
87
|
-
}, null, 2)) : (openBlock(), createElementBlock("svg", _hoisted_1$
|
|
134
|
+
}, null, 2)) : (openBlock(), createElementBlock("svg", _hoisted_1$w, [
|
|
88
135
|
createElementVNode("use", {
|
|
89
136
|
"xlink:href": `#${_ctx.name}`
|
|
90
|
-
}, null, 8, _hoisted_2$
|
|
137
|
+
}, null, 8, _hoisted_2$l)
|
|
91
138
|
]));
|
|
92
139
|
}
|
|
93
|
-
var DaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
94
|
-
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
95
|
-
props: {
|
|
96
|
-
useFont: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: false
|
|
99
|
-
},
|
|
100
|
-
iconName: {
|
|
101
|
-
type: String,
|
|
102
|
-
default: ""
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
setup(__props) {
|
|
106
|
-
return (_ctx, _cache) => {
|
|
107
|
-
return !__props.useFont ? (openBlock(), createBlock(DaoIcon, {
|
|
108
|
-
key: 0,
|
|
109
|
-
class: "dao-btn__icon",
|
|
110
|
-
name: __props.iconName
|
|
111
|
-
}, null, 8, ["name"])) : (openBlock(), createElementBlock("i", {
|
|
112
|
-
key: 1,
|
|
113
|
-
class: normalizeClass(["dao-btn__iconfont", __props.iconName])
|
|
114
|
-
}, null, 2));
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
});
|
|
140
|
+
var DaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$E]]);
|
|
118
141
|
var button_vue_vue_type_style_index_0_lang = "";
|
|
119
142
|
const NO_ICON = Symbol(0);
|
|
120
143
|
const RIGHT_ICON = Symbol(1);
|
|
121
144
|
const LEFT_ICON = Symbol(2);
|
|
122
145
|
const BOTH_ICON = Symbol(3);
|
|
123
|
-
const _sfc_main$
|
|
146
|
+
const _sfc_main$G = defineComponent({
|
|
124
147
|
name: "DaoButton",
|
|
125
148
|
components: {
|
|
126
|
-
|
|
149
|
+
DaoIcon
|
|
127
150
|
},
|
|
128
151
|
props: buttonProps,
|
|
129
152
|
emits: ["click"],
|
|
@@ -173,6 +196,8 @@ const _sfc_main$t = defineComponent({
|
|
|
173
196
|
}
|
|
174
197
|
return props.iconRight;
|
|
175
198
|
});
|
|
199
|
+
const leftIconClassName = computed(() => isIconLeftFont.value ? "dao-btn__iconfont" : "dao-btn__icon");
|
|
200
|
+
const rightIconClassName = computed(() => isIconRightFont.value ? "dao-btn__iconfont" : "dao-btn__icon");
|
|
176
201
|
const classList = computed(() => {
|
|
177
202
|
const unrefIconState = unref(iconState);
|
|
178
203
|
const list = [
|
|
@@ -203,106 +228,151 @@ const _sfc_main$t = defineComponent({
|
|
|
203
228
|
isIconLeftFont,
|
|
204
229
|
realIconLeft,
|
|
205
230
|
isIconRightFont,
|
|
206
|
-
realIconRight
|
|
231
|
+
realIconRight,
|
|
232
|
+
leftIconClassName,
|
|
233
|
+
rightIconClassName
|
|
207
234
|
};
|
|
208
235
|
}
|
|
209
236
|
});
|
|
210
|
-
const _hoisted_1$
|
|
211
|
-
const _hoisted_2$
|
|
237
|
+
const _hoisted_1$v = ["disabled"];
|
|
238
|
+
const _hoisted_2$k = {
|
|
212
239
|
key: 1,
|
|
213
240
|
class: "dao-btn__text"
|
|
214
241
|
};
|
|
215
|
-
function _sfc_render$
|
|
216
|
-
const
|
|
242
|
+
function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
|
|
243
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
217
244
|
return openBlock(), createElementBlock("button", {
|
|
218
245
|
class: normalizeClass(_ctx.classList),
|
|
219
246
|
disabled: _ctx.realDisabled,
|
|
220
247
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
221
248
|
}, [
|
|
222
249
|
_ctx.isSimpleButton ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
223
|
-
_ctx.realIconLeft ? (openBlock(), createBlock(
|
|
250
|
+
_ctx.realIconLeft ? (openBlock(), createBlock(_component_dao_icon, {
|
|
224
251
|
key: 0,
|
|
252
|
+
class: normalizeClass(_ctx.leftIconClassName),
|
|
225
253
|
"use-font": _ctx.isIconLeftFont,
|
|
226
|
-
|
|
227
|
-
}, null, 8, ["use-font", "
|
|
228
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
254
|
+
name: _ctx.realIconLeft
|
|
255
|
+
}, null, 8, ["class", "use-font", "name"])) : createCommentVNode("", true),
|
|
256
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_2$k, [
|
|
229
257
|
renderSlot(_ctx.$slots, "default")
|
|
230
258
|
])) : createCommentVNode("", true),
|
|
231
|
-
_ctx.realIconRight ? (openBlock(), createBlock(
|
|
259
|
+
_ctx.realIconRight ? (openBlock(), createBlock(_component_dao_icon, {
|
|
232
260
|
key: 2,
|
|
261
|
+
class: normalizeClass(_ctx.rightIconClassName),
|
|
233
262
|
"use-font": _ctx.isIconRightFont,
|
|
234
|
-
|
|
235
|
-
}, null, 8, ["use-font", "
|
|
263
|
+
name: _ctx.realIconRight
|
|
264
|
+
}, null, 8, ["class", "use-font", "name"])) : createCommentVNode("", true)
|
|
236
265
|
], 64))
|
|
237
|
-
], 10, _hoisted_1$
|
|
266
|
+
], 10, _hoisted_1$v);
|
|
238
267
|
}
|
|
239
|
-
var DaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
268
|
+
var DaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$D]]);
|
|
240
269
|
var buttonGroup_vue_vue_type_style_index_0_lang = "";
|
|
241
|
-
const _sfc_main$
|
|
270
|
+
const _sfc_main$F = defineComponent({
|
|
242
271
|
name: "DaoButtonGroup"
|
|
243
272
|
});
|
|
244
|
-
const _hoisted_1$
|
|
245
|
-
function _sfc_render$
|
|
246
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
273
|
+
const _hoisted_1$u = { class: "dao-btn-group" };
|
|
274
|
+
function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
|
|
275
|
+
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
247
276
|
renderSlot(_ctx.$slots, "default")
|
|
248
277
|
]);
|
|
249
278
|
}
|
|
250
|
-
var buttonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
const aKeysCount = Object.keys(a).length;
|
|
280
|
-
const bKeysCount = Object.keys(b).length;
|
|
281
|
-
if (aKeysCount !== bKeysCount) {
|
|
282
|
-
return false;
|
|
283
|
-
}
|
|
284
|
-
for (const key in a) {
|
|
285
|
-
const aHasKey = a.hasOwnProperty(key);
|
|
286
|
-
const bHasKey = b.hasOwnProperty(key);
|
|
287
|
-
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
279
|
+
var buttonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$C]]);
|
|
280
|
+
var card_scss_vue_type_style_index_0_src_lang = "";
|
|
281
|
+
const _sfc_main$E = defineComponent({
|
|
282
|
+
name: "DaoCard",
|
|
283
|
+
components: {
|
|
284
|
+
DaoIcon
|
|
285
|
+
},
|
|
286
|
+
props: {
|
|
287
|
+
type: {
|
|
288
|
+
type: String,
|
|
289
|
+
default: "standard"
|
|
290
|
+
},
|
|
291
|
+
icon: {
|
|
292
|
+
type: String,
|
|
293
|
+
default: void 0
|
|
294
|
+
},
|
|
295
|
+
useFont: {
|
|
296
|
+
type: Boolean,
|
|
297
|
+
default: false
|
|
298
|
+
},
|
|
299
|
+
title: {
|
|
300
|
+
type: String,
|
|
301
|
+
default: void 0
|
|
302
|
+
},
|
|
303
|
+
divider: {
|
|
304
|
+
type: Boolean,
|
|
305
|
+
default: false
|
|
290
306
|
}
|
|
291
307
|
}
|
|
292
|
-
|
|
308
|
+
});
|
|
309
|
+
const _hoisted_1$t = {
|
|
310
|
+
key: 0,
|
|
311
|
+
class: "dao-card-header"
|
|
312
|
+
};
|
|
313
|
+
const _hoisted_2$j = {
|
|
314
|
+
key: 0,
|
|
315
|
+
class: "dao-card-header-item"
|
|
316
|
+
};
|
|
317
|
+
const _hoisted_3$d = { class: "dao-card-header-item dao-card-header-title" };
|
|
318
|
+
const _hoisted_4$c = { class: "dao-card-header-item dao-card-header-action" };
|
|
319
|
+
function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
|
|
320
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
321
|
+
return openBlock(), createElementBlock("div", {
|
|
322
|
+
class: normalizeClass(["dao-card", `dao-card--${_ctx.type}`])
|
|
323
|
+
}, [
|
|
324
|
+
_ctx.type !== "headless" ? (openBlock(), createElementBlock("div", _hoisted_1$t, [
|
|
325
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
326
|
+
renderSlot(_ctx.$slots, "header-prefix"),
|
|
327
|
+
_ctx.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$j, [
|
|
328
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
329
|
+
_ctx.icon ? (openBlock(), createBlock(_component_dao_icon, {
|
|
330
|
+
key: 0,
|
|
331
|
+
class: "dao-card-header-icon",
|
|
332
|
+
name: _ctx.icon,
|
|
333
|
+
"use-font": _ctx.useFont
|
|
334
|
+
}, null, 8, ["name", "use-font"])) : createCommentVNode("", true)
|
|
335
|
+
])
|
|
336
|
+
])) : createCommentVNode("", true),
|
|
337
|
+
createElementVNode("div", _hoisted_3$d, [
|
|
338
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
339
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
340
|
+
])
|
|
341
|
+
]),
|
|
342
|
+
createElementVNode("div", _hoisted_4$c, [
|
|
343
|
+
renderSlot(_ctx.$slots, "action")
|
|
344
|
+
]),
|
|
345
|
+
renderSlot(_ctx.$slots, "header-suffix")
|
|
346
|
+
])
|
|
347
|
+
])) : createCommentVNode("", true),
|
|
348
|
+
createElementVNode("div", {
|
|
349
|
+
class: normalizeClass(["dao-card-container", {
|
|
350
|
+
"dao-card-container-with-footer": !!_ctx.$slots.footer
|
|
351
|
+
}])
|
|
352
|
+
}, [
|
|
353
|
+
createElementVNode("div", {
|
|
354
|
+
class: normalizeClass(["dao-card-item-container", {
|
|
355
|
+
"dao-card-item-container-divider": _ctx.divider
|
|
356
|
+
}])
|
|
357
|
+
}, [
|
|
358
|
+
renderSlot(_ctx.$slots, "default")
|
|
359
|
+
], 2),
|
|
360
|
+
renderSlot(_ctx.$slots, "footer")
|
|
361
|
+
], 2)
|
|
362
|
+
], 2);
|
|
293
363
|
}
|
|
294
|
-
|
|
295
|
-
|
|
364
|
+
var card = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$B]]);
|
|
365
|
+
var cardItem_scss_vue_type_style_index_0_src_lang = "";
|
|
366
|
+
const _sfc_main$D = defineComponent({
|
|
367
|
+
name: "DaoCardItem"
|
|
368
|
+
});
|
|
369
|
+
const _hoisted_1$s = { class: "dao-card-item" };
|
|
370
|
+
function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
371
|
+
return openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
372
|
+
renderSlot(_ctx.$slots, "default")
|
|
373
|
+
]);
|
|
296
374
|
}
|
|
297
|
-
|
|
298
|
-
};
|
|
299
|
-
const isArray = Array.isArray;
|
|
300
|
-
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
301
|
-
const isDate = (val) => val instanceof Date;
|
|
302
|
-
const isFunction = (val) => typeof val === "function";
|
|
303
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
|
304
|
-
const objectToString = Object.prototype.toString;
|
|
305
|
-
const toTypeString = (value) => objectToString.call(value);
|
|
375
|
+
var cardItem = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$A]]);
|
|
306
376
|
function isNullish(val) {
|
|
307
377
|
return val === null || val === void 0;
|
|
308
378
|
}
|
|
@@ -331,9 +401,14 @@ const checkboxGroupModelValueKey = Symbol("checkboxGroupModelValueKey");
|
|
|
331
401
|
const checkboxUpdateGroupModelValueFnKey = Symbol("checkboxUpdateGroupModelValueFnKey");
|
|
332
402
|
const checkboxGroupChangeFnKey = Symbol("checkboxGroupChangeFnKey");
|
|
333
403
|
const formLabelWidthKey = Symbol("formLabelWidthKey");
|
|
404
|
+
const navRootKey = Symbol("rootNav");
|
|
405
|
+
const navSubKey = Symbol("subNav");
|
|
406
|
+
const breadcrumbKey = Symbol("breadcrumbKey");
|
|
407
|
+
const ToggleItemKey = Symbol("toggleItem");
|
|
408
|
+
const ExpansionStateKey = Symbol("expansionProps");
|
|
334
409
|
var checkbox_vue_vue_type_style_index_0_lang = "";
|
|
335
410
|
const modelValueAny = [String, Number, Boolean, Symbol, Object, Set, Array];
|
|
336
|
-
const _sfc_main$
|
|
411
|
+
const _sfc_main$C = defineComponent({
|
|
337
412
|
name: "DaoCheckbox",
|
|
338
413
|
props: {
|
|
339
414
|
modelValue: {
|
|
@@ -428,13 +503,13 @@ const _sfc_main$r = defineComponent({
|
|
|
428
503
|
const modelValue = currentModelValue.value;
|
|
429
504
|
const { value } = props;
|
|
430
505
|
if (isArray(modelValue)) {
|
|
431
|
-
const
|
|
432
|
-
const found =
|
|
506
|
+
const index2 = looseIndexOf(modelValue, value);
|
|
507
|
+
const found = index2 !== -1;
|
|
433
508
|
if (checked && !found) {
|
|
434
509
|
emitModelValue(modelValue.concat(value), event);
|
|
435
510
|
} else if (!checked && found) {
|
|
436
511
|
const filtered = [...modelValue];
|
|
437
|
-
filtered.splice(
|
|
512
|
+
filtered.splice(index2, 1);
|
|
438
513
|
emitModelValue(filtered, event);
|
|
439
514
|
}
|
|
440
515
|
} else if (isSet(modelValue)) {
|
|
@@ -466,21 +541,21 @@ const _sfc_main$r = defineComponent({
|
|
|
466
541
|
}
|
|
467
542
|
}
|
|
468
543
|
});
|
|
469
|
-
const _hoisted_1$
|
|
470
|
-
const _hoisted_2$
|
|
471
|
-
const _hoisted_3$
|
|
544
|
+
const _hoisted_1$r = ["disabled", "indeterminate", "checked"];
|
|
545
|
+
const _hoisted_2$i = /* @__PURE__ */ createElementVNode("span", { class: "dao-checkbox-inner" }, null, -1);
|
|
546
|
+
const _hoisted_3$c = {
|
|
472
547
|
key: 0,
|
|
473
548
|
class: "dao-checkbox__label"
|
|
474
549
|
};
|
|
475
|
-
const _hoisted_4$
|
|
550
|
+
const _hoisted_4$b = {
|
|
476
551
|
key: 0,
|
|
477
552
|
class: "dao-checkbox__label-text"
|
|
478
553
|
};
|
|
479
|
-
const _hoisted_5$
|
|
554
|
+
const _hoisted_5$7 = {
|
|
480
555
|
key: 1,
|
|
481
556
|
class: "dao-checkbox__label-helper"
|
|
482
557
|
};
|
|
483
|
-
function _sfc_render$
|
|
558
|
+
function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
484
559
|
return openBlock(), createElementBlock("label", {
|
|
485
560
|
class: normalizeClass(_ctx.wrapClasses)
|
|
486
561
|
}, [
|
|
@@ -495,14 +570,14 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
495
570
|
}, _ctx.$attrs, {
|
|
496
571
|
checked: _ctx.currentChecked,
|
|
497
572
|
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args))
|
|
498
|
-
}), null, 16, _hoisted_1$
|
|
499
|
-
_hoisted_2$
|
|
573
|
+
}), null, 16, _hoisted_1$r),
|
|
574
|
+
_hoisted_2$i
|
|
500
575
|
], 2),
|
|
501
|
-
_ctx.hasLabel ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
502
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
576
|
+
_ctx.hasLabel ? (openBlock(), createElementBlock("span", _hoisted_3$c, [
|
|
577
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$b, [
|
|
503
578
|
renderSlot(_ctx.$slots, "default")
|
|
504
579
|
])) : createCommentVNode("", true),
|
|
505
|
-
_ctx.hasHelper ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
580
|
+
_ctx.hasHelper ? (openBlock(), createElementBlock("span", _hoisted_5$7, [
|
|
506
581
|
renderSlot(_ctx.$slots, "helper", {}, () => [
|
|
507
582
|
createTextVNode(toDisplayString(_ctx.helper), 1)
|
|
508
583
|
])
|
|
@@ -510,9 +585,9 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
510
585
|
])) : createCommentVNode("", true)
|
|
511
586
|
], 2);
|
|
512
587
|
}
|
|
513
|
-
var DaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
588
|
+
var DaoCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$z]]);
|
|
514
589
|
var checkboxGroup_vue_vue_type_style_index_0_lang = "";
|
|
515
|
-
const _sfc_main$
|
|
590
|
+
const _sfc_main$B = defineComponent({
|
|
516
591
|
name: "DaoCheckboxGroup",
|
|
517
592
|
props: {
|
|
518
593
|
modelValue: {
|
|
@@ -546,18 +621,18 @@ const _sfc_main$q = defineComponent({
|
|
|
546
621
|
};
|
|
547
622
|
}
|
|
548
623
|
});
|
|
549
|
-
function _sfc_render$
|
|
624
|
+
function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
550
625
|
return openBlock(), createElementBlock("div", {
|
|
551
626
|
class: normalizeClass(_ctx.checkboxGroupClasses)
|
|
552
627
|
}, [
|
|
553
628
|
renderSlot(_ctx.$slots, "default")
|
|
554
629
|
], 2);
|
|
555
630
|
}
|
|
556
|
-
var checkboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
557
|
-
const _sfc_main$
|
|
631
|
+
var checkboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$y]]);
|
|
632
|
+
const _sfc_main$A = defineComponent({
|
|
558
633
|
name: "DaoDialogHeader",
|
|
559
634
|
components: {
|
|
560
|
-
|
|
635
|
+
DaoButton
|
|
561
636
|
},
|
|
562
637
|
props: {
|
|
563
638
|
showClose: {
|
|
@@ -577,34 +652,28 @@ const _sfc_main$p = defineComponent({
|
|
|
577
652
|
};
|
|
578
653
|
}
|
|
579
654
|
});
|
|
580
|
-
const _hoisted_1$
|
|
581
|
-
function _sfc_render$
|
|
582
|
-
const
|
|
583
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
655
|
+
const _hoisted_1$q = { class: "dao-dialog-header" };
|
|
656
|
+
function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
657
|
+
const _component_dao_button = resolveComponent("dao-button");
|
|
658
|
+
return openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
584
659
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
585
|
-
createElementVNode("span",
|
|
586
|
-
class: normalizeClass({ "center": !_ctx.showClose })
|
|
587
|
-
}, [
|
|
660
|
+
createElementVNode("span", null, [
|
|
588
661
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
589
662
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
590
663
|
])
|
|
591
|
-
]
|
|
592
|
-
_ctx.showClose ? (openBlock(),
|
|
664
|
+
]),
|
|
665
|
+
_ctx.showClose ? (openBlock(), createBlock(_component_dao_button, {
|
|
593
666
|
key: 0,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
name: "icon_close-circled",
|
|
600
|
-
class: "dao-dialog-header-close-btn__close"
|
|
601
|
-
})
|
|
602
|
-
])) : createCommentVNode("", true)
|
|
667
|
+
"use-font": "",
|
|
668
|
+
type: "ghost",
|
|
669
|
+
"icon-left": "icon-close",
|
|
670
|
+
onClick: _ctx.onClose
|
|
671
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
603
672
|
])
|
|
604
673
|
]);
|
|
605
674
|
}
|
|
606
|
-
var DialogHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
607
|
-
const _sfc_main$
|
|
675
|
+
var DialogHeader = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$x]]);
|
|
676
|
+
const _sfc_main$z = defineComponent({
|
|
608
677
|
name: "DaoDialogFooter",
|
|
609
678
|
components: {
|
|
610
679
|
DaoButton
|
|
@@ -640,13 +709,13 @@ const _sfc_main$o = defineComponent({
|
|
|
640
709
|
};
|
|
641
710
|
}
|
|
642
711
|
});
|
|
643
|
-
const _hoisted_1$
|
|
644
|
-
function _sfc_render$
|
|
712
|
+
const _hoisted_1$p = { class: "dao-dialog-footer" };
|
|
713
|
+
function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
645
714
|
const _component_dao_button = resolveComponent("dao-button");
|
|
646
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
715
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
647
716
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
648
717
|
createVNode(_component_dao_button, {
|
|
649
|
-
type: "
|
|
718
|
+
type: "ghost",
|
|
650
719
|
class: "dao-dialog-footer-cancel-btn",
|
|
651
720
|
onClick: _ctx.onCancel
|
|
652
721
|
}, {
|
|
@@ -668,13 +737,13 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
668
737
|
])
|
|
669
738
|
]);
|
|
670
739
|
}
|
|
671
|
-
var DialogFooter = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
740
|
+
var DialogFooter = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$w]]);
|
|
672
741
|
var dialog_scss_vue_type_style_index_0_src_lang = "";
|
|
673
742
|
const DIALOG_NUM_ATTR = "dao-dialog-num";
|
|
674
743
|
const DIALOG_MINIMUM_PADDING = "20px";
|
|
675
744
|
const DIALOG_DEFAULT_PADDING_TOP = "100px";
|
|
676
745
|
const DIALOG_DEFAULT_PADDING_BOTTOM = "20px";
|
|
677
|
-
const _sfc_main$
|
|
746
|
+
const _sfc_main$y = defineComponent({
|
|
678
747
|
name: "DaoDialog",
|
|
679
748
|
components: {
|
|
680
749
|
DialogHeader,
|
|
@@ -752,7 +821,7 @@ const _sfc_main$n = defineComponent({
|
|
|
752
821
|
"before-close",
|
|
753
822
|
"closed"
|
|
754
823
|
],
|
|
755
|
-
setup(props, { emit
|
|
824
|
+
setup(props, { emit }) {
|
|
756
825
|
const {
|
|
757
826
|
modelValue,
|
|
758
827
|
middle,
|
|
@@ -760,7 +829,7 @@ const _sfc_main$n = defineComponent({
|
|
|
760
829
|
bottom: bottom2,
|
|
761
830
|
containerClass,
|
|
762
831
|
size,
|
|
763
|
-
header,
|
|
832
|
+
header: header2,
|
|
764
833
|
lockScroll,
|
|
765
834
|
closeOnPressEscape,
|
|
766
835
|
closeOnClickOutside
|
|
@@ -771,8 +840,8 @@ const _sfc_main$n = defineComponent({
|
|
|
771
840
|
containerClass.value,
|
|
772
841
|
`dao-dialog__size-${size.value}`
|
|
773
842
|
]);
|
|
774
|
-
const showHeader = computed(() => typeof
|
|
775
|
-
const headerTitle = computed(() => typeof
|
|
843
|
+
const showHeader = computed(() => typeof header2.value === "boolean" ? header2.value : true);
|
|
844
|
+
const headerTitle = computed(() => typeof header2.value === "string" ? header2.value : "");
|
|
776
845
|
watch(modelValue, (newV) => {
|
|
777
846
|
emit("change", newV);
|
|
778
847
|
});
|
|
@@ -839,7 +908,6 @@ const _sfc_main$n = defineComponent({
|
|
|
839
908
|
computedContainerClass,
|
|
840
909
|
headerTitle,
|
|
841
910
|
showHeader,
|
|
842
|
-
slots,
|
|
843
911
|
onBeforeEnter,
|
|
844
912
|
onAfterEnter,
|
|
845
913
|
onConfirm,
|
|
@@ -850,8 +918,8 @@ const _sfc_main$n = defineComponent({
|
|
|
850
918
|
};
|
|
851
919
|
}
|
|
852
920
|
});
|
|
853
|
-
const _hoisted_1$
|
|
854
|
-
function _sfc_render$
|
|
921
|
+
const _hoisted_1$o = { class: "dao-dialog-body" };
|
|
922
|
+
function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
855
923
|
const _component_dialog_header = resolveComponent("dialog-header");
|
|
856
924
|
const _component_dialog_footer = resolveComponent("dialog-footer");
|
|
857
925
|
return openBlock(), createBlock(Transition, {
|
|
@@ -886,7 +954,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
886
954
|
]),
|
|
887
955
|
_: 3
|
|
888
956
|
}, 8, ["title", "show-close", "onClose"])) : createCommentVNode("", true),
|
|
889
|
-
createElementVNode("div", _hoisted_1$
|
|
957
|
+
createElementVNode("div", _hoisted_1$o, [
|
|
890
958
|
renderSlot(_ctx.$slots, "default")
|
|
891
959
|
]),
|
|
892
960
|
_ctx.footer ? (openBlock(), createBlock(_component_dialog_footer, {
|
|
@@ -908,7 +976,278 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
908
976
|
_: 3
|
|
909
977
|
}, 8, ["onBeforeEnter", "onAfterEnter", "onBeforeLeave", "onAfterLeave"]);
|
|
910
978
|
}
|
|
911
|
-
var dialog = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
979
|
+
var dialog = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$v]]);
|
|
980
|
+
const drawerProps = {
|
|
981
|
+
modelValue: {
|
|
982
|
+
type: Boolean,
|
|
983
|
+
default: false
|
|
984
|
+
},
|
|
985
|
+
hideHeader: {
|
|
986
|
+
type: Boolean,
|
|
987
|
+
default: false
|
|
988
|
+
},
|
|
989
|
+
hideFooter: {
|
|
990
|
+
type: Boolean,
|
|
991
|
+
default: false
|
|
992
|
+
},
|
|
993
|
+
hideMask: {
|
|
994
|
+
type: Boolean,
|
|
995
|
+
default: false
|
|
996
|
+
},
|
|
997
|
+
hideCloseIcon: {
|
|
998
|
+
type: Boolean,
|
|
999
|
+
default: false
|
|
1000
|
+
},
|
|
1001
|
+
title: {
|
|
1002
|
+
type: String,
|
|
1003
|
+
default: ""
|
|
1004
|
+
},
|
|
1005
|
+
size: {
|
|
1006
|
+
type: String,
|
|
1007
|
+
default: "md"
|
|
1008
|
+
},
|
|
1009
|
+
cancelText: {
|
|
1010
|
+
type: String,
|
|
1011
|
+
default: "cancel"
|
|
1012
|
+
},
|
|
1013
|
+
confirmText: {
|
|
1014
|
+
type: String,
|
|
1015
|
+
default: "ok"
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
const getFocusElementRange = (elementNode) => {
|
|
1019
|
+
const focusedElementOrigin = document.activeElement;
|
|
1020
|
+
let firstTab = null;
|
|
1021
|
+
let lastTab = null;
|
|
1022
|
+
const focusableElementsString = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
|
|
1023
|
+
if (elementNode) {
|
|
1024
|
+
const focusableElements = Array.from(elementNode.querySelectorAll(focusableElementsString));
|
|
1025
|
+
firstTab = focusableElements[0];
|
|
1026
|
+
lastTab = focusableElements[focusableElements.length - 1];
|
|
1027
|
+
firstTab == null ? void 0 : firstTab.focus();
|
|
1028
|
+
}
|
|
1029
|
+
return {
|
|
1030
|
+
lastTab,
|
|
1031
|
+
firstTab,
|
|
1032
|
+
focusedElementOrigin
|
|
1033
|
+
};
|
|
1034
|
+
};
|
|
1035
|
+
const trapTabKey = (e, firstTab, lastTab) => {
|
|
1036
|
+
if (e.code === "Tab") {
|
|
1037
|
+
if (e.shiftKey) {
|
|
1038
|
+
if (document.activeElement === firstTab) {
|
|
1039
|
+
e.preventDefault();
|
|
1040
|
+
lastTab.focus();
|
|
1041
|
+
}
|
|
1042
|
+
} else if (document.activeElement === lastTab) {
|
|
1043
|
+
e.preventDefault();
|
|
1044
|
+
firstTab.focus();
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
};
|
|
1048
|
+
var drawer_vue_vue_type_style_index_0_lang = "";
|
|
1049
|
+
const _sfc_main$x = defineComponent({
|
|
1050
|
+
name: "DaoDrawer",
|
|
1051
|
+
components: {
|
|
1052
|
+
DaoButton,
|
|
1053
|
+
DaoActionIcon
|
|
1054
|
+
},
|
|
1055
|
+
props: drawerProps,
|
|
1056
|
+
emits: ["close", "confirm"],
|
|
1057
|
+
setup(props, { emit }) {
|
|
1058
|
+
const { modelValue, size } = toRefs(props);
|
|
1059
|
+
const visible = ref(false);
|
|
1060
|
+
const wrapVisible = ref(false);
|
|
1061
|
+
const drawerRef = ref(null);
|
|
1062
|
+
let focusElement = {
|
|
1063
|
+
firstTab: null,
|
|
1064
|
+
lastTab: null,
|
|
1065
|
+
focusedElementOrigin: null
|
|
1066
|
+
};
|
|
1067
|
+
const wrapClassList = computed(() => [
|
|
1068
|
+
"dao-drawer__wrap",
|
|
1069
|
+
{
|
|
1070
|
+
"dao-drawer__wrap--hide": !wrapVisible.value
|
|
1071
|
+
}
|
|
1072
|
+
]);
|
|
1073
|
+
const contentClassList = computed(() => [
|
|
1074
|
+
"dao-drawer",
|
|
1075
|
+
`dao-drawer-${size.value}`
|
|
1076
|
+
]);
|
|
1077
|
+
const checkMasksVisible = () => {
|
|
1078
|
+
const masks = document.getElementsByClassName("dao-drawer__mask") || [];
|
|
1079
|
+
return !Array.from(masks).some((v) => v.style.display === "");
|
|
1080
|
+
};
|
|
1081
|
+
const lockWindowScroll = () => {
|
|
1082
|
+
document.body.style.overflow = "hidden";
|
|
1083
|
+
document.body.tabIndex = -1;
|
|
1084
|
+
};
|
|
1085
|
+
const unLockWindowScroll = () => {
|
|
1086
|
+
if (checkMasksVisible()) {
|
|
1087
|
+
document.body.style.overflow = "";
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
const close = () => {
|
|
1091
|
+
visible.value = false;
|
|
1092
|
+
emit("close");
|
|
1093
|
+
};
|
|
1094
|
+
const handleWrapClick = (event) => {
|
|
1095
|
+
const { target } = event;
|
|
1096
|
+
const className = target.getAttribute("class");
|
|
1097
|
+
if (className && className.indexOf("dao-drawer__wrap") > -1) {
|
|
1098
|
+
close();
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
const handleWrapVisible = (v) => {
|
|
1102
|
+
if (!v) {
|
|
1103
|
+
setTimeout(() => {
|
|
1104
|
+
wrapVisible.value = v;
|
|
1105
|
+
}, 100);
|
|
1106
|
+
} else {
|
|
1107
|
+
wrapVisible.value = v;
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
const confirm = () => {
|
|
1111
|
+
visible.value = false;
|
|
1112
|
+
emit("confirm");
|
|
1113
|
+
};
|
|
1114
|
+
const setLastFocusElement = () => {
|
|
1115
|
+
if (focusElement.focusedElementOrigin instanceof HTMLElement) {
|
|
1116
|
+
focusElement.focusedElementOrigin.focus();
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
const onHandleKeyDown = (e) => {
|
|
1120
|
+
if (e.code === "Escape") {
|
|
1121
|
+
close();
|
|
1122
|
+
}
|
|
1123
|
+
if (!focusElement.firstTab || !focusElement.lastTab) {
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
trapTabKey(e, focusElement.firstTab, focusElement.lastTab);
|
|
1127
|
+
};
|
|
1128
|
+
const onBeforeEnter = () => {
|
|
1129
|
+
focusElement = getFocusElementRange(drawerRef.value);
|
|
1130
|
+
lockWindowScroll();
|
|
1131
|
+
document.addEventListener("keydown", onHandleKeyDown);
|
|
1132
|
+
};
|
|
1133
|
+
const onAfterLeave = () => {
|
|
1134
|
+
setLastFocusElement();
|
|
1135
|
+
unLockWindowScroll();
|
|
1136
|
+
document.removeEventListener("keydown", onHandleKeyDown);
|
|
1137
|
+
};
|
|
1138
|
+
watch(modelValue, (v) => {
|
|
1139
|
+
visible.value = v;
|
|
1140
|
+
handleWrapVisible(v);
|
|
1141
|
+
}, { immediate: true });
|
|
1142
|
+
return {
|
|
1143
|
+
visible,
|
|
1144
|
+
drawerRef,
|
|
1145
|
+
wrapClassList,
|
|
1146
|
+
contentClassList,
|
|
1147
|
+
close,
|
|
1148
|
+
confirm,
|
|
1149
|
+
handleWrapClick,
|
|
1150
|
+
onBeforeEnter,
|
|
1151
|
+
onAfterLeave
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
const _hoisted_1$n = { class: "dao-drawer__content" };
|
|
1156
|
+
const _hoisted_2$h = {
|
|
1157
|
+
key: 0,
|
|
1158
|
+
class: "dao-drawer__header"
|
|
1159
|
+
};
|
|
1160
|
+
const _hoisted_3$b = { class: "dao-drawer__header-group" };
|
|
1161
|
+
const _hoisted_4$a = { class: "dao-drawer__body" };
|
|
1162
|
+
const _hoisted_5$6 = {
|
|
1163
|
+
key: 1,
|
|
1164
|
+
class: "dao-drawer__footer"
|
|
1165
|
+
};
|
|
1166
|
+
const _hoisted_6$4 = { class: "dao-drawer__footer-group" };
|
|
1167
|
+
function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1168
|
+
const _component_dao_action_icon = resolveComponent("dao-action-icon");
|
|
1169
|
+
const _component_dao_button = resolveComponent("dao-button");
|
|
1170
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1171
|
+
createVNode(Transition, { name: "fade-in" }, {
|
|
1172
|
+
default: withCtx(() => [
|
|
1173
|
+
!_ctx.hideMask ? withDirectives((openBlock(), createElementBlock("div", {
|
|
1174
|
+
key: 0,
|
|
1175
|
+
class: "dao-drawer__mask",
|
|
1176
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args)),
|
|
1177
|
+
onKeydown: _cache[1] || (_cache[1] = (...args) => _ctx.close && _ctx.close(...args))
|
|
1178
|
+
}, null, 544)), [
|
|
1179
|
+
[vShow, _ctx.visible]
|
|
1180
|
+
]) : createCommentVNode("", true)
|
|
1181
|
+
]),
|
|
1182
|
+
_: 1
|
|
1183
|
+
}),
|
|
1184
|
+
createElementVNode("div", {
|
|
1185
|
+
ref: "drawerRef",
|
|
1186
|
+
class: normalizeClass(_ctx.wrapClassList),
|
|
1187
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleWrapClick && _ctx.handleWrapClick(...args)),
|
|
1188
|
+
onKeydown: _cache[3] || (_cache[3] = (...args) => _ctx.handleWrapClick && _ctx.handleWrapClick(...args))
|
|
1189
|
+
}, [
|
|
1190
|
+
createVNode(Transition, {
|
|
1191
|
+
name: "slide-in-right",
|
|
1192
|
+
onAfterEnter: _ctx.onBeforeEnter,
|
|
1193
|
+
onAfterLeave: _ctx.onAfterLeave
|
|
1194
|
+
}, {
|
|
1195
|
+
default: withCtx(() => [
|
|
1196
|
+
withDirectives(createElementVNode("div", {
|
|
1197
|
+
class: normalizeClass(_ctx.contentClassList)
|
|
1198
|
+
}, [
|
|
1199
|
+
createElementVNode("div", _hoisted_1$n, [
|
|
1200
|
+
!_ctx.hideHeader ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
1201
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1202
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
1203
|
+
createElementVNode("span", null, toDisplayString(_ctx.title), 1),
|
|
1204
|
+
!_ctx.hideCloseIcon ? (openBlock(), createBlock(_component_dao_action_icon, {
|
|
1205
|
+
key: 0,
|
|
1206
|
+
name: "icon-close",
|
|
1207
|
+
onClick: _ctx.close
|
|
1208
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
1209
|
+
])
|
|
1210
|
+
])
|
|
1211
|
+
])) : createCommentVNode("", true),
|
|
1212
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
1213
|
+
renderSlot(_ctx.$slots, "default")
|
|
1214
|
+
]),
|
|
1215
|
+
!_ctx.hideFooter ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
|
|
1216
|
+
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
1217
|
+
createElementVNode("div", _hoisted_6$4, [
|
|
1218
|
+
createVNode(_component_dao_button, {
|
|
1219
|
+
type: "ghost",
|
|
1220
|
+
class: "footer-cancel-btn footer-btn",
|
|
1221
|
+
onClick: _ctx.close
|
|
1222
|
+
}, {
|
|
1223
|
+
default: withCtx(() => [
|
|
1224
|
+
createTextVNode(toDisplayString(_ctx.cancelText), 1)
|
|
1225
|
+
]),
|
|
1226
|
+
_: 1
|
|
1227
|
+
}, 8, ["onClick"]),
|
|
1228
|
+
createVNode(_component_dao_button, {
|
|
1229
|
+
class: "footer-btn",
|
|
1230
|
+
onClick: _ctx.confirm
|
|
1231
|
+
}, {
|
|
1232
|
+
default: withCtx(() => [
|
|
1233
|
+
createTextVNode(toDisplayString(_ctx.confirmText), 1)
|
|
1234
|
+
]),
|
|
1235
|
+
_: 1
|
|
1236
|
+
}, 8, ["onClick"])
|
|
1237
|
+
])
|
|
1238
|
+
])
|
|
1239
|
+
])) : createCommentVNode("", true)
|
|
1240
|
+
])
|
|
1241
|
+
], 2), [
|
|
1242
|
+
[vShow, _ctx.visible]
|
|
1243
|
+
])
|
|
1244
|
+
]),
|
|
1245
|
+
_: 3
|
|
1246
|
+
}, 8, ["onAfterEnter", "onAfterLeave"])
|
|
1247
|
+
], 34)
|
|
1248
|
+
], 64);
|
|
1249
|
+
}
|
|
1250
|
+
var drawer = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$u]]);
|
|
912
1251
|
var top = "top";
|
|
913
1252
|
var bottom = "bottom";
|
|
914
1253
|
var right = "right";
|
|
@@ -2042,13 +2381,13 @@ function popperGenerator(generatorOptions) {
|
|
|
2042
2381
|
state.orderedModifiers.forEach(function(modifier) {
|
|
2043
2382
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
2044
2383
|
});
|
|
2045
|
-
for (var
|
|
2384
|
+
for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) {
|
|
2046
2385
|
if (state.reset === true) {
|
|
2047
2386
|
state.reset = false;
|
|
2048
|
-
|
|
2387
|
+
index2 = -1;
|
|
2049
2388
|
continue;
|
|
2050
2389
|
}
|
|
2051
|
-
var _state$orderedModifie = state.orderedModifiers[
|
|
2390
|
+
var _state$orderedModifie = state.orderedModifiers[index2], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
2052
2391
|
if (typeof fn2 === "function") {
|
|
2053
2392
|
state = fn2({
|
|
2054
2393
|
state,
|
|
@@ -2107,7 +2446,7 @@ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyS
|
|
|
2107
2446
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
2108
2447
|
defaultModifiers
|
|
2109
2448
|
});
|
|
2110
|
-
const _sfc_main$
|
|
2449
|
+
const _sfc_main$w = defineComponent({
|
|
2111
2450
|
name: "PopperContent",
|
|
2112
2451
|
props: {
|
|
2113
2452
|
popperId: {
|
|
@@ -2155,29 +2494,29 @@ const _sfc_main$m = defineComponent({
|
|
|
2155
2494
|
};
|
|
2156
2495
|
}
|
|
2157
2496
|
});
|
|
2158
|
-
const _hoisted_1$
|
|
2159
|
-
const _hoisted_2$
|
|
2497
|
+
const _hoisted_1$m = ["id", "aria-hidden", "tabindex"];
|
|
2498
|
+
const _hoisted_2$g = {
|
|
2160
2499
|
ref: "arrow",
|
|
2161
2500
|
class: "dao-popper-arrow"
|
|
2162
2501
|
};
|
|
2163
|
-
const _hoisted_3$
|
|
2502
|
+
const _hoisted_3$a = /* @__PURE__ */ createElementVNode("svg", {
|
|
2164
2503
|
class: "dao-popper-arrow-viewbox",
|
|
2165
|
-
viewBox: "0 0
|
|
2504
|
+
viewBox: "0 0 15 15"
|
|
2166
2505
|
}, [
|
|
2167
2506
|
/* @__PURE__ */ createElementVNode("path", {
|
|
2168
2507
|
class: "pt-popper-arrow-border",
|
|
2169
|
-
d: "
|
|
2170
|
-
|
|
2508
|
+
d: "M4 7.5L14 -1L14 16Z",
|
|
2509
|
+
opacity: "0.1"
|
|
2171
2510
|
}),
|
|
2172
2511
|
/* @__PURE__ */ createElementVNode("path", {
|
|
2173
2512
|
class: "pt-popper-arrow-fill",
|
|
2174
|
-
d: "
|
|
2513
|
+
d: "M6 7.5L15 -1L15 16Z"
|
|
2175
2514
|
})
|
|
2176
2515
|
], -1);
|
|
2177
|
-
const _hoisted_4$
|
|
2178
|
-
_hoisted_3$
|
|
2516
|
+
const _hoisted_4$9 = [
|
|
2517
|
+
_hoisted_3$a
|
|
2179
2518
|
];
|
|
2180
|
-
function _sfc_render$
|
|
2519
|
+
function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2181
2520
|
return openBlock(), createElementBlock("div", {
|
|
2182
2521
|
id: _ctx.popperId,
|
|
2183
2522
|
ref: "popover",
|
|
@@ -2196,12 +2535,12 @@ function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2196
2535
|
}, [
|
|
2197
2536
|
renderSlot(_ctx.$slots, "default")
|
|
2198
2537
|
], 4),
|
|
2199
|
-
withDirectives(createElementVNode("div", _hoisted_2$
|
|
2538
|
+
withDirectives(createElementVNode("div", _hoisted_2$g, _hoisted_4$9, 512), [
|
|
2200
2539
|
[vShow, _ctx.visibleArrow]
|
|
2201
2540
|
])
|
|
2202
|
-
], 42, _hoisted_1$
|
|
2541
|
+
], 42, _hoisted_1$m);
|
|
2203
2542
|
}
|
|
2204
|
-
var PopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2543
|
+
var PopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$t]]);
|
|
2205
2544
|
var PopperProps = {
|
|
2206
2545
|
modelValue: {
|
|
2207
2546
|
type: Boolean,
|
|
@@ -2291,7 +2630,7 @@ function updatePopperOptions(popperInstance, modifiers, popperOptions = {}) {
|
|
|
2291
2630
|
});
|
|
2292
2631
|
});
|
|
2293
2632
|
}
|
|
2294
|
-
const _sfc_main$
|
|
2633
|
+
const _sfc_main$v = defineComponent({
|
|
2295
2634
|
name: "DaoPopper",
|
|
2296
2635
|
components: {
|
|
2297
2636
|
PopperContent
|
|
@@ -2481,10 +2820,17 @@ const _sfc_main$l = defineComponent({
|
|
|
2481
2820
|
}
|
|
2482
2821
|
};
|
|
2483
2822
|
const handleDocumentClick = (e) => {
|
|
2823
|
+
let { target } = e;
|
|
2824
|
+
if (e.composed) {
|
|
2825
|
+
const composedPath = e.composedPath();
|
|
2826
|
+
if (composedPath.length) {
|
|
2827
|
+
[target] = composedPath;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2484
2830
|
if (!unref(isOpen)) {
|
|
2485
2831
|
return;
|
|
2486
2832
|
}
|
|
2487
|
-
if (!(_popperNode == null ? void 0 : _popperNode.contains(
|
|
2833
|
+
if (!(_popperNode == null ? void 0 : _popperNode.contains(target)) && !(_targetNode == null ? void 0 : _targetNode.contains(target))) {
|
|
2488
2834
|
hide();
|
|
2489
2835
|
}
|
|
2490
2836
|
};
|
|
@@ -2641,7 +2987,7 @@ const _sfc_main$l = defineComponent({
|
|
|
2641
2987
|
};
|
|
2642
2988
|
}
|
|
2643
2989
|
});
|
|
2644
|
-
function _sfc_render$
|
|
2990
|
+
function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2645
2991
|
const _component_popper_content = resolveComponent("popper-content");
|
|
2646
2992
|
return openBlock(), createElementBlock("div", {
|
|
2647
2993
|
ref: "reference",
|
|
@@ -2683,11 +3029,11 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2683
3029
|
], 8, ["to", "disabled"]))
|
|
2684
3030
|
], 2);
|
|
2685
3031
|
}
|
|
2686
|
-
var
|
|
2687
|
-
const _sfc_main$
|
|
3032
|
+
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$s]]);
|
|
3033
|
+
const _sfc_main$u = defineComponent({
|
|
2688
3034
|
name: "DaoDropdown",
|
|
2689
3035
|
components: {
|
|
2690
|
-
DaoPopper
|
|
3036
|
+
DaoPopper: Popper
|
|
2691
3037
|
},
|
|
2692
3038
|
props: {
|
|
2693
3039
|
trigger: {
|
|
@@ -2740,8 +3086,8 @@ const _sfc_main$k = defineComponent({
|
|
|
2740
3086
|
};
|
|
2741
3087
|
}
|
|
2742
3088
|
});
|
|
2743
|
-
const _hoisted_1$
|
|
2744
|
-
function _sfc_render$
|
|
3089
|
+
const _hoisted_1$l = { tabindex: "0" };
|
|
3090
|
+
function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2745
3091
|
const _component_dao_popper = resolveComponent("dao-popper");
|
|
2746
3092
|
return openBlock(), createBlock(_component_dao_popper, {
|
|
2747
3093
|
ref: "popper",
|
|
@@ -2757,27 +3103,27 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2757
3103
|
renderSlot(_ctx.$slots, "menu")
|
|
2758
3104
|
]),
|
|
2759
3105
|
default: withCtx(() => [
|
|
2760
|
-
createElementVNode("div", _hoisted_1$
|
|
3106
|
+
createElementVNode("div", _hoisted_1$l, [
|
|
2761
3107
|
renderSlot(_ctx.$slots, "default")
|
|
2762
3108
|
])
|
|
2763
3109
|
]),
|
|
2764
3110
|
_: 3
|
|
2765
3111
|
}, 8, ["placement", "append-to", "trigger", "offset", "model-value"]);
|
|
2766
3112
|
}
|
|
2767
|
-
var dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3113
|
+
var dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$r]]);
|
|
2768
3114
|
var dropdownMenu_vue_vue_type_style_index_0_lang = "";
|
|
2769
|
-
const _sfc_main$
|
|
3115
|
+
const _sfc_main$t = defineComponent({
|
|
2770
3116
|
name: "DaoDropdownMenu"
|
|
2771
3117
|
});
|
|
2772
|
-
const _hoisted_1$
|
|
2773
|
-
function _sfc_render$
|
|
2774
|
-
return openBlock(), createElementBlock("ul", _hoisted_1$
|
|
3118
|
+
const _hoisted_1$k = { class: "dao-dropdown-menu" };
|
|
3119
|
+
function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3120
|
+
return openBlock(), createElementBlock("ul", _hoisted_1$k, [
|
|
2775
3121
|
renderSlot(_ctx.$slots, "default")
|
|
2776
3122
|
]);
|
|
2777
3123
|
}
|
|
2778
|
-
var dropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3124
|
+
var dropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$q]]);
|
|
2779
3125
|
var dropdownItem_vue_vue_type_style_index_0_lang = "";
|
|
2780
|
-
const _sfc_main$
|
|
3126
|
+
const _sfc_main$s = defineComponent({
|
|
2781
3127
|
name: "DaoDropdownItem",
|
|
2782
3128
|
props: {
|
|
2783
3129
|
type: {
|
|
@@ -2826,14 +3172,259 @@ const _sfc_main$i = defineComponent({
|
|
|
2826
3172
|
};
|
|
2827
3173
|
}
|
|
2828
3174
|
});
|
|
2829
|
-
function _sfc_render$
|
|
3175
|
+
function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2830
3176
|
return openBlock(), createElementBlock("li", mergeProps({ class: _ctx.classList }, _ctx.itemAttrs), [
|
|
2831
3177
|
_ctx.type !== "divider" ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true)
|
|
2832
3178
|
], 16);
|
|
2833
3179
|
}
|
|
2834
|
-
var dropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3180
|
+
var dropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$p]]);
|
|
3181
|
+
const expansionProps = {
|
|
3182
|
+
modelValue: {
|
|
3183
|
+
type: [String, Symbol, Array]
|
|
3184
|
+
},
|
|
3185
|
+
accordion: {
|
|
3186
|
+
type: Boolean,
|
|
3187
|
+
default: false
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
const expansionItemProps = {
|
|
3191
|
+
name: {
|
|
3192
|
+
type: [String, Symbol],
|
|
3193
|
+
required: true
|
|
3194
|
+
},
|
|
3195
|
+
title: {
|
|
3196
|
+
type: String,
|
|
3197
|
+
default: ""
|
|
3198
|
+
},
|
|
3199
|
+
description: {
|
|
3200
|
+
type: String,
|
|
3201
|
+
default: ""
|
|
3202
|
+
}
|
|
3203
|
+
};
|
|
3204
|
+
var expansion_vue_vue_type_style_index_0_lang = "";
|
|
3205
|
+
const _sfc_main$r = defineComponent({
|
|
3206
|
+
name: "DaoExpansion",
|
|
3207
|
+
props: expansionProps,
|
|
3208
|
+
emits: ["update:modelValue", "change"],
|
|
3209
|
+
setup(props, { emit }) {
|
|
3210
|
+
const { accordion, modelValue } = toRefs(props);
|
|
3211
|
+
const state = reactive({
|
|
3212
|
+
expansionRecord: modelValue.value,
|
|
3213
|
+
accordion: accordion.value
|
|
3214
|
+
});
|
|
3215
|
+
function toggleItem(itemName) {
|
|
3216
|
+
if (props.accordion) {
|
|
3217
|
+
let currentVal = itemName;
|
|
3218
|
+
if (currentVal === state.expansionRecord) {
|
|
3219
|
+
currentVal = void 0;
|
|
3220
|
+
}
|
|
3221
|
+
state.expansionRecord = currentVal;
|
|
3222
|
+
emit("update:modelValue", currentVal);
|
|
3223
|
+
emit("change", currentVal);
|
|
3224
|
+
} else {
|
|
3225
|
+
let rst = [];
|
|
3226
|
+
if (Array.isArray(state.expansionRecord)) {
|
|
3227
|
+
rst = [...state.expansionRecord];
|
|
3228
|
+
}
|
|
3229
|
+
const idx = rst.indexOf(itemName);
|
|
3230
|
+
if (idx > -1) {
|
|
3231
|
+
rst.splice(idx, 1);
|
|
3232
|
+
} else {
|
|
3233
|
+
rst.push(itemName);
|
|
3234
|
+
}
|
|
3235
|
+
state.expansionRecord = rst;
|
|
3236
|
+
emit("update:modelValue", rst);
|
|
3237
|
+
emit("change", rst);
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
watch([modelValue, accordion], ([newM, newA]) => {
|
|
3241
|
+
state.expansionRecord = newM;
|
|
3242
|
+
if (newA !== state.accordion) {
|
|
3243
|
+
let nextRecordVal;
|
|
3244
|
+
if (newA) {
|
|
3245
|
+
if (Array.isArray(state.expansionRecord)) {
|
|
3246
|
+
if (state.expansionRecord.length) {
|
|
3247
|
+
[nextRecordVal] = state.expansionRecord;
|
|
3248
|
+
}
|
|
3249
|
+
} else {
|
|
3250
|
+
nextRecordVal = state.expansionRecord;
|
|
3251
|
+
}
|
|
3252
|
+
} else {
|
|
3253
|
+
nextRecordVal = [];
|
|
3254
|
+
if (state.expansionRecord !== void 0) {
|
|
3255
|
+
if (!Array.isArray(state.expansionRecord)) {
|
|
3256
|
+
nextRecordVal[0] = state.expansionRecord;
|
|
3257
|
+
}
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
state.expansionRecord = nextRecordVal;
|
|
3261
|
+
debugger;
|
|
3262
|
+
emit("update:modelValue", nextRecordVal);
|
|
3263
|
+
emit("change", nextRecordVal);
|
|
3264
|
+
}
|
|
3265
|
+
state.accordion = newA;
|
|
3266
|
+
});
|
|
3267
|
+
provide(ToggleItemKey, toggleItem);
|
|
3268
|
+
provide(ExpansionStateKey, state);
|
|
3269
|
+
return {
|
|
3270
|
+
toggleItem,
|
|
3271
|
+
state
|
|
3272
|
+
};
|
|
3273
|
+
}
|
|
3274
|
+
});
|
|
3275
|
+
const _hoisted_1$j = { class: "dao-expansion" };
|
|
3276
|
+
function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3277
|
+
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
3278
|
+
renderSlot(_ctx.$slots, "default")
|
|
3279
|
+
]);
|
|
3280
|
+
}
|
|
3281
|
+
var expansion = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$o]]);
|
|
3282
|
+
var expansionItem_vue_vue_type_style_index_0_lang = "";
|
|
3283
|
+
const _sfc_main$q = defineComponent({
|
|
3284
|
+
name: "DaoExpansionItem",
|
|
3285
|
+
components: {
|
|
3286
|
+
DaoIcon
|
|
3287
|
+
},
|
|
3288
|
+
props: expansionItemProps,
|
|
3289
|
+
setup(props) {
|
|
3290
|
+
const toggleItem = inject(ToggleItemKey, null);
|
|
3291
|
+
const parentState = inject(ExpansionStateKey, null);
|
|
3292
|
+
function onItemClick() {
|
|
3293
|
+
if (props.name !== void 0) {
|
|
3294
|
+
toggleItem == null ? void 0 : toggleItem(props.name);
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
const isExpanded = computed(() => {
|
|
3298
|
+
if (parentState == null ? void 0 : parentState.expansionRecord) {
|
|
3299
|
+
if (parentState == null ? void 0 : parentState.accordion) {
|
|
3300
|
+
return parentState.expansionRecord === props.name;
|
|
3301
|
+
}
|
|
3302
|
+
if (Array.isArray(parentState == null ? void 0 : parentState.expansionRecord) && props.name !== void 0) {
|
|
3303
|
+
return parentState.expansionRecord.includes(props.name);
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
return false;
|
|
3307
|
+
});
|
|
3308
|
+
function onBeforeEnter(el) {
|
|
3309
|
+
if (el instanceof HTMLElement) {
|
|
3310
|
+
const { style } = el;
|
|
3311
|
+
style.maxHeight = "0px";
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
function onEnter(el) {
|
|
3315
|
+
if (el instanceof HTMLElement) {
|
|
3316
|
+
const { style } = el;
|
|
3317
|
+
style.maxHeight = `${el.scrollHeight || style.maxHeight}px`;
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
function onAfterEnter(el) {
|
|
3321
|
+
if (el instanceof HTMLElement) {
|
|
3322
|
+
const { style } = el;
|
|
3323
|
+
style.maxHeight = "";
|
|
3324
|
+
}
|
|
3325
|
+
}
|
|
3326
|
+
function onBeforeLeave(el) {
|
|
3327
|
+
if (el instanceof HTMLElement) {
|
|
3328
|
+
const { style } = el;
|
|
3329
|
+
if (el.scrollHeight !== 0) {
|
|
3330
|
+
style.maxHeight = `${el.scrollHeight}px`;
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
function onLeave(el) {
|
|
3335
|
+
if (el instanceof HTMLElement) {
|
|
3336
|
+
const { style } = el;
|
|
3337
|
+
style.maxHeight = "0px";
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
function onAfterLeave(el) {
|
|
3341
|
+
if (el instanceof HTMLElement) {
|
|
3342
|
+
const { style } = el;
|
|
3343
|
+
style.maxHeight = "";
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
return {
|
|
3347
|
+
onItemClick,
|
|
3348
|
+
isExpanded,
|
|
3349
|
+
onBeforeEnter,
|
|
3350
|
+
onEnter,
|
|
3351
|
+
onAfterEnter,
|
|
3352
|
+
onBeforeLeave,
|
|
3353
|
+
onLeave,
|
|
3354
|
+
onAfterLeave
|
|
3355
|
+
};
|
|
3356
|
+
}
|
|
3357
|
+
});
|
|
3358
|
+
const _hoisted_1$i = { class: "dao-expansion-item-icon-container" };
|
|
3359
|
+
const _hoisted_2$f = { class: "dao-expansion-item-title-container" };
|
|
3360
|
+
const _hoisted_3$9 = { class: "dao-expansion-item-title dao-exp-ellipsis" };
|
|
3361
|
+
const _hoisted_4$8 = { class: "dao-expansion-item-description dao-exp-ellipsis" };
|
|
3362
|
+
const _hoisted_5$5 = { class: "dao-expansion-item-content-container" };
|
|
3363
|
+
const _hoisted_6$3 = { class: "dao-expansion-item-content" };
|
|
3364
|
+
function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3365
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
3366
|
+
return openBlock(), createElementBlock("div", {
|
|
3367
|
+
class: normalizeClass(["dao-expansion-item", {
|
|
3368
|
+
"dao-expansion-item--expanded": _ctx.isExpanded
|
|
3369
|
+
}])
|
|
3370
|
+
}, [
|
|
3371
|
+
createElementVNode("div", {
|
|
3372
|
+
class: "dao-expansion-item-header",
|
|
3373
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onItemClick && _ctx.onItemClick(...args))
|
|
3374
|
+
}, [
|
|
3375
|
+
createElementVNode("div", _hoisted_1$i, [
|
|
3376
|
+
createVNode(_component_dao_icon, {
|
|
3377
|
+
name: "icon-dropdown-line",
|
|
3378
|
+
class: "dao-expansion-item-icon",
|
|
3379
|
+
"use-font": ""
|
|
3380
|
+
})
|
|
3381
|
+
]),
|
|
3382
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
3383
|
+
createElementVNode("div", _hoisted_3$9, [
|
|
3384
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
3385
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
3386
|
+
])
|
|
3387
|
+
]),
|
|
3388
|
+
createElementVNode("div", _hoisted_4$8, [
|
|
3389
|
+
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
3390
|
+
createTextVNode(toDisplayString(_ctx.description), 1)
|
|
3391
|
+
])
|
|
3392
|
+
])
|
|
3393
|
+
]),
|
|
3394
|
+
_ctx.$slots.action ? (openBlock(), createElementBlock("div", {
|
|
3395
|
+
key: 0,
|
|
3396
|
+
class: "dao-expansion-item-action",
|
|
3397
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
3398
|
+
}, ["stop"]))
|
|
3399
|
+
}, [
|
|
3400
|
+
renderSlot(_ctx.$slots, "action")
|
|
3401
|
+
])) : createCommentVNode("", true)
|
|
3402
|
+
]),
|
|
3403
|
+
createVNode(Transition, {
|
|
3404
|
+
name: "dao-expansion-item",
|
|
3405
|
+
onBeforeEnter: _ctx.onBeforeEnter,
|
|
3406
|
+
onEnter: _ctx.onEnter,
|
|
3407
|
+
onAfterEnter: _ctx.onAfterEnter,
|
|
3408
|
+
onBeforeLeave: _ctx.onBeforeLeave,
|
|
3409
|
+
onLeave: _ctx.onLeave,
|
|
3410
|
+
onAfterLeave: _ctx.onAfterLeave
|
|
3411
|
+
}, {
|
|
3412
|
+
default: withCtx(() => [
|
|
3413
|
+
withDirectives(createElementVNode("div", _hoisted_5$5, [
|
|
3414
|
+
createElementVNode("div", _hoisted_6$3, [
|
|
3415
|
+
renderSlot(_ctx.$slots, "default")
|
|
3416
|
+
])
|
|
3417
|
+
], 512), [
|
|
3418
|
+
[vShow, _ctx.isExpanded]
|
|
3419
|
+
])
|
|
3420
|
+
]),
|
|
3421
|
+
_: 3
|
|
3422
|
+
}, 8, ["onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
|
|
3423
|
+
], 2);
|
|
3424
|
+
}
|
|
3425
|
+
var expansionItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$n]]);
|
|
2835
3426
|
var form_vue_vue_type_style_index_0_lang = "";
|
|
2836
|
-
const _sfc_main$
|
|
3427
|
+
const _sfc_main$p = defineComponent({
|
|
2837
3428
|
name: "DaoForm",
|
|
2838
3429
|
props: {
|
|
2839
3430
|
type: {
|
|
@@ -2851,7 +3442,7 @@ const _sfc_main$h = defineComponent({
|
|
|
2851
3442
|
provide(formLabelWidthKey, labelWidth.value);
|
|
2852
3443
|
}
|
|
2853
3444
|
});
|
|
2854
|
-
function _sfc_render$
|
|
3445
|
+
function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2855
3446
|
return openBlock(), createElementBlock("div", {
|
|
2856
3447
|
class: normalizeClass([
|
|
2857
3448
|
"dao-form",
|
|
@@ -2871,18 +3462,24 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2871
3462
|
} })
|
|
2872
3463
|
], 2);
|
|
2873
3464
|
}
|
|
2874
|
-
var form = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3465
|
+
var form = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$m]]);
|
|
3466
|
+
var tooltipProps = __spreadProps(__spreadValues({}, PopperProps), {
|
|
3467
|
+
offset: {
|
|
3468
|
+
type: [Number, String],
|
|
3469
|
+
default: 10
|
|
3470
|
+
}
|
|
3471
|
+
});
|
|
2875
3472
|
var tooltip_scss_vue_type_style_index_0_src_lang = "";
|
|
2876
|
-
const _sfc_main$
|
|
3473
|
+
const _sfc_main$o = defineComponent(__spreadProps(__spreadValues({}, Popper), {
|
|
2877
3474
|
name: "DaoTooltip",
|
|
2878
|
-
props:
|
|
3475
|
+
props: tooltipProps,
|
|
2879
3476
|
daoPopperTheme: "dao-tooltip"
|
|
2880
3477
|
}));
|
|
2881
3478
|
var formItem_vue_vue_type_style_index_0_lang = "";
|
|
2882
|
-
const _sfc_main$
|
|
3479
|
+
const _sfc_main$n = defineComponent({
|
|
2883
3480
|
name: "DaoFormItem",
|
|
2884
3481
|
components: {
|
|
2885
|
-
DaoTooltip: _sfc_main$
|
|
3482
|
+
DaoTooltip: _sfc_main$o
|
|
2886
3483
|
},
|
|
2887
3484
|
props: {
|
|
2888
3485
|
label: {
|
|
@@ -2927,30 +3524,30 @@ const _sfc_main$f = defineComponent({
|
|
|
2927
3524
|
};
|
|
2928
3525
|
}
|
|
2929
3526
|
});
|
|
2930
|
-
const _hoisted_1$
|
|
2931
|
-
const _hoisted_2$
|
|
3527
|
+
const _hoisted_1$h = { class: "dao-form-item" };
|
|
3528
|
+
const _hoisted_2$e = {
|
|
2932
3529
|
key: 0,
|
|
2933
3530
|
class: "dao-form-item__label-icon-wrapper"
|
|
2934
3531
|
};
|
|
2935
|
-
const _hoisted_3$
|
|
2936
|
-
const _hoisted_4$
|
|
2937
|
-
function _sfc_render$
|
|
3532
|
+
const _hoisted_3$8 = { class: "dao-form-item__label-icon-label" };
|
|
3533
|
+
const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("i", { class: "dao-form-item__label-icon icon-unknow" }, null, -1);
|
|
3534
|
+
function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2938
3535
|
const _component_dao_tooltip = resolveComponent("dao-tooltip");
|
|
2939
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3536
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
2940
3537
|
createElementVNode("div", {
|
|
2941
3538
|
class: "dao-form-item__label",
|
|
2942
3539
|
style: normalizeStyle(_ctx.labelStyle)
|
|
2943
3540
|
}, [
|
|
2944
3541
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
2945
3542
|
createTextVNode(toDisplayString(!_ctx.iconMessage ? _ctx.label : ""), 1),
|
|
2946
|
-
!!_ctx.iconMessage ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
2947
|
-
createElementVNode("span", _hoisted_3$
|
|
3543
|
+
!!_ctx.iconMessage ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
|
|
3544
|
+
createElementVNode("span", _hoisted_3$8, toDisplayString(_ctx.label), 1),
|
|
2948
3545
|
createVNode(_component_dao_tooltip, {
|
|
2949
3546
|
content: _ctx.iconMessage,
|
|
2950
3547
|
placement: "top"
|
|
2951
3548
|
}, {
|
|
2952
3549
|
default: withCtx(() => [
|
|
2953
|
-
_hoisted_4$
|
|
3550
|
+
_hoisted_4$7
|
|
2954
3551
|
]),
|
|
2955
3552
|
_: 1
|
|
2956
3553
|
}, 8, ["content"])
|
|
@@ -2965,9 +3562,9 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2965
3562
|
], 4)
|
|
2966
3563
|
]);
|
|
2967
3564
|
}
|
|
2968
|
-
var formItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3565
|
+
var formItem = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$l]]);
|
|
2969
3566
|
var formGroup_vue_vue_type_style_index_0_lang = "";
|
|
2970
|
-
const _sfc_main$
|
|
3567
|
+
const _sfc_main$m = defineComponent({
|
|
2971
3568
|
name: "DaoFormGroup",
|
|
2972
3569
|
props: {
|
|
2973
3570
|
title: {
|
|
@@ -2976,11 +3573,11 @@ const _sfc_main$e = defineComponent({
|
|
|
2976
3573
|
}
|
|
2977
3574
|
}
|
|
2978
3575
|
});
|
|
2979
|
-
const _hoisted_1$
|
|
2980
|
-
const _hoisted_2$
|
|
2981
|
-
function _sfc_render$
|
|
2982
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2983
|
-
createElementVNode("div", _hoisted_2$
|
|
3576
|
+
const _hoisted_1$g = { class: "dao-form-group" };
|
|
3577
|
+
const _hoisted_2$d = { class: "dao-form-group__title" };
|
|
3578
|
+
function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3579
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
3580
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
2984
3581
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
2985
3582
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
2986
3583
|
])
|
|
@@ -2988,20 +3585,216 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2988
3585
|
renderSlot(_ctx.$slots, "default")
|
|
2989
3586
|
]);
|
|
2990
3587
|
}
|
|
2991
|
-
var formGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3588
|
+
var formGroup = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$k]]);
|
|
3589
|
+
const headerProps = {
|
|
3590
|
+
type: {
|
|
3591
|
+
type: String,
|
|
3592
|
+
default: "2rd"
|
|
3593
|
+
},
|
|
3594
|
+
title: {
|
|
3595
|
+
type: String,
|
|
3596
|
+
default: ""
|
|
3597
|
+
}
|
|
3598
|
+
};
|
|
3599
|
+
var header_vue_vue_type_style_index_0_lang = "";
|
|
3600
|
+
const _sfc_main$l = defineComponent({
|
|
3601
|
+
name: "DaoHeader",
|
|
3602
|
+
props: headerProps,
|
|
3603
|
+
setup(props, { slots }) {
|
|
3604
|
+
const showInfo = computed(() => ({
|
|
3605
|
+
title: props.type === "3rd" ? false : Boolean(props.title || slots.title),
|
|
3606
|
+
breadcrumb: props.type === "2rd" ? false : slots.breadcrumb
|
|
3607
|
+
}));
|
|
3608
|
+
return {
|
|
3609
|
+
ns: "dao-header",
|
|
3610
|
+
showInfo
|
|
3611
|
+
};
|
|
3612
|
+
}
|
|
3613
|
+
});
|
|
3614
|
+
function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3615
|
+
return openBlock(), createElementBlock("div", {
|
|
3616
|
+
ref: "header",
|
|
3617
|
+
"aria-label": "Header",
|
|
3618
|
+
class: normalizeClass(_ctx.ns)
|
|
3619
|
+
}, [
|
|
3620
|
+
createElementVNode("div", {
|
|
3621
|
+
class: normalizeClass(_ctx.ns + "__left-container")
|
|
3622
|
+
}, [
|
|
3623
|
+
_ctx.showInfo.title ? (openBlock(), createElementBlock("div", {
|
|
3624
|
+
key: 0,
|
|
3625
|
+
class: normalizeClass(_ctx.ns + "__title")
|
|
3626
|
+
}, [
|
|
3627
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
3628
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
3629
|
+
])
|
|
3630
|
+
], 2)) : createCommentVNode("", true),
|
|
3631
|
+
_ctx.showInfo.breadcrumb ? (openBlock(), createElementBlock("div", {
|
|
3632
|
+
key: 1,
|
|
3633
|
+
class: normalizeClass(_ctx.ns + "__breadcrumb")
|
|
3634
|
+
}, [
|
|
3635
|
+
renderSlot(_ctx.$slots, "breadcrumb")
|
|
3636
|
+
], 2)) : createCommentVNode("", true)
|
|
3637
|
+
], 2),
|
|
3638
|
+
_ctx.$slots.action ? (openBlock(), createElementBlock("div", {
|
|
3639
|
+
key: 0,
|
|
3640
|
+
class: normalizeClass(_ctx.ns + "__action")
|
|
3641
|
+
}, [
|
|
3642
|
+
renderSlot(_ctx.$slots, "action")
|
|
3643
|
+
], 2)) : createCommentVNode("", true)
|
|
3644
|
+
], 2);
|
|
3645
|
+
}
|
|
3646
|
+
var header = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$j]]);
|
|
3647
|
+
const breadcrumbProps = {
|
|
3648
|
+
type: {
|
|
3649
|
+
type: String,
|
|
3650
|
+
default: "3rd"
|
|
3651
|
+
},
|
|
3652
|
+
list: {
|
|
3653
|
+
type: Array,
|
|
3654
|
+
default: () => []
|
|
3655
|
+
},
|
|
3656
|
+
separator: {
|
|
3657
|
+
type: String,
|
|
3658
|
+
default: "/"
|
|
3659
|
+
},
|
|
3660
|
+
icon: {
|
|
3661
|
+
type: String,
|
|
3662
|
+
default: ""
|
|
3663
|
+
}
|
|
3664
|
+
};
|
|
3665
|
+
const breadcrumbEmits = {
|
|
3666
|
+
navigate: (to) => to
|
|
3667
|
+
};
|
|
3668
|
+
const breadcrumbItemProps = {
|
|
3669
|
+
label: {
|
|
3670
|
+
type: String
|
|
3671
|
+
},
|
|
3672
|
+
value: {
|
|
3673
|
+
type: String
|
|
3674
|
+
},
|
|
3675
|
+
to: {
|
|
3676
|
+
type: [String, Object]
|
|
3677
|
+
}
|
|
3678
|
+
};
|
|
3679
|
+
const _sfc_main$k = defineComponent({
|
|
3680
|
+
name: "DaoBreadcrumbItem",
|
|
3681
|
+
props: breadcrumbItemProps,
|
|
3682
|
+
setup(props) {
|
|
3683
|
+
const parent = inject(breadcrumbKey, null);
|
|
3684
|
+
const separator = computed(() => {
|
|
3685
|
+
var _a;
|
|
3686
|
+
return (_a = parent == null ? void 0 : parent.props) == null ? void 0 : _a.separator;
|
|
3687
|
+
});
|
|
3688
|
+
const handleClick = () => {
|
|
3689
|
+
const to = props == null ? void 0 : props.to;
|
|
3690
|
+
if (to && (parent == null ? void 0 : parent.emit)) {
|
|
3691
|
+
parent.emit("navigate", to);
|
|
3692
|
+
}
|
|
3693
|
+
};
|
|
3694
|
+
return {
|
|
3695
|
+
ns: "dao-breadcrumb",
|
|
3696
|
+
handleClick,
|
|
3697
|
+
separator
|
|
3698
|
+
};
|
|
3699
|
+
}
|
|
3700
|
+
});
|
|
3701
|
+
function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3702
|
+
return openBlock(), createElementBlock("span", {
|
|
3703
|
+
class: normalizeClass(_ctx.ns + "__item")
|
|
3704
|
+
}, [
|
|
3705
|
+
createElementVNode("span", {
|
|
3706
|
+
role: "link",
|
|
3707
|
+
class: normalizeClass({ [_ctx.ns + "__link"]: !!_ctx.to }),
|
|
3708
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
3709
|
+
}, [
|
|
3710
|
+
_ctx.label ? (openBlock(), createElementBlock("span", {
|
|
3711
|
+
key: 0,
|
|
3712
|
+
role: "label",
|
|
3713
|
+
class: normalizeClass(_ctx.ns + "__label")
|
|
3714
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true),
|
|
3715
|
+
_ctx.value ? (openBlock(), createElementBlock("span", {
|
|
3716
|
+
key: 1,
|
|
3717
|
+
class: normalizeClass(_ctx.ns + "__value"),
|
|
3718
|
+
role: "value"
|
|
3719
|
+
}, toDisplayString(_ctx.value), 3)) : createCommentVNode("", true),
|
|
3720
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
3721
|
+
key: 2,
|
|
3722
|
+
role: "slot",
|
|
3723
|
+
class: normalizeClass(_ctx.ns + "__slot")
|
|
3724
|
+
}, [
|
|
3725
|
+
renderSlot(_ctx.$slots, "default")
|
|
3726
|
+
], 2)) : createCommentVNode("", true)
|
|
3727
|
+
], 2),
|
|
3728
|
+
createElementVNode("span", {
|
|
3729
|
+
class: normalizeClass(_ctx.ns + "__separator")
|
|
3730
|
+
}, toDisplayString(_ctx.separator), 3)
|
|
3731
|
+
], 2);
|
|
3732
|
+
}
|
|
3733
|
+
var DaoBreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$i]]);
|
|
3734
|
+
var breadcrumb_vue_vue_type_style_index_0_lang = "";
|
|
3735
|
+
const _sfc_main$j = defineComponent({
|
|
3736
|
+
name: "DaoBreadcrumb",
|
|
3737
|
+
components: {
|
|
3738
|
+
DaoIcon,
|
|
3739
|
+
DaoBreadcrumbItem
|
|
3740
|
+
},
|
|
3741
|
+
props: breadcrumbProps,
|
|
3742
|
+
emits: breadcrumbEmits,
|
|
3743
|
+
setup(props, { emit }) {
|
|
3744
|
+
provide(breadcrumbKey, { props, emit });
|
|
3745
|
+
return {
|
|
3746
|
+
ns: "dao-breadcrumb"
|
|
3747
|
+
};
|
|
3748
|
+
}
|
|
3749
|
+
});
|
|
3750
|
+
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3751
|
+
var _a;
|
|
3752
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
3753
|
+
const _component_dao_breadcrumb_item = resolveComponent("dao-breadcrumb-item");
|
|
3754
|
+
return openBlock(), createElementBlock("div", {
|
|
3755
|
+
ref: "breadcrumb",
|
|
3756
|
+
"aria-label": "Breadcrumb",
|
|
3757
|
+
role: "navigation",
|
|
3758
|
+
class: normalizeClass(_ctx.ns)
|
|
3759
|
+
}, [
|
|
3760
|
+
_ctx.$slots.icon || _ctx.icon ? (openBlock(), createElementBlock("span", {
|
|
3761
|
+
key: 0,
|
|
3762
|
+
class: normalizeClass(_ctx.ns + "__icon")
|
|
3763
|
+
}, [
|
|
3764
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
3765
|
+
createVNode(_component_dao_icon, {
|
|
3766
|
+
"use-font": "",
|
|
3767
|
+
name: _ctx.icon
|
|
3768
|
+
}, null, 8, ["name"])
|
|
3769
|
+
])
|
|
3770
|
+
], 2)) : createCommentVNode("", true),
|
|
3771
|
+
((_a = _ctx.list) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.list, (item, index2) => {
|
|
3772
|
+
return openBlock(), createBlock(_component_dao_breadcrumb_item, {
|
|
3773
|
+
key: index2,
|
|
3774
|
+
label: item.label,
|
|
3775
|
+
value: item.value,
|
|
3776
|
+
to: item.to
|
|
3777
|
+
}, null, 8, ["label", "value", "to"]);
|
|
3778
|
+
}), 128)) : createCommentVNode("", true),
|
|
3779
|
+
renderSlot(_ctx.$slots, "default")
|
|
3780
|
+
], 2);
|
|
3781
|
+
}
|
|
3782
|
+
var breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$h]]);
|
|
2992
3783
|
if (typeof window !== "undefined") {
|
|
2993
3784
|
let loadSvg = function() {
|
|
2994
|
-
|
|
2995
|
-
|
|
3785
|
+
var body = document.body;
|
|
3786
|
+
var svgDom = document.getElementById("__svg__icons__dom__");
|
|
2996
3787
|
if (!svgDom) {
|
|
2997
3788
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2998
3789
|
svgDom.style.position = "absolute";
|
|
2999
3790
|
svgDom.style.width = "0";
|
|
3000
3791
|
svgDom.style.height = "0";
|
|
3001
|
-
svgDom.id = "
|
|
3792
|
+
svgDom.id = "__svg__icons__dom__";
|
|
3793
|
+
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
3794
|
+
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
3002
3795
|
}
|
|
3003
|
-
svgDom.innerHTML = '<symbol
|
|
3004
|
-
body.insertBefore(svgDom, body.
|
|
3796
|
+
svgDom.innerHTML = '<symbol viewBox="0 0 16 16" id="icon_arrow-down"><path d="m2.97 10.03 4.5 4.5a.749.749 0 0 0 1.06 0l4.5-4.5a.75.75 0 0 0-1.06-1.06L9 11.939V2a1 1 0 0 0-2 0v9.939L4.03 8.97a.75.75 0 1 0-1.06 1.06Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_arrow-left"><path d="m5.97 2.97-4.5 4.5a.749.749 0 0 0 0 1.06l4.5 4.5a.75.75 0 0 0 1.06-1.06L4.061 9H14a1 1 0 0 0 0-2H4.061L7.03 4.03a.75.75 0 1 0-1.06-1.06Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_arrow-right"><path d="m10.03 13.03 4.5-4.5a.749.749 0 0 0 0-1.06l-4.5-4.5a.75.75 0 1 0-1.06 1.06L11.939 7H2a1 1 0 0 0 0 2h9.939L8.97 11.97a.75.75 0 0 0 1.06 1.06Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_arrow-up"><path d="m13.03 5.97-4.5-4.5a.749.749 0 0 0-1.06 0l-4.5 4.5a.75.75 0 1 0 1.06 1.06L7 4.061V14a1 1 0 0 0 2 0V4.061l2.97 2.969a.75.75 0 0 0 1.06-1.06Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-down"><path d="M8 10.75a.747.747 0 0 1-.53-.22l-3.5-3.5a.75.75 0 0 1 1.06-1.06L8 8.939l2.97-2.97a.75.75 0 0 1 1.06 1.061l-3.5 3.5a.747.747 0 0 1-.53.22Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-left"><path d="M5.25 8a.747.747 0 0 1 .22-.53l3.5-3.5a.75.75 0 0 1 1.06 1.06L7.061 8l2.97 2.97a.75.75 0 1 1-1.061 1.06l-3.5-3.5A.747.747 0 0 1 5.25 8Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-more"><path d="M13.75 8a.747.747 0 0 1-.22.53l-3.5 3.5a.75.75 0 0 1-1.06-1.06L11.939 8 8.97 5.03a.75.75 0 1 1 1.06-1.06l3.5 3.5a.747.747 0 0 1 .22.53ZM7.75 8a.747.747 0 0 1-.22.53l-3.5 3.5a.75.75 0 0 1-1.06-1.06L5.939 8 2.97 5.03a.75.75 0 0 1 1.06-1.06l3.5 3.5a.747.747 0 0 1 .22.53Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-right"><path d="M10.75 8a.747.747 0 0 1-.22.53l-3.5 3.5a.75.75 0 0 1-1.06-1.06L8.939 8 5.97 5.03a.75.75 0 0 1 1.06-1.06l3.5 3.5a.747.747 0 0 1 .22.53Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-select"><path d="M8 14.75a.747.747 0 0 1-.53-.22l-3.5-3.5a.75.75 0 0 1 1.06-1.06L8 12.939l2.97-2.97a.75.75 0 0 1 1.06 1.061l-3.5 3.5a.747.747 0 0 1-.53.22ZM8 1.25a.747.747 0 0 1 .53.22l3.5 3.5a.75.75 0 0 1-1.06 1.06L8 3.061 5.03 6.03a.75.75 0 0 1-1.06-1.06l3.5-3.5A.747.747 0 0 1 8 1.25Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_caret-up"><path d="M8 5.25a.747.747 0 0 1 .53.22l3.5 3.5a.75.75 0 0 1-1.06 1.06L8 7.061 5.03 10.03a.75.75 0 0 1-1.06-1.06l3.5-3.5A.747.747 0 0 1 8 5.25Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_close"><path d="m9.414 8 4.453-4.453a1 1 0 1 0-1.414-1.414L8 6.586 3.547 2.133a1 1 0 0 0-1.414 1.414L6.586 8l-4.453 4.453a1 1 0 1 0 1.414 1.414L8 9.414l4.453 4.453a1 1 0 0 0 1.414-1.414Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_reload"><path d="M15 7V1l-2.055 2.055a7 7 0 1 0 1.649 7.279 1 1 0 0 0-1.885-.668 5 5 0 1 1-1.177-5.2L9 7Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_search"><path d="m15.03 13.97-3.975-3.975a5.772 5.772 0 1 0-1.06 1.06l3.975 3.975a.75.75 0 0 0 1.06-1.06ZM1.75 6.5a4.75 4.75 0 1 1 4.75 4.75A4.75 4.75 0 0 1 1.75 6.5Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_setting"><path d="M15.6 6.75h-2.335a.614.614 0 0 1-.572-.423 4.764 4.764 0 0 0-.192-.461.615.615 0 0 1 .105-.7l1.652-1.656a.4.4 0 0 0 0-.566l-1.2-1.2a.4.4 0 0 0-.566 0l-1.653 1.65a.616.616 0 0 1-.7.1 4.764 4.764 0 0 0-.461-.192.614.614 0 0 1-.423-.572V.4a.4.4 0 0 0-.4-.4H7.15a.4.4 0 0 0-.4.4v2.335a.614.614 0 0 1-.423.572 4.764 4.764 0 0 0-.461.192.616.616 0 0 1-.7-.1L3.51 1.742a.4.4 0 0 0-.566 0l-1.2 1.2a.4.4 0 0 0 0 .566l1.65 1.653a.615.615 0 0 1 .1.705 4.764 4.764 0 0 0-.192.461.614.614 0 0 1-.572.423H.4a.4.4 0 0 0-.4.4v1.7a.4.4 0 0 0 .4.4h2.335a.614.614 0 0 1 .572.423 4.764 4.764 0 0 0 .192.461.615.615 0 0 1-.1.705L1.742 12.49a.4.4 0 0 0 0 .566l1.2 1.2a.4.4 0 0 0 .566 0l1.651-1.652a.615.615 0 0 1 .705-.105 4.764 4.764 0 0 0 .461.192.614.614 0 0 1 .423.572V15.6a.4.4 0 0 0 .4.4h1.7a.4.4 0 0 0 .4-.4v-2.335a.614.614 0 0 1 .423-.572 4.764 4.764 0 0 0 .461-.192.615.615 0 0 1 .705.105l1.651 1.652a.4.4 0 0 0 .566 0l1.2-1.2a.4.4 0 0 0 0-.566l-1.652-1.651a.615.615 0 0 1-.105-.7 4.764 4.764 0 0 0 .192-.461.614.614 0 0 1 .572-.423H15.6a.4.4 0 0 0 .4-.4V7.15a.4.4 0 0 0-.4-.4ZM8 10a2 2 0 1 1 2-2 2 2 0 0 1-2 2Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_trash"><path d="M6 5h1v8H6zM9 5h1v8H9z" /><path d="M13 2h-2V1a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v1H3a1 1 0 0 0-1 1v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3a1 1 0 0 0-1-1ZM6 1h4v1H6Zm6 13H4V4h8Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_triangle-down"><path d="M4 6h8l-4 5-4-5z" /></symbol><symbol viewBox="0 0 16 16" id="icon_triangle-left"><path d="M10 4v8L5 8l5-4z" /></symbol><symbol viewBox="0 0 16 16" id="icon_triangle-right"><path d="M6 12V4l5 4-5 4z" /></symbol><symbol viewBox="0 0 16 16" id="icon_triangle-up"><path d="M12 10H4l4-5 4 5z" /></symbol><symbol viewBox="0 0 16 16" id="icon_close-circled"><path d="M8 .5A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5Zm3.03 9.47a.75.75 0 1 1-1.06 1.06L8 9.061 6.03 11.03a.75.75 0 0 1-1.06-1.06L6.939 8 4.97 6.03a.75.75 0 0 1 1.06-1.06L8 6.939 9.97 4.97a.75.75 0 0 1 1.06 1.06L9.061 8Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_goto"><path d="M8 .5A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5Zm0 11V9H4V7h4V4.5L12.4 8Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_info-line"><path d="M9 11V7H6v.7h1V11H6v1h4v-1H9z" /><circle cx="8" cy="5" r="1.1" /><path d="M8 1.5A6.5 6.5 0 1 1 1.5 8 6.508 6.508 0 0 1 8 1.5m0-1A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_minus-circled"><path d="M8 .5A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5ZM12 9H4V7h8Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_more"><circle cx="14" cy="8" r="2" /><circle cx="8" cy="8" r="2" /><circle cx="2" cy="8" r="2" /></symbol><symbol viewBox="0 0 16 16" id="icon_plus-circled"><path d="M8 .5A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5ZM12 9H9v3H7V9H4V7h3V4h2v3h3Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_question-line"><path d="M8 1.5A6.5 6.5 0 1 1 1.5 8 6.508 6.508 0 0 1 8 1.5m0-1A7.5 7.5 0 1 0 15.5 8 7.5 7.5 0 0 0 8 .5Z" /><path d="M7 11h2v2H7zM8.75 10v-.5c.005-1.335 2.005-1.47 2-3.615A2.719 2.719 0 0 0 8 3.25 2.752 2.752 0 0 0 5.25 6h1.5a1.251 1.251 0 0 1 2.5-.052 1.614 1.614 0 0 1-.727 1.206A2.881 2.881 0 0 0 7.25 9.5v.5Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file-binary"><path d="M14 15H2V1h9V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4h-1Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0ZM4 6v5h3V6Zm2 4H5V7h1ZM11 10V6H9v1h1v3H9v1h3v-1h-1z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file-code"><path d="M14 15H2V1h9V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4h-1Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0ZM6.5 11a.5.5 0 0 1-.354-.146l-2-2a.5.5 0 0 1 0-.708l2-2a.5.5 0 0 1 .708.708L5.207 8.5l1.647 1.646A.5.5 0 0 1 6.5 11ZM9.5 11a.5.5 0 0 1-.354-.854L10.793 8.5 9.146 6.854a.5.5 0 0 1 .708-.708l2 2a.5.5 0 0 1 0 .708l-2 2A.5.5 0 0 1 9.5 11Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file-picture"><circle cx="10" cy="7" r="1" /><path d="M13 14v-2.25l-2-2-1.5 1.5-3-3-3.5 3.5V14h10z" /><path d="M14 15H2V1h9V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4h-1Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file-text"><path d="M5 6h6v1H5zM5 8h6v1H5zM5 10h6v1H5z" /><path d="M14 15H2V1h9V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4h-1Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file-zip"><path d="M7 2h1v1H7zM6 3h1v1H6zM7 4h1v1H7zM6 5h1v1H6zM7 6h1v1H7zM8.692 8.692 8 8H7V7H6v1l-.692.692A1.051 1.051 0 0 0 5 9.435V10.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5V9.435a1.051 1.051 0 0 0-.308-.743ZM8 10H6V9h2Z" /><path d="M14 4v11H2V1h4v1h1V1h4V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0Z" /></symbol><symbol viewBox="0 0 16 16" id="icon_file"><path d="M14 15H2V1h9V0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4h-1Z" /><path d="M15 3h-2a1 1 0 0 1-1-1V0Z" /></symbol><symbol viewBox="0 0 14 14" id="icon_checkmark-symbol"><path d="m2.466 7.29 1.016-1.152 2.515 2.527 5.359-5.634.83.729-6.182 7.734L2.466 7.29z" /></symbol>';
|
|
3797
|
+
body.insertBefore(svgDom, body.lastChild);
|
|
3005
3798
|
};
|
|
3006
3799
|
if (document.readyState === "loading") {
|
|
3007
3800
|
document.addEventListener("DOMContentLoaded", loadSvg);
|
|
@@ -3009,55 +3802,59 @@ if (typeof window !== "undefined") {
|
|
|
3009
3802
|
loadSvg();
|
|
3010
3803
|
}
|
|
3011
3804
|
}
|
|
3805
|
+
const INPUT_STATUS = ["default", "error", "success", "loading"];
|
|
3806
|
+
const INPUT_TYPES = ["text", "search", "number", "password"];
|
|
3807
|
+
var inputProps = {
|
|
3808
|
+
modelValue: {
|
|
3809
|
+
type: [String, Number],
|
|
3810
|
+
default: ""
|
|
3811
|
+
},
|
|
3812
|
+
type: {
|
|
3813
|
+
type: String,
|
|
3814
|
+
default: "text",
|
|
3815
|
+
validator: (value) => INPUT_TYPES.includes(value)
|
|
3816
|
+
},
|
|
3817
|
+
disabled: {
|
|
3818
|
+
type: Boolean,
|
|
3819
|
+
default: false
|
|
3820
|
+
},
|
|
3821
|
+
size: {
|
|
3822
|
+
type: String,
|
|
3823
|
+
default: "md",
|
|
3824
|
+
validator: (value) => ["md", "sm"].includes(value)
|
|
3825
|
+
},
|
|
3826
|
+
block: {
|
|
3827
|
+
type: Boolean,
|
|
3828
|
+
default: false
|
|
3829
|
+
},
|
|
3830
|
+
status: {
|
|
3831
|
+
type: String,
|
|
3832
|
+
default: "default",
|
|
3833
|
+
validator: (value) => INPUT_STATUS.includes(value)
|
|
3834
|
+
},
|
|
3835
|
+
borderless: {
|
|
3836
|
+
type: Boolean,
|
|
3837
|
+
default: false
|
|
3838
|
+
},
|
|
3839
|
+
append: {
|
|
3840
|
+
type: String,
|
|
3841
|
+
default: ""
|
|
3842
|
+
},
|
|
3843
|
+
prepend: {
|
|
3844
|
+
type: String,
|
|
3845
|
+
default: ""
|
|
3846
|
+
}
|
|
3847
|
+
};
|
|
3012
3848
|
var input_vue_vue_type_style_index_0_lang = "";
|
|
3013
|
-
const _sfc_main$
|
|
3849
|
+
const _sfc_main$i = defineComponent({
|
|
3014
3850
|
name: "DaoInput",
|
|
3015
3851
|
inheritAttrs: false,
|
|
3016
|
-
props:
|
|
3017
|
-
modelValue: {
|
|
3018
|
-
type: [String, Number],
|
|
3019
|
-
default: ""
|
|
3020
|
-
},
|
|
3021
|
-
type: {
|
|
3022
|
-
type: String,
|
|
3023
|
-
default: "text",
|
|
3024
|
-
validator: (value) => ["text", "search", "number", "password"].includes(value)
|
|
3025
|
-
},
|
|
3026
|
-
disabled: {
|
|
3027
|
-
type: Boolean,
|
|
3028
|
-
default: false
|
|
3029
|
-
},
|
|
3030
|
-
size: {
|
|
3031
|
-
type: String,
|
|
3032
|
-
default: "md",
|
|
3033
|
-
validator: (value) => ["md", "sm"].includes(value)
|
|
3034
|
-
},
|
|
3035
|
-
block: {
|
|
3036
|
-
type: Boolean,
|
|
3037
|
-
default: false
|
|
3038
|
-
},
|
|
3039
|
-
status: {
|
|
3040
|
-
type: String,
|
|
3041
|
-
default: "default",
|
|
3042
|
-
validator: (value) => ["default", "error", "success", "loading"].includes(value)
|
|
3043
|
-
},
|
|
3044
|
-
borderless: {
|
|
3045
|
-
type: Boolean,
|
|
3046
|
-
default: false
|
|
3047
|
-
},
|
|
3048
|
-
append: {
|
|
3049
|
-
type: String,
|
|
3050
|
-
default: ""
|
|
3051
|
-
},
|
|
3052
|
-
prepend: {
|
|
3053
|
-
type: String,
|
|
3054
|
-
default: ""
|
|
3055
|
-
}
|
|
3056
|
-
},
|
|
3852
|
+
props: inputProps,
|
|
3057
3853
|
emits: ["update:modelValue", "input", "change", "blur", "focus", "after-reset"],
|
|
3058
3854
|
setup(props, { emit, attrs, slots }) {
|
|
3059
3855
|
const prefixCls = "dao-input";
|
|
3060
3856
|
const statusMap = {
|
|
3857
|
+
default: "",
|
|
3061
3858
|
error: "dao-input-error-icon icon-sys-warning",
|
|
3062
3859
|
success: "dao-input-success-icon icon-sys-success",
|
|
3063
3860
|
loading: "dao-input-loading-icon icon-input-loading"
|
|
@@ -3075,6 +3872,11 @@ const _sfc_main$d = defineComponent({
|
|
|
3075
3872
|
const currentValue = ref(modelValue.value);
|
|
3076
3873
|
const isFocus = ref(false);
|
|
3077
3874
|
const input2 = ref(null);
|
|
3875
|
+
const isIncreaseDisabled = ref(false);
|
|
3876
|
+
const isDecreaseDisabled = ref(false);
|
|
3877
|
+
const isChangingNumber = ref(false);
|
|
3878
|
+
let counterInterval = null;
|
|
3879
|
+
let counterTimeout = null;
|
|
3078
3880
|
const clearable = computed(() => type.value === "search" && currentValue.value && !disabled.value);
|
|
3079
3881
|
const wrapClasses = computed(() => [
|
|
3080
3882
|
`${prefixCls}-wrapper`,
|
|
@@ -3096,10 +3898,18 @@ const _sfc_main$d = defineComponent({
|
|
|
3096
3898
|
[`${prefixCls}--with-append`]: !!append.value
|
|
3097
3899
|
}
|
|
3098
3900
|
]);
|
|
3901
|
+
const statusClasses = computed(() => statusMap[status.value]);
|
|
3099
3902
|
const setCurrentValue = (val) => {
|
|
3100
3903
|
if (val === currentValue.value) {
|
|
3101
3904
|
return;
|
|
3102
3905
|
}
|
|
3906
|
+
if (type.value === "number") {
|
|
3907
|
+
const inputVal = parseFloat(val);
|
|
3908
|
+
const maxVal = parseFloat(attrs.max);
|
|
3909
|
+
const minVal = parseFloat(attrs.min);
|
|
3910
|
+
isIncreaseDisabled.value = inputVal >= maxVal;
|
|
3911
|
+
isDecreaseDisabled.value = inputVal <= minVal;
|
|
3912
|
+
}
|
|
3103
3913
|
currentValue.value = val;
|
|
3104
3914
|
};
|
|
3105
3915
|
const updateModel = (val) => {
|
|
@@ -3116,6 +3926,63 @@ const _sfc_main$d = defineComponent({
|
|
|
3116
3926
|
emit("after-reset");
|
|
3117
3927
|
(_a = input2.value) == null ? void 0 : _a.focus();
|
|
3118
3928
|
};
|
|
3929
|
+
const getInputRealNumber = (val, fixedPointNum) => parseFloat(val.toFixed(fixedPointNum));
|
|
3930
|
+
const changeNumberValue = (changeType) => {
|
|
3931
|
+
var _a;
|
|
3932
|
+
if (type.value !== "number") {
|
|
3933
|
+
return;
|
|
3934
|
+
}
|
|
3935
|
+
const minimum = parseFloat(attrs.min);
|
|
3936
|
+
const maximum = parseFloat(attrs.max);
|
|
3937
|
+
const isMaximum = currentValue.value || currentValue.value === 0 ? maximum <= (currentValue == null ? void 0 : currentValue.value) : false;
|
|
3938
|
+
const isMinimum = currentValue.value || currentValue.value === 0 ? minimum >= (currentValue == null ? void 0 : currentValue.value) : false;
|
|
3939
|
+
if (changeType === "increase" && isMaximum || changeType === "decrease" && isMinimum) {
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
isChangingNumber.value = true;
|
|
3943
|
+
const stepValue = parseFloat(attrs.step) || 1;
|
|
3944
|
+
let stepPointNum = 0;
|
|
3945
|
+
if (stepValue.toString().split(".").length > 1) {
|
|
3946
|
+
stepPointNum = stepValue.toString().split(".")[1].length;
|
|
3947
|
+
}
|
|
3948
|
+
const inputVal = parseFloat(currentValue.value) || 0;
|
|
3949
|
+
const inputStepPointValue = getInputRealNumber(inputVal, stepPointNum);
|
|
3950
|
+
let setValue = inputVal;
|
|
3951
|
+
const changeStepValue = changeType === "increase" ? stepValue : -stepValue;
|
|
3952
|
+
setValue = (inputStepPointValue - inputVal) * changeStepValue > 0 ? inputStepPointValue : inputStepPointValue + changeStepValue;
|
|
3953
|
+
if (setValue >= maximum) {
|
|
3954
|
+
setValue = maximum;
|
|
3955
|
+
}
|
|
3956
|
+
if (setValue <= minimum) {
|
|
3957
|
+
setValue = minimum;
|
|
3958
|
+
}
|
|
3959
|
+
updateModel(getInputRealNumber(setValue, stepPointNum));
|
|
3960
|
+
(_a = input2.value) == null ? void 0 : _a.focus();
|
|
3961
|
+
if (!counterTimeout && !counterInterval) {
|
|
3962
|
+
counterTimeout = window.setTimeout(() => {
|
|
3963
|
+
counterInterval = window.setInterval(() => changeNumberValue(changeType), 100);
|
|
3964
|
+
}, 300);
|
|
3965
|
+
}
|
|
3966
|
+
};
|
|
3967
|
+
const onInputNumberMouseup = (event) => {
|
|
3968
|
+
var _a;
|
|
3969
|
+
if (isChangingNumber.value) {
|
|
3970
|
+
event.preventDefault();
|
|
3971
|
+
}
|
|
3972
|
+
const onEvents = !!counterTimeout || !!counterInterval;
|
|
3973
|
+
if (counterTimeout) {
|
|
3974
|
+
window.clearTimeout(counterTimeout);
|
|
3975
|
+
}
|
|
3976
|
+
if (counterInterval) {
|
|
3977
|
+
window.clearInterval(counterInterval);
|
|
3978
|
+
}
|
|
3979
|
+
counterTimeout = null;
|
|
3980
|
+
counterInterval = null;
|
|
3981
|
+
isChangingNumber.value = false;
|
|
3982
|
+
if (onEvents) {
|
|
3983
|
+
(_a = input2.value) == null ? void 0 : _a.focus();
|
|
3984
|
+
}
|
|
3985
|
+
};
|
|
3119
3986
|
const inputAttrs = computed(() => {
|
|
3120
3987
|
const events = {
|
|
3121
3988
|
onInput(event) {
|
|
@@ -3141,6 +4008,12 @@ const _sfc_main$d = defineComponent({
|
|
|
3141
4008
|
return __spreadValues(__spreadValues({}, attrs), events);
|
|
3142
4009
|
});
|
|
3143
4010
|
watch(modelValue, (newV) => setCurrentValue(newV));
|
|
4011
|
+
onMounted(() => {
|
|
4012
|
+
window.addEventListener("mouseup", onInputNumberMouseup);
|
|
4013
|
+
});
|
|
4014
|
+
onBeforeUnmount(() => {
|
|
4015
|
+
window.removeEventListener("mouseup", onInputNumberMouseup);
|
|
4016
|
+
});
|
|
3144
4017
|
return {
|
|
3145
4018
|
currentValue,
|
|
3146
4019
|
isFocus,
|
|
@@ -3151,41 +4024,47 @@ const _sfc_main$d = defineComponent({
|
|
|
3151
4024
|
inputAttrs,
|
|
3152
4025
|
slots,
|
|
3153
4026
|
resetCurrentVal,
|
|
3154
|
-
|
|
4027
|
+
statusClasses,
|
|
4028
|
+
changeNumberValue,
|
|
4029
|
+
isIncreaseDisabled,
|
|
4030
|
+
isDecreaseDisabled,
|
|
4031
|
+
isChangingNumber
|
|
3155
4032
|
};
|
|
3156
4033
|
}
|
|
3157
4034
|
});
|
|
3158
|
-
const _hoisted_1$
|
|
4035
|
+
const _hoisted_1$f = {
|
|
3159
4036
|
key: 0,
|
|
3160
4037
|
class: "dao-input-prepend"
|
|
3161
4038
|
};
|
|
3162
|
-
const _hoisted_2$
|
|
3163
|
-
const _hoisted_3$5 = {
|
|
4039
|
+
const _hoisted_2$c = {
|
|
3164
4040
|
key: 0,
|
|
3165
4041
|
class: "dao-input-prefix"
|
|
3166
4042
|
};
|
|
3167
|
-
const
|
|
3168
|
-
const
|
|
3169
|
-
key:
|
|
4043
|
+
const _hoisted_3$7 = ["type", "disabled", "value"];
|
|
4044
|
+
const _hoisted_4$6 = {
|
|
4045
|
+
key: 3,
|
|
3170
4046
|
class: "dao-input-suffix"
|
|
3171
4047
|
};
|
|
3172
|
-
const
|
|
3173
|
-
key:
|
|
4048
|
+
const _hoisted_5$4 = {
|
|
4049
|
+
key: 0,
|
|
3174
4050
|
class: "dao-input-append"
|
|
3175
4051
|
};
|
|
3176
|
-
function _sfc_render$
|
|
4052
|
+
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3177
4053
|
return openBlock(), createElementBlock("div", {
|
|
3178
4054
|
class: normalizeClass(_ctx.wrapClasses)
|
|
3179
4055
|
}, [
|
|
3180
|
-
renderSlot(_ctx.$slots, "prepend")
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
4056
|
+
renderSlot(_ctx.$slots, "prepend", {}, () => [
|
|
4057
|
+
_ctx.prepend ? (openBlock(), createElementBlock("div", _hoisted_1$f, toDisplayString(_ctx.prepend), 1)) : createCommentVNode("", true)
|
|
4058
|
+
]),
|
|
4059
|
+
createElementVNode("div", {
|
|
4060
|
+
class: normalizeClass(["dao-input-inner", { "dao-input__changing-number": _ctx.isChangingNumber }])
|
|
4061
|
+
}, [
|
|
4062
|
+
_ctx.slots.prefix ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
|
|
3184
4063
|
renderSlot(_ctx.$slots, "prefix")
|
|
3185
4064
|
])) : createCommentVNode("", true),
|
|
3186
4065
|
_ctx.type === "search" ? (openBlock(), createElementBlock("i", {
|
|
3187
4066
|
key: 1,
|
|
3188
|
-
class: normalizeClass(["dao-input-search-icon", "icon-search", {
|
|
4067
|
+
class: normalizeClass(["dao-input-search-icon", "icon-search", { "dao-input__active": _ctx.isFocus }])
|
|
3189
4068
|
}, null, 2)) : createCommentVNode("", true),
|
|
3190
4069
|
createElementVNode("input", mergeProps({
|
|
3191
4070
|
ref: "input",
|
|
@@ -3195,387 +4074,831 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3195
4074
|
disabled: _ctx.disabled,
|
|
3196
4075
|
value: _ctx.currentValue,
|
|
3197
4076
|
onKeyup: _cache[0] || (_cache[0] = withKeys((...args) => _ctx.resetCurrentVal && _ctx.resetCurrentVal(...args), ["esc"]))
|
|
3198
|
-
}), null, 16,
|
|
4077
|
+
}), null, 16, _hoisted_3$7),
|
|
4078
|
+
_ctx.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4079
|
+
createElementVNode("i", {
|
|
4080
|
+
class: normalizeClass([
|
|
4081
|
+
"dao-input-number-icon",
|
|
4082
|
+
"icon-arrow-sharp",
|
|
4083
|
+
"number-icon-up",
|
|
4084
|
+
{ "dao-input-number-icon__disabled": _ctx.isIncreaseDisabled }
|
|
4085
|
+
]),
|
|
4086
|
+
onMousedown: _cache[1] || (_cache[1] = ($event) => _ctx.changeNumberValue("increase"))
|
|
4087
|
+
}, null, 34),
|
|
4088
|
+
createElementVNode("i", {
|
|
4089
|
+
class: normalizeClass([
|
|
4090
|
+
"dao-input-number-icon",
|
|
4091
|
+
"icon-arrow-sharp",
|
|
4092
|
+
"number-icon-down",
|
|
4093
|
+
{ "dao-input-number-icon__disabled": _ctx.isDecreaseDisabled }
|
|
4094
|
+
]),
|
|
4095
|
+
onMousedown: _cache[2] || (_cache[2] = ($event) => _ctx.changeNumberValue("decrease"))
|
|
4096
|
+
}, null, 34)
|
|
4097
|
+
], 64)) : createCommentVNode("", true),
|
|
3199
4098
|
withDirectives(createElementVNode("i", {
|
|
3200
|
-
class: normalizeClass(["dao-input-close-icon", "icon-
|
|
3201
|
-
onClick: _cache[
|
|
4099
|
+
class: normalizeClass(["dao-input-close-icon", "icon-sys-error", { "dao-input__active": _ctx.isFocus }]),
|
|
4100
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.resetCurrentVal())
|
|
3202
4101
|
}, null, 2), [
|
|
3203
4102
|
[vShow, _ctx.clearable]
|
|
3204
4103
|
]),
|
|
3205
4104
|
withDirectives(createElementVNode("i", {
|
|
3206
|
-
class: normalizeClass(_ctx.
|
|
4105
|
+
class: normalizeClass(_ctx.statusClasses)
|
|
3207
4106
|
}, null, 2), [
|
|
3208
4107
|
[vShow, ["error", "success", "loading"].includes(_ctx.status)]
|
|
3209
4108
|
]),
|
|
3210
|
-
_ctx.slots.suffix ? (openBlock(), createElementBlock("div",
|
|
4109
|
+
_ctx.slots.suffix ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
|
|
3211
4110
|
renderSlot(_ctx.$slots, "suffix")
|
|
3212
4111
|
])) : createCommentVNode("", true)
|
|
3213
|
-
]),
|
|
3214
|
-
renderSlot(_ctx.$slots, "append")
|
|
3215
|
-
|
|
4112
|
+
], 2),
|
|
4113
|
+
renderSlot(_ctx.$slots, "append", {}, () => [
|
|
4114
|
+
_ctx.append ? (openBlock(), createElementBlock("div", _hoisted_5$4, toDisplayString(_ctx.append), 1)) : createCommentVNode("", true)
|
|
4115
|
+
])
|
|
3216
4116
|
], 2);
|
|
3217
4117
|
}
|
|
3218
|
-
var input = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3219
|
-
var
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
daoPopperTheme: "dao-popover"
|
|
3224
|
-
}));
|
|
3225
|
-
var progress_vue_vue_type_style_index_0_lang = "";
|
|
3226
|
-
const _sfc_main$b = defineComponent({
|
|
3227
|
-
name: "DaoProgress",
|
|
3228
|
-
props: {
|
|
3229
|
-
value: {
|
|
3230
|
-
type: Number,
|
|
3231
|
-
default: 0,
|
|
3232
|
-
validator: (val) => val >= 0 && val <= 100
|
|
3233
|
-
},
|
|
3234
|
-
bgColor: {
|
|
3235
|
-
type: String,
|
|
3236
|
-
default: "#ebeef5"
|
|
3237
|
-
},
|
|
3238
|
-
fill: {
|
|
3239
|
-
type: [Array, String],
|
|
3240
|
-
default: "#409eff"
|
|
3241
|
-
}
|
|
4118
|
+
var input = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$g]]);
|
|
4119
|
+
var MessageProps = {
|
|
4120
|
+
modelValue: {
|
|
4121
|
+
type: Boolean,
|
|
4122
|
+
default: void 0
|
|
3242
4123
|
},
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
width: `${fillColor.percent}%`,
|
|
3259
|
-
background: fillColor.color
|
|
3260
|
-
};
|
|
3261
|
-
}
|
|
3262
|
-
return {};
|
|
3263
|
-
});
|
|
3264
|
-
}
|
|
3265
|
-
return [];
|
|
3266
|
-
});
|
|
3267
|
-
const stackedBgColor = computed(() => typeof fill.value === "string" ? fill.value : "");
|
|
3268
|
-
return {
|
|
3269
|
-
type,
|
|
3270
|
-
stackedStyles,
|
|
3271
|
-
stackedBgColor
|
|
3272
|
-
};
|
|
4124
|
+
type: {
|
|
4125
|
+
type: String,
|
|
4126
|
+
default: "info"
|
|
4127
|
+
},
|
|
4128
|
+
title: {
|
|
4129
|
+
type: String,
|
|
4130
|
+
default: ""
|
|
4131
|
+
},
|
|
4132
|
+
content: {
|
|
4133
|
+
type: String,
|
|
4134
|
+
default: ""
|
|
4135
|
+
},
|
|
4136
|
+
isCloseShow: {
|
|
4137
|
+
type: Boolean,
|
|
4138
|
+
default: true
|
|
3273
4139
|
}
|
|
3274
|
-
});
|
|
3275
|
-
const _hoisted_1$9 = { class: "dao-progress" };
|
|
3276
|
-
const _hoisted_2$7 = {
|
|
3277
|
-
key: 1,
|
|
3278
|
-
class: "dao-progress__stacked"
|
|
3279
|
-
};
|
|
3280
|
-
const _hoisted_3$4 = {
|
|
3281
|
-
key: 0,
|
|
3282
|
-
class: "dao-progress__text"
|
|
3283
4140
|
};
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
}, [
|
|
3290
|
-
_ctx.type === "line" ? (openBlock(), createElementBlock("div", {
|
|
3291
|
-
key: 0,
|
|
3292
|
-
class: "dao-progress__bar",
|
|
3293
|
-
style: normalizeStyle({ width: `${_ctx.value}%`, background: _ctx.stackedBgColor })
|
|
3294
|
-
}, null, 4)) : (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
3295
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stackedStyles, (stackedStyle, idx) => {
|
|
3296
|
-
return openBlock(), createElementBlock("div", {
|
|
3297
|
-
key: idx,
|
|
3298
|
-
class: "dao-progress__stacked-item",
|
|
3299
|
-
style: normalizeStyle(stackedStyle)
|
|
3300
|
-
}, null, 4);
|
|
3301
|
-
}), 128))
|
|
3302
|
-
]))
|
|
3303
|
-
], 4),
|
|
3304
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$4, [
|
|
3305
|
-
renderSlot(_ctx.$slots, "default")
|
|
3306
|
-
])) : createCommentVNode("", true)
|
|
3307
|
-
]);
|
|
3308
|
-
}
|
|
3309
|
-
var progress = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$a]]);
|
|
3310
|
-
var radio_vue_vue_type_style_index_0_lang = "";
|
|
3311
|
-
const _sfc_main$a = defineComponent({
|
|
3312
|
-
name: "DaoRadio",
|
|
3313
|
-
props: {
|
|
3314
|
-
modelValue: {
|
|
3315
|
-
type: [String, Number, Boolean],
|
|
3316
|
-
default: false
|
|
3317
|
-
},
|
|
3318
|
-
value: {
|
|
3319
|
-
type: [String, Number, Boolean],
|
|
3320
|
-
required: true,
|
|
3321
|
-
default: ""
|
|
3322
|
-
},
|
|
3323
|
-
label: {
|
|
3324
|
-
type: String,
|
|
3325
|
-
default: ""
|
|
3326
|
-
},
|
|
3327
|
-
disabled: {
|
|
3328
|
-
type: Boolean,
|
|
3329
|
-
default: false
|
|
3330
|
-
},
|
|
3331
|
-
name: {
|
|
3332
|
-
type: String,
|
|
3333
|
-
default: ""
|
|
3334
|
-
}
|
|
3335
|
-
},
|
|
3336
|
-
emits: ["update:modelValue", "change"],
|
|
4141
|
+
var message_vue_vue_type_style_index_0_lang = "";
|
|
4142
|
+
const _sfc_main$h = defineComponent({
|
|
4143
|
+
name: "DaoMessage",
|
|
4144
|
+
props: MessageProps,
|
|
4145
|
+
emits: ["update:modelValue", "change", "beforeClose", "closed", "beforeShow", "show"],
|
|
3337
4146
|
setup(props, { emit }) {
|
|
3338
|
-
const
|
|
3339
|
-
const
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
const wrapClasses = computed(() => [
|
|
3344
|
-
"dao-radio-wrapper",
|
|
3345
|
-
{
|
|
3346
|
-
"dao-radio-wrapper--disabled": disabled.value
|
|
3347
|
-
}
|
|
3348
|
-
]);
|
|
3349
|
-
const radioClasses = computed(() => [
|
|
3350
|
-
"dao-radio",
|
|
3351
|
-
{
|
|
3352
|
-
"dao-radio--checked": currentValue.value,
|
|
3353
|
-
"dao-radio--disabled": disabled.value
|
|
4147
|
+
const typeClass = computed(() => `dao-message--${props.type}`);
|
|
4148
|
+
const _isMessageShow = ref(true);
|
|
4149
|
+
const isMessageShow = computed(() => {
|
|
4150
|
+
if (props.modelValue !== void 0) {
|
|
4151
|
+
return props.modelValue;
|
|
3354
4152
|
}
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
4153
|
+
return unref(_isMessageShow);
|
|
4154
|
+
});
|
|
4155
|
+
function closeMessage() {
|
|
4156
|
+
if (!props.isCloseShow) {
|
|
3358
4157
|
return;
|
|
3359
4158
|
}
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
if (isGroup.value) {
|
|
3363
|
-
radioGroup2 == null ? void 0 : radioGroup2.changeEvent(value.value);
|
|
4159
|
+
if (props.modelValue !== void 0) {
|
|
4160
|
+
emit("update:modelValue", false);
|
|
3364
4161
|
} else {
|
|
3365
|
-
|
|
3366
|
-
emit("change", value.value);
|
|
4162
|
+
_isMessageShow.value = false;
|
|
3367
4163
|
}
|
|
3368
|
-
}
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
4164
|
+
}
|
|
4165
|
+
let isMessageMounted = false;
|
|
4166
|
+
watch(isMessageShow, async (val) => {
|
|
4167
|
+
if (!val && isMessageMounted) {
|
|
4168
|
+
emit("beforeClose");
|
|
4169
|
+
await nextTick();
|
|
4170
|
+
emit("closed");
|
|
4171
|
+
} else if (val) {
|
|
4172
|
+
emit("beforeShow");
|
|
4173
|
+
await nextTick();
|
|
4174
|
+
emit("show");
|
|
4175
|
+
}
|
|
4176
|
+
}, {
|
|
4177
|
+
immediate: true
|
|
4178
|
+
});
|
|
4179
|
+
onMounted(() => {
|
|
4180
|
+
isMessageMounted = true;
|
|
4181
|
+
});
|
|
3373
4182
|
return {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
change
|
|
4183
|
+
typeClass,
|
|
4184
|
+
closeMessage,
|
|
4185
|
+
isMessageShow
|
|
3378
4186
|
};
|
|
3379
4187
|
}
|
|
3380
4188
|
});
|
|
3381
|
-
const _hoisted_1$
|
|
3382
|
-
const _hoisted_2$
|
|
3383
|
-
const _hoisted_3$
|
|
4189
|
+
const _hoisted_1$e = { class: "dao-message-icon" };
|
|
4190
|
+
const _hoisted_2$b = { class: "dao-message-section" };
|
|
4191
|
+
const _hoisted_3$6 = {
|
|
3384
4192
|
key: 0,
|
|
3385
|
-
class: "dao-
|
|
4193
|
+
class: "dao-message-title"
|
|
3386
4194
|
};
|
|
3387
|
-
const _hoisted_4$
|
|
4195
|
+
const _hoisted_4$5 = {
|
|
3388
4196
|
key: 0,
|
|
3389
|
-
class: "dao-
|
|
3390
|
-
};
|
|
3391
|
-
const _hoisted_5$2 = {
|
|
3392
|
-
key: 1,
|
|
3393
|
-
class: "dao-radio__help"
|
|
4197
|
+
class: "dao-message-content"
|
|
3394
4198
|
};
|
|
3395
|
-
function _sfc_render$
|
|
3396
|
-
return openBlock(), createElementBlock("
|
|
3397
|
-
|
|
4199
|
+
function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4200
|
+
return _ctx.isMessageShow ? (openBlock(), createElementBlock("div", {
|
|
4201
|
+
key: 0,
|
|
4202
|
+
class: normalizeClass(["dao-message-outer", _ctx.typeClass]),
|
|
4203
|
+
tabindex: "1",
|
|
4204
|
+
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => _ctx.closeMessage && _ctx.closeMessage(...args), ["self"]), ["esc"]))
|
|
3398
4205
|
}, [
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
default: true
|
|
3436
|
-
}
|
|
4206
|
+
renderSlot(_ctx.$slots, "main", {}, () => [
|
|
4207
|
+
createElementVNode("div", {
|
|
4208
|
+
class: normalizeClass(["dao-message-inner", { "dao-message-inner-without-close": !_ctx.isCloseShow }])
|
|
4209
|
+
}, [
|
|
4210
|
+
createElementVNode("div", _hoisted_1$e, [
|
|
4211
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
4212
|
+
createElementVNode("i", {
|
|
4213
|
+
class: normalizeClass(`icon-sys-${_ctx.type} dao-message-icon-general dao-message-icon-${_ctx.type}`)
|
|
4214
|
+
}, null, 2)
|
|
4215
|
+
])
|
|
4216
|
+
]),
|
|
4217
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
4218
|
+
renderSlot(_ctx.$slots, "section", {}, () => [
|
|
4219
|
+
renderSlot(_ctx.$slots, "title", { className: "dao-message-title" }, () => [
|
|
4220
|
+
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_3$6, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true)
|
|
4221
|
+
]),
|
|
4222
|
+
renderSlot(_ctx.$slots, "default", { className: "dao-message-content" }, () => [
|
|
4223
|
+
_ctx.content ? (openBlock(), createElementBlock("div", _hoisted_4$5, toDisplayString(_ctx.content), 1)) : createCommentVNode("", true)
|
|
4224
|
+
])
|
|
4225
|
+
])
|
|
4226
|
+
]),
|
|
4227
|
+
_ctx.isCloseShow ? (openBlock(), createElementBlock("i", {
|
|
4228
|
+
key: 0,
|
|
4229
|
+
class: "icon-close dao-message-close",
|
|
4230
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.closeMessage && _ctx.closeMessage(...args))
|
|
4231
|
+
})) : createCommentVNode("", true)
|
|
4232
|
+
], 2)
|
|
4233
|
+
])
|
|
4234
|
+
], 34)) : createCommentVNode("", true);
|
|
4235
|
+
}
|
|
4236
|
+
var message = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$f]]);
|
|
4237
|
+
const NAV_TYPES = ["2rd", "3rd"];
|
|
4238
|
+
const navProps = {
|
|
4239
|
+
accordion: {
|
|
4240
|
+
type: Boolean,
|
|
4241
|
+
default: false
|
|
3437
4242
|
},
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
4243
|
+
activeOpened: {
|
|
4244
|
+
type: Array,
|
|
4245
|
+
default: () => []
|
|
4246
|
+
},
|
|
4247
|
+
type: {
|
|
4248
|
+
type: String,
|
|
4249
|
+
default: "2rd",
|
|
4250
|
+
validator: (value) => NAV_TYPES.includes(value)
|
|
4251
|
+
}
|
|
4252
|
+
};
|
|
4253
|
+
const navHeadProps = {
|
|
4254
|
+
icon: {
|
|
4255
|
+
type: String,
|
|
4256
|
+
default: ""
|
|
4257
|
+
},
|
|
4258
|
+
title: {
|
|
4259
|
+
type: String,
|
|
4260
|
+
default: ""
|
|
4261
|
+
},
|
|
4262
|
+
useFont: {
|
|
4263
|
+
type: Boolean,
|
|
4264
|
+
default: false
|
|
4265
|
+
}
|
|
4266
|
+
};
|
|
4267
|
+
const navSubProps = {
|
|
4268
|
+
disabled: {
|
|
4269
|
+
type: Boolean,
|
|
4270
|
+
default: false
|
|
4271
|
+
},
|
|
4272
|
+
fold: {
|
|
4273
|
+
type: Boolean,
|
|
4274
|
+
default: true
|
|
4275
|
+
},
|
|
4276
|
+
isActive: {
|
|
4277
|
+
type: Boolean,
|
|
4278
|
+
default: false
|
|
4279
|
+
},
|
|
4280
|
+
isExactActive: {
|
|
4281
|
+
type: Boolean,
|
|
4282
|
+
default: false
|
|
4283
|
+
},
|
|
4284
|
+
icon: {
|
|
4285
|
+
type: String,
|
|
4286
|
+
default: ""
|
|
4287
|
+
},
|
|
4288
|
+
index: {
|
|
4289
|
+
type: [String, Number],
|
|
4290
|
+
default: ""
|
|
4291
|
+
},
|
|
4292
|
+
title: {
|
|
4293
|
+
type: String,
|
|
4294
|
+
default: ""
|
|
4295
|
+
},
|
|
4296
|
+
useFont: {
|
|
4297
|
+
type: Boolean,
|
|
4298
|
+
default: false
|
|
4299
|
+
}
|
|
4300
|
+
};
|
|
4301
|
+
const navItemProps = {
|
|
4302
|
+
disabled: {
|
|
4303
|
+
type: Boolean,
|
|
4304
|
+
default: false
|
|
4305
|
+
},
|
|
4306
|
+
isActive: {
|
|
4307
|
+
type: Boolean,
|
|
4308
|
+
default: false
|
|
4309
|
+
},
|
|
4310
|
+
isExactActive: {
|
|
4311
|
+
type: Boolean,
|
|
4312
|
+
default: false
|
|
4313
|
+
},
|
|
4314
|
+
icon: {
|
|
4315
|
+
type: String,
|
|
4316
|
+
default: ""
|
|
4317
|
+
},
|
|
4318
|
+
index: {
|
|
4319
|
+
type: [String, Number],
|
|
4320
|
+
default: ""
|
|
4321
|
+
},
|
|
4322
|
+
title: {
|
|
4323
|
+
type: String,
|
|
4324
|
+
default: ""
|
|
4325
|
+
},
|
|
4326
|
+
useFont: {
|
|
4327
|
+
type: Boolean,
|
|
4328
|
+
default: false
|
|
4329
|
+
}
|
|
4330
|
+
};
|
|
4331
|
+
var nav_vue_vue_type_style_index_0_lang = "";
|
|
4332
|
+
const _sfc_main$g = defineComponent({
|
|
4333
|
+
name: "DaoNav",
|
|
4334
|
+
props: navProps,
|
|
4335
|
+
emits: ["back", "select", "toggle"],
|
|
4336
|
+
setup(props, {
|
|
4337
|
+
emit,
|
|
4338
|
+
expose
|
|
4339
|
+
}) {
|
|
4340
|
+
const { type, accordion, activeOpened } = toRefs(props);
|
|
4341
|
+
const openedNav = ref([]);
|
|
4342
|
+
const activeItemIdx = ref();
|
|
4343
|
+
const openNavSub = (index2) => {
|
|
4344
|
+
if (openedNav.value.includes(index2)) {
|
|
4345
|
+
return;
|
|
4346
|
+
}
|
|
4347
|
+
if (accordion.value) {
|
|
4348
|
+
openedNav.value = [];
|
|
4349
|
+
}
|
|
4350
|
+
openedNav.value.push(index2);
|
|
4351
|
+
emit("toggle", {
|
|
4352
|
+
action: "open",
|
|
4353
|
+
index: index2
|
|
4354
|
+
});
|
|
4355
|
+
};
|
|
4356
|
+
const closeNavSub = (index2) => {
|
|
4357
|
+
const idx = openedNav.value.indexOf(index2);
|
|
4358
|
+
if (idx !== -1) {
|
|
4359
|
+
openedNav.value.splice(idx, 1);
|
|
4360
|
+
}
|
|
4361
|
+
emit("toggle", {
|
|
4362
|
+
action: "close",
|
|
4363
|
+
index: index2
|
|
4364
|
+
});
|
|
4365
|
+
};
|
|
4366
|
+
const close = (index2) => closeNavSub(index2);
|
|
4367
|
+
const open = (index2) => openNavSub(index2);
|
|
4368
|
+
const initNav = () => {
|
|
4369
|
+
activeOpened.value.forEach((v) => {
|
|
4370
|
+
openNavSub(v);
|
|
4371
|
+
});
|
|
4372
|
+
};
|
|
4373
|
+
onMounted(() => {
|
|
4374
|
+
initNav();
|
|
4375
|
+
});
|
|
4376
|
+
const handleNavItemClick = (index2) => {
|
|
4377
|
+
activeItemIdx.value = index2;
|
|
4378
|
+
emit("select", index2);
|
|
4379
|
+
};
|
|
4380
|
+
const handleNavSubClick = (index2) => {
|
|
4381
|
+
const isOpened = openedNav.value.includes(index2);
|
|
4382
|
+
if (isOpened) {
|
|
4383
|
+
closeNavSub(index2);
|
|
4384
|
+
} else {
|
|
4385
|
+
openNavSub(index2);
|
|
3446
4386
|
}
|
|
4387
|
+
};
|
|
4388
|
+
const handleNavHeadClick = () => {
|
|
4389
|
+
emit("back");
|
|
4390
|
+
};
|
|
4391
|
+
provide(navRootKey, reactive({
|
|
4392
|
+
type,
|
|
4393
|
+
accordion,
|
|
4394
|
+
activeItemIdx,
|
|
4395
|
+
openedNav,
|
|
4396
|
+
handleNavItemClick,
|
|
4397
|
+
handleNavSubClick,
|
|
4398
|
+
handleNavHeadClick
|
|
4399
|
+
}));
|
|
4400
|
+
expose({
|
|
4401
|
+
close,
|
|
4402
|
+
open
|
|
4403
|
+
});
|
|
4404
|
+
}
|
|
4405
|
+
});
|
|
4406
|
+
const _hoisted_1$d = { class: "dao-nav-bar" };
|
|
4407
|
+
const _hoisted_2$a = { class: "dao-nav" };
|
|
4408
|
+
function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4409
|
+
return openBlock(), createElementBlock("nav", _hoisted_1$d, [
|
|
4410
|
+
renderSlot(_ctx.$slots, "header"),
|
|
4411
|
+
createElementVNode("ul", _hoisted_2$a, [
|
|
4412
|
+
renderSlot(_ctx.$slots, "default")
|
|
4413
|
+
])
|
|
4414
|
+
]);
|
|
4415
|
+
}
|
|
4416
|
+
var nav = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$e]]);
|
|
4417
|
+
const _sfc_main$f = defineComponent({
|
|
4418
|
+
name: "DaoNavHead",
|
|
4419
|
+
components: {
|
|
4420
|
+
DaoIcon
|
|
4421
|
+
},
|
|
4422
|
+
props: navHeadProps,
|
|
4423
|
+
setup(props) {
|
|
4424
|
+
const rootNav = inject(navRootKey);
|
|
4425
|
+
if (!rootNav) {
|
|
4426
|
+
console.warn("use Nav", "can not inject root Nav");
|
|
4427
|
+
}
|
|
4428
|
+
const { icon, title, useFont } = toRefs(props);
|
|
4429
|
+
const showIcon = computed(() => (rootNav == null ? void 0 : rootNav.type) === "3rd" || Boolean(unref(icon)));
|
|
4430
|
+
const headIcon = computed(() => (rootNav == null ? void 0 : rootNav.type) === "2rd" ? unref(icon) : "icon-back");
|
|
4431
|
+
const isFontType = computed(() => (rootNav == null ? void 0 : rootNav.type) === "2rd" ? unref(useFont) : true);
|
|
4432
|
+
const classHeadList = computed(() => [
|
|
4433
|
+
"dao-nav__head",
|
|
4434
|
+
`dao-nav__head--${rootNav == null ? void 0 : rootNav.type}`
|
|
3447
4435
|
]);
|
|
3448
|
-
const
|
|
3449
|
-
|
|
3450
|
-
|
|
4436
|
+
const handleClickBack = () => {
|
|
4437
|
+
if ((rootNav == null ? void 0 : rootNav.type) === "2rd") {
|
|
4438
|
+
return;
|
|
4439
|
+
}
|
|
4440
|
+
rootNav == null ? void 0 : rootNav.handleNavHeadClick();
|
|
3451
4441
|
};
|
|
3452
|
-
provide(radioGroupKey, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
|
|
3453
|
-
changeEvent
|
|
3454
|
-
})));
|
|
3455
4442
|
return {
|
|
3456
|
-
|
|
4443
|
+
classHeadList,
|
|
4444
|
+
headIcon,
|
|
4445
|
+
title,
|
|
4446
|
+
isFontType,
|
|
4447
|
+
showIcon,
|
|
4448
|
+
handleClickBack
|
|
3457
4449
|
};
|
|
3458
4450
|
}
|
|
3459
4451
|
});
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
4452
|
+
const _hoisted_1$c = { class: "dao-nav__head-text dao-nav-text" };
|
|
4453
|
+
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4454
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
4455
|
+
return openBlock(), createElementBlock("li", {
|
|
4456
|
+
class: normalizeClass(_ctx.classHeadList)
|
|
3463
4457
|
}, [
|
|
3464
|
-
renderSlot(_ctx.$slots, "default")
|
|
4458
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4459
|
+
_ctx.showIcon ? (openBlock(), createBlock(_component_dao_icon, {
|
|
4460
|
+
key: 0,
|
|
4461
|
+
class: "dao-nav__head-icon",
|
|
4462
|
+
tabindex: "0",
|
|
4463
|
+
name: _ctx.headIcon,
|
|
4464
|
+
"use-font": _ctx.isFontType,
|
|
4465
|
+
onClick: _ctx.handleClickBack,
|
|
4466
|
+
onKeyup: withKeys(withModifiers(_ctx.handleClickBack, ["stop"]), ["esc"])
|
|
4467
|
+
}, null, 8, ["name", "use-font", "onClick", "onKeyup"])) : createCommentVNode("", true),
|
|
4468
|
+
createElementVNode("span", _hoisted_1$c, toDisplayString(_ctx.title), 1)
|
|
4469
|
+
])
|
|
3465
4470
|
], 2);
|
|
3466
4471
|
}
|
|
3467
|
-
var
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
name: "DaoSelect",
|
|
4472
|
+
var navHead = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$d]]);
|
|
4473
|
+
const _sfc_main$e = defineComponent({
|
|
4474
|
+
name: "DaoNavItem",
|
|
3471
4475
|
components: {
|
|
3472
|
-
|
|
4476
|
+
DaoIcon
|
|
3473
4477
|
},
|
|
3474
|
-
props:
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
type: String,
|
|
3481
|
-
default: ""
|
|
3482
|
-
},
|
|
3483
|
-
disabled: {
|
|
3484
|
-
type: Boolean,
|
|
3485
|
-
default: false
|
|
3486
|
-
},
|
|
3487
|
-
size: {
|
|
3488
|
-
type: String,
|
|
3489
|
-
default: "md",
|
|
3490
|
-
validator: (size) => ["md", "sm"].includes(size)
|
|
3491
|
-
},
|
|
3492
|
-
optionsPlaceholder: {
|
|
3493
|
-
type: String,
|
|
3494
|
-
default: "\u65E0\u6570\u636E"
|
|
3495
|
-
},
|
|
3496
|
-
search: {
|
|
3497
|
-
type: [Boolean, Function],
|
|
3498
|
-
default: false
|
|
3499
|
-
},
|
|
3500
|
-
searchPlaceholder: {
|
|
3501
|
-
type: String,
|
|
3502
|
-
default: "\u641C\u7D22"
|
|
3503
|
-
},
|
|
3504
|
-
menuClass: {
|
|
3505
|
-
type: String,
|
|
3506
|
-
default: ""
|
|
3507
|
-
},
|
|
3508
|
-
appendTo: {
|
|
3509
|
-
type: [String, Boolean, Object],
|
|
3510
|
-
default: "body"
|
|
4478
|
+
props: navItemProps,
|
|
4479
|
+
setup(props, { slots }) {
|
|
4480
|
+
const rootNav = inject(navRootKey);
|
|
4481
|
+
const subNav = inject(navSubKey);
|
|
4482
|
+
if (!rootNav || !subNav) {
|
|
4483
|
+
console.warn("use Nav", "can not inject root Nav");
|
|
3511
4484
|
}
|
|
3512
|
-
},
|
|
3513
|
-
emits: ["update:modelValue", "change", "search-change", "close", "open"],
|
|
3514
|
-
setup(props, { emit }) {
|
|
3515
4485
|
const {
|
|
3516
|
-
|
|
4486
|
+
icon,
|
|
4487
|
+
title,
|
|
4488
|
+
useFont,
|
|
3517
4489
|
disabled,
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
4490
|
+
isActive,
|
|
4491
|
+
isExactActive,
|
|
4492
|
+
index: index2
|
|
3521
4493
|
} = toRefs(props);
|
|
3522
|
-
const
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
const instance = getCurrentInstance();
|
|
3530
|
-
provide("select", instance);
|
|
3531
|
-
const popperOffset = computed(() => {
|
|
3532
|
-
const unrefSize = unref(size);
|
|
3533
|
-
if (unrefSize === "sm") {
|
|
3534
|
-
return 3;
|
|
4494
|
+
const showIcon = computed(() => (rootNav == null ? void 0 : rootNav.type) === "2rd" && Boolean(icon.value));
|
|
4495
|
+
const isSelect = computed(() => (rootNav == null ? void 0 : rootNav.activeItemIdx) === index2.value);
|
|
4496
|
+
const isNavItemActive = computed(() => {
|
|
4497
|
+
const unrefIsActive = unref(isActive);
|
|
4498
|
+
const unrefIsExactActive = unref(isExactActive);
|
|
4499
|
+
if (isSelect.value) {
|
|
4500
|
+
return true;
|
|
3535
4501
|
}
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
const selectClass = computed(() => {
|
|
3539
|
-
const classNames = ["dao-select"];
|
|
3540
|
-
const unrefSize = unref(size);
|
|
3541
|
-
if (disabled.value) {
|
|
3542
|
-
classNames.push("dao-select--disabled");
|
|
4502
|
+
if (unrefIsActive && !(rootNav == null ? void 0 : rootNav.activeItemIdx)) {
|
|
4503
|
+
return true;
|
|
3543
4504
|
}
|
|
3544
|
-
if (
|
|
3545
|
-
|
|
4505
|
+
if (unrefIsExactActive && !(rootNav == null ? void 0 : rootNav.activeItemIdx)) {
|
|
4506
|
+
return true;
|
|
3546
4507
|
}
|
|
3547
|
-
return
|
|
4508
|
+
return false;
|
|
3548
4509
|
});
|
|
3549
|
-
const
|
|
3550
|
-
const
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
4510
|
+
const classItemList = computed(() => {
|
|
4511
|
+
const unrefDisabled = unref(disabled);
|
|
4512
|
+
return [
|
|
4513
|
+
"dao-nav__item",
|
|
4514
|
+
`dao-nav__item--${rootNav == null ? void 0 : rootNav.type}`,
|
|
4515
|
+
{
|
|
4516
|
+
"dao-nav__item-disabled": unrefDisabled
|
|
4517
|
+
}
|
|
4518
|
+
];
|
|
4519
|
+
});
|
|
4520
|
+
const classTitleList = computed(() => [
|
|
4521
|
+
"dao-nav__item-title",
|
|
4522
|
+
{
|
|
4523
|
+
"dao-nav__item-title-active": isNavItemActive.value,
|
|
4524
|
+
"dao-nav__item-title-with-icon": showIcon.value || slots.default
|
|
3554
4525
|
}
|
|
3555
|
-
|
|
3556
|
-
|
|
4526
|
+
]);
|
|
4527
|
+
const handleClick = () => {
|
|
4528
|
+
if (disabled.value) {
|
|
4529
|
+
return;
|
|
4530
|
+
}
|
|
4531
|
+
rootNav == null ? void 0 : rootNav.handleNavItemClick(index2.value);
|
|
4532
|
+
};
|
|
4533
|
+
watchEffect(() => {
|
|
4534
|
+
if (isActive.value || isExactActive.value) {
|
|
4535
|
+
subNav == null ? void 0 : subNav.handleNavItemActive(isActive.value || isExactActive.value, index2.value);
|
|
4536
|
+
rootNav == null ? void 0 : rootNav.handleNavItemClick(index2.value);
|
|
3557
4537
|
}
|
|
3558
|
-
return classNames.join(" ");
|
|
3559
|
-
});
|
|
3560
|
-
const isSelected = computed(() => {
|
|
3561
|
-
var _a;
|
|
3562
|
-
return !isNullish((_a = state.selectedOption) == null ? void 0 : _a.value);
|
|
3563
|
-
});
|
|
3564
|
-
const isNoResult = computed(() => {
|
|
3565
|
-
const unrefSearch = unref(search);
|
|
3566
|
-
return state.options.length === 0 || unrefSearch && !state.options.some((x) => x.visible);
|
|
3567
4538
|
});
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
4539
|
+
watch(() => rootNav == null ? void 0 : rootNav.activeItemIdx, (val) => {
|
|
4540
|
+
const active = val === index2.value;
|
|
4541
|
+
subNav == null ? void 0 : subNav.handleNavItemActive(active, index2.value);
|
|
4542
|
+
}, { immediate: true });
|
|
4543
|
+
return {
|
|
4544
|
+
classItemList,
|
|
4545
|
+
classTitleList,
|
|
4546
|
+
icon,
|
|
4547
|
+
showIcon,
|
|
4548
|
+
title,
|
|
4549
|
+
useFont,
|
|
4550
|
+
handleClick
|
|
4551
|
+
};
|
|
4552
|
+
}
|
|
4553
|
+
});
|
|
4554
|
+
const _hoisted_1$b = { class: "dao-nav-slot" };
|
|
4555
|
+
const _hoisted_2$9 = { class: "dao-nav__item-text dao-nav-text" };
|
|
4556
|
+
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4557
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
4558
|
+
return openBlock(), createElementBlock("li", {
|
|
4559
|
+
class: normalizeClass(_ctx.classItemList)
|
|
4560
|
+
}, [
|
|
4561
|
+
createElementVNode("div", {
|
|
4562
|
+
class: normalizeClass(_ctx.classTitleList),
|
|
4563
|
+
tabindex: "0",
|
|
4564
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args)),
|
|
4565
|
+
onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["enter"]))
|
|
4566
|
+
}, [
|
|
4567
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
4568
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
4569
|
+
_ctx.showIcon ? (openBlock(), createBlock(_component_dao_icon, {
|
|
4570
|
+
key: 0,
|
|
4571
|
+
class: "dao-nav__item-icon",
|
|
4572
|
+
name: _ctx.icon,
|
|
4573
|
+
"use-font": _ctx.useFont
|
|
4574
|
+
}, null, 8, ["name", "use-font"])) : createCommentVNode("", true),
|
|
4575
|
+
createElementVNode("span", _hoisted_2$9, toDisplayString(_ctx.title), 1)
|
|
4576
|
+
])
|
|
4577
|
+
])
|
|
4578
|
+
], 34)
|
|
4579
|
+
], 2);
|
|
4580
|
+
}
|
|
4581
|
+
var navItem = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$c]]);
|
|
4582
|
+
const _sfc_main$d = defineComponent({
|
|
4583
|
+
name: "DaoNavSub",
|
|
4584
|
+
components: {
|
|
4585
|
+
DaoIcon
|
|
4586
|
+
},
|
|
4587
|
+
props: navSubProps,
|
|
4588
|
+
setup(props, { slots }) {
|
|
4589
|
+
const {
|
|
4590
|
+
icon,
|
|
4591
|
+
title,
|
|
4592
|
+
useFont,
|
|
4593
|
+
disabled,
|
|
4594
|
+
isActive,
|
|
4595
|
+
isExactActive,
|
|
4596
|
+
index: index2,
|
|
4597
|
+
fold
|
|
4598
|
+
} = toRefs(props);
|
|
4599
|
+
const rootNav = inject(navRootKey);
|
|
4600
|
+
if (!rootNav) {
|
|
4601
|
+
console.warn("use Nav", "can not inject root Nav");
|
|
4602
|
+
}
|
|
4603
|
+
const isChildrenActive = ref(false);
|
|
4604
|
+
const currentActiveIndex = ref(false);
|
|
4605
|
+
const opened = ref(false);
|
|
4606
|
+
const childrenActiveMap = reactive(new Map());
|
|
4607
|
+
const showIcon = computed(() => (rootNav == null ? void 0 : rootNav.type) === "2rd" && Boolean(icon.value));
|
|
4608
|
+
const foldIcon = computed(() => opened.value ? "icon_caret-up" : "icon_caret-down");
|
|
4609
|
+
const isSelect = computed(() => (rootNav == null ? void 0 : rootNav.activeItemIdx) === index2.value);
|
|
4610
|
+
const classSubList = computed(() => {
|
|
4611
|
+
const unrefDisabled = unref(disabled);
|
|
4612
|
+
return [
|
|
4613
|
+
"dao-nav__sub",
|
|
4614
|
+
`dao-nav__sub--${rootNav == null ? void 0 : rootNav.type}`,
|
|
4615
|
+
{
|
|
4616
|
+
"dao-nav__sub-disabled": unrefDisabled && !fold.value
|
|
4617
|
+
}
|
|
4618
|
+
];
|
|
4619
|
+
});
|
|
4620
|
+
const isNavSubActive = computed(() => {
|
|
4621
|
+
const unrefIsActive = unref(isActive);
|
|
4622
|
+
const unrefIsExactActive = unref(isExactActive);
|
|
4623
|
+
if (disabled.value && !fold.value) {
|
|
4624
|
+
return false;
|
|
4625
|
+
}
|
|
4626
|
+
if (fold.value) {
|
|
4627
|
+
return isChildrenActive.value;
|
|
4628
|
+
}
|
|
4629
|
+
if (isSelect.value) {
|
|
4630
|
+
return true;
|
|
4631
|
+
}
|
|
4632
|
+
if (unrefIsActive && !(rootNav == null ? void 0 : rootNav.activeItemIdx)) {
|
|
4633
|
+
return true;
|
|
4634
|
+
}
|
|
4635
|
+
if (unrefIsExactActive && !(rootNav == null ? void 0 : rootNav.activeItemIdx)) {
|
|
4636
|
+
return true;
|
|
4637
|
+
}
|
|
4638
|
+
return false;
|
|
4639
|
+
});
|
|
4640
|
+
const classTitleList = computed(() => [
|
|
4641
|
+
"dao-nav__sub-title",
|
|
4642
|
+
{
|
|
4643
|
+
"dao-nav__sub-title-active": isNavSubActive.value,
|
|
4644
|
+
"dao-nav__sub-title-opened": opened.value,
|
|
4645
|
+
"dao-nav__sub-title-fold": fold.value,
|
|
4646
|
+
"dao-nav__sub-title-with-icon": showIcon.value || slots.title
|
|
4647
|
+
}
|
|
4648
|
+
]);
|
|
4649
|
+
const handleNavItemActive = (active, idx) => {
|
|
4650
|
+
childrenActiveMap.set(idx, active);
|
|
4651
|
+
};
|
|
4652
|
+
provide(navSubKey, {
|
|
4653
|
+
handleNavItemActive
|
|
4654
|
+
});
|
|
4655
|
+
watch(childrenActiveMap, (v) => {
|
|
4656
|
+
if (!fold.value) {
|
|
4657
|
+
return;
|
|
4658
|
+
}
|
|
4659
|
+
const childrenActiveList = Array.from(v.values());
|
|
4660
|
+
if (childrenActiveList.indexOf(true) !== -1) {
|
|
4661
|
+
isChildrenActive.value = true;
|
|
4662
|
+
} else {
|
|
4663
|
+
isChildrenActive.value = false;
|
|
4664
|
+
}
|
|
4665
|
+
});
|
|
4666
|
+
const handleClick = () => {
|
|
4667
|
+
if (disabled.value && !fold.value) {
|
|
4668
|
+
return;
|
|
4669
|
+
}
|
|
4670
|
+
if (fold.value) {
|
|
4671
|
+
rootNav == null ? void 0 : rootNav.handleNavSubClick(index2.value);
|
|
4672
|
+
} else {
|
|
4673
|
+
rootNav == null ? void 0 : rootNav.handleNavItemClick(index2.value);
|
|
4674
|
+
}
|
|
4675
|
+
};
|
|
4676
|
+
watchEffect(() => {
|
|
4677
|
+
if (!fold.value && (isActive.value || isExactActive.value)) {
|
|
4678
|
+
rootNav == null ? void 0 : rootNav.handleNavItemClick(index2.value);
|
|
4679
|
+
}
|
|
4680
|
+
});
|
|
4681
|
+
watch(() => rootNav == null ? void 0 : rootNav.activeItemIdx, (val) => {
|
|
4682
|
+
currentActiveIndex.value = Boolean(val === index2.value);
|
|
4683
|
+
}, { immediate: true });
|
|
4684
|
+
watch(() => rootNav == null ? void 0 : rootNav.openedNav, (val) => {
|
|
4685
|
+
if (disabled.value && !fold.value) {
|
|
4686
|
+
opened.value = false;
|
|
4687
|
+
} else {
|
|
4688
|
+
opened.value = (val == null ? void 0 : val.indexOf(index2.value)) !== -1;
|
|
4689
|
+
}
|
|
4690
|
+
}, { immediate: true, deep: true });
|
|
4691
|
+
return {
|
|
4692
|
+
classSubList,
|
|
4693
|
+
classTitleList,
|
|
4694
|
+
fold,
|
|
4695
|
+
foldIcon,
|
|
4696
|
+
showIcon,
|
|
4697
|
+
title,
|
|
4698
|
+
useFont,
|
|
4699
|
+
opened,
|
|
4700
|
+
handleClick
|
|
4701
|
+
};
|
|
4702
|
+
}
|
|
4703
|
+
});
|
|
4704
|
+
const _hoisted_1$a = { class: "dao-nav-slot" };
|
|
4705
|
+
const _hoisted_2$8 = { class: "dao-nav__sub-text dao-nav-text" };
|
|
4706
|
+
const _hoisted_3$5 = {
|
|
4707
|
+
key: 0,
|
|
4708
|
+
class: "icon-dropdown-line dao-nav__sub__icon-fold"
|
|
4709
|
+
};
|
|
4710
|
+
const _hoisted_4$4 = /* @__PURE__ */ createElementVNode("span", { class: "dao-nav__sub-gap" }, null, -1);
|
|
4711
|
+
const _hoisted_5$3 = { class: "dao-nav dao-nav-inner" };
|
|
4712
|
+
const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("span", { class: "dao-nav__sub-gap" }, null, -1);
|
|
4713
|
+
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4714
|
+
const _component_dao_icon = resolveComponent("dao-icon");
|
|
4715
|
+
return openBlock(), createElementBlock("li", {
|
|
4716
|
+
class: normalizeClass(_ctx.classSubList)
|
|
4717
|
+
}, [
|
|
4718
|
+
createElementVNode("div", {
|
|
4719
|
+
class: normalizeClass(_ctx.classTitleList),
|
|
4720
|
+
tabindex: "0",
|
|
4721
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args)),
|
|
4722
|
+
onKeyup: _cache[1] || (_cache[1] = withKeys((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["enter"]))
|
|
4723
|
+
}, [
|
|
4724
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
4725
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
4726
|
+
_ctx.showIcon ? (openBlock(), createBlock(_component_dao_icon, {
|
|
4727
|
+
key: 0,
|
|
4728
|
+
class: "dao-nav__sub-icon",
|
|
4729
|
+
name: _ctx.icon,
|
|
4730
|
+
"use-font": _ctx.useFont
|
|
4731
|
+
}, null, 8, ["name", "use-font"])) : createCommentVNode("", true),
|
|
4732
|
+
createElementVNode("span", _hoisted_2$8, toDisplayString(_ctx.title), 1)
|
|
4733
|
+
])
|
|
4734
|
+
]),
|
|
4735
|
+
_ctx.fold ? (openBlock(), createElementBlock("i", _hoisted_3$5)) : createCommentVNode("", true)
|
|
4736
|
+
], 34),
|
|
4737
|
+
createVNode(Transition, { name: "dao-nav" }, {
|
|
4738
|
+
default: withCtx(() => [
|
|
4739
|
+
withDirectives(createElementVNode("div", null, [
|
|
4740
|
+
_hoisted_4$4,
|
|
4741
|
+
createElementVNode("ul", _hoisted_5$3, [
|
|
4742
|
+
renderSlot(_ctx.$slots, "default")
|
|
4743
|
+
]),
|
|
4744
|
+
_hoisted_6$2
|
|
4745
|
+
], 512), [
|
|
4746
|
+
[vShow, _ctx.opened]
|
|
4747
|
+
])
|
|
4748
|
+
]),
|
|
4749
|
+
_: 3
|
|
4750
|
+
})
|
|
4751
|
+
], 2);
|
|
4752
|
+
}
|
|
4753
|
+
var navSub = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$b]]);
|
|
4754
|
+
const paginationProps = {
|
|
4755
|
+
pageSize: {
|
|
4756
|
+
type: Number,
|
|
4757
|
+
required: true,
|
|
4758
|
+
default: 10,
|
|
4759
|
+
validator: (val) => val > 0 && Math.floor(val) === val
|
|
4760
|
+
},
|
|
4761
|
+
pageSizeOptions: {
|
|
4762
|
+
type: Array,
|
|
4763
|
+
default: () => []
|
|
4764
|
+
},
|
|
4765
|
+
pageFormat: {
|
|
4766
|
+
type: Function,
|
|
4767
|
+
default: (val) => `${val} per page`
|
|
4768
|
+
},
|
|
4769
|
+
compact: {
|
|
4770
|
+
type: Boolean,
|
|
4771
|
+
default: false
|
|
4772
|
+
},
|
|
4773
|
+
total: {
|
|
4774
|
+
type: Number,
|
|
4775
|
+
required: true,
|
|
4776
|
+
default: 0
|
|
4777
|
+
},
|
|
4778
|
+
totalFormat: {
|
|
4779
|
+
type: Function,
|
|
4780
|
+
default: (val) => `Total ${val} ${val === 1 ? "record" : "records"}`
|
|
4781
|
+
},
|
|
4782
|
+
currentPage: {
|
|
4783
|
+
type: Number,
|
|
4784
|
+
default: 1
|
|
4785
|
+
},
|
|
4786
|
+
pageSizerWidth: {
|
|
4787
|
+
type: Number,
|
|
4788
|
+
default: 110
|
|
4789
|
+
}
|
|
4790
|
+
};
|
|
4791
|
+
var select_vue_vue_type_style_index_0_lang = "";
|
|
4792
|
+
const _sfc_main$c = defineComponent({
|
|
4793
|
+
name: "DaoSelect",
|
|
4794
|
+
components: {
|
|
4795
|
+
DaoPopper: Popper
|
|
4796
|
+
},
|
|
4797
|
+
props: {
|
|
4798
|
+
modelValue: {
|
|
4799
|
+
type: [String, Number, Boolean],
|
|
4800
|
+
default: void 0
|
|
4801
|
+
},
|
|
4802
|
+
placeholder: {
|
|
4803
|
+
type: String,
|
|
4804
|
+
default: ""
|
|
4805
|
+
},
|
|
4806
|
+
disabled: {
|
|
4807
|
+
type: Boolean,
|
|
4808
|
+
default: false
|
|
4809
|
+
},
|
|
4810
|
+
size: {
|
|
4811
|
+
type: String,
|
|
4812
|
+
default: "md",
|
|
4813
|
+
validator: (size) => ["md", "sm"].includes(size)
|
|
4814
|
+
},
|
|
4815
|
+
optionsPlaceholder: {
|
|
4816
|
+
type: String,
|
|
4817
|
+
default: "\u65E0\u6570\u636E"
|
|
4818
|
+
},
|
|
4819
|
+
search: {
|
|
4820
|
+
type: [Boolean, Function],
|
|
4821
|
+
default: false
|
|
4822
|
+
},
|
|
4823
|
+
searchPlaceholder: {
|
|
4824
|
+
type: String,
|
|
4825
|
+
default: "\u641C\u7D22"
|
|
4826
|
+
},
|
|
4827
|
+
menuClass: {
|
|
4828
|
+
type: String,
|
|
4829
|
+
default: ""
|
|
4830
|
+
},
|
|
4831
|
+
appendTo: {
|
|
4832
|
+
type: [String, Boolean, Object],
|
|
4833
|
+
default: "body"
|
|
4834
|
+
}
|
|
4835
|
+
},
|
|
4836
|
+
emits: ["update:modelValue", "change", "search-change", "close", "open"],
|
|
4837
|
+
setup(props, { emit }) {
|
|
4838
|
+
const {
|
|
4839
|
+
modelValue,
|
|
4840
|
+
disabled,
|
|
4841
|
+
size,
|
|
4842
|
+
menuClass,
|
|
4843
|
+
search
|
|
4844
|
+
} = toRefs(props);
|
|
4845
|
+
const state = reactive({
|
|
4846
|
+
selectedOption: void 0,
|
|
4847
|
+
options: [],
|
|
4848
|
+
searchText: ""
|
|
4849
|
+
});
|
|
4850
|
+
const popper2 = ref(null);
|
|
4851
|
+
const searchInput = ref(null);
|
|
4852
|
+
const instance = getCurrentInstance();
|
|
4853
|
+
provide("select", instance);
|
|
4854
|
+
const popperOffset = computed(() => {
|
|
4855
|
+
const unrefSize = unref(size);
|
|
4856
|
+
if (unrefSize === "sm") {
|
|
4857
|
+
return 3;
|
|
4858
|
+
}
|
|
4859
|
+
return 5;
|
|
4860
|
+
});
|
|
4861
|
+
const selectClass = computed(() => {
|
|
4862
|
+
const classNames = ["dao-select"];
|
|
4863
|
+
const unrefSize = unref(size);
|
|
4864
|
+
if (disabled.value) {
|
|
4865
|
+
classNames.push("dao-select--disabled");
|
|
4866
|
+
}
|
|
4867
|
+
if (unrefSize) {
|
|
4868
|
+
classNames.push(`dao-select--size-${unrefSize}`);
|
|
4869
|
+
}
|
|
4870
|
+
return classNames;
|
|
4871
|
+
});
|
|
4872
|
+
const popperClass = computed(() => {
|
|
4873
|
+
const classNames = ["dao-select-popper"];
|
|
4874
|
+
const unrefSize = unref(size);
|
|
4875
|
+
if (unrefSize) {
|
|
4876
|
+
classNames.push(`dao-select-popper--size-${unrefSize}`);
|
|
4877
|
+
}
|
|
4878
|
+
if (menuClass.value) {
|
|
4879
|
+
classNames.push(menuClass.value);
|
|
4880
|
+
}
|
|
4881
|
+
return classNames.join(" ");
|
|
4882
|
+
});
|
|
4883
|
+
const isSelected = computed(() => {
|
|
4884
|
+
var _a;
|
|
4885
|
+
return !isNullish((_a = state.selectedOption) == null ? void 0 : _a.value);
|
|
4886
|
+
});
|
|
4887
|
+
const isNoResult = computed(() => {
|
|
4888
|
+
const unrefSearch = unref(search);
|
|
4889
|
+
return state.options.length === 0 || unrefSearch && !state.options.some((x) => x.visible);
|
|
4890
|
+
});
|
|
4891
|
+
const popperOptions = computed(() => ({
|
|
4892
|
+
modifiers: [
|
|
4893
|
+
{
|
|
4894
|
+
name: "sameWidth",
|
|
4895
|
+
enabled: true,
|
|
4896
|
+
phase: "beforeWrite",
|
|
4897
|
+
requires: ["computeStyles"],
|
|
4898
|
+
fn: ({ state: popperState }) => {
|
|
4899
|
+
popperState.styles.popper.width = `${popperState.rects.reference.width}px`;
|
|
4900
|
+
},
|
|
4901
|
+
effect: ({ state: popperState }) => {
|
|
3579
4902
|
popperState.elements.popper.style.width = `${popperState.elements.reference.offsetWidth}px`;
|
|
3580
4903
|
}
|
|
3581
4904
|
}
|
|
@@ -3633,9 +4956,9 @@ const _sfc_main$8 = defineComponent({
|
|
|
3633
4956
|
});
|
|
3634
4957
|
(_a = searchInput.value) == null ? void 0 : _a.focus();
|
|
3635
4958
|
};
|
|
3636
|
-
const remove = (
|
|
3637
|
-
if (
|
|
3638
|
-
const [removed] = state.options.splice(
|
|
4959
|
+
const remove = (index2) => {
|
|
4960
|
+
if (index2 > -1) {
|
|
4961
|
+
const [removed] = state.options.splice(index2, 1);
|
|
3639
4962
|
if (removed) {
|
|
3640
4963
|
checkRemovedOption(removed);
|
|
3641
4964
|
}
|
|
@@ -3668,20 +4991,20 @@ const _sfc_main$8 = defineComponent({
|
|
|
3668
4991
|
};
|
|
3669
4992
|
}
|
|
3670
4993
|
});
|
|
3671
|
-
const _hoisted_1$
|
|
4994
|
+
const _hoisted_1$9 = {
|
|
3672
4995
|
class: "dao-selection",
|
|
3673
4996
|
tabindex: "1"
|
|
3674
4997
|
};
|
|
3675
|
-
const _hoisted_2$
|
|
4998
|
+
const _hoisted_2$7 = {
|
|
3676
4999
|
key: 0,
|
|
3677
5000
|
class: "dao-selection-text"
|
|
3678
5001
|
};
|
|
3679
|
-
const _hoisted_3$
|
|
5002
|
+
const _hoisted_3$4 = {
|
|
3680
5003
|
key: 1,
|
|
3681
5004
|
class: "dao-selection-text--placeholder"
|
|
3682
5005
|
};
|
|
3683
|
-
const _hoisted_4$
|
|
3684
|
-
const _hoisted_5$
|
|
5006
|
+
const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("i", { class: "icon-dropdown-line dao-selection-icon" }, null, -1);
|
|
5007
|
+
const _hoisted_5$2 = {
|
|
3685
5008
|
key: 0,
|
|
3686
5009
|
class: "dao-selection-search"
|
|
3687
5010
|
};
|
|
@@ -3692,7 +5015,7 @@ const _hoisted_9$1 = {
|
|
|
3692
5015
|
key: "dao-option-placeholder",
|
|
3693
5016
|
class: "dao-option-placeholder"
|
|
3694
5017
|
};
|
|
3695
|
-
function _sfc_render$
|
|
5018
|
+
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3696
5019
|
const _component_dao_popper = resolveComponent("dao-popper");
|
|
3697
5020
|
return openBlock(), createBlock(_component_dao_popper, {
|
|
3698
5021
|
ref: "popper",
|
|
@@ -3712,7 +5035,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3712
5035
|
}, {
|
|
3713
5036
|
content: withCtx(() => [
|
|
3714
5037
|
renderSlot(_ctx.$slots, "optionsHeader", {}, () => [
|
|
3715
|
-
_ctx.search ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
5038
|
+
_ctx.search ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
|
|
3716
5039
|
withDirectives(createElementVNode("input", {
|
|
3717
5040
|
ref: "searchInput",
|
|
3718
5041
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.state.searchText = $event),
|
|
@@ -3727,7 +5050,7 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3727
5050
|
]),
|
|
3728
5051
|
_hoisted_7$1,
|
|
3729
5052
|
withDirectives(createElementVNode("i", {
|
|
3730
|
-
class: "icon-
|
|
5053
|
+
class: "icon-sys-error dao-selection-search-clear-icon",
|
|
3731
5054
|
tabindex: "1",
|
|
3732
5055
|
onKeydown: _cache[3] || (_cache[3] = withKeys((...args) => _ctx.onSearchClear && _ctx.onSearchClear(...args), ["enter"])),
|
|
3733
5056
|
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.onSearchClear && _ctx.onSearchClear(...args))
|
|
@@ -3744,8 +5067,8 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3744
5067
|
default: withCtx(() => {
|
|
3745
5068
|
var _a, _b;
|
|
3746
5069
|
return [
|
|
3747
|
-
createElementVNode("button", _hoisted_1$
|
|
3748
|
-
_ctx.isSelected ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
5070
|
+
createElementVNode("button", _hoisted_1$9, [
|
|
5071
|
+
_ctx.isSelected ? (openBlock(), createElementBlock("span", _hoisted_2$7, [
|
|
3749
5072
|
renderSlot(_ctx.$slots, "selected", {
|
|
3750
5073
|
selectedLabel: (_a = _ctx.state.selectedOption) == null ? void 0 : _a.label,
|
|
3751
5074
|
selectedOption: _ctx.state.selectedOption,
|
|
@@ -3756,17 +5079,17 @@ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3756
5079
|
createTextVNode(toDisplayString((_a2 = _ctx.state.selectedOption) == null ? void 0 : _a2.labelValue), 1)
|
|
3757
5080
|
];
|
|
3758
5081
|
})
|
|
3759
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_3$
|
|
3760
|
-
_hoisted_4$
|
|
5082
|
+
])) : (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(_ctx.placeholder), 1)),
|
|
5083
|
+
_hoisted_4$3
|
|
3761
5084
|
])
|
|
3762
5085
|
];
|
|
3763
5086
|
}),
|
|
3764
5087
|
_: 3
|
|
3765
5088
|
}, 8, ["disabled", "offset", "popper-class", "popper-options", "class", "append-to"]);
|
|
3766
5089
|
}
|
|
3767
|
-
var DaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5090
|
+
var DaoSelect = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$a]]);
|
|
3768
5091
|
var option_vue_vue_type_style_index_0_lang = "";
|
|
3769
|
-
const _sfc_main$
|
|
5092
|
+
const _sfc_main$b = defineComponent({
|
|
3770
5093
|
name: "DaoOption",
|
|
3771
5094
|
props: {
|
|
3772
5095
|
value: {
|
|
@@ -3812,55 +5135,462 @@ const _sfc_main$7 = defineComponent({
|
|
|
3812
5135
|
onSelectFn(instance);
|
|
3813
5136
|
}
|
|
3814
5137
|
};
|
|
3815
|
-
if (typeof addFn === "function") {
|
|
3816
|
-
addFn(instance);
|
|
3817
|
-
}
|
|
3818
|
-
onBeforeUnmount(() => {
|
|
3819
|
-
var _a;
|
|
3820
|
-
if (typeof removeFn === "function") {
|
|
3821
|
-
const
|
|
3822
|
-
removeFn(
|
|
3823
|
-
}
|
|
3824
|
-
});
|
|
5138
|
+
if (typeof addFn === "function") {
|
|
5139
|
+
addFn(instance);
|
|
5140
|
+
}
|
|
5141
|
+
onBeforeUnmount(() => {
|
|
5142
|
+
var _a;
|
|
5143
|
+
if (typeof removeFn === "function") {
|
|
5144
|
+
const index2 = (_a = selectState == null ? void 0 : selectState.options.indexOf(instance)) != null ? _a : -1;
|
|
5145
|
+
removeFn(index2);
|
|
5146
|
+
}
|
|
5147
|
+
});
|
|
5148
|
+
return {
|
|
5149
|
+
visible,
|
|
5150
|
+
labelValue,
|
|
5151
|
+
isSelected,
|
|
5152
|
+
onClick
|
|
5153
|
+
};
|
|
5154
|
+
}
|
|
5155
|
+
});
|
|
5156
|
+
const _hoisted_1$8 = ["title"];
|
|
5157
|
+
const _hoisted_2$6 = {
|
|
5158
|
+
key: 0,
|
|
5159
|
+
class: "icon-checked dao-option-checkmark"
|
|
5160
|
+
};
|
|
5161
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5162
|
+
return withDirectives((openBlock(), createElementBlock("li", {
|
|
5163
|
+
class: normalizeClass([
|
|
5164
|
+
"dao-option",
|
|
5165
|
+
{
|
|
5166
|
+
"dao-option-active": _ctx.isSelected,
|
|
5167
|
+
"dao-option-disabled": _ctx.disabled
|
|
5168
|
+
}
|
|
5169
|
+
]),
|
|
5170
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
5171
|
+
}, [
|
|
5172
|
+
createElementVNode("span", {
|
|
5173
|
+
title: String(_ctx.labelValue)
|
|
5174
|
+
}, [
|
|
5175
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
5176
|
+
createTextVNode(toDisplayString(_ctx.labelValue), 1)
|
|
5177
|
+
])
|
|
5178
|
+
], 8, _hoisted_1$8),
|
|
5179
|
+
_ctx.isSelected ? (openBlock(), createElementBlock("i", _hoisted_2$6)) : createCommentVNode("", true)
|
|
5180
|
+
], 2)), [
|
|
5181
|
+
[vShow, _ctx.visible]
|
|
5182
|
+
]);
|
|
5183
|
+
}
|
|
5184
|
+
var DaoOption = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$9]]);
|
|
5185
|
+
var pagination_vue_vue_type_style_index_0_lang = "";
|
|
5186
|
+
const numberAscSort = (a, b) => a - b;
|
|
5187
|
+
const _sfc_main$a = defineComponent({
|
|
5188
|
+
name: "DaoPagination",
|
|
5189
|
+
components: {
|
|
5190
|
+
DaoSelect,
|
|
5191
|
+
DaoOption
|
|
5192
|
+
},
|
|
5193
|
+
props: paginationProps,
|
|
5194
|
+
emits: [
|
|
5195
|
+
"update:page-size",
|
|
5196
|
+
"update:current-page",
|
|
5197
|
+
"next",
|
|
5198
|
+
"prev",
|
|
5199
|
+
"page-change",
|
|
5200
|
+
"size-change"
|
|
5201
|
+
],
|
|
5202
|
+
setup(props, { emit }) {
|
|
5203
|
+
const { currentPage } = toRefs(props);
|
|
5204
|
+
const currentShowPage = ref(currentPage.value);
|
|
5205
|
+
const totalText = computed(() => props.totalFormat(props.total));
|
|
5206
|
+
const totalPage = computed(() => Math.ceil(props.total / props.pageSize));
|
|
5207
|
+
const computedPageSizeOptions = computed(() => {
|
|
5208
|
+
if (!props.pageSizeOptions.length) {
|
|
5209
|
+
return [props.pageSize];
|
|
5210
|
+
}
|
|
5211
|
+
const filteredPageSizeOptions = props.pageSizeOptions.filter((i) => {
|
|
5212
|
+
const res = i > 0 && Math.floor(i) === i;
|
|
5213
|
+
return res;
|
|
5214
|
+
});
|
|
5215
|
+
if (props.pageSizeOptions.includes(props.pageSize)) {
|
|
5216
|
+
return [...filteredPageSizeOptions].sort(numberAscSort);
|
|
5217
|
+
}
|
|
5218
|
+
return [...filteredPageSizeOptions, props.pageSize].sort(numberAscSort);
|
|
5219
|
+
});
|
|
5220
|
+
const prevPage = () => {
|
|
5221
|
+
if (currentPage.value === 1) {
|
|
5222
|
+
return;
|
|
5223
|
+
}
|
|
5224
|
+
const curPage = currentPage.value - 1;
|
|
5225
|
+
emit("update:current-page", curPage);
|
|
5226
|
+
emit("prev", curPage);
|
|
5227
|
+
};
|
|
5228
|
+
const nextPage = () => {
|
|
5229
|
+
if (currentPage.value === totalPage.value) {
|
|
5230
|
+
return;
|
|
5231
|
+
}
|
|
5232
|
+
const curPage = currentPage.value + 1;
|
|
5233
|
+
emit("update:current-page", curPage);
|
|
5234
|
+
emit("next", curPage);
|
|
5235
|
+
};
|
|
5236
|
+
const targetPage = () => {
|
|
5237
|
+
let { value } = currentShowPage;
|
|
5238
|
+
if (!value) {
|
|
5239
|
+
currentShowPage.value = currentPage.value;
|
|
5240
|
+
return;
|
|
5241
|
+
}
|
|
5242
|
+
if (value > totalPage.value) {
|
|
5243
|
+
value = totalPage.value;
|
|
5244
|
+
}
|
|
5245
|
+
currentShowPage.value = value;
|
|
5246
|
+
emit("update:current-page", value);
|
|
5247
|
+
emit("page-change", value);
|
|
5248
|
+
};
|
|
5249
|
+
watch(currentPage, (val) => {
|
|
5250
|
+
currentShowPage.value = val;
|
|
5251
|
+
});
|
|
5252
|
+
watch(totalPage, (val) => {
|
|
5253
|
+
if (currentShowPage.value > val) {
|
|
5254
|
+
currentShowPage.value = val;
|
|
5255
|
+
emit("update:current-page", val);
|
|
5256
|
+
}
|
|
5257
|
+
});
|
|
5258
|
+
const updatePageSize = (val) => {
|
|
5259
|
+
currentShowPage.value = currentPage.value;
|
|
5260
|
+
emit("update:page-size", val);
|
|
5261
|
+
emit("size-change", val);
|
|
5262
|
+
};
|
|
5263
|
+
const currentShowPageFormat = () => {
|
|
5264
|
+
if (!currentShowPage.value) {
|
|
5265
|
+
return;
|
|
5266
|
+
}
|
|
5267
|
+
currentShowPage.value = parseInt(currentShowPage.value.toString().replace(/[^0-9]/g, ""), 10) || "";
|
|
5268
|
+
};
|
|
5269
|
+
return {
|
|
5270
|
+
currentShowPage,
|
|
5271
|
+
totalText,
|
|
5272
|
+
totalPage,
|
|
5273
|
+
computedPageSizeOptions,
|
|
5274
|
+
prevPage,
|
|
5275
|
+
nextPage,
|
|
5276
|
+
targetPage,
|
|
5277
|
+
updatePageSize,
|
|
5278
|
+
currentShowPageFormat
|
|
5279
|
+
};
|
|
5280
|
+
}
|
|
5281
|
+
});
|
|
5282
|
+
const _hoisted_1$7 = { class: "dao-pagination__total" };
|
|
5283
|
+
const _hoisted_2$5 = { class: "dao-pagination__pager" };
|
|
5284
|
+
const _hoisted_3$3 = ["disabled"];
|
|
5285
|
+
const _hoisted_4$2 = { class: "dao-pagination__pager-total" };
|
|
5286
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5287
|
+
const _component_dao_option = resolveComponent("dao-option");
|
|
5288
|
+
const _component_dao_select = resolveComponent("dao-select");
|
|
5289
|
+
return openBlock(), createElementBlock("div", {
|
|
5290
|
+
class: normalizeClass(["dao-pagination", { "dao-pagination--compact": _ctx.compact }])
|
|
5291
|
+
}, [
|
|
5292
|
+
createElementVNode("div", _hoisted_1$7, toDisplayString(_ctx.totalText), 1),
|
|
5293
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
5294
|
+
createElementVNode("i", {
|
|
5295
|
+
class: normalizeClass([
|
|
5296
|
+
"icon-arrow-previous",
|
|
5297
|
+
"dao-pagination__pager-prev",
|
|
5298
|
+
{ "dao-pagination__pager-icon--disabled": _ctx.currentPage === 1 }
|
|
5299
|
+
]),
|
|
5300
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.prevPage && _ctx.prevPage(...args))
|
|
5301
|
+
}, null, 2),
|
|
5302
|
+
withDirectives(createElementVNode("input", {
|
|
5303
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.currentShowPage = $event),
|
|
5304
|
+
class: "dao-pagination__pager-current",
|
|
5305
|
+
disabled: _ctx.totalPage === 1,
|
|
5306
|
+
onKeydown: _cache[2] || (_cache[2] = withKeys((...args) => _ctx.targetPage && _ctx.targetPage(...args), ["enter"])),
|
|
5307
|
+
onInput: _cache[3] || (_cache[3] = (...args) => _ctx.currentShowPageFormat && _ctx.currentShowPageFormat(...args))
|
|
5308
|
+
}, null, 40, _hoisted_3$3), [
|
|
5309
|
+
[vModelText, _ctx.currentShowPage]
|
|
5310
|
+
]),
|
|
5311
|
+
createElementVNode("span", _hoisted_4$2, " / " + toDisplayString(_ctx.totalPage), 1),
|
|
5312
|
+
createElementVNode("i", {
|
|
5313
|
+
class: normalizeClass([
|
|
5314
|
+
"icon-arrow-next",
|
|
5315
|
+
"dao-pagination__pager-next",
|
|
5316
|
+
{ "dao-pagination__pager-icon--disabled": _ctx.currentPage === _ctx.totalPage }
|
|
5317
|
+
]),
|
|
5318
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.nextPage && _ctx.nextPage(...args))
|
|
5319
|
+
}, null, 2)
|
|
5320
|
+
]),
|
|
5321
|
+
createVNode(_component_dao_select, {
|
|
5322
|
+
class: "dao-pagination__sizer",
|
|
5323
|
+
"model-value": _ctx.pageSize,
|
|
5324
|
+
size: "sm",
|
|
5325
|
+
style: normalizeStyle({ width: `${_ctx.pageSizerWidth}px` }),
|
|
5326
|
+
"menu-class": "dao-pagination__sizer-menu",
|
|
5327
|
+
onChange: _ctx.updatePageSize
|
|
5328
|
+
}, {
|
|
5329
|
+
default: withCtx(() => [
|
|
5330
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.computedPageSizeOptions, (size) => {
|
|
5331
|
+
return openBlock(), createBlock(_component_dao_option, {
|
|
5332
|
+
key: size,
|
|
5333
|
+
value: size,
|
|
5334
|
+
label: _ctx.pageFormat(size)
|
|
5335
|
+
}, null, 8, ["value", "label"]);
|
|
5336
|
+
}), 128))
|
|
5337
|
+
]),
|
|
5338
|
+
_: 1
|
|
5339
|
+
}, 8, ["model-value", "style", "onChange"])
|
|
5340
|
+
], 2);
|
|
5341
|
+
}
|
|
5342
|
+
var DaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$8]]);
|
|
5343
|
+
var popover_scss_vue_type_style_index_0_src_lang = "";
|
|
5344
|
+
const _sfc_main$9 = defineComponent(__spreadProps(__spreadValues({}, Popper), {
|
|
5345
|
+
name: "DaoPopover",
|
|
5346
|
+
props: PopperProps,
|
|
5347
|
+
daoPopperTheme: "dao-popover"
|
|
5348
|
+
}));
|
|
5349
|
+
var progress_vue_vue_type_style_index_0_lang = "";
|
|
5350
|
+
const _sfc_main$8 = defineComponent({
|
|
5351
|
+
name: "DaoProgress",
|
|
5352
|
+
props: {
|
|
5353
|
+
value: {
|
|
5354
|
+
type: Number,
|
|
5355
|
+
default: 0,
|
|
5356
|
+
validator: (val) => val >= 0 && val <= 100
|
|
5357
|
+
},
|
|
5358
|
+
bgColor: {
|
|
5359
|
+
type: String,
|
|
5360
|
+
default: "#ebeef5"
|
|
5361
|
+
},
|
|
5362
|
+
fill: {
|
|
5363
|
+
type: [Array, String],
|
|
5364
|
+
default: "#409eff"
|
|
5365
|
+
}
|
|
5366
|
+
},
|
|
5367
|
+
setup(props) {
|
|
5368
|
+
const { fill } = toRefs(props);
|
|
5369
|
+
const type = computed(() => typeof fill.value === "string" ? "line" : "stacked");
|
|
5370
|
+
const stackedStyles = computed(() => {
|
|
5371
|
+
if (Array.isArray(fill.value)) {
|
|
5372
|
+
return fill.value.map((fillColor) => {
|
|
5373
|
+
if (typeof fillColor === "string") {
|
|
5374
|
+
const stackedLen = fill.value.length;
|
|
5375
|
+
return {
|
|
5376
|
+
width: `${100 / stackedLen}%`,
|
|
5377
|
+
background: fillColor
|
|
5378
|
+
};
|
|
5379
|
+
}
|
|
5380
|
+
if (typeof fillColor === "object") {
|
|
5381
|
+
return {
|
|
5382
|
+
width: `${fillColor.percent}%`,
|
|
5383
|
+
background: fillColor.color
|
|
5384
|
+
};
|
|
5385
|
+
}
|
|
5386
|
+
return {};
|
|
5387
|
+
});
|
|
5388
|
+
}
|
|
5389
|
+
return [];
|
|
5390
|
+
});
|
|
5391
|
+
const stackedBgColor = computed(() => typeof fill.value === "string" ? fill.value : "");
|
|
5392
|
+
return {
|
|
5393
|
+
type,
|
|
5394
|
+
stackedStyles,
|
|
5395
|
+
stackedBgColor
|
|
5396
|
+
};
|
|
5397
|
+
}
|
|
5398
|
+
});
|
|
5399
|
+
const _hoisted_1$6 = { class: "dao-progress" };
|
|
5400
|
+
const _hoisted_2$4 = {
|
|
5401
|
+
key: 1,
|
|
5402
|
+
class: "dao-progress__stacked"
|
|
5403
|
+
};
|
|
5404
|
+
const _hoisted_3$2 = {
|
|
5405
|
+
key: 0,
|
|
5406
|
+
class: "dao-progress__text"
|
|
5407
|
+
};
|
|
5408
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5409
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
5410
|
+
createElementVNode("div", {
|
|
5411
|
+
class: "dao-progress__inner",
|
|
5412
|
+
style: normalizeStyle({ background: _ctx.bgColor })
|
|
5413
|
+
}, [
|
|
5414
|
+
_ctx.type === "line" ? (openBlock(), createElementBlock("div", {
|
|
5415
|
+
key: 0,
|
|
5416
|
+
class: "dao-progress__bar",
|
|
5417
|
+
style: normalizeStyle({ width: `${_ctx.value}%`, background: _ctx.stackedBgColor })
|
|
5418
|
+
}, null, 4)) : (openBlock(), createElementBlock("div", _hoisted_2$4, [
|
|
5419
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.stackedStyles, (stackedStyle, idx) => {
|
|
5420
|
+
return openBlock(), createElementBlock("div", {
|
|
5421
|
+
key: idx,
|
|
5422
|
+
class: "dao-progress__stacked-item",
|
|
5423
|
+
style: normalizeStyle(stackedStyle)
|
|
5424
|
+
}, null, 4);
|
|
5425
|
+
}), 128))
|
|
5426
|
+
]))
|
|
5427
|
+
], 4),
|
|
5428
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
|
|
5429
|
+
renderSlot(_ctx.$slots, "default")
|
|
5430
|
+
])) : createCommentVNode("", true)
|
|
5431
|
+
]);
|
|
5432
|
+
}
|
|
5433
|
+
var progress = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7]]);
|
|
5434
|
+
var radio_vue_vue_type_style_index_0_lang = "";
|
|
5435
|
+
const _sfc_main$7 = defineComponent({
|
|
5436
|
+
name: "DaoRadio",
|
|
5437
|
+
props: {
|
|
5438
|
+
modelValue: {
|
|
5439
|
+
type: [String, Number, Boolean],
|
|
5440
|
+
default: false
|
|
5441
|
+
},
|
|
5442
|
+
value: {
|
|
5443
|
+
type: [String, Number, Boolean],
|
|
5444
|
+
required: true,
|
|
5445
|
+
default: ""
|
|
5446
|
+
},
|
|
5447
|
+
label: {
|
|
5448
|
+
type: String,
|
|
5449
|
+
default: ""
|
|
5450
|
+
},
|
|
5451
|
+
disabled: {
|
|
5452
|
+
type: Boolean,
|
|
5453
|
+
default: false
|
|
5454
|
+
},
|
|
5455
|
+
name: {
|
|
5456
|
+
type: String,
|
|
5457
|
+
default: ""
|
|
5458
|
+
}
|
|
5459
|
+
},
|
|
5460
|
+
emits: ["update:modelValue", "change"],
|
|
5461
|
+
setup(props, { emit }) {
|
|
5462
|
+
const { value, disabled } = toRefs(props);
|
|
5463
|
+
const radioGroup2 = inject(radioGroupKey, void 0);
|
|
5464
|
+
const isGroup = computed(() => !!radioGroup2);
|
|
5465
|
+
const modelValue = computed(() => isGroup.value ? radioGroup2 == null ? void 0 : radioGroup2.modelValue : props.modelValue);
|
|
5466
|
+
const currentValue = ref(modelValue.value === value.value);
|
|
5467
|
+
const wrapClasses = computed(() => [
|
|
5468
|
+
"dao-radio-wrapper",
|
|
5469
|
+
{
|
|
5470
|
+
"dao-radio-wrapper--disabled": disabled.value
|
|
5471
|
+
}
|
|
5472
|
+
]);
|
|
5473
|
+
const radioClasses = computed(() => [
|
|
5474
|
+
"dao-radio",
|
|
5475
|
+
{
|
|
5476
|
+
"dao-radio--checked": currentValue.value,
|
|
5477
|
+
"dao-radio--disabled": disabled.value
|
|
5478
|
+
}
|
|
5479
|
+
]);
|
|
5480
|
+
const change = (event) => {
|
|
5481
|
+
if (disabled.value) {
|
|
5482
|
+
return;
|
|
5483
|
+
}
|
|
5484
|
+
const { checked } = event.target;
|
|
5485
|
+
currentValue.value = checked;
|
|
5486
|
+
if (isGroup.value) {
|
|
5487
|
+
radioGroup2 == null ? void 0 : radioGroup2.changeEvent(value.value);
|
|
5488
|
+
} else {
|
|
5489
|
+
emit("update:modelValue", value.value);
|
|
5490
|
+
emit("change", value.value);
|
|
5491
|
+
}
|
|
5492
|
+
};
|
|
5493
|
+
const updateValue = () => {
|
|
5494
|
+
currentValue.value = modelValue.value === value.value;
|
|
5495
|
+
};
|
|
5496
|
+
watch(modelValue, () => updateValue());
|
|
5497
|
+
return {
|
|
5498
|
+
currentValue,
|
|
5499
|
+
wrapClasses,
|
|
5500
|
+
radioClasses,
|
|
5501
|
+
change
|
|
5502
|
+
};
|
|
5503
|
+
}
|
|
5504
|
+
});
|
|
5505
|
+
const _hoisted_1$5 = ["disabled", "name", "checked"];
|
|
5506
|
+
const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("span", { class: "dao-radio-inner" }, null, -1);
|
|
5507
|
+
const _hoisted_3$1 = {
|
|
5508
|
+
key: 0,
|
|
5509
|
+
class: "dao-radio__label-wrapper"
|
|
5510
|
+
};
|
|
5511
|
+
const _hoisted_4$1 = {
|
|
5512
|
+
key: 0,
|
|
5513
|
+
class: "dao-radio__label"
|
|
5514
|
+
};
|
|
5515
|
+
const _hoisted_5$1 = {
|
|
5516
|
+
key: 1,
|
|
5517
|
+
class: "dao-radio__help"
|
|
5518
|
+
};
|
|
5519
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5520
|
+
return openBlock(), createElementBlock("label", {
|
|
5521
|
+
class: normalizeClass(_ctx.wrapClasses)
|
|
5522
|
+
}, [
|
|
5523
|
+
createElementVNode("span", {
|
|
5524
|
+
class: normalizeClass(_ctx.radioClasses)
|
|
5525
|
+
}, [
|
|
5526
|
+
createElementVNode("input", {
|
|
5527
|
+
type: "radio",
|
|
5528
|
+
class: "dao-radio-input",
|
|
5529
|
+
disabled: _ctx.disabled,
|
|
5530
|
+
name: _ctx.name,
|
|
5531
|
+
checked: _ctx.currentValue,
|
|
5532
|
+
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.change && _ctx.change(...args))
|
|
5533
|
+
}, null, 40, _hoisted_1$5),
|
|
5534
|
+
_hoisted_2$3
|
|
5535
|
+
], 2),
|
|
5536
|
+
_ctx.$slots.default || _ctx.label || _ctx.$slots.helper ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
5537
|
+
_ctx.$slots.default || _ctx.label ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
5538
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
5539
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
5540
|
+
])
|
|
5541
|
+
])) : createCommentVNode("", true),
|
|
5542
|
+
_ctx.$slots.helper ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
|
|
5543
|
+
renderSlot(_ctx.$slots, "helper")
|
|
5544
|
+
])) : createCommentVNode("", true)
|
|
5545
|
+
])) : createCommentVNode("", true)
|
|
5546
|
+
], 2);
|
|
5547
|
+
}
|
|
5548
|
+
var radio = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6]]);
|
|
5549
|
+
var radioGroup_vue_vue_type_style_index_0_lang = "";
|
|
5550
|
+
const _sfc_main$6 = defineComponent({
|
|
5551
|
+
name: "DaoRadioGroup",
|
|
5552
|
+
props: {
|
|
5553
|
+
modelValue: {
|
|
5554
|
+
type: [String, Number, Boolean],
|
|
5555
|
+
default: false
|
|
5556
|
+
},
|
|
5557
|
+
vertical: {
|
|
5558
|
+
type: Boolean,
|
|
5559
|
+
default: true
|
|
5560
|
+
}
|
|
5561
|
+
},
|
|
5562
|
+
emits: ["update:modelValue", "change"],
|
|
5563
|
+
setup(props, { emit }) {
|
|
5564
|
+
const { vertical } = toRefs(props);
|
|
5565
|
+
const radioGroupClasses = computed(() => [
|
|
5566
|
+
"dao-radio-group",
|
|
5567
|
+
{
|
|
5568
|
+
"dao-radio-group--vertical": vertical.value,
|
|
5569
|
+
"dao-radio-group--horizontal": !vertical.value
|
|
5570
|
+
}
|
|
5571
|
+
]);
|
|
5572
|
+
const changeEvent = (val) => {
|
|
5573
|
+
emit("update:modelValue", val);
|
|
5574
|
+
emit("change", val);
|
|
5575
|
+
};
|
|
5576
|
+
provide(radioGroupKey, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
|
|
5577
|
+
changeEvent
|
|
5578
|
+
})));
|
|
3825
5579
|
return {
|
|
3826
|
-
|
|
3827
|
-
labelValue,
|
|
3828
|
-
isSelected,
|
|
3829
|
-
onClick
|
|
5580
|
+
radioGroupClasses
|
|
3830
5581
|
};
|
|
3831
5582
|
}
|
|
3832
5583
|
});
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
class: "icon-checked dao-option-checkmark"
|
|
3837
|
-
};
|
|
3838
|
-
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3839
|
-
return withDirectives((openBlock(), createElementBlock("li", {
|
|
3840
|
-
class: normalizeClass([
|
|
3841
|
-
"dao-option",
|
|
3842
|
-
{
|
|
3843
|
-
"dao-option-active": _ctx.isSelected,
|
|
3844
|
-
"dao-option-disabled": _ctx.disabled
|
|
3845
|
-
}
|
|
3846
|
-
]),
|
|
3847
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
5584
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5585
|
+
return openBlock(), createElementBlock("div", {
|
|
5586
|
+
class: normalizeClass(_ctx.radioGroupClasses)
|
|
3848
5587
|
}, [
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
}, [
|
|
3852
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
3853
|
-
createTextVNode(toDisplayString(_ctx.labelValue), 1)
|
|
3854
|
-
])
|
|
3855
|
-
], 8, _hoisted_1$6),
|
|
3856
|
-
_ctx.isSelected ? (openBlock(), createElementBlock("i", _hoisted_2$4)) : createCommentVNode("", true)
|
|
3857
|
-
], 2)), [
|
|
3858
|
-
[vShow, _ctx.visible]
|
|
3859
|
-
]);
|
|
5588
|
+
renderSlot(_ctx.$slots, "default")
|
|
5589
|
+
], 2);
|
|
3860
5590
|
}
|
|
3861
|
-
var
|
|
5591
|
+
var radioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
|
|
3862
5592
|
var switch_vue_vue_type_style_index_0_lang = "";
|
|
3863
|
-
const _sfc_main$
|
|
5593
|
+
const _sfc_main$5 = defineComponent({
|
|
3864
5594
|
name: "DaoSwitch",
|
|
3865
5595
|
props: {
|
|
3866
5596
|
modelValue: {
|
|
@@ -3915,12 +5645,12 @@ const _sfc_main$6 = defineComponent({
|
|
|
3915
5645
|
};
|
|
3916
5646
|
}
|
|
3917
5647
|
});
|
|
3918
|
-
const _hoisted_1$
|
|
3919
|
-
const _hoisted_2$
|
|
5648
|
+
const _hoisted_1$4 = ["value", "name", "disabled"];
|
|
5649
|
+
const _hoisted_2$2 = {
|
|
3920
5650
|
key: 0,
|
|
3921
5651
|
class: "dao-switch__label"
|
|
3922
5652
|
};
|
|
3923
|
-
function _sfc_render$
|
|
5653
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3924
5654
|
return openBlock(), createElementBlock("div", {
|
|
3925
5655
|
class: normalizeClass(["dao-switch", { "dao-switch--disabled": _ctx.disabled, "dao-switch--size-sm": _ctx.size === "sm" }]),
|
|
3926
5656
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.toggle && _ctx.toggle(...args))
|
|
@@ -3931,16 +5661,16 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3931
5661
|
value: _ctx.currentValue,
|
|
3932
5662
|
name: _ctx.name,
|
|
3933
5663
|
disabled: _ctx.disabled
|
|
3934
|
-
}, null, 8, _hoisted_1$
|
|
5664
|
+
}, null, 8, _hoisted_1$4),
|
|
3935
5665
|
createElementVNode("span", {
|
|
3936
5666
|
class: normalizeClass(["dao-switch__pill", { "dao-switch-checked": _ctx.currentValue }])
|
|
3937
5667
|
}, null, 2),
|
|
3938
|
-
_ctx.showText ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
5668
|
+
_ctx.showText ? (openBlock(), createElementBlock("span", _hoisted_2$2, toDisplayString(_ctx.currentValue ? _ctx.textOn : _ctx.textOff), 1)) : createCommentVNode("", true)
|
|
3939
5669
|
], 2);
|
|
3940
5670
|
}
|
|
3941
|
-
var _switch = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5671
|
+
var _switch = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
|
|
3942
5672
|
var resizer_vue_vue_type_style_index_0_lang = "";
|
|
3943
|
-
const _sfc_main$
|
|
5673
|
+
const _sfc_main$4 = defineComponent({
|
|
3944
5674
|
name: "DaoResizer",
|
|
3945
5675
|
props: {
|
|
3946
5676
|
column: {
|
|
@@ -3987,9 +5717,9 @@ const _sfc_main$5 = defineComponent({
|
|
|
3987
5717
|
};
|
|
3988
5718
|
}
|
|
3989
5719
|
});
|
|
3990
|
-
const _hoisted_1$
|
|
3991
|
-
function _sfc_render$
|
|
3992
|
-
return openBlock(), createElementBlock("span", _hoisted_1$
|
|
5720
|
+
const _hoisted_1$3 = { class: "dao-table-resizer-separator" };
|
|
5721
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5722
|
+
return openBlock(), createElementBlock("span", _hoisted_1$3, [
|
|
3993
5723
|
!_ctx.disabled ? (openBlock(), createElementBlock("span", {
|
|
3994
5724
|
key: 0,
|
|
3995
5725
|
class: "dao-table-resizer-handle",
|
|
@@ -3999,202 +5729,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3999
5729
|
}, null, 32)) : createCommentVNode("", true)
|
|
4000
5730
|
]);
|
|
4001
5731
|
}
|
|
4002
|
-
var DaoResizer = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4003
|
-
const paginationProps = {
|
|
4004
|
-
pageSize: {
|
|
4005
|
-
type: Number,
|
|
4006
|
-
required: true,
|
|
4007
|
-
default: 10,
|
|
4008
|
-
validator: (val) => val > 0 && Math.floor(val) === val
|
|
4009
|
-
},
|
|
4010
|
-
pageSizeOptions: {
|
|
4011
|
-
type: Array,
|
|
4012
|
-
default: () => []
|
|
4013
|
-
},
|
|
4014
|
-
pageFormat: {
|
|
4015
|
-
type: Function,
|
|
4016
|
-
default: (val) => `${val} per page`
|
|
4017
|
-
},
|
|
4018
|
-
compact: {
|
|
4019
|
-
type: Boolean,
|
|
4020
|
-
default: false
|
|
4021
|
-
},
|
|
4022
|
-
total: {
|
|
4023
|
-
type: Number,
|
|
4024
|
-
required: true,
|
|
4025
|
-
default: 0
|
|
4026
|
-
},
|
|
4027
|
-
totalFormat: {
|
|
4028
|
-
type: Function,
|
|
4029
|
-
default: (val) => `Total ${val} ${val === 1 ? "record" : "records"}`
|
|
4030
|
-
},
|
|
4031
|
-
currentPage: {
|
|
4032
|
-
type: Number,
|
|
4033
|
-
default: 1
|
|
4034
|
-
},
|
|
4035
|
-
pageSizerWidth: {
|
|
4036
|
-
type: Number,
|
|
4037
|
-
default: 110
|
|
4038
|
-
}
|
|
4039
|
-
};
|
|
4040
|
-
var pagination_vue_vue_type_style_index_0_lang = "";
|
|
4041
|
-
const numberAscSort = (a, b) => a - b;
|
|
4042
|
-
const _sfc_main$4 = defineComponent({
|
|
4043
|
-
name: "DaoPagination",
|
|
4044
|
-
components: {
|
|
4045
|
-
DaoSelect,
|
|
4046
|
-
DaoOption
|
|
4047
|
-
},
|
|
4048
|
-
props: paginationProps,
|
|
4049
|
-
emits: [
|
|
4050
|
-
"update:page-size",
|
|
4051
|
-
"update:current-page",
|
|
4052
|
-
"next",
|
|
4053
|
-
"prev",
|
|
4054
|
-
"page-change",
|
|
4055
|
-
"size-change"
|
|
4056
|
-
],
|
|
4057
|
-
setup(props, { emit }) {
|
|
4058
|
-
const { currentPage } = toRefs(props);
|
|
4059
|
-
const currentShowPage = ref(currentPage.value);
|
|
4060
|
-
const totalText = computed(() => props.totalFormat(props.total));
|
|
4061
|
-
const totalPage = computed(() => Math.ceil(props.total / props.pageSize));
|
|
4062
|
-
const computedPageSizeOptions = computed(() => {
|
|
4063
|
-
if (!props.pageSizeOptions.length) {
|
|
4064
|
-
return [props.pageSize];
|
|
4065
|
-
}
|
|
4066
|
-
const filteredPageSizeOptions = props.pageSizeOptions.filter((i) => {
|
|
4067
|
-
const res = i > 0 && Math.floor(i) === i;
|
|
4068
|
-
return res;
|
|
4069
|
-
});
|
|
4070
|
-
if (props.pageSizeOptions.includes(props.pageSize)) {
|
|
4071
|
-
return [...filteredPageSizeOptions].sort(numberAscSort);
|
|
4072
|
-
}
|
|
4073
|
-
return [...filteredPageSizeOptions, props.pageSize].sort(numberAscSort);
|
|
4074
|
-
});
|
|
4075
|
-
const prevPage = () => {
|
|
4076
|
-
if (currentPage.value === 1) {
|
|
4077
|
-
return;
|
|
4078
|
-
}
|
|
4079
|
-
const curPage = currentPage.value - 1;
|
|
4080
|
-
emit("update:current-page", curPage);
|
|
4081
|
-
emit("prev", curPage);
|
|
4082
|
-
};
|
|
4083
|
-
const nextPage = () => {
|
|
4084
|
-
if (currentPage.value === totalPage.value) {
|
|
4085
|
-
return;
|
|
4086
|
-
}
|
|
4087
|
-
const curPage = currentPage.value + 1;
|
|
4088
|
-
emit("update:current-page", curPage);
|
|
4089
|
-
emit("next", curPage);
|
|
4090
|
-
};
|
|
4091
|
-
const targetPage = () => {
|
|
4092
|
-
let { value } = currentShowPage;
|
|
4093
|
-
if (!value) {
|
|
4094
|
-
currentShowPage.value = currentPage.value;
|
|
4095
|
-
return;
|
|
4096
|
-
}
|
|
4097
|
-
if (value > totalPage.value) {
|
|
4098
|
-
value = totalPage.value;
|
|
4099
|
-
}
|
|
4100
|
-
currentShowPage.value = value;
|
|
4101
|
-
emit("update:current-page", value);
|
|
4102
|
-
emit("page-change", value);
|
|
4103
|
-
};
|
|
4104
|
-
watch(currentPage, (val) => {
|
|
4105
|
-
currentShowPage.value = val;
|
|
4106
|
-
});
|
|
4107
|
-
watch(totalPage, (val) => {
|
|
4108
|
-
if (currentShowPage.value > val) {
|
|
4109
|
-
currentShowPage.value = val;
|
|
4110
|
-
emit("update:current-page", val);
|
|
4111
|
-
}
|
|
4112
|
-
});
|
|
4113
|
-
const updatePageSize = (val) => {
|
|
4114
|
-
currentShowPage.value = currentPage.value;
|
|
4115
|
-
emit("update:page-size", val);
|
|
4116
|
-
emit("size-change", val);
|
|
4117
|
-
};
|
|
4118
|
-
const currentShowPageFormat = () => {
|
|
4119
|
-
if (!currentShowPage.value) {
|
|
4120
|
-
return;
|
|
4121
|
-
}
|
|
4122
|
-
currentShowPage.value = parseInt(currentShowPage.value.toString().replace(/[^0-9]/g, ""), 10) || "";
|
|
4123
|
-
};
|
|
4124
|
-
return {
|
|
4125
|
-
currentShowPage,
|
|
4126
|
-
totalText,
|
|
4127
|
-
totalPage,
|
|
4128
|
-
computedPageSizeOptions,
|
|
4129
|
-
prevPage,
|
|
4130
|
-
nextPage,
|
|
4131
|
-
targetPage,
|
|
4132
|
-
updatePageSize,
|
|
4133
|
-
currentShowPageFormat
|
|
4134
|
-
};
|
|
4135
|
-
}
|
|
4136
|
-
});
|
|
4137
|
-
const _hoisted_1$3 = { class: "dao-pagination__total" };
|
|
4138
|
-
const _hoisted_2$2 = { class: "dao-pagination__pager" };
|
|
4139
|
-
const _hoisted_3$1 = ["disabled"];
|
|
4140
|
-
const _hoisted_4$1 = { class: "dao-pagination__pager-total" };
|
|
4141
|
-
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4142
|
-
const _component_dao_option = resolveComponent("dao-option");
|
|
4143
|
-
const _component_dao_select = resolveComponent("dao-select");
|
|
4144
|
-
return openBlock(), createElementBlock("div", {
|
|
4145
|
-
class: normalizeClass(["dao-pagination", { "dao-pagination--compact": _ctx.compact }])
|
|
4146
|
-
}, [
|
|
4147
|
-
createElementVNode("div", _hoisted_1$3, toDisplayString(_ctx.totalText), 1),
|
|
4148
|
-
createElementVNode("div", _hoisted_2$2, [
|
|
4149
|
-
createElementVNode("i", {
|
|
4150
|
-
class: normalizeClass([
|
|
4151
|
-
"icon-arrow-previous",
|
|
4152
|
-
"dao-pagination__pager-prev",
|
|
4153
|
-
{ "dao-pagination__pager-icon--disabled": _ctx.currentPage === 1 }
|
|
4154
|
-
]),
|
|
4155
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.prevPage && _ctx.prevPage(...args))
|
|
4156
|
-
}, null, 2),
|
|
4157
|
-
withDirectives(createElementVNode("input", {
|
|
4158
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.currentShowPage = $event),
|
|
4159
|
-
class: "dao-pagination__pager-current",
|
|
4160
|
-
disabled: _ctx.totalPage === 1,
|
|
4161
|
-
onKeydown: _cache[2] || (_cache[2] = withKeys((...args) => _ctx.targetPage && _ctx.targetPage(...args), ["enter"])),
|
|
4162
|
-
onInput: _cache[3] || (_cache[3] = (...args) => _ctx.currentShowPageFormat && _ctx.currentShowPageFormat(...args))
|
|
4163
|
-
}, null, 40, _hoisted_3$1), [
|
|
4164
|
-
[vModelText, _ctx.currentShowPage]
|
|
4165
|
-
]),
|
|
4166
|
-
createElementVNode("span", _hoisted_4$1, " / " + toDisplayString(_ctx.totalPage), 1),
|
|
4167
|
-
createElementVNode("i", {
|
|
4168
|
-
class: normalizeClass([
|
|
4169
|
-
"icon-arrow-next",
|
|
4170
|
-
"dao-pagination__pager-next",
|
|
4171
|
-
{ "dao-pagination__pager-icon--disabled": _ctx.currentPage === _ctx.totalPage }
|
|
4172
|
-
]),
|
|
4173
|
-
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.nextPage && _ctx.nextPage(...args))
|
|
4174
|
-
}, null, 2)
|
|
4175
|
-
]),
|
|
4176
|
-
createVNode(_component_dao_select, {
|
|
4177
|
-
class: "dao-pagination__sizer",
|
|
4178
|
-
"model-value": _ctx.pageSize,
|
|
4179
|
-
size: "sm",
|
|
4180
|
-
style: normalizeStyle({ width: `${_ctx.pageSizerWidth}px` }),
|
|
4181
|
-
"menu-class": "dao-pagination__sizer-menu",
|
|
4182
|
-
onChange: _ctx.updatePageSize
|
|
4183
|
-
}, {
|
|
4184
|
-
default: withCtx(() => [
|
|
4185
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.computedPageSizeOptions, (size) => {
|
|
4186
|
-
return openBlock(), createBlock(_component_dao_option, {
|
|
4187
|
-
key: size,
|
|
4188
|
-
value: size,
|
|
4189
|
-
label: _ctx.pageFormat(size)
|
|
4190
|
-
}, null, 8, ["value", "label"]);
|
|
4191
|
-
}), 128))
|
|
4192
|
-
]),
|
|
4193
|
-
_: 1
|
|
4194
|
-
}, 8, ["model-value", "style", "onChange"])
|
|
4195
|
-
], 2);
|
|
4196
|
-
}
|
|
4197
|
-
var DaoPagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
|
|
5732
|
+
var DaoResizer = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
|
|
4198
5733
|
const tableProps = {
|
|
4199
5734
|
id: {
|
|
4200
5735
|
type: String,
|
|
@@ -4287,7 +5822,8 @@ const _sfc_main$3 = defineComponent({
|
|
|
4287
5822
|
"next",
|
|
4288
5823
|
"prev",
|
|
4289
5824
|
"pageChange",
|
|
4290
|
-
"sizeChange"
|
|
5825
|
+
"sizeChange",
|
|
5826
|
+
"row-click"
|
|
4291
5827
|
],
|
|
4292
5828
|
setup(props, { emit }) {
|
|
4293
5829
|
const tableId = computed(() => `DAO_TABLE_${props.id}`);
|
|
@@ -4298,8 +5834,8 @@ const _sfc_main$3 = defineComponent({
|
|
|
4298
5834
|
const expandedRows = reactive(new WeakSet());
|
|
4299
5835
|
const columnRefs = reactive({});
|
|
4300
5836
|
const columns = reactive([]);
|
|
4301
|
-
const currentPage =
|
|
4302
|
-
const pageSize =
|
|
5837
|
+
const currentPage = toRef(props, "currentPage");
|
|
5838
|
+
const pageSize = toRef(props, "pageSize");
|
|
4303
5839
|
const tableScroll = ref();
|
|
4304
5840
|
const global = reactive({
|
|
4305
5841
|
checked: false,
|
|
@@ -4338,6 +5874,7 @@ const _sfc_main$3 = defineComponent({
|
|
|
4338
5874
|
}, {});
|
|
4339
5875
|
}
|
|
4340
5876
|
const init = () => {
|
|
5877
|
+
columns.length = 0;
|
|
4341
5878
|
props.columns.forEach((column) => {
|
|
4342
5879
|
columns.push(__spreadValues(__spreadValues({}, defaultColumnConfig), column));
|
|
4343
5880
|
});
|
|
@@ -4364,7 +5901,6 @@ const _sfc_main$3 = defineComponent({
|
|
|
4364
5901
|
});
|
|
4365
5902
|
}
|
|
4366
5903
|
};
|
|
4367
|
-
init();
|
|
4368
5904
|
const columnStyle = (id) => {
|
|
4369
5905
|
const setting = tableSetting[id];
|
|
4370
5906
|
const { width } = setting;
|
|
@@ -4409,9 +5945,9 @@ const _sfc_main$3 = defineComponent({
|
|
|
4409
5945
|
const isRowSelected = (row) => selectedRows.has(row);
|
|
4410
5946
|
const toggleExpand = (row, rowIndex) => {
|
|
4411
5947
|
expandedRows.add(row);
|
|
4412
|
-
const
|
|
4413
|
-
if (
|
|
4414
|
-
expandRows.splice(
|
|
5948
|
+
const index2 = expandRows.indexOf(row);
|
|
5949
|
+
if (index2 > -1) {
|
|
5950
|
+
expandRows.splice(index2, 1);
|
|
4415
5951
|
emit("expandToggle", row, rowIndex, false);
|
|
4416
5952
|
} else {
|
|
4417
5953
|
expandRows.push(row);
|
|
@@ -4456,6 +5992,10 @@ const _sfc_main$3 = defineComponent({
|
|
|
4456
5992
|
clearExpansion();
|
|
4457
5993
|
clearSelection();
|
|
4458
5994
|
};
|
|
5995
|
+
init();
|
|
5996
|
+
watch(() => props.columns, () => {
|
|
5997
|
+
init();
|
|
5998
|
+
}, { deep: true });
|
|
4459
5999
|
watch(currentPage, (val) => {
|
|
4460
6000
|
emit("update:current-page", val);
|
|
4461
6001
|
});
|
|
@@ -4510,6 +6050,9 @@ const _sfc_main$3 = defineComponent({
|
|
|
4510
6050
|
onUnmounted(() => {
|
|
4511
6051
|
window.removeEventListener("resize", windowResize);
|
|
4512
6052
|
});
|
|
6053
|
+
function onRowClick(row, rowIndex) {
|
|
6054
|
+
emit("row-click", row, rowIndex);
|
|
6055
|
+
}
|
|
4513
6056
|
return {
|
|
4514
6057
|
columns,
|
|
4515
6058
|
filterColumns,
|
|
@@ -4532,7 +6075,8 @@ const _sfc_main$3 = defineComponent({
|
|
|
4532
6075
|
clearState,
|
|
4533
6076
|
global,
|
|
4534
6077
|
tableScroll,
|
|
4535
|
-
expandedRows
|
|
6078
|
+
expandedRows,
|
|
6079
|
+
onRowClick
|
|
4536
6080
|
};
|
|
4537
6081
|
}
|
|
4538
6082
|
});
|
|
@@ -4554,20 +6098,21 @@ const _hoisted_6 = {
|
|
|
4554
6098
|
const _hoisted_7 = ["onClick"];
|
|
4555
6099
|
const _hoisted_8 = { class: "dao-table-th__content" };
|
|
4556
6100
|
const _hoisted_9 = { class: "dao-table-tbody" };
|
|
4557
|
-
const _hoisted_10 =
|
|
6101
|
+
const _hoisted_10 = ["onClick"];
|
|
6102
|
+
const _hoisted_11 = {
|
|
4558
6103
|
key: 0,
|
|
4559
6104
|
class: "dao-table-td"
|
|
4560
6105
|
};
|
|
4561
|
-
const
|
|
6106
|
+
const _hoisted_12 = {
|
|
4562
6107
|
key: 1,
|
|
4563
6108
|
class: "dao-table-td"
|
|
4564
6109
|
};
|
|
4565
|
-
const
|
|
4566
|
-
const
|
|
6110
|
+
const _hoisted_13 = ["onClick"];
|
|
6111
|
+
const _hoisted_14 = {
|
|
4567
6112
|
key: 0,
|
|
4568
6113
|
class: "dao-table-tr-expand"
|
|
4569
6114
|
};
|
|
4570
|
-
const
|
|
6115
|
+
const _hoisted_15 = { class: "dao-table-pagination" };
|
|
4571
6116
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4572
6117
|
const _component_dao_checkbox = resolveComponent("dao-checkbox");
|
|
4573
6118
|
const _component_dao_resizer = resolveComponent("dao-resizer");
|
|
@@ -4620,22 +6165,23 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4620
6165
|
])
|
|
4621
6166
|
])) : createCommentVNode("", true),
|
|
4622
6167
|
createElementVNode("tbody", _hoisted_9, [
|
|
4623
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (row,
|
|
4624
|
-
return openBlock(), createElementBlock(Fragment, { key:
|
|
6168
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (row, index2) => {
|
|
6169
|
+
return openBlock(), createElementBlock(Fragment, { key: index2 }, [
|
|
4625
6170
|
createElementVNode("tr", {
|
|
4626
|
-
class: normalizeClass(["dao-table-tr", { "dao-table-tr--expandable-open": _ctx.expandable && _ctx.isRowExpanded(row) }])
|
|
6171
|
+
class: normalizeClass(["dao-table-tr", { "dao-table-tr--expandable-open": _ctx.expandable && _ctx.isRowExpanded(row) }]),
|
|
6172
|
+
onClick: ($event) => _ctx.onRowClick(row, index2)
|
|
4627
6173
|
}, [
|
|
4628
|
-
_ctx.selectable ? (openBlock(), createElementBlock("td",
|
|
6174
|
+
_ctx.selectable ? (openBlock(), createElementBlock("td", _hoisted_11, [
|
|
4629
6175
|
createVNode(_component_dao_checkbox, {
|
|
4630
6176
|
checked: _ctx.isRowSelected(row),
|
|
4631
6177
|
onChange: ($event) => _ctx.toggleSelected(row)
|
|
4632
6178
|
}, null, 8, ["checked", "onChange"])
|
|
4633
6179
|
])) : createCommentVNode("", true),
|
|
4634
|
-
_ctx.expandable ? (openBlock(), createElementBlock("td",
|
|
6180
|
+
_ctx.expandable ? (openBlock(), createElementBlock("td", _hoisted_12, [
|
|
4635
6181
|
createElementVNode("i", {
|
|
4636
6182
|
class: "dao-table-expand-toggle icon-arrow-sharp",
|
|
4637
|
-
onClick: ($event) => _ctx.toggleExpand(row,
|
|
4638
|
-
}, null, 8,
|
|
6183
|
+
onClick: ($event) => _ctx.toggleExpand(row, index2)
|
|
6184
|
+
}, null, 8, _hoisted_13)
|
|
4639
6185
|
])) : createCommentVNode("", true),
|
|
4640
6186
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filterColumns, (column) => {
|
|
4641
6187
|
return openBlock(), createElementBlock("td", {
|
|
@@ -4646,15 +6192,17 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4646
6192
|
renderSlot(_ctx.$slots, `td-${column.id}`, {
|
|
4647
6193
|
value: row[column.id],
|
|
4648
6194
|
row,
|
|
4649
|
-
rowIndex:
|
|
4650
|
-
})
|
|
6195
|
+
rowIndex: index2
|
|
6196
|
+
}, () => [
|
|
6197
|
+
createElementVNode("span", null, toDisplayString(row[column.id]), 1)
|
|
6198
|
+
])
|
|
4651
6199
|
], 4);
|
|
4652
6200
|
}), 128))
|
|
4653
|
-
],
|
|
4654
|
-
_ctx.expandable && _ctx.expandedRows.has(row) ? withDirectives((openBlock(), createElementBlock("tr",
|
|
6201
|
+
], 10, _hoisted_10),
|
|
6202
|
+
_ctx.expandable && _ctx.expandedRows.has(row) ? withDirectives((openBlock(), createElementBlock("tr", _hoisted_14, [
|
|
4655
6203
|
renderSlot(_ctx.$slots, "expand", {
|
|
4656
6204
|
row,
|
|
4657
|
-
rowIndex:
|
|
6205
|
+
rowIndex: index2
|
|
4658
6206
|
})
|
|
4659
6207
|
], 512)), [
|
|
4660
6208
|
[vShow, _ctx.isRowExpanded(row)]
|
|
@@ -4664,7 +6212,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4664
6212
|
])
|
|
4665
6213
|
])
|
|
4666
6214
|
], 2),
|
|
4667
|
-
createElementVNode("div",
|
|
6215
|
+
createElementVNode("div", _hoisted_15, [
|
|
4668
6216
|
renderSlot(_ctx.$slots, "pagination", {}, () => [
|
|
4669
6217
|
createVNode(_component_dao_pagination, {
|
|
4670
6218
|
"current-page": _ctx.currentPage,
|
|
@@ -4790,7 +6338,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
4790
6338
|
}
|
|
4791
6339
|
emit("click", event, value);
|
|
4792
6340
|
};
|
|
4793
|
-
const tabsLi = computed(() => props.tabList.map((tab,
|
|
6341
|
+
const tabsLi = computed(() => props.tabList.map((tab, index2) => {
|
|
4794
6342
|
const { label } = tab;
|
|
4795
6343
|
const isNotString = typeof label !== "string";
|
|
4796
6344
|
const isActive = tab.value === props.currentTab;
|
|
@@ -4804,7 +6352,7 @@ const _sfc_main$2 = defineComponent({
|
|
|
4804
6352
|
"dao-tab-nav-item--disabled": tab.disabled
|
|
4805
6353
|
},
|
|
4806
6354
|
ref: hasActiveLine ? activeTab : void 0,
|
|
4807
|
-
key:
|
|
6355
|
+
key: index2,
|
|
4808
6356
|
onClick: (event) => handleClick(event, tab),
|
|
4809
6357
|
onMouseenter: hasHoverLine ? onMouseenter : void 0,
|
|
4810
6358
|
onMouseleave: hasHoverLine ? onMouseleave : void 0
|
|
@@ -4830,7 +6378,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
4830
6378
|
type: {
|
|
4831
6379
|
type: String,
|
|
4832
6380
|
default: "card",
|
|
4833
|
-
validator: (value) => ["card", "line"].includes(value)
|
|
6381
|
+
validator: (value) => ["card", "line", "pill"].includes(value)
|
|
4834
6382
|
},
|
|
4835
6383
|
direction: {
|
|
4836
6384
|
type: String,
|
|
@@ -4872,16 +6420,16 @@ const _sfc_main$1 = defineComponent({
|
|
|
4872
6420
|
if (!child.value) {
|
|
4873
6421
|
return;
|
|
4874
6422
|
}
|
|
4875
|
-
const
|
|
4876
|
-
if (
|
|
4877
|
-
tabList.splice(
|
|
6423
|
+
const index2 = Array.from(((_a = tabBody.value) == null ? void 0 : _a.children) || []).indexOf(child.value);
|
|
6424
|
+
if (index2 > -1) {
|
|
6425
|
+
tabList.splice(index2, 0, tab);
|
|
4878
6426
|
}
|
|
4879
6427
|
};
|
|
4880
6428
|
provide(addTabFnKey, addTab);
|
|
4881
6429
|
const removeTab = (tab) => {
|
|
4882
|
-
const
|
|
4883
|
-
if (
|
|
4884
|
-
tabList.splice(
|
|
6430
|
+
const index2 = tabList.indexOf(tab);
|
|
6431
|
+
if (index2 > -1) {
|
|
6432
|
+
tabList.splice(index2, 1);
|
|
4885
6433
|
}
|
|
4886
6434
|
};
|
|
4887
6435
|
provide(removeTabFnKey, removeTab);
|
|
@@ -4960,23 +6508,38 @@ var tabItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
|
4960
6508
|
var components = /* @__PURE__ */ Object.freeze({
|
|
4961
6509
|
__proto__: null,
|
|
4962
6510
|
[Symbol.toStringTag]: "Module",
|
|
6511
|
+
ActionIcon: DaoActionIcon,
|
|
4963
6512
|
Button: DaoButton,
|
|
4964
6513
|
ButtonGroup: buttonGroup,
|
|
6514
|
+
Card: card,
|
|
6515
|
+
CardItem: cardItem,
|
|
4965
6516
|
Checkbox: DaoCheckbox,
|
|
4966
6517
|
CheckboxGroup: checkboxGroup,
|
|
4967
6518
|
Dialog: dialog,
|
|
4968
6519
|
DialogFooter,
|
|
4969
6520
|
DialogHeader,
|
|
6521
|
+
Drawer: drawer,
|
|
4970
6522
|
Dropdown: dropdown,
|
|
4971
6523
|
DropdownMenu: dropdownMenu,
|
|
4972
6524
|
DropdownItem: dropdownItem,
|
|
6525
|
+
Expansion: expansion,
|
|
6526
|
+
ExpansionItem: expansionItem,
|
|
4973
6527
|
Form: form,
|
|
4974
6528
|
FormItem: formItem,
|
|
4975
6529
|
FormGroup: formGroup,
|
|
6530
|
+
Header: header,
|
|
6531
|
+
Breadcrumb: breadcrumb,
|
|
6532
|
+
BreadcrumbItem: DaoBreadcrumbItem,
|
|
4976
6533
|
Icon: DaoIcon,
|
|
4977
6534
|
Input: input,
|
|
4978
|
-
|
|
4979
|
-
|
|
6535
|
+
Message: message,
|
|
6536
|
+
Nav: nav,
|
|
6537
|
+
NavHead: navHead,
|
|
6538
|
+
NavItem: navItem,
|
|
6539
|
+
NavSub: navSub,
|
|
6540
|
+
Pagination: DaoPagination,
|
|
6541
|
+
Popover: _sfc_main$9,
|
|
6542
|
+
Popper,
|
|
4980
6543
|
Progress: progress,
|
|
4981
6544
|
Radio: radio,
|
|
4982
6545
|
RadioGroup: radioGroup,
|
|
@@ -4987,23 +6550,19 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
4987
6550
|
Tabs: tabs,
|
|
4988
6551
|
TabNav: _sfc_main$2,
|
|
4989
6552
|
TabItem: tabItem,
|
|
4990
|
-
Tooltip: _sfc_main$
|
|
6553
|
+
Tooltip: _sfc_main$o
|
|
4991
6554
|
});
|
|
4992
6555
|
var common = "";
|
|
4993
|
-
|
|
6556
|
+
var alias = "";
|
|
6557
|
+
const plugin = (app) => {
|
|
4994
6558
|
Object.values(components).forEach((c) => {
|
|
4995
6559
|
app.component(c.name, c);
|
|
4996
6560
|
});
|
|
4997
6561
|
};
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
}
|
|
5003
|
-
Vue.use(plugin$1);
|
|
5004
|
-
installed = true;
|
|
5005
|
-
}
|
|
5006
|
-
var plugin = {
|
|
6562
|
+
const install = (Vue) => {
|
|
6563
|
+
Vue.use(plugin);
|
|
6564
|
+
};
|
|
6565
|
+
var index = {
|
|
5007
6566
|
install
|
|
5008
6567
|
};
|
|
5009
|
-
export {
|
|
6568
|
+
export { DaoActionIcon as ActionIcon, breadcrumb as Breadcrumb, DaoBreadcrumbItem as BreadcrumbItem, DaoButton as Button, buttonGroup as ButtonGroup, card as Card, cardItem as CardItem, DaoCheckbox as Checkbox, checkboxGroup as CheckboxGroup, dialog as Dialog, DialogFooter, DialogHeader, drawer as Drawer, dropdown as Dropdown, dropdownItem as DropdownItem, dropdownMenu as DropdownMenu, expansion as Expansion, expansionItem as ExpansionItem, form as Form, formGroup as FormGroup, formItem as FormItem, header as Header, DaoIcon as Icon, input as Input, message as Message, nav as Nav, navHead as NavHead, navItem as NavItem, navSub as NavSub, DaoOption as Option, DaoPagination as Pagination, _sfc_main$9 as Popover, Popper, progress as Progress, radio as Radio, radioGroup as RadioGroup, DaoSelect as Select, _switch as Switch, tabItem as TabItem, _sfc_main$2 as TabNav, table as Table, tabs as Tabs, _sfc_main$o as Tooltip, index as default };
|