@dataloop-ai/components 0.16.64 → 0.17.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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/components/basic/DlAlert/DlAlert.vue +7 -8
  3. package/src/components/basic/DlButton/DlButton.vue +33 -11
  4. package/src/components/basic/DlButton/utils.ts +12 -2
  5. package/src/components/basic/DlChip/DlChip.vue +1 -8
  6. package/src/components/basic/DlPanelContainer/DlPanelContainer.vue +5 -5
  7. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/utils.ts +6 -2
  8. package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +21 -15
  9. package/src/components/compound/DlDropdownButton/components/ButtonGroup.vue +11 -9
  10. package/src/components/compound/DlInput/DlInput.vue +7 -7
  11. package/src/components/compound/DlJsonEditor/DlJsonEditor.vue +14 -14
  12. package/src/components/compound/DlPagination/components/PageNavigation.vue +21 -21
  13. package/src/components/compound/DlRange/DlRange.vue +1 -1
  14. package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +3 -3
  15. package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +132 -42
  16. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchFilters.vue +75 -0
  17. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +183 -173
  18. package/src/components/compound/DlSearches/DlSmartSearch/components/FiltersQuery.vue +101 -0
  19. package/src/components/compound/DlSearches/DlSmartSearch/types.ts +4 -4
  20. package/src/components/compound/DlSearches/DlSmartSearch/utils/highlightSyntax.ts +9 -4
  21. package/src/components/compound/DlSearches/DlSmartSearch/utils/utils.ts +18 -1
  22. package/src/components/compound/DlSelect/DlSelect.vue +3 -4
  23. package/src/components/compound/DlSlider/DlSlider.vue +1 -1
  24. package/src/components/compound/DlStepper/DlStepper.vue +2 -2
  25. package/src/components/compound/DlStepper/components/DlStepperFooter.vue +3 -3
  26. package/src/components/compound/DlStepper/components/DlStepperHeader.vue +2 -2
  27. package/src/components/compound/DlTabs/components/TabsWrapper.vue +1 -1
  28. package/src/components/compound/DlToggleButton/DlToggleButton.vue +14 -11
  29. package/src/components/essential/DlIcon/DlIcon.vue +1 -1
  30. package/src/components/essential/DlSpinner/styles/spinnerStyles.scss +1 -1
  31. package/src/components/essential/DlTypography/DlTypography.vue +18 -2
  32. package/src/components/shared/types.ts +7 -1
  33. package/src/demos/DlAlertDemo.vue +17 -3
  34. package/src/demos/DlDropdownButtonDemo.vue +4 -4
  35. package/src/demos/DlSearchDemo.vue +1 -1
  36. package/src/demos/DlStepperDemo/SimpleStepper.vue +1 -1
  37. package/src/demos/DlStepperDemo/steps/DataStep.vue +1 -1
  38. package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +40 -75
  39. package/src/hooks/use-suggestions.ts +8 -3
  40. package/src/utils/parse-smart-query.ts +109 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.16.64",
3
+ "version": "0.17.1",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -22,13 +22,13 @@
22
22
  </div>
23
23
  <div
24
24
  v-if="closable"
25
- class="close-btn"
26
- data-test="close-btn"
25
+ class="close-button"
26
+ data-test="close-button"
27
27
  :style="closeButtonStyle"
28
28
  >
29
29
  <dl-icon
30
- class="close-btn-icon"
31
- data-test="close-btn-icon"
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-btn {
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-btn-icon:hover {
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
- {{ buttonLabel }}
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
- {{ buttonLabel }}
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
- uppercase: Boolean,
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.uppercase
260
- ? 'uppercase'
261
- : 'none',
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',
@@ -368,6 +383,13 @@ export default defineComponent({
368
383
  gap: var(--dl-button-content-gap, 7px);
369
384
  }
370
385
 
386
+ .dl-chip.first-letter-capitalized {
387
+ &::first-letter,
388
+ & > *::first-letter {
389
+ text-transform: capitalize;
390
+ }
391
+ }
392
+
371
393
  .dl-button-container {
372
394
  display: inline-block;
373
395
  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="handleCollapseBtnClick"
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="handleCollapseBtnClick"
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="handleCollapseBtnClick"
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="handleCollapseBtnClick"
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
- handleCollapseBtnClick() {
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
  }
@@ -10,23 +10,23 @@
10
10
  >
11
11
  <dl-button
12
12
  class="dl-button-dropdown--current"
13
- :style="mainBtnStyle"
13
+ :style="mainButtonStyle"
14
14
  :label="label"
15
15
  :outlined="outlined"
16
16
  :size="size"
17
17
  :flat="flat"
18
- :disabled="disabled === true || disableMainBtn === true"
18
+ :disabled="disabled === true || disableMainButton === true"
19
19
  :max-width="maxWidth"
20
20
  :color="color"
21
21
  :icon="icon"
22
- :uppercase="uppercase"
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 && disableMainBtn === true) ||
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="btnCSSStyles"
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 && disableMainBtn === true) ||
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 && disableMainBtn === true) ||
114
+ (split === false && disableMainButton === true) ||
115
115
  disableDropdown === true
116
116
  "
117
- :disabled="disabled === true || disableMainBtn === true"
118
- :style="mainBtnStyle"
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
- mainBtnStyle: { type: [Array, String, Object], default: '' },
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
- disableMainBtn: Boolean,
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
- uppercase: Boolean,
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.disableMainBtn === true) ||
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 btnCSSStyles = computed(() => {
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
- btnCSSStyles,
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-btn-group--${t}`)
35
+ .map((t) => `dl-button-group--${t}`)
36
36
  .join(' ')
37
37
 
38
38
  return (
39
- `dl-btn-group row no-wrap${cls.length > 0 ? ' ' + cls : ''}` +
40
- (this.spread ? ' dl-btn-group--spread' : ' inline')
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-btn-group {
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-btn-group {
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-btn-group:not(:first-child) > .dl-button:first-child:before {
77
+ > .dl-button-group:not(:first-child) > .dl-button:first-child:before {
77
78
  border-left: 0;
78
79
  }
79
- > .dl-btn-group:not(:last-child) > .dl-button:last-child:before {
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-btn-group {
112
+ > .dl-button-group {
112
113
  display: flex !important;
113
114
  }
114
115
  > .dl-button,
115
- > .dl-btn-group > .dl-button:not(.dl-btn-dropdown__arrow-container) {
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="showClearBtn">
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="showShowPassBtn">
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
- disableClearBtn: {
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.disableClearBtn ||
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
- showClearBtn(): boolean {
450
+ showClearButton(): boolean {
451
451
  return (
452
- !this.disableClearBtn &&
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
- showShowPassBtn(): boolean {
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
- query(val) {
148
- this.$nextTick(() => {
149
- this.selectedOption = {
150
- label: val.name,
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>