@blueking/ediatable 0.0.1-beta.7 → 0.0.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +563 -0
- package/package.json +5 -1
- package/typings/components/{date-time-picker.vue.d.ts → date-time-picker-column.vue.d.ts} +4 -2
- package/typings/components/fixed-column.vue.d.ts +6 -4
- package/typings/components/head-column.vue.d.ts +21 -11
- package/typings/components/{input.vue.d.ts → input-column.vue.d.ts} +6 -4
- package/typings/components/{tag-input.vue.d.ts → tag-input-column.vue.d.ts} +6 -4
- package/typings/vue2.d.ts +13 -6
- package/typings/vue3.d.ts +7 -6
- package/vue2/index.es.min.js +1515 -8814
- package/vue2/index.iife.min.js +5888 -13274
- package/vue2/index.umd.min.js +1600 -8973
- package/vue2/vue2.css +44 -118
- package/vue3/index.es.min.js +269 -236
- package/vue3/index.iife.min.js +1586 -8974
- package/vue3/index.umd.min.js +309 -276
- package/vue3/vue3.css +41 -41
- package/typings/ediatable.vue.d.ts +0 -20
- package/typings/components/{operation.vue.d.ts → operation-column.vue.d.ts} +5 -5
- /package/typings/components/{select.vue.d.ts → select-column.vue.d.ts} +0 -0
package/vue3/index.es.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, provide, onMounted, onBeforeUnmount,
|
|
1
|
+
import { ref, provide, onMounted, onBeforeUnmount, getCurrentScope, onScopeDispose, unref, computed, watch, getCurrentInstance, defineComponent, useSlots, inject, resolveDirective, openBlock, createElementBlock, normalizeClass, normalizeStyle, withDirectives, createElementVNode, renderSlot, createCommentVNode, createBlock, Fragment, renderList, withCtx, createTextVNode, toDisplayString, reactive, toRefs, h, mergeModels, useModel, useAttrs, createVNode, mergeProps, createSlots, nextTick } from "vue";
|
|
2
2
|
import "bkui-vue/dist/style.css";
|
|
3
3
|
import { DatePicker, Input, Select, TagInput, Loading } from "bkui-vue";
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
@@ -5623,11 +5623,224 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5623
5623
|
handleMouseMove
|
|
5624
5624
|
};
|
|
5625
5625
|
}
|
|
5626
|
-
const
|
|
5627
|
-
const
|
|
5626
|
+
const random = () => `${_.random(0, 999999)}_${Date.now()}_${_.random(0, 999999)}`;
|
|
5627
|
+
const encodeMult = (text) => {
|
|
5628
|
+
const temp = document.createElement("textarea");
|
|
5629
|
+
temp.value = text;
|
|
5630
|
+
return temp.value;
|
|
5631
|
+
};
|
|
5632
|
+
function tryOnScopeDispose(fn2) {
|
|
5633
|
+
if (getCurrentScope()) {
|
|
5634
|
+
onScopeDispose(fn2);
|
|
5635
|
+
return true;
|
|
5636
|
+
}
|
|
5637
|
+
return false;
|
|
5638
|
+
}
|
|
5639
|
+
function toValue(r) {
|
|
5640
|
+
return typeof r === "function" ? r() : unref(r);
|
|
5641
|
+
}
|
|
5642
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
5643
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
5644
|
+
function unrefElement(elRef) {
|
|
5645
|
+
var _a;
|
|
5646
|
+
const plain = toValue(elRef);
|
|
5647
|
+
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
5648
|
+
}
|
|
5649
|
+
const defaultWindow = isClient ? window : void 0;
|
|
5650
|
+
function useMounted() {
|
|
5651
|
+
const isMounted = ref(false);
|
|
5652
|
+
const instance = getCurrentInstance();
|
|
5653
|
+
if (instance) {
|
|
5654
|
+
onMounted(() => {
|
|
5655
|
+
isMounted.value = true;
|
|
5656
|
+
}, instance);
|
|
5657
|
+
}
|
|
5658
|
+
return isMounted;
|
|
5659
|
+
}
|
|
5660
|
+
function useSupported(callback) {
|
|
5661
|
+
const isMounted = useMounted();
|
|
5662
|
+
return computed(() => {
|
|
5663
|
+
isMounted.value;
|
|
5664
|
+
return Boolean(callback());
|
|
5665
|
+
});
|
|
5666
|
+
}
|
|
5667
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
5668
|
+
const { window: window2 = defaultWindow, ...observerOptions } = options;
|
|
5669
|
+
let observer;
|
|
5670
|
+
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
|
|
5671
|
+
const cleanup = () => {
|
|
5672
|
+
if (observer) {
|
|
5673
|
+
observer.disconnect();
|
|
5674
|
+
observer = void 0;
|
|
5675
|
+
}
|
|
5676
|
+
};
|
|
5677
|
+
const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
|
|
5678
|
+
const stopWatch = watch(
|
|
5679
|
+
targets,
|
|
5680
|
+
(els) => {
|
|
5681
|
+
cleanup();
|
|
5682
|
+
if (isSupported.value && window2) {
|
|
5683
|
+
observer = new ResizeObserver(callback);
|
|
5684
|
+
for (const _el of els)
|
|
5685
|
+
_el && observer.observe(_el, observerOptions);
|
|
5686
|
+
}
|
|
5687
|
+
},
|
|
5688
|
+
{ immediate: true, flush: "post" }
|
|
5689
|
+
);
|
|
5690
|
+
const stop = () => {
|
|
5691
|
+
cleanup();
|
|
5692
|
+
stopWatch();
|
|
5693
|
+
};
|
|
5694
|
+
tryOnScopeDispose(stop);
|
|
5695
|
+
return {
|
|
5696
|
+
isSupported,
|
|
5697
|
+
stop
|
|
5698
|
+
};
|
|
5699
|
+
}
|
|
5700
|
+
const _hoisted_1$6 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
|
|
5701
|
+
const _hoisted_2$2 = { class: "th-cell" };
|
|
5702
|
+
const _hoisted_3$1 = { style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" } };
|
|
5628
5703
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
5704
|
+
__name: "head-column",
|
|
5705
|
+
props: {
|
|
5706
|
+
fixed: { default: void 0 },
|
|
5707
|
+
maxWidth: { default: void 0 },
|
|
5708
|
+
minWidth: { default: void 0 },
|
|
5709
|
+
required: { type: Boolean, default: true },
|
|
5710
|
+
width: { default: void 0 },
|
|
5711
|
+
renderAppend: { type: Function, default: void 0 },
|
|
5712
|
+
memo: { default: void 0 }
|
|
5713
|
+
},
|
|
5714
|
+
setup(__props) {
|
|
5715
|
+
const props = __props;
|
|
5716
|
+
const slots = useSlots();
|
|
5717
|
+
const { rowWidth, isOverflow: isMinimize } = inject(renderTablekey);
|
|
5718
|
+
const parentTable = inject(tableColumnResizekey);
|
|
5719
|
+
const columnRef = ref();
|
|
5720
|
+
const currentWidth = ref(0);
|
|
5721
|
+
const columnKey = random();
|
|
5722
|
+
let initWidthRate = 0;
|
|
5723
|
+
let isDragedSelf = false;
|
|
5724
|
+
const finalMinWidth = computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
5725
|
+
const isFixedRight = computed(() => props.fixed === "right");
|
|
5726
|
+
const isFixedLeft = computed(() => props.fixed === "left");
|
|
5727
|
+
const styles = computed(() => {
|
|
5728
|
+
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
5729
|
+
const newWidth = rowWidth.value * initWidthRate;
|
|
5730
|
+
if (newWidth !== props.width) {
|
|
5731
|
+
let width = 0;
|
|
5732
|
+
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
5733
|
+
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
5734
|
+
width = currentWidth.value;
|
|
5735
|
+
} else {
|
|
5736
|
+
width = finalMinWidth.value;
|
|
5737
|
+
}
|
|
5738
|
+
} else if (newWidth > finalMinWidth.value) {
|
|
5739
|
+
width = newWidth;
|
|
5740
|
+
} else {
|
|
5741
|
+
width = finalMinWidth.value;
|
|
5742
|
+
}
|
|
5743
|
+
return {
|
|
5744
|
+
minWidth: `${width}px`
|
|
5745
|
+
};
|
|
5746
|
+
}
|
|
5747
|
+
}
|
|
5748
|
+
return {
|
|
5749
|
+
minWidth: props.width ? `${props.width}px` : "120px"
|
|
5750
|
+
};
|
|
5751
|
+
});
|
|
5752
|
+
const RenderAppendElement = computed(() => props.renderAppend && props.renderAppend());
|
|
5753
|
+
watch(
|
|
5754
|
+
() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
|
|
5755
|
+
([width, rowWidth2, currentWidth2]) => {
|
|
5756
|
+
if (!isDragedSelf) {
|
|
5757
|
+
return;
|
|
5758
|
+
}
|
|
5759
|
+
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
5760
|
+
isDragedSelf = false;
|
|
5761
|
+
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
5762
|
+
initWidthRate = currentWidth2 / rowWidth2;
|
|
5763
|
+
} else {
|
|
5764
|
+
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
5765
|
+
}
|
|
5766
|
+
}
|
|
5767
|
+
},
|
|
5768
|
+
{
|
|
5769
|
+
immediate: true
|
|
5770
|
+
}
|
|
5771
|
+
);
|
|
5772
|
+
useResizeObserver(columnRef, () => {
|
|
5773
|
+
if (!isDragedSelf) {
|
|
5774
|
+
return;
|
|
5775
|
+
}
|
|
5776
|
+
const width = parseFloat(columnRef.value.style.width);
|
|
5777
|
+
currentWidth.value = width;
|
|
5778
|
+
});
|
|
5779
|
+
const handleMouseDown = (event) => {
|
|
5780
|
+
isDragedSelf = true;
|
|
5781
|
+
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
5782
|
+
columnKey,
|
|
5783
|
+
minWidth: finalMinWidth.value
|
|
5784
|
+
});
|
|
5785
|
+
};
|
|
5786
|
+
const handleMouseMove = (event) => {
|
|
5787
|
+
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
5788
|
+
};
|
|
5789
|
+
return (_ctx, _cache) => {
|
|
5790
|
+
const _directive_overflow_tips = resolveDirective("overflow-tips");
|
|
5791
|
+
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
5792
|
+
return openBlock(), createElementBlock("th", {
|
|
5793
|
+
ref_key: "columnRef",
|
|
5794
|
+
ref: columnRef,
|
|
5795
|
+
class: normalizeClass(["bk-ediatable-head-column", {
|
|
5796
|
+
"is-required": _ctx.required,
|
|
5797
|
+
[`column-${unref(columnKey)}`]: true,
|
|
5798
|
+
"is-right-fixed": unref(isMinimize) && isFixedRight.value,
|
|
5799
|
+
"is-left-fixed": unref(isMinimize) && isFixedLeft.value
|
|
5800
|
+
}]),
|
|
5801
|
+
"data-fixed": _ctx.fixed,
|
|
5802
|
+
"data-maxWidth": _ctx.maxWidth,
|
|
5803
|
+
"data-minWidth": finalMinWidth.value,
|
|
5804
|
+
"data-width": _ctx.width,
|
|
5805
|
+
style: normalizeStyle(styles.value),
|
|
5806
|
+
onMousedown: handleMouseDown,
|
|
5807
|
+
onMousemove: handleMouseMove
|
|
5808
|
+
}, [
|
|
5809
|
+
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
5810
|
+
createElementVNode(
|
|
5811
|
+
"span",
|
|
5812
|
+
{
|
|
5813
|
+
class: normalizeClass({ "title-memo": _ctx.memo })
|
|
5814
|
+
},
|
|
5815
|
+
[
|
|
5816
|
+
renderSlot(_ctx.$slots, "default")
|
|
5817
|
+
],
|
|
5818
|
+
2
|
|
5819
|
+
/* CLASS */
|
|
5820
|
+
)
|
|
5821
|
+
])), [
|
|
5822
|
+
[_directive_overflow_tips],
|
|
5823
|
+
[_directive_bk_tooltips, {
|
|
5824
|
+
content: _ctx.memo,
|
|
5825
|
+
disabled: !_ctx.memo
|
|
5826
|
+
}]
|
|
5827
|
+
]),
|
|
5828
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
5829
|
+
slots.append && !_ctx.renderAppend ? renderSlot(_ctx.$slots, "append", { key: 0 }) : createCommentVNode("v-if", true),
|
|
5830
|
+
_ctx.renderAppend ? (openBlock(), createBlock(unref(RenderAppendElement), { key: 1 })) : createCommentVNode("v-if", true)
|
|
5831
|
+
])
|
|
5832
|
+
], 46, _hoisted_1$6);
|
|
5833
|
+
};
|
|
5834
|
+
}
|
|
5835
|
+
});
|
|
5836
|
+
const renderTablekey = Symbol("renderTable");
|
|
5837
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5629
5838
|
__name: "ediatable",
|
|
5839
|
+
props: {
|
|
5840
|
+
theadList: { default: () => [] }
|
|
5841
|
+
},
|
|
5630
5842
|
setup(__props) {
|
|
5843
|
+
const slots = useSlots();
|
|
5631
5844
|
const checkTableScroll = () => {
|
|
5632
5845
|
rowWidth.value = tableRef.value.clientWidth;
|
|
5633
5846
|
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
@@ -5667,8 +5880,35 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
5667
5880
|
},
|
|
5668
5881
|
[
|
|
5669
5882
|
createElementVNode("thead", null, [
|
|
5670
|
-
createElementVNode("tr",
|
|
5671
|
-
renderSlot(_ctx.$slots, "default")
|
|
5883
|
+
createElementVNode("tr", null, [
|
|
5884
|
+
slots.default && _ctx.theadList.length === 0 ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(true), createElementBlock(
|
|
5885
|
+
Fragment,
|
|
5886
|
+
{ key: 1 },
|
|
5887
|
+
renderList(_ctx.theadList, (head, index) => {
|
|
5888
|
+
return openBlock(), createBlock(_sfc_main$8, {
|
|
5889
|
+
key: index,
|
|
5890
|
+
width: head.width,
|
|
5891
|
+
"min-width": head.minWidth,
|
|
5892
|
+
"max-width": head.maxWidth,
|
|
5893
|
+
fixed: head.fixed,
|
|
5894
|
+
required: head.required,
|
|
5895
|
+
"render-append": head.renderAppend,
|
|
5896
|
+
memo: head.memo
|
|
5897
|
+
}, {
|
|
5898
|
+
default: withCtx(() => [
|
|
5899
|
+
createTextVNode(
|
|
5900
|
+
toDisplayString(head.title),
|
|
5901
|
+
1
|
|
5902
|
+
/* TEXT */
|
|
5903
|
+
)
|
|
5904
|
+
]),
|
|
5905
|
+
_: 2
|
|
5906
|
+
/* DYNAMIC */
|
|
5907
|
+
}, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append", "memo"]);
|
|
5908
|
+
}),
|
|
5909
|
+
128
|
|
5910
|
+
/* KEYED_FRAGMENT */
|
|
5911
|
+
))
|
|
5672
5912
|
])
|
|
5673
5913
|
]),
|
|
5674
5914
|
createElementVNode("tbody", null, [
|
|
@@ -5789,12 +6029,12 @@ const DbIcon = defineComponent({
|
|
|
5789
6029
|
});
|
|
5790
6030
|
}
|
|
5791
6031
|
});
|
|
5792
|
-
const _hoisted_1$
|
|
6032
|
+
const _hoisted_1$5 = {
|
|
5793
6033
|
key: 0,
|
|
5794
6034
|
class: "input-error"
|
|
5795
6035
|
};
|
|
5796
|
-
const _sfc_main$
|
|
5797
|
-
__name: "date-time-picker",
|
|
6036
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
6037
|
+
__name: "date-time-picker-column",
|
|
5798
6038
|
props: /* @__PURE__ */ mergeModels({
|
|
5799
6039
|
placeholder: { default: "" },
|
|
5800
6040
|
rules: { default: void 0 },
|
|
@@ -5861,7 +6101,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5861
6101
|
key: "0"
|
|
5862
6102
|
} : void 0
|
|
5863
6103
|
]), 1040, ["model-value", "placeholder", "type"]),
|
|
5864
|
-
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6104
|
+
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
5865
6105
|
withDirectives(createVNode(
|
|
5866
6106
|
unref(DbIcon),
|
|
5867
6107
|
{ type: "exclamation-fill" },
|
|
@@ -5879,18 +6119,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5879
6119
|
};
|
|
5880
6120
|
}
|
|
5881
6121
|
});
|
|
5882
|
-
const
|
|
5883
|
-
const encodeMult = (text) => {
|
|
5884
|
-
const temp = document.createElement("textarea");
|
|
5885
|
-
temp.value = text;
|
|
5886
|
-
return temp.value;
|
|
5887
|
-
};
|
|
5888
|
-
const _hoisted_1$5 = {
|
|
6122
|
+
const _hoisted_1$4 = {
|
|
5889
6123
|
key: 1,
|
|
5890
6124
|
class: "blur-dispaly-main"
|
|
5891
6125
|
};
|
|
5892
|
-
const _sfc_main$
|
|
5893
|
-
__name: "input",
|
|
6126
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6127
|
+
__name: "input-column",
|
|
5894
6128
|
props: /* @__PURE__ */ mergeModels({
|
|
5895
6129
|
placeholder: { default: "请输入" },
|
|
5896
6130
|
rules: { default: void 0 },
|
|
@@ -6025,7 +6259,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6025
6259
|
)), [
|
|
6026
6260
|
[_directive_bk_tooltips, unref(errorMessage)]
|
|
6027
6261
|
]) : createCommentVNode("v-if", true),
|
|
6028
|
-
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6262
|
+
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
6029
6263
|
renderSlot(_ctx.$slots, "blur")
|
|
6030
6264
|
])) : createCommentVNode("v-if", true)
|
|
6031
6265
|
],
|
|
@@ -6035,7 +6269,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6035
6269
|
};
|
|
6036
6270
|
}
|
|
6037
6271
|
});
|
|
6038
|
-
const _sfc_main$
|
|
6272
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6039
6273
|
__name: "fixed-column",
|
|
6040
6274
|
props: {
|
|
6041
6275
|
fixed: { default: "right" }
|
|
@@ -6063,216 +6297,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6063
6297
|
};
|
|
6064
6298
|
}
|
|
6065
6299
|
});
|
|
6066
|
-
function tryOnScopeDispose(fn2) {
|
|
6067
|
-
if (getCurrentScope()) {
|
|
6068
|
-
onScopeDispose(fn2);
|
|
6069
|
-
return true;
|
|
6070
|
-
}
|
|
6071
|
-
return false;
|
|
6072
|
-
}
|
|
6073
|
-
function toValue(r) {
|
|
6074
|
-
return typeof r === "function" ? r() : unref(r);
|
|
6075
|
-
}
|
|
6076
|
-
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
6077
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
6078
|
-
function unrefElement(elRef) {
|
|
6079
|
-
var _a;
|
|
6080
|
-
const plain = toValue(elRef);
|
|
6081
|
-
return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
|
|
6082
|
-
}
|
|
6083
|
-
const defaultWindow = isClient ? window : void 0;
|
|
6084
|
-
function useMounted() {
|
|
6085
|
-
const isMounted = ref(false);
|
|
6086
|
-
const instance = getCurrentInstance();
|
|
6087
|
-
if (instance) {
|
|
6088
|
-
onMounted(() => {
|
|
6089
|
-
isMounted.value = true;
|
|
6090
|
-
}, instance);
|
|
6091
|
-
}
|
|
6092
|
-
return isMounted;
|
|
6093
|
-
}
|
|
6094
|
-
function useSupported(callback) {
|
|
6095
|
-
const isMounted = useMounted();
|
|
6096
|
-
return computed(() => {
|
|
6097
|
-
isMounted.value;
|
|
6098
|
-
return Boolean(callback());
|
|
6099
|
-
});
|
|
6100
|
-
}
|
|
6101
|
-
function useResizeObserver(target, callback, options = {}) {
|
|
6102
|
-
const { window: window2 = defaultWindow, ...observerOptions } = options;
|
|
6103
|
-
let observer;
|
|
6104
|
-
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
|
|
6105
|
-
const cleanup = () => {
|
|
6106
|
-
if (observer) {
|
|
6107
|
-
observer.disconnect();
|
|
6108
|
-
observer = void 0;
|
|
6109
|
-
}
|
|
6110
|
-
};
|
|
6111
|
-
const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
|
|
6112
|
-
const stopWatch = watch(
|
|
6113
|
-
targets,
|
|
6114
|
-
(els) => {
|
|
6115
|
-
cleanup();
|
|
6116
|
-
if (isSupported.value && window2) {
|
|
6117
|
-
observer = new ResizeObserver(callback);
|
|
6118
|
-
for (const _el of els)
|
|
6119
|
-
_el && observer.observe(_el, observerOptions);
|
|
6120
|
-
}
|
|
6121
|
-
},
|
|
6122
|
-
{ immediate: true, flush: "post" }
|
|
6123
|
-
);
|
|
6124
|
-
const stop = () => {
|
|
6125
|
-
cleanup();
|
|
6126
|
-
stopWatch();
|
|
6127
|
-
};
|
|
6128
|
-
tryOnScopeDispose(stop);
|
|
6129
|
-
return {
|
|
6130
|
-
isSupported,
|
|
6131
|
-
stop
|
|
6132
|
-
};
|
|
6133
|
-
}
|
|
6134
|
-
const _hoisted_1$4 = ["data-fixed", "data-maxWidth", "data-minWidth", "data-width"];
|
|
6135
|
-
const _hoisted_2$2 = { class: "th-cell" };
|
|
6136
|
-
const _hoisted_3$1 = {
|
|
6137
|
-
key: 0,
|
|
6138
|
-
style: { "display": "inline-block", "line-height": "40px", "vertical-align": "top" }
|
|
6139
|
-
};
|
|
6140
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6141
|
-
__name: "head-column",
|
|
6142
|
-
props: {
|
|
6143
|
-
width: { default: void 0 },
|
|
6144
|
-
required: { type: Boolean, default: true },
|
|
6145
|
-
minWidth: { default: void 0 },
|
|
6146
|
-
maxWidth: { default: void 0 },
|
|
6147
|
-
fixed: { default: void 0 },
|
|
6148
|
-
memo: { default: void 0 }
|
|
6149
|
-
},
|
|
6150
|
-
setup(__props) {
|
|
6151
|
-
const props = __props;
|
|
6152
|
-
const { rowWidth, isOverflow: isMinimize } = inject(renderTablekey);
|
|
6153
|
-
const parentTable = inject(tableColumnResizekey);
|
|
6154
|
-
const slots = useSlots();
|
|
6155
|
-
const columnRef = ref();
|
|
6156
|
-
const currentWidth = ref(0);
|
|
6157
|
-
const columnKey = random();
|
|
6158
|
-
let initWidthRate = 0;
|
|
6159
|
-
let isDragedSelf = false;
|
|
6160
|
-
const finalMinWidth = computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
6161
|
-
const isFixedRight = computed(() => props.fixed === "right");
|
|
6162
|
-
const isFixedLeft = computed(() => props.fixed === "left");
|
|
6163
|
-
const styles = computed(() => {
|
|
6164
|
-
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
6165
|
-
const newWidth = rowWidth.value * initWidthRate;
|
|
6166
|
-
if (newWidth !== props.width) {
|
|
6167
|
-
let width = 0;
|
|
6168
|
-
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
6169
|
-
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
6170
|
-
width = currentWidth.value;
|
|
6171
|
-
} else {
|
|
6172
|
-
width = finalMinWidth.value;
|
|
6173
|
-
}
|
|
6174
|
-
} else if (newWidth > finalMinWidth.value) {
|
|
6175
|
-
width = newWidth;
|
|
6176
|
-
} else {
|
|
6177
|
-
width = finalMinWidth.value;
|
|
6178
|
-
}
|
|
6179
|
-
return {
|
|
6180
|
-
minWidth: `${width}px`
|
|
6181
|
-
};
|
|
6182
|
-
}
|
|
6183
|
-
}
|
|
6184
|
-
return {
|
|
6185
|
-
minWidth: props.width ? `${props.width}px` : "120px"
|
|
6186
|
-
};
|
|
6187
|
-
});
|
|
6188
|
-
watch(() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value], ([width, rowWidth2, currentWidth2]) => {
|
|
6189
|
-
if (!isDragedSelf) {
|
|
6190
|
-
return;
|
|
6191
|
-
}
|
|
6192
|
-
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
6193
|
-
isDragedSelf = false;
|
|
6194
|
-
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
6195
|
-
initWidthRate = currentWidth2 / rowWidth2;
|
|
6196
|
-
} else {
|
|
6197
|
-
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
6198
|
-
}
|
|
6199
|
-
}
|
|
6200
|
-
}, {
|
|
6201
|
-
immediate: true
|
|
6202
|
-
});
|
|
6203
|
-
useResizeObserver(columnRef, () => {
|
|
6204
|
-
if (!isDragedSelf) {
|
|
6205
|
-
return;
|
|
6206
|
-
}
|
|
6207
|
-
const width = parseFloat(columnRef.value.style.width);
|
|
6208
|
-
currentWidth.value = width;
|
|
6209
|
-
});
|
|
6210
|
-
const handleMouseDown = (event) => {
|
|
6211
|
-
isDragedSelf = true;
|
|
6212
|
-
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
6213
|
-
columnKey,
|
|
6214
|
-
minWidth: finalMinWidth.value
|
|
6215
|
-
});
|
|
6216
|
-
};
|
|
6217
|
-
const handleMouseMove = (event) => {
|
|
6218
|
-
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
6219
|
-
};
|
|
6220
|
-
return (_ctx, _cache) => {
|
|
6221
|
-
const _directive_overflow_tips = resolveDirective("overflow-tips");
|
|
6222
|
-
const _directive_bk_tooltips = resolveDirective("bk-tooltips");
|
|
6223
|
-
return openBlock(), createElementBlock("th", {
|
|
6224
|
-
ref_key: "columnRef",
|
|
6225
|
-
ref: columnRef,
|
|
6226
|
-
class: normalizeClass(["bk-ediatable-head-column", {
|
|
6227
|
-
"is-required": _ctx.required,
|
|
6228
|
-
[`column-${unref(columnKey)}`]: true,
|
|
6229
|
-
"is-right-fixed": unref(isMinimize) && isFixedRight.value,
|
|
6230
|
-
"is-left-fixed": unref(isMinimize) && isFixedLeft.value
|
|
6231
|
-
}]),
|
|
6232
|
-
"data-fixed": _ctx.fixed,
|
|
6233
|
-
"data-maxWidth": _ctx.maxWidth,
|
|
6234
|
-
"data-minWidth": finalMinWidth.value,
|
|
6235
|
-
"data-width": _ctx.width,
|
|
6236
|
-
style: normalizeStyle(styles.value),
|
|
6237
|
-
onMousedown: handleMouseDown,
|
|
6238
|
-
onMousemove: handleMouseMove
|
|
6239
|
-
}, [
|
|
6240
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
6241
|
-
createElementVNode(
|
|
6242
|
-
"span",
|
|
6243
|
-
{
|
|
6244
|
-
class: normalizeClass({ "title-memo": _ctx.memo })
|
|
6245
|
-
},
|
|
6246
|
-
[
|
|
6247
|
-
renderSlot(_ctx.$slots, "default")
|
|
6248
|
-
],
|
|
6249
|
-
2
|
|
6250
|
-
/* CLASS */
|
|
6251
|
-
)
|
|
6252
|
-
])), [
|
|
6253
|
-
[_directive_overflow_tips],
|
|
6254
|
-
[_directive_bk_tooltips, {
|
|
6255
|
-
content: _ctx.memo,
|
|
6256
|
-
disabled: !_ctx.memo
|
|
6257
|
-
}]
|
|
6258
|
-
]),
|
|
6259
|
-
unref(slots).append ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
6260
|
-
renderSlot(_ctx.$slots, "append")
|
|
6261
|
-
])) : createCommentVNode("v-if", true)
|
|
6262
|
-
], 46, _hoisted_1$4);
|
|
6263
|
-
};
|
|
6264
|
-
}
|
|
6265
|
-
});
|
|
6266
6300
|
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
6267
6301
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6268
|
-
__name: "operation",
|
|
6302
|
+
__name: "operation-column",
|
|
6269
6303
|
props: {
|
|
6304
|
+
removeable: { type: Boolean, default: true },
|
|
6270
6305
|
showCopy: { type: Boolean, default: false },
|
|
6271
6306
|
showAdd: { type: Boolean, default: true },
|
|
6272
|
-
showRemove: { type: Boolean, default: true }
|
|
6273
|
-
removeable: { type: Boolean, default: true }
|
|
6307
|
+
showRemove: { type: Boolean, default: true }
|
|
6274
6308
|
},
|
|
6275
|
-
emits: ["
|
|
6309
|
+
emits: ["add", "copy", "remove"],
|
|
6276
6310
|
setup(__props, { emit: __emit }) {
|
|
6277
6311
|
const props = __props;
|
|
6278
6312
|
const emits = __emit;
|
|
@@ -6289,7 +6323,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6289
6323
|
emits("remove");
|
|
6290
6324
|
};
|
|
6291
6325
|
return (_ctx, _cache) => {
|
|
6292
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6326
|
+
return openBlock(), createBlock(_sfc_main$4, null, {
|
|
6293
6327
|
default: withCtx(() => [
|
|
6294
6328
|
createElementVNode("div", _hoisted_1$3, [
|
|
6295
6329
|
_ctx.showCopy ? (openBlock(), createElementBlock("div", {
|
|
@@ -6334,7 +6368,7 @@ const _hoisted_1$2 = {
|
|
|
6334
6368
|
class: "select-error"
|
|
6335
6369
|
};
|
|
6336
6370
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6337
|
-
__name: "select",
|
|
6371
|
+
__name: "select-column",
|
|
6338
6372
|
props: /* @__PURE__ */ mergeModels({
|
|
6339
6373
|
list: {},
|
|
6340
6374
|
placeholder: { default: "请选择" },
|
|
@@ -7334,8 +7368,7 @@ function flip(_ref) {
|
|
|
7334
7368
|
};
|
|
7335
7369
|
for (var _i = numberOfChecks; _i > 0; _i--) {
|
|
7336
7370
|
var _ret = _loop(_i);
|
|
7337
|
-
if (_ret === "break")
|
|
7338
|
-
break;
|
|
7371
|
+
if (_ret === "break") break;
|
|
7339
7372
|
}
|
|
7340
7373
|
}
|
|
7341
7374
|
if (state.placement !== firstFittingPlacement) {
|
|
@@ -8984,7 +9017,7 @@ const _hoisted_2$1 = {
|
|
|
8984
9017
|
style: { "display": "none" }
|
|
8985
9018
|
};
|
|
8986
9019
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8987
|
-
__name: "tag-input",
|
|
9020
|
+
__name: "tag-input-column",
|
|
8988
9021
|
props: /* @__PURE__ */ mergeModels({
|
|
8989
9022
|
placeholder: { default: "" },
|
|
8990
9023
|
single: { type: Boolean, default: false },
|
|
@@ -9151,7 +9184,7 @@ const _hoisted_3 = {
|
|
|
9151
9184
|
class: "input-error"
|
|
9152
9185
|
};
|
|
9153
9186
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9154
|
-
__name: "text-plain",
|
|
9187
|
+
__name: "text-plain-column",
|
|
9155
9188
|
props: {
|
|
9156
9189
|
data: {},
|
|
9157
9190
|
isLoading: { type: Boolean },
|
|
@@ -9226,14 +9259,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9226
9259
|
}
|
|
9227
9260
|
});
|
|
9228
9261
|
export {
|
|
9229
|
-
_sfc_main$
|
|
9230
|
-
_sfc_main$
|
|
9231
|
-
_sfc_main$
|
|
9232
|
-
_sfc_main$
|
|
9233
|
-
_sfc_main$
|
|
9262
|
+
_sfc_main$6 as DateTimePickerColumn,
|
|
9263
|
+
_sfc_main$7 as Ediatable,
|
|
9264
|
+
_sfc_main$4 as FixedColumn,
|
|
9265
|
+
_sfc_main$8 as HeadColumn,
|
|
9266
|
+
_sfc_main$5 as InputColumn,
|
|
9234
9267
|
_sfc_main$3 as OperationColumn,
|
|
9235
9268
|
_sfc_main$2 as SelectColumn,
|
|
9236
9269
|
_sfc_main$1 as TagInputColumn,
|
|
9237
9270
|
_sfc_main as TextPlainColumn,
|
|
9238
|
-
_sfc_main$
|
|
9271
|
+
_sfc_main$7 as default
|
|
9239
9272
|
};
|