@fewangsit/wangsvue-fats 1.0.0-alpha.34 → 1.0.0-alpha.35
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/components/animation/Animation.vue.d.ts +6 -6
- package/components/approverinfo/ApproverInfo.vue.d.ts +36 -36
- package/components/assetinfo/AssetInfo.vue.d.ts +21 -18
- package/components/badge/Badge.vue.d.ts +46 -46
- package/components/badgegroup/BadgeGroup.vue.d.ts +38 -38
- package/components/basecomponent/index.d.ts +15 -15
- package/components/basetree/BaseTree.vue.d.ts +458 -458
- package/components/basetree/TreeNode.vue.d.ts +25 -25
- package/components/breadcrumb/Breadcrumb.vue.d.ts +7 -7
- package/components/button/Button.vue.d.ts +142 -147
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +73 -73
- package/components/buttoncopy/ButtonCopy.vue.d.ts +7 -7
- package/components/buttondownload/ButtonDownload.vue.d.ts +26 -26
- package/components/buttonfilter/ButtonFilter.vue.d.ts +4 -4
- package/components/buttonradio/ButtonRadio.vue.d.ts +189 -189
- package/components/buttonscan/ButtonScan.vue.d.ts +154 -154
- package/components/buttonsearch/ButtonSearch.vue.d.ts +13 -13
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +164 -164
- package/components/buttonsplit/ButtonSplit.vue.d.ts +350 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +10 -10
- package/components/buttontoggle/ButtonToggle.vue.d.ts +4 -4
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +6 -6
- package/components/calendar/Calendar.vue.d.ts +469 -469
- package/components/card/Card.vue.d.ts +82 -82
- package/components/checkbox/Checkbox.vue.d.ts +245 -245
- package/components/customcolumn/CustomColumn.vue.d.ts +21 -21
- package/components/datatable/DataTable.vue.d.ts +595 -595
- package/components/dialog/Dialog.vue.d.ts +367 -367
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +117 -117
- package/components/dialogform/DialogForm.vue.d.ts +288 -288
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +98 -98
- package/components/dropdown/Dropdown.vue.d.ts +226 -226
- package/components/editor/Editor.vue.d.ts +156 -156
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +48 -48
- package/components/fileupload/FileUpload.vue.d.ts +132 -132
- package/components/filtercontainer/FilterContainer.vue.d.ts +116 -113
- package/components/form/Form.vue.d.ts +258 -258
- package/components/icon/Icon.vue.d.ts +235 -237
- package/components/image/Image.vue.d.ts +306 -306
- package/components/imagecompressor/ImageCompressor.vue.d.ts +186 -186
- package/components/index.d.ts +57 -58
- package/components/inputbadge/InputBadge.vue.d.ts +90 -90
- package/components/inputcurrency/InputCurrency.vue.d.ts +126 -126
- package/components/inputcurrency/helpers/currency.helper.d.ts +3 -3
- package/components/inputnumber/InputNumber.vue.d.ts +245 -245
- package/components/inputpassword/InputPassword.vue.d.ts +19 -19
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +68 -68
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +88 -88
- package/components/inputsearch/InputSearch.vue.d.ts +14 -11
- package/components/inputtext/InputText.vue.d.ts +281 -281
- package/components/inputurl/InputURL.vue.d.ts +9 -6
- package/components/invisiblefield/InvisibleField.vue.d.ts +18 -18
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +32 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +64 -64
- package/components/loading/Loading.vue.d.ts +5 -5
- package/components/loading/store/loading.store.d.ts +3 -3
- package/components/menu/Menu.vue.d.ts +282 -282
- package/components/menuitem/index.d.ts +84 -84
- package/components/multiselect/MultiSelect.vue.d.ts +161 -161
- package/components/overlaypanel/OverlayPanel.vue.d.ts +207 -207
- package/components/passthrough/index.d.ts +8 -8
- package/components/tabmenu/TabMenu.vue.d.ts +185 -185
- package/components/textarea/Textarea.vue.d.ts +131 -131
- package/components/timeline/Timeline.vue.d.ts +60 -60
- package/components/toast/Toast.vue.d.ts +265 -265
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +211 -211
- package/components/tree/Tree.vue.d.ts +116 -116
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +4 -4
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +1 -1
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +41 -43
- package/components/username/UserName.vue.d.ts +71 -71
- package/components/userwithicon/UserWithIcon.vue.d.ts +8 -8
- package/directives/focus.d.ts +1 -1
- package/event-bus/index.d.ts +51 -51
- package/event-bus/mitt.d.ts +21 -24
- package/package.json +8 -4
- package/plugins/WangsVue.d.ts +226 -226
- package/plugins/formValidation.d.ts +11 -11
- package/plugins/i18n-extension.d.ts +1 -1
- package/plugins/i18n.d.ts +80 -80
- package/utils/date.util.d.ts +53 -53
- package/utils/index.d.ts +2 -28
- package/utils/listenSidebarChanges.util.d.ts +9 -9
- package/utils/object.util.d.ts +8 -8
- package/utils/role.util.d.ts +43 -44
- package/utils/toast.util.d.ts +78 -78
- package/components/buttonscan/helpers/getErrorCode.helper.d.ts +0 -3
- package/components/buttonscan/helpers/index.d.ts +0 -1
- package/components/buttonscan/workers/scanner.worker.d.ts +0 -1
- package/components/calendar/BaseCalendar.vue.d.ts +0 -127
- package/components/customcolumn/ColumnList.vue.d.ts +0 -47
- package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +0 -16
- package/components/datatable/MultiRow.vue.d.ts +0 -36
- package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +0 -1
- package/components/datatable/helpers/filter.helper.d.ts +0 -38
- package/components/datatable/helpers/index.d.ts +0 -6
- package/components/datatable/helpers/readConfig.helper.d.ts +0 -5
- package/components/datatable/store/dataTable.store.d.ts +0 -25
- package/components/editor/CodeSnippetAdapter.vue.d.ts +0 -152
- package/components/editor/EditorButton.vue.d.ts +0 -35
- package/components/editor/MentionList.vue.d.ts +0 -49
- package/components/editor/MentionSection.vue.d.ts +0 -152
- package/components/editor/codeSnippetExtension.d.ts +0 -3
- package/components/editor/mentionSectionExtension.d.ts +0 -3
- package/components/editor/suggestion.d.ts +0 -2
- package/components/filtercontainer/helpers/applyFilter.helper.d.ts +0 -14
- package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +0 -7
- package/components/filtercontainer/helpers/getOption.helper.d.ts +0 -12
- package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +0 -59
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +0 -55
- package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +0 -8
- package/components/menu/helpers/filterMenu.helper.d.ts +0 -15
- package/components/menu/helpers/index.d.ts +0 -1
- package/components/menuitem/MenuItem.vue +0 -70
- package/components/menuitem/MenuItem.vue.d.ts +0 -39
- package/components/timeline/TimelineContentByType.vue.d.ts +0 -64
- package/components/transactionroles/TransactionRoles.vue.d.ts +0 -58
- package/components/tree/helpers/index.d.ts +0 -3
- package/loading-page-BrQattYE.js +0 -1
- package/loading-page-CgfbWppy.js +0 -1
- package/loading-page-CoC9UhfC.js +0 -4
- package/loading-page-CoXtqoc9.js +0 -4
- package/loading-page-DbLuqCHa.js +0 -1
- package/loading-page-f8D03l3G.js +0 -4
- package/loading-plane-CgfbWppy.js +0 -1
- package/loading-plane-CoXtqoc9.js +0 -4
- package/loading-table-Bdr9ZhtP.js +0 -1
- package/loading-table-ByUoWqUo.js +0 -4
- package/loading-table-BygEMzFM.js +0 -4
- package/loading-table-BzrSQlA0.js +0 -1
- package/loading-table-D9bw9OcI.js +0 -4
- package/loading-table-chOgXi94.js +0 -1
- package/no-data-CTKux8RI.js +0 -4
- package/no-data-Cgze_Rvp.js +0 -1
- package/no-data-DLHO1L_u.js +0 -4
- package/no-data-Dep79CBh.js +0 -1
- package/no-data-g0dJCy2p.js +0 -4
- package/no-data-y1X5WtcQ.js +0 -1
- package/style.css +0 -1
- package/utils/addAttachment.util.d.ts +0 -59
- package/utils/exportToExcel.util.d.ts +0 -20
- package/utils/filterOptions.util.d.ts +0 -5
- package/utils/genPlaceholder.util.d.ts +0 -13
- package/utils/getAttachmentIcon.util.d.ts +0 -8
- package/utils/mergePropsWithDefaults.util.d.ts +0 -23
- package/utils/textFormatter.util.d.ts +0 -29
- package/wangsvue-fats.es.js +0 -123948
- package/wangsvue-fats.system.js +0 -478
package/plugins/i18n.d.ts
CHANGED
|
@@ -2,97 +2,97 @@ import { App, Ref } from 'vue';
|
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
3
|
export type Locale = string;
|
|
4
4
|
export interface LanguageOption {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
/**
|
|
6
|
+
* ISO 639-1 language code (e.g., "en" for English, "fr" for French).
|
|
7
|
+
*/
|
|
8
|
+
isoCode?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The name of the language in English (e.g., "English", "Français").
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* The URL of the country's flag image.
|
|
15
|
+
* Flags are sourced from https://flagcdn.com and are typically in SVG format for high-quality resolution.
|
|
16
|
+
*/
|
|
17
|
+
flag?: string;
|
|
18
18
|
}
|
|
19
19
|
export interface I18n {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Locale message translation
|
|
22
|
+
*
|
|
23
|
+
* @param key - The translation key
|
|
24
|
+
* @param params - A values of named interpolation
|
|
25
|
+
* @param args - Positional interpolation values
|
|
26
|
+
*
|
|
27
|
+
* @returns translation message
|
|
28
|
+
* @example `t('Hello {user}!', { user: 'John Doe' })` - returns: 'Hello John Doe!'
|
|
29
|
+
* @example `t('Hello %s! I am %s.', "John Doe", "Peter Smith")` - returns: 'Hello John Doe! I am Peter Smith.'
|
|
30
|
+
*/
|
|
31
|
+
t: {
|
|
32
|
+
(key: string, params: Record<string, any>): string;
|
|
33
|
+
(key: string, ...args: (string | number | boolean)[]): string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Change the locale dynamically
|
|
37
|
+
*
|
|
38
|
+
* @param newLocale - The locale to switch to
|
|
39
|
+
*/
|
|
40
|
+
setLocale: (newLocale: Locale) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the current locale
|
|
43
|
+
*
|
|
44
|
+
* @returns Current locale
|
|
45
|
+
*/
|
|
46
|
+
locale: Ref<Locale>;
|
|
47
|
+
/**
|
|
48
|
+
* Service methods handle fetch requests
|
|
49
|
+
*/
|
|
50
|
+
service?: I18nService;
|
|
51
51
|
}
|
|
52
52
|
type MessageMap = Record<string, string>;
|
|
53
53
|
export interface I18nService {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Fetch all translation messages for a specific locale.
|
|
56
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
57
|
+
* @returns A promise resolving to a key-value record of messages.
|
|
58
|
+
*/
|
|
59
|
+
getMessages(locale: string): Promise<
|
|
60
|
+
AxiosResponse<{
|
|
61
|
+
data: MessageMap;
|
|
62
|
+
}>
|
|
63
|
+
>;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
66
|
+
*
|
|
67
|
+
* @returns Promise Array of options
|
|
68
|
+
*/
|
|
69
|
+
getLanguageOptions(): Promise<LanguageOption[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch single lang option meta data
|
|
72
|
+
*
|
|
73
|
+
* @param locale The locale code (e.g., 'en', 'id').
|
|
74
|
+
* @returns Promise LanguageMeta
|
|
75
|
+
*/
|
|
76
|
+
getLanguageOptionMeta(locale: string): Promise<LanguageOption>;
|
|
77
|
+
/**
|
|
78
|
+
* Translate a specific text to the target locale.
|
|
79
|
+
* @param key Unique translation key.
|
|
80
|
+
* @param locale Target locale code.
|
|
81
|
+
* @returns A promise resolving to the translated string.
|
|
82
|
+
*/
|
|
83
|
+
translateText(key: string, locale: string): Promise<string>;
|
|
84
84
|
}
|
|
85
85
|
export declare const useI18n: () => I18n;
|
|
86
86
|
declare const i18n: {
|
|
87
|
-
|
|
87
|
+
install: (app: App) => void;
|
|
88
88
|
};
|
|
89
89
|
export declare const createI18nWithExtension: (
|
|
90
|
-
|
|
90
|
+
service: I18nService,
|
|
91
91
|
) => typeof i18n;
|
|
92
92
|
export default i18n;
|
|
93
93
|
declare module 'vue' {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
interface ComponentCustomProperties {
|
|
95
|
+
$i18n: I18n;
|
|
96
|
+
$t: I18n['t'];
|
|
97
|
+
}
|
|
98
98
|
}
|
package/utils/date.util.d.ts
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
export type TDateFormat =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
| 'd/m/yy'
|
|
3
|
+
| 'm/d/yy'
|
|
4
|
+
| 'd/mm/yy'
|
|
5
|
+
| 'dd/mm/yy'
|
|
6
|
+
| 'dd/mm/yyyy'
|
|
7
|
+
| 'dd M yy'
|
|
8
|
+
| 'dd M yyyy'
|
|
9
|
+
| 'dd MM yy'
|
|
10
|
+
| 'dd MM yyyy'
|
|
11
|
+
| 'D dd M yy'
|
|
12
|
+
| 'D dd M yyyy'
|
|
13
|
+
| 'DD dd MM yy'
|
|
14
|
+
| 'DD dd MM yyyy'
|
|
15
|
+
| 'D, dd M yy'
|
|
16
|
+
| 'D, dd M yyyy'
|
|
17
|
+
| 'DD, dd MM yy'
|
|
18
|
+
| 'DD, dd MM yyyy';
|
|
19
19
|
export type GoDateLayout =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
| '02/01/06'
|
|
21
|
+
| '_2/_1/06'
|
|
22
|
+
| '_1/_2/06'
|
|
23
|
+
| '02 Jan 06'
|
|
24
|
+
| 'Mon, 02 Jan 06'
|
|
25
|
+
| 'Mon, 02 Jan 2006';
|
|
26
26
|
export type TTimeFormat = 'HH:mm' | 'HH:mm a' | 'HH:mm:ss' | 'HH:mm:ss a';
|
|
27
27
|
export type GoTimeLayout = '15:04' | '03:04 PM' | '15:04:05' | '03:04:05 PM';
|
|
28
28
|
export type CustomDateTimeFormatOptions = Omit<
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
Intl.DateTimeFormatOptions,
|
|
30
|
+
'timeZone'
|
|
31
31
|
> & {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
timezone?: string;
|
|
33
|
+
locale?: string;
|
|
34
34
|
};
|
|
35
35
|
export type DateOptions = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
locale?: string;
|
|
37
|
+
dateFormat?: TDateFormat | GoDateLayout;
|
|
38
|
+
timeFormat?: TTimeFormat | GoTimeLayout;
|
|
39
|
+
timezone?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Show the time in the formatted date.
|
|
42
|
+
*
|
|
43
|
+
* @default true - when `timeFormat` is provided
|
|
44
|
+
*/
|
|
45
|
+
showTime?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Show the date in the formatted date.
|
|
48
|
+
*
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
showDate?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* This is old format (general settings), if configuration still using old settings then this option parameter can be used
|
|
54
|
+
*/
|
|
55
|
+
formatPreset?: CustomDateTimeFormatOptions;
|
|
56
56
|
};
|
|
57
57
|
export declare const formatDate: (date: Date, options?: DateOptions) => string;
|
|
58
58
|
export declare const formatISODate: (date: string | Date) => string;
|
|
@@ -64,12 +64,12 @@ export declare const formatISODate: (date: string | Date) => string;
|
|
|
64
64
|
* @returns The formatted date string.
|
|
65
65
|
*/
|
|
66
66
|
export declare const formatDateReadable: (
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
date: Date,
|
|
68
|
+
maxSeconds?: number,
|
|
69
69
|
) => string;
|
|
70
70
|
export declare const getRemainingTime: (deadline: string) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
seconds: number;
|
|
72
|
+
days: number;
|
|
73
|
+
hours: number;
|
|
74
|
+
minutes: number;
|
|
75
75
|
};
|
package/utils/index.d.ts
CHANGED
|
@@ -1,34 +1,8 @@
|
|
|
1
|
+
export { formatDate } from '../utils/date.util';
|
|
1
2
|
export * from '../components/tree/helpers/filterNodeKeys.helper';
|
|
2
3
|
export * from './role.util';
|
|
3
4
|
export * from './listenSidebarChanges.util';
|
|
4
|
-
export {
|
|
5
|
-
checkRouteAccess,
|
|
6
|
-
getTransactionRole,
|
|
7
|
-
getSystemRole,
|
|
8
|
-
hasSystemRole,
|
|
9
|
-
hasTransactionRole,
|
|
10
|
-
hasManagerRole,
|
|
11
|
-
hasAnyManagerRole,
|
|
12
|
-
hasAnyMonitoringReportRole,
|
|
13
|
-
hasStaffRole,
|
|
14
|
-
hasMonitoringReportRole,
|
|
15
|
-
hasApprovalRole,
|
|
16
|
-
} from './role.util';
|
|
5
|
+
export { checkRouteAccess } from './role.util';
|
|
17
6
|
export { ZIndexUtils } from 'primevue/utils';
|
|
18
7
|
export { default as useToast } from './toast.util';
|
|
19
8
|
export { default as flattenTreeNodeChildren } from '../components/tree/helpers/flattenTreeNodeChildren.helper';
|
|
20
|
-
|
|
21
|
-
export * from './addAttachment.util';
|
|
22
|
-
export * from './object.util';
|
|
23
|
-
export * from './date.util';
|
|
24
|
-
export type { ToastParams, ToastMethod, UseToastConfig } from './toast.util';
|
|
25
|
-
export type { ITable } from './exportToExcel.util';
|
|
26
|
-
export type { FileType, FormattedFile } from './addAttachment.util';
|
|
27
|
-
export { default as exportToExcel } from './exportToExcel.util';
|
|
28
|
-
export { default as getAttachmentIcon } from './getAttachmentIcon.util';
|
|
29
|
-
export { default as filterOptions } from './filterOptions.util';
|
|
30
|
-
export { default as mergePropsWithDefaults } from './mergePropsWithDefaults.util';
|
|
31
|
-
export { formatUserName, getInititalName } from './textFormatter.util';
|
|
32
|
-
export { formatISODate } from './date.util';
|
|
33
|
-
export { genPlaceholder } from './genPlaceholder.util';
|
|
34
|
-
export { checkRouteAccess } from './role.util';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { TreeNode } from '../components/basetree/BaseTree.vue.d';
|
|
2
2
|
export type SidebarEvent = CustomEvent<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Stringified keys array.
|
|
5
|
+
*/
|
|
6
|
+
keys: string;
|
|
7
|
+
node: TreeNode;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const listenSidebarChanges: (
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type: 'group' | 'category',
|
|
11
|
+
callback: (e: SidebarEvent) => any,
|
|
12
12
|
) => void;
|
|
13
13
|
export declare const unListenSidebarChanges: (
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
type: 'group' | 'category',
|
|
15
|
+
callback: (e: SidebarEvent) => any,
|
|
16
16
|
) => void;
|
package/utils/object.util.d.ts
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
* Utility function to get nested property value.
|
|
3
3
|
*/
|
|
4
4
|
export declare const getNestedPropertyValue: (
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
obj: Record<string, any>,
|
|
6
|
+
path: string,
|
|
7
7
|
) => any;
|
|
8
8
|
/**
|
|
9
9
|
* Utility function to set nested property value.
|
|
10
10
|
*/
|
|
11
11
|
export declare const setNestedPropertyValue: (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
obj: Record<string, any>,
|
|
13
|
+
path: string,
|
|
14
|
+
value: any,
|
|
15
15
|
) => void;
|
|
16
16
|
export declare const isEmptyObject: (obj: object) => boolean;
|
|
17
17
|
export declare const deepEquals: (a: object, b: object) => boolean;
|
|
18
18
|
export declare const equals: (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
obj1: object,
|
|
20
|
+
obj2: object,
|
|
21
|
+
field?: string,
|
|
22
22
|
) => boolean;
|
|
23
23
|
export declare const resolveFieldData: (data: object, field?: string) => object;
|
|
24
24
|
export declare const contains: (value: object, list: object[]) => boolean;
|
package/utils/role.util.d.ts
CHANGED
|
@@ -1,69 +1,68 @@
|
|
|
1
1
|
import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
|
2
|
-
export * from '../utils';
|
|
3
2
|
export type TransactionRole = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
manager: boolean;
|
|
4
|
+
monitoringReport: boolean;
|
|
5
|
+
staff: boolean;
|
|
6
|
+
approver: boolean;
|
|
8
7
|
};
|
|
9
8
|
export type SystemRole = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
create: boolean;
|
|
10
|
+
view: boolean;
|
|
11
|
+
update: boolean;
|
|
12
|
+
delete: boolean;
|
|
14
13
|
};
|
|
15
14
|
export type SystemRoleAttribute =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
| 'importData'
|
|
16
|
+
| 'assetAttribute'
|
|
17
|
+
| 'assetPolicies'
|
|
18
|
+
| 'depreciationGroup'
|
|
19
|
+
| 'depreciationMethod'
|
|
20
|
+
| 'documentDeletion'
|
|
21
|
+
| 'group'
|
|
22
|
+
| 'iotReader'
|
|
23
|
+
| 'license'
|
|
24
|
+
| 'purchaseDocument'
|
|
25
|
+
| 'purchaseInformation'
|
|
26
|
+
| 'userAndRole'
|
|
27
|
+
| 'tag'
|
|
28
|
+
| 'tagType'
|
|
29
|
+
| 'registerAsset';
|
|
31
30
|
export type TransactionAttribute =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
| 'borrowingRole'
|
|
32
|
+
| 'assignmentRole'
|
|
33
|
+
| 'disposalRole'
|
|
34
|
+
| 'transferRole'
|
|
35
|
+
| 'auditRole'
|
|
36
|
+
| 'maintenanceRole'
|
|
37
|
+
| 'repairRole'
|
|
38
|
+
| 'trackingRole'
|
|
39
|
+
| 'damagedRole'
|
|
40
|
+
| 'missingRole';
|
|
42
41
|
export interface UserLogin {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
transactionRoles: Record<TransactionAttribute, TransactionRole>;
|
|
43
|
+
systemRoles: Record<SystemRoleAttribute, SystemRole>;
|
|
44
|
+
userType: 'Admin' | 'Basic';
|
|
46
45
|
}
|
|
47
46
|
export declare const getTransactionRole: (
|
|
48
|
-
|
|
47
|
+
name: keyof UserLogin['transactionRoles'],
|
|
49
48
|
) => TransactionRole;
|
|
50
49
|
export declare const getSystemRole: (
|
|
51
|
-
|
|
50
|
+
name: keyof UserLogin['systemRoles'],
|
|
52
51
|
) => SystemRole;
|
|
53
52
|
export declare const hasSystemRole: (name: SystemRoleAttribute) => boolean;
|
|
54
53
|
export declare const hasTransactionRole: (
|
|
55
|
-
|
|
54
|
+
name: TransactionAttribute,
|
|
56
55
|
) => boolean;
|
|
57
56
|
export declare const hasManagerRole: (name: TransactionAttribute) => boolean;
|
|
58
57
|
export declare const hasAnyManagerRole: () => boolean;
|
|
59
58
|
export declare const hasAnyMonitoringReportRole: () => boolean;
|
|
60
59
|
export declare const hasStaffRole: (name: TransactionAttribute) => boolean;
|
|
61
60
|
export declare const hasMonitoringReportRole: (
|
|
62
|
-
|
|
61
|
+
name: TransactionAttribute,
|
|
63
62
|
) => boolean;
|
|
64
63
|
export declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
|
|
65
64
|
export declare const checkRouteAccess: (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
to: RouteLocationNormalized,
|
|
66
|
+
from: RouteLocationNormalized,
|
|
67
|
+
next: NavigationGuardNext,
|
|
69
68
|
) => void;
|