@policystudio/policy-studio-ui-vue 1.1.90-access.7 → 1.1.90-access.9

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": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.90-access.07",
3
+ "version": "1.1.90-access.09",
4
4
  "description": "Policy Studio UI",
5
5
  "author": "Policy Studio Team",
6
6
  "scripts": {
@@ -70,7 +70,8 @@ const getComponentClass = computed(() => {
70
70
  })
71
71
 
72
72
  const instance = getCurrentInstance()
73
- const uniqueId = computed(() => `psui-switch-${instance.uid}`)
73
+ const uid = instance?.uid || Math.random().toString(36).slice(2)
74
+ const uniqueId = computed(() => `psui-switch-${uid}`)
74
75
 
75
76
  const change = () => {
76
77
  if (props.disabled) return
@@ -5,7 +5,7 @@
5
5
  >
6
6
  <label
7
7
  v-if="label"
8
- for="label"
8
+ :for="uniqueId"
9
9
  > {{ label }} </label>
10
10
 
11
11
  <div
@@ -26,7 +26,7 @@
26
26
  >
27
27
  <template #trigger>
28
28
  <input
29
- :name="label"
29
+ :id="uniqueId"
30
30
  :title="title"
31
31
  :type="type"
32
32
  :placeholder="placeholder"
@@ -75,7 +75,8 @@
75
75
 
76
76
  <script setup>
77
77
  import PsRichTooltip from '../tooltip/PsRichTooltip.vue'
78
- import { ref, computed, useAttrs } from 'vue'
78
+ import { ref, computed, useAttrs, getCurrentInstance } from 'vue'
79
+ import { useId } from 'vue'
79
80
 
80
81
  const props = defineProps({
81
82
  /**
@@ -194,6 +195,10 @@ const getComponentClass = computed(() => {
194
195
  }
195
196
  })
196
197
 
198
+ const instance = getCurrentInstance()
199
+ const uid = instance?.uid || Math.random().toString(36).slice(2)
200
+ const uniqueId = computed(() => `psui-input-${uid}`)
201
+
197
202
  const onInputFocus = ($event) => {
198
203
  isFocus.value = true
199
204
  emit('focus', $event)