@blueking/ediatable 0.0.1-beta.3 → 0.0.1-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +600 -0
- package/package.json +11 -2
- package/typings/components/checkbox-column.vue.d.ts +27 -0
- package/typings/components/date-time-picker-column.vue.d.ts +54 -0
- package/typings/components/db-icon/index.d.ts +4 -4
- package/typings/components/fixed-column.vue.d.ts +21 -27
- package/typings/components/head-column.vue.d.ts +36 -41
- package/typings/components/input-column.vue.d.ts +68 -0
- package/typings/components/operation-column.vue.d.ts +21 -0
- package/typings/components/select-column.vue.d.ts +73 -0
- package/typings/components/tag-input-column.vue.d.ts +57 -0
- package/typings/components/text-plain-column.vue.d.ts +38 -0
- package/typings/ediatable.vue.d.ts +18 -4
- package/typings/hooks/useIsWidthOverflow.d.ts +1 -1
- package/typings/hooks/useValidtor.d.ts +3 -3
- package/typings/vue2.d.ts +15 -7
- package/typings/vue3.d.ts +9 -7
- package/vue2/index.es.min.js +3682 -10672
- package/vue2/index.iife.min.js +6288 -16056
- package/vue2/index.umd.min.js +3684 -14000
- package/vue2/vue2.css +227 -206
- package/vue3/index.es.min.js +1546 -1205
- package/vue3/index.iife.min.js +3672 -14002
- package/vue3/index.umd.min.js +3310 -2872
- package/vue3/vue3.css +176 -80
- package/typings/components/date-time-picker.vue.d.ts +0 -63
- package/typings/components/input.vue.d.ts +0 -73
- package/typings/components/operation.vue.d.ts +0 -42
- package/typings/components/select.vue.d.ts +0 -65
- package/typings/components/tag-input.vue.d.ts +0 -60
package/vue3/index.es.min.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ref, provide, onMounted, onBeforeUnmount,
|
|
2
|
-
import "bkui-vue
|
|
3
|
-
import { DatePicker, Input, Select, TagInput, Loading } from "bkui-vue";
|
|
1
|
+
import { ref, provide, onMounted, onBeforeUnmount, getCurrentScope, onScopeDispose, unref, computed, watch, getCurrentInstance, defineComponent, useSlots, inject, openBlock, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, withDirectives, renderSlot, createCommentVNode, createBlock, Fragment, renderList, withCtx, createTextVNode, toDisplayString, reactive, toRefs, h, mergeModels, useModel, useAttrs, createVNode, mergeProps, createSlots, nextTick } from "vue";
|
|
2
|
+
import { bkTooltips, DatePicker, Input, Select, TagInput, Loading, Checkbox } from "bkui-vue";
|
|
4
3
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
5
4
|
function getDefaultExportFromCjs(x) {
|
|
6
5
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -5489,7 +5488,7 @@ lodash.exports;
|
|
|
5489
5488
|
var lodashExports = lodash.exports;
|
|
5490
5489
|
const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
|
|
5491
5490
|
!function() {
|
|
5492
|
-
var svgCode = '<svg xmlns="http://www.w3.org/2000/svg" data-name="ediatable" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="icon-exclamation-fill" viewBox="0 0 64 64"><path fill="#737987" d="M32 4C16.5 4 4 16.5 4 32s12.5 28 28 28 28-12.5 28-28S47.5 4 32 4zm0 44c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3zm3-28.7L34 38c0 1.1-.9 2-2 2s-2-.9-2-2l-1-18.7V19c0-1.7 1.3-3 3-3s3 1.3 3 3v.3z"/></symbol><symbol id="icon-minus-fill" viewBox="0 0 1024 1024"><path d="M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zm224 480H288v-64h448v64z"/></symbol><symbol id="icon-plus-fill" viewBox="0 0 1024 1024"><path d="M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zm224 480H544v192h-64V544H288v-64h192V288h64v192h192v64z"/></symbol></svg>';
|
|
5491
|
+
var svgCode = '<svg xmlns="http://www.w3.org/2000/svg" data-name="ediatable" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="icon-exclamation-fill" viewBox="0 0 64 64"><path fill="#737987" d="M32 4C16.5 4 4 16.5 4 32s12.5 28 28 28 28-12.5 28-28S47.5 4 32 4zm0 44c-1.7 0-3-1.3-3-3s1.3-3 3-3 3 1.3 3 3-1.3 3-3 3zm3-28.7L34 38c0 1.1-.9 2-2 2s-2-.9-2-2l-1-18.7V19c0-1.7 1.3-3 3-3s3 1.3 3 3v.3z"/></symbol><symbol id="icon-close-circle-shape" viewBox="0 0 64 64"><path fill="#737987" d="M32 4C16.5 4 4 16.5 4 32s12.5 28 28 28 28-12.5 28-28S47.5 4 32 4zm11.3 36.5l-2.8 2.8-8.5-8.5-8.5 8.5-2.8-2.8 8.5-8.5-8.5-8.5 2.8-2.8 8.5 8.5 8.5-8.5 2.8 2.8-8.5 8.5 8.5 8.5z"/></symbol><symbol id="icon-copy" viewBox="0 0 1024 1024"><path d="M864 128H288c-17.6 0-32 14.4-32 32v96h-96c-17.6 0-32 14.4-32 32v576c0 17.6 14.4 32 32 32h576c17.6 0 32-14.4 32-32v-96h96c17.6 0 32-14.4 32-32V160c0-17.6-14.4-32-32-32zM704 704v128H192V320h512v384zm128 0h-64V288c0-17.6-14.4-32-32-32H320v-64h512v512z"/><path d="M275.2 419.2h336v64h-336zM272 544h336v64H272zM272 672h336v64H272z"/></symbol><symbol id="icon-minus-fill" viewBox="0 0 1024 1024"><path d="M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zm224 480H288v-64h448v64z"/></symbol><symbol id="icon-plus-fill" viewBox="0 0 1024 1024"><path d="M512 64C264 64 64 264 64 512s200 448 448 448 448-200 448-448S760 64 512 64zm224 480H544v192h-64V544H288v-64h192V288h64v192h192v64z"/></symbol></svg>';
|
|
5493
5492
|
if (document.body) {
|
|
5494
5493
|
document.body.insertAdjacentHTML("afterbegin", svgCode);
|
|
5495
5494
|
} else {
|
|
@@ -5528,10 +5527,8 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5528
5527
|
if (!dragable) {
|
|
5529
5528
|
return;
|
|
5530
5529
|
}
|
|
5531
|
-
const {
|
|
5532
|
-
|
|
5533
|
-
minWidth = 100
|
|
5534
|
-
} = payload;
|
|
5530
|
+
const { columnKey, minWidth = 100 } = payload;
|
|
5531
|
+
const target = event.target.closest("th");
|
|
5535
5532
|
const tableEl = tableRef.value;
|
|
5536
5533
|
const columnEl = tableEl.querySelector(`th.column-${columnKey}`);
|
|
5537
5534
|
const tableLeft = tableEl.getBoundingClientRect().left;
|
|
@@ -5561,6 +5558,7 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5561
5558
|
resizeProxy.style.display = "block";
|
|
5562
5559
|
resizeProxyLeft = Math.max(minLeft, proxyLeft);
|
|
5563
5560
|
resizeProxy.style.left = `${resizeProxyLeft}px`;
|
|
5561
|
+
target.classList.add("poiner-right");
|
|
5564
5562
|
};
|
|
5565
5563
|
const handleMouseUp = () => {
|
|
5566
5564
|
if (dragging.value) {
|
|
@@ -5585,15 +5583,22 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5585
5583
|
document.addEventListener("mouseup", handleMouseUp);
|
|
5586
5584
|
};
|
|
5587
5585
|
const handleMouseMove = (event) => {
|
|
5586
|
+
var _a;
|
|
5587
|
+
if (dragging.value) {
|
|
5588
|
+
return;
|
|
5589
|
+
}
|
|
5588
5590
|
const target = event.target.closest("th");
|
|
5589
5591
|
const rect = target.getBoundingClientRect();
|
|
5590
5592
|
const bodyStyle = document.body.style;
|
|
5591
5593
|
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
|
5592
5594
|
bodyStyle.cursor = "col-resize";
|
|
5593
5595
|
dragable = true;
|
|
5596
|
+
target.classList.add("poiner-right");
|
|
5594
5597
|
} else if (!dragging.value) {
|
|
5595
5598
|
bodyStyle.cursor = "";
|
|
5596
5599
|
dragable = false;
|
|
5600
|
+
target.classList.remove("poiner-right");
|
|
5601
|
+
(_a = target.previousElementSibling) == null ? void 0 : _a.classList.remove("poiner-right");
|
|
5597
5602
|
}
|
|
5598
5603
|
};
|
|
5599
5604
|
const handleOuterMousemove = _.throttle((event) => {
|
|
@@ -5623,1052 +5628,310 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5623
5628
|
handleMouseMove
|
|
5624
5629
|
};
|
|
5625
5630
|
}
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
setup(__props) {
|
|
5631
|
-
const checkTableScroll = () => {
|
|
5632
|
-
rowWidth.value = tableRef.value.clientWidth;
|
|
5633
|
-
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
5634
|
-
initColumnWidth();
|
|
5635
|
-
};
|
|
5636
|
-
const tableOuterRef = ref();
|
|
5637
|
-
const tableRef = ref();
|
|
5638
|
-
const tableColumnResizeRef = ref();
|
|
5639
|
-
const isOverflow = ref(false);
|
|
5640
|
-
const rowWidth = ref(0);
|
|
5641
|
-
const { initColumnWidth } = useColumnResize(tableOuterRef, tableColumnResizeRef, _.debounce(checkTableScroll));
|
|
5642
|
-
provide(renderTablekey, {
|
|
5643
|
-
isOverflow,
|
|
5644
|
-
rowWidth
|
|
5645
|
-
});
|
|
5646
|
-
onMounted(() => {
|
|
5647
|
-
window.addEventListener("resize", checkTableScroll);
|
|
5648
|
-
checkTableScroll();
|
|
5649
|
-
setTimeout(() => checkTableScroll());
|
|
5650
|
-
});
|
|
5651
|
-
onBeforeUnmount(() => window.removeEventListener("resize", checkTableScroll));
|
|
5652
|
-
return (_ctx, _cache) => {
|
|
5653
|
-
return openBlock(), createElementBlock(
|
|
5654
|
-
"div",
|
|
5655
|
-
{
|
|
5656
|
-
id: "ediatableRenderTableKey",
|
|
5657
|
-
ref_key: "tableOuterRef",
|
|
5658
|
-
ref: tableOuterRef,
|
|
5659
|
-
class: "bk-ediatable"
|
|
5660
|
-
},
|
|
5661
|
-
[
|
|
5662
|
-
createElementVNode(
|
|
5663
|
-
"table",
|
|
5664
|
-
{
|
|
5665
|
-
ref_key: "tableRef",
|
|
5666
|
-
ref: tableRef
|
|
5667
|
-
},
|
|
5668
|
-
[
|
|
5669
|
-
createElementVNode("thead", null, [
|
|
5670
|
-
createElementVNode("tr", _hoisted_1$7, [
|
|
5671
|
-
renderSlot(_ctx.$slots, "default")
|
|
5672
|
-
])
|
|
5673
|
-
]),
|
|
5674
|
-
createElementVNode("tbody", null, [
|
|
5675
|
-
renderSlot(_ctx.$slots, "data")
|
|
5676
|
-
])
|
|
5677
|
-
],
|
|
5678
|
-
512
|
|
5679
|
-
/* NEED_PATCH */
|
|
5680
|
-
),
|
|
5681
|
-
createElementVNode(
|
|
5682
|
-
"div",
|
|
5683
|
-
{
|
|
5684
|
-
ref_key: "tableColumnResizeRef",
|
|
5685
|
-
ref: tableColumnResizeRef,
|
|
5686
|
-
class: "table-column-resize"
|
|
5687
|
-
},
|
|
5688
|
-
null,
|
|
5689
|
-
512
|
|
5690
|
-
/* NEED_PATCH */
|
|
5691
|
-
)
|
|
5692
|
-
],
|
|
5693
|
-
512
|
|
5694
|
-
/* NEED_PATCH */
|
|
5695
|
-
);
|
|
5696
|
-
};
|
|
5631
|
+
function tryOnScopeDispose(fn2) {
|
|
5632
|
+
if (getCurrentScope()) {
|
|
5633
|
+
onScopeDispose(fn2);
|
|
5634
|
+
return true;
|
|
5697
5635
|
}
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5636
|
+
return false;
|
|
5637
|
+
}
|
|
5638
|
+
function toValue(r) {
|
|
5639
|
+
return typeof r === "function" ? r() : unref(r);
|
|
5640
|
+
}
|
|
5641
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
5642
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
5643
|
+
function unrefElement(elRef) {
|
|
5644
|
+
var _a;
|
|
5645
|
+
const plain = toValue(elRef);
|
|
5646
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
5647
|
+
}
|
|
5648
|
+
const defaultWindow = isClient ? window : void 0;
|
|
5649
|
+
function useMounted() {
|
|
5650
|
+
const isMounted = ref(false);
|
|
5651
|
+
const instance = getCurrentInstance();
|
|
5652
|
+
if (instance) {
|
|
5653
|
+
onMounted(() => {
|
|
5654
|
+
isMounted.value = true;
|
|
5655
|
+
}, instance);
|
|
5702
5656
|
}
|
|
5703
|
-
return
|
|
5704
|
-
}
|
|
5705
|
-
function
|
|
5706
|
-
const
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5657
|
+
return isMounted;
|
|
5658
|
+
}
|
|
5659
|
+
function useSupported(callback) {
|
|
5660
|
+
const isMounted = useMounted();
|
|
5661
|
+
return computed(() => {
|
|
5662
|
+
isMounted.value;
|
|
5663
|
+
return Boolean(callback());
|
|
5710
5664
|
});
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5665
|
+
}
|
|
5666
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
5667
|
+
const { window: window2 = defaultWindow, ...observerOptions } = options;
|
|
5668
|
+
let observer;
|
|
5669
|
+
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
|
|
5670
|
+
const cleanup = () => {
|
|
5671
|
+
if (observer) {
|
|
5672
|
+
observer.disconnect();
|
|
5673
|
+
observer = void 0;
|
|
5715
5674
|
}
|
|
5716
|
-
const run = /* @__PURE__ */ (() => {
|
|
5717
|
-
let stepIndex = -1;
|
|
5718
|
-
return async () => {
|
|
5719
|
-
stepIndex = stepIndex + 1;
|
|
5720
|
-
if (stepIndex >= rules.length) {
|
|
5721
|
-
return Promise.resolve(true);
|
|
5722
|
-
}
|
|
5723
|
-
const rule = rules[stepIndex];
|
|
5724
|
-
return Promise.resolve().then(() => {
|
|
5725
|
-
const result = rule.validator(targetValue);
|
|
5726
|
-
if (typeof result !== "boolean" && typeof result.then === "function") {
|
|
5727
|
-
return result.then((data) => {
|
|
5728
|
-
if (data === false) {
|
|
5729
|
-
return Promise.reject(getRuleMessage(rule));
|
|
5730
|
-
}
|
|
5731
|
-
}).then(() => run(), () => {
|
|
5732
|
-
state.error = true;
|
|
5733
|
-
const message = getRuleMessage(rule);
|
|
5734
|
-
state.message = message;
|
|
5735
|
-
return Promise.reject(message);
|
|
5736
|
-
});
|
|
5737
|
-
}
|
|
5738
|
-
if (!result) {
|
|
5739
|
-
state.error = true;
|
|
5740
|
-
const message = getRuleMessage(rule);
|
|
5741
|
-
state.message = message;
|
|
5742
|
-
return Promise.reject(message);
|
|
5743
|
-
}
|
|
5744
|
-
return run();
|
|
5745
|
-
});
|
|
5746
|
-
};
|
|
5747
|
-
})();
|
|
5748
|
-
return run();
|
|
5749
5675
|
};
|
|
5676
|
+
const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
|
|
5677
|
+
const stopWatch = watch(
|
|
5678
|
+
targets,
|
|
5679
|
+
(els) => {
|
|
5680
|
+
cleanup();
|
|
5681
|
+
if (isSupported.value && window2) {
|
|
5682
|
+
observer = new ResizeObserver(callback);
|
|
5683
|
+
for (const _el of els)
|
|
5684
|
+
_el && observer.observe(_el, observerOptions);
|
|
5685
|
+
}
|
|
5686
|
+
},
|
|
5687
|
+
{ immediate: true, flush: "post" }
|
|
5688
|
+
);
|
|
5689
|
+
const stop = () => {
|
|
5690
|
+
cleanup();
|
|
5691
|
+
stopWatch();
|
|
5692
|
+
};
|
|
5693
|
+
tryOnScopeDispose(stop);
|
|
5750
5694
|
return {
|
|
5751
|
-
|
|
5752
|
-
|
|
5695
|
+
isSupported,
|
|
5696
|
+
stop
|
|
5753
5697
|
};
|
|
5754
5698
|
}
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
});
|
|
5699
|
+
var top = "top";
|
|
5700
|
+
var bottom = "bottom";
|
|
5701
|
+
var right = "right";
|
|
5702
|
+
var left = "left";
|
|
5703
|
+
var auto = "auto";
|
|
5704
|
+
var basePlacements = [top, bottom, right, left];
|
|
5705
|
+
var start = "start";
|
|
5706
|
+
var end = "end";
|
|
5707
|
+
var clippingParents = "clippingParents";
|
|
5708
|
+
var viewport = "viewport";
|
|
5709
|
+
var popper = "popper";
|
|
5710
|
+
var reference = "reference";
|
|
5711
|
+
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
5712
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
5713
|
+
}, []);
|
|
5714
|
+
var placements$1 = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
5715
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
5716
|
+
}, []);
|
|
5717
|
+
var beforeRead = "beforeRead";
|
|
5718
|
+
var read = "read";
|
|
5719
|
+
var afterRead = "afterRead";
|
|
5720
|
+
var beforeMain = "beforeMain";
|
|
5721
|
+
var main = "main";
|
|
5722
|
+
var afterMain = "afterMain";
|
|
5723
|
+
var beforeWrite = "beforeWrite";
|
|
5724
|
+
var write = "write";
|
|
5725
|
+
var afterWrite = "afterWrite";
|
|
5726
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
5727
|
+
function getNodeName(element) {
|
|
5728
|
+
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
5729
|
+
}
|
|
5730
|
+
function getWindow(node) {
|
|
5731
|
+
if (node == null) {
|
|
5732
|
+
return window;
|
|
5790
5733
|
}
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
class: "input-error"
|
|
5795
|
-
};
|
|
5796
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5797
|
-
__name: "date-time-picker",
|
|
5798
|
-
props: /* @__PURE__ */ mergeModels({
|
|
5799
|
-
placeholder: { default: "" },
|
|
5800
|
-
rules: { default: void 0 },
|
|
5801
|
-
type: { default: void 0 },
|
|
5802
|
-
disabled: { type: Boolean, default: false }
|
|
5803
|
-
}, {
|
|
5804
|
-
"modelValue": {},
|
|
5805
|
-
"modelModifiers": {}
|
|
5806
|
-
}),
|
|
5807
|
-
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
5808
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5809
|
-
const props = __props;
|
|
5810
|
-
const emits = __emit;
|
|
5811
|
-
const modelValue = useModel(__props, "modelValue");
|
|
5812
|
-
const attrs = useAttrs();
|
|
5813
|
-
const slots = useSlots();
|
|
5814
|
-
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
5815
|
-
const handleChange = (value) => {
|
|
5816
|
-
modelValue.value = value;
|
|
5817
|
-
validator(modelValue.value).then(() => {
|
|
5818
|
-
emits("change", modelValue.value);
|
|
5819
|
-
});
|
|
5820
|
-
};
|
|
5821
|
-
const handleOpenChange = (open) => {
|
|
5822
|
-
if (!open) {
|
|
5823
|
-
validator(modelValue.value);
|
|
5824
|
-
}
|
|
5825
|
-
};
|
|
5826
|
-
__expose({
|
|
5827
|
-
getValue() {
|
|
5828
|
-
return validator(modelValue.value).then(() => modelValue.value);
|
|
5829
|
-
}
|
|
5830
|
-
});
|
|
5831
|
-
return (_ctx, _cache) => {
|
|
5832
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
5833
|
-
return openBlock(), createElementBlock(
|
|
5834
|
-
"div",
|
|
5835
|
-
{
|
|
5836
|
-
class: normalizeClass(["bk-ediatable-time-picker", {
|
|
5837
|
-
"is-error": Boolean(unref(errorMessage)),
|
|
5838
|
-
"is-disabled": _ctx.disabled
|
|
5839
|
-
}])
|
|
5840
|
-
},
|
|
5841
|
-
[
|
|
5842
|
-
createVNode(unref(DatePicker), mergeProps({
|
|
5843
|
-
"append-to-body": "",
|
|
5844
|
-
clearable: false,
|
|
5845
|
-
"model-value": modelValue.value,
|
|
5846
|
-
placeholder: _ctx.placeholder,
|
|
5847
|
-
style: { "width": "100%" },
|
|
5848
|
-
type: _ctx.type
|
|
5849
|
-
}, unref(attrs), {
|
|
5850
|
-
onChange: handleChange,
|
|
5851
|
-
onOpenChange: handleOpenChange
|
|
5852
|
-
}), createSlots({
|
|
5853
|
-
_: 2
|
|
5854
|
-
/* DYNAMIC */
|
|
5855
|
-
}, [
|
|
5856
|
-
unref(slots).footer ? {
|
|
5857
|
-
name: "footer",
|
|
5858
|
-
fn: withCtx(() => [
|
|
5859
|
-
renderSlot(_ctx.$slots, "footer")
|
|
5860
|
-
]),
|
|
5861
|
-
key: "0"
|
|
5862
|
-
} : void 0
|
|
5863
|
-
]), 1040, ["model-value", "placeholder", "type"]),
|
|
5864
|
-
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
5865
|
-
withDirectives(createVNode(
|
|
5866
|
-
unref(DbIcon),
|
|
5867
|
-
{ type: "exclamation-fill" },
|
|
5868
|
-
null,
|
|
5869
|
-
512
|
|
5870
|
-
/* NEED_PATCH */
|
|
5871
|
-
), [
|
|
5872
|
-
[_directive_bk_tooltips, unref(errorMessage)]
|
|
5873
|
-
])
|
|
5874
|
-
])) : createCommentVNode("v-if", true)
|
|
5875
|
-
],
|
|
5876
|
-
2
|
|
5877
|
-
/* CLASS */
|
|
5878
|
-
);
|
|
5879
|
-
};
|
|
5880
|
-
}
|
|
5881
|
-
});
|
|
5882
|
-
const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
|
|
5883
|
-
const encodeMult = (text) => {
|
|
5884
|
-
const temp = document.createElement("textarea");
|
|
5885
|
-
temp.value = text;
|
|
5886
|
-
return temp.value;
|
|
5887
|
-
};
|
|
5888
|
-
const _hoisted_1$5 = {
|
|
5889
|
-
key: 1,
|
|
5890
|
-
class: "blur-dispaly-main"
|
|
5891
|
-
};
|
|
5892
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5893
|
-
__name: "input",
|
|
5894
|
-
props: /* @__PURE__ */ mergeModels({
|
|
5895
|
-
placeholder: { default: "请输入" },
|
|
5896
|
-
rules: { default: void 0 },
|
|
5897
|
-
disabled: { type: Boolean, default: false },
|
|
5898
|
-
type: { default: "text" },
|
|
5899
|
-
min: { default: Number.MIN_SAFE_INTEGER },
|
|
5900
|
-
max: { default: Number.MAX_SAFE_INTEGER },
|
|
5901
|
-
isShowBlur: { type: Boolean, default: false }
|
|
5902
|
-
}, {
|
|
5903
|
-
"modelValue": {
|
|
5904
|
-
default: ""
|
|
5905
|
-
},
|
|
5906
|
-
"modelModifiers": {}
|
|
5907
|
-
}),
|
|
5908
|
-
emits: /* @__PURE__ */ mergeModels(["submit"], ["update:modelValue"]),
|
|
5909
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
5910
|
-
const props = __props;
|
|
5911
|
-
const emits = __emit;
|
|
5912
|
-
const modelValue = useModel(__props, "modelValue");
|
|
5913
|
-
const rootRef = ref();
|
|
5914
|
-
const isBlur = ref(true);
|
|
5915
|
-
const isPassword = computed(() => props.type === "password");
|
|
5916
|
-
let oldInputText = "";
|
|
5917
|
-
const {
|
|
5918
|
-
message: errorMessage,
|
|
5919
|
-
validator
|
|
5920
|
-
} = useValidtor(props.rules);
|
|
5921
|
-
const handleInput = (value) => {
|
|
5922
|
-
isBlur.value = false;
|
|
5923
|
-
modelValue.value = value;
|
|
5924
|
-
};
|
|
5925
|
-
const handleBlur = (event) => {
|
|
5926
|
-
isBlur.value = true;
|
|
5927
|
-
if (props.disabled) {
|
|
5928
|
-
event.preventDefault();
|
|
5929
|
-
return;
|
|
5930
|
-
}
|
|
5931
|
-
if (modelValue.value) {
|
|
5932
|
-
if (oldInputText === modelValue.value) {
|
|
5933
|
-
return;
|
|
5934
|
-
}
|
|
5935
|
-
oldInputText = modelValue.value;
|
|
5936
|
-
validator(modelValue.value).then(() => {
|
|
5937
|
-
emits("submit", modelValue.value);
|
|
5938
|
-
});
|
|
5939
|
-
return;
|
|
5940
|
-
}
|
|
5941
|
-
emits("submit", modelValue.value);
|
|
5942
|
-
};
|
|
5943
|
-
const handleKeydown = (_value, event) => {
|
|
5944
|
-
if (props.disabled) {
|
|
5945
|
-
event.preventDefault();
|
|
5946
|
-
return;
|
|
5947
|
-
}
|
|
5948
|
-
if (event.isComposing) {
|
|
5949
|
-
return;
|
|
5950
|
-
}
|
|
5951
|
-
if (event.which === 13 || event.key === "Enter") {
|
|
5952
|
-
if (oldInputText === modelValue.value) {
|
|
5953
|
-
return;
|
|
5954
|
-
}
|
|
5955
|
-
oldInputText = modelValue.value;
|
|
5956
|
-
event.preventDefault();
|
|
5957
|
-
validator(modelValue.value).then((result) => {
|
|
5958
|
-
if (result) {
|
|
5959
|
-
emits("submit", modelValue.value);
|
|
5960
|
-
}
|
|
5961
|
-
});
|
|
5962
|
-
}
|
|
5963
|
-
};
|
|
5964
|
-
const handlePaste = (_value, event) => {
|
|
5965
|
-
event.preventDefault();
|
|
5966
|
-
let paste = (event.clipboardData || window.clipboardData).getData("text");
|
|
5967
|
-
paste = encodeMult(paste);
|
|
5968
|
-
modelValue.value = paste.replace(/^\s+|\s+$/g, "");
|
|
5969
|
-
};
|
|
5970
|
-
__expose({
|
|
5971
|
-
getValue() {
|
|
5972
|
-
return validator(modelValue.value).then(() => modelValue.value);
|
|
5973
|
-
},
|
|
5974
|
-
focus() {
|
|
5975
|
-
var _a;
|
|
5976
|
-
(_a = rootRef.value.querySelector("input")) == null ? void 0 : _a.focus();
|
|
5977
|
-
}
|
|
5978
|
-
});
|
|
5979
|
-
return (_ctx, _cache) => {
|
|
5980
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
5981
|
-
return openBlock(), createElementBlock(
|
|
5982
|
-
"div",
|
|
5983
|
-
{
|
|
5984
|
-
ref_key: "rootRef",
|
|
5985
|
-
ref: rootRef,
|
|
5986
|
-
class: normalizeClass(["bk-ediatable-input", {
|
|
5987
|
-
"is-error": Boolean(unref(errorMessage)),
|
|
5988
|
-
"is-disabled": _ctx.disabled,
|
|
5989
|
-
"is-password": isPassword.value
|
|
5990
|
-
}])
|
|
5991
|
-
},
|
|
5992
|
-
[
|
|
5993
|
-
createVNode(unref(Input), {
|
|
5994
|
-
class: "input-box",
|
|
5995
|
-
disabled: _ctx.disabled,
|
|
5996
|
-
max: _ctx.max,
|
|
5997
|
-
min: _ctx.min,
|
|
5998
|
-
"model-value": modelValue.value,
|
|
5999
|
-
placeholder: _ctx.placeholder,
|
|
6000
|
-
type: _ctx.type,
|
|
6001
|
-
onBlur: handleBlur,
|
|
6002
|
-
onChange: handleInput,
|
|
6003
|
-
onFocus: _cache[0] || (_cache[0] = () => isBlur.value = false),
|
|
6004
|
-
onInput: handleInput,
|
|
6005
|
-
onKeydown: handleKeydown,
|
|
6006
|
-
onPaste: handlePaste
|
|
6007
|
-
}, {
|
|
6008
|
-
suffix: withCtx(() => []),
|
|
6009
|
-
_: 1
|
|
6010
|
-
/* STABLE */
|
|
6011
|
-
}, 8, ["disabled", "max", "min", "model-value", "placeholder", "type"]),
|
|
6012
|
-
unref(errorMessage) ? withDirectives((openBlock(), createBlock(
|
|
6013
|
-
unref(DbIcon),
|
|
6014
|
-
{
|
|
6015
|
-
key: 0,
|
|
6016
|
-
class: "error-icon",
|
|
6017
|
-
type: "exclamation-fill"
|
|
6018
|
-
},
|
|
6019
|
-
null,
|
|
6020
|
-
512
|
|
6021
|
-
/* NEED_PATCH */
|
|
6022
|
-
)), [
|
|
6023
|
-
[_directive_bk_tooltips, unref(errorMessage)]
|
|
6024
|
-
]) : createCommentVNode("v-if", true),
|
|
6025
|
-
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
6026
|
-
renderSlot(_ctx.$slots, "blur")
|
|
6027
|
-
])) : createCommentVNode("v-if", true)
|
|
6028
|
-
],
|
|
6029
|
-
2
|
|
6030
|
-
/* CLASS */
|
|
6031
|
-
);
|
|
6032
|
-
};
|
|
6033
|
-
}
|
|
6034
|
-
});
|
|
6035
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6036
|
-
__name: "fixed-column",
|
|
6037
|
-
props: {
|
|
6038
|
-
fixed: { default: "right" }
|
|
6039
|
-
},
|
|
6040
|
-
setup(__props) {
|
|
6041
|
-
const props = __props;
|
|
6042
|
-
const { isOverflow: isFixed } = inject(renderTablekey);
|
|
6043
|
-
const isFixedRight = computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "right");
|
|
6044
|
-
const isFixedLeft = computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "left");
|
|
6045
|
-
return (_ctx, _cache) => {
|
|
6046
|
-
return openBlock(), createElementBlock(
|
|
6047
|
-
"td",
|
|
6048
|
-
{
|
|
6049
|
-
class: normalizeClass({
|
|
6050
|
-
"bk-ediatable-right-fixed-column": isFixedRight.value,
|
|
6051
|
-
"bk-ediatable-left-fixed-column": isFixedLeft.value
|
|
6052
|
-
})
|
|
6053
|
-
},
|
|
6054
|
-
[
|
|
6055
|
-
renderSlot(_ctx.$slots, "default")
|
|
6056
|
-
],
|
|
6057
|
-
2
|
|
6058
|
-
/* CLASS */
|
|
6059
|
-
);
|
|
6060
|
-
};
|
|
6061
|
-
}
|
|
6062
|
-
});
|
|
6063
|
-
function tryOnScopeDispose(fn2) {
|
|
6064
|
-
if (getCurrentScope()) {
|
|
6065
|
-
onScopeDispose(fn2);
|
|
6066
|
-
return true;
|
|
5734
|
+
if (node.toString() !== "[object Window]") {
|
|
5735
|
+
var ownerDocument = node.ownerDocument;
|
|
5736
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
6067
5737
|
}
|
|
6068
|
-
return
|
|
5738
|
+
return node;
|
|
6069
5739
|
}
|
|
6070
|
-
function
|
|
6071
|
-
|
|
5740
|
+
function isElement$1(node) {
|
|
5741
|
+
var OwnElement = getWindow(node).Element;
|
|
5742
|
+
return node instanceof OwnElement || node instanceof Element;
|
|
6072
5743
|
}
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
var _a;
|
|
6077
|
-
const plain = toValue(elRef);
|
|
6078
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
5744
|
+
function isHTMLElement(node) {
|
|
5745
|
+
var OwnElement = getWindow(node).HTMLElement;
|
|
5746
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
|
6079
5747
|
}
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
const instance = getCurrentInstance();
|
|
6084
|
-
if (instance) {
|
|
6085
|
-
onMounted(() => {
|
|
6086
|
-
isMounted.value = true;
|
|
6087
|
-
}, instance);
|
|
5748
|
+
function isShadowRoot(node) {
|
|
5749
|
+
if (typeof ShadowRoot === "undefined") {
|
|
5750
|
+
return false;
|
|
6088
5751
|
}
|
|
6089
|
-
|
|
5752
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
|
5753
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
6090
5754
|
}
|
|
6091
|
-
function
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
5755
|
+
function applyStyles(_ref) {
|
|
5756
|
+
var state = _ref.state;
|
|
5757
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
5758
|
+
var style = state.styles[name] || {};
|
|
5759
|
+
var attributes = state.attributes[name] || {};
|
|
5760
|
+
var element = state.elements[name];
|
|
5761
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
5762
|
+
return;
|
|
5763
|
+
}
|
|
5764
|
+
Object.assign(element.style, style);
|
|
5765
|
+
Object.keys(attributes).forEach(function(name2) {
|
|
5766
|
+
var value = attributes[name2];
|
|
5767
|
+
if (value === false) {
|
|
5768
|
+
element.removeAttribute(name2);
|
|
5769
|
+
} else {
|
|
5770
|
+
element.setAttribute(name2, value === true ? "" : value);
|
|
5771
|
+
}
|
|
5772
|
+
});
|
|
6096
5773
|
});
|
|
6097
5774
|
}
|
|
6098
|
-
function
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
}
|
|
5775
|
+
function effect$2(_ref2) {
|
|
5776
|
+
var state = _ref2.state;
|
|
5777
|
+
var initialStyles = {
|
|
5778
|
+
popper: {
|
|
5779
|
+
position: state.options.strategy,
|
|
5780
|
+
left: "0",
|
|
5781
|
+
top: "0",
|
|
5782
|
+
margin: "0"
|
|
5783
|
+
},
|
|
5784
|
+
arrow: {
|
|
5785
|
+
position: "absolute"
|
|
5786
|
+
},
|
|
5787
|
+
reference: {}
|
|
6107
5788
|
};
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
(
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
5789
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
5790
|
+
state.styles = initialStyles;
|
|
5791
|
+
if (state.elements.arrow) {
|
|
5792
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
5793
|
+
}
|
|
5794
|
+
return function() {
|
|
5795
|
+
Object.keys(state.elements).forEach(function(name) {
|
|
5796
|
+
var element = state.elements[name];
|
|
5797
|
+
var attributes = state.attributes[name] || {};
|
|
5798
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
5799
|
+
var style = styleProperties.reduce(function(style2, property) {
|
|
5800
|
+
style2[property] = "";
|
|
5801
|
+
return style2;
|
|
5802
|
+
}, {});
|
|
5803
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
5804
|
+
return;
|
|
6117
5805
|
}
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
stopWatch();
|
|
5806
|
+
Object.assign(element.style, style);
|
|
5807
|
+
Object.keys(attributes).forEach(function(attribute) {
|
|
5808
|
+
element.removeAttribute(attribute);
|
|
5809
|
+
});
|
|
5810
|
+
});
|
|
6124
5811
|
};
|
|
6125
|
-
|
|
5812
|
+
}
|
|
5813
|
+
const applyStyles$1 = {
|
|
5814
|
+
name: "applyStyles",
|
|
5815
|
+
enabled: true,
|
|
5816
|
+
phase: "write",
|
|
5817
|
+
fn: applyStyles,
|
|
5818
|
+
effect: effect$2,
|
|
5819
|
+
requires: ["computeStyles"]
|
|
5820
|
+
};
|
|
5821
|
+
function getBasePlacement$1(placement) {
|
|
5822
|
+
return placement.split("-")[0];
|
|
5823
|
+
}
|
|
5824
|
+
var max = Math.max;
|
|
5825
|
+
var min = Math.min;
|
|
5826
|
+
var round = Math.round;
|
|
5827
|
+
function getUAString() {
|
|
5828
|
+
var uaData = navigator.userAgentData;
|
|
5829
|
+
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
5830
|
+
return uaData.brands.map(function(item) {
|
|
5831
|
+
return item.brand + "/" + item.version;
|
|
5832
|
+
}).join(" ");
|
|
5833
|
+
}
|
|
5834
|
+
return navigator.userAgent;
|
|
5835
|
+
}
|
|
5836
|
+
function isLayoutViewport() {
|
|
5837
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
5838
|
+
}
|
|
5839
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
5840
|
+
if (includeScale === void 0) {
|
|
5841
|
+
includeScale = false;
|
|
5842
|
+
}
|
|
5843
|
+
if (isFixedStrategy === void 0) {
|
|
5844
|
+
isFixedStrategy = false;
|
|
5845
|
+
}
|
|
5846
|
+
var clientRect = element.getBoundingClientRect();
|
|
5847
|
+
var scaleX = 1;
|
|
5848
|
+
var scaleY = 1;
|
|
5849
|
+
if (includeScale && isHTMLElement(element)) {
|
|
5850
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
5851
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
5852
|
+
}
|
|
5853
|
+
var _ref = isElement$1(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
5854
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
5855
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
5856
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
5857
|
+
var width = clientRect.width / scaleX;
|
|
5858
|
+
var height = clientRect.height / scaleY;
|
|
6126
5859
|
return {
|
|
6127
|
-
|
|
6128
|
-
|
|
5860
|
+
width,
|
|
5861
|
+
height,
|
|
5862
|
+
top: y,
|
|
5863
|
+
right: x + width,
|
|
5864
|
+
bottom: y + height,
|
|
5865
|
+
left: x,
|
|
5866
|
+
x,
|
|
5867
|
+
y
|
|
6129
5868
|
};
|
|
6130
5869
|
}
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
const isFixedRight = computed(() => props.fixed === "right");
|
|
6158
|
-
const isFixedLeft = computed(() => props.fixed === "left");
|
|
6159
|
-
const styles = computed(() => {
|
|
6160
|
-
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
6161
|
-
const newWidth = rowWidth.value * initWidthRate;
|
|
6162
|
-
if (newWidth !== props.width) {
|
|
6163
|
-
let width = 0;
|
|
6164
|
-
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
6165
|
-
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
6166
|
-
width = currentWidth.value;
|
|
6167
|
-
} else {
|
|
6168
|
-
width = finalMinWidth.value;
|
|
6169
|
-
}
|
|
6170
|
-
} else if (newWidth > finalMinWidth.value) {
|
|
6171
|
-
width = newWidth;
|
|
6172
|
-
} else {
|
|
6173
|
-
width = finalMinWidth.value;
|
|
6174
|
-
}
|
|
6175
|
-
return {
|
|
6176
|
-
minWidth: `${width}px`
|
|
6177
|
-
};
|
|
6178
|
-
}
|
|
6179
|
-
}
|
|
6180
|
-
return {
|
|
6181
|
-
minWidth: props.width ? `${props.width}px` : "120px"
|
|
6182
|
-
};
|
|
6183
|
-
});
|
|
6184
|
-
watch(() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value], ([width, rowWidth2, currentWidth2]) => {
|
|
6185
|
-
if (!isDragedSelf) {
|
|
6186
|
-
return;
|
|
6187
|
-
}
|
|
6188
|
-
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
6189
|
-
isDragedSelf = false;
|
|
6190
|
-
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
6191
|
-
initWidthRate = currentWidth2 / rowWidth2;
|
|
6192
|
-
} else {
|
|
6193
|
-
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
6194
|
-
}
|
|
6195
|
-
}
|
|
6196
|
-
}, {
|
|
6197
|
-
immediate: true
|
|
6198
|
-
});
|
|
6199
|
-
useResizeObserver(columnRef, () => {
|
|
6200
|
-
if (!isDragedSelf) {
|
|
6201
|
-
return;
|
|
5870
|
+
function getLayoutRect(element) {
|
|
5871
|
+
var clientRect = getBoundingClientRect(element);
|
|
5872
|
+
var width = element.offsetWidth;
|
|
5873
|
+
var height = element.offsetHeight;
|
|
5874
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
|
5875
|
+
width = clientRect.width;
|
|
5876
|
+
}
|
|
5877
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
|
5878
|
+
height = clientRect.height;
|
|
5879
|
+
}
|
|
5880
|
+
return {
|
|
5881
|
+
x: element.offsetLeft,
|
|
5882
|
+
y: element.offsetTop,
|
|
5883
|
+
width,
|
|
5884
|
+
height
|
|
5885
|
+
};
|
|
5886
|
+
}
|
|
5887
|
+
function contains(parent, child) {
|
|
5888
|
+
var rootNode = child.getRootNode && child.getRootNode();
|
|
5889
|
+
if (parent.contains(child)) {
|
|
5890
|
+
return true;
|
|
5891
|
+
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
5892
|
+
var next = child;
|
|
5893
|
+
do {
|
|
5894
|
+
if (next && parent.isSameNode(next)) {
|
|
5895
|
+
return true;
|
|
6202
5896
|
}
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
});
|
|
6206
|
-
const handleMouseDown = (event) => {
|
|
6207
|
-
isDragedSelf = true;
|
|
6208
|
-
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
6209
|
-
columnKey,
|
|
6210
|
-
minWidth: finalMinWidth.value
|
|
6211
|
-
});
|
|
6212
|
-
};
|
|
6213
|
-
const handleMouseMove = (event) => {
|
|
6214
|
-
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
6215
|
-
};
|
|
6216
|
-
return (_ctx, _cache) => {
|
|
6217
|
-
const _directive_overflow_tips = resolveDirective("overflow-tips");
|
|
6218
|
-
return openBlock(), createElementBlock("th", {
|
|
6219
|
-
ref_key: "columnRef",
|
|
6220
|
-
ref: columnRef,
|
|
6221
|
-
class: normalizeClass(["bk-ediatable-head-column", {
|
|
6222
|
-
"is-required": _ctx.required,
|
|
6223
|
-
[`column-${unref(columnKey)}`]: true,
|
|
6224
|
-
"is-right-fixed": unref(isMinimize) && isFixedRight.value,
|
|
6225
|
-
"is-left-fixed": unref(isMinimize) && isFixedLeft.value
|
|
6226
|
-
}]),
|
|
6227
|
-
"data-fixed": _ctx.fixed,
|
|
6228
|
-
"data-maxWidth": _ctx.maxWidth,
|
|
6229
|
-
"data-minWidth": finalMinWidth.value,
|
|
6230
|
-
"data-width": _ctx.width,
|
|
6231
|
-
style: normalizeStyle(styles.value),
|
|
6232
|
-
onMousedown: handleMouseDown,
|
|
6233
|
-
onMousemove: handleMouseMove
|
|
6234
|
-
}, [
|
|
6235
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
6236
|
-
renderSlot(_ctx.$slots, "default")
|
|
6237
|
-
])), [
|
|
6238
|
-
[_directive_overflow_tips]
|
|
6239
|
-
]),
|
|
6240
|
-
unref(slots).append ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
6241
|
-
renderSlot(_ctx.$slots, "append")
|
|
6242
|
-
])) : createCommentVNode("v-if", true)
|
|
6243
|
-
], 46, _hoisted_1$4);
|
|
6244
|
-
};
|
|
5897
|
+
next = next.parentNode || next.host;
|
|
5898
|
+
} while (next);
|
|
6245
5899
|
}
|
|
6246
|
-
|
|
6247
|
-
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
6248
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6249
|
-
__name: "operation",
|
|
6250
|
-
props: {
|
|
6251
|
-
showAdd: { type: Boolean, default: true },
|
|
6252
|
-
showRemove: { type: Boolean, default: true },
|
|
6253
|
-
removeable: { type: Boolean, default: true }
|
|
6254
|
-
},
|
|
6255
|
-
emits: ["add", "remove"],
|
|
6256
|
-
setup(__props, { emit: __emit }) {
|
|
6257
|
-
const props = __props;
|
|
6258
|
-
const emits = __emit;
|
|
6259
|
-
const handleAppend = () => {
|
|
6260
|
-
emits("add");
|
|
6261
|
-
};
|
|
6262
|
-
const handleRemove = () => {
|
|
6263
|
-
if (props.removeable) {
|
|
6264
|
-
return;
|
|
6265
|
-
}
|
|
6266
|
-
emits("remove");
|
|
6267
|
-
};
|
|
6268
|
-
return (_ctx, _cache) => {
|
|
6269
|
-
return openBlock(), createBlock(_sfc_main$5, null, {
|
|
6270
|
-
default: withCtx(() => [
|
|
6271
|
-
createElementVNode("div", _hoisted_1$3, [
|
|
6272
|
-
_ctx.showAdd ? (openBlock(), createElementBlock("div", {
|
|
6273
|
-
key: 0,
|
|
6274
|
-
class: "action-btn",
|
|
6275
|
-
onClick: handleAppend
|
|
6276
|
-
}, [
|
|
6277
|
-
createVNode(unref(DbIcon), { type: "plus-fill" })
|
|
6278
|
-
])) : createCommentVNode("v-if", true),
|
|
6279
|
-
_ctx.showRemove ? (openBlock(), createElementBlock(
|
|
6280
|
-
"div",
|
|
6281
|
-
{
|
|
6282
|
-
key: 1,
|
|
6283
|
-
class: normalizeClass(["action-btn", {
|
|
6284
|
-
disabled: _ctx.removeable
|
|
6285
|
-
}]),
|
|
6286
|
-
onClick: handleRemove
|
|
6287
|
-
},
|
|
6288
|
-
[
|
|
6289
|
-
createVNode(unref(DbIcon), { type: "minus-fill" })
|
|
6290
|
-
],
|
|
6291
|
-
2
|
|
6292
|
-
/* CLASS */
|
|
6293
|
-
)) : createCommentVNode("v-if", true)
|
|
6294
|
-
])
|
|
6295
|
-
]),
|
|
6296
|
-
_: 1
|
|
6297
|
-
/* STABLE */
|
|
6298
|
-
});
|
|
6299
|
-
};
|
|
6300
|
-
}
|
|
6301
|
-
});
|
|
6302
|
-
const _hoisted_1$2 = {
|
|
6303
|
-
key: 0,
|
|
6304
|
-
class: "select-error"
|
|
6305
|
-
};
|
|
6306
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6307
|
-
__name: "select",
|
|
6308
|
-
props: /* @__PURE__ */ mergeModels({
|
|
6309
|
-
list: {},
|
|
6310
|
-
placeholder: { default: "请选择" },
|
|
6311
|
-
rules: { default: () => [] },
|
|
6312
|
-
disabled: { type: Boolean, default: false },
|
|
6313
|
-
multiple: { type: Boolean, default: false },
|
|
6314
|
-
showSelectAll: { type: Boolean, default: false }
|
|
6315
|
-
}, {
|
|
6316
|
-
"modelValue": {},
|
|
6317
|
-
"modelModifiers": {}
|
|
6318
|
-
}),
|
|
6319
|
-
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
6320
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6321
|
-
const { Option } = Select;
|
|
6322
|
-
const props = __props;
|
|
6323
|
-
const emits = __emit;
|
|
6324
|
-
const modelValue = useModel(__props, "modelValue");
|
|
6325
|
-
const rootRef = ref();
|
|
6326
|
-
const localValue = ref("");
|
|
6327
|
-
const rootHeight = ref(42);
|
|
6328
|
-
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
6329
|
-
watch(
|
|
6330
|
-
modelValue,
|
|
6331
|
-
(value) => {
|
|
6332
|
-
if (value === void 0) {
|
|
6333
|
-
return;
|
|
6334
|
-
}
|
|
6335
|
-
localValue.value = value;
|
|
6336
|
-
if (typeof value !== "object" && value) {
|
|
6337
|
-
validator(value);
|
|
6338
|
-
return;
|
|
6339
|
-
}
|
|
6340
|
-
if (Array.isArray(value) && value.length > 0) {
|
|
6341
|
-
validator(value);
|
|
6342
|
-
return;
|
|
6343
|
-
}
|
|
6344
|
-
},
|
|
6345
|
-
{
|
|
6346
|
-
immediate: true
|
|
6347
|
-
}
|
|
6348
|
-
);
|
|
6349
|
-
const handleSelect = (value) => {
|
|
6350
|
-
localValue.value = value;
|
|
6351
|
-
validator(localValue.value).then(() => {
|
|
6352
|
-
modelValue.value = value;
|
|
6353
|
-
emits("change", localValue.value);
|
|
6354
|
-
});
|
|
6355
|
-
};
|
|
6356
|
-
const handleRemove = () => {
|
|
6357
|
-
localValue.value = "";
|
|
6358
|
-
validator(localValue.value).then(() => {
|
|
6359
|
-
modelValue.value = localValue.value;
|
|
6360
|
-
emits("change", localValue.value);
|
|
6361
|
-
});
|
|
6362
|
-
};
|
|
6363
|
-
const checkRootHeight = () => {
|
|
6364
|
-
rootHeight.value = rootRef.value.parentNode.clientHeight;
|
|
6365
|
-
};
|
|
6366
|
-
useResizeObserver(rootRef, _.throttle(checkRootHeight, 500));
|
|
6367
|
-
__expose({
|
|
6368
|
-
getValue() {
|
|
6369
|
-
return validator(localValue.value).then(() => localValue.value);
|
|
6370
|
-
}
|
|
6371
|
-
});
|
|
6372
|
-
return (_ctx, _cache) => {
|
|
6373
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
6374
|
-
return openBlock(), createElementBlock(
|
|
6375
|
-
"div",
|
|
6376
|
-
{
|
|
6377
|
-
ref_key: "rootRef",
|
|
6378
|
-
ref: rootRef,
|
|
6379
|
-
class: normalizeClass(["bk-ediatable-select", {
|
|
6380
|
-
"is-error": Boolean(unref(errorMessage)),
|
|
6381
|
-
"is-disable": _ctx.disabled
|
|
6382
|
-
}]),
|
|
6383
|
-
style: normalizeStyle({ height: rootHeight.value + "px" })
|
|
6384
|
-
},
|
|
6385
|
-
[
|
|
6386
|
-
createVNode(unref(Select), {
|
|
6387
|
-
"model-value": localValue.value,
|
|
6388
|
-
"auto-focus": "",
|
|
6389
|
-
class: "select-box",
|
|
6390
|
-
clearable: false,
|
|
6391
|
-
disabled: _ctx.disabled,
|
|
6392
|
-
filterable: "",
|
|
6393
|
-
"input-search": false,
|
|
6394
|
-
multiple: _ctx.multiple,
|
|
6395
|
-
placeholder: _ctx.placeholder,
|
|
6396
|
-
"show-select-all": _ctx.showSelectAll,
|
|
6397
|
-
onChange: handleSelect,
|
|
6398
|
-
onClear: handleRemove
|
|
6399
|
-
}, {
|
|
6400
|
-
default: withCtx(() => [
|
|
6401
|
-
(openBlock(true), createElementBlock(
|
|
6402
|
-
Fragment,
|
|
6403
|
-
null,
|
|
6404
|
-
renderList(_ctx.list, (item, index) => {
|
|
6405
|
-
return openBlock(), createBlock(unref(Option), {
|
|
6406
|
-
key: index,
|
|
6407
|
-
label: item.label,
|
|
6408
|
-
value: item.value
|
|
6409
|
-
}, null, 8, ["label", "value"]);
|
|
6410
|
-
}),
|
|
6411
|
-
128
|
|
6412
|
-
/* KEYED_FRAGMENT */
|
|
6413
|
-
))
|
|
6414
|
-
]),
|
|
6415
|
-
_: 1
|
|
6416
|
-
/* STABLE */
|
|
6417
|
-
}, 8, ["model-value", "disabled", "multiple", "placeholder", "show-select-all"]),
|
|
6418
|
-
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
6419
|
-
withDirectives(createVNode(
|
|
6420
|
-
unref(DbIcon),
|
|
6421
|
-
{ type: "exclamation-fill" },
|
|
6422
|
-
null,
|
|
6423
|
-
512
|
|
6424
|
-
/* NEED_PATCH */
|
|
6425
|
-
), [
|
|
6426
|
-
[_directive_bk_tooltips, unref(errorMessage)]
|
|
6427
|
-
])
|
|
6428
|
-
])) : createCommentVNode("v-if", true)
|
|
6429
|
-
],
|
|
6430
|
-
6
|
|
6431
|
-
/* CLASS, STYLE */
|
|
6432
|
-
);
|
|
6433
|
-
};
|
|
6434
|
-
}
|
|
6435
|
-
});
|
|
6436
|
-
var top = "top";
|
|
6437
|
-
var bottom = "bottom";
|
|
6438
|
-
var right = "right";
|
|
6439
|
-
var left = "left";
|
|
6440
|
-
var auto = "auto";
|
|
6441
|
-
var basePlacements = [top, bottom, right, left];
|
|
6442
|
-
var start = "start";
|
|
6443
|
-
var end = "end";
|
|
6444
|
-
var clippingParents = "clippingParents";
|
|
6445
|
-
var viewport = "viewport";
|
|
6446
|
-
var popper = "popper";
|
|
6447
|
-
var reference = "reference";
|
|
6448
|
-
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
|
6449
|
-
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
|
6450
|
-
}, []);
|
|
6451
|
-
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
|
6452
|
-
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
|
6453
|
-
}, []);
|
|
6454
|
-
var beforeRead = "beforeRead";
|
|
6455
|
-
var read = "read";
|
|
6456
|
-
var afterRead = "afterRead";
|
|
6457
|
-
var beforeMain = "beforeMain";
|
|
6458
|
-
var main = "main";
|
|
6459
|
-
var afterMain = "afterMain";
|
|
6460
|
-
var beforeWrite = "beforeWrite";
|
|
6461
|
-
var write = "write";
|
|
6462
|
-
var afterWrite = "afterWrite";
|
|
6463
|
-
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
|
6464
|
-
function getNodeName(element) {
|
|
6465
|
-
return element ? (element.nodeName || "").toLowerCase() : null;
|
|
5900
|
+
return false;
|
|
6466
5901
|
}
|
|
6467
|
-
function
|
|
6468
|
-
|
|
6469
|
-
return window;
|
|
6470
|
-
}
|
|
6471
|
-
if (node.toString() !== "[object Window]") {
|
|
6472
|
-
var ownerDocument = node.ownerDocument;
|
|
6473
|
-
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
6474
|
-
}
|
|
6475
|
-
return node;
|
|
5902
|
+
function getComputedStyle(element) {
|
|
5903
|
+
return getWindow(element).getComputedStyle(element);
|
|
6476
5904
|
}
|
|
6477
|
-
function
|
|
6478
|
-
|
|
6479
|
-
return node instanceof OwnElement || node instanceof Element;
|
|
5905
|
+
function isTableElement(element) {
|
|
5906
|
+
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
6480
5907
|
}
|
|
6481
|
-
function
|
|
6482
|
-
|
|
6483
|
-
|
|
5908
|
+
function getDocumentElement(element) {
|
|
5909
|
+
return ((isElement$1(element) ? element.ownerDocument : (
|
|
5910
|
+
// $FlowFixMe[prop-missing]
|
|
5911
|
+
element.document
|
|
5912
|
+
)) || window.document).documentElement;
|
|
6484
5913
|
}
|
|
6485
|
-
function
|
|
6486
|
-
if (
|
|
6487
|
-
return
|
|
5914
|
+
function getParentNode(element) {
|
|
5915
|
+
if (getNodeName(element) === "html") {
|
|
5916
|
+
return element;
|
|
6488
5917
|
}
|
|
6489
|
-
|
|
6490
|
-
|
|
5918
|
+
return (
|
|
5919
|
+
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
5920
|
+
// $FlowFixMe[incompatible-return]
|
|
5921
|
+
// $FlowFixMe[prop-missing]
|
|
5922
|
+
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
5923
|
+
element.parentNode || // DOM Element detected
|
|
5924
|
+
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
5925
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
5926
|
+
getDocumentElement(element)
|
|
5927
|
+
);
|
|
6491
5928
|
}
|
|
6492
|
-
function
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
6499
|
-
return;
|
|
6500
|
-
}
|
|
6501
|
-
Object.assign(element.style, style);
|
|
6502
|
-
Object.keys(attributes).forEach(function(name2) {
|
|
6503
|
-
var value = attributes[name2];
|
|
6504
|
-
if (value === false) {
|
|
6505
|
-
element.removeAttribute(name2);
|
|
6506
|
-
} else {
|
|
6507
|
-
element.setAttribute(name2, value === true ? "" : value);
|
|
6508
|
-
}
|
|
6509
|
-
});
|
|
6510
|
-
});
|
|
6511
|
-
}
|
|
6512
|
-
function effect$2(_ref2) {
|
|
6513
|
-
var state = _ref2.state;
|
|
6514
|
-
var initialStyles = {
|
|
6515
|
-
popper: {
|
|
6516
|
-
position: state.options.strategy,
|
|
6517
|
-
left: "0",
|
|
6518
|
-
top: "0",
|
|
6519
|
-
margin: "0"
|
|
6520
|
-
},
|
|
6521
|
-
arrow: {
|
|
6522
|
-
position: "absolute"
|
|
6523
|
-
},
|
|
6524
|
-
reference: {}
|
|
6525
|
-
};
|
|
6526
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
6527
|
-
state.styles = initialStyles;
|
|
6528
|
-
if (state.elements.arrow) {
|
|
6529
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
6530
|
-
}
|
|
6531
|
-
return function() {
|
|
6532
|
-
Object.keys(state.elements).forEach(function(name) {
|
|
6533
|
-
var element = state.elements[name];
|
|
6534
|
-
var attributes = state.attributes[name] || {};
|
|
6535
|
-
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
|
6536
|
-
var style = styleProperties.reduce(function(style2, property) {
|
|
6537
|
-
style2[property] = "";
|
|
6538
|
-
return style2;
|
|
6539
|
-
}, {});
|
|
6540
|
-
if (!isHTMLElement(element) || !getNodeName(element)) {
|
|
6541
|
-
return;
|
|
6542
|
-
}
|
|
6543
|
-
Object.assign(element.style, style);
|
|
6544
|
-
Object.keys(attributes).forEach(function(attribute) {
|
|
6545
|
-
element.removeAttribute(attribute);
|
|
6546
|
-
});
|
|
6547
|
-
});
|
|
6548
|
-
};
|
|
6549
|
-
}
|
|
6550
|
-
const applyStyles$1 = {
|
|
6551
|
-
name: "applyStyles",
|
|
6552
|
-
enabled: true,
|
|
6553
|
-
phase: "write",
|
|
6554
|
-
fn: applyStyles,
|
|
6555
|
-
effect: effect$2,
|
|
6556
|
-
requires: ["computeStyles"]
|
|
6557
|
-
};
|
|
6558
|
-
function getBasePlacement$1(placement) {
|
|
6559
|
-
return placement.split("-")[0];
|
|
6560
|
-
}
|
|
6561
|
-
var max = Math.max;
|
|
6562
|
-
var min = Math.min;
|
|
6563
|
-
var round = Math.round;
|
|
6564
|
-
function getUAString() {
|
|
6565
|
-
var uaData = navigator.userAgentData;
|
|
6566
|
-
if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
|
|
6567
|
-
return uaData.brands.map(function(item) {
|
|
6568
|
-
return item.brand + "/" + item.version;
|
|
6569
|
-
}).join(" ");
|
|
6570
|
-
}
|
|
6571
|
-
return navigator.userAgent;
|
|
6572
|
-
}
|
|
6573
|
-
function isLayoutViewport() {
|
|
6574
|
-
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
|
6575
|
-
}
|
|
6576
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
|
6577
|
-
if (includeScale === void 0) {
|
|
6578
|
-
includeScale = false;
|
|
6579
|
-
}
|
|
6580
|
-
if (isFixedStrategy === void 0) {
|
|
6581
|
-
isFixedStrategy = false;
|
|
6582
|
-
}
|
|
6583
|
-
var clientRect = element.getBoundingClientRect();
|
|
6584
|
-
var scaleX = 1;
|
|
6585
|
-
var scaleY = 1;
|
|
6586
|
-
if (includeScale && isHTMLElement(element)) {
|
|
6587
|
-
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
6588
|
-
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
6589
|
-
}
|
|
6590
|
-
var _ref = isElement$1(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
|
6591
|
-
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
|
6592
|
-
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
|
6593
|
-
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
|
6594
|
-
var width = clientRect.width / scaleX;
|
|
6595
|
-
var height = clientRect.height / scaleY;
|
|
6596
|
-
return {
|
|
6597
|
-
width,
|
|
6598
|
-
height,
|
|
6599
|
-
top: y,
|
|
6600
|
-
right: x + width,
|
|
6601
|
-
bottom: y + height,
|
|
6602
|
-
left: x,
|
|
6603
|
-
x,
|
|
6604
|
-
y
|
|
6605
|
-
};
|
|
6606
|
-
}
|
|
6607
|
-
function getLayoutRect(element) {
|
|
6608
|
-
var clientRect = getBoundingClientRect(element);
|
|
6609
|
-
var width = element.offsetWidth;
|
|
6610
|
-
var height = element.offsetHeight;
|
|
6611
|
-
if (Math.abs(clientRect.width - width) <= 1) {
|
|
6612
|
-
width = clientRect.width;
|
|
6613
|
-
}
|
|
6614
|
-
if (Math.abs(clientRect.height - height) <= 1) {
|
|
6615
|
-
height = clientRect.height;
|
|
6616
|
-
}
|
|
6617
|
-
return {
|
|
6618
|
-
x: element.offsetLeft,
|
|
6619
|
-
y: element.offsetTop,
|
|
6620
|
-
width,
|
|
6621
|
-
height
|
|
6622
|
-
};
|
|
6623
|
-
}
|
|
6624
|
-
function contains(parent, child) {
|
|
6625
|
-
var rootNode = child.getRootNode && child.getRootNode();
|
|
6626
|
-
if (parent.contains(child)) {
|
|
6627
|
-
return true;
|
|
6628
|
-
} else if (rootNode && isShadowRoot(rootNode)) {
|
|
6629
|
-
var next = child;
|
|
6630
|
-
do {
|
|
6631
|
-
if (next && parent.isSameNode(next)) {
|
|
6632
|
-
return true;
|
|
6633
|
-
}
|
|
6634
|
-
next = next.parentNode || next.host;
|
|
6635
|
-
} while (next);
|
|
6636
|
-
}
|
|
6637
|
-
return false;
|
|
6638
|
-
}
|
|
6639
|
-
function getComputedStyle(element) {
|
|
6640
|
-
return getWindow(element).getComputedStyle(element);
|
|
6641
|
-
}
|
|
6642
|
-
function isTableElement(element) {
|
|
6643
|
-
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
|
6644
|
-
}
|
|
6645
|
-
function getDocumentElement(element) {
|
|
6646
|
-
return ((isElement$1(element) ? element.ownerDocument : (
|
|
6647
|
-
// $FlowFixMe[prop-missing]
|
|
6648
|
-
element.document
|
|
6649
|
-
)) || window.document).documentElement;
|
|
6650
|
-
}
|
|
6651
|
-
function getParentNode(element) {
|
|
6652
|
-
if (getNodeName(element) === "html") {
|
|
6653
|
-
return element;
|
|
6654
|
-
}
|
|
6655
|
-
return (
|
|
6656
|
-
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
6657
|
-
// $FlowFixMe[incompatible-return]
|
|
6658
|
-
// $FlowFixMe[prop-missing]
|
|
6659
|
-
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
6660
|
-
element.parentNode || // DOM Element detected
|
|
6661
|
-
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
|
6662
|
-
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
6663
|
-
getDocumentElement(element)
|
|
6664
|
-
);
|
|
6665
|
-
}
|
|
6666
|
-
function getTrueOffsetParent(element) {
|
|
6667
|
-
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
6668
|
-
getComputedStyle(element).position === "fixed") {
|
|
6669
|
-
return null;
|
|
6670
|
-
}
|
|
6671
|
-
return element.offsetParent;
|
|
5929
|
+
function getTrueOffsetParent(element) {
|
|
5930
|
+
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
|
5931
|
+
getComputedStyle(element).position === "fixed") {
|
|
5932
|
+
return null;
|
|
5933
|
+
}
|
|
5934
|
+
return element.offsetParent;
|
|
6672
5935
|
}
|
|
6673
5936
|
function getContainingBlock(element) {
|
|
6674
5937
|
var isFirefox = /firefox/i.test(getUAString());
|
|
@@ -7196,16 +6459,16 @@ function computeAutoPlacement(state, options) {
|
|
|
7196
6459
|
if (options === void 0) {
|
|
7197
6460
|
options = {};
|
|
7198
6461
|
}
|
|
7199
|
-
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;
|
|
6462
|
+
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;
|
|
7200
6463
|
var variation = getVariation(placement);
|
|
7201
|
-
var
|
|
6464
|
+
var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
7202
6465
|
return getVariation(placement2) === variation;
|
|
7203
6466
|
}) : basePlacements;
|
|
7204
|
-
var allowedPlacements =
|
|
6467
|
+
var allowedPlacements = placements2.filter(function(placement2) {
|
|
7205
6468
|
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
7206
6469
|
});
|
|
7207
6470
|
if (allowedPlacements.length === 0) {
|
|
7208
|
-
allowedPlacements =
|
|
6471
|
+
allowedPlacements = placements2;
|
|
7209
6472
|
}
|
|
7210
6473
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
7211
6474
|
acc[placement2] = detectOverflow(state, {
|
|
@@ -7304,8 +6567,7 @@ function flip(_ref) {
|
|
|
7304
6567
|
};
|
|
7305
6568
|
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
7306
6569
|
var _ret = _loop(_i);
|
|
7307
|
-
if (_ret === "break")
|
|
7308
|
-
break;
|
|
6570
|
+
if (_ret === "break") break;
|
|
7309
6571
|
}
|
|
7310
6572
|
}
|
|
7311
6573
|
if (state.placement !== firstFittingPlacement) {
|
|
@@ -7395,7 +6657,7 @@ function distanceAndSkiddingToXY(placement, rects, offset2) {
|
|
|
7395
6657
|
function offset(_ref2) {
|
|
7396
6658
|
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
|
7397
6659
|
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
|
7398
|
-
var data = placements.reduce(function(acc, placement) {
|
|
6660
|
+
var data = placements$1.reduce(function(acc, placement) {
|
|
7399
6661
|
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
|
7400
6662
|
return acc;
|
|
7401
6663
|
}, {});
|
|
@@ -7992,7 +7254,7 @@ var renderProps = {
|
|
|
7992
7254
|
theme: "",
|
|
7993
7255
|
zIndex: 9999
|
|
7994
7256
|
};
|
|
7995
|
-
var defaultProps = Object.assign({
|
|
7257
|
+
var defaultProps$1 = Object.assign({
|
|
7996
7258
|
appendTo: TIPPY_DEFAULT_APPEND_TO,
|
|
7997
7259
|
aria: {
|
|
7998
7260
|
content: "auto",
|
|
@@ -8041,11 +7303,11 @@ var defaultProps = Object.assign({
|
|
|
8041
7303
|
trigger: "mouseenter focus",
|
|
8042
7304
|
triggerTarget: null
|
|
8043
7305
|
}, pluginProps, renderProps);
|
|
8044
|
-
var defaultKeys = Object.keys(defaultProps);
|
|
7306
|
+
var defaultKeys = Object.keys(defaultProps$1);
|
|
8045
7307
|
var setDefaultProps = function setDefaultProps2(partialProps) {
|
|
8046
7308
|
var keys = Object.keys(partialProps);
|
|
8047
7309
|
keys.forEach(function(key) {
|
|
8048
|
-
defaultProps[key] = partialProps[key];
|
|
7310
|
+
defaultProps$1[key] = partialProps[key];
|
|
8049
7311
|
});
|
|
8050
7312
|
};
|
|
8051
7313
|
function getExtendedPassedProps(passedProps) {
|
|
@@ -8054,14 +7316,14 @@ function getExtendedPassedProps(passedProps) {
|
|
|
8054
7316
|
var name = plugin.name, defaultValue = plugin.defaultValue;
|
|
8055
7317
|
if (name) {
|
|
8056
7318
|
var _name;
|
|
8057
|
-
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
|
7319
|
+
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps$1[name]) != null ? _name : defaultValue;
|
|
8058
7320
|
}
|
|
8059
7321
|
return acc;
|
|
8060
7322
|
}, {});
|
|
8061
7323
|
return Object.assign({}, passedProps, pluginProps2);
|
|
8062
7324
|
}
|
|
8063
7325
|
function getDataAttributeProps(reference2, plugins) {
|
|
8064
|
-
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
|
7326
|
+
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps$1, {
|
|
8065
7327
|
plugins
|
|
8066
7328
|
}))) : defaultKeys;
|
|
8067
7329
|
var props = propKeys.reduce(function(acc, key) {
|
|
@@ -8086,7 +7348,7 @@ function evaluateProps(reference2, props) {
|
|
|
8086
7348
|
var out = Object.assign({}, props, {
|
|
8087
7349
|
content: invokeWithArgsOrReturn(props.content, [reference2])
|
|
8088
7350
|
}, props.ignoreAttributes ? {} : getDataAttributeProps(reference2, props.plugins));
|
|
8089
|
-
out.aria = Object.assign({}, defaultProps.aria, out.aria);
|
|
7351
|
+
out.aria = Object.assign({}, defaultProps$1.aria, out.aria);
|
|
8090
7352
|
out.aria = {
|
|
8091
7353
|
expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded,
|
|
8092
7354
|
content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content
|
|
@@ -8201,7 +7463,7 @@ var idCounter = 1;
|
|
|
8201
7463
|
var mouseMoveListeners = [];
|
|
8202
7464
|
var mountedInstances = [];
|
|
8203
7465
|
function createTippy(reference2, passedProps) {
|
|
8204
|
-
var props = evaluateProps(reference2, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps))));
|
|
7466
|
+
var props = evaluateProps(reference2, Object.assign({}, defaultProps$1, getExtendedPassedProps(removeUndefinedProps(passedProps))));
|
|
8205
7467
|
var showTimeout;
|
|
8206
7468
|
var hideTimeout;
|
|
8207
7469
|
var scheduleHideAnimationFrame;
|
|
@@ -8307,7 +7569,7 @@ function createTippy(reference2, passedProps) {
|
|
|
8307
7569
|
if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
|
|
8308
7570
|
return 0;
|
|
8309
7571
|
}
|
|
8310
|
-
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
|
|
7572
|
+
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps$1.delay);
|
|
8311
7573
|
}
|
|
8312
7574
|
function handleStyles(fromHide) {
|
|
8313
7575
|
if (fromHide === void 0) {
|
|
@@ -8771,7 +8033,7 @@ function createTippy(reference2, passedProps) {
|
|
|
8771
8033
|
var isDestroyed = instance.state.isDestroyed;
|
|
8772
8034
|
var isDisabled = !instance.state.isEnabled;
|
|
8773
8035
|
var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
|
|
8774
|
-
var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
|
|
8036
|
+
var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps$1.duration);
|
|
8775
8037
|
if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
|
|
8776
8038
|
return;
|
|
8777
8039
|
}
|
|
@@ -8820,167 +8082,1184 @@ function createTippy(reference2, passedProps) {
|
|
|
8820
8082
|
});
|
|
8821
8083
|
}
|
|
8822
8084
|
};
|
|
8823
|
-
mount();
|
|
8824
|
-
}
|
|
8825
|
-
function hide2() {
|
|
8826
|
-
var isAlreadyHidden = !instance.state.isVisible;
|
|
8827
|
-
var isDestroyed = instance.state.isDestroyed;
|
|
8828
|
-
var isDisabled = !instance.state.isEnabled;
|
|
8829
|
-
var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
|
|
8830
|
-
if (isAlreadyHidden || isDestroyed || isDisabled) {
|
|
8831
|
-
return;
|
|
8832
|
-
}
|
|
8833
|
-
invokeHook("onHide", [instance], false);
|
|
8834
|
-
if (instance.props.onHide(instance) === false) {
|
|
8835
|
-
return;
|
|
8836
|
-
}
|
|
8837
|
-
instance.state.isVisible = false;
|
|
8838
|
-
instance.state.isShown = false;
|
|
8839
|
-
ignoreOnFirstUpdate = false;
|
|
8840
|
-
isVisibleFromClick = false;
|
|
8841
|
-
if (getIsDefaultRenderFn()) {
|
|
8842
|
-
popper2.style.visibility = "hidden";
|
|
8843
|
-
}
|
|
8844
|
-
cleanupInteractiveMouseListeners();
|
|
8845
|
-
removeDocumentPress();
|
|
8846
|
-
handleStyles(true);
|
|
8847
|
-
if (getIsDefaultRenderFn()) {
|
|
8848
|
-
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
|
|
8849
|
-
if (instance.props.animation) {
|
|
8850
|
-
setTransitionDuration([box, content], duration);
|
|
8851
|
-
setVisibilityState([box, content], "hidden");
|
|
8852
|
-
}
|
|
8853
|
-
}
|
|
8854
|
-
handleAriaContentAttribute();
|
|
8855
|
-
handleAriaExpandedAttribute();
|
|
8856
|
-
if (instance.props.animation) {
|
|
8857
|
-
if (getIsDefaultRenderFn()) {
|
|
8858
|
-
onTransitionedOut(duration, instance.unmount);
|
|
8085
|
+
mount();
|
|
8086
|
+
}
|
|
8087
|
+
function hide2() {
|
|
8088
|
+
var isAlreadyHidden = !instance.state.isVisible;
|
|
8089
|
+
var isDestroyed = instance.state.isDestroyed;
|
|
8090
|
+
var isDisabled = !instance.state.isEnabled;
|
|
8091
|
+
var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps$1.duration);
|
|
8092
|
+
if (isAlreadyHidden || isDestroyed || isDisabled) {
|
|
8093
|
+
return;
|
|
8094
|
+
}
|
|
8095
|
+
invokeHook("onHide", [instance], false);
|
|
8096
|
+
if (instance.props.onHide(instance) === false) {
|
|
8097
|
+
return;
|
|
8098
|
+
}
|
|
8099
|
+
instance.state.isVisible = false;
|
|
8100
|
+
instance.state.isShown = false;
|
|
8101
|
+
ignoreOnFirstUpdate = false;
|
|
8102
|
+
isVisibleFromClick = false;
|
|
8103
|
+
if (getIsDefaultRenderFn()) {
|
|
8104
|
+
popper2.style.visibility = "hidden";
|
|
8105
|
+
}
|
|
8106
|
+
cleanupInteractiveMouseListeners();
|
|
8107
|
+
removeDocumentPress();
|
|
8108
|
+
handleStyles(true);
|
|
8109
|
+
if (getIsDefaultRenderFn()) {
|
|
8110
|
+
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
|
|
8111
|
+
if (instance.props.animation) {
|
|
8112
|
+
setTransitionDuration([box, content], duration);
|
|
8113
|
+
setVisibilityState([box, content], "hidden");
|
|
8114
|
+
}
|
|
8115
|
+
}
|
|
8116
|
+
handleAriaContentAttribute();
|
|
8117
|
+
handleAriaExpandedAttribute();
|
|
8118
|
+
if (instance.props.animation) {
|
|
8119
|
+
if (getIsDefaultRenderFn()) {
|
|
8120
|
+
onTransitionedOut(duration, instance.unmount);
|
|
8121
|
+
}
|
|
8122
|
+
} else {
|
|
8123
|
+
instance.unmount();
|
|
8124
|
+
}
|
|
8125
|
+
}
|
|
8126
|
+
function hideWithInteractivity(event) {
|
|
8127
|
+
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
|
8128
|
+
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
|
8129
|
+
debouncedOnMouseMove(event);
|
|
8130
|
+
}
|
|
8131
|
+
function unmount() {
|
|
8132
|
+
if (instance.state.isVisible) {
|
|
8133
|
+
instance.hide();
|
|
8134
|
+
}
|
|
8135
|
+
if (!instance.state.isMounted) {
|
|
8136
|
+
return;
|
|
8137
|
+
}
|
|
8138
|
+
destroyPopperInstance();
|
|
8139
|
+
getNestedPopperTree().forEach(function(nestedPopper) {
|
|
8140
|
+
nestedPopper._tippy.unmount();
|
|
8141
|
+
});
|
|
8142
|
+
if (popper2.parentNode) {
|
|
8143
|
+
popper2.parentNode.removeChild(popper2);
|
|
8144
|
+
}
|
|
8145
|
+
mountedInstances = mountedInstances.filter(function(i) {
|
|
8146
|
+
return i !== instance;
|
|
8147
|
+
});
|
|
8148
|
+
instance.state.isMounted = false;
|
|
8149
|
+
invokeHook("onHidden", [instance]);
|
|
8150
|
+
}
|
|
8151
|
+
function destroy() {
|
|
8152
|
+
if (instance.state.isDestroyed) {
|
|
8153
|
+
return;
|
|
8154
|
+
}
|
|
8155
|
+
instance.clearDelayTimeouts();
|
|
8156
|
+
instance.unmount();
|
|
8157
|
+
removeListeners();
|
|
8158
|
+
delete reference2._tippy;
|
|
8159
|
+
instance.state.isDestroyed = true;
|
|
8160
|
+
invokeHook("onDestroy", [instance]);
|
|
8161
|
+
}
|
|
8162
|
+
}
|
|
8163
|
+
function tippy(targets, optionalProps) {
|
|
8164
|
+
if (optionalProps === void 0) {
|
|
8165
|
+
optionalProps = {};
|
|
8166
|
+
}
|
|
8167
|
+
var plugins = defaultProps$1.plugins.concat(optionalProps.plugins || []);
|
|
8168
|
+
bindGlobalEventListeners();
|
|
8169
|
+
var passedProps = Object.assign({}, optionalProps, {
|
|
8170
|
+
plugins
|
|
8171
|
+
});
|
|
8172
|
+
var elements = getArrayOfElements(targets);
|
|
8173
|
+
var instances = elements.reduce(function(acc, reference2) {
|
|
8174
|
+
var instance = reference2 && createTippy(reference2, passedProps);
|
|
8175
|
+
if (instance) {
|
|
8176
|
+
acc.push(instance);
|
|
8177
|
+
}
|
|
8178
|
+
return acc;
|
|
8179
|
+
}, []);
|
|
8180
|
+
return isElement(targets) ? instances[0] : instances;
|
|
8181
|
+
}
|
|
8182
|
+
tippy.defaultProps = defaultProps$1;
|
|
8183
|
+
tippy.setDefaultProps = setDefaultProps;
|
|
8184
|
+
tippy.currentInput = currentInput;
|
|
8185
|
+
Object.assign({}, applyStyles$1, {
|
|
8186
|
+
effect: function effect2(_ref) {
|
|
8187
|
+
var state = _ref.state;
|
|
8188
|
+
var initialStyles = {
|
|
8189
|
+
popper: {
|
|
8190
|
+
position: state.options.strategy,
|
|
8191
|
+
left: "0",
|
|
8192
|
+
top: "0",
|
|
8193
|
+
margin: "0"
|
|
8194
|
+
},
|
|
8195
|
+
arrow: {
|
|
8196
|
+
position: "absolute"
|
|
8197
|
+
},
|
|
8198
|
+
reference: {}
|
|
8199
|
+
};
|
|
8200
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
8201
|
+
state.styles = initialStyles;
|
|
8202
|
+
if (state.elements.arrow) {
|
|
8203
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
8204
|
+
}
|
|
8205
|
+
}
|
|
8206
|
+
});
|
|
8207
|
+
tippy.setDefaultProps({
|
|
8208
|
+
render
|
|
8209
|
+
});
|
|
8210
|
+
const dbTheme = "db-tippy";
|
|
8211
|
+
const dbDefaultProps = { theme: dbTheme };
|
|
8212
|
+
function dbTippy(targets, optionalProps) {
|
|
8213
|
+
const props = optionalProps ? { ...optionalProps } : optionalProps;
|
|
8214
|
+
if (props) {
|
|
8215
|
+
const { theme } = props;
|
|
8216
|
+
props.theme = theme ? `${dbTheme} ${props.theme}` : dbTheme;
|
|
8217
|
+
}
|
|
8218
|
+
if (targets instanceof Element) {
|
|
8219
|
+
const target = targets;
|
|
8220
|
+
return tippy(target, props || dbDefaultProps);
|
|
8221
|
+
}
|
|
8222
|
+
return tippy(targets, props || dbDefaultProps);
|
|
8223
|
+
}
|
|
8224
|
+
const placements = [
|
|
8225
|
+
"top",
|
|
8226
|
+
"bottom",
|
|
8227
|
+
"right",
|
|
8228
|
+
"left",
|
|
8229
|
+
"auto",
|
|
8230
|
+
"auto-start",
|
|
8231
|
+
"auto-end",
|
|
8232
|
+
"top-start",
|
|
8233
|
+
"top-end",
|
|
8234
|
+
"bottom-start",
|
|
8235
|
+
"bottom-end",
|
|
8236
|
+
"right-start",
|
|
8237
|
+
"right-end",
|
|
8238
|
+
"left-start",
|
|
8239
|
+
"left-end"
|
|
8240
|
+
];
|
|
8241
|
+
function checkOverflow(el) {
|
|
8242
|
+
if (!el) return false;
|
|
8243
|
+
const createDom = (el2, css) => {
|
|
8244
|
+
const dom = document.createElement("div");
|
|
8245
|
+
const width = parseFloat(css.width) ? `${Math.ceil(parseFloat(css.width))}px` : css.width;
|
|
8246
|
+
dom.style.cssText = `
|
|
8247
|
+
width: ${width};
|
|
8248
|
+
line-height: ${css.lineHeight};
|
|
8249
|
+
font-size: ${css.fontSize};
|
|
8250
|
+
word-break: ${css.wordBreak};
|
|
8251
|
+
padding: ${css.padding};
|
|
8252
|
+
`;
|
|
8253
|
+
dom.textContent = el2.textContent;
|
|
8254
|
+
return dom;
|
|
8255
|
+
};
|
|
8256
|
+
let isOverflow = false;
|
|
8257
|
+
try {
|
|
8258
|
+
const css = window.getComputedStyle(el, null);
|
|
8259
|
+
const lineClamp = css.webkitLineClamp;
|
|
8260
|
+
if (lineClamp !== "none") {
|
|
8261
|
+
const targetHeight = parseFloat(css.height);
|
|
8262
|
+
const dom = createDom(el, css);
|
|
8263
|
+
document.body.appendChild(dom);
|
|
8264
|
+
const domHeight = window.getComputedStyle(dom, null).height;
|
|
8265
|
+
document.body.removeChild(dom);
|
|
8266
|
+
isOverflow = targetHeight < parseFloat(domHeight);
|
|
8267
|
+
} else {
|
|
8268
|
+
isOverflow = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
|
|
8269
|
+
}
|
|
8270
|
+
} catch (e) {
|
|
8271
|
+
console.warn("There is an error when check element overflow state: ", e);
|
|
8272
|
+
}
|
|
8273
|
+
return isOverflow;
|
|
8274
|
+
}
|
|
8275
|
+
function beforeShow(instance) {
|
|
8276
|
+
const { reference: reference2 } = instance;
|
|
8277
|
+
const { props } = reference2._bk_overflow_tips_;
|
|
8278
|
+
const isOverflow = checkOverflow(reference2);
|
|
8279
|
+
if (isOverflow) {
|
|
8280
|
+
let { content } = props;
|
|
8281
|
+
if (!content) {
|
|
8282
|
+
content = props.allowHTML ? reference2.innerHTML : reference2.textContent;
|
|
8283
|
+
}
|
|
8284
|
+
instance.setContent(content);
|
|
8285
|
+
return true;
|
|
8286
|
+
}
|
|
8287
|
+
return false;
|
|
8288
|
+
}
|
|
8289
|
+
function setupOnShow(props, customProps) {
|
|
8290
|
+
props.onShow = (instance) => {
|
|
8291
|
+
if (typeof customProps.onShow === "function") {
|
|
8292
|
+
const result = customProps.onShow(instance);
|
|
8293
|
+
if (!result) return false;
|
|
8294
|
+
}
|
|
8295
|
+
const isShow = beforeShow(instance);
|
|
8296
|
+
if (!isShow) return false;
|
|
8297
|
+
};
|
|
8298
|
+
}
|
|
8299
|
+
function setupTheme(props, customProps) {
|
|
8300
|
+
const theme = ["db-tippy bk-overflow-tips"];
|
|
8301
|
+
if (customProps.theme) {
|
|
8302
|
+
theme.push(customProps.theme);
|
|
8303
|
+
}
|
|
8304
|
+
props.theme = theme.join(" ");
|
|
8305
|
+
}
|
|
8306
|
+
function formatModifiers(modifiers) {
|
|
8307
|
+
const keys = Object.entries(modifiers).map((item) => item[0]);
|
|
8308
|
+
if (keys.length === 0) return {};
|
|
8309
|
+
const props = {};
|
|
8310
|
+
for (const key of keys) {
|
|
8311
|
+
if (placements.includes(key)) {
|
|
8312
|
+
props.placement = key;
|
|
8313
|
+
}
|
|
8314
|
+
}
|
|
8315
|
+
return props;
|
|
8316
|
+
}
|
|
8317
|
+
const defaultProps = {
|
|
8318
|
+
arrow: true,
|
|
8319
|
+
interactive: true,
|
|
8320
|
+
delay: 150,
|
|
8321
|
+
allowHTML: false,
|
|
8322
|
+
maxWidth: 600,
|
|
8323
|
+
// boundary: 'window',
|
|
8324
|
+
placement: "top",
|
|
8325
|
+
appendTo: () => document.body
|
|
8326
|
+
};
|
|
8327
|
+
const overflowTips = {
|
|
8328
|
+
mounted(el, binding) {
|
|
8329
|
+
const customProps = typeof binding.value === "object" ? binding.value : formatModifiers(binding.modifiers);
|
|
8330
|
+
const props = Object.assign({ ...defaultProps }, customProps);
|
|
8331
|
+
setupOnShow(props, customProps);
|
|
8332
|
+
setupTheme(props, customProps);
|
|
8333
|
+
el._bk_overflow_tips_ = {
|
|
8334
|
+
props,
|
|
8335
|
+
// 指令配置的props单独存储方便后续做判断
|
|
8336
|
+
instance: dbTippy(el, props)
|
|
8337
|
+
};
|
|
8338
|
+
},
|
|
8339
|
+
updated(el, binding) {
|
|
8340
|
+
const { props, instance } = el._bk_overflow_tips_;
|
|
8341
|
+
const customProps = typeof binding.value === "object" ? binding.value : formatModifiers(binding.modifiers);
|
|
8342
|
+
Object.assign(props, customProps);
|
|
8343
|
+
setupOnShow(props, customProps);
|
|
8344
|
+
setupTheme(props, customProps);
|
|
8345
|
+
instance.setProps(props);
|
|
8346
|
+
},
|
|
8347
|
+
beforeUnmount(el) {
|
|
8348
|
+
el._tippy && el._tippy.destroy();
|
|
8349
|
+
delete el._bk_overflow_tips_;
|
|
8350
|
+
}
|
|
8351
|
+
};
|
|
8352
|
+
const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
|
|
8353
|
+
const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
|
|
8354
|
+
const _hoisted_2$2 = { class: "th-cell" };
|
|
8355
|
+
const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
|
|
8356
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
8357
|
+
__name: "head-column",
|
|
8358
|
+
props: {
|
|
8359
|
+
fixed: { default: void 0 },
|
|
8360
|
+
maxWidth: { default: void 0 },
|
|
8361
|
+
minWidth: { default: void 0 },
|
|
8362
|
+
required: { type: Boolean, default: true },
|
|
8363
|
+
width: { default: void 0 },
|
|
8364
|
+
renderAppend: { type: Function, default: void 0 },
|
|
8365
|
+
memo: { default: "" }
|
|
8366
|
+
},
|
|
8367
|
+
setup(__props) {
|
|
8368
|
+
const props = __props;
|
|
8369
|
+
const slots = useSlots();
|
|
8370
|
+
const { rowWidth, isOverflow: isMinimize, isScrollToLeft, isScrollToRight } = inject(renderTablekey);
|
|
8371
|
+
const parentTable = inject(tableColumnResizekey);
|
|
8372
|
+
const columnRef = ref();
|
|
8373
|
+
const currentWidth = ref(0);
|
|
8374
|
+
const vBkTooltips = bkTooltips;
|
|
8375
|
+
const vOverflowTips = overflowTips;
|
|
8376
|
+
const columnKey = random();
|
|
8377
|
+
let initWidthRate = 0;
|
|
8378
|
+
let isDragedSelf = false;
|
|
8379
|
+
const finalMinWidth = computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
8380
|
+
const isFixedRight = computed(() => props.fixed === "right");
|
|
8381
|
+
const isFixedLeft = computed(() => props.fixed === "left");
|
|
8382
|
+
const styles = computed(() => {
|
|
8383
|
+
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
8384
|
+
const newWidth = rowWidth.value * initWidthRate;
|
|
8385
|
+
if (newWidth !== props.width) {
|
|
8386
|
+
let width = 0;
|
|
8387
|
+
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
8388
|
+
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
8389
|
+
width = currentWidth.value;
|
|
8390
|
+
} else {
|
|
8391
|
+
width = finalMinWidth.value;
|
|
8392
|
+
}
|
|
8393
|
+
} else if (newWidth > finalMinWidth.value) {
|
|
8394
|
+
width = newWidth;
|
|
8395
|
+
} else {
|
|
8396
|
+
width = finalMinWidth.value;
|
|
8397
|
+
}
|
|
8398
|
+
return {
|
|
8399
|
+
minWidth: `${width}px`
|
|
8400
|
+
};
|
|
8401
|
+
}
|
|
8402
|
+
}
|
|
8403
|
+
return {
|
|
8404
|
+
minWidth: props.width ? `${props.width}px` : "120px"
|
|
8405
|
+
};
|
|
8406
|
+
});
|
|
8407
|
+
const RenderAppendElement = computed(() => {
|
|
8408
|
+
var _a;
|
|
8409
|
+
return (_a = props.renderAppend) == null ? void 0 : _a.call(props);
|
|
8410
|
+
});
|
|
8411
|
+
watch(
|
|
8412
|
+
() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
|
|
8413
|
+
([width, rowWidth2, currentWidth2]) => {
|
|
8414
|
+
if (!isDragedSelf) {
|
|
8415
|
+
return;
|
|
8416
|
+
}
|
|
8417
|
+
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
8418
|
+
isDragedSelf = false;
|
|
8419
|
+
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
8420
|
+
initWidthRate = currentWidth2 / rowWidth2;
|
|
8421
|
+
} else {
|
|
8422
|
+
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
8423
|
+
}
|
|
8424
|
+
}
|
|
8425
|
+
},
|
|
8426
|
+
{
|
|
8427
|
+
immediate: true
|
|
8428
|
+
}
|
|
8429
|
+
);
|
|
8430
|
+
useResizeObserver(columnRef, () => {
|
|
8431
|
+
if (!isDragedSelf) {
|
|
8432
|
+
return;
|
|
8433
|
+
}
|
|
8434
|
+
const width = parseFloat(columnRef.value.style.width);
|
|
8435
|
+
currentWidth.value = width;
|
|
8436
|
+
});
|
|
8437
|
+
const handleMouseDown = (event) => {
|
|
8438
|
+
isDragedSelf = true;
|
|
8439
|
+
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
8440
|
+
columnKey,
|
|
8441
|
+
minWidth: finalMinWidth.value
|
|
8442
|
+
});
|
|
8443
|
+
};
|
|
8444
|
+
const handleMouseMove = (event) => {
|
|
8445
|
+
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
8446
|
+
};
|
|
8447
|
+
return (_ctx, _cache) => {
|
|
8448
|
+
return openBlock(), createElementBlock("th", {
|
|
8449
|
+
ref_key: "columnRef",
|
|
8450
|
+
ref: columnRef,
|
|
8451
|
+
style: normalizeStyle(styles.value),
|
|
8452
|
+
class: normalizeClass(["bk-ediatable-head-column", {
|
|
8453
|
+
[`column-${unref(columnKey)}`]: true,
|
|
8454
|
+
"is-right-fixed": unref(isMinimize) && isFixedRight.value && !unref(isScrollToRight),
|
|
8455
|
+
"is-left-fixed": unref(isMinimize) && isFixedLeft.value && !unref(isScrollToLeft)
|
|
8456
|
+
}]),
|
|
8457
|
+
"data-fixed": _ctx.fixed,
|
|
8458
|
+
"data-maxWidth": _ctx.maxWidth,
|
|
8459
|
+
"data-minWidth": finalMinWidth.value,
|
|
8460
|
+
"data-width": _ctx.width,
|
|
8461
|
+
onMousedown: handleMouseDown,
|
|
8462
|
+
onMousemove: handleMouseMove
|
|
8463
|
+
}, [
|
|
8464
|
+
createElementVNode(
|
|
8465
|
+
"div",
|
|
8466
|
+
{
|
|
8467
|
+
class: normalizeClass({ "is-required": _ctx.required })
|
|
8468
|
+
},
|
|
8469
|
+
[
|
|
8470
|
+
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
8471
|
+
withDirectives((openBlock(), createElementBlock(
|
|
8472
|
+
"span",
|
|
8473
|
+
{
|
|
8474
|
+
class: normalizeClass({ "title-memo": _ctx.memo })
|
|
8475
|
+
},
|
|
8476
|
+
[
|
|
8477
|
+
renderSlot(_ctx.$slots, "default")
|
|
8478
|
+
],
|
|
8479
|
+
2
|
|
8480
|
+
/* CLASS */
|
|
8481
|
+
)), [
|
|
8482
|
+
[unref(vBkTooltips), {
|
|
8483
|
+
content: _ctx.memo,
|
|
8484
|
+
disabled: !_ctx.memo
|
|
8485
|
+
}]
|
|
8486
|
+
])
|
|
8487
|
+
])), [
|
|
8488
|
+
[unref(vOverflowTips)]
|
|
8489
|
+
]),
|
|
8490
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
8491
|
+
slots.append && !_ctx.renderAppend ? renderSlot(_ctx.$slots, "append", { key: 0 }) : createCommentVNode("v-if", true),
|
|
8492
|
+
_ctx.renderAppend !== void 0 ? (openBlock(), createBlock(unref(RenderAppendElement), { key: 1 })) : createCommentVNode("v-if", true)
|
|
8493
|
+
])
|
|
8494
|
+
],
|
|
8495
|
+
2
|
|
8496
|
+
/* CLASS */
|
|
8497
|
+
)
|
|
8498
|
+
], 46, _hoisted_1$6);
|
|
8499
|
+
};
|
|
8500
|
+
}
|
|
8501
|
+
});
|
|
8502
|
+
const renderTablekey = Symbol("renderTable");
|
|
8503
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
8504
|
+
__name: "ediatable",
|
|
8505
|
+
props: {
|
|
8506
|
+
theadList: { default: () => [] }
|
|
8507
|
+
},
|
|
8508
|
+
setup(__props) {
|
|
8509
|
+
const slots = useSlots();
|
|
8510
|
+
const checkTableScroll = () => {
|
|
8511
|
+
rowWidth.value = tableRef.value.clientWidth;
|
|
8512
|
+
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
8513
|
+
initColumnWidth();
|
|
8514
|
+
};
|
|
8515
|
+
const tableOuterRef = ref();
|
|
8516
|
+
const tableRef = ref();
|
|
8517
|
+
const tableColumnResizeRef = ref();
|
|
8518
|
+
const isOverflow = ref(false);
|
|
8519
|
+
const rowWidth = ref(0);
|
|
8520
|
+
const isScrollToLeft = ref(true);
|
|
8521
|
+
const isScrollToRight = ref(false);
|
|
8522
|
+
const { initColumnWidth } = useColumnResize(tableOuterRef, tableColumnResizeRef, _.debounce(checkTableScroll));
|
|
8523
|
+
provide(renderTablekey, {
|
|
8524
|
+
isOverflow,
|
|
8525
|
+
rowWidth,
|
|
8526
|
+
isScrollToLeft,
|
|
8527
|
+
isScrollToRight
|
|
8528
|
+
});
|
|
8529
|
+
const handleScroll = _.throttle(() => {
|
|
8530
|
+
isScrollToLeft.value = tableOuterRef.value.scrollLeft === 0;
|
|
8531
|
+
isScrollToRight.value = tableOuterRef.value.scrollWidth - tableOuterRef.value.scrollLeft < tableOuterRef.value.clientWidth + 1;
|
|
8532
|
+
}, 200);
|
|
8533
|
+
onMounted(() => {
|
|
8534
|
+
window.addEventListener("resize", checkTableScroll);
|
|
8535
|
+
checkTableScroll();
|
|
8536
|
+
setTimeout(() => checkTableScroll());
|
|
8537
|
+
tableOuterRef.value.addEventListener("scroll", handleScroll);
|
|
8538
|
+
});
|
|
8539
|
+
onBeforeUnmount(() => {
|
|
8540
|
+
window.removeEventListener("resize", checkTableScroll);
|
|
8541
|
+
tableOuterRef.value.removeEventListener("scroll", handleScroll);
|
|
8542
|
+
});
|
|
8543
|
+
return (_ctx, _cache) => {
|
|
8544
|
+
return openBlock(), createElementBlock(
|
|
8545
|
+
"div",
|
|
8546
|
+
{
|
|
8547
|
+
id: "ediatableRenderTableKey",
|
|
8548
|
+
ref_key: "tableOuterRef",
|
|
8549
|
+
ref: tableOuterRef,
|
|
8550
|
+
class: normalizeClass(["bk-ediatable", { "scrollbar-exists": isOverflow.value }])
|
|
8551
|
+
},
|
|
8552
|
+
[
|
|
8553
|
+
createElementVNode(
|
|
8554
|
+
"table",
|
|
8555
|
+
{
|
|
8556
|
+
ref_key: "tableRef",
|
|
8557
|
+
ref: tableRef
|
|
8558
|
+
},
|
|
8559
|
+
[
|
|
8560
|
+
createElementVNode("thead", null, [
|
|
8561
|
+
createElementVNode("tr", null, [
|
|
8562
|
+
slots.default && _ctx.theadList.length === 0 ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(true), createElementBlock(
|
|
8563
|
+
Fragment,
|
|
8564
|
+
{ key: 1 },
|
|
8565
|
+
renderList(_ctx.theadList, (head, index) => {
|
|
8566
|
+
return openBlock(), createBlock(_sfc_main$9, {
|
|
8567
|
+
key: index,
|
|
8568
|
+
width: head.width,
|
|
8569
|
+
"min-width": head.minWidth,
|
|
8570
|
+
"max-width": head.maxWidth,
|
|
8571
|
+
fixed: head.fixed,
|
|
8572
|
+
required: head.required,
|
|
8573
|
+
"render-append": head.renderAppend,
|
|
8574
|
+
memo: head.memo
|
|
8575
|
+
}, {
|
|
8576
|
+
default: withCtx(() => [
|
|
8577
|
+
createTextVNode(
|
|
8578
|
+
toDisplayString(head.title),
|
|
8579
|
+
1
|
|
8580
|
+
/* TEXT */
|
|
8581
|
+
)
|
|
8582
|
+
]),
|
|
8583
|
+
_: 2
|
|
8584
|
+
/* DYNAMIC */
|
|
8585
|
+
}, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append", "memo"]);
|
|
8586
|
+
}),
|
|
8587
|
+
128
|
|
8588
|
+
/* KEYED_FRAGMENT */
|
|
8589
|
+
))
|
|
8590
|
+
])
|
|
8591
|
+
]),
|
|
8592
|
+
renderSlot(_ctx.$slots, "data")
|
|
8593
|
+
],
|
|
8594
|
+
512
|
|
8595
|
+
/* NEED_PATCH */
|
|
8596
|
+
),
|
|
8597
|
+
createElementVNode(
|
|
8598
|
+
"div",
|
|
8599
|
+
{
|
|
8600
|
+
ref_key: "tableColumnResizeRef",
|
|
8601
|
+
ref: tableColumnResizeRef,
|
|
8602
|
+
class: "table-column-resize"
|
|
8603
|
+
},
|
|
8604
|
+
null,
|
|
8605
|
+
512
|
|
8606
|
+
/* NEED_PATCH */
|
|
8607
|
+
)
|
|
8608
|
+
],
|
|
8609
|
+
2
|
|
8610
|
+
/* CLASS */
|
|
8611
|
+
);
|
|
8612
|
+
};
|
|
8613
|
+
}
|
|
8614
|
+
});
|
|
8615
|
+
const getRuleMessage = (rule) => {
|
|
8616
|
+
if (typeof rule.message === "function") {
|
|
8617
|
+
return rule.message();
|
|
8618
|
+
}
|
|
8619
|
+
return rule.message;
|
|
8620
|
+
};
|
|
8621
|
+
function useValidtor(rules) {
|
|
8622
|
+
const state = reactive({
|
|
8623
|
+
loading: false,
|
|
8624
|
+
error: false,
|
|
8625
|
+
message: ""
|
|
8626
|
+
});
|
|
8627
|
+
const validator = (targetValue) => {
|
|
8628
|
+
state.error = false, state.message = "";
|
|
8629
|
+
if (!rules) {
|
|
8630
|
+
return Promise.resolve(true);
|
|
8631
|
+
}
|
|
8632
|
+
const run = /* @__PURE__ */ (() => {
|
|
8633
|
+
let stepIndex = -1;
|
|
8634
|
+
return async () => {
|
|
8635
|
+
stepIndex = stepIndex + 1;
|
|
8636
|
+
if (stepIndex >= rules.length) {
|
|
8637
|
+
return Promise.resolve(true);
|
|
8638
|
+
}
|
|
8639
|
+
const rule = rules[stepIndex];
|
|
8640
|
+
return Promise.resolve().then(() => {
|
|
8641
|
+
const result = rule.validator(targetValue);
|
|
8642
|
+
if (typeof result !== "boolean" && typeof result.then === "function") {
|
|
8643
|
+
return result.then((data) => {
|
|
8644
|
+
if (data === false) {
|
|
8645
|
+
return Promise.reject(getRuleMessage(rule));
|
|
8646
|
+
}
|
|
8647
|
+
}).then(() => run(), () => {
|
|
8648
|
+
state.error = true;
|
|
8649
|
+
const message = getRuleMessage(rule);
|
|
8650
|
+
state.message = message;
|
|
8651
|
+
return Promise.reject(message);
|
|
8652
|
+
});
|
|
8653
|
+
}
|
|
8654
|
+
if (!result) {
|
|
8655
|
+
state.error = true;
|
|
8656
|
+
const message = getRuleMessage(rule);
|
|
8657
|
+
state.message = message;
|
|
8658
|
+
return Promise.reject(message);
|
|
8659
|
+
}
|
|
8660
|
+
return run();
|
|
8661
|
+
});
|
|
8662
|
+
};
|
|
8663
|
+
})();
|
|
8664
|
+
return run();
|
|
8665
|
+
};
|
|
8666
|
+
return {
|
|
8667
|
+
...toRefs(state),
|
|
8668
|
+
validator
|
|
8669
|
+
};
|
|
8670
|
+
}
|
|
8671
|
+
const DbIcon = defineComponent({
|
|
8672
|
+
name: "DbIcon",
|
|
8673
|
+
props: {
|
|
8674
|
+
type: {
|
|
8675
|
+
type: String,
|
|
8676
|
+
required: true
|
|
8677
|
+
},
|
|
8678
|
+
svg: {
|
|
8679
|
+
type: Boolean,
|
|
8680
|
+
default: false
|
|
8681
|
+
}
|
|
8682
|
+
},
|
|
8683
|
+
render() {
|
|
8684
|
+
if (this.svg) {
|
|
8685
|
+
return h(
|
|
8686
|
+
"svg",
|
|
8687
|
+
{
|
|
8688
|
+
class: {
|
|
8689
|
+
"db-svg-icon": true
|
|
8690
|
+
}
|
|
8691
|
+
},
|
|
8692
|
+
[
|
|
8693
|
+
h("use", {
|
|
8694
|
+
"xlink:href": `#db-icon-${this.type}`
|
|
8695
|
+
})
|
|
8696
|
+
]
|
|
8697
|
+
);
|
|
8698
|
+
}
|
|
8699
|
+
const classes = {
|
|
8700
|
+
"ediatable-icon": true,
|
|
8701
|
+
[`icon-${this.type}`]: true
|
|
8702
|
+
};
|
|
8703
|
+
return h("i", {
|
|
8704
|
+
class: classes
|
|
8705
|
+
});
|
|
8706
|
+
}
|
|
8707
|
+
});
|
|
8708
|
+
const _hoisted_1$5 = {
|
|
8709
|
+
key: 0,
|
|
8710
|
+
class: "input-error"
|
|
8711
|
+
};
|
|
8712
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
8713
|
+
__name: "date-time-picker-column",
|
|
8714
|
+
props: /* @__PURE__ */ mergeModels({
|
|
8715
|
+
placeholder: { default: "" },
|
|
8716
|
+
rules: { default: void 0 },
|
|
8717
|
+
type: { default: void 0 },
|
|
8718
|
+
disabled: { type: Boolean, default: false },
|
|
8719
|
+
clearable: { type: Boolean, default: true }
|
|
8720
|
+
}, {
|
|
8721
|
+
"modelValue": {},
|
|
8722
|
+
"modelModifiers": {}
|
|
8723
|
+
}),
|
|
8724
|
+
emits: /* @__PURE__ */ mergeModels(["change", "error"], ["update:modelValue"]),
|
|
8725
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8726
|
+
const props = __props;
|
|
8727
|
+
const emits = __emit;
|
|
8728
|
+
const modelValue = useModel(__props, "modelValue");
|
|
8729
|
+
const attrs = useAttrs();
|
|
8730
|
+
const slots = useSlots();
|
|
8731
|
+
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
8732
|
+
const vBkTooltips = bkTooltips;
|
|
8733
|
+
const handleChange = (value) => {
|
|
8734
|
+
modelValue.value = value;
|
|
8735
|
+
validator(value).then(() => {
|
|
8736
|
+
emits("error", false);
|
|
8737
|
+
emits("change", modelValue.value);
|
|
8738
|
+
}).catch(() => emits("error", true));
|
|
8739
|
+
};
|
|
8740
|
+
const handleOpenChange = (open) => {
|
|
8741
|
+
if (!open) {
|
|
8742
|
+
validator(modelValue.value).then(() => {
|
|
8743
|
+
emits("error", false);
|
|
8744
|
+
}).catch(() => emits("error", true));
|
|
8745
|
+
}
|
|
8746
|
+
};
|
|
8747
|
+
__expose({
|
|
8748
|
+
getValue() {
|
|
8749
|
+
return validator(modelValue.value).then(() => modelValue.value);
|
|
8750
|
+
}
|
|
8751
|
+
});
|
|
8752
|
+
return (_ctx, _cache) => {
|
|
8753
|
+
return openBlock(), createElementBlock(
|
|
8754
|
+
"div",
|
|
8755
|
+
{
|
|
8756
|
+
class: normalizeClass(["bk-ediatable-time-picker", {
|
|
8757
|
+
"is-error": Boolean(unref(errorMessage)),
|
|
8758
|
+
"is-disabled": _ctx.disabled
|
|
8759
|
+
}])
|
|
8760
|
+
},
|
|
8761
|
+
[
|
|
8762
|
+
createVNode(unref(DatePicker), mergeProps({
|
|
8763
|
+
style: { "width": "100%" },
|
|
8764
|
+
clearable: _ctx.clearable,
|
|
8765
|
+
"model-value": modelValue.value,
|
|
8766
|
+
placeholder: _ctx.placeholder,
|
|
8767
|
+
type: _ctx.type,
|
|
8768
|
+
"append-to-body": ""
|
|
8769
|
+
}, unref(attrs), {
|
|
8770
|
+
onChange: handleChange,
|
|
8771
|
+
onOpenChange: handleOpenChange
|
|
8772
|
+
}), createSlots({
|
|
8773
|
+
_: 2
|
|
8774
|
+
/* DYNAMIC */
|
|
8775
|
+
}, [
|
|
8776
|
+
unref(slots).footer ? {
|
|
8777
|
+
name: "footer",
|
|
8778
|
+
fn: withCtx(() => [
|
|
8779
|
+
renderSlot(_ctx.$slots, "footer")
|
|
8780
|
+
]),
|
|
8781
|
+
key: "0"
|
|
8782
|
+
} : void 0
|
|
8783
|
+
]), 1040, ["clearable", "model-value", "placeholder", "type"]),
|
|
8784
|
+
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
8785
|
+
withDirectives(createVNode(
|
|
8786
|
+
unref(DbIcon),
|
|
8787
|
+
{ type: "exclamation-fill" },
|
|
8788
|
+
null,
|
|
8789
|
+
512
|
|
8790
|
+
/* NEED_PATCH */
|
|
8791
|
+
), [
|
|
8792
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
8793
|
+
])
|
|
8794
|
+
])) : createCommentVNode("v-if", true)
|
|
8795
|
+
],
|
|
8796
|
+
2
|
|
8797
|
+
/* CLASS */
|
|
8798
|
+
);
|
|
8799
|
+
};
|
|
8800
|
+
}
|
|
8801
|
+
});
|
|
8802
|
+
const _hoisted_1$4 = {
|
|
8803
|
+
key: 2,
|
|
8804
|
+
class: "blur-dispaly-main"
|
|
8805
|
+
};
|
|
8806
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
8807
|
+
__name: "input-column",
|
|
8808
|
+
props: /* @__PURE__ */ mergeModels({
|
|
8809
|
+
placeholder: { default: "请输入" },
|
|
8810
|
+
rules: { default: void 0 },
|
|
8811
|
+
disabled: { type: Boolean, default: false },
|
|
8812
|
+
type: { default: "text" },
|
|
8813
|
+
min: { default: Number.MIN_SAFE_INTEGER },
|
|
8814
|
+
max: { default: Number.MAX_SAFE_INTEGER },
|
|
8815
|
+
isShowBlur: { type: Boolean, default: false },
|
|
8816
|
+
precision: { default: 0 },
|
|
8817
|
+
maxlength: {},
|
|
8818
|
+
clearable: { type: Boolean, default: true }
|
|
8819
|
+
}, {
|
|
8820
|
+
"modelValue": {
|
|
8821
|
+
default: ""
|
|
8822
|
+
},
|
|
8823
|
+
"modelModifiers": {}
|
|
8824
|
+
}),
|
|
8825
|
+
emits: /* @__PURE__ */ mergeModels(["submit", "error", "clear", "focus"], ["update:modelValue"]),
|
|
8826
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8827
|
+
const props = __props;
|
|
8828
|
+
const emits = __emit;
|
|
8829
|
+
const modelValue = useModel(__props, "modelValue");
|
|
8830
|
+
const rootRef = ref();
|
|
8831
|
+
const isBlur = ref(true);
|
|
8832
|
+
const isPassword = computed(() => props.type === "password");
|
|
8833
|
+
let oldInputText = "";
|
|
8834
|
+
const vBkTooltips = bkTooltips;
|
|
8835
|
+
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
8836
|
+
const handleFocus = () => {
|
|
8837
|
+
isBlur.value = false;
|
|
8838
|
+
emits("focus");
|
|
8839
|
+
};
|
|
8840
|
+
const handleChange = (value) => {
|
|
8841
|
+
isBlur.value = true;
|
|
8842
|
+
modelValue.value = props.type === "number" ? Number(value) : value;
|
|
8843
|
+
if (props.type === "number") {
|
|
8844
|
+
validator(modelValue.value).then(() => {
|
|
8845
|
+
emits("error", false);
|
|
8846
|
+
emits("submit", value);
|
|
8847
|
+
}).catch(() => emits("error", true));
|
|
8848
|
+
}
|
|
8849
|
+
};
|
|
8850
|
+
const handleClear = () => {
|
|
8851
|
+
modelValue.value = "";
|
|
8852
|
+
validator("").catch(() => emits("error", true)).finally(() => {
|
|
8853
|
+
emits("clear");
|
|
8854
|
+
});
|
|
8855
|
+
};
|
|
8856
|
+
const handleInput = (value) => {
|
|
8857
|
+
isBlur.value = false;
|
|
8858
|
+
modelValue.value = value;
|
|
8859
|
+
};
|
|
8860
|
+
const handleBlur = (event) => {
|
|
8861
|
+
setTimeout(() => {
|
|
8862
|
+
isBlur.value = true;
|
|
8863
|
+
if (props.disabled) {
|
|
8864
|
+
event.preventDefault();
|
|
8865
|
+
return;
|
|
8866
|
+
}
|
|
8867
|
+
if (modelValue.value) {
|
|
8868
|
+
if (oldInputText === modelValue.value) {
|
|
8869
|
+
return;
|
|
8870
|
+
}
|
|
8871
|
+
oldInputText = modelValue.value;
|
|
8872
|
+
validator(modelValue.value).then(() => {
|
|
8873
|
+
emits("error", false);
|
|
8874
|
+
emits("submit", modelValue.value);
|
|
8875
|
+
}).catch(() => emits("error", true));
|
|
8876
|
+
return;
|
|
8877
|
+
}
|
|
8878
|
+
emits("submit", modelValue.value);
|
|
8879
|
+
}, 100);
|
|
8880
|
+
};
|
|
8881
|
+
const handleKeydown = (_value, event) => {
|
|
8882
|
+
if (props.disabled) {
|
|
8883
|
+
event.preventDefault();
|
|
8884
|
+
return;
|
|
8885
|
+
}
|
|
8886
|
+
if (event.isComposing) {
|
|
8887
|
+
return;
|
|
8888
|
+
}
|
|
8889
|
+
if (event.which === 13 || event.key === "Enter") {
|
|
8890
|
+
if (oldInputText === modelValue.value) {
|
|
8891
|
+
return;
|
|
8892
|
+
}
|
|
8893
|
+
oldInputText = modelValue.value;
|
|
8894
|
+
event.preventDefault();
|
|
8895
|
+
validator(modelValue.value).then((result) => {
|
|
8896
|
+
if (result) {
|
|
8897
|
+
emits("error", false);
|
|
8898
|
+
emits("submit", modelValue.value);
|
|
8899
|
+
}
|
|
8900
|
+
}).catch(() => emits("error", true));
|
|
8901
|
+
}
|
|
8902
|
+
};
|
|
8903
|
+
__expose({
|
|
8904
|
+
getValue() {
|
|
8905
|
+
return validator(modelValue.value).then(() => modelValue.value);
|
|
8906
|
+
},
|
|
8907
|
+
focus() {
|
|
8908
|
+
var _a;
|
|
8909
|
+
(_a = rootRef.value.querySelector("input")) == null ? void 0 : _a.focus();
|
|
8910
|
+
}
|
|
8911
|
+
});
|
|
8912
|
+
return (_ctx, _cache) => {
|
|
8913
|
+
return openBlock(), createElementBlock(
|
|
8914
|
+
"div",
|
|
8915
|
+
{
|
|
8916
|
+
ref_key: "rootRef",
|
|
8917
|
+
ref: rootRef,
|
|
8918
|
+
class: normalizeClass(["bk-ediatable-input", {
|
|
8919
|
+
"is-error": Boolean(unref(errorMessage)),
|
|
8920
|
+
"is-disabled": _ctx.disabled,
|
|
8921
|
+
"is-password": isPassword.value
|
|
8922
|
+
}])
|
|
8923
|
+
},
|
|
8924
|
+
[
|
|
8925
|
+
createVNode(unref(Input), mergeProps({
|
|
8926
|
+
class: "input-box",
|
|
8927
|
+
clearable: false,
|
|
8928
|
+
disabled: _ctx.disabled,
|
|
8929
|
+
max: _ctx.max,
|
|
8930
|
+
maxlength: _ctx.maxlength,
|
|
8931
|
+
min: _ctx.min,
|
|
8932
|
+
"model-value": modelValue.value,
|
|
8933
|
+
placeholder: _ctx.placeholder,
|
|
8934
|
+
type: _ctx.type
|
|
8935
|
+
}, _ctx.$attrs, {
|
|
8936
|
+
precision: _ctx.precision,
|
|
8937
|
+
onBlur: handleBlur,
|
|
8938
|
+
onChange: handleChange,
|
|
8939
|
+
onFocus: handleFocus,
|
|
8940
|
+
onInput: handleInput,
|
|
8941
|
+
onKeydown: handleKeydown
|
|
8942
|
+
}), null, 16, ["disabled", "max", "maxlength", "min", "model-value", "placeholder", "type", "precision"]),
|
|
8943
|
+
_ctx.clearable && modelValue.value && _ctx.type !== "number" ? (openBlock(), createBlock(unref(DbIcon), {
|
|
8944
|
+
key: 0,
|
|
8945
|
+
class: "clear-icon",
|
|
8946
|
+
type: "close-circle-shape",
|
|
8947
|
+
onClick: handleClear
|
|
8948
|
+
})) : createCommentVNode("v-if", true),
|
|
8949
|
+
unref(errorMessage) ? withDirectives((openBlock(), createBlock(
|
|
8950
|
+
unref(DbIcon),
|
|
8951
|
+
{
|
|
8952
|
+
key: 1,
|
|
8953
|
+
class: "error-icon",
|
|
8954
|
+
type: "exclamation-fill"
|
|
8955
|
+
},
|
|
8956
|
+
null,
|
|
8957
|
+
512
|
|
8958
|
+
/* NEED_PATCH */
|
|
8959
|
+
)), [
|
|
8960
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
8961
|
+
]) : createCommentVNode("v-if", true),
|
|
8962
|
+
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
8963
|
+
renderSlot(_ctx.$slots, "blur")
|
|
8964
|
+
])) : createCommentVNode("v-if", true)
|
|
8965
|
+
],
|
|
8966
|
+
2
|
|
8967
|
+
/* CLASS */
|
|
8968
|
+
);
|
|
8969
|
+
};
|
|
8970
|
+
}
|
|
8971
|
+
});
|
|
8972
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
8973
|
+
__name: "fixed-column",
|
|
8974
|
+
props: {
|
|
8975
|
+
fixed: { default: "right" }
|
|
8976
|
+
},
|
|
8977
|
+
setup(__props) {
|
|
8978
|
+
const props = __props;
|
|
8979
|
+
const { isOverflow: isFixed, isScrollToLeft, isScrollToRight } = inject(renderTablekey);
|
|
8980
|
+
const isFixedRight = computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "right" && !isScrollToRight.value);
|
|
8981
|
+
const isFixedLeft = computed(() => (isFixed == null ? void 0 : isFixed.value) && props.fixed === "left" && !isScrollToLeft.value);
|
|
8982
|
+
return (_ctx, _cache) => {
|
|
8983
|
+
return openBlock(), createElementBlock(
|
|
8984
|
+
"td",
|
|
8985
|
+
{
|
|
8986
|
+
class: normalizeClass({
|
|
8987
|
+
"bk-ediatable-right-fixed-column": isFixedRight.value,
|
|
8988
|
+
"bk-ediatable-left-fixed-column": isFixedLeft.value
|
|
8989
|
+
})
|
|
8990
|
+
},
|
|
8991
|
+
[
|
|
8992
|
+
renderSlot(_ctx.$slots, "default")
|
|
8993
|
+
],
|
|
8994
|
+
2
|
|
8995
|
+
/* CLASS */
|
|
8996
|
+
);
|
|
8997
|
+
};
|
|
8998
|
+
}
|
|
8999
|
+
});
|
|
9000
|
+
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
9001
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
9002
|
+
__name: "operation-column",
|
|
9003
|
+
props: {
|
|
9004
|
+
removeable: { type: Boolean, default: true },
|
|
9005
|
+
showCopy: { type: Boolean, default: false },
|
|
9006
|
+
showAdd: { type: Boolean, default: true },
|
|
9007
|
+
showRemove: { type: Boolean, default: true }
|
|
9008
|
+
},
|
|
9009
|
+
emits: ["add", "copy", "remove"],
|
|
9010
|
+
setup(__props, { emit: __emit }) {
|
|
9011
|
+
const props = __props;
|
|
9012
|
+
const emits = __emit;
|
|
9013
|
+
const handleCopy = () => {
|
|
9014
|
+
emits("copy");
|
|
9015
|
+
};
|
|
9016
|
+
const handleAppend = () => {
|
|
9017
|
+
emits("add");
|
|
9018
|
+
};
|
|
9019
|
+
const handleRemove = () => {
|
|
9020
|
+
if (!props.removeable) {
|
|
9021
|
+
return;
|
|
9022
|
+
}
|
|
9023
|
+
emits("remove");
|
|
9024
|
+
};
|
|
9025
|
+
return (_ctx, _cache) => {
|
|
9026
|
+
return openBlock(), createBlock(_sfc_main$5, null, {
|
|
9027
|
+
default: withCtx(() => [
|
|
9028
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
9029
|
+
_ctx.showCopy ? (openBlock(), createElementBlock("div", {
|
|
9030
|
+
key: 0,
|
|
9031
|
+
class: "action-btn",
|
|
9032
|
+
onClick: handleCopy
|
|
9033
|
+
}, [
|
|
9034
|
+
createVNode(unref(DbIcon), { type: "copy" })
|
|
9035
|
+
])) : createCommentVNode("v-if", true),
|
|
9036
|
+
_ctx.showAdd ? (openBlock(), createElementBlock("div", {
|
|
9037
|
+
key: 1,
|
|
9038
|
+
class: "action-btn",
|
|
9039
|
+
onClick: handleAppend
|
|
9040
|
+
}, [
|
|
9041
|
+
createVNode(unref(DbIcon), { type: "plus-fill" })
|
|
9042
|
+
])) : createCommentVNode("v-if", true),
|
|
9043
|
+
_ctx.showRemove ? (openBlock(), createElementBlock(
|
|
9044
|
+
"div",
|
|
9045
|
+
{
|
|
9046
|
+
key: 2,
|
|
9047
|
+
class: normalizeClass(["action-btn", {
|
|
9048
|
+
disabled: !_ctx.removeable
|
|
9049
|
+
}]),
|
|
9050
|
+
onClick: handleRemove
|
|
9051
|
+
},
|
|
9052
|
+
[
|
|
9053
|
+
createVNode(unref(DbIcon), { type: "minus-fill" })
|
|
9054
|
+
],
|
|
9055
|
+
2
|
|
9056
|
+
/* CLASS */
|
|
9057
|
+
)) : createCommentVNode("v-if", true)
|
|
9058
|
+
])
|
|
9059
|
+
]),
|
|
9060
|
+
_: 1
|
|
9061
|
+
/* STABLE */
|
|
9062
|
+
});
|
|
9063
|
+
};
|
|
9064
|
+
}
|
|
9065
|
+
});
|
|
9066
|
+
const _hoisted_1$2 = {
|
|
9067
|
+
key: 0,
|
|
9068
|
+
class: "select-error"
|
|
9069
|
+
};
|
|
9070
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
9071
|
+
__name: "select-column",
|
|
9072
|
+
props: /* @__PURE__ */ mergeModels({
|
|
9073
|
+
list: { default: () => [] },
|
|
9074
|
+
placeholder: { default: "请选择" },
|
|
9075
|
+
rules: { default: () => [] },
|
|
9076
|
+
disabled: { type: Boolean, default: false },
|
|
9077
|
+
multiple: { type: Boolean, default: false },
|
|
9078
|
+
multipleMode: { default: void 0 },
|
|
9079
|
+
showSelectAll: { type: Boolean, default: false },
|
|
9080
|
+
clearable: { type: Boolean, default: true },
|
|
9081
|
+
displayKey: { default: "label" },
|
|
9082
|
+
idKey: { default: "value" }
|
|
9083
|
+
}, {
|
|
9084
|
+
"modelValue": { type: [Boolean, Number, String, Array] },
|
|
9085
|
+
"modelModifiers": {}
|
|
9086
|
+
}),
|
|
9087
|
+
emits: /* @__PURE__ */ mergeModels(["change", "error"], ["update:modelValue"]),
|
|
9088
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9089
|
+
const { Option } = Select;
|
|
9090
|
+
const slots = useSlots();
|
|
9091
|
+
const props = __props;
|
|
9092
|
+
const emits = __emit;
|
|
9093
|
+
const modelValue = useModel(__props, "modelValue");
|
|
9094
|
+
const rootRef = ref();
|
|
9095
|
+
const localValue = ref("");
|
|
9096
|
+
const rootHeight = ref(42);
|
|
9097
|
+
const isOverflowVisible = computed(() => props.multipleMode === "tag");
|
|
9098
|
+
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
9099
|
+
const vBkTooltips = bkTooltips;
|
|
9100
|
+
watch(
|
|
9101
|
+
modelValue,
|
|
9102
|
+
(value) => {
|
|
9103
|
+
if (value === void 0) {
|
|
9104
|
+
return;
|
|
9105
|
+
}
|
|
9106
|
+
localValue.value = value;
|
|
9107
|
+
if (typeof value !== "object" && value) {
|
|
9108
|
+
validator(value).then(() => {
|
|
9109
|
+
emits("error", false);
|
|
9110
|
+
}).catch(() => emits("error", true));
|
|
9111
|
+
return;
|
|
9112
|
+
}
|
|
9113
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
9114
|
+
validator(value).then(() => {
|
|
9115
|
+
emits("error", false);
|
|
9116
|
+
}).catch(() => emits("error", true));
|
|
9117
|
+
return;
|
|
9118
|
+
}
|
|
9119
|
+
},
|
|
9120
|
+
{
|
|
9121
|
+
immediate: true
|
|
9122
|
+
}
|
|
9123
|
+
);
|
|
9124
|
+
const handleSelect = (value) => {
|
|
9125
|
+
localValue.value = value;
|
|
9126
|
+
validator(localValue.value).then(() => {
|
|
9127
|
+
modelValue.value = value;
|
|
9128
|
+
emits("error", false);
|
|
9129
|
+
emits("change", localValue.value);
|
|
9130
|
+
}).catch(() => emits("error", true));
|
|
9131
|
+
};
|
|
9132
|
+
const handleRemove = () => {
|
|
9133
|
+
localValue.value = Array.isArray(localValue.value) ? [] : "";
|
|
9134
|
+
validator(localValue.value).then(() => {
|
|
9135
|
+
modelValue.value = localValue.value;
|
|
9136
|
+
emits("error", false);
|
|
9137
|
+
emits("change", localValue.value);
|
|
9138
|
+
}).catch(() => emits("error", true));
|
|
9139
|
+
};
|
|
9140
|
+
const checkRootHeight = () => {
|
|
9141
|
+
rootHeight.value = rootRef.value.parentNode.clientHeight;
|
|
9142
|
+
};
|
|
9143
|
+
useResizeObserver(rootRef, _.throttle(checkRootHeight, 500));
|
|
9144
|
+
__expose({
|
|
9145
|
+
getValue() {
|
|
9146
|
+
return validator(localValue.value).then(() => localValue.value);
|
|
8859
9147
|
}
|
|
8860
|
-
} else {
|
|
8861
|
-
instance.unmount();
|
|
8862
|
-
}
|
|
8863
|
-
}
|
|
8864
|
-
function hideWithInteractivity(event) {
|
|
8865
|
-
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
|
8866
|
-
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
|
8867
|
-
debouncedOnMouseMove(event);
|
|
8868
|
-
}
|
|
8869
|
-
function unmount() {
|
|
8870
|
-
if (instance.state.isVisible) {
|
|
8871
|
-
instance.hide();
|
|
8872
|
-
}
|
|
8873
|
-
if (!instance.state.isMounted) {
|
|
8874
|
-
return;
|
|
8875
|
-
}
|
|
8876
|
-
destroyPopperInstance();
|
|
8877
|
-
getNestedPopperTree().forEach(function(nestedPopper) {
|
|
8878
|
-
nestedPopper._tippy.unmount();
|
|
8879
|
-
});
|
|
8880
|
-
if (popper2.parentNode) {
|
|
8881
|
-
popper2.parentNode.removeChild(popper2);
|
|
8882
|
-
}
|
|
8883
|
-
mountedInstances = mountedInstances.filter(function(i) {
|
|
8884
|
-
return i !== instance;
|
|
8885
9148
|
});
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
9149
|
+
return (_ctx, _cache) => {
|
|
9150
|
+
return openBlock(), createElementBlock(
|
|
9151
|
+
"div",
|
|
9152
|
+
{
|
|
9153
|
+
ref_key: "rootRef",
|
|
9154
|
+
ref: rootRef,
|
|
9155
|
+
style: normalizeStyle({ height: rootHeight.value + "px" }),
|
|
9156
|
+
class: normalizeClass(["bk-ediatable-select", {
|
|
9157
|
+
"is-error": Boolean(unref(errorMessage)),
|
|
9158
|
+
"is-disable": _ctx.disabled,
|
|
9159
|
+
"is-overflow-visible": isOverflowVisible.value
|
|
9160
|
+
}])
|
|
9161
|
+
},
|
|
9162
|
+
[
|
|
9163
|
+
createVNode(unref(Select), mergeProps({
|
|
9164
|
+
class: "select-box",
|
|
9165
|
+
clearable: _ctx.clearable,
|
|
9166
|
+
disabled: _ctx.disabled,
|
|
9167
|
+
"display-key": _ctx.displayKey,
|
|
9168
|
+
"id-key": _ctx.idKey,
|
|
9169
|
+
"input-search": false,
|
|
9170
|
+
list: slots.optionRender ? _ctx.list : [],
|
|
9171
|
+
"model-value": localValue.value,
|
|
9172
|
+
multiple: _ctx.multiple,
|
|
9173
|
+
"multiple-mode": _ctx.multipleMode,
|
|
9174
|
+
placeholder: _ctx.placeholder,
|
|
9175
|
+
"show-select-all": _ctx.showSelectAll,
|
|
9176
|
+
"auto-focus": "",
|
|
9177
|
+
filterable: ""
|
|
9178
|
+
}, _ctx.$attrs, {
|
|
9179
|
+
onChange: handleSelect,
|
|
9180
|
+
onClear: handleRemove
|
|
9181
|
+
}), createSlots({
|
|
9182
|
+
default: withCtx(() => [
|
|
9183
|
+
!slots.optionRender ? (openBlock(true), createElementBlock(
|
|
9184
|
+
Fragment,
|
|
9185
|
+
{ key: 0 },
|
|
9186
|
+
renderList(_ctx.list, (item, index) => {
|
|
9187
|
+
return openBlock(), createBlock(unref(Option), {
|
|
9188
|
+
disabled: item.disabled,
|
|
9189
|
+
key: index,
|
|
9190
|
+
label: item[_ctx.displayKey],
|
|
9191
|
+
value: item[_ctx.idKey]
|
|
9192
|
+
}, null, 8, ["disabled", "label", "value"]);
|
|
9193
|
+
}),
|
|
9194
|
+
128
|
|
9195
|
+
/* KEYED_FRAGMENT */
|
|
9196
|
+
)) : createCommentVNode("v-if", true)
|
|
9197
|
+
]),
|
|
9198
|
+
_: 2
|
|
9199
|
+
/* DYNAMIC */
|
|
9200
|
+
}, [
|
|
9201
|
+
slots.optionRender ? {
|
|
9202
|
+
name: "optionRender",
|
|
9203
|
+
fn: withCtx(({ item }) => [
|
|
9204
|
+
renderSlot(_ctx.$slots, "optionRender", { item })
|
|
9205
|
+
]),
|
|
9206
|
+
key: "0"
|
|
9207
|
+
} : void 0
|
|
9208
|
+
]), 1040, ["clearable", "disabled", "display-key", "id-key", "list", "model-value", "multiple", "multiple-mode", "placeholder", "show-select-all"]),
|
|
9209
|
+
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
9210
|
+
withDirectives(createVNode(
|
|
9211
|
+
unref(DbIcon),
|
|
9212
|
+
{ type: "exclamation-fill" },
|
|
9213
|
+
null,
|
|
9214
|
+
512
|
|
9215
|
+
/* NEED_PATCH */
|
|
9216
|
+
), [
|
|
9217
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
9218
|
+
])
|
|
9219
|
+
])) : createCommentVNode("v-if", true)
|
|
9220
|
+
],
|
|
9221
|
+
6
|
|
9222
|
+
/* CLASS, STYLE */
|
|
9223
|
+
);
|
|
8937
9224
|
};
|
|
8938
|
-
Object.assign(state.elements.popper.style, initialStyles.popper);
|
|
8939
|
-
state.styles = initialStyles;
|
|
8940
|
-
if (state.elements.arrow) {
|
|
8941
|
-
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
|
8942
|
-
}
|
|
8943
9225
|
}
|
|
8944
9226
|
});
|
|
8945
|
-
tippy.setDefaultProps({
|
|
8946
|
-
render
|
|
8947
|
-
});
|
|
8948
9227
|
const _hoisted_1$1 = {
|
|
8949
9228
|
key: 0,
|
|
8950
9229
|
class: "input-error"
|
|
8951
9230
|
};
|
|
8952
|
-
const _hoisted_2$1 = {
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
};
|
|
8956
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8957
|
-
__name: "tag-input",
|
|
9231
|
+
const _hoisted_2$1 = { style: { "display": "none" } };
|
|
9232
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
9233
|
+
__name: "tag-input-column",
|
|
8958
9234
|
props: /* @__PURE__ */ mergeModels({
|
|
8959
9235
|
placeholder: { default: "" },
|
|
8960
9236
|
single: { type: Boolean, default: false },
|
|
8961
9237
|
rules: { default: void 0 },
|
|
8962
|
-
|
|
9238
|
+
clearable: { type: Boolean, default: true }
|
|
8963
9239
|
}, {
|
|
8964
9240
|
"modelValue": {},
|
|
8965
9241
|
"modelModifiers": {}
|
|
8966
9242
|
}),
|
|
8967
|
-
emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
|
|
9243
|
+
emits: /* @__PURE__ */ mergeModels(["change", "error"], ["update:modelValue"]),
|
|
8968
9244
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
8969
9245
|
const props = __props;
|
|
8970
9246
|
const emits = __emit;
|
|
8971
9247
|
const modelValue = useModel(__props, "modelValue");
|
|
9248
|
+
const slots = useSlots();
|
|
8972
9249
|
const rootRef = ref();
|
|
8973
9250
|
const popRef = ref();
|
|
8974
9251
|
const isFocus = ref(false);
|
|
8975
9252
|
let tippyIns;
|
|
9253
|
+
const vBkTooltips = bkTooltips;
|
|
8976
9254
|
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
8977
9255
|
const tagInputPasteFn = (value) => value.split("\n").map((item) => ({ id: item }));
|
|
8978
9256
|
const handleChange = (value) => {
|
|
8979
9257
|
modelValue.value = value;
|
|
8980
9258
|
nextTick(() => {
|
|
8981
9259
|
validator(modelValue.value).then(() => {
|
|
9260
|
+
emits("error", false);
|
|
8982
9261
|
emits("change", value);
|
|
8983
|
-
});
|
|
9262
|
+
}).catch(() => emits("error", true));
|
|
8984
9263
|
});
|
|
8985
9264
|
};
|
|
8986
9265
|
const handleShowTips = () => {
|
|
@@ -8993,25 +9272,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
8993
9272
|
isFocus.value = false;
|
|
8994
9273
|
};
|
|
8995
9274
|
onMounted(() => {
|
|
8996
|
-
if (
|
|
8997
|
-
|
|
9275
|
+
if (slots.tip) {
|
|
9276
|
+
tippyIns = tippy(rootRef.value, {
|
|
9277
|
+
content: popRef.value,
|
|
9278
|
+
placement: "top",
|
|
9279
|
+
appendTo: () => document.body,
|
|
9280
|
+
theme: "light",
|
|
9281
|
+
maxWidth: "none",
|
|
9282
|
+
trigger: "manual",
|
|
9283
|
+
interactive: true,
|
|
9284
|
+
arrow: true,
|
|
9285
|
+
offset: [0, 18],
|
|
9286
|
+
zIndex: 9998,
|
|
9287
|
+
hideOnClick: true
|
|
9288
|
+
});
|
|
8998
9289
|
}
|
|
8999
|
-
tippyIns = tippy(rootRef.value, {
|
|
9000
|
-
content: popRef.value,
|
|
9001
|
-
placement: "top",
|
|
9002
|
-
appendTo: () => document.body,
|
|
9003
|
-
theme: "light",
|
|
9004
|
-
maxWidth: "none",
|
|
9005
|
-
trigger: "manual",
|
|
9006
|
-
interactive: true,
|
|
9007
|
-
arrow: true,
|
|
9008
|
-
offset: [0, 18],
|
|
9009
|
-
zIndex: 9998,
|
|
9010
|
-
hideOnClick: true
|
|
9011
|
-
});
|
|
9012
9290
|
});
|
|
9013
9291
|
onBeforeUnmount(() => {
|
|
9014
|
-
if (tippyIns) {
|
|
9292
|
+
if (slots.tip && tippyIns) {
|
|
9015
9293
|
tippyIns.hide();
|
|
9016
9294
|
tippyIns.unmount();
|
|
9017
9295
|
tippyIns.destroy();
|
|
@@ -9024,7 +9302,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9024
9302
|
}
|
|
9025
9303
|
});
|
|
9026
9304
|
return (_ctx, _cache) => {
|
|
9027
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
9028
9305
|
return openBlock(), createElementBlock(
|
|
9029
9306
|
"div",
|
|
9030
9307
|
{
|
|
@@ -9040,11 +9317,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9040
9317
|
class: normalizeClass(["bk-ediatable-tag-input", { ["is-error"]: Boolean(unref(errorMessage)) }])
|
|
9041
9318
|
},
|
|
9042
9319
|
[
|
|
9043
|
-
createVNode(unref(TagInput), {
|
|
9044
|
-
"model-value": modelValue.value,
|
|
9320
|
+
createVNode(unref(TagInput), mergeProps({ "model-value": modelValue.value }, _ctx.$attrs, {
|
|
9045
9321
|
"allow-auto-match": "",
|
|
9046
9322
|
"allow-create": "",
|
|
9047
|
-
clearable:
|
|
9323
|
+
clearable: _ctx.clearable,
|
|
9048
9324
|
"collapse-tags": "",
|
|
9049
9325
|
"has-delete-icon": "",
|
|
9050
9326
|
"max-data": _ctx.single ? 1 : -1,
|
|
@@ -9053,7 +9329,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9053
9329
|
onBlur: handleBlur,
|
|
9054
9330
|
onChange: handleChange,
|
|
9055
9331
|
onFocus: handleFocus
|
|
9056
|
-
}, null,
|
|
9332
|
+
}), null, 16, ["model-value", "clearable", "max-data", "placeholder"]),
|
|
9057
9333
|
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
9058
9334
|
withDirectives(createVNode(
|
|
9059
9335
|
unref(DbIcon),
|
|
@@ -9062,7 +9338,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9062
9338
|
512
|
|
9063
9339
|
/* NEED_PATCH */
|
|
9064
9340
|
), [
|
|
9065
|
-
[
|
|
9341
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
9066
9342
|
])
|
|
9067
9343
|
])) : createCommentVNode("v-if", true)
|
|
9068
9344
|
],
|
|
@@ -9070,7 +9346,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9070
9346
|
/* CLASS */
|
|
9071
9347
|
)
|
|
9072
9348
|
]),
|
|
9073
|
-
|
|
9349
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
9074
9350
|
createElementVNode(
|
|
9075
9351
|
"div",
|
|
9076
9352
|
{
|
|
@@ -9083,7 +9359,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9083
9359
|
512
|
|
9084
9360
|
/* NEED_PATCH */
|
|
9085
9361
|
)
|
|
9086
|
-
])
|
|
9362
|
+
])
|
|
9087
9363
|
],
|
|
9088
9364
|
2
|
|
9089
9365
|
/* CLASS */
|
|
@@ -9093,17 +9369,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
9093
9369
|
});
|
|
9094
9370
|
function useIsWidthOverflow(domRef, watchVariable) {
|
|
9095
9371
|
const isOverflow = ref(false);
|
|
9096
|
-
const
|
|
9372
|
+
const checkOverflow2 = () => {
|
|
9097
9373
|
if (domRef.value) {
|
|
9098
9374
|
isOverflow.value = domRef.value.clientWidth < domRef.value.scrollWidth;
|
|
9099
9375
|
}
|
|
9100
9376
|
};
|
|
9101
|
-
useResizeObserver(domRef,
|
|
9377
|
+
useResizeObserver(domRef, checkOverflow2);
|
|
9102
9378
|
watch(
|
|
9103
9379
|
watchVariable,
|
|
9104
9380
|
() => {
|
|
9105
9381
|
setTimeout(() => {
|
|
9106
|
-
|
|
9382
|
+
checkOverflow2();
|
|
9107
9383
|
});
|
|
9108
9384
|
},
|
|
9109
9385
|
{
|
|
@@ -9121,8 +9397,8 @@ const _hoisted_3 = {
|
|
|
9121
9397
|
key: 2,
|
|
9122
9398
|
class: "input-error"
|
|
9123
9399
|
};
|
|
9124
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9125
|
-
__name: "text-plain",
|
|
9400
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
9401
|
+
__name: "text-plain-column",
|
|
9126
9402
|
props: {
|
|
9127
9403
|
data: {},
|
|
9128
9404
|
isLoading: { type: Boolean },
|
|
@@ -9133,6 +9409,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9133
9409
|
const props = __props;
|
|
9134
9410
|
const textRef = ref();
|
|
9135
9411
|
const renderData = computed(() => props.data);
|
|
9412
|
+
const vBkTooltips = bkTooltips;
|
|
9136
9413
|
const { isOverflow } = useIsWidthOverflow(textRef, renderData);
|
|
9137
9414
|
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
9138
9415
|
__expose({
|
|
@@ -9141,7 +9418,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9141
9418
|
}
|
|
9142
9419
|
});
|
|
9143
9420
|
return (_ctx, _cache) => {
|
|
9144
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
9145
9421
|
return openBlock(), createBlock(unref(Loading), { loading: _ctx.isLoading }, {
|
|
9146
9422
|
default: withCtx(() => [
|
|
9147
9423
|
withDirectives((openBlock(), createElementBlock(
|
|
@@ -9176,7 +9452,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9176
9452
|
512
|
|
9177
9453
|
/* NEED_PATCH */
|
|
9178
9454
|
), [
|
|
9179
|
-
[
|
|
9455
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
9180
9456
|
])
|
|
9181
9457
|
])) : createCommentVNode("v-if", true),
|
|
9182
9458
|
renderSlot(_ctx.$slots, "default")
|
|
@@ -9184,7 +9460,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9184
9460
|
2
|
|
9185
9461
|
/* CLASS */
|
|
9186
9462
|
)), [
|
|
9187
|
-
[
|
|
9463
|
+
[unref(vBkTooltips), {
|
|
9188
9464
|
content: _ctx.data || _ctx.placeholder,
|
|
9189
9465
|
disabled: !unref(isOverflow)
|
|
9190
9466
|
}]
|
|
@@ -9196,15 +9472,80 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9196
9472
|
};
|
|
9197
9473
|
}
|
|
9198
9474
|
});
|
|
9475
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9476
|
+
__name: "checkbox-column",
|
|
9477
|
+
props: /* @__PURE__ */ mergeModels({
|
|
9478
|
+
rules: { default: void 0 },
|
|
9479
|
+
disabled: { type: Boolean, default: false }
|
|
9480
|
+
}, {
|
|
9481
|
+
"modelValue": { type: Boolean, ...{
|
|
9482
|
+
default: false
|
|
9483
|
+
} },
|
|
9484
|
+
"modelModifiers": {}
|
|
9485
|
+
}),
|
|
9486
|
+
emits: /* @__PURE__ */ mergeModels(["submit", "change", "error"], ["update:modelValue"]),
|
|
9487
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
9488
|
+
const props = __props;
|
|
9489
|
+
const emits = __emit;
|
|
9490
|
+
const modelValue = useModel(__props, "modelValue");
|
|
9491
|
+
const vBkTooltips = bkTooltips;
|
|
9492
|
+
const { message: errorMessage, validator } = useValidtor(props.rules);
|
|
9493
|
+
const handleChange = (value) => {
|
|
9494
|
+
modelValue.value = value;
|
|
9495
|
+
emits("change", modelValue.value);
|
|
9496
|
+
validator(modelValue.value).then(() => {
|
|
9497
|
+
emits("error", false);
|
|
9498
|
+
emits("submit", value);
|
|
9499
|
+
}).catch(() => emits("error", true));
|
|
9500
|
+
};
|
|
9501
|
+
__expose({
|
|
9502
|
+
getValue() {
|
|
9503
|
+
return validator(modelValue.value).then(() => modelValue.value);
|
|
9504
|
+
}
|
|
9505
|
+
});
|
|
9506
|
+
return (_ctx, _cache) => {
|
|
9507
|
+
return openBlock(), createElementBlock(
|
|
9508
|
+
"div",
|
|
9509
|
+
{
|
|
9510
|
+
class: normalizeClass(["bk-ediatable-checkbox", {
|
|
9511
|
+
"is-error": Boolean(unref(errorMessage))
|
|
9512
|
+
}])
|
|
9513
|
+
},
|
|
9514
|
+
[
|
|
9515
|
+
createVNode(unref(Checkbox), mergeProps({
|
|
9516
|
+
"model-value": modelValue.value,
|
|
9517
|
+
disabled: _ctx.disabled
|
|
9518
|
+
}, _ctx.$attrs, { onChange: handleChange }), null, 16, ["model-value", "disabled"]),
|
|
9519
|
+
unref(errorMessage) ? withDirectives((openBlock(), createBlock(
|
|
9520
|
+
unref(DbIcon),
|
|
9521
|
+
{
|
|
9522
|
+
key: 0,
|
|
9523
|
+
class: "error-icon",
|
|
9524
|
+
type: "exclamation-fill"
|
|
9525
|
+
},
|
|
9526
|
+
null,
|
|
9527
|
+
512
|
|
9528
|
+
/* NEED_PATCH */
|
|
9529
|
+
)), [
|
|
9530
|
+
[unref(vBkTooltips), unref(errorMessage)]
|
|
9531
|
+
]) : createCommentVNode("v-if", true)
|
|
9532
|
+
],
|
|
9533
|
+
2
|
|
9534
|
+
/* CLASS */
|
|
9535
|
+
);
|
|
9536
|
+
};
|
|
9537
|
+
}
|
|
9538
|
+
});
|
|
9199
9539
|
export {
|
|
9540
|
+
_sfc_main as CheckboxColumn,
|
|
9200
9541
|
_sfc_main$7 as DateTimePickerColumn,
|
|
9201
9542
|
_sfc_main$8 as Ediatable,
|
|
9202
9543
|
_sfc_main$5 as FixedColumn,
|
|
9203
|
-
_sfc_main$
|
|
9544
|
+
_sfc_main$9 as HeadColumn,
|
|
9204
9545
|
_sfc_main$6 as InputColumn,
|
|
9205
|
-
_sfc_main$
|
|
9206
|
-
_sfc_main$
|
|
9207
|
-
_sfc_main$
|
|
9208
|
-
_sfc_main as TextPlainColumn,
|
|
9546
|
+
_sfc_main$4 as OperationColumn,
|
|
9547
|
+
_sfc_main$3 as SelectColumn,
|
|
9548
|
+
_sfc_main$2 as TagInputColumn,
|
|
9549
|
+
_sfc_main$1 as TextPlainColumn,
|
|
9209
9550
|
_sfc_main$8 as default
|
|
9210
9551
|
};
|