@uzum-tech/ui 2.0.5 → 2.0.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/dist/index.js +1183 -573
- package/dist/index.mjs +1183 -573
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/_internal/icons/DragHandleRound.mjs +16 -0
- package/es/_internal/icons/index.d.ts +1 -1
- package/es/_internal/icons/index.mjs +1 -1
- package/es/components.d.ts +99 -30
- package/es/data-table/src/DataTable.d.ts +24 -0
- package/es/data-table/src/DataTable.mjs +31 -0
- package/es/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
- package/es/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
- package/es/data-table/src/TableParts/Body.d.ts +17 -9
- package/es/data-table/src/TableParts/Body.mjs +81 -274
- package/es/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
- package/es/data-table/src/TableParts/BodyEmpty.mjs +22 -0
- package/es/data-table/src/TableParts/BodyRow.d.ts +3 -0
- package/es/data-table/src/TableParts/BodyRow.mjs +257 -0
- package/es/data-table/src/TableParts/BodySkeleton.mjs +5 -2
- package/es/data-table/src/TableParts/Header.d.ts +6 -0
- package/es/data-table/src/TableParts/Header.mjs +5 -1
- package/es/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
- package/es/data-table/src/TableParts/VirtualListItemWrapper.mjs +46 -0
- package/es/data-table/src/interface.d.ts +161 -2
- package/es/data-table/src/styles/index.cssr.mjs +26 -3
- package/es/data-table/src/use-group-header.d.ts +3 -3
- package/es/data-table/src/use-row-drag.d.ts +2 -0
- package/es/data-table/src/use-row-drag.mjs +241 -0
- package/es/data-table/src/use-sorter.d.ts +4 -8
- package/es/data-table/src/use-sorter.mjs +14 -2
- package/es/data-table/src/use-table-data.d.ts +11 -14
- package/es/data-table/src/use-table-data.mjs +4 -2
- package/es/data-table/src/use-table-storage.d.ts +2 -2
- package/es/data-table/src/use-table-storage.mjs +1 -1
- package/es/data-table/src/utils/column-utils.d.ts +3 -2
- package/es/data-table/src/utils/column-utils.mjs +9 -1
- package/es/data-table/src/utils/csv-utils.mjs +1 -1
- package/es/data-table/src/utils/flatten-rows.d.ts +2 -0
- package/es/data-table/src/utils/flatten-rows.mjs +33 -0
- package/es/data-table/src/utils/index.d.ts +1 -0
- package/es/data-table/src/utils/index.mjs +1 -0
- package/es/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
- package/es/data-table/src/utils/width-utils.d.ts +2 -2
- package/es/data-table/styles/light.d.ts +6 -0
- package/es/data-table/styles/light.mjs +3 -0
- package/es/mapping-card/src/MappingCard.d.ts +8 -0
- package/es/mapping-card/src/MappingCard.mjs +3 -1
- package/es/mapping-card/src/MappingCardParts/Header.mjs +31 -10
- package/es/mapping-card/src/interface.d.ts +8 -0
- package/es/mapping-card/src/interface.mjs +4 -0
- package/es/mapping-card/src/styles/index.cssr.mjs +8 -1
- package/es/tree/src/Tree.d.ts +49 -24
- package/es/tree/src/Tree.mjs +18 -13
- package/es/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/es/tree/src/TreeNodeSwitcher.mjs +24 -26
- package/es/tree/src/styles/index.cssr.mjs +11 -8
- package/es/tree/styles/light.d.ts +4 -0
- package/es/tree/styles/light.mjs +2 -0
- package/es/tree-select/index.d.ts +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +43 -16
- package/es/tree-select/src/TreeSelect.mjs +65 -35
- package/es/tree-select/src/interface.d.ts +6 -1
- package/es/tree-select/src/scroll-option-end.d.ts +3 -0
- package/es/tree-select/src/scroll-option-end.mjs +28 -0
- package/es/tree-select/styles/light.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/DragHandleRound.js +10 -0
- package/lib/_internal/icons/index.d.ts +1 -1
- package/lib/_internal/icons/index.js +4 -4
- package/lib/components.d.ts +99 -30
- package/lib/data-table/src/DataTable.d.ts +24 -0
- package/lib/data-table/src/DataTable.js +19 -1
- package/lib/data-table/src/HeaderButton/FilterButton.d.ts +6 -0
- package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +6 -0
- package/lib/data-table/src/TableParts/Body.d.ts +18 -10
- package/lib/data-table/src/TableParts/Body.js +65 -237
- package/lib/data-table/src/TableParts/BodyEmpty.d.ts +3 -0
- package/lib/data-table/src/TableParts/BodyEmpty.js +15 -0
- package/lib/data-table/src/TableParts/BodyRow.d.ts +3 -0
- package/lib/data-table/src/TableParts/BodyRow.js +210 -0
- package/lib/data-table/src/TableParts/BodySkeleton.js +8 -2
- package/lib/data-table/src/TableParts/Header.d.ts +6 -0
- package/lib/data-table/src/TableParts/Header.js +6 -0
- package/lib/data-table/src/TableParts/VirtualListItemWrapper.d.ts +36 -0
- package/lib/data-table/src/TableParts/VirtualListItemWrapper.js +29 -0
- package/lib/data-table/src/interface.d.ts +161 -2
- package/lib/data-table/src/styles/index.cssr.js +26 -3
- package/lib/data-table/src/use-group-header.d.ts +3 -3
- package/lib/data-table/src/use-row-drag.d.ts +2 -0
- package/lib/data-table/src/use-row-drag.js +270 -0
- package/lib/data-table/src/use-sorter.d.ts +4 -8
- package/lib/data-table/src/use-sorter.js +14 -0
- package/lib/data-table/src/use-table-data.d.ts +11 -14
- package/lib/data-table/src/use-table-data.js +5 -1
- package/lib/data-table/src/use-table-storage.d.ts +2 -2
- package/lib/data-table/src/use-table-storage.js +1 -0
- package/lib/data-table/src/utils/column-utils.d.ts +3 -2
- package/lib/data-table/src/utils/column-utils.js +11 -2
- package/lib/data-table/src/utils/csv-utils.js +1 -0
- package/lib/data-table/src/utils/flatten-rows.d.ts +2 -0
- package/lib/data-table/src/utils/flatten-rows.js +35 -0
- package/lib/data-table/src/utils/index.d.ts +1 -0
- package/lib/data-table/src/utils/index.js +1 -0
- package/lib/data-table/src/utils/resize-orchestrator-utils.d.ts +3 -5
- package/lib/data-table/src/utils/width-utils.d.ts +2 -2
- package/lib/data-table/styles/light.d.ts +6 -0
- package/lib/data-table/styles/light.js +3 -0
- package/lib/mapping-card/src/MappingCard.d.ts +8 -0
- package/lib/mapping-card/src/MappingCard.js +5 -1
- package/lib/mapping-card/src/MappingCardParts/Header.js +29 -5
- package/lib/mapping-card/src/interface.d.ts +8 -0
- package/lib/mapping-card/src/interface.js +4 -0
- package/lib/mapping-card/src/styles/index.cssr.js +8 -1
- package/lib/tree/src/Tree.d.ts +49 -24
- package/lib/tree/src/Tree.js +16 -15
- package/lib/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/lib/tree/src/TreeNodeSwitcher.js +11 -14
- package/lib/tree/src/styles/index.cssr.js +11 -8
- package/lib/tree/styles/light.d.ts +4 -0
- package/lib/tree/styles/light.js +2 -0
- package/lib/tree-select/index.d.ts +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +43 -16
- package/lib/tree-select/src/TreeSelect.js +66 -40
- package/lib/tree-select/src/interface.d.ts +6 -1
- package/lib/tree-select/src/scroll-option-end.d.ts +3 -0
- package/lib/tree-select/src/scroll-option-end.js +30 -0
- package/lib/tree-select/styles/light.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/web-types.json +21 -1
- package/es/_internal/icons/Switcher.mjs +0 -12
- package/lib/_internal/icons/Switcher.js +0 -10
- /package/es/_internal/icons/{Switcher.d.ts → DragHandleRound.d.ts} +0 -0
- /package/lib/_internal/icons/{Switcher.d.ts → DragHandleRound.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2370,7 +2370,7 @@ function getSlot$1(scope, slots, slotName = 'default') {
|
|
|
2370
2370
|
return slot();
|
|
2371
2371
|
}
|
|
2372
2372
|
// o(n) flatten
|
|
2373
|
-
function flatten$
|
|
2373
|
+
function flatten$2(vNodes, filterCommentNode = true, result = []) {
|
|
2374
2374
|
vNodes.forEach(vNode => {
|
|
2375
2375
|
if (vNode === null) return;
|
|
2376
2376
|
if (typeof vNode !== 'object') {
|
|
@@ -2380,13 +2380,13 @@ function flatten$3(vNodes, filterCommentNode = true, result = []) {
|
|
|
2380
2380
|
return;
|
|
2381
2381
|
}
|
|
2382
2382
|
if (Array.isArray(vNode)) {
|
|
2383
|
-
flatten$
|
|
2383
|
+
flatten$2(vNode, filterCommentNode, result);
|
|
2384
2384
|
return;
|
|
2385
2385
|
}
|
|
2386
2386
|
if (vNode.type === Fragment) {
|
|
2387
2387
|
if (vNode.children === null) return;
|
|
2388
2388
|
if (Array.isArray(vNode.children)) {
|
|
2389
|
-
flatten$
|
|
2389
|
+
flatten$2(vNode.children, filterCommentNode, result);
|
|
2390
2390
|
}
|
|
2391
2391
|
// rawSlot
|
|
2392
2392
|
} else if (vNode.type !== Comment) {
|
|
@@ -2400,7 +2400,7 @@ function getFirstVNode(scope, slots, slotName = 'default') {
|
|
|
2400
2400
|
if (slot === undefined) {
|
|
2401
2401
|
throw new Error(`[vueuc/${scope}]: slot[${slotName}] is empty.`);
|
|
2402
2402
|
}
|
|
2403
|
-
const content = flatten$
|
|
2403
|
+
const content = flatten$2(slot());
|
|
2404
2404
|
// vue will normalize the slot, so slot must be an array
|
|
2405
2405
|
if (content.length === 1) {
|
|
2406
2406
|
return content[0];
|
|
@@ -5551,7 +5551,7 @@ function createRefSetter(ref) {
|
|
|
5551
5551
|
};
|
|
5552
5552
|
}
|
|
5553
5553
|
|
|
5554
|
-
function flatten$
|
|
5554
|
+
function flatten$1(vNodes, filterCommentNode = true, result = []) {
|
|
5555
5555
|
vNodes.forEach(vNode => {
|
|
5556
5556
|
if (vNode === null) return;
|
|
5557
5557
|
if (typeof vNode !== "object") {
|
|
@@ -5561,13 +5561,13 @@ function flatten$2(vNodes, filterCommentNode = true, result = []) {
|
|
|
5561
5561
|
return;
|
|
5562
5562
|
}
|
|
5563
5563
|
if (Array.isArray(vNode)) {
|
|
5564
|
-
flatten$
|
|
5564
|
+
flatten$1(vNode, filterCommentNode, result);
|
|
5565
5565
|
return;
|
|
5566
5566
|
}
|
|
5567
5567
|
if (vNode.type === Fragment) {
|
|
5568
5568
|
if (vNode.children === null) return;
|
|
5569
5569
|
if (Array.isArray(vNode.children)) {
|
|
5570
|
-
flatten$
|
|
5570
|
+
flatten$1(vNode.children, filterCommentNode, result);
|
|
5571
5571
|
}
|
|
5572
5572
|
} else if (vNode.type !== Comment) {
|
|
5573
5573
|
result.push(vNode);
|
|
@@ -5582,7 +5582,7 @@ function getFirstSlotVNode(slots, slotName = "default", props = void 0) {
|
|
|
5582
5582
|
warn("getFirstSlotVNode", `slot[${slotName}] is empty`);
|
|
5583
5583
|
return null;
|
|
5584
5584
|
}
|
|
5585
|
-
const slotContent = flatten$
|
|
5585
|
+
const slotContent = flatten$1(slot(props));
|
|
5586
5586
|
if (slotContent.length === 1) {
|
|
5587
5587
|
return slotContent[0];
|
|
5588
5588
|
} else {
|
|
@@ -5594,7 +5594,7 @@ function getFirstSlotVNodeWithTypedProps(slotName, slot, props) {
|
|
|
5594
5594
|
if (!slot) {
|
|
5595
5595
|
return null;
|
|
5596
5596
|
}
|
|
5597
|
-
const slotContent = flatten$
|
|
5597
|
+
const slotContent = flatten$1(slot(props));
|
|
5598
5598
|
if (slotContent.length === 1) {
|
|
5599
5599
|
return slotContent[0];
|
|
5600
5600
|
} else {
|
|
@@ -11170,7 +11170,7 @@ function setCacheAdd(value) {
|
|
|
11170
11170
|
* @name has
|
|
11171
11171
|
* @memberOf SetCache
|
|
11172
11172
|
* @param {*} value The value to search for.
|
|
11173
|
-
* @returns {
|
|
11173
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
11174
11174
|
*/
|
|
11175
11175
|
function setCacheHas(value) {
|
|
11176
11176
|
return this.__data__.has(value);
|
|
@@ -14154,6 +14154,29 @@ var DownloadIcon = replaceable(
|
|
|
14154
14154
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, /* @__PURE__ */ h("g", { fill: "currentColor", "fill-rule": "nonzero" }, /* @__PURE__ */ h("path", { d: "M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z" }))))
|
|
14155
14155
|
);
|
|
14156
14156
|
|
|
14157
|
+
var DragHandleRound = defineComponent({
|
|
14158
|
+
name: "DragHandleRound",
|
|
14159
|
+
render() {
|
|
14160
|
+
return /* @__PURE__ */ h(
|
|
14161
|
+
"svg",
|
|
14162
|
+
{
|
|
14163
|
+
width: "24",
|
|
14164
|
+
height: "24",
|
|
14165
|
+
viewBox: "0 0 24 24",
|
|
14166
|
+
fill: "none",
|
|
14167
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
14168
|
+
},
|
|
14169
|
+
/* @__PURE__ */ h(
|
|
14170
|
+
"path",
|
|
14171
|
+
{
|
|
14172
|
+
d: "M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",
|
|
14173
|
+
fill: "currentColor"
|
|
14174
|
+
}
|
|
14175
|
+
)
|
|
14176
|
+
);
|
|
14177
|
+
}
|
|
14178
|
+
});
|
|
14179
|
+
|
|
14157
14180
|
var EditIcon = defineComponent({
|
|
14158
14181
|
name: "Edit",
|
|
14159
14182
|
render() {
|
|
@@ -14783,13 +14806,6 @@ var SuccessIcon = replaceable(
|
|
|
14783
14806
|
))
|
|
14784
14807
|
);
|
|
14785
14808
|
|
|
14786
|
-
var SwitcherIcon = defineComponent({
|
|
14787
|
-
name: "Switcher",
|
|
14788
|
-
render() {
|
|
14789
|
-
return /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, /* @__PURE__ */ h("path", { d: "M12 8l10 8l-10 8z" }));
|
|
14790
|
-
}
|
|
14791
|
-
});
|
|
14792
|
-
|
|
14793
14809
|
var TimeIcon = replaceable(
|
|
14794
14810
|
"time",
|
|
14795
14811
|
/* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, /* @__PURE__ */ h(
|
|
@@ -18005,7 +18021,7 @@ const moveMethods = {
|
|
|
18005
18021
|
}
|
|
18006
18022
|
};
|
|
18007
18023
|
|
|
18008
|
-
function flatten
|
|
18024
|
+
function flatten(treeNodes, expandedKeys) {
|
|
18009
18025
|
const expandedKeySet = expandedKeys ? new Set(expandedKeys) : undefined;
|
|
18010
18026
|
const flattenedNodes = [];
|
|
18011
18027
|
function traverse(treeNodes) {
|
|
@@ -18152,7 +18168,7 @@ function createTreeMate(rawNodes, options = {}) {
|
|
|
18152
18168
|
maxLevel: Math.max(...levelTreeNodeMap.keys()),
|
|
18153
18169
|
getChildren,
|
|
18154
18170
|
getFlattenedNodes(expandedKeys) {
|
|
18155
|
-
return flatten
|
|
18171
|
+
return flatten(treeNodes, expandedKeys);
|
|
18156
18172
|
},
|
|
18157
18173
|
getNode,
|
|
18158
18174
|
getPrev,
|
|
@@ -21147,7 +21163,7 @@ var _UTagGroup = defineComponent({
|
|
|
21147
21163
|
render() {
|
|
21148
21164
|
const { mergedClsPrefix, mergedValue, mergedSize, mergedDisabled } = this;
|
|
21149
21165
|
const children = mapSlot$1(
|
|
21150
|
-
flatten$
|
|
21166
|
+
flatten$1(getSlot(this)),
|
|
21151
21167
|
mergedValue,
|
|
21152
21168
|
mergedSize,
|
|
21153
21169
|
mergedDisabled,
|
|
@@ -39061,7 +39077,7 @@ var UGrid$1 = defineComponent({
|
|
|
39061
39077
|
}
|
|
39062
39078
|
const renderContent = () => {
|
|
39063
39079
|
this.overflow = false;
|
|
39064
|
-
const rawChildren = flatten$
|
|
39080
|
+
const rawChildren = flatten$1(getSlot(this));
|
|
39065
39081
|
const childrenAndRawSpan = [];
|
|
39066
39082
|
const { collapsed, collapsedRows, responsiveCols, responsiveQuery } = this;
|
|
39067
39083
|
rawChildren.forEach((child) => {
|
|
@@ -41023,7 +41039,7 @@ var _UCarousel = defineComponent({
|
|
|
41023
41039
|
dotSlotProps,
|
|
41024
41040
|
$slots: { default: defaultSlot, dots: dotsSlot, arrow: arrowSlot }
|
|
41025
41041
|
} = this;
|
|
41026
|
-
const children = defaultSlot && flatten$
|
|
41042
|
+
const children = defaultSlot && flatten$1(defaultSlot()) || [];
|
|
41027
41043
|
let slides = filterCarouselItem(children);
|
|
41028
41044
|
if (!slides.length) {
|
|
41029
41045
|
slides = children.map((ch) => /* @__PURE__ */ h(_UCarouselItem, null, {
|
|
@@ -43814,7 +43830,7 @@ var _UFlex = defineComponent({
|
|
|
43814
43830
|
mergedClsPrefix,
|
|
43815
43831
|
rtlEnabled
|
|
43816
43832
|
} = this;
|
|
43817
|
-
const children = flatten$
|
|
43833
|
+
const children = flatten$1(getSlot(this), false);
|
|
43818
43834
|
if (!children.length) {
|
|
43819
43835
|
return null;
|
|
43820
43836
|
}
|
|
@@ -46722,6 +46738,9 @@ function self$T(vars) {
|
|
|
46722
46738
|
thButtonColorHover: elementsTertiary,
|
|
46723
46739
|
thIconColor: elementsPrimary,
|
|
46724
46740
|
thIconColorActive: brandPrimary500,
|
|
46741
|
+
dropMarkColor: brandPrimary500,
|
|
46742
|
+
dragGhostOpacity: "0.85",
|
|
46743
|
+
dragGhostFilter: "drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18))",
|
|
46725
46744
|
// modal
|
|
46726
46745
|
borderColorModal: elementsQuaternary,
|
|
46727
46746
|
tdColorHoverModal: elementsTertiary,
|
|
@@ -49191,6 +49210,8 @@ function self$g(vars) {
|
|
|
49191
49210
|
nodeColorPressed: elementsQuaternary,
|
|
49192
49211
|
nodeColorActive: brandPrimary100,
|
|
49193
49212
|
arrowColor: elementsPrimary,
|
|
49213
|
+
switcherColor: elementsTertiary,
|
|
49214
|
+
switcherSize: "22px",
|
|
49194
49215
|
nodeTextColor: textPrimary,
|
|
49195
49216
|
nodeTextColorDisabled: textSecondary,
|
|
49196
49217
|
loadingColor: elementsPrimary,
|
|
@@ -65788,6 +65809,7 @@ function areColumnWidthMapsEqual(previousWidths, nextWidths, keys) {
|
|
|
65788
65809
|
|
|
65789
65810
|
const SELECTION_COL_WIDTH = 40;
|
|
65790
65811
|
const EXPAND_COL_WIDTH = 40;
|
|
65812
|
+
const DRAGGABLE_COL_WIDTH = 40;
|
|
65791
65813
|
function getNumberColWidth(column) {
|
|
65792
65814
|
if (column.type === "selection") {
|
|
65793
65815
|
return column.width === void 0 ? SELECTION_COL_WIDTH : depx(column.width);
|
|
@@ -65795,6 +65817,9 @@ function getNumberColWidth(column) {
|
|
|
65795
65817
|
if (column.type === "expand") {
|
|
65796
65818
|
return column.width === void 0 ? EXPAND_COL_WIDTH : depx(column.width);
|
|
65797
65819
|
}
|
|
65820
|
+
if (column.type === "draggable") {
|
|
65821
|
+
return column.width === void 0 ? DRAGGABLE_COL_WIDTH : depx(column.width);
|
|
65822
|
+
}
|
|
65798
65823
|
if ("children" in column) return void 0;
|
|
65799
65824
|
if (typeof column.width === "string") {
|
|
65800
65825
|
return depx(column.width);
|
|
@@ -65808,6 +65833,9 @@ function getStringColWidth(column) {
|
|
|
65808
65833
|
if (column.type === "expand") {
|
|
65809
65834
|
return formatLength(column.width ?? EXPAND_COL_WIDTH);
|
|
65810
65835
|
}
|
|
65836
|
+
if (column.type === "draggable") {
|
|
65837
|
+
return formatLength(column.width ?? DRAGGABLE_COL_WIDTH);
|
|
65838
|
+
}
|
|
65811
65839
|
if ("children" in column) {
|
|
65812
65840
|
return void 0;
|
|
65813
65841
|
}
|
|
@@ -65816,6 +65844,7 @@ function getStringColWidth(column) {
|
|
|
65816
65844
|
function getColKey(column) {
|
|
65817
65845
|
if (column.type === "selection") return "__n_selection__";
|
|
65818
65846
|
if (column.type === "expand") return "__n_expand__";
|
|
65847
|
+
if (column.type === "draggable") return "__n_draggable__";
|
|
65819
65848
|
return column.key;
|
|
65820
65849
|
}
|
|
65821
65850
|
function createCustomWidthStyle(column, resizedWidth) {
|
|
@@ -65876,7 +65905,7 @@ function formatCsvCell(value) {
|
|
|
65876
65905
|
}
|
|
65877
65906
|
}
|
|
65878
65907
|
function generateCsv(columns, data, getCsvCell, getCsvHeader) {
|
|
65879
|
-
const exportableColumns = columns.filter(column => column.type !== "expand" && column.type !== "selection" && column.allowExport !== false);
|
|
65908
|
+
const exportableColumns = columns.filter(column => column.type !== "expand" && column.type !== "selection" && column.type !== "draggable" && column.allowExport !== false);
|
|
65880
65909
|
const header = exportableColumns.map(col => {
|
|
65881
65910
|
return getCsvHeader ? getCsvHeader(col) : col.title;
|
|
65882
65911
|
}).join(",");
|
|
@@ -65888,6 +65917,40 @@ function generateCsv(columns, data, getCsvCell, getCsvHeader) {
|
|
|
65888
65917
|
return [header, ...rows].join("\n");
|
|
65889
65918
|
}
|
|
65890
65919
|
|
|
65920
|
+
function flattenExpandedRows(rowInfos, expandedRowKeys) {
|
|
65921
|
+
const flattenedRows = [];
|
|
65922
|
+
function traverse(nodes, rootIndex) {
|
|
65923
|
+
nodes.forEach(node => {
|
|
65924
|
+
if (node.children && expandedRowKeys.has(node.key)) {
|
|
65925
|
+
flattenedRows.push({
|
|
65926
|
+
tmNode: node,
|
|
65927
|
+
striped: false,
|
|
65928
|
+
key: node.key,
|
|
65929
|
+
index: rootIndex
|
|
65930
|
+
});
|
|
65931
|
+
traverse(node.children, rootIndex);
|
|
65932
|
+
} else {
|
|
65933
|
+
flattenedRows.push({
|
|
65934
|
+
key: node.key,
|
|
65935
|
+
tmNode: node,
|
|
65936
|
+
striped: false,
|
|
65937
|
+
index: rootIndex
|
|
65938
|
+
});
|
|
65939
|
+
}
|
|
65940
|
+
});
|
|
65941
|
+
}
|
|
65942
|
+
rowInfos.forEach(rowInfo => {
|
|
65943
|
+
flattenedRows.push(rowInfo);
|
|
65944
|
+
const {
|
|
65945
|
+
children
|
|
65946
|
+
} = rowInfo.tmNode;
|
|
65947
|
+
if (children && expandedRowKeys.has(rowInfo.key)) {
|
|
65948
|
+
traverse(children, rowInfo.index);
|
|
65949
|
+
}
|
|
65950
|
+
});
|
|
65951
|
+
return flattenedRows;
|
|
65952
|
+
}
|
|
65953
|
+
|
|
65891
65954
|
const REGEX = {
|
|
65892
65955
|
ONLY_DIGITS: /\D/g};
|
|
65893
65956
|
const defaultNumericMask = {
|
|
@@ -65960,6 +66023,39 @@ function isColumnSorting(column, mergedSortState) {
|
|
|
65960
66023
|
return mergedSortState.some(state => state.columnKey === column.key && state.order);
|
|
65961
66024
|
}
|
|
65962
66025
|
|
|
66026
|
+
function renderBodyEmpty(deps) {
|
|
66027
|
+
const {
|
|
66028
|
+
clsPrefix,
|
|
66029
|
+
loading,
|
|
66030
|
+
bodyStyle,
|
|
66031
|
+
dataTableSlots,
|
|
66032
|
+
mergedTheme,
|
|
66033
|
+
emptyProps
|
|
66034
|
+
} = deps;
|
|
66035
|
+
return /* @__PURE__ */ h(
|
|
66036
|
+
"div",
|
|
66037
|
+
{
|
|
66038
|
+
class: [
|
|
66039
|
+
`${clsPrefix}-data-table-empty`,
|
|
66040
|
+
loading && `${clsPrefix}-data-table-empty--hide`
|
|
66041
|
+
],
|
|
66042
|
+
style: bodyStyle,
|
|
66043
|
+
ref: "emptyElRef"
|
|
66044
|
+
},
|
|
66045
|
+
resolveSlot(dataTableSlots.empty, () => [
|
|
66046
|
+
/* @__PURE__ */ h(
|
|
66047
|
+
UEmpty$1,
|
|
66048
|
+
{
|
|
66049
|
+
size: "large",
|
|
66050
|
+
theme: mergedTheme.peers.Empty,
|
|
66051
|
+
themeOverrides: mergedTheme.peerOverrides.Empty,
|
|
66052
|
+
...emptyProps
|
|
66053
|
+
}
|
|
66054
|
+
)
|
|
66055
|
+
])
|
|
66056
|
+
);
|
|
66057
|
+
}
|
|
66058
|
+
|
|
65963
66059
|
var RenderSafeCheckbox = defineComponent({
|
|
65964
66060
|
name: "DataTableBodyCheckbox",
|
|
65965
66061
|
props: {
|
|
@@ -66618,7 +66714,7 @@ var _URadioGroup = defineComponent({
|
|
|
66618
66714
|
render() {
|
|
66619
66715
|
const { mergedValue, mergedClsPrefix, handleFocusin, handleFocusout } = this;
|
|
66620
66716
|
const { children, isButtonGroup } = mapSlot(
|
|
66621
|
-
flatten$
|
|
66717
|
+
flatten$1(getSlot(this)),
|
|
66622
66718
|
mergedValue,
|
|
66623
66719
|
mergedClsPrefix
|
|
66624
66720
|
);
|
|
@@ -66682,90 +66778,6 @@ var RenderSafeRadio = defineComponent({
|
|
|
66682
66778
|
}
|
|
66683
66779
|
});
|
|
66684
66780
|
|
|
66685
|
-
var BodySkeleton = defineComponent({
|
|
66686
|
-
name: "DataTableBodySkeleton",
|
|
66687
|
-
props: {
|
|
66688
|
-
rowCount: {
|
|
66689
|
-
type: Number,
|
|
66690
|
-
default: 10
|
|
66691
|
-
}
|
|
66692
|
-
},
|
|
66693
|
-
setup(props) {
|
|
66694
|
-
const {
|
|
66695
|
-
mergedClsPrefixRef,
|
|
66696
|
-
colsRef,
|
|
66697
|
-
props: dataTableProps
|
|
66698
|
-
} = inject(dataTableInjectionKey);
|
|
66699
|
-
const skeletonRowCount = computed(() => {
|
|
66700
|
-
if (dataTableProps.pagination && typeof dataTableProps.pagination === "object" && dataTableProps.pagination.pageSize) {
|
|
66701
|
-
return dataTableProps.pagination.pageSize;
|
|
66702
|
-
}
|
|
66703
|
-
return props.rowCount;
|
|
66704
|
-
});
|
|
66705
|
-
return {
|
|
66706
|
-
mergedClsPrefix: mergedClsPrefixRef,
|
|
66707
|
-
cols: colsRef,
|
|
66708
|
-
skeletonRowCount
|
|
66709
|
-
};
|
|
66710
|
-
},
|
|
66711
|
-
render() {
|
|
66712
|
-
const { mergedClsPrefix, cols, skeletonRowCount } = this;
|
|
66713
|
-
const skeletonRows = Array.from(
|
|
66714
|
-
{ length: skeletonRowCount },
|
|
66715
|
-
(_, index) => /* @__PURE__ */ h(
|
|
66716
|
-
"tr",
|
|
66717
|
-
{
|
|
66718
|
-
key: `skeleton-row-${index}`,
|
|
66719
|
-
class: `${mergedClsPrefix}-data-table-tr ${mergedClsPrefix}-data-table-tr--skeleton`
|
|
66720
|
-
},
|
|
66721
|
-
cols.map((col) => /* @__PURE__ */ h(
|
|
66722
|
-
"td",
|
|
66723
|
-
{
|
|
66724
|
-
key: col.key,
|
|
66725
|
-
class: [
|
|
66726
|
-
`${mergedClsPrefix}-data-table-td`,
|
|
66727
|
-
`${mergedClsPrefix}-data-table-td--skeleton`,
|
|
66728
|
-
col.column.fixed && `${mergedClsPrefix}-data-table-td--fixed-${col.column.fixed}`,
|
|
66729
|
-
col.column.align && `${mergedClsPrefix}-data-table-td--${col.column.align}-align`
|
|
66730
|
-
],
|
|
66731
|
-
style: {
|
|
66732
|
-
textAlign: col.column.align || void 0,
|
|
66733
|
-
padding: "var(--u-td-padding)"
|
|
66734
|
-
}
|
|
66735
|
-
},
|
|
66736
|
-
col.column.fixed && /* @__PURE__ */ h(
|
|
66737
|
-
"div",
|
|
66738
|
-
{
|
|
66739
|
-
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
66740
|
-
}
|
|
66741
|
-
),
|
|
66742
|
-
/* @__PURE__ */ h(
|
|
66743
|
-
_USkeleton,
|
|
66744
|
-
{
|
|
66745
|
-
height: "var(--u-line-height)",
|
|
66746
|
-
width: col.column.type === "selection" ? "16px" : "85%",
|
|
66747
|
-
animated: true,
|
|
66748
|
-
style: {
|
|
66749
|
-
borderRadius: "16px"
|
|
66750
|
-
}
|
|
66751
|
-
}
|
|
66752
|
-
)
|
|
66753
|
-
))
|
|
66754
|
-
)
|
|
66755
|
-
);
|
|
66756
|
-
return /* @__PURE__ */ h(
|
|
66757
|
-
"tbody",
|
|
66758
|
-
{
|
|
66759
|
-
class: [
|
|
66760
|
-
`${mergedClsPrefix}-data-table-tbody`,
|
|
66761
|
-
`${mergedClsPrefix}-data-table-tbody--skeleton`
|
|
66762
|
-
]
|
|
66763
|
-
},
|
|
66764
|
-
skeletonRows
|
|
66765
|
-
);
|
|
66766
|
-
}
|
|
66767
|
-
});
|
|
66768
|
-
|
|
66769
66781
|
function applyMask(value, mask) {
|
|
66770
66782
|
if (!mask) return value;
|
|
66771
66783
|
if (!value || value.trim() === "") return "";
|
|
@@ -67079,6 +67091,404 @@ var ExpandTrigger = defineComponent({
|
|
|
67079
67091
|
}
|
|
67080
67092
|
});
|
|
67081
67093
|
|
|
67094
|
+
function renderExpandedRow(context, rowInfo, displayedRowIndex) {
|
|
67095
|
+
const {
|
|
67096
|
+
mergedClsPrefix,
|
|
67097
|
+
colCount,
|
|
67098
|
+
rowCount,
|
|
67099
|
+
stickyExpandedRows,
|
|
67100
|
+
bodyWidthPx,
|
|
67101
|
+
renderExpand
|
|
67102
|
+
} = context;
|
|
67103
|
+
const { index: actualRowIndex } = rowInfo;
|
|
67104
|
+
const {
|
|
67105
|
+
tmNode: { key, rawNode }
|
|
67106
|
+
} = rowInfo;
|
|
67107
|
+
return /* @__PURE__ */ h(
|
|
67108
|
+
"tr",
|
|
67109
|
+
{
|
|
67110
|
+
class: `${mergedClsPrefix}-data-table-tr ${mergedClsPrefix}-data-table-tr--expanded`,
|
|
67111
|
+
key: `${key}__expand`
|
|
67112
|
+
},
|
|
67113
|
+
/* @__PURE__ */ h(
|
|
67114
|
+
"td",
|
|
67115
|
+
{
|
|
67116
|
+
class: [
|
|
67117
|
+
`${mergedClsPrefix}-data-table-td`,
|
|
67118
|
+
`${mergedClsPrefix}-data-table-td--last-col`,
|
|
67119
|
+
displayedRowIndex + 1 === rowCount && `${mergedClsPrefix}-data-table-td--last-row`
|
|
67120
|
+
],
|
|
67121
|
+
colspan: colCount
|
|
67122
|
+
},
|
|
67123
|
+
stickyExpandedRows ? /* @__PURE__ */ h(
|
|
67124
|
+
"div",
|
|
67125
|
+
{
|
|
67126
|
+
class: `${mergedClsPrefix}-data-table-expand`,
|
|
67127
|
+
style: {
|
|
67128
|
+
width: bodyWidthPx
|
|
67129
|
+
}
|
|
67130
|
+
},
|
|
67131
|
+
renderExpand(rawNode, actualRowIndex)
|
|
67132
|
+
) : renderExpand(rawNode, actualRowIndex)
|
|
67133
|
+
)
|
|
67134
|
+
);
|
|
67135
|
+
}
|
|
67136
|
+
function renderBodyRow(context, rowInfo, displayedRowIndex, isVirtual) {
|
|
67137
|
+
if ("isExpandedRow" in rowInfo) {
|
|
67138
|
+
return renderExpandedRow(context, rowInfo, displayedRowIndex);
|
|
67139
|
+
}
|
|
67140
|
+
const {
|
|
67141
|
+
mergedClsPrefix,
|
|
67142
|
+
cols,
|
|
67143
|
+
colCount,
|
|
67144
|
+
rowCount,
|
|
67145
|
+
hasChildren,
|
|
67146
|
+
childTriggerColIndex,
|
|
67147
|
+
indentStyle,
|
|
67148
|
+
rowClassName,
|
|
67149
|
+
rowProps,
|
|
67150
|
+
mergedSortState,
|
|
67151
|
+
mergedExpandedRowKeySet,
|
|
67152
|
+
fixedColumnLeftMap,
|
|
67153
|
+
fixedColumnRightMap,
|
|
67154
|
+
currentPage,
|
|
67155
|
+
loadingKeySet,
|
|
67156
|
+
renderExpandIcon,
|
|
67157
|
+
renderCell,
|
|
67158
|
+
defaultEmptyValue,
|
|
67159
|
+
mergedTheme,
|
|
67160
|
+
rowIndexToKey,
|
|
67161
|
+
cordToPass,
|
|
67162
|
+
cordKey,
|
|
67163
|
+
draggableColumn,
|
|
67164
|
+
droppingRowKey,
|
|
67165
|
+
droppingPosition,
|
|
67166
|
+
draggingRowKeySet,
|
|
67167
|
+
hoverKey,
|
|
67168
|
+
dataTableSlots,
|
|
67169
|
+
setHoverKey,
|
|
67170
|
+
handleCheckboxUpdateChecked,
|
|
67171
|
+
handleRadioUpdateChecked,
|
|
67172
|
+
handleUpdateExpanded,
|
|
67173
|
+
handleRowDragStart,
|
|
67174
|
+
handleRowDragOver,
|
|
67175
|
+
handleRowDragLeave,
|
|
67176
|
+
handleRowDragEnd,
|
|
67177
|
+
handleRowDrop,
|
|
67178
|
+
emitEdit
|
|
67179
|
+
} = context;
|
|
67180
|
+
const { index: actualRowIndex } = rowInfo;
|
|
67181
|
+
const isSummary = "isSummaryRow" in rowInfo;
|
|
67182
|
+
const striped = !isSummary && rowInfo.striped;
|
|
67183
|
+
const { tmNode, key: rowKey } = rowInfo;
|
|
67184
|
+
const { rawNode: rowData } = tmNode;
|
|
67185
|
+
const expanded = mergedExpandedRowKeySet.has(rowKey);
|
|
67186
|
+
const props = rowProps ? rowProps(rowData, actualRowIndex) : void 0;
|
|
67187
|
+
const mergedRowClassName = typeof rowClassName === "string" ? rowClassName : createRowClassName(rowData, actualRowIndex, rowClassName);
|
|
67188
|
+
const { class: _class, ...restProps } = props || {};
|
|
67189
|
+
const isRowDraggable = !isSummary && !!draggableColumn && (typeof draggableColumn.draggable === "function" ? draggableColumn.draggable(rowData) : true);
|
|
67190
|
+
const isDropTarget = !!draggableColumn && droppingRowKey === rowKey;
|
|
67191
|
+
const dropPosition = isDropTarget ? droppingPosition : null;
|
|
67192
|
+
const isBeingDragged = !!draggableColumn && draggingRowKeySet.has(rowKey);
|
|
67193
|
+
const row = /* @__PURE__ */ h(
|
|
67194
|
+
"tr",
|
|
67195
|
+
{
|
|
67196
|
+
onMouseenter: () => {
|
|
67197
|
+
setHoverKey(rowKey);
|
|
67198
|
+
},
|
|
67199
|
+
key: rowKey,
|
|
67200
|
+
"data-row-key": String(rowKey),
|
|
67201
|
+
onDragover: draggableColumn && !isSummary ? (event) => handleRowDragOver(event, rowKey) : void 0,
|
|
67202
|
+
onDragleave: draggableColumn && !isSummary ? (event) => handleRowDragLeave(event, rowKey) : void 0,
|
|
67203
|
+
onDrop: draggableColumn && !isSummary ? (event) => handleRowDrop(event, rowKey) : void 0,
|
|
67204
|
+
class: [
|
|
67205
|
+
`${mergedClsPrefix}-data-table-tr`,
|
|
67206
|
+
rowInfo.tmNode.disabled && `${mergedClsPrefix}-data-table-tr--disabled`,
|
|
67207
|
+
isSummary && `${mergedClsPrefix}-data-table-tr--summary`,
|
|
67208
|
+
striped && `${mergedClsPrefix}-data-table-tr--striped`,
|
|
67209
|
+
expanded && `${mergedClsPrefix}-data-table-tr--expanded`,
|
|
67210
|
+
isBeingDragged && `${mergedClsPrefix}-data-table-tr--dragging`,
|
|
67211
|
+
isDropTarget && dropPosition === "before" && `${mergedClsPrefix}-data-table-tr--drop-before`,
|
|
67212
|
+
isDropTarget && dropPosition === "after" && `${mergedClsPrefix}-data-table-tr--drop-after`,
|
|
67213
|
+
mergedRowClassName,
|
|
67214
|
+
_class
|
|
67215
|
+
],
|
|
67216
|
+
...restProps
|
|
67217
|
+
},
|
|
67218
|
+
cols.map((col, colIndex) => {
|
|
67219
|
+
if (displayedRowIndex in cordToPass) {
|
|
67220
|
+
const cordOfRowToPass = cordToPass[displayedRowIndex];
|
|
67221
|
+
const indexInCordOfRowToPass = cordOfRowToPass.indexOf(colIndex);
|
|
67222
|
+
if (~indexInCordOfRowToPass) {
|
|
67223
|
+
cordOfRowToPass.splice(indexInCordOfRowToPass, 1);
|
|
67224
|
+
return null;
|
|
67225
|
+
}
|
|
67226
|
+
}
|
|
67227
|
+
const { column } = col;
|
|
67228
|
+
const colKey = getColKey(col);
|
|
67229
|
+
const { rowSpan, colSpan } = column;
|
|
67230
|
+
const mergedColSpan = isSummary ? rowInfo.tmNode.rawNode[colKey]?.colSpan || 1 : colSpan ? colSpan(rowData, actualRowIndex) : 1;
|
|
67231
|
+
const mergedRowSpan = isSummary ? rowInfo.tmNode.rawNode[colKey]?.rowSpan || 1 : rowSpan ? rowSpan(rowData, actualRowIndex) : 1;
|
|
67232
|
+
const isLastCol = colIndex + mergedColSpan === colCount;
|
|
67233
|
+
const isLastRow = displayedRowIndex + mergedRowSpan === rowCount;
|
|
67234
|
+
const isCrossRowTd = mergedRowSpan > 1;
|
|
67235
|
+
if (isCrossRowTd) {
|
|
67236
|
+
cordKey[displayedRowIndex] = {
|
|
67237
|
+
[colIndex]: []
|
|
67238
|
+
};
|
|
67239
|
+
}
|
|
67240
|
+
if (mergedColSpan > 1 || isCrossRowTd) {
|
|
67241
|
+
for (let i = displayedRowIndex; i < displayedRowIndex + mergedRowSpan; ++i) {
|
|
67242
|
+
if (isCrossRowTd) {
|
|
67243
|
+
cordKey[displayedRowIndex][colIndex].push(rowIndexToKey[i]);
|
|
67244
|
+
}
|
|
67245
|
+
for (let j = colIndex; j < colIndex + mergedColSpan; ++j) {
|
|
67246
|
+
if (i === displayedRowIndex && j === colIndex) {
|
|
67247
|
+
continue;
|
|
67248
|
+
}
|
|
67249
|
+
if (!(i in cordToPass)) {
|
|
67250
|
+
cordToPass[i] = [j];
|
|
67251
|
+
} else {
|
|
67252
|
+
cordToPass[i].push(j);
|
|
67253
|
+
}
|
|
67254
|
+
}
|
|
67255
|
+
}
|
|
67256
|
+
}
|
|
67257
|
+
const cellHoverKey = isCrossRowTd ? hoverKey : null;
|
|
67258
|
+
const { cellProps } = column;
|
|
67259
|
+
const resolvedCellProps = cellProps?.(rowData, actualRowIndex);
|
|
67260
|
+
const indentOffsetStyle = {
|
|
67261
|
+
"--indent-offset": ""
|
|
67262
|
+
};
|
|
67263
|
+
const isDraggableHandleCell = column.type === "draggable" && !isSummary && isRowDraggable;
|
|
67264
|
+
return /* @__PURE__ */ h(
|
|
67265
|
+
"td",
|
|
67266
|
+
{
|
|
67267
|
+
...resolvedCellProps,
|
|
67268
|
+
key: colKey,
|
|
67269
|
+
draggable: isDraggableHandleCell || void 0,
|
|
67270
|
+
onDragstart: isDraggableHandleCell ? (event) => handleRowDragStart(event, rowKey) : void 0,
|
|
67271
|
+
onDragend: isDraggableHandleCell ? () => handleRowDragEnd() : void 0,
|
|
67272
|
+
style: [
|
|
67273
|
+
{
|
|
67274
|
+
textAlign: column.align || void 0,
|
|
67275
|
+
left: pxfy(fixedColumnLeftMap[colKey]?.start),
|
|
67276
|
+
right: pxfy(fixedColumnRightMap[colKey]?.start)
|
|
67277
|
+
},
|
|
67278
|
+
indentOffsetStyle,
|
|
67279
|
+
resolvedCellProps?.style || ""
|
|
67280
|
+
],
|
|
67281
|
+
colspan: mergedColSpan,
|
|
67282
|
+
rowspan: isVirtual ? void 0 : mergedRowSpan,
|
|
67283
|
+
"data-col-key": colKey,
|
|
67284
|
+
class: [
|
|
67285
|
+
`${mergedClsPrefix}-data-table-td`,
|
|
67286
|
+
column.className,
|
|
67287
|
+
resolvedCellProps?.class,
|
|
67288
|
+
isSummary && `${mergedClsPrefix}-data-table-td--summary`,
|
|
67289
|
+
(cellHoverKey !== null && cordKey[displayedRowIndex][colIndex].includes(cellHoverKey) || isColumnSorting(column, mergedSortState)) && `${mergedClsPrefix}-data-table-td--hover`,
|
|
67290
|
+
column.fixed && `${mergedClsPrefix}-data-table-td--fixed-${column.fixed}`,
|
|
67291
|
+
column.align && `${mergedClsPrefix}-data-table-td--${column.align}-align`,
|
|
67292
|
+
column.type === "selection" && `${mergedClsPrefix}-data-table-td--selection`,
|
|
67293
|
+
column.type === "expand" && `${mergedClsPrefix}-data-table-td--expand`,
|
|
67294
|
+
column.type === "draggable" && `${mergedClsPrefix}-data-table-td--draggable`,
|
|
67295
|
+
isLastCol && `${mergedClsPrefix}-data-table-td--last-col`,
|
|
67296
|
+
isLastRow && `${mergedClsPrefix}-data-table-td--last-row`,
|
|
67297
|
+
"editable" in column && (typeof column.editable === "function" ? column.editable(rowData) : column.editable) && !isSummary && `${mergedClsPrefix}-data-table-td--editable`
|
|
67298
|
+
]
|
|
67299
|
+
},
|
|
67300
|
+
column.fixed && /* @__PURE__ */ h(
|
|
67301
|
+
"div",
|
|
67302
|
+
{
|
|
67303
|
+
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
67304
|
+
}
|
|
67305
|
+
),
|
|
67306
|
+
hasChildren && colIndex === childTriggerColIndex ? [
|
|
67307
|
+
repeat(
|
|
67308
|
+
indentOffsetStyle["--indent-offset"] = isSummary ? 0 : rowInfo.tmNode.level,
|
|
67309
|
+
/* @__PURE__ */ h(
|
|
67310
|
+
"div",
|
|
67311
|
+
{
|
|
67312
|
+
class: `${mergedClsPrefix}-data-table-indent`,
|
|
67313
|
+
style: indentStyle
|
|
67314
|
+
}
|
|
67315
|
+
)
|
|
67316
|
+
),
|
|
67317
|
+
isSummary || rowInfo.tmNode.isLeaf ? /* @__PURE__ */ h(
|
|
67318
|
+
"div",
|
|
67319
|
+
{
|
|
67320
|
+
class: `${mergedClsPrefix}-data-table-expand-placeholder`
|
|
67321
|
+
}
|
|
67322
|
+
) : /* @__PURE__ */ h(
|
|
67323
|
+
ExpandTrigger,
|
|
67324
|
+
{
|
|
67325
|
+
class: `${mergedClsPrefix}-data-table-expand-trigger`,
|
|
67326
|
+
clsPrefix: mergedClsPrefix,
|
|
67327
|
+
expanded,
|
|
67328
|
+
renderExpandIcon,
|
|
67329
|
+
loading: loadingKeySet.has(rowInfo.key),
|
|
67330
|
+
onClick: () => {
|
|
67331
|
+
handleUpdateExpanded(rowKey, rowInfo.tmNode);
|
|
67332
|
+
}
|
|
67333
|
+
}
|
|
67334
|
+
)
|
|
67335
|
+
] : null,
|
|
67336
|
+
column.type === "selection" ? !isSummary ? column.multiple === false ? /* @__PURE__ */ h(
|
|
67337
|
+
RenderSafeRadio,
|
|
67338
|
+
{
|
|
67339
|
+
key: currentPage,
|
|
67340
|
+
rowKey,
|
|
67341
|
+
disabled: rowInfo.tmNode.disabled,
|
|
67342
|
+
onClick: (event) => {
|
|
67343
|
+
event.stopPropagation();
|
|
67344
|
+
},
|
|
67345
|
+
onUpdateChecked: () => {
|
|
67346
|
+
handleRadioUpdateChecked(rowInfo.tmNode);
|
|
67347
|
+
}
|
|
67348
|
+
}
|
|
67349
|
+
) : /* @__PURE__ */ h(
|
|
67350
|
+
RenderSafeCheckbox,
|
|
67351
|
+
{
|
|
67352
|
+
key: currentPage,
|
|
67353
|
+
rowKey,
|
|
67354
|
+
disabled: rowInfo.tmNode.disabled,
|
|
67355
|
+
onUpdateChecked: (checked, event) => {
|
|
67356
|
+
event.stopPropagation();
|
|
67357
|
+
handleCheckboxUpdateChecked(
|
|
67358
|
+
rowInfo.tmNode,
|
|
67359
|
+
checked,
|
|
67360
|
+
event.shiftKey
|
|
67361
|
+
);
|
|
67362
|
+
}
|
|
67363
|
+
}
|
|
67364
|
+
) : null : column.type === "expand" ? !isSummary ? !column.expandable || column.expandable?.(rowData) ? /* @__PURE__ */ h(
|
|
67365
|
+
ExpandTrigger,
|
|
67366
|
+
{
|
|
67367
|
+
clsPrefix: mergedClsPrefix,
|
|
67368
|
+
expanded,
|
|
67369
|
+
renderExpandIcon,
|
|
67370
|
+
onClick: () => {
|
|
67371
|
+
handleUpdateExpanded(rowKey, null);
|
|
67372
|
+
}
|
|
67373
|
+
}
|
|
67374
|
+
) : null : null : column.type === "draggable" ? isDraggableHandleCell ? /* @__PURE__ */ h(
|
|
67375
|
+
"span",
|
|
67376
|
+
{
|
|
67377
|
+
class: `${mergedClsPrefix}-data-table-td__drag-handle`,
|
|
67378
|
+
"aria-label": "Drag to reorder"
|
|
67379
|
+
},
|
|
67380
|
+
resolveSlot(dataTableSlots["drag-handle"], () => [
|
|
67381
|
+
/* @__PURE__ */ h(DragHandleRound, null)
|
|
67382
|
+
])
|
|
67383
|
+
) : null : /* @__PURE__ */ h(
|
|
67384
|
+
Cell,
|
|
67385
|
+
{
|
|
67386
|
+
clsPrefix: mergedClsPrefix,
|
|
67387
|
+
index: actualRowIndex,
|
|
67388
|
+
row: rowData,
|
|
67389
|
+
column,
|
|
67390
|
+
isSummary,
|
|
67391
|
+
mergedTheme,
|
|
67392
|
+
renderCell,
|
|
67393
|
+
defaultEmptyValue,
|
|
67394
|
+
onEdit: (value, row2, key) => {
|
|
67395
|
+
emitEdit(value, row2, key);
|
|
67396
|
+
}
|
|
67397
|
+
}
|
|
67398
|
+
)
|
|
67399
|
+
);
|
|
67400
|
+
})
|
|
67401
|
+
);
|
|
67402
|
+
return row;
|
|
67403
|
+
}
|
|
67404
|
+
|
|
67405
|
+
const ICON_COLUMN_SKELETON_WIDTH = "16px";
|
|
67406
|
+
const DEFAULT_COLUMN_SKELETON_WIDTH = "85%";
|
|
67407
|
+
const SKELETON_BORDER_RADIUS = "16px";
|
|
67408
|
+
var BodySkeleton = defineComponent({
|
|
67409
|
+
name: "DataTableBodySkeleton",
|
|
67410
|
+
props: {
|
|
67411
|
+
rowCount: {
|
|
67412
|
+
type: Number,
|
|
67413
|
+
default: 10
|
|
67414
|
+
}
|
|
67415
|
+
},
|
|
67416
|
+
setup(props) {
|
|
67417
|
+
const {
|
|
67418
|
+
mergedClsPrefixRef,
|
|
67419
|
+
colsRef,
|
|
67420
|
+
props: dataTableProps
|
|
67421
|
+
} = inject(dataTableInjectionKey);
|
|
67422
|
+
const skeletonRowCount = computed(() => {
|
|
67423
|
+
if (dataTableProps.pagination && typeof dataTableProps.pagination === "object" && dataTableProps.pagination.pageSize) {
|
|
67424
|
+
return dataTableProps.pagination.pageSize;
|
|
67425
|
+
}
|
|
67426
|
+
return props.rowCount;
|
|
67427
|
+
});
|
|
67428
|
+
return {
|
|
67429
|
+
mergedClsPrefix: mergedClsPrefixRef,
|
|
67430
|
+
cols: colsRef,
|
|
67431
|
+
skeletonRowCount
|
|
67432
|
+
};
|
|
67433
|
+
},
|
|
67434
|
+
render() {
|
|
67435
|
+
const { mergedClsPrefix, cols, skeletonRowCount } = this;
|
|
67436
|
+
const skeletonRows = Array.from(
|
|
67437
|
+
{ length: skeletonRowCount },
|
|
67438
|
+
(_, index) => /* @__PURE__ */ h(
|
|
67439
|
+
"tr",
|
|
67440
|
+
{
|
|
67441
|
+
key: `skeleton-row-${index}`,
|
|
67442
|
+
class: `${mergedClsPrefix}-data-table-tr ${mergedClsPrefix}-data-table-tr--skeleton`
|
|
67443
|
+
},
|
|
67444
|
+
cols.map((col) => /* @__PURE__ */ h(
|
|
67445
|
+
"td",
|
|
67446
|
+
{
|
|
67447
|
+
key: col.key,
|
|
67448
|
+
class: [
|
|
67449
|
+
`${mergedClsPrefix}-data-table-td`,
|
|
67450
|
+
`${mergedClsPrefix}-data-table-td--skeleton`,
|
|
67451
|
+
col.column.fixed && `${mergedClsPrefix}-data-table-td--fixed-${col.column.fixed}`,
|
|
67452
|
+
col.column.align && `${mergedClsPrefix}-data-table-td--${col.column.align}-align`
|
|
67453
|
+
],
|
|
67454
|
+
style: {
|
|
67455
|
+
textAlign: col.column.align || void 0,
|
|
67456
|
+
padding: "var(--u-td-padding)"
|
|
67457
|
+
}
|
|
67458
|
+
},
|
|
67459
|
+
col.column.fixed && /* @__PURE__ */ h(
|
|
67460
|
+
"div",
|
|
67461
|
+
{
|
|
67462
|
+
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
67463
|
+
}
|
|
67464
|
+
),
|
|
67465
|
+
/* @__PURE__ */ h(
|
|
67466
|
+
_USkeleton,
|
|
67467
|
+
{
|
|
67468
|
+
height: "var(--u-line-height)",
|
|
67469
|
+
width: col.column.type === "selection" || col.column.type === "draggable" ? ICON_COLUMN_SKELETON_WIDTH : DEFAULT_COLUMN_SKELETON_WIDTH,
|
|
67470
|
+
animated: true,
|
|
67471
|
+
style: {
|
|
67472
|
+
borderRadius: SKELETON_BORDER_RADIUS
|
|
67473
|
+
}
|
|
67474
|
+
}
|
|
67475
|
+
)
|
|
67476
|
+
))
|
|
67477
|
+
)
|
|
67478
|
+
);
|
|
67479
|
+
return /* @__PURE__ */ h(
|
|
67480
|
+
"tbody",
|
|
67481
|
+
{
|
|
67482
|
+
class: [
|
|
67483
|
+
`${mergedClsPrefix}-data-table-tbody`,
|
|
67484
|
+
`${mergedClsPrefix}-data-table-tbody--skeleton`
|
|
67485
|
+
]
|
|
67486
|
+
},
|
|
67487
|
+
skeletonRows
|
|
67488
|
+
);
|
|
67489
|
+
}
|
|
67490
|
+
});
|
|
67491
|
+
|
|
67082
67492
|
var UDataTableFilterMenu = defineComponent({
|
|
67083
67493
|
name: "DataTableFilterMenu",
|
|
67084
67494
|
props: {
|
|
@@ -67661,6 +68071,8 @@ var SelectionMenu = defineComponent({
|
|
|
67661
68071
|
});
|
|
67662
68072
|
|
|
67663
68073
|
function renderTitle(column) {
|
|
68074
|
+
if (column.type === "draggable")
|
|
68075
|
+
return null;
|
|
67664
68076
|
return typeof column.title === "function" ? column.title(column) : column.title;
|
|
67665
68077
|
}
|
|
67666
68078
|
var TableHeader = defineComponent({
|
|
@@ -67869,6 +68281,9 @@ var TableHeader = defineComponent({
|
|
|
67869
68281
|
const { ellipsis } = column;
|
|
67870
68282
|
const ellipsisEnabled = isColumnEllipsisEnabled(column);
|
|
67871
68283
|
const createColumnVNode = () => {
|
|
68284
|
+
if (column.type === "draggable") {
|
|
68285
|
+
return null;
|
|
68286
|
+
}
|
|
67872
68287
|
if (column.type === "selection") {
|
|
67873
68288
|
return column.multiple !== false ? /* @__PURE__ */ h(Fragment, null, /* @__PURE__ */ h(
|
|
67874
68289
|
_UCheckbox,
|
|
@@ -67960,7 +68375,7 @@ var TableHeader = defineComponent({
|
|
|
67960
68375
|
},
|
|
67961
68376
|
column.className
|
|
67962
68377
|
],
|
|
67963
|
-
onClick: column.type !== "selection" && column.type !== "expand" && !("children" in column) ? (e) => {
|
|
68378
|
+
onClick: column.type !== "selection" && column.type !== "expand" && column.type !== "draggable" && !("children" in column) ? (e) => {
|
|
67964
68379
|
handleColHeaderClick(e, column);
|
|
67965
68380
|
} : void 0
|
|
67966
68381
|
},
|
|
@@ -68003,38 +68418,8 @@ var TableHeader = defineComponent({
|
|
|
68003
68418
|
}
|
|
68004
68419
|
});
|
|
68005
68420
|
|
|
68006
|
-
|
|
68007
|
-
|
|
68008
|
-
function traverse(rs, rootIndex) {
|
|
68009
|
-
rs.forEach((r) => {
|
|
68010
|
-
if (r.children && expandedRowKeys.has(r.key)) {
|
|
68011
|
-
fRows.push({
|
|
68012
|
-
tmNode: r,
|
|
68013
|
-
striped: false,
|
|
68014
|
-
key: r.key,
|
|
68015
|
-
index: rootIndex
|
|
68016
|
-
});
|
|
68017
|
-
traverse(r.children, rootIndex);
|
|
68018
|
-
} else {
|
|
68019
|
-
fRows.push({
|
|
68020
|
-
key: r.key,
|
|
68021
|
-
tmNode: r,
|
|
68022
|
-
striped: false,
|
|
68023
|
-
index: rootIndex
|
|
68024
|
-
});
|
|
68025
|
-
}
|
|
68026
|
-
});
|
|
68027
|
-
}
|
|
68028
|
-
rowInfos.forEach((rowInfo) => {
|
|
68029
|
-
fRows.push(rowInfo);
|
|
68030
|
-
const { children } = rowInfo.tmNode;
|
|
68031
|
-
if (children && expandedRowKeys.has(rowInfo.key)) {
|
|
68032
|
-
traverse(children, rowInfo.index);
|
|
68033
|
-
}
|
|
68034
|
-
});
|
|
68035
|
-
return fRows;
|
|
68036
|
-
}
|
|
68037
|
-
const VirtualListItemWrapper = defineComponent({
|
|
68421
|
+
var VirtualListItemWrapper = defineComponent({
|
|
68422
|
+
name: "VirtualListItemWrapper",
|
|
68038
68423
|
props: {
|
|
68039
68424
|
clsPrefix: {
|
|
68040
68425
|
type: String,
|
|
@@ -68067,6 +68452,7 @@ const VirtualListItemWrapper = defineComponent({
|
|
|
68067
68452
|
);
|
|
68068
68453
|
}
|
|
68069
68454
|
});
|
|
68455
|
+
|
|
68070
68456
|
var TableBody = defineComponent({
|
|
68071
68457
|
name: "DataTableBody",
|
|
68072
68458
|
emits: ["edit"],
|
|
@@ -68126,7 +68512,16 @@ var TableBody = defineComponent({
|
|
|
68126
68512
|
doUncheck,
|
|
68127
68513
|
renderCell,
|
|
68128
68514
|
defaultEmptyValueRef,
|
|
68129
|
-
emptyPropsRef
|
|
68515
|
+
emptyPropsRef,
|
|
68516
|
+
draggableColumnRef,
|
|
68517
|
+
draggingRowKeySetRef,
|
|
68518
|
+
droppingRowKeyRef,
|
|
68519
|
+
droppingPositionRef,
|
|
68520
|
+
handleRowDragStart,
|
|
68521
|
+
handleRowDragOver,
|
|
68522
|
+
handleRowDragLeave,
|
|
68523
|
+
handleRowDragEnd,
|
|
68524
|
+
handleRowDrop
|
|
68130
68525
|
} = inject(dataTableInjectionKey);
|
|
68131
68526
|
const UConfigProvider = inject(configProviderInjectionKey, null);
|
|
68132
68527
|
const scrollbarInstRef = ref(null);
|
|
@@ -68429,6 +68824,15 @@ var TableBody = defineComponent({
|
|
|
68429
68824
|
renderCell,
|
|
68430
68825
|
defaultEmptyValueRef,
|
|
68431
68826
|
emptyPropsRef,
|
|
68827
|
+
draggableColumn: draggableColumnRef,
|
|
68828
|
+
draggingRowKeySet: draggingRowKeySetRef,
|
|
68829
|
+
droppingRowKey: droppingRowKeyRef,
|
|
68830
|
+
droppingPosition: droppingPositionRef,
|
|
68831
|
+
handleRowDragStart,
|
|
68832
|
+
handleRowDragOver,
|
|
68833
|
+
handleRowDragLeave,
|
|
68834
|
+
handleRowDragEnd,
|
|
68835
|
+
handleRowDrop,
|
|
68432
68836
|
...exposedMethods
|
|
68433
68837
|
};
|
|
68434
68838
|
},
|
|
@@ -68505,7 +68909,7 @@ var TableBody = defineComponent({
|
|
|
68505
68909
|
const { length: colCount } = cols;
|
|
68506
68910
|
let mergedData;
|
|
68507
68911
|
const { data: paginatedData, hasChildren } = paginatedDataAndInfo;
|
|
68508
|
-
const mergedPaginationData = hasChildren ?
|
|
68912
|
+
const mergedPaginationData = hasChildren ? flattenExpandedRows(paginatedData, mergedExpandedRowKeySet) : paginatedData;
|
|
68509
68913
|
if (summary) {
|
|
68510
68914
|
const summaryRows = summary(this.rawPaginatedData);
|
|
68511
68915
|
if (Array.isArray(summaryRows)) {
|
|
@@ -68556,246 +68960,59 @@ var TableBody = defineComponent({
|
|
|
68556
68960
|
});
|
|
68557
68961
|
const bodyWidth = stickyExpandedRows ? this.bodyWidth : null;
|
|
68558
68962
|
const bodyWidthPx = bodyWidth === null ? void 0 : `${bodyWidth}px`;
|
|
68559
|
-
const
|
|
68560
|
-
|
|
68561
|
-
|
|
68562
|
-
|
|
68563
|
-
|
|
68564
|
-
|
|
68565
|
-
|
|
68566
|
-
|
|
68567
|
-
|
|
68568
|
-
|
|
68569
|
-
|
|
68570
|
-
|
|
68571
|
-
|
|
68572
|
-
|
|
68573
|
-
|
|
68574
|
-
|
|
68575
|
-
|
|
68576
|
-
|
|
68577
|
-
|
|
68578
|
-
|
|
68579
|
-
|
|
68580
|
-
|
|
68581
|
-
|
|
68582
|
-
|
|
68583
|
-
|
|
68584
|
-
|
|
68585
|
-
|
|
68586
|
-
|
|
68587
|
-
|
|
68588
|
-
|
|
68589
|
-
|
|
68590
|
-
|
|
68591
|
-
|
|
68592
|
-
|
|
68963
|
+
const renderContext = {
|
|
68964
|
+
mergedClsPrefix,
|
|
68965
|
+
cols,
|
|
68966
|
+
colCount,
|
|
68967
|
+
rowCount,
|
|
68968
|
+
hasChildren,
|
|
68969
|
+
childTriggerColIndex,
|
|
68970
|
+
indentStyle,
|
|
68971
|
+
rowClassName,
|
|
68972
|
+
rowProps,
|
|
68973
|
+
mergedSortState,
|
|
68974
|
+
mergedExpandedRowKeySet,
|
|
68975
|
+
fixedColumnLeftMap,
|
|
68976
|
+
fixedColumnRightMap,
|
|
68977
|
+
currentPage,
|
|
68978
|
+
loadingKeySet,
|
|
68979
|
+
stickyExpandedRows,
|
|
68980
|
+
bodyWidthPx,
|
|
68981
|
+
renderExpand,
|
|
68982
|
+
renderExpandIcon: this.renderExpandIcon,
|
|
68983
|
+
renderCell: this.renderCell,
|
|
68984
|
+
defaultEmptyValue: this.defaultEmptyValueRef,
|
|
68985
|
+
mergedTheme: mergedTheme2,
|
|
68986
|
+
rowIndexToKey,
|
|
68987
|
+
cordToPass,
|
|
68988
|
+
cordKey,
|
|
68989
|
+
draggableColumn: this.draggableColumn,
|
|
68990
|
+
droppingRowKey: this.droppingRowKey,
|
|
68991
|
+
droppingPosition: this.droppingPosition,
|
|
68992
|
+
draggingRowKeySet: this.draggingRowKeySet,
|
|
68993
|
+
hoverKey: this.hoverKey,
|
|
68994
|
+
dataTableSlots: this.dataTableSlots,
|
|
68995
|
+
setHoverKey: (key) => {
|
|
68996
|
+
this.hoverKey = key;
|
|
68997
|
+
},
|
|
68998
|
+
handleCheckboxUpdateChecked,
|
|
68999
|
+
handleRadioUpdateChecked,
|
|
69000
|
+
handleUpdateExpanded,
|
|
69001
|
+
handleRowDragStart: this.handleRowDragStart,
|
|
69002
|
+
handleRowDragOver: this.handleRowDragOver,
|
|
69003
|
+
handleRowDragLeave: this.handleRowDragLeave,
|
|
69004
|
+
handleRowDragEnd: this.handleRowDragEnd,
|
|
69005
|
+
handleRowDrop: this.handleRowDrop,
|
|
69006
|
+
emitEdit: (value, row, key) => {
|
|
69007
|
+
this.$emit("edit", value, row, key);
|
|
68593
69008
|
}
|
|
68594
|
-
const isSummary = "isSummaryRow" in rowInfo;
|
|
68595
|
-
const striped = !isSummary && rowInfo.striped;
|
|
68596
|
-
const { tmNode, key: rowKey } = rowInfo;
|
|
68597
|
-
const { rawNode: rowData } = tmNode;
|
|
68598
|
-
const expanded = mergedExpandedRowKeySet.has(rowKey);
|
|
68599
|
-
const props = rowProps ? rowProps(rowData, actualRowIndex) : void 0;
|
|
68600
|
-
const mergedRowClassName = typeof rowClassName === "string" ? rowClassName : createRowClassName(rowData, actualRowIndex, rowClassName);
|
|
68601
|
-
const { class: _class, ...restProps } = props || {};
|
|
68602
|
-
const row = /* @__PURE__ */ h(
|
|
68603
|
-
"tr",
|
|
68604
|
-
{
|
|
68605
|
-
onMouseenter: () => {
|
|
68606
|
-
this.hoverKey = rowKey;
|
|
68607
|
-
},
|
|
68608
|
-
key: rowKey,
|
|
68609
|
-
class: [
|
|
68610
|
-
`${mergedClsPrefix}-data-table-tr`,
|
|
68611
|
-
rowInfo.tmNode.disabled && `${mergedClsPrefix}-data-table-tr--disabled`,
|
|
68612
|
-
isSummary && `${mergedClsPrefix}-data-table-tr--summary`,
|
|
68613
|
-
striped && `${mergedClsPrefix}-data-table-tr--striped`,
|
|
68614
|
-
expanded && `${mergedClsPrefix}-data-table-tr--expanded`,
|
|
68615
|
-
mergedRowClassName,
|
|
68616
|
-
_class
|
|
68617
|
-
],
|
|
68618
|
-
...restProps
|
|
68619
|
-
},
|
|
68620
|
-
cols.map((col, colIndex) => {
|
|
68621
|
-
if (displayedRowIndex in cordToPass) {
|
|
68622
|
-
const cordOfRowToPass = cordToPass[displayedRowIndex];
|
|
68623
|
-
const indexInCordOfRowToPass = cordOfRowToPass.indexOf(colIndex);
|
|
68624
|
-
if (~indexInCordOfRowToPass) {
|
|
68625
|
-
cordOfRowToPass.splice(indexInCordOfRowToPass, 1);
|
|
68626
|
-
return null;
|
|
68627
|
-
}
|
|
68628
|
-
}
|
|
68629
|
-
const { column } = col;
|
|
68630
|
-
const colKey = getColKey(col);
|
|
68631
|
-
const { rowSpan, colSpan } = column;
|
|
68632
|
-
const mergedColSpan = isSummary ? rowInfo.tmNode.rawNode[colKey]?.colSpan || 1 : colSpan ? colSpan(rowData, actualRowIndex) : 1;
|
|
68633
|
-
const mergedRowSpan = isSummary ? rowInfo.tmNode.rawNode[colKey]?.rowSpan || 1 : rowSpan ? rowSpan(rowData, actualRowIndex) : 1;
|
|
68634
|
-
const isLastCol = colIndex + mergedColSpan === colCount;
|
|
68635
|
-
const isLastRow = displayedRowIndex + mergedRowSpan === rowCount;
|
|
68636
|
-
const isCrossRowTd = mergedRowSpan > 1;
|
|
68637
|
-
if (isCrossRowTd) {
|
|
68638
|
-
cordKey[displayedRowIndex] = {
|
|
68639
|
-
[colIndex]: []
|
|
68640
|
-
};
|
|
68641
|
-
}
|
|
68642
|
-
if (mergedColSpan > 1 || isCrossRowTd) {
|
|
68643
|
-
for (let i = displayedRowIndex; i < displayedRowIndex + mergedRowSpan; ++i) {
|
|
68644
|
-
if (isCrossRowTd) {
|
|
68645
|
-
cordKey[displayedRowIndex][colIndex].push(
|
|
68646
|
-
rowIndexToKey[i]
|
|
68647
|
-
);
|
|
68648
|
-
}
|
|
68649
|
-
for (let j = colIndex; j < colIndex + mergedColSpan; ++j) {
|
|
68650
|
-
if (i === displayedRowIndex && j === colIndex) {
|
|
68651
|
-
continue;
|
|
68652
|
-
}
|
|
68653
|
-
if (!(i in cordToPass)) {
|
|
68654
|
-
cordToPass[i] = [j];
|
|
68655
|
-
} else {
|
|
68656
|
-
cordToPass[i].push(j);
|
|
68657
|
-
}
|
|
68658
|
-
}
|
|
68659
|
-
}
|
|
68660
|
-
}
|
|
68661
|
-
const hoverKey = isCrossRowTd ? this.hoverKey : null;
|
|
68662
|
-
const { cellProps } = column;
|
|
68663
|
-
const resolvedCellProps = cellProps?.(
|
|
68664
|
-
rowData,
|
|
68665
|
-
actualRowIndex
|
|
68666
|
-
);
|
|
68667
|
-
const indentOffsetStyle = {
|
|
68668
|
-
"--indent-offset": ""
|
|
68669
|
-
};
|
|
68670
|
-
return /* @__PURE__ */ h(
|
|
68671
|
-
"td",
|
|
68672
|
-
{
|
|
68673
|
-
...resolvedCellProps,
|
|
68674
|
-
key: colKey,
|
|
68675
|
-
style: [
|
|
68676
|
-
{
|
|
68677
|
-
textAlign: column.align || void 0,
|
|
68678
|
-
left: pxfy(fixedColumnLeftMap[colKey]?.start),
|
|
68679
|
-
right: pxfy(fixedColumnRightMap[colKey]?.start)
|
|
68680
|
-
},
|
|
68681
|
-
indentOffsetStyle,
|
|
68682
|
-
resolvedCellProps?.style || ""
|
|
68683
|
-
],
|
|
68684
|
-
colspan: mergedColSpan,
|
|
68685
|
-
rowspan: isVirtual ? void 0 : mergedRowSpan,
|
|
68686
|
-
"data-col-key": colKey,
|
|
68687
|
-
class: [
|
|
68688
|
-
`${mergedClsPrefix}-data-table-td`,
|
|
68689
|
-
column.className,
|
|
68690
|
-
resolvedCellProps?.class,
|
|
68691
|
-
isSummary && `${mergedClsPrefix}-data-table-td--summary`,
|
|
68692
|
-
(hoverKey !== null && cordKey[displayedRowIndex][colIndex].includes(
|
|
68693
|
-
hoverKey
|
|
68694
|
-
) || isColumnSorting(column, mergedSortState)) && `${mergedClsPrefix}-data-table-td--hover`,
|
|
68695
|
-
column.fixed && `${mergedClsPrefix}-data-table-td--fixed-${column.fixed}`,
|
|
68696
|
-
column.align && `${mergedClsPrefix}-data-table-td--${column.align}-align`,
|
|
68697
|
-
column.type === "selection" && `${mergedClsPrefix}-data-table-td--selection`,
|
|
68698
|
-
column.type === "expand" && `${mergedClsPrefix}-data-table-td--expand`,
|
|
68699
|
-
isLastCol && `${mergedClsPrefix}-data-table-td--last-col`,
|
|
68700
|
-
isLastRow && `${mergedClsPrefix}-data-table-td--last-row`,
|
|
68701
|
-
"editable" in column && (typeof column.editable === "function" ? column.editable(rowData) : column.editable) && !isSummary && `${mergedClsPrefix}-data-table-td--editable`
|
|
68702
|
-
]
|
|
68703
|
-
},
|
|
68704
|
-
column.fixed && /* @__PURE__ */ h(
|
|
68705
|
-
"div",
|
|
68706
|
-
{
|
|
68707
|
-
class: `${mergedClsPrefix}-data-table-td__shadow-holder`
|
|
68708
|
-
}
|
|
68709
|
-
),
|
|
68710
|
-
hasChildren && colIndex === childTriggerColIndex ? [
|
|
68711
|
-
repeat(
|
|
68712
|
-
indentOffsetStyle["--indent-offset"] = isSummary ? 0 : rowInfo.tmNode.level,
|
|
68713
|
-
/* @__PURE__ */ h(
|
|
68714
|
-
"div",
|
|
68715
|
-
{
|
|
68716
|
-
class: `${mergedClsPrefix}-data-table-indent`,
|
|
68717
|
-
style: indentStyle
|
|
68718
|
-
}
|
|
68719
|
-
)
|
|
68720
|
-
),
|
|
68721
|
-
isSummary || rowInfo.tmNode.isLeaf ? /* @__PURE__ */ h(
|
|
68722
|
-
"div",
|
|
68723
|
-
{
|
|
68724
|
-
class: `${mergedClsPrefix}-data-table-expand-placeholder`
|
|
68725
|
-
}
|
|
68726
|
-
) : /* @__PURE__ */ h(
|
|
68727
|
-
ExpandTrigger,
|
|
68728
|
-
{
|
|
68729
|
-
class: `${mergedClsPrefix}-data-table-expand-trigger`,
|
|
68730
|
-
clsPrefix: mergedClsPrefix,
|
|
68731
|
-
expanded,
|
|
68732
|
-
renderExpandIcon: this.renderExpandIcon,
|
|
68733
|
-
loading: loadingKeySet.has(rowInfo.key),
|
|
68734
|
-
onClick: () => {
|
|
68735
|
-
handleUpdateExpanded(rowKey, rowInfo.tmNode);
|
|
68736
|
-
}
|
|
68737
|
-
}
|
|
68738
|
-
)
|
|
68739
|
-
] : null,
|
|
68740
|
-
column.type === "selection" ? !isSummary ? column.multiple === false ? /* @__PURE__ */ h(
|
|
68741
|
-
RenderSafeRadio,
|
|
68742
|
-
{
|
|
68743
|
-
key: currentPage,
|
|
68744
|
-
rowKey,
|
|
68745
|
-
disabled: rowInfo.tmNode.disabled,
|
|
68746
|
-
onClick: (event) => {
|
|
68747
|
-
event.stopPropagation();
|
|
68748
|
-
},
|
|
68749
|
-
onUpdateChecked: () => {
|
|
68750
|
-
handleRadioUpdateChecked(rowInfo.tmNode);
|
|
68751
|
-
}
|
|
68752
|
-
}
|
|
68753
|
-
) : /* @__PURE__ */ h(
|
|
68754
|
-
RenderSafeCheckbox,
|
|
68755
|
-
{
|
|
68756
|
-
key: currentPage,
|
|
68757
|
-
rowKey,
|
|
68758
|
-
disabled: rowInfo.tmNode.disabled,
|
|
68759
|
-
onUpdateChecked: (checked, event) => {
|
|
68760
|
-
event.stopPropagation();
|
|
68761
|
-
handleCheckboxUpdateChecked(
|
|
68762
|
-
rowInfo.tmNode,
|
|
68763
|
-
checked,
|
|
68764
|
-
event.shiftKey
|
|
68765
|
-
);
|
|
68766
|
-
}
|
|
68767
|
-
}
|
|
68768
|
-
) : null : column.type === "expand" ? !isSummary ? !column.expandable || column.expandable?.(rowData) ? /* @__PURE__ */ h(
|
|
68769
|
-
ExpandTrigger,
|
|
68770
|
-
{
|
|
68771
|
-
clsPrefix: mergedClsPrefix,
|
|
68772
|
-
expanded,
|
|
68773
|
-
renderExpandIcon: this.renderExpandIcon,
|
|
68774
|
-
onClick: () => {
|
|
68775
|
-
handleUpdateExpanded(rowKey, null);
|
|
68776
|
-
}
|
|
68777
|
-
}
|
|
68778
|
-
) : null : null : /* @__PURE__ */ h(
|
|
68779
|
-
Cell,
|
|
68780
|
-
{
|
|
68781
|
-
clsPrefix: mergedClsPrefix,
|
|
68782
|
-
index: actualRowIndex,
|
|
68783
|
-
row: rowData,
|
|
68784
|
-
column,
|
|
68785
|
-
isSummary,
|
|
68786
|
-
mergedTheme: mergedTheme2,
|
|
68787
|
-
renderCell: this.renderCell,
|
|
68788
|
-
defaultEmptyValue: this.defaultEmptyValueRef,
|
|
68789
|
-
onEdit: (value, row2, key) => {
|
|
68790
|
-
this.$emit("edit", value, row2, key);
|
|
68791
|
-
}
|
|
68792
|
-
}
|
|
68793
|
-
)
|
|
68794
|
-
);
|
|
68795
|
-
})
|
|
68796
|
-
);
|
|
68797
|
-
return row;
|
|
68798
69009
|
};
|
|
69010
|
+
const renderRow = (rowInfo, displayedRowIndex, isVirtual) => renderBodyRow(
|
|
69011
|
+
renderContext,
|
|
69012
|
+
rowInfo,
|
|
69013
|
+
displayedRowIndex,
|
|
69014
|
+
isVirtual
|
|
69015
|
+
);
|
|
68799
69016
|
if (!virtualScroll) {
|
|
68800
69017
|
return /* @__PURE__ */ h(
|
|
68801
69018
|
"table",
|
|
@@ -68869,28 +69086,14 @@ var TableBody = defineComponent({
|
|
|
68869
69086
|
}
|
|
68870
69087
|
);
|
|
68871
69088
|
if (this.empty && !this.loadingSkeleton) {
|
|
68872
|
-
const createEmptyNode = () =>
|
|
68873
|
-
|
|
68874
|
-
|
|
68875
|
-
|
|
68876
|
-
|
|
68877
|
-
|
|
68878
|
-
|
|
68879
|
-
|
|
68880
|
-
ref: "emptyElRef"
|
|
68881
|
-
},
|
|
68882
|
-
resolveSlot(this.dataTableSlots.empty, () => [
|
|
68883
|
-
/* @__PURE__ */ h(
|
|
68884
|
-
UEmpty$1,
|
|
68885
|
-
{
|
|
68886
|
-
size: "large",
|
|
68887
|
-
theme: this.mergedTheme.peers.Empty,
|
|
68888
|
-
themeOverrides: this.mergedTheme.peerOverrides.Empty,
|
|
68889
|
-
...emptyPropsRef
|
|
68890
|
-
}
|
|
68891
|
-
)
|
|
68892
|
-
])
|
|
68893
|
-
);
|
|
69089
|
+
const createEmptyNode = () => renderBodyEmpty({
|
|
69090
|
+
clsPrefix: mergedClsPrefix,
|
|
69091
|
+
loading: this.loading,
|
|
69092
|
+
bodyStyle: this.bodyStyle,
|
|
69093
|
+
dataTableSlots: this.dataTableSlots,
|
|
69094
|
+
mergedTheme: this.mergedTheme,
|
|
69095
|
+
emptyProps: emptyPropsRef
|
|
69096
|
+
});
|
|
68894
69097
|
if (this.shouldDisplaySomeTablePart) {
|
|
68895
69098
|
return /* @__PURE__ */ h(Fragment, null, tableNode, createEmptyNode());
|
|
68896
69099
|
} else {
|
|
@@ -69092,7 +69295,11 @@ c$1("&:last-child", "flex-grow: 1;")])])])])])])]), c$1(">", [cB("data-table-loa
|
|
|
69092
69295
|
margin: calc(var(--u-th-padding) * -1);
|
|
69093
69296
|
padding: var(--u-th-padding);
|
|
69094
69297
|
box-sizing: border-box;
|
|
69095
|
-
`), cM("disabled", null, [cB("data-table-td", "color: var(--u-td-opacity-disabled);")]), cM("
|
|
69298
|
+
`), cM("disabled", null, [cB("data-table-td", "color: var(--u-td-opacity-disabled);")]), cM("dragging", "opacity: 0.4;"), cM("drop-before", null, [c$1(">", [cB("data-table-td", `
|
|
69299
|
+
box-shadow: inset 0 2px 0 0 var(--u-drop-mark-color);
|
|
69300
|
+
`)])]), cM("drop-after", null, [c$1(">", [cB("data-table-td", `
|
|
69301
|
+
box-shadow: inset 0 -2px 0 0 var(--u-drop-mark-color);
|
|
69302
|
+
`)])]), cM("striped", "background-color: var(--u-merged-td-color-striped);", [cB("data-table-td", "background-color: var(--u-merged-td-color-striped);")]), c$1("&:hover", "background-color: var(--u-merged-td-color-hover);", [c$1(">", [cB("data-table-td", "background-color: var(--u-merged-td-color-hover);")])]), c$1("&:has(.u-data-table-td--editable:hover)", [c$1(">", [cB("data-table-td", "background-color: var(--u-merged-td-color);", [cM("editable", [c$1("&:hover", "background-color: var(--u-merged-td-color-hover);")])])])])]), cB("data-table-th", `
|
|
69096
69303
|
padding: var(--u-th-padding);
|
|
69097
69304
|
position: relative;
|
|
69098
69305
|
height: var(--u-th-height);
|
|
@@ -69245,7 +69452,22 @@ c$1("&:last-child", "flex-grow: 1;")])])])])])])]), c$1(">", [cB("data-table-loa
|
|
|
69245
69452
|
`), cM("selection, expand", `
|
|
69246
69453
|
text-align: center;
|
|
69247
69454
|
line-height: 0;
|
|
69248
|
-
`), cM("
|
|
69455
|
+
`), cM("draggable", `
|
|
69456
|
+
text-align: center;
|
|
69457
|
+
line-height: 0;
|
|
69458
|
+
cursor: grab;
|
|
69459
|
+
`, [c$1("&:active", `
|
|
69460
|
+
cursor: grabbing;
|
|
69461
|
+
`), c$1("&:hover", [cE("drag-handle", `
|
|
69462
|
+
color: var(--u-th-icon-color-active);
|
|
69463
|
+
`)]), cE("drag-handle", `
|
|
69464
|
+
display: inline-flex;
|
|
69465
|
+
align-items: center;
|
|
69466
|
+
justify-content: center;
|
|
69467
|
+
color: var(--u-th-icon-color);
|
|
69468
|
+
line-height: 0;
|
|
69469
|
+
pointer-events: none;
|
|
69470
|
+
`)]), cM("editable", `
|
|
69249
69471
|
cursor: pointer;
|
|
69250
69472
|
position: relative;
|
|
69251
69473
|
padding: 0;
|
|
@@ -69265,7 +69487,11 @@ c$1("&:last-child", "flex-grow: 1;")])])])])])])]), c$1(">", [cB("data-table-loa
|
|
|
69265
69487
|
height: 100%;
|
|
69266
69488
|
width: 100%;
|
|
69267
69489
|
}
|
|
69268
|
-
`), fixedColumnStyle]), cB("data-table-
|
|
69490
|
+
`), fixedColumnStyle]), cB("data-table-drag-ghost", `
|
|
69491
|
+
opacity: var(--u-drag-ghost-opacity);
|
|
69492
|
+
filter: var(--u-drag-ghost-filter);
|
|
69493
|
+
pointer-events: none;
|
|
69494
|
+
`), cB("data-table-empty", `
|
|
69269
69495
|
box-sizing: border-box;
|
|
69270
69496
|
padding: var(--u-empty-padding);
|
|
69271
69497
|
flex-grow: 1;
|
|
@@ -69753,6 +69979,242 @@ function useResizable() {
|
|
|
69753
69979
|
};
|
|
69754
69980
|
}
|
|
69755
69981
|
|
|
69982
|
+
const DROP_HALF_DIVISOR = 2;
|
|
69983
|
+
const DROP_STEP_BIAS = 1;
|
|
69984
|
+
const FALLBACK_ORDER = 0;
|
|
69985
|
+
const SINGLE_ROW_DRAG_SIZE = 1;
|
|
69986
|
+
const DRAG_IMAGE_OFFSET = 0;
|
|
69987
|
+
const GHOST_OFFSCREEN_TOP_PX = -1e4;
|
|
69988
|
+
const GHOST_CLEANUP_DELAY_MS = 0;
|
|
69989
|
+
function useRowDrag(props, {
|
|
69990
|
+
paginatedDataRef,
|
|
69991
|
+
mergedCheckedRowKeySetRef,
|
|
69992
|
+
mergedClsPrefixRef
|
|
69993
|
+
}) {
|
|
69994
|
+
const draggableColumnRef = useMemo(() => {
|
|
69995
|
+
const findDraggableColumn = columns => {
|
|
69996
|
+
for (const column of columns) {
|
|
69997
|
+
if ("children" in column) {
|
|
69998
|
+
const nested = findDraggableColumn(column.children);
|
|
69999
|
+
if (nested) return nested;
|
|
70000
|
+
} else if (column.type === "draggable") {
|
|
70001
|
+
return column;
|
|
70002
|
+
}
|
|
70003
|
+
}
|
|
70004
|
+
return null;
|
|
70005
|
+
};
|
|
70006
|
+
return findDraggableColumn(props.columns);
|
|
70007
|
+
});
|
|
70008
|
+
const draggingRowKeysRef = ref([]);
|
|
70009
|
+
const draggingRowKeySetRef = computed(() => new Set(draggingRowKeysRef.value));
|
|
70010
|
+
const droppingRowKeyRef = ref(null);
|
|
70011
|
+
const droppingPositionRef = ref(null);
|
|
70012
|
+
function resetDropState() {
|
|
70013
|
+
droppingRowKeyRef.value = null;
|
|
70014
|
+
droppingPositionRef.value = null;
|
|
70015
|
+
}
|
|
70016
|
+
function isRowDraggable(rowData) {
|
|
70017
|
+
const column = draggableColumnRef.value;
|
|
70018
|
+
if (!column) return false;
|
|
70019
|
+
if (typeof column.draggable === "function") {
|
|
70020
|
+
return column.draggable(rowData);
|
|
70021
|
+
}
|
|
70022
|
+
return true;
|
|
70023
|
+
}
|
|
70024
|
+
function getRowByKey(targetKey) {
|
|
70025
|
+
return paginatedDataRef.value.find(node => node.key === targetKey)?.rawNode;
|
|
70026
|
+
}
|
|
70027
|
+
function resolveDragKeys(initialRowKey) {
|
|
70028
|
+
const checkedSet = mergedCheckedRowKeySetRef.value;
|
|
70029
|
+
if (!checkedSet.has(initialRowKey)) return [initialRowKey];
|
|
70030
|
+
const keysInOrder = [];
|
|
70031
|
+
for (const node of paginatedDataRef.value) {
|
|
70032
|
+
if (checkedSet.has(node.key) && isRowDraggable(node.rawNode)) {
|
|
70033
|
+
keysInOrder.push(node.key);
|
|
70034
|
+
}
|
|
70035
|
+
}
|
|
70036
|
+
return keysInOrder.length ? keysInOrder : [initialRowKey];
|
|
70037
|
+
}
|
|
70038
|
+
function applyDragImage(event) {
|
|
70039
|
+
if (!event.dataTransfer || typeof event.dataTransfer.setDragImage !== "function") {
|
|
70040
|
+
return;
|
|
70041
|
+
}
|
|
70042
|
+
const cellElement = event.currentTarget;
|
|
70043
|
+
const rowElement = cellElement?.closest("tr");
|
|
70044
|
+
if (!rowElement) return;
|
|
70045
|
+
const draggedSet = draggingRowKeySetRef.value;
|
|
70046
|
+
if (draggedSet.size <= SINGLE_ROW_DRAG_SIZE) {
|
|
70047
|
+
event.dataTransfer.setDragImage(rowElement, DRAG_IMAGE_OFFSET, DRAG_IMAGE_OFFSET);
|
|
70048
|
+
return;
|
|
70049
|
+
}
|
|
70050
|
+
const tableElement = rowElement.closest("table");
|
|
70051
|
+
if (!tableElement) {
|
|
70052
|
+
event.dataTransfer.setDragImage(rowElement, DRAG_IMAGE_OFFSET, DRAG_IMAGE_OFFSET);
|
|
70053
|
+
return;
|
|
70054
|
+
}
|
|
70055
|
+
const mergedClsPrefix = mergedClsPrefixRef.value;
|
|
70056
|
+
const keyStringSet = new Set(Array.from(draggedSet).map(String));
|
|
70057
|
+
const ghost = tableElement.cloneNode(true);
|
|
70058
|
+
ghost.classList.add(`${mergedClsPrefix}-data-table-drag-ghost`);
|
|
70059
|
+
ghost.querySelectorAll("thead").forEach(headElement => headElement.remove());
|
|
70060
|
+
ghost.querySelectorAll("tbody > tr").forEach(rowChild => {
|
|
70061
|
+
const childKey = rowChild.getAttribute("data-row-key");
|
|
70062
|
+
if (childKey === null || !keyStringSet.has(childKey)) rowChild.remove();
|
|
70063
|
+
});
|
|
70064
|
+
ghost.style.position = "fixed";
|
|
70065
|
+
ghost.style.top = `${GHOST_OFFSCREEN_TOP_PX}px`;
|
|
70066
|
+
ghost.style.left = "0";
|
|
70067
|
+
ghost.style.pointerEvents = "none";
|
|
70068
|
+
ghost.style.width = `${tableElement.offsetWidth}px`;
|
|
70069
|
+
const hostElement = tableElement.closest(`.${mergedClsPrefix}-data-table`) || document.body;
|
|
70070
|
+
hostElement.appendChild(ghost);
|
|
70071
|
+
event.dataTransfer.setDragImage(ghost, DRAG_IMAGE_OFFSET, DRAG_IMAGE_OFFSET);
|
|
70072
|
+
setTimeout(() => {
|
|
70073
|
+
if (ghost.parentNode) ghost.parentNode.removeChild(ghost);
|
|
70074
|
+
}, GHOST_CLEANUP_DELAY_MS);
|
|
70075
|
+
}
|
|
70076
|
+
function handleRowDragStart(event, rowKey) {
|
|
70077
|
+
const row = getRowByKey(rowKey);
|
|
70078
|
+
if (!row || !isRowDraggable(row)) {
|
|
70079
|
+
event.preventDefault();
|
|
70080
|
+
return;
|
|
70081
|
+
}
|
|
70082
|
+
draggingRowKeysRef.value = resolveDragKeys(rowKey);
|
|
70083
|
+
if (event.dataTransfer) {
|
|
70084
|
+
event.dataTransfer.effectAllowed = "move";
|
|
70085
|
+
event.dataTransfer.setData("text/plain", draggingRowKeysRef.value.map(String).join(","));
|
|
70086
|
+
}
|
|
70087
|
+
applyDragImage(event);
|
|
70088
|
+
}
|
|
70089
|
+
function handleRowDragOver(event, rowKey) {
|
|
70090
|
+
if (!draggableColumnRef.value) return;
|
|
70091
|
+
if (!draggingRowKeysRef.value.length) return;
|
|
70092
|
+
event.preventDefault();
|
|
70093
|
+
if (event.dataTransfer) {
|
|
70094
|
+
event.dataTransfer.dropEffect = "move";
|
|
70095
|
+
}
|
|
70096
|
+
if (draggingRowKeySetRef.value.has(rowKey)) {
|
|
70097
|
+
resetDropState();
|
|
70098
|
+
return;
|
|
70099
|
+
}
|
|
70100
|
+
const target = event.currentTarget;
|
|
70101
|
+
if (!target) return;
|
|
70102
|
+
const rect = target.getBoundingClientRect();
|
|
70103
|
+
const offset = event.clientY - rect.top;
|
|
70104
|
+
const position = offset < rect.height / DROP_HALF_DIVISOR ? "before" : "after";
|
|
70105
|
+
droppingRowKeyRef.value = rowKey;
|
|
70106
|
+
droppingPositionRef.value = position;
|
|
70107
|
+
}
|
|
70108
|
+
function handleRowDragLeave(event, rowKey) {
|
|
70109
|
+
if (droppingRowKeyRef.value !== rowKey) return;
|
|
70110
|
+
const related = event.relatedTarget;
|
|
70111
|
+
const current = event.currentTarget;
|
|
70112
|
+
if (related && current && current.contains(related)) {
|
|
70113
|
+
return;
|
|
70114
|
+
}
|
|
70115
|
+
resetDropState();
|
|
70116
|
+
}
|
|
70117
|
+
function handleRowDragEnd() {
|
|
70118
|
+
draggingRowKeysRef.value = [];
|
|
70119
|
+
resetDropState();
|
|
70120
|
+
}
|
|
70121
|
+
function readOrder(row, orderKey) {
|
|
70122
|
+
const value = row?.[orderKey];
|
|
70123
|
+
return typeof value === "number" ? value : Number(value) || FALLBACK_ORDER;
|
|
70124
|
+
}
|
|
70125
|
+
function computeNewOrders(draggedKeys, dropIndex, position, orderKey) {
|
|
70126
|
+
const rows = paginatedDataRef.value;
|
|
70127
|
+
if (!rows.length) return null;
|
|
70128
|
+
const draggedSet = new Set(draggedKeys);
|
|
70129
|
+
const draggedIndexes = rows.map((node, index) => draggedSet.has(node.key) ? index : -1).filter(index => index >= 0);
|
|
70130
|
+
if (!draggedIndexes.length) return null;
|
|
70131
|
+
const filtered = rows.filter(node => !draggedSet.has(node.key));
|
|
70132
|
+
const targetIndex = position === "before" ? dropIndex : dropIndex + 1;
|
|
70133
|
+
const removedBefore = draggedIndexes.filter(index => index < targetIndex).length;
|
|
70134
|
+
const insertAt = Math.max(0, targetIndex - removedBefore);
|
|
70135
|
+
const prev = filtered[insertAt - 1]?.rawNode;
|
|
70136
|
+
const next = filtered[insertAt]?.rawNode;
|
|
70137
|
+
const draggedCount = draggedKeys.length;
|
|
70138
|
+
const orders = [];
|
|
70139
|
+
if (prev && next) {
|
|
70140
|
+
const prevOrder = readOrder(prev, orderKey);
|
|
70141
|
+
const nextOrder = readOrder(next, orderKey);
|
|
70142
|
+
const step = (nextOrder - prevOrder) / (draggedCount + DROP_STEP_BIAS);
|
|
70143
|
+
for (let index = 0; index < draggedCount; index++) {
|
|
70144
|
+
orders.push(prevOrder + step * (index + DROP_STEP_BIAS));
|
|
70145
|
+
}
|
|
70146
|
+
} else if (!prev && next) {
|
|
70147
|
+
const nextOrder = readOrder(next, orderKey);
|
|
70148
|
+
for (let index = 0; index < draggedCount; index++) {
|
|
70149
|
+
orders.push(nextOrder - (draggedCount - index));
|
|
70150
|
+
}
|
|
70151
|
+
} else if (prev && !next) {
|
|
70152
|
+
const prevOrder = readOrder(prev, orderKey);
|
|
70153
|
+
for (let index = 0; index < draggedCount; index++) {
|
|
70154
|
+
orders.push(prevOrder + (index + DROP_STEP_BIAS));
|
|
70155
|
+
}
|
|
70156
|
+
} else {
|
|
70157
|
+
for (const key of draggedKeys) {
|
|
70158
|
+
const row = rows.find(node => node.key === key)?.rawNode;
|
|
70159
|
+
orders.push(readOrder(row, orderKey));
|
|
70160
|
+
}
|
|
70161
|
+
}
|
|
70162
|
+
return orders;
|
|
70163
|
+
}
|
|
70164
|
+
function handleRowDrop(event, rowKey) {
|
|
70165
|
+
event.preventDefault();
|
|
70166
|
+
const column = draggableColumnRef.value;
|
|
70167
|
+
const draggedKeys = draggingRowKeysRef.value;
|
|
70168
|
+
const position = droppingPositionRef.value;
|
|
70169
|
+
if (!column || !draggedKeys.length || position === null || draggingRowKeySetRef.value.has(rowKey)) {
|
|
70170
|
+
handleRowDragEnd();
|
|
70171
|
+
return;
|
|
70172
|
+
}
|
|
70173
|
+
const rows = paginatedDataRef.value;
|
|
70174
|
+
const dropIndex = rows.findIndex(node => node.key === rowKey);
|
|
70175
|
+
if (dropIndex < 0) {
|
|
70176
|
+
handleRowDragEnd();
|
|
70177
|
+
return;
|
|
70178
|
+
}
|
|
70179
|
+
const orderKey = column.key;
|
|
70180
|
+
const newOrders = computeNewOrders(draggedKeys, dropIndex, position, orderKey);
|
|
70181
|
+
const dispatchPlan = draggedKeys.map((key, index) => {
|
|
70182
|
+
const row = rows.find(node => node.key === key)?.rawNode;
|
|
70183
|
+
return row ? {
|
|
70184
|
+
row,
|
|
70185
|
+
oldOrder: readOrder(row, orderKey),
|
|
70186
|
+
newOrder: newOrders ? newOrders[index] : readOrder(row, orderKey)
|
|
70187
|
+
} : null;
|
|
70188
|
+
});
|
|
70189
|
+
const targetIndex = position === "before" ? dropIndex : dropIndex + 1;
|
|
70190
|
+
const draggedSet = draggingRowKeySetRef.value;
|
|
70191
|
+
const draggedIndexes = rows.map((node, index) => draggedSet.has(node.key) ? index : -1).filter(index => index >= 0);
|
|
70192
|
+
const removedBefore = draggedIndexes.filter(index => index < targetIndex).length;
|
|
70193
|
+
const baseIndex = Math.max(0, targetIndex - removedBefore);
|
|
70194
|
+
handleRowDragEnd();
|
|
70195
|
+
if (!newOrders) return;
|
|
70196
|
+
dispatchPlan.forEach((entry, index) => {
|
|
70197
|
+
if (!entry) return;
|
|
70198
|
+
column.onDragEnd?.(entry.row, {
|
|
70199
|
+
index: baseIndex + index,
|
|
70200
|
+
oldOrder: entry.oldOrder,
|
|
70201
|
+
newOrder: entry.newOrder
|
|
70202
|
+
});
|
|
70203
|
+
});
|
|
70204
|
+
}
|
|
70205
|
+
return {
|
|
70206
|
+
draggableColumnRef,
|
|
70207
|
+
draggingRowKeySetRef,
|
|
70208
|
+
droppingRowKeyRef,
|
|
70209
|
+
droppingPositionRef,
|
|
70210
|
+
handleRowDragStart,
|
|
70211
|
+
handleRowDragOver,
|
|
70212
|
+
handleRowDragLeave,
|
|
70213
|
+
handleRowDragEnd,
|
|
70214
|
+
handleRowDrop
|
|
70215
|
+
};
|
|
70216
|
+
}
|
|
70217
|
+
|
|
69756
70218
|
function useScroll(props, {
|
|
69757
70219
|
mainTableInstRef,
|
|
69758
70220
|
mergedCurrentPageRef,
|
|
@@ -70018,7 +70480,7 @@ function useSorter(props, {
|
|
|
70018
70480
|
});
|
|
70019
70481
|
const uncontrolledSortStateRef = ref(defaultSortState);
|
|
70020
70482
|
const mergedSortStateRef = computed(() => {
|
|
70021
|
-
const columnsWithControlledSortOrder = dataRelatedColsRef.value.filter(column => column.type !== "selection" && column.sorter !== void 0 && (column.sortOrder === "ascend" || column.sortOrder === "descend" || column.sortOrder === false));
|
|
70483
|
+
const columnsWithControlledSortOrder = dataRelatedColsRef.value.filter(column => column.type !== "selection" && column.type !== "draggable" && column.sorter !== void 0 && (column.sortOrder === "ascend" || column.sortOrder === "descend" || column.sortOrder === false));
|
|
70022
70484
|
const columnToSort = columnsWithControlledSortOrder.filter(col => col.sortOrder !== false);
|
|
70023
70485
|
if (columnToSort.length) {
|
|
70024
70486
|
return columnToSort.map(column => {
|
|
@@ -70072,6 +70534,18 @@ function useSorter(props, {
|
|
|
70072
70534
|
return compareResult;
|
|
70073
70535
|
});
|
|
70074
70536
|
}
|
|
70537
|
+
const draggableColumn = dataRelatedColsRef.value.find(column => column.type === "draggable" && column.sortByKey !== false);
|
|
70538
|
+
if (draggableColumn) {
|
|
70539
|
+
const orderKey = draggableColumn.key;
|
|
70540
|
+
return filteredDataRef.value.slice().sort((tmNode1, tmNode2) => {
|
|
70541
|
+
const order1 = tmNode1.rawNode[orderKey];
|
|
70542
|
+
const order2 = tmNode2.rawNode[orderKey];
|
|
70543
|
+
if (typeof order1 === "number" && typeof order2 === "number") {
|
|
70544
|
+
return order1 - order2;
|
|
70545
|
+
}
|
|
70546
|
+
return 0;
|
|
70547
|
+
});
|
|
70548
|
+
}
|
|
70075
70549
|
return filteredDataRef.value;
|
|
70076
70550
|
});
|
|
70077
70551
|
function getUpdatedSorterState(sortState) {
|
|
@@ -70110,7 +70584,7 @@ function useSorter(props, {
|
|
|
70110
70584
|
if (!columnKey) {
|
|
70111
70585
|
clearSorter();
|
|
70112
70586
|
} else {
|
|
70113
|
-
const columnToSort = dataRelatedColsRef.value.find(column => column.type !== "selection" && column.type !== "expand" && column.key === columnKey);
|
|
70587
|
+
const columnToSort = dataRelatedColsRef.value.find(column => column.type !== "selection" && column.type !== "expand" && column.type !== "draggable" && column.key === columnKey);
|
|
70114
70588
|
if (!columnToSort?.sorter) return;
|
|
70115
70589
|
const sorter = columnToSort.sorter;
|
|
70116
70590
|
deriveNextSorter({
|
|
@@ -70202,7 +70676,9 @@ function useTableData(props, {
|
|
|
70202
70676
|
});
|
|
70203
70677
|
const controlledFilterState = {};
|
|
70204
70678
|
columnsWithControlledFilter.forEach(column => {
|
|
70205
|
-
if (column.type === "selection" || column.type === "expand")
|
|
70679
|
+
if (column.type === "selection" || column.type === "expand" || column.type === "draggable") {
|
|
70680
|
+
return;
|
|
70681
|
+
}
|
|
70206
70682
|
if (column.filterOptionValues === void 0) {
|
|
70207
70683
|
controlledFilterState[column.key] = column.filterOptionValue ?? null;
|
|
70208
70684
|
} else {
|
|
@@ -70227,7 +70703,7 @@ function useTableData(props, {
|
|
|
70227
70703
|
} = treeMateRef;
|
|
70228
70704
|
const columnEntries = [];
|
|
70229
70705
|
columns.forEach(column => {
|
|
70230
|
-
if (column.type === "selection" || column.type === "expand" || "children" in column) {
|
|
70706
|
+
if (column.type === "selection" || column.type === "expand" || column.type === "draggable" || "children" in column) {
|
|
70231
70707
|
return;
|
|
70232
70708
|
}
|
|
70233
70709
|
columnEntries.push([column.key, column]);
|
|
@@ -70504,7 +70980,7 @@ function restoreSortStateFromStored(stored, dataRelatedCols) {
|
|
|
70504
70980
|
if (!stored?.length) return null;
|
|
70505
70981
|
const result = [];
|
|
70506
70982
|
for (const item of stored) {
|
|
70507
|
-
const column = dataRelatedCols.find(col => col.type !== "selection" && col.type !== "expand" && "key" in col && col.key === item.columnKey && col.sorter !== void 0);
|
|
70983
|
+
const column = dataRelatedCols.find(col => col.type !== "selection" && col.type !== "expand" && col.type !== "draggable" && "key" in col && col.key === item.columnKey && col.sorter !== void 0);
|
|
70508
70984
|
if (column?.sorter) {
|
|
70509
70985
|
result.push({
|
|
70510
70986
|
columnKey: item.columnKey,
|
|
@@ -70650,6 +71126,21 @@ var _UDataTable = defineComponent({
|
|
|
70650
71126
|
expandableRef,
|
|
70651
71127
|
doUpdateExpandedRowKeys
|
|
70652
71128
|
} = useExpand(props, treeMateRef);
|
|
71129
|
+
const {
|
|
71130
|
+
draggableColumnRef,
|
|
71131
|
+
draggingRowKeySetRef,
|
|
71132
|
+
droppingRowKeyRef,
|
|
71133
|
+
droppingPositionRef,
|
|
71134
|
+
handleRowDragStart,
|
|
71135
|
+
handleRowDragOver,
|
|
71136
|
+
handleRowDragLeave,
|
|
71137
|
+
handleRowDragEnd,
|
|
71138
|
+
handleRowDrop
|
|
71139
|
+
} = useRowDrag(props, {
|
|
71140
|
+
paginatedDataRef,
|
|
71141
|
+
mergedCheckedRowKeySetRef,
|
|
71142
|
+
mergedClsPrefixRef
|
|
71143
|
+
});
|
|
70653
71144
|
const {
|
|
70654
71145
|
handleTableBodyScroll,
|
|
70655
71146
|
handleTableHeaderScroll,
|
|
@@ -71091,6 +71582,15 @@ var _UDataTable = defineComponent({
|
|
|
71091
71582
|
"--u-action-divider-color": actionDividerColor
|
|
71092
71583
|
};
|
|
71093
71584
|
}),
|
|
71585
|
+
draggableColumnRef,
|
|
71586
|
+
draggingRowKeySetRef,
|
|
71587
|
+
droppingRowKeyRef,
|
|
71588
|
+
droppingPositionRef,
|
|
71589
|
+
handleRowDragStart,
|
|
71590
|
+
handleRowDragOver,
|
|
71591
|
+
handleRowDragLeave,
|
|
71592
|
+
handleRowDragEnd,
|
|
71593
|
+
handleRowDrop,
|
|
71094
71594
|
onLoadRef: toRef(props, "onLoad"),
|
|
71095
71595
|
mergedTableLayoutRef,
|
|
71096
71596
|
resizableEnabledRef,
|
|
@@ -71166,6 +71666,9 @@ var _UDataTable = defineComponent({
|
|
|
71166
71666
|
thButtonColorHover,
|
|
71167
71667
|
thIconColor,
|
|
71168
71668
|
thIconColorActive,
|
|
71669
|
+
dropMarkColor,
|
|
71670
|
+
dragGhostOpacity,
|
|
71671
|
+
dragGhostFilter,
|
|
71169
71672
|
filterSize,
|
|
71170
71673
|
borderRadius,
|
|
71171
71674
|
lineHeight,
|
|
@@ -71234,6 +71737,9 @@ var _UDataTable = defineComponent({
|
|
|
71234
71737
|
"--u-th-button-color-hover": thButtonColorHover,
|
|
71235
71738
|
"--u-th-icon-color": thIconColor,
|
|
71236
71739
|
"--u-th-icon-color-active": thIconColorActive,
|
|
71740
|
+
"--u-drop-mark-color": dropMarkColor,
|
|
71741
|
+
"--u-drag-ghost-opacity": dragGhostOpacity,
|
|
71742
|
+
"--u-drag-ghost-filter": dragGhostFilter,
|
|
71237
71743
|
"--u-filter-size": filterSize,
|
|
71238
71744
|
"--u-pagination-margin": paginationMargin,
|
|
71239
71745
|
"--u-empty-padding": emptyPadding,
|
|
@@ -80200,7 +80706,7 @@ var _UDescriptions = defineComponent({
|
|
|
80200
80706
|
},
|
|
80201
80707
|
render() {
|
|
80202
80708
|
const defaultSlots = this.$slots.default;
|
|
80203
|
-
const children = defaultSlots ? flatten$
|
|
80709
|
+
const children = defaultSlots ? flatten$1(defaultSlots()) : [];
|
|
80204
80710
|
const memorizedLength = children.length;
|
|
80205
80711
|
const {
|
|
80206
80712
|
contentClass,
|
|
@@ -83860,7 +84366,7 @@ var USpace$1 = defineComponent({
|
|
|
83860
84366
|
wrapItem,
|
|
83861
84367
|
internalUseGap
|
|
83862
84368
|
} = this;
|
|
83863
|
-
const children = flatten$
|
|
84369
|
+
const children = flatten$1(getSlot(this), false);
|
|
83864
84370
|
if (!children.length)
|
|
83865
84371
|
return null;
|
|
83866
84372
|
const horizontalMargin = `${margin.horizontal}px`;
|
|
@@ -95381,6 +95887,10 @@ const mappingCardInjectionKey = createInjectionKey("u-mapping-card");
|
|
|
95381
95887
|
const mappingCardProps = {
|
|
95382
95888
|
title: [String, Function],
|
|
95383
95889
|
description: [String, Function],
|
|
95890
|
+
subTitle: [String, Function],
|
|
95891
|
+
subDescription: [String, Function],
|
|
95892
|
+
headerInfo: Function,
|
|
95893
|
+
headerSubInfo: Function,
|
|
95384
95894
|
rows: Array,
|
|
95385
95895
|
cols: {
|
|
95386
95896
|
type: Number,
|
|
@@ -95999,6 +96509,26 @@ var MappingCardHeader = defineComponent({
|
|
|
95999
96509
|
const theme = mergedThemeRef.value;
|
|
96000
96510
|
const locale = localeRef.value;
|
|
96001
96511
|
const renderTextProp = (value) => typeof value === "function" ? value() : value;
|
|
96512
|
+
const renderInfoText = (title, description) => {
|
|
96513
|
+
if (!title && !description)
|
|
96514
|
+
return null;
|
|
96515
|
+
return /* @__PURE__ */ h("div", { class: `${prefix}-mapping-card__header-info-text` }, title && /* @__PURE__ */ h("div", { class: `${prefix}-mapping-card__header-title` }, renderTextProp(title)), description && /* @__PURE__ */ h("div", { class: `${prefix}-mapping-card__header-description` }, renderTextProp(description)));
|
|
96516
|
+
};
|
|
96517
|
+
const mainInfo = resolveSlot(slots.headerInfo, () => {
|
|
96518
|
+
const fromProp = props.headerInfo?.();
|
|
96519
|
+
if (fromProp)
|
|
96520
|
+
return [fromProp];
|
|
96521
|
+
const fallback = renderInfoText(props.title, props.description);
|
|
96522
|
+
return fallback ? [fallback] : [];
|
|
96523
|
+
});
|
|
96524
|
+
const subInfo = resolveSlot(slots.headerSubInfo, () => {
|
|
96525
|
+
const fromProp = props.headerSubInfo?.();
|
|
96526
|
+
if (fromProp)
|
|
96527
|
+
return [fromProp];
|
|
96528
|
+
const fallback = renderInfoText(props.subTitle, props.subDescription);
|
|
96529
|
+
return fallback ? [fallback] : [];
|
|
96530
|
+
});
|
|
96531
|
+
const hasSubInfo = subInfo.length > 0;
|
|
96002
96532
|
return /* @__PURE__ */ h("div", { class: `${prefix}-mapping-card__header` }, /* @__PURE__ */ h(
|
|
96003
96533
|
_UFlex,
|
|
96004
96534
|
{
|
|
@@ -96007,7 +96537,7 @@ var MappingCardHeader = defineComponent({
|
|
|
96007
96537
|
class: `${prefix}-mapping-card__header-info`
|
|
96008
96538
|
},
|
|
96009
96539
|
{
|
|
96010
|
-
default: () => /* @__PURE__ */ h(Fragment, null,
|
|
96540
|
+
default: () => /* @__PURE__ */ h(Fragment, null, mainInfo, !props.hideCopy && /* @__PURE__ */ h(_UTooltip, null, {
|
|
96011
96541
|
trigger: () => /* @__PURE__ */ h(
|
|
96012
96542
|
Button,
|
|
96013
96543
|
{
|
|
@@ -96031,7 +96561,7 @@ var MappingCardHeader = defineComponent({
|
|
|
96031
96561
|
}
|
|
96032
96562
|
),
|
|
96033
96563
|
default: () => locale.copyTooltip
|
|
96034
|
-
}))
|
|
96564
|
+
}), hasSubInfo && /* @__PURE__ */ h("div", { class: `${prefix}-mapping-card__header-info-divider` }), hasSubInfo && subInfo)
|
|
96035
96565
|
}
|
|
96036
96566
|
), !props.hideHeaderActions && /* @__PURE__ */ h(_UFlex, { align: "center", size: "small" }, {
|
|
96037
96567
|
default: () => resolveSlot(slots.headerActions, () => {
|
|
@@ -96044,7 +96574,7 @@ var MappingCardHeader = defineComponent({
|
|
|
96044
96574
|
...props.headerSwitchProps ?? {},
|
|
96045
96575
|
theme: theme.peers.Switch,
|
|
96046
96576
|
themeOverrides: theme.peerOverrides.Switch,
|
|
96047
|
-
onUpdateValue: (
|
|
96577
|
+
onUpdateValue: (value) => props.onSwitchChange?.(value)
|
|
96048
96578
|
}
|
|
96049
96579
|
),
|
|
96050
96580
|
default: () => locale.switchTooltip
|
|
@@ -96113,85 +96643,92 @@ var MappingCardHeader = defineComponent({
|
|
|
96113
96643
|
});
|
|
96114
96644
|
|
|
96115
96645
|
var style$o = c$1([cB("mapping-card", `
|
|
96116
|
-
|
|
96117
|
-
|
|
96118
|
-
|
|
96119
|
-
|
|
96120
|
-
|
|
96121
|
-
`, [cE("header", `
|
|
96122
|
-
|
|
96123
|
-
|
|
96124
|
-
|
|
96125
|
-
|
|
96126
|
-
|
|
96127
|
-
|
|
96128
|
-
|
|
96129
|
-
|
|
96130
|
-
|
|
96131
|
-
|
|
96132
|
-
|
|
96133
|
-
|
|
96134
|
-
|
|
96646
|
+
background-color: var(--u-background-color);
|
|
96647
|
+
border: 1px solid var(--u-border-color);
|
|
96648
|
+
border-radius: var(--u-border-radius);
|
|
96649
|
+
overflow: hidden;
|
|
96650
|
+
box-sizing: border-box;
|
|
96651
|
+
`, [cE("header", `
|
|
96652
|
+
padding: var(--u-header-padding);
|
|
96653
|
+
display: flex;
|
|
96654
|
+
align-items: center;
|
|
96655
|
+
justify-content: space-between;
|
|
96656
|
+
gap: 8px;
|
|
96657
|
+
position: relative;
|
|
96658
|
+
`, [c$1("&::after", `
|
|
96659
|
+
content: '';
|
|
96660
|
+
position: absolute;
|
|
96661
|
+
left: 24px;
|
|
96662
|
+
right: 24px;
|
|
96663
|
+
bottom: 0;
|
|
96664
|
+
height: 1px;
|
|
96665
|
+
background: var(--u-border-color);
|
|
96666
|
+
`)]), cE("header-info", `
|
|
96667
|
+
min-width: 0;
|
|
96668
|
+
`), cE("header-info-text", `
|
|
96669
|
+
min-width: 0;
|
|
96670
|
+
margin-right: 12px;
|
|
96671
|
+
`), cE("header-title", `
|
|
96672
|
+
color: var(--u-title-color);
|
|
96673
|
+
`), cE("header-description", `
|
|
96674
|
+
color: var(--u-description-color);
|
|
96675
|
+
margin-top: 2px;
|
|
96676
|
+
`), cE("header-info-divider", `
|
|
96677
|
+
margin-right: 12px;
|
|
96678
|
+
width: 1px;
|
|
96679
|
+
align-self: stretch;
|
|
96135
96680
|
background: var(--u-border-color);
|
|
96136
|
-
|
|
96137
|
-
|
|
96138
|
-
|
|
96139
|
-
|
|
96140
|
-
|
|
96141
|
-
|
|
96142
|
-
|
|
96143
|
-
|
|
96144
|
-
|
|
96145
|
-
|
|
96146
|
-
|
|
96147
|
-
|
|
96148
|
-
|
|
96149
|
-
|
|
96150
|
-
|
|
96151
|
-
|
|
96152
|
-
|
|
96153
|
-
|
|
96154
|
-
|
|
96155
|
-
|
|
96156
|
-
|
|
96157
|
-
|
|
96158
|
-
|
|
96681
|
+
flex-shrink: 0;
|
|
96682
|
+
`), cE("body", `
|
|
96683
|
+
display: flex;
|
|
96684
|
+
padding: var(--u-body-padding);
|
|
96685
|
+
`), cE("body-group", `
|
|
96686
|
+
flex: 1;
|
|
96687
|
+
position: relative;
|
|
96688
|
+
`, [c$1("&:last-child", `
|
|
96689
|
+
padding: 0 0 12px 20px;
|
|
96690
|
+
`), c$1("&:first-child", `
|
|
96691
|
+
padding: 0 20px 12px 0;
|
|
96692
|
+
`), c$1("&:only-child", `
|
|
96693
|
+
padding: 0 0 12px 0;
|
|
96694
|
+
`), c$1("&::after", `
|
|
96695
|
+
content: '';
|
|
96696
|
+
position: absolute;
|
|
96697
|
+
right: 0;
|
|
96698
|
+
top: 0;
|
|
96699
|
+
width: 1px;
|
|
96700
|
+
height: calc(100% - 12px);
|
|
96701
|
+
background: var(--u-border-color);
|
|
96702
|
+
`), c$1("&:last-child::after", `
|
|
96703
|
+
display: none;
|
|
96704
|
+
`)]), cE("body-items", `
|
|
96705
|
+
align-items: center;
|
|
96706
|
+
`), cE("body-item", [cM("text", `
|
|
96707
|
+
padding: 0 24px;
|
|
96708
|
+
`)]), cE("body-group-icon", `
|
|
96159
96709
|
position: absolute;
|
|
96160
96710
|
right: 0;
|
|
96161
|
-
top:
|
|
96162
|
-
|
|
96163
|
-
|
|
96164
|
-
|
|
96165
|
-
|
|
96166
|
-
|
|
96167
|
-
|
|
96168
|
-
|
|
96169
|
-
|
|
96170
|
-
|
|
96171
|
-
`)
|
|
96172
|
-
|
|
96173
|
-
|
|
96174
|
-
|
|
96175
|
-
|
|
96176
|
-
|
|
96177
|
-
|
|
96178
|
-
|
|
96179
|
-
|
|
96180
|
-
|
|
96181
|
-
|
|
96182
|
-
justify-content: center;
|
|
96183
|
-
background-color: var(--u-divider-background-color);
|
|
96184
|
-
`), cE("side", `
|
|
96185
|
-
flex: 1;
|
|
96186
|
-
min-width: 0;
|
|
96187
|
-
`), cE("arrow", `
|
|
96188
|
-
display: flex;
|
|
96189
|
-
align-items: center;
|
|
96190
|
-
padding-top: 32px;
|
|
96191
|
-
color: var(--u-arrow-color);
|
|
96192
|
-
font-size: 16px;
|
|
96193
|
-
flex-shrink: 0;
|
|
96194
|
-
`)]), cB("mapping-card-list", `
|
|
96711
|
+
top: 50%;
|
|
96712
|
+
transform: translate(50%, -50%);
|
|
96713
|
+
z-index: 1;
|
|
96714
|
+
display: flex;
|
|
96715
|
+
align-items: center;
|
|
96716
|
+
height: 44px;
|
|
96717
|
+
width: 44px;
|
|
96718
|
+
border-radius: 100px;
|
|
96719
|
+
justify-content: center;
|
|
96720
|
+
background-color: var(--u-divider-background-color);
|
|
96721
|
+
`), cE("side", `
|
|
96722
|
+
flex: 1;
|
|
96723
|
+
min-width: 0;
|
|
96724
|
+
`), cE("arrow", `
|
|
96725
|
+
display: flex;
|
|
96726
|
+
align-items: center;
|
|
96727
|
+
padding-top: 32px;
|
|
96728
|
+
color: var(--u-arrow-color);
|
|
96729
|
+
font-size: 16px;
|
|
96730
|
+
flex-shrink: 0;
|
|
96731
|
+
`)]), cB("mapping-card-list", `
|
|
96195
96732
|
display: flex;
|
|
96196
96733
|
justify-content: space-between;
|
|
96197
96734
|
flex-direction: column;
|
|
@@ -96268,7 +96805,11 @@ var _UMappingCard = defineComponent({
|
|
|
96268
96805
|
class: [`${this.mergedClsPrefix}-mapping-card`, themeClass],
|
|
96269
96806
|
style: cssVars
|
|
96270
96807
|
},
|
|
96271
|
-
/* @__PURE__ */ h(MappingCardHeader, null, {
|
|
96808
|
+
/* @__PURE__ */ h(MappingCardHeader, null, {
|
|
96809
|
+
headerActions: this.$slots.headerActions,
|
|
96810
|
+
headerInfo: this.$slots.headerInfo,
|
|
96811
|
+
headerSubInfo: this.$slots.headerSubInfo
|
|
96812
|
+
}),
|
|
96272
96813
|
/* @__PURE__ */ h(MappingCardBody, null)
|
|
96273
96814
|
);
|
|
96274
96815
|
}
|
|
@@ -103657,7 +104198,7 @@ var _USteps = defineComponent({
|
|
|
103657
104198
|
(variantConfigs[this.variant]?.vertical ?? this.vertical) && `${mergedClsPrefix}-steps--vertical`
|
|
103658
104199
|
]
|
|
103659
104200
|
},
|
|
103660
|
-
stepsWithIndex(flatten$
|
|
104201
|
+
stepsWithIndex(flatten$1(getSlot(this)))
|
|
103661
104202
|
);
|
|
103662
104203
|
}
|
|
103663
104204
|
});
|
|
@@ -104839,7 +105380,7 @@ var _UTabs = defineComponent({
|
|
|
104839
105380
|
});
|
|
104840
105381
|
const compitableValueRef = useCompitable(props, ["activeName", "value"]);
|
|
104841
105382
|
const uncontrolledValueRef = ref(
|
|
104842
|
-
compitableValueRef.value ?? props.defaultValue ?? (slots.default ? flatten$
|
|
105383
|
+
compitableValueRef.value ?? props.defaultValue ?? (slots.default ? flatten$1(slots.default())[0]?.props?.name : null)
|
|
104843
105384
|
);
|
|
104844
105385
|
const mergedValueRef = useMergedState(
|
|
104845
105386
|
compitableValueRef,
|
|
@@ -105334,10 +105875,10 @@ var _UTabs = defineComponent({
|
|
|
105334
105875
|
$slots: { default: defaultSlot, prefix: prefixSlot, suffix: suffixSlot }
|
|
105335
105876
|
} = this;
|
|
105336
105877
|
onRender?.();
|
|
105337
|
-
const tabPaneChildren = defaultSlot ? flatten$
|
|
105878
|
+
const tabPaneChildren = defaultSlot ? flatten$1(defaultSlot()).filter((v) => {
|
|
105338
105879
|
return v.type.name === "TabPane";
|
|
105339
105880
|
}) : [];
|
|
105340
|
-
const tabChildren = defaultSlot ? flatten$
|
|
105881
|
+
const tabChildren = defaultSlot ? flatten$1(defaultSlot()).filter((v) => {
|
|
105341
105882
|
return v.type.name === "Tab";
|
|
105342
105883
|
}) : [];
|
|
105343
105884
|
const showPane = !tabChildren.length;
|
|
@@ -107653,6 +108194,16 @@ var UTreeNodeSwitcher = defineComponent({
|
|
|
107653
108194
|
treeInjectionKey,
|
|
107654
108195
|
null
|
|
107655
108196
|
);
|
|
108197
|
+
const renderSwitchIcon = () => {
|
|
108198
|
+
const { value: renderSwitcherIcon } = renderSwitcherIconRef;
|
|
108199
|
+
return /* @__PURE__ */ h(UIconSwitchTransition, null, {
|
|
108200
|
+
default: () => renderSwitcherIcon ? renderSwitcherIcon({
|
|
108201
|
+
expanded: props.expanded,
|
|
108202
|
+
selected: props.selected,
|
|
108203
|
+
option: props.tmNode.rawNode
|
|
108204
|
+
}) : /* @__PURE__ */ h(UBaseIcon, { clsPrefix: props.clsPrefix, key: "switcher" }, { default: () => /* @__PURE__ */ h(ChevronRightIcon, null) })
|
|
108205
|
+
});
|
|
108206
|
+
};
|
|
107656
108207
|
return () => {
|
|
107657
108208
|
const { clsPrefix, expanded, hide, indent, onClick } = props;
|
|
107658
108209
|
return /* @__PURE__ */ h(
|
|
@@ -107667,28 +108218,16 @@ var UTreeNodeSwitcher = defineComponent({
|
|
|
107667
108218
|
style: { width: `${indent}px` },
|
|
107668
108219
|
onClick
|
|
107669
108220
|
},
|
|
107670
|
-
/* @__PURE__ */ h("div", { class: `${clsPrefix}-tree-node-switcher__icon` }, /* @__PURE__ */ h(
|
|
107671
|
-
|
|
107672
|
-
|
|
107673
|
-
|
|
107674
|
-
|
|
107675
|
-
|
|
107676
|
-
|
|
107677
|
-
|
|
107678
|
-
radius: 85,
|
|
107679
|
-
strokeWidth: 20,
|
|
107680
|
-
...spinPropsRef?.value
|
|
107681
|
-
}
|
|
107682
|
-
);
|
|
107683
|
-
}
|
|
107684
|
-
const { value: renderSwitcherIcon } = renderSwitcherIconRef;
|
|
107685
|
-
return renderSwitcherIcon ? renderSwitcherIcon({
|
|
107686
|
-
expanded: props.expanded,
|
|
107687
|
-
selected: props.selected,
|
|
107688
|
-
option: props.tmNode.rawNode
|
|
107689
|
-
}) : /* @__PURE__ */ h(UBaseIcon, { clsPrefix, key: "switcher" }, { default: () => /* @__PURE__ */ h(SwitcherIcon, null) });
|
|
108221
|
+
/* @__PURE__ */ h("div", { class: `${clsPrefix}-tree-node-switcher__icon` }, props.loading ? /* @__PURE__ */ h(
|
|
108222
|
+
UBaseLoading,
|
|
108223
|
+
{
|
|
108224
|
+
clsPrefix,
|
|
108225
|
+
key: "loading",
|
|
108226
|
+
radius: 85,
|
|
108227
|
+
strokeWidth: 20,
|
|
108228
|
+
...spinPropsRef?.value
|
|
107690
108229
|
}
|
|
107691
|
-
|
|
108230
|
+
) : renderSwitchIcon())
|
|
107692
108231
|
);
|
|
107693
108232
|
};
|
|
107694
108233
|
}
|
|
@@ -108376,19 +108915,20 @@ var style$3 = cB("tree", `
|
|
|
108376
108915
|
vertical-align: bottom;
|
|
108377
108916
|
`, [cE("icon", `
|
|
108378
108917
|
position: relative;
|
|
108379
|
-
height:
|
|
108380
|
-
width:
|
|
108918
|
+
height: var(--u-switcher-size);
|
|
108919
|
+
width: var(--u-switcher-size);
|
|
108381
108920
|
display: flex;
|
|
108921
|
+
align-items: center;
|
|
108922
|
+
justify-content: center;
|
|
108923
|
+
border-radius: 50%;
|
|
108382
108924
|
color: var(--u-arrow-color);
|
|
108383
|
-
|
|
108925
|
+
background-color: var(--u-switcher-color);
|
|
108926
|
+
transition:
|
|
108927
|
+
color .3s var(--u-bezier),
|
|
108928
|
+
background-color .3s var(--u-bezier);
|
|
108384
108929
|
font-size: 14px;
|
|
108385
108930
|
`, [cB("icon", [iconSwitchTransitionNode]), cB("base-loading", `
|
|
108386
108931
|
color: var(--u-loading-color);
|
|
108387
|
-
position: absolute;
|
|
108388
|
-
left: 0;
|
|
108389
|
-
top: 0;
|
|
108390
|
-
right: 0;
|
|
108391
|
-
bottom: 0;
|
|
108392
108932
|
`, [iconSwitchTransitionNode]), cB("base-icon", [iconSwitchTransitionNode])]), cM("hide", "visibility: hidden;"), cM("expanded", "transform: rotate(90deg);")]), cB("tree-node-checkbox", `
|
|
108393
108933
|
display: inline-flex;
|
|
108394
108934
|
height: var(--u-node-content-height);
|
|
@@ -108525,7 +109065,7 @@ const treeProps = {
|
|
|
108525
109065
|
scrollbarProps: Object,
|
|
108526
109066
|
indent: {
|
|
108527
109067
|
type: Number,
|
|
108528
|
-
default:
|
|
109068
|
+
default: 36
|
|
108529
109069
|
},
|
|
108530
109070
|
allowDrop: {
|
|
108531
109071
|
type: Function,
|
|
@@ -108561,6 +109101,7 @@ const treeProps = {
|
|
|
108561
109101
|
"onUpdate:checkedKeys": [Function, Array],
|
|
108562
109102
|
onUpdateSelectedKeys: [Function, Array],
|
|
108563
109103
|
"onUpdate:selectedKeys": [Function, Array],
|
|
109104
|
+
onScroll: [Function, Array],
|
|
108564
109105
|
...treeSharedProps,
|
|
108565
109106
|
// internal props for tree-select
|
|
108566
109107
|
internalTreeSelect: Boolean,
|
|
@@ -108939,7 +109480,7 @@ var _UTree = defineComponent({
|
|
|
108939
109480
|
if (~expandedNodeIndex) {
|
|
108940
109481
|
const children = afNodesRef.value[expandedNodeIndex].children;
|
|
108941
109482
|
if (children) {
|
|
108942
|
-
const expandedChildren = flatten
|
|
109483
|
+
const expandedChildren = flatten(children, value);
|
|
108943
109484
|
afNodesRef.value.splice(expandedNodeIndex + 1, 0, {
|
|
108944
109485
|
__motion: true,
|
|
108945
109486
|
mode: "expand",
|
|
@@ -108958,7 +109499,7 @@ var _UTree = defineComponent({
|
|
|
108958
109499
|
if (!collapsedNodeChildren)
|
|
108959
109500
|
return;
|
|
108960
109501
|
aipRef.value = true;
|
|
108961
|
-
const collapsedChildren = flatten
|
|
109502
|
+
const collapsedChildren = flatten(collapsedNodeChildren, value);
|
|
108962
109503
|
afNodesRef.value.splice(collapsedNodeIndex + 1, 0, {
|
|
108963
109504
|
__motion: true,
|
|
108964
109505
|
mode: "collapse",
|
|
@@ -109300,8 +109841,8 @@ var _UTree = defineComponent({
|
|
|
109300
109841
|
}
|
|
109301
109842
|
doDragLeave({ event, node: node.rawNode });
|
|
109302
109843
|
}
|
|
109303
|
-
function handleDragLeaveTree(
|
|
109304
|
-
if (
|
|
109844
|
+
function handleDragLeaveTree(event) {
|
|
109845
|
+
if (event.target !== event.currentTarget)
|
|
109305
109846
|
return;
|
|
109306
109847
|
resetDropState();
|
|
109307
109848
|
}
|
|
@@ -109498,22 +110039,26 @@ var _UTree = defineComponent({
|
|
|
109498
110039
|
});
|
|
109499
110040
|
resetDndState();
|
|
109500
110041
|
}
|
|
109501
|
-
function
|
|
110042
|
+
function doScroll(event) {
|
|
110043
|
+
props.onScroll && call(props.onScroll, event);
|
|
110044
|
+
}
|
|
110045
|
+
function handleScroll(event) {
|
|
109502
110046
|
syncScrollbar();
|
|
110047
|
+
doScroll(event);
|
|
109503
110048
|
}
|
|
109504
110049
|
function handleResize() {
|
|
109505
110050
|
syncScrollbar();
|
|
109506
110051
|
}
|
|
109507
|
-
function handleFocusout(
|
|
110052
|
+
function handleFocusout(event) {
|
|
109508
110053
|
if (props.virtualScroll || props.internalScrollable) {
|
|
109509
110054
|
const { value: scrollbarInst } = scrollbarInstRef;
|
|
109510
|
-
if (scrollbarInst?.containerRef?.contains(
|
|
110055
|
+
if (scrollbarInst?.containerRef?.contains(event.relatedTarget)) {
|
|
109511
110056
|
return;
|
|
109512
110057
|
}
|
|
109513
110058
|
pendingNodeKeyRef.value = null;
|
|
109514
110059
|
} else {
|
|
109515
110060
|
const { value: selfEl } = selfElRef;
|
|
109516
|
-
if (selfEl?.contains(
|
|
110061
|
+
if (selfEl?.contains(event.relatedTarget))
|
|
109517
110062
|
return;
|
|
109518
110063
|
pendingNodeKeyRef.value = null;
|
|
109519
110064
|
}
|
|
@@ -109626,6 +110171,8 @@ var _UTree = defineComponent({
|
|
|
109626
110171
|
nodeColorPressed,
|
|
109627
110172
|
nodeColorActive,
|
|
109628
110173
|
arrowColor,
|
|
110174
|
+
switcherColor,
|
|
110175
|
+
switcherSize,
|
|
109629
110176
|
loadingColor,
|
|
109630
110177
|
nodeTextColor,
|
|
109631
110178
|
nodeTextColorDisabled,
|
|
@@ -109642,6 +110189,8 @@ var _UTree = defineComponent({
|
|
|
109642
110189
|
);
|
|
109643
110190
|
return {
|
|
109644
110191
|
"--u-arrow-color": arrowColor,
|
|
110192
|
+
"--u-switcher-color": switcherColor,
|
|
110193
|
+
"--u-switcher-size": switcherSize,
|
|
109645
110194
|
"--u-loading-color": loadingColor,
|
|
109646
110195
|
"--u-bezier": cubicBezierEaseInOut,
|
|
109647
110196
|
"--u-font-size": fontSize,
|
|
@@ -109790,6 +110339,7 @@ var _UTree = defineComponent({
|
|
|
109790
110339
|
...scrollbarProps,
|
|
109791
110340
|
class: treeClass,
|
|
109792
110341
|
tabindex,
|
|
110342
|
+
onScroll: this.handleScroll,
|
|
109793
110343
|
onKeydown: mergedFocusable ? handleKeydown : void 0,
|
|
109794
110344
|
onFocusout: mergedFocusable ? handleFocusout : void 0,
|
|
109795
110345
|
style: this.cssVars,
|
|
@@ -109833,6 +110383,34 @@ var _UTree = defineComponent({
|
|
|
109833
110383
|
}
|
|
109834
110384
|
});
|
|
109835
110385
|
|
|
110386
|
+
function isVerticallyVisibleWithin(element, containerRect) {
|
|
110387
|
+
const elementRect = element.getBoundingClientRect();
|
|
110388
|
+
return elementRect.top < containerRect.bottom && elementRect.bottom > containerRect.top;
|
|
110389
|
+
}
|
|
110390
|
+
function scanReachedRootOptions(scrollElement, rootNodes, expandedKeys, previousVisibleKeys) {
|
|
110391
|
+
const containerRect = scrollElement.getBoundingClientRect();
|
|
110392
|
+
const visibleKeys = /* @__PURE__ */new Set();
|
|
110393
|
+
const reachedOptions = [];
|
|
110394
|
+
for (const rootNode of rootNodes) {
|
|
110395
|
+
const {
|
|
110396
|
+
children
|
|
110397
|
+
} = rootNode;
|
|
110398
|
+
if (!children?.length || !expandedKeys?.includes(rootNode.key)) continue;
|
|
110399
|
+
const lastChild = children[children.length - 1];
|
|
110400
|
+
const lastChildElement = scrollElement.querySelector(`[data-key="${createDataKey(lastChild.key)}"]`);
|
|
110401
|
+
const isHiddenOrMissing = !lastChildElement || !isVerticallyVisibleWithin(lastChildElement, containerRect);
|
|
110402
|
+
if (isHiddenOrMissing) continue;
|
|
110403
|
+
visibleKeys.add(rootNode.key);
|
|
110404
|
+
if (!previousVisibleKeys.has(rootNode.key)) {
|
|
110405
|
+
reachedOptions.push(rootNode.rawNode);
|
|
110406
|
+
}
|
|
110407
|
+
}
|
|
110408
|
+
return {
|
|
110409
|
+
reachedOptions,
|
|
110410
|
+
visibleKeys
|
|
110411
|
+
};
|
|
110412
|
+
}
|
|
110413
|
+
|
|
109836
110414
|
var style$2 = c$1([cB("tree-select", `
|
|
109837
110415
|
z-index: auto;
|
|
109838
110416
|
outline: none;
|
|
@@ -109951,6 +110529,8 @@ const treeSelectProps = {
|
|
|
109951
110529
|
nodeProps: Function,
|
|
109952
110530
|
onBlur: Function,
|
|
109953
110531
|
onFocus: Function,
|
|
110532
|
+
onScroll: [Function, Array],
|
|
110533
|
+
onScrollOptionEnd: [Function, Array],
|
|
109954
110534
|
onLoad: Function,
|
|
109955
110535
|
onUpdateShow: [Function, Array],
|
|
109956
110536
|
onUpdateValue: [Function, Array],
|
|
@@ -110039,6 +110619,7 @@ var _UTreeSelect = defineComponent({
|
|
|
110039
110619
|
uncontrolledExpandedKeysRef
|
|
110040
110620
|
);
|
|
110041
110621
|
const focusedRef = ref(false);
|
|
110622
|
+
let visibleRootEndKeys = /* @__PURE__ */ new Set();
|
|
110042
110623
|
const mergedPlaceholderRef = computed(() => {
|
|
110043
110624
|
const { placeholder } = props;
|
|
110044
110625
|
if (placeholder !== void 0)
|
|
@@ -110181,17 +110762,17 @@ var _UTreeSelect = defineComponent({
|
|
|
110181
110762
|
}
|
|
110182
110763
|
uncontrolledExpandedKeysRef.value = keys;
|
|
110183
110764
|
}
|
|
110184
|
-
function doFocus(
|
|
110765
|
+
function doFocus(event) {
|
|
110185
110766
|
const { onFocus } = props;
|
|
110186
110767
|
if (onFocus)
|
|
110187
|
-
onFocus(
|
|
110768
|
+
onFocus(event);
|
|
110188
110769
|
triggerFormFocus();
|
|
110189
110770
|
}
|
|
110190
|
-
function doBlur(
|
|
110771
|
+
function doBlur(event) {
|
|
110191
110772
|
closeMenu();
|
|
110192
110773
|
const { onBlur } = props;
|
|
110193
110774
|
if (onBlur)
|
|
110194
|
-
onBlur(
|
|
110775
|
+
onBlur(event);
|
|
110195
110776
|
triggerFormBlur();
|
|
110196
110777
|
}
|
|
110197
110778
|
function closeMenu() {
|
|
@@ -110208,11 +110789,12 @@ var _UTreeSelect = defineComponent({
|
|
|
110208
110789
|
}
|
|
110209
110790
|
function handleMenuLeave() {
|
|
110210
110791
|
patternRef.value = "";
|
|
110792
|
+
visibleRootEndKeys = /* @__PURE__ */ new Set();
|
|
110211
110793
|
}
|
|
110212
|
-
function handleMenuClickoutside(
|
|
110794
|
+
function handleMenuClickoutside(event) {
|
|
110213
110795
|
if (mergedShowRef.value) {
|
|
110214
110796
|
if (!triggerInstRef.value?.$el.contains(
|
|
110215
|
-
getPreciseEventTarget(
|
|
110797
|
+
getPreciseEventTarget(event)
|
|
110216
110798
|
)) {
|
|
110217
110799
|
closeMenu();
|
|
110218
110800
|
}
|
|
@@ -110260,34 +110842,34 @@ var _UTreeSelect = defineComponent({
|
|
|
110260
110842
|
doUpdateIndeterminateKeys(keys, getOptionsByKeys(keys));
|
|
110261
110843
|
}
|
|
110262
110844
|
}
|
|
110263
|
-
function handleTriggerFocus(
|
|
110264
|
-
if (menuElRef.value?.contains(
|
|
110845
|
+
function handleTriggerFocus(event) {
|
|
110846
|
+
if (menuElRef.value?.contains(event.relatedTarget))
|
|
110265
110847
|
return;
|
|
110266
110848
|
focusedRef.value = true;
|
|
110267
|
-
doFocus(
|
|
110849
|
+
doFocus(event);
|
|
110268
110850
|
}
|
|
110269
|
-
function handleTriggerBlur(
|
|
110270
|
-
if (menuElRef.value?.contains(
|
|
110851
|
+
function handleTriggerBlur(event) {
|
|
110852
|
+
if (menuElRef.value?.contains(event.relatedTarget))
|
|
110271
110853
|
return;
|
|
110272
110854
|
focusedRef.value = false;
|
|
110273
|
-
doBlur(
|
|
110855
|
+
doBlur(event);
|
|
110274
110856
|
}
|
|
110275
|
-
function handleMenuFocusin(
|
|
110276
|
-
if (menuElRef.value?.contains(
|
|
110857
|
+
function handleMenuFocusin(event) {
|
|
110858
|
+
if (menuElRef.value?.contains(event.relatedTarget) || triggerInstRef.value?.$el?.contains(event.relatedTarget)) {
|
|
110277
110859
|
return;
|
|
110278
110860
|
}
|
|
110279
110861
|
focusedRef.value = true;
|
|
110280
|
-
doFocus(
|
|
110862
|
+
doFocus(event);
|
|
110281
110863
|
}
|
|
110282
|
-
function handleMenuFocusout(
|
|
110283
|
-
if (menuElRef.value?.contains(
|
|
110864
|
+
function handleMenuFocusout(event) {
|
|
110865
|
+
if (menuElRef.value?.contains(event.relatedTarget) || triggerInstRef.value?.$el?.contains(event.relatedTarget)) {
|
|
110284
110866
|
return;
|
|
110285
110867
|
}
|
|
110286
110868
|
focusedRef.value = false;
|
|
110287
|
-
doBlur(
|
|
110869
|
+
doBlur(event);
|
|
110288
110870
|
}
|
|
110289
|
-
function handleClear(
|
|
110290
|
-
|
|
110871
|
+
function handleClear(event) {
|
|
110872
|
+
event.stopPropagation();
|
|
110291
110873
|
const { multiple } = props;
|
|
110292
110874
|
if (!multiple && props.filterable) {
|
|
110293
110875
|
closeMenu();
|
|
@@ -110340,20 +110922,20 @@ var _UTreeSelect = defineComponent({
|
|
|
110340
110922
|
}
|
|
110341
110923
|
}
|
|
110342
110924
|
}
|
|
110343
|
-
function handlePatternInput(
|
|
110344
|
-
const { value } =
|
|
110925
|
+
function handlePatternInput(event) {
|
|
110926
|
+
const { value } = event.target;
|
|
110345
110927
|
patternRef.value = value;
|
|
110346
110928
|
}
|
|
110347
|
-
function treeHandleKeydown(
|
|
110929
|
+
function treeHandleKeydown(event) {
|
|
110348
110930
|
const { value: treeInst } = treeInstRef;
|
|
110349
110931
|
if (treeInst) {
|
|
110350
|
-
treeInst.handleKeydown(
|
|
110932
|
+
treeInst.handleKeydown(event);
|
|
110351
110933
|
}
|
|
110352
110934
|
}
|
|
110353
|
-
function handleKeydown(
|
|
110354
|
-
if (
|
|
110935
|
+
function handleKeydown(event) {
|
|
110936
|
+
if (event.key === "Enter") {
|
|
110355
110937
|
if (mergedShowRef.value) {
|
|
110356
|
-
treeHandleKeydown(
|
|
110938
|
+
treeHandleKeydown(event);
|
|
110357
110939
|
if (!props.multiple) {
|
|
110358
110940
|
closeMenu();
|
|
110359
110941
|
focusSelection();
|
|
@@ -110361,17 +110943,17 @@ var _UTreeSelect = defineComponent({
|
|
|
110361
110943
|
} else {
|
|
110362
110944
|
openMenu();
|
|
110363
110945
|
}
|
|
110364
|
-
|
|
110365
|
-
} else if (
|
|
110946
|
+
event.preventDefault();
|
|
110947
|
+
} else if (event.key === "Escape") {
|
|
110366
110948
|
if (mergedShowRef.value) {
|
|
110367
|
-
markEventEffectPerformed(
|
|
110949
|
+
markEventEffectPerformed(event);
|
|
110368
110950
|
closeMenu();
|
|
110369
110951
|
focusSelection();
|
|
110370
110952
|
}
|
|
110371
110953
|
} else {
|
|
110372
110954
|
if (mergedShowRef.value) {
|
|
110373
|
-
treeHandleKeydown(
|
|
110374
|
-
} else if (
|
|
110955
|
+
treeHandleKeydown(event);
|
|
110956
|
+
} else if (event.key === "ArrowDown") {
|
|
110375
110957
|
openMenu();
|
|
110376
110958
|
}
|
|
110377
110959
|
}
|
|
@@ -110380,9 +110962,35 @@ var _UTreeSelect = defineComponent({
|
|
|
110380
110962
|
closeMenu();
|
|
110381
110963
|
focusSelection();
|
|
110382
110964
|
}
|
|
110383
|
-
function handleMenuMousedown(
|
|
110384
|
-
if (!happensIn(
|
|
110385
|
-
|
|
110965
|
+
function handleMenuMousedown(event) {
|
|
110966
|
+
if (!happensIn(event, "action"))
|
|
110967
|
+
event.preventDefault();
|
|
110968
|
+
}
|
|
110969
|
+
function doScroll(event) {
|
|
110970
|
+
const { onScroll } = props;
|
|
110971
|
+
if (onScroll)
|
|
110972
|
+
call(onScroll, event);
|
|
110973
|
+
}
|
|
110974
|
+
function doScrollOptionEnd(option, event) {
|
|
110975
|
+
props.onScrollOptionEnd && call(props.onScrollOptionEnd, option, event);
|
|
110976
|
+
}
|
|
110977
|
+
function handleTreeScroll(event) {
|
|
110978
|
+
doScroll(event);
|
|
110979
|
+
if (!props.onScrollOptionEnd)
|
|
110980
|
+
return;
|
|
110981
|
+
const scrollElement = event.currentTarget || event.target;
|
|
110982
|
+
if (!scrollElement)
|
|
110983
|
+
return;
|
|
110984
|
+
const { reachedOptions, visibleKeys } = scanReachedRootOptions(
|
|
110985
|
+
scrollElement,
|
|
110986
|
+
dataTreeMateRef.value.treeNodes,
|
|
110987
|
+
mergedExpandedKeysRef.value,
|
|
110988
|
+
visibleRootEndKeys
|
|
110989
|
+
);
|
|
110990
|
+
visibleRootEndKeys = visibleKeys;
|
|
110991
|
+
for (const reachedOption of reachedOptions) {
|
|
110992
|
+
doScrollOptionEnd(reachedOption, event);
|
|
110993
|
+
}
|
|
110386
110994
|
}
|
|
110387
110995
|
const selectionRenderTagRef = computed(() => {
|
|
110388
110996
|
const { renderTag } = props;
|
|
@@ -110535,6 +111143,7 @@ var _UTreeSelect = defineComponent({
|
|
|
110535
111143
|
handleKeydown,
|
|
110536
111144
|
handleTabOut,
|
|
110537
111145
|
handleMenuMousedown,
|
|
111146
|
+
handleTreeScroll,
|
|
110538
111147
|
mergedTheme: themeRef,
|
|
110539
111148
|
cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
|
|
110540
111149
|
themeClass: themeClassHandle?.themeClass,
|
|
@@ -110695,7 +111304,8 @@ var _UTreeSelect = defineComponent({
|
|
|
110695
111304
|
onLoad: this.onLoad,
|
|
110696
111305
|
onUpdateCheckedKeys: this.handleUpdateCheckedKeys,
|
|
110697
111306
|
onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys,
|
|
110698
|
-
onUpdateExpandedKeys: this.doUpdateExpandedKeys
|
|
111307
|
+
onUpdateExpandedKeys: this.doUpdateExpandedKeys,
|
|
111308
|
+
onScroll: this.handleTreeScroll
|
|
110699
111309
|
}
|
|
110700
111310
|
),
|
|
110701
111311
|
resolveWrappedSlot($slots.action, (children) => {
|
|
@@ -112623,7 +113233,7 @@ function useThemeVars() {
|
|
|
112623
113233
|
});
|
|
112624
113234
|
}
|
|
112625
113235
|
|
|
112626
|
-
var version = "2.0.
|
|
113236
|
+
var version = "2.0.7";
|
|
112627
113237
|
|
|
112628
113238
|
function create({
|
|
112629
113239
|
componentPrefix = "U",
|