@fewangsit/wangsvue-fats 1.0.0-alpha.30 → 1.0.0-alpha.31

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