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

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.
@@ -1,6 +1,6 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("bkui-vue/dist/style.css"), require("bkui-vue")) : typeof define === "function" && define.amd ? define(["exports", "vue", "bkui-vue/dist/style.css", "bkui-vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.lesscodeCustomComponentLibrary = {}, global2.Vue, null, global2.bkuiVue));
3
- })(this, function(exports2, vue, style_css, bkuiVue) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("vue"), require("bkui-vue")) : typeof define === "function" && define.amd ? define(["exports", "vue", "bkui-vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.lesscodeCustomComponentLibrary = {}, global2.Vue, global2.bkuiVue));
3
+ })(this, function(exports2, vue, bkuiVue) {
4
4
  "use strict";
5
5
  var __vite_style__ = document.createElement("style");
6
6
  __vite_style__.textContent = `@font-face {
@@ -40,13 +40,7 @@ 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 {
43
+ .bk-ediatable-head-column .is-required::after {
50
44
  position: absolute;
51
45
  top: 0;
52
46
  margin-left: 4px;
@@ -81,20 +75,38 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
81
75
  background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
82
76
  content: '';
83
77
  }
78
+ .bk-ediatable-head-column .title-memo {
79
+ border-bottom: 1px dashed #979ba5;
80
+ }
84
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 {
85
82
  position: relative;
86
83
  width: 100%;
87
- overflow-x: auto;
84
+ margin-bottom: -8px;
85
+ overflow-x: scroll;
88
86
  }
89
87
  .bk-ediatable::-webkit-scrollbar {
90
- width: 4px;
91
- height: 4px;
88
+ width: 8px;
89
+ height: 8px;
90
+ background: transparent;
92
91
  }
93
92
  .bk-ediatable::-webkit-scrollbar-thumb {
94
- background: #ddd;
93
+ background: transparent;
94
+ }
95
+ .bk-ediatable:hover::-webkit-scrollbar {
96
+ width: 8px;
97
+ height: 8px;
98
+ }
99
+ .bk-ediatable:hover::-webkit-scrollbar-thumb {
100
+ background: #dcdee5;
95
101
  border-radius: 20px;
96
102
  box-shadow: inset 0 0 6px rgba(204, 204, 204, 0.3);
97
103
  }
104
+ .bk-ediatable:hover::-webkit-scrollbar-thumb:hover {
105
+ background: #979ba5;
106
+ }
107
+ .bk-ediatable.scrollbar-exists:hover::-webkit-scrollbar {
108
+ background: #f0f1f5;
109
+ }
98
110
  .bk-ediatable table {
99
111
  width: 100%;
100
112
  font-size: 12px;
@@ -118,6 +130,19 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
118
130
  line-height: 0;
119
131
  color: #313238;
120
132
  background: #f0f1f5;
133
+ position: relative;
134
+ }
135
+ .bk-ediatable table th.poiner-right::after {
136
+ content: '';
137
+ position: absolute;
138
+ top: 0;
139
+ bottom: 0;
140
+ right: -3px;
141
+ width: 6px;
142
+ background-color: #3785ff;
143
+ transform: translateX(1px);
144
+ pointer-events: none;
145
+ z-index: 1;
121
146
  }
122
147
  .bk-ediatable table th .th-cell {
123
148
  display: inline-block;
@@ -133,8 +158,38 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
133
158
  top: 0;
134
159
  bottom: 0;
135
160
  display: none;
136
- width: 1px;
137
- background: #dfe0e5;
161
+ width: 2px;
162
+ background: #3c96ff;
163
+ }
164
+ .bk-ediatable .bk-ediatable-right-fixed-column {
165
+ position: sticky;
166
+ right: 1px;
167
+ z-index: 1;
168
+ background-color: #fff;
169
+ }
170
+ .bk-ediatable .bk-ediatable-right-fixed-column::before {
171
+ position: absolute;
172
+ top: 0;
173
+ left: -10px;
174
+ width: 10px;
175
+ height: 100%;
176
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
177
+ content: '';
178
+ }
179
+ .bk-ediatable .bk-ediatable-left-fixed-column {
180
+ position: sticky;
181
+ left: 1px;
182
+ z-index: 1;
183
+ background-color: #fff;
184
+ }
185
+ .bk-ediatable .bk-ediatable-left-fixed-column::before {
186
+ position: absolute;
187
+ top: 0;
188
+ right: -10px;
189
+ width: 10px;
190
+ height: 100%;
191
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.12), transparent);
192
+ content: '';
138
193
  }
139
194
  .db-svg-icon {
140
195
  width: 1em;
@@ -264,36 +319,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
264
319
  .bk-ediatable-input .blur-dispaly-main {
265
320
  padding: 0 16px;
266
321
  }
267
- .bk-ediatable-right-fixed-column {
268
- position: sticky;
269
- right: 1px;
270
- z-index: 1;
271
- background-color: #fff;
272
- }
273
- .bk-ediatable-right-fixed-column::before {
274
- position: absolute;
275
- top: 0;
276
- left: -10px;
277
- width: 10px;
278
- height: 100%;
279
- background: linear-gradient(to left, rgba(0, 0, 0, 0.12), transparent);
280
- content: '';
281
- }
282
- .bk-ediatable-left-fixed-column {
283
- position: sticky;
284
- left: 1px;
285
- z-index: 1;
286
- background-color: #fff;
287
- }
288
- .bk-ediatable-left-fixed-column::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
322
  .bk-ediatable-operation {
298
323
  display: flex;
299
324
  height: 42px;
@@ -367,7 +392,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
367
392
  top: 0;
368
393
  right: 0;
369
394
  bottom: 0;
370
- z-index: 99;
371
395
  display: flex;
372
396
  padding-right: 6px;
373
397
  font-size: 14px;
@@ -5998,10 +6022,8 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
5998
6022
  if (!dragable) {
5999
6023
  return;
6000
6024
  }
6001
- const {
6002
- columnKey,
6003
- minWidth = 100
6004
- } = payload;
6025
+ const { columnKey, minWidth = 100 } = payload;
6026
+ const target = event.target.closest("th");
6005
6027
  const tableEl = tableRef.value;
6006
6028
  const columnEl = tableEl.querySelector(`th.column-${columnKey}`);
6007
6029
  const tableLeft = tableEl.getBoundingClientRect().left;
@@ -6031,6 +6053,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6031
6053
  resizeProxy.style.display = "block";
6032
6054
  resizeProxyLeft = Math.max(minLeft, proxyLeft);
6033
6055
  resizeProxy.style.left = `${resizeProxyLeft}px`;
6056
+ target.classList.add("poiner-right");
6034
6057
  };
6035
6058
  const handleMouseUp = () => {
6036
6059
  if (dragging.value) {
@@ -6055,15 +6078,22 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6055
6078
  document.addEventListener("mouseup", handleMouseUp);
6056
6079
  };
6057
6080
  const handleMouseMove = (event) => {
6081
+ var _a;
6082
+ if (dragging.value) {
6083
+ return;
6084
+ }
6058
6085
  const target = event.target.closest("th");
6059
6086
  const rect = target.getBoundingClientRect();
6060
6087
  const bodyStyle = document.body.style;
6061
6088
  if (rect.width > 12 && rect.right - event.pageX < 8) {
6062
6089
  bodyStyle.cursor = "col-resize";
6063
6090
  dragable = true;
6091
+ target.classList.add("poiner-right");
6064
6092
  } else if (!dragging.value) {
6065
6093
  bodyStyle.cursor = "";
6066
6094
  dragable = false;
6095
+ target.classList.remove("poiner-right");
6096
+ (_a = target.previousElementSibling) == null ? void 0 : _a.classList.remove("poiner-right");
6067
6097
  }
6068
6098
  };
6069
6099
  const handleOuterMousemove = _.throttle((event) => {
@@ -6093,992 +6123,118 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
6093
6123
  handleMouseMove
6094
6124
  };
6095
6125
  }
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;
6126
+ var top = "top";
6127
+ var bottom = "bottom";
6128
+ var right = "right";
6129
+ var left = "left";
6130
+ var auto = "auto";
6131
+ var basePlacements = [top, bottom, right, left];
6132
+ var start = "start";
6133
+ var end = "end";
6134
+ var clippingParents = "clippingParents";
6135
+ var viewport = "viewport";
6136
+ var popper = "popper";
6137
+ var reference = "reference";
6138
+ var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
6139
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
6140
+ }, []);
6141
+ var placements$1 = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
6142
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
6143
+ }, []);
6144
+ var beforeRead = "beforeRead";
6145
+ var read = "read";
6146
+ var afterRead = "afterRead";
6147
+ var beforeMain = "beforeMain";
6148
+ var main = "main";
6149
+ var afterMain = "afterMain";
6150
+ var beforeWrite = "beforeWrite";
6151
+ var write = "write";
6152
+ var afterWrite = "afterWrite";
6153
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
6154
+ function getNodeName(element) {
6155
+ return element ? (element.nodeName || "").toLowerCase() : null;
6156
+ }
6157
+ function getWindow(node) {
6158
+ if (node == null) {
6159
+ return window;
6106
6160
  }
6107
- return false;
6161
+ if (node.toString() !== "[object Window]") {
6162
+ var ownerDocument = node.ownerDocument;
6163
+ return ownerDocument ? ownerDocument.defaultView || window : window;
6164
+ }
6165
+ return node;
6108
6166
  }
6109
- function toValue(r) {
6110
- return typeof r === "function" ? r() : vue.unref(r);
6167
+ function isElement$1(node) {
6168
+ var OwnElement = getWindow(node).Element;
6169
+ return node instanceof OwnElement || node instanceof Element;
6111
6170
  }
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;
6171
+ function isHTMLElement(node) {
6172
+ var OwnElement = getWindow(node).HTMLElement;
6173
+ return node instanceof OwnElement || node instanceof HTMLElement;
6118
6174
  }
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);
6175
+ function isShadowRoot(node) {
6176
+ if (typeof ShadowRoot === "undefined") {
6177
+ return false;
6127
6178
  }
6128
- return isMounted;
6129
- }
6130
- function useSupported(callback) {
6131
- const isMounted = useMounted();
6132
- return vue.computed(() => {
6133
- isMounted.value;
6134
- return Boolean(callback());
6135
- });
6179
+ var OwnElement = getWindow(node).ShadowRoot;
6180
+ return node instanceof OwnElement || node instanceof ShadowRoot;
6136
6181
  }
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;
6182
+ function applyStyles(_ref) {
6183
+ var state = _ref.state;
6184
+ Object.keys(state.elements).forEach(function(name) {
6185
+ var style = state.styles[name] || {};
6186
+ var attributes = state.attributes[name] || {};
6187
+ var element = state.elements[name];
6188
+ if (!isHTMLElement(element) || !getNodeName(element)) {
6189
+ return;
6145
6190
  }
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);
6191
+ Object.assign(element.style, style);
6192
+ Object.keys(attributes).forEach(function(name2) {
6193
+ var value = attributes[name2];
6194
+ if (value === false) {
6195
+ element.removeAttribute(name2);
6196
+ } else {
6197
+ element.setAttribute(name2, value === true ? "" : value);
6156
6198
  }
6199
+ });
6200
+ });
6201
+ }
6202
+ function effect$2(_ref2) {
6203
+ var state = _ref2.state;
6204
+ var initialStyles = {
6205
+ popper: {
6206
+ position: state.options.strategy,
6207
+ left: "0",
6208
+ top: "0",
6209
+ margin: "0"
6157
6210
  },
6158
- { immediate: true, flush: "post" }
6159
- );
6160
- const stop = () => {
6161
- cleanup();
6162
- stopWatch();
6211
+ arrow: {
6212
+ position: "absolute"
6213
+ },
6214
+ reference: {}
6163
6215
  };
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" } };
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({
6308
- __name: "ediatable",
6309
- props: {
6310
- theadList: { default: () => [] }
6311
- },
6312
- setup(__props) {
6313
- const slots = vue.useSlots();
6314
- const checkTableScroll = () => {
6315
- rowWidth.value = tableRef.value.clientWidth;
6316
- isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
6317
- initColumnWidth();
6318
- };
6319
- const tableOuterRef = vue.ref();
6320
- const tableRef = vue.ref();
6321
- const tableColumnResizeRef = vue.ref();
6322
- const isOverflow = vue.ref(false);
6323
- const rowWidth = vue.ref(0);
6324
- const { initColumnWidth } = useColumnResize(tableOuterRef, tableColumnResizeRef, _.debounce(checkTableScroll));
6325
- vue.provide(renderTablekey, {
6326
- isOverflow,
6327
- rowWidth
6328
- });
6329
- vue.onMounted(() => {
6330
- window.addEventListener("resize", checkTableScroll);
6331
- checkTableScroll();
6332
- setTimeout(() => checkTableScroll());
6333
- });
6334
- vue.onBeforeUnmount(() => window.removeEventListener("resize", checkTableScroll));
6335
- return (_ctx, _cache) => {
6336
- return vue.openBlock(), vue.createElementBlock(
6337
- "div",
6338
- {
6339
- id: "ediatableRenderTableKey",
6340
- ref_key: "tableOuterRef",
6341
- ref: tableOuterRef,
6342
- class: "bk-ediatable"
6343
- },
6344
- [
6345
- vue.createElementVNode(
6346
- "table",
6347
- {
6348
- ref_key: "tableRef",
6349
- ref: tableRef
6350
- },
6351
- [
6352
- vue.createElementVNode("thead", null, [
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
- ))
6382
- ])
6383
- ]),
6384
- vue.createElementVNode("tbody", null, [
6385
- vue.renderSlot(_ctx.$slots, "data")
6386
- ])
6387
- ],
6388
- 512
6389
- /* NEED_PATCH */
6390
- ),
6391
- vue.createElementVNode(
6392
- "div",
6393
- {
6394
- ref_key: "tableColumnResizeRef",
6395
- ref: tableColumnResizeRef,
6396
- class: "table-column-resize"
6397
- },
6398
- null,
6399
- 512
6400
- /* NEED_PATCH */
6401
- )
6402
- ],
6403
- 512
6404
- /* NEED_PATCH */
6405
- );
6406
- };
6407
- }
6408
- });
6409
- const getRuleMessage = (rule) => {
6410
- if (typeof rule.message === "function") {
6411
- return rule.message();
6412
- }
6413
- return rule.message;
6414
- };
6415
- function useValidtor(rules) {
6416
- const state = vue.reactive({
6417
- loading: false,
6418
- error: false,
6419
- message: ""
6420
- });
6421
- const validator = (targetValue) => {
6422
- state.error = false, state.message = "";
6423
- if (!rules) {
6424
- return Promise.resolve(true);
6425
- }
6426
- const run = /* @__PURE__ */ (() => {
6427
- let stepIndex = -1;
6428
- return async () => {
6429
- stepIndex = stepIndex + 1;
6430
- if (stepIndex >= rules.length) {
6431
- return Promise.resolve(true);
6432
- }
6433
- const rule = rules[stepIndex];
6434
- return Promise.resolve().then(() => {
6435
- const result = rule.validator(targetValue);
6436
- if (typeof result !== "boolean" && typeof result.then === "function") {
6437
- return result.then((data) => {
6438
- if (data === false) {
6439
- return Promise.reject(getRuleMessage(rule));
6440
- }
6441
- }).then(() => run(), () => {
6442
- state.error = true;
6443
- const message = getRuleMessage(rule);
6444
- state.message = message;
6445
- return Promise.reject(message);
6446
- });
6447
- }
6448
- if (!result) {
6449
- state.error = true;
6450
- const message = getRuleMessage(rule);
6451
- state.message = message;
6452
- return Promise.reject(message);
6453
- }
6454
- return run();
6455
- });
6456
- };
6457
- })();
6458
- return run();
6459
- };
6460
- return {
6461
- ...vue.toRefs(state),
6462
- validator
6463
- };
6464
- }
6465
- const DbIcon = vue.defineComponent({
6466
- name: "DbIcon",
6467
- props: {
6468
- type: {
6469
- type: String,
6470
- required: true
6471
- },
6472
- svg: {
6473
- type: Boolean,
6474
- default: false
6475
- }
6476
- },
6477
- render() {
6478
- if (this.svg) {
6479
- return vue.h(
6480
- "svg",
6481
- {
6482
- class: {
6483
- "db-svg-icon": true
6484
- }
6485
- },
6486
- [
6487
- vue.h("use", {
6488
- "xlink:href": `#db-icon-${this.type}`
6489
- })
6490
- ]
6491
- );
6492
- }
6493
- const classes = {
6494
- "ediatable-icon": true,
6495
- [`icon-${this.type}`]: true
6496
- };
6497
- return vue.h("i", {
6498
- class: classes
6499
- });
6500
- }
6501
- });
6502
- const _hoisted_1$5 = {
6503
- key: 0,
6504
- class: "input-error"
6505
- };
6506
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
6507
- __name: "date-time-picker-column",
6508
- props: /* @__PURE__ */ vue.mergeModels({
6509
- placeholder: { default: "" },
6510
- rules: { default: void 0 },
6511
- type: { default: void 0 },
6512
- disabled: { type: Boolean, default: false }
6513
- }, {
6514
- "modelValue": {},
6515
- "modelModifiers": {}
6516
- }),
6517
- emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
6518
- setup(__props, { expose: __expose, emit: __emit }) {
6519
- const props = __props;
6520
- const emits = __emit;
6521
- const modelValue = vue.useModel(__props, "modelValue");
6522
- const attrs = vue.useAttrs();
6523
- const slots = vue.useSlots();
6524
- const { message: errorMessage, validator } = useValidtor(props.rules);
6525
- const handleChange = (value) => {
6526
- modelValue.value = value;
6527
- validator(modelValue.value).then(() => {
6528
- emits("change", modelValue.value);
6529
- });
6530
- };
6531
- const handleOpenChange = (open) => {
6532
- if (!open) {
6533
- validator(modelValue.value);
6534
- }
6535
- };
6536
- __expose({
6537
- getValue() {
6538
- return validator(modelValue.value).then(() => modelValue.value);
6539
- }
6540
- });
6541
- return (_ctx, _cache) => {
6542
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
6543
- return vue.openBlock(), vue.createElementBlock(
6544
- "div",
6545
- {
6546
- class: vue.normalizeClass(["bk-ediatable-time-picker", {
6547
- "is-error": Boolean(vue.unref(errorMessage)),
6548
- "is-disabled": _ctx.disabled
6549
- }])
6550
- },
6551
- [
6552
- vue.createVNode(vue.unref(bkuiVue.DatePicker), vue.mergeProps({
6553
- "append-to-body": "",
6554
- clearable: false,
6555
- "model-value": modelValue.value,
6556
- placeholder: _ctx.placeholder,
6557
- style: { "width": "100%" },
6558
- type: _ctx.type
6559
- }, vue.unref(attrs), {
6560
- onChange: handleChange,
6561
- onOpenChange: handleOpenChange
6562
- }), vue.createSlots({
6563
- _: 2
6564
- /* DYNAMIC */
6565
- }, [
6566
- vue.unref(slots).footer ? {
6567
- name: "footer",
6568
- fn: vue.withCtx(() => [
6569
- vue.renderSlot(_ctx.$slots, "footer")
6570
- ]),
6571
- key: "0"
6572
- } : void 0
6573
- ]), 1040, ["model-value", "placeholder", "type"]),
6574
- vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
6575
- vue.withDirectives(vue.createVNode(
6576
- vue.unref(DbIcon),
6577
- { type: "exclamation-fill" },
6578
- null,
6579
- 512
6580
- /* NEED_PATCH */
6581
- ), [
6582
- [_directive_bk_tooltips, vue.unref(errorMessage)]
6583
- ])
6584
- ])) : vue.createCommentVNode("v-if", true)
6585
- ],
6586
- 2
6587
- /* CLASS */
6588
- );
6589
- };
6590
- }
6591
- });
6592
- const _hoisted_1$4 = {
6593
- key: 1,
6594
- class: "blur-dispaly-main"
6595
- };
6596
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
6597
- __name: "input-column",
6598
- props: /* @__PURE__ */ vue.mergeModels({
6599
- placeholder: { default: "请输入" },
6600
- rules: { default: void 0 },
6601
- disabled: { type: Boolean, default: false },
6602
- type: { default: "text" },
6603
- min: { default: Number.MIN_SAFE_INTEGER },
6604
- max: { default: Number.MAX_SAFE_INTEGER },
6605
- isShowBlur: { type: Boolean, default: false },
6606
- precision: { default: 0 }
6607
- }, {
6608
- "modelValue": {
6609
- default: ""
6610
- },
6611
- "modelModifiers": {}
6612
- }),
6613
- emits: /* @__PURE__ */ vue.mergeModels(["submit"], ["update:modelValue"]),
6614
- setup(__props, { expose: __expose, emit: __emit }) {
6615
- const props = __props;
6616
- const emits = __emit;
6617
- const modelValue = vue.useModel(__props, "modelValue");
6618
- const rootRef = vue.ref();
6619
- const isBlur = vue.ref(true);
6620
- const isPassword = vue.computed(() => props.type === "password");
6621
- let oldInputText = "";
6622
- const {
6623
- message: errorMessage,
6624
- validator
6625
- } = useValidtor(props.rules);
6626
- const handleInput = (value) => {
6627
- isBlur.value = false;
6628
- modelValue.value = value;
6629
- };
6630
- const handleBlur = (event) => {
6631
- isBlur.value = true;
6632
- if (props.disabled) {
6633
- event.preventDefault();
6634
- return;
6635
- }
6636
- if (modelValue.value) {
6637
- if (oldInputText === modelValue.value) {
6638
- return;
6639
- }
6640
- oldInputText = modelValue.value;
6641
- validator(modelValue.value).then(() => {
6642
- emits("submit", modelValue.value);
6643
- });
6644
- return;
6645
- }
6646
- emits("submit", modelValue.value);
6647
- };
6648
- const handleKeydown = (_value, event) => {
6649
- if (props.disabled) {
6650
- event.preventDefault();
6651
- return;
6652
- }
6653
- if (event.isComposing) {
6654
- return;
6655
- }
6656
- if (event.which === 13 || event.key === "Enter") {
6657
- if (oldInputText === modelValue.value) {
6658
- return;
6659
- }
6660
- oldInputText = modelValue.value;
6661
- event.preventDefault();
6662
- validator(modelValue.value).then((result) => {
6663
- if (result) {
6664
- emits("submit", modelValue.value);
6665
- }
6666
- });
6667
- }
6668
- };
6669
- const handlePaste = (_value, event) => {
6670
- event.preventDefault();
6671
- let paste = (event.clipboardData || window.clipboardData).getData("text");
6672
- paste = encodeMult(paste);
6673
- modelValue.value += paste.replace(/^\s+|\s+$/g, "");
6674
- };
6675
- __expose({
6676
- getValue() {
6677
- return validator(modelValue.value).then(() => modelValue.value);
6678
- },
6679
- focus() {
6680
- var _a;
6681
- (_a = rootRef.value.querySelector("input")) == null ? void 0 : _a.focus();
6682
- }
6683
- });
6684
- return (_ctx, _cache) => {
6685
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
6686
- return vue.openBlock(), vue.createElementBlock(
6687
- "div",
6688
- {
6689
- ref_key: "rootRef",
6690
- ref: rootRef,
6691
- class: vue.normalizeClass(["bk-ediatable-input", {
6692
- "is-error": Boolean(vue.unref(errorMessage)),
6693
- "is-disabled": _ctx.disabled,
6694
- "is-password": isPassword.value
6695
- }])
6696
- },
6697
- [
6698
- vue.createVNode(vue.unref(bkuiVue.Input), vue.mergeProps({
6699
- class: "input-box",
6700
- disabled: _ctx.disabled,
6701
- max: _ctx.max,
6702
- min: _ctx.min,
6703
- "model-value": modelValue.value,
6704
- placeholder: _ctx.placeholder,
6705
- type: _ctx.type
6706
- }, _ctx.$attrs, {
6707
- precision: _ctx.precision,
6708
- onBlur: handleBlur,
6709
- onChange: handleInput,
6710
- onFocus: _cache[0] || (_cache[0] = () => isBlur.value = false),
6711
- onInput: handleInput,
6712
- onKeydown: handleKeydown,
6713
- onPaste: handlePaste
6714
- }), {
6715
- suffix: vue.withCtx(() => []),
6716
- _: 1
6717
- /* STABLE */
6718
- }, 16, ["disabled", "max", "min", "model-value", "placeholder", "type", "precision"]),
6719
- vue.unref(errorMessage) ? vue.withDirectives((vue.openBlock(), vue.createBlock(
6720
- vue.unref(DbIcon),
6721
- {
6722
- key: 0,
6723
- class: "error-icon",
6724
- type: "exclamation-fill"
6725
- },
6726
- null,
6727
- 512
6728
- /* NEED_PATCH */
6729
- )), [
6730
- [_directive_bk_tooltips, vue.unref(errorMessage)]
6731
- ]) : vue.createCommentVNode("v-if", true),
6732
- _ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
6733
- vue.renderSlot(_ctx.$slots, "blur")
6734
- ])) : vue.createCommentVNode("v-if", true)
6735
- ],
6736
- 2
6737
- /* CLASS */
6738
- );
6739
- };
6740
- }
6741
- });
6742
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
6743
- __name: "fixed-column",
6744
- props: {
6745
- fixed: { default: "right" }
6746
- },
6747
- setup(__props) {
6748
- const props = __props;
6749
- const { isOverflow: isFixed } = vue.inject(renderTablekey);
6750
- const isFixedRight = vue.computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "right");
6751
- const isFixedLeft = vue.computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "left");
6752
- return (_ctx, _cache) => {
6753
- return vue.openBlock(), vue.createElementBlock(
6754
- "td",
6755
- {
6756
- class: vue.normalizeClass({
6757
- "bk-ediatable-right-fixed-column": isFixedRight.value,
6758
- "bk-ediatable-left-fixed-column": isFixedLeft.value
6759
- })
6760
- },
6761
- [
6762
- vue.renderSlot(_ctx.$slots, "default")
6763
- ],
6764
- 2
6765
- /* CLASS */
6766
- );
6767
- };
6768
- }
6769
- });
6770
- const _hoisted_1$3 = { class: "bk-ediatable-operation" };
6771
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
6772
- __name: "operation-column",
6773
- props: {
6774
- removeable: { type: Boolean, default: true },
6775
- showCopy: { type: Boolean, default: false },
6776
- showAdd: { type: Boolean, default: true },
6777
- showRemove: { type: Boolean, default: true }
6778
- },
6779
- emits: ["add", "copy", "remove"],
6780
- setup(__props, { emit: __emit }) {
6781
- const props = __props;
6782
- const emits = __emit;
6783
- const handleCopy = () => {
6784
- emits("copy");
6785
- };
6786
- const handleAppend = () => {
6787
- emits("add");
6788
- };
6789
- const handleRemove = () => {
6790
- if (props.removeable) {
6791
- return;
6792
- }
6793
- emits("remove");
6794
- };
6795
- return (_ctx, _cache) => {
6796
- return vue.openBlock(), vue.createBlock(_sfc_main$4, null, {
6797
- default: vue.withCtx(() => [
6798
- vue.createElementVNode("div", _hoisted_1$3, [
6799
- _ctx.showCopy ? (vue.openBlock(), vue.createElementBlock("div", {
6800
- key: 0,
6801
- class: "action-btn",
6802
- onClick: handleCopy
6803
- }, [
6804
- vue.createVNode(vue.unref(DbIcon), { type: "copy" })
6805
- ])) : vue.createCommentVNode("v-if", true),
6806
- _ctx.showAdd ? (vue.openBlock(), vue.createElementBlock("div", {
6807
- key: 1,
6808
- class: "action-btn",
6809
- onClick: handleAppend
6810
- }, [
6811
- vue.createVNode(vue.unref(DbIcon), { type: "plus-fill" })
6812
- ])) : vue.createCommentVNode("v-if", true),
6813
- _ctx.showRemove ? (vue.openBlock(), vue.createElementBlock(
6814
- "div",
6815
- {
6816
- key: 2,
6817
- class: vue.normalizeClass(["action-btn", {
6818
- disabled: _ctx.removeable
6819
- }]),
6820
- onClick: handleRemove
6821
- },
6822
- [
6823
- vue.createVNode(vue.unref(DbIcon), { type: "minus-fill" })
6824
- ],
6825
- 2
6826
- /* CLASS */
6827
- )) : vue.createCommentVNode("v-if", true)
6828
- ])
6829
- ]),
6830
- _: 1
6831
- /* STABLE */
6832
- });
6833
- };
6834
- }
6835
- });
6836
- const _hoisted_1$2 = {
6837
- key: 0,
6838
- class: "select-error"
6839
- };
6840
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
6841
- __name: "select-column",
6842
- props: /* @__PURE__ */ vue.mergeModels({
6843
- list: {},
6844
- placeholder: { default: "请选择" },
6845
- rules: { default: () => [] },
6846
- disabled: { type: Boolean, default: false },
6847
- multiple: { type: Boolean, default: false },
6848
- showSelectAll: { type: Boolean, default: false }
6849
- }, {
6850
- "modelValue": {},
6851
- "modelModifiers": {}
6852
- }),
6853
- emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
6854
- setup(__props, { expose: __expose, emit: __emit }) {
6855
- const { Option } = bkuiVue.Select;
6856
- const props = __props;
6857
- const emits = __emit;
6858
- const modelValue = vue.useModel(__props, "modelValue");
6859
- const rootRef = vue.ref();
6860
- const localValue = vue.ref("");
6861
- const rootHeight = vue.ref(42);
6862
- const { message: errorMessage, validator } = useValidtor(props.rules);
6863
- vue.watch(
6864
- modelValue,
6865
- (value) => {
6866
- if (value === void 0) {
6867
- return;
6868
- }
6869
- localValue.value = value;
6870
- if (typeof value !== "object" && value) {
6871
- validator(value);
6872
- return;
6873
- }
6874
- if (Array.isArray(value) && value.length > 0) {
6875
- validator(value);
6876
- return;
6877
- }
6878
- },
6879
- {
6880
- immediate: true
6881
- }
6882
- );
6883
- const handleSelect = (value) => {
6884
- localValue.value = value;
6885
- validator(localValue.value).then(() => {
6886
- modelValue.value = value;
6887
- emits("change", localValue.value);
6888
- });
6889
- };
6890
- const handleRemove = () => {
6891
- localValue.value = "";
6892
- validator(localValue.value).then(() => {
6893
- modelValue.value = localValue.value;
6894
- emits("change", localValue.value);
6895
- });
6896
- };
6897
- const checkRootHeight = () => {
6898
- rootHeight.value = rootRef.value.parentNode.clientHeight;
6899
- };
6900
- useResizeObserver(rootRef, _.throttle(checkRootHeight, 500));
6901
- __expose({
6902
- getValue() {
6903
- return validator(localValue.value).then(() => localValue.value);
6904
- }
6905
- });
6906
- return (_ctx, _cache) => {
6907
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
6908
- return vue.openBlock(), vue.createElementBlock(
6909
- "div",
6910
- {
6911
- ref_key: "rootRef",
6912
- ref: rootRef,
6913
- class: vue.normalizeClass(["bk-ediatable-select", {
6914
- "is-error": Boolean(vue.unref(errorMessage)),
6915
- "is-disable": _ctx.disabled
6916
- }]),
6917
- style: vue.normalizeStyle({ height: rootHeight.value + "px" })
6918
- },
6919
- [
6920
- vue.createVNode(vue.unref(bkuiVue.Select), vue.mergeProps(_ctx.$attrs, {
6921
- "model-value": localValue.value,
6922
- "auto-focus": "",
6923
- class: "select-box",
6924
- clearable: false,
6925
- disabled: _ctx.disabled,
6926
- filterable: "",
6927
- "input-search": false,
6928
- multiple: _ctx.multiple,
6929
- placeholder: _ctx.placeholder,
6930
- "show-select-all": _ctx.showSelectAll,
6931
- onChange: handleSelect,
6932
- onClear: handleRemove
6933
- }), {
6934
- default: vue.withCtx(() => [
6935
- (vue.openBlock(true), vue.createElementBlock(
6936
- vue.Fragment,
6937
- null,
6938
- vue.renderList(_ctx.list, (item, index) => {
6939
- return vue.openBlock(), vue.createBlock(vue.unref(Option), {
6940
- key: index,
6941
- label: item.label,
6942
- value: item.value
6943
- }, null, 8, ["label", "value"]);
6944
- }),
6945
- 128
6946
- /* KEYED_FRAGMENT */
6947
- ))
6948
- ]),
6949
- _: 1
6950
- /* STABLE */
6951
- }, 16, ["model-value", "disabled", "multiple", "placeholder", "show-select-all"]),
6952
- vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
6953
- vue.withDirectives(vue.createVNode(
6954
- vue.unref(DbIcon),
6955
- { type: "exclamation-fill" },
6956
- null,
6957
- 512
6958
- /* NEED_PATCH */
6959
- ), [
6960
- [_directive_bk_tooltips, vue.unref(errorMessage)]
6961
- ])
6962
- ])) : vue.createCommentVNode("v-if", true)
6963
- ],
6964
- 6
6965
- /* CLASS, STYLE */
6966
- );
6967
- };
6968
- }
6969
- });
6970
- var top = "top";
6971
- var bottom = "bottom";
6972
- var right = "right";
6973
- var left = "left";
6974
- var auto = "auto";
6975
- var basePlacements = [top, bottom, right, left];
6976
- var start = "start";
6977
- var end = "end";
6978
- var clippingParents = "clippingParents";
6979
- var viewport = "viewport";
6980
- var popper = "popper";
6981
- var reference = "reference";
6982
- var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
6983
- return acc.concat([placement + "-" + start, placement + "-" + end]);
6984
- }, []);
6985
- var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
6986
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
6987
- }, []);
6988
- var beforeRead = "beforeRead";
6989
- var read = "read";
6990
- var afterRead = "afterRead";
6991
- var beforeMain = "beforeMain";
6992
- var main = "main";
6993
- var afterMain = "afterMain";
6994
- var beforeWrite = "beforeWrite";
6995
- var write = "write";
6996
- var afterWrite = "afterWrite";
6997
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
6998
- function getNodeName(element) {
6999
- return element ? (element.nodeName || "").toLowerCase() : null;
7000
- }
7001
- function getWindow(node) {
7002
- if (node == null) {
7003
- return window;
7004
- }
7005
- if (node.toString() !== "[object Window]") {
7006
- var ownerDocument = node.ownerDocument;
7007
- return ownerDocument ? ownerDocument.defaultView || window : window;
7008
- }
7009
- return node;
7010
- }
7011
- function isElement$1(node) {
7012
- var OwnElement = getWindow(node).Element;
7013
- return node instanceof OwnElement || node instanceof Element;
7014
- }
7015
- function isHTMLElement(node) {
7016
- var OwnElement = getWindow(node).HTMLElement;
7017
- return node instanceof OwnElement || node instanceof HTMLElement;
7018
- }
7019
- function isShadowRoot(node) {
7020
- if (typeof ShadowRoot === "undefined") {
7021
- return false;
7022
- }
7023
- var OwnElement = getWindow(node).ShadowRoot;
7024
- return node instanceof OwnElement || node instanceof ShadowRoot;
7025
- }
7026
- function applyStyles(_ref) {
7027
- var state = _ref.state;
7028
- Object.keys(state.elements).forEach(function(name) {
7029
- var style = state.styles[name] || {};
7030
- var attributes = state.attributes[name] || {};
7031
- var element = state.elements[name];
7032
- if (!isHTMLElement(element) || !getNodeName(element)) {
7033
- return;
7034
- }
7035
- Object.assign(element.style, style);
7036
- Object.keys(attributes).forEach(function(name2) {
7037
- var value = attributes[name2];
7038
- if (value === false) {
7039
- element.removeAttribute(name2);
7040
- } else {
7041
- element.setAttribute(name2, value === true ? "" : value);
7042
- }
7043
- });
7044
- });
7045
- }
7046
- function effect$2(_ref2) {
7047
- var state = _ref2.state;
7048
- var initialStyles = {
7049
- popper: {
7050
- position: state.options.strategy,
7051
- left: "0",
7052
- top: "0",
7053
- margin: "0"
7054
- },
7055
- arrow: {
7056
- position: "absolute"
7057
- },
7058
- reference: {}
7059
- };
7060
- Object.assign(state.elements.popper.style, initialStyles.popper);
7061
- state.styles = initialStyles;
7062
- if (state.elements.arrow) {
7063
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
7064
- }
7065
- return function() {
7066
- Object.keys(state.elements).forEach(function(name) {
7067
- var element = state.elements[name];
7068
- var attributes = state.attributes[name] || {};
7069
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
7070
- var style = styleProperties.reduce(function(style2, property) {
7071
- style2[property] = "";
7072
- return style2;
7073
- }, {});
7074
- if (!isHTMLElement(element) || !getNodeName(element)) {
7075
- return;
7076
- }
7077
- Object.assign(element.style, style);
7078
- Object.keys(attributes).forEach(function(attribute) {
7079
- element.removeAttribute(attribute);
7080
- });
7081
- });
6216
+ Object.assign(state.elements.popper.style, initialStyles.popper);
6217
+ state.styles = initialStyles;
6218
+ if (state.elements.arrow) {
6219
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
6220
+ }
6221
+ return function() {
6222
+ Object.keys(state.elements).forEach(function(name) {
6223
+ var element = state.elements[name];
6224
+ var attributes = state.attributes[name] || {};
6225
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
6226
+ var style = styleProperties.reduce(function(style2, property) {
6227
+ style2[property] = "";
6228
+ return style2;
6229
+ }, {});
6230
+ if (!isHTMLElement(element) || !getNodeName(element)) {
6231
+ return;
6232
+ }
6233
+ Object.assign(element.style, style);
6234
+ Object.keys(attributes).forEach(function(attribute) {
6235
+ element.removeAttribute(attribute);
6236
+ });
6237
+ });
7082
6238
  };
7083
6239
  }
7084
6240
  const applyStyles$1 = {
@@ -7730,16 +6886,16 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
7730
6886
  if (options === void 0) {
7731
6887
  options = {};
7732
6888
  }
7733
- var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
6889
+ var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements$1 : _options$allowedAutoP;
7734
6890
  var variation = getVariation(placement);
7735
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
6891
+ var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
7736
6892
  return getVariation(placement2) === variation;
7737
6893
  }) : basePlacements;
7738
- var allowedPlacements = placements$1.filter(function(placement2) {
6894
+ var allowedPlacements = placements2.filter(function(placement2) {
7739
6895
  return allowedAutoPlacements.indexOf(placement2) >= 0;
7740
6896
  });
7741
6897
  if (allowedPlacements.length === 0) {
7742
- allowedPlacements = placements$1;
6898
+ allowedPlacements = placements2;
7743
6899
  }
7744
6900
  var overflows = allowedPlacements.reduce(function(acc, placement2) {
7745
6901
  acc[placement2] = detectOverflow(state, {
@@ -7928,7 +7084,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
7928
7084
  function offset(_ref2) {
7929
7085
  var state = _ref2.state, options = _ref2.options, name = _ref2.name;
7930
7086
  var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
7931
- var data = placements.reduce(function(acc, placement) {
7087
+ var data = placements$1.reduce(function(acc, placement) {
7932
7088
  acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
7933
7089
  return acc;
7934
7090
  }, {});
@@ -8525,7 +7681,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8525
7681
  theme: "",
8526
7682
  zIndex: 9999
8527
7683
  };
8528
- var defaultProps = Object.assign({
7684
+ var defaultProps$1 = Object.assign({
8529
7685
  appendTo: TIPPY_DEFAULT_APPEND_TO,
8530
7686
  aria: {
8531
7687
  content: "auto",
@@ -8574,11 +7730,11 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8574
7730
  trigger: "mouseenter focus",
8575
7731
  triggerTarget: null
8576
7732
  }, pluginProps, renderProps);
8577
- var defaultKeys = Object.keys(defaultProps);
7733
+ var defaultKeys = Object.keys(defaultProps$1);
8578
7734
  var setDefaultProps = function setDefaultProps2(partialProps) {
8579
7735
  var keys = Object.keys(partialProps);
8580
7736
  keys.forEach(function(key) {
8581
- defaultProps[key] = partialProps[key];
7737
+ defaultProps$1[key] = partialProps[key];
8582
7738
  });
8583
7739
  };
8584
7740
  function getExtendedPassedProps(passedProps) {
@@ -8587,14 +7743,14 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8587
7743
  var name = plugin.name, defaultValue = plugin.defaultValue;
8588
7744
  if (name) {
8589
7745
  var _name;
8590
- acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
7746
+ acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps$1[name]) != null ? _name : defaultValue;
8591
7747
  }
8592
7748
  return acc;
8593
7749
  }, {});
8594
7750
  return Object.assign({}, passedProps, pluginProps2);
8595
7751
  }
8596
7752
  function getDataAttributeProps(reference2, plugins) {
8597
- var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
7753
+ var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps$1, {
8598
7754
  plugins
8599
7755
  }))) : defaultKeys;
8600
7756
  var props = propKeys.reduce(function(acc, key) {
@@ -8619,7 +7775,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8619
7775
  var out = Object.assign({}, props, {
8620
7776
  content: invokeWithArgsOrReturn(props.content, [reference2])
8621
7777
  }, props.ignoreAttributes ? {} : getDataAttributeProps(reference2, props.plugins));
8622
- out.aria = Object.assign({}, defaultProps.aria, out.aria);
7778
+ out.aria = Object.assign({}, defaultProps$1.aria, out.aria);
8623
7779
  out.aria = {
8624
7780
  expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded,
8625
7781
  content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content
@@ -8734,7 +7890,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8734
7890
  var mouseMoveListeners = [];
8735
7891
  var mountedInstances = [];
8736
7892
  function createTippy(reference2, passedProps) {
8737
- var props = evaluateProps(reference2, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps))));
7893
+ var props = evaluateProps(reference2, Object.assign({}, defaultProps$1, getExtendedPassedProps(removeUndefinedProps(passedProps))));
8738
7894
  var showTimeout;
8739
7895
  var hideTimeout;
8740
7896
  var scheduleHideAnimationFrame;
@@ -8833,651 +7989,1687 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
8833
7989
  var parent = getCurrentTarget().parentNode;
8834
7990
  return parent ? getOwnerDocument(parent) : document;
8835
7991
  }
8836
- function getDefaultTemplateChildren() {
8837
- return getChildren(popper2);
7992
+ function getDefaultTemplateChildren() {
7993
+ return getChildren(popper2);
7994
+ }
7995
+ function getDelay(isShow) {
7996
+ if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
7997
+ return 0;
7998
+ }
7999
+ return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps$1.delay);
8000
+ }
8001
+ function handleStyles(fromHide) {
8002
+ if (fromHide === void 0) {
8003
+ fromHide = false;
8004
+ }
8005
+ popper2.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none";
8006
+ popper2.style.zIndex = "" + instance.props.zIndex;
8007
+ }
8008
+ function invokeHook(hook, args, shouldInvokePropsHook) {
8009
+ if (shouldInvokePropsHook === void 0) {
8010
+ shouldInvokePropsHook = true;
8011
+ }
8012
+ pluginsHooks.forEach(function(pluginHooks) {
8013
+ if (pluginHooks[hook]) {
8014
+ pluginHooks[hook].apply(pluginHooks, args);
8015
+ }
8016
+ });
8017
+ if (shouldInvokePropsHook) {
8018
+ var _instance$props;
8019
+ (_instance$props = instance.props)[hook].apply(_instance$props, args);
8020
+ }
8021
+ }
8022
+ function handleAriaContentAttribute() {
8023
+ var aria = instance.props.aria;
8024
+ if (!aria.content) {
8025
+ return;
8026
+ }
8027
+ var attr = "aria-" + aria.content;
8028
+ var id2 = popper2.id;
8029
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8030
+ nodes.forEach(function(node) {
8031
+ var currentValue = node.getAttribute(attr);
8032
+ if (instance.state.isVisible) {
8033
+ node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2);
8034
+ } else {
8035
+ var nextValue = currentValue && currentValue.replace(id2, "").trim();
8036
+ if (nextValue) {
8037
+ node.setAttribute(attr, nextValue);
8038
+ } else {
8039
+ node.removeAttribute(attr);
8040
+ }
8041
+ }
8042
+ });
8043
+ }
8044
+ function handleAriaExpandedAttribute() {
8045
+ if (hasAriaExpanded || !instance.props.aria.expanded) {
8046
+ return;
8047
+ }
8048
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8049
+ nodes.forEach(function(node) {
8050
+ if (instance.props.interactive) {
8051
+ node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false");
8052
+ } else {
8053
+ node.removeAttribute("aria-expanded");
8054
+ }
8055
+ });
8056
+ }
8057
+ function cleanupInteractiveMouseListeners() {
8058
+ getDocument().removeEventListener("mousemove", debouncedOnMouseMove);
8059
+ mouseMoveListeners = mouseMoveListeners.filter(function(listener) {
8060
+ return listener !== debouncedOnMouseMove;
8061
+ });
8062
+ }
8063
+ function onDocumentPress(event) {
8064
+ if (currentInput.isTouch) {
8065
+ if (didTouchMove || event.type === "mousedown") {
8066
+ return;
8067
+ }
8068
+ }
8069
+ var actualTarget = event.composedPath && event.composedPath()[0] || event.target;
8070
+ if (instance.props.interactive && actualContains(popper2, actualTarget)) {
8071
+ return;
8072
+ }
8073
+ if (normalizeToArray(instance.props.triggerTarget || reference2).some(function(el) {
8074
+ return actualContains(el, actualTarget);
8075
+ })) {
8076
+ if (currentInput.isTouch) {
8077
+ return;
8078
+ }
8079
+ if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) {
8080
+ return;
8081
+ }
8082
+ } else {
8083
+ invokeHook("onClickOutside", [instance, event]);
8084
+ }
8085
+ if (instance.props.hideOnClick === true) {
8086
+ instance.clearDelayTimeouts();
8087
+ instance.hide();
8088
+ didHideDueToDocumentMouseDown = true;
8089
+ setTimeout(function() {
8090
+ didHideDueToDocumentMouseDown = false;
8091
+ });
8092
+ if (!instance.state.isMounted) {
8093
+ removeDocumentPress();
8094
+ }
8095
+ }
8096
+ }
8097
+ function onTouchMove() {
8098
+ didTouchMove = true;
8099
+ }
8100
+ function onTouchStart() {
8101
+ didTouchMove = false;
8102
+ }
8103
+ function addDocumentPress() {
8104
+ var doc = getDocument();
8105
+ doc.addEventListener("mousedown", onDocumentPress, true);
8106
+ doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
8107
+ doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
8108
+ doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
8109
+ }
8110
+ function removeDocumentPress() {
8111
+ var doc = getDocument();
8112
+ doc.removeEventListener("mousedown", onDocumentPress, true);
8113
+ doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
8114
+ doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
8115
+ doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
8116
+ }
8117
+ function onTransitionedOut(duration, callback) {
8118
+ onTransitionEnd(duration, function() {
8119
+ if (!instance.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) {
8120
+ callback();
8121
+ }
8122
+ });
8123
+ }
8124
+ function onTransitionedIn(duration, callback) {
8125
+ onTransitionEnd(duration, callback);
8126
+ }
8127
+ function onTransitionEnd(duration, callback) {
8128
+ var box = getDefaultTemplateChildren().box;
8129
+ function listener(event) {
8130
+ if (event.target === box) {
8131
+ updateTransitionEndListener(box, "remove", listener);
8132
+ callback();
8133
+ }
8134
+ }
8135
+ if (duration === 0) {
8136
+ return callback();
8137
+ }
8138
+ updateTransitionEndListener(box, "remove", currentTransitionEndListener);
8139
+ updateTransitionEndListener(box, "add", listener);
8140
+ currentTransitionEndListener = listener;
8141
+ }
8142
+ function on(eventType, handler, options) {
8143
+ if (options === void 0) {
8144
+ options = false;
8145
+ }
8146
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8147
+ nodes.forEach(function(node) {
8148
+ node.addEventListener(eventType, handler, options);
8149
+ listeners.push({
8150
+ node,
8151
+ eventType,
8152
+ handler,
8153
+ options
8154
+ });
8155
+ });
8156
+ }
8157
+ function addListeners() {
8158
+ if (getIsCustomTouchBehavior()) {
8159
+ on("touchstart", onTrigger2, {
8160
+ passive: true
8161
+ });
8162
+ on("touchend", onMouseLeave, {
8163
+ passive: true
8164
+ });
8165
+ }
8166
+ splitBySpaces(instance.props.trigger).forEach(function(eventType) {
8167
+ if (eventType === "manual") {
8168
+ return;
8169
+ }
8170
+ on(eventType, onTrigger2);
8171
+ switch (eventType) {
8172
+ case "mouseenter":
8173
+ on("mouseleave", onMouseLeave);
8174
+ break;
8175
+ case "focus":
8176
+ on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut);
8177
+ break;
8178
+ case "focusin":
8179
+ on("focusout", onBlurOrFocusOut);
8180
+ break;
8181
+ }
8182
+ });
8183
+ }
8184
+ function removeListeners() {
8185
+ listeners.forEach(function(_ref) {
8186
+ var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options;
8187
+ node.removeEventListener(eventType, handler, options);
8188
+ });
8189
+ listeners = [];
8838
8190
  }
8839
- function getDelay(isShow) {
8840
- if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
8841
- return 0;
8191
+ function onTrigger2(event) {
8192
+ var _lastTriggerEvent;
8193
+ var shouldScheduleClickHide = false;
8194
+ if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
8195
+ return;
8842
8196
  }
8843
- return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
8844
- }
8845
- function handleStyles(fromHide) {
8846
- if (fromHide === void 0) {
8847
- fromHide = false;
8197
+ var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
8198
+ lastTriggerEvent = event;
8199
+ currentTarget = event.currentTarget;
8200
+ handleAriaExpandedAttribute();
8201
+ if (!instance.state.isVisible && isMouseEvent(event)) {
8202
+ mouseMoveListeners.forEach(function(listener) {
8203
+ return listener(event);
8204
+ });
8205
+ }
8206
+ if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
8207
+ shouldScheduleClickHide = true;
8208
+ } else {
8209
+ scheduleShow(event);
8210
+ }
8211
+ if (event.type === "click") {
8212
+ isVisibleFromClick = !shouldScheduleClickHide;
8213
+ }
8214
+ if (shouldScheduleClickHide && !wasFocused) {
8215
+ scheduleHide(event);
8848
8216
  }
8849
- popper2.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none";
8850
- popper2.style.zIndex = "" + instance.props.zIndex;
8851
8217
  }
8852
- function invokeHook(hook, args, shouldInvokePropsHook) {
8853
- if (shouldInvokePropsHook === void 0) {
8854
- shouldInvokePropsHook = true;
8218
+ function onMouseMove(event) {
8219
+ var target = event.target;
8220
+ var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
8221
+ if (event.type === "mousemove" && isCursorOverReferenceOrPopper) {
8222
+ return;
8855
8223
  }
8856
- pluginsHooks.forEach(function(pluginHooks) {
8857
- if (pluginHooks[hook]) {
8858
- pluginHooks[hook].apply(pluginHooks, args);
8224
+ var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper22) {
8225
+ var _instance$popperInsta;
8226
+ var instance2 = popper22._tippy;
8227
+ var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state;
8228
+ if (state2) {
8229
+ return {
8230
+ popperRect: popper22.getBoundingClientRect(),
8231
+ popperState: state2,
8232
+ props
8233
+ };
8859
8234
  }
8860
- });
8861
- if (shouldInvokePropsHook) {
8862
- var _instance$props;
8863
- (_instance$props = instance.props)[hook].apply(_instance$props, args);
8235
+ return null;
8236
+ }).filter(Boolean);
8237
+ if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
8238
+ cleanupInteractiveMouseListeners();
8239
+ scheduleHide(event);
8864
8240
  }
8865
8241
  }
8866
- function handleAriaContentAttribute() {
8867
- var aria = instance.props.aria;
8868
- if (!aria.content) {
8242
+ function onMouseLeave(event) {
8243
+ var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
8244
+ if (shouldBail) {
8869
8245
  return;
8870
8246
  }
8871
- var attr = "aria-" + aria.content;
8872
- var id2 = popper2.id;
8873
- var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8874
- nodes.forEach(function(node) {
8875
- var currentValue = node.getAttribute(attr);
8876
- if (instance.state.isVisible) {
8877
- node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2);
8878
- } else {
8879
- var nextValue = currentValue && currentValue.replace(id2, "").trim();
8880
- if (nextValue) {
8881
- node.setAttribute(attr, nextValue);
8882
- } else {
8883
- node.removeAttribute(attr);
8884
- }
8885
- }
8886
- });
8247
+ if (instance.props.interactive) {
8248
+ instance.hideWithInteractivity(event);
8249
+ return;
8250
+ }
8251
+ scheduleHide(event);
8887
8252
  }
8888
- function handleAriaExpandedAttribute() {
8889
- if (hasAriaExpanded || !instance.props.aria.expanded) {
8253
+ function onBlurOrFocusOut(event) {
8254
+ if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) {
8890
8255
  return;
8891
8256
  }
8892
- var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8893
- nodes.forEach(function(node) {
8894
- if (instance.props.interactive) {
8895
- node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false");
8896
- } else {
8897
- node.removeAttribute("aria-expanded");
8898
- }
8899
- });
8257
+ if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
8258
+ return;
8259
+ }
8260
+ scheduleHide(event);
8900
8261
  }
8901
- function cleanupInteractiveMouseListeners() {
8902
- getDocument().removeEventListener("mousemove", debouncedOnMouseMove);
8903
- mouseMoveListeners = mouseMoveListeners.filter(function(listener) {
8904
- return listener !== debouncedOnMouseMove;
8905
- });
8262
+ function isEventListenerStopped(event) {
8263
+ return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false;
8906
8264
  }
8907
- function onDocumentPress(event) {
8908
- if (currentInput.isTouch) {
8909
- if (didTouchMove || event.type === "mousedown") {
8910
- return;
8265
+ function createPopperInstance() {
8266
+ destroyPopperInstance();
8267
+ var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition;
8268
+ var arrow2 = getIsDefaultRenderFn() ? getChildren(popper2).arrow : null;
8269
+ var computedReference = getReferenceClientRect ? {
8270
+ getBoundingClientRect: getReferenceClientRect,
8271
+ contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
8272
+ } : reference2;
8273
+ var tippyModifier = {
8274
+ name: "$$tippy",
8275
+ enabled: true,
8276
+ phase: "beforeWrite",
8277
+ requires: ["computeStyles"],
8278
+ fn: function fn5(_ref2) {
8279
+ var state2 = _ref2.state;
8280
+ if (getIsDefaultRenderFn()) {
8281
+ var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box;
8282
+ ["placement", "reference-hidden", "escaped"].forEach(function(attr) {
8283
+ if (attr === "placement") {
8284
+ box.setAttribute("data-placement", state2.placement);
8285
+ } else {
8286
+ if (state2.attributes.popper["data-popper-" + attr]) {
8287
+ box.setAttribute("data-" + attr, "");
8288
+ } else {
8289
+ box.removeAttribute("data-" + attr);
8290
+ }
8291
+ }
8292
+ });
8293
+ state2.attributes.popper = {};
8294
+ }
8295
+ }
8296
+ };
8297
+ var modifiers = [{
8298
+ name: "offset",
8299
+ options: {
8300
+ offset: offset2
8301
+ }
8302
+ }, {
8303
+ name: "preventOverflow",
8304
+ options: {
8305
+ padding: {
8306
+ top: 2,
8307
+ bottom: 2,
8308
+ left: 5,
8309
+ right: 5
8310
+ }
8311
+ }
8312
+ }, {
8313
+ name: "flip",
8314
+ options: {
8315
+ padding: 5
8316
+ }
8317
+ }, {
8318
+ name: "computeStyles",
8319
+ options: {
8320
+ adaptive: !moveTransition
8911
8321
  }
8322
+ }, tippyModifier];
8323
+ if (getIsDefaultRenderFn() && arrow2) {
8324
+ modifiers.push({
8325
+ name: "arrow",
8326
+ options: {
8327
+ element: arrow2,
8328
+ padding: 3
8329
+ }
8330
+ });
8331
+ }
8332
+ modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
8333
+ instance.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, {
8334
+ placement,
8335
+ onFirstUpdate,
8336
+ modifiers
8337
+ }));
8338
+ }
8339
+ function destroyPopperInstance() {
8340
+ if (instance.popperInstance) {
8341
+ instance.popperInstance.destroy();
8342
+ instance.popperInstance = null;
8343
+ }
8344
+ }
8345
+ function mount() {
8346
+ var appendTo = instance.props.appendTo;
8347
+ var parentNode;
8348
+ var node = getCurrentTarget();
8349
+ if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") {
8350
+ parentNode = node.parentNode;
8351
+ } else {
8352
+ parentNode = invokeWithArgsOrReturn(appendTo, [node]);
8353
+ }
8354
+ if (!parentNode.contains(popper2)) {
8355
+ parentNode.appendChild(popper2);
8356
+ }
8357
+ instance.state.isMounted = true;
8358
+ createPopperInstance();
8359
+ }
8360
+ function getNestedPopperTree() {
8361
+ return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
8362
+ }
8363
+ function scheduleShow(event) {
8364
+ instance.clearDelayTimeouts();
8365
+ if (event) {
8366
+ invokeHook("onTrigger", [instance, event]);
8367
+ }
8368
+ addDocumentPress();
8369
+ var delay = getDelay(true);
8370
+ var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1];
8371
+ if (currentInput.isTouch && touchValue === "hold" && touchDelay) {
8372
+ delay = touchDelay;
8373
+ }
8374
+ if (delay) {
8375
+ showTimeout = setTimeout(function() {
8376
+ instance.show();
8377
+ }, delay);
8378
+ } else {
8379
+ instance.show();
8380
+ }
8381
+ }
8382
+ function scheduleHide(event) {
8383
+ instance.clearDelayTimeouts();
8384
+ invokeHook("onUntrigger", [instance, event]);
8385
+ if (!instance.state.isVisible) {
8386
+ removeDocumentPress();
8387
+ return;
8912
8388
  }
8913
- var actualTarget = event.composedPath && event.composedPath()[0] || event.target;
8914
- if (instance.props.interactive && actualContains(popper2, actualTarget)) {
8389
+ if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) {
8915
8390
  return;
8916
8391
  }
8917
- if (normalizeToArray(instance.props.triggerTarget || reference2).some(function(el) {
8918
- return actualContains(el, actualTarget);
8919
- })) {
8920
- if (currentInput.isTouch) {
8921
- return;
8922
- }
8923
- if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) {
8924
- return;
8925
- }
8392
+ var delay = getDelay(false);
8393
+ if (delay) {
8394
+ hideTimeout = setTimeout(function() {
8395
+ if (instance.state.isVisible) {
8396
+ instance.hide();
8397
+ }
8398
+ }, delay);
8926
8399
  } else {
8927
- invokeHook("onClickOutside", [instance, event]);
8928
- }
8929
- if (instance.props.hideOnClick === true) {
8930
- instance.clearDelayTimeouts();
8931
- instance.hide();
8932
- didHideDueToDocumentMouseDown = true;
8933
- setTimeout(function() {
8934
- didHideDueToDocumentMouseDown = false;
8400
+ scheduleHideAnimationFrame = requestAnimationFrame(function() {
8401
+ instance.hide();
8935
8402
  });
8936
- if (!instance.state.isMounted) {
8937
- removeDocumentPress();
8938
- }
8939
8403
  }
8940
8404
  }
8941
- function onTouchMove() {
8942
- didTouchMove = true;
8943
- }
8944
- function onTouchStart() {
8945
- didTouchMove = false;
8946
- }
8947
- function addDocumentPress() {
8948
- var doc = getDocument();
8949
- doc.addEventListener("mousedown", onDocumentPress, true);
8950
- doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
8951
- doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
8952
- doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
8953
- }
8954
- function removeDocumentPress() {
8955
- var doc = getDocument();
8956
- doc.removeEventListener("mousedown", onDocumentPress, true);
8957
- doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
8958
- doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
8959
- doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
8405
+ function enable() {
8406
+ instance.state.isEnabled = true;
8960
8407
  }
8961
- function onTransitionedOut(duration, callback) {
8962
- onTransitionEnd(duration, function() {
8963
- if (!instance.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) {
8964
- callback();
8965
- }
8966
- });
8408
+ function disable() {
8409
+ instance.hide();
8410
+ instance.state.isEnabled = false;
8967
8411
  }
8968
- function onTransitionedIn(duration, callback) {
8969
- onTransitionEnd(duration, callback);
8412
+ function clearDelayTimeouts() {
8413
+ clearTimeout(showTimeout);
8414
+ clearTimeout(hideTimeout);
8415
+ cancelAnimationFrame(scheduleHideAnimationFrame);
8970
8416
  }
8971
- function onTransitionEnd(duration, callback) {
8972
- var box = getDefaultTemplateChildren().box;
8973
- function listener(event) {
8974
- if (event.target === box) {
8975
- updateTransitionEndListener(box, "remove", listener);
8976
- callback();
8977
- }
8417
+ function setProps(partialProps) {
8418
+ if (instance.state.isDestroyed) {
8419
+ return;
8978
8420
  }
8979
- if (duration === 0) {
8980
- return callback();
8421
+ invokeHook("onBeforeUpdate", [instance, partialProps]);
8422
+ removeListeners();
8423
+ var prevProps = instance.props;
8424
+ var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
8425
+ ignoreAttributes: true
8426
+ }));
8427
+ instance.props = nextProps;
8428
+ addListeners();
8429
+ if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
8430
+ cleanupInteractiveMouseListeners();
8431
+ debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
8981
8432
  }
8982
- updateTransitionEndListener(box, "remove", currentTransitionEndListener);
8983
- updateTransitionEndListener(box, "add", listener);
8984
- currentTransitionEndListener = listener;
8985
- }
8986
- function on(eventType, handler, options) {
8987
- if (options === void 0) {
8988
- options = false;
8433
+ if (prevProps.triggerTarget && !nextProps.triggerTarget) {
8434
+ normalizeToArray(prevProps.triggerTarget).forEach(function(node) {
8435
+ node.removeAttribute("aria-expanded");
8436
+ });
8437
+ } else if (nextProps.triggerTarget) {
8438
+ reference2.removeAttribute("aria-expanded");
8989
8439
  }
8990
- var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
8991
- nodes.forEach(function(node) {
8992
- node.addEventListener(eventType, handler, options);
8993
- listeners.push({
8994
- node,
8995
- eventType,
8996
- handler,
8997
- options
8440
+ handleAriaExpandedAttribute();
8441
+ handleStyles();
8442
+ if (onUpdate) {
8443
+ onUpdate(prevProps, nextProps);
8444
+ }
8445
+ if (instance.popperInstance) {
8446
+ createPopperInstance();
8447
+ getNestedPopperTree().forEach(function(nestedPopper) {
8448
+ requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
8998
8449
  });
8450
+ }
8451
+ invokeHook("onAfterUpdate", [instance, partialProps]);
8452
+ }
8453
+ function setContent2(content) {
8454
+ instance.setProps({
8455
+ content
8999
8456
  });
9000
8457
  }
9001
- function addListeners() {
9002
- if (getIsCustomTouchBehavior()) {
9003
- on("touchstart", onTrigger2, {
9004
- passive: true
9005
- });
9006
- on("touchend", onMouseLeave, {
9007
- passive: true
9008
- });
8458
+ function show() {
8459
+ var isAlreadyVisible = instance.state.isVisible;
8460
+ var isDestroyed = instance.state.isDestroyed;
8461
+ var isDisabled = !instance.state.isEnabled;
8462
+ var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
8463
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps$1.duration);
8464
+ if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
8465
+ return;
9009
8466
  }
9010
- splitBySpaces(instance.props.trigger).forEach(function(eventType) {
9011
- if (eventType === "manual") {
8467
+ if (getCurrentTarget().hasAttribute("disabled")) {
8468
+ return;
8469
+ }
8470
+ invokeHook("onShow", [instance], false);
8471
+ if (instance.props.onShow(instance) === false) {
8472
+ return;
8473
+ }
8474
+ instance.state.isVisible = true;
8475
+ if (getIsDefaultRenderFn()) {
8476
+ popper2.style.visibility = "visible";
8477
+ }
8478
+ handleStyles();
8479
+ addDocumentPress();
8480
+ if (!instance.state.isMounted) {
8481
+ popper2.style.transition = "none";
8482
+ }
8483
+ if (getIsDefaultRenderFn()) {
8484
+ var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content;
8485
+ setTransitionDuration([box, content], 0);
8486
+ }
8487
+ onFirstUpdate = function onFirstUpdate2() {
8488
+ var _instance$popperInsta2;
8489
+ if (!instance.state.isVisible || ignoreOnFirstUpdate) {
9012
8490
  return;
9013
8491
  }
9014
- on(eventType, onTrigger2);
9015
- switch (eventType) {
9016
- case "mouseenter":
9017
- on("mouseleave", onMouseLeave);
9018
- break;
9019
- case "focus":
9020
- on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut);
9021
- break;
9022
- case "focusin":
9023
- on("focusout", onBlurOrFocusOut);
9024
- break;
8492
+ ignoreOnFirstUpdate = true;
8493
+ void popper2.offsetHeight;
8494
+ popper2.style.transition = instance.props.moveTransition;
8495
+ if (getIsDefaultRenderFn() && instance.props.animation) {
8496
+ var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content;
8497
+ setTransitionDuration([_box, _content], duration);
8498
+ setVisibilityState([_box, _content], "visible");
9025
8499
  }
9026
- });
9027
- }
9028
- function removeListeners() {
9029
- listeners.forEach(function(_ref) {
9030
- var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options;
9031
- node.removeEventListener(eventType, handler, options);
9032
- });
9033
- listeners = [];
8500
+ handleAriaContentAttribute();
8501
+ handleAriaExpandedAttribute();
8502
+ pushIfUnique(mountedInstances, instance);
8503
+ (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
8504
+ invokeHook("onMount", [instance]);
8505
+ if (instance.props.animation && getIsDefaultRenderFn()) {
8506
+ onTransitionedIn(duration, function() {
8507
+ instance.state.isShown = true;
8508
+ invokeHook("onShown", [instance]);
8509
+ });
8510
+ }
8511
+ };
8512
+ mount();
9034
8513
  }
9035
- function onTrigger2(event) {
9036
- var _lastTriggerEvent;
9037
- var shouldScheduleClickHide = false;
9038
- if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
8514
+ function hide2() {
8515
+ var isAlreadyHidden = !instance.state.isVisible;
8516
+ var isDestroyed = instance.state.isDestroyed;
8517
+ var isDisabled = !instance.state.isEnabled;
8518
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps$1.duration);
8519
+ if (isAlreadyHidden || isDestroyed || isDisabled) {
9039
8520
  return;
9040
8521
  }
9041
- var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
9042
- lastTriggerEvent = event;
9043
- currentTarget = event.currentTarget;
9044
- handleAriaExpandedAttribute();
9045
- if (!instance.state.isVisible && isMouseEvent(event)) {
9046
- mouseMoveListeners.forEach(function(listener) {
9047
- return listener(event);
9048
- });
8522
+ invokeHook("onHide", [instance], false);
8523
+ if (instance.props.onHide(instance) === false) {
8524
+ return;
9049
8525
  }
9050
- if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
9051
- shouldScheduleClickHide = true;
9052
- } else {
9053
- scheduleShow(event);
8526
+ instance.state.isVisible = false;
8527
+ instance.state.isShown = false;
8528
+ ignoreOnFirstUpdate = false;
8529
+ isVisibleFromClick = false;
8530
+ if (getIsDefaultRenderFn()) {
8531
+ popper2.style.visibility = "hidden";
9054
8532
  }
9055
- if (event.type === "click") {
9056
- isVisibleFromClick = !shouldScheduleClickHide;
8533
+ cleanupInteractiveMouseListeners();
8534
+ removeDocumentPress();
8535
+ handleStyles(true);
8536
+ if (getIsDefaultRenderFn()) {
8537
+ var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
8538
+ if (instance.props.animation) {
8539
+ setTransitionDuration([box, content], duration);
8540
+ setVisibilityState([box, content], "hidden");
8541
+ }
9057
8542
  }
9058
- if (shouldScheduleClickHide && !wasFocused) {
9059
- scheduleHide(event);
8543
+ handleAriaContentAttribute();
8544
+ handleAriaExpandedAttribute();
8545
+ if (instance.props.animation) {
8546
+ if (getIsDefaultRenderFn()) {
8547
+ onTransitionedOut(duration, instance.unmount);
8548
+ }
8549
+ } else {
8550
+ instance.unmount();
9060
8551
  }
9061
8552
  }
9062
- function onMouseMove(event) {
9063
- var target = event.target;
9064
- var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
9065
- if (event.type === "mousemove" && isCursorOverReferenceOrPopper) {
8553
+ function hideWithInteractivity(event) {
8554
+ getDocument().addEventListener("mousemove", debouncedOnMouseMove);
8555
+ pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
8556
+ debouncedOnMouseMove(event);
8557
+ }
8558
+ function unmount() {
8559
+ if (instance.state.isVisible) {
8560
+ instance.hide();
8561
+ }
8562
+ if (!instance.state.isMounted) {
9066
8563
  return;
9067
8564
  }
9068
- var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper22) {
9069
- var _instance$popperInsta;
9070
- var instance2 = popper22._tippy;
9071
- var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state;
9072
- if (state2) {
9073
- return {
9074
- popperRect: popper22.getBoundingClientRect(),
9075
- popperState: state2,
9076
- props
9077
- };
9078
- }
9079
- return null;
9080
- }).filter(Boolean);
9081
- if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
9082
- cleanupInteractiveMouseListeners();
9083
- scheduleHide(event);
8565
+ destroyPopperInstance();
8566
+ getNestedPopperTree().forEach(function(nestedPopper) {
8567
+ nestedPopper._tippy.unmount();
8568
+ });
8569
+ if (popper2.parentNode) {
8570
+ popper2.parentNode.removeChild(popper2);
9084
8571
  }
8572
+ mountedInstances = mountedInstances.filter(function(i) {
8573
+ return i !== instance;
8574
+ });
8575
+ instance.state.isMounted = false;
8576
+ invokeHook("onHidden", [instance]);
9085
8577
  }
9086
- function onMouseLeave(event) {
9087
- var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
9088
- if (shouldBail) {
8578
+ function destroy() {
8579
+ if (instance.state.isDestroyed) {
9089
8580
  return;
9090
8581
  }
9091
- if (instance.props.interactive) {
9092
- instance.hideWithInteractivity(event);
9093
- return;
8582
+ instance.clearDelayTimeouts();
8583
+ instance.unmount();
8584
+ removeListeners();
8585
+ delete reference2._tippy;
8586
+ instance.state.isDestroyed = true;
8587
+ invokeHook("onDestroy", [instance]);
8588
+ }
8589
+ }
8590
+ function tippy(targets, optionalProps) {
8591
+ if (optionalProps === void 0) {
8592
+ optionalProps = {};
8593
+ }
8594
+ var plugins = defaultProps$1.plugins.concat(optionalProps.plugins || []);
8595
+ bindGlobalEventListeners();
8596
+ var passedProps = Object.assign({}, optionalProps, {
8597
+ plugins
8598
+ });
8599
+ var elements = getArrayOfElements(targets);
8600
+ var instances = elements.reduce(function(acc, reference2) {
8601
+ var instance = reference2 && createTippy(reference2, passedProps);
8602
+ if (instance) {
8603
+ acc.push(instance);
8604
+ }
8605
+ return acc;
8606
+ }, []);
8607
+ return isElement(targets) ? instances[0] : instances;
8608
+ }
8609
+ tippy.defaultProps = defaultProps$1;
8610
+ tippy.setDefaultProps = setDefaultProps;
8611
+ tippy.currentInput = currentInput;
8612
+ Object.assign({}, applyStyles$1, {
8613
+ effect: function effect2(_ref) {
8614
+ var state = _ref.state;
8615
+ var initialStyles = {
8616
+ popper: {
8617
+ position: state.options.strategy,
8618
+ left: "0",
8619
+ top: "0",
8620
+ margin: "0"
8621
+ },
8622
+ arrow: {
8623
+ position: "absolute"
8624
+ },
8625
+ reference: {}
8626
+ };
8627
+ Object.assign(state.elements.popper.style, initialStyles.popper);
8628
+ state.styles = initialStyles;
8629
+ if (state.elements.arrow) {
8630
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
9094
8631
  }
9095
- scheduleHide(event);
9096
8632
  }
9097
- function onBlurOrFocusOut(event) {
9098
- if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) {
9099
- return;
8633
+ });
8634
+ tippy.setDefaultProps({
8635
+ render
8636
+ });
8637
+ const dbTheme = "db-tippy";
8638
+ const dbDefaultProps = { theme: dbTheme };
8639
+ function dbTippy(targets, optionalProps) {
8640
+ const props = optionalProps ? { ...optionalProps } : optionalProps;
8641
+ if (props) {
8642
+ const { theme } = props;
8643
+ props.theme = theme ? `${dbTheme} ${props.theme}` : dbTheme;
8644
+ }
8645
+ if (targets instanceof Element) {
8646
+ const target = targets;
8647
+ return tippy(target, props || dbDefaultProps);
8648
+ }
8649
+ return tippy(targets, props || dbDefaultProps);
8650
+ }
8651
+ const placements = [
8652
+ "top",
8653
+ "bottom",
8654
+ "right",
8655
+ "left",
8656
+ "auto",
8657
+ "auto-start",
8658
+ "auto-end",
8659
+ "top-start",
8660
+ "top-end",
8661
+ "bottom-start",
8662
+ "bottom-end",
8663
+ "right-start",
8664
+ "right-end",
8665
+ "left-start",
8666
+ "left-end"
8667
+ ];
8668
+ function checkOverflow(el) {
8669
+ if (!el) return false;
8670
+ const createDom = (el2, css) => {
8671
+ const dom = document.createElement("div");
8672
+ const width = parseFloat(css.width) ? `${Math.ceil(parseFloat(css.width))}px` : css.width;
8673
+ dom.style.cssText = `
8674
+ width: ${width};
8675
+ line-height: ${css.lineHeight};
8676
+ font-size: ${css.fontSize};
8677
+ word-break: ${css.wordBreak};
8678
+ padding: ${css.padding};
8679
+ `;
8680
+ dom.textContent = el2.textContent;
8681
+ return dom;
8682
+ };
8683
+ let isOverflow = false;
8684
+ try {
8685
+ const css = window.getComputedStyle(el, null);
8686
+ const lineClamp = css.webkitLineClamp;
8687
+ if (lineClamp !== "none") {
8688
+ const targetHeight = parseFloat(css.height);
8689
+ const dom = createDom(el, css);
8690
+ document.body.appendChild(dom);
8691
+ const domHeight = window.getComputedStyle(dom, null).height;
8692
+ document.body.removeChild(dom);
8693
+ isOverflow = targetHeight < parseFloat(domHeight);
8694
+ } else {
8695
+ isOverflow = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
9100
8696
  }
9101
- if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
9102
- return;
8697
+ } catch (e) {
8698
+ console.warn("There is an error when check element overflow state: ", e);
8699
+ }
8700
+ return isOverflow;
8701
+ }
8702
+ function beforeShow(instance) {
8703
+ const { reference: reference2 } = instance;
8704
+ const { props } = reference2._bk_overflow_tips_;
8705
+ const isOverflow = checkOverflow(reference2);
8706
+ if (isOverflow) {
8707
+ let { content } = props;
8708
+ if (!content) {
8709
+ content = props.allowHTML ? reference2.innerHTML : reference2.textContent;
8710
+ }
8711
+ instance.setContent(content);
8712
+ return true;
8713
+ }
8714
+ return false;
8715
+ }
8716
+ function setupOnShow(props, customProps) {
8717
+ props.onShow = (instance) => {
8718
+ if (typeof customProps.onShow === "function") {
8719
+ const result = customProps.onShow(instance);
8720
+ if (!result) return false;
8721
+ }
8722
+ const isShow = beforeShow(instance);
8723
+ if (!isShow) return false;
8724
+ };
8725
+ }
8726
+ function setupTheme(props, customProps) {
8727
+ const theme = ["db-tippy bk-overflow-tips"];
8728
+ if (customProps.theme) {
8729
+ theme.push(customProps.theme);
8730
+ }
8731
+ props.theme = theme.join(" ");
8732
+ }
8733
+ function formatModifiers(modifiers) {
8734
+ const keys = Object.entries(modifiers).map((item) => item[0]);
8735
+ if (keys.length === 0) return {};
8736
+ const props = {};
8737
+ for (const key of keys) {
8738
+ if (placements.includes(key)) {
8739
+ props.placement = key;
9103
8740
  }
9104
- scheduleHide(event);
9105
8741
  }
9106
- function isEventListenerStopped(event) {
9107
- return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false;
8742
+ return props;
8743
+ }
8744
+ const defaultProps = {
8745
+ arrow: true,
8746
+ interactive: true,
8747
+ delay: 150,
8748
+ allowHTML: false,
8749
+ maxWidth: 600,
8750
+ // boundary: 'window',
8751
+ placement: "top",
8752
+ appendTo: () => document.body
8753
+ };
8754
+ const overflowTips = {
8755
+ mounted(el, binding) {
8756
+ const customProps = typeof binding.value === "object" ? binding.value : formatModifiers(binding.modifiers);
8757
+ const props = Object.assign({ ...defaultProps }, customProps);
8758
+ setupOnShow(props, customProps);
8759
+ setupTheme(props, customProps);
8760
+ el._bk_overflow_tips_ = {
8761
+ props,
8762
+ // 指令配置的props单独存储方便后续做判断
8763
+ instance: dbTippy(el, props)
8764
+ };
8765
+ },
8766
+ updated(el, binding) {
8767
+ const { props, instance } = el._bk_overflow_tips_;
8768
+ const customProps = typeof binding.value === "object" ? binding.value : formatModifiers(binding.modifiers);
8769
+ Object.assign(props, customProps);
8770
+ setupOnShow(props, customProps);
8771
+ setupTheme(props, customProps);
8772
+ instance.setProps(props);
8773
+ },
8774
+ beforeUnmount(el) {
8775
+ el._tippy && el._tippy.destroy();
8776
+ delete el._bk_overflow_tips_;
9108
8777
  }
9109
- function createPopperInstance() {
9110
- destroyPopperInstance();
9111
- var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition;
9112
- var arrow2 = getIsDefaultRenderFn() ? getChildren(popper2).arrow : null;
9113
- var computedReference = getReferenceClientRect ? {
9114
- getBoundingClientRect: getReferenceClientRect,
9115
- contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
9116
- } : reference2;
9117
- var tippyModifier = {
9118
- name: "$$tippy",
9119
- enabled: true,
9120
- phase: "beforeWrite",
9121
- requires: ["computeStyles"],
9122
- fn: function fn5(_ref2) {
9123
- var state2 = _ref2.state;
9124
- if (getIsDefaultRenderFn()) {
9125
- var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box;
9126
- ["placement", "reference-hidden", "escaped"].forEach(function(attr) {
9127
- if (attr === "placement") {
9128
- box.setAttribute("data-placement", state2.placement);
8778
+ };
8779
+ const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
8780
+ const encodeMult = (text) => {
8781
+ const temp = document.createElement("textarea");
8782
+ temp.value = text;
8783
+ return temp.value;
8784
+ };
8785
+ function tryOnScopeDispose(fn) {
8786
+ if (vue.getCurrentScope()) {
8787
+ vue.onScopeDispose(fn);
8788
+ return true;
8789
+ }
8790
+ return false;
8791
+ }
8792
+ function toValue(r) {
8793
+ return typeof r === "function" ? r() : vue.unref(r);
8794
+ }
8795
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
8796
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
8797
+ function unrefElement(elRef) {
8798
+ var _a;
8799
+ const plain = toValue(elRef);
8800
+ return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
8801
+ }
8802
+ const defaultWindow = isClient ? window : void 0;
8803
+ function useMounted() {
8804
+ const isMounted = vue.ref(false);
8805
+ const instance = vue.getCurrentInstance();
8806
+ if (instance) {
8807
+ vue.onMounted(() => {
8808
+ isMounted.value = true;
8809
+ }, instance);
8810
+ }
8811
+ return isMounted;
8812
+ }
8813
+ function useSupported(callback) {
8814
+ const isMounted = useMounted();
8815
+ return vue.computed(() => {
8816
+ isMounted.value;
8817
+ return Boolean(callback());
8818
+ });
8819
+ }
8820
+ function useResizeObserver(target, callback, options = {}) {
8821
+ const { window: window2 = defaultWindow, ...observerOptions } = options;
8822
+ let observer;
8823
+ const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
8824
+ const cleanup = () => {
8825
+ if (observer) {
8826
+ observer.disconnect();
8827
+ observer = void 0;
8828
+ }
8829
+ };
8830
+ const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
8831
+ const stopWatch = vue.watch(
8832
+ targets,
8833
+ (els) => {
8834
+ cleanup();
8835
+ if (isSupported.value && window2) {
8836
+ observer = new ResizeObserver(callback);
8837
+ for (const _el of els)
8838
+ _el && observer.observe(_el, observerOptions);
8839
+ }
8840
+ },
8841
+ { immediate: true, flush: "post" }
8842
+ );
8843
+ const stop = () => {
8844
+ cleanup();
8845
+ stopWatch();
8846
+ };
8847
+ tryOnScopeDispose(stop);
8848
+ return {
8849
+ isSupported,
8850
+ stop
8851
+ };
8852
+ }
8853
+ const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
8854
+ const _hoisted_2$2 = { class: "th-cell" };
8855
+ const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
8856
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
8857
+ __name: "head-column",
8858
+ props: {
8859
+ fixed: { default: void 0 },
8860
+ maxWidth: { default: void 0 },
8861
+ minWidth: { default: void 0 },
8862
+ required: { type: Boolean, default: true },
8863
+ width: { default: void 0 },
8864
+ renderAppend: { type: Function, default: void 0 },
8865
+ memo: { default: void 0 }
8866
+ },
8867
+ setup(__props) {
8868
+ const props = __props;
8869
+ const slots = vue.useSlots();
8870
+ const { rowWidth, isOverflow: isMinimize, isScrollToLeft, isScrollToRight } = vue.inject(renderTablekey);
8871
+ const parentTable = vue.inject(tableColumnResizekey);
8872
+ const columnRef = vue.ref();
8873
+ const currentWidth = vue.ref(0);
8874
+ const vBkTooltips = bkuiVue.bkTooltips;
8875
+ const vOverflowTips = overflowTips;
8876
+ const columnKey = random();
8877
+ let initWidthRate = 0;
8878
+ let isDragedSelf = false;
8879
+ const finalMinWidth = vue.computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
8880
+ const isFixedRight = vue.computed(() => props.fixed === "right");
8881
+ const isFixedLeft = vue.computed(() => props.fixed === "left");
8882
+ const styles = vue.computed(() => {
8883
+ if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
8884
+ const newWidth = rowWidth.value * initWidthRate;
8885
+ if (newWidth !== props.width) {
8886
+ let width = 0;
8887
+ if (isMinimize == null ? void 0 : isMinimize.value) {
8888
+ if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
8889
+ width = currentWidth.value;
9129
8890
  } else {
9130
- if (state2.attributes.popper["data-popper-" + attr]) {
9131
- box.setAttribute("data-" + attr, "");
9132
- } else {
9133
- box.removeAttribute("data-" + attr);
9134
- }
8891
+ width = finalMinWidth.value;
9135
8892
  }
9136
- });
9137
- state2.attributes.popper = {};
8893
+ } else if (newWidth > finalMinWidth.value) {
8894
+ width = newWidth;
8895
+ } else {
8896
+ width = finalMinWidth.value;
8897
+ }
8898
+ return {
8899
+ minWidth: `${width}px`
8900
+ };
9138
8901
  }
9139
8902
  }
9140
- };
9141
- var modifiers = [{
9142
- name: "offset",
9143
- options: {
9144
- offset: offset2
9145
- }
9146
- }, {
9147
- name: "preventOverflow",
9148
- options: {
9149
- padding: {
9150
- top: 2,
9151
- bottom: 2,
9152
- left: 5,
9153
- right: 5
8903
+ return {
8904
+ minWidth: props.width ? `${props.width}px` : "120px"
8905
+ };
8906
+ });
8907
+ const RenderAppendElement = vue.computed(() => props.renderAppend && props.renderAppend());
8908
+ vue.watch(
8909
+ () => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
8910
+ ([width, rowWidth2, currentWidth2]) => {
8911
+ if (!isDragedSelf) {
8912
+ return;
9154
8913
  }
8914
+ if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
8915
+ isDragedSelf = false;
8916
+ if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
8917
+ initWidthRate = currentWidth2 / rowWidth2;
8918
+ } else {
8919
+ initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
8920
+ }
8921
+ }
8922
+ },
8923
+ {
8924
+ immediate: true
9155
8925
  }
9156
- }, {
9157
- name: "flip",
9158
- options: {
9159
- padding: 5
9160
- }
9161
- }, {
9162
- name: "computeStyles",
9163
- options: {
9164
- adaptive: !moveTransition
8926
+ );
8927
+ useResizeObserver(columnRef, () => {
8928
+ if (!isDragedSelf) {
8929
+ return;
9165
8930
  }
9166
- }, tippyModifier];
9167
- if (getIsDefaultRenderFn() && arrow2) {
9168
- modifiers.push({
9169
- name: "arrow",
9170
- options: {
9171
- element: arrow2,
9172
- padding: 3
9173
- }
9174
- });
9175
- }
9176
- modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
9177
- instance.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, {
9178
- placement,
9179
- onFirstUpdate,
9180
- modifiers
9181
- }));
9182
- }
9183
- function destroyPopperInstance() {
9184
- if (instance.popperInstance) {
9185
- instance.popperInstance.destroy();
9186
- instance.popperInstance = null;
9187
- }
9188
- }
9189
- function mount() {
9190
- var appendTo = instance.props.appendTo;
9191
- var parentNode;
9192
- var node = getCurrentTarget();
9193
- if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") {
9194
- parentNode = node.parentNode;
9195
- } else {
9196
- parentNode = invokeWithArgsOrReturn(appendTo, [node]);
9197
- }
9198
- if (!parentNode.contains(popper2)) {
9199
- parentNode.appendChild(popper2);
9200
- }
9201
- instance.state.isMounted = true;
9202
- createPopperInstance();
9203
- }
9204
- function getNestedPopperTree() {
9205
- return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
9206
- }
9207
- function scheduleShow(event) {
9208
- instance.clearDelayTimeouts();
9209
- if (event) {
9210
- invokeHook("onTrigger", [instance, event]);
9211
- }
9212
- addDocumentPress();
9213
- var delay = getDelay(true);
9214
- var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1];
9215
- if (currentInput.isTouch && touchValue === "hold" && touchDelay) {
9216
- delay = touchDelay;
9217
- }
9218
- if (delay) {
9219
- showTimeout = setTimeout(function() {
9220
- instance.show();
9221
- }, delay);
9222
- } else {
9223
- instance.show();
9224
- }
9225
- }
9226
- function scheduleHide(event) {
9227
- instance.clearDelayTimeouts();
9228
- invokeHook("onUntrigger", [instance, event]);
9229
- if (!instance.state.isVisible) {
9230
- removeDocumentPress();
9231
- return;
9232
- }
9233
- if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) {
9234
- return;
9235
- }
9236
- var delay = getDelay(false);
9237
- if (delay) {
9238
- hideTimeout = setTimeout(function() {
9239
- if (instance.state.isVisible) {
9240
- instance.hide();
9241
- }
9242
- }, delay);
9243
- } else {
9244
- scheduleHideAnimationFrame = requestAnimationFrame(function() {
9245
- instance.hide();
8931
+ const width = parseFloat(columnRef.value.style.width);
8932
+ currentWidth.value = width;
8933
+ });
8934
+ const handleMouseDown = (event) => {
8935
+ isDragedSelf = true;
8936
+ parentTable == null ? void 0 : parentTable.columnMousedown(event, {
8937
+ columnKey,
8938
+ minWidth: finalMinWidth.value
9246
8939
  });
9247
- }
9248
- }
9249
- function enable() {
9250
- instance.state.isEnabled = true;
8940
+ };
8941
+ const handleMouseMove = (event) => {
8942
+ parentTable == null ? void 0 : parentTable.columnMouseMove(event);
8943
+ };
8944
+ return (_ctx, _cache) => {
8945
+ return vue.openBlock(), vue.createElementBlock("th", {
8946
+ ref_key: "columnRef",
8947
+ ref: columnRef,
8948
+ class: vue.normalizeClass(["bk-ediatable-head-column", {
8949
+ [`column-${vue.unref(columnKey)}`]: true,
8950
+ "is-right-fixed": vue.unref(isMinimize) && isFixedRight.value && !vue.unref(isScrollToRight),
8951
+ "is-left-fixed": vue.unref(isMinimize) && isFixedLeft.value && !vue.unref(isScrollToLeft)
8952
+ }]),
8953
+ "data-fixed": _ctx.fixed,
8954
+ "data-maxWidth": _ctx.maxWidth,
8955
+ "data-minWidth": finalMinWidth.value,
8956
+ "data-width": _ctx.width,
8957
+ style: vue.normalizeStyle(styles.value),
8958
+ onMousedown: handleMouseDown,
8959
+ onMousemove: handleMouseMove
8960
+ }, [
8961
+ vue.createElementVNode(
8962
+ "div",
8963
+ {
8964
+ class: vue.normalizeClass({ "is-required": _ctx.required })
8965
+ },
8966
+ [
8967
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
8968
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock(
8969
+ "span",
8970
+ {
8971
+ class: vue.normalizeClass({ "title-memo": _ctx.memo })
8972
+ },
8973
+ [
8974
+ vue.renderSlot(_ctx.$slots, "default")
8975
+ ],
8976
+ 2
8977
+ /* CLASS */
8978
+ )), [
8979
+ [vue.unref(vBkTooltips), {
8980
+ content: _ctx.memo,
8981
+ disabled: !_ctx.memo
8982
+ }]
8983
+ ])
8984
+ ])), [
8985
+ [vue.unref(vOverflowTips)]
8986
+ ]),
8987
+ vue.createElementVNode("div", _hoisted_3$1, [
8988
+ slots.append && !_ctx.renderAppend ? vue.renderSlot(_ctx.$slots, "append", { key: 0 }) : vue.createCommentVNode("v-if", true),
8989
+ _ctx.renderAppend ? (vue.openBlock(), vue.createBlock(vue.unref(RenderAppendElement), { key: 1 })) : vue.createCommentVNode("v-if", true)
8990
+ ])
8991
+ ],
8992
+ 2
8993
+ /* CLASS */
8994
+ )
8995
+ ], 46, _hoisted_1$6);
8996
+ };
9251
8997
  }
9252
- function disable() {
9253
- instance.hide();
9254
- instance.state.isEnabled = false;
8998
+ });
8999
+ const renderTablekey = Symbol("renderTable");
9000
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
9001
+ __name: "ediatable",
9002
+ props: {
9003
+ theadList: { default: () => [] }
9004
+ },
9005
+ setup(__props) {
9006
+ const slots = vue.useSlots();
9007
+ const checkTableScroll = () => {
9008
+ rowWidth.value = tableRef.value.clientWidth;
9009
+ isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
9010
+ initColumnWidth();
9011
+ };
9012
+ const tableOuterRef = vue.ref();
9013
+ const tableRef = vue.ref();
9014
+ const tableColumnResizeRef = vue.ref();
9015
+ const isOverflow = vue.ref(false);
9016
+ const rowWidth = vue.ref(0);
9017
+ const isScrollToLeft = vue.ref(true);
9018
+ const isScrollToRight = vue.ref(false);
9019
+ const { initColumnWidth } = useColumnResize(tableOuterRef, tableColumnResizeRef, _.debounce(checkTableScroll));
9020
+ vue.provide(renderTablekey, {
9021
+ isOverflow,
9022
+ rowWidth,
9023
+ isScrollToLeft,
9024
+ isScrollToRight
9025
+ });
9026
+ const handleScroll = _.throttle(() => {
9027
+ isScrollToLeft.value = tableOuterRef.value.scrollLeft === 0;
9028
+ isScrollToRight.value = tableOuterRef.value.scrollWidth - tableOuterRef.value.scrollLeft < tableOuterRef.value.clientWidth + 1;
9029
+ }, 200);
9030
+ vue.onMounted(() => {
9031
+ window.addEventListener("resize", checkTableScroll);
9032
+ checkTableScroll();
9033
+ setTimeout(() => checkTableScroll());
9034
+ tableOuterRef.value.addEventListener("scroll", handleScroll);
9035
+ });
9036
+ vue.onBeforeUnmount(() => {
9037
+ window.removeEventListener("resize", checkTableScroll);
9038
+ tableOuterRef.value.removeEventListener("scroll", handleScroll);
9039
+ });
9040
+ return (_ctx, _cache) => {
9041
+ return vue.openBlock(), vue.createElementBlock(
9042
+ "div",
9043
+ {
9044
+ id: "ediatableRenderTableKey",
9045
+ ref_key: "tableOuterRef",
9046
+ ref: tableOuterRef,
9047
+ class: vue.normalizeClass(["bk-ediatable", { "scrollbar-exists": isOverflow.value }])
9048
+ },
9049
+ [
9050
+ vue.createElementVNode(
9051
+ "table",
9052
+ {
9053
+ ref_key: "tableRef",
9054
+ ref: tableRef
9055
+ },
9056
+ [
9057
+ vue.createElementVNode("thead", null, [
9058
+ vue.createElementVNode("tr", null, [
9059
+ slots.default && _ctx.theadList.length === 0 ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : (vue.openBlock(true), vue.createElementBlock(
9060
+ vue.Fragment,
9061
+ { key: 1 },
9062
+ vue.renderList(_ctx.theadList, (head, index) => {
9063
+ return vue.openBlock(), vue.createBlock(_sfc_main$8, {
9064
+ key: index,
9065
+ width: head.width,
9066
+ "min-width": head.minWidth,
9067
+ "max-width": head.maxWidth,
9068
+ fixed: head.fixed,
9069
+ required: head.required,
9070
+ "render-append": head.renderAppend,
9071
+ memo: head.memo
9072
+ }, {
9073
+ default: vue.withCtx(() => [
9074
+ vue.createTextVNode(
9075
+ vue.toDisplayString(head.title),
9076
+ 1
9077
+ /* TEXT */
9078
+ )
9079
+ ]),
9080
+ _: 2
9081
+ /* DYNAMIC */
9082
+ }, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append", "memo"]);
9083
+ }),
9084
+ 128
9085
+ /* KEYED_FRAGMENT */
9086
+ ))
9087
+ ])
9088
+ ]),
9089
+ vue.renderSlot(_ctx.$slots, "data")
9090
+ ],
9091
+ 512
9092
+ /* NEED_PATCH */
9093
+ ),
9094
+ vue.createElementVNode(
9095
+ "div",
9096
+ {
9097
+ ref_key: "tableColumnResizeRef",
9098
+ ref: tableColumnResizeRef,
9099
+ class: "table-column-resize"
9100
+ },
9101
+ null,
9102
+ 512
9103
+ /* NEED_PATCH */
9104
+ )
9105
+ ],
9106
+ 2
9107
+ /* CLASS */
9108
+ );
9109
+ };
9255
9110
  }
9256
- function clearDelayTimeouts() {
9257
- clearTimeout(showTimeout);
9258
- clearTimeout(hideTimeout);
9259
- cancelAnimationFrame(scheduleHideAnimationFrame);
9111
+ });
9112
+ const getRuleMessage = (rule) => {
9113
+ if (typeof rule.message === "function") {
9114
+ return rule.message();
9260
9115
  }
9261
- function setProps(partialProps) {
9262
- if (instance.state.isDestroyed) {
9263
- return;
9264
- }
9265
- invokeHook("onBeforeUpdate", [instance, partialProps]);
9266
- removeListeners();
9267
- var prevProps = instance.props;
9268
- var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
9269
- ignoreAttributes: true
9270
- }));
9271
- instance.props = nextProps;
9272
- addListeners();
9273
- if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
9274
- cleanupInteractiveMouseListeners();
9275
- debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
9276
- }
9277
- if (prevProps.triggerTarget && !nextProps.triggerTarget) {
9278
- normalizeToArray(prevProps.triggerTarget).forEach(function(node) {
9279
- node.removeAttribute("aria-expanded");
9280
- });
9281
- } else if (nextProps.triggerTarget) {
9282
- reference2.removeAttribute("aria-expanded");
9116
+ return rule.message;
9117
+ };
9118
+ function useValidtor(rules) {
9119
+ const state = vue.reactive({
9120
+ loading: false,
9121
+ error: false,
9122
+ message: ""
9123
+ });
9124
+ const validator = (targetValue) => {
9125
+ state.error = false, state.message = "";
9126
+ if (!rules) {
9127
+ return Promise.resolve(true);
9283
9128
  }
9284
- handleAriaExpandedAttribute();
9285
- handleStyles();
9286
- if (onUpdate) {
9287
- onUpdate(prevProps, nextProps);
9129
+ const run = /* @__PURE__ */ (() => {
9130
+ let stepIndex = -1;
9131
+ return async () => {
9132
+ stepIndex = stepIndex + 1;
9133
+ if (stepIndex >= rules.length) {
9134
+ return Promise.resolve(true);
9135
+ }
9136
+ const rule = rules[stepIndex];
9137
+ return Promise.resolve().then(() => {
9138
+ const result = rule.validator(targetValue);
9139
+ if (typeof result !== "boolean" && typeof result.then === "function") {
9140
+ return result.then((data) => {
9141
+ if (data === false) {
9142
+ return Promise.reject(getRuleMessage(rule));
9143
+ }
9144
+ }).then(() => run(), () => {
9145
+ state.error = true;
9146
+ const message = getRuleMessage(rule);
9147
+ state.message = message;
9148
+ return Promise.reject(message);
9149
+ });
9150
+ }
9151
+ if (!result) {
9152
+ state.error = true;
9153
+ const message = getRuleMessage(rule);
9154
+ state.message = message;
9155
+ return Promise.reject(message);
9156
+ }
9157
+ return run();
9158
+ });
9159
+ };
9160
+ })();
9161
+ return run();
9162
+ };
9163
+ return {
9164
+ ...vue.toRefs(state),
9165
+ validator
9166
+ };
9167
+ }
9168
+ const DbIcon = vue.defineComponent({
9169
+ name: "DbIcon",
9170
+ props: {
9171
+ type: {
9172
+ type: String,
9173
+ required: true
9174
+ },
9175
+ svg: {
9176
+ type: Boolean,
9177
+ default: false
9288
9178
  }
9289
- if (instance.popperInstance) {
9290
- createPopperInstance();
9291
- getNestedPopperTree().forEach(function(nestedPopper) {
9292
- requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
9293
- });
9179
+ },
9180
+ render() {
9181
+ if (this.svg) {
9182
+ return vue.h(
9183
+ "svg",
9184
+ {
9185
+ class: {
9186
+ "db-svg-icon": true
9187
+ }
9188
+ },
9189
+ [
9190
+ vue.h("use", {
9191
+ "xlink:href": `#db-icon-${this.type}`
9192
+ })
9193
+ ]
9194
+ );
9294
9195
  }
9295
- invokeHook("onAfterUpdate", [instance, partialProps]);
9296
- }
9297
- function setContent2(content) {
9298
- instance.setProps({
9299
- content
9196
+ const classes = {
9197
+ "ediatable-icon": true,
9198
+ [`icon-${this.type}`]: true
9199
+ };
9200
+ return vue.h("i", {
9201
+ class: classes
9300
9202
  });
9301
9203
  }
9302
- function show() {
9303
- var isAlreadyVisible = instance.state.isVisible;
9304
- var isDestroyed = instance.state.isDestroyed;
9305
- var isDisabled = !instance.state.isEnabled;
9306
- var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
9307
- var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
9308
- if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
9309
- return;
9310
- }
9311
- if (getCurrentTarget().hasAttribute("disabled")) {
9312
- return;
9313
- }
9314
- invokeHook("onShow", [instance], false);
9315
- if (instance.props.onShow(instance) === false) {
9316
- return;
9317
- }
9318
- instance.state.isVisible = true;
9319
- if (getIsDefaultRenderFn()) {
9320
- popper2.style.visibility = "visible";
9321
- }
9322
- handleStyles();
9323
- addDocumentPress();
9324
- if (!instance.state.isMounted) {
9325
- popper2.style.transition = "none";
9326
- }
9327
- if (getIsDefaultRenderFn()) {
9328
- var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content;
9329
- setTransitionDuration([box, content], 0);
9330
- }
9331
- onFirstUpdate = function onFirstUpdate2() {
9332
- var _instance$popperInsta2;
9333
- if (!instance.state.isVisible || ignoreOnFirstUpdate) {
9204
+ });
9205
+ const _hoisted_1$5 = {
9206
+ key: 0,
9207
+ class: "input-error"
9208
+ };
9209
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
9210
+ __name: "date-time-picker-column",
9211
+ props: /* @__PURE__ */ vue.mergeModels({
9212
+ placeholder: { default: "" },
9213
+ rules: { default: void 0 },
9214
+ type: { default: void 0 },
9215
+ disabled: { type: Boolean, default: false }
9216
+ }, {
9217
+ "modelValue": {},
9218
+ "modelModifiers": {}
9219
+ }),
9220
+ emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
9221
+ setup(__props, { expose: __expose, emit: __emit }) {
9222
+ const props = __props;
9223
+ const emits = __emit;
9224
+ const modelValue = vue.useModel(__props, "modelValue");
9225
+ const attrs = vue.useAttrs();
9226
+ const slots = vue.useSlots();
9227
+ const { message: errorMessage, validator } = useValidtor(props.rules);
9228
+ const vBkTooltips = bkuiVue.bkTooltips;
9229
+ const handleChange = (value) => {
9230
+ modelValue.value = value;
9231
+ validator(modelValue.value).then(() => {
9232
+ emits("change", modelValue.value);
9233
+ });
9234
+ };
9235
+ const handleOpenChange = (open) => {
9236
+ if (!open) {
9237
+ validator(modelValue.value);
9238
+ }
9239
+ };
9240
+ __expose({
9241
+ getValue() {
9242
+ return validator(modelValue.value).then(() => modelValue.value);
9243
+ }
9244
+ });
9245
+ return (_ctx, _cache) => {
9246
+ return vue.openBlock(), vue.createElementBlock(
9247
+ "div",
9248
+ {
9249
+ class: vue.normalizeClass(["bk-ediatable-time-picker", {
9250
+ "is-error": Boolean(vue.unref(errorMessage)),
9251
+ "is-disabled": _ctx.disabled
9252
+ }])
9253
+ },
9254
+ [
9255
+ vue.createVNode(vue.unref(bkuiVue.DatePicker), vue.mergeProps({
9256
+ "append-to-body": "",
9257
+ clearable: false,
9258
+ "model-value": modelValue.value,
9259
+ placeholder: _ctx.placeholder,
9260
+ style: { "width": "100%" },
9261
+ type: _ctx.type
9262
+ }, vue.unref(attrs), {
9263
+ onChange: handleChange,
9264
+ onOpenChange: handleOpenChange
9265
+ }), vue.createSlots({
9266
+ _: 2
9267
+ /* DYNAMIC */
9268
+ }, [
9269
+ vue.unref(slots).footer ? {
9270
+ name: "footer",
9271
+ fn: vue.withCtx(() => [
9272
+ vue.renderSlot(_ctx.$slots, "footer")
9273
+ ]),
9274
+ key: "0"
9275
+ } : void 0
9276
+ ]), 1040, ["model-value", "placeholder", "type"]),
9277
+ vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
9278
+ vue.withDirectives(vue.createVNode(
9279
+ vue.unref(DbIcon),
9280
+ { type: "exclamation-fill" },
9281
+ null,
9282
+ 512
9283
+ /* NEED_PATCH */
9284
+ ), [
9285
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
9286
+ ])
9287
+ ])) : vue.createCommentVNode("v-if", true)
9288
+ ],
9289
+ 2
9290
+ /* CLASS */
9291
+ );
9292
+ };
9293
+ }
9294
+ });
9295
+ const _hoisted_1$4 = {
9296
+ key: 1,
9297
+ class: "blur-dispaly-main"
9298
+ };
9299
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
9300
+ __name: "input-column",
9301
+ props: /* @__PURE__ */ vue.mergeModels({
9302
+ placeholder: { default: "请输入" },
9303
+ rules: { default: void 0 },
9304
+ disabled: { type: Boolean, default: false },
9305
+ type: { default: "text" },
9306
+ min: { default: Number.MIN_SAFE_INTEGER },
9307
+ max: { default: Number.MAX_SAFE_INTEGER },
9308
+ isShowBlur: { type: Boolean, default: false },
9309
+ precision: { default: 0 }
9310
+ }, {
9311
+ "modelValue": {
9312
+ default: ""
9313
+ },
9314
+ "modelModifiers": {}
9315
+ }),
9316
+ emits: /* @__PURE__ */ vue.mergeModels(["submit"], ["update:modelValue"]),
9317
+ setup(__props, { expose: __expose, emit: __emit }) {
9318
+ const props = __props;
9319
+ const emits = __emit;
9320
+ const modelValue = vue.useModel(__props, "modelValue");
9321
+ const rootRef = vue.ref();
9322
+ const isBlur = vue.ref(true);
9323
+ const isPassword = vue.computed(() => props.type === "password");
9324
+ let oldInputText = "";
9325
+ const vBkTooltips = bkuiVue.bkTooltips;
9326
+ const {
9327
+ message: errorMessage,
9328
+ validator
9329
+ } = useValidtor(props.rules);
9330
+ const handleInput = (value) => {
9331
+ isBlur.value = false;
9332
+ modelValue.value = value;
9333
+ };
9334
+ const handleBlur = (event) => {
9335
+ isBlur.value = true;
9336
+ if (props.disabled) {
9337
+ event.preventDefault();
9334
9338
  return;
9335
9339
  }
9336
- ignoreOnFirstUpdate = true;
9337
- void popper2.offsetHeight;
9338
- popper2.style.transition = instance.props.moveTransition;
9339
- if (getIsDefaultRenderFn() && instance.props.animation) {
9340
- var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content;
9341
- setTransitionDuration([_box, _content], duration);
9342
- setVisibilityState([_box, _content], "visible");
9340
+ if (modelValue.value) {
9341
+ if (oldInputText === modelValue.value) {
9342
+ return;
9343
+ }
9344
+ oldInputText = modelValue.value;
9345
+ validator(modelValue.value).then(() => {
9346
+ emits("submit", modelValue.value);
9347
+ });
9348
+ return;
9343
9349
  }
9344
- handleAriaContentAttribute();
9345
- handleAriaExpandedAttribute();
9346
- pushIfUnique(mountedInstances, instance);
9347
- (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
9348
- invokeHook("onMount", [instance]);
9349
- if (instance.props.animation && getIsDefaultRenderFn()) {
9350
- onTransitionedIn(duration, function() {
9351
- instance.state.isShown = true;
9352
- invokeHook("onShown", [instance]);
9350
+ emits("submit", modelValue.value);
9351
+ };
9352
+ const handleKeydown = (_value, event) => {
9353
+ if (props.disabled) {
9354
+ event.preventDefault();
9355
+ return;
9356
+ }
9357
+ if (event.isComposing) {
9358
+ return;
9359
+ }
9360
+ if (event.which === 13 || event.key === "Enter") {
9361
+ if (oldInputText === modelValue.value) {
9362
+ return;
9363
+ }
9364
+ oldInputText = modelValue.value;
9365
+ event.preventDefault();
9366
+ validator(modelValue.value).then((result) => {
9367
+ if (result) {
9368
+ emits("submit", modelValue.value);
9369
+ }
9353
9370
  });
9354
9371
  }
9355
9372
  };
9356
- mount();
9373
+ const handlePaste = (_value, event) => {
9374
+ event.preventDefault();
9375
+ let paste = (event.clipboardData || window.clipboardData).getData("text");
9376
+ paste = encodeMult(paste);
9377
+ modelValue.value += paste.replace(/^\s+|\s+$/g, "");
9378
+ };
9379
+ __expose({
9380
+ getValue() {
9381
+ return validator(modelValue.value).then(() => modelValue.value);
9382
+ },
9383
+ focus() {
9384
+ var _a;
9385
+ (_a = rootRef.value.querySelector("input")) == null ? void 0 : _a.focus();
9386
+ }
9387
+ });
9388
+ return (_ctx, _cache) => {
9389
+ return vue.openBlock(), vue.createElementBlock(
9390
+ "div",
9391
+ {
9392
+ ref_key: "rootRef",
9393
+ ref: rootRef,
9394
+ class: vue.normalizeClass(["bk-ediatable-input", {
9395
+ "is-error": Boolean(vue.unref(errorMessage)),
9396
+ "is-disabled": _ctx.disabled,
9397
+ "is-password": isPassword.value
9398
+ }])
9399
+ },
9400
+ [
9401
+ vue.createVNode(vue.unref(bkuiVue.Input), vue.mergeProps({
9402
+ class: "input-box",
9403
+ disabled: _ctx.disabled,
9404
+ max: _ctx.max,
9405
+ min: _ctx.min,
9406
+ "model-value": modelValue.value,
9407
+ placeholder: _ctx.placeholder,
9408
+ type: _ctx.type
9409
+ }, _ctx.$attrs, {
9410
+ precision: _ctx.precision,
9411
+ onBlur: handleBlur,
9412
+ onChange: handleInput,
9413
+ onFocus: _cache[0] || (_cache[0] = () => isBlur.value = false),
9414
+ onInput: handleInput,
9415
+ onKeydown: handleKeydown,
9416
+ onPaste: handlePaste
9417
+ }), {
9418
+ suffix: vue.withCtx(() => []),
9419
+ _: 1
9420
+ /* STABLE */
9421
+ }, 16, ["disabled", "max", "min", "model-value", "placeholder", "type", "precision"]),
9422
+ vue.unref(errorMessage) ? vue.withDirectives((vue.openBlock(), vue.createBlock(
9423
+ vue.unref(DbIcon),
9424
+ {
9425
+ key: 0,
9426
+ class: "error-icon",
9427
+ type: "exclamation-fill"
9428
+ },
9429
+ null,
9430
+ 512
9431
+ /* NEED_PATCH */
9432
+ )), [
9433
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
9434
+ ]) : vue.createCommentVNode("v-if", true),
9435
+ _ctx.isShowBlur && isBlur.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
9436
+ vue.renderSlot(_ctx.$slots, "blur")
9437
+ ])) : vue.createCommentVNode("v-if", true)
9438
+ ],
9439
+ 2
9440
+ /* CLASS */
9441
+ );
9442
+ };
9443
+ }
9444
+ });
9445
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
9446
+ __name: "fixed-column",
9447
+ props: {
9448
+ fixed: { default: "right" }
9449
+ },
9450
+ setup(__props) {
9451
+ const props = __props;
9452
+ const { isOverflow: isFixed, isScrollToLeft, isScrollToRight } = vue.inject(renderTablekey);
9453
+ const isFixedRight = vue.computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "right" && !isScrollToRight.value);
9454
+ const isFixedLeft = vue.computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "left" && !isScrollToLeft.value);
9455
+ return (_ctx, _cache) => {
9456
+ return vue.openBlock(), vue.createElementBlock(
9457
+ "td",
9458
+ {
9459
+ class: vue.normalizeClass({
9460
+ "bk-ediatable-right-fixed-column": isFixedRight.value,
9461
+ "bk-ediatable-left-fixed-column": isFixedLeft.value
9462
+ })
9463
+ },
9464
+ [
9465
+ vue.renderSlot(_ctx.$slots, "default")
9466
+ ],
9467
+ 2
9468
+ /* CLASS */
9469
+ );
9470
+ };
9471
+ }
9472
+ });
9473
+ const _hoisted_1$3 = { class: "bk-ediatable-operation" };
9474
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
9475
+ __name: "operation-column",
9476
+ props: {
9477
+ removeable: { type: Boolean, default: true },
9478
+ showCopy: { type: Boolean, default: false },
9479
+ showAdd: { type: Boolean, default: true },
9480
+ showRemove: { type: Boolean, default: true }
9481
+ },
9482
+ emits: ["add", "copy", "remove"],
9483
+ setup(__props, { emit: __emit }) {
9484
+ const props = __props;
9485
+ const emits = __emit;
9486
+ const handleCopy = () => {
9487
+ emits("copy");
9488
+ };
9489
+ const handleAppend = () => {
9490
+ emits("add");
9491
+ };
9492
+ const handleRemove = () => {
9493
+ if (props.removeable) {
9494
+ return;
9495
+ }
9496
+ emits("remove");
9497
+ };
9498
+ return (_ctx, _cache) => {
9499
+ return vue.openBlock(), vue.createBlock(_sfc_main$4, null, {
9500
+ default: vue.withCtx(() => [
9501
+ vue.createElementVNode("div", _hoisted_1$3, [
9502
+ _ctx.showCopy ? (vue.openBlock(), vue.createElementBlock("div", {
9503
+ key: 0,
9504
+ class: "action-btn",
9505
+ onClick: handleCopy
9506
+ }, [
9507
+ vue.createVNode(vue.unref(DbIcon), { type: "copy" })
9508
+ ])) : vue.createCommentVNode("v-if", true),
9509
+ _ctx.showAdd ? (vue.openBlock(), vue.createElementBlock("div", {
9510
+ key: 1,
9511
+ class: "action-btn",
9512
+ onClick: handleAppend
9513
+ }, [
9514
+ vue.createVNode(vue.unref(DbIcon), { type: "plus-fill" })
9515
+ ])) : vue.createCommentVNode("v-if", true),
9516
+ _ctx.showRemove ? (vue.openBlock(), vue.createElementBlock(
9517
+ "div",
9518
+ {
9519
+ key: 2,
9520
+ class: vue.normalizeClass(["action-btn", {
9521
+ disabled: _ctx.removeable
9522
+ }]),
9523
+ onClick: handleRemove
9524
+ },
9525
+ [
9526
+ vue.createVNode(vue.unref(DbIcon), { type: "minus-fill" })
9527
+ ],
9528
+ 2
9529
+ /* CLASS */
9530
+ )) : vue.createCommentVNode("v-if", true)
9531
+ ])
9532
+ ]),
9533
+ _: 1
9534
+ /* STABLE */
9535
+ });
9536
+ };
9357
9537
  }
9358
- function hide2() {
9359
- var isAlreadyHidden = !instance.state.isVisible;
9360
- var isDestroyed = instance.state.isDestroyed;
9361
- var isDisabled = !instance.state.isEnabled;
9362
- var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
9363
- if (isAlreadyHidden || isDestroyed || isDisabled) {
9364
- return;
9365
- }
9366
- invokeHook("onHide", [instance], false);
9367
- if (instance.props.onHide(instance) === false) {
9368
- return;
9369
- }
9370
- instance.state.isVisible = false;
9371
- instance.state.isShown = false;
9372
- ignoreOnFirstUpdate = false;
9373
- isVisibleFromClick = false;
9374
- if (getIsDefaultRenderFn()) {
9375
- popper2.style.visibility = "hidden";
9376
- }
9377
- cleanupInteractiveMouseListeners();
9378
- removeDocumentPress();
9379
- handleStyles(true);
9380
- if (getIsDefaultRenderFn()) {
9381
- var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
9382
- if (instance.props.animation) {
9383
- setTransitionDuration([box, content], duration);
9384
- setVisibilityState([box, content], "hidden");
9538
+ });
9539
+ const _hoisted_1$2 = {
9540
+ key: 0,
9541
+ class: "select-error"
9542
+ };
9543
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
9544
+ __name: "select-column",
9545
+ props: /* @__PURE__ */ vue.mergeModels({
9546
+ list: {},
9547
+ placeholder: { default: "请选择" },
9548
+ rules: { default: () => [] },
9549
+ disabled: { type: Boolean, default: false },
9550
+ multiple: { type: Boolean, default: false },
9551
+ showSelectAll: { type: Boolean, default: false }
9552
+ }, {
9553
+ "modelValue": {},
9554
+ "modelModifiers": {}
9555
+ }),
9556
+ emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:modelValue"]),
9557
+ setup(__props, { expose: __expose, emit: __emit }) {
9558
+ const { Option } = bkuiVue.Select;
9559
+ const props = __props;
9560
+ const emits = __emit;
9561
+ const modelValue = vue.useModel(__props, "modelValue");
9562
+ const rootRef = vue.ref();
9563
+ const localValue = vue.ref("");
9564
+ const rootHeight = vue.ref(42);
9565
+ const { message: errorMessage, validator } = useValidtor(props.rules);
9566
+ const vBkTooltips = bkuiVue.bkTooltips;
9567
+ vue.watch(
9568
+ modelValue,
9569
+ (value) => {
9570
+ if (value === void 0) {
9571
+ return;
9572
+ }
9573
+ localValue.value = value;
9574
+ if (typeof value !== "object" && value) {
9575
+ validator(value);
9576
+ return;
9577
+ }
9578
+ if (Array.isArray(value) && value.length > 0) {
9579
+ validator(value);
9580
+ return;
9581
+ }
9582
+ },
9583
+ {
9584
+ immediate: true
9385
9585
  }
9386
- }
9387
- handleAriaContentAttribute();
9388
- handleAriaExpandedAttribute();
9389
- if (instance.props.animation) {
9390
- if (getIsDefaultRenderFn()) {
9391
- onTransitionedOut(duration, instance.unmount);
9586
+ );
9587
+ const handleSelect = (value) => {
9588
+ localValue.value = value;
9589
+ validator(localValue.value).then(() => {
9590
+ modelValue.value = value;
9591
+ emits("change", localValue.value);
9592
+ });
9593
+ };
9594
+ const handleRemove = () => {
9595
+ localValue.value = "";
9596
+ validator(localValue.value).then(() => {
9597
+ modelValue.value = localValue.value;
9598
+ emits("change", localValue.value);
9599
+ });
9600
+ };
9601
+ const checkRootHeight = () => {
9602
+ rootHeight.value = rootRef.value.parentNode.clientHeight;
9603
+ };
9604
+ useResizeObserver(rootRef, _.throttle(checkRootHeight, 500));
9605
+ __expose({
9606
+ getValue() {
9607
+ return validator(localValue.value).then(() => localValue.value);
9392
9608
  }
9393
- } else {
9394
- instance.unmount();
9395
- }
9396
- }
9397
- function hideWithInteractivity(event) {
9398
- getDocument().addEventListener("mousemove", debouncedOnMouseMove);
9399
- pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
9400
- debouncedOnMouseMove(event);
9401
- }
9402
- function unmount() {
9403
- if (instance.state.isVisible) {
9404
- instance.hide();
9405
- }
9406
- if (!instance.state.isMounted) {
9407
- return;
9408
- }
9409
- destroyPopperInstance();
9410
- getNestedPopperTree().forEach(function(nestedPopper) {
9411
- nestedPopper._tippy.unmount();
9412
- });
9413
- if (popper2.parentNode) {
9414
- popper2.parentNode.removeChild(popper2);
9415
- }
9416
- mountedInstances = mountedInstances.filter(function(i) {
9417
- return i !== instance;
9418
9609
  });
9419
- instance.state.isMounted = false;
9420
- invokeHook("onHidden", [instance]);
9421
- }
9422
- function destroy() {
9423
- if (instance.state.isDestroyed) {
9424
- return;
9425
- }
9426
- instance.clearDelayTimeouts();
9427
- instance.unmount();
9428
- removeListeners();
9429
- delete reference2._tippy;
9430
- instance.state.isDestroyed = true;
9431
- invokeHook("onDestroy", [instance]);
9432
- }
9433
- }
9434
- function tippy(targets, optionalProps) {
9435
- if (optionalProps === void 0) {
9436
- optionalProps = {};
9437
- }
9438
- var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
9439
- bindGlobalEventListeners();
9440
- var passedProps = Object.assign({}, optionalProps, {
9441
- plugins
9442
- });
9443
- var elements = getArrayOfElements(targets);
9444
- var instances = elements.reduce(function(acc, reference2) {
9445
- var instance = reference2 && createTippy(reference2, passedProps);
9446
- if (instance) {
9447
- acc.push(instance);
9448
- }
9449
- return acc;
9450
- }, []);
9451
- return isElement(targets) ? instances[0] : instances;
9452
- }
9453
- tippy.defaultProps = defaultProps;
9454
- tippy.setDefaultProps = setDefaultProps;
9455
- tippy.currentInput = currentInput;
9456
- Object.assign({}, applyStyles$1, {
9457
- effect: function effect2(_ref) {
9458
- var state = _ref.state;
9459
- var initialStyles = {
9460
- popper: {
9461
- position: state.options.strategy,
9462
- left: "0",
9463
- top: "0",
9464
- margin: "0"
9465
- },
9466
- arrow: {
9467
- position: "absolute"
9468
- },
9469
- reference: {}
9610
+ return (_ctx, _cache) => {
9611
+ return vue.openBlock(), vue.createElementBlock(
9612
+ "div",
9613
+ {
9614
+ ref_key: "rootRef",
9615
+ ref: rootRef,
9616
+ class: vue.normalizeClass(["bk-ediatable-select", {
9617
+ "is-error": Boolean(vue.unref(errorMessage)),
9618
+ "is-disable": _ctx.disabled
9619
+ }]),
9620
+ style: vue.normalizeStyle({ height: rootHeight.value + "px" })
9621
+ },
9622
+ [
9623
+ vue.createVNode(vue.unref(bkuiVue.Select), vue.mergeProps(_ctx.$attrs, {
9624
+ "model-value": localValue.value,
9625
+ "auto-focus": "",
9626
+ class: "select-box",
9627
+ clearable: false,
9628
+ disabled: _ctx.disabled,
9629
+ filterable: "",
9630
+ "input-search": false,
9631
+ multiple: _ctx.multiple,
9632
+ placeholder: _ctx.placeholder,
9633
+ "show-select-all": _ctx.showSelectAll,
9634
+ onChange: handleSelect,
9635
+ onClear: handleRemove
9636
+ }), {
9637
+ default: vue.withCtx(() => [
9638
+ (vue.openBlock(true), vue.createElementBlock(
9639
+ vue.Fragment,
9640
+ null,
9641
+ vue.renderList(_ctx.list, (item, index) => {
9642
+ return vue.openBlock(), vue.createBlock(vue.unref(Option), {
9643
+ key: index,
9644
+ label: item.label,
9645
+ value: item.value
9646
+ }, null, 8, ["label", "value"]);
9647
+ }),
9648
+ 128
9649
+ /* KEYED_FRAGMENT */
9650
+ ))
9651
+ ]),
9652
+ _: 1
9653
+ /* STABLE */
9654
+ }, 16, ["model-value", "disabled", "multiple", "placeholder", "show-select-all"]),
9655
+ vue.unref(errorMessage) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
9656
+ vue.withDirectives(vue.createVNode(
9657
+ vue.unref(DbIcon),
9658
+ { type: "exclamation-fill" },
9659
+ null,
9660
+ 512
9661
+ /* NEED_PATCH */
9662
+ ), [
9663
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
9664
+ ])
9665
+ ])) : vue.createCommentVNode("v-if", true)
9666
+ ],
9667
+ 6
9668
+ /* CLASS, STYLE */
9669
+ );
9470
9670
  };
9471
- Object.assign(state.elements.popper.style, initialStyles.popper);
9472
- state.styles = initialStyles;
9473
- if (state.elements.arrow) {
9474
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
9475
- }
9476
9671
  }
9477
9672
  });
9478
- tippy.setDefaultProps({
9479
- render
9480
- });
9481
9673
  const _hoisted_1$1 = {
9482
9674
  key: 0,
9483
9675
  class: "input-error"
@@ -9506,6 +9698,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9506
9698
  const popRef = vue.ref();
9507
9699
  const isFocus = vue.ref(false);
9508
9700
  let tippyIns;
9701
+ const vBkTooltips = bkuiVue.bkTooltips;
9509
9702
  const { message: errorMessage, validator } = useValidtor(props.rules);
9510
9703
  const tagInputPasteFn = (value) => value.split("\n").map((item) => ({ id: item }));
9511
9704
  const handleChange = (value) => {
@@ -9557,7 +9750,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9557
9750
  }
9558
9751
  });
9559
9752
  return (_ctx, _cache) => {
9560
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
9561
9753
  return vue.openBlock(), vue.createElementBlock(
9562
9754
  "div",
9563
9755
  {
@@ -9594,7 +9786,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9594
9786
  512
9595
9787
  /* NEED_PATCH */
9596
9788
  ), [
9597
- [_directive_bk_tooltips, vue.unref(errorMessage)]
9789
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
9598
9790
  ])
9599
9791
  ])) : vue.createCommentVNode("v-if", true)
9600
9792
  ],
@@ -9625,17 +9817,17 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9625
9817
  });
9626
9818
  function useIsWidthOverflow(domRef, watchVariable) {
9627
9819
  const isOverflow = vue.ref(false);
9628
- const checkOverflow = () => {
9820
+ const checkOverflow2 = () => {
9629
9821
  if (domRef.value) {
9630
9822
  isOverflow.value = domRef.value.clientWidth < domRef.value.scrollWidth;
9631
9823
  }
9632
9824
  };
9633
- useResizeObserver(domRef, checkOverflow);
9825
+ useResizeObserver(domRef, checkOverflow2);
9634
9826
  vue.watch(
9635
9827
  watchVariable,
9636
9828
  () => {
9637
9829
  setTimeout(() => {
9638
- checkOverflow();
9830
+ checkOverflow2();
9639
9831
  });
9640
9832
  },
9641
9833
  {
@@ -9665,6 +9857,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9665
9857
  const props = __props;
9666
9858
  const textRef = vue.ref();
9667
9859
  const renderData = vue.computed(() => props.data);
9860
+ const vBkTooltips = bkuiVue.bkTooltips;
9668
9861
  const { isOverflow } = useIsWidthOverflow(textRef, renderData);
9669
9862
  const { message: errorMessage, validator } = useValidtor(props.rules);
9670
9863
  __expose({
@@ -9673,7 +9866,6 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9673
9866
  }
9674
9867
  });
9675
9868
  return (_ctx, _cache) => {
9676
- const _directive_bk_tooltips = vue.resolveDirective("bk-tooltips");
9677
9869
  return vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Loading), { loading: _ctx.isLoading }, {
9678
9870
  default: vue.withCtx(() => [
9679
9871
  vue.withDirectives((vue.openBlock(), vue.createElementBlock(
@@ -9708,7 +9900,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9708
9900
  512
9709
9901
  /* NEED_PATCH */
9710
9902
  ), [
9711
- [_directive_bk_tooltips, vue.unref(errorMessage)]
9903
+ [vue.unref(vBkTooltips), vue.unref(errorMessage)]
9712
9904
  ])
9713
9905
  ])) : vue.createCommentVNode("v-if", true),
9714
9906
  vue.renderSlot(_ctx.$slots, "default")
@@ -9716,7 +9908,7 @@ url("data:application/vnd.ms-fontobject;base64,9AgAAEwIAAABAAIAAAAAAAIABQMAAAAAA
9716
9908
  2
9717
9909
  /* CLASS */
9718
9910
  )), [
9719
- [_directive_bk_tooltips, {
9911
+ [vue.unref(vBkTooltips), {
9720
9912
  content: _ctx.data || _ctx.placeholder,
9721
9913
  disabled: !vue.unref(isOverflow)
9722
9914
  }]