@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.
Files changed (148) hide show
  1. package/components/animation/Animation.vue.d.ts +32 -0
  2. package/components/approverinfo/ApproverInfo.vue.d.ts +51 -0
  3. package/components/assetinfo/AssetInfo.vue.d.ts +44 -0
  4. package/components/badge/Badge.vue.d.ts +73 -0
  5. package/components/badgegroup/BadgeGroup.vue.d.ts +54 -0
  6. package/components/basecomponent/index.d.ts +28 -0
  7. package/components/basetree/BaseTree.vue.d.ts +596 -0
  8. package/components/basetree/TreeNode.vue.d.ts +35 -0
  9. package/components/breadcrumb/Breadcrumb.vue.d.ts +26 -0
  10. package/components/button/Button.vue.d.ts +189 -0
  11. package/components/buttonImportExcel/ButtonImportExcel.vue.d.ts +35 -0
  12. package/components/buttonaddbyscan/ButtonAddByScan.vue.d.ts +40 -0
  13. package/components/buttonbulkaction/ButtonBulkAction.vue.d.ts +105 -0
  14. package/components/buttoncopy/ButtonCopy.vue.d.ts +26 -0
  15. package/components/buttondownload/ButtonDownload.vue.d.ts +80 -0
  16. package/components/buttonfilter/ButtonFilter.vue.d.ts +12 -0
  17. package/components/buttonradio/ButtonRadio.vue.d.ts +258 -0
  18. package/components/buttonscan/ButtonScan.vue.d.ts +202 -0
  19. package/components/buttonsearch/ButtonSearch.vue.d.ts +38 -0
  20. package/components/buttonsearchbyscan/ButtonSearchByScan.vue.d.ts +46 -0
  21. package/components/buttonselecttree/ButtonSelectTree.vue.d.ts +201 -0
  22. package/components/buttonsplit/ButtonSplit.vue.d.ts +352 -0
  23. package/components/buttonsync/ButtonSync.vue.d.ts +22 -0
  24. package/components/buttontoggle/ButtonToggle.vue.d.ts +19 -0
  25. package/components/buttonviewlog/ButtonViewLog.vue.d.ts +17 -0
  26. package/components/calendar/Calendar.vue.d.ts +598 -0
  27. package/components/card/Card.vue.d.ts +140 -0
  28. package/components/carousel/Carousel.vue.d.ts +28 -0
  29. package/components/checkbox/Checkbox.vue.d.ts +330 -0
  30. package/components/customcolumn/CustomColumn.vue.d.ts +37 -0
  31. package/components/datatable/DataTable.vue.d.ts +745 -0
  32. package/components/datepicker/DatePicker.vue.d.ts +52 -0
  33. package/components/daypicker/DayPicker.vue.d.ts +52 -0
  34. package/components/dialog/Dialog.vue.d.ts +465 -0
  35. package/components/dialogassetnamedetail/DialogAssetNameDetail.vue.d.ts +46 -0
  36. package/components/dialogassetnamedetail/options/columns.d.ts +2 -0
  37. package/components/dialogassetnamedetail/options/filter.d.ts +2 -0
  38. package/components/dialogconfirm/DialogConfirm.vue.d.ts +165 -0
  39. package/components/dialogform/DialogForm.vue.d.ts +350 -0
  40. package/components/dialoglinkedasset/DialogLinkedAsset.vue.d.ts +106 -0
  41. package/components/dialogprintqr/DialogPrintQR.vue.d.ts +18 -0
  42. package/components/dialogreportdamage/DialogReportDamage.vue.d.ts +34 -0
  43. package/components/dialogreportmissing/DialogReportMissing.vue.d.ts +33 -0
  44. package/components/dialogreporttag/DialogReportTag.vue.d.ts +31 -0
  45. package/components/dialogselecttree/DialogSelectTree.vue.d.ts +137 -0
  46. package/components/dialogselectuser/DialogSelectUser.vue.d.ts +102 -0
  47. package/components/dialogselectuser/options/columns.d.ts +3 -0
  48. package/components/dialogtransferlog/DialogTransferLog.vue.d.ts +16 -0
  49. package/components/dropdown/Dropdown.vue.d.ts +288 -0
  50. package/components/editor/Editor.vue.d.ts +192 -0
  51. package/components/fieldwrapper/FieldWrapper.vue.d.ts +86 -0
  52. package/components/fileupload/FileUpload.vue.d.ts +170 -0
  53. package/components/filtercontainer/FilterContainer.vue.d.ts +217 -0
  54. package/components/form/Form.vue.d.ts +319 -0
  55. package/components/icon/Icon.vue.d.ts +260 -0
  56. package/components/image/Image.vue.d.ts +411 -0
  57. package/components/imagecompressor/ImageCompressor.vue.d.ts +237 -0
  58. package/components/index.d.ts +83 -0
  59. package/components/inlinemessage/InlineMessage.vue.d.ts +167 -0
  60. package/components/inputbadge/InputBadge.vue.d.ts +122 -0
  61. package/components/inputcurrency/InputCurrency.vue.d.ts +170 -0
  62. package/components/inputcurrency/helpers/currency.helper.d.ts +8 -0
  63. package/components/inputemail/InputEmail.vue.d.ts +26 -0
  64. package/components/inputnumber/InputNumber.vue.d.ts +288 -0
  65. package/components/inputotp/InputOtp.vue.d.ts +3 -0
  66. package/components/inputpassword/InputPassword.vue.d.ts +33 -0
  67. package/components/inputphonenumber/InputPhoneNumber.vue.d.ts +99 -0
  68. package/components/inputrangenumber/InputRangeNumber.vue.d.ts +121 -0
  69. package/components/inputsearch/InputSearch.vue.d.ts +36 -0
  70. package/components/inputtext/InputText.vue.d.ts +353 -0
  71. package/components/inputurl/InputURL.vue.d.ts +41 -0
  72. package/components/invisiblefield/InvisibleField.vue.d.ts +32 -0
  73. package/components/languagedropdown/LanguageDropdown.vue.d.ts +33 -0
  74. package/components/languageswitcher/LanguageSwitcher.vue.d.ts +15 -0
  75. package/components/litedropdown/LiteDropdown.vue.d.ts +98 -0
  76. package/components/loading/Loading.vue.d.ts +47 -0
  77. package/components/loading/store/loading.store.d.ts +8 -0
  78. package/components/menu/Menu.vue.d.ts +391 -0
  79. package/components/menuitem/index.d.ts +106 -0
  80. package/components/multiselect/MultiSelect.vue.d.ts +195 -0
  81. package/components/overlaypanel/OverlayPanel.vue.d.ts +302 -0
  82. package/components/paginator/Paginator.vue.d.ts +285 -0
  83. package/components/passthrough/index.d.ts +16 -0
  84. package/components/steps/Steps.vue.d.ts +20 -0
  85. package/components/tabmenu/TabMenu.vue.d.ts +104 -0
  86. package/components/tagtype/TagType.vue.d.ts +26 -0
  87. package/components/textarea/Textarea.vue.d.ts +171 -0
  88. package/components/timeline/Timeline.vue.d.ts +140 -0
  89. package/components/toast/Toast.vue.d.ts +368 -0
  90. package/components/toggleswitch/ToggleSwitch.vue.d.ts +282 -0
  91. package/components/transactionroles/TransactionRoles.vue.d.ts +58 -0
  92. package/components/tree/Tree.vue.d.ts +151 -0
  93. package/components/tree/helpers/filterNodeKeys.helper.d.ts +22 -0
  94. package/components/tree/helpers/flattenTreeNodeChildren.helper.d.ts +8 -0
  95. package/components/treesearchinput/TreeSearchInput.vue.d.ts +16 -0
  96. package/components/ts-helpers.d.ts +91 -0
  97. package/components/username/UserName.vue.d.ts +123 -0
  98. package/components/userwithicon/UserWithIcon.vue.d.ts +21 -0
  99. package/components/validatormessage/ValidatorMessage.vue.d.ts +12 -0
  100. package/config/defaultProps.d.ts +3 -0
  101. package/config/index.d.ts +3 -0
  102. package/config/locale.d.ts +3 -0
  103. package/directives/focus.d.ts +7 -0
  104. package/directives/index.d.ts +1 -0
  105. package/event-bus/index.d.ts +66 -0
  106. package/event-bus/mitt.d.ts +41 -0
  107. package/loading-page-BrQattYE.js +1 -0
  108. package/loading-page-CgfbWppy.js +1 -0
  109. package/loading-page-CoC9UhfC.js +4 -0
  110. package/loading-page-CoXtqoc9.js +4 -0
  111. package/loading-page-DbLuqCHa.js +1 -0
  112. package/loading-page-f8D03l3G.js +4 -0
  113. package/loading-plane-CgfbWppy.js +1 -0
  114. package/loading-plane-CoXtqoc9.js +4 -0
  115. package/loading-table-Bdr9ZhtP.js +1 -0
  116. package/loading-table-ByUoWqUo.js +4 -0
  117. package/loading-table-BygEMzFM.js +4 -0
  118. package/loading-table-BzrSQlA0.js +1 -0
  119. package/loading-table-D9bw9OcI.js +4 -0
  120. package/loading-table-chOgXi94.js +1 -0
  121. package/main.d.ts +34 -0
  122. package/no-data-CTKux8RI.js +4 -0
  123. package/no-data-Cgze_Rvp.js +1 -0
  124. package/no-data-DLHO1L_u.js +4 -0
  125. package/no-data-Dep79CBh.js +1 -0
  126. package/no-data-g0dJCy2p.js +4 -0
  127. package/no-data-y1X5WtcQ.js +1 -0
  128. package/package.json +27 -0
  129. package/plugins/VueHtmlToPaper.d.ts +11 -0
  130. package/plugins/WangsVue.d.ts +311 -0
  131. package/plugins/formValidation.d.ts +20 -0
  132. package/plugins/i18n-extension.d.ts +4 -0
  133. package/plugins/i18n.d.ts +103 -0
  134. package/stats.html +4949 -0
  135. package/style.css +1 -0
  136. package/utils/date.util.d.ts +79 -0
  137. package/utils/exportToExcel.util.d.ts +27 -0
  138. package/utils/formatTagCode.util.d.ts +1 -0
  139. package/utils/getStatusSeverity.util.d.ts +33 -0
  140. package/utils/index.d.ts +9 -0
  141. package/utils/isBasic.util.d.ts +1 -0
  142. package/utils/listenSidebarChanges.util.d.ts +16 -0
  143. package/utils/object.util.d.ts +27 -0
  144. package/utils/role.util.d.ts +70 -0
  145. package/utils/toast.util.d.ts +120 -0
  146. package/utils/xlsx.util.d.ts +19 -0
  147. package/wangsvue-fats.js +57238 -0
  148. package/wangsvue-fats.system.js +427 -0
@@ -0,0 +1,745 @@
1
+ import { Component } from 'vue';
2
+
3
+ import { DialogConfirmProps } from '../../components/dialogconfirm/DialogConfirm.vue.d';
4
+ import { MenuItem } from '../../components/menuitem';
5
+ import { DateOptions } from '../../utils/date.util';
6
+
7
+ import { WangsIconseverities } from '../icon/Icon.vue.d';
8
+ import { ClassComponent, HintedString } from '../ts-helpers.d';
9
+
10
+ export interface DataTableLocaleConfig {
11
+ /**
12
+ * Message to display on loading ovevrlay while downloading
13
+ */
14
+ downloadingMessage: string;
15
+
16
+ /**
17
+ * Text when booleanValue is true
18
+ */
19
+ trueText: string;
20
+
21
+ /**
22
+ * Text when booleanValue is false
23
+ */
24
+ falseText: string;
25
+ }
26
+
27
+ export type ChildGroup = {
28
+ groupHeader: string;
29
+ groupItems: Data[];
30
+ };
31
+
32
+ export type Data = Record<string, any> & {
33
+ children?: ChildGroup[];
34
+ hasChildren?: boolean;
35
+ };
36
+
37
+ export type QueryParams = Partial<Record<string, any>>;
38
+
39
+ /**
40
+ * Custom sort event.
41
+ * @see {@link BaseDataTableEmits.sort}
42
+ */
43
+ export interface DataTableSortEvent {
44
+ /**
45
+ * Browser event.
46
+ */
47
+ originalEvent: Event;
48
+ /**
49
+ * Number of rows to display in new page
50
+ */
51
+ rows: number;
52
+ /**
53
+ * Field to sort against
54
+ */
55
+ sortField: string | undefined;
56
+ /**
57
+ * Sort order as integer
58
+ */
59
+ sortOrder: 1 | 0 | -1 | undefined | null;
60
+ }
61
+
62
+ /**
63
+ * Custom pagination event.
64
+ * @see {@link BaseDataTableEmits.page}
65
+ * @extends DataTableSortEvent
66
+ */
67
+ export interface DataTablePageEvent extends DataTableSortEvent {
68
+ /**
69
+ * New page number
70
+ */
71
+ page: number;
72
+ /**
73
+ * Total page count
74
+ */
75
+ pageCount: number;
76
+ }
77
+
78
+ /**
79
+ * Custom datatable operator filter metadata.
80
+ */
81
+ export interface DataTableOperatorFilterMetaData {
82
+ /**
83
+ * Filter operator
84
+ */
85
+ operator: string;
86
+ /**
87
+ * Array of filter meta data.
88
+ */
89
+ constraints: DataTableFilterMetaData[];
90
+ }
91
+
92
+ /**
93
+ * Custom datatable filter metadata.
94
+ */
95
+ export interface DataTableFilterMetaData {
96
+ /**
97
+ * Filter value
98
+ */
99
+ value: any;
100
+ /**
101
+ * Filter match mode
102
+ */
103
+ matchMode:
104
+ | HintedString<
105
+ | 'startsWith'
106
+ | 'contains'
107
+ | 'notContains'
108
+ | 'endsWith'
109
+ | 'equals'
110
+ | 'notEquals'
111
+ | 'in'
112
+ | 'lt'
113
+ | 'lte'
114
+ | 'gt'
115
+ | 'gte'
116
+ | 'between'
117
+ | 'dateIs'
118
+ | 'dateIsNot'
119
+ | 'dateBefore'
120
+ | 'dateAfter'
121
+ >
122
+ | undefined;
123
+ }
124
+
125
+ /**
126
+ * Custom datatable filter metadata.
127
+ */
128
+ export interface DataTableFilterMeta {
129
+ /**
130
+ * Extra options
131
+ */
132
+ [key: string]:
133
+ | string
134
+ | DataTableFilterMetaData
135
+ | DataTableOperatorFilterMetaData;
136
+ }
137
+
138
+ export type FetchResponse<T = Data> = {
139
+ message: string;
140
+ data: {
141
+ data: T[];
142
+ totalRecords: number;
143
+ };
144
+ };
145
+
146
+ export type ShortFetchResponse<T = Data> = {
147
+ status: number;
148
+ message: string;
149
+ data: T[];
150
+ };
151
+
152
+ export type TableCellComponent = {
153
+ component: Component;
154
+ props?: object;
155
+ model?: any;
156
+ events?: any;
157
+ onChange?: (itemData: any) => void;
158
+ disabled?: boolean;
159
+ /**
160
+ * To tell DataTable component whether this component should stop propagation or not
161
+ *
162
+ * @default true - since old logic was automatically stop event click from bodyComponent
163
+ */
164
+ stop?: boolean;
165
+ };
166
+
167
+ export type TogglePresetConfirmDialogProps = Omit<
168
+ DialogConfirmProps,
169
+ 'visible' | 'list' | 'onConfirm'
170
+ > & {
171
+ /**
172
+ * When the dialog should be shown?
173
+ * Pass a boolean returning function to show dialog when it returns true.
174
+ *
175
+ * @default both - leave this as undefined to show on both states
176
+ */
177
+ showWhen?:
178
+ | 'active'
179
+ | 'inactive'
180
+ | ((data: any, state: boolean) => boolean)
181
+ | ((data: any, state: boolean) => Promise<boolean>);
182
+ };
183
+
184
+ interface ColumnConfirmActionPresetBase {
185
+ /**
186
+ * Use dialog confirmation
187
+ */
188
+ confirmDialogProps?:
189
+ | TogglePresetConfirmDialogProps
190
+ | ((state: boolean, data: any) => TogglePresetConfirmDialogProps);
191
+
192
+ /**
193
+ * Callback for confirmation
194
+ */
195
+ onConfirm?: (state: boolean, data: any, revertFunction: () => void) => void;
196
+ }
197
+
198
+ export interface ColumnTogglePreset extends ColumnConfirmActionPresetBase {
199
+ type: 'toggle';
200
+
201
+ /**
202
+ *
203
+ * @param state boolean - the toggle state
204
+ * @param revertFunction - function to revert previous state when action failed or canceled
205
+ * @returns
206
+ */
207
+ onToggle?: (state: boolean, data: any, revertFunction: () => void) => void;
208
+
209
+ /**
210
+ * Add conditional disabling for each row
211
+ */
212
+ disabled?: boolean | ((data: any) => boolean);
213
+ }
214
+
215
+ export interface ColumnCheckboxPreset extends ColumnConfirmActionPresetBase {
216
+ type: 'checkbox';
217
+
218
+ /**
219
+ *
220
+ * @param state boolean - the checkbox state
221
+ * @param revertFunction - function to revert previous state when action failed or canceled
222
+ * @returns
223
+ */
224
+ onCheck?: (state: boolean, data: any, revertFunction: () => void) => void;
225
+
226
+ /**
227
+ * Add conditional disabling for each row
228
+ */
229
+ disabled?: boolean | ((data: any) => boolean);
230
+ }
231
+
232
+ export interface ColumnMultiRowPreset {
233
+ type: 'multirow';
234
+ fieldAttributes?: (data: any) => MultiRowAttribute[];
235
+ }
236
+
237
+ export interface MultiRowAttribute {
238
+ class?: string | string[];
239
+ value?: string;
240
+ bodyComponent?: TableCellComponent;
241
+ }
242
+
243
+ export type ColumnPreset =
244
+ | ColumnTogglePreset
245
+ | ColumnMultiRowPreset
246
+ | ColumnCheckboxPreset;
247
+
248
+ export interface TableColumn {
249
+ header?: string;
250
+ field: string;
251
+ fieldType?: 'string' | 'number' | 'boolean' | 'array';
252
+ info?: string;
253
+ infoSeverity?: WangsIconseverities;
254
+ editable?: boolean;
255
+ /**
256
+ * If the column is editable, only allow number inputs.
257
+ */
258
+ numberInputOnly?: boolean;
259
+ sortable?: boolean;
260
+ /**
261
+ * Whether the column can be re-ordered by column visibility.
262
+ * If set to false, the column will not appear on column visibility.
263
+ */
264
+ reorderable?: boolean;
265
+ /**
266
+ * Make the column cannot reordered by disabled drag-ability.
267
+ */
268
+ dragable?: boolean;
269
+ fixed?: boolean;
270
+ visible?: boolean;
271
+ /**
272
+ * Use commonly used component as preset
273
+ */
274
+ preset?: ColumnPreset;
275
+ /**
276
+ * Whether the column is checked by default, only for Custom Report Table
277
+ * @default true
278
+ */
279
+ checkedByDefault?: boolean;
280
+ /**
281
+ * The column width in pixel.
282
+ */
283
+ width?: number | string;
284
+ /**
285
+ * Exclude column from download/export excel.
286
+ */
287
+ excluded?: boolean;
288
+ /**
289
+ * Set the field for Export Excel, when you need to export different field of column field.
290
+ *
291
+ * @default undefined - the export field using column 'field'
292
+ */
293
+ exportField?: string;
294
+ /**
295
+ * Specify the header when exported
296
+ */
297
+ exportHeader?: string;
298
+ /**
299
+ * Specify the property or field which value in the array should be used for exporting to Excel.
300
+ *
301
+ * @example 'field.name.fullName'
302
+ */
303
+ arrayValueField?: string;
304
+ /**
305
+ * Download Excel Config
306
+ *
307
+ * When needs to export only the property has Truthy value, set this to true,
308
+ * The Excel result will only get the property object which the value is truthy.
309
+ *
310
+ * @example
311
+ * Example Object:
312
+ * "roles": {
313
+ * roleA: true,
314
+ * roleB: true,
315
+ * roleC: false,
316
+ * roleD: null, // falsy
317
+ * roleE: '', // falsy
318
+ * roleF: 'role', // truthy
319
+ * }
320
+ *
321
+ * The result will be: "roleA, roleB, roleF" - Only the properties with truthy values will be included.
322
+ */
323
+ includeTruthyProperties?: boolean;
324
+ /**
325
+ * Convert boolean into text Yes/No
326
+ */
327
+ booleanValue?: boolean;
328
+ /**
329
+ * Specify the options for formatting date values using the formatDate utility.
330
+ *
331
+ * The date format primarily uses the general settings configurations.
332
+ * Within this property, you only need to set the `showTime` or `showDate` options.
333
+ */
334
+ dateFormatOptions?: DateOptions;
335
+ /**
336
+ * Set the fallback text when the cell value is empty. Used in export excel.
337
+ *
338
+ * @example 'N/A'
339
+ */
340
+ emptyText?: string;
341
+ bodyTemplate?: (data: any, index: number) => string | undefined;
342
+ bodyComponent?: (data: any, index: number) => TableCellComponent;
343
+ headerTemplate?: () => string;
344
+ headerComponent?: () => {
345
+ component: string | Component;
346
+ props?: any;
347
+ model?: any;
348
+ events?: any;
349
+ onChange?: (data: any) => void;
350
+ disabled?: boolean;
351
+ };
352
+ /**
353
+ * Inline style of header, body and footer cells.
354
+ */
355
+ style?: string | (() => string);
356
+ /**
357
+ * Style class of header, body and footer cells.
358
+ */
359
+ class?: string | string[] | (() => string | string[]);
360
+ /**
361
+ * Inline style of the column header.
362
+ */
363
+ headerStyle?: string | (() => string);
364
+ /**
365
+ * Style class of the column header.
366
+ */
367
+ headerClass?: string | string[] | (() => string | string[]);
368
+ /**
369
+ * Inline style of the column body.
370
+ */
371
+ bodyStyle?: string | (() => string);
372
+ /**
373
+ * Style class of the column body.
374
+ */
375
+ bodyClass?: string | string[] | ((data?: any) => string | string[]);
376
+ }
377
+
378
+ /**
379
+ * Extending the base table column, tree table column will only available when props.treeTable is sets to be `true`
380
+ */
381
+ export interface TreeTableColumns extends TableColumn {
382
+ /**
383
+ * How much the column spanning
384
+ */
385
+ colspan?: number;
386
+ /**
387
+ * The list of parents columns fields
388
+ * The colspan will be counted from it lengths
389
+ * This column will be shown when at least one of parent columns is visible
390
+ *
391
+ * @example
392
+ * This column spans from parent column A to C,
393
+ * this property value should be ['a', 'b', 'c'],
394
+ * which each value in array is a 'column.field' of the parent columns
395
+ *
396
+ * The counted colspan will be 3
397
+ */
398
+ parentColumnsFields?: string[];
399
+ }
400
+
401
+ /**
402
+ * Emit payload for `cellEdited`
403
+ */
404
+ export interface DataTableCellEditedEvent {
405
+ item: Data;
406
+ field: string;
407
+ index: number;
408
+ value?: string;
409
+ }
410
+
411
+ /**
412
+ * Emit payload for `rowReorder`
413
+ */
414
+ export interface DataTableRowReorderEvent {
415
+ item: Data;
416
+ fromIndex?: number;
417
+ toIndex?: number;
418
+ }
419
+
420
+ /**
421
+ * Custom row click event.
422
+ * @see {@link DataTableEmits['row-click']}
423
+ */
424
+ export interface DataTableRowClickEvent {
425
+ /**
426
+ * Browser event.
427
+ */
428
+ originalEvent: Event;
429
+ /**
430
+ * Selected row data.
431
+ */
432
+ data: any;
433
+ /**
434
+ * Row index.
435
+ */
436
+ index: number;
437
+ }
438
+
439
+ export type ChildTableProps = Partial<Omit<TreeTableProps, 'fetchFunction'>> & {
440
+ /**
441
+ * Use the header of each column in child table
442
+ *
443
+ * @default false
444
+ */
445
+ useColumnsHeader?: boolean;
446
+ /**
447
+ * The function to fetch data on row expand
448
+ */
449
+ fetchFunction?: (
450
+ parentData: Data,
451
+ ) => Promise<ShortFetchResponse<ChildGroup> | undefined>;
452
+ };
453
+
454
+ export interface TreeTableProps
455
+ extends Omit<
456
+ BaseDataTableProps,
457
+ 'columns' | 'treeTable' | 'childTableProps'
458
+ > {
459
+ /**
460
+ * Activate tree table mode
461
+ */
462
+ treeTable?: true;
463
+ /**
464
+ * V-model single selection. Works with selectionType 'single'
465
+ */
466
+ singleSelection?: Data;
467
+ /**
468
+ * An array of table columns to display.
469
+ */
470
+ columns: TreeTableColumns[];
471
+ /**
472
+ * Properties to be passed into sub table
473
+ */
474
+ childTableProps?: ChildTableProps;
475
+ }
476
+
477
+ export interface BaseDataTableProps {
478
+ /**
479
+ * Disable tree table mode
480
+ */
481
+ treeTable?: false;
482
+ childTableProps?: undefined;
483
+ /**
484
+ * Optional property to set a unique name for the table. This name will be used as part of the unique table ID.
485
+ *
486
+ * @optional
487
+ */
488
+ tableName?: string;
489
+ /**
490
+ * Optional property to set a unique name for the table. This name will be used as table title when export table into excel.
491
+ *
492
+ * @optional
493
+ */
494
+ tableTitle?: string;
495
+ /**
496
+ * An array of table columns to display.
497
+ */
498
+ columns: TableColumn[];
499
+ /**
500
+ * Whether show single action option.
501
+ * @default true;
502
+ */
503
+ useOption?: boolean;
504
+ /**
505
+ * An array of objects to display in the table.
506
+ */
507
+ data?: Data[];
508
+ /**
509
+ * The key of the data object to use as a unique identifier.
510
+ *
511
+ * @default '_id'
512
+ */
513
+ dataKey?: string;
514
+ /**
515
+ * The key of the data object to determine whether the row data should be disabled.
516
+ */
517
+ disableKey?: string;
518
+ /**
519
+ * Determine whether disabled rows should be included in the check all process or not
520
+ */
521
+ includeCheckDisabledRows?: boolean;
522
+ /**
523
+ * The key of data object to determine whether the row data has context highlighted or not
524
+ */
525
+ highlightKey?: string;
526
+ /**
527
+ * Boolean to specify whether all rows should be disabled.
528
+ */
529
+ disableAllRows?: boolean;
530
+ /**
531
+ * The query search from ButtonSearch component.
532
+ *
533
+ * @deprecated - not fully supported, may not works properly
534
+ */
535
+ search?: string;
536
+ /**
537
+ * Tag query for search by scan
538
+ * @deprecated - not fully supported, may not works properly
539
+ */
540
+ tag?: string;
541
+ /**
542
+ * The default query params that must be included every fetch request.
543
+ */
544
+ defaultQueryParams?: Readonly<Record<string, any>>;
545
+ /**
546
+ * The function to fetch data on DataTable mounted and on queryParams dependencies updated.
547
+ *
548
+ * @param params this is required
549
+ */
550
+ fetchFunction?: (params: QueryParams) => Promise<FetchResponse | undefined>;
551
+ /**
552
+ * The number of rows to display per page.
553
+ * @defaultValue 5
554
+ */
555
+ rows?: number;
556
+ /**
557
+ * Whether all rows are selected or not.
558
+ */
559
+ isSelectedAll?: boolean;
560
+ filters?: DataTableFilterMeta;
561
+ /**
562
+ * Determine the type of DataTable.
563
+ *
564
+ * Sets to lazy if you need to dynamically shows data.
565
+ */
566
+ lazy?: boolean;
567
+ // Sets loading animation for DataTable that's not lazy.
568
+ loading?: boolean;
569
+ /**
570
+ * Whether to enable 'checkbox' | 'single' selection.
571
+ *
572
+ * @default 'checkbox'
573
+ */
574
+ selectionType?: 'single' | 'checkbox' | 'none';
575
+ /**
576
+ * Whether to enable checkbox multi-selection.
577
+ *
578
+ * @deprecated use 'selection-type="checkbox"'
579
+ */
580
+ useSelection?: boolean;
581
+ /**
582
+ * An array of selected objects from `data`.
583
+ */
584
+ selectedData?: Data[];
585
+ /**
586
+ * An array of selected objects from `data`.
587
+ */
588
+ expandedRows?: { [key: string]: boolean };
589
+ /**
590
+ * Whether display pagination under the table or not.
591
+ */
592
+ usePaginator?: boolean;
593
+ /**
594
+ * The options that will be visible for each row data.
595
+ *
596
+ * __Provide at least one option to display an Options Menu for each row.__
597
+ *
598
+ * The options menu will be displayed on the right side of the table row.
599
+ */
600
+ options?: MenuItem[];
601
+ /**
602
+ * Whether to enable single selection or not.
603
+ * If enabled, clicking a row will trigger the `rowSelect` event with the corresponding data object passed as a parameter.
604
+ *
605
+ * @deprecated use 'selection-type="single"'
606
+ * @note Do not combine `singleSelect` with `useSelection`, as it may lead to unexpected behavior.
607
+ */
608
+ singleSelect?: boolean;
609
+ /**
610
+ * Whether the column is customizable or not.
611
+ *
612
+ * @default true - the table is able to reorder and toggle visibility column;
613
+ */
614
+ customColumn?: boolean;
615
+ /**
616
+ * Props to set scroll height, this will make table content scrollable
617
+ * @example '50vh' or '300px'
618
+ */
619
+ scrollHeight?: string;
620
+ /**
621
+ * When the row height sets to fixed, it will have 35px height
622
+ *
623
+ * @defaultValue 'fixed'
624
+ */
625
+ rowHeight?: 'fixed' | 'auto';
626
+ /**
627
+ * To determine if row table is reorder-able
628
+ */
629
+ reorderable?: boolean;
630
+ /**
631
+ * An array of fields as string to use in global filtering.
632
+ *
633
+ * @default undefined - All fields are used
634
+ */
635
+ globalFilterFields?: string[];
636
+ /**
637
+ * Total disabled rows in table (used for synchronizing with bulk action button)
638
+ */
639
+ totalDisabledRows?: number;
640
+ /**
641
+ * Specify the error message download excel
642
+ *
643
+ * @example 'Error, failed to download {fileName}' - fileName will be replaced
644
+ */
645
+ excelToastErrorMessage?: string;
646
+ /**
647
+ * Custom message when data table is empty
648
+ *
649
+ * Will be shown bellow no-data animation
650
+ */
651
+ emptyTableMessage?: string;
652
+ }
653
+
654
+ export type DataTableProps = BaseDataTableProps | TreeTableProps;
655
+
656
+ export type BaseDataTableEmits = {
657
+ /**
658
+ * Emits when option menu button clicked.
659
+ */
660
+ 'toggleOption': [data: Data];
661
+ /**
662
+ * @deprecated use 'v-model:selected-data' instead.
663
+ */
664
+ 'selectData': [data: Data[]];
665
+ 'rowSelect': [data: DataTableRowClickEvent];
666
+ /**
667
+ * Event emitted when the page changes in the data table.
668
+ *
669
+ * @event page
670
+ * @param {DataTablePageEvent} data - The event data containing information about the new page.
671
+ *
672
+ * @example
673
+ * <DataTable @page="handlePageChange" />
674
+ *
675
+ * This will call the `handlePageChange` method whenever the page changes in the data table.
676
+ */
677
+ 'page': [data: DataTablePageEvent];
678
+
679
+ /**
680
+ * Event emitted when the sort order changes in the data table.
681
+ *
682
+ * @event sort
683
+ * @param {DataTableSortEvent} data - The event data containing information about the new sort order.
684
+ *
685
+ * @example
686
+ * <DataTable @sort="handleSortChange" />
687
+ *
688
+ * This will call the `handleSortChange` method whenever the sort order changes in the data table.
689
+ */
690
+ 'sort': [data: DataTableSortEvent];
691
+ /**
692
+ * Event emitted when the `selectedData` property is updated.
693
+ *
694
+ * @event update:selectedData
695
+ * @param {Data[]} datas - The updated array of selected data objects.
696
+ *
697
+ * @example
698
+ * <DataTable v-model:selected-data="selectedData" />
699
+ *
700
+ * This will update the `selectedData` value whenever a row is selected or deselected.
701
+ */
702
+ 'update:selectedData': [datas: Data[]];
703
+ };
704
+
705
+ export type TreeTableEmits = BaseDataTableEmits & {
706
+ /**
707
+ * Emitted when a row is clicked/selected. Only available on `single` selectionType
708
+ */
709
+ 'update:singleSelection': [data: Data];
710
+ /**
711
+ * Emitted when cell has lost focus.
712
+ */
713
+ 'cellEdited': [payload: DataTableCellEditedEvent];
714
+ /**
715
+ * @deprecated - use new emits `cellEdited`
716
+ */
717
+ 'input': [payload: DataTableCellEditedEvent];
718
+ /**
719
+ * Emitted on Drop Event occurred after dragging a row.
720
+ * Only available on
721
+ *
722
+ */
723
+ 'rowReorder': [payload?: DataTableRowReorderEvent];
724
+ };
725
+
726
+ export type DataTableEmits = TreeTableEmits;
727
+
728
+ /**
729
+ * **WangsVue - DataTable**
730
+ *
731
+ * * _DataTable displays data in tabular format._
732
+ *
733
+ * [Live Demo](https://fewangsit.github.io/wangsvue/table)
734
+ * --- ---
735
+ * ![WangsVue](https://www.wangs.id/wp-content/uploads/2023/12/cropped-Logo_Wangsid-removebg-preview-192x192.png)
736
+ *
737
+ * @group Component
738
+ */
739
+ declare class DataTable extends ClassComponent<
740
+ DataTableProps,
741
+ Record<string, unknown>,
742
+ DataTableEmits
743
+ > {}
744
+
745
+ export default DataTable;