@dataloop-ai/components 0.20.240 → 0.20.242

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.240",
3
+ "version": "0.20.242",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -23,7 +23,7 @@
23
23
  "check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
24
24
  },
25
25
  "dependencies": {
26
- "@dataloop-ai/icons": "^3.1.69",
26
+ "@dataloop-ai/icons": "^3.1.72",
27
27
  "@monaco-editor/loader": "^1.4.0",
28
28
  "@types/flat": "^5.0.2",
29
29
  "@types/lodash": "^4.14.184",
@@ -23,11 +23,7 @@
23
23
  </span>
24
24
  </div>
25
25
  </div>
26
- <div
27
- v-if="$slots.actions"
28
- class="actions"
29
- data-test="actions"
30
- >
26
+ <div v-if="$slots.actions" class="actions" data-test="actions">
31
27
  <slot name="actions" />
32
28
  </div>
33
29
  <div
@@ -157,7 +153,10 @@ export default defineComponent({
157
153
  type: String,
158
154
  required: true,
159
155
  validator: (value: string) =>
160
- includes(['info', 'success', 'warning', 'error', 'discovery'], value)
156
+ includes(
157
+ ['info', 'success', 'warning', 'error', 'discovery'],
158
+ value
159
+ )
161
160
  },
162
161
  textColor: {
163
162
  type: String,
@@ -253,7 +253,12 @@ export default defineComponent({
253
253
  ]
254
254
  },
255
255
  getIconColor(): string {
256
- if (this.flat && this.hasIcon && !this.hasContent && this.icon === 'icon-dl-info') {
256
+ if (
257
+ this.flat &&
258
+ this.hasIcon &&
259
+ !this.hasContent &&
260
+ this.icon === 'icon-dl-info'
261
+ ) {
257
262
  return null
258
263
  }
259
264
  if (this.disabled) {
@@ -24,15 +24,13 @@
24
24
  </div>
25
25
  <dl-button
26
26
  v-if="closeButton"
27
- style="
28
- --dl-button-padding: 5px;
29
- --dl-button-bg-hover: var(--dl-color-fill-secondary);
30
- "
27
+ style="--dl-button-bg-hover: var(--dl-color-fill-secondary)"
31
28
  class="close-button"
32
29
  icon="icon-dl-close"
33
30
  size="xl"
34
31
  flat
35
32
  text-color="dl-color-darker"
33
+ :padding="closeIconSizePadding"
36
34
  @click="$emit('onClose')"
37
35
  >
38
36
  <dl-tooltip :delay="800"> Close </dl-tooltip>
@@ -43,6 +41,7 @@
43
41
  <script lang="ts">
44
42
  import { computed, defineComponent } from 'vue-demi'
45
43
  import DlButton from '../../../basic/DlButton/DlButton.vue'
44
+ import { setIconPadding } from '../../../basic/DlButton/utils'
46
45
  import { DlEllipsis } from '../../../essential'
47
46
  import { DlTooltip } from '../../../shared'
48
47
 
@@ -63,7 +62,8 @@ export default defineComponent({
63
62
  setup(props, { slots }) {
64
63
  const hasTitle = computed(() => !!props.title || !!slots.title)
65
64
  const hasSubtitle = computed(() => !!props.subtitle || !!slots.subtitle)
66
- return { hasTitle, hasSubtitle }
65
+ const closeIconSizePadding = `0 0 0 0`
66
+ return { hasTitle, hasSubtitle, closeIconSizePadding }
67
67
  }
68
68
  })
69
69
  </script>
@@ -115,6 +115,7 @@
115
115
  text-color="dl-color-darker"
116
116
  flat
117
117
  fluid
118
+ :padding="clearIconSizePadding"
118
119
  @click="onClear"
119
120
  />
120
121
  <dl-tooltip v-if="clearButtonTooltip">
@@ -347,6 +348,7 @@ import { setCaretAtTheEnd } from '../../../utils'
347
348
  import { DlInputFile, DlInputSuggestion } from './types'
348
349
  import InputFileElement from './components/InputFileElement.vue'
349
350
  import { stateManager } from '../../../StateManager'
351
+ import { setIconPadding } from '../../basic/DlButton/utils'
350
352
 
351
353
  export default defineComponent({
352
354
  name: 'DlInput',
@@ -1069,6 +1071,10 @@ export default defineComponent({
1069
1071
  if (this.isSmall) return 'xs'
1070
1072
  return 'm'
1071
1073
  },
1074
+ clearIconSizePadding(): string {
1075
+ const paddingRight = setIconPadding(this.clearIconSize)
1076
+ return `0 ${paddingRight} 0 0`
1077
+ },
1072
1078
  passShowIcon(): string {
1073
1079
  return this.showPass ? 'icon-dl-hide' : 'icon-dl-show'
1074
1080
  },
@@ -1111,7 +1111,8 @@ export default defineComponent({
1111
1111
 
1112
1112
  const uuid = v4()
1113
1113
  const watchFocusIn = () => {
1114
- focused.value = focused.value ||
1114
+ focused.value =
1115
+ focused.value ||
1115
1116
  !!document.activeElement?.closest(`#DlSmartSearchInput${uuid}`)
1116
1117
  }
1117
1118
 
@@ -4,7 +4,10 @@
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="
8
+ --dl-dialog-box-footer-padding: 10px 16px;
9
+ --dl-dialog-box-content-padding: 0;
10
+ "
8
11
  >
9
12
  <template #header>
10
13
  <dl-dialog-box-header
@@ -17,8 +20,8 @@
17
20
  <div class="json-editor-layout">
18
21
  <div class="json-query-menu">
19
22
  <dl-select
20
- :model-value="selectedOption"
21
23
  ref="jsonQueryMenu"
24
+ :model-value="selectedOption"
22
25
  width="300px"
23
26
  :options="selectOptions"
24
27
  placeholder="New Query"
@@ -39,7 +42,10 @@
39
42
  v-if="selectOptions.length < 2"
40
43
  class="json-query-menu-no-option"
41
44
  disabled
42
- style="cursor: default !important; padding: 14px 0 10px 0;"
45
+ style="
46
+ cursor: default !important;
47
+ padding: 14px 0 10px 0;
48
+ "
43
49
  >
44
50
  No Saved Queries
45
51
  </div>
@@ -197,7 +203,8 @@
197
203
  </template>
198
204
  <template #body>
199
205
  <dl-typography size="h5">
200
- Are you sure you want to permanently delete the following query?
206
+ Are you sure you want to permanently delete the following
207
+ query?
201
208
  <br />
202
209
  {{ optionToDelete.label }}
203
210
  <br />
@@ -207,9 +214,7 @@
207
214
  </template>
208
215
  <template #footer>
209
216
  <div class="full-width flex justify-end">
210
- <dl-button @click="deleteQuery">
211
- Delete
212
- </dl-button>
217
+ <dl-button @click="deleteQuery"> Delete </dl-button>
213
218
  </div>
214
219
  </template>
215
220
  </dl-dialog-box>
@@ -287,18 +292,6 @@ export default defineComponent({
287
292
  'delete',
288
293
  'select'
289
294
  ],
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
295
  setup(props, { emit }) {
303
296
  const { modelValue, options, json, selectedFilter } = toRefs(props)
304
297
 
@@ -498,6 +491,22 @@ export default defineComponent({
498
491
  saveQuery,
499
492
  deleteQuery
500
493
  }
494
+ },
495
+ methods: {
496
+ onDelete(option: DlSelectOption) {
497
+ const select = this.$refs['jsonQueryMenu'] as InstanceType<
498
+ typeof DlSelect
499
+ >
500
+ select?.closeMenu()
501
+ this.optionToDelete = option
502
+ },
503
+ onSave() {
504
+ const select = this.$refs['jsonQueryMenu'] as InstanceType<
505
+ typeof DlSelect
506
+ >
507
+ select?.closeMenu()
508
+ this.showSaveDialog = true
509
+ }
501
510
  }
502
511
  })
503
512
  </script>
@@ -327,7 +327,10 @@
327
327
  </div>
328
328
  </dl-list>
329
329
  <dl-list-item
330
- v-if="hasAfterOptions && (!noOptions || showAfterOptionsWhenEmpty)"
330
+ v-if="
331
+ hasAfterOptions &&
332
+ (!noOptions || showAfterOptionsWhenEmpty)
333
+ "
331
334
  :padding="afterOptionsPadding"
332
335
  >
333
336
  <dl-item-section>
@@ -11,6 +11,7 @@
11
11
  flat
12
12
  icon="icon-dl-close"
13
13
  size="xl"
14
+ :padding="closeIconSizePadding"
14
15
  @click="$emit('close')"
15
16
  />
16
17
  </div>
@@ -18,6 +19,7 @@
18
19
  <script lang="ts">
19
20
  import { defineComponent } from 'vue-demi'
20
21
  import { DlButton } from '../../../basic'
22
+ import { setIconPadding } from '../../../basic/DlButton/utils'
21
23
  import { DlTypography } from '../../../essential'
22
24
 
23
25
  export default defineComponent({
@@ -34,7 +36,11 @@ export default defineComponent({
34
36
  },
35
37
  hideCloseButton: Boolean
36
38
  },
37
- emits: ['close']
39
+ emits: ['close'],
40
+ setup() {
41
+ const closeIconSizePadding = `0 0 0 0`
42
+ return { closeIconSizePadding }
43
+ }
38
44
  })
39
45
  </script>
40
46
  <style lang="scss" scoped>
@@ -111,10 +111,7 @@ export default defineComponent({
111
111
  const isHovered = ref(false)
112
112
 
113
113
  const isInfoDefault = computed<boolean>(() => {
114
- return (
115
- icon.value === 'icon-dl-info' &&
116
- !color.value
117
- )
114
+ return icon.value === 'icon-dl-info' && !color.value
118
115
  })
119
116
 
120
117
  const effectiveColor = computed<string | null>(() => {
@@ -16,10 +16,7 @@
16
16
  {{ leftLabel }}
17
17
  </slot>
18
18
  </label>
19
- <span
20
- class="dl-switch-container"
21
- :style="`max-height: ${size}px;`"
22
- >
19
+ <span class="dl-switch-container" :style="`max-height: ${size}px;`">
23
20
  <input
24
21
  :id="computedId"
25
22
  ref="input"
@@ -29,7 +26,7 @@
29
26
  class="dl-switch-checkbox"
30
27
  :style="cssVars"
31
28
  @change="handleChange"
32
- >
29
+ />
33
30
  <label
34
31
  :for="computedId"
35
32
  class="dl-switch"
@@ -191,7 +188,7 @@ export default defineComponent({
191
188
  // todo: what the hell ?
192
189
  debounce(() => {
193
190
  nextTick(() => {
194
- (this.$refs.input as HTMLInputElement).checked =
191
+ ;(this.$refs.input as HTMLInputElement).checked =
195
192
  this.isTrue
196
193
  })
197
194
  }, 100)
@@ -203,7 +200,7 @@ export default defineComponent({
203
200
  stopAndPrevent(e)
204
201
  }
205
202
 
206
- (e.target as HTMLInputElement).checked = this.isTrue
203
+ ;(e.target as HTMLInputElement).checked = this.isTrue
207
204
 
208
205
  if (!this.disabled) {
209
206
  let newValue: any | any[]
@@ -1,9 +1,6 @@
1
1
  <template>
2
2
  <div style="width: 950px; padding-top: 20px">
3
- <div
4
- v-for="buttonSize in buttons"
5
- :key="buttonSize"
6
- >
3
+ <div v-for="buttonSize in buttons" :key="buttonSize">
7
4
  <h3>Size {{ buttonSize }}</h3>
8
5
  <div style="display: flex; gap: 10px; justify-content: center">
9
6
  <div class="col">
@@ -13,18 +10,10 @@
13
10
  label="Contained text filled"
14
11
  @click="log"
15
12
  />
16
- <DlButton
17
- :size="buttonSize"
18
- outlined
19
- @click="log"
20
- >
13
+ <DlButton :size="buttonSize" outlined @click="log">
21
14
  Outlined
22
15
  </DlButton>
23
- <DlButton
24
- :size="buttonSize"
25
- flat
26
- @click="log"
27
- >
16
+ <DlButton :size="buttonSize" flat @click="log">
28
17
  flat primary
29
18
  </DlButton>
30
19
  <DlButton
@@ -35,19 +24,10 @@
35
24
  >
36
25
  Flat Secondary
37
26
  </DlButton>
38
- <DlButton
39
- flat
40
- disabled
41
- :size="buttonSize"
42
- @click="log"
43
- >
27
+ <DlButton flat disabled :size="buttonSize" @click="log">
44
28
  Disabled Flat
45
29
  </DlButton>
46
- <DlButton
47
- disabled
48
- :size="buttonSize"
49
- @click="log"
50
- >
30
+ <DlButton disabled :size="buttonSize" @click="log">
51
31
  Disabled
52
32
  </DlButton>
53
33
  </div>
@@ -62,39 +42,14 @@
62
42
  margin-top: 50px;
63
43
  "
64
44
  >
65
- <DlButton
66
- :fluid="true"
67
- size="xl"
68
- @click="log"
69
- >
45
+ <DlButton :fluid="true" size="xl" @click="log">
70
46
  Fluid Button
71
47
  </DlButton>
72
- <DlButton
73
- size="xl"
74
- outlined
75
- @click="log"
76
- >
77
- Outlined
78
- </DlButton>
79
- <DlButton
80
- size="xl"
81
- flat
82
- @click="log"
83
- >
84
- Flat
85
- </DlButton>
86
- <DlButton
87
- size="xl"
88
- disabled
89
- @click="log"
90
- >
91
- Disabled
92
- </DlButton>
48
+ <DlButton size="xl" outlined @click="log"> Outlined </DlButton>
49
+ <DlButton size="xl" flat @click="log"> Flat </DlButton>
50
+ <DlButton size="xl" disabled @click="log"> Disabled </DlButton>
93
51
  </div>
94
- <div
95
- v-for="buttonSize in buttons"
96
- :key="buttonSize"
97
- >
52
+ <div v-for="buttonSize in buttons" :key="buttonSize">
98
53
  <h3>Size {{ buttonSize }}</h3>
99
54
  <div style="display: flex; gap: 10px; justify-content: center">
100
55
  <DlButton
@@ -103,11 +58,7 @@
103
58
  round
104
59
  @click="log"
105
60
  />
106
- <DlButton
107
- icon="icon-dl-add"
108
- :size="buttonSize"
109
- @click="log"
110
- />
61
+ <DlButton icon="icon-dl-add" :size="buttonSize" @click="log" />
111
62
  <DlButton
112
63
  icon="icon-dl-add"
113
64
  :size="buttonSize"
@@ -161,36 +112,16 @@
161
112
  margin-top: 50px;
162
113
  "
163
114
  >
164
- <DlButton
165
- icon="icon-dl-add"
166
- :fluid="true"
167
- size="xl"
168
- @click="log"
169
- >
115
+ <DlButton icon="icon-dl-add" :fluid="true" size="xl" @click="log">
170
116
  Fluid Button
171
117
  </DlButton>
172
- <DlButton
173
- icon="icon-dl-add"
174
- size="xl"
175
- outlined
176
- @click="log"
177
- >
118
+ <DlButton icon="icon-dl-add" size="xl" outlined @click="log">
178
119
  Outlined
179
120
  </DlButton>
180
- <DlButton
181
- icon="icon-dl-add"
182
- size="xl"
183
- flat
184
- @click="log"
185
- >
121
+ <DlButton icon="icon-dl-add" size="xl" flat @click="log">
186
122
  Flat
187
123
  </DlButton>
188
- <DlButton
189
- icon="icon-dl-add"
190
- size="xl"
191
- disabled
192
- @click="log"
193
- >
124
+ <DlButton icon="icon-dl-add" size="xl" disabled @click="log">
194
125
  Disabled
195
126
  </DlButton>
196
127
  </div>
@@ -225,36 +156,21 @@
225
156
  <h3>With badge</h3>
226
157
 
227
158
  <dl-button>
228
- <dl-badge
229
- with-border
230
- floating
231
- align="top"
232
- color="red"
233
- />
159
+ <dl-badge with-border floating align="top" color="red" />
234
160
  button with badge
235
161
  </dl-button>
236
162
  </div>
237
163
  <div>
238
164
  <h3>Button with label and slot</h3>
239
165
 
240
- <dl-button label="Hello">
241
- World
242
- </dl-button>
166
+ <dl-button label="Hello"> World </dl-button>
243
167
  </div>
244
168
  <div>
245
169
  <h3>Button with icon and slot</h3>
246
170
 
247
171
  <dl-button icon="icon-dl-search">
248
- <dl-icon
249
- size="16px"
250
- icon="icon-dl-cart"
251
- />
252
- <dl-badge
253
- with-border
254
- floating
255
- align="top"
256
- color="red"
257
- />
172
+ <dl-icon size="16px" icon="icon-dl-cart" />
173
+ <dl-badge with-border floating align="top" color="red" />
258
174
  </dl-button>
259
175
  </div>
260
176
  <div>
@@ -286,12 +202,7 @@
286
202
  </div>
287
203
  <div>
288
204
  <h3>Shaded and outlined</h3>
289
- <dl-button
290
- icon="icon-dl-search"
291
- label="test me"
292
- shaded
293
- outlined
294
- />
205
+ <dl-button icon="icon-dl-search" label="test me" shaded outlined />
295
206
  </div>
296
207
  <div style="display: flex; flex-direction: column">
297
208
  <h3>button with icon color</h3>
@@ -334,10 +245,7 @@
334
245
  </div>
335
246
  <div style="display: flex; flex-direction: column">
336
247
  <h3>button with tooltip</h3>
337
- <dl-button
338
- label="test me"
339
- tooltip="test me please"
340
- />
248
+ <dl-button label="test me" tooltip="test me please" />
341
249
  </div>
342
250
  <div style="display: flex; justify-content: center; margin-top: 50px">
343
251
  <dl-button
@@ -2,10 +2,7 @@
2
2
  <div style="width: 950px; padding-top: 20px">
3
3
  <div class="flex">
4
4
  <div>
5
- <dl-text-area
6
- v-model="message"
7
- title="Message"
8
- />
5
+ <dl-text-area v-model="message" title="Message" />
9
6
  <dl-input
10
7
  v-model="duration"
11
8
  type="number"
@@ -16,34 +13,15 @@
16
13
  type="number"
17
14
  title="Collapse count"
18
15
  />
19
- <dl-input
20
- v-model="width"
21
- title="Custom width for toast item"
22
- />
16
+ <dl-input v-model="width" title="Custom width for toast item" />
23
17
  </div>
24
18
  <div class="flex">
25
19
  <div>
26
20
  Type
27
- <dl-radio
28
- v-model="type"
29
- value="success"
30
- label="Success"
31
- />
32
- <dl-radio
33
- v-model="type"
34
- value="warning"
35
- label="Warning"
36
- />
37
- <dl-radio
38
- v-model="type"
39
- value="error"
40
- label="Error"
41
- />
42
- <dl-radio
43
- v-model="type"
44
- value="info"
45
- label="Info"
46
- />
21
+ <dl-radio v-model="type" value="success" label="Success" />
22
+ <dl-radio v-model="type" value="warning" label="Warning" />
23
+ <dl-radio v-model="type" value="error" label="Error" />
24
+ <dl-radio v-model="type" value="info" label="Info" />
47
25
  </div>
48
26
  <div>
49
27
  Position
@@ -62,11 +40,7 @@
62
40
  value="bottom-right"
63
41
  label="Bottom right"
64
42
  />
65
- <dl-radio
66
- v-model="position"
67
- value="top"
68
- label="Top"
69
- />
43
+ <dl-radio v-model="position" value="top" label="Top" />
70
44
  <dl-radio
71
45
  v-model="position"
72
46
  value="top-left"
@@ -79,32 +53,26 @@
79
53
  />
80
54
  </div>
81
55
  <div>
82
- <dl-switch
83
- v-model="closable"
84
- left-label="Closable"
85
- />
56
+ <dl-switch v-model="closable" left-label="Closable" />
86
57
  </div>
87
58
  </div>
88
59
  </div>
89
- <dl-button @click="showToastMessage">
90
- Show Toast Message
91
- </dl-button>
60
+ <dl-button @click="showToastMessage"> Show Toast Message </dl-button>
92
61
  <dl-button @click="showToastMessageCustom">
93
62
  Show Toast Message
94
63
  </dl-button>
95
- <dl-button @click="showToastMultiLine">
96
- Multi Line
97
- </dl-button>
64
+ <dl-button @click="showToastMultiLine"> Multi Line </dl-button>
98
65
  <div class="flex-row" style="margin-top: 8px">
99
- <dl-button @click="showToastWithLink">
100
- Toast with link
101
- </dl-button>
66
+ <dl-button @click="showToastWithLink"> Toast with link </dl-button>
102
67
  <dl-switch
103
68
  v-model="htmlEnabled"
104
69
  :left-label="htmlEnabled ? 'HTML true' : 'HTML false'"
105
70
  />
106
71
  </div>
107
- <dl-button @click="showToastWithTitleTextCaption" style="margin-top: 8px">
72
+ <dl-button
73
+ style="margin-top: 8px"
74
+ @click="showToastWithTitleTextCaption"
75
+ >
108
76
  Toast with Title + Text + Caption
109
77
  </dl-button>
110
78
  <dl-button style="margin-top: 8px" @click="showToastWithTwoActions">
@@ -239,7 +207,8 @@ export default defineComponent({
239
207
  function showToastWithTitleTextCaption() {
240
208
  DlToast.open({
241
209
  title: 'Toast Title',
242
- message: 'This is the main message text that appears in the toast.',
210
+ message:
211
+ 'This is the main message text that appears in the toast.',
243
212
  caption: 'This is the caption that appears below the message.',
244
213
  position: position.value as DlToastPositions,
245
214
  type: type.value as DlToastTypes,