@dataloop-ai/components 0.13.19 → 0.14.4
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/.nvmrc +1 -0
- package/README.md +3 -1
- package/package.json +19 -17
- package/src/assets/globals.scss +38 -3
- package/src/assets/grid.scss +9 -0
- package/src/components/DlAccordion/DlAccordion.vue +4 -4
- package/src/components/DlAlert.vue +6 -6
- package/src/components/DlChart/BrushThumb.vue +83 -0
- package/src/components/DlChart/DlBarChart.vue +545 -0
- package/src/components/DlChart/DlBrush.vue +475 -0
- package/src/components/DlChart/DlChartLabels.vue +279 -0
- package/src/components/DlChart/DlChartLegend.vue +141 -0
- package/src/components/DlChart/DlColumnChart.vue +555 -0
- package/src/components/DlChart/DlLineChart.vue +644 -0
- package/src/components/DlChart/DlScrollBar.vue +147 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChart.vue +448 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChartLegend.vue +281 -0
- package/src/components/DlChart/Doughnut/DlDoughnutChartWidget.vue +64 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartAnimation.ts +4 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartData.ts +16 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartOptions.ts +11 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutChartProps.ts +8 -0
- package/src/components/DlChart/Doughnut/types/TDoughnutWithOriginalColor.ts +13 -0
- package/src/components/DlChart/chart.ts +122 -0
- package/src/components/DlChart/index.ts +36 -0
- package/src/components/DlChart/props.ts +348 -0
- package/src/components/DlChart/typedCharts.ts +88 -0
- package/src/components/DlChart/types.ts +63 -0
- package/src/components/DlChart/utils.ts +153 -0
- package/src/components/DlChip/DlChip.vue +40 -13
- package/src/components/DlCounters.vue +31 -7
- package/src/components/DlDatePicker/DlCalendar.vue +22 -10
- package/src/components/DlDatePicker/DlDatePicker.vue +8 -5
- package/src/components/DlDateTimeRange/types.ts +2 -2
- package/src/components/DlDropdownButton.vue +5 -3
- package/src/components/DlMenu/DlMenu.vue +4 -2
- package/src/components/DlPagination/RowsSelector.vue +15 -2
- package/src/components/DlPopup/DlPopup.vue +0 -1
- package/src/components/DlRange/DlRange.vue +3 -2
- package/src/components/DlSearch.vue +1 -1
- package/src/components/DlSelect/DlSelect.vue +3 -2
- package/src/components/DlSlider/sliderStyles.scss +4 -0
- package/src/components/DlSlider/useSlider.ts +39 -12
- package/src/components/DlSmartSearch/DlSuggestionsDropdown.vue +1 -1
- package/src/components/DlSpinner.vue +259 -0
- package/src/components/DlTable/DlTable.vue +4 -1
- package/src/components/DlTable/hooks/tablePagination.ts +8 -2
- package/src/components/DlTextArea.vue +9 -0
- package/src/components/DlTextInput.vue +4 -2
- package/src/components/DlThemeProvider.vue +22 -13
- package/src/components/DlToastMessage/api/useToast.ts +23 -0
- package/src/components/DlToastMessage/components/ToastComponent.vue +279 -0
- package/src/components/DlToastMessage/index.ts +5 -0
- package/src/components/DlToastMessage/types.ts +4 -0
- package/src/components/DlToastMessage/utils/config.ts +17 -0
- package/src/components/DlToastMessage/utils/render.ts +56 -0
- package/src/components/DlTypography.vue +1 -1
- package/src/components/DlWidget/DlGrid.vue +33 -0
- package/src/components/DlWidget/DlGridRow.vue +32 -0
- package/src/components/DlWidget/DlWidget.vue +202 -11
- package/src/components/DlWidget/index.ts +2 -2
- package/src/components/DlWidget/utils.ts +26 -19
- package/src/components/index.ts +8 -3
- package/src/demo/BarChartDemo.vue +77 -0
- package/src/demo/ColumnChartDemo.vue +230 -0
- package/src/demo/DlButtonDemo.vue +1 -1
- package/src/demo/DlChartDoughnutDemo.vue +229 -0
- package/src/demo/DlChipDemo.vue +42 -18
- package/src/demo/DlDialogBoxDemo.vue +4 -4
- package/src/demo/DlDropdownButtonDemo.vue +1 -1
- package/src/demo/DlLineChartDemo.vue +375 -0
- package/src/demo/DlMenuDemo.vue +1 -1
- package/src/demo/DlOptionGroupDemo.vue +1 -1
- package/src/demo/DlSelectDemo.vue +1 -1
- package/src/demo/DlSpinnerDemo.vue +20 -0
- package/src/demo/DlTableDemo.vue +13 -94
- package/src/demo/DlToastMessageDemo.vue +143 -0
- package/src/demo/DlWidgetDemo.vue +105 -143
- package/src/demo/index.ts +20 -2
- package/src/hooks/use-theme.ts +19 -0
- package/src/utils/abbreviate-to-string.ts +14 -0
- package/src/utils/colors.ts +47 -0
- package/src/utils/getRootStyles.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/position-engine.ts +11 -2
- package/src/utils/swapNodes.ts +30 -0
- package/src/utils/update-key.ts +90 -0
- package/tsconfig.json +0 -1
- package/vite.config.ts +17 -0
- package/Dockerfile +0 -12
- package/jest.config.js +0 -16
- package/jest.setup.js +0 -59
- package/src/components/DlWidget/DlWidgetGrid.vue +0 -360
- package/storybook.js +0 -8
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style="
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 800px;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
gap: 0;
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<dl-column-chart
|
|
12
|
+
:brush-props="brushProps"
|
|
13
|
+
:legend-props="legendProps"
|
|
14
|
+
:data="data[0]"
|
|
15
|
+
:options="options[0]"
|
|
16
|
+
style="width: 50%"
|
|
17
|
+
/>
|
|
18
|
+
<dl-column-chart
|
|
19
|
+
:brush-props="brushProps"
|
|
20
|
+
:legend-props="legendProps"
|
|
21
|
+
:data="data[1]"
|
|
22
|
+
:options="options[1]"
|
|
23
|
+
style="width: 50%"
|
|
24
|
+
>
|
|
25
|
+
<template #axe-x-labels="{ labels, chartWidth }">
|
|
26
|
+
<div
|
|
27
|
+
:style="`display: flex; width: ${chartWidth}; align-self: flex-end; justify-content: space-between;`"
|
|
28
|
+
>
|
|
29
|
+
<div
|
|
30
|
+
v-for="(url, key) in labels"
|
|
31
|
+
:key="key"
|
|
32
|
+
style="
|
|
33
|
+
display: flex;
|
|
34
|
+
width: 100%;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
"
|
|
37
|
+
>
|
|
38
|
+
<dl-avatar size="24px">
|
|
39
|
+
<img :src="url">
|
|
40
|
+
</dl-avatar>
|
|
41
|
+
<div />
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
</dl-column-chart>
|
|
46
|
+
|
|
47
|
+
<dl-column-chart
|
|
48
|
+
:brush-props="brushProps"
|
|
49
|
+
:legend-props="legendProps"
|
|
50
|
+
:data="data[0]"
|
|
51
|
+
:options="options[0]"
|
|
52
|
+
style="width: 100%"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script lang="ts">
|
|
58
|
+
import { defineComponent } from 'vue-demi'
|
|
59
|
+
import DlColumnChart from '../components/DlChart/DlColumnChart.vue'
|
|
60
|
+
import DlAvatar from '../components/DlAvatar.vue'
|
|
61
|
+
|
|
62
|
+
import { orderBy } from 'lodash'
|
|
63
|
+
|
|
64
|
+
import {
|
|
65
|
+
Chart as ChartJS,
|
|
66
|
+
Title,
|
|
67
|
+
Tooltip,
|
|
68
|
+
Legend,
|
|
69
|
+
BarElement,
|
|
70
|
+
CategoryScale,
|
|
71
|
+
LinearScale
|
|
72
|
+
} from 'chart.js'
|
|
73
|
+
|
|
74
|
+
ChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip, Legend)
|
|
75
|
+
|
|
76
|
+
const data = [
|
|
77
|
+
{
|
|
78
|
+
labels: [
|
|
79
|
+
'JanuaryJanuaryJanuaryJanuary',
|
|
80
|
+
'February',
|
|
81
|
+
'March',
|
|
82
|
+
'April',
|
|
83
|
+
'May',
|
|
84
|
+
'June'
|
|
85
|
+
],
|
|
86
|
+
datasets: [
|
|
87
|
+
{
|
|
88
|
+
label: 'Data One 1',
|
|
89
|
+
backgroundColor: '--dl-color-secondary',
|
|
90
|
+
borderRadius: 4,
|
|
91
|
+
data: [35, 30, 25, 20, 15, 5]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
label: 'Data Two 2',
|
|
95
|
+
backgroundColor: '--dl-color-warning',
|
|
96
|
+
borderRadius: 4,
|
|
97
|
+
data: [15, 20, 15, 30, 25, 10]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Data One 3',
|
|
101
|
+
backgroundColor: '--dl-color-negative',
|
|
102
|
+
borderRadius: 4,
|
|
103
|
+
data: [35, 30, 25, 20, 15, 5]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'Data Two 4',
|
|
107
|
+
backgroundColor: '--dl-color-positive',
|
|
108
|
+
borderRadius: 4,
|
|
109
|
+
data: [15, 20, 15, 30, 25, 10]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: 'Data One 5',
|
|
113
|
+
backgroundColor: '--dl-color-secondary',
|
|
114
|
+
borderRadius: 4,
|
|
115
|
+
data: [35, 30, 25, 20, 15, 5]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: 'Data Two 6',
|
|
119
|
+
backgroundColor: '--dl-color-warning',
|
|
120
|
+
borderRadius: 4,
|
|
121
|
+
data: [15, 20, 15, 30, 25, 10]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: 'Data One 7',
|
|
125
|
+
backgroundColor: '--dl-color-secondary',
|
|
126
|
+
borderRadius: 4,
|
|
127
|
+
data: [35, 30, 25, 20, 15, 5]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: 'Data Two 8',
|
|
131
|
+
backgroundColor: '--dl-color-warning',
|
|
132
|
+
borderRadius: 4,
|
|
133
|
+
data: [15, 20, 15, 30, 25, 10]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
{
|
|
139
|
+
labels: [
|
|
140
|
+
'https://picsum.photos/200/200',
|
|
141
|
+
'https://picsum.photos/200/200',
|
|
142
|
+
'https://picsum.photos/200/200',
|
|
143
|
+
'https://picsum.photos/200/200',
|
|
144
|
+
'https://picsum.photos/200/200',
|
|
145
|
+
'https://picsum.photos/200/200'
|
|
146
|
+
],
|
|
147
|
+
datasets: [
|
|
148
|
+
{
|
|
149
|
+
label: 'Data One',
|
|
150
|
+
backgroundColor: '--dl-color-secondary',
|
|
151
|
+
borderRadius: 4,
|
|
152
|
+
data: [35, 30, 25, 20, 15, 5]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'Data Two',
|
|
156
|
+
backgroundColor: '--dl-color-warning',
|
|
157
|
+
borderRadius: 4,
|
|
158
|
+
data: [15, 20, 15, 30, 25, 10]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
const brushProps = {
|
|
165
|
+
min: 0,
|
|
166
|
+
max: orderBy(data[0].datasets, (o) => o.data.length)[0].data.length - 1
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const options = [
|
|
170
|
+
{
|
|
171
|
+
scales: {
|
|
172
|
+
y: {
|
|
173
|
+
ticks: {
|
|
174
|
+
callback(value: string, index: number, ticks: string[]) {
|
|
175
|
+
return value + 's'
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
suggestedMax: 45
|
|
179
|
+
},
|
|
180
|
+
x: {
|
|
181
|
+
min: 0,
|
|
182
|
+
max:
|
|
183
|
+
orderBy(data[0].datasets, (o) => o.data.length)[0].data
|
|
184
|
+
.length - 1
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
{
|
|
190
|
+
scales: {
|
|
191
|
+
y: {
|
|
192
|
+
ticks: {
|
|
193
|
+
callback(value: string, index: number, ticks: string[]) {
|
|
194
|
+
return value + 's'
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
suggestedMax: 45
|
|
198
|
+
},
|
|
199
|
+
x: {
|
|
200
|
+
min: 0,
|
|
201
|
+
max:
|
|
202
|
+
orderBy(data[1].datasets, (o) => o.data.length)[0].data
|
|
203
|
+
.length - 1
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
const legendProps = {
|
|
210
|
+
alignItems: 'center'
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export default defineComponent({
|
|
214
|
+
name: 'DlColumnChartDemo',
|
|
215
|
+
components: {
|
|
216
|
+
DlColumnChart,
|
|
217
|
+
DlAvatar
|
|
218
|
+
},
|
|
219
|
+
data() {
|
|
220
|
+
return {
|
|
221
|
+
options,
|
|
222
|
+
data,
|
|
223
|
+
brushProps,
|
|
224
|
+
legendProps
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; flex-wrap: wrap; flex-direction: row; gap: 0">
|
|
3
|
+
<div>
|
|
4
|
+
<div>
|
|
5
|
+
<DlDoughnutChart
|
|
6
|
+
:data="doughnutLessData"
|
|
7
|
+
:animation="doughnutAnimation"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<DlDoughnutChart :data="doughnutData" />
|
|
12
|
+
</div>
|
|
13
|
+
<div>
|
|
14
|
+
<DlDoughnutChart
|
|
15
|
+
:data="doughnutData"
|
|
16
|
+
:has-summary="true"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="grid grid-cols-3">
|
|
20
|
+
<div>
|
|
21
|
+
<DlDoughnutChart
|
|
22
|
+
:data="doughnutData"
|
|
23
|
+
:is-small="true"
|
|
24
|
+
:has-summary="true"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<DlDoughnutChart
|
|
29
|
+
:data="doughnutLessData"
|
|
30
|
+
:is-small="true"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
<div>
|
|
34
|
+
<DlDoughnutChart
|
|
35
|
+
:data="doughnutData"
|
|
36
|
+
:is-small="true"
|
|
37
|
+
:has-summary="true"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="grid grid-cols-2">
|
|
42
|
+
<div>
|
|
43
|
+
<DlDoughnutChart
|
|
44
|
+
:data="doughnutData"
|
|
45
|
+
:is-small="true"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
<div>
|
|
49
|
+
<DlDoughnutChart
|
|
50
|
+
:data="doughnutLessData"
|
|
51
|
+
:is-small="true"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<DlDoughnutChart
|
|
57
|
+
:data="doughnutData"
|
|
58
|
+
:is-small="true"
|
|
59
|
+
:has-summary="true"
|
|
60
|
+
:animation="doughnutAnimation"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script lang="ts">
|
|
68
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
69
|
+
import DlDoughnutChart from '../components/DlChart/Doughnut/DlDoughnutChart.vue'
|
|
70
|
+
import { DoughnutControllerChartOptions } from 'chart.js'
|
|
71
|
+
import { TDoughnutChartData } from '../components/DlChart/Doughnut/types/TDoughnutChartData'
|
|
72
|
+
|
|
73
|
+
export default defineComponent({
|
|
74
|
+
name: 'DlChartDoughnutDemo',
|
|
75
|
+
components: {
|
|
76
|
+
DlDoughnutChart
|
|
77
|
+
},
|
|
78
|
+
setup() {
|
|
79
|
+
const doughnutAnimation = ref<
|
|
80
|
+
DoughnutControllerChartOptions['animation']
|
|
81
|
+
>({
|
|
82
|
+
animateRotate: true,
|
|
83
|
+
animateScale: true
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const doughnutData: TDoughnutChartData = {
|
|
87
|
+
labels: [
|
|
88
|
+
'Label 1 very very very very very very very long title',
|
|
89
|
+
'Label 2',
|
|
90
|
+
'Label 3',
|
|
91
|
+
'Label 4',
|
|
92
|
+
'Label 5',
|
|
93
|
+
'Label 6',
|
|
94
|
+
'Label 7',
|
|
95
|
+
'Label 8',
|
|
96
|
+
'Label 9',
|
|
97
|
+
'Label 10',
|
|
98
|
+
'Label 11',
|
|
99
|
+
'Label 12',
|
|
100
|
+
'Label 13',
|
|
101
|
+
'Label 14',
|
|
102
|
+
'Label 15',
|
|
103
|
+
'Label 16',
|
|
104
|
+
'Label 17',
|
|
105
|
+
'Label 18',
|
|
106
|
+
'Label 19',
|
|
107
|
+
'Label 20'
|
|
108
|
+
],
|
|
109
|
+
datasets: [
|
|
110
|
+
{
|
|
111
|
+
label: 'My Doughnut',
|
|
112
|
+
data: [
|
|
113
|
+
9999, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
|
|
114
|
+
1100, 1200, 1000, 1400, 1500, 1600, 1700, 1800, 1900,
|
|
115
|
+
2000
|
|
116
|
+
],
|
|
117
|
+
backgroundColor: [
|
|
118
|
+
'#3452FF',
|
|
119
|
+
'#4DB1D3',
|
|
120
|
+
'#FF2F7A',
|
|
121
|
+
'#D4E3FF',
|
|
122
|
+
'#BECB5D',
|
|
123
|
+
'#839E30',
|
|
124
|
+
'#6B5935',
|
|
125
|
+
'#752B86',
|
|
126
|
+
'#BB96A3',
|
|
127
|
+
'#870F49',
|
|
128
|
+
'#CC566C',
|
|
129
|
+
'#F0A18C',
|
|
130
|
+
'#EDAB55',
|
|
131
|
+
'#FF5934',
|
|
132
|
+
'#9CD2E3',
|
|
133
|
+
'#1481A4',
|
|
134
|
+
'#928F80',
|
|
135
|
+
'#575567',
|
|
136
|
+
'#979797',
|
|
137
|
+
'#D9D9D9'
|
|
138
|
+
],
|
|
139
|
+
hoverBackgroundColor: [
|
|
140
|
+
'#3452FF',
|
|
141
|
+
'#4DB1D3',
|
|
142
|
+
'#FF2F7A',
|
|
143
|
+
'#D4E3FF',
|
|
144
|
+
'#BECB5D',
|
|
145
|
+
'#839E30',
|
|
146
|
+
'#6B5935',
|
|
147
|
+
'#752B86',
|
|
148
|
+
'#BB96A3',
|
|
149
|
+
'#870F49',
|
|
150
|
+
'#CC566C',
|
|
151
|
+
'#F0A18C',
|
|
152
|
+
'#EDAB55',
|
|
153
|
+
'#FF5934',
|
|
154
|
+
'#9CD2E3',
|
|
155
|
+
'#1481A4',
|
|
156
|
+
'#928F80',
|
|
157
|
+
'#575567',
|
|
158
|
+
'#979797',
|
|
159
|
+
'#D9D9D9'
|
|
160
|
+
],
|
|
161
|
+
lightColor: [
|
|
162
|
+
'#D6DCFF',
|
|
163
|
+
'#EDF7FB',
|
|
164
|
+
'#FFCBDD',
|
|
165
|
+
'#F4F8FF',
|
|
166
|
+
'#EFF2D7',
|
|
167
|
+
'#E0E7CB',
|
|
168
|
+
'#DAD5CD',
|
|
169
|
+
'#DDCAE1',
|
|
170
|
+
'#DDCBD1',
|
|
171
|
+
'#DDCBD1',
|
|
172
|
+
'#F2D5DA',
|
|
173
|
+
'#FBE7E2',
|
|
174
|
+
'#FBEAD5',
|
|
175
|
+
'#FFD5CC',
|
|
176
|
+
'#E7F4F8',
|
|
177
|
+
'#C4DFE8',
|
|
178
|
+
'#E4E3DF',
|
|
179
|
+
'#D5D5D9',
|
|
180
|
+
'#E5E5E5',
|
|
181
|
+
'#F5F5F5'
|
|
182
|
+
],
|
|
183
|
+
borderWidth: 0
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
const doughnutLessData: TDoughnutChartData = {
|
|
188
|
+
labels: [
|
|
189
|
+
'Label 1 very very very very very very very long title',
|
|
190
|
+
'Label 2',
|
|
191
|
+
'Label 3',
|
|
192
|
+
'Label 4'
|
|
193
|
+
],
|
|
194
|
+
datasets: [
|
|
195
|
+
{
|
|
196
|
+
label: 'My Doughnut',
|
|
197
|
+
data: [999, 2000, 300, 400],
|
|
198
|
+
backgroundColor: [
|
|
199
|
+
'--dl-color-secondary',
|
|
200
|
+
'#4DB1D3',
|
|
201
|
+
'#FF2F7A',
|
|
202
|
+
'#D4E3FF'
|
|
203
|
+
],
|
|
204
|
+
hoverBackgroundColor: [
|
|
205
|
+
'--dl-color-secondary',
|
|
206
|
+
'#4DB1D3',
|
|
207
|
+
'#FF2F7A',
|
|
208
|
+
'#D4E3FF'
|
|
209
|
+
],
|
|
210
|
+
lightColor: [
|
|
211
|
+
'--dl-color-link',
|
|
212
|
+
'#EDF7FB',
|
|
213
|
+
'#FFCBDD',
|
|
214
|
+
'#F4F8FF'
|
|
215
|
+
],
|
|
216
|
+
borderWidth: 0
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
doughnutData,
|
|
222
|
+
doughnutLessData,
|
|
223
|
+
doughnutAnimation
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<style scoped lang="scss"></style>
|
package/src/demo/DlChipDemo.vue
CHANGED
|
@@ -32,30 +32,30 @@
|
|
|
32
32
|
<DlChip
|
|
33
33
|
removable
|
|
34
34
|
label="Chip filled"
|
|
35
|
-
@remove="log"
|
|
35
|
+
@remove="log('removable')"
|
|
36
36
|
/>
|
|
37
37
|
<DlChip
|
|
38
38
|
removable
|
|
39
39
|
outlined
|
|
40
40
|
label="Chip outlined"
|
|
41
|
-
@remove="log"
|
|
41
|
+
@remove="log('outlined')"
|
|
42
42
|
/>
|
|
43
43
|
<DlChip
|
|
44
44
|
removable
|
|
45
45
|
disabled
|
|
46
46
|
label="Chip disabled"
|
|
47
|
-
@remove="log"
|
|
47
|
+
@remove="log('disabled')"
|
|
48
48
|
/>
|
|
49
49
|
<DlChip
|
|
50
50
|
removable
|
|
51
51
|
label="Ellipsed Chip with a multiple words"
|
|
52
|
-
@remove="log"
|
|
52
|
+
@remove="log('ellipsed')"
|
|
53
53
|
/>
|
|
54
54
|
<DlChip
|
|
55
55
|
removable
|
|
56
56
|
label="custom max width (200px)"
|
|
57
57
|
max-width="200px"
|
|
58
|
-
@remove="log"
|
|
58
|
+
@remove="log('test')"
|
|
59
59
|
/>
|
|
60
60
|
</div>
|
|
61
61
|
<h4>Removable Chips with icon</h4>
|
|
@@ -67,39 +67,39 @@
|
|
|
67
67
|
removable
|
|
68
68
|
icon="icon-dl-search"
|
|
69
69
|
label="Chip filled"
|
|
70
|
-
@remove="log"
|
|
70
|
+
@remove="log('test')"
|
|
71
71
|
/>
|
|
72
72
|
<DlChip
|
|
73
73
|
removable
|
|
74
74
|
icon="icon-dl-search"
|
|
75
|
-
@remove="log"
|
|
75
|
+
@remove="log('test')"
|
|
76
76
|
/>
|
|
77
77
|
<DlChip
|
|
78
78
|
removable
|
|
79
79
|
icon="icon-dl-search"
|
|
80
80
|
outlined
|
|
81
81
|
label="Chip outlined"
|
|
82
|
-
@remove="log"
|
|
82
|
+
@remove="log('test')"
|
|
83
83
|
/>
|
|
84
84
|
<DlChip
|
|
85
85
|
removable
|
|
86
86
|
icon="icon-dl-search"
|
|
87
87
|
disabled
|
|
88
88
|
label="Chip disabled"
|
|
89
|
-
@remove="log"
|
|
89
|
+
@remove="log('test')"
|
|
90
90
|
/>
|
|
91
91
|
<DlChip
|
|
92
92
|
removable
|
|
93
93
|
label="Ellipsed Chip with a multiple words"
|
|
94
94
|
icon="icon-dl-search"
|
|
95
|
-
@remove="log"
|
|
95
|
+
@remove="log('test')"
|
|
96
96
|
/>
|
|
97
97
|
<DlChip
|
|
98
98
|
removable
|
|
99
99
|
label="custom max width (200px)"
|
|
100
100
|
icon="icon-dl-search"
|
|
101
101
|
max-width="200px"
|
|
102
|
-
@remove="log"
|
|
102
|
+
@remove="log('test')"
|
|
103
103
|
/>
|
|
104
104
|
</div>
|
|
105
105
|
<h4>Removable Chips without icon and label</h4>
|
|
@@ -109,17 +109,34 @@
|
|
|
109
109
|
>
|
|
110
110
|
<DlChip
|
|
111
111
|
removable
|
|
112
|
-
@remove="log"
|
|
112
|
+
@remove="log('test')"
|
|
113
113
|
/>
|
|
114
114
|
<DlChip
|
|
115
115
|
removable
|
|
116
116
|
outlined
|
|
117
|
-
@remove="log"
|
|
117
|
+
@remove="log('test')"
|
|
118
118
|
/>
|
|
119
119
|
<DlChip
|
|
120
120
|
removable
|
|
121
121
|
disabled
|
|
122
|
-
@remove="log"
|
|
122
|
+
@remove="log('test')"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
<h4>Chips with label slot</h4>
|
|
126
|
+
<div
|
|
127
|
+
class="col"
|
|
128
|
+
style="margin-bottom: 30px"
|
|
129
|
+
>
|
|
130
|
+
<DlChip
|
|
131
|
+
ref="removableChip"
|
|
132
|
+
removable
|
|
133
|
+
label="Ellipsed Chip with a multiple words"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="col">
|
|
137
|
+
<DlButton
|
|
138
|
+
label="remove chip"
|
|
139
|
+
@click="removeChip"
|
|
123
140
|
/>
|
|
124
141
|
</div>
|
|
125
142
|
<h4>Chips with icon and without label</h4>
|
|
@@ -152,16 +169,23 @@
|
|
|
152
169
|
</template>
|
|
153
170
|
|
|
154
171
|
<script lang="ts">
|
|
155
|
-
import { defineComponent } from 'vue-demi'
|
|
156
|
-
import { DlChip } from '../components'
|
|
172
|
+
import { defineComponent, ref } from 'vue-demi'
|
|
173
|
+
import { DlChip, DlButton } from '../components'
|
|
157
174
|
export default defineComponent({
|
|
158
175
|
name: 'DlChipDemo',
|
|
159
176
|
components: {
|
|
160
|
-
DlChip
|
|
177
|
+
DlChip,
|
|
178
|
+
DlButton
|
|
161
179
|
},
|
|
162
180
|
setup() {
|
|
163
181
|
const log = (e: Event) => console.log(e)
|
|
164
|
-
|
|
182
|
+
const removableValue = ref(true)
|
|
183
|
+
return { log, removableValue }
|
|
184
|
+
},
|
|
185
|
+
methods: {
|
|
186
|
+
removeChip() {
|
|
187
|
+
(this.$refs.removableChip as any).remove()
|
|
188
|
+
}
|
|
165
189
|
}
|
|
166
190
|
})
|
|
167
191
|
</script>
|
|
@@ -134,7 +134,7 @@ export default defineComponent({
|
|
|
134
134
|
return
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
modalOne.value
|
|
137
|
+
modalOne.value?.openModal()
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
const closeModal = () => {
|
|
@@ -142,7 +142,7 @@ export default defineComponent({
|
|
|
142
142
|
return
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
modalOne.value
|
|
145
|
+
modalOne.value?.closeModal()
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
const openSecondModal = () => {
|
|
@@ -150,7 +150,7 @@ export default defineComponent({
|
|
|
150
150
|
return
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
modalTwo.value
|
|
153
|
+
modalTwo.value?.openModal()
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
const closeSecondModal = () => {
|
|
@@ -158,7 +158,7 @@ export default defineComponent({
|
|
|
158
158
|
return
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
modalTwo.value
|
|
161
|
+
modalTwo.value?.closeModal()
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
return {
|