@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,213 @@
|
|
|
1
|
+
import { h, computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
2
|
+
import { classNames } from '../shared/utils.js';
|
|
3
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
4
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
5
|
+
import { modalStateClasses } from '../shared/modal-state-classes.js';
|
|
6
|
+
export default {
|
|
7
|
+
name: 'f7-sheet',
|
|
8
|
+
props: {
|
|
9
|
+
opened: Boolean,
|
|
10
|
+
animate: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: undefined
|
|
13
|
+
},
|
|
14
|
+
top: Boolean,
|
|
15
|
+
bottom: Boolean,
|
|
16
|
+
position: String,
|
|
17
|
+
backdrop: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: undefined
|
|
20
|
+
},
|
|
21
|
+
backdropEl: {
|
|
22
|
+
type: [String, Object],
|
|
23
|
+
default: undefined
|
|
24
|
+
},
|
|
25
|
+
closeByBackdropClick: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: undefined
|
|
28
|
+
},
|
|
29
|
+
closeByOutsideClick: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: undefined
|
|
32
|
+
},
|
|
33
|
+
closeOnEscape: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: undefined
|
|
36
|
+
},
|
|
37
|
+
push: Boolean,
|
|
38
|
+
swipeToClose: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
swipeToStep: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
swipeHandler: {
|
|
47
|
+
type: [String, Object],
|
|
48
|
+
default: undefined
|
|
49
|
+
},
|
|
50
|
+
containerEl: {
|
|
51
|
+
type: [String, Object],
|
|
52
|
+
default: undefined
|
|
53
|
+
},
|
|
54
|
+
breakpoints: {
|
|
55
|
+
type: Array,
|
|
56
|
+
default: () => undefined
|
|
57
|
+
},
|
|
58
|
+
backdropBreakpoint: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: undefined
|
|
61
|
+
},
|
|
62
|
+
pushBreakpoint: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: undefined
|
|
65
|
+
},
|
|
66
|
+
...colorProps
|
|
67
|
+
},
|
|
68
|
+
emits: ['sheet:stepprogress', 'sheet:stepopen', 'sheet:stepclose', 'sheet:open', 'sheet:opened', 'sheet:close', 'sheet:closed', 'sheet:breakpoint', 'update:opened'],
|
|
69
|
+
setup(props, _ref) {
|
|
70
|
+
let {
|
|
71
|
+
emit,
|
|
72
|
+
slots
|
|
73
|
+
} = _ref;
|
|
74
|
+
let f7Sheet = null;
|
|
75
|
+
// eslint-disable-next-line
|
|
76
|
+
let isOpened = props.opened;
|
|
77
|
+
let isClosing = false;
|
|
78
|
+
const elRef = ref(null);
|
|
79
|
+
const onBreakpoint = (instance, breakpoint) => {
|
|
80
|
+
emit('sheet:breakpoint', instance, breakpoint);
|
|
81
|
+
};
|
|
82
|
+
const onStepProgress = (instance, progress) => {
|
|
83
|
+
emit('sheet:stepprogress', instance, progress);
|
|
84
|
+
};
|
|
85
|
+
const onStepOpen = instance => {
|
|
86
|
+
emit('sheet:stepopen', instance);
|
|
87
|
+
};
|
|
88
|
+
const onStepClose = instance => {
|
|
89
|
+
emit('sheet:stepclose', instance);
|
|
90
|
+
};
|
|
91
|
+
const onOpen = instance => {
|
|
92
|
+
isOpened = true;
|
|
93
|
+
isClosing = false;
|
|
94
|
+
emit('sheet:open', instance);
|
|
95
|
+
emit('update:opened', true);
|
|
96
|
+
};
|
|
97
|
+
const onOpened = instance => {
|
|
98
|
+
emit('sheet:opened', instance);
|
|
99
|
+
};
|
|
100
|
+
const onClose = instance => {
|
|
101
|
+
isOpened = false;
|
|
102
|
+
isClosing = true;
|
|
103
|
+
emit('sheet:close', instance);
|
|
104
|
+
};
|
|
105
|
+
const onClosed = instance => {
|
|
106
|
+
isClosing = false;
|
|
107
|
+
emit('sheet:closed', instance);
|
|
108
|
+
emit('update:opened', false);
|
|
109
|
+
};
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
if (!elRef.value) return;
|
|
112
|
+
const sheetParams = {
|
|
113
|
+
el: elRef.value,
|
|
114
|
+
on: {
|
|
115
|
+
open: onOpen,
|
|
116
|
+
opened: onOpened,
|
|
117
|
+
close: onClose,
|
|
118
|
+
closed: onClosed,
|
|
119
|
+
stepOpen: onStepOpen,
|
|
120
|
+
stepClose: onStepClose,
|
|
121
|
+
stepProgress: onStepProgress,
|
|
122
|
+
breakpoint: onBreakpoint
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const {
|
|
126
|
+
animate,
|
|
127
|
+
backdrop,
|
|
128
|
+
backdropEl,
|
|
129
|
+
closeByBackdropClick,
|
|
130
|
+
closeByOutsideClick,
|
|
131
|
+
closeOnEscape,
|
|
132
|
+
swipeToClose,
|
|
133
|
+
swipeToStep,
|
|
134
|
+
swipeHandler,
|
|
135
|
+
containerEl,
|
|
136
|
+
breakpoints,
|
|
137
|
+
backdropBreakpoint,
|
|
138
|
+
pushBreakpoint
|
|
139
|
+
} = props;
|
|
140
|
+
if (typeof animate !== 'undefined') sheetParams.animate = animate;
|
|
141
|
+
if (typeof backdrop !== 'undefined') sheetParams.backdrop = backdrop;
|
|
142
|
+
if (typeof backdropEl !== 'undefined') sheetParams.backdropEl = backdropEl;
|
|
143
|
+
if (typeof closeByBackdropClick !== 'undefined') sheetParams.closeByBackdropClick = closeByBackdropClick;
|
|
144
|
+
if (typeof closeByOutsideClick !== 'undefined') sheetParams.closeByOutsideClick = closeByOutsideClick;
|
|
145
|
+
if (typeof closeOnEscape !== 'undefined') sheetParams.closeOnEscape = closeOnEscape;
|
|
146
|
+
if (typeof swipeToClose !== 'undefined') sheetParams.swipeToClose = swipeToClose;
|
|
147
|
+
if (typeof swipeToStep !== 'undefined') sheetParams.swipeToStep = swipeToStep;
|
|
148
|
+
if (typeof swipeHandler !== 'undefined') sheetParams.swipeHandler = swipeHandler;
|
|
149
|
+
if (typeof containerEl !== 'undefined') sheetParams.containerEl = containerEl;
|
|
150
|
+
if (typeof breakpoints !== 'undefined') sheetParams.breakpoints = breakpoints;
|
|
151
|
+
if (typeof backdropBreakpoint !== 'undefined') sheetParams.backdropBreakpoint = backdropBreakpoint;
|
|
152
|
+
if (typeof pushBreakpoint !== 'undefined') sheetParams.pushBreakpoint = pushBreakpoint;
|
|
153
|
+
f7ready(() => {
|
|
154
|
+
f7Sheet = f7.sheet.create(sheetParams);
|
|
155
|
+
if (props.opened) {
|
|
156
|
+
f7Sheet.open(false);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
onBeforeUnmount(() => {
|
|
161
|
+
if (f7Sheet) {
|
|
162
|
+
f7Sheet.destroy();
|
|
163
|
+
}
|
|
164
|
+
f7Sheet = null;
|
|
165
|
+
});
|
|
166
|
+
watch(() => props.opened, value => {
|
|
167
|
+
if (!f7Sheet) return;
|
|
168
|
+
if (value) {
|
|
169
|
+
f7Sheet.open();
|
|
170
|
+
} else {
|
|
171
|
+
f7Sheet.close();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
['closeByBackdropClick', 'closeByOutsideClick', 'closeOnEscape', 'swipeToClose'].forEach(propName => {
|
|
175
|
+
watch(() => props[propName], propValue => {
|
|
176
|
+
if (!f7Sheet) return;
|
|
177
|
+
f7Sheet.params[propName] = propValue;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
const classes = computed(() => {
|
|
181
|
+
let positionComputed = 'bottom';
|
|
182
|
+
if (props.position) positionComputed = props.position;else if (props.top) positionComputed = 'top';else if (props.bottom) positionComputed = 'bottom';
|
|
183
|
+
return classNames('sheet-modal', `sheet-modal-${positionComputed}`, {
|
|
184
|
+
'sheet-modal-push': props.push
|
|
185
|
+
}, modalStateClasses({
|
|
186
|
+
isOpened,
|
|
187
|
+
isClosing
|
|
188
|
+
}), colorClasses(props));
|
|
189
|
+
});
|
|
190
|
+
const fixedTags = 'navbar toolbar tabbar subnavbar searchbar messagebar fab list-index panel'.split(' ').map(tagName => `f7-${tagName}`);
|
|
191
|
+
return () => {
|
|
192
|
+
const fixedList = [];
|
|
193
|
+
const staticList = [];
|
|
194
|
+
if (slots.default) {
|
|
195
|
+
slots.default().forEach(vnode => {
|
|
196
|
+
if (typeof vnode === 'undefined') return;
|
|
197
|
+
const tag = vnode.type && vnode.type.name ? vnode.type.name : vnode.type;
|
|
198
|
+
if (fixedTags.indexOf(tag) >= 0) {
|
|
199
|
+
fixedList.push(vnode);
|
|
200
|
+
} else {
|
|
201
|
+
staticList.push(vnode);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return h('div', {
|
|
206
|
+
class: classes.value,
|
|
207
|
+
ref: elRef
|
|
208
|
+
}, [fixedList, slots.fixed && slots.fixed(), h('div', {
|
|
209
|
+
class: 'sheet-modal-inner'
|
|
210
|
+
}, [staticList, slots.static && slots.static()])]);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Stepper: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
formatValue: {
|
|
9
|
+
type: FunctionConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
name: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
inputId: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
disabled: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
buttonsOnly: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
round: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
roundMd: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
roundIos: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
fill: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
fillMd: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
fillIos: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
large: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
largeMd: {
|
|
57
|
+
type: BooleanConstructor;
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
largeIos: {
|
|
61
|
+
type: BooleanConstructor;
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
small: {
|
|
65
|
+
type: BooleanConstructor;
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
smallMd: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
smallIos: {
|
|
73
|
+
type: BooleanConstructor;
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
raised: {
|
|
77
|
+
type: BooleanConstructor;
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
raisedMd: {
|
|
81
|
+
type: BooleanConstructor;
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
raisedIos: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
init: {
|
|
89
|
+
type: BooleanConstructor;
|
|
90
|
+
default: boolean;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
value: {
|
|
94
|
+
type: NumberConstructor;
|
|
95
|
+
default: number;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
min: {
|
|
99
|
+
type: NumberConstructor;
|
|
100
|
+
default: number;
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
max: {
|
|
104
|
+
type: NumberConstructor;
|
|
105
|
+
default: number;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
step: {
|
|
109
|
+
type: NumberConstructor;
|
|
110
|
+
default: number;
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
input: {
|
|
114
|
+
type: BooleanConstructor;
|
|
115
|
+
default: boolean;
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
inputType: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: string;
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
inputReadonly: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
default: boolean;
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
autorepeat: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: boolean;
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
autorepeatDynamic: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: boolean;
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
wraps: {
|
|
139
|
+
type: BooleanConstructor;
|
|
140
|
+
default: boolean;
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
manualInputMode: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
decimalPoint: {
|
|
149
|
+
type: NumberConstructor;
|
|
150
|
+
default: number;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
buttonsEndInputMode: {
|
|
154
|
+
type: BooleanConstructor;
|
|
155
|
+
default: boolean;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
color: {
|
|
159
|
+
type: StringConstructor;
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
colorTheme: {
|
|
163
|
+
type: StringConstructor;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
textColor: {
|
|
167
|
+
type: StringConstructor;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
bgColor: {
|
|
171
|
+
type: StringConstructor;
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
borderColor: {
|
|
175
|
+
type: StringConstructor;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
rippleColor: {
|
|
179
|
+
type: StringConstructor;
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
dark: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
() => JSX.Element,
|
|
187
|
+
unknown,
|
|
188
|
+
{},
|
|
189
|
+
{},
|
|
190
|
+
ComponentOptionsMixin,
|
|
191
|
+
ComponentOptionsMixin,
|
|
192
|
+
("input" | "change" | "stepper:minusclick" | "stepper:plusclick" | "stepper:change" | "update:value")[],
|
|
193
|
+
"input" | "change" | "stepper:minusclick" | "stepper:plusclick" | "stepper:change" | "update:value"
|
|
194
|
+
>;
|
|
195
|
+
|
|
196
|
+
export default Stepper;
|
|
197
|
+
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass } from "vue";
|
|
2
|
+
const _hoisted_1 = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "stepper-input-wrap"
|
|
5
|
+
};
|
|
6
|
+
const _hoisted_2 = ["id", "name", "type", "min", "max", "step", "value", "readonly"];
|
|
7
|
+
const _hoisted_3 = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "stepper-value"
|
|
10
|
+
};
|
|
11
|
+
function render(_ctx, _cache) {
|
|
12
|
+
return _openBlock(), _createElementBlock("div", {
|
|
13
|
+
ref: "elRef",
|
|
14
|
+
class: _normalizeClass(_ctx.classes)
|
|
15
|
+
}, [_createElementVNode("div", {
|
|
16
|
+
class: "stepper-button-minus",
|
|
17
|
+
onClick: _cache[0] || (_cache[0] = function () {
|
|
18
|
+
return _ctx.onMinusClick && _ctx.onMinusClick(...arguments);
|
|
19
|
+
})
|
|
20
|
+
}), _ctx.input && !_ctx.buttonsOnly ? (_openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("input", {
|
|
21
|
+
id: _ctx.inputId,
|
|
22
|
+
name: _ctx.name,
|
|
23
|
+
type: _ctx.inputType,
|
|
24
|
+
min: _ctx.inputType === 'number' ? _ctx.min : undefined,
|
|
25
|
+
max: _ctx.inputType === 'number' ? _ctx.max : undefined,
|
|
26
|
+
step: _ctx.inputType === 'number' ? _ctx.step : undefined,
|
|
27
|
+
value: _ctx.value,
|
|
28
|
+
readonly: _ctx.inputReadonly,
|
|
29
|
+
onInput: _cache[1] || (_cache[1] = function () {
|
|
30
|
+
return _ctx.onInput && _ctx.onInput(...arguments);
|
|
31
|
+
}),
|
|
32
|
+
onChange: _cache[2] || (_cache[2] = function () {
|
|
33
|
+
return _ctx.onChange && _ctx.onChange(...arguments);
|
|
34
|
+
})
|
|
35
|
+
}, null, 40, _hoisted_2)])) : _createCommentVNode("", true), !_ctx.input && !_ctx.buttonsOnly ? (_openBlock(), _createElementBlock("div", _hoisted_3, _toDisplayString(_ctx.value), 1)) : _createCommentVNode("", true), _createElementVNode("div", {
|
|
36
|
+
class: "stepper-button-plus",
|
|
37
|
+
onClick: _cache[3] || (_cache[3] = function () {
|
|
38
|
+
return _ctx.onPlusClick && _ctx.onPlusClick(...arguments);
|
|
39
|
+
})
|
|
40
|
+
})], 2);
|
|
41
|
+
}
|
|
42
|
+
import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
43
|
+
import { classNames, noUndefinedProps } from '../shared/utils.js';
|
|
44
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
45
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
46
|
+
export default {
|
|
47
|
+
name: 'f7-stepper',
|
|
48
|
+
render,
|
|
49
|
+
props: {
|
|
50
|
+
init: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
value: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 0
|
|
57
|
+
},
|
|
58
|
+
min: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: 0
|
|
61
|
+
},
|
|
62
|
+
max: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: 100
|
|
65
|
+
},
|
|
66
|
+
step: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 1
|
|
69
|
+
},
|
|
70
|
+
formatValue: Function,
|
|
71
|
+
name: String,
|
|
72
|
+
inputId: String,
|
|
73
|
+
input: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: true
|
|
76
|
+
},
|
|
77
|
+
inputType: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: 'text'
|
|
80
|
+
},
|
|
81
|
+
inputReadonly: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
autorepeat: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: false
|
|
88
|
+
},
|
|
89
|
+
autorepeatDynamic: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false
|
|
92
|
+
},
|
|
93
|
+
wraps: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
manualInputMode: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
decimalPoint: {
|
|
102
|
+
type: Number,
|
|
103
|
+
default: 4
|
|
104
|
+
},
|
|
105
|
+
buttonsEndInputMode: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: true
|
|
108
|
+
},
|
|
109
|
+
disabled: Boolean,
|
|
110
|
+
buttonsOnly: Boolean,
|
|
111
|
+
round: Boolean,
|
|
112
|
+
roundMd: Boolean,
|
|
113
|
+
roundIos: Boolean,
|
|
114
|
+
fill: Boolean,
|
|
115
|
+
fillMd: Boolean,
|
|
116
|
+
fillIos: Boolean,
|
|
117
|
+
large: Boolean,
|
|
118
|
+
largeMd: Boolean,
|
|
119
|
+
largeIos: Boolean,
|
|
120
|
+
small: Boolean,
|
|
121
|
+
smallMd: Boolean,
|
|
122
|
+
smallIos: Boolean,
|
|
123
|
+
raised: Boolean,
|
|
124
|
+
raisedMd: Boolean,
|
|
125
|
+
raisedIos: Boolean,
|
|
126
|
+
...colorProps
|
|
127
|
+
},
|
|
128
|
+
emits: ['input', 'change', 'stepper:minusclick', 'stepper:plusclick', 'stepper:change', 'update:value'],
|
|
129
|
+
setup(props, _ref) {
|
|
130
|
+
let {
|
|
131
|
+
emit
|
|
132
|
+
} = _ref;
|
|
133
|
+
let f7Stepper = null;
|
|
134
|
+
const elRef = ref(null);
|
|
135
|
+
const increment = () => {
|
|
136
|
+
if (!f7Stepper) return;
|
|
137
|
+
f7Stepper.increment();
|
|
138
|
+
};
|
|
139
|
+
const decrement = () => {
|
|
140
|
+
if (!f7Stepper) return;
|
|
141
|
+
f7Stepper.decrement();
|
|
142
|
+
};
|
|
143
|
+
const setValue = newValue => {
|
|
144
|
+
if (f7Stepper && f7Stepper.setValue) f7Stepper.setValue(newValue);
|
|
145
|
+
};
|
|
146
|
+
const getValue = () => {
|
|
147
|
+
if (f7Stepper && f7Stepper.getValue) {
|
|
148
|
+
return f7Stepper.getValue();
|
|
149
|
+
}
|
|
150
|
+
return undefined;
|
|
151
|
+
};
|
|
152
|
+
const onInput = event => {
|
|
153
|
+
emit('input', event, f7Stepper);
|
|
154
|
+
};
|
|
155
|
+
const onChange = event => {
|
|
156
|
+
emit('change', event, f7Stepper);
|
|
157
|
+
};
|
|
158
|
+
const onMinusClick = event => {
|
|
159
|
+
emit('stepper:minusclick', event, f7Stepper);
|
|
160
|
+
};
|
|
161
|
+
const onPlusClick = event => {
|
|
162
|
+
emit('stepper:plusclick', event, f7Stepper);
|
|
163
|
+
};
|
|
164
|
+
watch(() => props.value, newValue => {
|
|
165
|
+
if (!f7Stepper) return;
|
|
166
|
+
f7Stepper.setValue(newValue);
|
|
167
|
+
});
|
|
168
|
+
onMounted(() => {
|
|
169
|
+
f7ready(() => {
|
|
170
|
+
if (!props.init || !elRef.value) return;
|
|
171
|
+
f7Stepper = f7.stepper.create(noUndefinedProps({
|
|
172
|
+
el: elRef.value,
|
|
173
|
+
min: props.min,
|
|
174
|
+
max: props.max,
|
|
175
|
+
value: props.value,
|
|
176
|
+
step: props.step,
|
|
177
|
+
formatValue: props.formatValue,
|
|
178
|
+
autorepeat: props.autorepeat,
|
|
179
|
+
autorepeatDynamic: props.autorepeatDynamic,
|
|
180
|
+
wraps: props.wraps,
|
|
181
|
+
manualInputMode: props.manualInputMode,
|
|
182
|
+
decimalPoint: props.decimalPoint,
|
|
183
|
+
buttonsEndInputMode: props.buttonsEndInputMode,
|
|
184
|
+
on: {
|
|
185
|
+
change(stepper, newValue) {
|
|
186
|
+
emit('stepper:change', newValue);
|
|
187
|
+
emit('update:value', newValue);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}));
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
onBeforeUnmount(() => {
|
|
194
|
+
if (f7Stepper && f7Stepper.destroy) {
|
|
195
|
+
f7Stepper.destroy();
|
|
196
|
+
}
|
|
197
|
+
f7Stepper = null;
|
|
198
|
+
});
|
|
199
|
+
const classes = computed(() => classNames('stepper', {
|
|
200
|
+
disabled: props.disabled,
|
|
201
|
+
'stepper-round': props.round,
|
|
202
|
+
'stepper-round-ios': props.roundIos,
|
|
203
|
+
'stepper-round-md': props.roundMd,
|
|
204
|
+
'stepper-fill': props.fill,
|
|
205
|
+
'stepper-fill-ios': props.fillIos,
|
|
206
|
+
'stepper-fill-md': props.fillMd,
|
|
207
|
+
'stepper-large': props.large,
|
|
208
|
+
'stepper-large-ios': props.largeIos,
|
|
209
|
+
'stepper-large-md': props.largeMd,
|
|
210
|
+
'stepper-small': props.small,
|
|
211
|
+
'stepper-small-ios': props.smallIos,
|
|
212
|
+
'stepper-small-md': props.smallMd,
|
|
213
|
+
'stepper-raised': props.raised,
|
|
214
|
+
'stepper-raised-ios': props.raisedIos,
|
|
215
|
+
'stepper-raised-md': props.raisedMd
|
|
216
|
+
}, colorClasses(props)));
|
|
217
|
+
return {
|
|
218
|
+
elRef,
|
|
219
|
+
classes,
|
|
220
|
+
increment,
|
|
221
|
+
decrement,
|
|
222
|
+
setValue,
|
|
223
|
+
getValue,
|
|
224
|
+
onInput,
|
|
225
|
+
onChange,
|
|
226
|
+
onMinusClick,
|
|
227
|
+
onPlusClick
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
};
|