@blueking/ediatable 0.0.1-beta.4 → 0.0.1-beta.6
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 +563 -0
- package/package.json +5 -1
- package/typings/components/date-time-picker-column.vue.d.ts +63 -0
- package/typings/components/head-column.vue.d.ts +17 -9
- package/typings/components/input-column.vue.d.ts +77 -0
- package/typings/components/operation-column.vue.d.ts +48 -0
- package/typings/components/select-column.vue.d.ts +65 -0
- package/typings/components/tag-input-column.vue.d.ts +60 -0
- package/typings/vue2.d.ts +13 -6
- package/typings/vue3.d.ts +7 -6
- package/vue2/index.es.min.js +267 -219
- package/vue2/index.iife.min.js +304 -256
- package/vue2/index.umd.min.js +304 -256
- package/vue2/vue2.css +38 -38
- package/vue3/index.es.min.js +251 -218
- package/vue3/index.iife.min.js +290 -257
- package/vue3/index.umd.min.js +288 -255
- package/vue3/vue3.css +38 -38
package/vue3/index.umd.min.js
CHANGED
|
@@ -40,6 +40,44 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
40
40
|
.icon-plus-fill:before {
|
|
41
41
|
content: "\\e102";
|
|
42
42
|
}
|
|
43
|
+
.bk-ediatable-head-column.is-required {
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
.bk-ediatable-head-column.is-required::after {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
margin-left: 4px;
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
line-height: 40px;
|
|
52
|
+
color: #ea3636;
|
|
53
|
+
content: '*';
|
|
54
|
+
}
|
|
55
|
+
.bk-ediatable-head-column.is-right-fixed {
|
|
56
|
+
position: sticky;
|
|
57
|
+
right: 1px;
|
|
58
|
+
}
|
|
59
|
+
.bk-ediatable-head-column.is-right-fixed::before {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: -10px;
|
|
63
|
+
width: 10px;
|
|
64
|
+
height: 100%;
|
|
65
|
+
background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
|
|
66
|
+
content: '';
|
|
67
|
+
}
|
|
68
|
+
.bk-ediatable-head-column.is-left-fixed {
|
|
69
|
+
position: sticky;
|
|
70
|
+
left: 1px;
|
|
71
|
+
}
|
|
72
|
+
.bk-ediatable-head-column.is-left-fixed::before {
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: 0;
|
|
75
|
+
right: -10px;
|
|
76
|
+
width: 10px;
|
|
77
|
+
height: 100%;
|
|
78
|
+
background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
|
|
79
|
+
content: '';
|
|
80
|
+
}
|
|
43
81
|
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}.tippy-box[data-theme~=light]{color:#26323d;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);background-color:#fff}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff}.bk-ediatable {
|
|
44
82
|
position: relative;
|
|
45
83
|
width: 100%;
|
|
@@ -253,44 +291,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
253
291
|
background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
|
|
254
292
|
content: '';
|
|
255
293
|
}
|
|
256
|
-
.bk-ediatable-head-column.is-required {
|
|
257
|
-
position: relative;
|
|
258
|
-
}
|
|
259
|
-
.bk-ediatable-head-column.is-required::after {
|
|
260
|
-
position: absolute;
|
|
261
|
-
top: 0;
|
|
262
|
-
margin-left: 4px;
|
|
263
|
-
font-size: 12px;
|
|
264
|
-
line-height: 40px;
|
|
265
|
-
color: #ea3636;
|
|
266
|
-
content: '*';
|
|
267
|
-
}
|
|
268
|
-
.bk-ediatable-head-column.is-right-fixed {
|
|
269
|
-
position: sticky;
|
|
270
|
-
right: 1px;
|
|
271
|
-
}
|
|
272
|
-
.bk-ediatable-head-column.is-right-fixed::before {
|
|
273
|
-
position: absolute;
|
|
274
|
-
top: 0;
|
|
275
|
-
left: -10px;
|
|
276
|
-
width: 10px;
|
|
277
|
-
height: 100%;
|
|
278
|
-
background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
|
|
279
|
-
content: '';
|
|
280
|
-
}
|
|
281
|
-
.bk-ediatable-head-column.is-left-fixed {
|
|
282
|
-
position: sticky;
|
|
283
|
-
left: 1px;
|
|
284
|
-
}
|
|
285
|
-
.bk-ediatable-head-column.is-left-fixed::before {
|
|
286
|
-
position: absolute;
|
|
287
|
-
top: 0;
|
|
288
|
-
right: -10px;
|
|
289
|
-
width: 10px;
|
|
290
|
-
height: 100%;
|
|
291
|
-
background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
|
|
292
|
-
content: '';
|
|
293
|
-
}
|
|
294
294
|
.bk-ediatable-operation {
|
|
295
295
|
display: flex;
|
|
296
296
|
height: 42px;
|
|
@@ -6090,11 +6090,208 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6090
6090
|
handleMouseMove
|
|
6091
6091
|
};
|
|
6092
6092
|
}
|
|
6093
|
-
const
|
|
6094
|
-
const
|
|
6093
|
+
const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
|
|
6094
|
+
const encodeMult = (text) => {
|
|
6095
|
+
const temp = document.createElement("textarea");
|
|
6096
|
+
temp.value = text;
|
|
6097
|
+
return temp.value;
|
|
6098
|
+
};
|
|
6099
|
+
function tryOnScopeDispose(fn) {
|
|
6100
|
+
if (vue.getCurrentScope()) {
|
|
6101
|
+
vue.onScopeDispose(fn);
|
|
6102
|
+
return true;
|
|
6103
|
+
}
|
|
6104
|
+
return false;
|
|
6105
|
+
}
|
|
6106
|
+
function toValue(r) {
|
|
6107
|
+
return typeof r === "function" ? r() : vue.unref(r);
|
|
6108
|
+
}
|
|
6109
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
6110
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
6111
|
+
function unrefElement(elRef) {
|
|
6112
|
+
var _a;
|
|
6113
|
+
const plain = toValue(elRef);
|
|
6114
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
6115
|
+
}
|
|
6116
|
+
const defaultWindow = isClient ? window : void 0;
|
|
6117
|
+
function useMounted() {
|
|
6118
|
+
const isMounted = vue.ref(false);
|
|
6119
|
+
const instance = vue.getCurrentInstance();
|
|
6120
|
+
if (instance) {
|
|
6121
|
+
vue.onMounted(() => {
|
|
6122
|
+
isMounted.value = true;
|
|
6123
|
+
}, instance);
|
|
6124
|
+
}
|
|
6125
|
+
return isMounted;
|
|
6126
|
+
}
|
|
6127
|
+
function useSupported(callback) {
|
|
6128
|
+
const isMounted = useMounted();
|
|
6129
|
+
return vue.computed(() => {
|
|
6130
|
+
isMounted.value;
|
|
6131
|
+
return Boolean(callback());
|
|
6132
|
+
});
|
|
6133
|
+
}
|
|
6134
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
6135
|
+
const { window: window2 = defaultWindow, ...observerOptions } = options;
|
|
6136
|
+
let observer;
|
|
6137
|
+
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
|
|
6138
|
+
const cleanup = () => {
|
|
6139
|
+
if (observer) {
|
|
6140
|
+
observer.disconnect();
|
|
6141
|
+
observer = void 0;
|
|
6142
|
+
}
|
|
6143
|
+
};
|
|
6144
|
+
const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
|
|
6145
|
+
const stopWatch = vue.watch(
|
|
6146
|
+
targets,
|
|
6147
|
+
(els) => {
|
|
6148
|
+
cleanup();
|
|
6149
|
+
if (isSupported.value && window2) {
|
|
6150
|
+
observer = new ResizeObserver(callback);
|
|
6151
|
+
for (const _el of els)
|
|
6152
|
+
_el && observer.observe(_el, observerOptions);
|
|
6153
|
+
}
|
|
6154
|
+
},
|
|
6155
|
+
{ immediate: true, flush: "post" }
|
|
6156
|
+
);
|
|
6157
|
+
const stop = () => {
|
|
6158
|
+
cleanup();
|
|
6159
|
+
stopWatch();
|
|
6160
|
+
};
|
|
6161
|
+
tryOnScopeDispose(stop);
|
|
6162
|
+
return {
|
|
6163
|
+
isSupported,
|
|
6164
|
+
stop
|
|
6165
|
+
};
|
|
6166
|
+
}
|
|
6167
|
+
const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
|
|
6168
|
+
const _hoisted_2$2 = { class: "th-cell" };
|
|
6169
|
+
const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
|
|
6095
6170
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
6171
|
+
__name: "head-column",
|
|
6172
|
+
props: {
|
|
6173
|
+
fixed: { default: void 0 },
|
|
6174
|
+
maxWidth: { default: void 0 },
|
|
6175
|
+
minWidth: { default: void 0 },
|
|
6176
|
+
required: { type: Boolean, default: true },
|
|
6177
|
+
width: { default: void 0 },
|
|
6178
|
+
renderAppend: { type: Function, default: void 0 }
|
|
6179
|
+
},
|
|
6180
|
+
setup(__props) {
|
|
6181
|
+
const props = __props;
|
|
6182
|
+
const slots = vue.useSlots();
|
|
6183
|
+
const { rowWidth, isOverflow: isMinimize } = vue.inject(renderTablekey);
|
|
6184
|
+
const parentTable = vue.inject(tableColumnResizekey);
|
|
6185
|
+
const columnRef = vue.ref();
|
|
6186
|
+
const currentWidth = vue.ref(0);
|
|
6187
|
+
const columnKey = random();
|
|
6188
|
+
let initWidthRate = 0;
|
|
6189
|
+
let isDragedSelf = false;
|
|
6190
|
+
const finalMinWidth = vue.computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
6191
|
+
const isFixedRight = vue.computed(() => props.fixed === "right");
|
|
6192
|
+
const isFixedLeft = vue.computed(() => props.fixed === "left");
|
|
6193
|
+
const styles = vue.computed(() => {
|
|
6194
|
+
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
6195
|
+
const newWidth = rowWidth.value * initWidthRate;
|
|
6196
|
+
if (newWidth !== props.width) {
|
|
6197
|
+
let width = 0;
|
|
6198
|
+
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
6199
|
+
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
6200
|
+
width = currentWidth.value;
|
|
6201
|
+
} else {
|
|
6202
|
+
width = finalMinWidth.value;
|
|
6203
|
+
}
|
|
6204
|
+
} else if (newWidth > finalMinWidth.value) {
|
|
6205
|
+
width = newWidth;
|
|
6206
|
+
} else {
|
|
6207
|
+
width = finalMinWidth.value;
|
|
6208
|
+
}
|
|
6209
|
+
return {
|
|
6210
|
+
minWidth: `${width}px`
|
|
6211
|
+
};
|
|
6212
|
+
}
|
|
6213
|
+
}
|
|
6214
|
+
return {
|
|
6215
|
+
minWidth: props.width ? `${props.width}px` : "120px"
|
|
6216
|
+
};
|
|
6217
|
+
});
|
|
6218
|
+
const RenderAppendElement = vue.computed(() => props.renderAppend && props.renderAppend());
|
|
6219
|
+
vue.watch(
|
|
6220
|
+
() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
|
|
6221
|
+
([width, rowWidth2, currentWidth2]) => {
|
|
6222
|
+
if (!isDragedSelf) {
|
|
6223
|
+
return;
|
|
6224
|
+
}
|
|
6225
|
+
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
6226
|
+
isDragedSelf = false;
|
|
6227
|
+
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
6228
|
+
initWidthRate = currentWidth2 / rowWidth2;
|
|
6229
|
+
} else {
|
|
6230
|
+
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
},
|
|
6234
|
+
{
|
|
6235
|
+
immediate: true
|
|
6236
|
+
}
|
|
6237
|
+
);
|
|
6238
|
+
useResizeObserver(columnRef, () => {
|
|
6239
|
+
if (!isDragedSelf) {
|
|
6240
|
+
return;
|
|
6241
|
+
}
|
|
6242
|
+
const width = parseFloat(columnRef.value.style.width);
|
|
6243
|
+
currentWidth.value = width;
|
|
6244
|
+
});
|
|
6245
|
+
const handleMouseDown = (event) => {
|
|
6246
|
+
isDragedSelf = true;
|
|
6247
|
+
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
6248
|
+
columnKey,
|
|
6249
|
+
minWidth: finalMinWidth.value
|
|
6250
|
+
});
|
|
6251
|
+
};
|
|
6252
|
+
const handleMouseMove = (event) => {
|
|
6253
|
+
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
6254
|
+
};
|
|
6255
|
+
return (_ctx, _cache) => {
|
|
6256
|
+
const _directive_overflow_tips = vue.resolveDirective("overflow-tips");
|
|
6257
|
+
return vue.openBlock(), vue.createElementBlock("th", {
|
|
6258
|
+
ref_key: "columnRef",
|
|
6259
|
+
ref: columnRef,
|
|
6260
|
+
class: vue.normalizeClass(["bk-ediatable-head-column", {
|
|
6261
|
+
"is-required": _ctx.required,
|
|
6262
|
+
[`column-${vue.unref(columnKey)}`]: true,
|
|
6263
|
+
"is-right-fixed": vue.unref(isMinimize) && isFixedRight.value,
|
|
6264
|
+
"is-left-fixed": vue.unref(isMinimize) && isFixedLeft.value
|
|
6265
|
+
}]),
|
|
6266
|
+
"data-fixed": _ctx.fixed,
|
|
6267
|
+
"data-maxWidth": _ctx.maxWidth,
|
|
6268
|
+
"data-minWidth": finalMinWidth.value,
|
|
6269
|
+
"data-width": _ctx.width,
|
|
6270
|
+
style: vue.normalizeStyle(styles.value),
|
|
6271
|
+
onMousedown: handleMouseDown,
|
|
6272
|
+
onMousemove: handleMouseMove
|
|
6273
|
+
}, [
|
|
6274
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
6275
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
6276
|
+
])), [
|
|
6277
|
+
[_directive_overflow_tips]
|
|
6278
|
+
]),
|
|
6279
|
+
vue.createElementVNode("div", _hoisted_3$1, [
|
|
6280
|
+
vue.unref(slots).append && !_ctx.renderAppend ? vue.renderSlot(_ctx.$slots, "append", { key: 0 }) : vue.createCommentVNode("v-if", true),
|
|
6281
|
+
_ctx.renderAppend ? (vue.openBlock(), vue.createBlock(vue.unref(RenderAppendElement), { key: 1 })) : vue.createCommentVNode("v-if", true)
|
|
6282
|
+
])
|
|
6283
|
+
], 46, _hoisted_1$6);
|
|
6284
|
+
};
|
|
6285
|
+
}
|
|
6286
|
+
});
|
|
6287
|
+
const renderTablekey = Symbol("renderTable");
|
|
6288
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
6096
6289
|
__name: "ediatable",
|
|
6290
|
+
props: {
|
|
6291
|
+
theadList: { default: () => [] }
|
|
6292
|
+
},
|
|
6097
6293
|
setup(__props) {
|
|
6294
|
+
const slots = vue.useSlots();
|
|
6098
6295
|
const checkTableScroll = () => {
|
|
6099
6296
|
rowWidth.value = tableRef.value.clientWidth;
|
|
6100
6297
|
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
@@ -6134,8 +6331,34 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6134
6331
|
},
|
|
6135
6332
|
[
|
|
6136
6333
|
vue.createElementVNode("thead", null, [
|
|
6137
|
-
vue.createElementVNode("tr",
|
|
6138
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
6334
|
+
vue.createElementVNode("tr", null, [
|
|
6335
|
+
vue.unref(slots).default && _ctx.theadList.length === 0 ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : (vue.openBlock(true), vue.createElementBlock(
|
|
6336
|
+
vue.Fragment,
|
|
6337
|
+
{ key: 1 },
|
|
6338
|
+
vue.renderList(_ctx.theadList, (head, index) => {
|
|
6339
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$8, {
|
|
6340
|
+
key: index,
|
|
6341
|
+
width: head.width,
|
|
6342
|
+
"min-width": head.minWidth,
|
|
6343
|
+
"max-width": head.maxWidth,
|
|
6344
|
+
fixed: head.fixed,
|
|
6345
|
+
required: head.required,
|
|
6346
|
+
"render-append": head.renderAppend
|
|
6347
|
+
}, {
|
|
6348
|
+
default: vue.withCtx(() => [
|
|
6349
|
+
vue.createTextVNode(
|
|
6350
|
+
vue.toDisplayString(head.title),
|
|
6351
|
+
1
|
|
6352
|
+
/* TEXT */
|
|
6353
|
+
)
|
|
6354
|
+
]),
|
|
6355
|
+
_: 2
|
|
6356
|
+
/* DYNAMIC */
|
|
6357
|
+
}, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append"]);
|
|
6358
|
+
}),
|
|
6359
|
+
128
|
|
6360
|
+
/* KEYED_FRAGMENT */
|
|
6361
|
+
))
|
|
6139
6362
|
])
|
|
6140
6363
|
]),
|
|
6141
6364
|
vue.createElementVNode("tbody", null, [
|
|
@@ -6256,12 +6479,12 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6256
6479
|
});
|
|
6257
6480
|
}
|
|
6258
6481
|
});
|
|
6259
|
-
const _hoisted_1$
|
|
6482
|
+
const _hoisted_1$5 = {
|
|
6260
6483
|
key: 0,
|
|
6261
6484
|
class: "input-error"
|
|
6262
6485
|
};
|
|
6263
|
-
const _sfc_main$
|
|
6264
|
-
__name: "date-time-picker",
|
|
6486
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
6487
|
+
__name: "date-time-picker-column",
|
|
6265
6488
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
6266
6489
|
placeholder: { default: "" },
|
|
6267
6490
|
rules: { default: void 0 },
|
|
@@ -6328,7 +6551,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6328
6551
|
key: "0"
|
|
6329
6552
|
} : void 0
|
|
6330
6553
|
]), 1040, ["model-value", "placeholder", "type"]),
|
|
6331
|
-
vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6554
|
+
vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
6332
6555
|
vue.withDirectives(vue.createVNode(
|
|
6333
6556
|
vue.unref(DbIcon),
|
|
6334
6557
|
{ type: "exclamation-fill" },
|
|
@@ -6346,18 +6569,12 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6346
6569
|
};
|
|
6347
6570
|
}
|
|
6348
6571
|
});
|
|
6349
|
-
const
|
|
6350
|
-
const encodeMult = (text) => {
|
|
6351
|
-
const temp = document.createElement("textarea");
|
|
6352
|
-
temp.value = text;
|
|
6353
|
-
return temp.value;
|
|
6354
|
-
};
|
|
6355
|
-
const _hoisted_1$5 = {
|
|
6572
|
+
const _hoisted_1$4 = {
|
|
6356
6573
|
key: 1,
|
|
6357
6574
|
class: "blur-dispaly-main"
|
|
6358
6575
|
};
|
|
6359
|
-
const _sfc_main$
|
|
6360
|
-
__name: "input",
|
|
6576
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
6577
|
+
__name: "input-column",
|
|
6361
6578
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
6362
6579
|
placeholder: { default: "请输入" },
|
|
6363
6580
|
rules: { default: void 0 },
|
|
@@ -6492,7 +6709,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6492
6709
|
)), [
|
|
6493
6710
|
[_directive_bk_tooltips, vue.unref(errorMessage)]
|
|
6494
6711
|
]) : vue.createCommentVNode("v-if", true),
|
|
6495
|
-
_ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
6712
|
+
_ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
6496
6713
|
vue.renderSlot(_ctx.$slots, "blur")
|
|
6497
6714
|
])) : vue.createCommentVNode("v-if", true)
|
|
6498
6715
|
],
|
|
@@ -6502,7 +6719,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6502
6719
|
};
|
|
6503
6720
|
}
|
|
6504
6721
|
});
|
|
6505
|
-
const _sfc_main$
|
|
6722
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
6506
6723
|
__name: "fixed-column",
|
|
6507
6724
|
props: {
|
|
6508
6725
|
fixed: { default: "right" }
|
|
@@ -6530,200 +6747,16 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6530
6747
|
};
|
|
6531
6748
|
}
|
|
6532
6749
|
});
|
|
6533
|
-
function tryOnScopeDispose(fn) {
|
|
6534
|
-
if (vue.getCurrentScope()) {
|
|
6535
|
-
vue.onScopeDispose(fn);
|
|
6536
|
-
return true;
|
|
6537
|
-
}
|
|
6538
|
-
return false;
|
|
6539
|
-
}
|
|
6540
|
-
function toValue(r) {
|
|
6541
|
-
return typeof r === "function" ? r() : vue.unref(r);
|
|
6542
|
-
}
|
|
6543
|
-
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
6544
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
6545
|
-
function unrefElement(elRef) {
|
|
6546
|
-
var _a;
|
|
6547
|
-
const plain = toValue(elRef);
|
|
6548
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
6549
|
-
}
|
|
6550
|
-
const defaultWindow = isClient ? window : void 0;
|
|
6551
|
-
function useMounted() {
|
|
6552
|
-
const isMounted = vue.ref(false);
|
|
6553
|
-
const instance = vue.getCurrentInstance();
|
|
6554
|
-
if (instance) {
|
|
6555
|
-
vue.onMounted(() => {
|
|
6556
|
-
isMounted.value = true;
|
|
6557
|
-
}, instance);
|
|
6558
|
-
}
|
|
6559
|
-
return isMounted;
|
|
6560
|
-
}
|
|
6561
|
-
function useSupported(callback) {
|
|
6562
|
-
const isMounted = useMounted();
|
|
6563
|
-
return vue.computed(() => {
|
|
6564
|
-
isMounted.value;
|
|
6565
|
-
return Boolean(callback());
|
|
6566
|
-
});
|
|
6567
|
-
}
|
|
6568
|
-
function useResizeObserver(target, callback, options = {}) {
|
|
6569
|
-
const { window: window2 = defaultWindow, ...observerOptions } = options;
|
|
6570
|
-
let observer;
|
|
6571
|
-
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
|
|
6572
|
-
const cleanup = () => {
|
|
6573
|
-
if (observer) {
|
|
6574
|
-
observer.disconnect();
|
|
6575
|
-
observer = void 0;
|
|
6576
|
-
}
|
|
6577
|
-
};
|
|
6578
|
-
const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
|
|
6579
|
-
const stopWatch = vue.watch(
|
|
6580
|
-
targets,
|
|
6581
|
-
(els) => {
|
|
6582
|
-
cleanup();
|
|
6583
|
-
if (isSupported.value && window2) {
|
|
6584
|
-
observer = new ResizeObserver(callback);
|
|
6585
|
-
for (const _el of els)
|
|
6586
|
-
_el && observer.observe(_el, observerOptions);
|
|
6587
|
-
}
|
|
6588
|
-
},
|
|
6589
|
-
{ immediate: true, flush: "post" }
|
|
6590
|
-
);
|
|
6591
|
-
const stop = () => {
|
|
6592
|
-
cleanup();
|
|
6593
|
-
stopWatch();
|
|
6594
|
-
};
|
|
6595
|
-
tryOnScopeDispose(stop);
|
|
6596
|
-
return {
|
|
6597
|
-
isSupported,
|
|
6598
|
-
stop
|
|
6599
|
-
};
|
|
6600
|
-
}
|
|
6601
|
-
const _hoisted_1$4 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
|
|
6602
|
-
const _hoisted_2$2 = { class: "th-cell" };
|
|
6603
|
-
const _hoisted_3$1 = {
|
|
6604
|
-
key: 0,
|
|
6605
|
-
style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" }
|
|
6606
|
-
};
|
|
6607
|
-
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
6608
|
-
__name: "head-column",
|
|
6609
|
-
props: {
|
|
6610
|
-
width: { default: void 0 },
|
|
6611
|
-
required: { type: Boolean, default: true },
|
|
6612
|
-
minWidth: { default: void 0 },
|
|
6613
|
-
maxWidth: { default: void 0 },
|
|
6614
|
-
fixed: { default: void 0 }
|
|
6615
|
-
},
|
|
6616
|
-
setup(__props) {
|
|
6617
|
-
const props = __props;
|
|
6618
|
-
const { rowWidth, isOverflow: isMinimize } = vue.inject(renderTablekey);
|
|
6619
|
-
const parentTable = vue.inject(tableColumnResizekey);
|
|
6620
|
-
const slots = vue.useSlots();
|
|
6621
|
-
const columnRef = vue.ref();
|
|
6622
|
-
const currentWidth = vue.ref(0);
|
|
6623
|
-
const columnKey = random();
|
|
6624
|
-
let initWidthRate = 0;
|
|
6625
|
-
let isDragedSelf = false;
|
|
6626
|
-
const finalMinWidth = vue.computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
6627
|
-
const isFixedRight = vue.computed(() => props.fixed === "right");
|
|
6628
|
-
const isFixedLeft = vue.computed(() => props.fixed === "left");
|
|
6629
|
-
const styles = vue.computed(() => {
|
|
6630
|
-
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
6631
|
-
const newWidth = rowWidth.value * initWidthRate;
|
|
6632
|
-
if (newWidth !== props.width) {
|
|
6633
|
-
let width = 0;
|
|
6634
|
-
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
6635
|
-
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
6636
|
-
width = currentWidth.value;
|
|
6637
|
-
} else {
|
|
6638
|
-
width = finalMinWidth.value;
|
|
6639
|
-
}
|
|
6640
|
-
} else if (newWidth > finalMinWidth.value) {
|
|
6641
|
-
width = newWidth;
|
|
6642
|
-
} else {
|
|
6643
|
-
width = finalMinWidth.value;
|
|
6644
|
-
}
|
|
6645
|
-
return {
|
|
6646
|
-
minWidth: `${width}px`
|
|
6647
|
-
};
|
|
6648
|
-
}
|
|
6649
|
-
}
|
|
6650
|
-
return {
|
|
6651
|
-
minWidth: props.width ? `${props.width}px` : "120px"
|
|
6652
|
-
};
|
|
6653
|
-
});
|
|
6654
|
-
vue.watch(() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value], ([width, rowWidth2, currentWidth2]) => {
|
|
6655
|
-
if (!isDragedSelf) {
|
|
6656
|
-
return;
|
|
6657
|
-
}
|
|
6658
|
-
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
6659
|
-
isDragedSelf = false;
|
|
6660
|
-
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
6661
|
-
initWidthRate = currentWidth2 / rowWidth2;
|
|
6662
|
-
} else {
|
|
6663
|
-
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
6664
|
-
}
|
|
6665
|
-
}
|
|
6666
|
-
}, {
|
|
6667
|
-
immediate: true
|
|
6668
|
-
});
|
|
6669
|
-
useResizeObserver(columnRef, () => {
|
|
6670
|
-
if (!isDragedSelf) {
|
|
6671
|
-
return;
|
|
6672
|
-
}
|
|
6673
|
-
const width = parseFloat(columnRef.value.style.width);
|
|
6674
|
-
currentWidth.value = width;
|
|
6675
|
-
});
|
|
6676
|
-
const handleMouseDown = (event) => {
|
|
6677
|
-
isDragedSelf = true;
|
|
6678
|
-
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
6679
|
-
columnKey,
|
|
6680
|
-
minWidth: finalMinWidth.value
|
|
6681
|
-
});
|
|
6682
|
-
};
|
|
6683
|
-
const handleMouseMove = (event) => {
|
|
6684
|
-
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
6685
|
-
};
|
|
6686
|
-
return (_ctx, _cache) => {
|
|
6687
|
-
const _directive_overflow_tips = vue.resolveDirective("overflow-tips");
|
|
6688
|
-
return vue.openBlock(), vue.createElementBlock("th", {
|
|
6689
|
-
ref_key: "columnRef",
|
|
6690
|
-
ref: columnRef,
|
|
6691
|
-
class: vue.normalizeClass(["bk-ediatable-head-column", {
|
|
6692
|
-
"is-required": _ctx.required,
|
|
6693
|
-
[`column-${vue.unref(columnKey)}`]: true,
|
|
6694
|
-
"is-right-fixed": vue.unref(isMinimize) && isFixedRight.value,
|
|
6695
|
-
"is-left-fixed": vue.unref(isMinimize) && isFixedLeft.value
|
|
6696
|
-
}]),
|
|
6697
|
-
"data-fixed": _ctx.fixed,
|
|
6698
|
-
"data-maxWidth": _ctx.maxWidth,
|
|
6699
|
-
"data-minWidth": finalMinWidth.value,
|
|
6700
|
-
"data-width": _ctx.width,
|
|
6701
|
-
style: vue.normalizeStyle(styles.value),
|
|
6702
|
-
onMousedown: handleMouseDown,
|
|
6703
|
-
onMousemove: handleMouseMove
|
|
6704
|
-
}, [
|
|
6705
|
-
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
6706
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
6707
|
-
])), [
|
|
6708
|
-
[_directive_overflow_tips]
|
|
6709
|
-
]),
|
|
6710
|
-
vue.unref(slots).append ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
|
|
6711
|
-
vue.renderSlot(_ctx.$slots, "append")
|
|
6712
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
6713
|
-
], 46, _hoisted_1$4);
|
|
6714
|
-
};
|
|
6715
|
-
}
|
|
6716
|
-
});
|
|
6717
6750
|
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
6718
6751
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
6719
|
-
__name: "operation",
|
|
6752
|
+
__name: "operation-column",
|
|
6720
6753
|
props: {
|
|
6754
|
+
removeable: { type: Boolean, default: true },
|
|
6721
6755
|
showCopy: { type: Boolean, default: false },
|
|
6722
6756
|
showAdd: { type: Boolean, default: true },
|
|
6723
|
-
showRemove: { type: Boolean, default: true }
|
|
6724
|
-
removeable: { type: Boolean, default: true }
|
|
6757
|
+
showRemove: { type: Boolean, default: true }
|
|
6725
6758
|
},
|
|
6726
|
-
emits: ["
|
|
6759
|
+
emits: ["add", "copy", "remove"],
|
|
6727
6760
|
setup(__props, { emit: __emit }) {
|
|
6728
6761
|
const props = __props;
|
|
6729
6762
|
const emits = __emit;
|
|
@@ -6740,7 +6773,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6740
6773
|
emits("remove");
|
|
6741
6774
|
};
|
|
6742
6775
|
return (_ctx, _cache) => {
|
|
6743
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
6776
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$4, null, {
|
|
6744
6777
|
default: vue.withCtx(() => [
|
|
6745
6778
|
vue.createElementVNode("div", _hoisted_1$3, [
|
|
6746
6779
|
_ctx.showCopy ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -6785,7 +6818,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
6785
6818
|
class: "select-error"
|
|
6786
6819
|
};
|
|
6787
6820
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
6788
|
-
__name: "select",
|
|
6821
|
+
__name: "select-column",
|
|
6789
6822
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
6790
6823
|
list: {},
|
|
6791
6824
|
placeholder: { default: "请选择" },
|
|
@@ -9435,7 +9468,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
9435
9468
|
style: { "display": "none" }
|
|
9436
9469
|
};
|
|
9437
9470
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
9438
|
-
__name: "tag-input",
|
|
9471
|
+
__name: "tag-input-column",
|
|
9439
9472
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
9440
9473
|
placeholder: { default: "" },
|
|
9441
9474
|
single: { type: Boolean, default: false },
|
|
@@ -9602,7 +9635,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
9602
9635
|
class: "input-error"
|
|
9603
9636
|
};
|
|
9604
9637
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
9605
|
-
__name: "text-plain",
|
|
9638
|
+
__name: "text-plain-column",
|
|
9606
9639
|
props: {
|
|
9607
9640
|
data: {},
|
|
9608
9641
|
isLoading: { type: Boolean },
|
|
@@ -9676,15 +9709,15 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
|
|
|
9676
9709
|
};
|
|
9677
9710
|
}
|
|
9678
9711
|
});
|
|
9679
|
-
exports2.DateTimePickerColumn = _sfc_main$
|
|
9680
|
-
exports2.Ediatable = _sfc_main$
|
|
9681
|
-
exports2.FixedColumn = _sfc_main$
|
|
9682
|
-
exports2.HeadColumn = _sfc_main$
|
|
9683
|
-
exports2.InputColumn = _sfc_main$
|
|
9712
|
+
exports2.DateTimePickerColumn = _sfc_main$6;
|
|
9713
|
+
exports2.Ediatable = _sfc_main$7;
|
|
9714
|
+
exports2.FixedColumn = _sfc_main$4;
|
|
9715
|
+
exports2.HeadColumn = _sfc_main$8;
|
|
9716
|
+
exports2.InputColumn = _sfc_main$5;
|
|
9684
9717
|
exports2.OperationColumn = _sfc_main$3;
|
|
9685
9718
|
exports2.SelectColumn = _sfc_main$2;
|
|
9686
9719
|
exports2.TagInputColumn = _sfc_main$1;
|
|
9687
9720
|
exports2.TextPlainColumn = _sfc_main;
|
|
9688
|
-
exports2.default = _sfc_main$
|
|
9721
|
+
exports2.default = _sfc_main$7;
|
|
9689
9722
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
9690
9723
|
});
|