tsv2-library 1.1.0-dev-alpha.39 → 1.1.0-dev-alpha.41
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/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +6 -0
- package/dist/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +6 -0
- package/dist/src/components/v2/Tree/Tree.vue.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/tsv2-library.es.js +159 -15
- package/dist/tsv2-library.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/v2/ButtonSelectTree/ButtonSelectTree.vue.d.ts +6 -0
- package/src/components/v2/DialogSelectTree/DialogSelectTree.vue.d.ts +6 -0
- package/src/components/v2/Tree/Tree.vue.d.ts +6 -0
package/dist/tsv2-library.es.js
CHANGED
|
@@ -42025,6 +42025,7 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
42025
42025
|
flattenDisposableNode: { type: Boolean },
|
|
42026
42026
|
groupParams: {},
|
|
42027
42027
|
excludedKeys: {},
|
|
42028
|
+
allowedKeys: {},
|
|
42028
42029
|
requiredManagerPermission: {},
|
|
42029
42030
|
requiredSystemRole: {}
|
|
42030
42031
|
},
|
|
@@ -42050,7 +42051,62 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
42050
42051
|
const selectedKeysModel = computed({
|
|
42051
42052
|
get: () => props.selectedKeys ?? {},
|
|
42052
42053
|
set: (keys2) => {
|
|
42053
|
-
|
|
42054
|
+
var _a, _b, _c, _d, _e;
|
|
42055
|
+
const selectableSet = selectableKeys.value;
|
|
42056
|
+
const locked = lockedKeys.value;
|
|
42057
|
+
if (selectableSet.size > 0 || locked.size > 0) {
|
|
42058
|
+
const prevKeys = props.selectedKeys ?? {};
|
|
42059
|
+
const nextKeys = { ...keys2 };
|
|
42060
|
+
for (const key of Object.keys(nextKeys)) {
|
|
42061
|
+
if (key !== "0" && !selectableSet.has(key) && !locked.has(key)) {
|
|
42062
|
+
delete nextKeys[key];
|
|
42063
|
+
}
|
|
42064
|
+
}
|
|
42065
|
+
for (const k2 of locked) {
|
|
42066
|
+
nextKeys[k2] = { checked: true, partialChecked: false };
|
|
42067
|
+
}
|
|
42068
|
+
const effectiveSet = /* @__PURE__ */ new Set([...selectableSet, ...locked]);
|
|
42069
|
+
const prevAllChecked = !!((_a = prevKeys["0"]) == null ? void 0 : _a.checked) && !((_b = prevKeys["0"]) == null ? void 0 : _b.partialChecked);
|
|
42070
|
+
const currAllChecked = !!((_c = nextKeys["0"]) == null ? void 0 : _c.checked) && !((_d = nextKeys["0"]) == null ? void 0 : _d.partialChecked);
|
|
42071
|
+
if (currAllChecked && !prevAllChecked) {
|
|
42072
|
+
for (const k2 of selectableSet)
|
|
42073
|
+
nextKeys[k2] = { checked: true, partialChecked: false };
|
|
42074
|
+
nextKeys["0"] = { checked: true, partialChecked: false };
|
|
42075
|
+
} else if (!currAllChecked && prevAllChecked && !((_e = nextKeys["0"]) == null ? void 0 : _e.partialChecked)) {
|
|
42076
|
+
for (const k2 of selectableSet)
|
|
42077
|
+
nextKeys[k2] = { checked: false, partialChecked: false };
|
|
42078
|
+
const checkedCount = [...effectiveSet].filter(
|
|
42079
|
+
(k2) => {
|
|
42080
|
+
var _a2;
|
|
42081
|
+
return (_a2 = nextKeys[k2]) == null ? void 0 : _a2.checked;
|
|
42082
|
+
}
|
|
42083
|
+
).length;
|
|
42084
|
+
if (checkedCount === effectiveSet.size) {
|
|
42085
|
+
nextKeys["0"] = { checked: true, partialChecked: false };
|
|
42086
|
+
} else if (checkedCount > 0) {
|
|
42087
|
+
nextKeys["0"] = { checked: false, partialChecked: true };
|
|
42088
|
+
} else {
|
|
42089
|
+
nextKeys["0"] = { checked: false, partialChecked: false };
|
|
42090
|
+
}
|
|
42091
|
+
} else {
|
|
42092
|
+
const checkedCount = [...effectiveSet].filter(
|
|
42093
|
+
(k2) => {
|
|
42094
|
+
var _a2;
|
|
42095
|
+
return (_a2 = nextKeys[k2]) == null ? void 0 : _a2.checked;
|
|
42096
|
+
}
|
|
42097
|
+
).length;
|
|
42098
|
+
if (checkedCount === effectiveSet.size) {
|
|
42099
|
+
nextKeys["0"] = { checked: true, partialChecked: false };
|
|
42100
|
+
} else if (checkedCount > 0) {
|
|
42101
|
+
nextKeys["0"] = { checked: false, partialChecked: true };
|
|
42102
|
+
} else {
|
|
42103
|
+
nextKeys["0"] = { checked: false, partialChecked: false };
|
|
42104
|
+
}
|
|
42105
|
+
}
|
|
42106
|
+
emit("update:selectedKeys", nextKeys);
|
|
42107
|
+
} else {
|
|
42108
|
+
emit("update:selectedKeys", keys2);
|
|
42109
|
+
}
|
|
42054
42110
|
}
|
|
42055
42111
|
});
|
|
42056
42112
|
const flattenNodes = computed(() => {
|
|
@@ -42390,6 +42446,66 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
42390
42446
|
const expandNodeAll = () => {
|
|
42391
42447
|
expandedKeys2.value = { "0": true };
|
|
42392
42448
|
};
|
|
42449
|
+
const isNodeDisabled = (node2) => {
|
|
42450
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
42451
|
+
if (props.selectDisposableOnly && !node2.isDisposable)
|
|
42452
|
+
return true;
|
|
42453
|
+
if ((_a = props.excludedKeys) == null ? void 0 : _a.includes(node2.key))
|
|
42454
|
+
return true;
|
|
42455
|
+
if (((_b = props.allowedKeys) == null ? void 0 : _b.length) && !((_c = props.allowedKeys) == null ? void 0 : _c.includes(node2.key)) && node2.key !== "0")
|
|
42456
|
+
return true;
|
|
42457
|
+
if (((_d = props.exactDisableKey) == null ? void 0 : _d.toString()) === ((_e = node2.key) == null ? void 0 : _e.toString()))
|
|
42458
|
+
return true;
|
|
42459
|
+
if (props.disableSubChildren && (node2.level ?? 0) >= 2)
|
|
42460
|
+
return true;
|
|
42461
|
+
if (((_f = props.requiredSystemRole) == null ? void 0 : _f.length) && !((_h = (_g = node2 == null ? void 0 : node2.hasSystemRoles) == null ? void 0 : _g[props.requiredSystemRole[0]]) == null ? void 0 : _h[props.requiredSystemRole[1]]))
|
|
42462
|
+
return true;
|
|
42463
|
+
if (props.requiredManagerPermission && !((_j = (_i = node2 == null ? void 0 : node2.hasTransactionRoles) == null ? void 0 : _i.manager) == null ? void 0 : _j[props.requiredManagerPermission]))
|
|
42464
|
+
return true;
|
|
42465
|
+
if (node2.key && ((_k = props.disableKeys) == null ? void 0 : _k.includes(+node2.key)))
|
|
42466
|
+
return true;
|
|
42467
|
+
if (node2.key && disabledDescendantKeys.value.has(node2.key))
|
|
42468
|
+
return true;
|
|
42469
|
+
return false;
|
|
42470
|
+
};
|
|
42471
|
+
const disabledDescendantKeys = computed(() => {
|
|
42472
|
+
var _a;
|
|
42473
|
+
if (!((_a = props.disableKeys) == null ? void 0 : _a.length))
|
|
42474
|
+
return /* @__PURE__ */ new Set();
|
|
42475
|
+
const result = /* @__PURE__ */ new Set();
|
|
42476
|
+
const collectDescendants = (children) => {
|
|
42477
|
+
for (const child of children) {
|
|
42478
|
+
if (child.key)
|
|
42479
|
+
result.add(child.key);
|
|
42480
|
+
collectDescendants(child.children ?? []);
|
|
42481
|
+
}
|
|
42482
|
+
};
|
|
42483
|
+
const traverse = (nodes) => {
|
|
42484
|
+
var _a2;
|
|
42485
|
+
for (const node2 of nodes) {
|
|
42486
|
+
if (node2.key && ((_a2 = props.disableKeys) == null ? void 0 : _a2.includes(+node2.key))) {
|
|
42487
|
+
collectDescendants(node2.children ?? []);
|
|
42488
|
+
} else {
|
|
42489
|
+
traverse(node2.children ?? []);
|
|
42490
|
+
}
|
|
42491
|
+
}
|
|
42492
|
+
};
|
|
42493
|
+
traverse(treeNodes.value);
|
|
42494
|
+
return result;
|
|
42495
|
+
});
|
|
42496
|
+
const selectableKeys = computed(() => {
|
|
42497
|
+
return new Set(
|
|
42498
|
+
flattenNodes.value.filter((n) => {
|
|
42499
|
+
if (n.key === "0")
|
|
42500
|
+
return false;
|
|
42501
|
+
return !isNodeDisabled(n);
|
|
42502
|
+
}).map((n) => n.key).filter(Boolean)
|
|
42503
|
+
);
|
|
42504
|
+
});
|
|
42505
|
+
const lockedKeys = computed(() => {
|
|
42506
|
+
const currentKeys = Array.isArray(props.selectedKeys) ? props.selectedKeys : Object.keys(props.selectedKeys ?? {});
|
|
42507
|
+
return new Set(currentKeys.filter((k2) => k2 !== "0" && !selectableKeys.value.has(k2)));
|
|
42508
|
+
});
|
|
42393
42509
|
const handleSelectionChange = (selectedNodeKeys) => {
|
|
42394
42510
|
if (props.disableSubChildren && props.selectionMode === "checkbox") {
|
|
42395
42511
|
enforceTopLevelSelection(selectedNodeKeys);
|
|
@@ -42467,13 +42583,13 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
|
|
|
42467
42583
|
}, null, 8, ["disabled", "model-value"])
|
|
42468
42584
|
]),
|
|
42469
42585
|
default: withCtx(({ node: node2 }) => {
|
|
42470
|
-
var _a, _b
|
|
42586
|
+
var _a, _b;
|
|
42471
42587
|
return [
|
|
42472
42588
|
createElementVNode("span", {
|
|
42473
|
-
"data-exact-node-disabled":
|
|
42589
|
+
"data-exact-node-disabled": isNodeDisabled(node2),
|
|
42474
42590
|
"data-node-all-is-disabled": (_ctx.disableNodeAll || (_ctx.selectDisposableOnly || _ctx.flattenDisposableNode) && _ctx.selectionMode === "single") && node2.key == "0",
|
|
42475
|
-
"data-node-disabled": node2.key && ((
|
|
42476
|
-
"data-node-has-children": !!((
|
|
42591
|
+
"data-node-disabled": node2.key && ((_a = props.disableKeys) == null ? void 0 : _a.includes(+node2.key)),
|
|
42592
|
+
"data-node-has-children": !!((_b = node2.children) == null ? void 0 : _b.length),
|
|
42477
42593
|
"data-node-key": node2.key,
|
|
42478
42594
|
"data-node-selected": isNodeChecked(node2.key),
|
|
42479
42595
|
class: "flex flex-col grow text-body-medium break-all"
|
|
@@ -42570,6 +42686,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
42570
42686
|
validateQuota: {},
|
|
42571
42687
|
flattenDisposableNode: { type: Boolean },
|
|
42572
42688
|
excludedKeys: {},
|
|
42689
|
+
allowedKeys: {},
|
|
42573
42690
|
hidden: { type: Boolean },
|
|
42574
42691
|
disableSubChildren: { type: Boolean },
|
|
42575
42692
|
requiredManagerPermission: {},
|
|
@@ -42735,6 +42852,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
42735
42852
|
],
|
|
42736
42853
|
"selected-tree-nodes": selectedTreeNodes.value,
|
|
42737
42854
|
"onUpdate:selectedTreeNodes": _cache[2] || (_cache[2] = ($event) => selectedTreeNodes.value = $event),
|
|
42855
|
+
"allowed-keys": _ctx.allowedKeys,
|
|
42738
42856
|
"auto-select-all": _ctx.autoSelectAll,
|
|
42739
42857
|
"disable-keys": _ctx.disableKeys,
|
|
42740
42858
|
"disable-node-all": _ctx.disableNodeAll,
|
|
@@ -42751,7 +42869,7 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
42751
42869
|
"selection-mode": _ctx.selectionMode,
|
|
42752
42870
|
type: props.type,
|
|
42753
42871
|
onNodeSelect: _cache[3] || (_cache[3] = ($event) => temporarySelectedNode.value = $event)
|
|
42754
|
-
}, null, 8, ["selected-keys", "selected-tree-nodes", "auto-select-all", "disable-keys", "disable-node-all", "disable-sub-children", "exact-disable-key", "excluded-keys", "filter", "flatten-disposable-node", "group-params", "readonly", "required-manager-permission", "required-system-role", "select-disposable-only", "selection-mode", "type"])
|
|
42872
|
+
}, null, 8, ["selected-keys", "selected-tree-nodes", "allowed-keys", "auto-select-all", "disable-keys", "disable-node-all", "disable-sub-children", "exact-disable-key", "excluded-keys", "filter", "flatten-disposable-node", "group-params", "readonly", "required-manager-permission", "required-system-role", "select-disposable-only", "selection-mode", "type"])
|
|
42755
42873
|
]),
|
|
42756
42874
|
_: 2
|
|
42757
42875
|
}, [
|
|
@@ -42827,6 +42945,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
42827
42945
|
validateQuota: {},
|
|
42828
42946
|
flattenDisposableNode: { type: Boolean },
|
|
42829
42947
|
excludedKeys: {},
|
|
42948
|
+
allowedKeys: {},
|
|
42830
42949
|
singleEditable: { type: Boolean, default: true },
|
|
42831
42950
|
singleResetable: { type: Boolean },
|
|
42832
42951
|
fetchTreeOnButtonRender: { type: Boolean, default: false },
|
|
@@ -42910,17 +43029,41 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
42910
43029
|
} else {
|
|
42911
43030
|
keysModel = parseNodeKeys(keys2);
|
|
42912
43031
|
const filterredExcludedNodes = selectedNodes == null ? void 0 : selectedNodes.filter((each) => {
|
|
42913
|
-
var _a2;
|
|
42914
|
-
|
|
43032
|
+
var _a2, _b;
|
|
43033
|
+
if ((_a2 = props.keys) == null ? void 0 : _a2.includes(String(each.key)))
|
|
43034
|
+
return true;
|
|
43035
|
+
return !((_b = props.excludedKeys) == null ? void 0 : _b.includes(String(each.key)));
|
|
43036
|
+
});
|
|
43037
|
+
const filterredAllowedNodes = filterredExcludedNodes == null ? void 0 : filterredExcludedNodes.filter((each) => {
|
|
43038
|
+
var _a2, _b, _c;
|
|
43039
|
+
if (!((_a2 = props.allowedKeys) == null ? void 0 : _a2.length))
|
|
43040
|
+
return true;
|
|
43041
|
+
if ((_b = props.allowedKeys) == null ? void 0 : _b.includes(String(each.key)))
|
|
43042
|
+
return true;
|
|
43043
|
+
if ((_c = props.keys) == null ? void 0 : _c.includes(String(each.key)))
|
|
43044
|
+
return true;
|
|
43045
|
+
return false;
|
|
42915
43046
|
});
|
|
42916
|
-
emit("update:selectedNodes",
|
|
43047
|
+
emit("update:selectedNodes", filterredAllowedNodes);
|
|
42917
43048
|
}
|
|
42918
43049
|
const filterredExcludedKeys = keysModel == null ? void 0 : keysModel.filter((each) => {
|
|
42919
|
-
var _a2;
|
|
42920
|
-
|
|
43050
|
+
var _a2, _b;
|
|
43051
|
+
if ((_a2 = props.keys) == null ? void 0 : _a2.includes(each))
|
|
43052
|
+
return true;
|
|
43053
|
+
return !((_b = props.excludedKeys) == null ? void 0 : _b.includes(each));
|
|
43054
|
+
});
|
|
43055
|
+
const filterredAllowedKeys = filterredExcludedKeys == null ? void 0 : filterredExcludedKeys.filter((each) => {
|
|
43056
|
+
var _a2, _b, _c;
|
|
43057
|
+
if (!((_a2 = props.allowedKeys) == null ? void 0 : _a2.length))
|
|
43058
|
+
return true;
|
|
43059
|
+
if ((_b = props.allowedKeys) == null ? void 0 : _b.includes(each))
|
|
43060
|
+
return true;
|
|
43061
|
+
if ((_c = props.keys) == null ? void 0 : _c.includes(each))
|
|
43062
|
+
return true;
|
|
43063
|
+
return false;
|
|
42921
43064
|
});
|
|
42922
|
-
field2.value =
|
|
42923
|
-
emit("update:keys",
|
|
43065
|
+
field2.value = filterredAllowedKeys ?? [];
|
|
43066
|
+
emit("update:keys", filterredAllowedKeys, isAllSelected);
|
|
42924
43067
|
}
|
|
42925
43068
|
};
|
|
42926
43069
|
const resetSingleGroupNode = () => {
|
|
@@ -43009,6 +43152,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
43009
43152
|
visible: showDialogTree.value,
|
|
43010
43153
|
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => showDialogTree.value = $event),
|
|
43011
43154
|
"allow-empty-selection": _ctx.allowEmptySelection,
|
|
43155
|
+
"allowed-keys": _ctx.allowedKeys,
|
|
43012
43156
|
"auto-select-all": _ctx.autoSelectAll,
|
|
43013
43157
|
"disable-keys": _ctx.disableKeys,
|
|
43014
43158
|
"disable-node-all": _ctx.disableNodeAll,
|
|
@@ -43029,7 +43173,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
43029
43173
|
"validate-quota": props.validateQuota,
|
|
43030
43174
|
onHide: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("dialogHidden")),
|
|
43031
43175
|
onSelect: setTreeSelection
|
|
43032
|
-
}, null, 8, ["visible", "allow-empty-selection", "auto-select-all", "disable-keys", "disable-node-all", "disable-sub-children", "exact-disable-key", "excluded-keys", "flatten-disposable-node", "group-params", "header", "hidden", "keys", "readonly", "required-manager-permission", "required-system-role", "selection-mode", "show-disposable-groups", "type", "validate-quota"]))
|
|
43176
|
+
}, null, 8, ["visible", "allow-empty-selection", "allowed-keys", "auto-select-all", "disable-keys", "disable-node-all", "disable-sub-children", "exact-disable-key", "excluded-keys", "flatten-disposable-node", "group-params", "header", "hidden", "keys", "readonly", "required-manager-permission", "required-system-role", "selection-mode", "show-disposable-groups", "type", "validate-quota"]))
|
|
43033
43177
|
], 64);
|
|
43034
43178
|
};
|
|
43035
43179
|
}
|
|
@@ -62856,7 +63000,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
62856
63000
|
try {
|
|
62857
63001
|
if (props.type === "asset") {
|
|
62858
63002
|
const tagType = getTagTypeQuery();
|
|
62859
|
-
const { data: data30 } = await AssetsServices.
|
|
63003
|
+
const { data: data30 } = await AssetsServices.postAssetList({
|
|
62860
63004
|
excludeId,
|
|
62861
63005
|
tagType,
|
|
62862
63006
|
group,
|