@dataloop-ai/components 0.13.18 → 0.14.3
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/DlDialogBox/DlDialogBox.vue +0 -8
- package/src/components/DlDialogBox/DlDialogBoxHeader.vue +6 -22
- package/src/components/DlDropdownButton.vue +16 -4
- package/src/components/DlPagination/RowsSelector.vue +15 -1
- package/src/components/DlRange/DlRange.vue +3 -2
- package/src/components/DlSearch.vue +1 -1
- package/src/components/DlSelect/DlSelect.vue +1 -19
- package/src/components/DlSlider/sliderStyles.scss +4 -0
- package/src/components/DlSlider/useSlider.ts +39 -12
- 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 +6 -42
- 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 +54 -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/DlLineChartDemo.vue +375 -0
- 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/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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
+
v-if="isVisible"
|
|
3
4
|
:id="uuid"
|
|
4
|
-
ref="dlChipRef"
|
|
5
5
|
:tabindex="tabIndex"
|
|
6
6
|
class="dl-chip"
|
|
7
7
|
:style="cssChipVars"
|
|
@@ -17,16 +17,27 @@
|
|
|
17
17
|
:icon="icon"
|
|
18
18
|
/>
|
|
19
19
|
</span>
|
|
20
|
-
<slot>
|
|
21
|
-
{{ hasLabel ? label : null }}
|
|
22
|
-
</slot>
|
|
23
20
|
<dl-tooltip v-if="overflow && isOverflowing">
|
|
24
21
|
{{ label }}
|
|
25
22
|
</dl-tooltip>
|
|
23
|
+
<div
|
|
24
|
+
v-if="hasLabelSlot || hasLabel"
|
|
25
|
+
class="dl-chip--content"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
ref="dlChipRef"
|
|
29
|
+
class="dl-chip--ellipsis"
|
|
30
|
+
>
|
|
31
|
+
<slot>
|
|
32
|
+
{{ hasLabel ? label : null }}
|
|
33
|
+
</slot>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
26
37
|
<span
|
|
27
38
|
v-if="removable"
|
|
28
39
|
class="dl-chip-remove-icon-container"
|
|
29
|
-
@click="
|
|
40
|
+
@click="remove"
|
|
30
41
|
>
|
|
31
42
|
<dl-icon
|
|
32
43
|
class="dl-chip-remove-icon"
|
|
@@ -94,10 +105,12 @@ export default defineComponent({
|
|
|
94
105
|
},
|
|
95
106
|
emits: ['remove'],
|
|
96
107
|
setup() {
|
|
108
|
+
const isVisible = ref(true)
|
|
97
109
|
const dlChipRef = ref(null)
|
|
98
110
|
const { hasEllipsis } = useSizeObserver(dlChipRef)
|
|
99
111
|
|
|
100
112
|
return {
|
|
113
|
+
isVisible,
|
|
101
114
|
uuid: `dl-chip-${v4()}`,
|
|
102
115
|
dlChipRef,
|
|
103
116
|
isOverflowing: hasEllipsis
|
|
@@ -111,6 +124,9 @@ export default defineComponent({
|
|
|
111
124
|
this.label !== ''
|
|
112
125
|
)
|
|
113
126
|
},
|
|
127
|
+
hasLabelSlot(): boolean {
|
|
128
|
+
return !!this.$slots['default']
|
|
129
|
+
},
|
|
114
130
|
hasIcon(): boolean {
|
|
115
131
|
return typeof this.icon === 'string' && this.icon !== ''
|
|
116
132
|
},
|
|
@@ -167,9 +183,10 @@ export default defineComponent({
|
|
|
167
183
|
}
|
|
168
184
|
},
|
|
169
185
|
methods: {
|
|
170
|
-
|
|
186
|
+
remove(e: Event) {
|
|
171
187
|
if (!this.disabled) {
|
|
172
|
-
this
|
|
188
|
+
this.isVisible = false
|
|
189
|
+
this.$emit('remove')
|
|
173
190
|
}
|
|
174
191
|
}
|
|
175
192
|
}
|
|
@@ -179,6 +196,7 @@ export default defineComponent({
|
|
|
179
196
|
<style scoped lang="scss">
|
|
180
197
|
.dl-chip {
|
|
181
198
|
position: relative;
|
|
199
|
+
display: flex;
|
|
182
200
|
vertical-align: middle;
|
|
183
201
|
text-transform: var(--dl-chip-text-transform);
|
|
184
202
|
font-size: var(--dl-font-size-body);
|
|
@@ -189,19 +207,27 @@ export default defineComponent({
|
|
|
189
207
|
min-width: 18px; // +2px from borders
|
|
190
208
|
max-height: 18px; // +2px from borders
|
|
191
209
|
min-height: 12px;
|
|
192
|
-
height: fit-content;
|
|
193
210
|
max-width: var(--dl-chip-max-width);
|
|
194
|
-
width: fit-content;
|
|
195
211
|
color: var(--dl-chip-text-color);
|
|
196
212
|
background-color: var(--dl-chip-bg-color);
|
|
197
|
-
white-space: nowrap;
|
|
198
|
-
overflow: hidden;
|
|
199
|
-
text-overflow: ellipsis;
|
|
200
213
|
border: var(--dl-chip-border);
|
|
201
214
|
&::first-letter,
|
|
202
215
|
& > *::first-letter {
|
|
203
216
|
text-transform: capitalize;
|
|
204
217
|
}
|
|
218
|
+
|
|
219
|
+
&--content {
|
|
220
|
+
cursor: default;
|
|
221
|
+
width: auto;
|
|
222
|
+
min-width: 0;
|
|
223
|
+
max-width: 100%;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&--ellipsis {
|
|
227
|
+
text-overflow: ellipsis;
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
}
|
|
205
231
|
}
|
|
206
232
|
.dl-chip-remove-icon-container {
|
|
207
233
|
cursor: var(--dl-chip-left-icon-cursor);
|
|
@@ -223,7 +249,7 @@ export default defineComponent({
|
|
|
223
249
|
|
|
224
250
|
.dl-chip-left-icon-container {
|
|
225
251
|
@extend .dl-chip-remove-icon-container;
|
|
226
|
-
cursor:
|
|
252
|
+
cursor: default;
|
|
227
253
|
left: 0;
|
|
228
254
|
width: 18px;
|
|
229
255
|
&:active {
|
|
@@ -240,5 +266,6 @@ export default defineComponent({
|
|
|
240
266
|
|
|
241
267
|
.dl-chip-remove-icon {
|
|
242
268
|
color: var(--dl-chip-text-color);
|
|
269
|
+
display: flex !important;
|
|
243
270
|
}
|
|
244
271
|
</style>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:id="uuid"
|
|
4
|
-
class="container"
|
|
4
|
+
class="dl-counters-container"
|
|
5
|
+
:style="cssVars"
|
|
5
6
|
>
|
|
6
7
|
<ul>
|
|
7
8
|
<li
|
|
@@ -11,7 +12,11 @@
|
|
|
11
12
|
>
|
|
12
13
|
<div :class="computeClass('item-content')">
|
|
13
14
|
<p :class="computeClass('item-value')">
|
|
14
|
-
{{
|
|
15
|
+
{{
|
|
16
|
+
abbreviateNumbers
|
|
17
|
+
? abbreviateNumber(item.value)
|
|
18
|
+
: item.value
|
|
19
|
+
}}
|
|
15
20
|
</p>
|
|
16
21
|
<p
|
|
17
22
|
v-show="item.text"
|
|
@@ -35,6 +40,7 @@
|
|
|
35
40
|
<script lang="ts">
|
|
36
41
|
import { v4 } from 'uuid'
|
|
37
42
|
import { defineComponent, PropType } from 'vue-demi'
|
|
43
|
+
import { abbreviateToString } from '../utils/abbreviate-to-string'
|
|
38
44
|
|
|
39
45
|
interface CounterItem {
|
|
40
46
|
value?: number
|
|
@@ -49,12 +55,20 @@ export default defineComponent({
|
|
|
49
55
|
type: Boolean,
|
|
50
56
|
default: false
|
|
51
57
|
},
|
|
58
|
+
spacing: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: '30px'
|
|
61
|
+
},
|
|
52
62
|
items: {
|
|
53
63
|
type: Array as PropType<CounterItem[]>,
|
|
54
64
|
default: (): CounterItem[] => [],
|
|
55
65
|
validator(value: CounterItem[]): boolean {
|
|
56
66
|
return value.length <= 8
|
|
57
67
|
}
|
|
68
|
+
},
|
|
69
|
+
abbreviateNumbers: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
58
72
|
}
|
|
59
73
|
},
|
|
60
74
|
data() {
|
|
@@ -62,10 +76,20 @@ export default defineComponent({
|
|
|
62
76
|
uuid: `dl-counters-${v4()}`
|
|
63
77
|
}
|
|
64
78
|
},
|
|
79
|
+
computed: {
|
|
80
|
+
cssVars(): Record<string, string> {
|
|
81
|
+
return {
|
|
82
|
+
'--dl-counter-spacing': this.spacing
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
65
86
|
methods: {
|
|
66
87
|
capitalize(value: string): string {
|
|
67
88
|
return value[0].toUpperCase() + value.slice(1)
|
|
68
89
|
},
|
|
90
|
+
abbreviateNumber(nr: number) {
|
|
91
|
+
if (nr) return abbreviateToString(nr)
|
|
92
|
+
},
|
|
69
93
|
computeClass(value: string): (string | boolean)[] {
|
|
70
94
|
return [value, this.small && `${value}--small`]
|
|
71
95
|
}
|
|
@@ -74,7 +98,7 @@ export default defineComponent({
|
|
|
74
98
|
</script>
|
|
75
99
|
|
|
76
100
|
<style scoped lang="scss">
|
|
77
|
-
.container {
|
|
101
|
+
.dl-counters-container {
|
|
78
102
|
padding: 10px;
|
|
79
103
|
width: fit-content;
|
|
80
104
|
}
|
|
@@ -96,12 +120,12 @@ ul {
|
|
|
96
120
|
display: flex;
|
|
97
121
|
flex-direction: column;
|
|
98
122
|
align-items: center;
|
|
99
|
-
padding-left:
|
|
100
|
-
padding-right:
|
|
123
|
+
padding-left: var(--dl-counter-spacing);
|
|
124
|
+
padding-right: var(--dl-counter-spacing);
|
|
101
125
|
|
|
102
126
|
&--small {
|
|
103
|
-
padding-left:
|
|
104
|
-
padding-right:
|
|
127
|
+
padding-left: var(--dl-counter-spacing);
|
|
128
|
+
padding-right: var(--dl-counter-spacing);
|
|
105
129
|
}
|
|
106
130
|
}
|
|
107
131
|
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
@mouseenter="handleMouseEnter(date)"
|
|
48
48
|
>
|
|
49
49
|
<div
|
|
50
|
+
v-if="!date.isDisabled"
|
|
50
51
|
class="dl-calendar--inner_day"
|
|
51
52
|
:style="getInnerDayStyle(date)"
|
|
52
53
|
>
|
|
@@ -135,27 +136,37 @@ export default defineComponent({
|
|
|
135
136
|
if (this.modelValue === null) return
|
|
136
137
|
|
|
137
138
|
const style: Record<string, any> = {}
|
|
139
|
+
if (value.isDisabled) return style
|
|
138
140
|
|
|
139
141
|
const from = new CalendarDate(this.modelValue.from)
|
|
140
142
|
const to = new CalendarDate(this.modelValue.to)
|
|
141
143
|
|
|
142
144
|
if (!from.isSameOrAfter(to, 'date')) {
|
|
143
|
-
const bgColor = '
|
|
145
|
+
const bgColor = 'var(--dl-date-picker-selected-strip)'
|
|
144
146
|
|
|
145
|
-
if (value.isAfter(from, '
|
|
147
|
+
if (value.isAfter(from, 'day') && value.isBefore(to, 'day')) {
|
|
146
148
|
style.background = bgColor
|
|
147
|
-
} else if (value.isSame(from, '
|
|
149
|
+
} else if (value.isSame(from, 'day')) {
|
|
148
150
|
style.background = `linear-gradient(to right, transparent 50%, ${bgColor} 50%)`
|
|
149
|
-
} else if (value.isSame(to, '
|
|
151
|
+
} else if (value.isSame(to, 'day')) {
|
|
150
152
|
style.background = `linear-gradient(to right, ${bgColor} 50%, transparent 50%)`
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
const radius = '11px'
|
|
156
|
+
const valueClone = value.clone()
|
|
154
157
|
|
|
155
|
-
if (
|
|
158
|
+
if (
|
|
159
|
+
value.day() === 0 ||
|
|
160
|
+
value.isSame(valueClone.startOf('month'), 'day')
|
|
161
|
+
) {
|
|
156
162
|
style.borderTopLeftRadius = radius
|
|
157
163
|
style.borderBottomLeftRadius = radius
|
|
158
|
-
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (
|
|
167
|
+
value.day() === DAYS_IN_WEEK - 1 ||
|
|
168
|
+
value.isSame(valueClone.endOf('month'), 'day')
|
|
169
|
+
) {
|
|
159
170
|
style.borderTopRightRadius = radius
|
|
160
171
|
style.borderBottomRightRadius = radius
|
|
161
172
|
}
|
|
@@ -166,8 +177,10 @@ export default defineComponent({
|
|
|
166
177
|
|
|
167
178
|
getInnerDayStyle(value: Partial<CalendarDate>) {
|
|
168
179
|
let style: Record<string, any> = {}
|
|
169
|
-
const disabledOpacity = 0.6
|
|
170
180
|
|
|
181
|
+
if (value.isDisabled) return style
|
|
182
|
+
|
|
183
|
+
const disabledOpacity = 0.6
|
|
171
184
|
const isToday = value.isSame(
|
|
172
185
|
new CalendarDate().startOf('day'),
|
|
173
186
|
'day'
|
|
@@ -198,14 +211,13 @@ export default defineComponent({
|
|
|
198
211
|
const to = new CalendarDate(this.modelValue.to)
|
|
199
212
|
|
|
200
213
|
const isIntervalBoundary =
|
|
201
|
-
value.isSame(from, '
|
|
214
|
+
value.isSame(from, 'day') || value.isSame(to, 'day')
|
|
202
215
|
|
|
203
216
|
if (isIntervalBoundary && this.disabled) {
|
|
204
217
|
style = {
|
|
205
218
|
...style,
|
|
206
219
|
...selectedStyle,
|
|
207
|
-
opacity: disabledOpacity
|
|
208
|
-
color: 'var(--dl-color-disabled)'
|
|
220
|
+
opacity: disabledOpacity
|
|
209
221
|
}
|
|
210
222
|
} else if (isIntervalBoundary) {
|
|
211
223
|
style = {
|
|
@@ -253,11 +253,13 @@ export default defineComponent({
|
|
|
253
253
|
if (!this.isSelectionMode) return
|
|
254
254
|
|
|
255
255
|
if (this.type === 'day') {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
const calendarDateClone = this.calendarTo?.activeDate.clone()
|
|
257
|
+
|
|
258
|
+
const isLastDayOfTheMonth = calendarDateClone
|
|
259
|
+
.endOf('month')
|
|
260
|
+
.isSame(new CalendarDate(date), 'day')
|
|
261
|
+
|
|
262
|
+
if (isLastDayOfTheMonth) {
|
|
261
263
|
if (this.timeout) {
|
|
262
264
|
clearTimeout(this.timeout)
|
|
263
265
|
}
|
|
@@ -293,6 +295,7 @@ export default defineComponent({
|
|
|
293
295
|
}
|
|
294
296
|
})
|
|
295
297
|
</script>
|
|
298
|
+
|
|
296
299
|
<style lang="scss" scoped>
|
|
297
300
|
.dl-date-picker {
|
|
298
301
|
user-select: none;
|
|
@@ -12,7 +12,7 @@ export const DAY_SIDEBAR_OPTION = {
|
|
|
12
12
|
} as const
|
|
13
13
|
|
|
14
14
|
export type DAY_SIDEBAR_OPTION =
|
|
15
|
-
typeof DAY_SIDEBAR_OPTION[keyof typeof DAY_SIDEBAR_OPTION]
|
|
15
|
+
(typeof DAY_SIDEBAR_OPTION)[keyof typeof DAY_SIDEBAR_OPTION]
|
|
16
16
|
|
|
17
17
|
export const MONTH_SIDEBAR_OPTION = {
|
|
18
18
|
this_month: 'this_month',
|
|
@@ -25,7 +25,7 @@ export const MONTH_SIDEBAR_OPTION = {
|
|
|
25
25
|
} as const
|
|
26
26
|
|
|
27
27
|
export type MONTH_SIDEBAR_OPTION =
|
|
28
|
-
typeof MONTH_SIDEBAR_OPTION[keyof typeof MONTH_SIDEBAR_OPTION]
|
|
28
|
+
(typeof MONTH_SIDEBAR_OPTION)[keyof typeof MONTH_SIDEBAR_OPTION]
|
|
29
29
|
|
|
30
30
|
export type DayTypeOption = {
|
|
31
31
|
title: string
|
|
@@ -188,14 +188,6 @@ export default defineComponent({
|
|
|
188
188
|
height: 100vh !important;
|
|
189
189
|
border-radius: 0px;
|
|
190
190
|
}
|
|
191
|
-
&--right {
|
|
192
|
-
position: absolute !important;
|
|
193
|
-
right: 0;
|
|
194
|
-
}
|
|
195
|
-
&--left {
|
|
196
|
-
position: absolute !important;
|
|
197
|
-
left: 0;
|
|
198
|
-
}
|
|
199
191
|
}
|
|
200
192
|
|
|
201
193
|
.header {
|
|
@@ -10,21 +10,11 @@
|
|
|
10
10
|
style="padding: 0; margin-bottom: 10px"
|
|
11
11
|
@click.stop.prevent="$emit('onClose')"
|
|
12
12
|
/>
|
|
13
|
-
<h2
|
|
14
|
-
|
|
15
|
-
class="title"
|
|
16
|
-
>
|
|
17
|
-
<slot name="title">
|
|
18
|
-
{{ title }}
|
|
19
|
-
</slot>
|
|
13
|
+
<h2 class="title">
|
|
14
|
+
{{ title }}
|
|
20
15
|
</h2>
|
|
21
|
-
<p
|
|
22
|
-
|
|
23
|
-
class="subtitle"
|
|
24
|
-
>
|
|
25
|
-
<slot name="subtitle">
|
|
26
|
-
{{ subtitle }}
|
|
27
|
-
</slot>
|
|
16
|
+
<p class="subtitle">
|
|
17
|
+
{{ subtitle }}
|
|
28
18
|
</p>
|
|
29
19
|
</div>
|
|
30
20
|
<dl-button
|
|
@@ -40,7 +30,7 @@
|
|
|
40
30
|
</template>
|
|
41
31
|
|
|
42
32
|
<script lang="ts">
|
|
43
|
-
import {
|
|
33
|
+
import { defineComponent } from 'vue-demi'
|
|
44
34
|
import { DlButton } from '../DlButton'
|
|
45
35
|
|
|
46
36
|
export default defineComponent({
|
|
@@ -54,12 +44,7 @@ export default defineComponent({
|
|
|
54
44
|
closeButton: { type: Boolean, default: true },
|
|
55
45
|
hasBackButton: Boolean
|
|
56
46
|
},
|
|
57
|
-
emits: ['onClose']
|
|
58
|
-
setup(props, { slots }) {
|
|
59
|
-
const hasTitle = computed(() => !!props.title || !!slots.title)
|
|
60
|
-
const hasSubtitle = computed(() => !!props.subtitle || !!slots.subtitle)
|
|
61
|
-
return { hasTitle, hasSubtitle }
|
|
62
|
-
}
|
|
47
|
+
emits: ['onClose']
|
|
63
48
|
})
|
|
64
49
|
</script>
|
|
65
50
|
|
|
@@ -75,7 +60,6 @@ export default defineComponent({
|
|
|
75
60
|
font-size: var(--dl-font-size-h2);
|
|
76
61
|
margin: 0;
|
|
77
62
|
color: var(--dl-color-darker);
|
|
78
|
-
line-height: 2rem !important;
|
|
79
63
|
}
|
|
80
64
|
|
|
81
65
|
.subtitle {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
:class="contentClass"
|
|
79
79
|
:style="contentStyle"
|
|
80
80
|
:cover="cover"
|
|
81
|
-
|
|
81
|
+
fit
|
|
82
82
|
:persistent="persistent"
|
|
83
83
|
:auto-close="autoClose"
|
|
84
84
|
:anchor="menuAnchor"
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
:class="contentClass"
|
|
143
143
|
:style="contentStyle"
|
|
144
144
|
:cover="cover"
|
|
145
|
-
|
|
145
|
+
fit
|
|
146
146
|
:persistent="persistent"
|
|
147
147
|
:auto-close="autoClose"
|
|
148
148
|
:anchor="menuAnchor"
|
|
@@ -227,8 +227,7 @@ export default defineComponent({
|
|
|
227
227
|
flat: Boolean,
|
|
228
228
|
uppercase: Boolean,
|
|
229
229
|
outlined: Boolean,
|
|
230
|
-
padding: { type: String, default: '5px' }
|
|
231
|
-
fit: { type: Boolean, default: true }
|
|
230
|
+
padding: { type: String, default: '5px' }
|
|
232
231
|
},
|
|
233
232
|
emits: [
|
|
234
233
|
'update:model-value',
|
|
@@ -350,6 +349,19 @@ export default defineComponent({
|
|
|
350
349
|
}
|
|
351
350
|
}
|
|
352
351
|
|
|
352
|
+
// expose public methods
|
|
353
|
+
Object.assign(proxy, {
|
|
354
|
+
show,
|
|
355
|
+
hide,
|
|
356
|
+
toggle,
|
|
357
|
+
onClickHide,
|
|
358
|
+
onClick,
|
|
359
|
+
onBeforeShow,
|
|
360
|
+
onShow,
|
|
361
|
+
onBeforeHide,
|
|
362
|
+
onHide
|
|
363
|
+
})
|
|
364
|
+
|
|
353
365
|
onMounted(() => {
|
|
354
366
|
if (props.modelValue) {
|
|
355
367
|
show()
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="dl-pagination--rows_selector">
|
|
3
3
|
<span class="dl-pagination--rows_per_page_label">{{ itemsName }} per page:</span>
|
|
4
|
+
<dl-typography
|
|
5
|
+
v-if="hasSingeValue"
|
|
6
|
+
color="dl-color-darker"
|
|
7
|
+
>
|
|
8
|
+
{{ modelValue }}
|
|
9
|
+
</dl-typography>
|
|
4
10
|
<dl-select
|
|
11
|
+
v-else
|
|
5
12
|
size="s"
|
|
6
13
|
:options="options"
|
|
7
14
|
:disabled="disabled"
|
|
@@ -19,11 +26,13 @@
|
|
|
19
26
|
<script lang="ts">
|
|
20
27
|
import { defineComponent, PropType } from 'vue-demi'
|
|
21
28
|
import { DlSelect } from '../DlSelect'
|
|
29
|
+
import DlTypography from '../DlTypography.vue'
|
|
22
30
|
|
|
23
31
|
export default defineComponent({
|
|
24
32
|
name: 'RowsSelector',
|
|
25
33
|
components: {
|
|
26
|
-
DlSelect
|
|
34
|
+
DlSelect,
|
|
35
|
+
DlTypography
|
|
27
36
|
},
|
|
28
37
|
model: {
|
|
29
38
|
prop: 'modelValue',
|
|
@@ -45,6 +54,11 @@ export default defineComponent({
|
|
|
45
54
|
disabled: Boolean
|
|
46
55
|
},
|
|
47
56
|
emits: ['update:modelValue'],
|
|
57
|
+
computed: {
|
|
58
|
+
hasSingeValue() {
|
|
59
|
+
return this.options.length <= 1
|
|
60
|
+
}
|
|
61
|
+
},
|
|
48
62
|
methods: {
|
|
49
63
|
setSelectedItem(val: number) {
|
|
50
64
|
this.$emit('update:modelValue', val)
|
|
@@ -98,6 +98,7 @@ import { v4 } from 'uuid'
|
|
|
98
98
|
type DlRangeModelValue = {
|
|
99
99
|
min: number | null
|
|
100
100
|
max: number | null
|
|
101
|
+
both?: boolean
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
interface DlRangeProps extends SliderProps {
|
|
@@ -234,7 +235,7 @@ export default defineComponent({
|
|
|
234
235
|
return evt
|
|
235
236
|
})
|
|
236
237
|
|
|
237
|
-
function getEvents(side: 'min' | 'max') {
|
|
238
|
+
function getEvents(side: 'min' | 'max' | 'both') {
|
|
238
239
|
return isMobile !== true && state.editable.value === true
|
|
239
240
|
? {
|
|
240
241
|
onFocus: () => {
|
|
@@ -385,7 +386,7 @@ export default defineComponent({
|
|
|
385
386
|
evt,
|
|
386
387
|
{
|
|
387
388
|
step: state.step.value,
|
|
388
|
-
focus: state.focus.value,
|
|
389
|
+
focus: state.focus.value as 'min' | 'max',
|
|
389
390
|
decimals: state.decimals.value
|
|
390
391
|
},
|
|
391
392
|
{ min: props.min, max: props.max },
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
class="select-search-input"
|
|
77
77
|
:style="!isExpanded ? 'display: none;' : 'width: 100%;'"
|
|
78
78
|
:disabled="disabled"
|
|
79
|
-
:readonly="readonly"
|
|
80
79
|
@input="handleSearchInput"
|
|
81
80
|
@focus="handleSearchFocus"
|
|
82
81
|
@blur="handleSearchBlur"
|
|
@@ -140,7 +139,7 @@
|
|
|
140
139
|
no-focus
|
|
141
140
|
:offset="[0, 3]"
|
|
142
141
|
style="border-radius: 0"
|
|
143
|
-
:disabled="disabled
|
|
142
|
+
:disabled="disabled"
|
|
144
143
|
@show="onMenuOpen"
|
|
145
144
|
@hide="closeMenu"
|
|
146
145
|
>
|
|
@@ -310,7 +309,6 @@ export default defineComponent({
|
|
|
310
309
|
errorMessage: { type: String, default: '' },
|
|
311
310
|
error: { type: Boolean, default: false },
|
|
312
311
|
disabled: { type: Boolean, default: false },
|
|
313
|
-
readonly: { type: Boolean, default: false },
|
|
314
312
|
emitValue: { type: Boolean, default: false }, // We emit the value from the option and compare with it as a modelvalue
|
|
315
313
|
options: {
|
|
316
314
|
type: Array as PropType<SelectOptionType[]>,
|
|
@@ -499,9 +497,6 @@ export default defineComponent({
|
|
|
499
497
|
if (this.disabled) {
|
|
500
498
|
classes.push('dl_select__select--disabled')
|
|
501
499
|
}
|
|
502
|
-
if (this.readonly) {
|
|
503
|
-
classes.push('dl_select__select--readonly')
|
|
504
|
-
}
|
|
505
500
|
if (this.isExpanded) {
|
|
506
501
|
classes.push('dl_select__select--focused')
|
|
507
502
|
}
|
|
@@ -723,7 +718,6 @@ export default defineComponent({
|
|
|
723
718
|
if (!this.preserveSearch) {
|
|
724
719
|
const inputRef = this.$refs.searchInput as HTMLInputElement
|
|
725
720
|
if (inputRef) inputRef.value = ''
|
|
726
|
-
this.$emit('filter', '')
|
|
727
721
|
}
|
|
728
722
|
},
|
|
729
723
|
getLabel,
|
|
@@ -907,18 +901,6 @@ export default defineComponent({
|
|
|
907
901
|
pointer-events: none;
|
|
908
902
|
}
|
|
909
903
|
}
|
|
910
|
-
|
|
911
|
-
&--readonly {
|
|
912
|
-
border-color: var(--dl-color-separator);
|
|
913
|
-
cursor: text;
|
|
914
|
-
|
|
915
|
-
&:hover {
|
|
916
|
-
border-color: var(--dl-color-separator);
|
|
917
|
-
}
|
|
918
|
-
& input {
|
|
919
|
-
pointer-events: none;
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
904
|
}
|
|
923
905
|
|
|
924
906
|
.selected {
|