@xenknight/framework7-vue 0.0.2

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.
Files changed (199) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +33 -0
  3. package/components/accordion-content.d.ts +46 -0
  4. package/components/accordion-content.js +22 -0
  5. package/components/accordion-item.d.ts +51 -0
  6. package/components/accordion-item.js +77 -0
  7. package/components/accordion-toggle.d.ts +46 -0
  8. package/components/accordion-toggle.js +22 -0
  9. package/components/accordion.d.ts +50 -0
  10. package/components/accordion.js +23 -0
  11. package/components/actions-button.d.ts +56 -0
  12. package/components/actions-button.js +58 -0
  13. package/components/actions-group.d.ts +46 -0
  14. package/components/actions-group.js +22 -0
  15. package/components/actions-label.d.ts +51 -0
  16. package/components/actions-label.js +36 -0
  17. package/components/actions.d.ts +109 -0
  18. package/components/actions.js +157 -0
  19. package/components/app.d.ts +310 -0
  20. package/components/app.js +267 -0
  21. package/components/area-chart.d.ts +88 -0
  22. package/components/area-chart.js +364 -0
  23. package/components/badge.d.ts +54 -0
  24. package/components/badge.js +29 -0
  25. package/components/block-footer.d.ts +46 -0
  26. package/components/block-footer.js +22 -0
  27. package/components/block-header.d.ts +46 -0
  28. package/components/block-header.js +22 -0
  29. package/components/block-title.d.ts +54 -0
  30. package/components/block-title.js +35 -0
  31. package/components/block.d.ts +163 -0
  32. package/components/block.js +123 -0
  33. package/components/breadcrumbs-collapsed.d.ts +19 -0
  34. package/components/breadcrumbs-collapsed.js +21 -0
  35. package/components/breadcrumbs-item.d.ts +22 -0
  36. package/components/breadcrumbs-item.js +24 -0
  37. package/components/breadcrumbs-separator.d.ts +19 -0
  38. package/components/breadcrumbs-separator.js +20 -0
  39. package/components/breadcrumbs.d.ts +19 -0
  40. package/components/breadcrumbs.js +20 -0
  41. package/components/button.d.ts +371 -0
  42. package/components/button.js +182 -0
  43. package/components/card-content.d.ts +51 -0
  44. package/components/card-content.js +28 -0
  45. package/components/card-footer.d.ts +46 -0
  46. package/components/card-footer.js +22 -0
  47. package/components/card-header.d.ts +46 -0
  48. package/components/card-header.js +22 -0
  49. package/components/card.d.ts +145 -0
  50. package/components/card.js +192 -0
  51. package/components/checkbox.d.ts +72 -0
  52. package/components/checkbox.js +70 -0
  53. package/components/chip.d.ts +107 -0
  54. package/components/chip.js +81 -0
  55. package/components/fab-backdrop.d.ts +46 -0
  56. package/components/fab-backdrop.js +22 -0
  57. package/components/fab-button.d.ts +67 -0
  58. package/components/fab-button.js +52 -0
  59. package/components/fab-buttons.d.ts +51 -0
  60. package/components/fab-buttons.js +26 -0
  61. package/components/fab.d.ts +76 -0
  62. package/components/fab.js +78 -0
  63. package/components/gauge.d.ts +91 -0
  64. package/components/gauge.js +151 -0
  65. package/components/icon.d.ts +78 -0
  66. package/components/icon.js +100 -0
  67. package/components/input.d.ts +226 -0
  68. package/components/input.js +409 -0
  69. package/components/link.d.ts +287 -0
  70. package/components/link.js +129 -0
  71. package/components/list-button.d.ts +239 -0
  72. package/components/list-button.js +71 -0
  73. package/components/list-group.d.ts +71 -0
  74. package/components/list-group.js +53 -0
  75. package/components/list-index.d.ts +81 -0
  76. package/components/list-index.js +96 -0
  77. package/components/list-input.d.ts +245 -0
  78. package/components/list-input.js +415 -0
  79. package/components/list-item.d.ts +370 -0
  80. package/components/list-item.js +451 -0
  81. package/components/list.d.ts +236 -0
  82. package/components/list.js +222 -0
  83. package/components/login-screen-title.d.ts +46 -0
  84. package/components/login-screen-title.js +22 -0
  85. package/components/login-screen.d.ts +61 -0
  86. package/components/login-screen.js +104 -0
  87. package/components/message.d.ts +116 -0
  88. package/components/message.js +169 -0
  89. package/components/messagebar-attachment.d.ts +56 -0
  90. package/components/messagebar-attachment.js +52 -0
  91. package/components/messagebar-attachments.d.ts +46 -0
  92. package/components/messagebar-attachments.js +22 -0
  93. package/components/messagebar-sheet-image.d.ts +55 -0
  94. package/components/messagebar-sheet-image.js +48 -0
  95. package/components/messagebar-sheet-item.d.ts +46 -0
  96. package/components/messagebar-sheet-item.js +22 -0
  97. package/components/messagebar-sheet.d.ts +46 -0
  98. package/components/messagebar-sheet.js +22 -0
  99. package/components/messagebar.d.ts +117 -0
  100. package/components/messagebar.js +193 -0
  101. package/components/messages-title.d.ts +46 -0
  102. package/components/messages-title.js +22 -0
  103. package/components/messages.d.ts +116 -0
  104. package/components/messages.js +134 -0
  105. package/components/nav-left.d.ts +68 -0
  106. package/components/nav-left.js +66 -0
  107. package/components/nav-right.d.ts +50 -0
  108. package/components/nav-right.js +25 -0
  109. package/components/nav-title-large.d.ts +46 -0
  110. package/components/nav-title-large.js +25 -0
  111. package/components/nav-title.d.ts +58 -0
  112. package/components/nav-title.js +31 -0
  113. package/components/navbar.d.ts +110 -0
  114. package/components/navbar.js +248 -0
  115. package/components/page-content.d.ts +113 -0
  116. package/components/page-content.js +147 -0
  117. package/components/page.d.ts +150 -0
  118. package/components/page.js +331 -0
  119. package/components/panel.d.ts +139 -0
  120. package/components/panel.js +198 -0
  121. package/components/photo-browser.d.ts +164 -0
  122. package/components/photo-browser.js +181 -0
  123. package/components/pie-chart.d.ts +37 -0
  124. package/components/pie-chart.js +172 -0
  125. package/components/popover.d.ts +101 -0
  126. package/components/popover.js +157 -0
  127. package/components/popup.d.ts +99 -0
  128. package/components/popup.js +161 -0
  129. package/components/preloader.d.ts +50 -0
  130. package/components/preloader.js +65 -0
  131. package/components/progressbar.d.ts +54 -0
  132. package/components/progressbar.js +44 -0
  133. package/components/radio.d.ts +68 -0
  134. package/components/radio.js +59 -0
  135. package/components/range.d.ts +141 -0
  136. package/components/range.js +139 -0
  137. package/components/routable-modals.d.ts +19 -0
  138. package/components/routable-modals.js +58 -0
  139. package/components/searchbar.d.ts +182 -0
  140. package/components/searchbar.js +285 -0
  141. package/components/segmented.d.ts +87 -0
  142. package/components/segmented.js +53 -0
  143. package/components/sheet.d.ts +132 -0
  144. package/components/sheet.js +213 -0
  145. package/components/skeleton-avatar.d.ts +6 -0
  146. package/components/skeleton-avatar.js +3 -0
  147. package/components/skeleton-block.d.ts +6 -0
  148. package/components/skeleton-block.js +3 -0
  149. package/components/skeleton-image.d.ts +6 -0
  150. package/components/skeleton-image.js +3 -0
  151. package/components/skeleton-text.d.ts +6 -0
  152. package/components/skeleton-text.js +3 -0
  153. package/components/stepper.d.ts +197 -0
  154. package/components/stepper.js +230 -0
  155. package/components/subnavbar.d.ts +59 -0
  156. package/components/subnavbar.js +40 -0
  157. package/components/swipeout-actions.d.ts +58 -0
  158. package/components/swipeout-actions.js +33 -0
  159. package/components/swipeout-button.d.ts +75 -0
  160. package/components/swipeout-button.js +48 -0
  161. package/components/tab.d.ts +51 -0
  162. package/components/tab.js +128 -0
  163. package/components/tabs.d.ts +63 -0
  164. package/components/tabs.js +59 -0
  165. package/components/text-editor.d.ts +95 -0
  166. package/components/text-editor.js +147 -0
  167. package/components/toggle.d.ts +80 -0
  168. package/components/toggle.js +89 -0
  169. package/components/toolbar.d.ts +108 -0
  170. package/components/toolbar.js +135 -0
  171. package/components/treeview-item.d.ts +265 -0
  172. package/components/treeview-item.js +140 -0
  173. package/components/treeview.d.ts +46 -0
  174. package/components/treeview.js +22 -0
  175. package/components/use-icon.d.ts +19 -0
  176. package/components/use-icon.js +27 -0
  177. package/components/view.d.ts +296 -0
  178. package/components/view.js +373 -0
  179. package/components/views.d.ts +50 -0
  180. package/components/views.js +25 -0
  181. package/framework7-vue-bundle.js +190 -0
  182. package/framework7-vue.d.ts +121 -0
  183. package/framework7-vue.js +108 -0
  184. package/package.json +65 -0
  185. package/shared/components-router.js +203 -0
  186. package/shared/f7.js +71 -0
  187. package/shared/get-router-initial-component.js +35 -0
  188. package/shared/mixins.js +233 -0
  189. package/shared/modal-state-classes.js +10 -0
  190. package/shared/plugin.js +37 -0
  191. package/shared/router-open-in.js +105 -0
  192. package/shared/use-icon.js +37 -0
  193. package/shared/use-route-props.js +18 -0
  194. package/shared/use-smart-select.js +24 -0
  195. package/shared/use-store.js +24 -0
  196. package/shared/use-tab.js +24 -0
  197. package/shared/use-theme.js +11 -0
  198. package/shared/use-tooltip.js +43 -0
  199. package/shared/utils.js +110 -0
@@ -0,0 +1,415 @@
1
+ import { computed, h, ref, onMounted, onBeforeUnmount, watch, inject, onUpdated } from 'vue';
2
+ import { classNames, extend, noUndefinedProps } from '../shared/utils.js';
3
+ import { colorClasses, colorProps } from '../shared/mixins.js';
4
+ import { f7ready, f7 } from '../shared/f7.js';
5
+ import f7TextEditor from './text-editor.js';
6
+ export default {
7
+ name: 'f7-list-input',
8
+ props: {
9
+ sortable: {
10
+ type: Boolean,
11
+ default: undefined
12
+ },
13
+ media: String,
14
+ dropdown: {
15
+ type: [String, Boolean],
16
+ default: 'auto'
17
+ },
18
+ wrap: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ // Inputs
23
+ input: {
24
+ type: Boolean,
25
+ default: true
26
+ },
27
+ type: {
28
+ type: String,
29
+ default: 'text'
30
+ },
31
+ name: String,
32
+ value: {
33
+ type: [String, Number, Array, Date, Object],
34
+ default: undefined
35
+ },
36
+ inputmode: String,
37
+ readonly: Boolean,
38
+ required: Boolean,
39
+ disabled: Boolean,
40
+ placeholder: String,
41
+ inputId: [String, Number],
42
+ size: [String, Number],
43
+ accept: [String, Number],
44
+ autocomplete: [String],
45
+ autocorrect: [String],
46
+ autocapitalize: [String],
47
+ spellcheck: [String],
48
+ autofocus: Boolean,
49
+ autosave: String,
50
+ max: [String, Number],
51
+ min: [String, Number],
52
+ step: [String, Number],
53
+ maxlength: [String, Number],
54
+ minlength: [String, Number],
55
+ multiple: Boolean,
56
+ inputStyle: [String, Object],
57
+ pattern: String,
58
+ validate: [Boolean, String],
59
+ validateOnBlur: Boolean,
60
+ onValidate: Function,
61
+ tabindex: [String, Number],
62
+ resizable: Boolean,
63
+ clearButton: Boolean,
64
+ // Form
65
+ noFormStoreData: Boolean,
66
+ noStoreData: Boolean,
67
+ ignoreStoreData: Boolean,
68
+ // Error, Info
69
+ errorMessage: String,
70
+ errorMessageForce: Boolean,
71
+ info: String,
72
+ // Outline
73
+ outline: Boolean,
74
+ // Label
75
+ label: [String, Number],
76
+ floatingLabel: Boolean,
77
+ // Datepicker
78
+ calendarParams: Object,
79
+ // Colorpicker
80
+ colorPickerParams: Object,
81
+ // Text editor
82
+ textEditorParams: Object,
83
+ ...colorProps
84
+ },
85
+ emits: ['textarea:resize', 'input:notempty', 'input:empty', 'input:clear', 'texteditor:change', 'calendar:change', 'colorpicker:change', 'change', 'focus', 'blur', 'input', 'update:value'],
86
+ setup(props, _ref) {
87
+ let {
88
+ emit,
89
+ slots
90
+ } = _ref;
91
+ const inputInvalid = ref(false);
92
+ const inputFocused = ref(false);
93
+ const ListContext = inject('ListContext', {
94
+ value: {
95
+ listIsMedia: false,
96
+ listIsSortable: false,
97
+ listIsSortableOpposite: false,
98
+ listIsSimple: false
99
+ }
100
+ });
101
+ let f7Calendar = null;
102
+ let f7ColorPicker = null;
103
+ const elRef = ref(null);
104
+ const inputElRef = ref(null);
105
+ const itemContentElRef = ref(null);
106
+ let updateInputOnDidUpdate = false;
107
+ const getDomValue = () => {
108
+ if (!inputElRef.value) return undefined;
109
+ return inputElRef.value.value;
110
+ };
111
+ const domValue = ref(getDomValue());
112
+ const inputHasValue = computed(() => {
113
+ if (props.type === 'datepicker' && Array.isArray(props.value) && props.value.length === 0) {
114
+ return false;
115
+ }
116
+ return typeof props.value === 'undefined' ? domValue.value || domValue.value === 0 : props.value || props.value === 0;
117
+ });
118
+ const validateInput = () => {
119
+ if (!f7 || !inputElRef.value) return;
120
+ const validity = inputElRef.value.validity;
121
+ if (!validity) return;
122
+ if (!validity.valid) {
123
+ if (props.onValidate) props.onValidate(false);
124
+ if (inputInvalid.value !== true) {
125
+ inputInvalid.value = true;
126
+ }
127
+ } else {
128
+ if (props.onValidate) props.onValidate(true);
129
+ if (inputInvalid.value !== false) {
130
+ inputInvalid.value = false;
131
+ }
132
+ }
133
+ };
134
+ const onTextareaResize = event => {
135
+ emit('textarea:resize', event);
136
+ };
137
+ const onInputNotEmpty = event => {
138
+ emit('input:notempty', event);
139
+ };
140
+ const onInputEmpty = event => {
141
+ emit('input:empty', event);
142
+ };
143
+ const onInputClear = event => {
144
+ emit('input:clear', event);
145
+ };
146
+ const onInput = function () {
147
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
148
+ args[_key] = arguments[_key];
149
+ }
150
+ emit('input', ...args);
151
+ if (inputElRef.value) {
152
+ domValue.value = inputElRef.value.value;
153
+ }
154
+ if (!(props.validateOnBlur || props.validateOnBlur === '') && (props.validate || props.validate === '') && inputElRef.value) {
155
+ validateInput(inputElRef.value);
156
+ }
157
+ if (inputElRef.value && props.type !== 'texteditor' && props.type !== 'colorpicker' && props.type !== 'datepicker') {
158
+ emit('update:value', inputElRef.value.value);
159
+ }
160
+ };
161
+ const onFocus = function () {
162
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
163
+ args[_key2] = arguments[_key2];
164
+ }
165
+ emit('focus', ...args);
166
+ inputFocused.value = true;
167
+ };
168
+ const onBlur = function () {
169
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
170
+ args[_key3] = arguments[_key3];
171
+ }
172
+ emit('blur', ...args);
173
+ if ((props.validate || props.validate === '' || props.validateOnBlur || props.validateOnBlur === '') && inputElRef.value) {
174
+ validateInput(inputElRef.value);
175
+ }
176
+ inputFocused.value = false;
177
+ };
178
+ const onChange = function () {
179
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
180
+ args[_key4] = arguments[_key4];
181
+ }
182
+ emit('change', ...args);
183
+ if (props.type === 'texteditor') {
184
+ emit('texteditor:change', args[0]);
185
+ emit('update:value', args[0]);
186
+ }
187
+ };
188
+ onMounted(() => {
189
+ if (!elRef.value && !itemContentElRef.value) return;
190
+ f7ready(() => {
191
+ if (!inputElRef.value) return;
192
+ inputElRef.value.addEventListener('input:notempty', onInputNotEmpty, false);
193
+ inputElRef.value.addEventListener('textarea:resize', onTextareaResize, false);
194
+ inputElRef.value.addEventListener('input:empty', onInputEmpty, false);
195
+ inputElRef.value.addEventListener('input:clear', onInputClear, false);
196
+ if (props.type === 'datepicker') {
197
+ f7Calendar = f7.calendar.create({
198
+ inputEl: inputElRef.value,
199
+ value: props.value,
200
+ on: {
201
+ change(calendar, calendarValue) {
202
+ emit('update:value', calendarValue);
203
+ emit('calendar:change', calendarValue);
204
+ }
205
+ },
206
+ ...(props.calendarParams || {})
207
+ });
208
+ }
209
+ if (props.type === 'colorpicker') {
210
+ f7ColorPicker = f7.colorPicker.create({
211
+ inputEl: inputElRef.value,
212
+ value: props.value,
213
+ on: {
214
+ change(colorPicker, colorPickerValue) {
215
+ emit('update:value', colorPickerValue);
216
+ emit('colorpicker:change', colorPickerValue);
217
+ }
218
+ },
219
+ ...(props.colorPickerParams || {})
220
+ });
221
+ }
222
+ if (!(props.validateOnBlur || props.validateOnBlur === '') && (props.validate || props.validate === '') && typeof props.value !== 'undefined' && props.value !== null && props.value !== '') {
223
+ setTimeout(() => {
224
+ validateInput();
225
+ }, 0);
226
+ }
227
+ if (props.type === 'textarea' && props.resizable) {
228
+ f7.input.resizeTextarea(inputElRef.value);
229
+ }
230
+ });
231
+ });
232
+ onBeforeUnmount(() => {
233
+ if (inputElRef.value) {
234
+ inputElRef.value.removeEventListener('input:notempty', onInputNotEmpty, false);
235
+ inputElRef.value.removeEventListener('textarea:resize', onTextareaResize, false);
236
+ inputElRef.value.removeEventListener('input:empty', onInputEmpty, false);
237
+ inputElRef.value.removeEventListener('input:clear', onInputClear, false);
238
+ }
239
+ if (f7Calendar && f7Calendar.destroy) {
240
+ f7Calendar.destroy();
241
+ f7Calendar = null;
242
+ }
243
+ if (f7ColorPicker && f7ColorPicker.destroy) {
244
+ f7ColorPicker.destroy();
245
+ f7ColorPicker = null;
246
+ }
247
+ });
248
+ onUpdated(() => {
249
+ if (!f7) return;
250
+ if (updateInputOnDidUpdate) {
251
+ if (!inputElRef.value) return;
252
+ updateInputOnDidUpdate = false;
253
+ if (props.validate && !props.validateOnBlur) {
254
+ validateInput();
255
+ }
256
+ if (props.type === 'textarea' && props.resizable) {
257
+ f7.input.resizeTextarea(inputElRef.value);
258
+ }
259
+ }
260
+ });
261
+ watch(() => props.colorPickerParams, newValue => {
262
+ if (!f7 || !f7ColorPicker) return;
263
+ extend(f7ColorPicker.params, newValue || {});
264
+ });
265
+ watch(() => props.calendarParams, newValue => {
266
+ if (!f7 || !f7Calendar) return;
267
+ extend(f7Calendar.params, newValue || {});
268
+ });
269
+ watch(() => props.value, newValue => {
270
+ if (!f7) return;
271
+ updateInputOnDidUpdate = true;
272
+ if (f7Calendar) {
273
+ f7Calendar.setValue(newValue);
274
+ }
275
+ if (f7ColorPicker) {
276
+ f7ColorPicker.setValue(newValue);
277
+ }
278
+ });
279
+ const isSortableComputed = computed(() => props.sortable === true || props.sortable === false ? props.sortable : ListContext.value.listIsSortable || false);
280
+ const createInput = (InputTag, children) => {
281
+ const needsValue = props.type !== 'file' && props.type !== 'datepicker' && props.type !== 'colorpicker';
282
+ const needsType = InputTag === 'input';
283
+ let inputType = props.type;
284
+ if (inputType === 'datepicker' || inputType === 'colorpicker') {
285
+ inputType = 'text';
286
+ }
287
+ const inputClassName = classNames({
288
+ resizable: inputType === 'textarea' && props.resizable,
289
+ 'no-store-data': props.noFormStoreData || props.noStoreData || props.ignoreStoreData,
290
+ 'input-invalid': props.errorMessage && props.errorMessageForce || inputInvalid.value,
291
+ 'input-with-value': inputHasValue.value,
292
+ 'input-focused': inputFocused.value
293
+ });
294
+ let inputValue;
295
+ if (needsValue) {
296
+ if (typeof props.value !== 'undefined') inputValue = props.value;else inputValue = domValue.value;
297
+ }
298
+ const valueProps = {};
299
+ if (props.type !== 'datepicker' && props.type !== 'colorpicker') {
300
+ if ('value' in props) valueProps.value = inputValue;
301
+ }
302
+ const inputProps = noUndefinedProps({
303
+ name: props.name,
304
+ type: needsType ? inputType : undefined,
305
+ placeholder: props.placeholder,
306
+ inputmode: props.inputmode,
307
+ id: props.inputId,
308
+ size: props.size,
309
+ accept: props.accept,
310
+ autocomplete: props.autocomplete,
311
+ autocorrect: props.autocorrect,
312
+ autocapitalize: props.autocapitalize,
313
+ spellcheck: props.spellcheck,
314
+ autofocus: props.autofocus,
315
+ autosave: props.autosave,
316
+ disabled: props.disabled,
317
+ max: props.max,
318
+ maxlength: props.maxlength,
319
+ min: props.min,
320
+ minlength: props.minlength,
321
+ step: props.step,
322
+ multiple: props.multiple,
323
+ readonly: props.readonly,
324
+ required: props.required,
325
+ pattern: props.pattern,
326
+ validate: typeof props.validate === 'string' && props.validate.length ? props.validate : undefined,
327
+ tabindex: props.tabindex
328
+ });
329
+ return h(InputTag, {
330
+ ref: inputElRef,
331
+ style: props.inputStyle,
332
+ ...inputProps,
333
+ 'data-validate': props.validate === true || props.validate === '' || props.validateOnBlur === true || props.validateOnBlur === '' ? true : undefined,
334
+ 'data-validate-on-blur': props.validateOnBlur === true || props.validateOnBlur === '' ? true : undefined,
335
+ 'data-error-message': props.errorMessageForce ? undefined : props.errorMessage,
336
+ class: inputClassName,
337
+ onFocus,
338
+ onBlur,
339
+ onInput,
340
+ onChange,
341
+ ...valueProps
342
+ }, [children]);
343
+ };
344
+ return () => {
345
+ let inputEl;
346
+ if (props.input) {
347
+ if (props.type === 'select' || props.type === 'textarea' || props.type === 'file') {
348
+ if (props.type === 'select') {
349
+ inputEl = createInput('select', slots.default && slots.default());
350
+ } else if (props.type === 'file') {
351
+ inputEl = createInput('input');
352
+ } else {
353
+ inputEl = createInput('textarea');
354
+ }
355
+ } else if (props.type === 'texteditor') {
356
+ inputEl = h(f7TextEditor, {
357
+ value: props.value,
358
+ resizable: props.resizable,
359
+ placeholder: props.placeholder,
360
+ onTexteditorFocus: onFocus,
361
+ onTexteditorBlur: onBlur,
362
+ onTexteditorInput: onInput,
363
+ onTexteditorChange: onChange,
364
+ ...(props.textEditorParams || {})
365
+ });
366
+ } else {
367
+ inputEl = createInput('input');
368
+ }
369
+ }
370
+ const hasErrorMessage = !!props.errorMessage || slots['error-message'];
371
+ const ItemContent = h('div', {
372
+ ref: itemContentElRef,
373
+ class: classNames('item-content item-input', !props.wrap && {
374
+ disabled: props.disabled
375
+ }, !props.wrap && colorClasses(props), {
376
+ 'item-input-outline': props.outline,
377
+ 'item-input-focused': inputFocused.value,
378
+ 'item-input-with-info': !!props.info || slots.info,
379
+ 'item-input-with-value': inputHasValue.value,
380
+ 'item-input-with-error-message': hasErrorMessage && props.errorMessageForce || inputInvalid.value,
381
+ 'item-input-invalid': hasErrorMessage && props.errorMessageForce || inputInvalid.value
382
+ })
383
+ }, [slots['content-start'] && slots['content-start'](), (props.media || slots.media) && h('div', {
384
+ class: 'item-media'
385
+ }, [props.media && h('img', {
386
+ src: props.media
387
+ }), slots.media && slots.media()]), h('div', {
388
+ class: 'item-inner'
389
+ }, [slots['inner-start'] && slots['inner-start'](), (props.label || slots.label) && h('div', {
390
+ class: classNames('item-title item-label', {
391
+ 'item-floating-label': props.floatingLabel
392
+ })
393
+ }, [props.label, slots.label && slots.label()]), h('div', {
394
+ class: classNames('item-input-wrap', {
395
+ 'input-dropdown': props.dropdown === 'auto' ? props.type === 'select' : props.dropdown
396
+ })
397
+ }, [inputEl, slots.input && slots.input(), hasErrorMessage && props.errorMessageForce && h('div', {
398
+ class: 'item-input-error-message'
399
+ }, [props.errorMessage, slots['error-message'] && slots['error-message']()]), props.clearButton && h('span', {
400
+ class: 'input-clear-button'
401
+ }), (props.info || slots.info) && h('div', {
402
+ class: 'item-input-info'
403
+ }, [props.info, slots.info && slots.info()])]), slots.inner && slots.inner(), slots['inner-end'] && slots['inner-end']()]), slots.content && slots.content(), slots['content-end'] && slots['content-end']()]);
404
+ if (!props.wrap) return ItemContent;
405
+ return h('li', {
406
+ ref: elRef,
407
+ class: classNames({
408
+ disabled: props.disabled
409
+ }, colorClasses(props))
410
+ }, [slots['root-start'] && slots['root-start'](), ItemContent, isSortableComputed.value && h('div', {
411
+ class: 'sortable-handler'
412
+ }), slots.root && slots.root(), slots['root-end'] && slots['root-end']()]);
413
+ };
414
+ }
415
+ };