@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,59 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const Subnavbar: DefineComponent<
6
+ {
7
+
8
+ sliding: {
9
+ type: BooleanConstructor;
10
+ },
11
+
12
+ title: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ inner: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ },
20
+
21
+ color: {
22
+ type: StringConstructor;
23
+ },
24
+
25
+ colorTheme: {
26
+ type: StringConstructor;
27
+ },
28
+
29
+ textColor: {
30
+ type: StringConstructor;
31
+ },
32
+
33
+ bgColor: {
34
+ type: StringConstructor;
35
+ },
36
+
37
+ borderColor: {
38
+ type: StringConstructor;
39
+ },
40
+
41
+ rippleColor: {
42
+ type: StringConstructor;
43
+ },
44
+
45
+ dark: {
46
+ type: BooleanConstructor;
47
+ }
48
+ },
49
+ () => JSX.Element,
50
+ unknown,
51
+ {},
52
+ {},
53
+ ComponentOptionsMixin,
54
+ ComponentOptionsMixin,
55
+
56
+ >;
57
+
58
+ export default Subnavbar;
59
+
@@ -0,0 +1,40 @@
1
+ import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass } from "vue";
2
+ const _hoisted_1 = {
3
+ key: 0,
4
+ class: "subnavbar-inner"
5
+ };
6
+ const _hoisted_2 = {
7
+ key: 0,
8
+ class: "subnavbar-title"
9
+ };
10
+ function render(_ctx, _cache) {
11
+ return _openBlock(), _createElementBlock("div", {
12
+ class: _normalizeClass(_ctx.classes)
13
+ }, [_ctx.inner ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.title ? (_openBlock(), _createElementBlock("div", _hoisted_2, _toDisplayString(_ctx.title), 1)) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "default")])) : _renderSlot(_ctx.$slots, "default", {
14
+ key: 1
15
+ })], 2);
16
+ }
17
+ import { computed } from 'vue';
18
+ import { classNames } from '../shared/utils.js';
19
+ import { colorClasses, colorProps } from '../shared/mixins.js';
20
+ export default {
21
+ name: 'f7-subnavbar',
22
+ render,
23
+ props: {
24
+ sliding: Boolean,
25
+ title: String,
26
+ inner: {
27
+ type: Boolean,
28
+ default: true
29
+ },
30
+ ...colorProps
31
+ },
32
+ setup(props) {
33
+ const classes = computed(() => classNames('subnavbar', {
34
+ sliding: props.sliding
35
+ }, colorClasses(props)));
36
+ return {
37
+ classes
38
+ };
39
+ }
40
+ };
@@ -0,0 +1,58 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const SwipeoutActions: DefineComponent<
6
+ {
7
+
8
+ left: {
9
+ type: BooleanConstructor;
10
+ },
11
+
12
+ right: {
13
+ type: BooleanConstructor;
14
+ },
15
+
16
+ side: {
17
+ type: StringConstructor;
18
+ },
19
+
20
+ color: {
21
+ type: StringConstructor;
22
+ },
23
+
24
+ colorTheme: {
25
+ type: StringConstructor;
26
+ },
27
+
28
+ textColor: {
29
+ type: StringConstructor;
30
+ },
31
+
32
+ bgColor: {
33
+ type: StringConstructor;
34
+ },
35
+
36
+ borderColor: {
37
+ type: StringConstructor;
38
+ },
39
+
40
+ rippleColor: {
41
+ type: StringConstructor;
42
+ },
43
+
44
+ dark: {
45
+ type: BooleanConstructor;
46
+ }
47
+ },
48
+ () => JSX.Element,
49
+ unknown,
50
+ {},
51
+ {},
52
+ ComponentOptionsMixin,
53
+ ComponentOptionsMixin,
54
+
55
+ >;
56
+
57
+ export default SwipeoutActions;
58
+
@@ -0,0 +1,33 @@
1
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
2
+ function render(_ctx, _cache) {
3
+ return _openBlock(), _createElementBlock("div", {
4
+ class: _normalizeClass(_ctx.classes)
5
+ }, [_renderSlot(_ctx.$slots, "default")], 2);
6
+ }
7
+ import { computed } from 'vue';
8
+ import { classNames } from '../shared/utils.js';
9
+ import { colorClasses, colorProps } from '../shared/mixins.js';
10
+ export default {
11
+ name: 'f7-swipeout-actions',
12
+ render,
13
+ props: {
14
+ left: Boolean,
15
+ right: Boolean,
16
+ side: String,
17
+ ...colorProps
18
+ },
19
+ setup(props) {
20
+ const side = computed(() => {
21
+ let sideComputed = props.side;
22
+ if (!sideComputed) {
23
+ if (props.left) sideComputed = 'left';
24
+ if (props.right) sideComputed = 'right';
25
+ }
26
+ return sideComputed;
27
+ });
28
+ const classes = computed(() => classNames(`swipeout-actions-${side.value}`, colorClasses(props)));
29
+ return {
30
+ classes
31
+ };
32
+ }
33
+ };
@@ -0,0 +1,75 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const SwipeoutButton: DefineComponent<
6
+ {
7
+
8
+ text: {
9
+ type: StringConstructor;
10
+ },
11
+
12
+ confirmTitle: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ confirmText: {
17
+ type: StringConstructor;
18
+ },
19
+
20
+ overswipe: {
21
+ type: BooleanConstructor;
22
+ },
23
+
24
+ close: {
25
+ type: BooleanConstructor;
26
+ },
27
+
28
+ delete: {
29
+ type: BooleanConstructor;
30
+ },
31
+
32
+ href: {
33
+ type: StringConstructor;
34
+ },
35
+
36
+ color: {
37
+ type: StringConstructor;
38
+ },
39
+
40
+ colorTheme: {
41
+ type: StringConstructor;
42
+ },
43
+
44
+ textColor: {
45
+ type: StringConstructor;
46
+ },
47
+
48
+ bgColor: {
49
+ type: StringConstructor;
50
+ },
51
+
52
+ borderColor: {
53
+ type: StringConstructor;
54
+ },
55
+
56
+ rippleColor: {
57
+ type: StringConstructor;
58
+ },
59
+
60
+ dark: {
61
+ type: BooleanConstructor;
62
+ }
63
+ },
64
+ () => JSX.Element,
65
+ unknown,
66
+ {},
67
+ {},
68
+ ComponentOptionsMixin,
69
+ ComponentOptionsMixin,
70
+ ("click")[],
71
+ "click"
72
+ >;
73
+
74
+ export default SwipeoutButton;
75
+
@@ -0,0 +1,48 @@
1
+ import { toDisplayString as _toDisplayString, renderSlot as _renderSlot, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
2
+ const _hoisted_1 = ["href", "data-confirm", "data-confirm-title"];
3
+ function render(_ctx, _cache) {
4
+ return _openBlock(), _createElementBlock("a", {
5
+ href: _ctx.href || '#',
6
+ "data-confirm": _ctx.confirmText || undefined,
7
+ "data-confirm-title": _ctx.confirmTitle || undefined,
8
+ class: _normalizeClass(_ctx.classes),
9
+ onClick: _cache[0] || (_cache[0] = function () {
10
+ return _ctx.onClick && _ctx.onClick(...arguments);
11
+ })
12
+ }, [_createTextVNode(_toDisplayString(_ctx.text) + " ", 1), _renderSlot(_ctx.$slots, "default")], 10, _hoisted_1);
13
+ }
14
+ import { computed } from 'vue';
15
+ import { classNames } from '../shared/utils.js';
16
+ import { colorClasses, colorProps } from '../shared/mixins.js';
17
+ export default {
18
+ name: 'f7-swipeout-button',
19
+ render,
20
+ props: {
21
+ text: String,
22
+ confirmTitle: String,
23
+ confirmText: String,
24
+ overswipe: Boolean,
25
+ close: Boolean,
26
+ delete: Boolean,
27
+ href: String,
28
+ ...colorProps
29
+ },
30
+ emits: ['click'],
31
+ setup(props, _ref) {
32
+ let {
33
+ emit
34
+ } = _ref;
35
+ const onClick = e => {
36
+ emit('click', e);
37
+ };
38
+ const classes = computed(() => classNames({
39
+ 'swipeout-overswipe': props.overswipe,
40
+ 'swipeout-delete': props.delete,
41
+ 'swipeout-close': props.close
42
+ }, colorClasses(props)));
43
+ return {
44
+ classes,
45
+ onClick
46
+ };
47
+ }
48
+ };
@@ -0,0 +1,51 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const Tab: DefineComponent<
6
+ {
7
+
8
+ tabActive: {
9
+ type: BooleanConstructor;
10
+ },
11
+
12
+ color: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ colorTheme: {
17
+ type: StringConstructor;
18
+ },
19
+
20
+ textColor: {
21
+ type: StringConstructor;
22
+ },
23
+
24
+ bgColor: {
25
+ type: StringConstructor;
26
+ },
27
+
28
+ borderColor: {
29
+ type: StringConstructor;
30
+ },
31
+
32
+ rippleColor: {
33
+ type: StringConstructor;
34
+ },
35
+
36
+ dark: {
37
+ type: BooleanConstructor;
38
+ }
39
+ },
40
+ () => JSX.Element,
41
+ unknown,
42
+ {},
43
+ {},
44
+ ComponentOptionsMixin,
45
+ ComponentOptionsMixin,
46
+ ("tab:show" | "tab:hide")[],
47
+ "tab:show" | "tab:hide"
48
+ >;
49
+
50
+ export default Tab;
51
+
@@ -0,0 +1,128 @@
1
+ import { resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock } from "vue";
2
+ function render(_ctx, _cache) {
3
+ return _ctx.isSwiper ? (_openBlock(), _createElementBlock("swiper-slide", {
4
+ key: 0,
5
+ ref: "elRef",
6
+ class: _normalizeClass(_ctx.classes)
7
+ }, [_ctx.tabContent ? (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.getComponent(_ctx.tabContent)), _mergeProps({
8
+ key: _ctx.tabContent.id
9
+ }, _ctx.getProps(_ctx.tabContent)), null, 16)) : _renderSlot(_ctx.$slots, "default", {
10
+ key: 1
11
+ })], 2)) : (_openBlock(), _createElementBlock("div", {
12
+ key: 1,
13
+ ref: "elRef",
14
+ class: _normalizeClass(_ctx.classes)
15
+ }, [_ctx.tabContent ? (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.getComponent(_ctx.tabContent)), _mergeProps({
16
+ key: _ctx.tabContent.id
17
+ }, _ctx.getProps(_ctx.tabContent)), null, 16)) : _renderSlot(_ctx.$slots, "default", {
18
+ key: 1
19
+ })], 2));
20
+ }
21
+ import { computed, ref, inject, onMounted, onBeforeUnmount, onUpdated, toRaw } from 'vue';
22
+ import { classNames, getComponentId } from '../shared/utils.js';
23
+ import { colorClasses, colorProps } from '../shared/mixins.js';
24
+ import { f7ready, f7routers, f7, f7events } from '../shared/f7.js';
25
+ import { useTab } from '../shared/use-tab.js';
26
+ export default {
27
+ name: 'f7-tab',
28
+ render,
29
+ props: {
30
+ tabActive: Boolean,
31
+ ...colorProps
32
+ },
33
+ emits: ['tab:show', 'tab:hide'],
34
+ setup(props, _ref) {
35
+ let {
36
+ emit
37
+ } = _ref;
38
+ const elRef = ref(null);
39
+ const routerData = ref(null);
40
+ const route = inject('f7route', null);
41
+ const router = inject('f7route', null);
42
+ const isSwiper = inject('TabsSwipeableContext', false);
43
+ let initialTabContent = null;
44
+ if (!routerData.value && route && route.route && route.route.tab && route.route.tab.id === props.id) {
45
+ const {
46
+ component,
47
+ asyncComponent,
48
+ options: tabRouteOptions
49
+ } = route.route.tab;
50
+ if (component || asyncComponent) {
51
+ const parentProps = route.route.options && route.route.options.props;
52
+ initialTabContent = {
53
+ id: getComponentId(),
54
+ component: component || asyncComponent,
55
+ isAsync: !!asyncComponent,
56
+ props: {
57
+ ...(parentProps || {}),
58
+ ...(tabRouteOptions && tabRouteOptions.props || {}),
59
+ f7router: router,
60
+ f7route: route,
61
+ ...route.params
62
+ }
63
+ };
64
+ }
65
+ }
66
+ const tabContent = ref(initialTabContent || null);
67
+ const setTabContent = newContent => {
68
+ tabContent.value = newContent;
69
+ };
70
+ if (f7 && !routerData.value) {
71
+ routerData.value = {
72
+ setTabContent
73
+ };
74
+ f7routers.tabs.push(routerData.value);
75
+ }
76
+ onMounted(() => {
77
+ if (elRef.value && initialTabContent) {
78
+ elRef.value.f7RouterTabLoaded = true;
79
+ }
80
+ f7ready(() => {
81
+ if (!routerData.value) {
82
+ routerData.value = {
83
+ el: elRef.value,
84
+ setTabContent
85
+ };
86
+ f7routers.tabs.push(routerData.value);
87
+ } else {
88
+ routerData.value.el = elRef.value;
89
+ }
90
+ });
91
+ });
92
+ onBeforeUnmount(() => {
93
+ if (!routerData.value) return;
94
+ f7routers.tabs.splice(f7routers.tabs.indexOf(routerData.value), 1);
95
+ routerData.value = null;
96
+ });
97
+ onUpdated(() => {
98
+ if (!routerData.value || !f7) return;
99
+ f7events.emit('tabRouterDidUpdate', routerData.value);
100
+ });
101
+ useTab(elRef, emit);
102
+ const classes = computed(() => classNames('tab', {
103
+ 'tab-active': props.tabActive
104
+ }, colorClasses(props)));
105
+ const getComponent = content => toRaw(content.component);
106
+ const getProps = content => {
107
+ const {
108
+ component: tabComponent,
109
+ props: tabProps
110
+ } = content;
111
+ let keys = [];
112
+ const passProps = {};
113
+ if (tabComponent && tabComponent.props) keys = Object.keys(tabComponent.props);
114
+ keys.forEach(key => {
115
+ if (key in tabProps) passProps[key] = tabProps[key];
116
+ });
117
+ return passProps;
118
+ };
119
+ return {
120
+ elRef,
121
+ classes,
122
+ tabContent,
123
+ getComponent,
124
+ getProps,
125
+ isSwiper
126
+ };
127
+ }
128
+ };
@@ -0,0 +1,63 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const Tabs: DefineComponent<
6
+ {
7
+
8
+ animated: {
9
+ type: BooleanConstructor;
10
+ },
11
+
12
+ swipeable: {
13
+ type: BooleanConstructor;
14
+ },
15
+
16
+ routable: {
17
+ type: BooleanConstructor;
18
+ },
19
+
20
+ swiperParams: {
21
+ type: ObjectConstructor;
22
+ default: undefined;
23
+ },
24
+
25
+ color: {
26
+ type: StringConstructor;
27
+ },
28
+
29
+ colorTheme: {
30
+ type: StringConstructor;
31
+ },
32
+
33
+ textColor: {
34
+ type: StringConstructor;
35
+ },
36
+
37
+ bgColor: {
38
+ type: StringConstructor;
39
+ },
40
+
41
+ borderColor: {
42
+ type: StringConstructor;
43
+ },
44
+
45
+ rippleColor: {
46
+ type: StringConstructor;
47
+ },
48
+
49
+ dark: {
50
+ type: BooleanConstructor;
51
+ }
52
+ },
53
+ () => JSX.Element,
54
+ unknown,
55
+ {},
56
+ {},
57
+ ComponentOptionsMixin,
58
+ ComponentOptionsMixin,
59
+
60
+ >;
61
+
62
+ export default Tabs;
63
+
@@ -0,0 +1,59 @@
1
+ import { renderSlot as _renderSlot, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from "vue";
2
+ const _hoisted_1 = ["init"];
3
+ function render(_ctx, _cache) {
4
+ return _ctx.animated ? (_openBlock(), _createElementBlock("div", {
5
+ key: 0,
6
+ ref: "elRef",
7
+ class: _normalizeClass(_ctx.classNames('tabs-animated-wrap', _ctx.classes))
8
+ }, [_createElementVNode("div", {
9
+ class: _normalizeClass(_ctx.tabsClasses)
10
+ }, [_renderSlot(_ctx.$slots, "default")], 2)], 2)) : _ctx.swipeable ? (_openBlock(), _createElementBlock("swiper-container", {
11
+ key: 1,
12
+ ref: "elRef",
13
+ class: _normalizeClass(_ctx.classNames(_ctx.tabsClasses, _ctx.classes)),
14
+ init: _ctx.swiperParams ? 'false' : 'true'
15
+ }, [_renderSlot(_ctx.$slots, "default")], 10, _hoisted_1)) : (_openBlock(), _createElementBlock("div", {
16
+ key: 2,
17
+ ref: "elRef",
18
+ class: _normalizeClass(_ctx.classNames(_ctx.tabsClasses, _ctx.classes))
19
+ }, [_renderSlot(_ctx.$slots, "default")], 2));
20
+ }
21
+ import { computed, ref, onMounted, provide } from 'vue';
22
+ import { classNames } from '../shared/utils.js';
23
+ import { colorClasses, colorProps } from '../shared/mixins.js';
24
+ export default {
25
+ name: 'f7-tabs',
26
+ render,
27
+ props: {
28
+ animated: Boolean,
29
+ swipeable: Boolean,
30
+ routable: Boolean,
31
+ swiperParams: {
32
+ type: Object,
33
+ default: undefined
34
+ },
35
+ ...colorProps
36
+ },
37
+ setup(props) {
38
+ const elRef = ref(null);
39
+ onMounted(() => {
40
+ if (!props.swipeable || !props.swiperParams) return;
41
+ if (!elRef.value) return;
42
+ Object.assign(elRef.value, props.swiperParams);
43
+ elRef.value.initialize();
44
+ });
45
+ const classes = computed(() => classNames(colorClasses(props)));
46
+ const tabsClasses = computed(() => classNames({
47
+ tabs: true,
48
+ 'tabs-routable': props.routable
49
+ }));
50
+ const TabsSwipeableContext = computed(() => props.swipeable);
51
+ provide('TabsSwipeableContext', TabsSwipeableContext);
52
+ return {
53
+ elRef,
54
+ classes,
55
+ tabsClasses,
56
+ classNames
57
+ };
58
+ }
59
+ };