@dataloop-ai/components 0.20.172 → 0.20.174

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.172",
3
+ "version": "0.20.174",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -33,7 +33,7 @@
33
33
  data-test="close-button-icon"
34
34
  icon="icon-dl-close"
35
35
  color="dl-color-darker"
36
- size="12px"
36
+ size="16px"
37
37
  @click="handleClose"
38
38
  />
39
39
  </div>
@@ -2,6 +2,7 @@ import { getColor } from '../../../utils'
2
2
  import { getLighterGradient } from '../../../utils/getLighterGradient'
3
3
 
4
4
  export enum ButtonSizes {
5
+ xs = 'xs',
5
6
  s = 's',
6
7
  m = 'm',
7
8
  l = 'l',
@@ -23,6 +24,7 @@ const iconPaddings: { [key: string]: string } = {
23
24
  }
24
25
 
25
26
  const iconSizes: { [key: string]: string } = {
27
+ xs: '7px',
26
28
  s: '12px',
27
29
  m: '16px',
28
30
  l: '18px',
@@ -37,7 +37,7 @@
37
37
  >
38
38
  <dl-icon
39
39
  class="dl-chip-remove-icon"
40
- size="7px"
40
+ size="12px"
41
41
  icon="icon-dl-close"
42
42
  /></span>
43
43
  </div>
@@ -1,16 +1,7 @@
1
1
  <template>
2
- <div
3
- class="popup-header"
4
- :style="cssVars"
5
- >
6
- <slot
7
- v-if="hasHeaderSlot"
8
- name="header"
9
- />
10
- <div
11
- v-else
12
- class="header-content"
13
- >
2
+ <div class="popup-header" :style="cssVars">
3
+ <slot v-if="hasHeaderSlot" name="header" />
4
+ <div v-else class="header-content">
14
5
  <span class="title">
15
6
  <dl-ellipsis :text="title" />
16
7
  <span class="info-icon">
@@ -30,15 +21,12 @@
30
21
  class="close-button"
31
22
  @click="handleClick"
32
23
  >
33
- <slot
34
- v-if="hasCloseButtonSlot"
35
- name="close-button"
36
- />
24
+ <slot v-if="hasCloseButtonSlot" name="close-button" />
37
25
  <dl-icon
38
26
  v-else
39
27
  color="dl-color-darker"
40
28
  icon="icon-dl-close"
41
- size="12px"
29
+ size="16px"
42
30
  />
43
31
  </span>
44
32
  <span class="subtitle">
@@ -30,6 +30,7 @@
30
30
  "
31
31
  class="close-button"
32
32
  icon="icon-dl-close"
33
+ size="xl"
33
34
  flat
34
35
  text-color="dl-color-darker"
35
36
  @click="$emit('onClose')"
@@ -1070,8 +1070,8 @@ export default defineComponent({
1070
1070
  return !!this.$slots.action && !this.isSmall
1071
1071
  },
1072
1072
  clearIconSize(): string {
1073
- if (this.isSmall) return '7px'
1074
- return 's'
1073
+ if (this.isSmall) return 'xs'
1074
+ return 'm'
1075
1075
  },
1076
1076
  passShowIcon(): string {
1077
1077
  return this.showPass ? 'icon-dl-hide' : 'icon-dl-show'
@@ -1643,4 +1643,3 @@ export default defineComponent({
1643
1643
  }
1644
1644
  }
1645
1645
  </style>
1646
-
@@ -103,7 +103,7 @@
103
103
  <dl-button
104
104
  ref="input-clear-button"
105
105
  icon="icon-dl-close"
106
- size="s"
106
+ size="m"
107
107
  text-color="dl-color-darker"
108
108
  flat
109
109
  fluid
@@ -44,7 +44,7 @@
44
44
  >
45
45
  <dl-button
46
46
  icon="icon-dl-close"
47
- size="12px"
47
+ size="m"
48
48
  flat
49
49
  :disabled="disabled"
50
50
  @mousedown="onClear"
@@ -101,9 +101,7 @@
101
101
  v-if="multiselect && (!searchable || !isExpanded)"
102
102
  class="root-container--placeholder"
103
103
  >
104
- <template
105
- v-if="allFiltersModel || isAllOptionsSelected"
106
- >
104
+ <template v-if="allFiltersModel">
107
105
  <dl-ellipsis :text="computedAllItemsLabel" />
108
106
  </template>
109
107
  <template v-else>
@@ -131,7 +129,7 @@
131
129
  v-if="clearable && hasSelection"
132
130
  class=".dl-select__clear-button"
133
131
  icon="icon-dl-close"
134
- :size="withoutBorders ? '10px' : '12px'"
132
+ :size="withoutBorders ? '10px' : '16px'"
135
133
  style="margin-right: 3px; cursor: pointer"
136
134
  @click.prevent.stop="clearSelection"
137
135
  />
@@ -198,6 +196,7 @@
198
196
  :highlight-selected="highlightSelected"
199
197
  :filter-term="searchTerm"
200
198
  :fit-content="fitContent"
199
+ :uniform-width="uniformWidth"
201
200
  total-items
202
201
  @update:model-value="selectAll"
203
202
  @depth-change="handleDepthChange"
@@ -243,6 +242,7 @@
243
242
  :indentation="indentation"
244
243
  :is-expanded="item.expanded"
245
244
  :tooltip="getOptionTooltip(item)"
245
+ :uniform-width="uniformWidth"
246
246
  @update:model-value="handleModelValueUpdate"
247
247
  @click="selectOption(item)"
248
248
  @selected="handleSelected"
@@ -294,6 +294,7 @@
294
294
  :indentation="indentation"
295
295
  :is-expanded="isExpandedOption(option)"
296
296
  :tooltip="getOptionTooltip(option)"
297
+ :uniform-width="uniformWidth"
297
298
  @update:model-value="handleModelValueUpdate"
298
299
  @click="selectOption(option)"
299
300
  @selected="handleSelected"
@@ -428,7 +429,6 @@ export default defineComponent({
428
429
  alignRight: { type: Boolean, default: false },
429
430
  allItemsOption: { type: Boolean, default: false },
430
431
  allItemsOptionLabel: { type: String, default: null },
431
- isAllOptionsSelected: { type: Boolean, default: false },
432
432
  placeholder: { type: String, default: null },
433
433
  removableSelection: { type: Boolean, default: false },
434
434
  width: { type: String, default: '100%' },
@@ -680,6 +680,35 @@ export default defineComponent({
680
680
  optionsCount(): number {
681
681
  return this.options?.length ?? 0
682
682
  },
683
+ maxDepth(): number {
684
+ const hasChildren = (option: DlSelectOptionType) =>
685
+ typeof option === 'object' && option?.children?.length > 0
686
+
687
+ const getMaxDepth = (
688
+ options: DlSelectOptionType[],
689
+ depth: number = 0
690
+ ): number => {
691
+ let max = depth
692
+ for (const option of options) {
693
+ if (hasChildren(option)) {
694
+ const childDepth = getMaxDepth(
695
+ (option as any).children,
696
+ depth + 1
697
+ )
698
+ if (childDepth > max) {
699
+ max = childDepth
700
+ }
701
+ }
702
+ }
703
+ return max
704
+ }
705
+ return getMaxDepth(this.options)
706
+ },
707
+ uniformWidth(): string {
708
+ return this.maxDepth === 0
709
+ ? '100%'
710
+ : `calc(100% + ${(this.maxDepth - 1) * this.indentation}px)`
711
+ },
683
712
  identifierClass(): string {
684
713
  return `dl-select-${this.title}-${
685
714
  this.placeholder ?? ''
@@ -3,7 +3,9 @@
3
3
  <div
4
4
  v-if="readonly"
5
5
  :class="[{ 'readonly-option': true }, { capitalized }]"
6
- :style="`padding-left: ${10 + depth * indentation}px;`"
6
+ :style="`padding-left: ${
7
+ 10 + depth * indentation
8
+ }px; width: ${computedWidth};`"
7
9
  >
8
10
  <dl-tooltip v-if="tooltip">
9
11
  {{ tooltip }}
@@ -18,10 +20,10 @@
18
20
  :class="{ highlighted: highlightSelected && isSelected }"
19
21
  :with-wave="withWave"
20
22
  clickable
21
- style="width: 100%"
23
+ :style="`width: ${computedWidth}`"
22
24
  @click="handleClick"
23
25
  >
24
- <dl-item-section :color="color" style="width: 100%">
26
+ <dl-item-section :color="color">
25
27
  <span
26
28
  v-if="multiselect"
27
29
  class="multiselect-option"
@@ -98,6 +100,7 @@
98
100
  :filter-term="filterTerm"
99
101
  :fit-content="fitContent"
100
102
  :tooltip="tooltip"
103
+ :uniform-width="uniformWidth"
101
104
  @update:model-value="handleCheckboxUpdate"
102
105
  @selected="handleSingleSelect($event, true)"
103
106
  @deselected="handleSingleDeselect"
@@ -194,7 +197,8 @@ export default defineComponent({
194
197
  type: Boolean,
195
198
  default: true
196
199
  },
197
- tooltip: { type: String, default: null }
200
+ tooltip: { type: String, default: null },
201
+ uniformWidth: { type: String, default: null }
198
202
  },
199
203
  emits: [
200
204
  'update:model-value',
@@ -238,6 +242,12 @@ export default defineComponent({
238
242
  },
239
243
  displayLabel(): string {
240
244
  return String(this.label ? this.label : this.value)
245
+ },
246
+ computedWidth(): string {
247
+ if (this.uniformWidth) {
248
+ return this.uniformWidth
249
+ }
250
+ return 'max-content; min-width: 100%'
241
251
  }
242
252
  },
243
253
  methods: {
@@ -38,22 +38,25 @@ const isValueSelected = (
38
38
  export const getLabelOfSelectedOption = (
39
39
  selected: string[] | string,
40
40
  options: DlSelectOptionType[] | string[]
41
- ): string | undefined => {
42
- for (const option of options) {
43
- if (
44
- typeof option === 'string' &&
45
- typeof selected === 'string' &&
46
- option === selected
47
- ) {
48
- return String(option)
49
- } else if (
50
- typeof option === 'object' &&
51
- isValueSelected(option, selected)
52
- ) {
53
- return String(option.label)
41
+ ): string => {
42
+ const selectedValue = Array.isArray(selected) ? selected[0] : selected
43
+
44
+ const findLabel = (opts: DlSelectOptionType[]): string | undefined => {
45
+ for (const opt of opts) {
46
+ const optValue = typeof opt === 'object' ? opt.value : opt
47
+ if (optValue === selectedValue) {
48
+ return typeof opt === 'object' ? String(opt.label) : String(opt)
49
+ }
50
+
51
+ if (typeof opt === 'object' && opt?.children?.length) {
52
+ const found = findLabel(opt.children as DlSelectOptionType[])
53
+ if (found) return found
54
+ }
54
55
  }
56
+ return undefined
55
57
  }
56
- return '1 Option Selected'
58
+
59
+ return findLabel(options as DlSelectOptionType[]) ?? '1 Option Selected'
57
60
  }
58
61
 
59
62
  export const getIconSize = (size: TInputSizes) => ICON_SIZES[size] ?? '14px'
@@ -1,10 +1,7 @@
1
1
  <template>
2
2
  <div class="dl-stepper-header">
3
3
  <slot>
4
- <dl-typography
5
- size="h2"
6
- variant="h2"
7
- >
4
+ <dl-typography size="h2" variant="h2">
8
5
  {{ headerTitle }}
9
6
  </dl-typography>
10
7
  </slot>
@@ -13,6 +10,7 @@
13
10
  text-color="dl-color-darker"
14
11
  flat
15
12
  icon="icon-dl-close"
13
+ size="xl"
16
14
  @click="$emit('close')"
17
15
  />
18
16
  </div>
@@ -129,7 +129,7 @@ export function useTableColumnSelection(
129
129
  ? props.tableColspan
130
130
  : computedCols.value.length +
131
131
  (hasSelectionMode.value === true ? 1 : 0) +
132
- (hasDraggableRows.value === true ? 1 : 0) +
132
+ 1 +
133
133
  (props.isTreeTable ? 1 : 0)
134
134
  })
135
135
 
@@ -10,15 +10,9 @@
10
10
  v-show="!!title.length || !!tooltip.length"
11
11
  class="dl-textarea__title-container"
12
12
  >
13
- <label
14
- v-show="!!title.length"
15
- class="dl-textarea__title"
16
- >
13
+ <label v-show="!!title.length" class="dl-textarea__title">
17
14
  {{ title }}
18
- <span
19
- v-show="required"
20
- :class="asteriskClasses"
21
- > *</span>
15
+ <span v-show="required" :class="asteriskClasses"> *</span>
22
16
  {{ !required && optional ? ' (Optional)' : null }}
23
17
  </label>
24
18
  <span v-show="!!tooltip.length">
@@ -42,14 +36,11 @@
42
36
  :value="topMessage"
43
37
  />
44
38
  </div>
45
- <span
46
- v-show="showClearButton"
47
- class="dl-textarea__clear-button"
48
- >
39
+ <span v-show="showClearButton" class="dl-textarea__clear-button">
49
40
  <dl-button
50
41
  ref="input-clear-button"
51
42
  icon="icon-dl-close"
52
- size="s"
43
+ size="m"
53
44
  text-color="dl-color-darker"
54
45
  flat
55
46
  fluid
@@ -3,13 +3,11 @@
3
3
  <dl-button @click="isOpenedDatasetBrowserModal = true">
4
4
  Dataset Browser
5
5
  </dl-button>
6
- <div
7
- v-if="isOpenedDatasetBrowserModal"
8
- class="fullscreen-template"
9
- >
6
+ <div v-if="isOpenedDatasetBrowserModal" class="fullscreen-template">
10
7
  <div class="fullscreen-template__close">
11
8
  <dl-button
12
9
  icon="icon-dl-close"
10
+ size="xl"
13
11
  flat
14
12
  @click="isOpenedDatasetBrowserModal = false"
15
13
  />
@@ -3,13 +3,11 @@
3
3
  <dl-button @click="isOpenPageLayoutModal = true">
4
4
  Page Layout
5
5
  </dl-button>
6
- <div
7
- v-if="isOpenPageLayoutModal"
8
- class="fullscreen-template"
9
- >
6
+ <div v-if="isOpenPageLayoutModal" class="fullscreen-template">
10
7
  <div class="fullscreen-template__close">
11
8
  <dl-button
12
9
  icon="icon-dl-close"
10
+ size="xl"
13
11
  flat
14
12
  @click="isOpenPageLayoutModal = false"
15
13
  />
@@ -45,9 +43,7 @@
45
43
  label="Switch to Basic Browser"
46
44
  />
47
45
  </template>
48
- <template #subtitle>
49
- testestse
50
- </template>
46
+ <template #subtitle> testestse </template>
51
47
  </dl-page-layout-header>
52
48
  </template>
53
49
  <div>This is a body</div>
@@ -16,10 +16,7 @@
16
16
  label="Error"
17
17
  @click="$emit('error-click')"
18
18
  />
19
- <dl-button
20
- label="Reset"
21
- @click="$emit('reset-click')"
22
- />
19
+ <dl-button label="Reset" @click="$emit('reset-click')" />
23
20
  </div>
24
21
  <div class="inputs-container">
25
22
  <dl-select
@@ -40,12 +37,16 @@
40
37
  to create a new recipe.
41
38
  </dl-typography>
42
39
  <span>
43
- <dl-typography color="dl-color-medium">2. Instruction Document</dl-typography>
40
+ <dl-typography color="dl-color-medium"
41
+ >2. Instruction Document</dl-typography
42
+ >
44
43
  <div style="height: 10px" />
45
44
  <dl-typography>Lorem Ipsum Dolot Sit Amat.Pdf</dl-typography>
46
45
  </span>
47
46
  <span>
48
- <dl-typography color="dl-color-medium">Instruction Range</dl-typography>
47
+ <dl-typography color="dl-color-medium"
48
+ >Instruction Range</dl-typography
49
+ >
49
50
  <div style="height: 4px" />
50
51
  <dl-option-group
51
52
  v-model="range"
@@ -57,7 +58,9 @@
57
58
  />
58
59
  </span>
59
60
  <span>
60
- <dl-typography color="dl-color-medium">Tools Settings (Optional)</dl-typography>
61
+ <dl-typography color="dl-color-medium"
62
+ >Tools Settings (Optional)</dl-typography
63
+ >
61
64
  <div style="height: 10px" />
62
65
  <dl-checkbox
63
66
  v-model="pixel"
@@ -66,31 +69,26 @@
66
69
  />
67
70
  </span>
68
71
  <span>
69
- <dl-typography color="dl-color-medium">Labeling Task Actions</dl-typography>
72
+ <dl-typography color="dl-color-medium"
73
+ >Labeling Task Actions</dl-typography
74
+ >
70
75
  <div style="height: 10px" />
71
76
  <dl-checkbox
72
77
  v-model="auto"
73
78
  padding="5px 0px"
74
79
  label="Auto apply status on classification tool"
75
80
  />
76
- <div
77
- class="labeling-option"
78
- style="margin-top: 4px"
79
- >
81
+ <div class="labeling-option" style="margin-top: 4px">
80
82
  <dl-radio
81
83
  v-model="labeling"
82
84
  label="Complete"
83
85
  padding="5px 0px"
84
86
  value="complete"
85
87
  />
86
- <dl-typography
87
- size="10px"
88
- color="dl-color-lighter"
89
- >(Default)</dl-typography>
90
- <dl-icon
91
- icon="icon-dl-close"
92
- size="8px"
93
- />
88
+ <dl-typography size="10px" color="dl-color-lighter"
89
+ >(Default)</dl-typography
90
+ >
91
+ <dl-icon icon="icon-dl-close" size="12px" />
94
92
  </div>
95
93
  <div class="labeling-option">
96
94
  <dl-radio
@@ -99,10 +97,7 @@
99
97
  padding="5px 0px"
100
98
  value="disable"
101
99
  />
102
- <dl-icon
103
- icon="icon-dl-close"
104
- size="8px"
105
- />
100
+ <dl-icon icon="icon-dl-close" size="12px" />
106
101
  </div>
107
102
  </span>
108
103
  <dl-button
@@ -8,6 +8,7 @@
8
8
  <dl-button
9
9
  flat
10
10
  icon="icon-dl-close"
11
+ size="xl"
11
12
  @click="isOpenedStudioModal = false"
12
13
  />
13
14
  </div>