lew-ui 2.7.60 → 2.7.61
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/LICENSE +21 -21
- package/dist/index.css +1 -1
- package/dist/index.js +136 -104
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8648,10 +8648,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8648
8648
|
}));
|
|
8649
8649
|
const totalColumnWidth = computed(() => {
|
|
8650
8650
|
let width = sumBy(leafColumns.value, "width");
|
|
8651
|
-
if (props.checkable)
|
|
8652
|
-
|
|
8653
|
-
if (props.sortable)
|
|
8654
|
-
width += getDragColumnWidth.value;
|
|
8651
|
+
if (props.checkable) width += getCheckableWidth.value;
|
|
8652
|
+
if (props.sortable) width += getDragColumnWidth.value;
|
|
8655
8653
|
return width;
|
|
8656
8654
|
});
|
|
8657
8655
|
const fixedWidths = computed(() => {
|
|
@@ -8692,8 +8690,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8692
8690
|
});
|
|
8693
8691
|
const columnLevel = computed(() => {
|
|
8694
8692
|
const findMaxDepth = (columns, currentDepth = 1) => {
|
|
8695
|
-
if (!columns || columns.length === 0)
|
|
8696
|
-
return currentDepth;
|
|
8693
|
+
if (!columns || columns.length === 0) return currentDepth;
|
|
8697
8694
|
let maxDepth = currentDepth;
|
|
8698
8695
|
for (const col of columns) {
|
|
8699
8696
|
if (col.children && col.children.length > 0) {
|
|
@@ -8786,7 +8783,10 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8786
8783
|
state.isAllChecked = isEmpty(uncheckedKeys) && props.multiple && props.checkable && checkedKeys.length > 0;
|
|
8787
8784
|
}
|
|
8788
8785
|
function setAllRowsChecked(checked) {
|
|
8789
|
-
state.selectedRowsMap = mapValues(
|
|
8786
|
+
state.selectedRowsMap = mapValues(
|
|
8787
|
+
keyBy(state.dataSource, _rowKey),
|
|
8788
|
+
() => checked
|
|
8789
|
+
);
|
|
8790
8790
|
if (props.multiple) {
|
|
8791
8791
|
selectedKeys.value = checked ? keys(state.selectedRowsMap) : [];
|
|
8792
8792
|
}
|
|
@@ -8805,7 +8805,10 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8805
8805
|
}
|
|
8806
8806
|
function updateSelectedKeys(keys2) {
|
|
8807
8807
|
if (props.multiple) {
|
|
8808
|
-
state.selectedRowsMap = mapValues(
|
|
8808
|
+
state.selectedRowsMap = mapValues(
|
|
8809
|
+
keyBy(state.dataSource, _rowKey),
|
|
8810
|
+
() => false
|
|
8811
|
+
);
|
|
8809
8812
|
keys2.forEach((key) => {
|
|
8810
8813
|
state.selectedRowsMap[key] = true;
|
|
8811
8814
|
});
|
|
@@ -8832,10 +8835,15 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8832
8835
|
right: "end",
|
|
8833
8836
|
end: "end"
|
|
8834
8837
|
};
|
|
8838
|
+
const width = column.width;
|
|
8839
|
+
let calculatedWidth = width;
|
|
8840
|
+
if (!state.isScrollbarVisible && !column.fixed) {
|
|
8841
|
+
calculatedWidth = width / (totalColumnWidth.value - fixedWidths.value.left - fixedWidths.value.right) * (state.scrollClientWidth - fixedWidths.value.left - fixedWidths.value.right);
|
|
8842
|
+
}
|
|
8835
8843
|
const tdStyle = {
|
|
8836
8844
|
display: "flex",
|
|
8837
8845
|
flexDirection: "column",
|
|
8838
|
-
width: any2px(
|
|
8846
|
+
width: any2px(calculatedWidth),
|
|
8839
8847
|
justifyContent: "center",
|
|
8840
8848
|
alignItems: xMap[column.x] || "start"
|
|
8841
8849
|
};
|
|
@@ -8844,7 +8852,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8844
8852
|
display: "flex",
|
|
8845
8853
|
alignItems: "center",
|
|
8846
8854
|
justifyContent: xMap[column.x],
|
|
8847
|
-
width: any2px(
|
|
8855
|
+
width: any2px(calculatedWidth),
|
|
8848
8856
|
height: "100%",
|
|
8849
8857
|
boxSizing: "border-box"
|
|
8850
8858
|
};
|
|
@@ -8881,8 +8889,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8881
8889
|
column?.title,
|
|
8882
8890
|
column.sortable && h(SortIcon, {
|
|
8883
8891
|
"sort-value": sortValue.value[column.field],
|
|
8884
|
-
|
|
8885
|
-
|
|
8892
|
+
size: props.size,
|
|
8893
|
+
class: "lew-table-sorter"
|
|
8886
8894
|
})
|
|
8887
8895
|
]
|
|
8888
8896
|
}
|
|
@@ -8897,7 +8905,9 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8897
8905
|
style: tdGroupStyle
|
|
8898
8906
|
},
|
|
8899
8907
|
{
|
|
8900
|
-
default: () => column.children.map(
|
|
8908
|
+
default: () => column.children.map(
|
|
8909
|
+
(child) => readerHeaderTd({ column: child })
|
|
8910
|
+
)
|
|
8901
8911
|
}
|
|
8902
8912
|
) : null
|
|
8903
8913
|
]
|
|
@@ -8926,8 +8936,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8926
8936
|
}
|
|
8927
8937
|
}
|
|
8928
8938
|
function updateScrollState() {
|
|
8929
|
-
if (!tableRef.value)
|
|
8930
|
-
return;
|
|
8939
|
+
if (!tableRef.value) return;
|
|
8931
8940
|
const element = tableRef.value;
|
|
8932
8941
|
const { clientWidth, scrollWidth, scrollLeft } = element;
|
|
8933
8942
|
if (scrollWidth === clientWidth) {
|
|
@@ -8999,8 +9008,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8999
9008
|
}
|
|
9000
9009
|
const handleTableResize = throttle(() => {
|
|
9001
9010
|
const table = tableRef.value;
|
|
9002
|
-
if (!table)
|
|
9003
|
-
return;
|
|
9011
|
+
if (!table) return;
|
|
9004
9012
|
const newScrollClientWidth = table.clientWidth;
|
|
9005
9013
|
const newIsScroll = table.scrollWidth > table.clientWidth + 5;
|
|
9006
9014
|
if (state.scrollClientWidth !== newScrollClientWidth) {
|
|
@@ -9056,10 +9064,12 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9056
9064
|
state.showTooltip = false;
|
|
9057
9065
|
state.isDragging = false;
|
|
9058
9066
|
}
|
|
9059
|
-
const throttledTooltipUpdate = throttle(
|
|
9067
|
+
const throttledTooltipUpdate = throttle(
|
|
9068
|
+
updateTooltipPosition,
|
|
9069
|
+
TOOLTIP_THROTTLE_DELAY
|
|
9070
|
+
);
|
|
9060
9071
|
function dragStart(event, row, index2) {
|
|
9061
|
-
if (!props.sortable)
|
|
9062
|
-
return;
|
|
9072
|
+
if (!props.sortable) return;
|
|
9063
9073
|
initDragState();
|
|
9064
9074
|
computeTableRowHeight();
|
|
9065
9075
|
state.dragIndex = index2;
|
|
@@ -9153,14 +9163,15 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9153
9163
|
}
|
|
9154
9164
|
let targetRowId = "";
|
|
9155
9165
|
let isAbove = false;
|
|
9156
|
-
const positionEntries = Object.entries(state.trPositionsMap).map(
|
|
9157
|
-
id,
|
|
9158
|
-
|
|
9159
|
-
|
|
9166
|
+
const positionEntries = Object.entries(state.trPositionsMap).map(
|
|
9167
|
+
([id, pos]) => ({
|
|
9168
|
+
id,
|
|
9169
|
+
...pos
|
|
9170
|
+
})
|
|
9171
|
+
);
|
|
9160
9172
|
positionEntries.sort((a, b) => a.top - b.top);
|
|
9161
9173
|
for (const entry of positionEntries) {
|
|
9162
|
-
if (entry.id === state.dragRowId)
|
|
9163
|
-
continue;
|
|
9174
|
+
if (entry.id === state.dragRowId) continue;
|
|
9164
9175
|
const position = entry;
|
|
9165
9176
|
if (mouseY >= position.top && mouseY <= position.bottom) {
|
|
9166
9177
|
targetRowId = position.id;
|
|
@@ -9170,10 +9181,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9170
9181
|
}
|
|
9171
9182
|
if (!targetRowId) {
|
|
9172
9183
|
for (let i = 0; i < positionEntries.length - 1; i++) {
|
|
9173
|
-
if (positionEntries[i].id === state.dragRowId)
|
|
9174
|
-
|
|
9175
|
-
if (positionEntries[i + 1].id === state.dragRowId)
|
|
9176
|
-
continue;
|
|
9184
|
+
if (positionEntries[i].id === state.dragRowId) continue;
|
|
9185
|
+
if (positionEntries[i + 1].id === state.dragRowId) continue;
|
|
9177
9186
|
if (mouseY > positionEntries[i].bottom && mouseY < positionEntries[i + 1].top) {
|
|
9178
9187
|
if (mouseY - positionEntries[i].bottom < positionEntries[i + 1].top - mouseY) {
|
|
9179
9188
|
targetRowId = positionEntries[i].id;
|
|
@@ -9208,8 +9217,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9208
9217
|
`;
|
|
9209
9218
|
}
|
|
9210
9219
|
const targetPosition = state.trPositionsMap[state.targetRowId];
|
|
9211
|
-
if (!targetPosition)
|
|
9212
|
-
return "display: none;";
|
|
9220
|
+
if (!targetPosition) return "display: none;";
|
|
9213
9221
|
const top2 = state.isAboveTarget ? targetPosition.top : targetPosition.bottom;
|
|
9214
9222
|
const tableRect = tableRef.value?.getBoundingClientRect();
|
|
9215
9223
|
const offsetTop = tableRect ? top2 - tableRect.top : 0;
|
|
@@ -9228,8 +9236,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9228
9236
|
});
|
|
9229
9237
|
}
|
|
9230
9238
|
function getRowHeight(row) {
|
|
9231
|
-
if (!row || !row._lew_table_tr_id)
|
|
9232
|
-
return "auto";
|
|
9239
|
+
if (!row || !row._lew_table_tr_id) return "auto";
|
|
9233
9240
|
const height = state.trHeightMap[row._lew_table_tr_id];
|
|
9234
9241
|
if (!height) {
|
|
9235
9242
|
const minHeightMap = {
|
|
@@ -15554,9 +15561,6 @@ function useVirtList(userProps, emitFunction) {
|
|
|
15554
15561
|
slotSize.footerSize = 0;
|
|
15555
15562
|
}
|
|
15556
15563
|
});
|
|
15557
|
-
onActivated(() => {
|
|
15558
|
-
scrollToOffset(reactiveData.offset);
|
|
15559
|
-
});
|
|
15560
15564
|
function getVirtualSize2beginInView() {
|
|
15561
15565
|
return reactiveData.virtualSize + getRangeSize(reactiveData.renderBegin, reactiveData.inViewBegin);
|
|
15562
15566
|
}
|
|
@@ -22877,6 +22881,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22877
22881
|
}
|
|
22878
22882
|
function inputFn(e) {
|
|
22879
22883
|
const target = e.target;
|
|
22884
|
+
checkValidationMessage();
|
|
22880
22885
|
emit("input", target.value);
|
|
22881
22886
|
validationMessage.value = lewInputRef.value.validationMessage;
|
|
22882
22887
|
}
|
|
@@ -22936,6 +22941,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22936
22941
|
lewInputRef.value.stepUp();
|
|
22937
22942
|
modelValue.value = Number(lewInputRef.value.value);
|
|
22938
22943
|
emit("change", cloneDeep(modelValue.value));
|
|
22944
|
+
checkValidationMessage();
|
|
22939
22945
|
if (props.max !== void 0 && lewInputRef.value.value >= Number(props.max || 0)) {
|
|
22940
22946
|
clearTimer();
|
|
22941
22947
|
}
|
|
@@ -22950,6 +22956,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22950
22956
|
lewInputRef.value.stepDown();
|
|
22951
22957
|
modelValue.value = Number(lewInputRef.value.value);
|
|
22952
22958
|
emit("change", cloneDeep(modelValue.value));
|
|
22959
|
+
checkValidationMessage();
|
|
22953
22960
|
if (props.min !== void 0 && lewInputRef.value.value <= Number(props.min || 0)) {
|
|
22954
22961
|
clearTimer();
|
|
22955
22962
|
}
|
|
@@ -22966,12 +22973,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22966
22973
|
__expose({ focus, validCheck });
|
|
22967
22974
|
return (_ctx, _cache) => {
|
|
22968
22975
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
22969
|
-
return openBlock(), createElementBlock("div", {
|
|
22976
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
22970
22977
|
class: normalizeClass(["lew-input-number-view", unref(getInputClassNames)]),
|
|
22971
22978
|
style: normalizeStyle(unref(getInputNumberViewStyle)),
|
|
22972
22979
|
onWheel: _cache[3] || (_cache[3] = (e) => e.preventDefault()),
|
|
22973
|
-
onMouseenter: checkValidationMessage
|
|
22974
|
-
onMouseleave: _cache[4] || (_cache[4] = ($event) => validationMessage.value = "")
|
|
22980
|
+
onMouseenter: checkValidationMessage
|
|
22975
22981
|
}, [
|
|
22976
22982
|
withDirectives(createElementVNode("input", {
|
|
22977
22983
|
ref_key: "lewInputRef",
|
|
@@ -22989,11 +22995,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22989
22995
|
onChange: changeFn,
|
|
22990
22996
|
onFocus: focusFn
|
|
22991
22997
|
}, null, 44, _hoisted_1$q), [
|
|
22992
|
-
[vModelText, modelValue.value]
|
|
22993
|
-
[_directive_tooltip, {
|
|
22994
|
-
content: unref(validationMessage),
|
|
22995
|
-
triggerFrom: "input-number"
|
|
22996
|
-
}]
|
|
22998
|
+
[vModelText, modelValue.value]
|
|
22997
22999
|
]),
|
|
22998
23000
|
createVNode(unref(LewFlex), {
|
|
22999
23001
|
style: normalizeStyle(unref(getControlStyle)),
|
|
@@ -23024,11 +23026,16 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
23024
23026
|
]),
|
|
23025
23027
|
_: 1
|
|
23026
23028
|
}, 8, ["style"])
|
|
23027
|
-
], 38)
|
|
23029
|
+
], 38)), [
|
|
23030
|
+
[_directive_tooltip, {
|
|
23031
|
+
content: unref(validationMessage),
|
|
23032
|
+
triggerFrom: "input-number"
|
|
23033
|
+
}]
|
|
23034
|
+
]);
|
|
23028
23035
|
};
|
|
23029
23036
|
}
|
|
23030
23037
|
});
|
|
23031
|
-
const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
23038
|
+
const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-67533033"]]);
|
|
23032
23039
|
const inputTableEmits = {
|
|
23033
23040
|
change: (value) => value
|
|
23034
23041
|
};
|
|
@@ -23675,22 +23682,11 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23675
23682
|
const isTagMarkedForDeletion = ref(false);
|
|
23676
23683
|
const autoWidthDelay = ref(false);
|
|
23677
23684
|
let originalKeydownHandler = null;
|
|
23678
|
-
function
|
|
23679
|
-
if (isInputActive.value || props.disabled || props.readonly)
|
|
23680
|
-
return;
|
|
23681
|
-
if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
|
|
23682
|
-
LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
|
|
23683
|
-
return;
|
|
23684
|
-
}
|
|
23685
|
-
isInputActive.value = true;
|
|
23686
|
-
nextTick(() => {
|
|
23687
|
-
if (lewInputRef.value && typeof lewInputRef.value?.focus === "function") {
|
|
23688
|
-
lewInputRef.value?.focus();
|
|
23689
|
-
}
|
|
23690
|
-
});
|
|
23685
|
+
function attachKeydownListener() {
|
|
23691
23686
|
originalKeydownHandler = document.onkeydown;
|
|
23692
23687
|
document.onkeydown = function(event) {
|
|
23693
23688
|
const keyCode = event.key || event.code;
|
|
23689
|
+
if (!isInputActive.value) return;
|
|
23694
23690
|
if (inputValue.value) {
|
|
23695
23691
|
if (keyCode === "Enter" || keyCode === "NumpadEnter") {
|
|
23696
23692
|
isTagMarkedForDeletion.value = false;
|
|
@@ -23721,24 +23717,31 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23721
23717
|
isTagMarkedForDeletion.value = true;
|
|
23722
23718
|
}
|
|
23723
23719
|
}
|
|
23724
|
-
if (keyCode === "Enter" || keyCode === "NumpadEnter") {
|
|
23725
|
-
if (lewInputRef.value && typeof lewInputRef.value.blur === "function") {
|
|
23726
|
-
lewInputRef.value.blur();
|
|
23727
|
-
}
|
|
23728
|
-
}
|
|
23729
23720
|
}
|
|
23730
23721
|
};
|
|
23731
23722
|
}
|
|
23732
|
-
|
|
23723
|
+
function detachKeydownListener() {
|
|
23733
23724
|
if (document.onkeydown && document.onkeydown !== originalKeydownHandler) {
|
|
23734
23725
|
document.onkeydown = originalKeydownHandler;
|
|
23735
23726
|
}
|
|
23736
|
-
}
|
|
23737
|
-
function
|
|
23738
|
-
|
|
23739
|
-
if (
|
|
23727
|
+
}
|
|
23728
|
+
function openInput() {
|
|
23729
|
+
if (isInputActive.value || props.disabled || props.readonly) return;
|
|
23730
|
+
if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
|
|
23731
|
+
LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
|
|
23740
23732
|
return;
|
|
23741
23733
|
}
|
|
23734
|
+
isInputActive.value = true;
|
|
23735
|
+
nextTick(() => {
|
|
23736
|
+
if (lewInputRef.value && typeof lewInputRef.value?.focus === "function") {
|
|
23737
|
+
lewInputRef.value?.focus();
|
|
23738
|
+
}
|
|
23739
|
+
});
|
|
23740
|
+
attachKeydownListener();
|
|
23741
|
+
}
|
|
23742
|
+
function addTag() {
|
|
23743
|
+
const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
|
|
23744
|
+
if (!inputValue.value || inputValue.value.trim() === "") return;
|
|
23742
23745
|
if (props.maxLength > 0 && _value.length >= props.maxLength) {
|
|
23743
23746
|
inputValue.value = "";
|
|
23744
23747
|
isInputActive.value = false;
|
|
@@ -23753,9 +23756,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23753
23756
|
emit("add", addedValue);
|
|
23754
23757
|
}
|
|
23755
23758
|
function delTag(index2) {
|
|
23756
|
-
if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length)
|
|
23759
|
+
if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length)
|
|
23757
23760
|
return;
|
|
23758
|
-
}
|
|
23759
23761
|
const removedTag = modelValue.value[index2];
|
|
23760
23762
|
const newValue = [...modelValue.value];
|
|
23761
23763
|
newValue.splice(index2, 1);
|
|
@@ -23769,6 +23771,25 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23769
23771
|
emit("change", cloneDeep(newValue));
|
|
23770
23772
|
emit("remove", removedTag, index2);
|
|
23771
23773
|
}
|
|
23774
|
+
function clear() {
|
|
23775
|
+
modelValue.value = [];
|
|
23776
|
+
inputValue.value = "";
|
|
23777
|
+
emit("clear");
|
|
23778
|
+
emit("change", void 0);
|
|
23779
|
+
}
|
|
23780
|
+
function onBlur() {
|
|
23781
|
+
isInputActive.value = false;
|
|
23782
|
+
isTagMarkedForDeletion.value = false;
|
|
23783
|
+
detachKeydownListener();
|
|
23784
|
+
if (inputValue.value) {
|
|
23785
|
+
addTag();
|
|
23786
|
+
}
|
|
23787
|
+
}
|
|
23788
|
+
function onFocus() {
|
|
23789
|
+
if (props.disabled || props.readonly) return;
|
|
23790
|
+
isInputActive.value = true;
|
|
23791
|
+
attachKeydownListener();
|
|
23792
|
+
}
|
|
23772
23793
|
const getInputClassNames = computed(() => {
|
|
23773
23794
|
const { size, readonly: readonly2, disabled, clearable } = props;
|
|
23774
23795
|
return object2class("lew-input-tag-view", {
|
|
@@ -23786,19 +23807,6 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23786
23807
|
};
|
|
23787
23808
|
return size[props.size] || 14;
|
|
23788
23809
|
});
|
|
23789
|
-
function clear() {
|
|
23790
|
-
modelValue.value = [];
|
|
23791
|
-
inputValue.value = "";
|
|
23792
|
-
emit("clear");
|
|
23793
|
-
emit("change", void 0);
|
|
23794
|
-
}
|
|
23795
|
-
function onBlur() {
|
|
23796
|
-
isInputActive.value = false;
|
|
23797
|
-
isTagMarkedForDeletion.value = false;
|
|
23798
|
-
if (inputValue.value) {
|
|
23799
|
-
addTag();
|
|
23800
|
-
}
|
|
23801
|
-
}
|
|
23802
23810
|
const shouldShowIcon = computed(
|
|
23803
23811
|
() => !((modelValue.value || []).length > 0 && props.clearable)
|
|
23804
23812
|
);
|
|
@@ -23812,6 +23820,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23812
23820
|
color: isTagMarkedForDeletion.value && index2 === (modelValue.value || []).length - 1 ? "var(--lew-color-red-dark)" : "var(--lew-color-primary-dark)"
|
|
23813
23821
|
};
|
|
23814
23822
|
});
|
|
23823
|
+
onUnmounted(() => {
|
|
23824
|
+
detachKeydownListener();
|
|
23825
|
+
});
|
|
23815
23826
|
return (_ctx, _cache) => {
|
|
23816
23827
|
return openBlock(), createElementBlock("div", {
|
|
23817
23828
|
class: normalizeClass(["lew-input-tag-view", unref(getInputClassNames)]),
|
|
@@ -23852,6 +23863,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23852
23863
|
readonly: !unref(isInputActive),
|
|
23853
23864
|
placeholder: (modelValue.value || []).length === 0 ? unref(locale).t("inputTag.placeholder") : " ",
|
|
23854
23865
|
onInput: _cache[1] || (_cache[1] = ($event) => isTagMarkedForDeletion.value = false),
|
|
23866
|
+
onFocus,
|
|
23855
23867
|
onBlur
|
|
23856
23868
|
}, null, 8, ["modelValue", "auto-width", "size", "readonly", "placeholder"])) : createCommentVNode("", true)
|
|
23857
23869
|
]),
|
|
@@ -23885,7 +23897,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23885
23897
|
};
|
|
23886
23898
|
}
|
|
23887
23899
|
});
|
|
23888
|
-
const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-
|
|
23900
|
+
const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-60df733b"]]);
|
|
23889
23901
|
const radioEmits = {
|
|
23890
23902
|
change: () => true
|
|
23891
23903
|
};
|
|
@@ -27324,7 +27336,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
27324
27336
|
};
|
|
27325
27337
|
}
|
|
27326
27338
|
});
|
|
27327
|
-
const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
27339
|
+
const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-dadd6f86"]]);
|
|
27328
27340
|
const uploadEmits = {
|
|
27329
27341
|
change: (files) => files,
|
|
27330
27342
|
delete: (file) => file
|
|
@@ -27991,13 +28003,15 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
27991
28003
|
medium: 12,
|
|
27992
28004
|
large: 14
|
|
27993
28005
|
};
|
|
27994
|
-
const uploadIconFontSizeMap = computed(
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
|
|
28006
|
+
const uploadIconFontSizeMap = computed(
|
|
28007
|
+
() => {
|
|
28008
|
+
return {
|
|
28009
|
+
small: props.viewMode === "list" ? 28 : 22,
|
|
28010
|
+
medium: props.viewMode === "list" ? 30 : 24,
|
|
28011
|
+
large: props.viewMode === "list" ? 32 : 26
|
|
28012
|
+
};
|
|
28013
|
+
}
|
|
28014
|
+
);
|
|
28001
28015
|
const uploadPaddingMap = computed(() => {
|
|
28002
28016
|
return {
|
|
28003
28017
|
small: props.viewMode === "list" ? "10px 8px" : "14px",
|
|
@@ -28045,9 +28059,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28045
28059
|
lastModified,
|
|
28046
28060
|
file: item
|
|
28047
28061
|
};
|
|
28048
|
-
|
|
28049
|
-
|
|
28062
|
+
const _value = [
|
|
28063
|
+
fileItem,
|
|
28064
|
+
...cloneDeep(modelValue.value || [])
|
|
28065
|
+
];
|
|
28066
|
+
modelValue.value = _value;
|
|
28050
28067
|
nextTick(() => {
|
|
28068
|
+
emit("change", _value);
|
|
28051
28069
|
if (status === "pending" && isFunction$1(_uploadHelper.value)) {
|
|
28052
28070
|
setFileItem({
|
|
28053
28071
|
key: fileItem.key,
|
|
@@ -28069,7 +28087,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28069
28087
|
}
|
|
28070
28088
|
async function deleteFile(key) {
|
|
28071
28089
|
const fileList = cloneDeep(modelValue.value) || [];
|
|
28072
|
-
const index2 = (fileList || []).findIndex(
|
|
28090
|
+
const index2 = (fileList || []).findIndex(
|
|
28091
|
+
(e) => e.key === key
|
|
28092
|
+
);
|
|
28073
28093
|
if (index2 >= 0) {
|
|
28074
28094
|
const { status } = fileList[index2];
|
|
28075
28095
|
const fileItem = fileList[index2];
|
|
@@ -28077,6 +28097,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28077
28097
|
fileList.splice(index2, 1);
|
|
28078
28098
|
modelValue.value = fileList;
|
|
28079
28099
|
emit("delete", key);
|
|
28100
|
+
nextTick(() => {
|
|
28101
|
+
emit("change", fileList);
|
|
28102
|
+
});
|
|
28080
28103
|
return;
|
|
28081
28104
|
}
|
|
28082
28105
|
if (props.beforeDelete && isFunction$1(props.beforeDelete)) {
|
|
@@ -28088,6 +28111,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28088
28111
|
fileList.splice(index2, 1);
|
|
28089
28112
|
modelValue.value = fileList;
|
|
28090
28113
|
emit("delete", key);
|
|
28114
|
+
nextTick(() => {
|
|
28115
|
+
emit("change", fileList);
|
|
28116
|
+
});
|
|
28091
28117
|
}
|
|
28092
28118
|
}
|
|
28093
28119
|
function reUpload(key) {
|
|
@@ -28171,7 +28197,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28171
28197
|
function setFileItem(item) {
|
|
28172
28198
|
const { key, percent } = item;
|
|
28173
28199
|
const fileList = cloneDeep(modelValue.value) || [];
|
|
28174
|
-
const index2 = (fileList || []).findIndex(
|
|
28200
|
+
const index2 = (fileList || []).findIndex(
|
|
28201
|
+
(e) => e.key === key
|
|
28202
|
+
);
|
|
28175
28203
|
let _percent = percent || 0;
|
|
28176
28204
|
if (index2 >= 0) {
|
|
28177
28205
|
if (percent) {
|
|
@@ -28186,6 +28214,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28186
28214
|
fileList[index2] = { ...fileList[index2], ...item, percent: _percent };
|
|
28187
28215
|
}
|
|
28188
28216
|
modelValue.value = fileList;
|
|
28217
|
+
nextTick(() => {
|
|
28218
|
+
emit("change", fileList);
|
|
28219
|
+
});
|
|
28189
28220
|
}
|
|
28190
28221
|
const getUploadLabelClass = computed(() => {
|
|
28191
28222
|
const { disabled, readonly: readonly2, viewMode } = props;
|
|
@@ -28311,7 +28342,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28311
28342
|
};
|
|
28312
28343
|
}
|
|
28313
28344
|
});
|
|
28314
|
-
const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
28345
|
+
const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-fe1dc1c2"]]);
|
|
28315
28346
|
const statusValues = ["online", "processing", "away", "offline", "busy"];
|
|
28316
28347
|
const placementValues = ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
28317
28348
|
const shapeValues = ["circle", "square", "sharp"];
|
|
@@ -30187,7 +30218,7 @@ const contextMenuProps = {
|
|
|
30187
30218
|
}
|
|
30188
30219
|
};
|
|
30189
30220
|
const MENU_SHOW_DELAY = 120;
|
|
30190
|
-
const MENU_DESTROY_DELAY =
|
|
30221
|
+
const MENU_DESTROY_DELAY = 300;
|
|
30191
30222
|
const ATTR_MENU_ID = "lew-context-menu-id";
|
|
30192
30223
|
const ATTR_DATA_LEW = "data-lew";
|
|
30193
30224
|
function initLewContextMenu() {
|
|
@@ -30200,7 +30231,7 @@ function initLewContextMenu() {
|
|
|
30200
30231
|
interactive: true,
|
|
30201
30232
|
placement: "right-start",
|
|
30202
30233
|
duration: [250, 250],
|
|
30203
|
-
delay: [
|
|
30234
|
+
delay: [120, 120],
|
|
30204
30235
|
arrow: false,
|
|
30205
30236
|
appendTo: () => document.body,
|
|
30206
30237
|
allowHTML: true,
|
|
@@ -30457,7 +30488,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
30457
30488
|
return proxy;
|
|
30458
30489
|
}
|
|
30459
30490
|
function clickItem(item) {
|
|
30460
|
-
if (item.disabled)
|
|
30491
|
+
if (item.disabled)
|
|
30492
|
+
return;
|
|
30461
30493
|
const instance = props.dropdownInstance || window.LewContextMenu?.instance || null;
|
|
30462
30494
|
if (isFunction$1(item.onClick)) {
|
|
30463
30495
|
const proxyItem = createItemProxy(item);
|
|
@@ -30616,7 +30648,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
30616
30648
|
};
|
|
30617
30649
|
}
|
|
30618
30650
|
});
|
|
30619
|
-
const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
30651
|
+
const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a2ddcebf"]]);
|
|
30620
30652
|
const dropdownModel = {
|
|
30621
30653
|
selectedKeys: {
|
|
30622
30654
|
type: Array,
|
|
@@ -30990,7 +31022,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
30990
31022
|
};
|
|
30991
31023
|
}
|
|
30992
31024
|
});
|
|
30993
|
-
const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
31025
|
+
const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4a79a5c9"]]);
|
|
30994
31026
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
30995
31027
|
__name: "LewMenuTree",
|
|
30996
31028
|
props: /* @__PURE__ */ mergeModels(menuTreeProps, {
|