@jetlinks-web/components 2.4.25 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/EditTable/Body.js +91 -181
- package/es/EditTable/EditTable.js +178 -105
- package/es/EditTable/FormItem.js +3 -4
- package/es/EditTable/Header.js +56 -164
- package/es/EditTable/components/ContextMenu/Menu.js +11 -7
- package/es/EditTable/components/Search/index.js +2 -1
- package/es/EditTable/components/Search/{Search.js → search.js} +94 -66
- package/es/EditTable/components/Search/sort.js +214 -0
- package/es/EditTable/consts.js +6 -1
- package/es/EditTable/context.js +50 -0
- package/es/EditTable/group.js +355 -0
- package/es/EditTable/hooks/index.js +1 -0
- package/es/EditTable/hooks/useGroup.js +44 -0
- package/es/EditTable/props.js +14 -4
- package/es/EditTable/style/body.less +17 -27
- package/es/EditTable/style/form.less +33 -0
- package/es/EditTable/style/group.less +32 -0
- package/es/EditTable/style/header.less +16 -21
- package/es/EditTable/style/index.css +103 -66
- package/es/EditTable/style/index.less +3 -0
- package/es/EditTable/style/menu.less +25 -0
- package/es/EditTable/style/table.less +2 -11
- package/es/EditTable/utils.js +22 -50
- package/es/FullPage/FullPage.js +1 -1
- package/es/PermissionButton/index.js +40 -20
- package/es/RadioButton/RadioButton.js +1 -1
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/es/locale/en-US.js +39 -3
- package/es/locale/zh-CN.js +36 -0
- package/es/style/index.css +103 -66
- package/lib/EditTable/Body.js +91 -181
- package/lib/EditTable/EditTable.js +178 -105
- package/lib/EditTable/FormItem.js +3 -4
- package/lib/EditTable/Header.js +56 -164
- package/lib/EditTable/components/ContextMenu/Menu.js +11 -7
- package/lib/EditTable/components/Search/index.js +10 -3
- package/lib/EditTable/components/Search/{Search.js → search.js} +94 -66
- package/lib/EditTable/components/Search/sort.js +214 -0
- package/lib/EditTable/consts.js +7 -2
- package/lib/EditTable/context.js +56 -0
- package/lib/EditTable/group.js +355 -0
- package/lib/EditTable/hooks/index.js +12 -0
- package/lib/EditTable/hooks/useGroup.js +50 -0
- package/lib/EditTable/props.js +14 -4
- package/lib/EditTable/style/body.less +17 -27
- package/lib/EditTable/style/form.less +33 -0
- package/lib/EditTable/style/group.less +32 -0
- package/lib/EditTable/style/header.less +16 -21
- package/lib/EditTable/style/index.css +103 -66
- package/lib/EditTable/style/index.less +3 -0
- package/lib/EditTable/style/menu.less +25 -0
- package/lib/EditTable/style/table.less +2 -11
- package/lib/EditTable/utils.js +23 -51
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/PermissionButton/index.js +40 -20
- package/lib/RadioButton/RadioButton.js +1 -1
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/lib/locale/en-US.js +39 -3
- package/lib/locale/zh-CN.js +36 -0
- package/lib/style/index.css +103 -66
- package/package.json +2 -2
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
17
|
+
/* Analyzed bindings: {
|
|
18
|
+
"options": "props",
|
|
19
|
+
"activeKey": "props",
|
|
20
|
+
"readonly": "props",
|
|
21
|
+
"Modal": "setup-maybe-ref",
|
|
22
|
+
"randomNumber": "setup-maybe-ref",
|
|
23
|
+
"isFullScreen": "setup-maybe-ref",
|
|
24
|
+
"useTableGroupError": "setup-maybe-ref",
|
|
25
|
+
"useTableWrapper": "setup-maybe-ref",
|
|
26
|
+
"ref": "setup-const",
|
|
27
|
+
"defineOptions": "setup-const",
|
|
28
|
+
"useLocaleReceiver": "setup-maybe-ref",
|
|
29
|
+
"props": "setup-reactive-const",
|
|
30
|
+
"emit": "setup-const",
|
|
31
|
+
"contextLocale": "setup-maybe-ref",
|
|
32
|
+
"myActiveKey": "setup-ref",
|
|
33
|
+
"visible": "setup-ref",
|
|
34
|
+
"type": "setup-ref",
|
|
35
|
+
"errorMap": "setup-maybe-ref",
|
|
36
|
+
"tableWrapperRef": "setup-maybe-ref",
|
|
37
|
+
"addIndex": "setup-ref",
|
|
38
|
+
"formRef": "setup-ref",
|
|
39
|
+
"formData": "setup-maybe-ref",
|
|
40
|
+
"onAdd": "setup-const",
|
|
41
|
+
"onEdit": "setup-const",
|
|
42
|
+
"onCancel": "setup-const",
|
|
43
|
+
"onOk": "setup-const",
|
|
44
|
+
"change": "setup-const",
|
|
45
|
+
"menuClick": "setup-const",
|
|
46
|
+
"popContainer": "setup-const",
|
|
47
|
+
"modalContainer": "setup-const"
|
|
48
|
+
} */
|
|
49
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, createBlock as _createBlock, createCommentVNode as _createCommentVNode, vShow as _vShow, withDirectives as _withDirectives } from "vue";
|
|
50
|
+
const _hoisted_1 = { class: "jetlinks-table-group-warp" };
|
|
51
|
+
const _hoisted_2 = { class: "jetlinks-table-group-error-warp" };
|
|
52
|
+
const _hoisted_3 = { style: { "color": "#1d2129" } };
|
|
53
|
+
const _hoisted_4 = /*#__PURE__*/ _createElementVNode("div", { class: "jetlinks-table-group-error-target" }, null, -1 /* HOISTED */);
|
|
54
|
+
const _hoisted_5 = {
|
|
55
|
+
key: 1,
|
|
56
|
+
class: "jetlinks-table-group-error-warp"
|
|
57
|
+
};
|
|
58
|
+
const _hoisted_6 = { style: { "color": "#1d2129" } };
|
|
59
|
+
const _hoisted_7 = /*#__PURE__*/ _createElementVNode("div", { class: "jetlinks-table-group-error-target" }, null, -1 /* HOISTED */);
|
|
60
|
+
import { Modal } from "ant-design-vue";
|
|
61
|
+
import { randomNumber } from "@jetlinks-web/utils";
|
|
62
|
+
import { isFullScreen } from "./utils";
|
|
63
|
+
import { useTableGroupError, useTableWrapper } from './context';
|
|
64
|
+
import { ref, } from 'vue';
|
|
65
|
+
import { useLocaleReceiver } from "../LocaleReciver";
|
|
66
|
+
const __sfc_main__ = Object.assign({
|
|
67
|
+
name: 'JEditTableGroup'
|
|
68
|
+
}, {
|
|
69
|
+
props: {
|
|
70
|
+
options: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: () => []
|
|
73
|
+
},
|
|
74
|
+
activeKey: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: undefined
|
|
77
|
+
},
|
|
78
|
+
readonly: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: false
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
emits: ['delete', 'edit', 'add', 'change', 'update:activeKey'],
|
|
84
|
+
setup(__props, { emit: __emit }) {
|
|
85
|
+
const props = __props;
|
|
86
|
+
const emit = __emit;
|
|
87
|
+
const [contextLocale] = useLocaleReceiver('EditTable');
|
|
88
|
+
const myActiveKey = ref(props.activeKey);
|
|
89
|
+
const visible = ref(false);
|
|
90
|
+
const type = ref(contextLocale.value.Group.addGroup);
|
|
91
|
+
const errorMap = useTableGroupError();
|
|
92
|
+
const tableWrapperRef = useTableWrapper();
|
|
93
|
+
const addIndex = ref(0);
|
|
94
|
+
const formRef = ref();
|
|
95
|
+
const formData = reactive({
|
|
96
|
+
label: undefined
|
|
97
|
+
});
|
|
98
|
+
const onAdd = (targetKey, action) => {
|
|
99
|
+
// if(props.readonly) return
|
|
100
|
+
if (action === 'add') {
|
|
101
|
+
type.value = 'add';
|
|
102
|
+
// 获取上一个包含 “分组_” 的信息
|
|
103
|
+
const groupName = props.options.filter(item => item.label.includes(contextLocale.value.Group.one));
|
|
104
|
+
let index = addIndex.value + 1;
|
|
105
|
+
let findStatus = false;
|
|
106
|
+
while (!findStatus) {
|
|
107
|
+
const status = groupName.some(item => {
|
|
108
|
+
const [_, _index] = item.label.split('_');
|
|
109
|
+
if (index === Number(_index)) {
|
|
110
|
+
index = Number(_index) + 1;
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
});
|
|
115
|
+
findStatus = !status;
|
|
116
|
+
}
|
|
117
|
+
addIndex.value = index;
|
|
118
|
+
formData.label = contextLocale.value.Group.one + index;
|
|
119
|
+
onOk();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const onEdit = (record) => {
|
|
123
|
+
visible.value = true;
|
|
124
|
+
type.value = 'edit';
|
|
125
|
+
formData.label = record.label;
|
|
126
|
+
};
|
|
127
|
+
const onCancel = () => {
|
|
128
|
+
formRef.value.resetFields();
|
|
129
|
+
visible.value = false;
|
|
130
|
+
};
|
|
131
|
+
const onOk = () => {
|
|
132
|
+
const data = { ...formData };
|
|
133
|
+
if (type.value === 'add') {
|
|
134
|
+
data.value = 'group_' + randomNumber();
|
|
135
|
+
myActiveKey.value = data.value;
|
|
136
|
+
emit(type.value, data);
|
|
137
|
+
emit('change', data.value, data.label);
|
|
138
|
+
emit('update:activeKey', data.value);
|
|
139
|
+
visible.value = false;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
formRef.value.validate().then(() => {
|
|
143
|
+
data.value = myActiveKey.value;
|
|
144
|
+
emit(type.value, data);
|
|
145
|
+
emit('change', data.value, data.label);
|
|
146
|
+
visible.value = false;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const change = () => {
|
|
151
|
+
const item = props.options.find(item => item.value === myActiveKey.value);
|
|
152
|
+
emit('change', myActiveKey.value, item.label);
|
|
153
|
+
emit('update:activeKey', myActiveKey.value);
|
|
154
|
+
};
|
|
155
|
+
const menuClick = (e, record) => {
|
|
156
|
+
if (props.readonly)
|
|
157
|
+
return;
|
|
158
|
+
if (e.key === 'edit') {
|
|
159
|
+
onEdit(record);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
Modal.confirm({
|
|
163
|
+
title: contextLocale.value.Group.deleteMessage,
|
|
164
|
+
onOk: () => {
|
|
165
|
+
// activeKey 根据数据长度进行左右移动
|
|
166
|
+
const index = props.options.findIndex(item => item.value === record.value);
|
|
167
|
+
let label = '';
|
|
168
|
+
if (index !== 0 && index === props.options.length - 1) {
|
|
169
|
+
myActiveKey.value = props.options[index - 1].value;
|
|
170
|
+
label = props.options[index - 1].label;
|
|
171
|
+
}
|
|
172
|
+
else if (index === 0 && props.options.length === 1) {
|
|
173
|
+
myActiveKey.value = props.options[0].value;
|
|
174
|
+
label = props.options[0].label;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
myActiveKey.value = props.options[index + 1].value;
|
|
178
|
+
label = props.options[index + 1].label;
|
|
179
|
+
}
|
|
180
|
+
emit('delete', record.value, index);
|
|
181
|
+
emit('change', myActiveKey.value, label);
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const popContainer = (e) => {
|
|
187
|
+
return tableWrapperRef.value || e;
|
|
188
|
+
};
|
|
189
|
+
const modalContainer = (e) => {
|
|
190
|
+
if (isFullScreen()) {
|
|
191
|
+
return tableWrapperRef.value || document.body;
|
|
192
|
+
}
|
|
193
|
+
return document.body;
|
|
194
|
+
};
|
|
195
|
+
onMounted(() => {
|
|
196
|
+
myActiveKey.value = _optionalChain([props, 'access', _2 => _2.options, 'access', _3 => _3[0], 'optionalAccess', _4 => _4.value]);
|
|
197
|
+
emit('change', myActiveKey.value, _optionalChain([props, 'access', _5 => _5.options, 'access', _6 => _6[0], 'optionalAccess', _7 => _7.label]));
|
|
198
|
+
emit('update:activeKey', myActiveKey.value);
|
|
199
|
+
});
|
|
200
|
+
watch(() => props.activeKey, (val) => {
|
|
201
|
+
myActiveKey.value = val;
|
|
202
|
+
});
|
|
203
|
+
return (_ctx, _cache) => {
|
|
204
|
+
const _component_a_menu_item = _resolveComponent("a-menu-item");
|
|
205
|
+
const _component_a_menu = _resolveComponent("a-menu");
|
|
206
|
+
const _component_a_tooltip = _resolveComponent("a-tooltip");
|
|
207
|
+
const _component_a_dropdown = _resolveComponent("a-dropdown");
|
|
208
|
+
const _component_a_tab_pane = _resolveComponent("a-tab-pane");
|
|
209
|
+
const _component_a_tabs = _resolveComponent("a-tabs");
|
|
210
|
+
const _component_a_input = _resolveComponent("a-input");
|
|
211
|
+
const _component_a_form_item = _resolveComponent("a-form-item");
|
|
212
|
+
const _component_a_button = _resolveComponent("a-button");
|
|
213
|
+
const _component_a_form = _resolveComponent("a-form");
|
|
214
|
+
const _component_a_modal = _resolveComponent("a-modal");
|
|
215
|
+
return (_openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
216
|
+
_createVNode(_component_a_tabs, {
|
|
217
|
+
type: "editable-card",
|
|
218
|
+
activeKey: myActiveKey.value,
|
|
219
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = $event => ((myActiveKey).value = $event)),
|
|
220
|
+
onEdit: onAdd,
|
|
221
|
+
hideAdd: __props.readonly,
|
|
222
|
+
onChange: change
|
|
223
|
+
}, {
|
|
224
|
+
default: _withCtx(() => [
|
|
225
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, (item) => {
|
|
226
|
+
return (_openBlock(), _createBlock(_component_a_tab_pane, {
|
|
227
|
+
key: item.value,
|
|
228
|
+
closable: false
|
|
229
|
+
}, {
|
|
230
|
+
tab: _withCtx(() => [
|
|
231
|
+
(myActiveKey.value === item.value)
|
|
232
|
+
? (_openBlock(), _createBlock(_component_a_dropdown, {
|
|
233
|
+
key: 0,
|
|
234
|
+
trigger: ['click'],
|
|
235
|
+
getPopupContainer: (node) => _unref(tableWrapperRef) || node,
|
|
236
|
+
disabled: __props.readonly
|
|
237
|
+
}, {
|
|
238
|
+
overlay: _withCtx(() => [
|
|
239
|
+
_createVNode(_component_a_menu, {
|
|
240
|
+
onClick: (e) => { menuClick(e, item); }
|
|
241
|
+
}, {
|
|
242
|
+
default: _withCtx(() => [
|
|
243
|
+
_createVNode(_component_a_menu_item, { key: "edit" }, {
|
|
244
|
+
default: _withCtx(() => [
|
|
245
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).Group.edit), 1 /* TEXT */)
|
|
246
|
+
]),
|
|
247
|
+
_: 1 /* STABLE */
|
|
248
|
+
}),
|
|
249
|
+
_createVNode(_component_a_menu_item, { key: "delete" }, {
|
|
250
|
+
default: _withCtx(() => [
|
|
251
|
+
_createTextVNode(_toDisplayString(_unref(contextLocale).Group.delete), 1 /* TEXT */)
|
|
252
|
+
]),
|
|
253
|
+
_: 1 /* STABLE */
|
|
254
|
+
})
|
|
255
|
+
]),
|
|
256
|
+
_: 2 /* DYNAMIC */
|
|
257
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])
|
|
258
|
+
]),
|
|
259
|
+
default: _withCtx(() => [
|
|
260
|
+
_createElementVNode("div", _hoisted_2, [
|
|
261
|
+
_createTextVNode(_toDisplayString(item.label) + " (" + _toDisplayString(item.effective) + ") ", 1 /* TEXT */),
|
|
262
|
+
(_unref(errorMap)[item.value])
|
|
263
|
+
? (_openBlock(), _createBlock(_component_a_tooltip, {
|
|
264
|
+
key: 0,
|
|
265
|
+
color: "#ffffff",
|
|
266
|
+
arrowPointAtCenter: true,
|
|
267
|
+
"get-popup-container": popContainer
|
|
268
|
+
}, {
|
|
269
|
+
title: _withCtx(() => [
|
|
270
|
+
_createElementVNode("span", _hoisted_3, _toDisplayString(_unref(contextLocale).Group.validate), 1 /* TEXT */)
|
|
271
|
+
]),
|
|
272
|
+
default: _withCtx(() => [
|
|
273
|
+
_hoisted_4
|
|
274
|
+
]),
|
|
275
|
+
_: 1 /* STABLE */
|
|
276
|
+
}))
|
|
277
|
+
: _createCommentVNode("v-if", true)
|
|
278
|
+
])
|
|
279
|
+
]),
|
|
280
|
+
_: 2 /* DYNAMIC */
|
|
281
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["getPopupContainer", "disabled"]))
|
|
282
|
+
: (_openBlock(), _createElementBlock("div", _hoisted_5, [
|
|
283
|
+
_createTextVNode(_toDisplayString(item.label) + " (" + _toDisplayString(item.effective) + ") ", 1 /* TEXT */),
|
|
284
|
+
(_unref(errorMap)[item.value])
|
|
285
|
+
? (_openBlock(), _createBlock(_component_a_tooltip, {
|
|
286
|
+
key: 0,
|
|
287
|
+
color: "#ffffff",
|
|
288
|
+
arrowPointAtCenter: true,
|
|
289
|
+
getContainer: popContainer
|
|
290
|
+
}, {
|
|
291
|
+
title: _withCtx(() => [
|
|
292
|
+
_createElementVNode("span", _hoisted_6, _toDisplayString(_unref(contextLocale).Group.validate), 1 /* TEXT */)
|
|
293
|
+
]),
|
|
294
|
+
default: _withCtx(() => [
|
|
295
|
+
_hoisted_7
|
|
296
|
+
]),
|
|
297
|
+
_: 1 /* STABLE */
|
|
298
|
+
}))
|
|
299
|
+
: _createCommentVNode("v-if", true)
|
|
300
|
+
]))
|
|
301
|
+
]),
|
|
302
|
+
_: 2 /* DYNAMIC */
|
|
303
|
+
}, 1024 /* DYNAMIC_SLOTS */));
|
|
304
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
305
|
+
]),
|
|
306
|
+
_: 1 /* STABLE */
|
|
307
|
+
}, 8 /* PROPS */, ["activeKey", "hideAdd"]),
|
|
308
|
+
_createVNode(_component_a_modal, {
|
|
309
|
+
visible: visible.value,
|
|
310
|
+
title: _unref(contextLocale).Group.editGroup,
|
|
311
|
+
maskClosable: false,
|
|
312
|
+
getContainer: modalContainer,
|
|
313
|
+
onCancel: onCancel,
|
|
314
|
+
onOk: onOk
|
|
315
|
+
}, {
|
|
316
|
+
default: _withCtx(() => [
|
|
317
|
+
_createVNode(_component_a_form, {
|
|
318
|
+
ref_key: "formRef",
|
|
319
|
+
ref: formRef,
|
|
320
|
+
model: _unref(formData),
|
|
321
|
+
onFinish: onOk
|
|
322
|
+
}, {
|
|
323
|
+
default: _withCtx(() => [
|
|
324
|
+
_createVNode(_component_a_form_item, {
|
|
325
|
+
name: "label",
|
|
326
|
+
rules: [{ required: true, message: _unref(contextLocale).Group.placeholder }, { max: 16, message: _unref(contextLocale).Group.max }]
|
|
327
|
+
}, {
|
|
328
|
+
default: _withCtx(() => [
|
|
329
|
+
_createVNode(_component_a_input, {
|
|
330
|
+
value: _unref(formData).label,
|
|
331
|
+
"onUpdate:value": _cache[1] || (_cache[1] = $event => ((_unref(formData).label) = $event)),
|
|
332
|
+
placeholder: _unref(contextLocale).Group.placeholder
|
|
333
|
+
}, null, 8 /* PROPS */, ["value", "placeholder"])
|
|
334
|
+
]),
|
|
335
|
+
_: 1 /* STABLE */
|
|
336
|
+
}, 8 /* PROPS */, ["rules"]),
|
|
337
|
+
_withDirectives(_createVNode(_component_a_form_item, null, {
|
|
338
|
+
default: _withCtx(() => [
|
|
339
|
+
_createVNode(_component_a_button, { "html-type": "submit" })
|
|
340
|
+
]),
|
|
341
|
+
_: 1 /* STABLE */
|
|
342
|
+
}, 512 /* NEED_PATCH */), [
|
|
343
|
+
[_vShow, false]
|
|
344
|
+
])
|
|
345
|
+
]),
|
|
346
|
+
_: 1 /* STABLE */
|
|
347
|
+
}, 8 /* PROPS */, ["model"])
|
|
348
|
+
]),
|
|
349
|
+
_: 1 /* STABLE */
|
|
350
|
+
}, 8 /* PROPS */, ["visible", "title"])
|
|
351
|
+
]));
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
export default __sfc_main__;
|
|
@@ -41,6 +41,18 @@ Object.keys(_useValidate).forEach(function (key) {
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
|
+
var _useGroup = require("./useGroup");
|
|
45
|
+
Object.keys(_useGroup).forEach(function (key) {
|
|
46
|
+
if (key === "default" || key === "__esModule") return;
|
|
47
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
48
|
+
if (key in exports && exports[key] === _useGroup[key]) return;
|
|
49
|
+
Object.defineProperty(exports, key, {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _useGroup[key];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
44
56
|
var FormContextKey = 'form-context';
|
|
45
57
|
var useFormContext = exports.useFormContext = function useFormContext(options) {
|
|
46
58
|
(0, _vue.provide)(FormContextKey, options);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useGroup = void 0;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var useGroup = exports.useGroup = function useGroup() {
|
|
9
|
+
var openGroup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
10
|
+
var groupOptions = (0, _vue.ref)([]);
|
|
11
|
+
var groupActive = (0, _vue.reactive)({
|
|
12
|
+
value: undefined,
|
|
13
|
+
label: undefined
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* 更新当前选择的分组id
|
|
17
|
+
* @param key
|
|
18
|
+
* @param name
|
|
19
|
+
*/
|
|
20
|
+
var updateGroupActive = function updateGroupActive(key, name) {
|
|
21
|
+
if (openGroup) {
|
|
22
|
+
groupActive.value = key;
|
|
23
|
+
groupActive.label = name;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var addGroup = function addGroup(val) {
|
|
27
|
+
if (openGroup) {
|
|
28
|
+
groupOptions.value.push(val);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var removeGroup = function removeGroup(index) {
|
|
32
|
+
if (openGroup) {
|
|
33
|
+
groupOptions.value.splice(index, 1);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var updateGroupOptions = function updateGroupOptions() {
|
|
37
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
38
|
+
if (openGroup) {
|
|
39
|
+
groupOptions.value = options;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
groupOptions: groupOptions,
|
|
44
|
+
groupActive: groupActive,
|
|
45
|
+
updateGroupActive: updateGroupActive,
|
|
46
|
+
addGroup: addGroup,
|
|
47
|
+
removeGroup: removeGroup,
|
|
48
|
+
updateGroupOptions: updateGroupOptions
|
|
49
|
+
};
|
|
50
|
+
};
|
package/lib/EditTable/props.js
CHANGED
|
@@ -38,6 +38,12 @@ var bodyProps = exports.bodyProps = function bodyProps() {
|
|
|
38
38
|
return [];
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
columns: {
|
|
42
|
+
type: Array,
|
|
43
|
+
default: function _default() {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
},
|
|
41
47
|
cellHeight: {
|
|
42
48
|
type: Number,
|
|
43
49
|
default: 50
|
|
@@ -56,11 +62,15 @@ var bodyProps = exports.bodyProps = function bodyProps() {
|
|
|
56
62
|
type: Boolean,
|
|
57
63
|
default: true
|
|
58
64
|
},
|
|
59
|
-
|
|
60
|
-
type:
|
|
61
|
-
default:
|
|
65
|
+
rowKey: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'id'
|
|
62
68
|
},
|
|
63
|
-
|
|
69
|
+
openGroup: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
rowSelection: {
|
|
64
74
|
type: Object,
|
|
65
75
|
default: undefined
|
|
66
76
|
}
|
|
@@ -13,16 +13,15 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.jetlinks-edit-table-body-container {
|
|
16
|
-
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
height: 100%;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
.jetlinks-edit-table-center
|
|
20
|
+
.jetlinks-edit-table-center {
|
|
20
21
|
position: relative;
|
|
22
|
+
flex: 1 1 auto;
|
|
21
23
|
min-width: 0;
|
|
22
24
|
height: 100%;
|
|
23
|
-
z-index: 5;
|
|
24
|
-
flex-shrink: 0;
|
|
25
|
-
flex-grow: 0;
|
|
26
25
|
|
|
27
26
|
.jetlinks-edit-table-row {
|
|
28
27
|
width: 100%;
|
|
@@ -30,9 +29,12 @@
|
|
|
30
29
|
align-items: center;
|
|
31
30
|
transition: top .2s, height .2s, background-color .1s;
|
|
32
31
|
border-bottom: 1px solid #ebebeb;
|
|
33
|
-
|
|
32
|
+
.jetlinks-edit-table-cell{
|
|
33
|
+
position:absolute;
|
|
34
|
+
min-width: 0;;
|
|
35
|
+
}
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
&:hover {
|
|
36
38
|
background-color: rgb(248, 248, 248);
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -40,31 +42,19 @@
|
|
|
40
42
|
background-color: var(--ant-primary-1);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
.jetlinks-edit-table-cell {
|
|
44
|
-
min-width: 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
45
|
.body-cell-box {
|
|
48
46
|
padding: 0 12px;
|
|
49
47
|
position: relative;
|
|
50
48
|
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.jetlinks-edit-table-center {
|
|
65
|
-
z-index: 1;
|
|
66
|
-
> div {
|
|
67
|
-
position: relative;
|
|
50
|
+
.readonly-mask {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 0;
|
|
53
|
+
left: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
bottom: 0;
|
|
56
|
+
z-index: 4;
|
|
57
|
+
}
|
|
68
58
|
}
|
|
69
59
|
}
|
|
70
60
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.jetlinks-table-form-error-target {
|
|
2
|
+
position: absolute;
|
|
3
|
+
right: 2px;
|
|
4
|
+
top: -9px;
|
|
5
|
+
border: 16px solid transparent;
|
|
6
|
+
border-top-color: @error-color;
|
|
7
|
+
border-right-width: 0;
|
|
8
|
+
border-bottom-width: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.jetlinks-edit-table-form-has-error {
|
|
12
|
+
|
|
13
|
+
.select-no-value {
|
|
14
|
+
.ant-select-selector {
|
|
15
|
+
border-color: @error-color !important;
|
|
16
|
+
&:focus {
|
|
17
|
+
box-shadow: 0 0 0 2px var(--ant-error-color-outline) !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
> input {
|
|
23
|
+
border-color: @error-color !important;
|
|
24
|
+
|
|
25
|
+
&:focus {
|
|
26
|
+
box-shadow: 0 0 0 2px var(--ant-error-color-outline) !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.jetlinks-table-form-required-aicon {
|
|
31
|
+
color: @error-color;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.jetlinks-table-group-warp {
|
|
2
|
+
.ant-tabs-nav {
|
|
3
|
+
margin-bottom: 0;
|
|
4
|
+
.ant-tabs-tab {
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
.ant-tabs-tab-active {
|
|
9
|
+
background-color: #BAE0FF !important;
|
|
10
|
+
border-color: #91CAFF !important;
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ant-tabs-nav-add {
|
|
15
|
+
border: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.jetlinks-table-group-error-warp {
|
|
21
|
+
color: #1a1a1a !important;
|
|
22
|
+
|
|
23
|
+
.table-group-error-target {
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 0;
|
|
26
|
+
top: 0;
|
|
27
|
+
border: 16px solid transparent;
|
|
28
|
+
border-top-color: @error-color;
|
|
29
|
+
border-right-width: 0;
|
|
30
|
+
border-bottom-width: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
.jetlinks-edit-table-header-container {
|
|
2
2
|
height: 100%;
|
|
3
3
|
position: relative;
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 100%;
|
|
6
|
-
|
|
7
|
-
.jetlinks-header-left,& .jetlinks-header-center,& .jetlinks-header-right {
|
|
8
|
-
position: relative;
|
|
9
|
-
z-index: 5;
|
|
10
|
-
min-width: 0;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
background: #fafafa;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.jetlinks-header-center {
|
|
17
|
-
z-index: 2;
|
|
18
|
-
> div {
|
|
19
|
-
position: relative;
|
|
20
|
-
height: 100%;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
4
|
|
|
24
5
|
.jetlinks-edit-table-header-cell {
|
|
25
6
|
height: 100%;
|
|
@@ -27,12 +8,12 @@
|
|
|
27
8
|
align-items: center;
|
|
28
9
|
float: left;
|
|
29
10
|
overflow: visible;
|
|
30
|
-
|
|
11
|
+
position: absolute;
|
|
12
|
+
top: 0;
|
|
31
13
|
|
|
32
14
|
.jetlinks-edit-table-header-cell-box {
|
|
33
15
|
padding: 0 12px;
|
|
34
16
|
width: 100%;
|
|
35
|
-
position: relative;
|
|
36
17
|
|
|
37
18
|
&.header-cell-box-tool {
|
|
38
19
|
display: flex;
|
|
@@ -75,3 +56,17 @@
|
|
|
75
56
|
}
|
|
76
57
|
}
|
|
77
58
|
}
|
|
59
|
+
|
|
60
|
+
.jetlinks-table-search {
|
|
61
|
+
.jetlinks-table-search-header {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
.jetlinks-drag-modal-footer {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.jetlinks-table-search-result-total {
|
|
69
|
+
color: @primary-color;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|