design-system-next 2.15.7 → 2.16.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.
@@ -48,12 +48,19 @@
48
48
  </template>
49
49
  </div>
50
50
  <div :class="multiSelectClasses.chippedIconClasses">
51
- <div class="spr-flex spr-items-center spr-gap-1">
51
+ <div
52
+ :class="[
53
+ 'spr-flex spr-items-center spr-gap-1',
54
+ {
55
+ 'spr-cursor-pointer': !props.disabled,
56
+ 'spr-cursor-not-allowed': props.disabled,
57
+ },
58
+ ]"
59
+ >
52
60
  <Icon
53
61
  v-if="props.clearable && inputText"
54
- class="spr-cursor-pointer"
55
62
  icon="ph:x"
56
- @click.stop="handleClear"
63
+ @click.stop="!props.disabled ? handleClear : null"
57
64
  />
58
65
  <Icon icon="ph:caret-down" />
59
66
  </div>
@@ -91,13 +98,16 @@
91
98
  :error="props.error"
92
99
  >
93
100
  <template #icon>
94
- <div class="spr-flex spr-items-center spr-gap-1">
95
- <Icon
96
- v-if="props.clearable && inputText"
97
- class="spr-cursor-pointer"
98
- icon="ph:x"
99
- @click.stop="handleClear"
100
- />
101
+ <div
102
+ :class="[
103
+ 'spr-flex spr-items-center spr-gap-1',
104
+ {
105
+ 'spr-cursor-pointer': !props.disabled,
106
+ 'spr-cursor-not-allowed': props.disabled,
107
+ },
108
+ ]"
109
+ >
110
+ <Icon v-if="props.clearable && inputText" icon="ph:x" @click.stop="handleClear" />
101
111
  <Icon icon="ph:caret-down" />
102
112
  </div>
103
113
  </template>
@@ -316,11 +316,13 @@ export const useMultiSelect = (props: MultiSelectPropTypes, emit: SetupContext<M
316
316
  * Clears the selection and input text, and closes the multi-select.
317
317
  */
318
318
  const handleClear = () => {
319
- emit('update:modelValue', []);
319
+ if (disabled.value) return;
320
320
 
321
321
  multiSelectedListItems.value = [];
322
322
  inputText.value = '';
323
323
  multiSelectPopperState.value = false;
324
+
325
+ emit('update:modelValue', []);
324
326
  };
325
327
 
326
328
  watch(multiSelectModel, () => {
@@ -47,13 +47,16 @@
47
47
  @click="props.searchable ? (selectPopperState = true) : null"
48
48
  >
49
49
  <template #icon>
50
- <div class="spr-flex spr-cursor-pointer spr-items-center">
51
- <Icon
52
- v-if="props.clearable && inputText"
53
- class="spr-cursor-pointer"
54
- icon="ph:x"
55
- @click.stop="handleClear"
56
- />
50
+ <div
51
+ :class="[
52
+ 'spr-flex spr-items-center spr-gap-1',
53
+ {
54
+ 'spr-cursor-pointer': !props.disabled,
55
+ 'spr-cursor-not-allowed': props.disabled,
56
+ },
57
+ ]"
58
+ >
59
+ <Icon v-if="props.clearable && inputText" icon="ph:x" @click.stop="handleClear" />
57
60
  <Icon icon="ph:caret-down" />
58
61
  </div>
59
62
  </template>
@@ -301,10 +301,12 @@ export const useSelect = (props: SelectPropTypes, emit: SetupContext<SelectEmitT
301
301
  };
302
302
 
303
303
  const handleClear = () => {
304
- emit('update:modelValue', '');
305
- emit('search-string', '');
304
+ if (disabled.value) return;
306
305
 
307
306
  inputText.value = '';
307
+
308
+ emit('update:modelValue', '');
309
+ emit('search-string', '');
308
310
  };
309
311
 
310
312
  watch(selectModel, () => {