@cloudron/pankow 3.5.0 → 3.5.1

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.
@@ -40,7 +40,6 @@ const internalId = uuidv4();
40
40
  display: inline-block;
41
41
  vertical-align: middle;
42
42
  cursor: pointer;
43
- user-select: none;
44
43
  margin: 0;
45
44
  margin-left: 6px;
46
45
  }
@@ -8,6 +8,10 @@ const props = defineProps({
8
8
  required: {
9
9
  type: Boolean,
10
10
  default: false,
11
+ },
12
+ multiline: {
13
+ type: Boolean,
14
+ default: false
11
15
  }
12
16
  });
13
17
 
@@ -24,7 +28,7 @@ const displayValue = computed({
24
28
  });
25
29
 
26
30
  const isValid = computed(() => {
27
- if (!props.required) return true;
31
+ if (!props.required) return false;
28
32
  if (model.value === null) return true; // treat masked as satisfying "required"
29
33
  return !!model.value;
30
34
  });
@@ -32,7 +36,8 @@ const isValid = computed(() => {
32
36
  </script>
33
37
 
34
38
  <template>
35
- <input class="pankow-masked-input" :value="displayValue" :required="isValid" @input="displayValue = $event.target.value" @focus="$event.target.select()" />
39
+ <input v-if="!multiline" class="pankow-masked-input" :value="displayValue" :required="isValid" @input="displayValue = $event.target.value" @focus="$event.target.select()" />
40
+ <textarea v-else :rows="rows" :cols="cols" :required="isValid" :value="displayValue" @input="displayValue = $event.target.value" @focus="$event.target.select()"></textarea>
36
41
  </template>
37
42
 
38
43
  <style>
@@ -149,6 +149,12 @@ onMounted(() => {
149
149
 
150
150
  <template>
151
151
  <div class="pankow-multiselect" :class="{ 'pankow-multiselect-disabled': disabled }" ref="elem" tabindex="0" @click="onClick" @keydown.enter="onOpen" @keydown.down.stop="onOpen" @keydown.up.stop="onOpen" @keydown.esc.stop="onClose">
152
+ <!-- native select for required and accessibility handling -->
153
+ <select v-model="selected" :required="$attrs['required']" style="display: none">
154
+ <option value=""></option>
155
+ <option v-for="item in options" :value="optionKey ? item[optionKey] : item">{{ optionKey }} - {{ item[optionLabel] }}</option>
156
+ </select>
157
+
152
158
  <Menu ref="menu" :model="menuModel" :close-on-activation="false" @close="onMenuClosed" :search-threshold="searchThreshold"></Menu>
153
159
  {{ buttonLabel }}
154
160
  <Icon icon="fa-solid fa-chevron-down" class="pankow-button-icon-right-with-text" />
@@ -53,7 +53,6 @@ export default {
53
53
  .pankow-radio-input-label {
54
54
  display: inline-block;
55
55
  cursor: pointer;
56
- user-select: none;
57
56
  margin: 0;
58
57
  margin-left: 6px;
59
58
  }
@@ -162,6 +162,12 @@ onMounted(() => {
162
162
 
163
163
  <template>
164
164
  <div class="pankow-singleselect" :class="{ 'pankow-singleselect-disabled': disabled }" ref="elem" tabindex="0" @click="onClick" @keydown.enter="onOpen" @keydown.down.stop.prevent="onSelectNext" @keydown.up.stop.prevent="onSelectPrev" @keydown.esc.stop="onClose" @keydown.stop="onKeyDown($event)">
165
+ <!-- native select for required and accessibility handling -->
166
+ <select v-model="selectedKey" :required="$attrs['required']" style="display: none">
167
+ <option value=""></option>
168
+ <option v-for="item in options" :value="optionKey ? item[optionKey] : item">{{ item[optionLabel] }}</option>
169
+ </select>
170
+
165
171
  <Menu ref="menu" :model="menuModel" :search-threshold="searchThreshold" :close-on-activation="true" @close="onMenuClosed"/>
166
172
  <span>
167
173
  <Icon v-if="selected ? selected.icon : false" :icon="selected.icon" style="margin-right: 6px" />
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudron/pankow",
3
3
  "private": false,
4
- "version": "3.5.0",
4
+ "version": "3.5.1",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "types": "types/index.d.ts",