@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,95 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const TextEditor: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
buttons: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
customButtons: {
|
|
13
|
+
type: ObjectConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
mode: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: undefined;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
value: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: undefined;
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
dividers: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
default: undefined;
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
imageUrlText: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: undefined;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
linkUrlText: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
default: undefined;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
default: undefined;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
clearFormattingOnPaste: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: undefined;
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
resizable: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
color: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
colorTheme: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
textColor: {
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
bgColor: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
borderColor: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
rippleColor: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
dark: {
|
|
81
|
+
type: BooleanConstructor;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
() => JSX.Element,
|
|
85
|
+
unknown,
|
|
86
|
+
{},
|
|
87
|
+
{},
|
|
88
|
+
ComponentOptionsMixin,
|
|
89
|
+
ComponentOptionsMixin,
|
|
90
|
+
("texteditor:change" | "texteditor:input" | "texteditor:focus" | "texteditor:blur" | "texteditor:buttonclick" | "texteditor:keyboardopen" | "texteditor:keyboardclose" | "texteditor:popoveropen" | "texteditor:popoverclose" | "texteditor:insertlink" | "texteditor:insertimage" | "texteditorChange" | "texteditorInput" | "texteditorFocus" | "texteditorBlur")[],
|
|
91
|
+
"texteditor:change" | "texteditor:input" | "texteditor:focus" | "texteditor:blur" | "texteditor:buttonclick" | "texteditor:keyboardopen" | "texteditor:keyboardclose" | "texteditor:popoveropen" | "texteditor:popoverclose" | "texteditor:insertlink" | "texteditor:insertimage" | "texteditorChange" | "texteditorInput" | "texteditorFocus" | "texteditorBlur"
|
|
92
|
+
>;
|
|
93
|
+
|
|
94
|
+
export default TextEditor;
|
|
95
|
+
|
|
@@ -0,0 +1,147 @@
|
|
|
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: "text-editor-content",
|
|
4
|
+
contenteditable: ""
|
|
5
|
+
};
|
|
6
|
+
function render(_ctx, _cache) {
|
|
7
|
+
return _openBlock(), _createElementBlock("div", {
|
|
8
|
+
ref: "elRef",
|
|
9
|
+
class: _normalizeClass(_ctx.classes)
|
|
10
|
+
}, [_renderSlot(_ctx.$slots, "root-start"), _createElementVNode("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")]), _renderSlot(_ctx.$slots, "root-end"), _renderSlot(_ctx.$slots, "root")], 2);
|
|
11
|
+
}
|
|
12
|
+
import { computed, ref, onMounted, onBeforeUnmount, watch } from 'vue';
|
|
13
|
+
import { classNames, noUndefinedProps } from '../shared/utils.js';
|
|
14
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
15
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
16
|
+
export default {
|
|
17
|
+
name: 'f7-text-editor',
|
|
18
|
+
render,
|
|
19
|
+
props: {
|
|
20
|
+
mode: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: undefined
|
|
23
|
+
},
|
|
24
|
+
value: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: undefined
|
|
27
|
+
},
|
|
28
|
+
buttons: Array,
|
|
29
|
+
customButtons: Object,
|
|
30
|
+
dividers: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: undefined
|
|
33
|
+
},
|
|
34
|
+
imageUrlText: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: undefined
|
|
37
|
+
},
|
|
38
|
+
linkUrlText: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
placeholder: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
clearFormattingOnPaste: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: undefined
|
|
49
|
+
},
|
|
50
|
+
resizable: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
...colorProps
|
|
55
|
+
},
|
|
56
|
+
emits: ['texteditor:change', 'texteditor:input', 'texteditor:focus', 'texteditor:blur', 'texteditor:buttonclick', 'texteditor:keyboardopen', 'texteditor:keyboardclose', 'texteditor:popoveropen', 'texteditor:popoverclose', 'texteditor:insertlink', 'texteditor:insertimage', 'texteditorChange', 'texteditorInput', 'texteditorFocus', 'texteditorBlur'],
|
|
57
|
+
setup(props, _ref) {
|
|
58
|
+
let {
|
|
59
|
+
emit
|
|
60
|
+
} = _ref;
|
|
61
|
+
let f7TextEditor = null;
|
|
62
|
+
const elRef = ref(null);
|
|
63
|
+
const onChange = (editor, editorValue) => {
|
|
64
|
+
emit('texteditor:change', editorValue);
|
|
65
|
+
emit('texteditorChange', editorValue);
|
|
66
|
+
};
|
|
67
|
+
const onInput = (editor, editorValue) => {
|
|
68
|
+
emit('texteditor:input', editorValue);
|
|
69
|
+
emit('texteditorInput', editorValue);
|
|
70
|
+
};
|
|
71
|
+
const onFocus = () => {
|
|
72
|
+
emit('texteditor:focus');
|
|
73
|
+
emit('texteditorFocus');
|
|
74
|
+
};
|
|
75
|
+
const onBlur = () => {
|
|
76
|
+
emit('texteditor:blur');
|
|
77
|
+
emit('texteditorBlur');
|
|
78
|
+
};
|
|
79
|
+
const onButtonClick = (editor, button) => {
|
|
80
|
+
emit('texteditor:buttonclick', button);
|
|
81
|
+
};
|
|
82
|
+
const onKeyboardOpen = () => {
|
|
83
|
+
emit('texteditor:keyboardopen');
|
|
84
|
+
};
|
|
85
|
+
const onKeyboardClose = () => {
|
|
86
|
+
emit('texteditor:keyboardclose');
|
|
87
|
+
};
|
|
88
|
+
const onPopoverOpen = () => {
|
|
89
|
+
emit('texteditor:popoveropen');
|
|
90
|
+
};
|
|
91
|
+
const onPopoverClose = () => {
|
|
92
|
+
emit('texteditor:popoverclose');
|
|
93
|
+
};
|
|
94
|
+
const onInsertLink = (editor, url) => {
|
|
95
|
+
emit('texteditor:insertlink', url);
|
|
96
|
+
};
|
|
97
|
+
const onInsertImage = (editor, url) => {
|
|
98
|
+
emit('texteditor:insertimage', url);
|
|
99
|
+
};
|
|
100
|
+
watch(() => props.value, newValue => {
|
|
101
|
+
if (f7TextEditor) {
|
|
102
|
+
f7TextEditor.setValue(newValue);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
onMounted(() => {
|
|
106
|
+
const params = noUndefinedProps({
|
|
107
|
+
el: elRef.value,
|
|
108
|
+
mode: props.mode,
|
|
109
|
+
value: props.value,
|
|
110
|
+
buttons: props.buttons,
|
|
111
|
+
customButtons: props.customButtons,
|
|
112
|
+
dividers: props.dividers,
|
|
113
|
+
imageUrlText: props.imageUrlText,
|
|
114
|
+
linkUrlText: props.linkUrlText,
|
|
115
|
+
placeholder: props.placeholder,
|
|
116
|
+
clearFormattingOnPaste: props.clearFormattingOnPaste,
|
|
117
|
+
on: {
|
|
118
|
+
change: onChange,
|
|
119
|
+
input: onInput,
|
|
120
|
+
focus: onFocus,
|
|
121
|
+
blur: onBlur,
|
|
122
|
+
buttonClick: onButtonClick,
|
|
123
|
+
keyboardOpen: onKeyboardOpen,
|
|
124
|
+
keyboardClose: onKeyboardClose,
|
|
125
|
+
popoverOpen: onPopoverOpen,
|
|
126
|
+
popoverClose: onPopoverClose,
|
|
127
|
+
insertLink: onInsertLink,
|
|
128
|
+
insertImage: onInsertImage
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
f7ready(() => {
|
|
132
|
+
f7TextEditor = f7.textEditor.create(params);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
onBeforeUnmount(() => {
|
|
136
|
+
if (f7TextEditor && f7TextEditor.destroy) {
|
|
137
|
+
f7TextEditor.destroy();
|
|
138
|
+
}
|
|
139
|
+
f7TextEditor = null;
|
|
140
|
+
});
|
|
141
|
+
const classes = computed(() => classNames('text-editor', props.resizable && 'text-editor-resizable', colorClasses(props)));
|
|
142
|
+
return {
|
|
143
|
+
elRef,
|
|
144
|
+
classes
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Toggle: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
checked: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
disabled: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
readonly: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
name: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
value: {
|
|
25
|
+
type: StringConstructor | NumberConstructor | ArrayConstructor;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
tooltip: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
tooltipTrigger: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
init: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
default: boolean;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
color: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
colorTheme: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
textColor: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
bgColor: {
|
|
54
|
+
type: StringConstructor;
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
borderColor: {
|
|
58
|
+
type: StringConstructor;
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
rippleColor: {
|
|
62
|
+
type: StringConstructor;
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
dark: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
() => JSX.Element,
|
|
70
|
+
unknown,
|
|
71
|
+
{},
|
|
72
|
+
{},
|
|
73
|
+
ComponentOptionsMixin,
|
|
74
|
+
ComponentOptionsMixin,
|
|
75
|
+
("change" | "toggle:change" | "update:checked")[],
|
|
76
|
+
"change" | "toggle:change" | "update:checked"
|
|
77
|
+
>;
|
|
78
|
+
|
|
79
|
+
export default Toggle;
|
|
80
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
2
|
+
const _hoisted_1 = ["name", "disabled", "readonly", "checked", "value"];
|
|
3
|
+
const _hoisted_2 = /*#__PURE__*/_createElementVNode("span", {
|
|
4
|
+
class: "toggle-icon"
|
|
5
|
+
}, null, -1);
|
|
6
|
+
function render(_ctx, _cache) {
|
|
7
|
+
return _openBlock(), _createElementBlock("label", {
|
|
8
|
+
ref: "elRef",
|
|
9
|
+
class: _normalizeClass(_ctx.classes)
|
|
10
|
+
}, [_createElementVNode("input", {
|
|
11
|
+
type: "checkbox",
|
|
12
|
+
name: _ctx.name,
|
|
13
|
+
disabled: _ctx.disabled,
|
|
14
|
+
readonly: _ctx.readonly,
|
|
15
|
+
checked: _ctx.checked,
|
|
16
|
+
value: _ctx.value,
|
|
17
|
+
onChange: _cache[0] || (_cache[0] = function () {
|
|
18
|
+
return _ctx.onChange && _ctx.onChange(...arguments);
|
|
19
|
+
})
|
|
20
|
+
}, null, 40, _hoisted_1), _hoisted_2], 2);
|
|
21
|
+
}
|
|
22
|
+
import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
23
|
+
import { classNames } from '../shared/utils.js';
|
|
24
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
25
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
26
|
+
import { useTooltip } from '../shared/use-tooltip.js';
|
|
27
|
+
export default {
|
|
28
|
+
name: 'f7-toggle',
|
|
29
|
+
render,
|
|
30
|
+
props: {
|
|
31
|
+
init: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
checked: Boolean,
|
|
36
|
+
disabled: Boolean,
|
|
37
|
+
readonly: Boolean,
|
|
38
|
+
name: String,
|
|
39
|
+
value: [String, Number, Array],
|
|
40
|
+
tooltip: String,
|
|
41
|
+
tooltipTrigger: String,
|
|
42
|
+
...colorProps
|
|
43
|
+
},
|
|
44
|
+
emits: ['change', 'toggle:change', 'update:checked'],
|
|
45
|
+
setup(props, _ref) {
|
|
46
|
+
let {
|
|
47
|
+
emit
|
|
48
|
+
} = _ref;
|
|
49
|
+
let f7Toggle = null;
|
|
50
|
+
const elRef = ref(null);
|
|
51
|
+
useTooltip(elRef, props);
|
|
52
|
+
const onChange = event => {
|
|
53
|
+
emit('change', event);
|
|
54
|
+
};
|
|
55
|
+
watch(() => props.checked, newValue => {
|
|
56
|
+
if (!f7Toggle) return;
|
|
57
|
+
f7Toggle.checked = newValue;
|
|
58
|
+
});
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
f7ready(() => {
|
|
61
|
+
if (!props.init || !elRef.value) return;
|
|
62
|
+
f7Toggle = f7.toggle.create({
|
|
63
|
+
el: elRef.value,
|
|
64
|
+
on: {
|
|
65
|
+
change(toggleInstance) {
|
|
66
|
+
emit('toggle:change', toggleInstance.checked);
|
|
67
|
+
emit('update:checked', toggleInstance.checked);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
onBeforeUnmount(() => {
|
|
74
|
+
if (f7Toggle && f7Toggle.destroy && f7Toggle.$el) {
|
|
75
|
+
f7Toggle.destroy();
|
|
76
|
+
}
|
|
77
|
+
f7Toggle = null;
|
|
78
|
+
});
|
|
79
|
+
const classes = computed(() => classNames('toggle', {
|
|
80
|
+
disabled: props.disabled
|
|
81
|
+
}, colorClasses(props)));
|
|
82
|
+
return {
|
|
83
|
+
classes,
|
|
84
|
+
elRef,
|
|
85
|
+
f7Toggle,
|
|
86
|
+
onChange
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Toolbar: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
tabbar: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
icons: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
scrollable: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
hidden: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
outline: {
|
|
25
|
+
type: any;
|
|
26
|
+
default: boolean;
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
position: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
topMd: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: undefined;
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
topIos: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: undefined;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
top: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: undefined;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
bottomMd: {
|
|
50
|
+
type: BooleanConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
bottomIos: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: undefined;
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
bottom: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: undefined;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
inner: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
default: boolean;
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
color: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
colorTheme: {
|
|
74
|
+
type: StringConstructor;
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
textColor: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
bgColor: {
|
|
82
|
+
type: StringConstructor;
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
borderColor: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
rippleColor: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
dark: {
|
|
94
|
+
type: BooleanConstructor;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
() => JSX.Element,
|
|
98
|
+
unknown,
|
|
99
|
+
{},
|
|
100
|
+
{},
|
|
101
|
+
ComponentOptionsMixin,
|
|
102
|
+
ComponentOptionsMixin,
|
|
103
|
+
("toolbar:hide" | "toolbar:show")[],
|
|
104
|
+
"toolbar:hide" | "toolbar:show"
|
|
105
|
+
>;
|
|
106
|
+
|
|
107
|
+
export default Toolbar;
|
|
108
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { renderSlot as _renderSlot, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from "vue";
|
|
2
|
+
const _hoisted_1 = {
|
|
3
|
+
key: 0,
|
|
4
|
+
className: "toolbar-inner"
|
|
5
|
+
};
|
|
6
|
+
function render(_ctx, _cache) {
|
|
7
|
+
return _openBlock(), _createElementBlock("div", {
|
|
8
|
+
ref: "elRef",
|
|
9
|
+
class: _normalizeClass(_ctx.classes)
|
|
10
|
+
}, [_renderSlot(_ctx.$slots, "before-inner"), _ctx.inner ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_renderSlot(_ctx.$slots, "default")])) : _renderSlot(_ctx.$slots, "default", {
|
|
11
|
+
key: 1
|
|
12
|
+
}), _renderSlot(_ctx.$slots, "after-inner")], 2);
|
|
13
|
+
}
|
|
14
|
+
import { computed, ref, provide, onMounted, onBeforeUnmount } from 'vue';
|
|
15
|
+
import { classNames } from '../shared/utils.js';
|
|
16
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
17
|
+
import { f7 } from '../shared/f7.js';
|
|
18
|
+
import { useTheme } from '../shared/use-theme.js';
|
|
19
|
+
export default {
|
|
20
|
+
name: 'f7-toolbar',
|
|
21
|
+
render,
|
|
22
|
+
props: {
|
|
23
|
+
tabbar: Boolean,
|
|
24
|
+
icons: Boolean,
|
|
25
|
+
scrollable: Boolean,
|
|
26
|
+
hidden: Boolean,
|
|
27
|
+
outline: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
position: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: undefined
|
|
34
|
+
},
|
|
35
|
+
topMd: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: undefined
|
|
38
|
+
},
|
|
39
|
+
topIos: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: undefined
|
|
42
|
+
},
|
|
43
|
+
top: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: undefined
|
|
46
|
+
},
|
|
47
|
+
bottomMd: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: undefined
|
|
50
|
+
},
|
|
51
|
+
bottomIos: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: undefined
|
|
54
|
+
},
|
|
55
|
+
bottom: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: undefined
|
|
58
|
+
},
|
|
59
|
+
inner: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: true
|
|
62
|
+
},
|
|
63
|
+
...colorProps
|
|
64
|
+
},
|
|
65
|
+
emits: ['toolbar:hide', 'toolbar:show'],
|
|
66
|
+
setup(props, _ref) {
|
|
67
|
+
let {
|
|
68
|
+
emit
|
|
69
|
+
} = _ref;
|
|
70
|
+
const elRef = ref(null);
|
|
71
|
+
const theme = useTheme();
|
|
72
|
+
const onHide = toolbarEl => {
|
|
73
|
+
if (elRef.value !== toolbarEl) return;
|
|
74
|
+
emit('toolbar:hide');
|
|
75
|
+
};
|
|
76
|
+
const onShow = toolbarEl => {
|
|
77
|
+
if (elRef.value !== toolbarEl) return;
|
|
78
|
+
emit('toolbar:show');
|
|
79
|
+
};
|
|
80
|
+
const hide = animate => {
|
|
81
|
+
if (!f7) return;
|
|
82
|
+
f7.toolbar.hide(elRef.value, animate);
|
|
83
|
+
};
|
|
84
|
+
const show = animate => {
|
|
85
|
+
if (!f7) return;
|
|
86
|
+
f7.toolbar.show(elRef.value, animate);
|
|
87
|
+
};
|
|
88
|
+
onMounted(() => {
|
|
89
|
+
if (props.tabbar && f7 && elRef.value) {
|
|
90
|
+
f7.toolbar.setHighlight(elRef.value);
|
|
91
|
+
}
|
|
92
|
+
f7.on('toolbarShow', onShow);
|
|
93
|
+
f7.on('toolbarHide', onHide);
|
|
94
|
+
});
|
|
95
|
+
onBeforeUnmount(() => {
|
|
96
|
+
f7.off('toolbarShow', onShow);
|
|
97
|
+
f7.off('toolbarHide', onHide);
|
|
98
|
+
});
|
|
99
|
+
const TabbarContext = computed(() => ({
|
|
100
|
+
tabbarHasIcons: props.icons
|
|
101
|
+
}));
|
|
102
|
+
provide('TabbarContext', TabbarContext);
|
|
103
|
+
const classes = computed(() => {
|
|
104
|
+
const {
|
|
105
|
+
tabbar,
|
|
106
|
+
bottomMd,
|
|
107
|
+
bottomIos,
|
|
108
|
+
bottom,
|
|
109
|
+
position,
|
|
110
|
+
topMd,
|
|
111
|
+
topIos,
|
|
112
|
+
top,
|
|
113
|
+
icons,
|
|
114
|
+
scrollable,
|
|
115
|
+
hidden,
|
|
116
|
+
outline
|
|
117
|
+
} = props;
|
|
118
|
+
return classNames('toolbar', {
|
|
119
|
+
tabbar,
|
|
120
|
+
'toolbar-bottom': theme.value && theme.value.md && bottomMd || theme.value && theme.value.ios && bottomIos || bottom || position === 'bottom',
|
|
121
|
+
'toolbar-top': theme.value && theme.value.md && topMd || theme.value && theme.value.ios && topIos || top || position === 'top',
|
|
122
|
+
'tabbar-icons': icons,
|
|
123
|
+
'tabbar-scrollable': scrollable,
|
|
124
|
+
'toolbar-hidden': hidden,
|
|
125
|
+
'no-outline': !outline
|
|
126
|
+
}, colorClasses(props));
|
|
127
|
+
});
|
|
128
|
+
return {
|
|
129
|
+
classes,
|
|
130
|
+
elRef,
|
|
131
|
+
hide,
|
|
132
|
+
show
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
};
|