ninemoon-ui 0.0.1
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 +10 -0
- package/dist/badge.css +27 -0
- package/dist/carousel.css +13 -0
- package/dist/checkgroup.css +41 -0
- package/dist/components/alert/alert.d.ts +11 -0
- package/dist/components/alert/alertcomponent.vue.d.ts +12 -0
- package/dist/components/badge/badge.vue.d.ts +38 -0
- package/dist/components/carousel/carousel.vue.d.ts +10 -0
- package/dist/components/carousel/carouselitem.vue.d.ts +9 -0
- package/dist/components/check/checkbox.vue.d.ts +25 -0
- package/dist/components/check/checkgroup.vue.d.ts +25 -0
- package/dist/components/date/datepicker.vue.d.ts +21 -0
- package/dist/components/date/datepickerRange.vue.d.ts +14 -0
- package/dist/components/date/getcalendar.d.ts +11 -0
- package/dist/components/dialog/dialog.vue.d.ts +79 -0
- package/dist/components/form/form.vue.d.ts +54 -0
- package/dist/components/form/formlabel.vue.d.ts +44 -0
- package/dist/components/image/image.vue.d.ts +38 -0
- package/dist/components/input/input.vue.d.ts +65 -0
- package/dist/components/loadding/loadcomponent.vue.d.ts +5 -0
- package/dist/components/loadding/loadding.d.ts +22 -0
- package/dist/components/menu/menu.vue.d.ts +14 -0
- package/dist/components/message/message.d.ts +18 -0
- package/dist/components/message/messagecomponent.vue.d.ts +17 -0
- package/dist/components/numberInput/numberinput.vue.d.ts +64 -0
- package/dist/components/pagination/pagination.vue.d.ts +31 -0
- package/dist/components/popover/popover.vue.d.ts +59 -0
- package/dist/components/radio/radiobox.vue.d.ts +25 -0
- package/dist/components/radio/radiogroup.vue.d.ts +25 -0
- package/dist/components/scrollBar/movebar.vue.d.ts +38 -0
- package/dist/components/scrollBar/scrollBar.vue.d.ts +48 -0
- package/dist/components/scrollloading/scrolllead.d.ts +20 -0
- package/dist/components/select/select.vue.d.ts +43 -0
- package/dist/components/select/selectoption.vue.d.ts +25 -0
- package/dist/components/switch/switch.vue.d.ts +49 -0
- package/dist/components/table/table.vue.d.ts +61 -0
- package/dist/components/table/tableItem.vue.d.ts +66 -0
- package/dist/components/tabs/tabs.vue.d.ts +30 -0
- package/dist/components/tabs/tabsPane.vue.d.ts +19 -0
- package/dist/components/tree/tree.vue.d.ts +47 -0
- package/dist/components/upload/upload.vue.d.ts +65 -0
- package/dist/components/utils/tool.d.ts +44 -0
- package/dist/datepickerRange.css +79 -0
- package/dist/image.css +8 -0
- package/dist/index.css +816 -0
- package/dist/index.d.ts +2787 -0
- package/dist/index.es.js +37 -0
- package/dist/index.umd.js +5930 -0
- package/dist/js/badge/badge.js +46 -0
- package/dist/js/carousel/carousel.js +196 -0
- package/dist/js/carousel/carouselitem.js +16 -0
- package/dist/js/check/checkbox.js +16 -0
- package/dist/js/check/checkgroup.js +91 -0
- package/dist/js/date/datepicker.js +373 -0
- package/dist/js/date/datepickerRange.js +579 -0
- package/dist/js/dialog/dialog.js +140 -0
- package/dist/js/form/form.js +85 -0
- package/dist/js/form/formlabel.js +167 -0
- package/dist/js/getcalendar/getcalendar.js +48 -0
- package/dist/js/image/image.js +259 -0
- package/dist/js/index/index.js +801 -0
- package/dist/js/input/input.js +91 -0
- package/dist/js/menu/menu.js +58 -0
- package/dist/js/numberInput/numberinput.js +145 -0
- package/dist/js/pagination/pagination.js +259 -0
- package/dist/js/popover/popover.js +193 -0
- package/dist/js/radio/radiobox.js +16 -0
- package/dist/js/radio/radiogroup.js +99 -0
- package/dist/js/scrollBar/scrollBar.js +208 -0
- package/dist/js/select/select.js +133 -0
- package/dist/js/select/selectoption.js +16 -0
- package/dist/js/switch/switch.js +49 -0
- package/dist/js/table/table.js +203 -0
- package/dist/js/table/tableItem.js +25 -0
- package/dist/js/tabs/tabs.js +164 -0
- package/dist/js/tabs/tabsPane.js +17 -0
- package/dist/js/tree/tree.js +72 -0
- package/dist/js/tree/treeleaf.js +118 -0
- package/dist/js/upload/upload.js +108 -0
- package/dist/radiogroup.css +44 -0
- package/dist/scrollBar.css +37 -0
- package/dist/select.css +20 -0
- package/dist/tabs.css +77 -0
- package/package.json +37 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "tdd-inline-block tdd-cursor-pointer tdd-select-none tdd-text-xs" };
|
|
3
|
+
const _hoisted_2 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "tdd-z-10 tdd-absolute tdd-top-0 tdd-font-semibold tdd-text-white tdd-left-1 tdd-leading-5 tdd-rounded-tr-sm tdd-rounded-br-sm"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_3 = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "tdd-z-10 tdd-absolute tdd-top-0 tdd-font-semibold tdd-text-white tdd-right-1 tdd-leading-5 tdd-rounded-tl-sm tdd-rounded-bl-sm"
|
|
10
|
+
};
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "switch",
|
|
13
|
+
props: {
|
|
14
|
+
labelChecked: {},
|
|
15
|
+
labelUnchecked: {},
|
|
16
|
+
colorChecked: { default: "#25b9e9" },
|
|
17
|
+
colorUnchecked: { default: "#666666" },
|
|
18
|
+
modelValue: { type: Boolean, default: false }
|
|
19
|
+
},
|
|
20
|
+
emits: ["update:modelValue", "switchChange"],
|
|
21
|
+
setup(__props, { emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const togglehandle = () => {
|
|
24
|
+
emit("update:modelValue", !props.modelValue);
|
|
25
|
+
emit("switchChange", !props.modelValue);
|
|
26
|
+
};
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
return openBlock(), createElementBlock("label", _hoisted_1, [
|
|
29
|
+
createElementVNode("input", {
|
|
30
|
+
type: "checkbox",
|
|
31
|
+
class: "tdd-hidden",
|
|
32
|
+
onChange: togglehandle
|
|
33
|
+
}, null, 32),
|
|
34
|
+
createElementVNode("div", {
|
|
35
|
+
class: "tdd-relative tdd-m-0 tdd-box-border tdd-block tdd-h-5 tdd-w-10 tdd-transform tdd-select-none tdd-overflow-hidden tdd-rounded-xl tdd-outline-0 tdd-ring-2 tdd-ring-gray-300 tdd-transition",
|
|
36
|
+
style: normalizeStyle({ backgroundColor: _ctx.modelValue ? _ctx.colorChecked : _ctx.colorUnchecked })
|
|
37
|
+
}, [
|
|
38
|
+
createElementVNode("div", {
|
|
39
|
+
class: normalizeClass(["tdd-absolute tdd-top-0 tdd-left-0 tdd-z-10 tdd-block tdd-h-full tdd-w-1/2 tdd-translate-x-0 tdd-transform tdd-rounded-full tdd-bg-slate-50 tdd-transition", { "tdd-translate-x-full ": _ctx.modelValue }])
|
|
40
|
+
}, null, 2)
|
|
41
|
+
], 4),
|
|
42
|
+
_ctx.modelValue ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(_ctx.labelChecked), 1)) : (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(_ctx.labelUnchecked), 1))
|
|
43
|
+
]);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
_sfc_main as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { defineComponent, computed, useSlots, ref, watch, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, createVNode, withDirectives, vShow, h, vModelCheckbox, withModifiers } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "tdd-text-center tdd-text-word6 tdd-text-base" };
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "table",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
whiteword: { default: "" },
|
|
8
|
+
showHead: { type: Boolean, default: true },
|
|
9
|
+
headclass: {},
|
|
10
|
+
cellclass: {},
|
|
11
|
+
tableclass: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["rowClick", "selectionChange"],
|
|
14
|
+
setup(__props, { expose: __expose, emit }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const hasData = computed(() => {
|
|
17
|
+
return props.data.length > 0;
|
|
18
|
+
});
|
|
19
|
+
const slots = useSlots();
|
|
20
|
+
const renderColGroup = () => {
|
|
21
|
+
return h(
|
|
22
|
+
"colgroup",
|
|
23
|
+
null,
|
|
24
|
+
slots.default().map((it, _index) => {
|
|
25
|
+
var _a;
|
|
26
|
+
return h("col", {
|
|
27
|
+
width: ((_a = it.props) == null ? void 0 : _a.width) || null
|
|
28
|
+
});
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
const renderHead = () => {
|
|
33
|
+
return h(
|
|
34
|
+
"thead",
|
|
35
|
+
{ class: props.headclass ? `tdd-text-word6 ${props.headclass}` : "tdd-text-word6" },
|
|
36
|
+
slots.default().map((it, index) => {
|
|
37
|
+
var _a;
|
|
38
|
+
return h(
|
|
39
|
+
"th",
|
|
40
|
+
{
|
|
41
|
+
class: "tdd-font-normal tdd-h-10 tdd-border-b ",
|
|
42
|
+
key: index
|
|
43
|
+
},
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
it.children && it.children.head ? (
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
it.children.head()
|
|
48
|
+
) : ((_a = it.props) == null ? void 0 : _a.type) && it.props.type === "selection" ? h(
|
|
49
|
+
"label",
|
|
50
|
+
{
|
|
51
|
+
class: "tdd-px-1 tdd-flex"
|
|
52
|
+
},
|
|
53
|
+
withDirectives(
|
|
54
|
+
h("input", {
|
|
55
|
+
type: "checkbox",
|
|
56
|
+
"onUpdate:modelValue": (value) => allSelect.value = value,
|
|
57
|
+
onChange: () => {
|
|
58
|
+
allSelect.value ? allSelection() : toggleAllSelection();
|
|
59
|
+
},
|
|
60
|
+
class: "tdd-appearance-none form-tick tdd-h-4 tdd-w-4 tdd-border tdd-border-gray-300 tdd-rounded checked:tdd-border-transparent checked:tdd-bg-red-600 tdd-text-red-600 focus:tdd-outline-none"
|
|
61
|
+
}),
|
|
62
|
+
[[vModelCheckbox, allSelect.value]]
|
|
63
|
+
)
|
|
64
|
+
) : it.props.label
|
|
65
|
+
);
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
const allSelect = computed({
|
|
70
|
+
set(flag) {
|
|
71
|
+
if (flag) {
|
|
72
|
+
choosed.value = props.data.map((_i, d) => d);
|
|
73
|
+
} else {
|
|
74
|
+
choosed.value = [];
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
get() {
|
|
78
|
+
return hasData.value && choosed.value.length == props.data.length;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const choosed = ref([]);
|
|
82
|
+
const clearSelection = () => {
|
|
83
|
+
choosed.value = [];
|
|
84
|
+
};
|
|
85
|
+
const a = () => {
|
|
86
|
+
let arr = [
|
|
87
|
+
{ a: 1, b: 3 },
|
|
88
|
+
{ a: 3, b: 6 },
|
|
89
|
+
{ a: 0, b: 9 }
|
|
90
|
+
];
|
|
91
|
+
return arr.map((i) => i.a);
|
|
92
|
+
};
|
|
93
|
+
a();
|
|
94
|
+
const allSelection = () => {
|
|
95
|
+
let temp = [];
|
|
96
|
+
for (let i = 0; i < props.data.length; i++) {
|
|
97
|
+
temp.push(i);
|
|
98
|
+
}
|
|
99
|
+
choosed.value = temp;
|
|
100
|
+
};
|
|
101
|
+
watch(
|
|
102
|
+
choosed,
|
|
103
|
+
(newd) => {
|
|
104
|
+
const res = props.data.filter((_i, d) => newd.includes(d));
|
|
105
|
+
emit("selectionChange", res);
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
deep: true
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
const toggleAllSelection = () => {
|
|
112
|
+
let temp = [];
|
|
113
|
+
for (let i = 0; i < props.data.length; i++) {
|
|
114
|
+
temp.push(i);
|
|
115
|
+
}
|
|
116
|
+
choosed.value = temp.filter((i) => !choosed.value.includes(i));
|
|
117
|
+
};
|
|
118
|
+
const toggleSelection = (arr) => {
|
|
119
|
+
choosed.value = arr;
|
|
120
|
+
};
|
|
121
|
+
const renderBody = () => {
|
|
122
|
+
return h(
|
|
123
|
+
"tbody",
|
|
124
|
+
{},
|
|
125
|
+
props.data.map((row, i) => {
|
|
126
|
+
return h(
|
|
127
|
+
"tr",
|
|
128
|
+
{
|
|
129
|
+
class: "tdd-border-b hover:tdd-bg-gray-100",
|
|
130
|
+
key: i,
|
|
131
|
+
onClick: withModifiers(() => {
|
|
132
|
+
emit("rowClick", { row, i });
|
|
133
|
+
}, ["stop"])
|
|
134
|
+
},
|
|
135
|
+
slots.default().map((it, _j) => {
|
|
136
|
+
var _a;
|
|
137
|
+
return h(
|
|
138
|
+
"td",
|
|
139
|
+
{
|
|
140
|
+
class: props.cellclass ? `tdd-text-center tdd-py-2 ${props.cellclass}` : "tdd-text-center tdd-py-2"
|
|
141
|
+
},
|
|
142
|
+
((_a = it.props) == null ? void 0 : _a.type) && it.props.type === "selection" ? h(
|
|
143
|
+
"label",
|
|
144
|
+
{
|
|
145
|
+
class: "tdd-px-1 tdd-flex",
|
|
146
|
+
for: "checkbox"
|
|
147
|
+
},
|
|
148
|
+
withDirectives(
|
|
149
|
+
h("input", {
|
|
150
|
+
type: "checkbox",
|
|
151
|
+
value: i,
|
|
152
|
+
"onUpdate:modelValue": (value) => {
|
|
153
|
+
choosed.value = value;
|
|
154
|
+
},
|
|
155
|
+
class: "tdd-appearance-none form-tick tdd-h-4 tdd-w-4 tdd-border tdd-border-gray-300 tdd-rounded checked:tdd-border-transparent checked:tdd-bg-red-600 tdd-text-red-600 focus:tdd-outline-none "
|
|
156
|
+
}),
|
|
157
|
+
[[vModelCheckbox, choosed.value]]
|
|
158
|
+
)
|
|
159
|
+
) : h(
|
|
160
|
+
"div",
|
|
161
|
+
null,
|
|
162
|
+
// @ts-ignore
|
|
163
|
+
it.children && it.children.default ? (
|
|
164
|
+
// @ts-ignore
|
|
165
|
+
it.children.default({
|
|
166
|
+
row,
|
|
167
|
+
index: i
|
|
168
|
+
})
|
|
169
|
+
) : row[it.props.prop] != null ? row[it.props.prop] : props.whiteword
|
|
170
|
+
)
|
|
171
|
+
);
|
|
172
|
+
})
|
|
173
|
+
);
|
|
174
|
+
})
|
|
175
|
+
);
|
|
176
|
+
};
|
|
177
|
+
__expose({
|
|
178
|
+
clearSelection,
|
|
179
|
+
allSelection,
|
|
180
|
+
toggleAllSelection,
|
|
181
|
+
toggleSelection
|
|
182
|
+
});
|
|
183
|
+
return (_ctx, _cache) => {
|
|
184
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
185
|
+
createElementVNode("table", {
|
|
186
|
+
class: normalizeClass(["tdd-w-full tdd-text-sm", _ctx.tableclass])
|
|
187
|
+
}, [
|
|
188
|
+
createVNode(renderColGroup),
|
|
189
|
+
withDirectives(createVNode(renderHead, null, null, 512), [
|
|
190
|
+
[vShow, _ctx.showHead]
|
|
191
|
+
]),
|
|
192
|
+
createVNode(renderBody)
|
|
193
|
+
], 2),
|
|
194
|
+
withDirectives(createElementVNode("div", _hoisted_1, "暂无数据", 512), [
|
|
195
|
+
[vShow, !hasData.value]
|
|
196
|
+
])
|
|
197
|
+
], 64);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
export {
|
|
202
|
+
_sfc_main as default
|
|
203
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent, renderSlot } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "tableItem",
|
|
4
|
+
props: {
|
|
5
|
+
prop: {},
|
|
6
|
+
width: {},
|
|
7
|
+
label: {},
|
|
8
|
+
fixed: {},
|
|
9
|
+
type: {},
|
|
10
|
+
sortable: { type: Boolean },
|
|
11
|
+
row: {},
|
|
12
|
+
index: {}
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
return (_ctx, _cache) => {
|
|
16
|
+
return renderSlot(_ctx.$slots, "default", {
|
|
17
|
+
row: _ctx.row,
|
|
18
|
+
index: _ctx.index
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
_sfc_main as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, useSlots, onMounted, openBlock, createElementBlock, createVNode, createElementVNode, normalizeStyle, createCommentVNode, h, withDirectives, vShow } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "tdd-relative tdd-w-full tdd-overflow-hidden" };
|
|
3
|
+
const _hoisted_2 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "tdd-relative tdd-my-2 tdd-w-full tdd-border-t-2 tdd-border-solid tdd-border-gray-200"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_3 = { class: "tdd-relative tdd-w-full" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "tabs",
|
|
10
|
+
props: {
|
|
11
|
+
active: {},
|
|
12
|
+
default: {},
|
|
13
|
+
type: { default: "line" }
|
|
14
|
+
},
|
|
15
|
+
emits: ["update:active"],
|
|
16
|
+
setup(__props, { emit }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const showBaseline = computed(() => props.type === "line");
|
|
19
|
+
const currentActive = ref(props.default || "");
|
|
20
|
+
const activeIndex = ref(0);
|
|
21
|
+
const arrowNum = ref(8);
|
|
22
|
+
const arrowWidth = ref(0);
|
|
23
|
+
const changeHandle = (name) => {
|
|
24
|
+
emit("update:active", name);
|
|
25
|
+
};
|
|
26
|
+
const slots = useSlots();
|
|
27
|
+
const renderBtn = (name, index) => {
|
|
28
|
+
let btc = [];
|
|
29
|
+
let divc = [];
|
|
30
|
+
switch (props.type) {
|
|
31
|
+
case "card":
|
|
32
|
+
btc.push("ETab_Card_Btn");
|
|
33
|
+
divc.push("ETabline");
|
|
34
|
+
if (index - 1 === activeIndex.value) {
|
|
35
|
+
btc.push("ETab_Line_Btn_Btw");
|
|
36
|
+
divc.push("ETablineActBtw ETablineActNe");
|
|
37
|
+
} else if (index + 1 === activeIndex.value) {
|
|
38
|
+
btc.push("ETab_Line_Btn_Btw");
|
|
39
|
+
divc.push("ETablineActBtw ETablineActPr");
|
|
40
|
+
} else if (index === activeIndex.value) {
|
|
41
|
+
btc.push("ETab_Card_Btn_Act");
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
default:
|
|
45
|
+
btc.push("ETab_Line_Btn");
|
|
46
|
+
divc.push("ETabline");
|
|
47
|
+
if (index === activeIndex.value) {
|
|
48
|
+
divc.push("ETab_Line_Act");
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return h(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
class: btc.join(" "),
|
|
57
|
+
onClick: (e) => {
|
|
58
|
+
activeIndex.value = index;
|
|
59
|
+
let aim = e.target;
|
|
60
|
+
arrowWidth.value = aim.offsetWidth;
|
|
61
|
+
arrowNum.value = aim.offsetLeft;
|
|
62
|
+
changeHandle(name);
|
|
63
|
+
currentActive.value = name;
|
|
64
|
+
}
|
|
65
|
+
// key: index,
|
|
66
|
+
},
|
|
67
|
+
h(
|
|
68
|
+
"span",
|
|
69
|
+
{
|
|
70
|
+
class: divc.join(" ")
|
|
71
|
+
},
|
|
72
|
+
name
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
const renderBar = () => {
|
|
77
|
+
return h(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
class: `ETab${props.type === "line" ? " px-2 pt-2" : " ETab_Card"}`
|
|
81
|
+
},
|
|
82
|
+
slots.default().map((it, index) => {
|
|
83
|
+
var _a;
|
|
84
|
+
if (it.type.toString().includes("Symbol")) {
|
|
85
|
+
return it.children.map((simple, i) => {
|
|
86
|
+
return renderBtn(simple.props.name, i);
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
return renderBtn((_a = it.props) == null ? void 0 : _a.name, index);
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
const renderContent = () => {
|
|
95
|
+
return h(
|
|
96
|
+
"div",
|
|
97
|
+
{},
|
|
98
|
+
slots.default().map((it, index) => {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
if (it.type.toString().includes("Symbol")) {
|
|
101
|
+
return it.children.map((simple, i) => {
|
|
102
|
+
if (currentActive.value === "") {
|
|
103
|
+
activeIndex.value = i;
|
|
104
|
+
currentActive.value = simple.props.name;
|
|
105
|
+
} else if (currentActive.value === simple.props.name) {
|
|
106
|
+
activeIndex.value = i;
|
|
107
|
+
}
|
|
108
|
+
return withDirectives(
|
|
109
|
+
h(simple, {
|
|
110
|
+
key: simple.props.name
|
|
111
|
+
}),
|
|
112
|
+
[[vShow, currentActive.value === "" || currentActive.value === simple.props.name]]
|
|
113
|
+
);
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
if (currentActive.value === "") {
|
|
117
|
+
activeIndex.value = index;
|
|
118
|
+
currentActive.value = (_a = it.props) == null ? void 0 : _a.name;
|
|
119
|
+
} else if (currentActive.value === ((_b = it.props) == null ? void 0 : _b.name)) {
|
|
120
|
+
activeIndex.value = index;
|
|
121
|
+
}
|
|
122
|
+
return withDirectives(
|
|
123
|
+
h(it, {
|
|
124
|
+
key: it.props.name
|
|
125
|
+
}),
|
|
126
|
+
[[vShow, currentActive.value === "" || currentActive.value === it.props.name]]
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
const btnBar = ref();
|
|
133
|
+
onMounted(() => {
|
|
134
|
+
if (props.type === "line") {
|
|
135
|
+
const aim = btnBar.value.children[activeIndex.value];
|
|
136
|
+
arrowWidth.value = aim.children[0].innerHTML.length * 14 + 16;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return (_ctx, _cache) => {
|
|
140
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
141
|
+
createVNode(renderBar, {
|
|
142
|
+
ref_key: "btnBar",
|
|
143
|
+
ref: btnBar
|
|
144
|
+
}, null, 512),
|
|
145
|
+
showBaseline.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
146
|
+
createElementVNode("div", {
|
|
147
|
+
class: "tdd-absolute tdd-bottom-0 tdd-border-t-2 tdd-border-solid tdd-border-blue-brand tdd-transition",
|
|
148
|
+
style: normalizeStyle({
|
|
149
|
+
transform: `translateX(${arrowNum.value}px`,
|
|
150
|
+
width: `${arrowWidth.value}px`
|
|
151
|
+
})
|
|
152
|
+
}, null, 4)
|
|
153
|
+
])) : createCommentVNode("", true),
|
|
154
|
+
createElementVNode("div", _hoisted_3, [
|
|
155
|
+
createVNode(renderContent)
|
|
156
|
+
])
|
|
157
|
+
]);
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const tabs_vue_vue_type_style_index_0_lang = "";
|
|
162
|
+
export {
|
|
163
|
+
_sfc_main as default
|
|
164
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "tabsPane",
|
|
4
|
+
props: {
|
|
5
|
+
name: {}
|
|
6
|
+
},
|
|
7
|
+
setup(__props) {
|
|
8
|
+
return (_ctx, _cache) => {
|
|
9
|
+
return openBlock(), createElementBlock("div", null, [
|
|
10
|
+
renderSlot(_ctx.$slots, "default")
|
|
11
|
+
]);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
_sfc_main as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineComponent, defineAsyncComponent, provide, computed, watch, openBlock, createElementBlock, Fragment, renderList, createBlock, unref } from "vue";
|
|
2
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3
|
+
__name: "tree",
|
|
4
|
+
props: {
|
|
5
|
+
data: {},
|
|
6
|
+
defaultExpandAll: { type: Boolean, default: false },
|
|
7
|
+
lazy: { type: Boolean, default: false },
|
|
8
|
+
defaultCheckedKeys: {},
|
|
9
|
+
nodeKey: {}
|
|
10
|
+
},
|
|
11
|
+
setup(__props, { expose: __expose }) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const Leaf = defineAsyncComponent(() => import("./treeleaf.js"));
|
|
14
|
+
provide("parentlazy", props.lazy);
|
|
15
|
+
const flattenArr = computed(() => {
|
|
16
|
+
let data = flatten(props.data);
|
|
17
|
+
return data;
|
|
18
|
+
});
|
|
19
|
+
const flatten = (list, pid) => {
|
|
20
|
+
let result = [];
|
|
21
|
+
for (let i = 0; i < list.length; i++) {
|
|
22
|
+
let temp = list[i];
|
|
23
|
+
temp.pid = pid;
|
|
24
|
+
temp.checked = false;
|
|
25
|
+
temp.somechecked = false;
|
|
26
|
+
result.push(temp);
|
|
27
|
+
if (Array.isArray(temp.children)) {
|
|
28
|
+
result = result.concat(flatten(temp.children, temp[props.nodeKey]));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
watch(() => props.defaultCheckedKeys, (newd) => {
|
|
34
|
+
if (newd && newd.length > 0) {
|
|
35
|
+
flattenArr.value.map((i) => {
|
|
36
|
+
if (newd == null ? void 0 : newd.includes(i[props.nodeKey])) {
|
|
37
|
+
i.checked = true;
|
|
38
|
+
} else {
|
|
39
|
+
i.checked = false;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
flattenArr.value.map((i) => {
|
|
44
|
+
i.checked = false;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, { deep: true });
|
|
48
|
+
const getCheckedKeys = (leafOnly = false) => {
|
|
49
|
+
if (leafOnly) {
|
|
50
|
+
return flattenArr.value.filter((i) => i.somechecked === false || i.checked === true).map((i) => i[props.nodeKey]);
|
|
51
|
+
} else {
|
|
52
|
+
return flattenArr.value.filter((i) => i.checked === true).map((i) => i[props.nodeKey]);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__expose({
|
|
56
|
+
getCheckedKeys
|
|
57
|
+
});
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (i) => {
|
|
60
|
+
return openBlock(), createBlock(unref(Leaf), {
|
|
61
|
+
item: i,
|
|
62
|
+
deepnum: 1,
|
|
63
|
+
key: i[_ctx.nodeKey],
|
|
64
|
+
nodeKey: _ctx.nodeKey
|
|
65
|
+
}, null, 8, ["item", "nodeKey"]);
|
|
66
|
+
}), 128);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
_sfc_main as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, inject, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, withDirectives, vModelCheckbox, toDisplayString, Fragment, renderList, createBlock, vShow } from "vue";
|
|
2
|
+
const _hoisted_1 = { class: "tdd-flow-root" };
|
|
3
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("polygon", { points: "1,2.5 5,7.5 9,2.5" }, null, -1);
|
|
4
|
+
const _hoisted_3 = [
|
|
5
|
+
_hoisted_2
|
|
6
|
+
];
|
|
7
|
+
const _hoisted_4 = { class: "tdd-flex tdd-items-center" };
|
|
8
|
+
const __default__ = {
|
|
9
|
+
name: "Leaf"
|
|
10
|
+
};
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...__default__,
|
|
13
|
+
props: {
|
|
14
|
+
item: {},
|
|
15
|
+
deepnum: {},
|
|
16
|
+
nodeKey: {}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const marginLeft = computed(() => {
|
|
21
|
+
return `${(props.deepnum - 1) * 16}px`;
|
|
22
|
+
});
|
|
23
|
+
const noshow = ref(inject("parentlazy", false));
|
|
24
|
+
const childList = computed(() => {
|
|
25
|
+
return props.item.children || [];
|
|
26
|
+
});
|
|
27
|
+
const checkedchildLen = computed(() => childList.value.filter((i) => i.checked === true).length);
|
|
28
|
+
const somecheckchildLen = computed(() => childList.value.filter((i) => i.somechecked === true).length);
|
|
29
|
+
const childlenChange = computed(() => childList.value.length);
|
|
30
|
+
watch([checkedchildLen, somecheckchildLen], ([checklen, somechecklen]) => {
|
|
31
|
+
if (checklen > 0) {
|
|
32
|
+
if (checklen === childList.value.length) {
|
|
33
|
+
props.item.checked = true;
|
|
34
|
+
props.item.somechecked = false;
|
|
35
|
+
} else {
|
|
36
|
+
props.item.checked = false;
|
|
37
|
+
props.item.somechecked = true;
|
|
38
|
+
}
|
|
39
|
+
} else if (somechecklen > 0) {
|
|
40
|
+
props.item.checked = false;
|
|
41
|
+
props.item.somechecked = true;
|
|
42
|
+
} else {
|
|
43
|
+
props.item.somechecked = false;
|
|
44
|
+
props.item.checked = false;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const ableExpend = computed(() => {
|
|
48
|
+
return childList.value.length > 0 || noshow.value === true;
|
|
49
|
+
});
|
|
50
|
+
const expendflag = ref(false);
|
|
51
|
+
const expendHandle = () => {
|
|
52
|
+
noshow.value = false;
|
|
53
|
+
if (ableExpend.value === false)
|
|
54
|
+
return;
|
|
55
|
+
expendflag.value = !expendflag.value;
|
|
56
|
+
};
|
|
57
|
+
watch(() => [props.item.checked, props.item.somechecked, childlenChange], ([checkflag, somecheckflag]) => {
|
|
58
|
+
if (checkflag === false && somecheckflag === false || checkflag === true) {
|
|
59
|
+
childList.value.map((i) => {
|
|
60
|
+
i.checked = checkflag;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
// immediate: true,
|
|
65
|
+
deep: true
|
|
66
|
+
});
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
const _component_Leaf = resolveComponent("Leaf");
|
|
69
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
70
|
+
createElementVNode("div", {
|
|
71
|
+
class: "tdd-flex tdd-items-center",
|
|
72
|
+
style: normalizeStyle({ marginLeft: marginLeft.value })
|
|
73
|
+
}, [
|
|
74
|
+
createElementVNode("div", {
|
|
75
|
+
class: "tdd-ml-1 tdd-flex",
|
|
76
|
+
onClick: expendHandle
|
|
77
|
+
}, [
|
|
78
|
+
(openBlock(), createElementBlock("svg", {
|
|
79
|
+
class: normalizeClass([[expendflag.value ? "tdd-rotate-0" : "-tdd-rotate-90", ableExpend.value ? "tdd-visible" : " tdd-invisible"], "tdd-fill-gray-400 tdd-w-3 tdd-h-3 tdd-transition tdd-inline-block"]),
|
|
80
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
81
|
+
viewBox: "0 0 10 10"
|
|
82
|
+
}, _hoisted_3, 2))
|
|
83
|
+
]),
|
|
84
|
+
createElementVNode("label", _hoisted_4, [
|
|
85
|
+
withDirectives(createElementVNode("input", {
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.item.checked = $event),
|
|
88
|
+
class: "tdd-appearance-none"
|
|
89
|
+
}, null, 512), [
|
|
90
|
+
[vModelCheckbox, _ctx.item.checked]
|
|
91
|
+
]),
|
|
92
|
+
createElementVNode("div", {
|
|
93
|
+
class: normalizeClass(["tdd-w-3 tdd-h-3 tdd-rounded-sm tdd-border tdd-border-solid tdd-mr-1", {
|
|
94
|
+
"tdd-bg-blue-500 tdd-border-blue-600": _ctx.item.checked == true,
|
|
95
|
+
"tdd-bg-blue-300 tdd-border-blue-400": _ctx.item.somechecked == true,
|
|
96
|
+
"tdd-bg-white": _ctx.item.checked == false && _ctx.item.somechecked == false
|
|
97
|
+
}])
|
|
98
|
+
}, null, 2),
|
|
99
|
+
createElementVNode("div", null, toDisplayString(_ctx.item.label), 1)
|
|
100
|
+
])
|
|
101
|
+
], 4),
|
|
102
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(childList.value, (i) => {
|
|
103
|
+
return withDirectives((openBlock(), createBlock(_component_Leaf, {
|
|
104
|
+
item: i,
|
|
105
|
+
deepnum: _ctx.deepnum + 1,
|
|
106
|
+
nodeKey: _ctx.nodeKey,
|
|
107
|
+
key: i[props.nodeKey]
|
|
108
|
+
}, null, 8, ["item", "deepnum", "nodeKey"])), [
|
|
109
|
+
[vShow, expendflag.value]
|
|
110
|
+
]);
|
|
111
|
+
}), 128))
|
|
112
|
+
]);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export {
|
|
117
|
+
_sfc_main as default
|
|
118
|
+
};
|