@dataloop-ai/components 0.16.62 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/basic/DlAlert/DlAlert.vue +7 -8
- package/src/components/basic/DlButton/DlButton.vue +33 -11
- package/src/components/basic/DlButton/utils.ts +12 -2
- package/src/components/basic/DlChip/DlChip.vue +1 -8
- package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +5 -5
- package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +6 -2
- package/src/components/compound/DlDialogBox/DlDialogBox.vue +3 -3
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +21 -15
- package/src/components/compound/DlDropdownButton/components/ButtonGroup.vue +11 -9
- package/src/components/compound/DlInput/DlInput.vue +7 -7
- package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +14 -14
- package/src/components/compound/DlPagination/components/PageNavigation.vue +21 -21
- package/src/components/compound/DlRange/DlRange.vue +1 -1
- package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +3 -3
- package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +132 -42
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +75 -0
- package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +183 -173
- package/src/components/compound/DlSearches/DlSmartSearch/components/FiltersQuery.vue +101 -0
- package/src/components/compound/DlSearches/DlSmartSearch/types.ts +4 -4
- package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +9 -4
- package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +18 -1
- package/src/components/compound/DlSelect/DlSelect.vue +3 -4
- package/src/components/compound/DlSlider/DlSlider.vue +1 -1
- package/src/components/compound/DlStepper/DlStepper.vue +2 -2
- package/src/components/compound/DlStepper/components/DlStepperFooter.vue +3 -3
- package/src/components/compound/DlStepper/components/DlStepperHeader.vue +2 -2
- package/src/components/compound/DlTabs/components/TabsWrapper.vue +1 -1
- package/src/components/compound/DlToggleButton/DlToggleButton.vue +14 -11
- package/src/components/essential/DlIcon/DlIcon.vue +1 -1
- package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +1 -1
- package/src/components/essential/DlTypography/DlTypography.vue +18 -2
- package/src/components/shared/types.ts +7 -1
- package/src/demos/DlAlertDemo.vue +17 -3
- package/src/demos/DlDialogBoxDemo.vue +15 -1
- package/src/demos/DlDropdownButtonDemo.vue +4 -4
- package/src/demos/DlSearchDemo.vue +1 -1
- package/src/demos/DlStepperDemo/SimpleStepper.vue +1 -1
- package/src/demos/DlStepperDemo/steps/DataStep.vue +1 -1
- package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +40 -75
- package/src/hooks/use-suggestions.ts +8 -3
- package/src/utils/parse-smart-query.ts +109 -1
package/package.json
CHANGED
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
<div
|
|
24
24
|
v-if="closable"
|
|
25
|
-
class="close-
|
|
26
|
-
data-test="close-
|
|
25
|
+
class="close-button"
|
|
26
|
+
data-test="close-button"
|
|
27
27
|
:style="closeButtonStyle"
|
|
28
28
|
>
|
|
29
29
|
<dl-icon
|
|
30
|
-
class="close-
|
|
31
|
-
data-test="close-
|
|
30
|
+
class="close-button-icon"
|
|
31
|
+
data-test="close-button-icon"
|
|
32
32
|
icon="icon-dl-close"
|
|
33
33
|
color="dl-color-darker"
|
|
34
34
|
size="12px"
|
|
@@ -116,6 +116,7 @@ export default defineComponent({
|
|
|
116
116
|
setup(props, { emit }) {
|
|
117
117
|
const show = ref(props.modelValue)
|
|
118
118
|
const type = props.type as AlertType
|
|
119
|
+
const typeIcon = typeToIconMap[type]
|
|
119
120
|
const icon = computed(() => typeToIconMap[type])
|
|
120
121
|
const iconColor = computed(() => typeToIconColorMap[type])
|
|
121
122
|
const textStyle = computed(() => ({
|
|
@@ -210,15 +211,13 @@ export default defineComponent({
|
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
.text {
|
|
213
|
-
display: flex;
|
|
214
|
-
text-align: left;
|
|
215
214
|
padding-left: 10px;
|
|
216
215
|
font-size: var(--dl-font-size-body);
|
|
217
216
|
align-self: center;
|
|
218
217
|
word-break: break-word;
|
|
219
218
|
}
|
|
220
219
|
|
|
221
|
-
.close-
|
|
220
|
+
.close-button {
|
|
222
221
|
padding-right: 10px;
|
|
223
222
|
padding-left: 10px;
|
|
224
223
|
align-items: var(--dl-alert-align-button, start);
|
|
@@ -228,7 +227,7 @@ export default defineComponent({
|
|
|
228
227
|
cursor: pointer;
|
|
229
228
|
}
|
|
230
229
|
|
|
231
|
-
.close-
|
|
230
|
+
.close-button-icon:hover {
|
|
232
231
|
cursor: pointer;
|
|
233
232
|
}
|
|
234
233
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
:id="uuid"
|
|
4
4
|
class="dl-button-container"
|
|
5
5
|
style="pointer-events: none"
|
|
6
|
-
:style="[cssButtonVars, containerStyles]"
|
|
6
|
+
:style="[cssButtonVars, containerStyles, capitalizeFirst]"
|
|
7
7
|
>
|
|
8
8
|
<button
|
|
9
9
|
v-if="hasContent || hasIcon"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<dl-tooltip
|
|
20
20
|
v-if="!tooltip && overflow && isOverflowing && hasLabel"
|
|
21
21
|
>
|
|
22
|
-
{{
|
|
22
|
+
{{ label }}
|
|
23
23
|
</dl-tooltip>
|
|
24
24
|
<div class="dl-button-content dl-anchor--skip">
|
|
25
25
|
<dl-icon
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
'dl-button-no-wrap': noWrap
|
|
38
38
|
}"
|
|
39
39
|
>
|
|
40
|
-
{{
|
|
40
|
+
{{ label }}
|
|
41
41
|
</span>
|
|
42
42
|
<slot />
|
|
43
43
|
</div>
|
|
@@ -67,12 +67,12 @@ import {
|
|
|
67
67
|
setMaxHeight
|
|
68
68
|
} from './utils'
|
|
69
69
|
import type { ButtonSizes } from './utils'
|
|
70
|
-
import { textTransform } from '../../../utils/string'
|
|
71
70
|
import { defineComponent, PropType, ref } from 'vue-demi'
|
|
72
71
|
import { colorNames } from '../../../utils/css-color-names'
|
|
73
72
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
74
73
|
import { v4 } from 'uuid'
|
|
75
74
|
import { ButtonColors } from './types'
|
|
75
|
+
import { transformOptions } from '../../shared/types'
|
|
76
76
|
import { stringStyleToRecord } from '../../../utils'
|
|
77
77
|
import { isString } from 'lodash'
|
|
78
78
|
|
|
@@ -102,9 +102,15 @@ export default defineComponent({
|
|
|
102
102
|
size: { type: String! as PropType<ButtonSizes>, default: 'm' },
|
|
103
103
|
filled: { type: Boolean, default: true },
|
|
104
104
|
round: { type: Boolean, default: false },
|
|
105
|
+
shaded: { type: Boolean, default: false },
|
|
105
106
|
fluid: Boolean,
|
|
106
107
|
flat: Boolean,
|
|
107
|
-
|
|
108
|
+
transform: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: 'default',
|
|
111
|
+
validator: (value: string): boolean =>
|
|
112
|
+
transformOptions.includes(value)
|
|
113
|
+
},
|
|
108
114
|
outlined: Boolean,
|
|
109
115
|
noWrap: Boolean,
|
|
110
116
|
icon: { type: String, default: '' },
|
|
@@ -124,6 +130,12 @@ export default defineComponent({
|
|
|
124
130
|
}
|
|
125
131
|
},
|
|
126
132
|
computed: {
|
|
133
|
+
capitalizeFirst(): string {
|
|
134
|
+
if (this.transform === 'default') {
|
|
135
|
+
return 'first-letter-capitalized'
|
|
136
|
+
}
|
|
137
|
+
return null
|
|
138
|
+
},
|
|
127
139
|
computedStyles(): Record<string, string> {
|
|
128
140
|
return isString(this.styles)
|
|
129
141
|
? stringStyleToRecord(this.styles)
|
|
@@ -145,9 +157,6 @@ export default defineComponent({
|
|
|
145
157
|
this.label !== ''
|
|
146
158
|
)
|
|
147
159
|
},
|
|
148
|
-
buttonLabel(): string {
|
|
149
|
-
return textTransform(this.label)
|
|
150
|
-
},
|
|
151
160
|
hasIcon(): boolean {
|
|
152
161
|
return typeof this.icon === 'string' && this.icon !== ''
|
|
153
162
|
},
|
|
@@ -207,32 +216,38 @@ export default defineComponent({
|
|
|
207
216
|
flat: this.flat,
|
|
208
217
|
color: this.color,
|
|
209
218
|
filled: this.filled,
|
|
219
|
+
shaded: this.shaded,
|
|
210
220
|
textColor: this.textColor
|
|
211
221
|
}),
|
|
212
222
|
'--dl-button-bg': setBgColor({
|
|
213
223
|
disabled: this.disabled,
|
|
214
224
|
outlined: this.outlined,
|
|
225
|
+
shaded: this.shaded,
|
|
215
226
|
flat: this.flat,
|
|
216
227
|
color: this.color
|
|
217
228
|
}),
|
|
218
229
|
'--dl-button-border': setBorder({
|
|
219
230
|
disabled: this.disabled,
|
|
220
231
|
flat: this.flat,
|
|
232
|
+
shaded: this.shaded,
|
|
221
233
|
color: this.color
|
|
222
234
|
}),
|
|
223
235
|
'--dl-button-text-color-hover': setColorOnHover({
|
|
224
236
|
disabled: this.disabled,
|
|
225
237
|
outlined: this.outlined,
|
|
238
|
+
shaded: this.shaded,
|
|
226
239
|
flat: this.flat,
|
|
227
240
|
color: this.textColor
|
|
228
241
|
}),
|
|
229
242
|
'--dl-button-border-hover': setBorderOnHover({
|
|
230
243
|
disabled: this.disabled,
|
|
231
244
|
flat: this.flat,
|
|
245
|
+
shaded: this.shaded,
|
|
232
246
|
color: this.color
|
|
233
247
|
}),
|
|
234
248
|
'--dl-button-bg-hover': setBgOnHover({
|
|
235
249
|
disabled: this.disabled,
|
|
250
|
+
shaded: this.shaded,
|
|
236
251
|
outlined: this.outlined,
|
|
237
252
|
flat: this.flat,
|
|
238
253
|
filled: this.filled,
|
|
@@ -256,9 +271,9 @@ export default defineComponent({
|
|
|
256
271
|
: setPadding(this.size),
|
|
257
272
|
'--dl-button-margin': this.margin,
|
|
258
273
|
'--dl-button-font-size': setFontSize(this.size),
|
|
259
|
-
'--dl-button-text-transform': this.
|
|
260
|
-
?
|
|
261
|
-
:
|
|
274
|
+
'--dl-button-text-transform': this.capitalizeFirst
|
|
275
|
+
? null
|
|
276
|
+
: this.transform,
|
|
262
277
|
'--dl-button-cursor': this.isActionable
|
|
263
278
|
? 'pointer'
|
|
264
279
|
: 'not-allowed',
|
|
@@ -369,6 +384,13 @@ export default defineComponent({
|
|
|
369
384
|
gap: var(--dl-button-gap, 7px);
|
|
370
385
|
}
|
|
371
386
|
|
|
387
|
+
.dl-chip.first-letter-capitalized {
|
|
388
|
+
&::first-letter,
|
|
389
|
+
& > *::first-letter {
|
|
390
|
+
text-transform: capitalize;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
372
394
|
.dl-button-container {
|
|
373
395
|
display: inline-block;
|
|
374
396
|
width: var(--dl-button-container-width);
|
|
@@ -43,6 +43,7 @@ export interface DlButtonProps {
|
|
|
43
43
|
outlined: boolean
|
|
44
44
|
flat: boolean
|
|
45
45
|
filled: boolean
|
|
46
|
+
shaded: boolean
|
|
46
47
|
color: string
|
|
47
48
|
textColor: string
|
|
48
49
|
}
|
|
@@ -63,6 +64,7 @@ export const setTextColor = ({
|
|
|
63
64
|
flat,
|
|
64
65
|
color,
|
|
65
66
|
filled,
|
|
67
|
+
shaded,
|
|
66
68
|
textColor
|
|
67
69
|
}: DlButtonProps): string => {
|
|
68
70
|
if (disabled) {
|
|
@@ -78,6 +80,9 @@ export const setTextColor = ({
|
|
|
78
80
|
|
|
79
81
|
return getColor(textColor, 'dl-color-secondary')
|
|
80
82
|
}
|
|
83
|
+
if (shaded) {
|
|
84
|
+
return getColor(textColor, 'dl-color-darker')
|
|
85
|
+
}
|
|
81
86
|
if (filled) {
|
|
82
87
|
return getColor(textColor, 'dl-color-text-buttons')
|
|
83
88
|
}
|
|
@@ -89,11 +94,15 @@ export const setBgColor = ({
|
|
|
89
94
|
disabled,
|
|
90
95
|
flat,
|
|
91
96
|
outlined,
|
|
97
|
+
shaded,
|
|
92
98
|
color = ''
|
|
93
99
|
}: Partial<DlButtonProps>) => {
|
|
94
100
|
if (disabled || flat || outlined) {
|
|
95
101
|
return 'var(--dl-color-transparent)'
|
|
96
102
|
}
|
|
103
|
+
if (shaded) {
|
|
104
|
+
return 'var(--dl-color-fill)'
|
|
105
|
+
}
|
|
97
106
|
|
|
98
107
|
return getColor(color, 'dl-color-secondary')
|
|
99
108
|
}
|
|
@@ -101,14 +110,15 @@ export const setBgColor = ({
|
|
|
101
110
|
export const setBorder = ({
|
|
102
111
|
disabled,
|
|
103
112
|
flat,
|
|
104
|
-
color = ''
|
|
113
|
+
color = '',
|
|
114
|
+
shaded
|
|
105
115
|
}: Partial<DlButtonProps>) => {
|
|
106
116
|
if (disabled) {
|
|
107
117
|
return flat
|
|
108
118
|
? 'var(--dl-color-transparent)'
|
|
109
119
|
: 'var(--dl-color-separator)'
|
|
110
120
|
}
|
|
111
|
-
if (flat) {
|
|
121
|
+
if (flat || shaded) {
|
|
112
122
|
return 'var(--dl-color-transparent)'
|
|
113
123
|
}
|
|
114
124
|
|
|
@@ -62,14 +62,7 @@ import {
|
|
|
62
62
|
setRemoveIconWidth
|
|
63
63
|
} from './utils'
|
|
64
64
|
import { v4 } from 'uuid'
|
|
65
|
-
|
|
66
|
-
const transformOptions: string[] = [
|
|
67
|
-
'none',
|
|
68
|
-
'capitalize',
|
|
69
|
-
'uppercase',
|
|
70
|
-
'lowercase',
|
|
71
|
-
'default'
|
|
72
|
-
]
|
|
65
|
+
import { transformOptions } from '../../shared/types'
|
|
73
66
|
|
|
74
67
|
export default defineComponent({
|
|
75
68
|
name: 'DlChip',
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<div
|
|
22
22
|
v-if="direction === 'right' && isFullWidth === true"
|
|
23
23
|
class="collapse-icon collapse-icon--right"
|
|
24
|
-
@click="
|
|
24
|
+
@click="handleCollapseButtonClick"
|
|
25
25
|
>
|
|
26
26
|
<dl-tooltip>Hide</dl-tooltip>
|
|
27
27
|
<dl-icon
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<div
|
|
34
34
|
v-else-if="direction === 'right' && isFullWidth === false"
|
|
35
35
|
class="collapse-icon collapse-icon--right"
|
|
36
|
-
@click="
|
|
36
|
+
@click="handleCollapseButtonClick"
|
|
37
37
|
>
|
|
38
38
|
<dl-tooltip>Show</dl-tooltip>
|
|
39
39
|
<dl-icon
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<div
|
|
46
46
|
v-else-if="direction === 'left' && isFullWidth === true"
|
|
47
47
|
class="collapse-icon collapse-icon--left"
|
|
48
|
-
@click="
|
|
48
|
+
@click="handleCollapseButtonClick"
|
|
49
49
|
>
|
|
50
50
|
<dl-tooltip>Hide</dl-tooltip>
|
|
51
51
|
<dl-icon
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<div
|
|
58
58
|
v-else-if="direction === 'left' && isFullWidth === false"
|
|
59
59
|
class="collapse-icon collapse-icon--left--collapsed"
|
|
60
|
-
@click="
|
|
60
|
+
@click="handleCollapseButtonClick"
|
|
61
61
|
>
|
|
62
62
|
<dl-tooltip>Show</dl-tooltip>
|
|
63
63
|
<dl-icon
|
|
@@ -346,7 +346,7 @@ export default defineComponent({
|
|
|
346
346
|
|
|
347
347
|
this.avoidUserSelect = false
|
|
348
348
|
},
|
|
349
|
-
|
|
349
|
+
handleCollapseButtonClick() {
|
|
350
350
|
this.$emit('update:model-value', !this.modelValue)
|
|
351
351
|
},
|
|
352
352
|
collapse() {
|
|
@@ -89,9 +89,13 @@ export function flattenConfusionMatrix(
|
|
|
89
89
|
xLabel: labelStrings[rowIndex],
|
|
90
90
|
yLabel: labelStrings[cellIndex],
|
|
91
91
|
x: rowIndex,
|
|
92
|
-
y: cellIndex
|
|
93
|
-
link: cellIsObject ? (cell as DlConfusionMatrixCell).link : ''
|
|
92
|
+
y: cellIndex
|
|
94
93
|
}
|
|
94
|
+
|
|
95
|
+
if ((cell as DlConfusionMatrixCell)?.link) {
|
|
96
|
+
object.link = (cell as DlConfusionMatrixCell)?.link
|
|
97
|
+
}
|
|
98
|
+
|
|
95
99
|
toNormalize.push(object)
|
|
96
100
|
}
|
|
97
101
|
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
:style="{
|
|
16
16
|
width: Number(width) ? `${width}px` : width,
|
|
17
17
|
height: Number(height) ? `${height}px` : height,
|
|
18
|
-
transform: `translate(${draggableOptions.draggableX}px, ${draggableOptions.draggableY}px)
|
|
18
|
+
transform: `translate(${draggableOptions.draggableX}px, ${draggableOptions.draggableY}px)`,
|
|
19
|
+
maxHeight: !fullscreen && !fullHeight ? '90vh' : ''
|
|
19
20
|
}"
|
|
20
21
|
:class="{
|
|
21
22
|
'dialog-wrapper--fullscreen': fullscreen,
|
|
@@ -226,7 +227,6 @@ export default defineComponent({
|
|
|
226
227
|
display: flex;
|
|
227
228
|
flex-direction: column;
|
|
228
229
|
z-index: var(--dl-z-index-menu);
|
|
229
|
-
max-height: 90vh;
|
|
230
230
|
|
|
231
231
|
&--fullscreen {
|
|
232
232
|
margin: 0;
|
|
@@ -267,7 +267,7 @@ export default defineComponent({
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
.content {
|
|
270
|
-
padding: 10px 16px 30px 16px;
|
|
270
|
+
padding: var(--dl-dialog-box-content-padding, 10px 16px 30px 16px);
|
|
271
271
|
overflow: auto;
|
|
272
272
|
height: 100%;
|
|
273
273
|
|
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
>
|
|
11
11
|
<dl-button
|
|
12
12
|
class="dl-button-dropdown--current"
|
|
13
|
-
:style="
|
|
13
|
+
:style="mainButtonStyle"
|
|
14
14
|
:label="label"
|
|
15
15
|
:outlined="outlined"
|
|
16
16
|
:size="size"
|
|
17
17
|
:flat="flat"
|
|
18
|
-
:disabled="disabled === true ||
|
|
18
|
+
:disabled="disabled === true || disableMainButton === true"
|
|
19
19
|
:max-width="maxWidth"
|
|
20
20
|
:color="color"
|
|
21
21
|
:icon="icon"
|
|
22
|
-
:
|
|
22
|
+
:transform="transform"
|
|
23
23
|
:text-color="textColor"
|
|
24
24
|
no-wrap
|
|
25
25
|
:aria-expanded="showing === true ? 'true' : 'false'"
|
|
26
26
|
:aria-haspopup="true"
|
|
27
27
|
:aria-disabled="
|
|
28
28
|
disabled === true ||
|
|
29
|
-
(split === false &&
|
|
29
|
+
(split === false && disableMainButton === true) ||
|
|
30
30
|
disableDropdown === true
|
|
31
31
|
"
|
|
32
32
|
:overflow="overflow"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
/>
|
|
36
36
|
<dl-button
|
|
37
37
|
class="dl-button-dropdown__arrow-container"
|
|
38
|
-
:style="
|
|
38
|
+
:style="buttonCSSStyles"
|
|
39
39
|
:disabled="disabled === true || disableDropdown === true"
|
|
40
40
|
:outlined="outlined"
|
|
41
41
|
:flat="flat"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
:aria-haspopup="true"
|
|
47
47
|
:aria-disabled="
|
|
48
48
|
disabled === true ||
|
|
49
|
-
(split === false &&
|
|
49
|
+
(split === false && disableMainButton === true) ||
|
|
50
50
|
disableDropdown === true
|
|
51
51
|
"
|
|
52
52
|
:no-wrap="noWrap"
|
|
@@ -111,11 +111,11 @@
|
|
|
111
111
|
:aria-haspopup="true"
|
|
112
112
|
:aria-disabled="
|
|
113
113
|
disabled === true ||
|
|
114
|
-
(split === false &&
|
|
114
|
+
(split === false && disableMainButton === true) ||
|
|
115
115
|
disableDropdown === true
|
|
116
116
|
"
|
|
117
|
-
:disabled="disabled === true ||
|
|
118
|
-
:style="
|
|
117
|
+
:disabled="disabled === true || disableMainButton === true"
|
|
118
|
+
:style="mainButtonStyle"
|
|
119
119
|
:no-wrap="props.noWrap"
|
|
120
120
|
:tooltip="tooltip"
|
|
121
121
|
:max-width="maxWidth"
|
|
@@ -188,6 +188,7 @@ import {
|
|
|
188
188
|
Ref
|
|
189
189
|
} from 'vue-demi'
|
|
190
190
|
import { v4 } from 'uuid'
|
|
191
|
+
import { transformOptions } from '../../shared/types'
|
|
191
192
|
|
|
192
193
|
export default defineComponent({
|
|
193
194
|
name: 'DlDropdownButton',
|
|
@@ -208,7 +209,7 @@ export default defineComponent({
|
|
|
208
209
|
dropdownIcon: { type: String, default: 'icon-dl-down-chevron' },
|
|
209
210
|
contentClass: { type: [Array, String, Object], default: '' },
|
|
210
211
|
contentStyle: { type: [Array, String, Object], default: '' },
|
|
211
|
-
|
|
212
|
+
mainButtonStyle: { type: [Array, String, Object], default: '' },
|
|
212
213
|
cover: Boolean,
|
|
213
214
|
maxWidth: { type: String, default: null },
|
|
214
215
|
maxHeight: { type: String, default: null },
|
|
@@ -224,7 +225,7 @@ export default defineComponent({
|
|
|
224
225
|
default: 'top end'
|
|
225
226
|
},
|
|
226
227
|
menuOffset: { type: Array, default: () => [0, 0] },
|
|
227
|
-
|
|
228
|
+
disableMainButton: Boolean,
|
|
228
229
|
disableDropdown: Boolean,
|
|
229
230
|
noIconAnimation: Boolean,
|
|
230
231
|
disabled: Boolean,
|
|
@@ -237,7 +238,12 @@ export default defineComponent({
|
|
|
237
238
|
icon: { type: String, required: false, default: '' },
|
|
238
239
|
iconSize: { type: String, required: false, default: '20px' },
|
|
239
240
|
flat: Boolean,
|
|
240
|
-
|
|
241
|
+
transform: {
|
|
242
|
+
type: String,
|
|
243
|
+
default: 'default',
|
|
244
|
+
validator: (value: string): boolean =>
|
|
245
|
+
transformOptions.includes(value)
|
|
246
|
+
},
|
|
241
247
|
outlined: Boolean,
|
|
242
248
|
padding: { type: String, default: '5px' },
|
|
243
249
|
fitContent: Boolean,
|
|
@@ -276,7 +282,7 @@ export default defineComponent({
|
|
|
276
282
|
|
|
277
283
|
if (
|
|
278
284
|
props.disabled === true ||
|
|
279
|
-
(props.split === false && props.
|
|
285
|
+
(props.split === false && props.disableMainButton === true) ||
|
|
280
286
|
props.disableDropdown === true
|
|
281
287
|
) {
|
|
282
288
|
acc['aria-disabled'] = 'true'
|
|
@@ -302,7 +308,7 @@ export default defineComponent({
|
|
|
302
308
|
)
|
|
303
309
|
})
|
|
304
310
|
|
|
305
|
-
const
|
|
311
|
+
const buttonCSSStyles = computed(() => {
|
|
306
312
|
return {
|
|
307
313
|
'--dl-button-border-left': props.outlined
|
|
308
314
|
? 'none'
|
|
@@ -396,7 +402,7 @@ export default defineComponent({
|
|
|
396
402
|
iconClass,
|
|
397
403
|
menuRef,
|
|
398
404
|
attributes,
|
|
399
|
-
|
|
405
|
+
buttonCSSStyles,
|
|
400
406
|
showing,
|
|
401
407
|
onBeforeShow,
|
|
402
408
|
onBeforeHide,
|
|
@@ -32,12 +32,13 @@ export default defineComponent({
|
|
|
32
32
|
// todo: wtf is this ?
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
.filter((t) => this[t] === true)
|
|
35
|
-
.map((t) => `dl-
|
|
35
|
+
.map((t) => `dl-button-group--${t}`)
|
|
36
36
|
.join(' ')
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
|
-
`dl-
|
|
40
|
-
|
|
39
|
+
`dl-button-group row no-wrap${
|
|
40
|
+
cls.length > 0 ? ' ' + cls : ''
|
|
41
|
+
}` + (this.spread ? ' dl-button-group--spread' : ' inline')
|
|
41
42
|
)
|
|
42
43
|
}
|
|
43
44
|
}
|
|
@@ -45,7 +46,7 @@ export default defineComponent({
|
|
|
45
46
|
</script>
|
|
46
47
|
|
|
47
48
|
<style lang="scss" scoped>
|
|
48
|
-
.dl-
|
|
49
|
+
.dl-button-group {
|
|
49
50
|
border-radius: 2px;
|
|
50
51
|
vertical-align: middle;
|
|
51
52
|
|
|
@@ -57,7 +58,7 @@ export default defineComponent({
|
|
|
57
58
|
box-shadow: none;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
> .dl-
|
|
61
|
+
> .dl-button-group {
|
|
61
62
|
box-shadow: none;
|
|
62
63
|
|
|
63
64
|
&:first-child {
|
|
@@ -73,10 +74,10 @@ export default defineComponent({
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
> .dl-
|
|
77
|
+
> .dl-button-group:not(:first-child) > .dl-button:first-child:before {
|
|
77
78
|
border-left: 0;
|
|
78
79
|
}
|
|
79
|
-
> .dl-
|
|
80
|
+
> .dl-button-group:not(:last-child) > .dl-button:last-child:before {
|
|
80
81
|
border-right: 0;
|
|
81
82
|
}
|
|
82
83
|
> .dl-button:not(:last-child) {
|
|
@@ -108,11 +109,12 @@ export default defineComponent({
|
|
|
108
109
|
border-radius: 0;
|
|
109
110
|
}
|
|
110
111
|
&--spread {
|
|
111
|
-
> .dl-
|
|
112
|
+
> .dl-button-group {
|
|
112
113
|
display: flex !important;
|
|
113
114
|
}
|
|
114
115
|
> .dl-button,
|
|
115
|
-
> .dl-
|
|
116
|
+
> .dl-button-group
|
|
117
|
+
> .dl-button:not(.dl-button-dropdown__arrow-container) {
|
|
116
118
|
width: auto;
|
|
117
119
|
min-width: 0;
|
|
118
120
|
max-width: 100%;
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
]"
|
|
76
76
|
>
|
|
77
77
|
<slot name="append" />
|
|
78
|
-
<span v-show="
|
|
78
|
+
<span v-show="showClearButton">
|
|
79
79
|
<dl-button
|
|
80
80
|
ref="input-clear-button"
|
|
81
81
|
icon="icon-dl-close"
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
Remove text
|
|
90
90
|
</dl-tooltip>
|
|
91
91
|
</span>
|
|
92
|
-
<span v-show="
|
|
92
|
+
<span v-show="showShowPassButton">
|
|
93
93
|
<dl-button
|
|
94
94
|
ref="input-show-pass-button"
|
|
95
95
|
:icon="passShowIcon"
|
|
@@ -302,7 +302,7 @@ export default defineComponent({
|
|
|
302
302
|
default: false
|
|
303
303
|
},
|
|
304
304
|
dense: Boolean,
|
|
305
|
-
|
|
305
|
+
hideClearButton: {
|
|
306
306
|
type: Boolean,
|
|
307
307
|
default: false
|
|
308
308
|
},
|
|
@@ -436,7 +436,7 @@ export default defineComponent({
|
|
|
436
436
|
hasAppend(): boolean {
|
|
437
437
|
return (
|
|
438
438
|
(!!this.$slots.append ||
|
|
439
|
-
!this.
|
|
439
|
+
!this.hideClearButton ||
|
|
440
440
|
this.type === 'password') &&
|
|
441
441
|
!this.isSmall
|
|
442
442
|
)
|
|
@@ -447,9 +447,9 @@ export default defineComponent({
|
|
|
447
447
|
passShowIcon(): string {
|
|
448
448
|
return this.showPass ? 'icon-dl-hide' : 'icon-dl-show'
|
|
449
449
|
},
|
|
450
|
-
|
|
450
|
+
showClearButton(): boolean {
|
|
451
451
|
return (
|
|
452
|
-
!this.
|
|
452
|
+
!this.hideClearButton &&
|
|
453
453
|
this.type !== 'password' &&
|
|
454
454
|
!this.disabled &&
|
|
455
455
|
!this.readonly &&
|
|
@@ -457,7 +457,7 @@ export default defineComponent({
|
|
|
457
457
|
// this.focused
|
|
458
458
|
)
|
|
459
459
|
},
|
|
460
|
-
|
|
460
|
+
showShowPassButton(): boolean {
|
|
461
461
|
return !this.$slots.append && this.type === 'password'
|
|
462
462
|
},
|
|
463
463
|
showSuggestItems(): boolean {
|
|
@@ -101,7 +101,7 @@ export default defineComponent({
|
|
|
101
101
|
default: () => [] as Query[]
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
|
-
emits: ['update:modelValue', 'save', 'remove', 'search'],
|
|
104
|
+
emits: ['update:modelValue', 'save', 'remove', 'search', 'update-query'],
|
|
105
105
|
data() {
|
|
106
106
|
return {
|
|
107
107
|
preventOnChange: false,
|
|
@@ -144,20 +144,15 @@ export default defineComponent({
|
|
|
144
144
|
queries() {
|
|
145
145
|
this.resetEditor()
|
|
146
146
|
},
|
|
147
|
-
|
|
148
|
-
this.$
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
value: val.query
|
|
152
|
-
}
|
|
153
|
-
if (val.query && this.jsonEditor.set) {
|
|
154
|
-
this.activeQuery = {
|
|
155
|
-
name: '',
|
|
156
|
-
query: val.query
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
this.alignText()
|
|
147
|
+
activeQuery(val) {
|
|
148
|
+
this.$emit('update-query', val)
|
|
149
|
+
this.jsonEditor?.set({
|
|
150
|
+
text: val.query
|
|
160
151
|
})
|
|
152
|
+
this.selectedOption = {
|
|
153
|
+
label: val.name,
|
|
154
|
+
value: val.query
|
|
155
|
+
}
|
|
161
156
|
}
|
|
162
157
|
},
|
|
163
158
|
mounted() {
|
|
@@ -289,4 +284,9 @@ export default defineComponent({
|
|
|
289
284
|
display: flex;
|
|
290
285
|
justify-content: space-between;
|
|
291
286
|
}
|
|
287
|
+
.footer-save {
|
|
288
|
+
width: 25%;
|
|
289
|
+
display: flex;
|
|
290
|
+
justify-content: space-between;
|
|
291
|
+
}
|
|
292
292
|
</style>
|