@dataloop-ai/components 0.20.186-ds-v3.0 → 0.20.186

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 (21) hide show
  1. package/package.json +1 -1
  2. package/src/assets/globals.scss +226 -3
  3. package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +106 -101
  4. package/src/components/compound/DlDateTime/DlDateTimeRange/types.ts +0 -5
  5. package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +27 -24
  6. package/src/components/compound/DlInput/DlInput.vue +0 -4
  7. package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +0 -12
  8. package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +8 -3
  9. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +18 -58
  10. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchJsonEditorDialog.vue +45 -187
  11. package/src/components/compound/DlSelect/DlSelect.vue +3 -15
  12. package/src/components/compound/DlSelect/components/DlSelectOption.vue +6 -7
  13. package/src/components/compound/DlTable/DlTable.vue +15 -12
  14. package/src/components/compound/DlTable/hooks/use-sortable.ts +148 -5
  15. package/src/components/compound/DlTreeTable/DlTreeTable.vue +55 -31
  16. package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +1 -1
  17. package/src/components/essential/DlSwitch/DlSwitch.vue +4 -14
  18. package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +1 -3
  19. package/src/demos/DlDateTimeRangeDemo.vue +0 -20
  20. package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +0 -1
  21. package/src/components/compound/DlDateTime/DlDateTimeRange/DateTimeRangeContent.vue +0 -177
@@ -1,6 +1,12 @@
1
1
  <template>
2
- <div class="dl-smart-search" :style="cssVars">
3
- <div ref="inputWrapper" class="dl-smart-search__input-wrapper">
2
+ <div
3
+ class="dl-smart-search"
4
+ :style="cssVars"
5
+ >
6
+ <div
7
+ ref="inputWrapper"
8
+ class="dl-smart-search__input-wrapper"
9
+ >
4
10
  <dl-smart-search-input
5
11
  ref="smartSearchInput"
6
12
  v-model="queryObject"
@@ -12,7 +18,6 @@
12
18
  :color-schema="colorSchema"
13
19
  :strict="strict"
14
20
  :placeholder="placeholder"
15
- :disabled="disabled"
16
21
  @focus="isFocused = true"
17
22
  @blur="isFocused = false"
18
23
  @search="emitSearchQuery"
@@ -12,7 +12,11 @@
12
12
  :icon="
13
13
  focused ? defaultIcon : statusIcon || defaultIcon
14
14
  "
15
- :color="iconColor"
15
+ :color="
16
+ focused
17
+ ? defaultIconColor
18
+ : statusIconColor || defaultIconColor
19
+ "
16
20
  size="16px"
17
21
  :inline="false"
18
22
  />
@@ -49,7 +53,7 @@
49
53
  </div>
50
54
  </div>
51
55
  <dl-tooltip
52
- v-if="!focused && !noTooltip"
56
+ v-if="!focused"
53
57
  border="1px solid var(--dl-color-separator)"
54
58
  background-color="dl-color-panel-background"
55
59
  color="dl-color-darker"
@@ -244,10 +248,6 @@ export default defineComponent({
244
248
  type: String,
245
249
  default: '28px'
246
250
  },
247
- noTooltip: {
248
- type: Boolean,
249
- default: false
250
- },
251
251
  omitSuggestions: {
252
252
  type: Array as PropType<string[]>,
253
253
  default: () => [] as string[]
@@ -275,7 +275,6 @@ export default defineComponent({
275
275
  'blur',
276
276
  'input',
277
277
  'search',
278
- 'status',
279
278
  'error',
280
279
  'clear'
281
280
  ],
@@ -298,7 +297,6 @@ export default defineComponent({
298
297
  defaultIcon,
299
298
  defaultIconColor,
300
299
  schema,
301
- noTooltip,
302
300
  omitSuggestions,
303
301
  operatorsOverride,
304
302
  height,
@@ -962,16 +960,6 @@ export default defineComponent({
962
960
  }
963
961
  })
964
962
 
965
- const iconColor = computed(() => {
966
- if (disabled.value) {
967
- return 'dl-color-disabled'
968
- }
969
- if (focused.value) {
970
- return defaultIconColor.value
971
- }
972
- return statusIconColor.value || defaultIconColor.value
973
- })
974
-
975
963
  const textareaStyles = computed<Record<string, string | number>>(() => {
976
964
  const overflow: string =
977
965
  scroll.value && focused.value ? 'scroll' : 'hidden'
@@ -1006,14 +994,9 @@ export default defineComponent({
1006
994
  })
1007
995
 
1008
996
  const inputClass = computed<string>(() => {
1009
- let classes = 'dl-smart-search-input__textarea'
1010
- if (focused.value) {
1011
- classes += ' focus'
1012
- }
1013
- if (disabled.value) {
1014
- classes += ' dl-smart-search-input__textarea--disabled'
1015
- }
1016
- return classes
997
+ return `dl-smart-search-input__textarea${
998
+ focused.value ? ' focus' : ''
999
+ }`
1017
1000
  })
1018
1001
 
1019
1002
  const showClearButton = computed(() => {
@@ -1052,31 +1035,24 @@ export default defineComponent({
1052
1035
  return status.value
1053
1036
  }
1054
1037
 
1055
- let newStatus: {
1056
- type: string
1057
- message: string
1058
- }
1059
-
1060
1038
  if (!error.value && searchQuery.value !== '') {
1061
- newStatus = {
1039
+ return {
1062
1040
  type: 'success',
1063
1041
  message: ''
1064
1042
  }
1065
- } else if (error.value === 'warning') {
1066
- newStatus = {
1043
+ }
1044
+
1045
+ if (error.value === 'warning') {
1046
+ return {
1067
1047
  type: 'warning',
1068
1048
  message: 'The query is not supported technically.'
1069
1049
  }
1070
- } else {
1071
- newStatus = {
1072
- type: 'error',
1073
- message: error.value
1074
- }
1075
1050
  }
1076
1051
 
1077
- emit('status', newStatus)
1078
-
1079
- return newStatus
1052
+ return {
1053
+ type: 'error',
1054
+ message: error.value
1055
+ }
1080
1056
  })
1081
1057
 
1082
1058
  const inputPlaceholder = computed<string>(() => {
@@ -1197,7 +1173,6 @@ export default defineComponent({
1197
1173
  debouncedSetInputValue,
1198
1174
  statusIcon,
1199
1175
  statusIconColor,
1200
- iconColor,
1201
1176
  textareaStyles,
1202
1177
  searchBarClasses,
1203
1178
  inputClass,
@@ -1350,21 +1325,6 @@ export default defineComponent({
1350
1325
  }
1351
1326
  }
1352
1327
 
1353
- &__textarea--disabled {
1354
- &::before {
1355
- color: var(--dl-color-disabled);
1356
- }
1357
- }
1358
-
1359
- &__search-bar--disabled {
1360
- .dl-smart-search-input__input,
1361
- .dl-smart-search-input__textarea {
1362
- &::before {
1363
- color: var(--dl-color-disabled);
1364
- }
1365
- }
1366
- }
1367
-
1368
1328
  &__input-wrapper,
1369
1329
  &__textarea-wrapper {
1370
1330
  min-height: 28px;
@@ -4,116 +4,48 @@
4
4
  v-model="isOpen"
5
5
  :height="500"
6
6
  :width="800"
7
- style="--dl-dialog-box-footer-padding: 10px 16px; --dl-dialog-box-content-padding: 0"
7
+ style="--dl-dialog-box-footer-padding: 10px 16px"
8
8
  >
9
9
  <template #header>
10
10
  <dl-dialog-box-header
11
- title="DQL Editor"
11
+ title="DQL Search"
12
12
  :close-button="true"
13
13
  @onClose="isOpen = false"
14
14
  />
15
15
  </template>
16
16
  <template #body>
17
17
  <div class="json-editor-layout">
18
- <div class="json-query-menu">
18
+ <div
19
+ class="json-query-menu"
20
+ style="margin-bottom: 10px"
21
+ >
19
22
  <dl-select
20
23
  :model-value="selectedOption"
21
- ref="jsonQueryMenu"
22
24
  width="300px"
23
25
  :options="selectOptions"
24
26
  placeholder="New Query"
25
- searchable
26
- size="m"
27
- after-options-padding="0"
28
- no-options-padding="0"
29
- menu-style="overflow-y: hidden;"
30
27
  @update:model-value="onQuerySelect"
31
28
  >
32
29
  <template #selected="scope">
33
- <span class="json-query-menu-selected">
30
+ <span class="json-query-menu-option">
34
31
  {{ scope.opt ? scope.opt.label : '' }}
35
32
  </span>
36
33
  </template>
37
34
  <template #option="scope">
38
- <div
39
- v-if="selectOptions.length < 2"
40
- class="json-query-menu-no-option"
41
- disabled
42
- style="cursor: default !important; padding: 14px 0 10px 0;"
43
- >
44
- No Saved Queries
45
- </div>
46
- <div v-else class="json-query-menu-option">
47
- <div class="json-query-menu-option-label">
48
- {{ scope.opt.label }}
49
- </div>
50
- <dl-icon
51
- v-if="scope.opt.label !== 'New Query'"
52
- icon="icon-dl-delete"
53
- color="dl-color-negative"
54
- class="json-query-menu-option-delete"
55
- @click.stop="onDelete(scope.opt)"
56
- >
57
- <dl-tooltip>Delete</dl-tooltip>
58
- </dl-icon>
59
- </div>
60
- </template>
61
- <template #after-options>
62
- <dl-separator
63
- style="margin: 0 0 2px 0 !important"
64
- type="horizontal"
65
- />
66
- <dl-button
67
- icon="icon-dl-save"
68
- flat
69
- fluid
70
- secondary
71
- size="s"
72
- label="Save Query"
73
- class="json-query-menu-save-button"
74
- @click="onSave"
75
- />
76
- </template>
77
- <template #no-options>
78
- <div class="json-query-menu-no-option">
79
- No Results Found
80
- </div>
81
- <dl-separator
82
- style="margin: 0 0 2px 0 !important"
83
- type="horizontal"
84
- />
85
- <dl-button
86
- icon="icon-dl-save"
87
- flat
88
- fluid
89
- secondary
90
- size="s"
91
- label="Save Query"
92
- class="json-query-menu-save-button"
93
- @click="onSave"
94
- />
35
+ <span class="json-query-menu-option">
36
+ {{ scope.opt.label }}
37
+ </span>
95
38
  </template>
96
39
  </dl-select>
97
- <div>
98
- <dl-button
99
- icon="icon-dl-align-left"
100
- tooltip="Align Left"
101
- flat
102
- color="secondary"
103
- padding="0px 3px"
104
- :disabled="alignDisabled"
105
- @click="alignJSON"
106
- />
107
- <dl-button
108
- icon="icon-dl-copy"
109
- tooltip="Copy"
110
- flat
111
- color="secondary"
112
- padding="0px 3px"
113
- :disabled="alignDisabled"
114
- @click="copyJSON"
115
- />
116
- </div>
40
+ <dl-button
41
+ icon="icon-dl-align-left"
42
+ label="Align Left"
43
+ flat
44
+ color="secondary"
45
+ padding="0px 3px"
46
+ :disabled="alignDisabled"
47
+ @click="alignJSON"
48
+ />
117
49
  </div>
118
50
  <dl-json-editor
119
51
  ref="jsonEditor"
@@ -133,7 +65,7 @@
133
65
  flat
134
66
  color="secondary"
135
67
  padding="0"
136
- @click="optionToDelete = selectedOption"
68
+ @click="showDeleteDialog = true"
137
69
  />
138
70
  <div class="json-editor-footer-actions">
139
71
  <dl-button
@@ -169,20 +101,27 @@
169
101
  <template #body>
170
102
  <dl-input
171
103
  v-model="newQueryName"
172
- :red-asterisk="true"
173
- :required="true"
174
- title="Query Name"
175
- placeholder="Insert query name"
104
+ title="Query name"
105
+ style="text-align: center"
106
+ placeholder="Type query name"
176
107
  />
177
108
  </template>
178
109
  <template #footer>
179
110
  <div class="dl-smart-search__buttons--save">
180
111
  <dl-button
181
112
  :disabled="!newQueryName"
113
+ outlined
114
+ style="margin-right: 5px"
182
115
  @click="() => saveQuery(false)"
183
116
  >
184
117
  Save
185
118
  </dl-button>
119
+ <dl-button
120
+ :disabled="!newQueryName"
121
+ @click="() => saveQuery(true)"
122
+ >
123
+ Save and Search
124
+ </dl-button>
186
125
  </div>
187
126
  </template>
188
127
  </dl-dialog-box>
@@ -196,13 +135,12 @@
196
135
  />
197
136
  </template>
198
137
  <template #body>
199
- <dl-typography size="h5">
200
- Are you sure you want to permanently delete the following query?
201
- <br />
202
- {{ optionToDelete.label }}
203
- <br />
204
- <br />
205
- This action cannot be undone.
138
+ <dl-typography
139
+ size="h3"
140
+ style="display: flex; justify-content: center"
141
+ >
142
+ Are you sure you want to delete
143
+ {{ selectedOption.label }}?
206
144
  </dl-typography>
207
145
  </template>
208
146
  <template #footer>
@@ -228,12 +166,10 @@ import {
228
166
  } from 'vue-demi'
229
167
  import { DlSelect } from '../../../DlSelect'
230
168
  import { DlSelectOption } from '../../../DlSelect/types'
231
- import { DlSeparator } from '../../../../essential/DlSeparator'
232
169
  import { DlButton } from '../../../../basic'
233
170
  import { DlDialogBox, DlDialogBoxHeader } from '../../../DlDialogBox'
234
171
  import { DlJsonEditor } from '../../../DlJsonEditor'
235
- import { DlTooltip } from '../../../../shared/DlTooltip'
236
- import { DlTypography, DlIcon } from '../../../../essential'
172
+ import { DlTypography } from '../../../../essential'
237
173
  import { DlInput } from '../../../DlInput'
238
174
  import { stateManager } from '../../../../../StateManager'
239
175
  import { cloneDeep, isEqual, uniqBy } from 'lodash'
@@ -243,12 +179,9 @@ export default defineComponent({
243
179
  components: {
244
180
  DlDialogBox,
245
181
  DlDialogBoxHeader,
246
- DlIcon,
247
182
  DlJsonEditor,
248
183
  DlButton,
249
184
  DlSelect,
250
- DlSeparator,
251
- DlTooltip,
252
185
  DlTypography,
253
186
  DlInput
254
187
  },
@@ -281,24 +214,11 @@ export default defineComponent({
281
214
  'update:modelValue',
282
215
  'search',
283
216
  'change',
284
- 'copied',
285
217
  'update:options',
286
218
  'save',
287
219
  'delete',
288
220
  'select'
289
221
  ],
290
- methods: {
291
- onDelete(option: DlSelectOption) {
292
- const select = this.$refs['jsonQueryMenu'] as InstanceType<typeof DlSelect>
293
- select?.closeMenu()
294
- this.optionToDelete = option
295
- },
296
- onSave() {
297
- const select = this.$refs['jsonQueryMenu'] as InstanceType<typeof DlSelect>
298
- select?.closeMenu()
299
- this.showSaveDialog = true
300
- }
301
- },
302
222
  setup(props, { emit }) {
303
223
  const { modelValue, options, json, selectedFilter } = toRefs(props)
304
224
 
@@ -310,15 +230,7 @@ export default defineComponent({
310
230
  const currentQuery = ref<{ [key: string]: any }>(cloneDeep(json.value))
311
231
  const jsonEditor = ref<any>(null)
312
232
  const showSaveDialog = ref(false)
313
- const optionToDelete = ref<DlSelectOption>(null)
314
- const showDeleteDialog = computed<boolean>({
315
- get: () => !!optionToDelete.value,
316
- set: (val) => {
317
- if (!val) {
318
- optionToDelete.value = null
319
- }
320
- }
321
- })
233
+ const showDeleteDialog = ref(false)
322
234
  const newQueryName = ref('')
323
235
  const alignDisabled = ref(false)
324
236
 
@@ -361,11 +273,6 @@ export default defineComponent({
361
273
  jsonEditor.value?.format()
362
274
  }
363
275
 
364
- const copyJSON = async () => {
365
- await navigator.clipboard.writeText(stringifiedJSON.value)
366
- emit('copied')
367
- }
368
-
369
276
  const onQuerySelect = (option: DlSelectOption) => {
370
277
  if (option.label === selectedOption.value.label) {
371
278
  return
@@ -449,10 +356,10 @@ export default defineComponent({
449
356
 
450
357
  const deleteQuery = () => {
451
358
  const toDelete = options.value.find(
452
- (o: DlSelectOption) => o.label === optionToDelete.value.label
359
+ (o: DlSelectOption) => o.label === selectedOption.value.label
453
360
  )
454
361
  const newOptions = options.value.filter(
455
- (o: DlSelectOption) => o.label !== optionToDelete.value.label
362
+ (o: DlSelectOption) => o.label !== selectedOption.value.label
456
363
  )
457
364
 
458
365
  emit('delete', toDelete)
@@ -485,11 +392,9 @@ export default defineComponent({
485
392
  selectedOption,
486
393
  hasActiveFilter,
487
394
  alignJSON,
488
- copyJSON,
489
395
  onQuerySelect,
490
396
  newQueryName,
491
397
  alignDisabled,
492
- optionToDelete,
493
398
  showDeleteDialog,
494
399
  selectOptions,
495
400
  search,
@@ -502,76 +407,29 @@ export default defineComponent({
502
407
  })
503
408
  </script>
504
409
 
505
- <style scoped>
410
+ <style scoped lang="scss">
506
411
  .json-editor-layout {
507
412
  display: flex;
508
413
  flex-direction: column;
509
414
  height: 100%;
510
415
  }
511
416
 
512
- .json-editor-footer {
513
- width: 100%;
514
- display: flex;
515
- align-items: center;
516
- justify-content: space-between;
517
- }
417
+ .json-editor-footer,
518
418
  .json-query-menu {
419
+ width: 100%;
519
420
  display: flex;
520
421
  align-items: center;
521
- background-color: var(--dl-color-fill);
522
422
  justify-content: space-between;
523
- padding: 6px 16px;
524
423
  }
525
424
  .json-editor {
526
- height: calc(100% - 40px);
527
- --jse-main-border: none;
425
+ height: 100%;
528
426
  }
529
427
 
530
428
  .json-query-menu-option {
531
- display: flex;
532
- flex-direction: row;
533
- }
534
- .json-query-menu-option-label,
535
- .json-query-menu-selected {
536
- padding-top: 3px;
537
429
  white-space: nowrap;
538
430
  display: inline-block;
539
431
  width: 265px;
540
432
  overflow: hidden;
541
433
  text-overflow: ellipsis;
542
434
  }
543
- .json-query-menu-option:hover .json-query-menu-option-label {
544
- margin-right: 6px;
545
- width: 255px;
546
- }
547
- .json-query-menu-option-delete {
548
- overflow-x: hidden;
549
- width: 0;
550
- }
551
- .json-query-menu-option:hover .json-query-menu-option-delete {
552
- border-radius: 4px;
553
- overflow-x: visible;
554
- padding: 4px;
555
- width: auto;
556
- }
557
- .json-query-menu-option-delete:hover {
558
- background-color: var(--dl-color-fill-secondary);
559
- }
560
- .json-query-menu-option-delete:active {
561
- background-color: var(--dl-color-negative-background);
562
- }
563
- .json-query-menu-no-option {
564
- display: flex;
565
- padding: 20px 0;
566
- flex-direction: column;
567
- align-items: center;
568
- align-self: stretch;
569
- }
570
- .json-query-menu-save-button:hover {
571
- background-color: var(--dl-color-fill-secondary);
572
- }
573
- .dl-smart-search__buttons--save {
574
- text-align: right;
575
- width: 100%;
576
- }
577
435
  </style>
@@ -170,17 +170,13 @@
170
170
  <slot name="before-options" />
171
171
  </dl-item-section>
172
172
  </dl-list-item>
173
- <dl-list-item
174
- v-if="noOptions"
175
- :style="computedNoOptionsStyle"
176
- :padding="noOptionsPadding"
177
- >
173
+ <dl-list-item v-if="noOptions" :style="computedNoOptionsStyle">
178
174
  <dl-item-section color="dl-color-medium">
179
175
  <slot name="no-options"> No options </slot>
180
176
  </dl-item-section>
181
177
  </dl-list-item>
182
178
  <dl-list
183
- v-else-if="showMenuList"
179
+ v-if="showMenuList"
184
180
  class="select-list"
185
181
  :padding="false"
186
182
  :style="
@@ -519,10 +515,6 @@ export default defineComponent({
519
515
  type: String,
520
516
  default: null
521
517
  },
522
- noOptionsPadding: {
523
- type: String,
524
- default: null
525
- },
526
518
  keepFocusOnBlur: {
527
519
  type: Boolean,
528
520
  default: false
@@ -1056,11 +1048,7 @@ export default defineComponent({
1056
1048
  return !!option?.readonly
1057
1049
  },
1058
1050
  isDisableRowOption(option: DlSelectOptionType) {
1059
- return (
1060
- typeof option === 'object' &&
1061
- option !== null &&
1062
- !!option.disableRow
1063
- )
1051
+ return typeof option === 'object' && option !== null && !!option.disableRow
1064
1052
  },
1065
1053
  getOptionCount(option: any) {
1066
1054
  return option?.count ?? null
@@ -17,7 +17,7 @@
17
17
  <dl-list-item
18
18
  v-else
19
19
  class="option"
20
- :class="{
20
+ :class="{
21
21
  highlighted: highlightSelected && isSelected,
22
22
  'disabled-row': disableRow
23
23
  }"
@@ -142,7 +142,10 @@ import { v4 } from 'uuid'
142
142
  import { debounce } from 'lodash'
143
143
  import { stateManager } from '../../../../StateManager'
144
144
  import { getCaseInsensitiveInput, getLabel } from '../utils'
145
- import { DlSelectOption, DlSelectOptionType } from '../../types'
145
+ import {
146
+ DlSelectOption,
147
+ DlSelectOptionType
148
+ } from '../../types'
146
149
 
147
150
  const ValueTypes = [Array, Boolean, String, Number, Object, Function]
148
151
 
@@ -403,11 +406,7 @@ export default defineComponent({
403
406
  return !!option?.readonly
404
407
  },
405
408
  isDisableRowOption(option: DlSelectOptionType) {
406
- return (
407
- typeof option === 'object' &&
408
- option !== null &&
409
- !!option.disableRow
410
- )
409
+ return typeof option === 'object' && option !== null && !!option.disableRow
411
410
  }
412
411
  }
413
412
  })