tsv2-library 0.2.42 → 0.2.44
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/Dropdown/Dropdown.vue.d.ts +4 -0
- package/dist/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +2 -2
- package/dist/src/components/v2/InputNumber/InputNumber.vue.d.ts +6 -0
- package/dist/src/services/tree.service.d.ts +14 -2
- package/dist/src/types/generalSettings.type.d.ts +6 -1
- package/dist/src/utils/currency.util.d.ts +9 -4
- package/dist/src/utils/role.util.d.ts +4 -25
- package/dist/style.css +1 -1
- package/dist/tsv2-library.es.js +10113 -8981
- package/package.json +3 -2
- package/src/assets/currencies.json +1066 -0
- package/src/components/v2/Dropdown/Dropdown.vue.d.ts +4 -0
- package/src/components/v2/InputCurrency/InputCurrency.vue.d.ts +2 -2
- package/src/components/v2/InputNumber/InputNumber.vue.d.ts +6 -0
- package/src/presets/dropdown/index.js +12 -10
- package/src/presets/multiselect/index.js +18 -16
- package/src/services/tree.service.ts +20 -2
|
@@ -35,6 +35,10 @@ export interface DropdownProps {
|
|
|
35
35
|
* @default undefined - the value will be sets to the option itself.
|
|
36
36
|
*/
|
|
37
37
|
optionValue?: string;
|
|
38
|
+
/**
|
|
39
|
+
* A property to uniquely identify an option.
|
|
40
|
+
*/
|
|
41
|
+
dataKey?: string | undefined;
|
|
38
42
|
/**
|
|
39
43
|
* Determines if the field uses a validator
|
|
40
44
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CurrencyFormat } from '../../../utils/currency.util';
|
|
2
2
|
import { DefineComponent } from 'vue';
|
|
3
3
|
|
|
4
4
|
export interface CurrencyValue {
|
|
5
|
-
currency: Currency
|
|
5
|
+
currency: string; // Currency ISO Code
|
|
6
6
|
value?: number;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -55,6 +55,12 @@ export interface InputNumberProps {
|
|
|
55
55
|
* It is rarely use, this component has handled the validator message.
|
|
56
56
|
*/
|
|
57
57
|
validatorMessage?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Show the validator message on error.
|
|
60
|
+
*
|
|
61
|
+
* @default true;
|
|
62
|
+
*/
|
|
63
|
+
showValidatorMessage?: boolean;
|
|
58
64
|
/**
|
|
59
65
|
* Specify the input placeholder.
|
|
60
66
|
*
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
import { SystemRoleAttribute, TransactionAttribute } from '../utils/role.util';
|
|
2
3
|
import { TreeNode } from '../../node_modules/primevue/treenode';
|
|
3
4
|
export interface ServiceOptions {
|
|
4
5
|
type?: 'Group' | 'Category';
|
|
5
6
|
headers?: Record<string, unknown>;
|
|
6
|
-
params?:
|
|
7
|
+
params?: TreeQueryParams;
|
|
7
8
|
}
|
|
8
9
|
export interface TreeListData {
|
|
9
10
|
data: TreeNode[];
|
|
10
11
|
}
|
|
12
|
+
export type RoleType = 'Manager' | 'Monitoring' | 'Approval' | 'Staff';
|
|
13
|
+
export interface TreeRoleParams {
|
|
14
|
+
systemRole?: SystemRoleAttribute[];
|
|
15
|
+
transactionAttribute?: TransactionAttribute[];
|
|
16
|
+
roleType?: RoleType[];
|
|
17
|
+
}
|
|
18
|
+
export interface TreeQueryParams {
|
|
19
|
+
systemRole?: string;
|
|
20
|
+
transactionAttribute?: string;
|
|
21
|
+
roleType?: string;
|
|
22
|
+
}
|
|
11
23
|
export declare const API: ({ type, headers, params, }?: ServiceOptions) => AxiosInstance;
|
|
12
24
|
declare const TreeServices: {
|
|
13
|
-
getTreeList: (type: ServiceOptions['type']) => Promise<AxiosResponse<TreeListData>>;
|
|
25
|
+
getTreeList: (type: ServiceOptions['type'], params: TreeQueryParams) => Promise<AxiosResponse<TreeListData>>;
|
|
14
26
|
};
|
|
15
27
|
export default TreeServices;
|
|
@@ -20,7 +20,12 @@ export type DateFormat = {
|
|
|
20
20
|
day: 'numeric' | '2-digit';
|
|
21
21
|
} & Pick<DateTextFormatOptions, 'weekday'>;
|
|
22
22
|
export type GeneralSetting = {
|
|
23
|
-
currency:
|
|
23
|
+
currency: {
|
|
24
|
+
currency: string;
|
|
25
|
+
symbol: string;
|
|
26
|
+
locale: string;
|
|
27
|
+
label: string;
|
|
28
|
+
};
|
|
24
29
|
timezone: string;
|
|
25
30
|
dateFormat: DateFormat;
|
|
26
31
|
timeFormat: boolean;
|
|
@@ -19,9 +19,14 @@ export type ChineseYuan = {
|
|
|
19
19
|
prefix: '¥';
|
|
20
20
|
currency: 'CNY';
|
|
21
21
|
};
|
|
22
|
-
export type CurrencyFormat =
|
|
22
|
+
export type CurrencyFormat = {
|
|
23
|
+
name?: string;
|
|
24
|
+
label: string;
|
|
25
|
+
currency: string;
|
|
26
|
+
symbol: string;
|
|
27
|
+
locale: string;
|
|
28
|
+
};
|
|
23
29
|
export type Locale = CurrencyFormat['locale'];
|
|
24
|
-
|
|
25
|
-
declare const
|
|
26
|
-
declare const formatCurrency: (value?: number | string | null, currency?: GeneralSetting['currency'], prefix?: boolean) => string;
|
|
30
|
+
declare const getCurrency: (code?: string) => CurrencyFormat;
|
|
31
|
+
declare const formatCurrency: (value?: number | string | null, currency?: GeneralSetting['currency']['currency'], prefix?: boolean) => string;
|
|
27
32
|
export { getCurrency, formatCurrency };
|
|
@@ -10,32 +10,11 @@ export type SystemRole = {
|
|
|
10
10
|
update: boolean;
|
|
11
11
|
delete: boolean;
|
|
12
12
|
};
|
|
13
|
+
export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'user' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'role' | 'tag' | 'registerAsset';
|
|
14
|
+
export type TransactionAttribute = 'borrowingRole' | 'disposalRole' | 'transferRole' | 'auditRole' | 'maintenanceRole' | 'repairRole' | 'trackingRole' | 'damagedRole' | 'missingRole';
|
|
13
15
|
export interface UserLogin {
|
|
14
|
-
transactionRoles:
|
|
15
|
-
|
|
16
|
-
borrowingRole: TransactionRole;
|
|
17
|
-
disposalRole: TransactionRole;
|
|
18
|
-
maintenanceRole: TransactionRole;
|
|
19
|
-
repairRole: TransactionRole;
|
|
20
|
-
trackingRole: TransactionRole;
|
|
21
|
-
};
|
|
22
|
-
systemRoles: {
|
|
23
|
-
importData: SystemRole;
|
|
24
|
-
assetAttribute: SystemRole;
|
|
25
|
-
assetPolicies: SystemRole;
|
|
26
|
-
depreciationGroup: SystemRole;
|
|
27
|
-
depreciationMethod: SystemRole;
|
|
28
|
-
documentDeletion: SystemRole;
|
|
29
|
-
group: SystemRole;
|
|
30
|
-
user: SystemRole;
|
|
31
|
-
iotReader: SystemRole;
|
|
32
|
-
license: SystemRole;
|
|
33
|
-
purchaseDocument: SystemRole;
|
|
34
|
-
purchaseInformation: SystemRole;
|
|
35
|
-
role: SystemRole;
|
|
36
|
-
tag: SystemRole;
|
|
37
|
-
registerAsset: SystemRole;
|
|
38
|
-
};
|
|
16
|
+
transactionRoles: Record<TransactionAttribute, TransactionRole>;
|
|
17
|
+
systemRoles: Record<SystemRoleAttribute, SystemRole>;
|
|
39
18
|
}
|
|
40
19
|
declare const getTransactionRole: (name: keyof UserLogin['transactionRoles']) => TransactionRole;
|
|
41
20
|
declare const getSystemRole: (name: keyof UserLogin['systemRoles']) => SystemRole;
|