@policystudio/policy-studio-ui-vue 1.2.0-access.61 → 1.2.0-access.63

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.2.0-access.61",
3
+ "version": "1.2.0-access.63",
4
4
  "description": "Policy Studio UI",
5
5
  "author": "Policy Studio Team",
6
6
  "scripts": {
@@ -4,13 +4,13 @@
4
4
  :class="[getComponentClass, { selected: selectedClass }, { disabled: disabled }]"
5
5
  >
6
6
  <label
7
- :for="label"
7
+ :for="selectedId"
8
8
  v-if="label"
9
9
  >{{ label }}</label>
10
10
  <div class="psui-el-input-select-wrapper">
11
11
  <select
12
12
  :name="label"
13
- :id="label"
13
+ :id="selectedId"
14
14
  v-model="childValue"
15
15
  >
16
16
  <option
@@ -100,6 +100,10 @@ const getComponentClass = computed(() => {
100
100
  return `layout-${props.layout}`
101
101
  })
102
102
 
103
+ const selectedId = computed(() => {
104
+ return this.label ? this.label.toLowerCase().replace(/\s+/g, '-') : `select-${Math.random().toString(36).substr(2, 9)}`
105
+ })
106
+
103
107
  const childValue = computed({
104
108
  get() {
105
109
  return props.value
@@ -102,7 +102,7 @@ const getComponentClass = computed(() => {
102
102
 
103
103
  onMounted(() => {
104
104
  document.addEventListener('resize', updatePosition)
105
- document.addEventListener('keydown', handleKeyDown)
105
+
106
106
  })
107
107
 
108
108
  onBeforeUnmount(() => {
@@ -114,6 +114,9 @@ const open = () => {
114
114
  if (show.value || props.ignoreDialog) return
115
115
  emit('show')
116
116
  show.value = true
117
+
118
+ document.addEventListener('keydown', handleKeyDown)
119
+
117
120
  const dialog = PsTooltipDialog.value
118
121
  dialog.style.display = 'block'
119
122
  dialog.style.opacity = 0
@@ -128,6 +131,8 @@ const close = () => {
128
131
  emit('close')
129
132
  show.value = false
130
133
  dialog.style.display = 'none'
134
+
135
+ document.removeEventListener('keydown', handleKeyDown)
131
136
  }
132
137
  }
133
138