@blueking/ediatable 0.0.1-beta.7 → 0.0.1-beta.8

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.
@@ -40,6 +40,47 @@ 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 .title-memo {
44
+ border-bottom: 1px dashed #979ba5;
45
+ }
46
+ .bk-ediatable-head-column.is-required {
47
+ position: relative;
48
+ }
49
+ .bk-ediatable-head-column.is-required::after {
50
+ position: absolute;
51
+ top: 0;
52
+ margin-left: 4px;
53
+ font-size: 12px;
54
+ line-height: 40px;
55
+ color: #ea3636;
56
+ content: '*';
57
+ }
58
+ .bk-ediatable-head-column.is-right-fixed {
59
+ position: sticky;
60
+ right: 1px;
61
+ }
62
+ .bk-ediatable-head-column.is-right-fixed::before {
63
+ position: absolute;
64
+ top: 0;
65
+ left: -10px;
66
+ width: 10px;
67
+ height: 100%;
68
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
69
+ content: '';
70
+ }
71
+ .bk-ediatable-head-column.is-left-fixed {
72
+ position: sticky;
73
+ left: 1px;
74
+ }
75
+ .bk-ediatable-head-column.is-left-fixed::before {
76
+ position: absolute;
77
+ top: 0;
78
+ right: -10px;
79
+ width: 10px;
80
+ height: 100%;
81
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
82
+ content: '';
83
+ }
43
84
  .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
85
  position: relative;
45
86
  width: 100%;
@@ -253,47 +294,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
253
294
  background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
254
295
  content: '';
255
296
  }
256
- .bk-ediatable-head-column .title-memo {
257
- border-bottom: 1px dashed #979ba5;
258
- }
259
- .bk-ediatable-head-column.is-required {
260
- position: relative;
261
- }
262
- .bk-ediatable-head-column.is-required::after {
263
- position: absolute;
264
- top: 0;
265
- margin-left: 4px;
266
- font-size: 12px;
267
- line-height: 40px;
268
- color: #ea3636;
269
- content: '*';
270
- }
271
- .bk-ediatable-head-column.is-right-fixed {
272
- position: sticky;
273
- right: 1px;
274
- }
275
- .bk-ediatable-head-column.is-right-fixed::before {
276
- position: absolute;
277
- top: 0;
278
- left: -10px;
279
- width: 10px;
280
- height: 100%;
281
- background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
282
- content: '';
283
- }
284
- .bk-ediatable-head-column.is-left-fixed {
285
- position: sticky;
286
- left: 1px;
287
- }
288
- .bk-ediatable-head-column.is-left-fixed::before {
289
- position: absolute;
290
- top: 0;
291
- right: -10px;
292
- width: 10px;
293
- height: 100%;
294
- background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
295
- content: '';
296
- }
297
297
  .bk-ediatable-operation {
298
298
  display: flex;
299
299
  height: 42px;
@@ -6093,11 +6093,224 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6093
6093
  handleMouseMove
6094
6094
  };
6095
6095
  }
6096
- const _hoisted_1$7 = { style: { "position": "relative" } };
6097
- const renderTablekey = Symbol("renderTable");
6096
+ const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
6097
+ const encodeMult = (text) => {
6098
+ const temp = document.createElement("textarea");
6099
+ temp.value = text;
6100
+ return temp.value;
6101
+ };
6102
+ function tryOnScopeDispose(fn) {
6103
+ if (vue.getCurrentScope()) {
6104
+ vue.onScopeDispose(fn);
6105
+ return true;
6106
+ }
6107
+ return false;
6108
+ }
6109
+ function toValue(r) {
6110
+ return typeof r === "function" ? r() : vue.unref(r);
6111
+ }
6112
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
6113
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
6114
+ function unrefElement(elRef) {
6115
+ var _a;
6116
+ const plain = toValue(elRef);
6117
+ return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
6118
+ }
6119
+ const defaultWindow = isClient ? window : void 0;
6120
+ function useMounted() {
6121
+ const isMounted = vue.ref(false);
6122
+ const instance = vue.getCurrentInstance();
6123
+ if (instance) {
6124
+ vue.onMounted(() => {
6125
+ isMounted.value = true;
6126
+ }, instance);
6127
+ }
6128
+ return isMounted;
6129
+ }
6130
+ function useSupported(callback) {
6131
+ const isMounted = useMounted();
6132
+ return vue.computed(() => {
6133
+ isMounted.value;
6134
+ return Boolean(callback());
6135
+ });
6136
+ }
6137
+ function useResizeObserver(target, callback, options = {}) {
6138
+ const { window: window2 = defaultWindow, ...observerOptions } = options;
6139
+ let observer;
6140
+ const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
6141
+ const cleanup = () => {
6142
+ if (observer) {
6143
+ observer.disconnect();
6144
+ observer = void 0;
6145
+ }
6146
+ };
6147
+ const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
6148
+ const stopWatch = vue.watch(
6149
+ targets,
6150
+ (els) => {
6151
+ cleanup();
6152
+ if (isSupported.value && window2) {
6153
+ observer = new ResizeObserver(callback);
6154
+ for (const _el of els)
6155
+ _el && observer.observe(_el, observerOptions);
6156
+ }
6157
+ },
6158
+ { immediate: true, flush: "post" }
6159
+ );
6160
+ const stop = () => {
6161
+ cleanup();
6162
+ stopWatch();
6163
+ };
6164
+ tryOnScopeDispose(stop);
6165
+ return {
6166
+ isSupported,
6167
+ stop
6168
+ };
6169
+ }
6170
+ const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
6171
+ const _hoisted_2$2 = { class: "th-cell" };
6172
+ const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
6098
6173
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
6174
+ __name: "head-column",
6175
+ props: {
6176
+ fixed: { default: void 0 },
6177
+ maxWidth: { default: void 0 },
6178
+ minWidth: { default: void 0 },
6179
+ required: { type: Boolean, default: true },
6180
+ width: { default: void 0 },
6181
+ renderAppend: { type: Function, default: void 0 },
6182
+ memo: { default: void 0 }
6183
+ },
6184
+ setup(__props) {
6185
+ const props = __props;
6186
+ const slots = vue.useSlots();
6187
+ const { rowWidth, isOverflow: isMinimize } = vue.inject(renderTablekey);
6188
+ const parentTable = vue.inject(tableColumnResizekey);
6189
+ const columnRef = vue.ref();
6190
+ const currentWidth = vue.ref(0);
6191
+ const columnKey = random();
6192
+ let initWidthRate = 0;
6193
+ let isDragedSelf = false;
6194
+ const finalMinWidth = vue.computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
6195
+ const isFixedRight = vue.computed(() => props.fixed === "right");
6196
+ const isFixedLeft = vue.computed(() => props.fixed === "left");
6197
+ const styles = vue.computed(() => {
6198
+ if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
6199
+ const newWidth = rowWidth.value * initWidthRate;
6200
+ if (newWidth !== props.width) {
6201
+ let width = 0;
6202
+ if (isMinimize == null ? void 0 : isMinimize.value) {
6203
+ if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
6204
+ width = currentWidth.value;
6205
+ } else {
6206
+ width = finalMinWidth.value;
6207
+ }
6208
+ } else if (newWidth > finalMinWidth.value) {
6209
+ width = newWidth;
6210
+ } else {
6211
+ width = finalMinWidth.value;
6212
+ }
6213
+ return {
6214
+ minWidth: `${width}px`
6215
+ };
6216
+ }
6217
+ }
6218
+ return {
6219
+ minWidth: props.width ? `${props.width}px` : "120px"
6220
+ };
6221
+ });
6222
+ const RenderAppendElement = vue.computed(() => props.renderAppend && props.renderAppend());
6223
+ vue.watch(
6224
+ () => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
6225
+ ([width, rowWidth2, currentWidth2]) => {
6226
+ if (!isDragedSelf) {
6227
+ return;
6228
+ }
6229
+ if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
6230
+ isDragedSelf = false;
6231
+ if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
6232
+ initWidthRate = currentWidth2 / rowWidth2;
6233
+ } else {
6234
+ initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
6235
+ }
6236
+ }
6237
+ },
6238
+ {
6239
+ immediate: true
6240
+ }
6241
+ );
6242
+ useResizeObserver(columnRef, () => {
6243
+ if (!isDragedSelf) {
6244
+ return;
6245
+ }
6246
+ const width = parseFloat(columnRef.value.style.width);
6247
+ currentWidth.value = width;
6248
+ });
6249
+ const handleMouseDown = (event) => {
6250
+ isDragedSelf = true;
6251
+ parentTable == null ? void 0 : parentTable.columnMousedown(event, {
6252
+ columnKey,
6253
+ minWidth: finalMinWidth.value
6254
+ });
6255
+ };
6256
+ const handleMouseMove = (event) => {
6257
+ parentTable == null ? void 0 : parentTable.columnMouseMove(event);
6258
+ };
6259
+ return (_ctx, _cache) => {
6260
+ const _directive_overflow_tips = vue.resolveDirective("overflow-tips");
6261
+ const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
6262
+ return vue.openBlock(), vue.createElementBlock("th", {
6263
+ ref_key: "columnRef",
6264
+ ref: columnRef,
6265
+ class: vue.normalizeClass(["bk-ediatable-head-column", {
6266
+ "is-required": _ctx.required,
6267
+ [`column-${vue.unref(columnKey)}`]: true,
6268
+ "is-right-fixed": vue.unref(isMinimize) && isFixedRight.value,
6269
+ "is-left-fixed": vue.unref(isMinimize) && isFixedLeft.value
6270
+ }]),
6271
+ "data-fixed": _ctx.fixed,
6272
+ "data-maxWidth": _ctx.maxWidth,
6273
+ "data-minWidth": finalMinWidth.value,
6274
+ "data-width": _ctx.width,
6275
+ style: vue.normalizeStyle(styles.value),
6276
+ onMousedown: handleMouseDown,
6277
+ onMousemove: handleMouseMove
6278
+ }, [
6279
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
6280
+ vue.createElementVNode(
6281
+ "span",
6282
+ {
6283
+ class: vue.normalizeClass({ "title-memo": _ctx.memo })
6284
+ },
6285
+ [
6286
+ vue.renderSlot(_ctx.$slots, "default")
6287
+ ],
6288
+ 2
6289
+ /* CLASS */
6290
+ )
6291
+ ])), [
6292
+ [_directive_overflow_tips],
6293
+ [_directive_bk_tooltips, {
6294
+ content: _ctx.memo,
6295
+ disabled: !_ctx.memo
6296
+ }]
6297
+ ]),
6298
+ vue.createElementVNode("div", _hoisted_3$1, [
6299
+ slots.append && !_ctx.renderAppend ? vue.renderSlot(_ctx.$slots, "append", { key: 0 }) : vue.createCommentVNode("v-if", true),
6300
+ _ctx.renderAppend ? (vue.openBlock(), vue.createBlock(vue.unref(RenderAppendElement), { key: 1 })) : vue.createCommentVNode("v-if", true)
6301
+ ])
6302
+ ], 46, _hoisted_1$6);
6303
+ };
6304
+ }
6305
+ });
6306
+ const renderTablekey = Symbol("renderTable");
6307
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
6099
6308
  __name: "ediatable",
6309
+ props: {
6310
+ theadList: { default: () => [] }
6311
+ },
6100
6312
  setup(__props) {
6313
+ const slots = vue.useSlots();
6101
6314
  const checkTableScroll = () => {
6102
6315
  rowWidth.value = tableRef.value.clientWidth;
6103
6316
  isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
@@ -6137,8 +6350,35 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6137
6350
  },
6138
6351
  [
6139
6352
  vue.createElementVNode("thead", null, [
6140
- vue.createElementVNode("tr", _hoisted_1$7, [
6141
- vue.renderSlot(_ctx.$slots, "default")
6353
+ vue.createElementVNode("tr", null, [
6354
+ slots.default && _ctx.theadList.length === 0 ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : (vue.openBlock(true), vue.createElementBlock(
6355
+ vue.Fragment,
6356
+ { key: 1 },
6357
+ vue.renderList(_ctx.theadList, (head, index) => {
6358
+ return vue.openBlock(), vue.createBlock(_sfc_main$8, {
6359
+ key: index,
6360
+ width: head.width,
6361
+ "min-width": head.minWidth,
6362
+ "max-width": head.maxWidth,
6363
+ fixed: head.fixed,
6364
+ required: head.required,
6365
+ "render-append": head.renderAppend,
6366
+ memo: head.memo
6367
+ }, {
6368
+ default: vue.withCtx(() => [
6369
+ vue.createTextVNode(
6370
+ vue.toDisplayString(head.title),
6371
+ 1
6372
+ /* TEXT */
6373
+ )
6374
+ ]),
6375
+ _: 2
6376
+ /* DYNAMIC */
6377
+ }, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append", "memo"]);
6378
+ }),
6379
+ 128
6380
+ /* KEYED_FRAGMENT */
6381
+ ))
6142
6382
  ])
6143
6383
  ]),
6144
6384
  vue.createElementVNode("tbody", null, [
@@ -6259,12 +6499,12 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6259
6499
  });
6260
6500
  }
6261
6501
  });
6262
- const _hoisted_1$6 = {
6502
+ const _hoisted_1$5 = {
6263
6503
  key: 0,
6264
6504
  class: "input-error"
6265
6505
  };
6266
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
6267
- __name: "date-time-picker",
6506
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
6507
+ __name: "date-time-picker-column",
6268
6508
  props: /* @__PURE__ */ vue.mergeModels({
6269
6509
  placeholder: { default: "" },
6270
6510
  rules: { default: void 0 },
@@ -6331,7 +6571,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6331
6571
  key: "0"
6332
6572
  } : void 0
6333
6573
  ]), 1040, ["model-value", "placeholder", "type"]),
6334
- vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
6574
+ vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
6335
6575
  vue.withDirectives(vue.createVNode(
6336
6576
  vue.unref(DbIcon),
6337
6577
  { type: "exclamation-fill" },
@@ -6349,18 +6589,12 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6349
6589
  };
6350
6590
  }
6351
6591
  });
6352
- const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
6353
- const encodeMult = (text) => {
6354
- const temp = document.createElement("textarea");
6355
- temp.value = text;
6356
- return temp.value;
6357
- };
6358
- const _hoisted_1$5 = {
6592
+ const _hoisted_1$4 = {
6359
6593
  key: 1,
6360
6594
  class: "blur-dispaly-main"
6361
6595
  };
6362
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
6363
- __name: "input",
6596
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
6597
+ __name: "input-column",
6364
6598
  props: /* @__PURE__ */ vue.mergeModels({
6365
6599
  placeholder: { default: "请输入" },
6366
6600
  rules: { default: void 0 },
@@ -6495,7 +6729,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6495
6729
  )), [
6496
6730
  [_directive_bk_tooltips, vue.unref(errorMessage)]
6497
6731
  ]) : vue.createCommentVNode("v-if", true),
6498
- _ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
6732
+ _ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
6499
6733
  vue.renderSlot(_ctx.$slots, "blur")
6500
6734
  ])) : vue.createCommentVNode("v-if", true)
6501
6735
  ],
@@ -6505,7 +6739,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6505
6739
  };
6506
6740
  }
6507
6741
  });
6508
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
6742
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
6509
6743
  __name: "fixed-column",
6510
6744
  props: {
6511
6745
  fixed: { default: "right" }
@@ -6533,216 +6767,16 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6533
6767
  };
6534
6768
  }
6535
6769
  });
6536
- function tryOnScopeDispose(fn) {
6537
- if (vue.getCurrentScope()) {
6538
- vue.onScopeDispose(fn);
6539
- return true;
6540
- }
6541
- return false;
6542
- }
6543
- function toValue(r) {
6544
- return typeof r === "function" ? r() : vue.unref(r);
6545
- }
6546
- const isClient = typeof window !== "undefined" && typeof document !== "undefined";
6547
- typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
6548
- function unrefElement(elRef) {
6549
- var _a;
6550
- const plain = toValue(elRef);
6551
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
6552
- }
6553
- const defaultWindow = isClient ? window : void 0;
6554
- function useMounted() {
6555
- const isMounted = vue.ref(false);
6556
- const instance = vue.getCurrentInstance();
6557
- if (instance) {
6558
- vue.onMounted(() => {
6559
- isMounted.value = true;
6560
- }, instance);
6561
- }
6562
- return isMounted;
6563
- }
6564
- function useSupported(callback) {
6565
- const isMounted = useMounted();
6566
- return vue.computed(() => {
6567
- isMounted.value;
6568
- return Boolean(callback());
6569
- });
6570
- }
6571
- function useResizeObserver(target, callback, options = {}) {
6572
- const { window: window2 = defaultWindow, ...observerOptions } = options;
6573
- let observer;
6574
- const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
6575
- const cleanup = () => {
6576
- if (observer) {
6577
- observer.disconnect();
6578
- observer = void 0;
6579
- }
6580
- };
6581
- const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
6582
- const stopWatch = vue.watch(
6583
- targets,
6584
- (els) => {
6585
- cleanup();
6586
- if (isSupported.value && window2) {
6587
- observer = new ResizeObserver(callback);
6588
- for (const _el of els)
6589
- _el && observer.observe(_el, observerOptions);
6590
- }
6591
- },
6592
- { immediate: true, flush: "post" }
6593
- );
6594
- const stop = () => {
6595
- cleanup();
6596
- stopWatch();
6597
- };
6598
- tryOnScopeDispose(stop);
6599
- return {
6600
- isSupported,
6601
- stop
6602
- };
6603
- }
6604
- const _hoisted_1$4 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
6605
- const _hoisted_2$2 = { class: "th-cell" };
6606
- const _hoisted_3$1 = {
6607
- key: 0,
6608
- style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" }
6609
- };
6610
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
6611
- __name: "head-column",
6612
- props: {
6613
- width: { default: void 0 },
6614
- required: { type: Boolean, default: true },
6615
- minWidth: { default: void 0 },
6616
- maxWidth: { default: void 0 },
6617
- fixed: { default: void 0 },
6618
- memo: { default: void 0 }
6619
- },
6620
- setup(__props) {
6621
- const props = __props;
6622
- const { rowWidth, isOverflow: isMinimize } = vue.inject(renderTablekey);
6623
- const parentTable = vue.inject(tableColumnResizekey);
6624
- const slots = vue.useSlots();
6625
- const columnRef = vue.ref();
6626
- const currentWidth = vue.ref(0);
6627
- const columnKey = random();
6628
- let initWidthRate = 0;
6629
- let isDragedSelf = false;
6630
- const finalMinWidth = vue.computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
6631
- const isFixedRight = vue.computed(() => props.fixed === "right");
6632
- const isFixedLeft = vue.computed(() => props.fixed === "left");
6633
- const styles = vue.computed(() => {
6634
- if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
6635
- const newWidth = rowWidth.value * initWidthRate;
6636
- if (newWidth !== props.width) {
6637
- let width = 0;
6638
- if (isMinimize == null ? void 0 : isMinimize.value) {
6639
- if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
6640
- width = currentWidth.value;
6641
- } else {
6642
- width = finalMinWidth.value;
6643
- }
6644
- } else if (newWidth > finalMinWidth.value) {
6645
- width = newWidth;
6646
- } else {
6647
- width = finalMinWidth.value;
6648
- }
6649
- return {
6650
- minWidth: `${width}px`
6651
- };
6652
- }
6653
- }
6654
- return {
6655
- minWidth: props.width ? `${props.width}px` : "120px"
6656
- };
6657
- });
6658
- vue.watch(() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value], ([width, rowWidth2, currentWidth2]) => {
6659
- if (!isDragedSelf) {
6660
- return;
6661
- }
6662
- if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
6663
- isDragedSelf = false;
6664
- if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
6665
- initWidthRate = currentWidth2 / rowWidth2;
6666
- } else {
6667
- initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
6668
- }
6669
- }
6670
- }, {
6671
- immediate: true
6672
- });
6673
- useResizeObserver(columnRef, () => {
6674
- if (!isDragedSelf) {
6675
- return;
6676
- }
6677
- const width = parseFloat(columnRef.value.style.width);
6678
- currentWidth.value = width;
6679
- });
6680
- const handleMouseDown = (event) => {
6681
- isDragedSelf = true;
6682
- parentTable == null ? void 0 : parentTable.columnMousedown(event, {
6683
- columnKey,
6684
- minWidth: finalMinWidth.value
6685
- });
6686
- };
6687
- const handleMouseMove = (event) => {
6688
- parentTable == null ? void 0 : parentTable.columnMouseMove(event);
6689
- };
6690
- return (_ctx, _cache) => {
6691
- const _directive_overflow_tips = vue.resolveDirective("overflow-tips");
6692
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
6693
- return vue.openBlock(), vue.createElementBlock("th", {
6694
- ref_key: "columnRef",
6695
- ref: columnRef,
6696
- class: vue.normalizeClass(["bk-ediatable-head-column", {
6697
- "is-required": _ctx.required,
6698
- [`column-${vue.unref(columnKey)}`]: true,
6699
- "is-right-fixed": vue.unref(isMinimize) && isFixedRight.value,
6700
- "is-left-fixed": vue.unref(isMinimize) && isFixedLeft.value
6701
- }]),
6702
- "data-fixed": _ctx.fixed,
6703
- "data-maxWidth": _ctx.maxWidth,
6704
- "data-minWidth": finalMinWidth.value,
6705
- "data-width": _ctx.width,
6706
- style: vue.normalizeStyle(styles.value),
6707
- onMousedown: handleMouseDown,
6708
- onMousemove: handleMouseMove
6709
- }, [
6710
- vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
6711
- vue.createElementVNode(
6712
- "span",
6713
- {
6714
- class: vue.normalizeClass({ "title-memo": _ctx.memo })
6715
- },
6716
- [
6717
- vue.renderSlot(_ctx.$slots, "default")
6718
- ],
6719
- 2
6720
- /* CLASS */
6721
- )
6722
- ])), [
6723
- [_directive_overflow_tips],
6724
- [_directive_bk_tooltips, {
6725
- content: _ctx.memo,
6726
- disabled: !_ctx.memo
6727
- }]
6728
- ]),
6729
- vue.unref(slots).append ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
6730
- vue.renderSlot(_ctx.$slots, "append")
6731
- ])) : vue.createCommentVNode("v-if", true)
6732
- ], 46, _hoisted_1$4);
6733
- };
6734
- }
6735
- });
6736
6770
  const _hoisted_1$3 = { class: "bk-ediatable-operation" };
6737
6771
  const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
6738
- __name: "operation",
6772
+ __name: "operation-column",
6739
6773
  props: {
6774
+ removeable: { type: Boolean, default: true },
6740
6775
  showCopy: { type: Boolean, default: false },
6741
6776
  showAdd: { type: Boolean, default: true },
6742
- showRemove: { type: Boolean, default: true },
6743
- removeable: { type: Boolean, default: true }
6777
+ showRemove: { type: Boolean, default: true }
6744
6778
  },
6745
- emits: ["copy", "add", "remove"],
6779
+ emits: ["add", "copy", "remove"],
6746
6780
  setup(__props, { emit: __emit }) {
6747
6781
  const props = __props;
6748
6782
  const emits = __emit;
@@ -6759,7 +6793,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6759
6793
  emits("remove");
6760
6794
  };
6761
6795
  return (_ctx, _cache) => {
6762
- return vue.openBlock(), vue.createBlock(_sfc_main$5, null, {
6796
+ return vue.openBlock(), vue.createBlock(_sfc_main$4, null, {
6763
6797
  default: vue.withCtx(() => [
6764
6798
  vue.createElementVNode("div", _hoisted_1$3, [
6765
6799
  _ctx.showCopy ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -6804,7 +6838,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6804
6838
  class: "select-error"
6805
6839
  };
6806
6840
  const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
6807
- __name: "select",
6841
+ __name: "select-column",
6808
6842
  props: /* @__PURE__ */ vue.mergeModels({
6809
6843
  list: {},
6810
6844
  placeholder: { default: "请选择" },
@@ -7804,8 +7838,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
7804
7838
  };
7805
7839
  for (var _i = numberOfChecks; _i > 0; _i--) {
7806
7840
  var _ret = _loop(_i);
7807
- if (_ret === "break")
7808
- break;
7841
+ if (_ret === "break") break;
7809
7842
  }
7810
7843
  }
7811
7844
  if (state.placement !== firstFittingPlacement) {
@@ -9454,7 +9487,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9454
9487
  style: { "display": "none" }
9455
9488
  };
9456
9489
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
9457
- __name: "tag-input",
9490
+ __name: "tag-input-column",
9458
9491
  props: /* @__PURE__ */ vue.mergeModels({
9459
9492
  placeholder: { default: "" },
9460
9493
  single: { type: Boolean, default: false },
@@ -9621,7 +9654,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9621
9654
  class: "input-error"
9622
9655
  };
9623
9656
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9624
- __name: "text-plain",
9657
+ __name: "text-plain-column",
9625
9658
  props: {
9626
9659
  data: {},
9627
9660
  isLoading: { type: Boolean },
@@ -9695,15 +9728,15 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9695
9728
  };
9696
9729
  }
9697
9730
  });
9698
- exports2.DateTimePickerColumn = _sfc_main$7;
9699
- exports2.Ediatable = _sfc_main$8;
9700
- exports2.FixedColumn = _sfc_main$5;
9701
- exports2.HeadColumn = _sfc_main$4;
9702
- exports2.InputColumn = _sfc_main$6;
9731
+ exports2.DateTimePickerColumn = _sfc_main$6;
9732
+ exports2.Ediatable = _sfc_main$7;
9733
+ exports2.FixedColumn = _sfc_main$4;
9734
+ exports2.HeadColumn = _sfc_main$8;
9735
+ exports2.InputColumn = _sfc_main$5;
9703
9736
  exports2.OperationColumn = _sfc_main$3;
9704
9737
  exports2.SelectColumn = _sfc_main$2;
9705
9738
  exports2.TagInputColumn = _sfc_main$1;
9706
9739
  exports2.TextPlainColumn = _sfc_main;
9707
- exports2.default = _sfc_main$8;
9740
+ exports2.default = _sfc_main$7;
9708
9741
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
9709
9742
  });