@blueking/ediatable 0.0.1-beta.6 → 0.0.1-beta.7
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 +0 -563
- package/package.json +1 -5
- package/typings/components/head-column.vue.d.ts +13 -17
- package/typings/vue2.d.ts +6 -13
- package/typings/vue3.d.ts +6 -7
- package/vue2/index.es.min.js +236 -268
- package/vue2/index.iife.min.js +276 -305
- package/vue2/index.umd.min.js +276 -305
- package/vue2/vue2.css +41 -38
- package/vue3/index.es.min.js +235 -252
- package/vue3/index.iife.min.js +277 -291
- package/vue3/index.umd.min.js +275 -289
- package/vue3/vue3.css +41 -38
- package/typings/components/date-time-picker-column.vue.d.ts +0 -63
- package/typings/components/input-column.vue.d.ts +0 -77
- package/typings/components/operation-column.vue.d.ts +0 -48
- package/typings/components/select-column.vue.d.ts +0 -65
- package/typings/components/tag-input-column.vue.d.ts +0 -60
package/vue3/index.es.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, provide, onMounted, onBeforeUnmount,
|
|
1
|
+
import { ref, provide, onMounted, onBeforeUnmount, defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, reactive, toRefs, h, mergeModels, useModel, useAttrs, useSlots, resolveDirective, normalizeClass, unref, createVNode, mergeProps, createSlots, withCtx, withDirectives, createCommentVNode, computed, createBlock, inject, getCurrentScope, onScopeDispose, watch, getCurrentInstance, normalizeStyle, Fragment, renderList, nextTick, toDisplayString } 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,208 +5623,11 @@ function useColumnResize(tableRef, tableColumnResizeRef, mouseupCallback) {
|
|
|
5623
5623
|
handleMouseMove
|
|
5624
5624
|
};
|
|
5625
5625
|
}
|
|
5626
|
-
const
|
|
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" } };
|
|
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
|
-
},
|
|
5713
|
-
setup(__props) {
|
|
5714
|
-
const props = __props;
|
|
5715
|
-
const slots = useSlots();
|
|
5716
|
-
const { rowWidth, isOverflow: isMinimize } = inject(renderTablekey);
|
|
5717
|
-
const parentTable = inject(tableColumnResizekey);
|
|
5718
|
-
const columnRef = ref();
|
|
5719
|
-
const currentWidth = ref(0);
|
|
5720
|
-
const columnKey = random();
|
|
5721
|
-
let initWidthRate = 0;
|
|
5722
|
-
let isDragedSelf = false;
|
|
5723
|
-
const finalMinWidth = computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
5724
|
-
const isFixedRight = computed(() => props.fixed === "right");
|
|
5725
|
-
const isFixedLeft = computed(() => props.fixed === "left");
|
|
5726
|
-
const styles = computed(() => {
|
|
5727
|
-
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
5728
|
-
const newWidth = rowWidth.value * initWidthRate;
|
|
5729
|
-
if (newWidth !== props.width) {
|
|
5730
|
-
let width = 0;
|
|
5731
|
-
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
5732
|
-
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
5733
|
-
width = currentWidth.value;
|
|
5734
|
-
} else {
|
|
5735
|
-
width = finalMinWidth.value;
|
|
5736
|
-
}
|
|
5737
|
-
} else if (newWidth > finalMinWidth.value) {
|
|
5738
|
-
width = newWidth;
|
|
5739
|
-
} else {
|
|
5740
|
-
width = finalMinWidth.value;
|
|
5741
|
-
}
|
|
5742
|
-
return {
|
|
5743
|
-
minWidth: `${width}px`
|
|
5744
|
-
};
|
|
5745
|
-
}
|
|
5746
|
-
}
|
|
5747
|
-
return {
|
|
5748
|
-
minWidth: props.width ? `${props.width}px` : "120px"
|
|
5749
|
-
};
|
|
5750
|
-
});
|
|
5751
|
-
const RenderAppendElement = computed(() => props.renderAppend && props.renderAppend());
|
|
5752
|
-
watch(
|
|
5753
|
-
() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value],
|
|
5754
|
-
([width, rowWidth2, currentWidth2]) => {
|
|
5755
|
-
if (!isDragedSelf) {
|
|
5756
|
-
return;
|
|
5757
|
-
}
|
|
5758
|
-
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
5759
|
-
isDragedSelf = false;
|
|
5760
|
-
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
5761
|
-
initWidthRate = currentWidth2 / rowWidth2;
|
|
5762
|
-
} else {
|
|
5763
|
-
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
5764
|
-
}
|
|
5765
|
-
}
|
|
5766
|
-
},
|
|
5767
|
-
{
|
|
5768
|
-
immediate: true
|
|
5769
|
-
}
|
|
5770
|
-
);
|
|
5771
|
-
useResizeObserver(columnRef, () => {
|
|
5772
|
-
if (!isDragedSelf) {
|
|
5773
|
-
return;
|
|
5774
|
-
}
|
|
5775
|
-
const width = parseFloat(columnRef.value.style.width);
|
|
5776
|
-
currentWidth.value = width;
|
|
5777
|
-
});
|
|
5778
|
-
const handleMouseDown = (event) => {
|
|
5779
|
-
isDragedSelf = true;
|
|
5780
|
-
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
5781
|
-
columnKey,
|
|
5782
|
-
minWidth: finalMinWidth.value
|
|
5783
|
-
});
|
|
5784
|
-
};
|
|
5785
|
-
const handleMouseMove = (event) => {
|
|
5786
|
-
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
5787
|
-
};
|
|
5788
|
-
return (_ctx, _cache) => {
|
|
5789
|
-
const _directive_overflow_tips = resolveDirective("overflow-tips");
|
|
5790
|
-
return openBlock(), createElementBlock("th", {
|
|
5791
|
-
ref_key: "columnRef",
|
|
5792
|
-
ref: columnRef,
|
|
5793
|
-
class: normalizeClass(["bk-ediatable-head-column", {
|
|
5794
|
-
"is-required": _ctx.required,
|
|
5795
|
-
[`column-${unref(columnKey)}`]: true,
|
|
5796
|
-
"is-right-fixed": unref(isMinimize) && isFixedRight.value,
|
|
5797
|
-
"is-left-fixed": unref(isMinimize) && isFixedLeft.value
|
|
5798
|
-
}]),
|
|
5799
|
-
"data-fixed": _ctx.fixed,
|
|
5800
|
-
"data-maxWidth": _ctx.maxWidth,
|
|
5801
|
-
"data-minWidth": finalMinWidth.value,
|
|
5802
|
-
"data-width": _ctx.width,
|
|
5803
|
-
style: normalizeStyle(styles.value),
|
|
5804
|
-
onMousedown: handleMouseDown,
|
|
5805
|
-
onMousemove: handleMouseMove
|
|
5806
|
-
}, [
|
|
5807
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
5808
|
-
renderSlot(_ctx.$slots, "default")
|
|
5809
|
-
])), [
|
|
5810
|
-
[_directive_overflow_tips]
|
|
5811
|
-
]),
|
|
5812
|
-
createElementVNode("div", _hoisted_3$1, [
|
|
5813
|
-
unref(slots).append && !_ctx.renderAppend ? renderSlot(_ctx.$slots, "append", { key: 0 }) : createCommentVNode("v-if", true),
|
|
5814
|
-
_ctx.renderAppend ? (openBlock(), createBlock(unref(RenderAppendElement), { key: 1 })) : createCommentVNode("v-if", true)
|
|
5815
|
-
])
|
|
5816
|
-
], 46, _hoisted_1$6);
|
|
5817
|
-
};
|
|
5818
|
-
}
|
|
5819
|
-
});
|
|
5626
|
+
const _hoisted_1$7 = { style: { "position": "relative" } };
|
|
5820
5627
|
const renderTablekey = Symbol("renderTable");
|
|
5821
|
-
const _sfc_main$
|
|
5628
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
5822
5629
|
__name: "ediatable",
|
|
5823
|
-
props: {
|
|
5824
|
-
theadList: { default: () => [] }
|
|
5825
|
-
},
|
|
5826
5630
|
setup(__props) {
|
|
5827
|
-
const slots = useSlots();
|
|
5828
5631
|
const checkTableScroll = () => {
|
|
5829
5632
|
rowWidth.value = tableRef.value.clientWidth;
|
|
5830
5633
|
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
@@ -5864,34 +5667,8 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5864
5667
|
},
|
|
5865
5668
|
[
|
|
5866
5669
|
createElementVNode("thead", null, [
|
|
5867
|
-
createElementVNode("tr",
|
|
5868
|
-
|
|
5869
|
-
Fragment,
|
|
5870
|
-
{ key: 1 },
|
|
5871
|
-
renderList(_ctx.theadList, (head, index) => {
|
|
5872
|
-
return openBlock(), createBlock(_sfc_main$8, {
|
|
5873
|
-
key: index,
|
|
5874
|
-
width: head.width,
|
|
5875
|
-
"min-width": head.minWidth,
|
|
5876
|
-
"max-width": head.maxWidth,
|
|
5877
|
-
fixed: head.fixed,
|
|
5878
|
-
required: head.required,
|
|
5879
|
-
"render-append": head.renderAppend
|
|
5880
|
-
}, {
|
|
5881
|
-
default: withCtx(() => [
|
|
5882
|
-
createTextVNode(
|
|
5883
|
-
toDisplayString(head.title),
|
|
5884
|
-
1
|
|
5885
|
-
/* TEXT */
|
|
5886
|
-
)
|
|
5887
|
-
]),
|
|
5888
|
-
_: 2
|
|
5889
|
-
/* DYNAMIC */
|
|
5890
|
-
}, 1032, ["width", "min-width", "max-width", "fixed", "required", "render-append"]);
|
|
5891
|
-
}),
|
|
5892
|
-
128
|
|
5893
|
-
/* KEYED_FRAGMENT */
|
|
5894
|
-
))
|
|
5670
|
+
createElementVNode("tr", _hoisted_1$7, [
|
|
5671
|
+
renderSlot(_ctx.$slots, "default")
|
|
5895
5672
|
])
|
|
5896
5673
|
]),
|
|
5897
5674
|
createElementVNode("tbody", null, [
|
|
@@ -6012,12 +5789,12 @@ const DbIcon = defineComponent({
|
|
|
6012
5789
|
});
|
|
6013
5790
|
}
|
|
6014
5791
|
});
|
|
6015
|
-
const _hoisted_1$
|
|
5792
|
+
const _hoisted_1$6 = {
|
|
6016
5793
|
key: 0,
|
|
6017
5794
|
class: "input-error"
|
|
6018
5795
|
};
|
|
6019
|
-
const _sfc_main$
|
|
6020
|
-
__name: "date-time-picker
|
|
5796
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5797
|
+
__name: "date-time-picker",
|
|
6021
5798
|
props: /* @__PURE__ */ mergeModels({
|
|
6022
5799
|
placeholder: { default: "" },
|
|
6023
5800
|
rules: { default: void 0 },
|
|
@@ -6084,7 +5861,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6084
5861
|
key: "0"
|
|
6085
5862
|
} : void 0
|
|
6086
5863
|
]), 1040, ["model-value", "placeholder", "type"]),
|
|
6087
|
-
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
5864
|
+
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
6088
5865
|
withDirectives(createVNode(
|
|
6089
5866
|
unref(DbIcon),
|
|
6090
5867
|
{ type: "exclamation-fill" },
|
|
@@ -6102,12 +5879,18 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6102
5879
|
};
|
|
6103
5880
|
}
|
|
6104
5881
|
});
|
|
6105
|
-
const
|
|
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 = {
|
|
6106
5889
|
key: 1,
|
|
6107
5890
|
class: "blur-dispaly-main"
|
|
6108
5891
|
};
|
|
6109
|
-
const _sfc_main$
|
|
6110
|
-
__name: "input
|
|
5892
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5893
|
+
__name: "input",
|
|
6111
5894
|
props: /* @__PURE__ */ mergeModels({
|
|
6112
5895
|
placeholder: { default: "请输入" },
|
|
6113
5896
|
rules: { default: void 0 },
|
|
@@ -6183,7 +5966,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6183
5966
|
event.preventDefault();
|
|
6184
5967
|
let paste = (event.clipboardData || window.clipboardData).getData("text");
|
|
6185
5968
|
paste = encodeMult(paste);
|
|
6186
|
-
modelValue.value
|
|
5969
|
+
modelValue.value += paste.replace(/^\s+|\s+$/g, "");
|
|
6187
5970
|
};
|
|
6188
5971
|
__expose({
|
|
6189
5972
|
getValue() {
|
|
@@ -6242,7 +6025,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6242
6025
|
)), [
|
|
6243
6026
|
[_directive_bk_tooltips, unref(errorMessage)]
|
|
6244
6027
|
]) : createCommentVNode("v-if", true),
|
|
6245
|
-
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6028
|
+
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
6246
6029
|
renderSlot(_ctx.$slots, "blur")
|
|
6247
6030
|
])) : createCommentVNode("v-if", true)
|
|
6248
6031
|
],
|
|
@@ -6252,7 +6035,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6252
6035
|
};
|
|
6253
6036
|
}
|
|
6254
6037
|
});
|
|
6255
|
-
const _sfc_main$
|
|
6038
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6256
6039
|
__name: "fixed-column",
|
|
6257
6040
|
props: {
|
|
6258
6041
|
fixed: { default: "right" }
|
|
@@ -6280,16 +6063,216 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
6280
6063
|
};
|
|
6281
6064
|
}
|
|
6282
6065
|
});
|
|
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
|
+
});
|
|
6283
6266
|
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
6284
6267
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6285
|
-
__name: "operation
|
|
6268
|
+
__name: "operation",
|
|
6286
6269
|
props: {
|
|
6287
|
-
removeable: { type: Boolean, default: true },
|
|
6288
6270
|
showCopy: { type: Boolean, default: false },
|
|
6289
6271
|
showAdd: { type: Boolean, default: true },
|
|
6290
|
-
showRemove: { type: Boolean, default: true }
|
|
6272
|
+
showRemove: { type: Boolean, default: true },
|
|
6273
|
+
removeable: { type: Boolean, default: true }
|
|
6291
6274
|
},
|
|
6292
|
-
emits: ["
|
|
6275
|
+
emits: ["copy", "add", "remove"],
|
|
6293
6276
|
setup(__props, { emit: __emit }) {
|
|
6294
6277
|
const props = __props;
|
|
6295
6278
|
const emits = __emit;
|
|
@@ -6306,7 +6289,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6306
6289
|
emits("remove");
|
|
6307
6290
|
};
|
|
6308
6291
|
return (_ctx, _cache) => {
|
|
6309
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6292
|
+
return openBlock(), createBlock(_sfc_main$5, null, {
|
|
6310
6293
|
default: withCtx(() => [
|
|
6311
6294
|
createElementVNode("div", _hoisted_1$3, [
|
|
6312
6295
|
_ctx.showCopy ? (openBlock(), createElementBlock("div", {
|
|
@@ -6351,7 +6334,7 @@ const _hoisted_1$2 = {
|
|
|
6351
6334
|
class: "select-error"
|
|
6352
6335
|
};
|
|
6353
6336
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6354
|
-
__name: "select
|
|
6337
|
+
__name: "select",
|
|
6355
6338
|
props: /* @__PURE__ */ mergeModels({
|
|
6356
6339
|
list: {},
|
|
6357
6340
|
placeholder: { default: "请选择" },
|
|
@@ -9001,7 +8984,7 @@ const _hoisted_2$1 = {
|
|
|
9001
8984
|
style: { "display": "none" }
|
|
9002
8985
|
};
|
|
9003
8986
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
9004
|
-
__name: "tag-input
|
|
8987
|
+
__name: "tag-input",
|
|
9005
8988
|
props: /* @__PURE__ */ mergeModels({
|
|
9006
8989
|
placeholder: { default: "" },
|
|
9007
8990
|
single: { type: Boolean, default: false },
|
|
@@ -9168,7 +9151,7 @@ const _hoisted_3 = {
|
|
|
9168
9151
|
class: "input-error"
|
|
9169
9152
|
};
|
|
9170
9153
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9171
|
-
__name: "text-plain
|
|
9154
|
+
__name: "text-plain",
|
|
9172
9155
|
props: {
|
|
9173
9156
|
data: {},
|
|
9174
9157
|
isLoading: { type: Boolean },
|
|
@@ -9243,14 +9226,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9243
9226
|
}
|
|
9244
9227
|
});
|
|
9245
9228
|
export {
|
|
9246
|
-
_sfc_main$
|
|
9247
|
-
_sfc_main$
|
|
9248
|
-
_sfc_main$
|
|
9249
|
-
_sfc_main$
|
|
9250
|
-
_sfc_main$
|
|
9229
|
+
_sfc_main$7 as DateTimePickerColumn,
|
|
9230
|
+
_sfc_main$8 as Ediatable,
|
|
9231
|
+
_sfc_main$5 as FixedColumn,
|
|
9232
|
+
_sfc_main$4 as HeadColumn,
|
|
9233
|
+
_sfc_main$6 as InputColumn,
|
|
9251
9234
|
_sfc_main$3 as OperationColumn,
|
|
9252
9235
|
_sfc_main$2 as SelectColumn,
|
|
9253
9236
|
_sfc_main$1 as TagInputColumn,
|
|
9254
9237
|
_sfc_main as TextPlainColumn,
|
|
9255
|
-
_sfc_main$
|
|
9238
|
+
_sfc_main$8 as default
|
|
9256
9239
|
};
|