|
17 | 17 | :theme="theme"
|
18 | 18 | :aria-label="option.alias || option.value"
|
19 | 19 | :active="modelValue.includes(option.value)"
|
20 |
| - :disabled="!input.multiple && modelValue.includes(option.value)" |
| 20 | + :disabled="readonly || (!input.multiple && modelValue.includes(option.value))" |
21 | 21 | @click="choose(option.value)"
|
22 | 22 | >
|
23 | 23 | <span>{{ option.alias || option.value }}</span>
|
|
40 | 40 | <InputFile
|
41 | 41 | v-else-if="!input.defaults && input.type === eFT.FILE"
|
42 | 42 | :theme="theme"
|
| 43 | + :disabled="readonly" |
43 | 44 | class="--flx"
|
44 | 45 | :min="input.min"
|
45 | 46 | :max="input.max"
|
|
48 | 49 | @update:model-value="$emit('update:model-value', $event)"
|
49 | 50 | />
|
50 | 51 | <!-- Future inner loop input -->
|
51 |
| - <FormInputLoop v-else v-slot="{ i }" :models="models" :input="input" :theme="theme"> |
| 52 | + <FormInputLoop |
| 53 | + v-else |
| 54 | + v-slot="{ i }" |
| 55 | + :models="models" |
| 56 | + :input="input" |
| 57 | + :theme="theme" |
| 58 | + :readonly="readonly" |
| 59 | + > |
52 | 60 | <div
|
53 | 61 | v-if="input.defaults && input.defaults.length >= 2"
|
54 | 62 | class="flx --flxColumn --flxRow-wrap:md --flx-start-stretch --flx"
|
|
71 | 79 | class="--width-180 --flx"
|
72 | 80 | :invalid="invalid"
|
73 | 81 | :model-value="[model]"
|
| 82 | + :disabled="readonly" |
74 | 83 | @update:model-value="
|
75 | 84 | models[i].value = models[i].value.toSpliced(index, 1, $event[0])
|
76 | 85 | "
|
|
85 | 94 | v-model="models[i].value[0]"
|
86 | 95 | v-bind="inputProps"
|
87 | 96 | :theme="theme"
|
| 97 | + :disabled="readonly" |
88 | 98 | :placeholder="getInputPlaceholder()"
|
89 | 99 | type="password"
|
90 | 100 | class="--width-180 --flx"
|
|
93 | 103 | v-model="models[i].value[1]"
|
94 | 104 | v-bind="inputProps"
|
95 | 105 | :theme="theme"
|
| 106 | + :disabled="readonly" |
96 | 107 | :placeholder="getInputPlaceholder()"
|
97 | 108 | type="password"
|
98 | 109 | class="--width-180 --flx"
|
|
106 | 117 | <SelectSimple
|
107 | 118 | v-model="models[i].value[0]"
|
108 | 119 | v-bind="{ options: input.options, theme }"
|
| 120 | + :disabled="readonly" |
109 | 121 | class="--width-180 --flx"
|
110 | 122 | />
|
111 | 123 | <InputText
|
112 | 124 | v-model="models[i].value[1]"
|
113 | 125 | v-bind="inputProps"
|
114 | 126 | :theme="theme"
|
| 127 | + :disabled="readonly" |
115 | 128 | :placeholder="getInputPlaceholder()"
|
116 | 129 | type="number"
|
117 | 130 | class="--width-180 --flx"
|
|
125 | 138 | <SelectSimple
|
126 | 139 | v-model="models[i].value[0]"
|
127 | 140 | :theme="theme"
|
| 141 | + :disabled="readonly" |
128 | 142 | :options="indicativesArr"
|
129 | 143 | class="--width-180 --flx"
|
130 | 144 | />
|
131 | 145 | <InputText
|
132 | 146 | v-model="models[i].value[1]"
|
133 | 147 | v-bind="inputProps"
|
134 | 148 | :theme="theme"
|
| 149 | + :disabled="readonly" |
135 | 150 | :placeholder="getInputPlaceholder()"
|
136 | 151 | type="tel"
|
137 | 152 | class="--width-180 --flx"
|
|
152 | 167 | :value="defaultCountry"
|
153 | 168 | icon="earth-americas"
|
154 | 169 | :theme="theme"
|
| 170 | + :disabled="readonly" |
155 | 171 | :placeholder="getInputPlaceholder()"
|
156 | 172 | class="--width-180 --flx"
|
157 | 173 | />
|
|
165 | 181 | name="state"
|
166 | 182 | icon="mountain-sun"
|
167 | 183 | :theme="theme"
|
168 |
| - :disabled="!(models[i].value[0] || defaultCountry)" |
| 184 | + :disabled="readonly || !(models[i].value[0] || defaultCountry)" |
169 | 185 | :placeholder="getInputPlaceholder(1)"
|
170 | 186 | class="--width-180 --flx"
|
171 | 187 | />
|
|
175 | 191 | name="city"
|
176 | 192 | icon="city"
|
177 | 193 | :theme="theme"
|
178 |
| - :disabled="!models[i].value[1]" |
| 194 | + :disabled="readonly || !models[i].value[1]" |
179 | 195 | :placeholder="getInputPlaceholder(2)"
|
180 | 196 | class="--width-180 --flx"
|
181 | 197 | />
|
|
198 | 214 | :placeholder="getInputPlaceholder()"
|
199 | 215 | type="checkbox"
|
200 | 216 | :theme="theme"
|
| 217 | + :disabled="readonly" |
201 | 218 | full-width
|
202 | 219 | show-placeholder
|
203 | 220 | >
|
|
216 | 233 | v-model="models[i].value"
|
217 | 234 | v-bind="inputProps"
|
218 | 235 | :theme="theme"
|
| 236 | + :disabled="readonly" |
219 | 237 | :placeholder="input.placeholder"
|
220 | 238 | :options="options"
|
221 | 239 | class="--flx"
|
|
230 | 248 | v-model="models[i].value"
|
231 | 249 | v-bind="inputProps"
|
232 | 250 | :theme="theme"
|
| 251 | + :disabled="readonly" |
233 | 252 | :placeholder="input.placeholder"
|
234 | 253 | :options="options"
|
235 | 254 | class="--flx"
|
|
240 | 259 | v-model="models[i].value"
|
241 | 260 | v-bind="inputProps"
|
242 | 261 | :theme="theme"
|
| 262 | + :disabled="readonly" |
243 | 263 | />
|
244 | 264 | <!-- Future outer loop input -->
|
245 | 265 | <InputText
|
|
252 | 272 | : { type: getInputTextType() }),
|
253 | 273 | }"
|
254 | 274 | :theme="theme"
|
| 275 | + :disabled="readonly" |
255 | 276 | :placeholder="getInputPlaceholder()"
|
256 | 277 | class="--flx"
|
257 | 278 | />
|
|
306 | 327 | invalid?: iInvalidInput;
|
307 | 328 | countries?: iCountry[];
|
308 | 329 | states?: iState[];
|
| 330 | + /** Make all inputs read only by disabling them */ |
| 331 | + readonly?: boolean; |
309 | 332 | }
|
310 | 333 |
|
311 | 334 | /**
|
|
0 commit comments