@dataloop-ai/components 0.19.21 → 0.19.23

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.19.21",
3
+ "version": "0.19.23",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -66,6 +66,7 @@
66
66
  :class="`${
67
67
  isSmall ? 'col' : 'row'
68
68
  } bottom-section full-width full-height`"
69
+ :style="{ cursor: disabled ? 'not-allowed' : '' }"
69
70
  >
70
71
  <div class="row center full-width full-height">
71
72
  <div :class="wrapperClasses">
@@ -80,7 +81,7 @@
80
81
  </div>
81
82
  <div
82
83
  ref="input"
83
- :contenteditable="!readonly"
84
+ :contenteditable="!readonly && !disabled"
84
85
  :class="inputClasses"
85
86
  :placeholder="placeholder"
86
87
  @input="onChange"
@@ -91,10 +92,11 @@
91
92
  @paste="handlePaste"
92
93
  >
93
94
  <span
94
- v-if="readonly"
95
- :class="
96
- showPlaceholder ? 'placeholder-string' : ''
97
- "
95
+ v-if="readonly || disabled"
96
+ :class="{
97
+ 'placeholder-string': showPlaceholder,
98
+ 'placeholder-string--disabled': disabled
99
+ }"
98
100
  >{{
99
101
  showPlaceholder ? placeholder : modelValue
100
102
  }}</span>
@@ -719,7 +721,9 @@ export default defineComponent({
719
721
  )
720
722
 
721
723
  onMounted(() => {
722
- input.value.innerHTML = modelValue.value
724
+ if (String(modelValue.value ?? '').length) {
725
+ input.value.innerHTML = modelValue.value
726
+ }
723
727
  })
724
728
 
725
729
  return {
@@ -816,6 +820,10 @@ export default defineComponent({
816
820
  classes.push('dl-input__input--password')
817
821
  }
818
822
 
823
+ if (this.disabled) {
824
+ classes.push('dl-input__input--disabled')
825
+ }
826
+
819
827
  return classes
820
828
  },
821
829
  asteriskClasses(): string[] {
@@ -1300,6 +1308,12 @@ export default defineComponent({
1300
1308
  border-color: var(--dl-color-separator) !important;
1301
1309
  }
1302
1310
  }
1311
+
1312
+ .placeholder-string--disabled,
1313
+ &--disabled {
1314
+ color: var(--dl-color-disabled);
1315
+ pointer-events: none;
1316
+ }
1303
1317
  }
1304
1318
 
1305
1319
  &__adornment-container {
@@ -17,7 +17,7 @@
17
17
  <slot />
18
18
  <span
19
19
  class="th-icons"
20
- :style="{ top: props?.dense ? '5px' : '10px' }"
20
+ :style="{ top: isDense ? '5px' : '10px' }"
21
21
  >
22
22
  <dl-icon
23
23
  v-if="hasHint"
@@ -87,6 +87,15 @@ export default defineComponent({
87
87
  return !!props.props?.col?.hint
88
88
  })
89
89
 
90
+ const isDense = computed(() => {
91
+ // @ts-ignore
92
+ return (
93
+ !!props.props?.dense ||
94
+ !!props.dense ||
95
+ !!props.props?.col?.dense
96
+ )
97
+ })
98
+
90
99
  const column = computed(() => {
91
100
  let col: any
92
101
  const name = vm.vnode.key as string
@@ -110,7 +119,8 @@ export default defineComponent({
110
119
  isSortable: false,
111
120
  hasEllipsis: false,
112
121
  onClick: onClickFn,
113
- hasHint
122
+ hasHint,
123
+ isDense
114
124
  }
115
125
  }
116
126
 
@@ -140,6 +150,7 @@ export default defineComponent({
140
150
 
141
151
  return {
142
152
  hasHint,
153
+ isDense,
143
154
  isSortable: !hasOptionalProps.value
144
155
  ? false
145
156
  : column?.value?.sortable ?? false,
@@ -5,6 +5,11 @@
5
5
  readonly
6
6
  />
7
7
 
8
+ <dl-input
9
+ placeholder="placeholder input disabled"
10
+ disabled
11
+ />
12
+
8
13
  <dl-input
9
14
  v-model="textInputValue"
10
15
  max-width="100%"