@fewangsit/wangsvue-fats 1.0.0-alpha.31 → 1.0.0-alpha.32
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 +24 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/assetinfo/AssetInfo.vue.d.ts +34 -0
- package/components/badge/Badge.vue.d.ts +73 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +52 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +591 -0
- package/components/basetree/TreeNode.vue.d.ts +35 -0
- package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
- package/components/button/Button.vue.d.ts +188 -0
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +104 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +49 -0
- package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +257 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +201 -0
- package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +200 -0
- package/components/buttonsplit/ButtonSplit.vue.d.ts +350 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +18 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/Calendar.vue.d.ts +570 -0
- package/components/card/Card.vue.d.ts +139 -0
- package/components/checkbox/Checkbox.vue.d.ts +329 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
- package/components/datatable/DataTable.vue.d.ts +735 -0
- package/components/dialog/Dialog.vue.d.ts +464 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +164 -0
- package/components/dialogform/DialogForm.vue.d.ts +349 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +136 -0
- package/components/dropdown/Dropdown.vue.d.ts +274 -0
- package/components/editor/Editor.vue.d.ts +191 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +69 -0
- package/components/fileupload/FileUpload.vue.d.ts +169 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +184 -0
- package/components/form/Form.vue.d.ts +316 -0
- package/components/icon/Icon.vue.d.ts +256 -0
- package/components/image/Image.vue.d.ts +403 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +229 -0
- package/components/index.d.ts +58 -0
- package/components/inputbadge/InputBadge.vue.d.ts +122 -0
- package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
- package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
- package/components/inputemail/InputEmail.vue.d.ts +25 -0
- package/components/inputnumber/InputNumber.vue.d.ts +282 -0
- package/components/inputpassword/InputPassword.vue.d.ts +32 -0
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +120 -0
- package/components/inputsearch/InputSearch.vue.d.ts +36 -0
- package/components/inputtext/InputText.vue.d.ts +352 -0
- package/components/inputurl/InputURL.vue.d.ts +39 -0
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +32 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +96 -0
- package/components/loading/Loading.vue.d.ts +47 -0
- package/components/loading/store/loading.store.d.ts +8 -0
- package/components/menu/Menu.vue.d.ts +390 -0
- package/components/menuitem/index.d.ts +106 -0
- package/components/multiselect/MultiSelect.vue.d.ts +194 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +301 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/tabmenu/TabMenu.vue.d.ts +288 -0
- package/components/textarea/Textarea.vue.d.ts +170 -0
- package/components/timeline/Timeline.vue.d.ts +121 -0
- package/components/toast/Toast.vue.d.ts +367 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +281 -0
- package/components/tree/Tree.vue.d.ts +148 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +83 -0
- package/components/username/UserName.vue.d.ts +113 -0
- package/components/userwithicon/UserWithIcon.vue.d.ts +20 -0
- package/config/defaultProps.d.ts +3 -0
- package/config/index.d.ts +3 -0
- package/config/locale.d.ts +3 -0
- package/directives/focus.d.ts +1 -1
- package/event-bus/index.d.ts +51 -51
- package/event-bus/mitt.d.ts +29 -14
- package/main.d.ts +31 -0
- package/package.json +8 -4
- package/plugins/WangsVue.d.ts +249 -199
- package/plugins/formValidation.d.ts +15 -6
- package/plugins/i18n-extension.d.ts +4 -0
- package/plugins/i18n.d.ts +82 -78
- package/utils/date.util.d.ts +59 -30
- package/utils/getSeverityByAssetStatus.util.d.ts +3 -0
- package/utils/index.d.ts +8 -0
- package/utils/listenSidebarChanges.util.d.ts +16 -0
- package/utils/object.util.d.ts +14 -3
- package/utils/role.util.d.ts +68 -0
- package/utils/toast.util.d.ts +78 -78
- package/utils/addAttachment.util.d.ts +0 -43
- package/utils/exportToExcel.util.d.ts +0 -20
- package/utils/filterOptions.util.d.ts +0 -3
- package/utils/genPlaceholder.util.d.ts +0 -8
- package/utils/getAttachmentIcon.util.d.ts +0 -8
- package/utils/mergePropsWithDefaults.util.d.ts +0 -20
- package/utils/textFormatter.util.d.ts +0 -17
package/plugins/i18n.d.ts
CHANGED
|
@@ -2,93 +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
|
-
|
|
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>;
|
|
82
84
|
}
|
|
83
85
|
export declare const useI18n: () => I18n;
|
|
84
86
|
declare const i18n: {
|
|
85
|
-
|
|
87
|
+
install: (app: App) => void;
|
|
86
88
|
};
|
|
87
|
-
export declare const createI18nWithExtension: (
|
|
89
|
+
export declare const createI18nWithExtension: (
|
|
90
|
+
service: I18nService,
|
|
91
|
+
) => typeof i18n;
|
|
88
92
|
export default i18n;
|
|
89
93
|
declare module 'vue' {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
interface ComponentCustomProperties {
|
|
95
|
+
$i18n: I18n;
|
|
96
|
+
$t: I18n['t'];
|
|
97
|
+
}
|
|
94
98
|
}
|
package/utils/date.util.d.ts
CHANGED
|
@@ -1,32 +1,58 @@
|
|
|
1
|
-
export type TDateFormat =
|
|
2
|
-
|
|
1
|
+
export type TDateFormat =
|
|
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
|
+
export type GoDateLayout =
|
|
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';
|
|
3
26
|
export type TTimeFormat = 'HH:mm' | 'HH:mm a' | 'HH:mm:ss' | 'HH:mm:ss a';
|
|
4
27
|
export type GoTimeLayout = '15:04' | '03:04 PM' | '15:04:05' | '03:04:05 PM';
|
|
5
|
-
export type CustomDateTimeFormatOptions = Omit<
|
|
6
|
-
|
|
7
|
-
|
|
28
|
+
export type CustomDateTimeFormatOptions = Omit<
|
|
29
|
+
Intl.DateTimeFormatOptions,
|
|
30
|
+
'timeZone'
|
|
31
|
+
> & {
|
|
32
|
+
timezone?: string;
|
|
33
|
+
locale?: string;
|
|
8
34
|
};
|
|
9
35
|
export type DateOptions = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
30
56
|
};
|
|
31
57
|
export declare const formatDate: (date: Date, options?: DateOptions) => string;
|
|
32
58
|
export declare const formatISODate: (date: string | Date) => string;
|
|
@@ -37,10 +63,13 @@ export declare const formatISODate: (date: string | Date) => string;
|
|
|
37
63
|
* @param maxSeconds - Max value of seconds difference. Use it for formats a date according to the user's general settings.
|
|
38
64
|
* @returns The formatted date string.
|
|
39
65
|
*/
|
|
40
|
-
export declare const formatDateReadable: (
|
|
66
|
+
export declare const formatDateReadable: (
|
|
67
|
+
date: Date,
|
|
68
|
+
maxSeconds?: number,
|
|
69
|
+
) => string;
|
|
41
70
|
export declare const getRemainingTime: (deadline: string) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
seconds: number;
|
|
72
|
+
days: number;
|
|
73
|
+
hours: number;
|
|
74
|
+
minutes: number;
|
|
46
75
|
};
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { formatDate } from '../utils/date.util';
|
|
2
|
+
export * from '../components/tree/helpers/filterNodeKeys.helper';
|
|
3
|
+
export * from './role.util';
|
|
4
|
+
export * from './listenSidebarChanges.util';
|
|
5
|
+
export { checkRouteAccess } from './role.util';
|
|
6
|
+
export { ZIndexUtils } from 'primevue/utils';
|
|
7
|
+
export { default as useToast } from './toast.util';
|
|
8
|
+
export { default as flattenTreeNodeChildren } from '../components/tree/helpers/flattenTreeNodeChildren.helper';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TreeNode } from '../components/basetree/BaseTree.vue.d';
|
|
2
|
+
export type SidebarEvent = CustomEvent<{
|
|
3
|
+
/**
|
|
4
|
+
* Stringified keys array.
|
|
5
|
+
*/
|
|
6
|
+
keys: string;
|
|
7
|
+
node: TreeNode;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const listenSidebarChanges: (
|
|
10
|
+
type: 'group' | 'category',
|
|
11
|
+
callback: (e: SidebarEvent) => any,
|
|
12
|
+
) => void;
|
|
13
|
+
export declare const unListenSidebarChanges: (
|
|
14
|
+
type: 'group' | 'category',
|
|
15
|
+
callback: (e: SidebarEvent) => any,
|
|
16
|
+
) => void;
|
package/utils/object.util.d.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility function to get nested property value.
|
|
3
3
|
*/
|
|
4
|
-
export declare const getNestedPropertyValue: (
|
|
4
|
+
export declare const getNestedPropertyValue: (
|
|
5
|
+
obj: Record<string, any>,
|
|
6
|
+
path: string,
|
|
7
|
+
) => any;
|
|
5
8
|
/**
|
|
6
9
|
* Utility function to set nested property value.
|
|
7
10
|
*/
|
|
8
|
-
export declare const setNestedPropertyValue: (
|
|
11
|
+
export declare const setNestedPropertyValue: (
|
|
12
|
+
obj: Record<string, any>,
|
|
13
|
+
path: string,
|
|
14
|
+
value: any,
|
|
15
|
+
) => void;
|
|
9
16
|
export declare const isEmptyObject: (obj: object) => boolean;
|
|
10
17
|
export declare const deepEquals: (a: object, b: object) => boolean;
|
|
11
|
-
export declare const equals: (
|
|
18
|
+
export declare const equals: (
|
|
19
|
+
obj1: object,
|
|
20
|
+
obj2: object,
|
|
21
|
+
field?: string,
|
|
22
|
+
) => boolean;
|
|
12
23
|
export declare const resolveFieldData: (data: object, field?: string) => object;
|
|
13
24
|
export declare const contains: (value: object, list: object[]) => boolean;
|
|
14
25
|
export declare const isNotEmpty: (value: object) => boolean;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
|
2
|
+
export type TransactionRole = {
|
|
3
|
+
manager: boolean;
|
|
4
|
+
monitoringReport: boolean;
|
|
5
|
+
staff: boolean;
|
|
6
|
+
approver: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type SystemRole = {
|
|
9
|
+
create: boolean;
|
|
10
|
+
view: boolean;
|
|
11
|
+
update: boolean;
|
|
12
|
+
delete: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type SystemRoleAttribute =
|
|
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';
|
|
30
|
+
export type TransactionAttribute =
|
|
31
|
+
| 'borrowingRole'
|
|
32
|
+
| 'assignmentRole'
|
|
33
|
+
| 'disposalRole'
|
|
34
|
+
| 'transferRole'
|
|
35
|
+
| 'auditRole'
|
|
36
|
+
| 'maintenanceRole'
|
|
37
|
+
| 'repairRole'
|
|
38
|
+
| 'trackingRole'
|
|
39
|
+
| 'damagedRole'
|
|
40
|
+
| 'missingRole';
|
|
41
|
+
export interface UserLogin {
|
|
42
|
+
transactionRoles: Record<TransactionAttribute, TransactionRole>;
|
|
43
|
+
systemRoles: Record<SystemRoleAttribute, SystemRole>;
|
|
44
|
+
userType: 'Admin' | 'Basic';
|
|
45
|
+
}
|
|
46
|
+
export declare const getTransactionRole: (
|
|
47
|
+
name: keyof UserLogin['transactionRoles'],
|
|
48
|
+
) => TransactionRole;
|
|
49
|
+
export declare const getSystemRole: (
|
|
50
|
+
name: keyof UserLogin['systemRoles'],
|
|
51
|
+
) => SystemRole;
|
|
52
|
+
export declare const hasSystemRole: (name: SystemRoleAttribute) => boolean;
|
|
53
|
+
export declare const hasTransactionRole: (
|
|
54
|
+
name: TransactionAttribute,
|
|
55
|
+
) => boolean;
|
|
56
|
+
export declare const hasManagerRole: (name: TransactionAttribute) => boolean;
|
|
57
|
+
export declare const hasAnyManagerRole: () => boolean;
|
|
58
|
+
export declare const hasAnyMonitoringReportRole: () => boolean;
|
|
59
|
+
export declare const hasStaffRole: (name: TransactionAttribute) => boolean;
|
|
60
|
+
export declare const hasMonitoringReportRole: (
|
|
61
|
+
name: TransactionAttribute,
|
|
62
|
+
) => boolean;
|
|
63
|
+
export declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
|
|
64
|
+
export declare const checkRouteAccess: (
|
|
65
|
+
to: RouteLocationNormalized,
|
|
66
|
+
from: RouteLocationNormalized,
|
|
67
|
+
next: NavigationGuardNext,
|
|
68
|
+
) => void;
|
package/utils/toast.util.d.ts
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
import { WangsIcons } from '../components/icon/Icon.vue.d';
|
|
2
2
|
export type ToastSeverity = 'success' | 'error' | 'info';
|
|
3
3
|
export interface ToastParams {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The main message to display in the toast. Will be formatted based on template message.
|
|
6
|
+
*/
|
|
7
|
+
message: string;
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether the message is customized and does not follow the default message template.
|
|
10
|
+
* If true, custom formatting will be applied.
|
|
11
|
+
*/
|
|
12
|
+
customMessage?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The severity level of the toast message.
|
|
15
|
+
* Can be 'success', 'error', or 'info'.
|
|
16
|
+
*/
|
|
17
|
+
severity?: ToastSeverity;
|
|
18
|
+
/**
|
|
19
|
+
* The icon to display in the toast.
|
|
20
|
+
*/
|
|
21
|
+
icon?: WangsIcons;
|
|
22
|
+
/**
|
|
23
|
+
* The custom CSS class to apply to the icon.
|
|
24
|
+
*/
|
|
25
|
+
iconClass?: any;
|
|
26
|
+
/**
|
|
27
|
+
* The error object from a catch statement, used to provide additional details for error toasts.
|
|
28
|
+
* Accepts any type of error object.
|
|
29
|
+
*/
|
|
30
|
+
error?: unknown;
|
|
31
|
+
/**
|
|
32
|
+
* The duration for which the toast will be displayed, in milliseconds.
|
|
33
|
+
* Set to 0 to show the message infinitely.
|
|
34
|
+
*
|
|
35
|
+
* @default 3000 - 3 seconds
|
|
36
|
+
*/
|
|
37
|
+
life?: number;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the message group to which this toast belongs.
|
|
40
|
+
*/
|
|
41
|
+
group?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Unique identifier of the toast message.
|
|
44
|
+
*/
|
|
45
|
+
messageId?: string;
|
|
46
46
|
}
|
|
47
47
|
export interface ToastMethod {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
add(params: ToastParams): void;
|
|
49
|
+
/**
|
|
50
|
+
* Clears the messages that belongs to the group.
|
|
51
|
+
* @param {string} group - Name of the message group.
|
|
52
|
+
*/
|
|
53
|
+
removeGroup(group: string): void;
|
|
54
|
+
removeAllGroups(): void;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Configuration options for the `useToast` hook.
|
|
58
58
|
*/
|
|
59
59
|
export interface UseToastConfig {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Default message templates for each severity level.
|
|
62
|
+
* Keys represent the severity, and values are the template strings.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* {
|
|
66
|
+
* severity: {
|
|
67
|
+
* success: 'Success, {message}',
|
|
68
|
+
* error: 'Error, {message} {additionalMessage}',
|
|
69
|
+
* info: 'Info, {message} {additionalMessage}',
|
|
70
|
+
* },
|
|
71
|
+
* additionalMessage: ' Silahkan cek kembali koneksi Anda.'
|
|
72
|
+
* }
|
|
73
|
+
*/
|
|
74
|
+
template?: {
|
|
75
|
+
severity?: Record<string, string>;
|
|
76
|
+
additionalMessage?: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Icons for each severity level.
|
|
80
|
+
* Keys represent the severity, and values are the corresponding icon identifiers.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* {
|
|
84
|
+
* success: 'emotion-happy-fill',
|
|
85
|
+
* error: 'emotion-unhappy-fill',
|
|
86
|
+
* }
|
|
87
|
+
*/
|
|
88
|
+
icons?: Record<string, WangsIcons>;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Hook to create and manage toast notifications.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export type FileType = 'link' | 'image' | 'txt' | 'doc' | 'xls' | 'pdf' | 'csv' | 'html' | 'json' | 'mp4' | 'mkv' | 'compressed' | 'unknown';
|
|
2
|
-
export type FormattedFile = {
|
|
3
|
-
name: string;
|
|
4
|
-
type: string;
|
|
5
|
-
size: number;
|
|
6
|
-
webkitRelativePath: string;
|
|
7
|
-
fileType: FileType;
|
|
8
|
-
file: File;
|
|
9
|
-
imgPreviewURL?: string;
|
|
10
|
-
uploadProgress?: number;
|
|
11
|
-
controller?: AbortController;
|
|
12
|
-
isCanceled?: boolean;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Maps a mime type to a custom file type.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} mimeType
|
|
18
|
-
* @returns {CustomFileType}
|
|
19
|
-
*/
|
|
20
|
-
export declare const getFileType: (mimeType: string) => FileType;
|
|
21
|
-
/**
|
|
22
|
-
* Formats a file into a FormattedFile object.
|
|
23
|
-
*
|
|
24
|
-
* @param file The file to be formatted.
|
|
25
|
-
* @returns A FormattedFile object.
|
|
26
|
-
*/
|
|
27
|
-
export declare const formatFile: (file: File) => FormattedFile;
|
|
28
|
-
/**
|
|
29
|
-
* Checks if a file is under the maximum size limit.
|
|
30
|
-
*
|
|
31
|
-
* @param file The file to be checked.
|
|
32
|
-
* @param customFileSize The maximum size limit in megabytes. @default 1
|
|
33
|
-
* @returns True if the file is under the maximum size limit, false otherwise.
|
|
34
|
-
*/
|
|
35
|
-
export declare const validateFileSize: (file: File, customFileSize?: number) => boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Checks if a file has a valid type.
|
|
38
|
-
* Make sure user doesn't upload a folder.
|
|
39
|
-
*
|
|
40
|
-
* @param file The file to be checked.
|
|
41
|
-
* @returns True if the file has a valid type, false otherwise.
|
|
42
|
-
*/
|
|
43
|
-
export declare const validateFileType: (file: File) => boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface ITable {
|
|
2
|
-
headers: string[];
|
|
3
|
-
data: Record<string, unknown>[];
|
|
4
|
-
tableName: string;
|
|
5
|
-
tableTitle?: string;
|
|
6
|
-
}
|
|
7
|
-
interface IExcelOptions {
|
|
8
|
-
tables: ITable[];
|
|
9
|
-
fileName: string;
|
|
10
|
-
additionalTexts?: (string | string[])[];
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Function to export excel, previously this only handle for 1 table in 1 file
|
|
14
|
-
* Now this function has been refactored to be able to format multiple tables in 1 file without altered its original functionality
|
|
15
|
-
* However, the way to called this function is changing a little bit (look for component DataTable and find usage of util `exportToExcel`)
|
|
16
|
-
*
|
|
17
|
-
* @param options - param that contain tables and filename for excel
|
|
18
|
-
*/
|
|
19
|
-
declare const exportToExcel: (options: IExcelOptions) => Promise<void>;
|
|
20
|
-
export default exportToExcel;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const genRandomPlaceholderBg: () => string;
|
|
2
|
-
export declare const genPlaceholder: (text: string, size: 30 | 125, bgColor?: string, fontOptions?: {
|
|
3
|
-
font?: string;
|
|
4
|
-
fontWeight?: string;
|
|
5
|
-
fontSize?: number;
|
|
6
|
-
fontColor?: string;
|
|
7
|
-
}) => HTMLCanvasElement;
|
|
8
|
-
export default genPlaceholder;
|