@blueking/ediatable 0.0.1-beta.4 → 0.0.1-beta.5
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-column.vue.d.ts +63 -0
- package/typings/components/head-column.vue.d.ts +17 -9
- package/typings/components/input-column.vue.d.ts +77 -0
- package/typings/components/operation-column.vue.d.ts +48 -0
- package/typings/components/select-column.vue.d.ts +65 -0
- package/typings/components/tag-input-column.vue.d.ts +60 -0
- package/typings/vue2.d.ts +13 -6
- package/typings/vue3.d.ts +7 -6
- package/vue2/index.es.min.js +267 -219
- package/vue2/index.iife.min.js +304 -256
- package/vue2/index.umd.min.js +304 -256
- package/vue2/vue2.css +38 -38
- package/vue3/index.es.min.js +251 -218
- package/vue3/index.iife.min.js +290 -257
- package/vue3/index.umd.min.js +288 -255
- package/vue3/vue3.css +38 -38
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, renderSlot, createElementVNode, 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,208 @@ 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
|
+
},
|
|
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
|
+
});
|
|
5820
|
+
const renderTablekey = Symbol("renderTable");
|
|
5821
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5629
5822
|
__name: "ediatable",
|
|
5823
|
+
props: {
|
|
5824
|
+
theadList: { default: () => [] }
|
|
5825
|
+
},
|
|
5630
5826
|
setup(__props) {
|
|
5827
|
+
const slots = useSlots();
|
|
5631
5828
|
const checkTableScroll = () => {
|
|
5632
5829
|
rowWidth.value = tableRef.value.clientWidth;
|
|
5633
5830
|
isOverflow.value = tableOuterRef.value.clientWidth < tableRef.value.clientWidth;
|
|
@@ -5667,8 +5864,34 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
5667
5864
|
},
|
|
5668
5865
|
[
|
|
5669
5866
|
createElementVNode("thead", null, [
|
|
5670
|
-
createElementVNode("tr",
|
|
5671
|
-
renderSlot(_ctx.$slots, "default")
|
|
5867
|
+
createElementVNode("tr", null, [
|
|
5868
|
+
unref(slots).default && _ctx.theadList.length === 0 ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(true), createElementBlock(
|
|
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
|
+
))
|
|
5672
5895
|
])
|
|
5673
5896
|
]),
|
|
5674
5897
|
createElementVNode("tbody", null, [
|
|
@@ -5789,12 +6012,12 @@ const DbIcon = defineComponent({
|
|
|
5789
6012
|
});
|
|
5790
6013
|
}
|
|
5791
6014
|
});
|
|
5792
|
-
const _hoisted_1$
|
|
6015
|
+
const _hoisted_1$5 = {
|
|
5793
6016
|
key: 0,
|
|
5794
6017
|
class: "input-error"
|
|
5795
6018
|
};
|
|
5796
|
-
const _sfc_main$
|
|
5797
|
-
__name: "date-time-picker",
|
|
6019
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
6020
|
+
__name: "date-time-picker-column",
|
|
5798
6021
|
props: /* @__PURE__ */ mergeModels({
|
|
5799
6022
|
placeholder: { default: "" },
|
|
5800
6023
|
rules: { default: void 0 },
|
|
@@ -5861,7 +6084,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5861
6084
|
key: "0"
|
|
5862
6085
|
} : void 0
|
|
5863
6086
|
]), 1040, ["model-value", "placeholder", "type"]),
|
|
5864
|
-
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6087
|
+
unref(errorMessage) ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
5865
6088
|
withDirectives(createVNode(
|
|
5866
6089
|
unref(DbIcon),
|
|
5867
6090
|
{ type: "exclamation-fill" },
|
|
@@ -5879,18 +6102,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5879
6102
|
};
|
|
5880
6103
|
}
|
|
5881
6104
|
});
|
|
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 = {
|
|
6105
|
+
const _hoisted_1$4 = {
|
|
5889
6106
|
key: 1,
|
|
5890
6107
|
class: "blur-dispaly-main"
|
|
5891
6108
|
};
|
|
5892
|
-
const _sfc_main$
|
|
5893
|
-
__name: "input",
|
|
6109
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
6110
|
+
__name: "input-column",
|
|
5894
6111
|
props: /* @__PURE__ */ mergeModels({
|
|
5895
6112
|
placeholder: { default: "请输入" },
|
|
5896
6113
|
rules: { default: void 0 },
|
|
@@ -6025,7 +6242,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6025
6242
|
)), [
|
|
6026
6243
|
[_directive_bk_tooltips, unref(errorMessage)]
|
|
6027
6244
|
]) : createCommentVNode("v-if", true),
|
|
6028
|
-
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
6245
|
+
_ctx.isShowBlur && isBlur.value ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
6029
6246
|
renderSlot(_ctx.$slots, "blur")
|
|
6030
6247
|
])) : createCommentVNode("v-if", true)
|
|
6031
6248
|
],
|
|
@@ -6035,7 +6252,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6035
6252
|
};
|
|
6036
6253
|
}
|
|
6037
6254
|
});
|
|
6038
|
-
const _sfc_main$
|
|
6255
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6039
6256
|
__name: "fixed-column",
|
|
6040
6257
|
props: {
|
|
6041
6258
|
fixed: { default: "right" }
|
|
@@ -6063,200 +6280,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
6063
6280
|
};
|
|
6064
6281
|
}
|
|
6065
6282
|
});
|
|
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
|
-
},
|
|
6149
|
-
setup(__props) {
|
|
6150
|
-
const props = __props;
|
|
6151
|
-
const { rowWidth, isOverflow: isMinimize } = inject(renderTablekey);
|
|
6152
|
-
const parentTable = inject(tableColumnResizekey);
|
|
6153
|
-
const slots = useSlots();
|
|
6154
|
-
const columnRef = ref();
|
|
6155
|
-
const currentWidth = ref(0);
|
|
6156
|
-
const columnKey = random();
|
|
6157
|
-
let initWidthRate = 0;
|
|
6158
|
-
let isDragedSelf = false;
|
|
6159
|
-
const finalMinWidth = computed(() => props.minWidth ? props.minWidth : props.width ?? 100);
|
|
6160
|
-
const isFixedRight = computed(() => props.fixed === "right");
|
|
6161
|
-
const isFixedLeft = computed(() => props.fixed === "left");
|
|
6162
|
-
const styles = computed(() => {
|
|
6163
|
-
if (props.width && (rowWidth == null ? void 0 : rowWidth.value) && finalMinWidth.value) {
|
|
6164
|
-
const newWidth = rowWidth.value * initWidthRate;
|
|
6165
|
-
if (newWidth !== props.width) {
|
|
6166
|
-
let width = 0;
|
|
6167
|
-
if (isMinimize == null ? void 0 : isMinimize.value) {
|
|
6168
|
-
if (currentWidth.value !== 0 && (currentWidth.value !== finalMinWidth.value || currentWidth.value !== props.width)) {
|
|
6169
|
-
width = currentWidth.value;
|
|
6170
|
-
} else {
|
|
6171
|
-
width = finalMinWidth.value;
|
|
6172
|
-
}
|
|
6173
|
-
} else if (newWidth > finalMinWidth.value) {
|
|
6174
|
-
width = newWidth;
|
|
6175
|
-
} else {
|
|
6176
|
-
width = finalMinWidth.value;
|
|
6177
|
-
}
|
|
6178
|
-
return {
|
|
6179
|
-
minWidth: `${width}px`
|
|
6180
|
-
};
|
|
6181
|
-
}
|
|
6182
|
-
}
|
|
6183
|
-
return {
|
|
6184
|
-
minWidth: props.width ? `${props.width}px` : "120px"
|
|
6185
|
-
};
|
|
6186
|
-
});
|
|
6187
|
-
watch(() => [props.width, rowWidth == null ? void 0 : rowWidth.value, currentWidth.value], ([width, rowWidth2, currentWidth2]) => {
|
|
6188
|
-
if (!isDragedSelf) {
|
|
6189
|
-
return;
|
|
6190
|
-
}
|
|
6191
|
-
if (width && rowWidth2 && currentWidth2 && finalMinWidth.value) {
|
|
6192
|
-
isDragedSelf = false;
|
|
6193
|
-
if (currentWidth2 !== 0 && (currentWidth2 !== finalMinWidth.value || currentWidth2 !== width)) {
|
|
6194
|
-
initWidthRate = currentWidth2 / rowWidth2;
|
|
6195
|
-
} else {
|
|
6196
|
-
initWidthRate = (isMinimize == null ? void 0 : isMinimize.value) ? finalMinWidth.value / rowWidth2 : width / rowWidth2;
|
|
6197
|
-
}
|
|
6198
|
-
}
|
|
6199
|
-
}, {
|
|
6200
|
-
immediate: true
|
|
6201
|
-
});
|
|
6202
|
-
useResizeObserver(columnRef, () => {
|
|
6203
|
-
if (!isDragedSelf) {
|
|
6204
|
-
return;
|
|
6205
|
-
}
|
|
6206
|
-
const width = parseFloat(columnRef.value.style.width);
|
|
6207
|
-
currentWidth.value = width;
|
|
6208
|
-
});
|
|
6209
|
-
const handleMouseDown = (event) => {
|
|
6210
|
-
isDragedSelf = true;
|
|
6211
|
-
parentTable == null ? void 0 : parentTable.columnMousedown(event, {
|
|
6212
|
-
columnKey,
|
|
6213
|
-
minWidth: finalMinWidth.value
|
|
6214
|
-
});
|
|
6215
|
-
};
|
|
6216
|
-
const handleMouseMove = (event) => {
|
|
6217
|
-
parentTable == null ? void 0 : parentTable.columnMouseMove(event);
|
|
6218
|
-
};
|
|
6219
|
-
return (_ctx, _cache) => {
|
|
6220
|
-
const _directive_overflow_tips = resolveDirective("overflow-tips");
|
|
6221
|
-
return openBlock(), createElementBlock("th", {
|
|
6222
|
-
ref_key: "columnRef",
|
|
6223
|
-
ref: columnRef,
|
|
6224
|
-
class: normalizeClass(["bk-ediatable-head-column", {
|
|
6225
|
-
"is-required": _ctx.required,
|
|
6226
|
-
[`column-${unref(columnKey)}`]: true,
|
|
6227
|
-
"is-right-fixed": unref(isMinimize) && isFixedRight.value,
|
|
6228
|
-
"is-left-fixed": unref(isMinimize) && isFixedLeft.value
|
|
6229
|
-
}]),
|
|
6230
|
-
"data-fixed": _ctx.fixed,
|
|
6231
|
-
"data-maxWidth": _ctx.maxWidth,
|
|
6232
|
-
"data-minWidth": finalMinWidth.value,
|
|
6233
|
-
"data-width": _ctx.width,
|
|
6234
|
-
style: normalizeStyle(styles.value),
|
|
6235
|
-
onMousedown: handleMouseDown,
|
|
6236
|
-
onMousemove: handleMouseMove
|
|
6237
|
-
}, [
|
|
6238
|
-
withDirectives((openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
6239
|
-
renderSlot(_ctx.$slots, "default")
|
|
6240
|
-
])), [
|
|
6241
|
-
[_directive_overflow_tips]
|
|
6242
|
-
]),
|
|
6243
|
-
unref(slots).append ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
6244
|
-
renderSlot(_ctx.$slots, "append")
|
|
6245
|
-
])) : createCommentVNode("v-if", true)
|
|
6246
|
-
], 46, _hoisted_1$4);
|
|
6247
|
-
};
|
|
6248
|
-
}
|
|
6249
|
-
});
|
|
6250
6283
|
const _hoisted_1$3 = { class: "bk-ediatable-operation" };
|
|
6251
6284
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6252
|
-
__name: "operation",
|
|
6285
|
+
__name: "operation-column",
|
|
6253
6286
|
props: {
|
|
6287
|
+
removeable: { type: Boolean, default: true },
|
|
6254
6288
|
showCopy: { type: Boolean, default: false },
|
|
6255
6289
|
showAdd: { type: Boolean, default: true },
|
|
6256
|
-
showRemove: { type: Boolean, default: true }
|
|
6257
|
-
removeable: { type: Boolean, default: true }
|
|
6290
|
+
showRemove: { type: Boolean, default: true }
|
|
6258
6291
|
},
|
|
6259
|
-
emits: ["
|
|
6292
|
+
emits: ["add", "copy", "remove"],
|
|
6260
6293
|
setup(__props, { emit: __emit }) {
|
|
6261
6294
|
const props = __props;
|
|
6262
6295
|
const emits = __emit;
|
|
@@ -6273,7 +6306,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6273
6306
|
emits("remove");
|
|
6274
6307
|
};
|
|
6275
6308
|
return (_ctx, _cache) => {
|
|
6276
|
-
return openBlock(), createBlock(_sfc_main$
|
|
6309
|
+
return openBlock(), createBlock(_sfc_main$4, null, {
|
|
6277
6310
|
default: withCtx(() => [
|
|
6278
6311
|
createElementVNode("div", _hoisted_1$3, [
|
|
6279
6312
|
_ctx.showCopy ? (openBlock(), createElementBlock("div", {
|
|
@@ -6318,7 +6351,7 @@ const _hoisted_1$2 = {
|
|
|
6318
6351
|
class: "select-error"
|
|
6319
6352
|
};
|
|
6320
6353
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6321
|
-
__name: "select",
|
|
6354
|
+
__name: "select-column",
|
|
6322
6355
|
props: /* @__PURE__ */ mergeModels({
|
|
6323
6356
|
list: {},
|
|
6324
6357
|
placeholder: { default: "请选择" },
|
|
@@ -8968,7 +9001,7 @@ const _hoisted_2$1 = {
|
|
|
8968
9001
|
style: { "display": "none" }
|
|
8969
9002
|
};
|
|
8970
9003
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
8971
|
-
__name: "tag-input",
|
|
9004
|
+
__name: "tag-input-column",
|
|
8972
9005
|
props: /* @__PURE__ */ mergeModels({
|
|
8973
9006
|
placeholder: { default: "" },
|
|
8974
9007
|
single: { type: Boolean, default: false },
|
|
@@ -9135,7 +9168,7 @@ const _hoisted_3 = {
|
|
|
9135
9168
|
class: "input-error"
|
|
9136
9169
|
};
|
|
9137
9170
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9138
|
-
__name: "text-plain",
|
|
9171
|
+
__name: "text-plain-column",
|
|
9139
9172
|
props: {
|
|
9140
9173
|
data: {},
|
|
9141
9174
|
isLoading: { type: Boolean },
|
|
@@ -9210,14 +9243,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
9210
9243
|
}
|
|
9211
9244
|
});
|
|
9212
9245
|
export {
|
|
9213
|
-
_sfc_main$
|
|
9214
|
-
_sfc_main$
|
|
9215
|
-
_sfc_main$
|
|
9216
|
-
_sfc_main$
|
|
9217
|
-
_sfc_main$
|
|
9246
|
+
_sfc_main$6 as DateTimePickerColumn,
|
|
9247
|
+
_sfc_main$7 as Ediatable,
|
|
9248
|
+
_sfc_main$4 as FixedColumn,
|
|
9249
|
+
_sfc_main$8 as HeadColumn,
|
|
9250
|
+
_sfc_main$5 as InputColumn,
|
|
9218
9251
|
_sfc_main$3 as OperationColumn,
|
|
9219
9252
|
_sfc_main$2 as SelectColumn,
|
|
9220
9253
|
_sfc_main$1 as TagInputColumn,
|
|
9221
9254
|
_sfc_main as TextPlainColumn,
|
|
9222
|
-
_sfc_main$
|
|
9255
|
+
_sfc_main$7 as default
|
|
9223
9256
|
};
|