@fewangsit/wangsvue-fats 1.0.0-alpha.0
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 +32 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/assetinfo/AssetInfo.vue.d.ts +44 -0
- package/components/badge/Badge.vue.d.ts +73 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +54 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +596 -0
- package/components/basetree/TreeNode.vue.d.ts +35 -0
- package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
- package/components/button/Button.vue.d.ts +189 -0
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
- package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +105 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +80 -0
- package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +258 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +202 -0
- package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +201 -0
- package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +19 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/Calendar.vue.d.ts +598 -0
- package/components/card/Card.vue.d.ts +140 -0
- package/components/carousel/Carousel.vue.d.ts +28 -0
- package/components/checkbox/Checkbox.vue.d.ts +330 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
- package/components/datatable/DataTable.vue.d.ts +745 -0
- package/components/datepicker/DatePicker.vue.d.ts +52 -0
- package/components/daypicker/DayPicker.vue.d.ts +52 -0
- package/components/dialog/Dialog.vue.d.ts +465 -0
- 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 +165 -0
- package/components/dialogform/DialogForm.vue.d.ts +350 -0
- 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 +137 -0
- 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 +288 -0
- package/components/editor/Editor.vue.d.ts +192 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +86 -0
- package/components/fileupload/FileUpload.vue.d.ts +170 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +217 -0
- package/components/form/Form.vue.d.ts +319 -0
- package/components/icon/Icon.vue.d.ts +260 -0
- package/components/image/Image.vue.d.ts +411 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +237 -0
- package/components/index.d.ts +83 -0
- package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
- package/components/inputbadge/InputBadge.vue.d.ts +122 -0
- package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
- package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
- package/components/inputemail/InputEmail.vue.d.ts +26 -0
- package/components/inputnumber/InputNumber.vue.d.ts +288 -0
- package/components/inputotp/InputOtp.vue.d.ts +3 -0
- package/components/inputpassword/InputPassword.vue.d.ts +33 -0
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +121 -0
- package/components/inputsearch/InputSearch.vue.d.ts +36 -0
- package/components/inputtext/InputText.vue.d.ts +353 -0
- package/components/inputurl/InputURL.vue.d.ts +41 -0
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +33 -0
- package/components/languageswitcher/LanguageSwitcher.vue.d.ts +15 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +98 -0
- package/components/loading/Loading.vue.d.ts +47 -0
- package/components/loading/store/loading.store.d.ts +8 -0
- package/components/menu/Menu.vue.d.ts +391 -0
- package/components/menuitem/index.d.ts +106 -0
- package/components/multiselect/MultiSelect.vue.d.ts +195 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +302 -0
- package/components/paginator/Paginator.vue.d.ts +285 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/steps/Steps.vue.d.ts +20 -0
- package/components/tabmenu/TabMenu.vue.d.ts +104 -0
- package/components/tagtype/TagType.vue.d.ts +26 -0
- package/components/textarea/Textarea.vue.d.ts +171 -0
- package/components/timeline/Timeline.vue.d.ts +140 -0
- package/components/toast/Toast.vue.d.ts +368 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +282 -0
- package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
- package/components/tree/Tree.vue.d.ts +151 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +91 -0
- package/components/username/UserName.vue.d.ts +123 -0
- package/components/userwithicon/UserWithIcon.vue.d.ts +21 -0
- package/components/validatormessage/ValidatorMessage.vue.d.ts +12 -0
- package/config/defaultProps.d.ts +3 -0
- package/config/index.d.ts +3 -0
- package/config/locale.d.ts +3 -0
- package/directives/focus.d.ts +7 -0
- package/directives/index.d.ts +1 -0
- package/event-bus/index.d.ts +66 -0
- package/event-bus/mitt.d.ts +41 -0
- package/loading-page-BrQattYE.js +1 -0
- package/loading-page-CgfbWppy.js +1 -0
- package/loading-page-CoC9UhfC.js +4 -0
- package/loading-page-CoXtqoc9.js +4 -0
- package/loading-page-DbLuqCHa.js +1 -0
- package/loading-page-f8D03l3G.js +4 -0
- package/loading-plane-CgfbWppy.js +1 -0
- package/loading-plane-CoXtqoc9.js +4 -0
- package/loading-table-Bdr9ZhtP.js +1 -0
- package/loading-table-ByUoWqUo.js +4 -0
- package/loading-table-BygEMzFM.js +4 -0
- package/loading-table-BzrSQlA0.js +1 -0
- package/loading-table-D9bw9OcI.js +4 -0
- package/loading-table-chOgXi94.js +1 -0
- package/main.d.ts +34 -0
- package/no-data-CTKux8RI.js +4 -0
- package/no-data-Cgze_Rvp.js +1 -0
- package/no-data-DLHO1L_u.js +4 -0
- package/no-data-Dep79CBh.js +1 -0
- package/no-data-g0dJCy2p.js +4 -0
- package/no-data-y1X5WtcQ.js +1 -0
- package/package.json +27 -0
- package/plugins/VueHtmlToPaper.d.ts +11 -0
- package/plugins/WangsVue.d.ts +311 -0
- package/plugins/formValidation.d.ts +20 -0
- package/plugins/i18n-extension.d.ts +4 -0
- package/plugins/i18n.d.ts +103 -0
- package/stats.html +4949 -0
- package/style.css +1 -0
- package/utils/date.util.d.ts +79 -0
- package/utils/exportToExcel.util.d.ts +27 -0
- package/utils/formatTagCode.util.d.ts +1 -0
- package/utils/getStatusSeverity.util.d.ts +33 -0
- package/utils/index.d.ts +9 -0
- package/utils/isBasic.util.d.ts +1 -0
- package/utils/listenSidebarChanges.util.d.ts +16 -0
- package/utils/object.util.d.ts +27 -0
- package/utils/role.util.d.ts +70 -0
- package/utils/toast.util.d.ts +120 -0
- package/utils/xlsx.util.d.ts +19 -0
- package/wangsvue-fats.js +57238 -0
- package/wangsvue-fats.system.js +427 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { EditorEvents } from '@tiptap/vue-3';
|
|
2
|
+
|
|
3
|
+
import { ClassComponent } from '../ts-helpers';
|
|
4
|
+
|
|
5
|
+
export interface EditorProps {
|
|
6
|
+
/**
|
|
7
|
+
* Model Value For Editor Content
|
|
8
|
+
*/
|
|
9
|
+
modelValue?: JSONContent;
|
|
10
|
+
/**
|
|
11
|
+
* Model Value For Editor Content
|
|
12
|
+
*/
|
|
13
|
+
initialValue?: JSONContent;
|
|
14
|
+
/**
|
|
15
|
+
* Specify the input placeholder.
|
|
16
|
+
*/
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Determine Editor State Readonly / Editable.
|
|
20
|
+
* @default 'editable'
|
|
21
|
+
*/
|
|
22
|
+
editorState?: EditorState;
|
|
23
|
+
/**
|
|
24
|
+
* Change Editor Border Content.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
borderLess?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The input label. Tell the user what input is this.
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Wether the input should be validated with vee-validator or not.
|
|
34
|
+
* If you use this component within form input, you need to set this props as true.
|
|
35
|
+
*/
|
|
36
|
+
useValidator?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* This prop is required if you use this component in a form input.
|
|
39
|
+
* Specify the unique field name, match with your needs for API request.
|
|
40
|
+
*
|
|
41
|
+
* @default 'editorInput'
|
|
42
|
+
*/
|
|
43
|
+
fieldName?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Specify classes for label.
|
|
46
|
+
*/
|
|
47
|
+
labelClass?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Show information to user about the field.
|
|
50
|
+
*/
|
|
51
|
+
fieldInfo?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Classes for validator message in input field.
|
|
54
|
+
*/
|
|
55
|
+
validatorMessageClass?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Set custom validator message.
|
|
58
|
+
* Will be show if invalid="true"
|
|
59
|
+
*/
|
|
60
|
+
validatorMessage?: string | { empty: string };
|
|
61
|
+
/**
|
|
62
|
+
* Wether this input field is required or not.
|
|
63
|
+
*/
|
|
64
|
+
mandatory?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Invalid input state.
|
|
67
|
+
*/
|
|
68
|
+
invalid?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Showing Optional value text on Label.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
showOptionalText?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Determine for image upload from local machine if value is true, no need to use postImageLocal emitter
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
isImageUploadBase64?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Fetch function for mention this will get triger if putting @ in editor
|
|
81
|
+
*/
|
|
82
|
+
fetchMentionSuggestionFunction?: () => Promise<
|
|
83
|
+
GetMentionSuggestionResponse | undefined
|
|
84
|
+
>;
|
|
85
|
+
/**
|
|
86
|
+
* Getting all mentioned list
|
|
87
|
+
*/
|
|
88
|
+
mentionedList?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Add custom class tailwind for editor wrapper/container
|
|
91
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
92
|
+
*/
|
|
93
|
+
editorWrapperClass?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Add custom class tailwind for editor toolbar wrapper/container
|
|
96
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
97
|
+
*/
|
|
98
|
+
toolbarWrapperClass?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Add custom class tailwind for editor content wrapper/container
|
|
101
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
102
|
+
*/
|
|
103
|
+
contentWrapperClass?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type EditorEmits = {
|
|
107
|
+
/**
|
|
108
|
+
* Event emitted when the model value is updated
|
|
109
|
+
*/
|
|
110
|
+
'update:modelValue': [value: JSONContent];
|
|
111
|
+
/**
|
|
112
|
+
* Event emitted when try to upload image from local machine,
|
|
113
|
+
* and need to send file image to server first using value.image params and then
|
|
114
|
+
* get back image url that already get hosted.
|
|
115
|
+
* to set the image url back to editor to be show up simply using value.setImageCb from params
|
|
116
|
+
*/
|
|
117
|
+
'postImageLocal': [value: PostImage];
|
|
118
|
+
/**
|
|
119
|
+
* Event emitted when button in floating menu named :(unset image) is clicked,
|
|
120
|
+
* but this only get triger if selected image get set by postImageLocal function
|
|
121
|
+
*/
|
|
122
|
+
'deleteImageLocal': [value: ImageProperties];
|
|
123
|
+
/**
|
|
124
|
+
* Event emitted when the editor is blurred
|
|
125
|
+
*/
|
|
126
|
+
'blur': [value: EditorEvents['blur']];
|
|
127
|
+
/**
|
|
128
|
+
* Event emitted when the editor is focused
|
|
129
|
+
*/
|
|
130
|
+
'focus': [value: EditorEvents['focus']];
|
|
131
|
+
/**
|
|
132
|
+
* Emited Everytime mentioned user in editor change
|
|
133
|
+
*/
|
|
134
|
+
'update:mentionedList': [value: string[]];
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export type PostImage = {
|
|
138
|
+
/**
|
|
139
|
+
* This Is Image File that should be send to server
|
|
140
|
+
*/
|
|
141
|
+
image: File;
|
|
142
|
+
/**
|
|
143
|
+
* Set Image Cb Is Callback For setting back image url that get send back
|
|
144
|
+
* from server through response
|
|
145
|
+
*/
|
|
146
|
+
setImageCb: (imageUrl: string) => void;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Editor Content Meta Data
|
|
151
|
+
*/
|
|
152
|
+
export type JSONContent = {
|
|
153
|
+
type?: string;
|
|
154
|
+
attrs?: Record<string, any>;
|
|
155
|
+
content?: JSONContent[];
|
|
156
|
+
marks?: {
|
|
157
|
+
type: string;
|
|
158
|
+
attrs?: Record<string, any>;
|
|
159
|
+
[key: string]: any;
|
|
160
|
+
}[];
|
|
161
|
+
text?: string;
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export type ImageProperties = {
|
|
166
|
+
alt?: string;
|
|
167
|
+
src: string;
|
|
168
|
+
title: string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type GetMentionSuggestionResponse = {
|
|
172
|
+
status: number;
|
|
173
|
+
message: string;
|
|
174
|
+
data: MentionSuggestion[];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export type MentionSuggestion = {
|
|
178
|
+
_id: string;
|
|
179
|
+
fullName: string;
|
|
180
|
+
nickName: string;
|
|
181
|
+
profilePicture: string;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export type EditorState = 'editable' | 'readonly';
|
|
185
|
+
|
|
186
|
+
declare class Editor extends ClassComponent<
|
|
187
|
+
EditorProps,
|
|
188
|
+
unknown,
|
|
189
|
+
EditorEmits
|
|
190
|
+
> {}
|
|
191
|
+
|
|
192
|
+
export default Editor;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Slot } from 'vue';
|
|
2
|
+
|
|
3
|
+
import { ClassComponent } from '../ts-helpers';
|
|
4
|
+
|
|
5
|
+
export interface FieldWrapperLocaleConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The indicator for mandatory field.
|
|
8
|
+
* @default '*''
|
|
9
|
+
*/
|
|
10
|
+
labelRequired?: string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The indicator for optional field.
|
|
14
|
+
* @default '(optional)''
|
|
15
|
+
*/
|
|
16
|
+
labelOptional?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Props for the FieldWrapper component.
|
|
21
|
+
*/
|
|
22
|
+
export interface FieldWrapperProps {
|
|
23
|
+
/**
|
|
24
|
+
* The label text to display for the field.
|
|
25
|
+
* @default undefined
|
|
26
|
+
*/
|
|
27
|
+
label?: string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Indicates whether the field is mandatory (required).
|
|
31
|
+
* If `true`, this may trigger the display of a required indicator.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
mandatory?: boolean;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* When `true`, displays an "(optional)" text next to the label if the field is not mandatory.
|
|
38
|
+
*/
|
|
39
|
+
showOptionalText?: boolean;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* When `true`, displays an asterisk (`*`) next to the label if the field is mandatory.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
showAsterisk?: boolean;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Additional information or description for the field.
|
|
49
|
+
* Can be used to display tooltips or inline helper text.
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
info?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Custom CSS class to apply to the label element.
|
|
56
|
+
* Useful for styling the label specifically.
|
|
57
|
+
* @default undefined
|
|
58
|
+
*/
|
|
59
|
+
labelClass?: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Position of the tooltip, if one is displayed.
|
|
63
|
+
* Accepted values are `'top'`, `'right'`, `'bottom'`, and `'left'`.
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
tooltipPos?: 'top' | 'right' | 'bottom' | 'left';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface FieldWrapperSlots {
|
|
70
|
+
'label-addon': Slot;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare class FieldWrapper extends ClassComponent<
|
|
74
|
+
FieldWrapperProps,
|
|
75
|
+
FieldWrapperSlots,
|
|
76
|
+
unknown
|
|
77
|
+
> {}
|
|
78
|
+
|
|
79
|
+
export type FieldWrapperEmits = {
|
|
80
|
+
/**
|
|
81
|
+
* Emitted when the information (tooltip) is clicked.
|
|
82
|
+
*/
|
|
83
|
+
infoClick: [];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default FieldWrapper;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileUploadErrorEvent,
|
|
3
|
+
FileUploadUploadEvent,
|
|
4
|
+
} from 'primevue/fileupload';
|
|
5
|
+
|
|
6
|
+
import { CustomValidation } from '../form/Form.vue.d';
|
|
7
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
8
|
+
|
|
9
|
+
export type InputErrorCodes = 'FILE_SIZE_TOO_LARGE';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Defines valid properties in FileUpload component.
|
|
13
|
+
*/
|
|
14
|
+
export type FileUploadProps = {
|
|
15
|
+
/**
|
|
16
|
+
* Pattern to restrict the allowed file types such as 'image/*'.
|
|
17
|
+
*/
|
|
18
|
+
accept?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Disables the upload functionality.
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum file size allowed in bytes.
|
|
26
|
+
*/
|
|
27
|
+
maxFileSize?: number | undefined;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* V-model for the file upload component.
|
|
31
|
+
* Be careful while using this props since the validation can't work while using this.
|
|
32
|
+
* You must do manual validation when choosing the file to be set on the component.
|
|
33
|
+
*/
|
|
34
|
+
modelValue?: File | File[];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Props to determine whether file upload support multiple files or not
|
|
38
|
+
*
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Message of the invalid fize size.
|
|
44
|
+
* - Use {0} to get the file's name
|
|
45
|
+
* - Use {1} to get the max file size
|
|
46
|
+
* - Use {2} to get the accepted file types from props.accept
|
|
47
|
+
* - Use {2.1} to get the accepted file types from props.fileExtensions
|
|
48
|
+
* @defaultValue {0}: Invalid file size, file size should be smaller than {1}.
|
|
49
|
+
*/
|
|
50
|
+
invalidFileSizeMessage?: string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* Message of the invalid fize type.
|
|
53
|
+
* - Use {0} to get the file's name
|
|
54
|
+
* - Use {1} to get the max file size
|
|
55
|
+
* - Use {2} to get the accepted file types
|
|
56
|
+
* - Use {2.1} to get the accepted file types from props.fileExtensions
|
|
57
|
+
* @defaultValue '{0}: Invalid file type, allowed file types: {2}'
|
|
58
|
+
*/
|
|
59
|
+
invalidFileTypeMessage?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Label of the file upload.
|
|
62
|
+
* @defaultValue 'Upload File'
|
|
63
|
+
*/
|
|
64
|
+
label?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Whether to use an upload button.
|
|
67
|
+
* @defaultValue true
|
|
68
|
+
*/
|
|
69
|
+
withUpload?: boolean | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Label of the upload button.
|
|
72
|
+
* @defaultValue 'Upload'.
|
|
73
|
+
*/
|
|
74
|
+
uploadLabel?: string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Placeholder of the file upload.
|
|
77
|
+
* @defaultValue 'Select File'
|
|
78
|
+
*/
|
|
79
|
+
placeholder?: string | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* File extensions to display the accepted extensions.
|
|
82
|
+
*/
|
|
83
|
+
fileExtensions?: string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The note about the requirements of file for being uploaded.
|
|
86
|
+
*
|
|
87
|
+
* Placed at the bottom right of input.
|
|
88
|
+
*/
|
|
89
|
+
fileRequirements?: string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* The function to be called after the upload button is clicked. (Must be used when withUpload is true)
|
|
92
|
+
*/
|
|
93
|
+
uploadFunction?: (files: File[]) => Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Whether the input should be validated with vee-validator or not.
|
|
96
|
+
* If you use this component within form input, you need to set this props as true.
|
|
97
|
+
*/
|
|
98
|
+
useValidator?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* This prop is required if you use this component in a form input.
|
|
101
|
+
* Specify the unique field name, match with your needs for API request.
|
|
102
|
+
*
|
|
103
|
+
* @default 'fileUpload'
|
|
104
|
+
*/
|
|
105
|
+
fieldName?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Whether this input field is required or not.
|
|
108
|
+
*/
|
|
109
|
+
mandatory?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Whether show toast error message on invalid file input
|
|
112
|
+
*
|
|
113
|
+
* @default true;
|
|
114
|
+
*/
|
|
115
|
+
useErrorToast?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Set custom validator message.
|
|
118
|
+
* Will be show if invalid="true"
|
|
119
|
+
*/
|
|
120
|
+
validatorMessage?: string | CustomValidation;
|
|
121
|
+
/**
|
|
122
|
+
* Classes for validator message in input field.
|
|
123
|
+
*/
|
|
124
|
+
validatorMessageClass?: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type FileUploadEmits = {
|
|
128
|
+
/**
|
|
129
|
+
* Callback to invoke when there is a file selected.
|
|
130
|
+
*/
|
|
131
|
+
'select': [event: File | File[]];
|
|
132
|
+
/**
|
|
133
|
+
* Callback to invoke when model changed.
|
|
134
|
+
*/
|
|
135
|
+
'update:modelValue': [event: File | File[]];
|
|
136
|
+
/**
|
|
137
|
+
* Callback to invoke when file upload is complete.
|
|
138
|
+
*/
|
|
139
|
+
'upload': [event: FileUploadUploadEvent];
|
|
140
|
+
/**
|
|
141
|
+
* Callback to invoke if file upload fails.
|
|
142
|
+
*/
|
|
143
|
+
'error': [event: FileUploadErrorEvent | InputErrorCodes];
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* **WangsVue - FileUpload**
|
|
148
|
+
*
|
|
149
|
+
* _FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations._
|
|
150
|
+
*
|
|
151
|
+
* [Live Demo](https://fewangsit.github.io/wangsvue/button)
|
|
152
|
+
* --- ---
|
|
153
|
+
* 
|
|
154
|
+
*
|
|
155
|
+
* @group Component
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
declare class FileUpload extends ClassComponent<
|
|
159
|
+
FileUploadProps,
|
|
160
|
+
null,
|
|
161
|
+
FileUploadEmits
|
|
162
|
+
> {}
|
|
163
|
+
|
|
164
|
+
declare module '@vue/runtime-core' {
|
|
165
|
+
interface GlobalComponents {
|
|
166
|
+
FileUpload: GlobalComponentConstructor<FileUpload>;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export default FileUpload;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import { DefineComponent, Slot } from 'vue';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
DropdownProps,
|
|
6
|
+
Option,
|
|
7
|
+
} from '../../components/dropdown/Dropdown.vue.d';
|
|
8
|
+
|
|
9
|
+
import { ButtonSelectTreeProps } from '../buttonselecttree/ButtonSelectTree.vue.d';
|
|
10
|
+
import { CalendarProps } from '../calendar/Calendar.vue.d';
|
|
11
|
+
import { QueryParams } from '../datatable/DataTable.vue.d';
|
|
12
|
+
import { InputRangeNumberProps } from '../inputrangenumber/InputRangeNumber.vue.d';
|
|
13
|
+
import { MultiSelectProps } from '../multiselect/MultiSelect.vue.d';
|
|
14
|
+
import { StringKeyOf, TypeError } from '../ts-helpers';
|
|
15
|
+
|
|
16
|
+
export type FilterMatchMode =
|
|
17
|
+
| 'CONTAINS'
|
|
18
|
+
| 'EQUALS'
|
|
19
|
+
| 'NOT_EQUALS'
|
|
20
|
+
| 'IN'
|
|
21
|
+
| 'LESS_THAN'
|
|
22
|
+
| 'LESS_THAN_OR_EQUAL_TO'
|
|
23
|
+
| 'GREATER_THAN'
|
|
24
|
+
| 'GREATER_THAN_OR_EQUAL_TO'
|
|
25
|
+
| 'BETWEEN'
|
|
26
|
+
| 'DATE_BETWEEN';
|
|
27
|
+
|
|
28
|
+
type BaseSelectField<OptionsQueryParams extends QueryParams> = {
|
|
29
|
+
/**
|
|
30
|
+
* Represents a function type for fetching options based on query parameters.
|
|
31
|
+
*
|
|
32
|
+
* @template T - The type of query parameters, extending `QueryParams`. Defaults to `any`.
|
|
33
|
+
*
|
|
34
|
+
* This function can have one of the following signatures:
|
|
35
|
+
* - A synchronous function that takes query parameters and returns an array of `Option` objects.
|
|
36
|
+
* - An asynchronous function that takes query parameters and returns a `Promise` resolving to an array of `Option` objects.
|
|
37
|
+
* - An asynchronous function that takes query parameters and returns a `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
|
|
38
|
+
*
|
|
39
|
+
* @param args - The query parameters of type `T` used to fetch the options.
|
|
40
|
+
* @returns One of the following:
|
|
41
|
+
* - An array of `Option` objects.
|
|
42
|
+
* - A `Promise` resolving to an array of `Option` objects.
|
|
43
|
+
* - A `Promise` resolving to an `AxiosResponse` containing a `FetchOptionResponse` object.
|
|
44
|
+
*/
|
|
45
|
+
fetchOptionFn?(
|
|
46
|
+
args: OptionsQueryParams,
|
|
47
|
+
): Option[] | Promise<Option[]> | Promise<AxiosResponse<FetchOptionResponse>>;
|
|
48
|
+
|
|
49
|
+
optionField?: keyof OptionsQueryParams; // @example - actionOptions
|
|
50
|
+
params?: OptionsQueryParams; // Additional QueryParams for the fetchOptionFn
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface MultiSelectFilterField<OptionsQueryParams extends QueryParams>
|
|
54
|
+
extends BaseSelectField<OptionsQueryParams>,
|
|
55
|
+
MultiSelectProps {
|
|
56
|
+
type: 'multiselect';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface DropdownFilterField<OptionsQueryParams extends QueryParams>
|
|
60
|
+
extends BaseSelectField<OptionsQueryParams>,
|
|
61
|
+
DropdownProps {
|
|
62
|
+
type: 'dropdown';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type RangeNumberFilterField<Field extends string> =
|
|
66
|
+
| (InputRangeNumberProps & {
|
|
67
|
+
type: 'rangenumber';
|
|
68
|
+
/**
|
|
69
|
+
* Specify min and max field
|
|
70
|
+
*
|
|
71
|
+
* @example ['minAge', 'maxAge']
|
|
72
|
+
*/
|
|
73
|
+
fields: [Field, Field];
|
|
74
|
+
field?: TypeError<'`field` must not be specified when using `fields` property'>;
|
|
75
|
+
tooltip?: string;
|
|
76
|
+
})
|
|
77
|
+
| (InputRangeNumberProps & {
|
|
78
|
+
type: 'rangenumber';
|
|
79
|
+
/**
|
|
80
|
+
* Specify single field for both min and max input.
|
|
81
|
+
* The value will be a number array.
|
|
82
|
+
*
|
|
83
|
+
* Prefer using this property when working with Static Filtering
|
|
84
|
+
*
|
|
85
|
+
* @example value: [1000, 5000] or equivalent to 'value.0': 1000 & 'value.1': 5000
|
|
86
|
+
*/
|
|
87
|
+
field: Field;
|
|
88
|
+
fields?: TypeError<'`fields` must not be specified when using `field` property'>;
|
|
89
|
+
tooltip?: string;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export interface ButtonSelectTreeFilterField<
|
|
93
|
+
Field extends string,
|
|
94
|
+
Params = QueryParams,
|
|
95
|
+
> extends Omit<ButtonSelectTreeProps, 'type' | 'label' | 'fieldLabel'> {
|
|
96
|
+
type: 'group' | 'category';
|
|
97
|
+
field: Field; // The name of the field this filter applies to
|
|
98
|
+
/**
|
|
99
|
+
* The field label.
|
|
100
|
+
*/
|
|
101
|
+
label?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The button label.
|
|
104
|
+
* @default to Select Group|Category
|
|
105
|
+
*/
|
|
106
|
+
buttonLabel?: string;
|
|
107
|
+
params?: Params; // Override QueryParams for the fetchTree
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface CalendarFilterField extends CalendarProps {
|
|
111
|
+
type: 'calendar';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type AdditionalFilterField<Field extends string = string> =
|
|
115
|
+
ButtonSelectTreeFilterField<Field>;
|
|
116
|
+
|
|
117
|
+
export type BaseFilterField<Params extends QueryParams = QueryParams> = {
|
|
118
|
+
/**
|
|
119
|
+
* Filter field visibility
|
|
120
|
+
*
|
|
121
|
+
* You dont need manually filter, this component already handle it.
|
|
122
|
+
*/
|
|
123
|
+
visible?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* The name of the field this filter applies to.
|
|
126
|
+
*
|
|
127
|
+
* When using a static filter, it also specifies the field in the data to be used for generating unique options.
|
|
128
|
+
* For example, if filtering by a user's full name, the field could be 'user.fullName', which will extract
|
|
129
|
+
* unique full names from the table data and use them as filter options.
|
|
130
|
+
*/
|
|
131
|
+
field: keyof Params;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export type FilterField<
|
|
135
|
+
Params extends QueryParams = QueryParams,
|
|
136
|
+
OptionsQueryParams extends QueryParams = QueryParams,
|
|
137
|
+
> =
|
|
138
|
+
| (BaseFilterField<Params> &
|
|
139
|
+
(
|
|
140
|
+
| AdditionalFilterField<StringKeyOf<Params>>
|
|
141
|
+
| MultiSelectFilterField<OptionsQueryParams>
|
|
142
|
+
| DropdownFilterField<OptionsQueryParams>
|
|
143
|
+
| CalendarFilterField
|
|
144
|
+
))
|
|
145
|
+
| (Omit<BaseFilterField<Params>, 'field'> &
|
|
146
|
+
RangeNumberFilterField<StringKeyOf<Params>>);
|
|
147
|
+
|
|
148
|
+
export type FilterOptions<Opt = Record<string, boolean>> = Record<
|
|
149
|
+
keyof Opt,
|
|
150
|
+
Option[]
|
|
151
|
+
>;
|
|
152
|
+
|
|
153
|
+
export type LoadingFilters = Record<string, boolean>;
|
|
154
|
+
|
|
155
|
+
export type FetchOptionResponse<Opt = Record<string, boolean>> = {
|
|
156
|
+
message: string;
|
|
157
|
+
data: FilterOptions<Opt>;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export interface FilterContainerLocaleConfig {
|
|
161
|
+
clearFieldText?: string;
|
|
162
|
+
applyText?: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface FilterContainerProps {
|
|
166
|
+
/**
|
|
167
|
+
* Specify the table name integrated with this filter.
|
|
168
|
+
*
|
|
169
|
+
* @default datatable - the default table name
|
|
170
|
+
*/
|
|
171
|
+
tableName?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Set the fields count in a row
|
|
174
|
+
*
|
|
175
|
+
* @default 4 grid columns
|
|
176
|
+
*/
|
|
177
|
+
fieldsPerRow?: number;
|
|
178
|
+
fields: FilterField[];
|
|
179
|
+
/**
|
|
180
|
+
* Enable static filtering
|
|
181
|
+
*/
|
|
182
|
+
static?: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Slots for FilterContainer component
|
|
187
|
+
*/
|
|
188
|
+
export type FilterContainerSlots = {
|
|
189
|
+
/**
|
|
190
|
+
* Additional template for field.
|
|
191
|
+
*/
|
|
192
|
+
field: Slot<{ field: AdditionalFilterField; fieldName: string }>;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export type FilterContainerEmits = {
|
|
196
|
+
apply: [filter: QueryParams];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* **WangsVue - FilterContainer**
|
|
201
|
+
*
|
|
202
|
+
* _FilterContainer is a component for generating a dynamic grid-based layout for any count of filter fields.
|
|
203
|
+
* It calculates the number of children in the container and sets their grid area style dynamically.
|
|
204
|
+
*
|
|
205
|
+
* The grid layout is determined by the row and column position, which are incremented based on the child count.
|
|
206
|
+
* If the child count is odd and the child is the last one (which is Buttons Action),
|
|
207
|
+
* it is placed in the 4th column._
|
|
208
|
+
*
|
|
209
|
+
* @group components
|
|
210
|
+
*/
|
|
211
|
+
declare const FilterContainer: DefineComponent<
|
|
212
|
+
FilterContainerProps,
|
|
213
|
+
FilterContainerEmits,
|
|
214
|
+
FilterContainerSlots
|
|
215
|
+
>;
|
|
216
|
+
|
|
217
|
+
export default FilterContainer;
|