tsv2-library 1.1.0-dev-alpha.34 → 1.1.0-dev-alpha.36

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.
@@ -2,6 +2,6 @@ import { TableColumn } from '../../DataTable/DataTable.vue.d';
2
2
  export declare const ASSET_COL_FIELDS: readonly ["assetImage", "name.nameWithSequence", "aliasName", "assetId", "group.name", "category.name", "brand.name", "model.name", "tagType", "measurement.name", "maintenanceStatus", "auditStatus", "transactions", "coordinates", "address", "warrantyStatus", "lastScannedAt", "linkedAssetCount"];
3
3
  export type AssetColField = (typeof ASSET_COL_FIELDS)[number];
4
4
  export declare const assetValueColumns: import("vue").Ref<TableColumn[], TableColumn[]>, assetValueColumnsWithDefault: import("vue").Ref<TableColumn[], TableColumn[]>, customFieldColumns: import("vue").Ref<TableColumn[], TableColumn[]>;
5
- export declare const defaultAssetColumns: import("vue").ComputedRef<Record<"transactions" | "tagType" | "assetImage" | "name.nameWithSequence" | "aliasName" | "assetId" | "group.name" | "category.name" | "brand.name" | "model.name" | "measurement.name" | "maintenanceStatus" | "auditStatus" | "coordinates" | "address" | "warrantyStatus" | "lastScannedAt" | "linkedAssetCount", TableColumn & {
5
+ export declare const defaultAssetColumns: import("vue").ComputedRef<Record<"tagType" | "transactions" | "assetImage" | "name.nameWithSequence" | "aliasName" | "assetId" | "group.name" | "category.name" | "brand.name" | "model.name" | "measurement.name" | "maintenanceStatus" | "auditStatus" | "coordinates" | "address" | "warrantyStatus" | "lastScannedAt" | "linkedAssetCount", TableColumn & {
6
6
  field: AssetColField;
7
7
  }>>;
@@ -3,7 +3,11 @@ 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
+ import {
7
+ SystemRole,
8
+ SystemRoleAttribute,
9
+ TransactionType,
10
+ } from '@/utils/role.util';
7
11
 
8
12
  export type KeysModelValue = string[] | undefined;
9
13
 
@@ -164,6 +168,11 @@ export interface ButtonSelectTreeProps {
164
168
  * If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
165
169
  */
166
170
  requiredManagerPermission?: TransactionType;
171
+ /**
172
+ * Specifies the required system role permission to make a node selectable.
173
+ * If the node's `SystemRoleAttribute[SystemRole]` value is false, the node will be rendered in a disabled state.
174
+ */
175
+ requiredSystemRole?: [SystemRoleAttribute, keyof SystemRole];
167
176
  }
168
177
 
169
178
  export type ButtonSelectTreeEmits = {
@@ -1,4 +1,8 @@
1
- import { TransactionType } from '../../../utils/role.util';
1
+ import {
2
+ SystemRole,
3
+ SystemRoleAttribute,
4
+ TransactionType,
5
+ } from '@/utils/role.util';
2
6
  import { TreeSelectionKeys } from '../../../../node_modules/primevue/tree';
3
7
 
4
8
  export interface SelectTreeDialogProps {
@@ -76,6 +80,11 @@ export interface SelectTreeDialogProps {
76
80
  * If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
77
81
  */
78
82
  requiredManagerPermission?: TransactionType;
83
+ /**
84
+ * Specifies the required system role permission to make a node selectable.
85
+ * If the node's `SystemRoleAttribute[SystemRole]` value is false, the node will be rendered in a disabled state.
86
+ */
87
+ requiredSystemRole?: [SystemRoleAttribute, keyof SystemRole];
79
88
  }
80
89
 
81
90
  type TreeSelectPayload = {
@@ -1,4 +1,8 @@
1
- import { SystemRole, TransactionType } from '../../../utils/role.util';
1
+ import {
2
+ SystemRole,
3
+ SystemRoleAttribute,
4
+ TransactionType,
5
+ } from '@/utils/role.util';
2
6
  import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
3
7
  import { TreeSelectionKeys } from '../../../../node_modules/primevue/tree';
4
8
  import { MenuItem } from '../Menu/MenuItem';
@@ -134,6 +138,11 @@ export interface TreeProps {
134
138
  * If the node's `manager[transaction]` value is false, the node will be rendered in a disabled state.
135
139
  */
136
140
  requiredManagerPermission?: TransactionType;
141
+ /**
142
+ * Specifies the required system role permission to make a node selectable.
143
+ * If the node's `SystemRoleAttribute[SystemRole]` value is false, the node will be rendered in a disabled state.
144
+ */
145
+ requiredSystemRole?: [SystemRoleAttribute, keyof SystemRole];
137
146
  }
138
147
 
139
148
  export type TreeEmits = {
@@ -9,6 +9,7 @@ export type FieldValidation<T = FieldValue | undefined> = {
9
9
  errorMessage?: Ref<string | undefined>;
10
10
  setErrors?: (errors?: string | string[]) => void;
11
11
  handleReset?: () => void;
12
+ validate?: () => void;
12
13
  } | (Omit<FieldContext, 'value'> & {
13
14
  value: T;
14
15
  });
@@ -42013,7 +42013,8 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
42013
42013
  flattenDisposableNode: { type: Boolean },
42014
42014
  groupParams: {},
42015
42015
  excludedKeys: {},
42016
- requiredManagerPermission: {}
42016
+ requiredManagerPermission: {},
42017
+ requiredSystemRole: {}
42017
42018
  },
42018
42019
  emits: ["update:selectedKeys", "update:selectedTreeNodes", "nodeSelect", "nodeUnselect", "toggleMenu"],
42019
42020
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -42454,13 +42455,13 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
42454
42455
  }, null, 8, ["disabled", "model-value"])
42455
42456
  ]),
42456
42457
  default: withCtx(({ node: node2 }) => {
42457
- var _a, _b, _c, _d, _e, _f;
42458
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
42458
42459
  return [
42459
42460
  createElementVNode("span", {
42460
- "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]),
42461
+ "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 || ((_c = props.requiredSystemRole) == null ? void 0 : _c.length) && !((_e = (_d = node2 == null ? void 0 : node2.hasSystemRoles) == null ? void 0 : _d[props.requiredSystemRole[0]]) == null ? void 0 : _e[props.requiredSystemRole[1]]) || props.requiredManagerPermission && !((_g = (_f = node2 == null ? void 0 : node2.hasTransactionRoles) == null ? void 0 : _f.manager) == null ? void 0 : _g[props.requiredManagerPermission]),
42461
42462
  "data-node-all-is-disabled": (_ctx.disableNodeAll || (_ctx.selectDisposableOnly || _ctx.flattenDisposableNode) && _ctx.selectionMode === "single") && node2.key == "0",
42462
- "data-node-disabled": node2.key && ((_e = props.disableKeys) == null ? void 0 : _e.includes(+node2.key)),
42463
- "data-node-has-children": !!((_f = node2.children) == null ? void 0 : _f.length),
42463
+ "data-node-disabled": node2.key && ((_h = props.disableKeys) == null ? void 0 : _h.includes(+node2.key)),
42464
+ "data-node-has-children": !!((_i = node2.children) == null ? void 0 : _i.length),
42464
42465
  "data-node-key": node2.key,
42465
42466
  "data-node-selected": isNodeChecked(node2.key),
42466
42467
  class: "flex flex-col grow text-body-medium break-all"
@@ -42559,7 +42560,8 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
42559
42560
  excludedKeys: {},
42560
42561
  hidden: { type: Boolean },
42561
42562
  disableSubChildren: { type: Boolean },
42562
- requiredManagerPermission: {}
42563
+ requiredManagerPermission: {},
42564
+ requiredSystemRole: {}
42563
42565
  },
42564
42566
  emits: ["update:visible", "select", "hide"],
42565
42567
  setup(__props, { emit: __emit }) {
@@ -42732,11 +42734,12 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
42732
42734
  "group-params": _ctx.groupParams,
42733
42735
  readonly: props.readonly,
42734
42736
  "required-manager-permission": props.requiredManagerPermission,
42737
+ "required-system-role": props.requiredSystemRole,
42735
42738
  "select-disposable-only": selectDisposableOnly.value,
42736
42739
  "selection-mode": _ctx.selectionMode,
42737
42740
  type: props.type,
42738
42741
  onNodeSelect: _cache[3] || (_cache[3] = ($event) => temporarySelectedNode.value = $event)
42739
- }, 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"])
42742
+ }, 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"])
42740
42743
  ]),
42741
42744
  _: 2
42742
42745
  }, [
@@ -42816,7 +42819,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
42816
42819
  singleResetable: { type: Boolean },
42817
42820
  fetchTreeOnButtonRender: { type: Boolean, default: false },
42818
42821
  disableSubChildren: { type: Boolean },
42819
- requiredManagerPermission: {}
42822
+ requiredManagerPermission: {},
42823
+ requiredSystemRole: {}
42820
42824
  },
42821
42825
  emits: ["update:keys", "update:selectedNode", "update:selectedNodes", "dialogShown", "dialogHidden", "reset"],
42822
42826
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -43006,13 +43010,14 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
43006
43010
  keys: treeKeys.value,
43007
43011
  readonly: props.readonly,
43008
43012
  "required-manager-permission": props.requiredManagerPermission,
43013
+ "required-system-role": props.requiredSystemRole,
43009
43014
  "selection-mode": props.selectionMode,
43010
43015
  "show-disposable-groups": props.showDisposableGroups,
43011
43016
  type: props.type,
43012
43017
  "validate-quota": props.validateQuota,
43013
43018
  onHide: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("dialogHidden")),
43014
43019
  onSelect: setTreeSelection
43015
- }, 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", "validate-quota"]))
43020
+ }, 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"]))
43016
43021
  ], 64);
43017
43022
  };
43018
43023
  }
@@ -78270,6 +78275,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
78270
78275
  },
78271
78276
  { immediate: true }
78272
78277
  );
78278
+ watch(
78279
+ () => props.invalid,
78280
+ () => {
78281
+ var _a2;
78282
+ (_a2 = field2 == null ? void 0 : field2.validate) == null ? void 0 : _a2.call(field2);
78283
+ }
78284
+ );
78273
78285
  return (_ctx, _cache) => {
78274
78286
  return openBlock(), createBlock(_sfc_main$1o, {
78275
78287
  info: _ctx.fieldInfo,