tide-design-system 2.0.32 → 2.0.33

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
@@ -52,5 +52,5 @@
52
52
  "main": "dist/tide-design-system.cjs",
53
53
  "module": "dist/tide-design-system.esm.js",
54
54
  "types": "dist/tide-design-system.esm.d.ts",
55
- "version": "2.0.32"
55
+ "version": "2.0.33"
56
56
  }
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, getCurrentInstance, ref, watch } from 'vue';
2
+ import { ref, watch } from 'vue';
3
3
 
4
4
  import TideIcon from '@/components/TideIcon.vue';
5
5
  import { CSS } from '@/types/Styles';
@@ -34,8 +34,6 @@
34
34
  const checked = ref(props.checked || props.indeterminate);
35
35
  const indeterminate = ref(props.indeterminate);
36
36
 
37
- const uniqueId = computed(() => (props.inputId ? props.inputId : `text-input-${getCurrentInstance()?.uid || ''}`));
38
-
39
37
  const handleClick = () => {
40
38
  checked.value = !checked.value;
41
39
  };
@@ -88,7 +86,7 @@
88
86
  :disabled="props.disabled"
89
87
  :name="props.name"
90
88
  ref="input"
91
- :id="uniqueId"
89
+ :id="props.inputId"
92
90
  type="checkbox"
93
91
  />
94
92
 
@@ -118,7 +116,7 @@
118
116
 
119
117
  <label
120
118
  :class="[CSS.DISPLAY.FLEX, CSS.GAP.HALF, disabled ? CSS.CURSOR.NOT_ALLOWED : CSS.CURSOR.POINTER]"
121
- :for="uniqueId"
119
+ :for="props.inputId"
122
120
  @click.prevent="checked = !checked"
123
121
  v-if="label"
124
122
  >
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, getCurrentInstance, ref, watch } from 'vue';
2
+ import { ref, watch } from 'vue';
3
3
 
4
4
  import { CSS } from '@/types/Styles';
5
5
 
@@ -22,8 +22,6 @@
22
22
 
23
23
  const checked = ref(props.checked);
24
24
 
25
- const uniqueId = computed(() => (props.inputId ? props.inputId : `text-input-${getCurrentInstance()?.uid || ''}`));
26
-
27
25
  watch(
28
26
  () => props.checked,
29
27
  (newValue, oldValue) => {
@@ -39,7 +37,7 @@
39
37
  <input
40
38
  :checked="checked"
41
39
  :class="[CSS.DISPLAY.NONE]"
42
- :id="uniqueId"
40
+ :id="props.inputId"
43
41
  name=""
44
42
  type="radio"
45
43
  value=""
@@ -63,7 +61,7 @@
63
61
 
64
62
  <label
65
63
  :class="CSS.FONT.WEIGHT.FOUR_HUNDRED"
66
- :for="uniqueId"
64
+ :for="props.inputId"
67
65
  >
68
66
  {{ props.label }}
69
67
  </label>
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { getCurrentInstance, computed, ref, watch } from 'vue';
2
+ import { computed, ref, watch } from 'vue';
3
3
 
4
4
  import type { SelectField } from '@/types/Field';
5
5
  import type { SelectOption, SelectOptionGroup } from '@/types/Select';
@@ -37,8 +37,6 @@
37
37
  const hasMinilabel = computed(() => hasFocus.value || !isEmpty.value);
38
38
  const isEmpty = computed(() => value.value === undefined);
39
39
 
40
- const uniqueId = computed(() => (props.inputId ? props.inputId : `text-input-${getCurrentInstance()?.uid || ''}`));
41
-
42
40
  const expandOptions = () => {
43
41
  const event = new MouseEvent('mousedown');
44
42
  input?.value?.dispatchEvent(event);
@@ -99,7 +97,7 @@
99
97
  !hasError && CSS.FONT.COLOR.SURFACE.VARIANT,
100
98
  CSS.FONT.WEIGHT.FIVE_HUNDRED,
101
99
  ]"
102
- :for="uniqueId"
100
+ :for="props.inputId"
103
101
  v-if="label"
104
102
  >
105
103
  {{ formattedLabel }}
@@ -113,7 +111,7 @@
113
111
  :required="required"
114
112
  @focus="handleFocus"
115
113
  @focusout="handleFocusOut"
116
- :id="uniqueId"
114
+ :id="props.inputId"
117
115
  v-model="value"
118
116
  >
119
117
  <template v-for="optgroup in props.optgroups">
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, getCurrentInstance, ref, watch } from 'vue';
2
+ import { computed, ref, watch } from 'vue';
3
3
 
4
4
  import type { FormValueTransformer } from '@/types/Form';
5
5
  import type { Icon } from '@/types/Icon';
@@ -71,7 +71,6 @@
71
71
  const type = computed(() =>
72
72
  props.type === TEXT_INPUT_TYPE.PASSWORD && showPassword.value === true ? TEXT_INPUT_TYPE.TEXT : props.type
73
73
  );
74
- const uniqueId = computed(() => (props.inputId ? props.inputId : `text-input-${getCurrentInstance()?.uid || ''}`));
75
74
 
76
75
  const handleClear = () => {
77
76
  value.value = '';
@@ -172,7 +171,7 @@
172
171
  CSS.FONT.WEIGHT.FIVE_HUNDRED,
173
172
  CSS.CURSOR.TEXT,
174
173
  ]"
175
- :for="uniqueId"
174
+ :for="props.inputId"
176
175
  v-if="label"
177
176
  >
178
177
  {{ formattedLabel }}
@@ -193,7 +192,7 @@
193
192
  @focus="handleFocus"
194
193
  @focusout="handleFocusOut"
195
194
  @input="handleInput"
196
- :id="uniqueId"
195
+ :id="props.inputId"
197
196
  v-model="value"
198
197
  />
199
198
  </div>
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, getCurrentInstance, ref, watch } from 'vue';
2
+ import { computed, ref, watch } from 'vue';
3
3
 
4
4
  import type { ValidationError } from '@/types/Validation';
5
5
 
@@ -47,7 +47,6 @@
47
47
  const hasError = computed(() => (props.required && !value.value) || getFieldHasError(error.value, props.error));
48
48
  const hasMinilabel = computed(() => hasFocus.value || !isEmpty.value);
49
49
  const isEmpty = computed(() => value.value === '');
50
- const uniqueId = computed(() => (props.inputId ? props.inputId : `text-input-${getCurrentInstance()?.uid || ''}`));
51
50
 
52
51
  const handleFocus = () => {
53
52
  hasFocus.value = true;
@@ -101,7 +100,7 @@
101
100
  CSS.FONT.WEIGHT.FIVE_HUNDRED,
102
101
  CSS.CURSOR.TEXT,
103
102
  ]"
104
- :for="uniqueId"
103
+ :for="props.inputId"
105
104
  ref="label"
106
105
  v-if="label"
107
106
  >
@@ -120,7 +119,7 @@
120
119
  @change="handleValidation"
121
120
  @focus="handleFocus"
122
121
  @focusout="handleFocusOut"
123
- :id="uniqueId"
122
+ :id="props.inputId"
124
123
  v-model="value"
125
124
  />
126
125
  </div>