@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,117 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Messagebar: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
sheetVisible: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
attachmentsVisible: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
top: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
maxHeight: {
|
|
21
|
+
type: NumberConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
sendLink: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
value: {
|
|
29
|
+
type: StringConstructor | NumberConstructor | ArrayConstructor;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
disabled: {
|
|
33
|
+
type: BooleanConstructor;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
readonly: {
|
|
37
|
+
type: BooleanConstructor;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
textareaId: {
|
|
41
|
+
type: NumberConstructor | StringConstructor;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
name: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
resizable: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
bottomOffset: {
|
|
54
|
+
type: NumberConstructor;
|
|
55
|
+
default: number;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
topOffset: {
|
|
59
|
+
type: NumberConstructor;
|
|
60
|
+
default: number;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
resizePage: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
placeholder: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: string;
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
init: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
color: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
colorTheme: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
textColor: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
bgColor: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
borderColor: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
rippleColor: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
dark: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
() => JSX.Element,
|
|
107
|
+
unknown,
|
|
108
|
+
{},
|
|
109
|
+
{},
|
|
110
|
+
ComponentOptionsMixin,
|
|
111
|
+
ComponentOptionsMixin,
|
|
112
|
+
("change" | "input" | "focus" | "blur" | "submit" | "send" | "click" | "messagebar:attachmentdelete" | "messagebar:attachmentclick" | "messagebar:resizepage" | "update:value")[],
|
|
113
|
+
"change" | "input" | "focus" | "blur" | "submit" | "send" | "click" | "messagebar:attachmentdelete" | "messagebar:attachmentclick" | "messagebar:resizepage" | "update:value"
|
|
114
|
+
>;
|
|
115
|
+
|
|
116
|
+
export default Messagebar;
|
|
117
|
+
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { h, computed, ref, onMounted, onBeforeUnmount, watch, onUpdated } from 'vue';
|
|
2
|
+
import { classNames, noUndefinedProps } from '../shared/utils.js';
|
|
3
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
4
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
5
|
+
import Link from './link.js';
|
|
6
|
+
import Input from './input.js';
|
|
7
|
+
export default {
|
|
8
|
+
name: 'f7-messagebar',
|
|
9
|
+
props: {
|
|
10
|
+
sheetVisible: Boolean,
|
|
11
|
+
attachmentsVisible: Boolean,
|
|
12
|
+
top: Boolean,
|
|
13
|
+
resizable: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
bottomOffset: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 0
|
|
20
|
+
},
|
|
21
|
+
topOffset: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 0
|
|
24
|
+
},
|
|
25
|
+
maxHeight: Number,
|
|
26
|
+
resizePage: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
sendLink: String,
|
|
31
|
+
value: [String, Number, Array],
|
|
32
|
+
disabled: Boolean,
|
|
33
|
+
readonly: Boolean,
|
|
34
|
+
textareaId: [Number, String],
|
|
35
|
+
name: String,
|
|
36
|
+
placeholder: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: 'Message'
|
|
39
|
+
},
|
|
40
|
+
init: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
},
|
|
44
|
+
...colorProps
|
|
45
|
+
},
|
|
46
|
+
emits: ['change', 'input', 'focus', 'blur', 'submit', 'send', 'click', 'messagebar:attachmentdelete', 'messagebar:attachmentclick', 'messagebar:resizepage', 'update:value'],
|
|
47
|
+
setup(props, _ref) {
|
|
48
|
+
let {
|
|
49
|
+
emit,
|
|
50
|
+
slots
|
|
51
|
+
} = _ref;
|
|
52
|
+
const elRef = ref(null);
|
|
53
|
+
const areaElRef = ref(null);
|
|
54
|
+
let f7Messagebar = null;
|
|
55
|
+
let updateSheetVisible = false;
|
|
56
|
+
let updateAttachmentsVisible = false;
|
|
57
|
+
const onChange = event => {
|
|
58
|
+
emit('change', event);
|
|
59
|
+
};
|
|
60
|
+
const onInput = event => {
|
|
61
|
+
emit('input', event);
|
|
62
|
+
emit('update:value', event.target.value);
|
|
63
|
+
};
|
|
64
|
+
const onFocus = event => {
|
|
65
|
+
emit('focus', event);
|
|
66
|
+
};
|
|
67
|
+
const onBlur = event => {
|
|
68
|
+
emit('blur', event);
|
|
69
|
+
};
|
|
70
|
+
const onClick = event => {
|
|
71
|
+
const inputValue = areaElRef.value.$el;
|
|
72
|
+
const clear = f7Messagebar ? () => {
|
|
73
|
+
f7Messagebar.clear();
|
|
74
|
+
} : () => {};
|
|
75
|
+
emit('submit', inputValue, clear);
|
|
76
|
+
emit('send', inputValue, clear);
|
|
77
|
+
emit('click', event);
|
|
78
|
+
};
|
|
79
|
+
const onAttachmentDelete = (instance, attachmentEl, attachmentElIndex) => {
|
|
80
|
+
emit('messagebar:attachmentdelete', instance, attachmentEl, attachmentElIndex);
|
|
81
|
+
};
|
|
82
|
+
const onAttachmentClick = (instance, attachmentEl, attachmentElIndex) => {
|
|
83
|
+
emit('messagebar:attachmentclick', instance, attachmentEl, attachmentElIndex);
|
|
84
|
+
};
|
|
85
|
+
const onResizePage = instance => {
|
|
86
|
+
emit('messagebar:resizepage', instance);
|
|
87
|
+
};
|
|
88
|
+
watch(() => props.sheetVisible, () => {
|
|
89
|
+
if (!props.resizable || !f7Messagebar) return;
|
|
90
|
+
updateSheetVisible = true;
|
|
91
|
+
});
|
|
92
|
+
watch(() => props.attachmentsVisible, () => {
|
|
93
|
+
if (!props.resizable || !f7Messagebar) return;
|
|
94
|
+
updateAttachmentsVisible = true;
|
|
95
|
+
});
|
|
96
|
+
onMounted(() => {
|
|
97
|
+
if (!props.init) return;
|
|
98
|
+
if (!elRef.value) return;
|
|
99
|
+
const params = noUndefinedProps({
|
|
100
|
+
el: elRef.value,
|
|
101
|
+
top: props.top,
|
|
102
|
+
resizePage: props.resizePage,
|
|
103
|
+
bottomOffset: props.bottomOffset,
|
|
104
|
+
topOffset: props.topOffset,
|
|
105
|
+
maxHeight: props.maxHeight,
|
|
106
|
+
on: {
|
|
107
|
+
attachmentDelete: onAttachmentDelete,
|
|
108
|
+
attachmentClick: onAttachmentClick,
|
|
109
|
+
resizePage: onResizePage
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
f7ready(() => {
|
|
113
|
+
f7Messagebar = f7.messagebar.create(params);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
onUpdated(() => {
|
|
117
|
+
if (!f7Messagebar) return;
|
|
118
|
+
if (updateSheetVisible) {
|
|
119
|
+
updateSheetVisible = false;
|
|
120
|
+
f7Messagebar.sheetVisible = props.sheetVisible;
|
|
121
|
+
f7Messagebar.resizePage();
|
|
122
|
+
}
|
|
123
|
+
if (updateAttachmentsVisible) {
|
|
124
|
+
updateAttachmentsVisible = false;
|
|
125
|
+
f7Messagebar.attachmentsVisible = props.attachmentsVisible;
|
|
126
|
+
f7Messagebar.resizePage();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
onBeforeUnmount(() => {
|
|
130
|
+
if (f7Messagebar && f7Messagebar.destroy) f7Messagebar.destroy();
|
|
131
|
+
f7Messagebar = null;
|
|
132
|
+
});
|
|
133
|
+
const classes = computed(() => classNames('toolbar', 'messagebar', {
|
|
134
|
+
'messagebar-attachments-visible': props.attachmentsVisible,
|
|
135
|
+
'messagebar-sheet-visible': props.sheetVisible
|
|
136
|
+
}, colorClasses(props)));
|
|
137
|
+
return () => {
|
|
138
|
+
const valueProps = {};
|
|
139
|
+
if ('value' in props) valueProps.value = props.value;
|
|
140
|
+
const {
|
|
141
|
+
default: slotsDefault,
|
|
142
|
+
'before-inner': slotsBeforeInner,
|
|
143
|
+
'after-inner': slotsAfterInner,
|
|
144
|
+
'send-link': slotsSendLink,
|
|
145
|
+
'inner-start': slotsInnerStart,
|
|
146
|
+
'inner-end': slotsInnerEnd,
|
|
147
|
+
'before-area': slotsBeforeArea,
|
|
148
|
+
'after-area': slotsAfterArea
|
|
149
|
+
} = slots;
|
|
150
|
+
const innerEndEls = [];
|
|
151
|
+
let messagebarAttachmentsEl;
|
|
152
|
+
let messagebarSheetEl;
|
|
153
|
+
if (slotsDefault) {
|
|
154
|
+
slotsDefault().forEach(vnode => {
|
|
155
|
+
if (typeof vnode === 'undefined') return;
|
|
156
|
+
const tag = vnode.type && vnode.type.name ? vnode.type.name : vnode.type;
|
|
157
|
+
if (tag && (tag.indexOf('messagebar-attachments') >= 0 || tag === 'F7MessagebarAttachments' || tag === 'f7-messagebar-attachments')) {
|
|
158
|
+
messagebarAttachmentsEl = vnode;
|
|
159
|
+
} else if (tag && (tag.indexOf('messagebar-sheet') >= 0 || tag === 'F7MessagebarSheet' || tag === 'f7-messagebar-sheet')) {
|
|
160
|
+
messagebarSheetEl = vnode;
|
|
161
|
+
} else {
|
|
162
|
+
innerEndEls.push(vnode);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return h('div', {
|
|
167
|
+
class: classes.value,
|
|
168
|
+
ref: elRef
|
|
169
|
+
}, [slotsBeforeInner && slotsBeforeInner(), h('div', {
|
|
170
|
+
class: 'toolbar-inner'
|
|
171
|
+
}, [slotsInnerStart && slotsInnerStart(), h('div', {
|
|
172
|
+
class: 'messagebar-area'
|
|
173
|
+
}, [slotsBeforeArea && slotsBeforeArea(), messagebarAttachmentsEl, h(Input, {
|
|
174
|
+
inputId: props.textareaId,
|
|
175
|
+
ref: areaElRef,
|
|
176
|
+
type: 'textarea',
|
|
177
|
+
wrap: false,
|
|
178
|
+
placeholder: props.placeholder,
|
|
179
|
+
disabled: props.disabled,
|
|
180
|
+
name: props.name,
|
|
181
|
+
readonly: props.readonly,
|
|
182
|
+
resizable: props.resizable,
|
|
183
|
+
onInput,
|
|
184
|
+
onChange,
|
|
185
|
+
onFocus,
|
|
186
|
+
onBlur,
|
|
187
|
+
...valueProps
|
|
188
|
+
}), slotsAfterArea && slotsAfterArea()]), (props.sendLink && props.sendLink.length > 0 || slotsSendLink) && h(Link, {
|
|
189
|
+
onClick
|
|
190
|
+
}, [slotsSendLink ? slotsSendLink() : props.sendLink]), slotsInnerEnd && slotsInnerEnd(), innerEndEls]), slotsAfterInner && slotsAfterInner(), messagebarSheetEl]);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const MessagesTitle: 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 MessagesTitle;
|
|
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-messages-title',
|
|
12
|
+
render,
|
|
13
|
+
props: {
|
|
14
|
+
...colorProps
|
|
15
|
+
},
|
|
16
|
+
setup(props) {
|
|
17
|
+
const classes = computed(() => classNames('messages-title', colorClasses(props)));
|
|
18
|
+
return {
|
|
19
|
+
classes
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const Messages: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
firstMessageRule: {
|
|
9
|
+
type: FunctionConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
lastMessageRule: {
|
|
13
|
+
type: FunctionConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
tailMessageRule: {
|
|
17
|
+
type: FunctionConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
sameNameMessageRule: {
|
|
21
|
+
type: FunctionConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
sameHeaderMessageRule: {
|
|
25
|
+
type: FunctionConstructor;
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
sameFooterMessageRule: {
|
|
29
|
+
type: FunctionConstructor;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
sameAvatarMessageRule: {
|
|
33
|
+
type: FunctionConstructor;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
customClassMessageRule: {
|
|
37
|
+
type: FunctionConstructor;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
renderMessage: {
|
|
41
|
+
type: FunctionConstructor;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
autoLayout: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
messages: {
|
|
50
|
+
type: ArrayConstructor;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
newMessagesFirst: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
scrollMessages: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
scrollMessagesOnEdge: {
|
|
64
|
+
type: BooleanConstructor;
|
|
65
|
+
default: boolean;
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
typing: {
|
|
69
|
+
type: BooleanConstructor;
|
|
70
|
+
default: boolean;
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
init: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
color: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
colorTheme: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
textColor: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
bgColor: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
borderColor: {
|
|
95
|
+
type: StringConstructor;
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
rippleColor: {
|
|
99
|
+
type: StringConstructor;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
dark: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
() => JSX.Element,
|
|
107
|
+
unknown,
|
|
108
|
+
{},
|
|
109
|
+
{},
|
|
110
|
+
ComponentOptionsMixin,
|
|
111
|
+
ComponentOptionsMixin,
|
|
112
|
+
|
|
113
|
+
>;
|
|
114
|
+
|
|
115
|
+
export default Messages;
|
|
116
|
+
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
ref: "elRef",
|
|
5
|
+
class: _normalizeClass(_ctx.classes)
|
|
6
|
+
}, [_renderSlot(_ctx.$slots, "default")], 2);
|
|
7
|
+
}
|
|
8
|
+
import { computed, ref, onMounted, onBeforeUnmount, onBeforeUpdate, onUpdated, watch } from 'vue';
|
|
9
|
+
import { classNames, getChildren, noUndefinedProps } from '../shared/utils.js';
|
|
10
|
+
import { colorClasses, colorProps } from '../shared/mixins.js';
|
|
11
|
+
import { f7ready, f7 } from '../shared/f7.js';
|
|
12
|
+
export default {
|
|
13
|
+
name: 'f7-messages',
|
|
14
|
+
render,
|
|
15
|
+
props: {
|
|
16
|
+
autoLayout: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
messages: {
|
|
21
|
+
type: Array,
|
|
22
|
+
default() {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
newMessagesFirst: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
scrollMessages: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
scrollMessagesOnEdge: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
typing: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
firstMessageRule: Function,
|
|
43
|
+
lastMessageRule: Function,
|
|
44
|
+
tailMessageRule: Function,
|
|
45
|
+
sameNameMessageRule: Function,
|
|
46
|
+
sameHeaderMessageRule: Function,
|
|
47
|
+
sameFooterMessageRule: Function,
|
|
48
|
+
sameAvatarMessageRule: Function,
|
|
49
|
+
customClassMessageRule: Function,
|
|
50
|
+
renderMessage: Function,
|
|
51
|
+
init: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
...colorProps
|
|
56
|
+
},
|
|
57
|
+
setup(props, _ref) {
|
|
58
|
+
let {
|
|
59
|
+
slots
|
|
60
|
+
} = _ref;
|
|
61
|
+
let f7Messages = null;
|
|
62
|
+
let childrenBeforeUpdated = null;
|
|
63
|
+
const elRef = ref(null);
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
if (!props.init) return;
|
|
66
|
+
f7ready(() => {
|
|
67
|
+
f7Messages = f7.messages.create(noUndefinedProps({
|
|
68
|
+
el: elRef.value,
|
|
69
|
+
autoLayout: props.autoLayout,
|
|
70
|
+
messages: props.messages,
|
|
71
|
+
newMessagesFirst: props.newMessagesFirst,
|
|
72
|
+
scrollMessages: props.scrollMessages,
|
|
73
|
+
scrollMessagesOnEdge: props.scrollMessagesOnEdge,
|
|
74
|
+
firstMessageRule: props.firstMessageRule,
|
|
75
|
+
lastMessageRule: props.lastMessageRule,
|
|
76
|
+
tailMessageRule: props.tailMessageRule,
|
|
77
|
+
sameNameMessageRule: props.sameNameMessageRule,
|
|
78
|
+
sameHeaderMessageRule: props.sameHeaderMessageRule,
|
|
79
|
+
sameFooterMessageRule: props.sameFooterMessageRule,
|
|
80
|
+
sameAvatarMessageRule: props.sameAvatarMessageRule,
|
|
81
|
+
customClassMessageRule: props.customClassMessageRule,
|
|
82
|
+
renderMessage: props.renderMessage
|
|
83
|
+
}));
|
|
84
|
+
if (f7Messages && props.typing) {
|
|
85
|
+
f7Messages.showTyping();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
onBeforeUpdate(() => {
|
|
90
|
+
if (!props.init || !elRef.value) return;
|
|
91
|
+
const children = elRef.value.children;
|
|
92
|
+
if (!children) return;
|
|
93
|
+
childrenBeforeUpdated = children.length;
|
|
94
|
+
for (let i = 0; i < children.length; i += 1) {
|
|
95
|
+
children[i].classList.add('message-appeared');
|
|
96
|
+
}
|
|
97
|
+
const childrenAfterUpdate = getChildren(slots);
|
|
98
|
+
if (f7Messages && props.scrollMessages && childrenBeforeUpdated !== childrenAfterUpdate) {
|
|
99
|
+
f7Messages.setScrollData();
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
onUpdated(() => {
|
|
103
|
+
if (!props.init) return;
|
|
104
|
+
if (!elRef.value) return;
|
|
105
|
+
const children = elRef.value.children;
|
|
106
|
+
if (!children) return;
|
|
107
|
+
const childerAftterUpdated = children.length;
|
|
108
|
+
for (let i = 0; i < children.length; i += 1) {
|
|
109
|
+
if (!children[i].classList.contains('message-appeared')) {
|
|
110
|
+
children[i].classList.add('message-appear-from-bottom');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (f7Messages && f7Messages.layout && props.autoLayout) {
|
|
114
|
+
f7Messages.layout();
|
|
115
|
+
}
|
|
116
|
+
if (childerAftterUpdated !== childrenBeforeUpdated && f7Messages && f7Messages.scroll && f7Messages.scrollData && props.scrollMessages) {
|
|
117
|
+
f7Messages.scrollWithEdgeCheck(true);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
onBeforeUnmount(() => {
|
|
121
|
+
if (f7Messages && f7Messages.destroy) f7Messages.destroy();
|
|
122
|
+
f7Messages = null;
|
|
123
|
+
});
|
|
124
|
+
watch(() => props.typing, newValue => {
|
|
125
|
+
if (!f7Messages) return;
|
|
126
|
+
if (newValue) f7Messages.showTyping();else f7Messages.hideTyping();
|
|
127
|
+
});
|
|
128
|
+
const classes = computed(() => classNames('messages', colorClasses(props)));
|
|
129
|
+
return {
|
|
130
|
+
elRef,
|
|
131
|
+
classes
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentOptionsMixin, DefineComponent, PropType } from 'vue';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
declare const NavLeft: DefineComponent<
|
|
6
|
+
{
|
|
7
|
+
|
|
8
|
+
backLink: {
|
|
9
|
+
type: BooleanConstructor | StringConstructor;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
backLinkUrl: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
backLinkForce: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
sliding: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
backLinkShowText: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: undefined;
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
color: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
colorTheme: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
textColor: {
|
|
38
|
+
type: StringConstructor;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
bgColor: {
|
|
42
|
+
type: StringConstructor;
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
borderColor: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
rippleColor: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
dark: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
() => JSX.Element,
|
|
58
|
+
unknown,
|
|
59
|
+
{},
|
|
60
|
+
{},
|
|
61
|
+
ComponentOptionsMixin,
|
|
62
|
+
ComponentOptionsMixin,
|
|
63
|
+
("back:click" | "click:back")[],
|
|
64
|
+
"back:click" | "click:back"
|
|
65
|
+
>;
|
|
66
|
+
|
|
67
|
+
export default NavLeft;
|
|
68
|
+
|