@dataloop-ai/components 0.20.197 → 0.20.199

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 (27) hide show
  1. package/package.json +1 -1
  2. package/src/components/basic/DlButton/DlButton.vue +9 -8
  3. package/src/components/basic/DlListItem/utils.ts +1 -1
  4. package/src/components/compound/DlDateTime/DlDateTimeRange/DateTimeRangeContent.vue +177 -0
  5. package/src/components/compound/DlDateTime/DlDateTimeRange/DlDateTimeRange.vue +101 -106
  6. package/src/components/compound/DlDateTime/DlDateTimeRange/types.ts +5 -0
  7. package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +24 -27
  8. package/src/components/compound/DlInput/DlInput.vue +21 -5
  9. package/src/components/compound/DlSearches/DlSearch/DlSearch.vue +12 -0
  10. package/src/components/compound/DlSearches/DlSmartSearch/DlSmartSearch.vue +3 -8
  11. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchInput.vue +71 -19
  12. package/src/components/compound/DlSearches/DlSmartSearch/components/DlSmartSearchJsonEditorDialog.vue +187 -45
  13. package/src/components/compound/DlSelect/DlSelect.vue +15 -7
  14. package/src/components/compound/DlSelect/components/DlSelectOption.vue +9 -8
  15. package/src/components/compound/DlTable/DlTable.vue +2 -2
  16. package/src/components/compound/DlTreeTable/DlTreeTable.vue +16 -16
  17. package/src/components/compound/DlTreeTable/views/DlTrTreeView.vue +1 -1
  18. package/src/components/essential/DlCheckbox/DlCheckbox.vue +4 -4
  19. package/src/components/essential/DlLink/DlLink.vue +6 -2
  20. package/src/components/essential/DlList/DlList.vue +4 -8
  21. package/src/components/essential/DlProgressBar/DlProgressBar.vue +1 -1
  22. package/src/components/essential/DlSwitch/DlSwitch.vue +14 -4
  23. package/src/components/essential/DlTrend/DlTrend.vue +22 -7
  24. package/src/components/shared/DlVirtualScroll/DlVirtualScroll.vue +3 -1
  25. package/src/demos/DlDateTimeRangeDemo.vue +20 -0
  26. package/src/demos/SmartSearchDemo/DlSmartSearchDemo.vue +1 -0
  27. package/src/utils/getColor.ts +2 -2
@@ -63,7 +63,7 @@
63
63
  v-if="searchable"
64
64
  icon="icon-dl-search"
65
65
  :size="iconSize"
66
- color="dl-color-lighter"
66
+ color="dell-gray-500"
67
67
  />
68
68
  </slot>
69
69
  </div>
@@ -166,17 +166,21 @@
166
166
  @selected-item="handleSelectedItem"
167
167
  >
168
168
  <dl-list-item v-if="hasBeforeOptions && !noOptions">
169
- <dl-item-section color="dl-color-medium">
169
+ <dl-item-section color="dell-gray-600">
170
170
  <slot name="before-options" />
171
171
  </dl-item-section>
172
172
  </dl-list-item>
173
- <dl-list-item v-if="noOptions" :style="computedNoOptionsStyle">
174
- <dl-item-section color="dl-color-medium">
173
+ <dl-list-item
174
+ v-if="noOptions"
175
+ :style="computedNoOptionsStyle"
176
+ :padding="noOptionsPadding"
177
+ >
178
+ <dl-item-section color="dell-gray-600">
175
179
  <slot name="no-options"> No options </slot>
176
180
  </dl-item-section>
177
181
  </dl-list-item>
178
182
  <dl-list
179
- v-if="showMenuList"
183
+ v-else-if="showMenuList"
180
184
  class="select-list"
181
185
  :padding="false"
182
186
  :style="
@@ -351,7 +355,7 @@
351
355
  v-if="error && !!errorMessage.length"
352
356
  :icon="errorIcon"
353
357
  :inline="false"
354
- color="dl-color-negative"
358
+ color="dell-red-500"
355
359
  :size="iconSize"
356
360
  >
357
361
  <dl-tooltip>
@@ -515,6 +519,10 @@ export default defineComponent({
515
519
  type: String,
516
520
  default: null
517
521
  },
522
+ noOptionsPadding: {
523
+ type: String,
524
+ default: null
525
+ },
518
526
  keepFocusOnBlur: {
519
527
  type: Boolean,
520
528
  default: false
@@ -808,7 +816,7 @@ export default defineComponent({
808
816
  '--placeholder-color': getColor(
809
817
  this.modelValueLength > 0 || this.selectedIndex !== -1
810
818
  ? 'dell-gray-800'
811
- : 'dl-color-lighter'
819
+ : 'dell-gray-500'
812
820
  )
813
821
  }
814
822
  },
@@ -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,10 +142,7 @@ 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 {
146
- DlSelectOption,
147
- DlSelectOptionType
148
- } from '../../types'
145
+ import { DlSelectOption, DlSelectOptionType } from '../../types'
149
146
 
150
147
  const ValueTypes = [Array, Boolean, String, Number, Object, Function]
151
148
 
@@ -225,7 +222,7 @@ export default defineComponent({
225
222
  return `dl-select-option-${this.value}`.replaceAll(' ', '-')
226
223
  },
227
224
  color(): string | null {
228
- return this.defaultStyles ? 'dl-color-darker' : null
225
+ return this.defaultStyles ? 'dell-gray-800' : null
229
226
  },
230
227
  isSelected(): boolean {
231
228
  return (
@@ -271,7 +268,7 @@ export default defineComponent({
271
268
 
272
269
  highlightedHtml = label.replace(
273
270
  toReplace,
274
- `<span style="background: var(--dl-color-warning)">${getCaseInsensitiveInput(
271
+ `<span style="background: var(--dell-yellow-500)">${getCaseInsensitiveInput(
275
272
  label,
276
273
  this.filterTerm
277
274
  )}</span>`
@@ -406,7 +403,11 @@ export default defineComponent({
406
403
  return !!option?.readonly
407
404
  },
408
405
  isDisableRowOption(option: DlSelectOptionType) {
409
- return typeof option === 'object' && option !== null && !!option.disableRow
406
+ return (
407
+ typeof option === 'object' &&
408
+ option !== null &&
409
+ !!option.disableRow
410
+ )
410
411
  }
411
412
  }
412
413
  })
@@ -167,7 +167,7 @@
167
167
  style="width: 100%; display: flex"
168
168
  >
169
169
  <dl-button
170
- :text-color="
170
+ :icon-color="
171
171
  isVisibleColumnsOpen
172
172
  ? 'dell-blue-600'
173
173
  : 'dell-gray-600'
@@ -571,7 +571,7 @@
571
571
  style="width: 100%; display: flex"
572
572
  >
573
573
  <dl-button
574
- :text-color="
574
+ :icon-color="
575
575
  isVisibleColumnsOpen
576
576
  ? 'dl-color-secondary'
577
577
  : 'dl-color-medium'
@@ -266,11 +266,11 @@ export default defineComponent({
266
266
  emptyStateProps: {
267
267
  type: Object as PropType<DlEmptyStateProps>,
268
268
  default: () =>
269
- ({
270
- title: '',
271
- subtitle: 'No data to show yet',
272
- icon: 'icon-dl-dataset-filled'
273
- } as unknown as PropType<DlEmptyStateProps>)
269
+ ({
270
+ title: '',
271
+ subtitle: 'No data to show yet',
272
+ icon: 'icon-dl-dataset-filled'
273
+ } as unknown as PropType<DlEmptyStateProps>)
274
274
  },
275
275
  /**
276
276
  * Custom icon class to use for expanded rows.
@@ -392,7 +392,7 @@ export default defineComponent({
392
392
  typeof props.rowKey === 'function'
393
393
  ? props.rowKey
394
394
  : (row: Record<string, any>) =>
395
- row[props.rowKey as string] ?? ''
395
+ row[props.rowKey as string] ?? ''
396
396
  )
397
397
 
398
398
  const hasDraggableRows = computed(() =>
@@ -537,7 +537,7 @@ export default defineComponent({
537
537
  const onMultipleSelectionSet = (val: boolean) => {
538
538
  const value =
539
539
  selectedData.value.length > 0 &&
540
- selectedData.value.length === tableRows.value.length
540
+ selectedData.value.length === tableRows.value.length
541
541
  ? false
542
542
  : val
543
543
 
@@ -811,7 +811,9 @@ export default defineComponent({
811
811
  targetRow: finalTarget
812
812
  })
813
813
 
814
- const isDragValid = shouldSkipValidation || checkParentCondition(draggedRow.value, finalTarget)
814
+ const isDragValid =
815
+ shouldSkipValidation ||
816
+ checkParentCondition(draggedRow.value, finalTarget)
815
817
  if (isDragValid) {
816
818
  const smartSortingMovement = {
817
819
  ...sortingMovement.value,
@@ -835,10 +837,9 @@ export default defineComponent({
835
837
  return
836
838
  }
837
839
 
838
- const srcEl =
839
- (originalEvent.srcElement ||
840
- originalEvent.target ||
841
- null) as HTMLElement | null
840
+ const srcEl = (originalEvent.srcElement ||
841
+ originalEvent.target ||
842
+ null) as HTMLElement | null
842
843
  const passedElement = srcEl ? getElementAbove(srcEl, 'dl-tr') : null
843
844
  if (passedElement) {
844
845
  const targetRowId = passedElement.dataset.id
@@ -1243,7 +1244,7 @@ export default defineComponent({
1243
1244
  this.vue2h = vue2h
1244
1245
  const tableBodySlot = isVue2
1245
1246
  ? this.$slots['table-body'] &&
1246
- (() => (this.$slots['table-body'] as any)?.pop())
1247
+ (() => (this.$slots['table-body'] as any)?.pop())
1247
1248
  : this.$slots['table-body']
1248
1249
  const tbody =
1249
1250
  tableBodySlot ?? (this.isDataEmpty ? null : this.renderTBody)
@@ -1307,7 +1308,7 @@ export default defineComponent({
1307
1308
  justify-content: center;
1308
1309
  flex-wrap: wrap;
1309
1310
 
1310
- &>* {
1311
+ & > * {
1311
1312
  flex-grow: 1;
1312
1313
  }
1313
1314
  }
@@ -1336,7 +1337,6 @@ tr {
1336
1337
  }
1337
1338
 
1338
1339
  .sticky-header {
1339
-
1340
1340
  ::v-deep .dl-table__top,
1341
1341
  ::v-deep .dl-table__bottom,
1342
1342
  ::v-deep thead tr:first-child th {
@@ -1359,4 +1359,4 @@ tr {
1359
1359
  top: 40px;
1360
1360
  }
1361
1361
  }
1362
- </style>
1362
+ </style>
@@ -16,7 +16,7 @@
16
16
  }`"
17
17
  >
18
18
  <dl-icon
19
- v-if="hasDraggableRows && !row.disableDraggable"
19
+ v-if="hasDraggableRows && !row.disableDraggable"
20
20
  class="draggable-icon"
21
21
  icon="icon-dl-drag"
22
22
  size="12px"
@@ -234,10 +234,10 @@ export default defineComponent({
234
234
  }
235
235
  .container.disabled {
236
236
  cursor: not-allowed;
237
- color: var(--dl-color-disabled);
237
+ color: var(--dell-gray-500);
238
238
  & * {
239
239
  pointer-events: auto;
240
- color: var(--dl-color-disabled);
240
+ color: var(--dell-gray-500);
241
241
  }
242
242
  }
243
243
  .checkbox-wrapper {
@@ -245,7 +245,7 @@ export default defineComponent({
245
245
  position: relative;
246
246
  width: 12px;
247
247
  height: 12px;
248
- border: 1px solid var(--dl-color-separator);
248
+ border: 1px solid var(--dell-gray-300);
249
249
  border-radius: 2px;
250
250
  & svg {
251
251
  transition: fill 100ms cubic-bezier(0, 0, 0.2, 1) 0ms;
@@ -278,7 +278,7 @@ input {
278
278
 
279
279
  .checkbox-label {
280
280
  font-size: var(--dl-font-size-body);
281
- color: var(--dl-color-darker);
281
+ color: var(--dell-gray-800);
282
282
  overflow-wrap: break-word;
283
283
  width: 100%;
284
284
  }
@@ -43,8 +43,12 @@ export default defineComponent({
43
43
  : `${window.origin}/${this.href}`
44
44
  },
45
45
  linkStyles(): Record<string, string> {
46
- const textColor = this.color ?? 'dl-color-studio-secondary'
47
- const hoverTextColor = this.hoverColor ?? textColor
46
+ const textColor = this.color ?? 'dell-blue-600'
47
+ const hoverTextColor = this.hoverColor
48
+ ? this.hoverColor
49
+ : this.color
50
+ ? this.color
51
+ : 'dell-blue-700'
48
52
  return {
49
53
  '--link-color': `var(--${textColor})`,
50
54
  '--link-hover-color': `var(--${hoverTextColor})`
@@ -1,9 +1,5 @@
1
1
  <template>
2
- <component
3
- :is="type"
4
- :id="uuid"
5
- :class="classes"
6
- >
2
+ <component :is="type" :id="uuid" :class="classes">
7
3
  <slot :clickable="clickable" />
8
4
  </component>
9
5
  </template>
@@ -44,12 +40,12 @@ export default defineComponent({
44
40
  <style scoped lang="scss">
45
41
  .dl-list {
46
42
  padding: 6px 0;
47
- background-color: var(--dl-color-panel-background);
43
+ background-color: var(--dell-white);
48
44
  &--bordered {
49
- border: 1px solid var(--dl-color-separator);
45
+ border: 1px solid var(--dell-gray-300);
50
46
  }
51
47
  &--separator {
52
- border-top: 1px solid var(--dl-color-separator);
48
+ border-top: 1px solid var(--dell-gray-300);
53
49
  & > .dl-list-item {
54
50
  padding: 5px 10px;
55
51
  }
@@ -51,7 +51,7 @@ export default defineComponent({
51
51
  props: {
52
52
  color: {
53
53
  type: String,
54
- default: 'dl-color-secondary'
54
+ default: 'dell-blue-500'
55
55
  },
56
56
  label: {
57
57
  type: String,
@@ -7,12 +7,14 @@
7
7
  }`"
8
8
  >
9
9
  <label
10
- v-if="!!leftLabel"
10
+ v-if="hasLeftLabel"
11
11
  class="left dl-switch-label"
12
12
  :for="computedId"
13
13
  :style="cssLabelVars"
14
14
  >
15
- {{ leftLabel }}
15
+ <slot name="left-label">
16
+ {{ leftLabel }}
17
+ </slot>
16
18
  </label>
17
19
  <span
18
20
  class="dl-switch-container"
@@ -35,12 +37,14 @@
35
37
  />
36
38
  </span>
37
39
  <label
38
- v-if="!!rightLabel"
40
+ v-if="hasRightLabel"
39
41
  class="right dl-switch-label"
40
42
  :for="computedId"
41
43
  :style="cssLabelVars"
42
44
  >
43
- {{ rightLabel }}
45
+ <slot name="right-label">
46
+ {{ rightLabel }}
47
+ </slot>
44
48
  </label>
45
49
  </div>
46
50
  </template>
@@ -143,6 +147,12 @@ export default defineComponent({
143
147
  ? this.index === -1
144
148
  : toRaw(this.modelValue) === toRaw(this.falseValue)
145
149
  },
150
+ hasLeftLabel(): boolean {
151
+ return !!this.leftLabel || !!this.$slots['left-label']
152
+ },
153
+ hasRightLabel(): boolean {
154
+ return !!this.rightLabel || !!this.$slots['right-label']
155
+ },
146
156
  cssVars(): Record<string, string> {
147
157
  return {
148
158
  '--dl-checkbox-height': `${this.size}px`,
@@ -1,8 +1,5 @@
1
1
  <template>
2
- <div
3
- :id="uuid"
4
- class="trend-wrapper"
5
- >
2
+ <div :id="uuid" class="trend-wrapper">
6
3
  <span
7
4
  v-if="withArrow"
8
5
  class="direction-arrow"
@@ -25,6 +22,24 @@ import { getColor } from '../../../utils'
25
22
  const colorValidator = (val: string | null) =>
26
23
  val === 'negative' || val === 'positive' || val === null
27
24
 
25
+ const getColorByName = (name: string) => {
26
+ if (name === 'negative') {
27
+ return 'dell-red-500'
28
+ } else if (name === 'positive') {
29
+ return 'dell-green-500'
30
+ } else {
31
+ return 'dell-gray-800'
32
+ }
33
+ }
34
+
35
+ const getColorByDirection = (direction: string) => {
36
+ if (direction === 'up') {
37
+ return 'dell-green-500'
38
+ } else {
39
+ return 'dell-red-500'
40
+ }
41
+ }
42
+
28
43
  export default defineComponent({
29
44
  name: 'DlTrend',
30
45
  props: {
@@ -63,9 +78,9 @@ export default defineComponent({
63
78
  },
64
79
  computedColor(): string {
65
80
  if (this.color !== null || !colorValidator(this.color)) {
66
- return getColor(`dl-color-${this.color}`)
81
+ return getColor(getColorByName(this.color))
67
82
  }
68
- return getColor(`dl-color-${this.isUp ? 'positive' : 'negative'}`)
83
+ return getColor(getColorByDirection(this.direction))
69
84
  },
70
85
  withArrow(): boolean {
71
86
  return !(this.value === 0 || this.value === '0')
@@ -83,7 +98,7 @@ export default defineComponent({
83
98
  font-size: var(--dl-font-size-body);
84
99
  line-height: 1;
85
100
  padding: 2px 0;
86
- color: var(--dl-color-darker);
101
+ color: var(--dell-gray-800);
87
102
  }
88
103
  .direction-arrow {
89
104
  width: 8px;
@@ -124,7 +124,9 @@ export default defineComponent({
124
124
 
125
125
  let localScrollTarget: HTMLElement | undefined
126
126
  const rootRef: Ref<HTMLElement | null> = ref(null)
127
- const scrollSizeItem: Ref<number> = ref(40)
127
+ const scrollSizeItem: Ref<number> = ref(
128
+ virtualScrollItemSize.value || 40
129
+ )
128
130
 
129
131
  const isDefined = (v: any) => v !== undefined && v !== null
130
132
 
@@ -176,6 +176,26 @@
176
176
  @change="handleModelValueUpdate"
177
177
  />
178
178
  </div>
179
+ <div style="width: 500px; margin-top: 30px">
180
+ <div style="margin-bottom: 10px; font-weight: bold">
181
+ Inline Mode
182
+ </div>
183
+ <dl-date-time-range
184
+ v-model="date"
185
+ :type="type"
186
+ width="100%"
187
+ :available-range="range ? availableRange : null"
188
+ :mode="mode"
189
+ :show-time="showTime"
190
+ :auto-close="autoClose"
191
+ :including-current-month="includesCurrentMonthEnd"
192
+ :should-clear-select-first-option="shouldClearSelectFirstOption"
193
+ :disabled-type="type === 'day' ? 'month' : 'day'"
194
+ view-mode="inline"
195
+ @set-type="handleSetType"
196
+ @change="handleModelValueUpdate"
197
+ />
198
+ </div>
179
199
  </div>
180
200
  </template>
181
201
  <script lang="ts">
@@ -42,6 +42,7 @@
42
42
 
43
43
  <dl-smart-search-input
44
44
  v-model="queryObject"
45
+ no-tooltip
45
46
  :aliases="aliases"
46
47
  :schema="schema"
47
48
  :color-schema="colorSchema"
@@ -9,10 +9,10 @@ const getColor = (color: string, fallback?: string) => {
9
9
  return color
10
10
  }
11
11
 
12
- if (!color) return `var(--${fallback || 'dl-color-darker'})`
12
+ if (!color) return `var(--${fallback || 'dell-gray-800'})`
13
13
  if (color.includes('var(--')) return color
14
14
 
15
- return `var(--${color}, var(--${fallback || 'dl-color-darker'}))`
15
+ return `var(--${color}, var(--${fallback || 'dell-gray-800'}))`
16
16
  }
17
17
 
18
18
  export { getColor }