@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.
- package/LICENSE +20 -0
- package/README.md +33 -0
- package/components/accordion-content.d.ts +46 -0
- package/components/accordion-content.js +22 -0
- package/components/accordion-item.d.ts +51 -0
- package/components/accordion-item.js +77 -0
- package/components/accordion-toggle.d.ts +46 -0
- package/components/accordion-toggle.js +22 -0
- package/components/accordion.d.ts +50 -0
- package/components/accordion.js +23 -0
- package/components/actions-button.d.ts +56 -0
- package/components/actions-button.js +58 -0
- package/components/actions-group.d.ts +46 -0
- package/components/actions-group.js +22 -0
- package/components/actions-label.d.ts +51 -0
- package/components/actions-label.js +36 -0
- package/components/actions.d.ts +109 -0
- package/components/actions.js +157 -0
- package/components/app.d.ts +310 -0
- package/components/app.js +267 -0
- package/components/area-chart.d.ts +88 -0
- package/components/area-chart.js +364 -0
- package/components/badge.d.ts +54 -0
- package/components/badge.js +29 -0
- package/components/block-footer.d.ts +46 -0
- package/components/block-footer.js +22 -0
- package/components/block-header.d.ts +46 -0
- package/components/block-header.js +22 -0
- package/components/block-title.d.ts +54 -0
- package/components/block-title.js +35 -0
- package/components/block.d.ts +163 -0
- package/components/block.js +123 -0
- package/components/breadcrumbs-collapsed.d.ts +19 -0
- package/components/breadcrumbs-collapsed.js +21 -0
- package/components/breadcrumbs-item.d.ts +22 -0
- package/components/breadcrumbs-item.js +24 -0
- package/components/breadcrumbs-separator.d.ts +19 -0
- package/components/breadcrumbs-separator.js +20 -0
- package/components/breadcrumbs.d.ts +19 -0
- package/components/breadcrumbs.js +20 -0
- package/components/button.d.ts +371 -0
- package/components/button.js +182 -0
- package/components/card-content.d.ts +51 -0
- package/components/card-content.js +28 -0
- package/components/card-footer.d.ts +46 -0
- package/components/card-footer.js +22 -0
- package/components/card-header.d.ts +46 -0
- package/components/card-header.js +22 -0
- package/components/card.d.ts +145 -0
- package/components/card.js +192 -0
- package/components/checkbox.d.ts +72 -0
- package/components/checkbox.js +70 -0
- package/components/chip.d.ts +107 -0
- package/components/chip.js +81 -0
- package/components/fab-backdrop.d.ts +46 -0
- package/components/fab-backdrop.js +22 -0
- package/components/fab-button.d.ts +67 -0
- package/components/fab-button.js +52 -0
- package/components/fab-buttons.d.ts +51 -0
- package/components/fab-buttons.js +26 -0
- package/components/fab.d.ts +76 -0
- package/components/fab.js +78 -0
- package/components/gauge.d.ts +91 -0
- package/components/gauge.js +151 -0
- package/components/icon.d.ts +78 -0
- package/components/icon.js +100 -0
- package/components/input.d.ts +226 -0
- package/components/input.js +409 -0
- package/components/link.d.ts +287 -0
- package/components/link.js +129 -0
- package/components/list-button.d.ts +239 -0
- package/components/list-button.js +71 -0
- package/components/list-group.d.ts +71 -0
- package/components/list-group.js +53 -0
- package/components/list-index.d.ts +81 -0
- package/components/list-index.js +96 -0
- package/components/list-input.d.ts +245 -0
- package/components/list-input.js +415 -0
- package/components/list-item.d.ts +370 -0
- package/components/list-item.js +451 -0
- package/components/list.d.ts +236 -0
- package/components/list.js +222 -0
- package/components/login-screen-title.d.ts +46 -0
- package/components/login-screen-title.js +22 -0
- package/components/login-screen.d.ts +61 -0
- package/components/login-screen.js +104 -0
- package/components/message.d.ts +116 -0
- package/components/message.js +169 -0
- package/components/messagebar-attachment.d.ts +56 -0
- package/components/messagebar-attachment.js +52 -0
- package/components/messagebar-attachments.d.ts +46 -0
- package/components/messagebar-attachments.js +22 -0
- package/components/messagebar-sheet-image.d.ts +55 -0
- package/components/messagebar-sheet-image.js +48 -0
- package/components/messagebar-sheet-item.d.ts +46 -0
- package/components/messagebar-sheet-item.js +22 -0
- package/components/messagebar-sheet.d.ts +46 -0
- package/components/messagebar-sheet.js +22 -0
- package/components/messagebar.d.ts +117 -0
- package/components/messagebar.js +193 -0
- package/components/messages-title.d.ts +46 -0
- package/components/messages-title.js +22 -0
- package/components/messages.d.ts +116 -0
- package/components/messages.js +134 -0
- package/components/nav-left.d.ts +68 -0
- package/components/nav-left.js +66 -0
- package/components/nav-right.d.ts +50 -0
- package/components/nav-right.js +25 -0
- package/components/nav-title-large.d.ts +46 -0
- package/components/nav-title-large.js +25 -0
- package/components/nav-title.d.ts +58 -0
- package/components/nav-title.js +31 -0
- package/components/navbar.d.ts +110 -0
- package/components/navbar.js +248 -0
- package/components/page-content.d.ts +113 -0
- package/components/page-content.js +147 -0
- package/components/page.d.ts +150 -0
- package/components/page.js +331 -0
- package/components/panel.d.ts +139 -0
- package/components/panel.js +198 -0
- package/components/photo-browser.d.ts +164 -0
- package/components/photo-browser.js +181 -0
- package/components/pie-chart.d.ts +37 -0
- package/components/pie-chart.js +172 -0
- package/components/popover.d.ts +101 -0
- package/components/popover.js +157 -0
- package/components/popup.d.ts +99 -0
- package/components/popup.js +161 -0
- package/components/preloader.d.ts +50 -0
- package/components/preloader.js +65 -0
- package/components/progressbar.d.ts +54 -0
- package/components/progressbar.js +44 -0
- package/components/radio.d.ts +68 -0
- package/components/radio.js +59 -0
- package/components/range.d.ts +141 -0
- package/components/range.js +139 -0
- package/components/routable-modals.d.ts +19 -0
- package/components/routable-modals.js +58 -0
- package/components/searchbar.d.ts +182 -0
- package/components/searchbar.js +285 -0
- package/components/segmented.d.ts +87 -0
- package/components/segmented.js +53 -0
- package/components/sheet.d.ts +132 -0
- package/components/sheet.js +213 -0
- package/components/skeleton-avatar.d.ts +6 -0
- package/components/skeleton-avatar.js +3 -0
- package/components/skeleton-block.d.ts +6 -0
- package/components/skeleton-block.js +3 -0
- package/components/skeleton-image.d.ts +6 -0
- package/components/skeleton-image.js +3 -0
- package/components/skeleton-text.d.ts +6 -0
- package/components/skeleton-text.js +3 -0
- package/components/stepper.d.ts +197 -0
- package/components/stepper.js +230 -0
- package/components/subnavbar.d.ts +59 -0
- package/components/subnavbar.js +40 -0
- package/components/swipeout-actions.d.ts +58 -0
- package/components/swipeout-actions.js +33 -0
- package/components/swipeout-button.d.ts +75 -0
- package/components/swipeout-button.js +48 -0
- package/components/tab.d.ts +51 -0
- package/components/tab.js +128 -0
- package/components/tabs.d.ts +63 -0
- package/components/tabs.js +59 -0
- package/components/text-editor.d.ts +95 -0
- package/components/text-editor.js +147 -0
- package/components/toggle.d.ts +80 -0
- package/components/toggle.js +89 -0
- package/components/toolbar.d.ts +108 -0
- package/components/toolbar.js +135 -0
- package/components/treeview-item.d.ts +265 -0
- package/components/treeview-item.js +140 -0
- package/components/treeview.d.ts +46 -0
- package/components/treeview.js +22 -0
- package/components/use-icon.d.ts +19 -0
- package/components/use-icon.js +27 -0
- package/components/view.d.ts +296 -0
- package/components/view.js +373 -0
- package/components/views.d.ts +50 -0
- package/components/views.js +25 -0
- package/framework7-vue-bundle.js +190 -0
- package/framework7-vue.d.ts +121 -0
- package/framework7-vue.js +108 -0
- package/package.json +65 -0
- package/shared/components-router.js +203 -0
- package/shared/f7.js +71 -0
- package/shared/get-router-initial-component.js +35 -0
- package/shared/mixins.js +233 -0
- package/shared/modal-state-classes.js +10 -0
- package/shared/plugin.js +37 -0
- package/shared/router-open-in.js +105 -0
- package/shared/use-icon.js +37 -0
- package/shared/use-route-props.js +18 -0
- package/shared/use-smart-select.js +24 -0
- package/shared/use-store.js +24 -0
- package/shared/use-tab.js +24 -0
- package/shared/use-theme.js +11 -0
- package/shared/use-tooltip.js +43 -0
- package/shared/utils.js +110 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const TreeviewItem: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
itemToggle: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
selectable: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
selected: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
opened: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
label: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
loadChildren: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
toggle: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
default: undefined;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
link: {
|
|
38
|
+
type: BooleanConstructor | StringConstructor;
|
|
39
|
+
default: undefined;
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
color: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
colorTheme: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
textColor: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
bgColor: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
borderColor: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
rippleColor: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
dark: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
searchbarEnable: {
|
|
71
|
+
type: BooleanConstructor | StringConstructor;
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
searchbarDisable: {
|
|
75
|
+
type: BooleanConstructor | StringConstructor;
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
searchbarClear: {
|
|
79
|
+
type: BooleanConstructor | StringConstructor;
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
searchbarToggle: {
|
|
83
|
+
type: BooleanConstructor | StringConstructor;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
panelOpen: {
|
|
87
|
+
type: BooleanConstructor | StringConstructor;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
panelClose: {
|
|
91
|
+
type: BooleanConstructor | StringConstructor;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
panelToggle: {
|
|
95
|
+
type: BooleanConstructor | StringConstructor;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
popupOpen: {
|
|
99
|
+
type: BooleanConstructor | StringConstructor;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
popupClose: {
|
|
103
|
+
type: BooleanConstructor | StringConstructor;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
actionsOpen: {
|
|
107
|
+
type: BooleanConstructor | StringConstructor;
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
actionsClose: {
|
|
111
|
+
type: BooleanConstructor | StringConstructor;
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
popoverOpen: {
|
|
115
|
+
type: BooleanConstructor | StringConstructor;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
popoverClose: {
|
|
119
|
+
type: BooleanConstructor | StringConstructor;
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
loginScreenOpen: {
|
|
123
|
+
type: BooleanConstructor | StringConstructor;
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
loginScreenClose: {
|
|
127
|
+
type: BooleanConstructor | StringConstructor;
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
sheetOpen: {
|
|
131
|
+
type: BooleanConstructor | StringConstructor;
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
sheetClose: {
|
|
135
|
+
type: BooleanConstructor | StringConstructor;
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
sortableEnable: {
|
|
139
|
+
type: BooleanConstructor | StringConstructor;
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
sortableDisable: {
|
|
143
|
+
type: BooleanConstructor | StringConstructor;
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
sortableToggle: {
|
|
147
|
+
type: BooleanConstructor | StringConstructor;
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
cardOpen: {
|
|
151
|
+
type: BooleanConstructor | StringConstructor;
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
cardPreventOpen: {
|
|
155
|
+
type: BooleanConstructor | StringConstructor;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
cardClose: {
|
|
159
|
+
type: BooleanConstructor | StringConstructor;
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
menuClose: {
|
|
163
|
+
type: BooleanConstructor | StringConstructor;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
icon: {
|
|
167
|
+
type: StringConstructor;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
iconMaterial: {
|
|
171
|
+
type: StringConstructor;
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
iconF7: {
|
|
175
|
+
type: StringConstructor;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
iconIos: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
iconMd: {
|
|
183
|
+
type: StringConstructor;
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
iconColor: {
|
|
187
|
+
type: StringConstructor;
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
iconSize: {
|
|
191
|
+
type: StringConstructor | NumberConstructor;
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
back: {
|
|
195
|
+
type: BooleanConstructor;
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
external: {
|
|
199
|
+
type: BooleanConstructor;
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
force: {
|
|
203
|
+
type: BooleanConstructor;
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
animate: {
|
|
207
|
+
type: BooleanConstructor;
|
|
208
|
+
},
|
|
209
|
+
|
|
210
|
+
ignoreCache: {
|
|
211
|
+
type: BooleanConstructor;
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
reloadCurrent: {
|
|
215
|
+
type: BooleanConstructor;
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
reloadAll: {
|
|
219
|
+
type: BooleanConstructor;
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
reloadPrevious: {
|
|
223
|
+
type: BooleanConstructor;
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
reloadDetail: {
|
|
227
|
+
type: BooleanConstructor;
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
routeTabId: {
|
|
231
|
+
type: StringConstructor;
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
view: {
|
|
235
|
+
type: StringConstructor;
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
routeProps: {
|
|
239
|
+
type: ObjectConstructor;
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
preventRouter: {
|
|
243
|
+
type: BooleanConstructor;
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
transition: {
|
|
247
|
+
type: StringConstructor;
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
openIn: {
|
|
251
|
+
type: StringConstructor;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
() => JSX.Element,
|
|
255
|
+
unknown,
|
|
256
|
+
{},
|
|
257
|
+
{},
|
|
258
|
+
ComponentOptionsMixin,
|
|
259
|
+
ComponentOptionsMixin,
|
|
260
|
+
("click" | "treeview:open" | "treeview:close" | "treeview:loadchildren")[],
|
|
261
|
+
"click" | "treeview:open" | "treeview:close" | "treeview:loadchildren"
|
|
262
|
+
>;
|
|
263
|
+
|
|
264
|
+
export default TreeviewItem;
|
|
265
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, mergeProps as _mergeProps, withCtx as _withCtx, normalizeClass as _normalizeClass } from "vue";
|
|
2
|
+
const _hoisted_1 = {
|
|
3
|
+
key: 0,
|
|
4
|
+
className: "treeview-toggle"
|
|
5
|
+
};
|
|
6
|
+
const _hoisted_2 = {
|
|
7
|
+
className: "treeview-item-content"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_3 = {
|
|
10
|
+
className: "treeview-item-label"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_4 = {
|
|
13
|
+
key: 0,
|
|
14
|
+
className: "treeview-item-children"
|
|
15
|
+
};
|
|
16
|
+
function render(_ctx, _cache) {
|
|
17
|
+
const _component_f7_use_icon = _resolveComponent("f7-use-icon");
|
|
18
|
+
return _openBlock(), _createElementBlock("div", {
|
|
19
|
+
ref: "elRef",
|
|
20
|
+
class: _normalizeClass(_ctx.classes)
|
|
21
|
+
}, [(_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.itemRootTag), _mergeProps({
|
|
22
|
+
class: _ctx.itemRootClasses
|
|
23
|
+
}, _ctx.itemRootAttrs, {
|
|
24
|
+
onClick: _ctx.onClick
|
|
25
|
+
}), {
|
|
26
|
+
default: _withCtx(() => [_renderSlot(_ctx.$slots, "root-start"), _ctx.needToggle ? (_openBlock(), _createElementBlock("div", _hoisted_1)) : _createCommentVNode("", true), _createElementVNode("div", _hoisted_2, [_renderSlot(_ctx.$slots, "content-start"), _ctx.icon ? (_openBlock(), _createBlock(_component_f7_use_icon, {
|
|
27
|
+
key: 0,
|
|
28
|
+
icon: _ctx.icon
|
|
29
|
+
}, null, 8, ["icon"])) : _createCommentVNode("", true), _renderSlot(_ctx.$slots, "media"), _createElementVNode("div", _hoisted_3, [_renderSlot(_ctx.$slots, "label-start"), _createTextVNode(" " + _toDisplayString(_ctx.label) + " ", 1), _renderSlot(_ctx.$slots, "label")]), _renderSlot(_ctx.$slots, "content"), _renderSlot(_ctx.$slots, "content-end")]), _renderSlot(_ctx.$slots, "root"), _renderSlot(_ctx.$slots, "root-end")]),
|
|
30
|
+
_: 3
|
|
31
|
+
}, 16, ["class", "onClick"])), _ctx.hasChildren ? (_openBlock(), _createElementBlock("div", _hoisted_4, [_renderSlot(_ctx.$slots, "children-start"), _renderSlot(_ctx.$slots, "default"), _renderSlot(_ctx.$slots, "children")])) : _createCommentVNode("", true)], 2);
|
|
32
|
+
}
|
|
33
|
+
import { computed, ref, onMounted, onBeforeUnmount } from 'vue';
|
|
34
|
+
import { classNames } from '../shared/utils.js';
|
|
35
|
+
import { colorClasses, colorProps, actionsAttrs, actionsProps, actionsClasses, routerAttrs, routerProps, routerClasses, iconProps } from '../shared/mixins.js';
|
|
36
|
+
import { useIcon } from '../shared/use-icon.js';
|
|
37
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
38
|
+
import f7UseIcon from './use-icon.js';
|
|
39
|
+
export default {
|
|
40
|
+
name: 'f7-treeview-item',
|
|
41
|
+
render,
|
|
42
|
+
components: {
|
|
43
|
+
f7UseIcon
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
toggle: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: undefined
|
|
49
|
+
},
|
|
50
|
+
itemToggle: Boolean,
|
|
51
|
+
selectable: Boolean,
|
|
52
|
+
selected: Boolean,
|
|
53
|
+
opened: Boolean,
|
|
54
|
+
label: String,
|
|
55
|
+
loadChildren: Boolean,
|
|
56
|
+
link: {
|
|
57
|
+
type: [Boolean, String],
|
|
58
|
+
default: undefined
|
|
59
|
+
},
|
|
60
|
+
...colorProps,
|
|
61
|
+
...actionsProps,
|
|
62
|
+
...iconProps,
|
|
63
|
+
...routerProps
|
|
64
|
+
},
|
|
65
|
+
emits: ['click', 'treeview:open', 'treeview:close', 'treeview:loadchildren'],
|
|
66
|
+
setup(props, _ref) {
|
|
67
|
+
let {
|
|
68
|
+
slots,
|
|
69
|
+
emit
|
|
70
|
+
} = _ref;
|
|
71
|
+
const elRef = ref(null);
|
|
72
|
+
const hasChildren = computed(() => {
|
|
73
|
+
return slots.default || slots.children || slots['children-start'];
|
|
74
|
+
});
|
|
75
|
+
const needToggle = computed(() => typeof props.toggle === 'undefined' ? hasChildren.value : props.toggle);
|
|
76
|
+
const icon = computed(() => useIcon(props));
|
|
77
|
+
const onClick = event => {
|
|
78
|
+
emit('click', event);
|
|
79
|
+
};
|
|
80
|
+
const onOpen = el => {
|
|
81
|
+
if (elRef.value !== el) return;
|
|
82
|
+
emit('treeview:open', el);
|
|
83
|
+
};
|
|
84
|
+
const onClose = el => {
|
|
85
|
+
if (elRef.value !== el) return;
|
|
86
|
+
emit('treeview:close', el);
|
|
87
|
+
};
|
|
88
|
+
const onLoadChildren = (el, done) => {
|
|
89
|
+
if (elRef.value !== el) return;
|
|
90
|
+
emit('treeview:loadchildren', el, done);
|
|
91
|
+
};
|
|
92
|
+
const attachEvents = () => {
|
|
93
|
+
if (!elRef.value) return;
|
|
94
|
+
f7ready(() => {
|
|
95
|
+
f7.on('treeviewOpen', onOpen);
|
|
96
|
+
f7.on('treeviewClose', onClose);
|
|
97
|
+
f7.on('treeviewLoadChildren', onLoadChildren);
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
const detachEvents = () => {
|
|
101
|
+
if (!f7) return;
|
|
102
|
+
f7.off('treeviewOpen', onOpen);
|
|
103
|
+
f7.off('treeviewClose', onClose);
|
|
104
|
+
f7.off('treeviewLoadChildren', onLoadChildren);
|
|
105
|
+
};
|
|
106
|
+
onMounted(() => attachEvents());
|
|
107
|
+
onBeforeUnmount(() => detachEvents());
|
|
108
|
+
const classes = computed(() => classNames('treeview-item', {
|
|
109
|
+
'treeview-item-opened': props.opened,
|
|
110
|
+
'treeview-load-children': props.loadChildren
|
|
111
|
+
}, colorClasses(props)));
|
|
112
|
+
const itemRootClasses = computed(() => classNames('treeview-item-root', {
|
|
113
|
+
'treeview-item-selectable': props.selectable,
|
|
114
|
+
'treeview-item-selected': props.selected,
|
|
115
|
+
'treeview-item-toggle': props.itemToggle
|
|
116
|
+
}, routerClasses(props), actionsClasses(props)));
|
|
117
|
+
const itemRootTag = computed(() => props.link || props.link === '' ? 'a' : 'div');
|
|
118
|
+
const itemRootAttrs = computed(() => {
|
|
119
|
+
let href = props.link;
|
|
120
|
+
if (props.link === true) href = '#';
|
|
121
|
+
if (props.link === false) href = undefined; // no href attribute
|
|
122
|
+
return {
|
|
123
|
+
href,
|
|
124
|
+
...routerAttrs(props),
|
|
125
|
+
...actionsAttrs(props)
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
itemRootTag,
|
|
130
|
+
itemRootAttrs,
|
|
131
|
+
itemRootClasses,
|
|
132
|
+
classes,
|
|
133
|
+
icon,
|
|
134
|
+
onClick,
|
|
135
|
+
hasChildren,
|
|
136
|
+
needToggle,
|
|
137
|
+
elRef
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Treeview: 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 Treeview;
|
|
46
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
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-treeview',
|
|
12
|
+
render,
|
|
13
|
+
props: {
|
|
14
|
+
...colorProps
|
|
15
|
+
},
|
|
16
|
+
setup(props) {
|
|
17
|
+
const classes = computed(() => classNames('treeview', colorClasses(props)));
|
|
18
|
+
return {
|
|
19
|
+
classes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const UseIcon: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
},
|
|
9
|
+
() => JSX.Element,
|
|
10
|
+
unknown,
|
|
11
|
+
{},
|
|
12
|
+
{},
|
|
13
|
+
ComponentOptionsMixin,
|
|
14
|
+
ComponentOptionsMixin,
|
|
15
|
+
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export default UseIcon;
|
|
19
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, mergeProps as _mergeProps, createCommentVNode as _createCommentVNode } from "vue";
|
|
2
|
+
function render(_ctx, _cache) {
|
|
3
|
+
const _component_f7_badge = _resolveComponent("f7-badge");
|
|
4
|
+
const _component_f7_icon = _resolveComponent("f7-icon");
|
|
5
|
+
return _openBlock(), _createBlock(_component_f7_icon, _normalizeProps(_guardReactiveProps(_ctx.icon.props)), {
|
|
6
|
+
default: _withCtx(() => [_ctx.icon.badge ? (_openBlock(), _createBlock(_component_f7_badge, _normalizeProps(_mergeProps({
|
|
7
|
+
key: 0
|
|
8
|
+
}, _ctx.icon.badge.props)), {
|
|
9
|
+
default: _withCtx(() => [_createTextVNode(_toDisplayString(_ctx.icon.badge.content), 1)]),
|
|
10
|
+
_: 1
|
|
11
|
+
}, 16)) : _createCommentVNode("", true)]),
|
|
12
|
+
_: 1
|
|
13
|
+
}, 16);
|
|
14
|
+
}
|
|
15
|
+
import f7Icon from './icon.js';
|
|
16
|
+
import f7Badge from './badge.js';
|
|
17
|
+
export default {
|
|
18
|
+
name: 'f7-use-icon',
|
|
19
|
+
render,
|
|
20
|
+
components: {
|
|
21
|
+
f7Icon,
|
|
22
|
+
f7Badge
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
icon: Object
|
|
26
|
+
}
|
|
27
|
+
};
|