lew-ui 2.7.60 → 2.7.62
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 +147 -108
- 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) {
|
|
@@ -8832,10 +8829,15 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8832
8829
|
right: "end",
|
|
8833
8830
|
end: "end"
|
|
8834
8831
|
};
|
|
8832
|
+
const width = column.width;
|
|
8833
|
+
let calculatedWidth = width;
|
|
8834
|
+
if (!state.isScrollbarVisible && !column.fixed) {
|
|
8835
|
+
calculatedWidth = width / (totalColumnWidth.value - fixedWidths.value.left - fixedWidths.value.right) * (state.scrollClientWidth - fixedWidths.value.left - fixedWidths.value.right);
|
|
8836
|
+
}
|
|
8835
8837
|
const tdStyle = {
|
|
8836
8838
|
display: "flex",
|
|
8837
8839
|
flexDirection: "column",
|
|
8838
|
-
width: any2px(
|
|
8840
|
+
width: any2px(calculatedWidth),
|
|
8839
8841
|
justifyContent: "center",
|
|
8840
8842
|
alignItems: xMap[column.x] || "start"
|
|
8841
8843
|
};
|
|
@@ -8844,7 +8846,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8844
8846
|
display: "flex",
|
|
8845
8847
|
alignItems: "center",
|
|
8846
8848
|
justifyContent: xMap[column.x],
|
|
8847
|
-
width: any2px(
|
|
8849
|
+
width: any2px(calculatedWidth),
|
|
8848
8850
|
height: "100%",
|
|
8849
8851
|
boxSizing: "border-box"
|
|
8850
8852
|
};
|
|
@@ -8881,8 +8883,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8881
8883
|
column?.title,
|
|
8882
8884
|
column.sortable && h(SortIcon, {
|
|
8883
8885
|
"sort-value": sortValue.value[column.field],
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
+
size: props.size,
|
|
8887
|
+
class: "lew-table-sorter"
|
|
8886
8888
|
})
|
|
8887
8889
|
]
|
|
8888
8890
|
}
|
|
@@ -8926,8 +8928,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8926
8928
|
}
|
|
8927
8929
|
}
|
|
8928
8930
|
function updateScrollState() {
|
|
8929
|
-
if (!tableRef.value)
|
|
8930
|
-
return;
|
|
8931
|
+
if (!tableRef.value) return;
|
|
8931
8932
|
const element = tableRef.value;
|
|
8932
8933
|
const { clientWidth, scrollWidth, scrollLeft } = element;
|
|
8933
8934
|
if (scrollWidth === clientWidth) {
|
|
@@ -8999,8 +9000,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
8999
9000
|
}
|
|
9000
9001
|
const handleTableResize = throttle(() => {
|
|
9001
9002
|
const table = tableRef.value;
|
|
9002
|
-
if (!table)
|
|
9003
|
-
return;
|
|
9003
|
+
if (!table) return;
|
|
9004
9004
|
const newScrollClientWidth = table.clientWidth;
|
|
9005
9005
|
const newIsScroll = table.scrollWidth > table.clientWidth + 5;
|
|
9006
9006
|
if (state.scrollClientWidth !== newScrollClientWidth) {
|
|
@@ -9058,8 +9058,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9058
9058
|
}
|
|
9059
9059
|
const throttledTooltipUpdate = throttle(updateTooltipPosition, TOOLTIP_THROTTLE_DELAY);
|
|
9060
9060
|
function dragStart(event, row, index2) {
|
|
9061
|
-
if (!props.sortable)
|
|
9062
|
-
return;
|
|
9061
|
+
if (!props.sortable) return;
|
|
9063
9062
|
initDragState();
|
|
9064
9063
|
computeTableRowHeight();
|
|
9065
9064
|
state.dragIndex = index2;
|
|
@@ -9144,8 +9143,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9144
9143
|
}
|
|
9145
9144
|
function updateDragTarget(mouseY) {
|
|
9146
9145
|
state.lastMouseY = mouseY;
|
|
9147
|
-
if (!state.dragRowId || Object.keys(state.trPositionsMap).length === 0)
|
|
9148
|
-
return;
|
|
9146
|
+
if (!state.dragRowId || Object.keys(state.trPositionsMap).length === 0) return;
|
|
9149
9147
|
const dragDistance = Math.abs(state.initialDragY - mouseY);
|
|
9150
9148
|
const minDragDistance = 5;
|
|
9151
9149
|
if (dragDistance < minDragDistance) {
|
|
@@ -9159,8 +9157,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9159
9157
|
}));
|
|
9160
9158
|
positionEntries.sort((a, b) => a.top - b.top);
|
|
9161
9159
|
for (const entry of positionEntries) {
|
|
9162
|
-
if (entry.id === state.dragRowId)
|
|
9163
|
-
continue;
|
|
9160
|
+
if (entry.id === state.dragRowId) continue;
|
|
9164
9161
|
const position = entry;
|
|
9165
9162
|
if (mouseY >= position.top && mouseY <= position.bottom) {
|
|
9166
9163
|
targetRowId = position.id;
|
|
@@ -9170,10 +9167,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9170
9167
|
}
|
|
9171
9168
|
if (!targetRowId) {
|
|
9172
9169
|
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;
|
|
9170
|
+
if (positionEntries[i].id === state.dragRowId) continue;
|
|
9171
|
+
if (positionEntries[i + 1].id === state.dragRowId) continue;
|
|
9177
9172
|
if (mouseY > positionEntries[i].bottom && mouseY < positionEntries[i + 1].top) {
|
|
9178
9173
|
if (mouseY - positionEntries[i].bottom < positionEntries[i + 1].top - mouseY) {
|
|
9179
9174
|
targetRowId = positionEntries[i].id;
|
|
@@ -9208,8 +9203,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9208
9203
|
`;
|
|
9209
9204
|
}
|
|
9210
9205
|
const targetPosition = state.trPositionsMap[state.targetRowId];
|
|
9211
|
-
if (!targetPosition)
|
|
9212
|
-
return "display: none;";
|
|
9206
|
+
if (!targetPosition) return "display: none;";
|
|
9213
9207
|
const top2 = state.isAboveTarget ? targetPosition.top : targetPosition.bottom;
|
|
9214
9208
|
const tableRect = tableRef.value?.getBoundingClientRect();
|
|
9215
9209
|
const offsetTop = tableRect ? top2 - tableRect.top : 0;
|
|
@@ -9228,8 +9222,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
|
|
|
9228
9222
|
});
|
|
9229
9223
|
}
|
|
9230
9224
|
function getRowHeight(row) {
|
|
9231
|
-
if (!row || !row._lew_table_tr_id)
|
|
9232
|
-
return "auto";
|
|
9225
|
+
if (!row || !row._lew_table_tr_id) return "auto";
|
|
9233
9226
|
const height = state.trHeightMap[row._lew_table_tr_id];
|
|
9234
9227
|
if (!height) {
|
|
9235
9228
|
const minHeightMap = {
|
|
@@ -15554,9 +15547,6 @@ function useVirtList(userProps, emitFunction) {
|
|
|
15554
15547
|
slotSize.footerSize = 0;
|
|
15555
15548
|
}
|
|
15556
15549
|
});
|
|
15557
|
-
onActivated(() => {
|
|
15558
|
-
scrollToOffset(reactiveData.offset);
|
|
15559
|
-
});
|
|
15560
15550
|
function getVirtualSize2beginInView() {
|
|
15561
15551
|
return reactiveData.virtualSize + getRangeSize(reactiveData.renderBegin, reactiveData.inViewBegin);
|
|
15562
15552
|
}
|
|
@@ -16273,7 +16263,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16273
16263
|
let _value;
|
|
16274
16264
|
let _items;
|
|
16275
16265
|
if (props.onlyLeafSelectable) {
|
|
16276
|
-
_items = findItemsByValues(selectedKeys.value).filter(
|
|
16266
|
+
_items = findItemsByValues(selectedKeys.value).filter(
|
|
16267
|
+
(item) => item.isLeaf
|
|
16268
|
+
);
|
|
16277
16269
|
_value = _items.map((item) => item.key);
|
|
16278
16270
|
} else {
|
|
16279
16271
|
_value = cloneDeep(selectedKeys.value);
|
|
@@ -16323,7 +16315,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16323
16315
|
state.optionsGroup = [formattedTree];
|
|
16324
16316
|
state.optionsTree = formattedTree;
|
|
16325
16317
|
if (formattedTree.length > 0 && !props.free) {
|
|
16326
|
-
initTreeSelection({
|
|
16318
|
+
initTreeSelection({
|
|
16319
|
+
tree: formattedTree,
|
|
16320
|
+
keys: modelValue.value
|
|
16321
|
+
});
|
|
16327
16322
|
}
|
|
16328
16323
|
} catch (error) {
|
|
16329
16324
|
console.error("Cascader initialization failed:", error);
|
|
@@ -16357,19 +16352,24 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16357
16352
|
updateModelValue();
|
|
16358
16353
|
}
|
|
16359
16354
|
setTimeout(() => {
|
|
16360
|
-
|
|
16355
|
+
if (lewPopoverRef.value) {
|
|
16356
|
+
lewPopoverRef.value.refresh();
|
|
16357
|
+
}
|
|
16361
16358
|
}, 100);
|
|
16362
16359
|
}
|
|
16363
16360
|
function getSelected() {
|
|
16364
16361
|
if (props.multiple) {
|
|
16365
16362
|
return findItemsByValues(modelValue.value);
|
|
16366
16363
|
} else {
|
|
16367
|
-
return findObjectByValue(
|
|
16364
|
+
return findObjectByValue(
|
|
16365
|
+
state.optionsTree,
|
|
16366
|
+
modelValue.value,
|
|
16367
|
+
nodeCache
|
|
16368
|
+
);
|
|
16368
16369
|
}
|
|
16369
16370
|
}
|
|
16370
16371
|
async function selectItem(item, level) {
|
|
16371
|
-
if (item.disabled)
|
|
16372
|
-
return;
|
|
16372
|
+
if (item.disabled) return;
|
|
16373
16373
|
if (!item.isLeaf && !isEqual(item.valuePaths, state.activeValues)) {
|
|
16374
16374
|
state.optionsGroup = state.optionsGroup.slice(0, level + 1);
|
|
16375
16375
|
if (_loadMethod.value && !item.isLeaf) {
|
|
@@ -16406,7 +16406,11 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16406
16406
|
updateModelValue();
|
|
16407
16407
|
});
|
|
16408
16408
|
}
|
|
16409
|
-
const _options = findChildrenByValue(
|
|
16409
|
+
const _options = findChildrenByValue(
|
|
16410
|
+
state.optionsTree,
|
|
16411
|
+
item.value,
|
|
16412
|
+
nodeCache
|
|
16413
|
+
);
|
|
16410
16414
|
state.optionsGroup.push(_options);
|
|
16411
16415
|
loadedDataCache.set(item.value, _options);
|
|
16412
16416
|
loadedData[item.value] = _options;
|
|
@@ -16423,14 +16427,14 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16423
16427
|
}
|
|
16424
16428
|
if (!props.multiple) {
|
|
16425
16429
|
modelValue.value = item.value;
|
|
16430
|
+
emit("change", item.value, toRaw(item));
|
|
16426
16431
|
if (props.onlyLeafSelectable && item.isLeaf) {
|
|
16427
16432
|
setTimeout(() => {
|
|
16428
16433
|
hide2();
|
|
16429
16434
|
}, 100);
|
|
16430
16435
|
}
|
|
16431
16436
|
}
|
|
16432
|
-
if (item.isLeaf)
|
|
16433
|
-
return;
|
|
16437
|
+
if (item.isLeaf) return;
|
|
16434
16438
|
if (isEqual(item.valuePaths, state.activeValues)) {
|
|
16435
16439
|
state.activeValues = item.parentValuePaths || [];
|
|
16436
16440
|
if (level < state.optionsGroup.length - 1) {
|
|
@@ -16639,7 +16643,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16639
16643
|
class: "lew-cascader-icon",
|
|
16640
16644
|
type: "chevron-right"
|
|
16641
16645
|
}, null, 512), [
|
|
16642
|
-
[
|
|
16646
|
+
[
|
|
16647
|
+
vShow,
|
|
16648
|
+
!templateProps.loading && !templateProps.isLeaf
|
|
16649
|
+
]
|
|
16643
16650
|
])
|
|
16644
16651
|
], 2)
|
|
16645
16652
|
], 8, _hoisted_2$s)
|
|
@@ -16659,7 +16666,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
|
16659
16666
|
};
|
|
16660
16667
|
}
|
|
16661
16668
|
});
|
|
16662
|
-
const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-
|
|
16669
|
+
const LewCascader = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-dd8d6365"]]);
|
|
16663
16670
|
const cascaderModel = {
|
|
16664
16671
|
modelValue: {
|
|
16665
16672
|
type: String
|
|
@@ -22877,6 +22884,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22877
22884
|
}
|
|
22878
22885
|
function inputFn(e) {
|
|
22879
22886
|
const target = e.target;
|
|
22887
|
+
checkValidationMessage();
|
|
22880
22888
|
emit("input", target.value);
|
|
22881
22889
|
validationMessage.value = lewInputRef.value.validationMessage;
|
|
22882
22890
|
}
|
|
@@ -22936,6 +22944,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22936
22944
|
lewInputRef.value.stepUp();
|
|
22937
22945
|
modelValue.value = Number(lewInputRef.value.value);
|
|
22938
22946
|
emit("change", cloneDeep(modelValue.value));
|
|
22947
|
+
checkValidationMessage();
|
|
22939
22948
|
if (props.max !== void 0 && lewInputRef.value.value >= Number(props.max || 0)) {
|
|
22940
22949
|
clearTimer();
|
|
22941
22950
|
}
|
|
@@ -22950,6 +22959,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22950
22959
|
lewInputRef.value.stepDown();
|
|
22951
22960
|
modelValue.value = Number(lewInputRef.value.value);
|
|
22952
22961
|
emit("change", cloneDeep(modelValue.value));
|
|
22962
|
+
checkValidationMessage();
|
|
22953
22963
|
if (props.min !== void 0 && lewInputRef.value.value <= Number(props.min || 0)) {
|
|
22954
22964
|
clearTimer();
|
|
22955
22965
|
}
|
|
@@ -22966,12 +22976,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22966
22976
|
__expose({ focus, validCheck });
|
|
22967
22977
|
return (_ctx, _cache) => {
|
|
22968
22978
|
const _directive_tooltip = resolveDirective("tooltip");
|
|
22969
|
-
return openBlock(), createElementBlock("div", {
|
|
22979
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
22970
22980
|
class: normalizeClass(["lew-input-number-view", unref(getInputClassNames)]),
|
|
22971
22981
|
style: normalizeStyle(unref(getInputNumberViewStyle)),
|
|
22972
22982
|
onWheel: _cache[3] || (_cache[3] = (e) => e.preventDefault()),
|
|
22973
|
-
onMouseenter: checkValidationMessage
|
|
22974
|
-
onMouseleave: _cache[4] || (_cache[4] = ($event) => validationMessage.value = "")
|
|
22983
|
+
onMouseenter: checkValidationMessage
|
|
22975
22984
|
}, [
|
|
22976
22985
|
withDirectives(createElementVNode("input", {
|
|
22977
22986
|
ref_key: "lewInputRef",
|
|
@@ -22989,11 +22998,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
22989
22998
|
onChange: changeFn,
|
|
22990
22999
|
onFocus: focusFn
|
|
22991
23000
|
}, null, 44, _hoisted_1$q), [
|
|
22992
|
-
[vModelText, modelValue.value]
|
|
22993
|
-
[_directive_tooltip, {
|
|
22994
|
-
content: unref(validationMessage),
|
|
22995
|
-
triggerFrom: "input-number"
|
|
22996
|
-
}]
|
|
23001
|
+
[vModelText, modelValue.value]
|
|
22997
23002
|
]),
|
|
22998
23003
|
createVNode(unref(LewFlex), {
|
|
22999
23004
|
style: normalizeStyle(unref(getControlStyle)),
|
|
@@ -23024,11 +23029,16 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
23024
23029
|
]),
|
|
23025
23030
|
_: 1
|
|
23026
23031
|
}, 8, ["style"])
|
|
23027
|
-
], 38)
|
|
23032
|
+
], 38)), [
|
|
23033
|
+
[_directive_tooltip, {
|
|
23034
|
+
content: unref(validationMessage),
|
|
23035
|
+
triggerFrom: "input-number"
|
|
23036
|
+
}]
|
|
23037
|
+
]);
|
|
23028
23038
|
};
|
|
23029
23039
|
}
|
|
23030
23040
|
});
|
|
23031
|
-
const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-
|
|
23041
|
+
const LewInputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-aa6b53e5"]]);
|
|
23032
23042
|
const inputTableEmits = {
|
|
23033
23043
|
change: (value) => value
|
|
23034
23044
|
};
|
|
@@ -23675,22 +23685,12 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23675
23685
|
const isTagMarkedForDeletion = ref(false);
|
|
23676
23686
|
const autoWidthDelay = ref(false);
|
|
23677
23687
|
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
|
-
});
|
|
23688
|
+
function attachKeydownListener() {
|
|
23691
23689
|
originalKeydownHandler = document.onkeydown;
|
|
23692
23690
|
document.onkeydown = function(event) {
|
|
23693
23691
|
const keyCode = event.key || event.code;
|
|
23692
|
+
if (!isInputActive.value)
|
|
23693
|
+
return;
|
|
23694
23694
|
if (inputValue.value) {
|
|
23695
23695
|
if (keyCode === "Enter" || keyCode === "NumpadEnter") {
|
|
23696
23696
|
isTagMarkedForDeletion.value = false;
|
|
@@ -23721,24 +23721,33 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23721
23721
|
isTagMarkedForDeletion.value = true;
|
|
23722
23722
|
}
|
|
23723
23723
|
}
|
|
23724
|
-
if (keyCode === "Enter" || keyCode === "NumpadEnter") {
|
|
23725
|
-
if (lewInputRef.value && typeof lewInputRef.value.blur === "function") {
|
|
23726
|
-
lewInputRef.value.blur();
|
|
23727
|
-
}
|
|
23728
|
-
}
|
|
23729
23724
|
}
|
|
23730
23725
|
};
|
|
23731
23726
|
}
|
|
23732
|
-
|
|
23727
|
+
function detachKeydownListener() {
|
|
23733
23728
|
if (document.onkeydown && document.onkeydown !== originalKeydownHandler) {
|
|
23734
23729
|
document.onkeydown = originalKeydownHandler;
|
|
23735
23730
|
}
|
|
23736
|
-
}
|
|
23731
|
+
}
|
|
23732
|
+
function openInput() {
|
|
23733
|
+
if (isInputActive.value || props.disabled || props.readonly)
|
|
23734
|
+
return;
|
|
23735
|
+
if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
|
|
23736
|
+
LewMessage.warning(locale.t("inputTag.maxLength", { maxLength: props.maxLength }));
|
|
23737
|
+
return;
|
|
23738
|
+
}
|
|
23739
|
+
isInputActive.value = true;
|
|
23740
|
+
nextTick(() => {
|
|
23741
|
+
if (lewInputRef.value && typeof lewInputRef.value?.focus === "function") {
|
|
23742
|
+
lewInputRef.value?.focus();
|
|
23743
|
+
}
|
|
23744
|
+
});
|
|
23745
|
+
attachKeydownListener();
|
|
23746
|
+
}
|
|
23737
23747
|
function addTag() {
|
|
23738
23748
|
const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
|
|
23739
|
-
if (!inputValue.value || inputValue.value.trim() === "")
|
|
23749
|
+
if (!inputValue.value || inputValue.value.trim() === "")
|
|
23740
23750
|
return;
|
|
23741
|
-
}
|
|
23742
23751
|
if (props.maxLength > 0 && _value.length >= props.maxLength) {
|
|
23743
23752
|
inputValue.value = "";
|
|
23744
23753
|
isInputActive.value = false;
|
|
@@ -23753,9 +23762,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23753
23762
|
emit("add", addedValue);
|
|
23754
23763
|
}
|
|
23755
23764
|
function delTag(index2) {
|
|
23756
|
-
if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length)
|
|
23765
|
+
if (!Array.isArray(modelValue.value) || index2 < 0 || index2 >= modelValue.value.length)
|
|
23757
23766
|
return;
|
|
23758
|
-
}
|
|
23759
23767
|
const removedTag = modelValue.value[index2];
|
|
23760
23768
|
const newValue = [...modelValue.value];
|
|
23761
23769
|
newValue.splice(index2, 1);
|
|
@@ -23769,6 +23777,26 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23769
23777
|
emit("change", cloneDeep(newValue));
|
|
23770
23778
|
emit("remove", removedTag, index2);
|
|
23771
23779
|
}
|
|
23780
|
+
function clear() {
|
|
23781
|
+
modelValue.value = [];
|
|
23782
|
+
inputValue.value = "";
|
|
23783
|
+
emit("clear");
|
|
23784
|
+
emit("change", void 0);
|
|
23785
|
+
}
|
|
23786
|
+
function onBlur() {
|
|
23787
|
+
isInputActive.value = false;
|
|
23788
|
+
isTagMarkedForDeletion.value = false;
|
|
23789
|
+
detachKeydownListener();
|
|
23790
|
+
if (inputValue.value) {
|
|
23791
|
+
addTag();
|
|
23792
|
+
}
|
|
23793
|
+
}
|
|
23794
|
+
function onFocus() {
|
|
23795
|
+
if (props.disabled || props.readonly)
|
|
23796
|
+
return;
|
|
23797
|
+
isInputActive.value = true;
|
|
23798
|
+
attachKeydownListener();
|
|
23799
|
+
}
|
|
23772
23800
|
const getInputClassNames = computed(() => {
|
|
23773
23801
|
const { size, readonly: readonly2, disabled, clearable } = props;
|
|
23774
23802
|
return object2class("lew-input-tag-view", {
|
|
@@ -23786,19 +23814,6 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23786
23814
|
};
|
|
23787
23815
|
return size[props.size] || 14;
|
|
23788
23816
|
});
|
|
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
23817
|
const shouldShowIcon = computed(
|
|
23803
23818
|
() => !((modelValue.value || []).length > 0 && props.clearable)
|
|
23804
23819
|
);
|
|
@@ -23812,6 +23827,9 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23812
23827
|
color: isTagMarkedForDeletion.value && index2 === (modelValue.value || []).length - 1 ? "var(--lew-color-red-dark)" : "var(--lew-color-primary-dark)"
|
|
23813
23828
|
};
|
|
23814
23829
|
});
|
|
23830
|
+
onUnmounted(() => {
|
|
23831
|
+
detachKeydownListener();
|
|
23832
|
+
});
|
|
23815
23833
|
return (_ctx, _cache) => {
|
|
23816
23834
|
return openBlock(), createElementBlock("div", {
|
|
23817
23835
|
class: normalizeClass(["lew-input-tag-view", unref(getInputClassNames)]),
|
|
@@ -23852,6 +23870,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23852
23870
|
readonly: !unref(isInputActive),
|
|
23853
23871
|
placeholder: (modelValue.value || []).length === 0 ? unref(locale).t("inputTag.placeholder") : " ",
|
|
23854
23872
|
onInput: _cache[1] || (_cache[1] = ($event) => isTagMarkedForDeletion.value = false),
|
|
23873
|
+
onFocus,
|
|
23855
23874
|
onBlur
|
|
23856
23875
|
}, null, 8, ["modelValue", "auto-width", "size", "readonly", "placeholder"])) : createCommentVNode("", true)
|
|
23857
23876
|
]),
|
|
@@ -23885,7 +23904,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
23885
23904
|
};
|
|
23886
23905
|
}
|
|
23887
23906
|
});
|
|
23888
|
-
const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-
|
|
23907
|
+
const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-d9c5ffa5"]]);
|
|
23889
23908
|
const radioEmits = {
|
|
23890
23909
|
change: () => true
|
|
23891
23910
|
};
|
|
@@ -27324,7 +27343,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
27324
27343
|
};
|
|
27325
27344
|
}
|
|
27326
27345
|
});
|
|
27327
|
-
const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-
|
|
27346
|
+
const LewTreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-0f4c61a3"]]);
|
|
27328
27347
|
const uploadEmits = {
|
|
27329
27348
|
change: (files) => files,
|
|
27330
27349
|
delete: (file) => file
|
|
@@ -27991,13 +28010,15 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
27991
28010
|
medium: 12,
|
|
27992
28011
|
large: 14
|
|
27993
28012
|
};
|
|
27994
|
-
const uploadIconFontSizeMap = computed(
|
|
27995
|
-
|
|
27996
|
-
|
|
27997
|
-
|
|
27998
|
-
|
|
27999
|
-
|
|
28000
|
-
|
|
28013
|
+
const uploadIconFontSizeMap = computed(
|
|
28014
|
+
() => {
|
|
28015
|
+
return {
|
|
28016
|
+
small: props.viewMode === "list" ? 28 : 22,
|
|
28017
|
+
medium: props.viewMode === "list" ? 30 : 24,
|
|
28018
|
+
large: props.viewMode === "list" ? 32 : 26
|
|
28019
|
+
};
|
|
28020
|
+
}
|
|
28021
|
+
);
|
|
28001
28022
|
const uploadPaddingMap = computed(() => {
|
|
28002
28023
|
return {
|
|
28003
28024
|
small: props.viewMode === "list" ? "10px 8px" : "14px",
|
|
@@ -28045,9 +28066,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28045
28066
|
lastModified,
|
|
28046
28067
|
file: item
|
|
28047
28068
|
};
|
|
28048
|
-
|
|
28049
|
-
|
|
28069
|
+
const _value = [
|
|
28070
|
+
fileItem,
|
|
28071
|
+
...cloneDeep(modelValue.value || [])
|
|
28072
|
+
];
|
|
28073
|
+
modelValue.value = _value;
|
|
28050
28074
|
nextTick(() => {
|
|
28075
|
+
emit("change", _value);
|
|
28051
28076
|
if (status === "pending" && isFunction$1(_uploadHelper.value)) {
|
|
28052
28077
|
setFileItem({
|
|
28053
28078
|
key: fileItem.key,
|
|
@@ -28069,7 +28094,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28069
28094
|
}
|
|
28070
28095
|
async function deleteFile(key) {
|
|
28071
28096
|
const fileList = cloneDeep(modelValue.value) || [];
|
|
28072
|
-
const index2 = (fileList || []).findIndex(
|
|
28097
|
+
const index2 = (fileList || []).findIndex(
|
|
28098
|
+
(e) => e.key === key
|
|
28099
|
+
);
|
|
28073
28100
|
if (index2 >= 0) {
|
|
28074
28101
|
const { status } = fileList[index2];
|
|
28075
28102
|
const fileItem = fileList[index2];
|
|
@@ -28077,6 +28104,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28077
28104
|
fileList.splice(index2, 1);
|
|
28078
28105
|
modelValue.value = fileList;
|
|
28079
28106
|
emit("delete", key);
|
|
28107
|
+
nextTick(() => {
|
|
28108
|
+
emit("change", fileList);
|
|
28109
|
+
});
|
|
28080
28110
|
return;
|
|
28081
28111
|
}
|
|
28082
28112
|
if (props.beforeDelete && isFunction$1(props.beforeDelete)) {
|
|
@@ -28088,6 +28118,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28088
28118
|
fileList.splice(index2, 1);
|
|
28089
28119
|
modelValue.value = fileList;
|
|
28090
28120
|
emit("delete", key);
|
|
28121
|
+
nextTick(() => {
|
|
28122
|
+
emit("change", fileList);
|
|
28123
|
+
});
|
|
28091
28124
|
}
|
|
28092
28125
|
}
|
|
28093
28126
|
function reUpload(key) {
|
|
@@ -28171,7 +28204,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28171
28204
|
function setFileItem(item) {
|
|
28172
28205
|
const { key, percent } = item;
|
|
28173
28206
|
const fileList = cloneDeep(modelValue.value) || [];
|
|
28174
|
-
const index2 = (fileList || []).findIndex(
|
|
28207
|
+
const index2 = (fileList || []).findIndex(
|
|
28208
|
+
(e) => e.key === key
|
|
28209
|
+
);
|
|
28175
28210
|
let _percent = percent || 0;
|
|
28176
28211
|
if (index2 >= 0) {
|
|
28177
28212
|
if (percent) {
|
|
@@ -28186,6 +28221,9 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28186
28221
|
fileList[index2] = { ...fileList[index2], ...item, percent: _percent };
|
|
28187
28222
|
}
|
|
28188
28223
|
modelValue.value = fileList;
|
|
28224
|
+
nextTick(() => {
|
|
28225
|
+
emit("change", fileList);
|
|
28226
|
+
});
|
|
28189
28227
|
}
|
|
28190
28228
|
const getUploadLabelClass = computed(() => {
|
|
28191
28229
|
const { disabled, readonly: readonly2, viewMode } = props;
|
|
@@ -28311,7 +28349,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
28311
28349
|
};
|
|
28312
28350
|
}
|
|
28313
28351
|
});
|
|
28314
|
-
const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-
|
|
28352
|
+
const LewUpload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-fe1dc1c2"]]);
|
|
28315
28353
|
const statusValues = ["online", "processing", "away", "offline", "busy"];
|
|
28316
28354
|
const placementValues = ["top-left", "top-right", "bottom-left", "bottom-right"];
|
|
28317
28355
|
const shapeValues = ["circle", "square", "sharp"];
|
|
@@ -30187,7 +30225,7 @@ const contextMenuProps = {
|
|
|
30187
30225
|
}
|
|
30188
30226
|
};
|
|
30189
30227
|
const MENU_SHOW_DELAY = 120;
|
|
30190
|
-
const MENU_DESTROY_DELAY =
|
|
30228
|
+
const MENU_DESTROY_DELAY = 300;
|
|
30191
30229
|
const ATTR_MENU_ID = "lew-context-menu-id";
|
|
30192
30230
|
const ATTR_DATA_LEW = "data-lew";
|
|
30193
30231
|
function initLewContextMenu() {
|
|
@@ -30200,7 +30238,7 @@ function initLewContextMenu() {
|
|
|
30200
30238
|
interactive: true,
|
|
30201
30239
|
placement: "right-start",
|
|
30202
30240
|
duration: [250, 250],
|
|
30203
|
-
delay: [
|
|
30241
|
+
delay: [120, 120],
|
|
30204
30242
|
arrow: false,
|
|
30205
30243
|
appendTo: () => document.body,
|
|
30206
30244
|
allowHTML: true,
|
|
@@ -30457,7 +30495,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
30457
30495
|
return proxy;
|
|
30458
30496
|
}
|
|
30459
30497
|
function clickItem(item) {
|
|
30460
|
-
if (item.disabled)
|
|
30498
|
+
if (item.disabled)
|
|
30499
|
+
return;
|
|
30461
30500
|
const instance = props.dropdownInstance || window.LewContextMenu?.instance || null;
|
|
30462
30501
|
if (isFunction$1(item.onClick)) {
|
|
30463
30502
|
const proxyItem = createItemProxy(item);
|
|
@@ -30616,7 +30655,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
30616
30655
|
};
|
|
30617
30656
|
}
|
|
30618
30657
|
});
|
|
30619
|
-
const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
30658
|
+
const LewContextMenu = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a2ddcebf"]]);
|
|
30620
30659
|
const dropdownModel = {
|
|
30621
30660
|
selectedKeys: {
|
|
30622
30661
|
type: Array,
|
|
@@ -30990,7 +31029,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
30990
31029
|
};
|
|
30991
31030
|
}
|
|
30992
31031
|
});
|
|
30993
|
-
const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
31032
|
+
const LewMenuTreeItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-871c625a"]]);
|
|
30994
31033
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
30995
31034
|
__name: "LewMenuTree",
|
|
30996
31035
|
props: /* @__PURE__ */ mergeModels(menuTreeProps, {
|