@fewangsit/wangsvue-gsts 1.0.0-alpha.1
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/assets/json/currencies.json.d.ts +1068 -0
- package/assets/json/languages.json.d.ts +180 -0
- 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 +14 -0
- package/components/animation/Animation.vue.d.ts +24 -0
- package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
- package/components/badge/Badge.vue.d.ts +66 -0
- package/components/badgegroup/BadgeGroup.vue.d.ts +40 -0
- package/components/badgegrouptree/BadgeGroupTree.vue.d.ts +34 -0
- package/components/basecomponent/index.d.ts +28 -0
- package/components/basetree/BaseTree.vue.d.ts +567 -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 +185 -0
- package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +26 -0
- package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +97 -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/buttonsearch/ButtonSearch.vue.d.ts +38 -0
- package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +193 -0
- package/components/buttonsplit/ButtonSplit.d.ts +350 -0
- package/components/buttonsplit/ButtonSplit.vue.d.ts +34 -0
- package/components/buttontoggle/ButtonToggle.vue.d.ts +18 -0
- package/components/calendar/BaseCalendar.vue.d.ts +83 -0
- package/components/calendar/Calendar.vue.d.ts +561 -0
- package/components/card/Card.vue.d.ts +139 -0
- package/components/changelog/Changelog.vue.d.ts +158 -0
- package/components/changelogpage/ChangelogFilter.vue.d.ts +16 -0
- package/components/changelogpage/ChangelogPage.vue.d.ts +124 -0
- package/components/checkbox/Checkbox.vue.d.ts +329 -0
- package/components/codesnippet/CodeSnippet.vue.d.ts +14 -0
- package/components/customcolumn/CustomColumn.vue.d.ts +35 -0
- package/components/datatable/DataTable.vue.d.ts +704 -0
- package/components/datatable/MultiRow.vue.d.ts +16 -0
- package/components/datatable/helpers/adjustMenuPosition.helper.d.ts +1 -0
- package/components/datatable/helpers/filter.helper.d.ts +28 -0
- package/components/datatable/helpers/index.d.ts +3 -0
- package/components/datatable/helpers/readConfig.helper.d.ts +2 -0
- package/components/datatable/store/dataTable.store.d.ts +22 -0
- package/components/dialog/Dialog.vue.d.ts +464 -0
- package/components/dialogconfirm/DialogConfirm.vue.d.ts +153 -0
- package/components/dialogform/DialogForm.vue.d.ts +349 -0
- package/components/dialogselecttree/DialogSelectTree.vue.d.ts +111 -0
- package/components/dropdown/Dropdown.vue.d.ts +257 -0
- package/components/editor/CodeSnippetAdapter.vue.d.ts +92 -0
- package/components/editor/Editor.vue.d.ts +191 -0
- package/components/editor/EditorButton.vue.d.ts +15 -0
- package/components/editor/MentionList.vue.d.ts +35 -0
- package/components/editor/MentionSection.vue.d.ts +92 -0
- package/components/editor/codeSnippetExtension.d.ts +3 -0
- package/components/editor/mentionSectionExtension.d.ts +3 -0
- package/components/editor/suggestion.d.ts +2 -0
- package/components/fieldwrapper/FieldWrapper.vue.d.ts +69 -0
- package/components/fileupload/FileUpload.vue.d.ts +153 -0
- package/components/filtercontainer/FilterContainer.vue.d.ts +141 -0
- package/components/filtercontainer/helpers/applyFilter.helper.d.ts +3 -0
- package/components/filtercontainer/helpers/formatDateTimeRange.helper.d.ts +7 -0
- package/components/filtercontainer/helpers/getOption.helper.d.ts +3 -0
- package/components/form/Form.vue.d.ts +306 -0
- package/components/gallerypreview/GalleryPreview.vue.d.ts +31 -0
- package/components/helpers/convertToArrayClass.helper.d.ts +2 -0
- package/components/helpers/index.d.ts +2 -0
- package/components/helpers/label.d.ts +15 -0
- package/components/icon/Icon.vue.d.ts +245 -0
- package/components/image/Image.vue.d.ts +403 -0
- package/components/imagecompressor/BackgroundImageCropper.vue.d.ts +36 -0
- package/components/imagecompressor/ImageCompressor.vue.d.ts +191 -0
- package/components/imagecompressor/ImageInputInfo.vue.d.ts +30 -0
- package/components/index.d.ts +66 -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 +4 -0
- package/components/inputemail/InputEmail.vue.d.ts +25 -0
- package/components/inputgroup/InputGroup.vue.d.ts +141 -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/inputphonenumber/helpers/getUserLocation.helper.d.ts +8 -0
- package/components/inputrangenumber/InputRangeNumber.vue.d.ts +120 -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 +36 -0
- package/components/languagedropdown/LanguageDropdown.vue.d.ts +58 -0
- package/components/languagedropdown/LanguageDropdownOption.vue.d.ts +18 -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/menu/helpers/filterMenu.helper.d.ts +12 -0
- package/components/menu/helpers/index.d.ts +1 -0
- package/components/menuitem/MenuItem.vue.d.ts +19 -0
- package/components/menuitem/index.d.ts +104 -0
- package/components/multiselect/MultiSelect.vue.d.ts +192 -0
- package/components/overlaypanel/OverlayPanel.vue.d.ts +301 -0
- package/components/passthrough/index.d.ts +16 -0
- package/components/progressbar/ProgressBar.vue.d.ts +72 -0
- package/components/quickfilter/QuickFilter.vue.d.ts +25 -0
- package/components/tabmenu/TabMenu.vue.d.ts +288 -0
- package/components/tagtype/TagType.vue.d.ts +22 -0
- package/components/textarea/Textarea.vue.d.ts +170 -0
- package/components/timeline/Timeline.vue.d.ts +115 -0
- package/components/timeline/TimelineContentByType.vue.d.ts +16 -0
- package/components/toast/Toast.vue.d.ts +367 -0
- package/components/toggleswitch/ToggleSwitch.vue.d.ts +281 -0
- package/components/tooltipspan/TooltipSpan.vue.d.ts +20 -0
- package/components/tree/Tree.vue.d.ts +146 -0
- package/components/tree/helpers/filterNodeKeys.helper.d.ts +16 -0
- package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +6 -0
- package/components/tree/helpers/index.d.ts +3 -0
- package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
- package/components/ts-helpers.d.ts +63 -0
- package/components/usergroup/UserGroup.vue.d.ts +57 -0
- package/components/username/UserName.vue.d.ts +61 -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 +55 -0
- package/event-bus/mitt.d.ts +26 -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-Bb2MtjdD.js +4 -0
- package/loading-table-Br25QIny.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-chOgXi94.js +1 -0
- package/main.d.ts +2 -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 +16 -0
- package/plugins/WangsVue.d.ts +121 -0
- package/plugins/formValidation.d.ts +10 -0
- package/plugins/translation.d.ts +37 -0
- package/style.css +1 -0
- package/types/options.type.d.ts +16 -0
- package/utils/date.util.d.ts +37 -0
- package/utils/exportToExcel.util.d.ts +20 -0
- package/utils/filterOptions.util.d.ts +3 -0
- package/utils/genPlaceholder.util.d.ts +8 -0
- package/utils/getAttachmentIcon.util.d.ts +8 -0
- package/utils/getStatusSeverity.util.d.ts +3 -0
- package/utils/index.d.ts +18 -0
- package/utils/mergePropsWithDefaults.util.d.ts +20 -0
- package/utils/object.util.d.ts +9 -0
- package/utils/role.util.d.ts +2 -0
- package/utils/textFormatter.util.d.ts +17 -0
- package/utils/toast.util.d.ts +114 -0
- package/wangsvue-gsts.es.js +133347 -0
- package/wangsvue-gsts.system.js +454 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { GenericObject } from 'vee-validate';
|
|
2
|
+
import { Slot } from 'vue';
|
|
3
|
+
import FormInstance, { FormPayload, FormProps } from '../form/Form.vue.d';
|
|
4
|
+
import { WangsIcons } from '../icon/Icon.vue.d';
|
|
5
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
6
|
+
|
|
7
|
+
export type DialogFormValue =
|
|
8
|
+
| string
|
|
9
|
+
| string[]
|
|
10
|
+
| number
|
|
11
|
+
| number[]
|
|
12
|
+
| boolean
|
|
13
|
+
| boolean[]
|
|
14
|
+
| Record<string, unknown>
|
|
15
|
+
| Record<string, unknown>[];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Generic form payload, able to receive types from outside
|
|
19
|
+
*/
|
|
20
|
+
export type DialogFormPayload<
|
|
21
|
+
FormValuesType = Record<string, DialogFormValue>,
|
|
22
|
+
> = {
|
|
23
|
+
stayAfterSubmit: boolean;
|
|
24
|
+
formValues: FormValuesType;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export interface DialogFormLocaleConfig {
|
|
28
|
+
/**
|
|
29
|
+
* @example 'Cancel'
|
|
30
|
+
*/
|
|
31
|
+
cancelBtnLabel?: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @example 'Clear Field'
|
|
35
|
+
*/
|
|
36
|
+
clearBtnLabel?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @example 'Stay after submit'
|
|
40
|
+
*/
|
|
41
|
+
stayCheckboxLabel?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @example 'Submit'
|
|
45
|
+
*/
|
|
46
|
+
submitBtnLabel?: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Set the label for button expand sidebar right when it is expanded.
|
|
50
|
+
*
|
|
51
|
+
* @example 'Tutup <'
|
|
52
|
+
*/
|
|
53
|
+
asideRightExpandedButtonLabel?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Set the label for button expand sidebar right when it is collapsed.
|
|
57
|
+
*
|
|
58
|
+
* @example 'Lihat data yang ada >'
|
|
59
|
+
*/
|
|
60
|
+
asideRightCollapsedButtonLabel?: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Props for DialogForm component
|
|
65
|
+
*/
|
|
66
|
+
export interface DialogFormProps extends FormProps {
|
|
67
|
+
/**
|
|
68
|
+
* The template for form buttons.
|
|
69
|
+
*/
|
|
70
|
+
buttonsTemplate: ('clear' | 'submit' | 'cancel')[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The dialog header.
|
|
74
|
+
*/
|
|
75
|
+
header: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Value binding to show/hide the dialog.
|
|
79
|
+
*/
|
|
80
|
+
visible: boolean;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* With in pixel
|
|
84
|
+
*
|
|
85
|
+
* @default 260
|
|
86
|
+
*/
|
|
87
|
+
asideRightWidth?: number;
|
|
88
|
+
class?: string | string[];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Custom button cancel label.
|
|
92
|
+
*
|
|
93
|
+
* @default - The default value from locale configuration {@link DialogFormLocaleConfig.cancelBtnLabel}
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
96
|
+
cancelBtnLabel?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Custom button clear label.
|
|
100
|
+
*
|
|
101
|
+
* @default - The default value from locale configuration {@link DialogFormLocaleConfig.clearBtnLabel}
|
|
102
|
+
*/
|
|
103
|
+
clearBtnLabel?: string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Wether show the Close icon or not.
|
|
107
|
+
*/
|
|
108
|
+
closable?: boolean;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Close dialog after form validated and submitted.
|
|
112
|
+
*
|
|
113
|
+
* @default true
|
|
114
|
+
*/
|
|
115
|
+
closeOnSubmit?: boolean;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated
|
|
119
|
+
*/
|
|
120
|
+
contentClass?: string | string[];
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Show Date time on header.
|
|
124
|
+
*/
|
|
125
|
+
dateHeader?: string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Set the header icon left beside of the title.
|
|
129
|
+
*/
|
|
130
|
+
headerIcon?: WangsIcons;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Sets the invalid state.
|
|
134
|
+
*
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
invalid?: boolean;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Prevent form resets after submitted. Default is resetted.
|
|
141
|
+
*
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
resetAfterSubmit?: boolean;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The severity of the dialog.
|
|
148
|
+
* The severity will determine the dialog icons and color scheme.
|
|
149
|
+
*/
|
|
150
|
+
severity?: 'success' | 'danger' | 'primary';
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Show or hide the checkbox 'Stay after submit.'
|
|
154
|
+
*
|
|
155
|
+
* @default true - if the action is submit.
|
|
156
|
+
* @default false - if the action is save.
|
|
157
|
+
*/
|
|
158
|
+
showStayCheckbox?: boolean;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Custom label for stay checkbox.
|
|
162
|
+
*
|
|
163
|
+
* @default - The default value from locale configuration {@link DialogFormLocaleConfig.stayCheckboxLabel}
|
|
164
|
+
*/
|
|
165
|
+
stayCheckboxLabel?: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Custom button submit label.
|
|
169
|
+
* @default - The default value from locale configuration {@link DialogFormLocaleConfig.submitBtnLabel}
|
|
170
|
+
*/
|
|
171
|
+
submitBtnLabel?: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Define the invalid message to be shown on invalid state above the Form submit button.
|
|
175
|
+
*
|
|
176
|
+
* @default undefined
|
|
177
|
+
*/
|
|
178
|
+
validatorMessage?: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Additional validation function.
|
|
182
|
+
* Within this this function, you need to set the invalid props value.
|
|
183
|
+
*
|
|
184
|
+
* If after executing this function the props invalid is true, the form will not be submitted.
|
|
185
|
+
* Otherwise, 'submit' event will be emitted.
|
|
186
|
+
*
|
|
187
|
+
* @param values - the Form values
|
|
188
|
+
*/
|
|
189
|
+
validationFunction?: (values: GenericObject) => void | Promise<void>;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Set the dialog size.
|
|
193
|
+
*
|
|
194
|
+
* - small: 400px
|
|
195
|
+
* - medium: 500px
|
|
196
|
+
* - large: 572px
|
|
197
|
+
* - semi-xlarge: 600px
|
|
198
|
+
* - xlarge: 800px
|
|
199
|
+
*
|
|
200
|
+
* @default 'small';
|
|
201
|
+
*/
|
|
202
|
+
width?: 'small' | 'medium' | 'large' | 'semi-xlarge' | 'xlarge';
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface ConfirmSlots {
|
|
206
|
+
/**
|
|
207
|
+
* The Visible state.
|
|
208
|
+
*/
|
|
209
|
+
visible: boolean;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Hide the confirm dialog.
|
|
213
|
+
*/
|
|
214
|
+
hide: () => void;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The submit function to be called after confirmation.
|
|
218
|
+
*/
|
|
219
|
+
submit: (submitFn: (value: FormPayload) => Promise<void> | void) => void;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface ActionSlots {
|
|
223
|
+
/**
|
|
224
|
+
* The submit function to be called after confirmation.
|
|
225
|
+
*/
|
|
226
|
+
submit: (submitFn: () => Promise<void> | void) => void;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Slots for DialogForm component
|
|
231
|
+
*/
|
|
232
|
+
export interface DialogFormSlots {
|
|
233
|
+
/**
|
|
234
|
+
* Slot for action buttons.
|
|
235
|
+
*/
|
|
236
|
+
'actionButtons': Slot<ActionSlots>;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Slot for aside right expansion.
|
|
240
|
+
*/
|
|
241
|
+
'aside-right': Slot;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Slot for dialog confirm.
|
|
245
|
+
*/
|
|
246
|
+
'confirm': Slot<ConfirmSlots>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The fields slot for the Dialogform. Here is where you can put your Dialogform fields.
|
|
250
|
+
*/
|
|
251
|
+
'fields': Slot<{ formValues: GenericObject; key?: number }>;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Slot for dialog header.
|
|
255
|
+
*/
|
|
256
|
+
'header': Slot;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Emits for DialogForm component
|
|
261
|
+
*/
|
|
262
|
+
export type DialogFormEmits = {
|
|
263
|
+
/**
|
|
264
|
+
* Emits when 'Clear Field' button clicked.
|
|
265
|
+
*/
|
|
266
|
+
'clear': [];
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* When dialog is closed by close button.
|
|
270
|
+
*/
|
|
271
|
+
'close': [];
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Callback to invoke when dialog is hidden.
|
|
275
|
+
*/
|
|
276
|
+
'hide': [];
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Callback to invoke when dialog is shown.
|
|
280
|
+
*/
|
|
281
|
+
'show': [];
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Emits when the form validation succes and props.invalid is 'false'.
|
|
285
|
+
*/
|
|
286
|
+
'submit': [values: DialogFormPayload];
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* When dialog is closed.
|
|
290
|
+
*/
|
|
291
|
+
'update:visible': [state: boolean];
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* **WangsVue - DialogForm**
|
|
296
|
+
*
|
|
297
|
+
* _DialogForm is combination of Form and Dialog. Handles validation on submit using vee-validate.
|
|
298
|
+
* You need to install vee-validate while using this component._
|
|
299
|
+
*
|
|
300
|
+
* --- ---
|
|
301
|
+
* 
|
|
302
|
+
*
|
|
303
|
+
* @group components
|
|
304
|
+
*/
|
|
305
|
+
declare class DialogForm extends ClassComponent<
|
|
306
|
+
DialogFormProps,
|
|
307
|
+
DialogFormSlots,
|
|
308
|
+
DialogFormEmits
|
|
309
|
+
> {
|
|
310
|
+
/**
|
|
311
|
+
* Exposed function to clears the form fields.
|
|
312
|
+
*/
|
|
313
|
+
clearField: () => void;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The ref of form element.
|
|
317
|
+
*/
|
|
318
|
+
form: FormInstance;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Set initial values for all fields.
|
|
322
|
+
*/
|
|
323
|
+
setValues: (values: GenericObject) => void;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Set value for specific field.
|
|
327
|
+
*/
|
|
328
|
+
setFieldValue: <T extends string>(
|
|
329
|
+
field: T,
|
|
330
|
+
value: GenericObject[T],
|
|
331
|
+
shouldValidate?: boolean,
|
|
332
|
+
) => void;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Set errors fields
|
|
336
|
+
* @param fields - {
|
|
337
|
+
* name: 'This name already exists'
|
|
338
|
+
* }
|
|
339
|
+
*/
|
|
340
|
+
setErrors(fields: GenericObject): void;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare module '@vue/runtime-core' {
|
|
344
|
+
interface GlobalComponents {
|
|
345
|
+
DialogForm: GlobalComponentConstructor<DialogForm>;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export default DialogForm;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { TreeSelectionKeys } from 'primevue/tree';
|
|
2
|
+
import { TreeNode } from '../basetree/BaseTree.vue.d';
|
|
3
|
+
import { ShortFetchResponse } from '../datatable/DataTable.vue.d';
|
|
4
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
5
|
+
import TreeInstance from '../tree/Tree.vue.d';
|
|
6
|
+
|
|
7
|
+
export interface DialogSelectTreeProps {
|
|
8
|
+
fetchTree?: (
|
|
9
|
+
type: 'group' | 'category',
|
|
10
|
+
) => Promise<ShortFetchResponse<TreeNode> | undefined>;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
type?: 'group' | 'category';
|
|
13
|
+
/**
|
|
14
|
+
* Specify wether the all tree node should be auto checked once it rendered.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
autoSelectAll?: boolean;
|
|
18
|
+
header?: string;
|
|
19
|
+
subHeader?: string;
|
|
20
|
+
selectionMode?: 'single' | 'checkbox';
|
|
21
|
+
/**
|
|
22
|
+
* For checkbox selection, current behavior is preventing select if there is no node selected.
|
|
23
|
+
*
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
allowEmptySelection?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The previously selected tree key to be displayed again.
|
|
29
|
+
*/
|
|
30
|
+
keys?: number[];
|
|
31
|
+
/**
|
|
32
|
+
* The lists to be displayed in the dialog.
|
|
33
|
+
*/
|
|
34
|
+
lists?: (string | object)[];
|
|
35
|
+
/**
|
|
36
|
+
* The label of the list if your list item is an object.
|
|
37
|
+
* Choose a property from the item to be displayed on the list.
|
|
38
|
+
*/
|
|
39
|
+
listLabel?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Disable node 'All' selection
|
|
42
|
+
*/
|
|
43
|
+
disableNodeAll?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated
|
|
46
|
+
*/
|
|
47
|
+
exactDisableKey?: number;
|
|
48
|
+
/**
|
|
49
|
+
* A list of node keys that should be disabled along with their children.
|
|
50
|
+
*/
|
|
51
|
+
disableKeys?: number[];
|
|
52
|
+
/**
|
|
53
|
+
* A list of node keys that should be disabled, affecting only the specified nodes and not their children.
|
|
54
|
+
*/
|
|
55
|
+
exactDisableKeys?: number[];
|
|
56
|
+
/**
|
|
57
|
+
* Defines the tree is readonly and disabled.
|
|
58
|
+
*/
|
|
59
|
+
readonly?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Defines the group tree to showing disposable groups.
|
|
62
|
+
*/
|
|
63
|
+
showDisposableGroups?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Defines the tree to be flattened and shows disposable only
|
|
66
|
+
*/
|
|
67
|
+
flattenDisposableNode?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Defines the group tree to disable excluded keys
|
|
70
|
+
*/
|
|
71
|
+
excludedKeys?: number[];
|
|
72
|
+
/**
|
|
73
|
+
* Render hidden dialog to trigger fetch tree
|
|
74
|
+
*/
|
|
75
|
+
hidden?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type TreeSelectPayload = {
|
|
79
|
+
keys: TreeSelectionKeys | undefined;
|
|
80
|
+
selectedNodes: TreeNode[] | undefined;
|
|
81
|
+
singleNode: TreeNode | undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type DialogSelectTreeEmits = {
|
|
85
|
+
select: [keys?: TreeSelectPayload];
|
|
86
|
+
hide: [];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* **TSVue v2 - DialogSelectTree**
|
|
91
|
+
*
|
|
92
|
+
* --- ---
|
|
93
|
+
* 
|
|
94
|
+
*
|
|
95
|
+
* @group components
|
|
96
|
+
*/
|
|
97
|
+
declare class DialogSelectTree extends ClassComponent<
|
|
98
|
+
DialogSelectTreeProps,
|
|
99
|
+
Record<string, unknown>,
|
|
100
|
+
DialogSelectTreeEmits
|
|
101
|
+
> {
|
|
102
|
+
treeComponent: TreeInstance;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
declare module '@vue/runtime-core' {
|
|
106
|
+
interface GlobalComponents {
|
|
107
|
+
DialogSelectTree: GlobalComponentConstructor<DialogSelectTree>;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export default DialogSelectTree;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { Slot } from 'vue';
|
|
2
|
+
import { DropdownOption, OptionValue } from 'lib/types/options.type';
|
|
3
|
+
import { CustomValidation } from '../form/Form.vue.d';
|
|
4
|
+
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
|
|
5
|
+
import { BadgeProps } from 'lib/components/badge/Badge.vue.d';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Configuration interface for localizing dropdown component placeholders and error messages.
|
|
9
|
+
*/
|
|
10
|
+
export interface DropdownLocaleConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder text for the filter input field.
|
|
13
|
+
*
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
filterPlaceholder?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Placeholder text displayed while the dropdown is loading.
|
|
20
|
+
*
|
|
21
|
+
* @example 'Loading...'
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
loadingPlaceholder?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Placeholder text for the input field when no selection has been made.
|
|
28
|
+
*
|
|
29
|
+
* This text can include a placeholder `{label}` which will be replaced with the value of `props.label`.
|
|
30
|
+
*
|
|
31
|
+
* @example 'Select {label}' - If `props.label` is 'Option', the placeholder will be 'Select Option'.
|
|
32
|
+
* @example 'Select {lowercaseLabel}' - If `props.label` is 'Option', the placeholder will be 'Select option'.
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
inputPlaceholder?: string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Error message displayed when no selection has been made.
|
|
39
|
+
*
|
|
40
|
+
* This message can include placeholders:
|
|
41
|
+
* - `{label}`: Replaced with the value of `props.label`.
|
|
42
|
+
* - `{formattedLabel}`: Replaced with the value of `props.label` formatted with an appropriate article (a/an).
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // If `props.label` is 'Label', the error message will be:
|
|
46
|
+
* '{label} must be picked' - 'Label must be picked'
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // If `props.label` is 'user', the error message will be:
|
|
50
|
+
* 'You must pick {formattedLabel}' - 'You must pick a user'
|
|
51
|
+
*
|
|
52
|
+
* @default undefined
|
|
53
|
+
*/
|
|
54
|
+
emptySelectionErrorMessage?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Dropdown component props
|
|
59
|
+
*/
|
|
60
|
+
export interface DropdownProps {
|
|
61
|
+
/**
|
|
62
|
+
* Don't use modelValue with useValidator at the same time.
|
|
63
|
+
* It may lead unexpected behavior.
|
|
64
|
+
*/
|
|
65
|
+
modelValue?: OptionValue;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* If you deals with form validation on edit form action, you can set the initial value of the field.
|
|
69
|
+
*/
|
|
70
|
+
initialValue?: OptionValue;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The input label. Tell the user what input is this.
|
|
74
|
+
*/
|
|
75
|
+
label?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* List of options to display.
|
|
79
|
+
*/
|
|
80
|
+
options?: DropdownOption[] | string[] | Record<string, any>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Specify the property name of option to be used as label.
|
|
84
|
+
*
|
|
85
|
+
* @default undefined - the label will be sets to the option itself.
|
|
86
|
+
*/
|
|
87
|
+
optionLabel?: string;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Specify the property name of option to be used as value.
|
|
91
|
+
*
|
|
92
|
+
* @default undefined - the value will be sets to the option itself.
|
|
93
|
+
*/
|
|
94
|
+
optionValue?: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Define the value style, whether badge or plain text
|
|
98
|
+
*
|
|
99
|
+
* @default 'plain'
|
|
100
|
+
*/
|
|
101
|
+
valueType?: 'badge' | 'plain';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Bind the badge property to the dropdown value
|
|
105
|
+
*/
|
|
106
|
+
badgeValueProps?: Omit<BadgeProps, 'label'>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Set the input border style
|
|
110
|
+
*
|
|
111
|
+
* @default 'default'
|
|
112
|
+
*/
|
|
113
|
+
inputBorder?: 'none' | 'default';
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A property to uniquely identify an option.
|
|
117
|
+
*/
|
|
118
|
+
dataKey?: string | undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Determines if the field uses a validator
|
|
122
|
+
*/
|
|
123
|
+
useValidator?: boolean;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Determines if the field is mandatory
|
|
127
|
+
*/
|
|
128
|
+
mandatory?: boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Show the text (opsional)
|
|
132
|
+
*
|
|
133
|
+
* @default true if mandatory true
|
|
134
|
+
*/
|
|
135
|
+
showOptionalText?: boolean;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Set custom validator message.
|
|
139
|
+
* It is rarely use, this component has handled the validator message.
|
|
140
|
+
*
|
|
141
|
+
*
|
|
142
|
+
* @example: 'This field is required'
|
|
143
|
+
* @example: { empty: 'This field is required' }
|
|
144
|
+
*/
|
|
145
|
+
validatorMessage?: string | CustomValidation<'empty'>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Wether to format the message
|
|
149
|
+
*
|
|
150
|
+
* @default true
|
|
151
|
+
*/
|
|
152
|
+
formatValidatorMessage?: boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Set custom invalid state.
|
|
156
|
+
*/
|
|
157
|
+
invalid?: boolean;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* This prop is required if you use this component in a form input.
|
|
161
|
+
* Specify the unique field name, match with your needs for API request.
|
|
162
|
+
*
|
|
163
|
+
* @default 'dropdown'
|
|
164
|
+
*/
|
|
165
|
+
fieldName?: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Default text to display when no option is selected.
|
|
169
|
+
*
|
|
170
|
+
* @default `Select ${label}`
|
|
171
|
+
*/
|
|
172
|
+
placeholder?: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Whether the dropdown is in loading state.
|
|
176
|
+
* @defaultValue false
|
|
177
|
+
*/
|
|
178
|
+
loading?: boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Show icon 'info' on the right side of label.
|
|
182
|
+
* Show information to user about the field on icon hover.
|
|
183
|
+
*/
|
|
184
|
+
fieldInfo?: string;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Set disabled state for input dropdown.
|
|
188
|
+
*/
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Whether show the Dropdown option search or not.
|
|
193
|
+
*
|
|
194
|
+
* @default true,
|
|
195
|
+
*/
|
|
196
|
+
filter?: boolean;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* The filter input Placeholder
|
|
200
|
+
*
|
|
201
|
+
* @default 'Search'
|
|
202
|
+
*/
|
|
203
|
+
filterPlaceholder?: string;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface DropdownSlots {
|
|
207
|
+
'value': Slot<{ value: string; originalValue: any }>;
|
|
208
|
+
'option': Slot<{ option: DropdownOption }>;
|
|
209
|
+
'addon-left': Slot;
|
|
210
|
+
'addon-right': Slot;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Dropdown component emits
|
|
215
|
+
*/
|
|
216
|
+
export type DropdownEmits = {
|
|
217
|
+
/**
|
|
218
|
+
* Emits when an option selected.
|
|
219
|
+
*/
|
|
220
|
+
'update:modelValue': [value: OptionValue | undefined];
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Emits when overlay shown.
|
|
224
|
+
*/
|
|
225
|
+
'show': [];
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* **WangsVue - Dropdown**
|
|
230
|
+
*
|
|
231
|
+
* _Dropdown also known as Select, is used to choose an item from a collection of options._
|
|
232
|
+
*
|
|
233
|
+
* --- ---
|
|
234
|
+
* 
|
|
235
|
+
*
|
|
236
|
+
* @group Component
|
|
237
|
+
*/
|
|
238
|
+
declare class Dropdown extends ClassComponent<
|
|
239
|
+
DropdownProps,
|
|
240
|
+
DropdownSlots,
|
|
241
|
+
DropdownEmits
|
|
242
|
+
> {
|
|
243
|
+
/**
|
|
244
|
+
* Shows the overlay.
|
|
245
|
+
*
|
|
246
|
+
* @memberof MultiSelect
|
|
247
|
+
*/
|
|
248
|
+
showOverlay(): void;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare module '@vue/runtime-core' {
|
|
252
|
+
interface GlobalComponents {
|
|
253
|
+
Dropdown: GlobalComponentConstructor<Dropdown>;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export default Dropdown;
|