@fewangsit/wangsvue-fats 1.0.0-alpha.31 → 1.0.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/animation/Animation.vue.d.ts +24 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/assetinfo/AssetInfo.vue.d.ts +34 -0
- package/components/badge/Badge.vue.d.ts +73 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +52 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +591 -0
- package/components/basetree/TreeNode.vue.d.ts +35 -0
- package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
- package/components/button/Button.vue.d.ts +188 -0
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +104 -0
- package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
- package/components/buttondownload/ButtonDownload.vue.d.ts +49 -0
- package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
- package/components/buttonradio/ButtonRadio.vue.d.ts +257 -0
- package/components/buttonscan/ButtonScan.vue.d.ts +201 -0
- package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +200 -0
- package/components/buttonsplit/ButtonSplit.vue.d.ts +350 -0
- package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +18 -0
- package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
- package/components/calendar/Calendar.vue.d.ts +570 -0
- package/components/card/Card.vue.d.ts +139 -0
- package/components/checkbox/Checkbox.vue.d.ts +329 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
- package/components/datatable/DataTable.vue.d.ts +735 -0
- package/components/dialog/Dialog.vue.d.ts +464 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +164 -0
- package/components/dialogform/DialogForm.vue.d.ts +349 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +136 -0
- package/components/dropdown/Dropdown.vue.d.ts +274 -0
- package/components/editor/Editor.vue.d.ts +191 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +69 -0
- package/components/fileupload/FileUpload.vue.d.ts +169 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +184 -0
- package/components/form/Form.vue.d.ts +316 -0
- package/components/icon/Icon.vue.d.ts +256 -0
- package/components/image/Image.vue.d.ts +403 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +229 -0
- package/components/index.d.ts +58 -0
- package/components/inputbadge/InputBadge.vue.d.ts +122 -0
- package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
- package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
- package/components/inputemail/InputEmail.vue.d.ts +25 -0
- package/components/inputnumber/InputNumber.vue.d.ts +282 -0
- package/components/inputpassword/InputPassword.vue.d.ts +32 -0
- package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +120 -0
- package/components/inputsearch/InputSearch.vue.d.ts +36 -0
- package/components/inputtext/InputText.vue.d.ts +352 -0
- package/components/inputurl/InputURL.vue.d.ts +39 -0
- package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +32 -0
- package/components/litedropdown/LiteDropdown.vue.d.ts +96 -0
- package/components/loading/Loading.vue.d.ts +47 -0
- package/components/loading/store/loading.store.d.ts +8 -0
- package/components/menu/Menu.vue.d.ts +390 -0
- package/components/menuitem/index.d.ts +106 -0
- package/components/multiselect/MultiSelect.vue.d.ts +194 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +301 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/tabmenu/TabMenu.vue.d.ts +288 -0
- package/components/textarea/Textarea.vue.d.ts +170 -0
- package/components/timeline/Timeline.vue.d.ts +121 -0
- package/components/toast/Toast.vue.d.ts +367 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +281 -0
- package/components/tree/Tree.vue.d.ts +148 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +83 -0
- package/components/username/UserName.vue.d.ts +113 -0
- package/components/userwithicon/UserWithIcon.vue.d.ts +20 -0
- package/config/defaultProps.d.ts +3 -0
- package/config/index.d.ts +3 -0
- package/config/locale.d.ts +3 -0
- package/directives/focus.d.ts +1 -1
- package/event-bus/index.d.ts +51 -51
- package/event-bus/mitt.d.ts +29 -14
- package/main.d.ts +31 -0
- package/package.json +8 -4
- package/plugins/WangsVue.d.ts +249 -199
- package/plugins/formValidation.d.ts +15 -6
- package/plugins/i18n-extension.d.ts +4 -0
- package/plugins/i18n.d.ts +82 -78
- package/utils/date.util.d.ts +59 -30
- package/utils/getSeverityByAssetStatus.util.d.ts +3 -0
- package/utils/index.d.ts +8 -0
- package/utils/listenSidebarChanges.util.d.ts +16 -0
- package/utils/object.util.d.ts +14 -3
- package/utils/role.util.d.ts +68 -0
- package/utils/toast.util.d.ts +78 -78
- package/utils/addAttachment.util.d.ts +0 -43
- package/utils/exportToExcel.util.d.ts +0 -20
- package/utils/filterOptions.util.d.ts +0 -3
- package/utils/genPlaceholder.util.d.ts +0 -8
- package/utils/getAttachmentIcon.util.d.ts +0 -8
- package/utils/mergePropsWithDefaults.util.d.ts +0 -20
- package/utils/textFormatter.util.d.ts +0 -17
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { Slot } from 'vue';
|
|
2
|
+
import { CustomValidation } from '../form/Form.vue.d';
|
|
3
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
4
|
+
import { BadgeProps } from '../../components/badge/Badge.vue.d';
|
|
5
|
+
import { WangsIcons } from '../../components/icon/Icon.vue.d';
|
|
6
|
+
|
|
7
|
+
export type OptionValue = string | number | boolean | Record<string, any>;
|
|
8
|
+
|
|
9
|
+
export type Option = {
|
|
10
|
+
label?: string;
|
|
11
|
+
value?: OptionValue;
|
|
12
|
+
visible?: boolean;
|
|
13
|
+
icon?: WangsIcons;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Configuration interface for localizing dropdown component placeholders and error messages.
|
|
19
|
+
*/
|
|
20
|
+
export interface DropdownLocaleConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Placeholder text for the filter input field.
|
|
23
|
+
*
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
filterPlaceholder?: string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Placeholder text displayed while the dropdown is loading.
|
|
30
|
+
*
|
|
31
|
+
* @example 'Loading...'
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
loadingPlaceholder?: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Placeholder text for the input field when no selection has been made.
|
|
38
|
+
*
|
|
39
|
+
* This text can include a placeholder `{label}` which will be replaced with the value of `props.label`.
|
|
40
|
+
*
|
|
41
|
+
* @example 'Select {label}' - If `props.label` is 'Option', the placeholder will be 'Select Option'.
|
|
42
|
+
* @example 'Select {lowercaseLabel}' - If `props.label` is 'Option', the placeholder will be 'Select option'.
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
inputPlaceholder?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Error message displayed when no selection has been made.
|
|
49
|
+
*
|
|
50
|
+
* This message can include placeholders:
|
|
51
|
+
* - `{label}`: Replaced with the value of `props.label`.
|
|
52
|
+
* - `{formattedLabel}`: Replaced with the value of `props.label` formatted with an appropriate article (a/an).
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // If `props.label` is 'Label', the error message will be:
|
|
56
|
+
* '{label} must be picked' - 'Label must be picked'
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // If `props.label` is 'user', the error message will be:
|
|
60
|
+
* 'You must pick {formattedLabel}' - 'You must pick a user'
|
|
61
|
+
*
|
|
62
|
+
* @default undefined
|
|
63
|
+
*/
|
|
64
|
+
emptySelectionErrorMessage?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Dropdown component props
|
|
69
|
+
*/
|
|
70
|
+
export interface DropdownProps {
|
|
71
|
+
/**
|
|
72
|
+
* Don't use modelValue with useValidator at the same time.
|
|
73
|
+
* It may lead unexpected behavior.
|
|
74
|
+
*/
|
|
75
|
+
modelValue?: OptionValue;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* If you deals with form validation on edit form action, you can set the initial value of the field.
|
|
79
|
+
*/
|
|
80
|
+
initialValue?: OptionValue;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The input label. Tell the user what input is this.
|
|
84
|
+
*/
|
|
85
|
+
label?: string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* List of options to display.
|
|
89
|
+
*/
|
|
90
|
+
options?: Option[] | string[] | Record<string, any>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Allows `null` to be treated as a valid selectable option in the dropdown.
|
|
94
|
+
*
|
|
95
|
+
* When enabled, `null` can be included in the options list and selected by the user.
|
|
96
|
+
*/
|
|
97
|
+
allowNullOption?: boolean;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Specify the property name of option to be used as label.
|
|
101
|
+
*
|
|
102
|
+
* @default undefined - the label will be sets to the option itself.
|
|
103
|
+
*/
|
|
104
|
+
optionLabel?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Specify the property name of option to be used as value.
|
|
108
|
+
*
|
|
109
|
+
* @default undefined - the value will be sets to the option itself.
|
|
110
|
+
*/
|
|
111
|
+
optionValue?: string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Define the value style, whether badge or plain text
|
|
115
|
+
*
|
|
116
|
+
* @default 'plain'
|
|
117
|
+
*/
|
|
118
|
+
valueType?: 'badge' | 'plain';
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Bind the badge property to the dropdown value
|
|
122
|
+
*/
|
|
123
|
+
badgeValueProps?: Omit<BadgeProps, 'label'>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Set the input border style
|
|
127
|
+
*
|
|
128
|
+
* @default 'default'
|
|
129
|
+
*/
|
|
130
|
+
inputBorder?: 'none' | 'default';
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A property to uniquely identify an option.
|
|
134
|
+
*/
|
|
135
|
+
dataKey?: string | undefined;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Determines if the field uses a validator
|
|
139
|
+
*/
|
|
140
|
+
useValidator?: boolean;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Determines if the field is mandatory
|
|
144
|
+
*/
|
|
145
|
+
mandatory?: boolean;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Show the text (opsional)
|
|
149
|
+
*
|
|
150
|
+
* @default true if mandatory true
|
|
151
|
+
*/
|
|
152
|
+
showOptionalText?: boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Set custom validator message.
|
|
156
|
+
* It is rarely use, this component has handled the validator message.
|
|
157
|
+
*
|
|
158
|
+
*
|
|
159
|
+
* @example: 'This field is required'
|
|
160
|
+
* @example: { empty: 'This field is required' }
|
|
161
|
+
*/
|
|
162
|
+
validatorMessage?: string | CustomValidation<'empty'>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Wether to format the message
|
|
166
|
+
*
|
|
167
|
+
* @default true
|
|
168
|
+
*/
|
|
169
|
+
formatValidatorMessage?: boolean;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Set custom invalid state.
|
|
173
|
+
*/
|
|
174
|
+
invalid?: boolean;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* This prop is required if you use this component in a form input.
|
|
178
|
+
* Specify the unique field name, match with your needs for API request.
|
|
179
|
+
*
|
|
180
|
+
* @default 'dropdown'
|
|
181
|
+
*/
|
|
182
|
+
fieldName?: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Default text to display when no option is selected.
|
|
186
|
+
*
|
|
187
|
+
* @default `Select ${label}`
|
|
188
|
+
*/
|
|
189
|
+
placeholder?: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Whether the dropdown is in loading state.
|
|
193
|
+
* @defaultValue false
|
|
194
|
+
*/
|
|
195
|
+
loading?: boolean;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Show icon 'info' on the right side of label.
|
|
199
|
+
* Show information to user about the field on icon hover.
|
|
200
|
+
*/
|
|
201
|
+
fieldInfo?: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Set disabled state for input dropdown.
|
|
205
|
+
*/
|
|
206
|
+
disabled?: boolean;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Whether show the Dropdown option search or not.
|
|
210
|
+
*
|
|
211
|
+
* @default true,
|
|
212
|
+
*/
|
|
213
|
+
filter?: boolean;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The filter input Placeholder
|
|
217
|
+
*
|
|
218
|
+
* @default 'Search'
|
|
219
|
+
*/
|
|
220
|
+
filterPlaceholder?: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface DropdownSlots {
|
|
224
|
+
'value': Slot<{ value: string; originalValue: any }>;
|
|
225
|
+
'option': Slot<{ option: Option }>;
|
|
226
|
+
'addon-left': Slot;
|
|
227
|
+
'addon-right': Slot;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Dropdown component emits
|
|
232
|
+
*/
|
|
233
|
+
export type DropdownEmits = {
|
|
234
|
+
/**
|
|
235
|
+
* Emits when an option selected.
|
|
236
|
+
*/
|
|
237
|
+
'update:modelValue': [value: OptionValue | undefined];
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Emits when overlay shown.
|
|
241
|
+
*/
|
|
242
|
+
'show': [];
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* **WangsVue - Dropdown**
|
|
247
|
+
*
|
|
248
|
+
* _Dropdown also known as Select, is used to choose an item from a collection of options._
|
|
249
|
+
*
|
|
250
|
+
* --- ---
|
|
251
|
+
* 
|
|
252
|
+
*
|
|
253
|
+
* @group Component
|
|
254
|
+
*/
|
|
255
|
+
declare class Dropdown extends ClassComponent<
|
|
256
|
+
DropdownProps,
|
|
257
|
+
DropdownSlots,
|
|
258
|
+
DropdownEmits
|
|
259
|
+
> {
|
|
260
|
+
/**
|
|
261
|
+
* Shows the overlay.
|
|
262
|
+
*
|
|
263
|
+
* @memberof MultiSelect
|
|
264
|
+
*/
|
|
265
|
+
showOverlay(): void;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare module '@vue/runtime-core' {
|
|
269
|
+
interface GlobalComponents {
|
|
270
|
+
Dropdown: GlobalComponentConstructor<Dropdown>;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export default Dropdown;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { EditorEvents } from '@tiptap/vue-3';
|
|
2
|
+
import { ClassComponent } from '../ts-helpers';
|
|
3
|
+
|
|
4
|
+
export interface EditorProps {
|
|
5
|
+
/**
|
|
6
|
+
* Model Value For Editor Content
|
|
7
|
+
*/
|
|
8
|
+
modelValue?: JSONContent;
|
|
9
|
+
/**
|
|
10
|
+
* Model Value For Editor Content
|
|
11
|
+
*/
|
|
12
|
+
initialValue?: JSONContent;
|
|
13
|
+
/**
|
|
14
|
+
* Specify the input placeholder.
|
|
15
|
+
*/
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Determine Editor State Readonly / Editable.
|
|
19
|
+
* @default 'editable'
|
|
20
|
+
*/
|
|
21
|
+
editorState?: EditorState;
|
|
22
|
+
/**
|
|
23
|
+
* Change Editor Border Content.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
borderLess?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The input label. Tell the user what input is this.
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Wether the input should be validated with vee-validator or not.
|
|
33
|
+
* If you use this component within form input, you need to set this props as true.
|
|
34
|
+
*/
|
|
35
|
+
useValidator?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* This prop is required if you use this component in a form input.
|
|
38
|
+
* Specify the unique field name, match with your needs for API request.
|
|
39
|
+
*
|
|
40
|
+
* @default 'editorInput'
|
|
41
|
+
*/
|
|
42
|
+
fieldName?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Specify classes for label.
|
|
45
|
+
*/
|
|
46
|
+
labelClass?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Show information to user about the field.
|
|
49
|
+
*/
|
|
50
|
+
fieldInfo?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Classes for validator message in input field.
|
|
53
|
+
*/
|
|
54
|
+
validatorMessageClass?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Set custom validator message.
|
|
57
|
+
* Will be show if invalid="true"
|
|
58
|
+
*/
|
|
59
|
+
validatorMessage?: string | { empty: string };
|
|
60
|
+
/**
|
|
61
|
+
* Wether this input field is required or not.
|
|
62
|
+
*/
|
|
63
|
+
mandatory?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Invalid input state.
|
|
66
|
+
*/
|
|
67
|
+
invalid?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Showing Optional value text on Label.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
showOptionalText?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Determine for image upload from local machine if value is true, no need to use postImageLocal emitter
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
isImageUploadBase64?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Fetch function for mention this will get triger if putting @ in editor
|
|
80
|
+
*/
|
|
81
|
+
fetchMentionSuggestionFunction?: () => Promise<
|
|
82
|
+
GetMentionSuggestionResponse | undefined
|
|
83
|
+
>;
|
|
84
|
+
/**
|
|
85
|
+
* Getting all mentioned list
|
|
86
|
+
*/
|
|
87
|
+
mentionedList?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Add custom class tailwind for editor wrapper/container
|
|
90
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
91
|
+
*/
|
|
92
|
+
editorWrapperClass?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Add custom class tailwind for editor toolbar wrapper/container
|
|
95
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
96
|
+
*/
|
|
97
|
+
toolbarWrapperClass?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Add custom class tailwind for editor content wrapper/container
|
|
100
|
+
* and preferred for using "!" bang! for your tailwind class just to make sure it apply
|
|
101
|
+
*/
|
|
102
|
+
contentWrapperClass?: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type EditorEmits = {
|
|
106
|
+
/**
|
|
107
|
+
* Event emitted when the model value is updated
|
|
108
|
+
*/
|
|
109
|
+
'update:modelValue': [value: JSONContent];
|
|
110
|
+
/**
|
|
111
|
+
* Event emitted when try to upload image from local machine,
|
|
112
|
+
* and need to send file image to server first using value.image params and then
|
|
113
|
+
* get back image url that already get hosted.
|
|
114
|
+
* to set the image url back to editor to be show up simply using value.setImageCb from params
|
|
115
|
+
*/
|
|
116
|
+
'postImageLocal': [value: PostImage];
|
|
117
|
+
/**
|
|
118
|
+
* Event emitted when button in floating menu named :(unset image) is clicked,
|
|
119
|
+
* but this only get triger if selected image get set by postImageLocal function
|
|
120
|
+
*/
|
|
121
|
+
'deleteImageLocal': [value: ImageProperties];
|
|
122
|
+
/**
|
|
123
|
+
* Event emitted when the editor is blurred
|
|
124
|
+
*/
|
|
125
|
+
'blur': [value: EditorEvents['blur']];
|
|
126
|
+
/**
|
|
127
|
+
* Event emitted when the editor is focused
|
|
128
|
+
*/
|
|
129
|
+
'focus': [value: EditorEvents['focus']];
|
|
130
|
+
/**
|
|
131
|
+
* Emited Everytime mentioned user in editor change
|
|
132
|
+
*/
|
|
133
|
+
'update:mentionedList': [value: string[]];
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type PostImage = {
|
|
137
|
+
/**
|
|
138
|
+
* This Is Image File that should be send to server
|
|
139
|
+
*/
|
|
140
|
+
image: File;
|
|
141
|
+
/**
|
|
142
|
+
* Set Image Cb Is Callback For setting back image url that get send back
|
|
143
|
+
* from server through response
|
|
144
|
+
*/
|
|
145
|
+
setImageCb: (imageUrl: string) => void;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Editor Content Meta Data
|
|
150
|
+
*/
|
|
151
|
+
export type JSONContent = {
|
|
152
|
+
type?: string;
|
|
153
|
+
attrs?: Record<string, any>;
|
|
154
|
+
content?: JSONContent[];
|
|
155
|
+
marks?: {
|
|
156
|
+
type: string;
|
|
157
|
+
attrs?: Record<string, any>;
|
|
158
|
+
[key: string]: any;
|
|
159
|
+
}[];
|
|
160
|
+
text?: string;
|
|
161
|
+
[key: string]: any;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export type ImageProperties = {
|
|
165
|
+
alt?: string;
|
|
166
|
+
src: string;
|
|
167
|
+
title: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export type GetMentionSuggestionResponse = {
|
|
171
|
+
status: number;
|
|
172
|
+
message: string;
|
|
173
|
+
data: MentionSuggestion[];
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type MentionSuggestion = {
|
|
177
|
+
_id: string;
|
|
178
|
+
fullName: string;
|
|
179
|
+
nickName: string;
|
|
180
|
+
profilePicture: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export type EditorState = 'editable' | 'readonly';
|
|
184
|
+
|
|
185
|
+
declare class Editor extends ClassComponent<
|
|
186
|
+
EditorProps,
|
|
187
|
+
unknown,
|
|
188
|
+
EditorEmits
|
|
189
|
+
> {}
|
|
190
|
+
|
|
191
|
+
export default Editor;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface FieldWrapperLocaleConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The indicator for mandatory field.
|
|
6
|
+
* @default '*''
|
|
7
|
+
*/
|
|
8
|
+
labelRequired?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The indicator for optional field.
|
|
12
|
+
* @default '(optional)''
|
|
13
|
+
*/
|
|
14
|
+
labelOptional?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Props for the FieldWrapper component.
|
|
19
|
+
*/
|
|
20
|
+
export interface FieldWrapperProps {
|
|
21
|
+
/**
|
|
22
|
+
* The label text to display for the field.
|
|
23
|
+
* @default undefined
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Indicates whether the field is mandatory (required).
|
|
29
|
+
* If `true`, this may trigger the display of a required indicator.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
mandatory?: boolean;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* When `true`, displays an "(optional)" text next to the label if the field is not mandatory.
|
|
36
|
+
*/
|
|
37
|
+
showOptionalText?: boolean;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* When `true`, displays an asterisk (`*`) next to the label if the field is mandatory.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
showAsterisk?: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Additional information or description for the field.
|
|
47
|
+
* Can be used to display tooltips or inline helper text.
|
|
48
|
+
* @default undefined
|
|
49
|
+
*/
|
|
50
|
+
info?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Custom CSS class to apply to the label element.
|
|
54
|
+
* Useful for styling the label specifically.
|
|
55
|
+
* @default undefined
|
|
56
|
+
*/
|
|
57
|
+
labelClass?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Position of the tooltip, if one is displayed.
|
|
61
|
+
* Accepted values are `'top'`, `'right'`, `'bottom'`, and `'left'`.
|
|
62
|
+
* @default undefined
|
|
63
|
+
*/
|
|
64
|
+
tooltipPos?: 'top' | 'right' | 'bottom' | 'left';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare const FieldWrapper: DefineComponent<FieldWrapperProps>;
|
|
68
|
+
|
|
69
|
+
export default FieldWrapper;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileUploadErrorEvent,
|
|
3
|
+
FileUploadUploadEvent,
|
|
4
|
+
} from 'primevue/fileupload';
|
|
5
|
+
import { CustomValidation } from '../form/Form.vue.d';
|
|
6
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
7
|
+
|
|
8
|
+
export type InputErrorCodes = 'FILE_SIZE_TOO_LARGE';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Defines valid properties in FileUpload component.
|
|
12
|
+
*/
|
|
13
|
+
export type FileUploadProps = {
|
|
14
|
+
/**
|
|
15
|
+
* Pattern to restrict the allowed file types such as 'image/*'.
|
|
16
|
+
*/
|
|
17
|
+
accept?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Disables the upload functionality.
|
|
20
|
+
* @defaultValue false
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Maximum file size allowed in bytes.
|
|
25
|
+
*/
|
|
26
|
+
maxFileSize?: number | undefined;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* V-model for the file upload component.
|
|
30
|
+
* Be careful while using this props since the validation can't work while using this.
|
|
31
|
+
* You must do manual validation when choosing the file to be set on the component.
|
|
32
|
+
*/
|
|
33
|
+
modelValue?: File | File[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Props to determine whether file upload support multiple files or not
|
|
37
|
+
*
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
multiple?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Message of the invalid fize size.
|
|
43
|
+
* - Use {0} to get the file's name
|
|
44
|
+
* - Use {1} to get the max file size
|
|
45
|
+
* - Use {2} to get the accepted file types from props.accept
|
|
46
|
+
* - Use {2.1} to get the accepted file types from props.fileExtensions
|
|
47
|
+
* @defaultValue {0}: Invalid file size, file size should be smaller than {1}.
|
|
48
|
+
*/
|
|
49
|
+
invalidFileSizeMessage?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Message of the invalid fize type.
|
|
52
|
+
* - Use {0} to get the file's name
|
|
53
|
+
* - Use {1} to get the max file size
|
|
54
|
+
* - Use {2} to get the accepted file types
|
|
55
|
+
* - Use {2.1} to get the accepted file types from props.fileExtensions
|
|
56
|
+
* @defaultValue '{0}: Invalid file type, allowed file types: {2}'
|
|
57
|
+
*/
|
|
58
|
+
invalidFileTypeMessage?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Label of the file upload.
|
|
61
|
+
* @defaultValue 'Upload File'
|
|
62
|
+
*/
|
|
63
|
+
label?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to use an upload button.
|
|
66
|
+
* @defaultValue true
|
|
67
|
+
*/
|
|
68
|
+
withUpload?: boolean | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Label of the upload button.
|
|
71
|
+
* @defaultValue 'Upload'.
|
|
72
|
+
*/
|
|
73
|
+
uploadLabel?: string | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Placeholder of the file upload.
|
|
76
|
+
* @defaultValue 'Select File'
|
|
77
|
+
*/
|
|
78
|
+
placeholder?: string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* File extensions to display the accepted extensions.
|
|
81
|
+
*/
|
|
82
|
+
fileExtensions?: string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The note about the requirements of file for being uploaded.
|
|
85
|
+
*
|
|
86
|
+
* Placed at the bottom right of input.
|
|
87
|
+
*/
|
|
88
|
+
fileRequirements?: string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* The function to be called after the upload button is clicked. (Must be used when withUpload is true)
|
|
91
|
+
*/
|
|
92
|
+
uploadFunction?: (files: File[]) => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the input should be validated with vee-validator or not.
|
|
95
|
+
* If you use this component within form input, you need to set this props as true.
|
|
96
|
+
*/
|
|
97
|
+
useValidator?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* This prop is required if you use this component in a form input.
|
|
100
|
+
* Specify the unique field name, match with your needs for API request.
|
|
101
|
+
*
|
|
102
|
+
* @default 'fileUpload'
|
|
103
|
+
*/
|
|
104
|
+
fieldName?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Whether this input field is required or not.
|
|
107
|
+
*/
|
|
108
|
+
mandatory?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Whether show toast error message on invalid file input
|
|
111
|
+
*
|
|
112
|
+
* @default true;
|
|
113
|
+
*/
|
|
114
|
+
useErrorToast?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Set custom validator message.
|
|
117
|
+
* Will be show if invalid="true"
|
|
118
|
+
*/
|
|
119
|
+
validatorMessage?: string | CustomValidation;
|
|
120
|
+
/**
|
|
121
|
+
* Classes for validator message in input field.
|
|
122
|
+
*/
|
|
123
|
+
validatorMessageClass?: string;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export type FileUploadEmits = {
|
|
127
|
+
/**
|
|
128
|
+
* Callback to invoke when there is a file selected.
|
|
129
|
+
*/
|
|
130
|
+
'select': [event: File | File[]];
|
|
131
|
+
/**
|
|
132
|
+
* Callback to invoke when model changed.
|
|
133
|
+
*/
|
|
134
|
+
'update:modelValue': [event: File | File[]];
|
|
135
|
+
/**
|
|
136
|
+
* Callback to invoke when file upload is complete.
|
|
137
|
+
*/
|
|
138
|
+
'upload': [event: FileUploadUploadEvent];
|
|
139
|
+
/**
|
|
140
|
+
* Callback to invoke if file upload fails.
|
|
141
|
+
*/
|
|
142
|
+
'error': [event: FileUploadErrorEvent | InputErrorCodes];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* **WangsVue - FileUpload**
|
|
147
|
+
*
|
|
148
|
+
* _FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations._
|
|
149
|
+
*
|
|
150
|
+
* [Live Demo](https://fewangsit.github.io/wangsvue/button)
|
|
151
|
+
* --- ---
|
|
152
|
+
* 
|
|
153
|
+
*
|
|
154
|
+
* @group Component
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
declare class FileUpload extends ClassComponent<
|
|
158
|
+
FileUploadProps,
|
|
159
|
+
null,
|
|
160
|
+
FileUploadEmits
|
|
161
|
+
> {}
|
|
162
|
+
|
|
163
|
+
declare module '@vue/runtime-core' {
|
|
164
|
+
interface GlobalComponents {
|
|
165
|
+
FileUpload: GlobalComponentConstructor<FileUpload>;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export default FileUpload;
|