@dataloop-ai/components 0.20.0 → 0.20.2

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 (42) hide show
  1. package/package.json +59 -59
  2. package/src/components/basic/DlButton/DlButton.vue +5 -5
  3. package/src/components/basic/DlPopup/DlPopup.vue +1 -1
  4. package/src/components/basic/DlProgressChart/DlProgressChart.vue +19 -11
  5. package/src/components/compound/DlCard/DlCard.vue +48 -14
  6. package/src/components/compound/DlCharts/charts/DlConfusionMatrix/DlConfusionMatrix.vue +1 -1
  7. package/src/components/compound/DlCharts/components/DlChartLabels.vue +25 -21
  8. package/src/components/compound/DlCharts/components/DlChartLegend.vue +17 -14
  9. package/src/components/compound/DlRange/DlRange.vue +9 -3
  10. package/src/components/compound/DlSelect/components/DlSelectOption.vue +1 -1
  11. package/src/components/compound/DlSelect/types.ts +1 -2
  12. package/src/components/compound/DlSlider/components/DlSliderInput.vue +1 -1
  13. package/src/components/compound/DlSlider/useSlider.ts +1 -4
  14. package/src/components/compound/DlTable/components/DlTh.vue +3 -6
  15. package/src/components/compound/DlTable/components/SortableJS.vue +8 -3
  16. package/src/components/compound/DlThumbnailGallery/DlThumbnailGallery.vue +18 -9
  17. package/src/components/essential/DlTypography/DlTypography.vue +14 -6
  18. package/src/components/essential/types.ts +0 -1
  19. package/src/demos/DlChipDemo.vue +84 -24
  20. package/src/demos/DlCounterDemo.vue +1 -1
  21. package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/ActionsMenu.vue +7 -4
  22. package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/AutomationMenu.vue +19 -7
  23. package/src/demos/DlDatasetBrowserLayoutDemo/components/MainContent/CardView.vue +7 -13
  24. package/src/demos/DlDatasetBrowserLayoutDemo/components/filters/AddFilter.vue +23 -10
  25. package/src/demos/DlDateTimeRangeDemo.vue +16 -19
  26. package/src/demos/DlLabelPickerDemo.vue +5 -8
  27. package/src/demos/DlMenuDemo.vue +2 -2
  28. package/src/demos/DlSelectDemo.vue +10 -10
  29. package/src/demos/DlSliderDemo.vue +1 -1
  30. package/src/demos/DlStepperDemo/steps/GeneralStep.vue +5 -8
  31. package/src/demos/DlStudioLayoutDemo/components/StudioLeftDrawer.vue +4 -10
  32. package/src/demos/DlStudioLayoutDemo/components/StudioTabsMenu.vue +10 -2
  33. package/src/demos/DlTextInputDemo.vue +5 -5
  34. package/src/demos/DlThDemo.vue +4 -5
  35. package/src/demos/DlTooltipDemo.vue +1 -1
  36. package/src/demos/DlTreeTableDemo.vue +7 -6
  37. package/src/demos/DlTypographyDemo.vue +8 -11
  38. package/src/demos/DlVirtualScrollDemo.vue +13 -7
  39. package/tsconfig.json +1 -1
  40. package/vite.config.ts +3 -0
  41. package/src/components/essential/DlTypography/types.ts +0 -19
  42. package/tsconfig.vue.json +0 -4
@@ -32,7 +32,10 @@
32
32
  class="dl-dtr--option_switch"
33
33
  />
34
34
  </div>
35
- <div style="margin-top: 10px" class="dl-dtr--option__range">
35
+ <div
36
+ style="margin-top: 10px"
37
+ class="dl-dtr--option__range"
38
+ >
36
39
  <span class="dl-dtr--option_title">Available Range: </span>
37
40
  <dl-switch
38
41
  v-model="switchState"
@@ -46,7 +49,7 @@
46
49
  value="auto-close"
47
50
  class="dl-dtr--option_switch"
48
51
  />
49
- <br />
52
+ <br>
50
53
  <span>From</span>
51
54
  <input
52
55
  type="date"
@@ -55,7 +58,7 @@
55
58
  class="dl-dtr--range-input"
56
59
  placeholder="from"
57
60
  @input="setRangeFrom"
58
- />
61
+ >
59
62
  <span style="margin-left: 5px">To</span>
60
63
  <input
61
64
  :disabled="!range"
@@ -64,7 +67,7 @@
64
67
  class="dl-dtr--range-input"
65
68
  placeholder="to"
66
69
  @input="setRangeTo"
67
- />
70
+ >
68
71
  </div>
69
72
  </div>
70
73
  <div>
@@ -115,8 +118,8 @@
115
118
  :value="date.from"
116
119
  class="dl-dtr--range-input"
117
120
  placeholder="from"
118
- @input="updateFrom"
119
- />
121
+ @input="date.from = new Date($event.target.value)"
122
+ >
120
123
 
121
124
  from
122
125
  <input
@@ -125,8 +128,8 @@
125
128
  :value="date.to"
126
129
  class="dl-dtr--range-input"
127
130
  placeholder="from"
128
- @input="updateTo"
129
- />
131
+ @input="date.to = new Date($event.target.value)"
132
+ >
130
133
  </div>
131
134
 
132
135
  vmodel date: {{ date }}
@@ -174,10 +177,10 @@ export default defineComponent({
174
177
  }
175
178
  },
176
179
  computed: {
177
- type(): 'month' | 'day' {
180
+ type(): string {
178
181
  return this.switchState.includes('type') ? 'month' : 'day'
179
182
  },
180
- mode(): 'multi' | 'single' {
183
+ mode(): string {
181
184
  return this.switchState.includes('mode') ? 'multi' : 'single'
182
185
  },
183
186
  showTime(): boolean {
@@ -212,26 +215,20 @@ export default defineComponent({
212
215
  this.switchState.push('type')
213
216
  }
214
217
  },
215
- setRangeFrom({ target }: any) {
218
+ setRangeFrom({ target }: { target: HTMLInputElement }) {
216
219
  this.availableRange = {
217
220
  from: target.value ? new Date(target.value) : null,
218
221
  to: this.availableRange?.to
219
222
  }
220
223
  },
221
- setRangeTo({ target }: any) {
224
+ setRangeTo({ target }: { target: HTMLInputElement }) {
222
225
  this.availableRange = {
223
226
  to: target.value ? new Date(target.value) : null,
224
227
  from: this.availableRange?.from
225
228
  }
226
229
  },
227
- handleRange({ target }: any) {
230
+ handleRange({ target }: { target: HTMLInputElement }) {
228
231
  if (!target.checked) this.availableRange = null
229
- },
230
- updateTo({ target }: any) {
231
- this.date.to = new Date(target.value)
232
- },
233
- updateFrom({ target }: any) {
234
- this.date.from = new Date(target.value)
235
232
  }
236
233
  }
237
234
  })
@@ -3,7 +3,10 @@
3
3
  <div>Label picker component</div>
4
4
  <DlLabelPicker
5
5
  :items="items"
6
- :empty-state-props="emptyStateProps"
6
+ :empty-state-props="{
7
+ title: '',
8
+ icon: ''
9
+ }"
7
10
  hide-bottom
8
11
  hide-no-data
9
12
  @selected-label="setSelectedEvent"
@@ -16,12 +19,6 @@
16
19
  import { DlLabelPicker } from '../components'
17
20
  import { defineComponent, ref } from 'vue-demi'
18
21
  import { DlLabelPickerItem } from '../types'
19
-
20
- const emptyStateProps: any = {
21
- title: '',
22
- icon: ''
23
- }
24
-
25
22
  const rows: DlLabelPickerItem[] = [
26
23
  {
27
24
  identifier: 'a',
@@ -79,7 +76,7 @@ export default defineComponent({
79
76
  const setSelectedEvent = (item: DlLabelPickerItem) => {
80
77
  lastSelected.value = item
81
78
  }
82
- return { items, lastSelected, setSelectedEvent, emptyStateProps }
79
+ return { items, lastSelected, setSelectedEvent }
83
80
  }
84
81
  })
85
82
  </script>
@@ -517,7 +517,7 @@ export default defineComponent({
517
517
  setup() {
518
518
  const showing = ref(false)
519
519
  const isMenuOpen = ref(false)
520
- const arrowNavigationLabel = ref<string>('Arrow Navigation Label')
520
+ const arrowNavigationLabel = ref<ItemType>('Arrow Navigation Label')
521
521
  const isOpen = ref(false)
522
522
 
523
523
  const listItems = ref([
@@ -645,7 +645,7 @@ export default defineComponent({
645
645
  )
646
646
 
647
647
  watch(selectedItem, (value: ItemType | string) => {
648
- arrowNavigationLabel.value = value as any
648
+ arrowNavigationLabel.value = value
649
649
  })
650
650
 
651
651
  onMounted(() => {
@@ -632,15 +632,15 @@
632
632
  import { cloneDeep } from 'lodash'
633
633
  import { defineComponent } from 'vue-demi'
634
634
  import { DlChip, DlSelect, DlIcon, DlBadge, DlButton } from '../components'
635
- import { DlSelectOption } from '../components/types'
635
+ import { DlSelectOptionType } from '../components/types'
636
636
 
637
- const defaultOptions: DlSelectOption[] = [
637
+ const defaultOptions = [
638
638
  { label: 'Contributor 1', value: 'c1' },
639
639
  { label: 'Contributor 2', value: 'c2' },
640
640
  { label: 'Contributor 3', value: 'c3' }
641
641
  ]
642
642
 
643
- const treeOptions: DlSelectOption[] = [
643
+ const treeOptions = [
644
644
  {
645
645
  label: 'root',
646
646
  value: 'root',
@@ -729,7 +729,7 @@ const treeOptions: DlSelectOption[] = [
729
729
  }
730
730
  ]
731
731
 
732
- const treeOptionsWithReadonly: DlSelectOption[] = [
732
+ const treeOptionsWithReadonly = [
733
733
  {
734
734
  label: 'Without children',
735
735
  value: 'r0',
@@ -790,7 +790,7 @@ const treeOptionsWithReadonly: DlSelectOption[] = [
790
790
  }
791
791
  ]
792
792
 
793
- const treeOptionsExpanded: DlSelectOption[] = [
793
+ const treeOptionsExpanded: DlSelectOptionType[] = [
794
794
  {
795
795
  label: 'Readonly option with children & readonly child',
796
796
  value: 'r6',
@@ -899,7 +899,7 @@ export default defineComponent({
899
899
  // @ts-ignore
900
900
  return defaultOptions.includes(this.selectedBySearch as any)
901
901
  },
902
- alotOfOptions(): DlSelectOption[] {
902
+ alotOfOptions(): DlSelectOptionType[] {
903
903
  const arr = [] as any[]
904
904
 
905
905
  for (let i = 0; i < 1000; ++i) {
@@ -914,7 +914,7 @@ export default defineComponent({
914
914
 
915
915
  return arr
916
916
  },
917
- someOptions(): DlSelectOption[] {
917
+ someOptions(): DlSelectOptionType[] {
918
918
  const arr = [] as any[]
919
919
 
920
920
  for (let i = 0; i < 10; ++i) {
@@ -929,7 +929,7 @@ export default defineComponent({
929
929
 
930
930
  return arr
931
931
  },
932
- alotOfOptionsExpanded(): DlSelectOption[] {
932
+ alotOfOptionsExpanded(): DlSelectOptionType[] {
933
933
  const arr = cloneDeep(this.alotOfOptions)
934
934
  arr.push(treeOptionsExpanded[0])
935
935
  return arr
@@ -941,8 +941,8 @@ export default defineComponent({
941
941
  },
942
942
  filterFn(val: string) {
943
943
  this.searchOptions = defaultOptions.filter(
944
- (v: DlSelectOption) =>
945
- v.value.toLowerCase().indexOf(val.toLowerCase()) > -1
944
+ (v: { label: string; value: string } | undefined) =>
945
+ v.label.toLowerCase().indexOf(val.toLowerCase()) > -1
946
946
  )
947
947
  this.showAllOption =
948
948
  this.searchOptions.length === defaultOptions.length
@@ -5,7 +5,7 @@
5
5
  width="500px"
6
6
  text="slider"
7
7
  :step="1"
8
- :min="-100"
8
+ :min="50"
9
9
  :max="100"
10
10
  :slim="slim"
11
11
  :readonly="readonly"
@@ -16,7 +16,10 @@
16
16
  label="Error"
17
17
  @click="$emit('error-click')"
18
18
  />
19
- <dl-button label="Reset" @click="$emit('reset-click')" />
19
+ <dl-button
20
+ label="Reset"
21
+ @click="$emit('reset-click')"
22
+ />
20
23
  </div>
21
24
  <div class="inputs-container">
22
25
  <dl-input
@@ -81,13 +84,7 @@ export default defineComponent({
81
84
  DlInput,
82
85
  DlSelect
83
86
  },
84
- emits: [
85
- 'reset-click',
86
- 'error-click',
87
- 'complete-click',
88
- 'warning-click',
89
- 'set-subtitle'
90
- ],
87
+ emits: ['reset-click', 'error-click', 'complete-click', 'warning-click'],
91
88
  data() {
92
89
  return {
93
90
  owner: 'Rotem Shaham',
@@ -36,7 +36,7 @@
36
36
  size="12px"
37
37
  style="text-align: center"
38
38
  >
39
- For more ontology settings <br />
39
+ For more ontology settings <br>
40
40
  <a href="https://google.com/">go to receipe</a>
41
41
  </dl-typography>
42
42
  </div>
@@ -53,7 +53,7 @@
53
53
  @selectedOption="handleOption"
54
54
  />
55
55
  </div>
56
- <hr />
56
+ <hr>
57
57
  <div>
58
58
  <div>
59
59
  <dl-button
@@ -82,7 +82,7 @@
82
82
  </dl-button>
83
83
  </div>
84
84
  </div>
85
- <hr />
85
+ <hr>
86
86
  <div
87
87
  style="
88
88
  display: flex;
@@ -226,19 +226,13 @@ export default defineComponent({
226
226
  selectedIconMenu.value = iconMenu
227
227
  }
228
228
 
229
- const autoNextItem = ref(false)
230
-
231
229
  return {
232
230
  listAutocomleteItems,
233
231
  handleOption,
234
232
  selectedItem,
235
233
  iconsMenu,
236
234
  selectedIconMenu,
237
- handleSelectedIconMenu,
238
- logValue: (value: any) => {
239
- console.log('log value: ', value)
240
- },
241
- autoNextItem
235
+ handleSelectedIconMenu
242
236
  }
243
237
  }
244
238
  })
@@ -1,12 +1,19 @@
1
1
  <template>
2
- <div class="tabs-menu" :style="cssVars">
2
+ <div
3
+ class="tabs-menu"
4
+ :style="cssVars"
5
+ >
3
6
  <dl-tabs
4
7
  v-model="selectedTab"
5
8
  :items="tabItems"
6
9
  @update:model-value="handleSelectedOption"
7
10
  />
8
11
  <div class="tabs-menu__border-icon">
9
- <dl-button flat :icon="expandIcon" @click="onToggle" />
12
+ <dl-button
13
+ flat
14
+ :icon="expandIcon"
15
+ @click="onToggle"
16
+ />
10
17
  </div>
11
18
  <component :is="tabs" />
12
19
  </div>
@@ -36,6 +43,7 @@ export default defineComponent({
36
43
  DlButton,
37
44
  DlIcon
38
45
  },
46
+ props: {},
39
47
  setup() {
40
48
  const LARGE_WIDTH = '250px'
41
49
  const SMALL_WIDTH = '0px'
@@ -12,11 +12,11 @@
12
12
  top-message="Pariatur consequat non sit aliqua labore ad reprehenderit deserunt ullamco incididunt non irure laborum deserunt."
13
13
  info-message="Ipsum amet quis velit amet. Anim consectetur nostrud sunt eu non non consequat sint eu amet."
14
14
  :auto-suggest-items="[
15
- { suggestion: 'foo' },
16
- { suggestion: 'bar' },
17
- { suggestion: 'foobar' },
18
- { suggestion: 'barfoo' },
19
- { suggestion: 'foo bar foobarv' }
15
+ 'foo',
16
+ 'bar',
17
+ 'foobar',
18
+ 'barfoo',
19
+ 'foo bar foobarv'
20
20
  ]"
21
21
  show-counter
22
22
  :max-length="20"
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <div>
3
3
  <DlTh> Table Th component </DlTh>
4
- <DlTh :auto-width="true"> Table Th component auto width </DlTh>
4
+ <DlTh :auto-width="true">
5
+ Table Th component auto width
6
+ </DlTh>
5
7
  <DlTh
6
8
  :props="{
7
- sort: sort,
9
+ sort: (el) => log(el),
8
10
  col: { sortable: true, align: 'left' }
9
11
  }"
10
12
  >
@@ -24,9 +26,6 @@ export default defineComponent({
24
26
  methods: {
25
27
  log(e: Event) {
26
28
  console.log(e)
27
- },
28
- sort(el: any) {
29
- console.log(el)
30
29
  }
31
30
  }
32
31
  })
@@ -145,7 +145,7 @@ export default defineComponent({
145
145
  title: 'Developers',
146
146
  icon: 'icon-dl-code'
147
147
  }
148
- ] as any
148
+ ]
149
149
  }
150
150
  },
151
151
  template: 'dl-tooltip-demo'
@@ -57,7 +57,10 @@
57
57
  </div>
58
58
 
59
59
  <div class="right-panel">
60
- <button class="btn" @click="addRowPerPage">
60
+ <button
61
+ class="btn"
62
+ @click="addRowPerPage"
63
+ >
61
64
  Add Rows/Page
62
65
  </button>
63
66
 
@@ -203,9 +206,7 @@
203
206
  :rows="tableRows"
204
207
  :columns="tableColumns"
205
208
  title="Editable Columns"
206
- :visible-columns="
207
- tableColumns.slice(0, -1).map((c) => c.name)
208
- "
209
+ :visible-columns="tableColumns.slice(0, -1)"
209
210
  />
210
211
  </div>
211
212
  <div>
@@ -267,7 +268,7 @@ import {
267
268
  import { defineComponent, ref, computed, nextTick, watch } from 'vue-demi'
268
269
  import { times, cloneDeep } from 'lodash'
269
270
  import { v4 } from 'uuid'
270
- import { DlTableColumn, DlTableRow } from '../types'
271
+ import { DlTableRow } from '../types'
271
272
 
272
273
  const columns = [
273
274
  {
@@ -576,7 +577,7 @@ export default defineComponent({
576
577
  const tableRows = ref(rows)
577
578
  const tableRowsVS = ref(cloneDeep(rows))
578
579
  const draggable = ref('both')
579
- const tableColumns = ref<DlTableColumn[]>(columns as any)
580
+ const tableColumns = ref(columns)
580
581
  const rowsPerPageOptions = ref([10, 12, 14, 16])
581
582
 
582
583
  const infiniteLoading = ref(false)
@@ -1,9 +1,12 @@
1
1
  <template>
2
2
  <div>
3
- <div v-for="(item, index) in typographyTypes" :key="index">
3
+ <div
4
+ v-for="(item, index) in typographyTypes"
5
+ :key="index"
6
+ >
4
7
  <DlTypography
5
8
  :color="item.color"
6
- :size="getItemSize(item)"
9
+ :size="item.size || item.variant"
7
10
  :variant="item.variant"
8
11
  >
9
12
  Typography {{ item ? item.variant : item }}
@@ -20,8 +23,8 @@
20
23
  Typography Bold
21
24
  </dl-typography>
22
25
  </DlButton>
23
- <br />
24
- <br />
26
+ <br>
27
+ <br>
25
28
  <DlButton>
26
29
  <dl-typography
27
30
  color="dl-color-tooltip-text"
@@ -38,7 +41,6 @@
38
41
  <script lang="ts">
39
42
  import { defineComponent } from 'vue-demi'
40
43
  import { DlButton, DlTypography } from '../components'
41
- import { DlTypographyVariant } from '../types'
42
44
 
43
45
  export default defineComponent({
44
46
  name: 'DlTypographyDemo',
@@ -46,7 +48,7 @@ export default defineComponent({
46
48
  DlTypography,
47
49
  DlButton
48
50
  },
49
- data(): { typographyTypes: Record<string, any>[] } {
51
+ data() {
50
52
  return {
51
53
  typographyTypes: [
52
54
  {
@@ -85,11 +87,6 @@ export default defineComponent({
85
87
  }
86
88
  ]
87
89
  }
88
- },
89
- methods: {
90
- getItemSize(item: Record<string, string>): string {
91
- return item.size || item.variant
92
- }
93
90
  }
94
91
  })
95
92
  </script>
@@ -10,7 +10,10 @@
10
10
  >
11
11
  <dl-tr :key="index">
12
12
  <dl-td>#{{ index }}</dl-td>
13
- <dl-td v-for="col in columns" :key="index + '-' + col">
13
+ <dl-td
14
+ v-for="col in columns"
15
+ :key="index + '-' + col"
16
+ >
14
17
  {{ row[col] }}
15
18
  </dl-td>
16
19
  </dl-tr>
@@ -24,7 +27,10 @@
24
27
  :items="horizontalList"
25
28
  virtual-scroll-horizontal
26
29
  >
27
- <div :key="index" :class="item.class">
30
+ <div
31
+ :key="index"
32
+ :class="item.class"
33
+ >
28
34
  #{{ index }} - {{ item.label }}
29
35
  </div>
30
36
  </dl-virtual-scroll>
@@ -38,7 +44,10 @@
38
44
  separator
39
45
  @virtual-scroll="log"
40
46
  >
41
- <dl-list-item :key="index" dense>
47
+ <dl-list-item
48
+ :key="index"
49
+ dense
50
+ >
42
51
  <dl-item-section>
43
52
  #{{ index }} - {{ item.label }}
44
53
  </dl-item-section>
@@ -262,10 +271,7 @@ export default defineComponent({
262
271
  horizontalList,
263
272
  customList,
264
273
  columns,
265
- cardData,
266
- log: () => {
267
- console.log('hi')
268
- }
274
+ cardData
269
275
  }
270
276
  }
271
277
  })
package/tsconfig.json CHANGED
@@ -38,6 +38,6 @@
38
38
  "experimentalDisableTemplateSupport": true
39
39
  },
40
40
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
41
- "exclude": ["node_modules", "**/*.stories.ts", "**/*.temp.vue", "**/*.temp.ts"],
41
+ "exclude": ["node_modules", "**/*.stories.ts"],
42
42
  "references": [{ "path": "./tsconfig.node.json" }]
43
43
  }
package/vite.config.ts CHANGED
@@ -11,6 +11,9 @@ export default defineConfig({
11
11
  deps: {
12
12
  inline: ['vitest-canvas-mock']
13
13
  },
14
+ coverage: {
15
+ reporter: ['lcovonly', 'text']
16
+ },
14
17
  exclude: [
15
18
  'node_modules/**/*.spec.js',
16
19
  'node_modules/**/*.spec.ts',
@@ -1,19 +0,0 @@
1
- export type DlTypographyVariant =
2
- | 'h1'
3
- | 'h2'
4
- | 'h3'
5
- | 'h4'
6
- | 'h5'
7
- | 'h6'
8
- | 'p'
9
- | 'div'
10
- export const DlTypographySizes = [
11
- 'h1',
12
- 'h2',
13
- 'h3',
14
- 'h4',
15
- 'h5',
16
- 'h6',
17
- 'body',
18
- 'small'
19
- ]
package/tsconfig.vue.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "dist", "src/demos", "src/stories"]
4
- }