@fewangsit/wangsvue-fats 1.0.0-alpha.20 → 1.0.0-alpha.22
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/event-bus/mitt.d.ts +25 -7
- package/package.json +1 -1
- package/plugins/WangsVue.d.ts +184 -16
- package/plugins/formValidation.d.ts +11 -2
- package/plugins/i18n.d.ts +23 -5
- package/utils/addAttachment.util.d.ts +18 -2
- package/utils/date.util.d.ts +33 -4
- package/utils/filterOptions.util.d.ts +4 -2
- package/utils/genPlaceholder.util.d.ts +11 -6
- package/utils/mergePropsWithDefaults.util.d.ts +4 -1
- package/utils/object.util.d.ts +14 -3
- package/utils/role.util.d.ts +5 -32
- package/utils/textFormatter.util.d.ts +15 -3
- package/assets/json/currencies.json.d.ts +0 -1068
- package/assets/lottie/admin/loading-page.lottie +0 -0
- package/assets/lottie/admin/loading-table.lottie +0 -0
- package/assets/lottie/admin/no-data.lottie +0 -0
- package/assets/lottie/supplyasset/loading-page.lottie +0 -0
- package/assets/lottie/supplyasset/loading-table.lottie +0 -0
- package/assets/lottie/supplyasset/no-data.lottie +0 -0
- package/assets/lottie/workspace/loading-page.lottie +0 -0
- package/assets/lottie/workspace/loading-plane.lottie +0 -0
- package/assets/lottie/workspace/loading-table.lottie +0 -0
- package/assets/lottie/workspace/no-data.lottie +0 -0
- package/build-entry.d.ts +0 -14
- package/components/animation/Animation.vue.d.ts +0 -24
- package/components/approverinfo/ApproverInfo.vue.d.ts +0 -51
- package/components/assetinfo/AssetInfo.vue.d.ts +0 -32
- package/components/badge/Badge.vue.d.ts +0 -73
- package/components/badgegroup/BadgeGroup.vue.d.ts +0 -52
- package/components/basecomponent/index.d.ts +0 -28
- package/components/basetree/BaseTree.vue.d.ts +0 -591
- package/components/basetree/TreeNode.vue.d.ts +0 -35
- package/components/breadcrumb/Breadcrumb.vue.d.ts +0 -26
- package/components/button/Button.vue.d.ts +0 -188
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +0 -35
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +0 -104
- package/components/buttoncopy/ButtonCopy.vue.d.ts +0 -26
- package/components/buttondownload/ButtonDownload.vue.d.ts +0 -49
- package/components/buttonfilter/ButtonFilter.vue.d.ts +0 -12
- package/components/buttonradio/ButtonRadio.vue.d.ts +0 -257
- package/components/buttonscan/ButtonScan.vue.d.ts +0 -201
- 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/buttonsearch/ButtonSearch.vue.d.ts +0 -38
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +0 -200
- package/components/buttonsplit/ButtonSplit.d.ts +0 -350
- package/components/buttonsplit/ButtonSplit.vue.d.ts +0 -34
- package/components/buttonsync/ButtonSync.vue.d.ts +0 -10
- package/components/buttontoggle/ButtonToggle.vue.d.ts +0 -18
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +0 -17
- package/components/calendar/BaseCalendar.vue.d.ts +0 -86
- package/components/calendar/Calendar.vue.d.ts +0 -570
- package/components/card/Card.vue.d.ts +0 -139
- package/components/checkbox/Checkbox.vue.d.ts +0 -329
- package/components/codesnippet/CodeSnippet.vue.d.ts +0 -14
- package/components/customcolumn/ColumnList.vue.d.ts +0 -27
- package/components/customcolumn/CustomColumn.vue.d.ts +0 -37
- package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +0 -12
- package/components/datatable/DataTable.vue.d.ts +0 -735
- package/components/datatable/MultiRow.vue.d.ts +0 -16
- package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +0 -1
- package/components/datatable/helpers/filter.helper.d.ts +0 -28
- package/components/datatable/helpers/index.d.ts +0 -3
- package/components/datatable/helpers/readConfig.helper.d.ts +0 -2
- package/components/datatable/store/dataTable.store.d.ts +0 -22
- package/components/dialog/Dialog.vue.d.ts +0 -464
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +0 -164
- package/components/dialogform/DialogForm.vue.d.ts +0 -349
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +0 -136
- package/components/dropdown/Dropdown.vue.d.ts +0 -264
- package/components/editor/CodeSnippetAdapter.vue.d.ts +0 -92
- package/components/editor/Editor.vue.d.ts +0 -191
- package/components/editor/EditorButton.vue.d.ts +0 -15
- package/components/editor/MentionList.vue.d.ts +0 -35
- package/components/editor/MentionSection.vue.d.ts +0 -92
- 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/fieldwrapper/FieldWrapper.vue.d.ts +0 -69
- package/components/fileupload/FileUpload.vue.d.ts +0 -169
- package/components/filtercontainer/FilterContainer.vue.d.ts +0 -182
- package/components/filtercontainer/helpers/applyFilter.helper.d.ts +0 -5
- package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +0 -7
- package/components/filtercontainer/helpers/getOption.helper.d.ts +0 -3
- package/components/form/Form.vue.d.ts +0 -316
- package/components/gallerypreview/GalleryPreview.vue.d.ts +0 -31
- package/components/hardwaresync/store/device.store.d.ts +0 -36
- package/components/helpers/convertToArrayClass.helper.d.ts +0 -2
- package/components/helpers/index.d.ts +0 -2
- package/components/helpers/label.d.ts +0 -15
- package/components/icon/Icon.vue.d.ts +0 -256
- package/components/image/Image.vue.d.ts +0 -403
- package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +0 -36
- package/components/imagecompressor/ImageCompressor.vue.d.ts +0 -229
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +0 -32
- package/components/index.d.ts +0 -69
- package/components/inlinemessage/InlineMessage.vue.d.ts +0 -167
- package/components/inputbadge/InputBadge.vue.d.ts +0 -122
- package/components/inputcurrency/InputCurrency.vue.d.ts +0 -170
- package/components/inputcurrency/helpers/currency.helper.d.ts +0 -4
- package/components/inputemail/InputEmail.vue.d.ts +0 -25
- package/components/inputgroup/InputGroup.vue.d.ts +0 -141
- package/components/inputnumber/InputNumber.vue.d.ts +0 -282
- package/components/inputpassword/InputPassword.vue.d.ts +0 -32
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +0 -99
- package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +0 -8
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +0 -120
- package/components/inputsearch/InputSearch.vue.d.ts +0 -32
- package/components/inputtext/InputText.vue.d.ts +0 -352
- package/components/inputurl/InputURL.vue.d.ts +0 -39
- package/components/invisiblefield/InvisibleField.vue.d.ts +0 -36
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +0 -47
- package/components/languagedropdown/LanguageDropdownOption.vue.d.ts +0 -18
- package/components/languageswitcher/LanguageSwitcher.vue.d.ts +0 -15
- package/components/litedropdown/LiteDropdown.vue.d.ts +0 -96
- package/components/loading/Loading.vue.d.ts +0 -47
- package/components/loading/store/loading.store.d.ts +0 -8
- package/components/menu/Menu.vue.d.ts +0 -390
- package/components/menu/helpers/filterMenu.helper.d.ts +0 -12
- package/components/menu/helpers/index.d.ts +0 -1
- package/components/menuitem/MenuItem.vue.d.ts +0 -19
- package/components/menuitem/index.d.ts +0 -106
- package/components/multiselect/MultiSelect.vue.d.ts +0 -192
- package/components/overlaypanel/OverlayPanel.vue.d.ts +0 -301
- package/components/passthrough/index.d.ts +0 -16
- package/components/progressbar/ProgressBar.vue.d.ts +0 -72
- package/components/quickfilter/QuickFilter.vue.d.ts +0 -25
- package/components/tabmenu/TabMenu.vue.d.ts +0 -288
- package/components/tagtype/TagType.vue.d.ts +0 -21
- package/components/textarea/Textarea.vue.d.ts +0 -170
- package/components/timeline/Timeline.vue.d.ts +0 -121
- package/components/timeline/TimelineContentByType.vue.d.ts +0 -16
- package/components/toast/Toast.vue.d.ts +0 -367
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +0 -281
- package/components/tooltipspan/TooltipSpan.vue.d.ts +0 -20
- package/components/tree/Tree.vue.d.ts +0 -148
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +0 -16
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +0 -6
- package/components/tree/helpers/index.d.ts +0 -3
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +0 -16
- package/components/ts-helpers.d.ts +0 -83
- package/components/usergroup/UserGroup.vue.d.ts +0 -57
- package/components/username/UserName.vue.d.ts +0 -113
- package/components/userwithicon/UserWithIcon.vue.d.ts +0 -21
- package/components/validatormessage/ValidatorMessage.vue.d.ts +0 -12
- package/config/defaultProps.d.ts +0 -3
- package/config/index.d.ts +0 -3
- package/config/locale.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/main.d.ts +0 -2
- 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/plugins/i18n-extension.d.ts +0 -4
- package/style.css +0 -1
- package/types/options.type.d.ts +0 -16
- package/utils/getSeverityByAssetStatus.util.d.ts +0 -3
- package/utils/index.d.ts +0 -22
- package/utils/listenSidebarChanges.util.d.ts +0 -11
- package/wangsvue-fats.es.js +0 -133302
- package/wangsvue-fats.system.js +0 -489
package/event-bus/mitt.d.ts
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
export type EventType = string | symbol;
|
|
2
2
|
export type Handler<T = unknown> = (event: T) => void;
|
|
3
|
-
export type WildcardHandler<T = Record<string, unknown>> = (
|
|
3
|
+
export type WildcardHandler<T = Record<string, unknown>> = (
|
|
4
|
+
type: keyof T,
|
|
5
|
+
event: T[keyof T],
|
|
6
|
+
) => void;
|
|
4
7
|
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
5
|
-
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<
|
|
6
|
-
|
|
8
|
+
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<
|
|
9
|
+
WildcardHandler<T>
|
|
10
|
+
>;
|
|
11
|
+
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<
|
|
12
|
+
keyof Events | '*',
|
|
13
|
+
EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>
|
|
14
|
+
>;
|
|
7
15
|
export interface Emitter<Events extends Record<EventType, unknown>> {
|
|
8
16
|
all: EventHandlerMap<Events>;
|
|
9
|
-
on<Key extends keyof Events>(
|
|
17
|
+
on<Key extends keyof Events>(
|
|
18
|
+
type: Key,
|
|
19
|
+
handler: Handler<Events[Key]>,
|
|
20
|
+
): void;
|
|
10
21
|
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
11
|
-
off<Key extends keyof Events>(
|
|
22
|
+
off<Key extends keyof Events>(
|
|
23
|
+
type: Key,
|
|
24
|
+
handler?: Handler<Events[Key]>,
|
|
25
|
+
): void;
|
|
12
26
|
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
13
27
|
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
14
|
-
emit<Key extends keyof Events>(
|
|
28
|
+
emit<Key extends keyof Events>(
|
|
29
|
+
type: undefined extends Events[Key] ? Key : never,
|
|
30
|
+
): void;
|
|
15
31
|
}
|
|
16
32
|
/**
|
|
17
33
|
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
18
34
|
* @name mitt
|
|
19
35
|
* @returns {Mitt}
|
|
20
36
|
*/
|
|
21
|
-
export default function mitt<Events extends Record<EventType, unknown>>(
|
|
37
|
+
export default function mitt<Events extends Record<EventType, unknown>>(
|
|
38
|
+
all?: EventHandlerMap<Events>,
|
|
39
|
+
): Emitter<Events>;
|
|
22
40
|
declare global {
|
|
23
41
|
interface Window {
|
|
24
42
|
eventBus: Emitter<any>;
|
package/package.json
CHANGED
package/plugins/WangsVue.d.ts
CHANGED
|
@@ -1,32 +1,53 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {
|
|
3
|
+
FieldWrapperLocaleConfig,
|
|
4
|
+
FieldWrapperProps,
|
|
5
|
+
} from '../components/fieldwrapper/FieldWrapper.vue.d';
|
|
6
|
+
import {
|
|
7
|
+
InputTextLocaleConfig,
|
|
8
|
+
InputTextProps,
|
|
9
|
+
} from '../components/inputtext/InputText.vue.d';
|
|
5
10
|
import { TreeProps } from '../components/tree/Tree.vue.d';
|
|
6
11
|
import { DialogConfirmLocaleConfig } from '../components/dialogconfirm/DialogConfirm.vue.d';
|
|
7
12
|
import { CustomColumnLocaleConfig } from '../components/customcolumn/CustomColumn.vue.d';
|
|
8
13
|
import { ButtonSearchLocaleConfig } from '../components/buttonsearch/ButtonSearch.vue.d';
|
|
9
14
|
import { FilterContainerLocaleConfig } from '../components/filtercontainer/FilterContainer.vue.d';
|
|
10
15
|
import { MultiSelectLocaleConfig } from '../components/multiselect/MultiSelect.vue.d';
|
|
11
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
DropdownLocaleConfig,
|
|
18
|
+
DropdownProps,
|
|
19
|
+
} from '../components/dropdown/Dropdown.vue.d';
|
|
12
20
|
import { InputCurrencyLocaleConfig } from '../components/inputcurrency/InputCurrency.vue.d';
|
|
13
21
|
import { TextareaLocaleConfig } from '../components/textarea/Textarea.vue.d';
|
|
14
22
|
import { InputrangeNumberLocaleConfig } from '../components/inputrangenumber/InputRangeNumber.vue.d';
|
|
15
23
|
import { DialogFormLocaleConfig } from '../components/dialogform/DialogForm.vue.d';
|
|
16
24
|
import { InputPhoneNumberLocaleConfig } from '../components/inputphonenumber/InputPhoneNumber.vue.d';
|
|
17
25
|
import { InputNumberLocaleConfig } from '../components/inputnumber/InputNumber.vue.d';
|
|
18
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
CalendarLocaleConfig,
|
|
28
|
+
CalendarPresetOptions,
|
|
29
|
+
} from '../components/calendar/Calendar.vue.d';
|
|
19
30
|
import { OverlayPanelPassThroughOptions } from '../components/overlaypanel/OverlayPanel.vue.d';
|
|
20
31
|
import { InputURLProps } from '../components/inputurl/InputURL.vue.d';
|
|
21
32
|
import { InputEmailProps } from '../components/inputemail/InputEmail.vue.d';
|
|
22
33
|
import { ImageProps } from '../components/image/Image.vue.d';
|
|
23
34
|
import { MenuLocaleConfig } from '../components/menu/Menu.vue.d';
|
|
24
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
ButtonBulkActionLocaleConfig,
|
|
37
|
+
ButtonBulkActionProps,
|
|
38
|
+
} from '../components/buttonbulkaction/ButtonBulkAction.vue.d';
|
|
25
39
|
import { AnimationDefaultConfig } from '../components/animation/Animation.vue.d';
|
|
26
40
|
import { LoadingPresetOptions } from '../components/loading/Loading.vue.d';
|
|
27
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
DataTableLocaleConfig,
|
|
43
|
+
DataTableProps,
|
|
44
|
+
} from '../components/datatable/DataTable.vue.d';
|
|
28
45
|
import { BadgeComponentConfigs } from '../components/badge/Badge.vue.d';
|
|
29
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
UserNameComponentConfigs,
|
|
48
|
+
UserNameLocaleConfig,
|
|
49
|
+
UserNamePresetOptions,
|
|
50
|
+
} from '../components/username/UserName.vue.d';
|
|
30
51
|
import { ImageCompressorLocaleConfig } from '../components/imagecompressor/ImageCompressor.vue.d';
|
|
31
52
|
import { UseToastConfig } from '../utils';
|
|
32
53
|
/**
|
|
@@ -69,7 +90,7 @@ interface ComponentLocaleConfig {
|
|
|
69
90
|
ImageCompressor?: ImageCompressorLocaleConfig;
|
|
70
91
|
}
|
|
71
92
|
export interface LocaleConfig {
|
|
72
|
-
global:
|
|
93
|
+
global: typeof DEFAULT_GLOBAL_LOCALE_CONFIG;
|
|
73
94
|
components: ComponentLocaleConfig;
|
|
74
95
|
}
|
|
75
96
|
export interface ComponentPresetOptions {
|
|
@@ -79,9 +100,17 @@ export interface ComponentPresetOptions {
|
|
|
79
100
|
username: UserNamePresetOptions;
|
|
80
101
|
[key: string]: any;
|
|
81
102
|
}
|
|
82
|
-
export type WangsVueComponentConfig<
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
export type WangsVueComponentConfig<
|
|
104
|
+
ComponentName extends
|
|
105
|
+
| keyof ComponentDefaultPropsConfig
|
|
106
|
+
| keyof ComponentLocaleConfig,
|
|
107
|
+
> = {
|
|
108
|
+
defaultProps: ComponentName extends keyof ComponentDefaultPropsConfig
|
|
109
|
+
? ComponentDefaultPropsConfig[ComponentName]
|
|
110
|
+
: undefined;
|
|
111
|
+
locale: (ComponentName extends keyof ComponentLocaleConfig
|
|
112
|
+
? ComponentLocaleConfig[ComponentName]
|
|
113
|
+
: undefined) & {
|
|
85
114
|
global: LocaleConfig['global'];
|
|
86
115
|
};
|
|
87
116
|
};
|
|
@@ -110,18 +139,157 @@ export interface WangsVueOptions {
|
|
|
110
139
|
}
|
|
111
140
|
export interface WangsVueInstance {
|
|
112
141
|
config: WangsVueOptions;
|
|
113
|
-
getComponentConfig<
|
|
142
|
+
getComponentConfig<
|
|
143
|
+
ComponentName extends
|
|
144
|
+
| keyof ComponentDefaultPropsConfig
|
|
145
|
+
| keyof ComponentLocaleConfig,
|
|
146
|
+
>(
|
|
147
|
+
componentName: ComponentName,
|
|
148
|
+
): WangsVueComponentConfig<ComponentName>;
|
|
114
149
|
}
|
|
150
|
+
declare const DEFAULT_GLOBAL_LOCALE_CONFIG: {
|
|
151
|
+
startsWith: string;
|
|
152
|
+
contains: string;
|
|
153
|
+
notContains: string;
|
|
154
|
+
endsWith: string;
|
|
155
|
+
equals: string;
|
|
156
|
+
notEquals: string;
|
|
157
|
+
noFilter: string;
|
|
158
|
+
lt: string;
|
|
159
|
+
lte: string;
|
|
160
|
+
gt: string;
|
|
161
|
+
gte: string;
|
|
162
|
+
dateIs: string;
|
|
163
|
+
dateIsNot: string;
|
|
164
|
+
dateBefore: string;
|
|
165
|
+
dateAfter: string;
|
|
166
|
+
clear: string;
|
|
167
|
+
apply: string;
|
|
168
|
+
matchAll: string;
|
|
169
|
+
matchAny: string;
|
|
170
|
+
addRule: string;
|
|
171
|
+
removeRule: string;
|
|
172
|
+
accept: string;
|
|
173
|
+
reject: string;
|
|
174
|
+
choose: string;
|
|
175
|
+
upload: string;
|
|
176
|
+
cancel: string;
|
|
177
|
+
completed: string;
|
|
178
|
+
pending: string;
|
|
179
|
+
fileSizeTypes: string[];
|
|
180
|
+
monthNames: string[];
|
|
181
|
+
monthNamesShort: string[];
|
|
182
|
+
dayNames: string[];
|
|
183
|
+
dayNamesShort: string[];
|
|
184
|
+
dayNamesMin: string[];
|
|
185
|
+
chooseYear: string;
|
|
186
|
+
chooseMonth: string;
|
|
187
|
+
chooseDate: string;
|
|
188
|
+
prevDecade: string;
|
|
189
|
+
nextDecade: string;
|
|
190
|
+
prevYear: string;
|
|
191
|
+
nextYear: string;
|
|
192
|
+
prevMonth: string;
|
|
193
|
+
nextMonth: string;
|
|
194
|
+
prevHour: string;
|
|
195
|
+
nextHour: string;
|
|
196
|
+
prevMinute: string;
|
|
197
|
+
nextMinute: string;
|
|
198
|
+
prevSecond: string;
|
|
199
|
+
nextSecond: string;
|
|
200
|
+
pm: string;
|
|
201
|
+
am: string;
|
|
202
|
+
today: string;
|
|
203
|
+
weekHeader: string;
|
|
204
|
+
firstDayOfWeek: number;
|
|
205
|
+
showMonthAfterYear: boolean;
|
|
206
|
+
dateFormat: string;
|
|
207
|
+
weak: string;
|
|
208
|
+
medium: string;
|
|
209
|
+
strong: string;
|
|
210
|
+
passwordPrompt: string;
|
|
211
|
+
emptyFilterMessage: string;
|
|
212
|
+
searchMessage: string;
|
|
213
|
+
selectionMessage: string;
|
|
214
|
+
emptySelectionMessage: string;
|
|
215
|
+
emptySearchMessage: string;
|
|
216
|
+
emptyMessage: string;
|
|
217
|
+
aria: {
|
|
218
|
+
trueLabel: string;
|
|
219
|
+
falseLabel: string;
|
|
220
|
+
nullLabel: string;
|
|
221
|
+
star: string;
|
|
222
|
+
stars: string;
|
|
223
|
+
selectAll: string;
|
|
224
|
+
unselectAll: string;
|
|
225
|
+
close: string;
|
|
226
|
+
previous: string;
|
|
227
|
+
next: string;
|
|
228
|
+
navigation: string;
|
|
229
|
+
scrollTop: string;
|
|
230
|
+
moveTop: string;
|
|
231
|
+
moveUp: string;
|
|
232
|
+
moveDown: string;
|
|
233
|
+
moveBottom: string;
|
|
234
|
+
moveToTarget: string;
|
|
235
|
+
moveToSource: string;
|
|
236
|
+
moveAllToTarget: string;
|
|
237
|
+
moveAllToSource: string;
|
|
238
|
+
pageLabel: string;
|
|
239
|
+
firstPageLabel: string;
|
|
240
|
+
lastPageLabel: string;
|
|
241
|
+
nextPageLabel: string;
|
|
242
|
+
prevPageLabel: string;
|
|
243
|
+
rowsPerPageLabel: string;
|
|
244
|
+
jumpToPageDropdownLabel: string;
|
|
245
|
+
jumpToPageInputLabel: string;
|
|
246
|
+
selectRow: string;
|
|
247
|
+
unselectRow: string;
|
|
248
|
+
expandRow: string;
|
|
249
|
+
collapseRow: string;
|
|
250
|
+
showFilterMenu: string;
|
|
251
|
+
hideFilterMenu: string;
|
|
252
|
+
filterOperator: string;
|
|
253
|
+
filterConstraint: string;
|
|
254
|
+
editRow: string;
|
|
255
|
+
saveEdit: string;
|
|
256
|
+
cancelEdit: string;
|
|
257
|
+
listView: string;
|
|
258
|
+
gridView: string;
|
|
259
|
+
slide: string;
|
|
260
|
+
slideNumber: string;
|
|
261
|
+
zoomImage: string;
|
|
262
|
+
zoomIn: string;
|
|
263
|
+
zoomOut: string;
|
|
264
|
+
rotateRight: string;
|
|
265
|
+
rotateLeft: string;
|
|
266
|
+
listLabel: string;
|
|
267
|
+
};
|
|
268
|
+
};
|
|
115
269
|
export declare const defaultOptions: WangsVueOptions;
|
|
116
|
-
export declare const useWangsVueConfig: <
|
|
117
|
-
|
|
270
|
+
export declare const useWangsVueConfig: <
|
|
271
|
+
T extends
|
|
272
|
+
| (keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig)
|
|
273
|
+
| undefined,
|
|
274
|
+
>(
|
|
275
|
+
componentName?: T,
|
|
276
|
+
) => T extends keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig
|
|
277
|
+
? WangsVueComponentConfig<T>
|
|
278
|
+
: WangsVueOptions;
|
|
279
|
+
export declare const mergeWangsVueConfig: (
|
|
280
|
+
baseConfig: WangsVueOptions,
|
|
281
|
+
overrideConfig: Partial<WangsVueOptions>,
|
|
282
|
+
) => WangsVueOptions;
|
|
118
283
|
/**
|
|
119
284
|
*
|
|
120
285
|
* @param predefinedOptions
|
|
121
286
|
* @param mergeConfig Wether merge predefined config with defualt config @default true
|
|
122
287
|
* @returns
|
|
123
288
|
*/
|
|
124
|
-
declare const createWangsVuePlugin: (
|
|
289
|
+
declare const createWangsVuePlugin: (
|
|
290
|
+
predefinedOptions?: Partial<WangsVueOptions>,
|
|
291
|
+
mergeConfig?: boolean,
|
|
292
|
+
) => Plugin<Partial<WangsVueOptions>>;
|
|
125
293
|
export default createWangsVuePlugin;
|
|
126
294
|
declare module 'vue' {
|
|
127
295
|
interface ComponentCustomProperties {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { MaybeRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
FormContext as VeeFormContext,
|
|
4
|
+
FieldContext,
|
|
5
|
+
RuleExpression,
|
|
6
|
+
FieldOptions,
|
|
7
|
+
} from 'vee-validate';
|
|
3
8
|
export interface FormContext<T> {
|
|
4
9
|
values: T;
|
|
5
10
|
handleSubmit: VeeFormContext['handleSubmit'];
|
|
@@ -7,4 +12,8 @@ export interface FormContext<T> {
|
|
|
7
12
|
setFieldValue: VeeFormContext['setFieldValue'];
|
|
8
13
|
}
|
|
9
14
|
export declare const useForm: <T>() => FormContext<T>;
|
|
10
|
-
export declare const useField: <T>(
|
|
15
|
+
export declare const useField: <T>(
|
|
16
|
+
path: MaybeRefOrGetter<string>,
|
|
17
|
+
rules?: MaybeRef<RuleExpression<T>>,
|
|
18
|
+
opts?: Partial<FieldOptions<T>>,
|
|
19
|
+
) => FieldContext<T>;
|
package/plugins/i18n.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { App, Ref } from 'vue';
|
|
2
2
|
import { AxiosResponse } from 'axios';
|
|
3
|
-
import { LanguageOption } from '../components/languagedropdown/LanguageDropdown.vue.d';
|
|
4
3
|
export type Locale = string;
|
|
4
|
+
export interface LanguageOption {
|
|
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
|
+
}
|
|
5
19
|
export interface I18n {
|
|
6
20
|
/**
|
|
7
21
|
* Locale message translation
|
|
@@ -42,9 +56,11 @@ export interface I18nService {
|
|
|
42
56
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
43
57
|
* @returns A promise resolving to a key-value record of messages.
|
|
44
58
|
*/
|
|
45
|
-
getMessages(locale: string): Promise<
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
getMessages(locale: string): Promise<
|
|
60
|
+
AxiosResponse<{
|
|
61
|
+
data: MessageMap;
|
|
62
|
+
}>
|
|
63
|
+
>;
|
|
48
64
|
/**
|
|
49
65
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
50
66
|
*
|
|
@@ -70,7 +86,9 @@ export declare const useI18n: () => I18n;
|
|
|
70
86
|
declare const i18n: {
|
|
71
87
|
install: (app: App) => void;
|
|
72
88
|
};
|
|
73
|
-
export declare const createI18nWithExtension: (
|
|
89
|
+
export declare const createI18nWithExtension: (
|
|
90
|
+
service: I18nService,
|
|
91
|
+
) => typeof i18n;
|
|
74
92
|
export default i18n;
|
|
75
93
|
declare module 'vue' {
|
|
76
94
|
interface ComponentCustomProperties {
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
export type FileType =
|
|
1
|
+
export type FileType =
|
|
2
|
+
| 'link'
|
|
3
|
+
| 'image'
|
|
4
|
+
| 'txt'
|
|
5
|
+
| 'doc'
|
|
6
|
+
| 'xls'
|
|
7
|
+
| 'pdf'
|
|
8
|
+
| 'csv'
|
|
9
|
+
| 'html'
|
|
10
|
+
| 'json'
|
|
11
|
+
| 'mp4'
|
|
12
|
+
| 'mkv'
|
|
13
|
+
| 'compressed'
|
|
14
|
+
| 'unknown';
|
|
2
15
|
export type FormattedFile = {
|
|
3
16
|
name: string;
|
|
4
17
|
type: string;
|
|
@@ -32,7 +45,10 @@ export declare const formatFile: (file: File) => FormattedFile;
|
|
|
32
45
|
* @param customFileSize The maximum size limit in megabytes. @default 1
|
|
33
46
|
* @returns True if the file is under the maximum size limit, false otherwise.
|
|
34
47
|
*/
|
|
35
|
-
export declare const validateFileSize: (
|
|
48
|
+
export declare const validateFileSize: (
|
|
49
|
+
file: File,
|
|
50
|
+
customFileSize?: number,
|
|
51
|
+
) => boolean;
|
|
36
52
|
/**
|
|
37
53
|
* Checks if a file has a valid type.
|
|
38
54
|
* Make sure user doesn't upload a folder.
|
package/utils/date.util.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
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<
|
|
28
|
+
export type CustomDateTimeFormatOptions = Omit<
|
|
29
|
+
Intl.DateTimeFormatOptions,
|
|
30
|
+
'timeZone'
|
|
31
|
+
> & {
|
|
6
32
|
timezone?: string;
|
|
7
33
|
locale?: string;
|
|
8
34
|
};
|
|
@@ -37,7 +63,10 @@ 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
71
|
seconds: number;
|
|
43
72
|
days: number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const filterOptions: (
|
|
1
|
+
import { Option } from '../components/dropdown/Dropdown.vue.d';
|
|
2
|
+
declare const filterOptions: (
|
|
3
|
+
options?: Option[] | string[],
|
|
4
|
+
) => Option[] | string[];
|
|
3
5
|
export default filterOptions;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export declare const genRandomPlaceholderBg: () => string;
|
|
2
|
-
export declare const genPlaceholder: (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export declare const genPlaceholder: (
|
|
3
|
+
text: string,
|
|
4
|
+
size: 30 | 125,
|
|
5
|
+
bgColor?: string,
|
|
6
|
+
fontOptions?: {
|
|
7
|
+
font?: string;
|
|
8
|
+
fontWeight?: string;
|
|
9
|
+
fontSize?: number;
|
|
10
|
+
fontColor?: string;
|
|
11
|
+
},
|
|
12
|
+
) => HTMLCanvasElement;
|
|
8
13
|
export default genPlaceholder;
|
|
@@ -17,4 +17,7 @@
|
|
|
17
17
|
* const mergedProps = mergePropsWithDefaults(defaultProps, props);
|
|
18
18
|
* console.log(mergedProps); // Output: { showOptionalText: true, tooltipPos: 'bottom' }
|
|
19
19
|
*/
|
|
20
|
-
export default function mergePropsWithDefaults<T extends Record<string, any>>(
|
|
20
|
+
export default function mergePropsWithDefaults<T extends Record<string, any>>(
|
|
21
|
+
props: Record<string, any>,
|
|
22
|
+
defaultProps: T,
|
|
23
|
+
): T;
|
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;
|
package/utils/role.util.d.ts
CHANGED
|
@@ -1,33 +1,6 @@
|
|
|
1
1
|
import { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
approver: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type SystemRole = {
|
|
10
|
-
create: boolean;
|
|
11
|
-
view: boolean;
|
|
12
|
-
update: boolean;
|
|
13
|
-
delete: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type SystemRoleAttribute = 'importData' | 'assetAttribute' | 'assetPolicies' | 'depreciationGroup' | 'depreciationMethod' | 'documentDeletion' | 'group' | 'iotReader' | 'license' | 'purchaseDocument' | 'purchaseInformation' | 'userAndRole' | 'tag' | 'tagType' | 'registerAsset';
|
|
16
|
-
export type TransactionAttribute = 'borrowingRole' | 'assignmentRole' | 'disposalRole' | 'transferRole' | 'auditRole' | 'maintenanceRole' | 'repairRole' | 'trackingRole' | 'damagedRole' | 'missingRole';
|
|
17
|
-
export interface UserLogin {
|
|
18
|
-
transactionRoles: Record<TransactionAttribute, TransactionRole>;
|
|
19
|
-
systemRoles: Record<SystemRoleAttribute, SystemRole>;
|
|
20
|
-
userType: 'Admin' | 'Basic';
|
|
21
|
-
}
|
|
22
|
-
declare const getTransactionRole: (name: keyof UserLogin["transactionRoles"]) => TransactionRole;
|
|
23
|
-
declare const getSystemRole: (name: keyof UserLogin["systemRoles"]) => SystemRole;
|
|
24
|
-
declare const hasSystemRole: (name: SystemRoleAttribute) => boolean;
|
|
25
|
-
declare const hasTransactionRole: (name: TransactionAttribute) => boolean;
|
|
26
|
-
declare const hasManagerRole: (name: TransactionAttribute) => boolean;
|
|
27
|
-
declare const hasAnyManagerRole: () => boolean;
|
|
28
|
-
declare const hasAnyMonitoringReportRole: () => boolean;
|
|
29
|
-
declare const hasStaffRole: (name: TransactionAttribute) => boolean;
|
|
30
|
-
declare const hasMonitoringReportRole: (name: TransactionAttribute) => boolean;
|
|
31
|
-
declare const hasApprovalRole: (name: TransactionAttribute) => boolean;
|
|
32
|
-
declare const checkRouteAccess: (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => void;
|
|
33
|
-
export { getTransactionRole, getSystemRole, hasTransactionRole, hasApprovalRole, hasSystemRole, checkRouteAccess, hasManagerRole, hasAnyManagerRole, hasMonitoringReportRole, hasAnyMonitoringReportRole, hasStaffRole, };
|
|
2
|
+
export declare const checkRouteAccess: (
|
|
3
|
+
to: RouteLocationNormalized,
|
|
4
|
+
from: RouteLocationNormalized,
|
|
5
|
+
next: NavigationGuardNext,
|
|
6
|
+
) => void;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
export declare const formatUserName: (name?: string) => string;
|
|
2
|
-
export declare const getInititalName: (
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export declare const getInititalName: (
|
|
3
|
+
existing: string[],
|
|
4
|
+
fullName?: string,
|
|
5
|
+
maxLength?: number,
|
|
6
|
+
) => string;
|
|
7
|
+
export declare const getInitialsByConsonant: (
|
|
8
|
+
existingInitials: string[],
|
|
9
|
+
fullName: string,
|
|
10
|
+
maxLength: number,
|
|
11
|
+
) => string;
|
|
12
|
+
export declare const getInitialsBy3FirstLetter: (
|
|
13
|
+
existingInitials: string[],
|
|
14
|
+
fullName: string,
|
|
15
|
+
maxLength: number,
|
|
16
|
+
) => string;
|
|
5
17
|
/**
|
|
6
18
|
* Formats the label with the appropriate article ("a" or "an") based on its vowel sound.
|
|
7
19
|
* This function checks if the label starts with a vowel or has a special case for silent "h" words.
|