@fewangsit/wangsvue-fats 1.0.0-alpha.15 → 1.0.0-alpha.151
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 +9 -1
- package/components/assetinfo/AssetInfo.vue.d.ts +15 -16
- package/components/badgegroup/BadgeGroup.vue.d.ts +3 -1
- package/components/basetree/BaseTree.vue.d.ts +6 -1
- package/components/button/Button.vue.d.ts +3 -2
- package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +1 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +31 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +1 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +3 -2
- package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +2 -1
- package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -34
- package/components/buttonsync/ButtonSync.vue.d.ts +13 -1
- package/components/buttontoggle/ButtonToggle.vue.d.ts +1 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/Calendar.vue.d.ts +32 -4
- package/components/card/Card.vue.d.ts +1 -0
- package/components/carousel/Carousel.vue.d.ts +28 -0
- package/components/checkbox/Checkbox.vue.d.ts +1 -0
- package/components/datatable/DataTable.vue.d.ts +14 -4
- package/components/dialog/Dialog.vue.d.ts +4 -3
- package/components/dialogassetnamedetail/DialogAssetNameDetail.vue.d.ts +46 -0
- package/components/dialogassetnamedetail/options/columns.d.ts +2 -0
- package/components/dialogassetnamedetail/options/filter.d.ts +2 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +2 -1
- package/components/dialogform/DialogForm.vue.d.ts +3 -2
- package/components/dialoglinkedasset/DialogLinkedAsset.vue.d.ts +106 -0
- package/components/dialogprintqr/DialogPrintQR.vue.d.ts +18 -0
- package/components/dialogreportdamage/DialogReportDamage.vue.d.ts +34 -0
- package/components/dialogreportmissing/DialogReportMissing.vue.d.ts +33 -0
- package/components/dialogreporttag/DialogReportTag.vue.d.ts +31 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +3 -2
- package/components/dialogselectuser/DialogSelectUser.vue.d.ts +102 -0
- package/components/dialogselectuser/options/columns.d.ts +3 -0
- package/components/dialogtransferlog/DialogTransferLog.vue.d.ts +16 -0
- package/components/dropdown/Dropdown.vue.d.ts +28 -4
- package/components/editor/Editor.vue.d.ts +1 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +19 -2
- package/components/fileupload/FileUpload.vue.d.ts +1 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +104 -69
- package/components/form/Form.vue.d.ts +4 -1
- package/components/icon/Icon.vue.d.ts +4 -0
- package/components/image/Image.vue.d.ts +8 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +14 -0
- package/components/index.d.ts +34 -22
- package/components/inputcurrency/helpers/currency.helper.d.ts +5 -1
- package/components/inputemail/InputEmail.vue.d.ts +1 -0
- package/components/inputnumber/InputNumber.vue.d.ts +6 -0
- package/components/inputotp/InputOtp.vue.d.ts +3 -0
- package/components/inputpassword/InputPassword.vue.d.ts +1 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +1 -0
- package/components/inputsearch/InputSearch.vue.d.ts +7 -1
- package/components/inputtext/InputText.vue.d.ts +2 -1
- package/components/inputurl/InputURL.vue.d.ts +4 -2
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -36
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +5 -19
- package/components/litedropdown/LiteDropdown.vue.d.ts +5 -3
- package/components/loading/store/loading.store.d.ts +3 -3
- package/components/menu/Menu.vue.d.ts +2 -1
- package/components/multiselect/MultiSelect.vue.d.ts +7 -4
- package/components/overlaypanel/OverlayPanel.vue.d.ts +1 -0
- package/components/paginator/Paginator.vue.d.ts +285 -0
- package/components/steps/Steps.vue.d.ts +20 -0
- package/components/tabmenu/TabMenu.vue.d.ts +7 -191
- package/components/tagtype/TagType.vue.d.ts +5 -0
- package/components/textarea/Textarea.vue.d.ts +2 -1
- package/components/timeline/Timeline.vue.d.ts +21 -2
- package/components/toast/Toast.vue.d.ts +2 -1
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +1 -0
- package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
- package/components/tree/Tree.vue.d.ts +6 -3
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +8 -2
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +3 -1
- package/components/ts-helpers.d.ts +8 -0
- package/components/username/UserName.vue.d.ts +6 -1
- package/components/userwithicon/UserWithIcon.vue.d.ts +2 -2
- package/config/defaultProps.d.ts +1 -1
- package/config/index.d.ts +1 -1
- package/config/locale.d.ts +1 -1
- package/directives/focus.d.ts +1 -1
- package/event-bus/index.d.ts +59 -53
- package/event-bus/mitt.d.ts +29 -14
- package/main.d.ts +34 -2
- package/package.json +16 -8
- package/plugins/VueHtmlToPaper.d.ts +11 -0
- package/plugins/WangsVue.d.ts +278 -98
- package/plugins/formValidation.d.ts +16 -6
- package/plugins/i18n-extension.d.ts +1 -1
- package/plugins/i18n.d.ts +90 -67
- package/stats.html +4949 -0
- package/style.css +1 -1
- package/utils/date.util.d.ts +64 -31
- package/utils/exportToExcel.util.d.ts +23 -16
- package/utils/formatTagCode.util.d.ts +1 -0
- package/utils/getStatusSeverity.util.d.ts +30 -0
- package/utils/index.d.ts +8 -21
- package/utils/isBasic.util.d.ts +1 -0
- package/utils/listenSidebarChanges.util.d.ts +14 -9
- package/utils/object.util.d.ts +14 -3
- package/utils/role.util.d.ts +63 -26
- package/utils/toast.util.d.ts +78 -78
- package/utils/xlsx.util.d.ts +19 -0
- package/wangsvue-fats.js +56981 -0
- package/wangsvue-fats.system.js +199 -281
- 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/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/buttonsplit/ButtonSplit.d.ts +0 -350
- package/components/calendar/BaseCalendar.vue.d.ts +0 -86
- package/components/codesnippet/CodeSnippet.vue.d.ts +0 -14
- package/components/customcolumn/ColumnList.vue.d.ts +0 -27
- package/components/customcolumn/helpers/setVisibilityColumn.helper.d.ts +0 -12
- 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/editor/CodeSnippetAdapter.vue.d.ts +0 -92
- 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/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/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/imagecompressor/BackgroundImageCropper.vue.d.ts +0 -36
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +0 -30
- package/components/inputgroup/InputGroup.vue.d.ts +0 -141
- package/components/inputphonenumber/helpers/getUserLocation.helper.d.ts +0 -8
- package/components/languagedropdown/LanguageDropdownOption.vue.d.ts +0 -18
- 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/progressbar/ProgressBar.vue.d.ts +0 -72
- package/components/quickfilter/QuickFilter.vue.d.ts +0 -25
- package/components/timeline/TimelineContentByType.vue.d.ts +0 -16
- package/components/tooltipspan/TooltipSpan.vue.d.ts +0 -20
- package/components/tree/helpers/index.d.ts +0 -3
- package/components/usergroup/UserGroup.vue.d.ts +0 -57
- package/types/options.type.d.ts +0 -16
- package/utils/addAttachment.util.d.ts +0 -43
- 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/getSeverityByAssetStatus.util.d.ts +0 -3
- package/utils/mergePropsWithDefaults.util.d.ts +0 -20
- package/utils/textFormatter.util.d.ts +0 -17
- package/wangsvue-fats.es.js +0 -133778
package/event-bus/mitt.d.ts
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
all: EventHandlerMap<Events>;
|
|
17
|
+
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
18
|
+
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
19
|
+
off<Key extends keyof Events>(
|
|
20
|
+
type: Key,
|
|
21
|
+
handler?: Handler<Events[Key]>,
|
|
22
|
+
): void;
|
|
23
|
+
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
24
|
+
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
25
|
+
emit<Key extends keyof Events>(
|
|
26
|
+
type: undefined extends Events[Key] ? Key : never,
|
|
27
|
+
): void;
|
|
15
28
|
}
|
|
16
29
|
/**
|
|
17
30
|
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
18
31
|
* @name mitt
|
|
19
32
|
* @returns {Mitt}
|
|
20
33
|
*/
|
|
21
|
-
export default function mitt<Events extends Record<EventType, unknown>>(
|
|
34
|
+
export default function mitt<Events extends Record<EventType, unknown>>(
|
|
35
|
+
all?: EventHandlerMap<Events>,
|
|
36
|
+
): Emitter<Events>;
|
|
22
37
|
declare global {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
interface Window {
|
|
39
|
+
eventBus: Emitter<any>;
|
|
40
|
+
}
|
|
26
41
|
}
|
package/main.d.ts
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {}
|
|
1
|
+
export { default as mitt } from './event-bus/mitt';
|
|
2
|
+
export { default as eventBus, extendEventBus } from './event-bus';
|
|
3
|
+
|
|
4
|
+
// PrimeVue
|
|
5
|
+
export { default as ToastService } from 'primevue/toastservice';
|
|
6
|
+
|
|
7
|
+
// Utils
|
|
8
|
+
export * from './utils';
|
|
9
|
+
|
|
10
|
+
// Helpers
|
|
11
|
+
export { formatCurrency } from './components/inputcurrency/helpers/currency.helper';
|
|
12
|
+
|
|
13
|
+
// Component store
|
|
14
|
+
export { default as useLoadingStore } from './components/loading/store/loading.store';
|
|
15
|
+
|
|
16
|
+
// Directives
|
|
17
|
+
export { default as Tooltip } from 'primevue/tooltip';
|
|
18
|
+
export { Focus } from './directives';
|
|
19
|
+
|
|
20
|
+
// Plugins
|
|
21
|
+
export { useForm, useField } from './plugins/formValidation';
|
|
22
|
+
export type { FormContext } from './plugins/formValidation';
|
|
23
|
+
|
|
24
|
+
// Translation
|
|
25
|
+
export * from './plugins/i18n';
|
|
26
|
+
export { default as i18n } from './plugins/i18n-extension';
|
|
27
|
+
|
|
28
|
+
// Used for dialog print qr
|
|
29
|
+
export { default as VueHtmlToPaper } from './plugins/VueHtmlToPaper';
|
|
30
|
+
|
|
31
|
+
export * from './components';
|
|
32
|
+
|
|
33
|
+
// Config
|
|
34
|
+
export { default as WangsVue } from './config';
|
package/package.json
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fewangsit/wangsvue-fats",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"author": "
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "1.0.0-alpha.151",
|
|
4
|
+
"author": "Wangsit FE Developer",
|
|
5
|
+
"description": "Fixed Asset Tagsamurai VueJS Component Library",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"module": "./wangsvue-fats.
|
|
7
|
+
"module": "./wangsvue-fats.js",
|
|
8
8
|
"types": "./main.d.ts",
|
|
9
|
+
"repository": "https://github.com/fewangsit/wangsvue",
|
|
9
10
|
"exports": {
|
|
10
|
-
".": "./wangsvue-fats.
|
|
11
|
+
".": "./wangsvue-fats.js",
|
|
11
12
|
"./style.css": "./style.css",
|
|
12
|
-
"./
|
|
13
|
-
"./
|
|
14
|
-
"./
|
|
13
|
+
"./config/*": "./config/*",
|
|
14
|
+
"./plugins/*": "./plugins/*",
|
|
15
|
+
"./directives/*": "./directives/*",
|
|
16
|
+
"./components/*": "./components/*",
|
|
17
|
+
"./event-bus/*": "./event-bus/*",
|
|
18
|
+
"./utils/*": "./utils/*"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@wangs-ui/core": "latest",
|
|
22
|
+
"@wangs-ui/vue": "latest"
|
|
15
23
|
}
|
|
16
24
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
type PrintOptions = {
|
|
3
|
+
name?: string;
|
|
4
|
+
specs?: string[];
|
|
5
|
+
replace?: boolean;
|
|
6
|
+
styles?: string[];
|
|
7
|
+
};
|
|
8
|
+
declare const VueHtmlToPaper: {
|
|
9
|
+
install(app: App, globalOptions?: PrintOptions): void;
|
|
10
|
+
};
|
|
11
|
+
export default VueHtmlToPaper;
|
package/plugins/WangsVue.d.ts
CHANGED
|
@@ -1,131 +1,311 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
2
|
+
import { InputOtpRawPreset } from '@wangs-ui/core/dist/types/components/inputotp/inputotp.type';
|
|
3
|
+
import { TabMenuRawPreset } from '@wangs-ui/core/dist/types/components/tabmenu/tabmenu.type';
|
|
4
|
+
import { AnimationDefaultConfig } from '../components/animation/Animation.vue.d';
|
|
5
|
+
import { BadgeComponentConfigs } from '../components/badge/Badge.vue.d';
|
|
6
|
+
import {
|
|
7
|
+
ButtonBulkActionLocaleConfig,
|
|
8
|
+
ButtonBulkActionProps,
|
|
9
|
+
} from '../components/buttonbulkaction/ButtonBulkAction.vue.d';
|
|
10
|
+
import {
|
|
11
|
+
ButtonDownloadLocaleConfig,
|
|
12
|
+
ButtonDownloadProps,
|
|
13
|
+
} from '../components/buttondownload/ButtonDownload.vue.d';
|
|
8
14
|
import { ButtonSearchLocaleConfig } from '../components/buttonsearch/ButtonSearch.vue.d';
|
|
15
|
+
import {
|
|
16
|
+
CalendarLocaleConfig,
|
|
17
|
+
CalendarPresetOptions,
|
|
18
|
+
} from '../components/calendar/Calendar.vue.d';
|
|
19
|
+
import { CustomColumnLocaleConfig } from '../components/customcolumn/CustomColumn.vue.d';
|
|
20
|
+
import {
|
|
21
|
+
DataTableLocaleConfig,
|
|
22
|
+
DataTableProps,
|
|
23
|
+
} from '../components/datatable/DataTable.vue.d';
|
|
24
|
+
import { DialogConfirmLocaleConfig } from '../components/dialogconfirm/DialogConfirm.vue.d';
|
|
25
|
+
import { DialogFormLocaleConfig } from '../components/dialogform/DialogForm.vue.d';
|
|
26
|
+
import {
|
|
27
|
+
DropdownLocaleConfig,
|
|
28
|
+
DropdownProps,
|
|
29
|
+
} from '../components/dropdown/Dropdown.vue.d';
|
|
30
|
+
import {
|
|
31
|
+
FieldWrapperLocaleConfig,
|
|
32
|
+
FieldWrapperProps,
|
|
33
|
+
} from '../components/fieldwrapper/FieldWrapper.vue.d';
|
|
9
34
|
import { FilterContainerLocaleConfig } from '../components/filtercontainer/FilterContainer.vue.d';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
35
|
+
import { ImageProps } from '../components/image/Image.vue.d';
|
|
36
|
+
import { ImageCompressorLocaleConfig } from '../components/imagecompressor/ImageCompressor.vue.d';
|
|
12
37
|
import { InputCurrencyLocaleConfig } from '../components/inputcurrency/InputCurrency.vue.d';
|
|
13
|
-
import {
|
|
14
|
-
import { InputrangeNumberLocaleConfig } from '../components/inputrangenumber/InputRangeNumber.vue.d';
|
|
15
|
-
import { DialogFormLocaleConfig } from '../components/dialogform/DialogForm.vue.d';
|
|
16
|
-
import { InputPhoneNumberLocaleConfig } from '../components/inputphonenumber/InputPhoneNumber.vue.d';
|
|
38
|
+
import { InputEmailProps } from '../components/inputemail/InputEmail.vue.d';
|
|
17
39
|
import { InputNumberLocaleConfig } from '../components/inputnumber/InputNumber.vue.d';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
40
|
+
import { InputPhoneNumberLocaleConfig } from '../components/inputphonenumber/InputPhoneNumber.vue.d';
|
|
41
|
+
import { InputrangeNumberLocaleConfig } from '../components/inputrangenumber/InputRangeNumber.vue.d';
|
|
42
|
+
import {
|
|
43
|
+
InputTextLocaleConfig,
|
|
44
|
+
InputTextProps,
|
|
45
|
+
} from '../components/inputtext/InputText.vue.d';
|
|
20
46
|
import { InputURLProps } from '../components/inputurl/InputURL.vue.d';
|
|
21
|
-
import { InputEmailProps } from '../components/inputemail/InputEmail.vue.d';
|
|
22
|
-
import { ImageProps } from '../components/image/Image.vue.d';
|
|
23
|
-
import { MenuLocaleConfig } from '../components/menu/Menu.vue.d';
|
|
24
|
-
import { ButtonBulkActionLocaleConfig, ButtonBulkActionProps } from '../components/buttonbulkaction/ButtonBulkAction.vue.d';
|
|
25
|
-
import { AnimationDefaultConfig } from '../components/animation/Animation.vue.d';
|
|
26
47
|
import { LoadingPresetOptions } from '../components/loading/Loading.vue.d';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
48
|
+
import { MenuLocaleConfig } from '../components/menu/Menu.vue.d';
|
|
49
|
+
import { MultiSelectLocaleConfig } from '../components/multiselect/MultiSelect.vue.d';
|
|
50
|
+
import { OverlayPanelPassThroughOptions } from '../components/overlaypanel/OverlayPanel.vue.d';
|
|
51
|
+
import { TagTypeProps } from '../components/tagtype/TagType.vue.d';
|
|
52
|
+
import { TextareaLocaleConfig } from '../components/textarea/Textarea.vue.d';
|
|
53
|
+
import { TreeProps } from '../components/tree/Tree.vue.d';
|
|
54
|
+
import {
|
|
55
|
+
UserNameComponentConfigs,
|
|
56
|
+
UserNameLocaleConfig,
|
|
57
|
+
UserNamePresetOptions,
|
|
58
|
+
} from '../components/username/UserName.vue.d';
|
|
59
|
+
import { type UseToastConfig } from '../utils/toast.util';
|
|
32
60
|
/**
|
|
33
61
|
* A Record of component names with theirs props interface
|
|
34
62
|
*/
|
|
35
63
|
export interface ComponentDefaultPropsConfig {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
64
|
+
FieldWrapper?: FieldWrapperProps;
|
|
65
|
+
InputText?: InputTextProps;
|
|
66
|
+
InputURL?: InputURLProps;
|
|
67
|
+
InputEmail?: InputEmailProps;
|
|
68
|
+
Tree?: TreeProps;
|
|
69
|
+
Image?: ImageProps;
|
|
70
|
+
ButtonBulkAction?: Omit<ButtonBulkActionProps, 'selectedData' | 'options'>;
|
|
71
|
+
Animation?: AnimationDefaultConfig;
|
|
72
|
+
DataTable?: Partial<DataTableProps>;
|
|
73
|
+
Badge?: Partial<BadgeComponentConfigs>;
|
|
74
|
+
UserName?: UserNameComponentConfigs;
|
|
75
|
+
Dropdown?: DropdownProps;
|
|
76
|
+
TagType?: Partial<TagTypeProps>;
|
|
77
|
+
ButtonDownload?: Partial<ButtonDownloadProps>;
|
|
48
78
|
}
|
|
49
79
|
interface ComponentLocaleConfig {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
FieldWrapper?: FieldWrapperLocaleConfig;
|
|
81
|
+
InputText?: InputTextLocaleConfig;
|
|
82
|
+
DialogConfirm?: DialogConfirmLocaleConfig;
|
|
83
|
+
CustomColumn?: CustomColumnLocaleConfig;
|
|
84
|
+
ButtonSearch?: ButtonSearchLocaleConfig;
|
|
85
|
+
FilterContainer?: FilterContainerLocaleConfig;
|
|
86
|
+
MultiSelect?: MultiSelectLocaleConfig;
|
|
87
|
+
Dropdown?: DropdownLocaleConfig;
|
|
88
|
+
InputCurrency?: InputCurrencyLocaleConfig;
|
|
89
|
+
TextArea?: TextareaLocaleConfig;
|
|
90
|
+
InputRangeNumber?: InputrangeNumberLocaleConfig;
|
|
91
|
+
DialogForm?: DialogFormLocaleConfig;
|
|
92
|
+
InputPhoneNumber?: InputPhoneNumberLocaleConfig;
|
|
93
|
+
InputNumber?: InputNumberLocaleConfig;
|
|
94
|
+
Calendar?: CalendarLocaleConfig;
|
|
95
|
+
Menu?: MenuLocaleConfig;
|
|
96
|
+
ButtonBulkAction?: ButtonBulkActionLocaleConfig;
|
|
97
|
+
UserName?: UserNameLocaleConfig;
|
|
98
|
+
DataTable?: DataTableLocaleConfig;
|
|
99
|
+
ImageCompressor?: ImageCompressorLocaleConfig;
|
|
100
|
+
ButtonDownload?: ButtonDownloadLocaleConfig;
|
|
70
101
|
}
|
|
71
102
|
export interface LocaleConfig {
|
|
72
|
-
|
|
73
|
-
|
|
103
|
+
global: Partial<typeof DEFAULT_GLOBAL_LOCALE_CONFIG>;
|
|
104
|
+
components: ComponentLocaleConfig;
|
|
74
105
|
}
|
|
75
106
|
export interface ComponentPresetOptions {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
107
|
+
calendar: CalendarPresetOptions;
|
|
108
|
+
overlaypanel: OverlayPanelPassThroughOptions;
|
|
109
|
+
loading: LoadingPresetOptions;
|
|
110
|
+
username: UserNamePresetOptions;
|
|
111
|
+
inputotp: InputOtpRawPreset;
|
|
112
|
+
tabmenu: TabMenuRawPreset;
|
|
113
|
+
[key: string]: any;
|
|
81
114
|
}
|
|
82
|
-
export type WangsVueComponentConfig<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
115
|
+
export type WangsVueComponentConfig<
|
|
116
|
+
ComponentName extends
|
|
117
|
+
| keyof ComponentDefaultPropsConfig
|
|
118
|
+
| keyof ComponentLocaleConfig,
|
|
119
|
+
> = {
|
|
120
|
+
defaultProps: ComponentName extends keyof ComponentDefaultPropsConfig
|
|
121
|
+
? ComponentDefaultPropsConfig[ComponentName]
|
|
122
|
+
: undefined;
|
|
123
|
+
locale: (ComponentName extends keyof ComponentLocaleConfig
|
|
124
|
+
? ComponentLocaleConfig[ComponentName]
|
|
125
|
+
: undefined) & {
|
|
126
|
+
global: LocaleConfig['global'];
|
|
127
|
+
};
|
|
87
128
|
};
|
|
88
129
|
export interface WangsVueOptions {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
130
|
+
defaultProps: ComponentDefaultPropsConfig;
|
|
131
|
+
locale: LocaleConfig;
|
|
132
|
+
useToastConfig?: UseToastConfig;
|
|
133
|
+
zIndex?: Record<string, number>;
|
|
134
|
+
filterMatchModeOptions?: Record<string, string[]>;
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated - partially replaced with {@link preset}
|
|
137
|
+
*/
|
|
138
|
+
pt?: ComponentPresetOptions;
|
|
139
|
+
preset?: ComponentPresetOptions;
|
|
140
|
+
ptOptions?: {
|
|
141
|
+
mergeSections: boolean;
|
|
142
|
+
mergeProps: boolean;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated - Will always be unstyled
|
|
146
|
+
*/
|
|
147
|
+
unstyled?: boolean;
|
|
148
|
+
csp?: {
|
|
149
|
+
nonce?: string;
|
|
150
|
+
};
|
|
110
151
|
}
|
|
111
152
|
export interface WangsVueInstance {
|
|
112
|
-
|
|
113
|
-
|
|
153
|
+
config: WangsVueOptions;
|
|
154
|
+
getComponentConfig<
|
|
155
|
+
ComponentName extends
|
|
156
|
+
| keyof ComponentDefaultPropsConfig
|
|
157
|
+
| keyof ComponentLocaleConfig,
|
|
158
|
+
>(
|
|
159
|
+
componentName: ComponentName,
|
|
160
|
+
): WangsVueComponentConfig<ComponentName>;
|
|
114
161
|
}
|
|
162
|
+
declare const DEFAULT_GLOBAL_LOCALE_CONFIG: {
|
|
163
|
+
startsWith: string;
|
|
164
|
+
contains: string;
|
|
165
|
+
notContains: string;
|
|
166
|
+
endsWith: string;
|
|
167
|
+
equals: string;
|
|
168
|
+
notEquals: string;
|
|
169
|
+
noFilter: string;
|
|
170
|
+
lt: string;
|
|
171
|
+
lte: string;
|
|
172
|
+
gt: string;
|
|
173
|
+
gte: string;
|
|
174
|
+
dateIs: string;
|
|
175
|
+
dateIsNot: string;
|
|
176
|
+
dateBefore: string;
|
|
177
|
+
dateAfter: string;
|
|
178
|
+
clear: string;
|
|
179
|
+
apply: string;
|
|
180
|
+
matchAll: string;
|
|
181
|
+
matchAny: string;
|
|
182
|
+
addRule: string;
|
|
183
|
+
removeRule: string;
|
|
184
|
+
accept: string;
|
|
185
|
+
reject: string;
|
|
186
|
+
choose: string;
|
|
187
|
+
upload: string;
|
|
188
|
+
cancel: string;
|
|
189
|
+
completed: string;
|
|
190
|
+
pending: string;
|
|
191
|
+
fileSizeTypes: string[];
|
|
192
|
+
monthNames: string[];
|
|
193
|
+
monthNamesShort: string[];
|
|
194
|
+
dayNames: string[];
|
|
195
|
+
dayNamesShort: string[];
|
|
196
|
+
dayNamesMin: string[];
|
|
197
|
+
chooseYear: string;
|
|
198
|
+
chooseMonth: string;
|
|
199
|
+
chooseDate: string;
|
|
200
|
+
prevDecade: string;
|
|
201
|
+
nextDecade: string;
|
|
202
|
+
prevYear: string;
|
|
203
|
+
nextYear: string;
|
|
204
|
+
prevMonth: string;
|
|
205
|
+
nextMonth: string;
|
|
206
|
+
prevHour: string;
|
|
207
|
+
nextHour: string;
|
|
208
|
+
prevMinute: string;
|
|
209
|
+
nextMinute: string;
|
|
210
|
+
prevSecond: string;
|
|
211
|
+
nextSecond: string;
|
|
212
|
+
pm: string;
|
|
213
|
+
am: string;
|
|
214
|
+
today: string;
|
|
215
|
+
weekHeader: string;
|
|
216
|
+
firstDayOfWeek: number;
|
|
217
|
+
showMonthAfterYear: boolean;
|
|
218
|
+
dateFormat: string;
|
|
219
|
+
weak: string;
|
|
220
|
+
medium: string;
|
|
221
|
+
strong: string;
|
|
222
|
+
passwordPrompt: string;
|
|
223
|
+
emptyFilterMessage: string;
|
|
224
|
+
searchMessage: string;
|
|
225
|
+
selectionMessage: string;
|
|
226
|
+
emptySelectionMessage: string;
|
|
227
|
+
emptySearchMessage: string;
|
|
228
|
+
emptyMessage: string;
|
|
229
|
+
aria: {
|
|
230
|
+
trueLabel: string;
|
|
231
|
+
falseLabel: string;
|
|
232
|
+
nullLabel: string;
|
|
233
|
+
star: string;
|
|
234
|
+
stars: string;
|
|
235
|
+
selectAll: string;
|
|
236
|
+
unselectAll: string;
|
|
237
|
+
close: string;
|
|
238
|
+
previous: string;
|
|
239
|
+
next: string;
|
|
240
|
+
navigation: string;
|
|
241
|
+
scrollTop: string;
|
|
242
|
+
moveTop: string;
|
|
243
|
+
moveUp: string;
|
|
244
|
+
moveDown: string;
|
|
245
|
+
moveBottom: string;
|
|
246
|
+
moveToTarget: string;
|
|
247
|
+
moveToSource: string;
|
|
248
|
+
moveAllToTarget: string;
|
|
249
|
+
moveAllToSource: string;
|
|
250
|
+
pageLabel: string;
|
|
251
|
+
firstPageLabel: string;
|
|
252
|
+
lastPageLabel: string;
|
|
253
|
+
nextPageLabel: string;
|
|
254
|
+
prevPageLabel: string;
|
|
255
|
+
rowsPerPageLabel: string;
|
|
256
|
+
jumpToPageDropdownLabel: string;
|
|
257
|
+
jumpToPageInputLabel: string;
|
|
258
|
+
selectRow: string;
|
|
259
|
+
unselectRow: string;
|
|
260
|
+
expandRow: string;
|
|
261
|
+
collapseRow: string;
|
|
262
|
+
showFilterMenu: string;
|
|
263
|
+
hideFilterMenu: string;
|
|
264
|
+
filterOperator: string;
|
|
265
|
+
filterConstraint: string;
|
|
266
|
+
editRow: string;
|
|
267
|
+
saveEdit: string;
|
|
268
|
+
cancelEdit: string;
|
|
269
|
+
listView: string;
|
|
270
|
+
gridView: string;
|
|
271
|
+
slide: string;
|
|
272
|
+
slideNumber: string;
|
|
273
|
+
zoomImage: string;
|
|
274
|
+
zoomIn: string;
|
|
275
|
+
zoomOut: string;
|
|
276
|
+
rotateRight: string;
|
|
277
|
+
rotateLeft: string;
|
|
278
|
+
listLabel: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
115
281
|
export declare const defaultOptions: WangsVueOptions;
|
|
116
|
-
export declare const useWangsVueConfig: <
|
|
117
|
-
|
|
282
|
+
export declare const useWangsVueConfig: <
|
|
283
|
+
T extends
|
|
284
|
+
| (keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig)
|
|
285
|
+
| undefined,
|
|
286
|
+
>(
|
|
287
|
+
componentName?: T,
|
|
288
|
+
) => T extends keyof ComponentDefaultPropsConfig | keyof ComponentLocaleConfig
|
|
289
|
+
? WangsVueComponentConfig<T>
|
|
290
|
+
: WangsVueOptions;
|
|
291
|
+
export declare const mergeWangsVueConfig: (
|
|
292
|
+
baseConfig: WangsVueOptions,
|
|
293
|
+
overrideConfig: Partial<WangsVueOptions>,
|
|
294
|
+
) => WangsVueOptions;
|
|
118
295
|
/**
|
|
119
296
|
*
|
|
120
297
|
* @param predefinedOptions
|
|
121
298
|
* @param mergeConfig Wether merge predefined config with defualt config @default true
|
|
122
299
|
* @returns
|
|
123
300
|
*/
|
|
124
|
-
declare const createWangsVuePlugin: (
|
|
301
|
+
declare const createWangsVuePlugin: (
|
|
302
|
+
predefinedOptions?: Partial<WangsVueOptions>,
|
|
303
|
+
mergeConfig?: boolean,
|
|
304
|
+
) => Plugin<Partial<WangsVueOptions>>;
|
|
125
305
|
export default createWangsVuePlugin;
|
|
126
306
|
declare module 'vue' {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
307
|
+
interface ComponentCustomProperties {
|
|
308
|
+
$wangsvue: WangsVueInstance;
|
|
309
|
+
$preset: ComponentPresetOptions;
|
|
310
|
+
}
|
|
131
311
|
}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FieldContext,
|
|
3
|
+
FieldOptions,
|
|
4
|
+
FormContext as VeeFormContext,
|
|
5
|
+
RuleExpression,
|
|
6
|
+
} from 'vee-validate';
|
|
1
7
|
import { MaybeRef, MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { FormContext as VeeFormContext, FieldContext, RuleExpression, FieldOptions } from 'vee-validate';
|
|
3
8
|
export interface FormContext<T> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
values: T;
|
|
10
|
+
handleSubmit: VeeFormContext['handleSubmit'];
|
|
11
|
+
setValues: VeeFormContext['setValues'];
|
|
12
|
+
setFieldValue: VeeFormContext['setFieldValue'];
|
|
13
|
+
errors: VeeFormContext['errors'];
|
|
8
14
|
}
|
|
9
15
|
export declare const useForm: <T>() => FormContext<T>;
|
|
10
|
-
export declare const useField: <T>(
|
|
16
|
+
export declare const useField: <T>(
|
|
17
|
+
path: MaybeRefOrGetter<string>,
|
|
18
|
+
rules?: MaybeRef<RuleExpression<T>>,
|
|
19
|
+
opts?: Partial<FieldOptions<T>>,
|
|
20
|
+
) => FieldContext<T>;
|