tsv2-library 1.0.61-beta.74 → 1.0.61-beta.76
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 -1
- package/dist/src/utils/role.util.d.ts +1 -0
- package/dist/tsv2-library.es.js +20 -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 -1
|
@@ -3,6 +3,7 @@ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
|
3
3
|
import { TreeNode } from '../Tree/Tree.vue.d';
|
|
4
4
|
import { TSVueIconSeverities } from '../Icon/Icon.vue.d';
|
|
5
5
|
import { Severities } from '../../../utils/getSeverityByAssetStatus.util';
|
|
6
|
+
import { TransactionType } from '../../../utils/role.util';
|
|
6
7
|
|
|
7
8
|
export type KeysModelValue = string[] | undefined;
|
|
8
9
|
|
|
@@ -154,6 +155,11 @@ export interface ButtonSelectTreeProps {
|
|
|
154
155
|
* Disable level 2 (All > Level 1 > Level 2)
|
|
155
156
|
*/
|
|
156
157
|
disableSubChildren?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Specifies the required manager transaction permission to make a node selectable.
|
|
160
|
+
* If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
|
|
161
|
+
*/
|
|
162
|
+
requiredManagerPermission?: TransactionType;
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
export type ButtonSelectTreeEmits = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionType } from '../../../utils/role.util';
|
|
1
2
|
import { TreeSelectionKeys } from '../../../../node_modules/primevue/tree';
|
|
2
3
|
|
|
3
4
|
export interface SelectTreeDialogProps {
|
|
@@ -66,6 +67,11 @@ export interface SelectTreeDialogProps {
|
|
|
66
67
|
* Disable level 2 (All > Level 1 > Level 2)
|
|
67
68
|
*/
|
|
68
69
|
disableSubChildren?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Specifies the required manager transaction permission to make a node selectable.
|
|
72
|
+
* If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
|
|
73
|
+
*/
|
|
74
|
+
requiredManagerPermission?: TransactionType;
|
|
69
75
|
}
|
|
70
76
|
|
|
71
77
|
type TreeSelectPayload = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SystemRole } from '../../../utils/role.util';
|
|
1
|
+
import { SystemRole, TransactionType } from '../../../utils/role.util';
|
|
2
2
|
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
3
3
|
import { TreeSelectionKeys } from '../../../../node_modules/primevue/tree';
|
|
4
4
|
import { MenuItem } from '../Menu/MenuItem';
|
|
@@ -129,6 +129,11 @@ export interface TreeProps {
|
|
|
129
129
|
* Defines the group tree to disable excluded keys
|
|
130
130
|
*/
|
|
131
131
|
excludedKeys?: string[];
|
|
132
|
+
/**
|
|
133
|
+
* Specifies the required manager transaction permission to make a node selectable.
|
|
134
|
+
* If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
|
|
135
|
+
*/
|
|
136
|
+
requiredManagerPermission?: TransactionType;
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
export type TreeEmits = {
|
|
@@ -13,6 +13,7 @@ export type SystemRole = {
|
|
|
13
13
|
};
|
|
14
14
|
export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'userAndRole' | 'openApi' | 'tag' | 'tagType' | 'registerAsset';
|
|
15
15
|
export type TransactionAttribute = 'borrowingRole' | 'assignmentRole' | 'disposalRole' | 'transferRole' | 'auditRole' | 'maintenanceRole' | 'repairRole' | 'trackingRole' | 'damagedRole' | 'registrationRole' | 'missingRole';
|
|
16
|
+
export type TransactionType = 'borrowing' | 'assignment' | 'disposal' | 'transfer' | 'audit' | 'maintenance' | 'repair' | 'tracking' | 'damaged' | 'registration' | 'missing';
|
|
16
17
|
export interface UserLogin {
|
|
17
18
|
transactionRoles: Record<TransactionAttribute, TransactionRole>;
|
|
18
19
|
systemRoles: Record<SystemRoleAttribute, SystemRole>;
|
package/dist/tsv2-library.es.js
CHANGED
|
@@ -41995,7 +41995,8 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
41995
41995
|
selectDisposableOnly: { type: Boolean },
|
|
41996
41996
|
flattenDisposableNode: { type: Boolean },
|
|
41997
41997
|
groupParams: {},
|
|
41998
|
-
excludedKeys: {}
|
|
41998
|
+
excludedKeys: {},
|
|
41999
|
+
requiredManagerPermission: {}
|
|
41999
42000
|
},
|
|
42000
42001
|
emits: ["update:selectedKeys", "update:selectedTreeNodes", "nodeSelect", "nodeUnselect", "toggleMenu"],
|
|
42001
42002
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -42434,13 +42435,13 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
|
|
|
42434
42435
|
}, null, 8, ["disabled", "model-value"])
|
|
42435
42436
|
]),
|
|
42436
42437
|
default: withCtx(({ node: node2 }) => {
|
|
42437
|
-
var _a, _b, _c, _d;
|
|
42438
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42438
42439
|
return [
|
|
42439
42440
|
createElementVNode("span", {
|
|
42440
|
-
"data-exact-node-disabled": props.selectDisposableOnly && !node2.isDisposable || ((_a = props.excludedKeys) == null ? void 0 : _a.includes(node2.key)) || ((_b = props.exactDisableKey) == null ? void 0 : _b.toString()) === node2.key.toString() || props.disableSubChildren && node2.level >= 2,
|
|
42441
|
+
"data-exact-node-disabled": props.selectDisposableOnly && !node2.isDisposable || ((_a = props.excludedKeys) == null ? void 0 : _a.includes(node2.key)) || ((_b = props.exactDisableKey) == null ? void 0 : _b.toString()) === node2.key.toString() || props.disableSubChildren && node2.level >= 2 || props.requiredManagerPermission && !((_d = (_c = node2 == null ? void 0 : node2.hasTransactionRoles) == null ? void 0 : _c.manager) == null ? void 0 : _d[props.requiredManagerPermission]),
|
|
42441
42442
|
"data-node-all-is-disabled": (_ctx.disableNodeAll || (_ctx.selectDisposableOnly || _ctx.flattenDisposableNode) && _ctx.selectionMode === "single") && node2.key == "0",
|
|
42442
|
-
"data-node-disabled": node2.key && ((
|
|
42443
|
-
"data-node-has-children": !!((
|
|
42443
|
+
"data-node-disabled": node2.key && ((_e = props.disableKeys) == null ? void 0 : _e.includes(+node2.key)),
|
|
42444
|
+
"data-node-has-children": !!((_f = node2.children) == null ? void 0 : _f.length),
|
|
42444
42445
|
"data-node-key": node2.key,
|
|
42445
42446
|
"data-node-selected": isNodeChecked(node2.key),
|
|
42446
42447
|
class: "grow text-body-medium break-all"
|
|
@@ -42534,7 +42535,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
42534
42535
|
flattenDisposableNode: { type: Boolean },
|
|
42535
42536
|
excludedKeys: {},
|
|
42536
42537
|
hidden: { type: Boolean },
|
|
42537
|
-
disableSubChildren: { type: Boolean }
|
|
42538
|
+
disableSubChildren: { type: Boolean },
|
|
42539
|
+
requiredManagerPermission: {}
|
|
42538
42540
|
},
|
|
42539
42541
|
emits: ["update:visible", "select", "hide"],
|
|
42540
42542
|
setup(__props, { emit: __emit }) {
|
|
@@ -42690,11 +42692,12 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
|
|
|
42690
42692
|
"flatten-disposable-node": _ctx.flattenDisposableNode,
|
|
42691
42693
|
"group-params": _ctx.groupParams,
|
|
42692
42694
|
readonly: props.readonly,
|
|
42695
|
+
"required-manager-permission": props.requiredManagerPermission,
|
|
42693
42696
|
"select-disposable-only": selectDisposableOnly.value,
|
|
42694
42697
|
"selection-mode": _ctx.selectionMode,
|
|
42695
42698
|
type: props.type,
|
|
42696
42699
|
onNodeSelect: _cache[3] || (_cache[3] = ($event) => temporarySelectedNode.value = $event)
|
|
42697
|
-
}, 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", "select-disposable-only", "selection-mode", "type"])
|
|
42700
|
+
}, 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", "select-disposable-only", "selection-mode", "type"])
|
|
42698
42701
|
]),
|
|
42699
42702
|
_: 2
|
|
42700
42703
|
}, [
|
|
@@ -42772,7 +42775,8 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
42772
42775
|
singleEditable: { type: Boolean, default: true },
|
|
42773
42776
|
singleResetable: { type: Boolean },
|
|
42774
42777
|
fetchTreeOnButtonRender: { type: Boolean, default: false },
|
|
42775
|
-
disableSubChildren: { type: Boolean }
|
|
42778
|
+
disableSubChildren: { type: Boolean },
|
|
42779
|
+
requiredManagerPermission: {}
|
|
42776
42780
|
},
|
|
42777
42781
|
emits: ["update:keys", "update:selectedNode", "update:selectedNodes", "dialogShown", "dialogHidden", "reset"],
|
|
42778
42782
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -42961,12 +42965,13 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
|
|
|
42961
42965
|
hidden: hideDialogTreeOnRender.value,
|
|
42962
42966
|
keys: treeKeys.value,
|
|
42963
42967
|
readonly: props.readonly,
|
|
42968
|
+
"required-manager-permission": props.requiredManagerPermission,
|
|
42964
42969
|
"selection-mode": props.selectionMode,
|
|
42965
42970
|
"show-disposable-groups": props.showDisposableGroups,
|
|
42966
42971
|
type: props.type,
|
|
42967
42972
|
onHide: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("dialogHidden")),
|
|
42968
42973
|
onSelect: setTreeSelection
|
|
42969
|
-
}, 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", "selection-mode", "show-disposable-groups", "type"]))
|
|
42974
|
+
}, 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", "selection-mode", "show-disposable-groups", "type"]))
|
|
42970
42975
|
], 64);
|
|
42971
42976
|
};
|
|
42972
42977
|
}
|
|
@@ -78122,17 +78127,17 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
78122
78127
|
return true;
|
|
78123
78128
|
};
|
|
78124
78129
|
const checkForAvailability = debounce$1(async () => {
|
|
78125
|
-
var _a2, _b, _c, _d;
|
|
78126
|
-
if (field2.value != props.value) {
|
|
78127
|
-
if ((
|
|
78128
|
-
const available = await ((
|
|
78130
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
78131
|
+
if (((_a2 = field2.value) == null ? void 0 : _a2.trim()) != ((_b = props.value) == null ? void 0 : _b.trim())) {
|
|
78132
|
+
if ((_c = field2.value) == null ? void 0 : _c.trim().length) {
|
|
78133
|
+
const available = await ((_e = props.checkAvailability) == null ? void 0 : _e.call(props, (_d = field2.value) == null ? void 0 : _d.trim()));
|
|
78129
78134
|
if (!available) {
|
|
78130
|
-
return (
|
|
78135
|
+
return (_f = field2.setErrors) == null ? void 0 : _f.call(field2, existErrorMessage.value);
|
|
78131
78136
|
}
|
|
78132
78137
|
}
|
|
78133
78138
|
}
|
|
78134
78139
|
if (field2.errorMessage === CHECK_AVAILABILITY_ERROR_MESSAGE) {
|
|
78135
|
-
(
|
|
78140
|
+
(_g = field2.setErrors) == null ? void 0 : _g.call(field2, "");
|
|
78136
78141
|
}
|
|
78137
78142
|
}, 300);
|
|
78138
78143
|
const setMaxValue = (value) => {
|