@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,37 @@
|
|
|
1
|
+
export const useIcon = function (props) {
|
|
2
|
+
if (props === void 0) {
|
|
3
|
+
props = {};
|
|
4
|
+
}
|
|
5
|
+
const {
|
|
6
|
+
icon,
|
|
7
|
+
iconMaterial,
|
|
8
|
+
iconF7,
|
|
9
|
+
iconMd,
|
|
10
|
+
iconIos,
|
|
11
|
+
iconColor,
|
|
12
|
+
iconSize,
|
|
13
|
+
iconBadge,
|
|
14
|
+
badgeColor,
|
|
15
|
+
iconBadgeColor
|
|
16
|
+
} = props;
|
|
17
|
+
if (icon || iconMaterial || iconF7 || iconMd || iconIos) {
|
|
18
|
+
return {
|
|
19
|
+
props: {
|
|
20
|
+
material: iconMaterial,
|
|
21
|
+
f7: iconF7,
|
|
22
|
+
icon,
|
|
23
|
+
md: iconMd,
|
|
24
|
+
ios: iconIos,
|
|
25
|
+
color: iconColor,
|
|
26
|
+
size: iconSize
|
|
27
|
+
},
|
|
28
|
+
badge: iconBadge || iconBadge === 0 ? {
|
|
29
|
+
props: {
|
|
30
|
+
color: badgeColor || iconBadgeColor
|
|
31
|
+
},
|
|
32
|
+
content: iconBadge
|
|
33
|
+
} : null
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { onMounted, onUpdated } from 'vue';
|
|
2
|
+
export const useRouteProps = function (elRef, _temp) {
|
|
3
|
+
let {
|
|
4
|
+
routeProps
|
|
5
|
+
} = _temp === void 0 ? {} : _temp;
|
|
6
|
+
onMounted(() => {
|
|
7
|
+
if (elRef.value && routeProps) {
|
|
8
|
+
elRef.value.f7RouteProps = routeProps;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
onUpdated(() => {
|
|
12
|
+
if (elRef.value && routeProps) {
|
|
13
|
+
elRef.value.f7RouteProps = routeProps;
|
|
14
|
+
} else if (elRef.value && elRef.value.f7RouteProps) {
|
|
15
|
+
delete elRef.value.f7RouteProps;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { onMounted, onBeforeUnmount } from 'vue';
|
|
2
|
+
import { f7ready, f7 } from './f7.js';
|
|
3
|
+
import { extend } from './utils.js';
|
|
4
|
+
export const useSmartSelect = (props, setInstance, getEl) => {
|
|
5
|
+
let f7SmartSelect;
|
|
6
|
+
onMounted(() => {
|
|
7
|
+
f7ready(() => {
|
|
8
|
+
if (props.smartSelect) {
|
|
9
|
+
const ssParams = extend({
|
|
10
|
+
el: getEl()
|
|
11
|
+
}, props.smartSelectParams || {});
|
|
12
|
+
f7SmartSelect = f7.smartSelect.create(ssParams);
|
|
13
|
+
setInstance(f7SmartSelect);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
onBeforeUnmount(() => {
|
|
18
|
+
if (f7SmartSelect && f7SmartSelect.destroy) {
|
|
19
|
+
f7SmartSelect.destroy();
|
|
20
|
+
}
|
|
21
|
+
f7SmartSelect = null;
|
|
22
|
+
setInstance(f7SmartSelect);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { onBeforeUnmount, ref } from 'vue';
|
|
2
|
+
import { f7 } from './f7.js';
|
|
3
|
+
export const useStore = function () {
|
|
4
|
+
// (store, getter)
|
|
5
|
+
let store = arguments.length <= 0 ? undefined : arguments[0];
|
|
6
|
+
let getter = arguments.length <= 1 ? undefined : arguments[1];
|
|
7
|
+
if (arguments.length === 1) {
|
|
8
|
+
// (getter)
|
|
9
|
+
store = f7.store;
|
|
10
|
+
getter = arguments.length <= 0 ? undefined : arguments[0];
|
|
11
|
+
}
|
|
12
|
+
// eslint-disable-next-line
|
|
13
|
+
const obj = store._gettersPlain[getter];
|
|
14
|
+
const valueRef = ref(obj.value);
|
|
15
|
+
const callback = v => {
|
|
16
|
+
valueRef.value = v;
|
|
17
|
+
};
|
|
18
|
+
obj.onUpdated(callback);
|
|
19
|
+
onBeforeUnmount(() => {
|
|
20
|
+
// eslint-disable-next-line
|
|
21
|
+
store.__removeCallback(callback);
|
|
22
|
+
});
|
|
23
|
+
return valueRef;
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { onMounted, onBeforeUnmount } from 'vue';
|
|
2
|
+
import { f7, f7ready } from './f7.js';
|
|
3
|
+
export const useTab = (elRef, emit) => {
|
|
4
|
+
const onTabShow = el => {
|
|
5
|
+
if (elRef.value !== el) return;
|
|
6
|
+
emit('tab:show', el);
|
|
7
|
+
};
|
|
8
|
+
const onTabHide = el => {
|
|
9
|
+
if (elRef.value !== el) return;
|
|
10
|
+
emit('tab:hide', el);
|
|
11
|
+
};
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
if (!elRef.value) return;
|
|
14
|
+
f7ready(() => {
|
|
15
|
+
f7.on('tabShow', onTabShow);
|
|
16
|
+
f7.on('tabHide', onTabHide);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
onBeforeUnmount(() => {
|
|
20
|
+
if (!f7) return;
|
|
21
|
+
f7.off('tabShow', onTabShow);
|
|
22
|
+
f7.off('tabHide', onTabHide);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { watch, onMounted, onBeforeUnmount } from 'vue';
|
|
2
|
+
import { f7, f7ready } from './f7.js';
|
|
3
|
+
export const useTooltip = (elRef, props) => {
|
|
4
|
+
let f7Tooltip = null;
|
|
5
|
+
const {
|
|
6
|
+
tooltip,
|
|
7
|
+
tooltipTrigger
|
|
8
|
+
} = props;
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
if (!elRef.value) return;
|
|
11
|
+
if (!tooltip) return;
|
|
12
|
+
f7ready(() => {
|
|
13
|
+
f7Tooltip = f7.tooltip.create({
|
|
14
|
+
targetEl: elRef.value,
|
|
15
|
+
text: tooltip,
|
|
16
|
+
trigger: tooltipTrigger
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
onBeforeUnmount(() => {
|
|
21
|
+
if (f7Tooltip && f7Tooltip.destroy) {
|
|
22
|
+
f7Tooltip.destroy();
|
|
23
|
+
f7Tooltip = null;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
watch(() => props.tooltip, value => {
|
|
27
|
+
if (!value && f7Tooltip) {
|
|
28
|
+
f7Tooltip.destroy();
|
|
29
|
+
f7Tooltip = null;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (value && !f7Tooltip && f7) {
|
|
33
|
+
f7Tooltip = f7.tooltip.create({
|
|
34
|
+
targetEl: elRef.value,
|
|
35
|
+
text: value,
|
|
36
|
+
trigger: tooltipTrigger
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!value || !f7Tooltip) return;
|
|
41
|
+
f7Tooltip.setText(value);
|
|
42
|
+
});
|
|
43
|
+
};
|
package/shared/utils.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Comment, Fragment } from 'vue';
|
|
2
|
+
export function noUndefinedProps(obj) {
|
|
3
|
+
const o = {};
|
|
4
|
+
Object.keys(obj).forEach(key => {
|
|
5
|
+
if (typeof obj[key] !== 'undefined') o[key] = obj[key];
|
|
6
|
+
});
|
|
7
|
+
return o;
|
|
8
|
+
}
|
|
9
|
+
export function isStringProp(val) {
|
|
10
|
+
return typeof val === 'string' && val !== '';
|
|
11
|
+
}
|
|
12
|
+
export function isObject(o) {
|
|
13
|
+
return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;
|
|
14
|
+
}
|
|
15
|
+
export function now() {
|
|
16
|
+
return Date.now();
|
|
17
|
+
}
|
|
18
|
+
export function extend() {
|
|
19
|
+
let deep = true;
|
|
20
|
+
let to;
|
|
21
|
+
let from;
|
|
22
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
+
args[_key] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
if (typeof args[0] === 'boolean') {
|
|
26
|
+
[deep, to] = args;
|
|
27
|
+
args.splice(0, 2);
|
|
28
|
+
from = args;
|
|
29
|
+
} else {
|
|
30
|
+
[to] = args;
|
|
31
|
+
args.splice(0, 1);
|
|
32
|
+
from = args;
|
|
33
|
+
}
|
|
34
|
+
for (let i = 0; i < from.length; i += 1) {
|
|
35
|
+
const nextSource = args[i];
|
|
36
|
+
if (nextSource !== undefined && nextSource !== null) {
|
|
37
|
+
const keysArray = Object.keys(Object(nextSource));
|
|
38
|
+
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
|
39
|
+
const nextKey = keysArray[nextIndex];
|
|
40
|
+
const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
|
41
|
+
if (desc !== undefined && desc.enumerable) {
|
|
42
|
+
if (!deep) {
|
|
43
|
+
to[nextKey] = nextSource[nextKey];
|
|
44
|
+
} else if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
45
|
+
extend(to[nextKey], nextSource[nextKey]);
|
|
46
|
+
} else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {
|
|
47
|
+
to[nextKey] = {};
|
|
48
|
+
extend(to[nextKey], nextSource[nextKey]);
|
|
49
|
+
} else {
|
|
50
|
+
to[nextKey] = nextSource[nextKey];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return to;
|
|
57
|
+
}
|
|
58
|
+
export function classNames() {
|
|
59
|
+
const classes = [];
|
|
60
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
61
|
+
args[_key2] = arguments[_key2];
|
|
62
|
+
}
|
|
63
|
+
args.forEach(arg => {
|
|
64
|
+
if (typeof arg === 'object' && arg.constructor === Object) {
|
|
65
|
+
Object.keys(arg).forEach(key => {
|
|
66
|
+
if (arg[key]) classes.push(key);
|
|
67
|
+
});
|
|
68
|
+
} else if (arg) classes.push(arg);
|
|
69
|
+
});
|
|
70
|
+
const uniqueClasses = [];
|
|
71
|
+
classes.forEach(c => {
|
|
72
|
+
if (uniqueClasses.indexOf(c) < 0) uniqueClasses.push(c);
|
|
73
|
+
});
|
|
74
|
+
return uniqueClasses.join(' ');
|
|
75
|
+
}
|
|
76
|
+
let routerIdCounter = 0;
|
|
77
|
+
let routerComponentIdCounter = 0;
|
|
78
|
+
export function unsetRouterIds() {
|
|
79
|
+
routerIdCounter = 0;
|
|
80
|
+
routerComponentIdCounter = 0;
|
|
81
|
+
}
|
|
82
|
+
export function getRouterId() {
|
|
83
|
+
routerIdCounter += 1;
|
|
84
|
+
return `${now()}_${routerIdCounter}`;
|
|
85
|
+
}
|
|
86
|
+
export function getComponentId() {
|
|
87
|
+
routerComponentIdCounter += 1;
|
|
88
|
+
return `${now()}_${routerComponentIdCounter}`;
|
|
89
|
+
}
|
|
90
|
+
export function getChildren(slots, slotName) {
|
|
91
|
+
if (slotName === void 0) {
|
|
92
|
+
slotName = 'default';
|
|
93
|
+
}
|
|
94
|
+
const result = [];
|
|
95
|
+
const getElementsChildren = els => {
|
|
96
|
+
if (!Array.isArray(els)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
els.forEach(vnode => {
|
|
100
|
+
const isFragment = vnode.type === Fragment;
|
|
101
|
+
if (isFragment && vnode.children) {
|
|
102
|
+
getElementsChildren(vnode.children);
|
|
103
|
+
} else if (vnode.type && vnode.type !== Comment) {
|
|
104
|
+
result.push(vnode);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
if (slots[slotName]) getElementsChildren(slots[slotName]());
|
|
109
|
+
return result;
|
|
110
|
+
}
|