@community-release/nx-ui 0.0.53 → 0.0.55

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.53"
4
+ "version": "0.0.55"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="component-ui-file-input" :class="classes">
2
+ <div class="component-ui-file-input" :class="classes" :id="inputId">
3
3
 
4
4
  <!-- Input -->
5
5
  <div class="block-input">
@@ -81,7 +81,10 @@
81
81
  multiple: {
82
82
  type: Boolean,
83
83
  default: false,
84
- }
84
+ },
85
+ inputId: {
86
+ default: '',
87
+ },
85
88
  });
86
89
 
87
90
  const filesList = ref([]);
@@ -17,9 +17,18 @@
17
17
  :disabled="disabled"
18
18
  autocomplete="off"
19
19
  >
20
- <option v-for="option in options" :value="option.value" :key="option.value" :selected="option.value == modelValue">
21
- {{ option.name }}
22
- </option>
20
+ <template v-if="withGroups">
21
+ <optgroup v-for="group of options" :label="group.name">
22
+ <option v-for="option in group.items" :value="option.value" :key="option.value" :selected="option.value == modelValue">
23
+ {{ option.name }}
24
+ </option>
25
+ </optgroup>
26
+ </template>
27
+ <template v-else>
28
+ <option v-for="option in options" :value="option.value" :key="option.value" :selected="option.value == modelValue">
29
+ {{ option.name }}
30
+ </option>
31
+ </template>
23
32
  </select>
24
33
  </div>
25
34
  </div>
@@ -51,6 +60,10 @@ const props = defineProps({
51
60
  type: Array,
52
61
  default: () => []
53
62
  },
63
+ withGroups: {
64
+ type: Boolean,
65
+ default: false
66
+ },
54
67
  required: {
55
68
  type: Boolean,
56
69
  default: false
@@ -81,9 +94,23 @@ const valueName = computed(() => {
81
94
  let result = '...';
82
95
 
83
96
  const value = props.modelValue;
84
- const option = props.options.find(option => option.value == value);
97
+
98
+ // If it's options with groups
99
+ if (props.withGroups) {
100
+ for (let group of props.options) {
101
+ for (let o of group.items) {
102
+ if (o.value == value) {
103
+ return o.name;
104
+ }
105
+ }
106
+ }
107
+
108
+ // If it's flat options
109
+ } else {
110
+ let option = props.options.find(option => option.value == value);
85
111
 
86
- if (typeof option !== 'undefined') { result = option.name; }
112
+ if (typeof option !== 'undefined') result = option.name;
113
+ }
87
114
 
88
115
  return result;
89
116
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "packageManager": "pnpm@10.14.0",
5
5
  "description": "nx-ui - Nuxt UI library",
6
6
  "repository": {