@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,451 @@
1
+ import { computed, ref, h, onMounted, onBeforeUnmount, watch, inject } from 'vue';
2
+ import { classNames, isStringProp } from '../shared/utils.js';
3
+ import { colorClasses, colorProps, actionsProps, actionsAttrs, actionsClasses, routerProps, routerAttrs, routerClasses } from '../shared/mixins.js';
4
+ import { useRouteProps } from '../shared/use-route-props.js';
5
+ import { useSmartSelect } from '../shared/use-smart-select.js';
6
+ import { useTooltip } from '../shared/use-tooltip.js';
7
+ import { f7ready, f7 } from '../shared/f7.js';
8
+ import f7Badge from './badge.js';
9
+ const ListItemContent = function (_temp) {
10
+ let {
11
+ props,
12
+ slots,
13
+ inputElRef,
14
+ onChange,
15
+ onClick,
16
+ isMediaComputed,
17
+ isSortableComputed,
18
+ isSortableOppositeComputed,
19
+ itemContentClasses
20
+ } = _temp === void 0 ? {} : _temp;
21
+ const {
22
+ radio,
23
+ checkbox,
24
+ value,
25
+ name,
26
+ readonly,
27
+ disabled,
28
+ checked,
29
+ required,
30
+ media,
31
+ header,
32
+ footer,
33
+ title,
34
+ subtitle,
35
+ text,
36
+ after,
37
+ badge,
38
+ badgeColor,
39
+ swipeout,
40
+ sortable,
41
+ accordionItem
42
+ } = props;
43
+ let titleEl;
44
+ let afterWrapEl;
45
+ let afterEl;
46
+ let badgeEl;
47
+ let innerEl;
48
+ let titleRowEl;
49
+ let subtitleEl;
50
+ let textEl;
51
+ let mediaEl;
52
+ let inputEl;
53
+ let inputIconEl;
54
+ let headerEl;
55
+ let footerEl;
56
+
57
+ // Input
58
+ if (radio || checkbox) {
59
+ inputEl = h('input', {
60
+ ref: inputElRef,
61
+ value,
62
+ name,
63
+ checked,
64
+ readonly,
65
+ disabled,
66
+ required,
67
+ type: radio ? 'radio' : 'checkbox',
68
+ onChange
69
+ });
70
+ inputIconEl = h('i', {
71
+ class: `icon icon-${radio ? 'radio' : 'checkbox'}`
72
+ });
73
+ }
74
+ // Media
75
+ if (media || slots.media) {
76
+ let mediaImgEl;
77
+ if (media) {
78
+ mediaImgEl = h('img', {
79
+ src: media
80
+ });
81
+ }
82
+ mediaEl = h('div', {
83
+ class: 'item-media'
84
+ }, [mediaImgEl, slots.media && slots.media()]);
85
+ }
86
+ // Inner Elements
87
+ if (header || slots.header) {
88
+ headerEl = h('div', {
89
+ class: 'item-header'
90
+ }, [header, slots.header && slots.header()]);
91
+ }
92
+ if (footer || slots.footer) {
93
+ footerEl = h('div', {
94
+ class: 'item-footer'
95
+ }, [footer, slots.footer && slots.footer()]);
96
+ }
97
+ if (title || slots.title || !isMediaComputed.value && headerEl || !isMediaComputed.value && footerEl) {
98
+ titleEl = h('div', {
99
+ class: 'item-title'
100
+ }, [!isMediaComputed.value && headerEl, title, slots.title && slots.title(), !isMediaComputed.value && footerEl]);
101
+ }
102
+ if (subtitle || slots.subtitle) {
103
+ subtitleEl = h('div', {
104
+ class: 'item-subtitle'
105
+ }, [subtitle, slots.subtitle && slots.subtitle()]);
106
+ }
107
+ if (text || slots.text) {
108
+ textEl = h('div', {
109
+ class: 'item-text'
110
+ }, [text, slots.text && slots.text()]);
111
+ }
112
+ if (after || badge || slots.after) {
113
+ if (after) {
114
+ afterEl = h('span', [after]);
115
+ }
116
+ if (badge) {
117
+ badgeEl = h(f7Badge, {
118
+ color: badgeColor
119
+ }, () => badge);
120
+ }
121
+ afterWrapEl = h('div', {
122
+ class: 'item-after'
123
+ }, [slots['after-start'] && slots['after-start'](), afterEl, badgeEl, slots.after && slots.after(), slots['after-end'] && slots['after-end']()]);
124
+ }
125
+ if (isMediaComputed.value) {
126
+ titleRowEl = h('div', {
127
+ class: 'item-title-row'
128
+ }, [slots['before-title'] && slots['before-title'](), titleEl, slots['after-title'] && slots['after-title'](), afterWrapEl]);
129
+ innerEl = h('div', {
130
+ class: 'item-inner'
131
+ }, [slots['inner-start'] && slots['inner-start'], headerEl, titleRowEl, subtitleEl, textEl, swipeout || accordionItem ? null : slots.default && slots.default(), slots.inner && slots.inner(), footerEl, slots['inner-end'] && slots['inner-end']]);
132
+ } else {
133
+ innerEl = h('div', {
134
+ class: 'item-inner'
135
+ }, [slots['inner-start'] && slots['inner-start'](), slots['before-title'] && slots['before-title'](), titleEl, slots['after-title'] && slots['after-title'](), afterWrapEl, swipeout || accordionItem ? null : slots.default && slots.default(), slots.inner && slots.inner(), slots['inner-end'] && slots['inner-end']()]);
136
+ }
137
+ const ItemContentTag = checkbox || radio ? 'label' : 'div';
138
+ return h(ItemContentTag, {
139
+ class: itemContentClasses.value,
140
+ onClick
141
+ }, [isSortableComputed.value && sortable !== false && isSortableOppositeComputed.value && h('div', {
142
+ class: 'sortable-handler'
143
+ }), slots['content-start'] && slots['content-start'](), inputEl, inputIconEl, mediaEl, innerEl, slots.content && slots.content(), slots['content-end'] && slots['content-end']()]);
144
+ };
145
+ export default {
146
+ name: 'f7-list-item',
147
+ props: {
148
+ title: [String, Number],
149
+ text: [String, Number],
150
+ media: String,
151
+ subtitle: [String, Number],
152
+ header: [String, Number],
153
+ footer: [String, Number],
154
+ // Tooltip
155
+ tooltip: String,
156
+ tooltipTrigger: String,
157
+ // Link Props
158
+ link: [Boolean, String],
159
+ target: String,
160
+ tabLink: [Boolean, String],
161
+ tabLinkActive: Boolean,
162
+ selected: Boolean,
163
+ after: [String, Number],
164
+ badge: [String, Number],
165
+ badgeColor: String,
166
+ mediaItem: Boolean,
167
+ mediaList: Boolean,
168
+ groupTitle: Boolean,
169
+ swipeout: Boolean,
170
+ swipeoutOpened: Boolean,
171
+ sortable: {
172
+ type: Boolean,
173
+ default: undefined
174
+ },
175
+ sortableOpposite: {
176
+ type: Boolean,
177
+ default: undefined
178
+ },
179
+ accordionItem: Boolean,
180
+ accordionItemOpened: Boolean,
181
+ // Smart Select
182
+ smartSelect: Boolean,
183
+ smartSelectParams: Object,
184
+ // Links Chevron (Arrow) Icon
185
+ noChevron: Boolean,
186
+ chevronCenter: Boolean,
187
+ // Inputs
188
+ checkbox: Boolean,
189
+ radio: Boolean,
190
+ radioIcon: String,
191
+ checkboxIcon: String,
192
+ checked: Boolean,
193
+ indeterminate: Boolean,
194
+ name: String,
195
+ value: {
196
+ type: [String, Number, Array],
197
+ default: undefined
198
+ },
199
+ readonly: Boolean,
200
+ required: Boolean,
201
+ disabled: Boolean,
202
+ virtualListIndex: Number,
203
+ ...colorProps,
204
+ ...actionsProps,
205
+ ...routerProps
206
+ },
207
+ emits: ['click', 'swipeout', 'swipeout:overswipeenter', 'swipeout:overswipeexit', 'swipeout:deleted', 'swipeout:delete', 'swipeout:close', 'swipeout:closed', 'swipeout:open', 'swipeout:opened', 'accordion:beforeclose', 'accordion:close', 'accordion:closed', 'accordion:beforeopen', 'accordion:open', 'accordion:opened', 'change', 'update:checked'],
208
+ setup(props, _ref) {
209
+ let {
210
+ slots,
211
+ emit
212
+ } = _ref;
213
+ const ListContext = inject('ListContext', {
214
+ value: {
215
+ listIsMedia: false,
216
+ listIsSortable: false,
217
+ listIsSortableOpposite: false,
218
+ listIsSimple: false
219
+ }
220
+ });
221
+ const listIsMedia = computed(() => ListContext.value.listIsMedia || false);
222
+ const listIsSortable = computed(() => ListContext.value.listIsSortable || false);
223
+ const listIsSortableOpposite = computed(() => ListContext.value.listIsSortableOpposite || false);
224
+ const listIsSimple = computed(() => ListContext.value.listIsSimple || false);
225
+ const elRef = ref(null);
226
+ const linkElRef = ref(null);
227
+ const inputElRef = ref(null);
228
+ const onClick = event => {
229
+ if (event.target.tagName.toLowerCase() !== 'input') {
230
+ emit('click', event);
231
+ }
232
+ };
233
+ const onSwipeoutOverswipeEnter = el => {
234
+ if (elRef.value !== el) return;
235
+ emit('swipeout:overswipeenter');
236
+ };
237
+ const onSwipeoutOverswipeExit = el => {
238
+ if (elRef.value !== el) return;
239
+ emit('swipeout:overswipeexit');
240
+ };
241
+ const onSwipeoutDeleted = el => {
242
+ if (elRef.value !== el) return;
243
+ emit('swipeout:deleted');
244
+ };
245
+ const onSwipeoutDelete = el => {
246
+ if (elRef.value !== el) return;
247
+ emit('swipeout:delete');
248
+ };
249
+ const onSwipeoutClose = el => {
250
+ if (elRef.value !== el) return;
251
+ emit('swipeout:close');
252
+ };
253
+ const onSwipeoutClosed = el => {
254
+ if (elRef.value !== el) return;
255
+ emit('swipeout:closed');
256
+ };
257
+ const onSwipeoutOpen = el => {
258
+ if (elRef.value !== el) return;
259
+ emit('swipeout:open');
260
+ };
261
+ const onSwipeoutOpened = el => {
262
+ if (elRef.value !== el) return;
263
+ emit('swipeout:opened');
264
+ };
265
+ const onSwipeout = (el, progress) => {
266
+ if (elRef.value !== el) return;
267
+ emit('swipeout', progress);
268
+ };
269
+ const onAccBeforeClose = (el, prevent) => {
270
+ if (elRef.value !== el) return;
271
+ emit('accordion:beforeclose', prevent);
272
+ };
273
+ const onAccClose = el => {
274
+ if (elRef.value !== el) return;
275
+ emit('accordion:close');
276
+ };
277
+ const onAccClosed = el => {
278
+ if (elRef.value !== el) return;
279
+ emit('accordion:closed');
280
+ };
281
+ const onAccBeforeOpen = (el, prevent) => {
282
+ if (elRef.value !== el) return;
283
+ emit('accordion:beforeopen', prevent);
284
+ };
285
+ const onAccOpen = el => {
286
+ if (elRef.value !== el) return;
287
+ emit('accordion:open');
288
+ };
289
+ const onAccOpened = el => {
290
+ if (elRef.value !== el) return;
291
+ emit('accordion:opened');
292
+ };
293
+ const onChange = event => {
294
+ emit('change', event);
295
+ emit('update:checked', event.target.checked);
296
+ };
297
+ useTooltip(elRef, props);
298
+ useRouteProps(linkElRef, props);
299
+ useSmartSelect(props, () => {}, () => elRef.value.querySelector('a.smart-select'));
300
+ watch(() => props.swipeoutOpened, newValue => {
301
+ if (!props.swipeout || !elRef.value || !f7) return;
302
+ if (newValue) {
303
+ f7.swipeout.open(elRef.value);
304
+ } else {
305
+ f7.swipeout.close(elRef.value);
306
+ }
307
+ });
308
+ onMounted(() => {
309
+ f7ready(() => {
310
+ if (props.swipeout) {
311
+ f7.on('swipeoutOpen', onSwipeoutOpen);
312
+ f7.on('swipeoutOpened', onSwipeoutOpened);
313
+ f7.on('swipeoutClose', onSwipeoutClose);
314
+ f7.on('swipeoutClosed', onSwipeoutClosed);
315
+ f7.on('swipeoutDelete', onSwipeoutDelete);
316
+ f7.on('swipeoutDeleted', onSwipeoutDeleted);
317
+ f7.on('swipeoutOverswipeEnter', onSwipeoutOverswipeEnter);
318
+ f7.on('swipeoutOverswipeExit', onSwipeoutOverswipeExit);
319
+ f7.on('swipeout', onSwipeout);
320
+ }
321
+ if (props.accordionItem) {
322
+ f7.on('accordionBeforeOpen', onAccBeforeOpen);
323
+ f7.on('accordionOpen', onAccOpen);
324
+ f7.on('accordionOpened', onAccOpened);
325
+ f7.on('accordionBeforeClose', onAccBeforeClose);
326
+ f7.on('accordionClose', onAccClose);
327
+ f7.on('accordionClosed', onAccClosed);
328
+ }
329
+ if (props.swipeout && props.swipeoutOpened) {
330
+ f7.swipeout.open(elRef.value);
331
+ }
332
+ });
333
+ if (props.checkbox && inputElRef.value) {
334
+ inputElRef.value.indeterminate = !!props.indeterminate;
335
+ }
336
+ });
337
+ onBeforeUnmount(() => {
338
+ if (!f7) return;
339
+ f7.off('swipeoutOpen', onSwipeoutOpen);
340
+ f7.off('swipeoutOpened', onSwipeoutOpened);
341
+ f7.off('swipeoutClose', onSwipeoutClose);
342
+ f7.off('swipeoutClosed', onSwipeoutClosed);
343
+ f7.off('swipeoutDelete', onSwipeoutDelete);
344
+ f7.off('swipeoutDeleted', onSwipeoutDeleted);
345
+ f7.off('swipeoutOverswipeEnter', onSwipeoutOverswipeEnter);
346
+ f7.off('swipeoutOverswipeExit', onSwipeoutOverswipeExit);
347
+ f7.off('swipeout', onSwipeout);
348
+ f7.off('accordionBeforeOpen', onAccBeforeOpen);
349
+ f7.off('accordionOpen', onAccOpen);
350
+ f7.off('accordionOpened', onAccOpened);
351
+ f7.off('accordionBeforeClose', onAccBeforeClose);
352
+ f7.off('accordionClose', onAccClose);
353
+ f7.off('accordionClosed', onAccClosed);
354
+ });
355
+ watch(() => props.indeterminate, newValue => {
356
+ if (inputElRef.value) {
357
+ inputElRef.value.indeterminate = !!newValue;
358
+ }
359
+ });
360
+ const isMediaComputed = computed(() => props.mediaItem || props.mediaList || listIsMedia.value);
361
+ const isSortableComputed = computed(() => props.sortable === true || props.sortable === false ? props.sortable : listIsSortable.value);
362
+ const isSortableOppositeComputed = computed(() => isSortableComputed.value && (props.sortableOpposite || listIsSortableOpposite.value));
363
+ const linkAttrs = computed(() => ({
364
+ href: props.href === false ? undefined : props.link === true ? props.href || '' : props.link || props.href,
365
+ target: props.target,
366
+ 'data-tab': isStringProp(props.tabLink) && props.tabLink || undefined,
367
+ ...routerAttrs(props),
368
+ ...actionsAttrs(props)
369
+ }));
370
+ const linkClasses = computed(() => classNames({
371
+ 'item-link': true,
372
+ 'smart-select': props.smartSelect,
373
+ 'tab-link': props.tabLink || props.tabLink === '',
374
+ 'tab-link-active': props.tabLinkActive,
375
+ 'item-selected': props.selected
376
+ }, routerClasses(props), actionsClasses(props)));
377
+ const itemContentClasses = computed(() => classNames('item-content', {
378
+ 'item-checkbox': props.checkbox,
379
+ 'item-radio': props.radio,
380
+ 'item-checkbox-icon-start': props.checkbox && props.checkboxIcon === 'start',
381
+ 'item-checkbox-icon-end': props.checkbox && props.checkboxIcon === 'end',
382
+ 'item-radio-icon-start': props.radio && props.radioIcon === 'start',
383
+ 'item-radio-icon-end': props.radio && props.radioIcon === 'end'
384
+ }, colorClasses(props)));
385
+ const liClasses = computed(() => classNames({
386
+ 'list-group-title': props.groupTitle,
387
+ 'media-item': isMediaComputed.value,
388
+ swipeout: props.swipeout,
389
+ 'accordion-item': props.accordionItem,
390
+ 'accordion-item-opened': props.accordionItemOpened,
391
+ disabled: props.disabled && !(props.radio || props.checkbox),
392
+ 'no-chevron': props.noChevron,
393
+ 'chevron-center': props.chevronCenter,
394
+ 'disallow-sorting': props.sortable === false
395
+ }, colorClasses(props)));
396
+ return () => {
397
+ let linkEl;
398
+ let itemContentEl;
399
+ if (!listIsSimple.value) {
400
+ // Item Content
401
+ itemContentEl = ListItemContent({
402
+ props,
403
+ slots,
404
+ inputElRef,
405
+ onChange,
406
+ onClick: props.link || props.href || props.accordionItem || props.smartSelect ? undefined : onClick,
407
+ isMediaComputed,
408
+ isSortableComputed,
409
+ isSortableOppositeComputed,
410
+ itemContentClasses
411
+ });
412
+
413
+ // Link
414
+ if (props.link || props.href || props.accordionItem || props.smartSelect) {
415
+ linkEl = h('a', {
416
+ ref: linkElRef,
417
+ class: linkClasses.value,
418
+ ...linkAttrs.value,
419
+ onClick
420
+ }, [itemContentEl]);
421
+ }
422
+ }
423
+ if (props.groupTitle) {
424
+ return h('li', {
425
+ ref: elRef,
426
+ class: liClasses.value,
427
+ 'data-virtual-list-index': props.virtualListIndex,
428
+ onClick
429
+ }, [props.title, slots.default && slots.default()]);
430
+ }
431
+ if (listIsSimple.value) {
432
+ return h('li', {
433
+ ref: elRef,
434
+ class: liClasses.value,
435
+ onClick,
436
+ 'data-virtual-list-index': props.virtualListIndex
437
+ }, [props.title, slots.default && slots.default()]);
438
+ }
439
+ const linkItemEl = props.link || props.href || props.smartSelect || props.accordionItem ? linkEl : itemContentEl;
440
+ return h('li', {
441
+ ref: elRef,
442
+ class: liClasses.value,
443
+ 'data-virtual-list-index': props.virtualListIndex
444
+ }, [slots['root-start'] && slots['root-start'](), props.swipeout ? h('div', {
445
+ class: 'swipeout-content'
446
+ }, [linkItemEl]) : linkItemEl, isSortableComputed.value && props.sortable !== false && !isSortableOppositeComputed.value && h('div', {
447
+ class: 'sortable-handler'
448
+ }), (props.swipeout || props.accordionItem) && slots.default(), slots.root && slots.root(), slots['root-end'] && slots['root-end']()]);
449
+ };
450
+ }
451
+ };
@@ -0,0 +1,236 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const List: DefineComponent<
6
+ {
7
+
8
+ inset: {
9
+ type: BooleanConstructor;
10
+ },
11
+
12
+ insetIos: {
13
+ type: BooleanConstructor;
14
+ },
15
+
16
+ insetMd: {
17
+ type: BooleanConstructor;
18
+ },
19
+
20
+ xsmallInset: {
21
+ type: BooleanConstructor;
22
+ },
23
+
24
+ xsmallInsetIos: {
25
+ type: BooleanConstructor;
26
+ },
27
+
28
+ xsmallInsetMd: {
29
+ type: BooleanConstructor;
30
+ },
31
+
32
+ smallInset: {
33
+ type: BooleanConstructor;
34
+ },
35
+
36
+ smallInsetIos: {
37
+ type: BooleanConstructor;
38
+ },
39
+
40
+ smallInsetMd: {
41
+ type: BooleanConstructor;
42
+ },
43
+
44
+ mediumInset: {
45
+ type: BooleanConstructor;
46
+ },
47
+
48
+ mediumInsetIos: {
49
+ type: BooleanConstructor;
50
+ },
51
+
52
+ mediumInsetMd: {
53
+ type: BooleanConstructor;
54
+ },
55
+
56
+ largeInset: {
57
+ type: BooleanConstructor;
58
+ },
59
+
60
+ largeInsetIos: {
61
+ type: BooleanConstructor;
62
+ },
63
+
64
+ largeInsetMd: {
65
+ type: BooleanConstructor;
66
+ },
67
+
68
+ xlargeInset: {
69
+ type: BooleanConstructor;
70
+ },
71
+
72
+ xlargeInsetIos: {
73
+ type: BooleanConstructor;
74
+ },
75
+
76
+ xlargeInsetMd: {
77
+ type: BooleanConstructor;
78
+ },
79
+
80
+ strong: {
81
+ type: BooleanConstructor;
82
+ },
83
+
84
+ strongIos: {
85
+ type: BooleanConstructor;
86
+ },
87
+
88
+ strongMd: {
89
+ type: BooleanConstructor;
90
+ },
91
+
92
+ outline: {
93
+ type: BooleanConstructor;
94
+ },
95
+
96
+ outlineIos: {
97
+ type: BooleanConstructor;
98
+ },
99
+
100
+ outlineMd: {
101
+ type: BooleanConstructor;
102
+ },
103
+
104
+ dividers: {
105
+ type: BooleanConstructor;
106
+ },
107
+
108
+ dividersIos: {
109
+ type: BooleanConstructor;
110
+ },
111
+
112
+ dividersMd: {
113
+ type: BooleanConstructor;
114
+ },
115
+
116
+ mediaList: {
117
+ type: BooleanConstructor;
118
+ },
119
+
120
+ sortable: {
121
+ type: BooleanConstructor;
122
+ },
123
+
124
+ sortableTapHold: {
125
+ type: BooleanConstructor;
126
+ },
127
+
128
+ sortableEnabled: {
129
+ type: BooleanConstructor;
130
+ },
131
+
132
+ sortableOpposite: {
133
+ type: BooleanConstructor;
134
+ },
135
+
136
+ accordionList: {
137
+ type: BooleanConstructor;
138
+ },
139
+
140
+ accordionOpposite: {
141
+ type: BooleanConstructor;
142
+ },
143
+
144
+ contactsList: {
145
+ type: BooleanConstructor;
146
+ },
147
+
148
+ simpleList: {
149
+ type: BooleanConstructor;
150
+ },
151
+
152
+ linksList: {
153
+ type: BooleanConstructor;
154
+ },
155
+
156
+ menuList: {
157
+ type: BooleanConstructor;
158
+ },
159
+
160
+ noChevron: {
161
+ type: BooleanConstructor;
162
+ },
163
+
164
+ chevronCenter: {
165
+ type: BooleanConstructor;
166
+ },
167
+
168
+ tab: {
169
+ type: BooleanConstructor;
170
+ },
171
+
172
+ tabActive: {
173
+ type: BooleanConstructor;
174
+ },
175
+
176
+ form: {
177
+ type: BooleanConstructor;
178
+ },
179
+
180
+ formStoreData: {
181
+ type: BooleanConstructor;
182
+ },
183
+
184
+ virtualList: {
185
+ type: BooleanConstructor;
186
+ },
187
+
188
+ virtualListParams: {
189
+ type: ObjectConstructor;
190
+ },
191
+
192
+ sortableMoveElements: {
193
+ type: BooleanConstructor;
194
+ default: undefined;
195
+ },
196
+
197
+ color: {
198
+ type: StringConstructor;
199
+ },
200
+
201
+ colorTheme: {
202
+ type: StringConstructor;
203
+ },
204
+
205
+ textColor: {
206
+ type: StringConstructor;
207
+ },
208
+
209
+ bgColor: {
210
+ type: StringConstructor;
211
+ },
212
+
213
+ borderColor: {
214
+ type: StringConstructor;
215
+ },
216
+
217
+ rippleColor: {
218
+ type: StringConstructor;
219
+ },
220
+
221
+ dark: {
222
+ type: BooleanConstructor;
223
+ }
224
+ },
225
+ () => JSX.Element,
226
+ unknown,
227
+ {},
228
+ {},
229
+ ComponentOptionsMixin,
230
+ ComponentOptionsMixin,
231
+ ("submit" | "sortable:enable" | "sortable:disable" | "sortable:sort" | "sortable:move" | "virtual:itembeforeinsert" | "virtual:beforeclear" | "virtual:itemsbeforeinsert" | "virtual:itemsafterinsert" | "tab:hide" | "tab:show")[],
232
+ "submit" | "sortable:enable" | "sortable:disable" | "sortable:sort" | "sortable:move" | "virtual:itembeforeinsert" | "virtual:beforeclear" | "virtual:itemsbeforeinsert" | "virtual:itemsafterinsert" | "tab:hide" | "tab:show"
233
+ >;
234
+
235
+ export default List;
236
+