ninemoon-ui 0.1.8 → 0.1.10
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/dist/components/date/datepicker.vue.d.ts +3 -3
- package/dist/components/date/datepickerRange.vue.d.ts +2 -2
- package/dist/components/form/form.vue.d.ts +5 -0
- package/dist/components/form/formlabel.vue.d.ts +10 -0
- package/dist/components/input/input.vue.d.ts +10 -3
- package/dist/components/numberInput/numberinput.vue.d.ts +3 -3
- package/dist/components/select/select.vue.d.ts +3 -3
- package/dist/components/table/table.vue.d.ts +8 -1
- package/dist/components/table/tableItem.vue.d.ts +2 -0
- package/dist/{tabs.css → css/style.css} +81 -0
- package/dist/directives/index.d.ts +1 -2
- package/dist/directives/looplead.d.ts +19 -0
- package/dist/directives/scrolllead.d.ts +3 -11
- package/dist/directives/watchwindow.d.ts +1 -1
- package/dist/hooks/teleportcontainer.d.ts +5 -0
- package/dist/index.d.ts +128 -30
- package/dist/index.es.js +26 -27
- package/dist/js/badge/badge.js +3 -3
- package/dist/js/carousel/carousel.js +1 -1
- package/dist/js/check/checkbox.js +4 -4
- package/dist/js/date/datepicker.js +4 -3
- package/dist/js/date/datepickerRange.js +22 -17
- package/dist/js/dialog/dialog.js +36 -37
- package/dist/js/form/form.js +3 -1
- package/dist/js/form/formlabel.js +39 -8
- package/dist/js/image/image.js +2 -2
- package/dist/js/index/index.js +131 -113
- package/dist/js/input/input.js +26 -6
- package/dist/js/numberInput/numberinput.js +2 -1
- package/dist/js/pagination/pagination.js +2 -1
- package/dist/js/popover/popover.js +10 -16
- package/dist/js/radio/radiobox.js +4 -4
- package/dist/js/select/select.js +4 -3
- package/dist/js/table/table.js +243 -188
- package/dist/js/table/tableItem.js +2 -1
- package/dist/js/tabs/tabs.js +0 -1
- package/package.json +2 -1
- package/dist/directives/whitespaceclick.d.ts +0 -12
- package/dist/index.css +0 -80
package/dist/js/table/table.js
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
import { defineComponent, computed, useSlots,
|
|
1
|
+
import { defineComponent, computed, useSlots, h, nextTick, ref, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, renderList, withDirectives, vModelCheckbox, createCommentVNode, createTextVNode, toDisplayString, createBlock, markRaw } from "vue";
|
|
2
2
|
import { S as ShapeFlags } from "../shapeFlag/shapeFlag.js";
|
|
3
|
-
const _hoisted_1 =
|
|
3
|
+
const _hoisted_1 = ["width"];
|
|
4
|
+
const _hoisted_2 = { key: 0 };
|
|
5
|
+
const _hoisted_3 = ["colspan"];
|
|
6
|
+
const _hoisted_4 = { class: "border-b" };
|
|
7
|
+
const _hoisted_5 = { key: 0 };
|
|
8
|
+
const _hoisted_6 = {
|
|
9
|
+
class: "px-1",
|
|
10
|
+
for: "checkbox"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_7 = ["checked", "onChange"];
|
|
13
|
+
const _hoisted_8 = { key: 1 };
|
|
14
|
+
const _hoisted_9 = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "border-b"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_10 = ["colspan"];
|
|
19
|
+
const _hoisted_11 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "text-center text-word6 text-base"
|
|
22
|
+
};
|
|
4
23
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
24
|
__name: "table",
|
|
6
25
|
props: {
|
|
@@ -10,85 +29,133 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10
29
|
headclass: {},
|
|
11
30
|
cellclass: {},
|
|
12
31
|
tableclass: {},
|
|
13
|
-
idKey: {}
|
|
32
|
+
idKey: {},
|
|
33
|
+
outSideCheck: { type: Boolean, default: false }
|
|
14
34
|
},
|
|
15
|
-
emits: ["rowClick", "selectionChange"],
|
|
35
|
+
emits: ["rowClick", "selectionChange", "finishRender"],
|
|
16
36
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
17
37
|
const props = __props;
|
|
18
38
|
const hasData = computed(() => {
|
|
19
39
|
return props.data.length > 0;
|
|
20
40
|
});
|
|
21
41
|
const emit = __emit;
|
|
42
|
+
const emitSelection = () => {
|
|
43
|
+
emit("selectionChange", resultArray.value);
|
|
44
|
+
};
|
|
22
45
|
const slots = useSlots();
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
const groupedSlots = computed(() => {
|
|
47
|
+
const groups = {
|
|
48
|
+
append: null,
|
|
49
|
+
prepend: null,
|
|
50
|
+
rest: [],
|
|
51
|
+
restLen: 0,
|
|
52
|
+
normal: [],
|
|
53
|
+
hasindex: false,
|
|
54
|
+
hascheck: false
|
|
55
|
+
};
|
|
56
|
+
const _categorizeSlot = (slot) => {
|
|
57
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
58
|
+
const type = (_a = slot.props) == null ? void 0 : _a.type;
|
|
59
|
+
switch (type) {
|
|
60
|
+
case "append":
|
|
61
|
+
groups.append = slot;
|
|
62
|
+
break;
|
|
63
|
+
case "prepend":
|
|
64
|
+
groups.prepend = slot;
|
|
65
|
+
break;
|
|
66
|
+
case "index":
|
|
67
|
+
groups.rest.push({
|
|
68
|
+
type: (_b = slot.props) == null ? void 0 : _b.type,
|
|
69
|
+
prop: (_c = slot.props) == null ? void 0 : _c.prop,
|
|
70
|
+
label: ((_d = slot.props) == null ? void 0 : _d.label) || "",
|
|
71
|
+
width: (_e = slot.props) == null ? void 0 : _e.width
|
|
72
|
+
});
|
|
73
|
+
groups.restLen += 1;
|
|
74
|
+
groups.hasindex = true;
|
|
75
|
+
break;
|
|
76
|
+
case "selection":
|
|
77
|
+
groups.rest.push({
|
|
78
|
+
type: (_f = slot.props) == null ? void 0 : _f.type,
|
|
79
|
+
prop: (_g = slot.props) == null ? void 0 : _g.prop,
|
|
80
|
+
label: ((_h = slot.props) == null ? void 0 : _h.label) || "",
|
|
81
|
+
width: (_i = slot.props) == null ? void 0 : _i.width
|
|
82
|
+
});
|
|
83
|
+
groups.restLen += 1;
|
|
84
|
+
groups.hascheck = true;
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
groups.rest.push({
|
|
88
|
+
type: (_j = slot.props) == null ? void 0 : _j.type,
|
|
89
|
+
prop: (_k = slot.props) == null ? void 0 : _k.prop,
|
|
90
|
+
label: ((_l = slot.props) == null ? void 0 : _l.label) || "",
|
|
91
|
+
width: (_m = slot.props) == null ? void 0 : _m.width
|
|
92
|
+
});
|
|
93
|
+
groups.restLen += 1;
|
|
94
|
+
groups.normal.push({
|
|
95
|
+
isSlot: Boolean((_n = slot.children) == null ? void 0 : _n.default),
|
|
96
|
+
prop: (_o = slot.props) == null ? void 0 : _o.prop,
|
|
97
|
+
slot
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
slots.default().forEach((node) => {
|
|
103
|
+
if (node.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
|
104
|
+
node.children.forEach(_categorizeSlot);
|
|
105
|
+
} else if (node.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
|
|
106
|
+
_categorizeSlot(node);
|
|
29
107
|
}
|
|
30
|
-
return pre;
|
|
31
|
-
}, []);
|
|
32
|
-
});
|
|
33
|
-
const appendSlots = computed(
|
|
34
|
-
() => validSlots.value.filter((slot) => slot.props.type === "append")
|
|
35
|
-
);
|
|
36
|
-
const prependSlots = computed(
|
|
37
|
-
() => validSlots.value.filter((slot) => slot.props.type === "prepend")
|
|
38
|
-
);
|
|
39
|
-
const restSlots = computed(
|
|
40
|
-
() => validSlots.value.filter(
|
|
41
|
-
(slot) => slot.props.type !== "append" && slot.props.type !== "prepend"
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
const renderColGroup = () => {
|
|
45
|
-
return h(
|
|
46
|
-
"colgroup",
|
|
47
|
-
null,
|
|
48
|
-
restSlots.value.map((it, _index) => {
|
|
49
|
-
return colitemHandle(it);
|
|
50
|
-
})
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
const colitemHandle = (it) => {
|
|
54
|
-
return h("col", {
|
|
55
|
-
width: it.props.width || null
|
|
56
108
|
});
|
|
109
|
+
return groups;
|
|
110
|
+
});
|
|
111
|
+
const prependSlot = computed(() => groupedSlots.value.prepend);
|
|
112
|
+
const appendSlot = computed(() => groupedSlots.value.append);
|
|
113
|
+
const dynamicPre = (props2) => {
|
|
114
|
+
var _a, _b, _c;
|
|
115
|
+
return (_c = (_a = prependSlot.value) == null ? void 0 : (_b = _a.children).default) == null ? void 0 : _c.call(_b, props2);
|
|
57
116
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
class: normalizeClass(["text-word6", [props.headclass]])
|
|
63
|
-
},
|
|
64
|
-
restSlots.value.map((it) => {
|
|
65
|
-
return headitemHandle(it);
|
|
66
|
-
})
|
|
67
|
-
);
|
|
117
|
+
const dynamicAppend = (props2) => {
|
|
118
|
+
var _a, _b, _c;
|
|
119
|
+
return (_c = (_a = appendSlot.value) == null ? void 0 : (_b = _a.children).default) == null ? void 0 : _c.call(_b, props2);
|
|
68
120
|
};
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
121
|
+
const hasindexSlot = computed(() => groupedSlots.value.hasindex);
|
|
122
|
+
const hascheckSlot = computed(() => groupedSlots.value.hascheck);
|
|
123
|
+
const normalSlots = computed(() => groupedSlots.value.normal);
|
|
124
|
+
const cachedSlots = computed(() => groupedSlots.value.rest);
|
|
125
|
+
const dynamicnormal = computed(() => {
|
|
126
|
+
return normalSlots.value.map((eachslot) => {
|
|
127
|
+
if (eachslot.isSlot) {
|
|
128
|
+
return (dyprops) => {
|
|
129
|
+
var _a;
|
|
130
|
+
return (_a = eachslot.slot) == null ? void 0 : _a.children.default(dyprops);
|
|
131
|
+
};
|
|
132
|
+
} else {
|
|
133
|
+
return (dyprops) => {
|
|
134
|
+
const text = dyprops.row[eachslot.prop] || props.whiteword;
|
|
135
|
+
return h("span", text);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
nextTick(() => {
|
|
141
|
+
emit("finishRender");
|
|
142
|
+
});
|
|
143
|
+
const dynormalRenderHandle = (rowprops) => {
|
|
144
|
+
return dynamicnormal.value.map((rh, _) => {
|
|
145
|
+
return h(
|
|
146
|
+
"td",
|
|
78
147
|
{
|
|
79
|
-
class: "
|
|
148
|
+
class: normalizeClass(["text-center py-2", props.cellclass])
|
|
80
149
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"onUpdate:modelValue": (value) => allSelect.value = value,
|
|
85
|
-
class: "appearance-none form-tick h-4 w-4 border border-gray-300 rounded checked:border-transparent checked:bg-blue-600 text-red-600 focus:outline-none"
|
|
86
|
-
}),
|
|
87
|
-
[[vModelCheckbox, allSelect.value]]
|
|
88
|
-
)
|
|
89
|
-
) : it.props.label
|
|
90
|
-
);
|
|
150
|
+
rh({ row: rowprops.row, index: rowprops.rowindex })
|
|
151
|
+
);
|
|
152
|
+
});
|
|
91
153
|
};
|
|
154
|
+
const getRowKey = (rowdata, index) => props.idKey ? `row_${rowdata[props.idKey]}` : `row_${index}`;
|
|
155
|
+
const getPreRowkey = (rowdata, index) => props.idKey ? `prepend_${rowdata[props.idKey]}` : `prepend_${index}`;
|
|
156
|
+
const getAppendRowkey = (rowdata, index) => props.idKey ? `append_${rowdata[props.idKey]}` : `append_${index}`;
|
|
157
|
+
const colSpan = computed(() => groupedSlots.value.restLen);
|
|
158
|
+
const choosedSet = ref(/* @__PURE__ */ new Set());
|
|
92
159
|
const allSelect = computed({
|
|
93
160
|
set(flag) {
|
|
94
161
|
if (flag) {
|
|
@@ -96,137 +163,52 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
96
163
|
} else {
|
|
97
164
|
clearSelection();
|
|
98
165
|
}
|
|
166
|
+
emitSelection();
|
|
99
167
|
},
|
|
100
168
|
get() {
|
|
101
|
-
|
|
169
|
+
if (MapData.value.size === 0)
|
|
170
|
+
return false;
|
|
171
|
+
for (const key of MapData.value.keys()) {
|
|
172
|
+
if (!choosedSet.value.has(key))
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
102
176
|
}
|
|
103
177
|
});
|
|
104
178
|
const MapData = computed(() => {
|
|
105
|
-
return props.data.reduce((
|
|
179
|
+
return props.data.reduce((thismap, item, index) => {
|
|
106
180
|
const key = props.idKey ? item[props.idKey] : index;
|
|
107
|
-
if (
|
|
108
|
-
console.warn(`重复键 ${key}
|
|
109
|
-
map.set(key, [...map.get(key), item]);
|
|
110
|
-
} else {
|
|
111
|
-
map.set(key, [item]);
|
|
181
|
+
if (thismap.has(key)) {
|
|
182
|
+
console.warn(`重复键 ${key},已覆盖`);
|
|
112
183
|
}
|
|
113
|
-
|
|
184
|
+
thismap.set(key, item);
|
|
185
|
+
return thismap;
|
|
114
186
|
}, /* @__PURE__ */ new Map());
|
|
115
187
|
});
|
|
116
|
-
const choosedSet = ref(/* @__PURE__ */ new Set());
|
|
117
|
-
const choosedKeys = computed(() => Array.from(choosedSet.value));
|
|
118
188
|
const resultArray = computed(() => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
189
|
+
if (choosedSet.value.size === 0)
|
|
190
|
+
return [];
|
|
191
|
+
let result = [];
|
|
192
|
+
choosedSet.value.forEach((key) => {
|
|
193
|
+
if (MapData.value.has(key)) {
|
|
194
|
+
result.push(MapData.value.get(key));
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return result;
|
|
123
198
|
});
|
|
124
199
|
const clearSelection = () => {
|
|
125
|
-
choosedSet.value
|
|
200
|
+
choosedSet.value.clear();
|
|
201
|
+
emitSelection();
|
|
126
202
|
};
|
|
127
203
|
const allSelection = () => {
|
|
128
204
|
choosedSet.value = new Set(MapData.value.keys());
|
|
205
|
+
emitSelection();
|
|
129
206
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return slots2.map(
|
|
136
|
-
(slot) => h(
|
|
137
|
-
"tr",
|
|
138
|
-
{ key: `${modify}-${rowKey}` },
|
|
139
|
-
h("td", { colSpan }, trRenderHandle(row, slot, index))
|
|
140
|
-
)
|
|
141
|
-
);
|
|
142
|
-
};
|
|
143
|
-
const renderMainRow = (row, index) => {
|
|
144
|
-
const rowKey = getRowKey(row, index);
|
|
145
|
-
return h(
|
|
146
|
-
"tr",
|
|
147
|
-
{
|
|
148
|
-
class: "border-b hover:bg-gray-100 transition-colors",
|
|
149
|
-
key: rowKey,
|
|
150
|
-
// 使用唯一键替代索引
|
|
151
|
-
onClick: withModifiers(() => emit("rowClick", { row, index }), ["stop"])
|
|
152
|
-
},
|
|
153
|
-
restSlots.value.map(
|
|
154
|
-
(slot, colIndex) => bodyCellRenderer(row, slot, index, colIndex)
|
|
155
|
-
)
|
|
156
|
-
);
|
|
157
|
-
};
|
|
158
|
-
const bodyCellRenderer = (row, slot, rowIndex, colIndex) => {
|
|
159
|
-
return h(
|
|
160
|
-
"td",
|
|
161
|
-
{
|
|
162
|
-
class: cellClasses(slot.props),
|
|
163
|
-
// 提取样式生成逻辑
|
|
164
|
-
key: `${getRowKey(row, rowIndex)}-${colIndex}`
|
|
165
|
-
// 复合键
|
|
166
|
-
},
|
|
167
|
-
renderCellContent(row, slot, rowIndex)
|
|
168
|
-
);
|
|
169
|
-
};
|
|
170
|
-
const renderCellContent = (row, slot, rowIndex) => {
|
|
171
|
-
var _a;
|
|
172
|
-
return ((_a = slot.props) == null ? void 0 : _a.type) === "selection" ? h(
|
|
173
|
-
"label",
|
|
174
|
-
{
|
|
175
|
-
class: "px-1 flex",
|
|
176
|
-
for: "checkbox"
|
|
177
|
-
},
|
|
178
|
-
h("input", {
|
|
179
|
-
type: "checkbox",
|
|
180
|
-
value: props.idKey ? row[props.idKey] : rowIndex,
|
|
181
|
-
onChange: (event) => {
|
|
182
|
-
const target = event.target;
|
|
183
|
-
const rowKey = props.idKey ? row[props.idKey] : rowIndex;
|
|
184
|
-
target.checked ? choosedSet.value.add(rowKey) : choosedSet.value.delete(rowKey);
|
|
185
|
-
},
|
|
186
|
-
checked: choosedSet.value.has(
|
|
187
|
-
props.idKey ? row[props.idKey] : rowIndex
|
|
188
|
-
),
|
|
189
|
-
class: "appearance-none form-tick h-4 w-4 border border-gray-300 rounded checked:border-transparent checked:bg-blue-600 text-red-600 focus:outline-none "
|
|
190
|
-
})
|
|
191
|
-
) : trRenderHandle(row, slot, rowIndex);
|
|
192
|
-
};
|
|
193
|
-
const cellClasses = (props2) => {
|
|
194
|
-
return normalizeClass([
|
|
195
|
-
"text-center py-2",
|
|
196
|
-
props2 == null ? void 0 : props2.cellclass,
|
|
197
|
-
(props2 == null ? void 0 : props2.align) === "right" ? "text-right" : "text-left"
|
|
198
|
-
]);
|
|
199
|
-
};
|
|
200
|
-
const getRowKey = (row, index) => {
|
|
201
|
-
return props.idKey ? row[props.idKey] : `row-${index}`;
|
|
202
|
-
};
|
|
203
|
-
const renderBody = () => {
|
|
204
|
-
const { data } = props;
|
|
205
|
-
const prepend = prependSlots.value;
|
|
206
|
-
const append = appendSlots.value;
|
|
207
|
-
const rest = restSlots.value;
|
|
208
|
-
const colSpan = rest.length;
|
|
209
|
-
const renderRow = (row, index) => {
|
|
210
|
-
return [
|
|
211
|
-
// 前置插槽渲染
|
|
212
|
-
...renderSlotRows(prepend, row, index, colSpan, "pre"),
|
|
213
|
-
// 主体行
|
|
214
|
-
renderMainRow(row, index),
|
|
215
|
-
// 后置插槽渲染
|
|
216
|
-
...renderSlotRows(append, row, index, colSpan, "next")
|
|
217
|
-
];
|
|
218
|
-
};
|
|
219
|
-
return h("tbody", data.map(renderRow));
|
|
220
|
-
};
|
|
221
|
-
const trRenderHandle = (row, it, i) => {
|
|
222
|
-
return h(
|
|
223
|
-
"div",
|
|
224
|
-
null,
|
|
225
|
-
it.children && it.children.default ? it.children.default({
|
|
226
|
-
row,
|
|
227
|
-
index: i
|
|
228
|
-
}) : row[it.props.prop] || props.whiteword
|
|
229
|
-
);
|
|
207
|
+
const checkChange = (event, row, index) => {
|
|
208
|
+
const target = event.target;
|
|
209
|
+
const rowKey = props.idKey ? row[props.idKey] : index;
|
|
210
|
+
target.checked ? choosedSet.value.add(rowKey) : choosedSet.value.delete(rowKey);
|
|
211
|
+
emitSelection();
|
|
230
212
|
};
|
|
231
213
|
__expose({
|
|
232
214
|
clearSelection,
|
|
@@ -242,9 +224,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
242
224
|
newSet.add(key);
|
|
243
225
|
}
|
|
244
226
|
choosedSet.value = newSet;
|
|
227
|
+
emitSelection();
|
|
245
228
|
},
|
|
246
229
|
setSelection: (arr) => {
|
|
247
230
|
choosedSet.value = new Set(arr);
|
|
231
|
+
emitSelection();
|
|
248
232
|
}
|
|
249
233
|
});
|
|
250
234
|
return (_ctx, _cache) => {
|
|
@@ -252,15 +236,86 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
252
236
|
createElementVNode("table", {
|
|
253
237
|
class: normalizeClass(["w-full text-sm", _ctx.tableclass])
|
|
254
238
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
239
|
+
createElementVNode("colgroup", null, [
|
|
240
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cachedSlots.value, (i, j) => {
|
|
241
|
+
return openBlock(), createElementBlock("col", {
|
|
242
|
+
width: i.width,
|
|
243
|
+
key: j
|
|
244
|
+
}, null, 8, _hoisted_1);
|
|
245
|
+
}), 128))
|
|
258
246
|
]),
|
|
259
|
-
|
|
247
|
+
_ctx.showHead ? (openBlock(), createElementBlock("thead", {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: normalizeClass(["text-word6", _ctx.headclass])
|
|
250
|
+
}, [
|
|
251
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(cachedSlots.value, (i, j) => {
|
|
252
|
+
return openBlock(), createElementBlock("th", {
|
|
253
|
+
class: "font-normal h-10 border-b",
|
|
254
|
+
key: j
|
|
255
|
+
}, [
|
|
256
|
+
i.type === "selection" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
257
|
+
!_ctx.outSideCheck ? withDirectives((openBlock(), createElementBlock("input", {
|
|
258
|
+
key: 0,
|
|
259
|
+
type: "checkbox",
|
|
260
|
+
class: "appearance-none form-tick h-4 w-4 border border-gray-300 rounded checked:border-transparent checked:bg-blue-600 focus:outline-none",
|
|
261
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => allSelect.value = $event)
|
|
262
|
+
}, null, 512)), [
|
|
263
|
+
[vModelCheckbox, allSelect.value]
|
|
264
|
+
]) : createCommentVNode("", true)
|
|
265
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
266
|
+
createTextVNode(toDisplayString(i.label), 1)
|
|
267
|
+
], 64))
|
|
268
|
+
]);
|
|
269
|
+
}), 128))
|
|
270
|
+
], 2)) : createCommentVNode("", true),
|
|
271
|
+
createElementVNode("tbody", null, [
|
|
272
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data, (rowdata, rowindex) => {
|
|
273
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
274
|
+
key: getRowKey(rowdata, rowindex)
|
|
275
|
+
}, [
|
|
276
|
+
prependSlot.value ? (openBlock(), createElementBlock("tr", _hoisted_2, [
|
|
277
|
+
createElementVNode("td", { colspan: colSpan.value }, [
|
|
278
|
+
(openBlock(), createBlock(dynamicPre, {
|
|
279
|
+
row: markRaw(rowdata),
|
|
280
|
+
index: rowindex,
|
|
281
|
+
key: getPreRowkey(rowdata, rowindex)
|
|
282
|
+
}, null, 8, ["row", "index"]))
|
|
283
|
+
], 8, _hoisted_3)
|
|
284
|
+
])) : createCommentVNode("", true),
|
|
285
|
+
createElementVNode("tr", _hoisted_4, [
|
|
286
|
+
hascheckSlot.value ? (openBlock(), createElementBlock("td", _hoisted_5, [
|
|
287
|
+
createElementVNode("label", _hoisted_6, [
|
|
288
|
+
createElementVNode("input", {
|
|
289
|
+
type: "checkbox",
|
|
290
|
+
checked: choosedSet.value.has(_ctx.idKey ? rowdata[_ctx.idKey] : rowindex),
|
|
291
|
+
onChange: ($event) => checkChange($event, rowdata, rowindex),
|
|
292
|
+
class: "appearance-none form-tick h-4 w-4 border border-gray-300 rounded checked:border-transparent checked:bg-blue-600 text-red-600 focus:outline-none"
|
|
293
|
+
}, null, 40, _hoisted_7)
|
|
294
|
+
])
|
|
295
|
+
])) : createCommentVNode("", true),
|
|
296
|
+
hasindexSlot.value ? (openBlock(), createElementBlock("td", _hoisted_8, [
|
|
297
|
+
createElementVNode("div", null, toDisplayString(rowindex + 1), 1)
|
|
298
|
+
])) : createCommentVNode("", true),
|
|
299
|
+
(openBlock(), createBlock(dynormalRenderHandle, {
|
|
300
|
+
row: markRaw(rowdata),
|
|
301
|
+
rowindex,
|
|
302
|
+
key: getRowKey(rowdata, rowindex)
|
|
303
|
+
}, null, 8, ["row", "rowindex"]))
|
|
304
|
+
]),
|
|
305
|
+
appendSlot.value ? (openBlock(), createElementBlock("tr", _hoisted_9, [
|
|
306
|
+
createElementVNode("td", { colspan: colSpan.value }, [
|
|
307
|
+
(openBlock(), createBlock(dynamicAppend, {
|
|
308
|
+
row: markRaw(rowdata),
|
|
309
|
+
index: rowindex,
|
|
310
|
+
key: getAppendRowkey(rowdata, rowindex)
|
|
311
|
+
}, null, 8, ["row", "index"]))
|
|
312
|
+
], 8, _hoisted_10)
|
|
313
|
+
])) : createCommentVNode("", true)
|
|
314
|
+
], 64);
|
|
315
|
+
}), 128))
|
|
316
|
+
])
|
|
260
317
|
], 2),
|
|
261
|
-
|
|
262
|
-
[vShow, !hasData.value]
|
|
263
|
-
])
|
|
318
|
+
!hasData.value ? (openBlock(), createElementBlock("div", _hoisted_11, "暂无数据")) : createCommentVNode("", true)
|
|
264
319
|
], 64);
|
|
265
320
|
};
|
|
266
321
|
}
|
package/dist/js/tabs/tabs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ninemoon-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.10",
|
|
5
5
|
"author": "zhuboy",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"vue3",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"main": "dist/index.es.js",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
21
|
+
"@vue/runtime-core": "^3.5.13",
|
|
21
22
|
"autoprefixer": "^10.4.14",
|
|
22
23
|
"postcss": "^8.4.27",
|
|
23
24
|
"sass": "^1.64.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ObjectDirective } from 'vue';
|
|
2
|
-
|
|
3
|
-
interface BgPictureDirectiveOptions {
|
|
4
|
-
onBgPicture: (e: MouseEvent) => void;
|
|
5
|
-
}
|
|
6
|
-
interface bgPictureDom extends HTMLElement {
|
|
7
|
-
_bgPicture_handlers_?: {
|
|
8
|
-
bgPicture: (e: MouseEvent) => void;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export declare const createBgClickeDirective: (options: Partial<BgPictureDirectiveOptions>) => ObjectDirective<bgPictureDom, any>;
|
|
12
|
-
export {};
|
package/dist/index.css
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
.alertOpecity-enter-from{
|
|
3
|
-
position: absolute;
|
|
4
|
-
opacity: 0.5
|
|
5
|
-
}
|
|
6
|
-
.alertOpecity-enter-active,
|
|
7
|
-
.alertOpecity-leave-active{
|
|
8
|
-
transition-property: opacity;
|
|
9
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
10
|
-
transition-duration: 300ms
|
|
11
|
-
/* 300ms 与 JS 清理时间一致 */
|
|
12
|
-
}
|
|
13
|
-
.alertOpecity-enter,
|
|
14
|
-
.alertOpecity-leave-to{
|
|
15
|
-
opacity: 0
|
|
16
|
-
}.circular {
|
|
17
|
-
animation: rotate 2s linear infinite;
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0px;
|
|
20
|
-
right: 0px;
|
|
21
|
-
left: 0px;
|
|
22
|
-
bottom: 0px;
|
|
23
|
-
height: 100%;
|
|
24
|
-
width: 100%;
|
|
25
|
-
transform-origin: center;
|
|
26
|
-
}
|
|
27
|
-
.circular .path {
|
|
28
|
-
stroke-dasharray: 1, 200;
|
|
29
|
-
stroke-dashoffset: 0;
|
|
30
|
-
animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
|
|
31
|
-
stroke-linecap: round;
|
|
32
|
-
}
|
|
33
|
-
@keyframes rotate {
|
|
34
|
-
100% {
|
|
35
|
-
transform: rotate(360deg);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
@keyframes dash {
|
|
39
|
-
0% {
|
|
40
|
-
stroke-dasharray: 1, 200;
|
|
41
|
-
stroke-dashoffset: 0;
|
|
42
|
-
}
|
|
43
|
-
50% {
|
|
44
|
-
stroke-dasharray: 89, 200;
|
|
45
|
-
stroke-dashoffset: -35px;
|
|
46
|
-
}
|
|
47
|
-
100% {
|
|
48
|
-
stroke-dasharray: 89, 200;
|
|
49
|
-
stroke-dashoffset: -124px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
@keyframes color {
|
|
53
|
-
100%, 0% {
|
|
54
|
-
stroke: #d62d20;
|
|
55
|
-
}
|
|
56
|
-
40% {
|
|
57
|
-
stroke: #0057e7;
|
|
58
|
-
}
|
|
59
|
-
66% {
|
|
60
|
-
stroke: #008744;
|
|
61
|
-
}
|
|
62
|
-
80%, 90% {
|
|
63
|
-
stroke: #ffa700;
|
|
64
|
-
}
|
|
65
|
-
}.form-tick:checked {
|
|
66
|
-
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z'/%3e%3c/svg%3e");
|
|
67
|
-
border-color: transparent;
|
|
68
|
-
background-size: 100% 100%;
|
|
69
|
-
background-position: 50%;
|
|
70
|
-
background-repeat: no-repeat;
|
|
71
|
-
}
|
|
72
|
-
.fade-enter-active,
|
|
73
|
-
.fade-leave-active {
|
|
74
|
-
transition: opacity 0.2s ease;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.fade-enter-from,
|
|
78
|
-
.fade-leave-to {
|
|
79
|
-
opacity: 0;
|
|
80
|
-
}
|