@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,66 @@
1
+ import { resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, createElementBlock as _createElementBlock } from "vue";
2
+ function render(_ctx, _cache) {
3
+ const _component_f7_link = _resolveComponent("f7-link");
4
+ return _openBlock(), _createElementBlock("div", {
5
+ class: _normalizeClass(_ctx.classes)
6
+ }, [_ctx.backLink ? (_openBlock(), _createBlock(_component_f7_link, {
7
+ key: 0,
8
+ href: _ctx.backLinkUrl || '#',
9
+ back: "",
10
+ icon: "icon-back",
11
+ force: _ctx.backLinkForce || undefined,
12
+ class: _normalizeClass(!_ctx.text ? 'icon-only' : undefined),
13
+ text: _ctx.text,
14
+ onClick: _ctx.onBackClick
15
+ }, null, 8, ["href", "force", "class", "text", "onClick"])) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "default")], 2);
16
+ }
17
+ import { computed } from 'vue';
18
+ import { classNames } from '../shared/utils.js';
19
+ import { colorClasses, colorProps } from '../shared/mixins.js';
20
+ import { useTheme } from '../shared/use-theme.js';
21
+ import f7Link from './link.js';
22
+ export default {
23
+ name: 'f7-nav-left',
24
+ render,
25
+ components: {
26
+ f7Link
27
+ },
28
+ props: {
29
+ backLink: [Boolean, String],
30
+ backLinkUrl: String,
31
+ backLinkForce: Boolean,
32
+ backLinkShowText: {
33
+ type: Boolean,
34
+ default: undefined
35
+ },
36
+ sliding: Boolean,
37
+ ...colorProps
38
+ },
39
+ emits: ['back:click', 'click:back'],
40
+ setup(props, _ref) {
41
+ let {
42
+ emit
43
+ } = _ref;
44
+ const onBackClick = event => {
45
+ emit('back:click', event);
46
+ emit('click:back', event);
47
+ };
48
+ const theme = useTheme();
49
+ const text = computed(() => {
50
+ let needBackLinkText = props.backLinkShowText;
51
+ if (typeof needBackLinkText === 'undefined') needBackLinkText = !theme.value.md;
52
+ if (props.backLink) {
53
+ return props.backLink !== true && needBackLinkText ? props.backLink : undefined;
54
+ }
55
+ return undefined;
56
+ });
57
+ const classes = computed(() => classNames('left', {
58
+ sliding: props.sliding
59
+ }, colorClasses(props)));
60
+ return {
61
+ classes,
62
+ onBackClick,
63
+ text
64
+ };
65
+ }
66
+ };
@@ -0,0 +1,50 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const NavRight: DefineComponent<
6
+ {
7
+
8
+ sliding: {
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
+
47
+ >;
48
+
49
+ export default NavRight;
50
+
@@ -0,0 +1,25 @@
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-nav-right',
12
+ render,
13
+ props: {
14
+ sliding: Boolean,
15
+ ...colorProps
16
+ },
17
+ setup(props) {
18
+ const classes = computed(() => classNames('right', {
19
+ sliding: props.sliding
20
+ }, colorClasses(props)));
21
+ return {
22
+ classes
23
+ };
24
+ }
25
+ };
@@ -0,0 +1,46 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const NavTitleLarge: DefineComponent<
6
+ {
7
+
8
+ color: {
9
+ type: StringConstructor;
10
+ },
11
+
12
+ colorTheme: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ textColor: {
17
+ type: StringConstructor;
18
+ },
19
+
20
+ bgColor: {
21
+ type: StringConstructor;
22
+ },
23
+
24
+ borderColor: {
25
+ type: StringConstructor;
26
+ },
27
+
28
+ rippleColor: {
29
+ type: StringConstructor;
30
+ },
31
+
32
+ dark: {
33
+ type: BooleanConstructor;
34
+ }
35
+ },
36
+ () => JSX.Element,
37
+ unknown,
38
+ {},
39
+ {},
40
+ ComponentOptionsMixin,
41
+ ComponentOptionsMixin,
42
+
43
+ >;
44
+
45
+ export default NavTitleLarge;
46
+
@@ -0,0 +1,25 @@
1
+ import { renderSlot as _renderSlot, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
2
+ const _hoisted_1 = {
3
+ class: "title-large-text"
4
+ };
5
+ function render(_ctx, _cache) {
6
+ return _openBlock(), _createElementBlock("div", {
7
+ class: _normalizeClass(_ctx.classes)
8
+ }, [_createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")])], 2);
9
+ }
10
+ import { computed } from 'vue';
11
+ import { classNames } from '../shared/utils.js';
12
+ import { colorClasses, colorProps } from '../shared/mixins.js';
13
+ export default {
14
+ name: 'f7-nav-title-large',
15
+ render,
16
+ props: {
17
+ ...colorProps
18
+ },
19
+ setup(props) {
20
+ const classes = computed(() => classNames('title-large', colorClasses(props)));
21
+ return {
22
+ classes
23
+ };
24
+ }
25
+ };
@@ -0,0 +1,58 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const NavTitle: DefineComponent<
6
+ {
7
+
8
+ title: {
9
+ type: StringConstructor;
10
+ },
11
+
12
+ subtitle: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ sliding: {
17
+ type: BooleanConstructor;
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 NavTitle;
58
+
@@ -0,0 +1,31 @@
1
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass } from "vue";
2
+ const _hoisted_1 = {
3
+ key: 0,
4
+ class: "subtitle"
5
+ };
6
+ function render(_ctx, _cache) {
7
+ return _openBlock(), _createElementBlock("div", {
8
+ class: _normalizeClass(_ctx.classes)
9
+ }, [_renderSlot(_ctx.$slots, "default"), _createTextVNode(" " + _toDisplayString(_ctx.title) + " ", 1), _ctx.subtitle ? (_openBlock(), _createElementBlock("span", _hoisted_1, _toDisplayString(_ctx.subtitle), 1)) : _createCommentVNode("", true)], 2);
10
+ }
11
+ import { computed } from 'vue';
12
+ import { classNames } from '../shared/utils.js';
13
+ import { colorClasses, colorProps } from '../shared/mixins.js';
14
+ export default {
15
+ name: 'f7-nav-title',
16
+ render,
17
+ props: {
18
+ title: String,
19
+ subtitle: String,
20
+ sliding: Boolean,
21
+ ...colorProps
22
+ },
23
+ setup(props) {
24
+ const classes = computed(() => classNames('title', {
25
+ sliding: props.sliding
26
+ }, colorClasses(props)));
27
+ return {
28
+ classes
29
+ };
30
+ }
31
+ };
@@ -0,0 +1,110 @@
1
+
2
+ import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
3
+
4
+
5
+ declare const Navbar: DefineComponent<
6
+ {
7
+
8
+ backLink: {
9
+ type: BooleanConstructor | StringConstructor;
10
+ },
11
+
12
+ backLinkUrl: {
13
+ type: StringConstructor;
14
+ },
15
+
16
+ backLinkForce: {
17
+ type: BooleanConstructor;
18
+ },
19
+
20
+ title: {
21
+ type: StringConstructor;
22
+ },
23
+
24
+ subtitle: {
25
+ type: StringConstructor;
26
+ },
27
+
28
+ hidden: {
29
+ type: BooleanConstructor;
30
+ },
31
+
32
+ innerClass: {
33
+ type: StringConstructor;
34
+ },
35
+
36
+ innerClassName: {
37
+ type: StringConstructor;
38
+ },
39
+
40
+ large: {
41
+ type: BooleanConstructor;
42
+ },
43
+
44
+ largeTransparent: {
45
+ type: BooleanConstructor;
46
+ },
47
+
48
+ transparent: {
49
+ type: BooleanConstructor;
50
+ },
51
+
52
+ titleLarge: {
53
+ type: StringConstructor;
54
+ },
55
+
56
+ backLinkShowText: {
57
+ type: BooleanConstructor;
58
+ default: undefined;
59
+ },
60
+
61
+ sliding: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ },
65
+
66
+ outline: {
67
+ type: any;
68
+ default: boolean;
69
+ },
70
+
71
+ color: {
72
+ type: StringConstructor;
73
+ },
74
+
75
+ colorTheme: {
76
+ type: StringConstructor;
77
+ },
78
+
79
+ textColor: {
80
+ type: StringConstructor;
81
+ },
82
+
83
+ bgColor: {
84
+ type: StringConstructor;
85
+ },
86
+
87
+ borderColor: {
88
+ type: StringConstructor;
89
+ },
90
+
91
+ rippleColor: {
92
+ type: StringConstructor;
93
+ },
94
+
95
+ dark: {
96
+ type: BooleanConstructor;
97
+ }
98
+ },
99
+ () => JSX.Element,
100
+ unknown,
101
+ {},
102
+ {},
103
+ ComponentOptionsMixin,
104
+ ComponentOptionsMixin,
105
+ ("navbar:hide" | "navbar:show" | "navbar:expand" | "navbar:collapse" | "navbar:transparentshow" | "navbar:transparenthide" | "click:back" | "back:click")[],
106
+ "navbar:hide" | "navbar:show" | "navbar:expand" | "navbar:collapse" | "navbar:transparentshow" | "navbar:transparenthide" | "click:back" | "back:click"
107
+ >;
108
+
109
+ export default Navbar;
110
+
@@ -0,0 +1,248 @@
1
+ import { createElementVNode as _createElementVNode, renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass } from "vue";
2
+ const _hoisted_1 = /*#__PURE__*/_createElementVNode("div", {
3
+ class: "navbar-bg"
4
+ }, null, -1);
5
+ const _hoisted_2 = {
6
+ key: 3,
7
+ className: "title-large"
8
+ };
9
+ const _hoisted_3 = {
10
+ className: "title-large-text"
11
+ };
12
+ function render(_ctx, _cache) {
13
+ const _component_f7_nav_left = _resolveComponent("f7-nav-left");
14
+ const _component_f7_nav_title = _resolveComponent("f7-nav-title");
15
+ const _component_f7_nav_right = _resolveComponent("f7-nav-right");
16
+ return _openBlock(), _createElementBlock("div", {
17
+ ref: "elRef",
18
+ class: _normalizeClass(_ctx.classes)
19
+ }, [_hoisted_1, _renderSlot(_ctx.$slots, "before-inner"), _createElementVNode("div", {
20
+ class: _normalizeClass(_ctx.innerClasses)
21
+ }, [_ctx.hasLeft ? (_openBlock(), _createBlock(_component_f7_nav_left, {
22
+ key: 0,
23
+ "back-link": _ctx.backLink,
24
+ "back-link-url": _ctx.backLinkUrl,
25
+ "back-link-force": _ctx.backLinkForce,
26
+ "back-link-show-text": _ctx.backLinkShowText,
27
+ "onBack:click": _ctx.onBackClick
28
+ }, {
29
+ default: _withCtx(() => [_renderSlot(_ctx.$slots, "nav-left"), _renderSlot(_ctx.$slots, "left")]),
30
+ _: 3
31
+ }, 8, ["back-link", "back-link-url", "back-link-force", "back-link-show-text", "onBack:click"])) : _createCommentVNode("", true), _ctx.hasTitle ? (_openBlock(), _createBlock(_component_f7_nav_title, {
32
+ key: 1,
33
+ title: _ctx.title,
34
+ subtitle: _ctx.subtitle
35
+ }, {
36
+ default: _withCtx(() => [_renderSlot(_ctx.$slots, "title")]),
37
+ _: 3
38
+ }, 8, ["title", "subtitle"])) : _createCommentVNode("", true), _ctx.hasRight ? (_openBlock(), _createBlock(_component_f7_nav_right, {
39
+ key: 2
40
+ }, {
41
+ default: _withCtx(() => [_renderSlot(_ctx.$slots, "nav-right"), _renderSlot(_ctx.$slots, "right")]),
42
+ _: 3
43
+ })) : _createCommentVNode("", true), _ctx.hasLargeTitle ? (_openBlock(), _createElementBlock("div", _hoisted_2, [_createElementVNode("div", _hoisted_3, [_createTextVNode(_toDisplayString(_ctx.largeTitle) + " ", 1), _renderSlot(_ctx.$slots, "title-large")])])) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "default")], 2), _renderSlot(_ctx.$slots, "after-inner")], 2);
44
+ }
45
+ import { computed, ref, onMounted, onBeforeUnmount } from 'vue';
46
+ import { classNames } from '../shared/utils.js';
47
+ import { colorClasses, colorProps } from '../shared/mixins.js';
48
+ import { f7ready, f7 } from '../shared/f7.js';
49
+ import { useTheme } from '../shared/use-theme.js';
50
+ import f7NavLeft from './nav-left.js';
51
+ import f7NavTitle from './nav-title.js';
52
+ import f7NavRight from './nav-right.js';
53
+ export default {
54
+ name: 'f7-navbar',
55
+ render,
56
+ components: {
57
+ f7NavLeft,
58
+ f7NavTitle,
59
+ f7NavRight
60
+ },
61
+ props: {
62
+ backLink: [Boolean, String],
63
+ backLinkUrl: String,
64
+ backLinkForce: Boolean,
65
+ backLinkShowText: {
66
+ type: Boolean,
67
+ default: undefined
68
+ },
69
+ sliding: {
70
+ type: Boolean,
71
+ default: true
72
+ },
73
+ title: String,
74
+ subtitle: String,
75
+ hidden: Boolean,
76
+ outline: {
77
+ type: Boolean,
78
+ default: true
79
+ },
80
+ innerClass: String,
81
+ innerClassName: String,
82
+ large: Boolean,
83
+ largeTransparent: Boolean,
84
+ transparent: Boolean,
85
+ titleLarge: String,
86
+ ...colorProps
87
+ },
88
+ emits: ['navbar:hide', 'navbar:show', 'navbar:expand', 'navbar:collapse', 'navbar:transparentshow', 'navbar:transparenthide', 'click:back', 'back:click'],
89
+ setup(props, _ref) {
90
+ let {
91
+ emit,
92
+ slots
93
+ } = _ref;
94
+ let routerPositionClass = '';
95
+ let largeCollapsed = false;
96
+ let routerNavbarRole = null;
97
+ let routerNavbarRoleDetailRoot = false;
98
+ let routerNavbarMasterStack = false;
99
+ let transparentVisible = false;
100
+ const elRef = ref(null);
101
+ const theme = useTheme();
102
+ const onHide = navbarEl => {
103
+ if (elRef.value !== navbarEl) return;
104
+ emit('navbar:hide');
105
+ };
106
+ const onShow = navbarEl => {
107
+ if (elRef.value !== navbarEl) return;
108
+ emit('navbar:show');
109
+ };
110
+ const onExpand = navbarEl => {
111
+ if (elRef.value !== navbarEl) return;
112
+ largeCollapsed = false;
113
+ emit('navbar:expand');
114
+ };
115
+ const onCollapse = navbarEl => {
116
+ if (elRef.value !== navbarEl) return;
117
+ largeCollapsed = true;
118
+ emit('navbar:collapse');
119
+ };
120
+ const onNavbarTransparentShow = navbarEl => {
121
+ if (elRef.value !== navbarEl) return;
122
+ transparentVisible = true;
123
+ emit('navbar:transparentshow');
124
+ };
125
+ const onNavbarTransparentHide = navbarEl => {
126
+ if (elRef.value !== navbarEl) return;
127
+ transparentVisible = false;
128
+ emit('navbar:transparenthide');
129
+ };
130
+ const onNavbarPosition = (navbarEl, position) => {
131
+ if (elRef.value !== navbarEl) return;
132
+ routerPositionClass = position ? `navbar-${position}` : '';
133
+ };
134
+ const onNavbarRole = (navbarEl, rolesData) => {
135
+ if (elRef.value !== navbarEl) return;
136
+ routerNavbarRole = rolesData.role;
137
+ routerNavbarRoleDetailRoot = rolesData.detailRoot;
138
+ };
139
+ const onNavbarMasterStack = navbarEl => {
140
+ if (elRef.value !== navbarEl) return;
141
+ routerNavbarMasterStack = true;
142
+ };
143
+ const onNavbarMasterUnstack = navbarEl => {
144
+ if (elRef.value !== navbarEl) return;
145
+ routerNavbarMasterStack = false;
146
+ };
147
+ const hide = animate => {
148
+ if (!f7) return;
149
+ f7.navbar.hide(elRef.value, animate);
150
+ };
151
+ const show = animate => {
152
+ if (!f7) return;
153
+ f7.navbar.show(elRef.value, animate);
154
+ };
155
+ const size = () => {
156
+ if (!f7) return;
157
+ f7.navbar.size(elRef.value);
158
+ };
159
+ const onBackClick = event => {
160
+ emit('back:click', event);
161
+ emit('click:back', event);
162
+ };
163
+ onMounted(() => {
164
+ if (!elRef.value) return;
165
+ f7ready(() => {
166
+ f7.navbar.size(elRef.value);
167
+ f7.on('navbarShow', onShow);
168
+ f7.on('navbarHide', onHide);
169
+ f7.on('navbarCollapse', onCollapse);
170
+ f7.on('navbarExpand', onExpand);
171
+ f7.on('navbarPosition', onNavbarPosition);
172
+ f7.on('navbarRole', onNavbarRole);
173
+ f7.on('navbarMasterStack', onNavbarMasterStack);
174
+ f7.on('navbarMasterUnstack', onNavbarMasterUnstack);
175
+ f7.on('navbarTransparentShow', onNavbarTransparentShow);
176
+ f7.on('navbarTransparentHide', onNavbarTransparentHide);
177
+ });
178
+ });
179
+ onBeforeUnmount(() => {
180
+ if (!f7) return;
181
+ f7.off('navbarShow', onShow);
182
+ f7.off('navbarHide', onHide);
183
+ f7.off('navbarCollapse', onCollapse);
184
+ f7.off('navbarExpand', onExpand);
185
+ f7.off('navbarPosition', onNavbarPosition);
186
+ f7.off('navbarRole', onNavbarRole);
187
+ f7.off('navbarMasterStack', onNavbarMasterStack);
188
+ f7.off('navbarMasterUnstack', onNavbarMasterUnstack);
189
+ f7.off('navbarTransparentShow', onNavbarTransparentShow);
190
+ f7.off('navbarTransparentHide', onNavbarTransparentHide);
191
+ });
192
+ const addLeftTitleClass = computed(() => theme.value && theme.value.ios && f7 && !f7.params.navbar.iosCenterTitle);
193
+ const addCenterTitleClass = computed(() => theme.value && theme.value.md && f7 && f7.params.navbar.mdCenterTitle);
194
+ const isLarge = computed(() => props.large || props.largeTransparent);
195
+ const isTransparent = computed(() => props.transparent || isLarge.value && props.largeTransparent);
196
+ const isTransparentVisible = computed(() => isTransparent.value && transparentVisible);
197
+ const classes = computed(() => classNames('navbar', routerPositionClass, {
198
+ 'navbar-hidden': props.hidden,
199
+ 'navbar-large': isLarge.value,
200
+ 'navbar-large-collapsed': isLarge.value && largeCollapsed,
201
+ 'navbar-transparent': isTransparent.value,
202
+ 'navbar-transparent-visible': isTransparentVisible.value,
203
+ 'navbar-master': routerNavbarRole === 'master',
204
+ 'navbar-master-detail': routerNavbarRole === 'detail',
205
+ 'navbar-master-detail-root': routerNavbarRoleDetailRoot === true,
206
+ 'navbar-master-stacked': routerNavbarMasterStack === true,
207
+ 'no-outline': !props.outline
208
+ }, colorClasses(props)));
209
+ const largeTitle = computed(() => {
210
+ let largeTitleText = props.titleLarge;
211
+ if (!largeTitleText && props.large && props.title) largeTitleText = props.title;
212
+ return largeTitleText;
213
+ });
214
+ const hasLeft = computed(() => {
215
+ return props.backLink || slots['nav-left'] || slots.left;
216
+ });
217
+ const hasTitle = computed(() => {
218
+ return props.title || props.subtitle || slots.title;
219
+ });
220
+ const hasRight = computed(() => {
221
+ return slots['nav-right'] || slots.right;
222
+ });
223
+ const hasLargeTitle = computed(() => {
224
+ return largeTitle.value || slots['title-large'];
225
+ });
226
+ const innerClasses = computed(() => {
227
+ return classNames('navbar-inner', props.innerClass, props.innerClassName, {
228
+ sliding: props.sliding,
229
+ 'navbar-inner-left-title': addLeftTitleClass.value,
230
+ 'navbar-inner-centered-title': addCenterTitleClass.value
231
+ });
232
+ });
233
+ return {
234
+ elRef,
235
+ classes,
236
+ innerClasses,
237
+ hide,
238
+ show,
239
+ size,
240
+ largeTitle,
241
+ hasLeft,
242
+ hasTitle,
243
+ hasRight,
244
+ hasLargeTitle,
245
+ onBackClick
246
+ };
247
+ }
248
+ };