@dataloop-ai/components 0.13.8 → 0.13.10

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.13.8",
3
+ "version": "0.13.10",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -13,7 +13,11 @@
13
13
  <div
14
14
  class="dialog-wrapper"
15
15
  :style="{ maxWidth: Number(width) ? `${width}px` : width }"
16
- :class="{ 'dialog-wrapper--fullscreen': fullscreen }"
16
+ :class="{
17
+ 'dialog-wrapper--fullscreen': fullscreen,
18
+ 'dialog-wrapper--right': right,
19
+ 'dialog-wrapper--left': left
20
+ }"
17
21
  >
18
22
  <div
19
23
  v-if="hasHeader"
@@ -51,6 +55,8 @@ export default defineComponent({
51
55
  props: {
52
56
  width: { type: [Number, String], default: 400 },
53
57
  fullscreen: Boolean,
58
+ right: Boolean,
59
+ left: Boolean,
54
60
  modelValue: Boolean,
55
61
  volatile: { type: Boolean, default: false }
56
62
  },
@@ -159,6 +165,14 @@ export default defineComponent({
159
165
  max-width: 100vw !important;
160
166
  border-radius: 0px;
161
167
  }
168
+ &--right {
169
+ position: absolute !important;
170
+ right: 0;
171
+ }
172
+ &--left {
173
+ position: absolute !important;
174
+ left: 0;
175
+ }
162
176
  }
163
177
 
164
178
  .header {
@@ -178,7 +192,7 @@ export default defineComponent({
178
192
 
179
193
  .footer {
180
194
  display: flex;
181
- padding: 20px 16px;
195
+ padding: 16px;
182
196
  border-top: 1px solid var(--dl-color-separator);
183
197
  }
184
198
 
@@ -10,11 +10,21 @@
10
10
  style="padding: 0; margin-bottom: 10px"
11
11
  @click.stop.prevent="$emit('onClose')"
12
12
  />
13
- <h2 class="title">
14
- {{ title }}
13
+ <h2
14
+ v-if="hasTitle"
15
+ class="title"
16
+ >
17
+ <slot name="title">
18
+ {{ title }}
19
+ </slot>
15
20
  </h2>
16
- <p class="subtitle">
17
- {{ subtitle }}
21
+ <p
22
+ v-if="hasSubtitle"
23
+ class="subtitle"
24
+ >
25
+ <slot name="subtitle">
26
+ {{ subtitle }}
27
+ </slot>
18
28
  </p>
19
29
  </div>
20
30
  <dl-button
@@ -30,7 +40,7 @@
30
40
  </template>
31
41
 
32
42
  <script lang="ts">
33
- import { defineComponent } from 'vue-demi'
43
+ import { computed, defineComponent } from 'vue-demi'
34
44
  import { DlButton } from '../DlButton'
35
45
 
36
46
  export default defineComponent({
@@ -44,7 +54,12 @@ export default defineComponent({
44
54
  closeButton: { type: Boolean, default: true },
45
55
  hasBackButton: Boolean
46
56
  },
47
- emits: ['onClose']
57
+ emits: ['onClose'],
58
+ setup(props, { slots }) {
59
+ const hasTitle = computed(() => !!props.title || !!slots.title)
60
+ const hasSubtitle = computed(() => !!props.subtitle || !!slots.subtitle)
61
+ return { hasTitle, hasSubtitle }
62
+ }
48
63
  })
49
64
  </script>
50
65
 
@@ -60,6 +75,7 @@ export default defineComponent({
60
75
  font-size: var(--dl-font-size-h2);
61
76
  margin: 0;
62
77
  color: var(--dl-color-darker);
78
+ line-height: 2rem !important;
63
79
  }
64
80
 
65
81
  .subtitle {
@@ -76,6 +76,7 @@
76
76
  class="select-search-input"
77
77
  :style="!isExpanded ? 'display: none;' : 'width: 100%;'"
78
78
  :disabled="disabled"
79
+ :readonly="readonly"
79
80
  @input="handleSearchInput"
80
81
  @focus="handleSearchFocus"
81
82
  @blur="handleSearchBlur"
@@ -139,7 +140,7 @@
139
140
  no-focus
140
141
  :offset="[0, 3]"
141
142
  style="border-radius: 0"
142
- :disabled="disabled"
143
+ :disabled="disabled || readonly"
143
144
  @show="onMenuOpen"
144
145
  @hide="closeMenu"
145
146
  >
@@ -309,6 +310,7 @@ export default defineComponent({
309
310
  errorMessage: { type: String, default: '' },
310
311
  error: { type: Boolean, default: false },
311
312
  disabled: { type: Boolean, default: false },
313
+ readonly: { type: Boolean, default: false },
312
314
  emitValue: { type: Boolean, default: false }, // We emit the value from the option and compare with it as a modelvalue
313
315
  options: {
314
316
  type: Array as PropType<SelectOptionType[]>,
@@ -497,6 +499,9 @@ export default defineComponent({
497
499
  if (this.disabled) {
498
500
  classes.push('dl_select__select--disabled')
499
501
  }
502
+ if (this.readonly) {
503
+ classes.push('dl_select__select--readonly')
504
+ }
500
505
  if (this.isExpanded) {
501
506
  classes.push('dl_select__select--focused')
502
507
  }
@@ -902,6 +907,18 @@ export default defineComponent({
902
907
  pointer-events: none;
903
908
  }
904
909
  }
910
+
911
+ &--readonly {
912
+ border-color: var(--dl-color-separator);
913
+ cursor: text;
914
+
915
+ &:hover {
916
+ border-color: var(--dl-color-separator);
917
+ }
918
+ & input {
919
+ pointer-events: none;
920
+ }
921
+ }
905
922
  }
906
923
 
907
924
  .selected {
@@ -51,6 +51,7 @@
51
51
  :maxlength="maxLength"
52
52
  :type="showPass ? 'text' : type"
53
53
  :disabled="disabled"
54
+ :readonly="readonly"
54
55
  @input="onChange"
55
56
  @focus="onFocus"
56
57
  @blur="debouncedBlur()"
@@ -283,6 +284,10 @@ export default defineComponent({
283
284
  type: Boolean,
284
285
  default: false
285
286
  },
287
+ readonly: {
288
+ type: Boolean,
289
+ default: false
290
+ },
286
291
  maxLength: {
287
292
  type: Number,
288
293
  default: null
@@ -412,6 +417,7 @@ export default defineComponent({
412
417
  !this.disableClearBtn &&
413
418
  this.type !== 'password' &&
414
419
  !this.disabled &&
420
+ !this.readonly &&
415
421
  !!this.modelValue
416
422
  // this.focused
417
423
  )
@@ -716,6 +722,13 @@ export default defineComponent({
716
722
  color: var(--dl-color-disabled);
717
723
  cursor: not-allowed;
718
724
  }
725
+ &:readonly {
726
+ border-color: var(--dl-color-separator);
727
+ cursor: text;
728
+ &:hover {
729
+ border-color: var(--dl-color-separator) !important;
730
+ }
731
+ }
719
732
  }
720
733
 
721
734
  &__adornment-container {