@fewangsit/wangsvue-fats 1.0.0-alpha.30 → 1.0.0-alpha.31
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 +7 -25
- package/package.json +1 -1
- package/plugins/WangsVue.d.ts +14 -64
- package/plugins/formValidation.d.ts +2 -11
- package/plugins/i18n.d.ts +4 -8
- package/utils/addAttachment.util.d.ts +2 -18
- package/utils/date.util.d.ts +4 -33
- package/utils/filterOptions.util.d.ts +1 -3
- package/utils/genPlaceholder.util.d.ts +6 -11
- package/utils/mergePropsWithDefaults.util.d.ts +1 -4
- package/utils/object.util.d.ts +3 -14
- package/utils/textFormatter.util.d.ts +3 -15
- 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 -31
- 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 -193
- 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/buttonsync/ButtonSync.vue.d.ts +0 -22
- 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 -127
- 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/customcolumn/ColumnList.vue.d.ts +0 -47
- package/components/customcolumn/CustomColumn.vue.d.ts +0 -37
- package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +0 -16
- package/components/datatable/DataTable.vue.d.ts +0 -735
- 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/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 -274
- package/components/editor/CodeSnippetAdapter.vue.d.ts +0 -152
- package/components/editor/Editor.vue.d.ts +0 -191
- 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/fieldwrapper/FieldWrapper.vue.d.ts +0 -69
- package/components/fileupload/FileUpload.vue.d.ts +0 -169
- package/components/filtercontainer/FilterContainer.vue.d.ts +0 -181
- 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/form/Form.vue.d.ts +0 -316
- 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 -59
- package/components/imagecompressor/ImageCompressor.vue.d.ts +0 -229
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +0 -55
- package/components/index.d.ts +0 -58
- 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 -8
- package/components/inputemail/InputEmail.vue.d.ts +0 -25
- 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 -33
- package/components/inputtext/InputText.vue.d.ts +0 -352
- package/components/inputurl/InputURL.vue.d.ts +0 -36
- package/components/invisiblefield/InvisibleField.vue.d.ts +0 -32
- 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 -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/menuitem/index.d.ts +0 -106
- package/components/multiselect/MultiSelect.vue.d.ts +0 -194
- package/components/overlaypanel/OverlayPanel.vue.d.ts +0 -301
- package/components/passthrough/index.d.ts +0 -16
- package/components/tabmenu/TabMenu.vue.d.ts +0 -288
- 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 -64
- package/components/toast/Toast.vue.d.ts +0 -367
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +0 -281
- package/components/tree/Tree.vue.d.ts +0 -148
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +0 -22
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +0 -8
- package/components/tree/helpers/index.d.ts +0 -3
- package/components/ts-helpers.d.ts +0 -85
- package/components/username/UserName.vue.d.ts +0 -113
- package/components/userwithicon/UserWithIcon.vue.d.ts +0 -20
- 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 -31
- 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/utils/getSeverityByAssetStatus.util.d.ts +0 -3
- package/utils/index.d.ts +0 -21
- package/utils/listenSidebarChanges.util.d.ts +0 -16
- package/utils/role.util.d.ts +0 -6
- package/wangsvue-fats.es.js +0 -123730
- package/wangsvue-fats.system.js +0 -478
package/event-bus/mitt.d.ts
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
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>> = (
|
|
4
|
-
type: keyof T,
|
|
5
|
-
event: T[keyof T],
|
|
6
|
-
) => void;
|
|
3
|
+
export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
|
|
7
4
|
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
8
|
-
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<
|
|
9
|
-
|
|
10
|
-
>;
|
|
11
|
-
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<
|
|
12
|
-
keyof Events | '*',
|
|
13
|
-
EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>
|
|
14
|
-
>;
|
|
5
|
+
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
|
6
|
+
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
|
15
7
|
export interface Emitter<Events extends Record<EventType, unknown>> {
|
|
16
8
|
all: EventHandlerMap<Events>;
|
|
17
|
-
on<Key extends keyof Events>(
|
|
18
|
-
type: Key,
|
|
19
|
-
handler: Handler<Events[Key]>,
|
|
20
|
-
): void;
|
|
9
|
+
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
21
10
|
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
22
|
-
off<Key extends keyof Events>(
|
|
23
|
-
type: Key,
|
|
24
|
-
handler?: Handler<Events[Key]>,
|
|
25
|
-
): void;
|
|
11
|
+
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
26
12
|
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
27
13
|
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
28
|
-
emit<Key extends keyof Events>(
|
|
29
|
-
type: undefined extends Events[Key] ? Key : never,
|
|
30
|
-
): void;
|
|
14
|
+
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
31
15
|
}
|
|
32
16
|
/**
|
|
33
17
|
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
34
18
|
* @name mitt
|
|
35
19
|
* @returns {Mitt}
|
|
36
20
|
*/
|
|
37
|
-
export default function mitt<Events extends Record<EventType, unknown>>(
|
|
38
|
-
all?: EventHandlerMap<Events>,
|
|
39
|
-
): Emitter<Events>;
|
|
21
|
+
export default function mitt<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): Emitter<Events>;
|
|
40
22
|
declare global {
|
|
41
23
|
interface Window {
|
|
42
24
|
eventBus: Emitter<any>;
|
package/package.json
CHANGED
package/plugins/WangsVue.d.ts
CHANGED
|
@@ -1,53 +1,31 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
FieldWrapperProps,
|
|
5
|
-
} from '../components/fieldwrapper/FieldWrapper.vue.d';
|
|
6
|
-
import {
|
|
7
|
-
InputTextLocaleConfig,
|
|
8
|
-
InputTextProps,
|
|
9
|
-
} from '../components/inputtext/InputText.vue.d';
|
|
2
|
+
import { FieldWrapperLocaleConfig, FieldWrapperProps } from '../components/fieldwrapper/FieldWrapper.vue.d';
|
|
3
|
+
import { InputTextLocaleConfig, InputTextProps } from '../components/inputtext/InputText.vue.d';
|
|
10
4
|
import { TreeProps } from '../components/tree/Tree.vue.d';
|
|
11
5
|
import { DialogConfirmLocaleConfig } from '../components/dialogconfirm/DialogConfirm.vue.d';
|
|
12
6
|
import { CustomColumnLocaleConfig } from '../components/customcolumn/CustomColumn.vue.d';
|
|
13
7
|
import { ButtonSearchLocaleConfig } from '../components/buttonsearch/ButtonSearch.vue.d';
|
|
14
8
|
import { FilterContainerLocaleConfig } from '../components/filtercontainer/FilterContainer.vue.d';
|
|
15
9
|
import { MultiSelectLocaleConfig } from '../components/multiselect/MultiSelect.vue.d';
|
|
16
|
-
import {
|
|
17
|
-
DropdownLocaleConfig,
|
|
18
|
-
DropdownProps,
|
|
19
|
-
} from '../components/dropdown/Dropdown.vue.d';
|
|
10
|
+
import { DropdownLocaleConfig, DropdownProps } from '../components/dropdown/Dropdown.vue.d';
|
|
20
11
|
import { InputCurrencyLocaleConfig } from '../components/inputcurrency/InputCurrency.vue.d';
|
|
21
12
|
import { TextareaLocaleConfig } from '../components/textarea/Textarea.vue.d';
|
|
22
13
|
import { InputrangeNumberLocaleConfig } from '../components/inputrangenumber/InputRangeNumber.vue.d';
|
|
23
14
|
import { DialogFormLocaleConfig } from '../components/dialogform/DialogForm.vue.d';
|
|
24
15
|
import { InputPhoneNumberLocaleConfig } from '../components/inputphonenumber/InputPhoneNumber.vue.d';
|
|
25
16
|
import { InputNumberLocaleConfig } from '../components/inputnumber/InputNumber.vue.d';
|
|
26
|
-
import {
|
|
27
|
-
CalendarLocaleConfig,
|
|
28
|
-
CalendarPresetOptions,
|
|
29
|
-
} from '../components/calendar/Calendar.vue.d';
|
|
17
|
+
import { CalendarLocaleConfig, CalendarPresetOptions } from '../components/calendar/Calendar.vue.d';
|
|
30
18
|
import { OverlayPanelPassThroughOptions } from '../components/overlaypanel/OverlayPanel.vue.d';
|
|
31
19
|
import { InputURLProps } from '../components/inputurl/InputURL.vue.d';
|
|
32
20
|
import { InputEmailProps } from '../components/inputemail/InputEmail.vue.d';
|
|
33
21
|
import { ImageProps } from '../components/image/Image.vue.d';
|
|
34
22
|
import { MenuLocaleConfig } from '../components/menu/Menu.vue.d';
|
|
35
|
-
import {
|
|
36
|
-
ButtonBulkActionLocaleConfig,
|
|
37
|
-
ButtonBulkActionProps,
|
|
38
|
-
} from '../components/buttonbulkaction/ButtonBulkAction.vue.d';
|
|
23
|
+
import { ButtonBulkActionLocaleConfig, ButtonBulkActionProps } from '../components/buttonbulkaction/ButtonBulkAction.vue.d';
|
|
39
24
|
import { AnimationDefaultConfig } from '../components/animation/Animation.vue.d';
|
|
40
25
|
import { LoadingPresetOptions } from '../components/loading/Loading.vue.d';
|
|
41
|
-
import {
|
|
42
|
-
DataTableLocaleConfig,
|
|
43
|
-
DataTableProps,
|
|
44
|
-
} from '../components/datatable/DataTable.vue.d';
|
|
26
|
+
import { DataTableLocaleConfig, DataTableProps } from '../components/datatable/DataTable.vue.d';
|
|
45
27
|
import { BadgeComponentConfigs } from '../components/badge/Badge.vue.d';
|
|
46
|
-
import {
|
|
47
|
-
UserNameComponentConfigs,
|
|
48
|
-
UserNameLocaleConfig,
|
|
49
|
-
UserNamePresetOptions,
|
|
50
|
-
} from '../components/username/UserName.vue.d';
|
|
28
|
+
import { UserNameComponentConfigs, UserNameLocaleConfig, UserNamePresetOptions } from '../components/username/UserName.vue.d';
|
|
51
29
|
import { ImageCompressorLocaleConfig } from '../components/imagecompressor/ImageCompressor.vue.d';
|
|
52
30
|
import { UseToastConfig } from '../utils';
|
|
53
31
|
/**
|
|
@@ -100,17 +78,9 @@ export interface ComponentPresetOptions {
|
|
|
100
78
|
username: UserNamePresetOptions;
|
|
101
79
|
[key: string]: any;
|
|
102
80
|
}
|
|
103
|
-
export type WangsVueComponentConfig<
|
|
104
|
-
ComponentName extends
|
|
105
|
-
|
|
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) & {
|
|
81
|
+
export type WangsVueComponentConfig<ComponentName extends keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig> = {
|
|
82
|
+
defaultProps: ComponentName extends keyof ComponentDefaultPropsConfig ? ComponentDefaultPropsConfig[ComponentName] : undefined;
|
|
83
|
+
locale: (ComponentName extends keyof ComponentLocaleConfig ? ComponentLocaleConfig[ComponentName] : undefined) & {
|
|
114
84
|
global: LocaleConfig['global'];
|
|
115
85
|
};
|
|
116
86
|
};
|
|
@@ -139,13 +109,7 @@ export interface WangsVueOptions {
|
|
|
139
109
|
}
|
|
140
110
|
export interface WangsVueInstance {
|
|
141
111
|
config: WangsVueOptions;
|
|
142
|
-
getComponentConfig<
|
|
143
|
-
ComponentName extends
|
|
144
|
-
| keyof ComponentDefaultPropsConfig
|
|
145
|
-
| keyof ComponentLocaleConfig,
|
|
146
|
-
>(
|
|
147
|
-
componentName: ComponentName,
|
|
148
|
-
): WangsVueComponentConfig<ComponentName>;
|
|
112
|
+
getComponentConfig<ComponentName extends keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig>(componentName: ComponentName): WangsVueComponentConfig<ComponentName>;
|
|
149
113
|
}
|
|
150
114
|
declare const DEFAULT_GLOBAL_LOCALE_CONFIG: {
|
|
151
115
|
startsWith: string;
|
|
@@ -267,29 +231,15 @@ declare const DEFAULT_GLOBAL_LOCALE_CONFIG: {
|
|
|
267
231
|
};
|
|
268
232
|
};
|
|
269
233
|
export declare const defaultOptions: WangsVueOptions;
|
|
270
|
-
export declare const useWangsVueConfig: <
|
|
271
|
-
|
|
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;
|
|
234
|
+
export declare const useWangsVueConfig: <T extends (keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig) | undefined>(componentName?: T) => T extends keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig ? WangsVueComponentConfig<T> : WangsVueOptions;
|
|
235
|
+
export declare const mergeWangsVueConfig: (baseConfig: WangsVueOptions, overrideConfig: Partial<WangsVueOptions>) => WangsVueOptions;
|
|
283
236
|
/**
|
|
284
237
|
*
|
|
285
238
|
* @param predefinedOptions
|
|
286
239
|
* @param mergeConfig Wether merge predefined config with defualt config @default true
|
|
287
240
|
* @returns
|
|
288
241
|
*/
|
|
289
|
-
declare const createWangsVuePlugin: (
|
|
290
|
-
predefinedOptions?: Partial<WangsVueOptions>,
|
|
291
|
-
mergeConfig?: boolean,
|
|
292
|
-
) => Plugin<Partial<WangsVueOptions>>;
|
|
242
|
+
declare const createWangsVuePlugin: (predefinedOptions?: Partial<WangsVueOptions>, mergeConfig?: boolean) => Plugin<Partial<WangsVueOptions>>;
|
|
293
243
|
export default createWangsVuePlugin;
|
|
294
244
|
declare module 'vue' {
|
|
295
245
|
interface ComponentCustomProperties {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { MaybeRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
FormContext as VeeFormContext,
|
|
4
|
-
FieldContext,
|
|
5
|
-
RuleExpression,
|
|
6
|
-
FieldOptions,
|
|
7
|
-
} from 'vee-validate';
|
|
2
|
+
import { FormContext as VeeFormContext, FieldContext, RuleExpression, FieldOptions } from 'vee-validate';
|
|
8
3
|
export interface FormContext<T> {
|
|
9
4
|
values: T;
|
|
10
5
|
handleSubmit: VeeFormContext['handleSubmit'];
|
|
@@ -12,8 +7,4 @@ export interface FormContext<T> {
|
|
|
12
7
|
setFieldValue: VeeFormContext['setFieldValue'];
|
|
13
8
|
}
|
|
14
9
|
export declare const useForm: <T>() => FormContext<T>;
|
|
15
|
-
export declare const useField: <T>(
|
|
16
|
-
path: MaybeRefOrGetter<string>,
|
|
17
|
-
rules?: MaybeRef<RuleExpression<T>>,
|
|
18
|
-
opts?: Partial<FieldOptions<T>>,
|
|
19
|
-
) => FieldContext<T>;
|
|
10
|
+
export declare const useField: <T>(path: MaybeRefOrGetter<string>, rules?: MaybeRef<RuleExpression<T>>, opts?: Partial<FieldOptions<T>>) => FieldContext<T>;
|
package/plugins/i18n.d.ts
CHANGED
|
@@ -56,11 +56,9 @@ export interface I18nService {
|
|
|
56
56
|
* @param locale The locale code (e.g., 'en', 'id').
|
|
57
57
|
* @returns A promise resolving to a key-value record of messages.
|
|
58
58
|
*/
|
|
59
|
-
getMessages(locale: string): Promise<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}>
|
|
63
|
-
>;
|
|
59
|
+
getMessages(locale: string): Promise<AxiosResponse<{
|
|
60
|
+
data: MessageMap;
|
|
61
|
+
}>>;
|
|
64
62
|
/**
|
|
65
63
|
* Fetch all available lang options for LanguageDropdown and LanguageSwitcher
|
|
66
64
|
*
|
|
@@ -86,9 +84,7 @@ export declare const useI18n: () => I18n;
|
|
|
86
84
|
declare const i18n: {
|
|
87
85
|
install: (app: App) => void;
|
|
88
86
|
};
|
|
89
|
-
export declare const createI18nWithExtension: (
|
|
90
|
-
service: I18nService,
|
|
91
|
-
) => typeof i18n;
|
|
87
|
+
export declare const createI18nWithExtension: (service: I18nService) => typeof i18n;
|
|
92
88
|
export default i18n;
|
|
93
89
|
declare module 'vue' {
|
|
94
90
|
interface ComponentCustomProperties {
|
|
@@ -1,17 +1,4 @@
|
|
|
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';
|
|
1
|
+
export type FileType = 'link' | 'image' | 'txt' | 'doc' | 'xls' | 'pdf' | 'csv' | 'html' | 'json' | 'mp4' | 'mkv' | 'compressed' | 'unknown';
|
|
15
2
|
export type FormattedFile = {
|
|
16
3
|
name: string;
|
|
17
4
|
type: string;
|
|
@@ -45,10 +32,7 @@ export declare const formatFile: (file: File) => FormattedFile;
|
|
|
45
32
|
* @param customFileSize The maximum size limit in megabytes. @default 1
|
|
46
33
|
* @returns True if the file is under the maximum size limit, false otherwise.
|
|
47
34
|
*/
|
|
48
|
-
export declare const validateFileSize: (
|
|
49
|
-
file: File,
|
|
50
|
-
customFileSize?: number,
|
|
51
|
-
) => boolean;
|
|
35
|
+
export declare const validateFileSize: (file: File, customFileSize?: number) => boolean;
|
|
52
36
|
/**
|
|
53
37
|
* Checks if a file has a valid type.
|
|
54
38
|
* Make sure user doesn't upload a folder.
|
package/utils/date.util.d.ts
CHANGED
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
export type TDateFormat =
|
|
2
|
-
|
|
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';
|
|
1
|
+
export type TDateFormat = 'd/m/yy' | 'm/d/yy' | 'd/mm/yy' | 'dd/mm/yy' | 'dd/mm/yyyy' | 'dd M yy' | 'dd M yyyy' | 'dd MM yy' | 'dd MM yyyy' | 'D dd M yy' | 'D dd M yyyy' | 'DD dd MM yy' | 'DD dd MM yyyy' | 'D, dd M yy' | 'D, dd M yyyy' | 'DD, dd MM yy' | 'DD, dd MM yyyy';
|
|
2
|
+
export type GoDateLayout = '02/01/06' | '_2/_1/06' | '_1/_2/06' | '02 Jan 06' | 'Mon, 02 Jan 06' | 'Mon, 02 Jan 2006';
|
|
26
3
|
export type TTimeFormat = 'HH:mm' | 'HH:mm a' | 'HH:mm:ss' | 'HH:mm:ss a';
|
|
27
4
|
export type GoTimeLayout = '15:04' | '03:04 PM' | '15:04:05' | '03:04:05 PM';
|
|
28
|
-
export type CustomDateTimeFormatOptions = Omit<
|
|
29
|
-
Intl.DateTimeFormatOptions,
|
|
30
|
-
'timeZone'
|
|
31
|
-
> & {
|
|
5
|
+
export type CustomDateTimeFormatOptions = Omit<Intl.DateTimeFormatOptions, 'timeZone'> & {
|
|
32
6
|
timezone?: string;
|
|
33
7
|
locale?: string;
|
|
34
8
|
};
|
|
@@ -63,10 +37,7 @@ export declare const formatISODate: (date: string | Date) => string;
|
|
|
63
37
|
* @param maxSeconds - Max value of seconds difference. Use it for formats a date according to the user's general settings.
|
|
64
38
|
* @returns The formatted date string.
|
|
65
39
|
*/
|
|
66
|
-
export declare const formatDateReadable: (
|
|
67
|
-
date: Date,
|
|
68
|
-
maxSeconds?: number,
|
|
69
|
-
) => string;
|
|
40
|
+
export declare const formatDateReadable: (date: Date, maxSeconds?: number) => string;
|
|
70
41
|
export declare const getRemainingTime: (deadline: string) => {
|
|
71
42
|
seconds: number;
|
|
72
43
|
days: number;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { Option } from '../components/dropdown/Dropdown.vue.d';
|
|
2
|
-
declare const filterOptions: (
|
|
3
|
-
options?: Option[] | string[],
|
|
4
|
-
) => Option[] | string[];
|
|
2
|
+
declare const filterOptions: (options?: Option[] | string[]) => Option[] | string[];
|
|
5
3
|
export default filterOptions;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export declare const genRandomPlaceholderBg: () => string;
|
|
2
|
-
export declare const genPlaceholder: (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fontWeight?: string;
|
|
9
|
-
fontSize?: number;
|
|
10
|
-
fontColor?: string;
|
|
11
|
-
},
|
|
12
|
-
) => HTMLCanvasElement;
|
|
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;
|
|
13
8
|
export default genPlaceholder;
|
|
@@ -17,7 +17,4 @@
|
|
|
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>>(
|
|
21
|
-
props: Record<string, any>,
|
|
22
|
-
defaultProps: T,
|
|
23
|
-
): T;
|
|
20
|
+
export default function mergePropsWithDefaults<T extends Record<string, any>>(props: Record<string, any>, defaultProps: T): T;
|
package/utils/object.util.d.ts
CHANGED
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility function to get nested property value.
|
|
3
3
|
*/
|
|
4
|
-
export declare const getNestedPropertyValue: (
|
|
5
|
-
obj: Record<string, any>,
|
|
6
|
-
path: string,
|
|
7
|
-
) => any;
|
|
4
|
+
export declare const getNestedPropertyValue: (obj: Record<string, any>, path: string) => any;
|
|
8
5
|
/**
|
|
9
6
|
* Utility function to set nested property value.
|
|
10
7
|
*/
|
|
11
|
-
export declare const setNestedPropertyValue: (
|
|
12
|
-
obj: Record<string, any>,
|
|
13
|
-
path: string,
|
|
14
|
-
value: any,
|
|
15
|
-
) => void;
|
|
8
|
+
export declare const setNestedPropertyValue: (obj: Record<string, any>, path: string, value: any) => void;
|
|
16
9
|
export declare const isEmptyObject: (obj: object) => boolean;
|
|
17
10
|
export declare const deepEquals: (a: object, b: object) => boolean;
|
|
18
|
-
export declare const equals: (
|
|
19
|
-
obj1: object,
|
|
20
|
-
obj2: object,
|
|
21
|
-
field?: string,
|
|
22
|
-
) => boolean;
|
|
11
|
+
export declare const equals: (obj1: object, obj2: object, field?: string) => boolean;
|
|
23
12
|
export declare const resolveFieldData: (data: object, field?: string) => object;
|
|
24
13
|
export declare const contains: (value: object, list: object[]) => boolean;
|
|
25
14
|
export declare const isNotEmpty: (value: object) => boolean;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
export declare const formatUserName: (name?: string) => string;
|
|
2
|
-
export declare const getInititalName: (
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
2
|
+
export declare const getInititalName: (existing: string[], fullName?: string, maxLength?: number) => string;
|
|
3
|
+
export declare const getInitialsByConsonant: (existingInitials: string[], fullName: string, maxLength: number) => string;
|
|
4
|
+
export declare const getInitialsBy3FirstLetter: (existingInitials: string[], fullName: string, maxLength: number) => string;
|
|
17
5
|
/**
|
|
18
6
|
* Formats the label with the appropriate article ("a" or "an") based on its vowel sound.
|
|
19
7
|
* This function checks if the label starts with a vowel or has a special case for silent "h" words.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ClassComponent } from '../ts-helpers.d';
|
|
2
|
-
|
|
3
|
-
export interface AnimationDefaultConfig {
|
|
4
|
-
libPath: 'supplyasset' | 'workspace' | 'admin';
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface AnimationProps {
|
|
8
|
-
animation: 'no-data' | 'loading-plane' | 'loading-page' | 'loading-table';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* **WangsVue - Animation**
|
|
13
|
-
*
|
|
14
|
-
* _Animation is a lottie animation wrapper._
|
|
15
|
-
*
|
|
16
|
-
* @group Component
|
|
17
|
-
*/
|
|
18
|
-
declare class Animation extends ClassComponent<
|
|
19
|
-
AnimationProps,
|
|
20
|
-
unknown,
|
|
21
|
-
unknown
|
|
22
|
-
> {}
|
|
23
|
-
|
|
24
|
-
export default Animation;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers.d';
|
|
2
|
-
|
|
3
|
-
export interface ApproverDetail {
|
|
4
|
-
_id?: string;
|
|
5
|
-
level: number;
|
|
6
|
-
type: 'and' | 'or';
|
|
7
|
-
status: 'disetujui' | 'ditolak' | 'menunggu approval';
|
|
8
|
-
approvers: {
|
|
9
|
-
_id: string;
|
|
10
|
-
fullName: string;
|
|
11
|
-
actionAt?: string;
|
|
12
|
-
action?: 'menyetujui' | 'menolak' | null;
|
|
13
|
-
}[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ApproverInfoProps {
|
|
17
|
-
approvals?: ApproverDetail[];
|
|
18
|
-
/**
|
|
19
|
-
* To determine whether this component show short information about approval or not
|
|
20
|
-
* @default true
|
|
21
|
-
*/
|
|
22
|
-
showShortInfo?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* To set label text when showShortInfo is false
|
|
25
|
-
*/
|
|
26
|
-
label?: string;
|
|
27
|
-
/**
|
|
28
|
-
* To set the button label that opens the approval dialog
|
|
29
|
-
* @default 'more'
|
|
30
|
-
*/
|
|
31
|
-
btnLabel?: string;
|
|
32
|
-
/**
|
|
33
|
-
* To format date in list approver
|
|
34
|
-
* @default true
|
|
35
|
-
*/
|
|
36
|
-
useFormatDate?: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class ApproverInfo extends ClassComponent<
|
|
40
|
-
ApproverInfoProps,
|
|
41
|
-
unknown,
|
|
42
|
-
unknown
|
|
43
|
-
> {}
|
|
44
|
-
|
|
45
|
-
declare module '@vue/runtime-core' {
|
|
46
|
-
interface GlobalComponents {
|
|
47
|
-
ApproverInfo: GlobalComponentConstructor<ApproverInfo>;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default ApproverInfo;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers.d';
|
|
2
|
-
|
|
3
|
-
type Field = 'brand' | 'model' | 'group' | 'status';
|
|
4
|
-
|
|
5
|
-
export interface AssetInfoProps {
|
|
6
|
-
id: string;
|
|
7
|
-
/**
|
|
8
|
-
* Specifys the field/information to be fisplayed
|
|
9
|
-
*/
|
|
10
|
-
fields?: Field[];
|
|
11
|
-
/**
|
|
12
|
-
* The Transaction Detail contains the asset infomation.
|
|
13
|
-
*
|
|
14
|
-
* It will prevent dynamic fetch of asset information.
|
|
15
|
-
*/
|
|
16
|
-
transactionDetail?: Record<string, unknown>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare class AssetInfo extends ClassComponent<
|
|
20
|
-
AssetInfoProps,
|
|
21
|
-
unknown,
|
|
22
|
-
unknown
|
|
23
|
-
> {}
|
|
24
|
-
|
|
25
|
-
declare module 'vue' {
|
|
26
|
-
export interface GlobalComponents {
|
|
27
|
-
AssetInfo: GlobalComponentConstructor<AssetInfo>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default AssetInfo;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ClassComponent } from '../ts-helpers';
|
|
2
|
-
|
|
3
|
-
export interface BadgeComponentConfigs {
|
|
4
|
-
/**
|
|
5
|
-
* The component configurasion to set the severity based on given label. If provided, props.severity might be omitted.
|
|
6
|
-
*
|
|
7
|
-
* @param label The badge label
|
|
8
|
-
* @returns The matched severity of given label
|
|
9
|
-
*/
|
|
10
|
-
getSeverity?: (label?: string) => BadgeProps['severity'];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Props for Badge component
|
|
15
|
-
*/
|
|
16
|
-
export interface BadgeProps extends BadgeComponentConfigs {
|
|
17
|
-
/**
|
|
18
|
-
* The text to be displayed.
|
|
19
|
-
*/
|
|
20
|
-
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* Whether the badge text is editable.
|
|
23
|
-
*/
|
|
24
|
-
editable?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Sets the severity level for styling purposes. This prop might be omitted if getSeverity is provided.
|
|
27
|
-
*/
|
|
28
|
-
severity?: 'success' | 'info' | 'danger' | 'warning' | 'dark' | 'primary';
|
|
29
|
-
/**
|
|
30
|
-
* Specifies the format for text truncation rules based on the usage context.
|
|
31
|
-
*/
|
|
32
|
-
format?: 'username' | 'nowrap';
|
|
33
|
-
/**
|
|
34
|
-
* Whether to show the remove icon or not. Clicking the remove icon will emit 'remove' event.
|
|
35
|
-
*/
|
|
36
|
-
removable?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to set badge become disabled.
|
|
39
|
-
*/
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Set custom tooltip for badge.
|
|
44
|
-
*
|
|
45
|
-
* @default - the full label if the badge text is truncated
|
|
46
|
-
*/
|
|
47
|
-
tooltip?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Emits for Badge component
|
|
52
|
-
*/
|
|
53
|
-
export type BadgeEmits = {
|
|
54
|
-
'remove': [];
|
|
55
|
-
/**
|
|
56
|
-
* Emits when the text is edited.
|
|
57
|
-
* Only available when props.editable=true
|
|
58
|
-
*/
|
|
59
|
-
'update:label': [label: string | null];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* **WangsVue - Badge**
|
|
64
|
-
*
|
|
65
|
-
* _Badge is a component for displaying a text with optional remove functionality._
|
|
66
|
-
*
|
|
67
|
-
* @group components
|
|
68
|
-
*/
|
|
69
|
-
export default class Badge extends ClassComponent<
|
|
70
|
-
BadgeProps,
|
|
71
|
-
unknown,
|
|
72
|
-
BadgeEmits
|
|
73
|
-
> {}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Slot } from 'vue';
|
|
2
|
-
import { BadgeProps } from '../badge/Badge.vue.d';
|
|
3
|
-
import { ClassComponent, HintedString } from '../ts-helpers.d';
|
|
4
|
-
|
|
5
|
-
export type ObjectBadge = {
|
|
6
|
-
text: string;
|
|
7
|
-
severity: 'success' | 'danger' | 'warning' | 'dark' | 'primary';
|
|
8
|
-
tooltip?: string;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export interface BadgeGroupProps
|
|
12
|
-
extends Omit<BadgeProps, 'label' | 'disabled' | 'removable'> {
|
|
13
|
-
/**
|
|
14
|
-
* Support data type object to determine severity for specific text
|
|
15
|
-
*/
|
|
16
|
-
labels: string[] | ObjectBadge[];
|
|
17
|
-
/**
|
|
18
|
-
* Determine whether severity of text "more" is customizable
|
|
19
|
-
*
|
|
20
|
-
* @default undefined
|
|
21
|
-
*/
|
|
22
|
-
textMoreSeverity?: HintedString<
|
|
23
|
-
'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast'
|
|
24
|
-
>;
|
|
25
|
-
/**
|
|
26
|
-
* The text shown on the more button
|
|
27
|
-
*
|
|
28
|
-
* @default 'more'
|
|
29
|
-
*/
|
|
30
|
-
textMore?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Maximum number of label to be shown.
|
|
33
|
-
*/
|
|
34
|
-
limit?: number;
|
|
35
|
-
/**
|
|
36
|
-
* The dialog header shown on more button clicked
|
|
37
|
-
*/
|
|
38
|
-
headerLabel?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface BadgeGroupSlots {
|
|
42
|
-
/**
|
|
43
|
-
* Slot for custom more dialog content
|
|
44
|
-
*/
|
|
45
|
-
dialogcontent: Slot<{ labels: string[] }>;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default class Badge extends ClassComponent<
|
|
49
|
-
BadgeGroupProps,
|
|
50
|
-
BadgeGroupSlots,
|
|
51
|
-
unknown
|
|
52
|
-
> {}
|