@dataloop-ai/components 0.18.145 → 0.19.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/package.json +4 -1
- package/src/assets/constants.scss +25 -26
- package/src/assets/globals.scss +58 -56
- package/src/assets/grid.css +1 -1
- package/src/assets/grid.scss +4 -4
- package/src/components/basic/DlAccordion/DlAccordion.vue +10 -3
- package/src/components/basic/DlEmptyState/types.ts +1 -1
- package/src/components/basic/DlGrid/DlGrid.vue +2 -1
- package/src/components/basic/DlPopup/DlPopup.vue +159 -396
- package/src/components/basic/DlWidget/DlWidget.vue +2 -1
- package/src/components/basic/utils.ts +0 -9
- package/src/components/blocks/DlLabelPicker/DlLabelPicker.vue +127 -0
- package/src/components/blocks/DlLabelPicker/index.ts +3 -0
- package/src/components/blocks/DlLabelPicker/types.ts +6 -0
- package/src/components/blocks/index.ts +1 -0
- package/src/components/blocks/types.ts +1 -0
- package/src/components/compound/DlCodeEditor/README.md +5 -4
- package/src/components/compound/DlCodeEditor/styles/themes-base16.css +16934 -11289
- package/src/components/compound/DlCodeEditor/styles/themes.css +5122 -3448
- package/src/components/compound/DlInput/DlInput.vue +609 -178
- package/src/components/compound/DlInput/components/InputFileElement.vue +97 -0
- package/src/components/compound/DlInput/types.ts +12 -0
- package/src/components/compound/DlInput/utils.ts +117 -0
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +10 -1
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +3 -3
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +1 -1
- package/src/components/compound/DlSlider/sliderStyles.scss +92 -92
- package/src/components/compound/DlTable/DlTable.vue +701 -358
- package/src/components/compound/DlTable/components/DlTd.vue +11 -9
- package/src/components/compound/DlTable/components/DlTh.vue +22 -21
- package/src/components/compound/DlTable/components/SortableJS.vue +33 -0
- package/src/components/compound/DlTable/hooks/tableActions.ts +3 -3
- package/src/components/compound/DlTable/hooks/tableColumnSelection.ts +3 -4
- package/src/components/compound/DlTable/hooks/use-sortable.ts +152 -0
- package/src/components/compound/DlTable/styles/dl-table-styles.scss +372 -377
- package/src/components/compound/DlTable/types.ts +6 -0
- package/src/components/compound/DlTable/utils/getCellValue.ts +27 -0
- package/src/components/compound/DlTable/utils/insertAtIndex.ts +22 -0
- package/src/components/compound/DlTable/utils/tableClasses.ts +22 -0
- package/src/components/compound/DlToast/api/useToast.ts +10 -4
- package/src/components/compound/DlToast/components/ToastComponent.vue +26 -21
- package/src/components/compound/DlToast/utils/render.ts +15 -8
- package/src/components/compound/DlTreeTable/DlTreeTable.vue +708 -323
- package/src/components/compound/DlTreeTable/components/DlTdTree.vue +10 -9
- package/src/components/compound/DlTreeTable/components/DlTrTree.vue +13 -0
- package/src/components/compound/DlTreeTable/emits.ts +2 -2
- package/src/components/compound/DlTreeTable/utils/index.ts +6 -0
- package/src/components/compound/DlTreeTable/utils/moveNestedRow.ts +95 -0
- package/src/components/compound/DlTreeTable/utils/trSpacing.ts +12 -1
- package/src/components/compound/DlTreeTable/utils/treeTableRowSelection.ts +10 -7
- package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +52 -58
- package/src/components/essential/DlMenu/DlMenu.vue +25 -0
- package/src/components/index.ts +1 -0
- package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +2 -1
- package/src/components/shared/DlVirtualScroll/styles/dl-virtual-scroll-styles.scss +62 -41
- package/src/components/types.ts +1 -0
- package/src/demos/DlAccordionDemo.vue +32 -0
- package/src/demos/DlButtonDemo.vue +7 -0
- package/src/demos/DlDemoPage.vue +1 -0
- package/src/demos/DlInputDemo.vue +122 -64
- package/src/demos/DlLabelPickerDemo.vue +46 -0
- package/src/demos/DlPopupDemo.vue +94 -4
- package/src/demos/DlSearchDemo.vue +0 -1
- package/src/demos/DlTableDemo.vue +261 -162
- package/src/demos/DlToastDemo.vue +28 -1
- package/src/demos/DlTreeTableDemo.vue +266 -262
- package/src/demos/DlVirtualScrollDemo.vue +1 -4
- package/src/demos/index.ts +3 -1
- package/src/hooks/use-model-toggle.ts +26 -62
- package/src/utils/browse-nested-nodes.ts +26 -0
- package/src/utils/draggable-table.ts +100 -488
- package/src/utils/get-element-above.ts +8 -0
- package/src/utils/getSlotByVersion.ts +11 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/keyCodes.ts +1 -1
- package/src/utils/remove-child-nodes.ts +5 -0
- package/src/utils/render-fn.ts +46 -0
- package/src/utils/resizable-table.ts +110 -0
- package/src/utils/selection.ts +196 -0
- package/src/utils/swap-nodes.ts +11 -0
- package/src/utils/table-columns.ts +209 -0
- package/src/components/compound/DlTable/utils/ResizableManager.ts +0 -236
- package/src/components/compound/DlTable/utils/index.ts +0 -1
- package/src/components/compound/DlTable/utils/props.ts +0 -120
- package/src/components/compound/DlTreeTable/props.ts +0 -134
- package/src/components/compound/DlTreeTable/utils/flatTreeData.ts +0 -19
|
@@ -2,95 +2,94 @@
|
|
|
2
2
|
<div style="width: 900px; align-items: inherit">
|
|
3
3
|
<div>
|
|
4
4
|
<div class="settings">
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<div>
|
|
58
|
-
<p>Draggable</p>
|
|
59
|
-
<DlOptionGroup
|
|
60
|
-
v-model="draggable"
|
|
61
|
-
inline
|
|
62
|
-
:options="[
|
|
63
|
-
{ label: 'rows', value: 'rows' },
|
|
64
|
-
{ label: 'columns', value: 'columns' },
|
|
65
|
-
{ label: 'both', value: 'both' },
|
|
66
|
-
{ label: 'none', value: 'none' }
|
|
67
|
-
]"
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<div>
|
|
72
|
-
<p>Selection</p>
|
|
73
|
-
<DlOptionGroup
|
|
74
|
-
v-model="selection"
|
|
75
|
-
inline
|
|
76
|
-
:options="[
|
|
77
|
-
{ label: 'none', value: 'none' },
|
|
78
|
-
{ label: 'single', value: 'single' },
|
|
79
|
-
{ label: 'multiple', value: 'multiple' }
|
|
80
|
-
]"
|
|
81
|
-
/>
|
|
5
|
+
<div class="left-panel">
|
|
6
|
+
<div class="option-group">
|
|
7
|
+
<p>Separator:</p>
|
|
8
|
+
<DlOptionGroup
|
|
9
|
+
v-model="separator"
|
|
10
|
+
inline
|
|
11
|
+
:options="[
|
|
12
|
+
{ label: 'Horizontal', value: 'horizontal' },
|
|
13
|
+
{ label: 'Vertical', value: 'vertical' },
|
|
14
|
+
{ label: 'Cell', value: 'cell' },
|
|
15
|
+
{ label: 'None', value: 'none' }
|
|
16
|
+
]"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="option-group">
|
|
21
|
+
<p>Draggable:</p>
|
|
22
|
+
<DlOptionGroup
|
|
23
|
+
v-model="draggable"
|
|
24
|
+
inline
|
|
25
|
+
:options="[
|
|
26
|
+
{ label: 'Rows', value: 'rows' },
|
|
27
|
+
{ label: 'Columns', value: 'columns' },
|
|
28
|
+
{ label: 'Both', value: 'both' },
|
|
29
|
+
{ label: 'None', value: 'none' }
|
|
30
|
+
]"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="option-group">
|
|
35
|
+
<p>Selection:</p>
|
|
36
|
+
<DlOptionGroup
|
|
37
|
+
v-model="selection"
|
|
38
|
+
inline
|
|
39
|
+
:options="[
|
|
40
|
+
{ label: 'None', value: 'none' },
|
|
41
|
+
{ label: 'Single', value: 'single' },
|
|
42
|
+
{ label: 'Multiple', value: 'multiple' }
|
|
43
|
+
]"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="filter-container">
|
|
48
|
+
<label for="filter">Filter:</label>
|
|
49
|
+
<dl-input
|
|
50
|
+
id="filter"
|
|
51
|
+
v-model="filter"
|
|
52
|
+
placeholder="Filter"
|
|
53
|
+
size="s"
|
|
54
|
+
type="text"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
82
57
|
</div>
|
|
83
58
|
|
|
84
|
-
<div>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
59
|
+
<div class="right-panel">
|
|
60
|
+
<button
|
|
61
|
+
class="btn"
|
|
62
|
+
@click="addRowPerPage"
|
|
63
|
+
>
|
|
64
|
+
Add Rows/Page
|
|
65
|
+
</button>
|
|
66
|
+
|
|
67
|
+
<div class="option-group">
|
|
68
|
+
<dl-switch
|
|
69
|
+
left-label="Bordered"
|
|
70
|
+
value="bordered"
|
|
71
|
+
:model-value="borderState"
|
|
72
|
+
@update:model-value="updateBorderedState"
|
|
73
|
+
/>
|
|
74
|
+
<dl-switch
|
|
75
|
+
left-label="Dense"
|
|
76
|
+
value="dense"
|
|
77
|
+
:model-value="denseState"
|
|
78
|
+
@update:model-value="updateDenseState"
|
|
79
|
+
/>
|
|
80
|
+
<dl-switch
|
|
81
|
+
left-label="Virtual Scroll"
|
|
82
|
+
value="vScroll"
|
|
83
|
+
:model-value="virtualScroll"
|
|
84
|
+
@update:model-value="updateVirtualScrollState"
|
|
85
|
+
/>
|
|
86
|
+
<dl-switch
|
|
87
|
+
left-label="Resizable"
|
|
88
|
+
value="resizable"
|
|
89
|
+
:model-value="resizableState"
|
|
90
|
+
@update:model-value="updateResizableState"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
94
93
|
</div>
|
|
95
94
|
</div>
|
|
96
95
|
<DlTable
|
|
@@ -115,37 +114,12 @@
|
|
|
115
114
|
@row-click="log"
|
|
116
115
|
@th-click="log"
|
|
117
116
|
@update:selected="updateSeleted"
|
|
117
|
+
@col-update="updateColumns"
|
|
118
|
+
@row-reorder="reorderRows"
|
|
118
119
|
/>
|
|
119
120
|
|
|
120
121
|
<div style="margin-top: 100px">
|
|
121
|
-
|
|
122
|
-
:selected="selected"
|
|
123
|
-
:separator="separator"
|
|
124
|
-
:columns="tableColumns"
|
|
125
|
-
:bordered="bordered"
|
|
126
|
-
:dense="dense"
|
|
127
|
-
class="sticky-header"
|
|
128
|
-
:filter="filter"
|
|
129
|
-
:selection="selection"
|
|
130
|
-
:loading="loading"
|
|
131
|
-
:rows="tableRows"
|
|
132
|
-
:resizable="resizable"
|
|
133
|
-
row-key="name"
|
|
134
|
-
color="dl-color-secondary"
|
|
135
|
-
title="Table Title"
|
|
136
|
-
:virtual-scroll="vScroll"
|
|
137
|
-
style="height: 500px"
|
|
138
|
-
:rows-per-page-options="rowsPerPageOptions"
|
|
139
|
-
hide-pagination
|
|
140
|
-
is-empty
|
|
141
|
-
@row-click="log"
|
|
142
|
-
@th-click="log"
|
|
143
|
-
@update:selected="updateSeleted"
|
|
144
|
-
/>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<div style="margin-top: 100px">
|
|
148
|
-
Custom Slot `row-body`
|
|
122
|
+
Custom Slot row-body
|
|
149
123
|
<DlTable
|
|
150
124
|
:selected="selected"
|
|
151
125
|
:separator="separator"
|
|
@@ -169,14 +143,9 @@
|
|
|
169
143
|
@update:selected="updateSeleted"
|
|
170
144
|
>
|
|
171
145
|
<template #row-body="props">
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
:key="key"
|
|
176
|
-
>
|
|
177
|
-
{{ props.row[value] }}
|
|
178
|
-
</dl-td>
|
|
179
|
-
</dl-tr>
|
|
146
|
+
<div style="width: 300px">
|
|
147
|
+
Custom row: {{ props.row.name }}
|
|
148
|
+
</div>
|
|
180
149
|
</template>
|
|
181
150
|
</DlTable>
|
|
182
151
|
</div>
|
|
@@ -287,6 +256,7 @@
|
|
|
287
256
|
:separator="separator"
|
|
288
257
|
:draggable="draggable"
|
|
289
258
|
:filter="filter"
|
|
259
|
+
:resizable="resizable"
|
|
290
260
|
:selection="selection"
|
|
291
261
|
:dense="dense"
|
|
292
262
|
title="Treats"
|
|
@@ -331,14 +301,10 @@
|
|
|
331
301
|
@update:selected="updateSeleted"
|
|
332
302
|
>
|
|
333
303
|
<template #pagination>
|
|
334
|
-
<div
|
|
335
|
-
< slot#pagination >
|
|
336
|
-
</div>
|
|
304
|
+
<div>< slot#pagination ></div>
|
|
337
305
|
</template>
|
|
338
306
|
<template #no-data>
|
|
339
|
-
<div
|
|
340
|
-
< slot#no-data > should not be visible
|
|
341
|
-
</div>
|
|
307
|
+
<div>< slot#no-data > should not be visible</div>
|
|
342
308
|
</template>
|
|
343
309
|
</DlTable>
|
|
344
310
|
<h4>case 2: table with no data</h4>
|
|
@@ -366,14 +332,10 @@
|
|
|
366
332
|
@update:selected="updateSeleted"
|
|
367
333
|
>
|
|
368
334
|
<template #pagination>
|
|
369
|
-
<div
|
|
370
|
-
< slot#pagination > should not be visible
|
|
371
|
-
</div>
|
|
335
|
+
<div>< slot#pagination > should not be visible</div>
|
|
372
336
|
</template>
|
|
373
337
|
<template #no-data>
|
|
374
|
-
<div
|
|
375
|
-
< slot#no-data >
|
|
376
|
-
</div>
|
|
338
|
+
<div>< slot#no-data ></div>
|
|
377
339
|
</template>
|
|
378
340
|
</DlTable>
|
|
379
341
|
</div>
|
|
@@ -406,20 +368,39 @@
|
|
|
406
368
|
<template #body-cell-name="{ row }">
|
|
407
369
|
{{ row.name }}
|
|
408
370
|
</template>
|
|
371
|
+
<template #body-cell-row-actions>
|
|
372
|
+
<dl-button label="ActionButton" />
|
|
373
|
+
</template>
|
|
409
374
|
</DlTable>
|
|
410
375
|
</div>
|
|
411
376
|
<div>
|
|
412
|
-
<p>With
|
|
377
|
+
<p>With editable columns</p>
|
|
413
378
|
<DlTable
|
|
414
379
|
:rows="tableRows"
|
|
415
380
|
:columns="tableColumns"
|
|
416
381
|
title="Editable Columns"
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
382
|
+
:visible-columns="tableColumns.slice(0, -1)"
|
|
383
|
+
/>
|
|
384
|
+
</div>
|
|
385
|
+
<div>
|
|
386
|
+
<p>Virtual With editable columns</p>
|
|
387
|
+
<DlTable
|
|
388
|
+
:rows="tableRows"
|
|
389
|
+
:columns="tableColumns"
|
|
390
|
+
:visible-columns="tableColumns.slice(0, -1)"
|
|
391
|
+
virtual-scroll
|
|
392
|
+
/>
|
|
393
|
+
</div>
|
|
394
|
+
<div>
|
|
395
|
+
<p>With nested field value</p>
|
|
396
|
+
<div style="font-size: 12px">
|
|
397
|
+
Row array looks like this: {{ rows2 }}
|
|
398
|
+
</div>
|
|
399
|
+
<DlTable
|
|
400
|
+
:rows="rows2"
|
|
401
|
+
:columns="columns2"
|
|
402
|
+
title="Nested Field"
|
|
403
|
+
/>
|
|
423
404
|
</div>
|
|
424
405
|
</div>
|
|
425
406
|
<div>
|
|
@@ -440,9 +421,7 @@ import {
|
|
|
440
421
|
DlOptionGroup,
|
|
441
422
|
DlSwitch,
|
|
442
423
|
DlInput,
|
|
443
|
-
DlButton
|
|
444
|
-
DlTr,
|
|
445
|
-
DlTd
|
|
424
|
+
DlButton
|
|
446
425
|
} from '../components'
|
|
447
426
|
import { defineComponent, ref, computed, nextTick } from 'vue-demi'
|
|
448
427
|
import { times, cloneDeep, isNumber } from 'lodash'
|
|
@@ -457,6 +436,7 @@ const columns = [
|
|
|
457
436
|
field: 'name',
|
|
458
437
|
sortable: true,
|
|
459
438
|
textTransform: 'uppercase',
|
|
439
|
+
width: 100,
|
|
460
440
|
hint: 'test hint'
|
|
461
441
|
},
|
|
462
442
|
{
|
|
@@ -465,18 +445,45 @@ const columns = [
|
|
|
465
445
|
label: 'Calories',
|
|
466
446
|
field: 'calories',
|
|
467
447
|
sortable: true,
|
|
468
|
-
|
|
448
|
+
width: 100
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: 'fat',
|
|
452
|
+
label: 'Fat (g)',
|
|
453
|
+
field: 'fat',
|
|
454
|
+
sortable: true,
|
|
455
|
+
align: 'center',
|
|
456
|
+
width: 100
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: 'carbs',
|
|
460
|
+
label: 'Carbs (g)',
|
|
461
|
+
field: 'carbs',
|
|
462
|
+
align: 'center',
|
|
463
|
+
width: 100
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: 'protein',
|
|
467
|
+
label: 'Protein (g)',
|
|
468
|
+
field: 'protein',
|
|
469
|
+
align: 'center',
|
|
470
|
+
width: 100
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
name: 'sodium',
|
|
474
|
+
label: 'Sodium (mg)',
|
|
475
|
+
field: 'sodium',
|
|
476
|
+
align: 'center',
|
|
477
|
+
width: 100
|
|
469
478
|
},
|
|
470
|
-
{ name: 'fat', label: 'Fat (g)', field: 'fat', sortable: true },
|
|
471
|
-
{ name: 'carbs', label: 'Carbs (g)', field: 'carbs' },
|
|
472
|
-
{ name: 'protein', label: 'Protein (g)', field: 'protein' },
|
|
473
|
-
{ name: 'sodium', label: 'Sodium (mg)', field: 'sodium' },
|
|
474
479
|
{
|
|
475
480
|
name: 'calcium',
|
|
476
481
|
label: 'Calcium (%)',
|
|
477
482
|
field: 'calcium',
|
|
478
483
|
sortable: true,
|
|
479
484
|
textTransform: 'lowercase',
|
|
485
|
+
align: 'center',
|
|
486
|
+
width: 100,
|
|
480
487
|
sort: (a: string | number, b: string | number) =>
|
|
481
488
|
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
482
489
|
},
|
|
@@ -486,11 +493,41 @@ const columns = [
|
|
|
486
493
|
field: 'iron',
|
|
487
494
|
sortable: true,
|
|
488
495
|
textTransform: 'lowercase',
|
|
496
|
+
align: 'center',
|
|
497
|
+
width: 100,
|
|
489
498
|
sort: (a: string | number, b: string | number) =>
|
|
490
499
|
parseInt(a as string, 10) - parseInt(b as string, 10)
|
|
491
500
|
}
|
|
492
501
|
]
|
|
493
502
|
|
|
503
|
+
const rows2 = [
|
|
504
|
+
{
|
|
505
|
+
name: {
|
|
506
|
+
title: 'Row 1',
|
|
507
|
+
subtitle: 'This row...'
|
|
508
|
+
}
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
name: {
|
|
512
|
+
title: 'Row 2',
|
|
513
|
+
subtitle: 'This other row...'
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
const columns2 = [
|
|
518
|
+
{
|
|
519
|
+
name: 'name',
|
|
520
|
+
required: true,
|
|
521
|
+
label: 'Nested value',
|
|
522
|
+
align: 'left',
|
|
523
|
+
field: 'name.subtitle',
|
|
524
|
+
sortable: true,
|
|
525
|
+
textTransform: 'uppercase',
|
|
526
|
+
width: 100,
|
|
527
|
+
hint: 'test hint'
|
|
528
|
+
}
|
|
529
|
+
]
|
|
530
|
+
|
|
494
531
|
const rows = [
|
|
495
532
|
{
|
|
496
533
|
name: 'Frozen Yogurt',
|
|
@@ -616,9 +653,7 @@ export default defineComponent({
|
|
|
616
653
|
DlSwitch,
|
|
617
654
|
DlOptionGroup,
|
|
618
655
|
DlInput,
|
|
619
|
-
DlButton
|
|
620
|
-
DlTr,
|
|
621
|
-
DlTd
|
|
656
|
+
DlButton
|
|
622
657
|
},
|
|
623
658
|
setup() {
|
|
624
659
|
const filter = ref('')
|
|
@@ -749,7 +784,18 @@ export default defineComponent({
|
|
|
749
784
|
setPagination({ page: pagesNumber.value })
|
|
750
785
|
}
|
|
751
786
|
|
|
787
|
+
const reorderRows = (newRows: any) => {
|
|
788
|
+
tableRows.value = newRows
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
const updateColumns = (newColumns: any) => {
|
|
792
|
+
console.log(newColumns)
|
|
793
|
+
tableColumns.value = newColumns
|
|
794
|
+
}
|
|
795
|
+
|
|
752
796
|
return {
|
|
797
|
+
reorderRows,
|
|
798
|
+
updateColumns,
|
|
753
799
|
filter,
|
|
754
800
|
selected,
|
|
755
801
|
selection,
|
|
@@ -777,7 +823,9 @@ export default defineComponent({
|
|
|
777
823
|
nextPage,
|
|
778
824
|
prevPage,
|
|
779
825
|
isLastPage,
|
|
780
|
-
isFirstPage
|
|
826
|
+
isFirstPage,
|
|
827
|
+
rows2,
|
|
828
|
+
columns2
|
|
781
829
|
}
|
|
782
830
|
},
|
|
783
831
|
|
|
@@ -811,7 +859,7 @@ export default defineComponent({
|
|
|
811
859
|
this.resizable = val.length !== 0
|
|
812
860
|
},
|
|
813
861
|
log(...args: any[]) {
|
|
814
|
-
console.log(...args)
|
|
862
|
+
// console.log(...args)
|
|
815
863
|
},
|
|
816
864
|
filterMethod(
|
|
817
865
|
rows: Record<string, any>[],
|
|
@@ -839,14 +887,65 @@ export default defineComponent({
|
|
|
839
887
|
<style scoped lang="scss">
|
|
840
888
|
.settings {
|
|
841
889
|
display: flex;
|
|
842
|
-
|
|
843
|
-
max-width: 600px;
|
|
890
|
+
align-items: flex-start;
|
|
844
891
|
gap: 10px;
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
892
|
+
padding: 10px;
|
|
893
|
+
background-color: #f4f4f4;
|
|
894
|
+
border-radius: 4px;
|
|
895
|
+
box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.left-panel {
|
|
899
|
+
display: flex;
|
|
900
|
+
flex-direction: column;
|
|
901
|
+
gap: 10px;
|
|
902
|
+
flex: 1;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.right-panel {
|
|
906
|
+
display: flex;
|
|
907
|
+
flex-direction: column;
|
|
908
|
+
align-items: flex-end;
|
|
909
|
+
gap: 10px;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.btn {
|
|
913
|
+
background-color: #007bff;
|
|
914
|
+
color: white;
|
|
915
|
+
border: none;
|
|
916
|
+
border-radius: 4px;
|
|
917
|
+
padding: 5px 10px;
|
|
918
|
+
cursor: pointer;
|
|
919
|
+
font-size: 12px;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.option-group {
|
|
923
|
+
display: flex;
|
|
924
|
+
flex-direction: column;
|
|
925
|
+
gap: 5px;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
p {
|
|
929
|
+
font-weight: bold;
|
|
930
|
+
font-size: 12px;
|
|
931
|
+
margin: 0;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.dl-switch {
|
|
935
|
+
display: flex;
|
|
936
|
+
align-items: center;
|
|
937
|
+
gap: 2px;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.filter-container {
|
|
941
|
+
display: flex;
|
|
942
|
+
align-items: center;
|
|
943
|
+
gap: 5px;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
label {
|
|
947
|
+
font-weight: bold;
|
|
948
|
+
font-size: 12px;
|
|
850
949
|
}
|
|
851
950
|
|
|
852
951
|
.sticky-header {
|
|
@@ -89,11 +89,14 @@
|
|
|
89
89
|
<dl-button @click="showToastMessage">
|
|
90
90
|
Show Toast Message
|
|
91
91
|
</dl-button>
|
|
92
|
+
<dl-button @click="showToastMessageCustom">
|
|
93
|
+
Show Toast Message
|
|
94
|
+
</dl-button>
|
|
92
95
|
</div>
|
|
93
96
|
</template>
|
|
94
97
|
|
|
95
98
|
<script lang="ts">
|
|
96
|
-
import { defineComponent, ref } from 'vue-demi'
|
|
99
|
+
import { defineComponent, ref, h } from 'vue-demi'
|
|
97
100
|
import {
|
|
98
101
|
DlButton,
|
|
99
102
|
DlInput,
|
|
@@ -134,7 +137,31 @@ export default defineComponent({
|
|
|
134
137
|
collapseCount: collapseCount.value
|
|
135
138
|
})
|
|
136
139
|
}
|
|
140
|
+
|
|
141
|
+
function showToastMessageCustom() {
|
|
142
|
+
DlToast.open(
|
|
143
|
+
{
|
|
144
|
+
message: message.value,
|
|
145
|
+
position: position.value as DlToastPositions,
|
|
146
|
+
type: type.value as DlToastTypes,
|
|
147
|
+
duration: Number(duration.value) || 1000,
|
|
148
|
+
closable: closable.value,
|
|
149
|
+
width: width.value,
|
|
150
|
+
collapseCount: collapseCount.value
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
message: (...args: any) => {
|
|
154
|
+
const vNode = h(DlButton, {
|
|
155
|
+
label: 'Click me',
|
|
156
|
+
props: { label: 'Click Me' }
|
|
157
|
+
} as any)
|
|
158
|
+
return vNode
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
}
|
|
137
163
|
return {
|
|
164
|
+
showToastMessageCustom,
|
|
138
165
|
showToastMessage,
|
|
139
166
|
message,
|
|
140
167
|
duration,
|