framework7-svelte 8.3.4 → 9.0.0
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/components/accordion-content.d.ts +11 -5
- package/components/accordion-content.svelte +8 -6
- package/components/accordion-item.d.ts +23 -11
- package/components/accordion-item.svelte +27 -25
- package/components/accordion-toggle.d.ts +11 -5
- package/components/accordion-toggle.svelte +8 -6
- package/components/accordion.d.ts +11 -5
- package/components/accordion.svelte +11 -10
- package/components/actions-button.d.ts +14 -6
- package/components/actions-button.svelte +21 -19
- package/components/actions-group.d.ts +11 -5
- package/components/actions-group.svelte +4 -7
- package/components/actions-label.d.ts +11 -5
- package/components/actions-label.svelte +13 -23
- package/components/actions.d.ts +31 -21
- package/components/actions.svelte +50 -54
- package/components/app.d.ts +11 -5
- package/components/app.svelte +6 -7
- package/components/area-chart.d.ts +13 -6
- package/components/area-chart.svelte +42 -46
- package/components/badge.d.ts +11 -5
- package/components/badge.svelte +10 -9
- package/components/block-footer.d.ts +11 -5
- package/components/block-footer.svelte +8 -6
- package/components/block-header.d.ts +11 -5
- package/components/block-header.svelte +8 -6
- package/components/block-title.d.ts +11 -5
- package/components/block-title.svelte +12 -10
- package/components/block.d.ts +11 -5
- package/components/block.svelte +76 -76
- package/components/breadcrumbs-collapsed.d.ts +12 -6
- package/components/breadcrumbs-collapsed.svelte +10 -15
- package/components/breadcrumbs-item.d.ts +12 -6
- package/components/breadcrumbs-item.svelte +9 -8
- package/components/breadcrumbs-separator.d.ts +10 -5
- package/components/breadcrumbs-separator.svelte +9 -5
- package/components/breadcrumbs.d.ts +11 -6
- package/components/breadcrumbs.svelte +8 -6
- package/components/button.d.ts +44 -37
- package/components/button.svelte +107 -103
- package/components/card-content.d.ts +11 -5
- package/components/card-content.svelte +11 -10
- package/components/card-footer.d.ts +11 -5
- package/components/card-footer.svelte +8 -6
- package/components/card-header.d.ts +11 -5
- package/components/card-header.svelte +8 -6
- package/components/card.d.ts +43 -31
- package/components/card.svelte +78 -67
- package/components/checkbox.d.ts +20 -13
- package/components/checkbox.svelte +32 -30
- package/components/chip.d.ts +22 -15
- package/components/chip.svelte +54 -60
- package/components/fab-backdrop.d.ts +10 -5
- package/components/fab-backdrop.svelte +5 -7
- package/components/fab-button.d.ts +17 -11
- package/components/fab-button.svelte +20 -29
- package/components/fab-buttons.d.ts +11 -5
- package/components/fab-buttons.svelte +5 -12
- package/components/fab.d.ts +22 -13
- package/components/fab.svelte +55 -51
- package/components/gauge.d.ts +24 -19
- package/components/gauge.svelte +25 -25
- package/components/icon.d.ts +19 -13
- package/components/icon.svelte +65 -63
- package/components/input.d.ts +78 -61
- package/components/input.svelte +171 -154
- package/components/link.d.ts +28 -21
- package/components/link.svelte +67 -65
- package/components/list-button.d.ts +22 -15
- package/components/list-button.svelte +56 -44
- package/components/list-group.d.ts +16 -10
- package/components/list-group.svelte +38 -34
- package/components/list-index.d.ts +20 -13
- package/components/list-index.svelte +23 -24
- package/components/list-input.d.ts +91 -64
- package/components/list-input.svelte +254 -205
- package/components/list-item.d.ts +98 -63
- package/components/list-item.svelte +412 -439
- package/components/list.d.ts +72 -54
- package/components/list.svelte +151 -147
- package/components/login-screen-title.d.ts +11 -5
- package/components/login-screen-title.svelte +4 -6
- package/components/login-screen.d.ts +20 -10
- package/components/login-screen.svelte +39 -42
- package/components/message.d.ts +48 -29
- package/components/message.svelte +123 -88
- package/components/messagebar-attachment.d.ts +17 -9
- package/components/messagebar-attachment.svelte +16 -18
- package/components/messagebar-attachments.d.ts +11 -5
- package/components/messagebar-attachments.svelte +6 -6
- package/components/messagebar-sheet-image.d.ts +19 -10
- package/components/messagebar-sheet-image.svelte +30 -22
- package/components/messagebar-sheet-item.d.ts +11 -5
- package/components/messagebar-sheet-item.svelte +4 -6
- package/components/messagebar-sheet.d.ts +11 -5
- package/components/messagebar-sheet.svelte +4 -6
- package/components/messagebar.d.ts +53 -31
- package/components/messagebar.svelte +100 -77
- package/components/messages-title.d.ts +11 -5
- package/components/messages-title.svelte +4 -6
- package/components/messages.d.ts +26 -20
- package/components/messages.svelte +32 -32
- package/components/nav-left.d.ts +19 -12
- package/components/nav-left.svelte +23 -39
- package/components/nav-right.d.ts +11 -6
- package/components/nav-right.svelte +4 -15
- package/components/nav-title-large.d.ts +11 -5
- package/components/nav-title-large.svelte +4 -6
- package/components/nav-title.d.ts +13 -8
- package/components/nav-title.svelte +25 -20
- package/components/navbar.d.ts +47 -28
- package/components/navbar.svelte +100 -111
- package/components/page-content.d.ts +41 -29
- package/components/page-content.svelte +58 -50
- package/components/page.d.ts +71 -46
- package/components/page.svelte +102 -82
- package/components/panel.d.ts +51 -35
- package/components/panel.svelte +94 -99
- package/components/photo-browser.d.ts +50 -41
- package/components/photo-browser.svelte +48 -47
- package/components/pie-chart.d.ts +13 -6
- package/components/pie-chart.svelte +29 -27
- package/components/popover.d.ts +28 -19
- package/components/popover.svelte +45 -48
- package/components/popup.d.ts +37 -23
- package/components/popup.svelte +68 -57
- package/components/preloader.d.ts +10 -5
- package/components/preloader.svelte +30 -31
- package/components/progressbar.d.ts +11 -6
- package/components/progressbar.svelte +13 -17
- package/components/radio.d.ts +19 -12
- package/components/radio.svelte +19 -23
- package/components/range.d.ts +35 -27
- package/components/range.svelte +47 -44
- package/components/routable-modals.d.ts +9 -4
- package/components/routable-modals.svelte +9 -8
- package/components/router-context-provider.d.ts +11 -6
- package/components/router-context-provider.svelte +2 -4
- package/components/searchbar.d.ts +60 -43
- package/components/searchbar.svelte +115 -104
- package/components/segmented.d.ts +21 -15
- package/components/segmented.svelte +38 -35
- package/components/sheet.d.ts +47 -30
- package/components/sheet.svelte +94 -76
- package/components/snippet-render.d.ts +24 -0
- package/components/snippet-render.svelte +9 -0
- package/components/stepper.d.ts +53 -43
- package/components/stepper.svelte +83 -79
- package/components/subnavbar.d.ts +13 -8
- package/components/subnavbar.svelte +12 -20
- package/components/swipeout-actions.d.ts +14 -8
- package/components/swipeout-actions.svelte +14 -13
- package/components/swipeout-button.d.ts +20 -13
- package/components/swipeout-button.svelte +31 -31
- package/components/tab.d.ts +14 -8
- package/components/tab.svelte +20 -28
- package/components/tabs.d.ts +15 -9
- package/components/tabs.svelte +27 -26
- package/components/text-editor.d.ts +44 -24
- package/components/text-editor.svelte +56 -41
- package/components/toggle.d.ts +22 -15
- package/components/toggle.svelte +33 -37
- package/components/toolbar-pane.d.ts +24 -0
- package/components/toolbar-pane.svelte +14 -0
- package/components/toolbar.d.ts +30 -20
- package/components/toolbar.svelte +61 -53
- package/components/treeview-item.d.ts +36 -17
- package/components/treeview-item.svelte +101 -81
- package/components/treeview.d.ts +11 -5
- package/components/treeview.svelte +4 -6
- package/components/use-icon.d.ts +9 -4
- package/components/use-icon.svelte +1 -1
- package/components/view.d.ts +76 -65
- package/components/view.svelte +66 -48
- package/components/views.d.ts +11 -5
- package/components/views.svelte +12 -15
- package/framework7-svelte.d.ts +3 -1
- package/framework7-svelte.js +6 -4
- package/package.json +2 -2
- package/shared/components-router.js +28 -25
- package/shared/f7.js +1 -7
- package/shared/mixins.js +5 -5
- package/shared/modal-state-classes.js +4 -5
- package/shared/plugin.js +1 -4
- package/shared/rest-props.js +1 -4
- package/shared/use-icon.js +2 -5
- package/shared/use-store.js +9 -9
- package/shared/use-tab.js +3 -3
- package/shared/use-tooltip.js +3 -4
- package/shared/utils.js +2 -8
- package/shared/get-reactive-context.js +0 -16
- package/shared/list-context.js +0 -10
- package/shared/router-context.js +0 -8
- package/shared/set-reactive-context.js +0 -26
|
@@ -1,89 +1,83 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
import { onMount, onDestroy } from 'svelte';
|
|
3
4
|
import { colorClasses } from '../shared/mixins.js';
|
|
4
|
-
import { classNames, extend
|
|
5
|
-
import { restProps } from '../shared/rest-props.js';
|
|
5
|
+
import { classNames, extend } from '../shared/utils.js';
|
|
6
6
|
import { app, f7ready } from '../shared/f7.js';
|
|
7
|
-
import { getReactiveContext } from '../shared/get-reactive-context.js';
|
|
8
7
|
|
|
9
8
|
import TextEditor from './text-editor.svelte';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let
|
|
82
|
-
let inputFocused = false;
|
|
83
|
-
let inputInvalid = false;
|
|
84
|
-
let updateInputOnDidUpdate = false;
|
|
85
|
-
let f7Calendar;
|
|
86
|
-
let f7ColorPicker;
|
|
10
|
+
let {
|
|
11
|
+
class: className,
|
|
12
|
+
sortable = undefined,
|
|
13
|
+
sortableOpposite = undefined,
|
|
14
|
+
media = undefined,
|
|
15
|
+
dropdown = 'auto',
|
|
16
|
+
wrap = true,
|
|
17
|
+
input = true,
|
|
18
|
+
inputContent = undefined,
|
|
19
|
+
type = 'text',
|
|
20
|
+
name = undefined,
|
|
21
|
+
value = undefined,
|
|
22
|
+
inputmode = undefined,
|
|
23
|
+
readonly = undefined,
|
|
24
|
+
required = undefined,
|
|
25
|
+
disabled = undefined,
|
|
26
|
+
placeholder = undefined,
|
|
27
|
+
inputId = undefined,
|
|
28
|
+
size = undefined,
|
|
29
|
+
accept = undefined,
|
|
30
|
+
autocomplete = undefined,
|
|
31
|
+
autocorrect = undefined,
|
|
32
|
+
autocapitalize = undefined,
|
|
33
|
+
spellcheck = undefined,
|
|
34
|
+
autofocus = undefined,
|
|
35
|
+
autosave = undefined,
|
|
36
|
+
max = undefined,
|
|
37
|
+
min = undefined,
|
|
38
|
+
step = undefined,
|
|
39
|
+
maxlength = undefined,
|
|
40
|
+
minlength = undefined,
|
|
41
|
+
multiple = undefined,
|
|
42
|
+
inputStyle = undefined,
|
|
43
|
+
pattern = undefined,
|
|
44
|
+
validate = undefined,
|
|
45
|
+
validateOnBlur = undefined,
|
|
46
|
+
onValidate = undefined,
|
|
47
|
+
tabindex = undefined,
|
|
48
|
+
resizable = undefined,
|
|
49
|
+
clearButton = undefined,
|
|
50
|
+
noFormStoreData = undefined,
|
|
51
|
+
noStoreData = undefined,
|
|
52
|
+
ignoreStoreData = undefined,
|
|
53
|
+
errorMessage = undefined,
|
|
54
|
+
errorMessageForce = undefined,
|
|
55
|
+
info = undefined,
|
|
56
|
+
outline = undefined,
|
|
57
|
+
label = undefined,
|
|
58
|
+
floatingLabel = undefined,
|
|
59
|
+
calendarParams = undefined,
|
|
60
|
+
colorPickerParams = undefined,
|
|
61
|
+
textEditorParams = undefined,
|
|
62
|
+
rootStart,
|
|
63
|
+
contentStart,
|
|
64
|
+
innerStart,
|
|
65
|
+
inner,
|
|
66
|
+
innerEnd,
|
|
67
|
+
content,
|
|
68
|
+
contentEnd,
|
|
69
|
+
root,
|
|
70
|
+
rootEnd,
|
|
71
|
+
children,
|
|
72
|
+
...restProps
|
|
73
|
+
} = $props();
|
|
74
|
+
|
|
75
|
+
let inputEl = $state(null);
|
|
76
|
+
let inputFocused = $state(false);
|
|
77
|
+
let inputInvalid = $state(false);
|
|
78
|
+
let updateInputOnDidUpdate = $state(false);
|
|
79
|
+
let f7Calendar = $state(null);
|
|
80
|
+
let f7ColorPicker = $state(null);
|
|
87
81
|
|
|
88
82
|
export function calendarInstance() {
|
|
89
83
|
return f7Calendar;
|
|
@@ -93,13 +87,18 @@
|
|
|
93
87
|
return f7ColorPicker;
|
|
94
88
|
}
|
|
95
89
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
const ListContext =
|
|
91
|
+
getContext('ListContext') ||
|
|
92
|
+
(() => ({
|
|
93
|
+
value: {},
|
|
94
|
+
}));
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
const isSortable = $derived(
|
|
97
|
+
sortable === true || sortable === false ? sortable : ListContext().value.listIsSortable,
|
|
98
|
+
);
|
|
99
|
+
const isSortableOpposite = $derived(
|
|
100
|
+
sortableOpposite || ListContext().value.listIsSortableOpposite,
|
|
101
|
+
);
|
|
103
102
|
|
|
104
103
|
function domValue() {
|
|
105
104
|
if (!inputEl) return undefined;
|
|
@@ -132,7 +131,7 @@
|
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
|
|
135
|
-
let initialWatched = false;
|
|
134
|
+
let initialWatched = $state(false);
|
|
136
135
|
function watchValue() {
|
|
137
136
|
if (!initialWatched) {
|
|
138
137
|
initialWatched = true;
|
|
@@ -159,16 +158,15 @@
|
|
|
159
158
|
extend(f7Calendar.params, calendarParams || {});
|
|
160
159
|
}
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
$effect(() => watchValue(value));
|
|
162
|
+
$effect(() => watchColorPickerParams(colorPickerParams));
|
|
163
|
+
$effect(() => watchCalendarParams(calendarParams));
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
const inputType = $derived(type === 'datepicker' || type === 'colorpicker' ? 'text' : type);
|
|
167
166
|
|
|
168
|
-
|
|
169
|
-
$: needsValue = type !== 'file' && type !== 'datepicker' && type !== 'colorpicker';
|
|
167
|
+
const needsValue = $derived(type !== 'file' && type !== 'datepicker' && type !== 'colorpicker');
|
|
170
168
|
|
|
171
|
-
|
|
169
|
+
const inputValue = $derived.by(() => {
|
|
172
170
|
let v;
|
|
173
171
|
if (typeof value !== 'undefined') {
|
|
174
172
|
v = value;
|
|
@@ -177,66 +175,79 @@
|
|
|
177
175
|
}
|
|
178
176
|
if (typeof v === 'undefined' || v === null) return '';
|
|
179
177
|
return v;
|
|
180
|
-
})();
|
|
181
|
-
|
|
182
|
-
$: hasInfoSlots = $$slots.info;
|
|
183
|
-
$: hasErrorSlots = $$slots['error-message'];
|
|
184
|
-
$: hasMediaSlots = $$slots.media;
|
|
185
|
-
$: hasLabelSlots = $$slots.label;
|
|
186
|
-
|
|
187
|
-
$: hasErrorMessage = !!errorMessage || hasErrorSlots;
|
|
188
|
-
|
|
189
|
-
$: inputClasses = classNames({
|
|
190
|
-
resizable: inputType === 'textarea' && resizable,
|
|
191
|
-
'no-store-data': noFormStoreData || noStoreData || ignoreStoreData,
|
|
192
|
-
'input-invalid': (errorMessage && errorMessageForce) || inputInvalid,
|
|
193
|
-
'input-with-value': inputHasValue(),
|
|
194
|
-
'input-focused': inputFocused,
|
|
195
178
|
});
|
|
196
179
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
|
|
180
|
+
const hasInfoSlots = $derived(info);
|
|
181
|
+
const hasErrorSlots = $derived(errorMessage);
|
|
182
|
+
const hasMediaSlots = $derived(media);
|
|
183
|
+
const hasLabelSlots = $derived(label);
|
|
184
|
+
|
|
185
|
+
const hasErrorMessage = $derived(!!errorMessage || hasErrorSlots);
|
|
186
|
+
|
|
187
|
+
const inputClasses = $derived(
|
|
188
|
+
classNames({
|
|
189
|
+
resizable: inputType === 'textarea' && resizable,
|
|
190
|
+
'no-store-data': noFormStoreData || noStoreData || ignoreStoreData,
|
|
191
|
+
'input-invalid': (errorMessage && errorMessageForce) || inputInvalid,
|
|
192
|
+
'input-with-value': inputHasValue(),
|
|
193
|
+
'input-focused': inputFocused,
|
|
194
|
+
}),
|
|
210
195
|
);
|
|
211
196
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
197
|
+
const itemContentClasses = $derived(
|
|
198
|
+
classNames(
|
|
199
|
+
'item-content item-input',
|
|
200
|
+
!wrap && className,
|
|
201
|
+
!wrap && { disabled },
|
|
202
|
+
!wrap && colorClasses(restProps),
|
|
203
|
+
{
|
|
204
|
+
'item-input-outline': outline,
|
|
205
|
+
'item-input-focused': inputFocused,
|
|
206
|
+
'item-input-with-info': !!info || hasInfoSlots,
|
|
207
|
+
'item-input-with-value': inputHasValue(),
|
|
208
|
+
'item-input-with-error-message': (hasErrorMessage && errorMessageForce) || inputInvalid,
|
|
209
|
+
'item-input-invalid': (hasErrorMessage && errorMessageForce) || inputInvalid,
|
|
210
|
+
},
|
|
211
|
+
),
|
|
212
|
+
);
|
|
215
213
|
|
|
216
|
-
|
|
217
|
-
'
|
|
218
|
-
|
|
214
|
+
const labelClasses = $derived(
|
|
215
|
+
classNames('item-title item-label', {
|
|
216
|
+
'item-floating-label': floatingLabel,
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
const inputWrapClasses = $derived(
|
|
221
|
+
classNames('item-input-wrap', {
|
|
222
|
+
'input-dropdown': dropdown === 'auto' ? type === 'select' : dropdown,
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const classes = $derived(classNames(className, { disabled }, colorClasses(restProps)));
|
|
221
227
|
|
|
222
228
|
function onTextareaResize(event) {
|
|
223
|
-
|
|
229
|
+
restProps.onTextareaResize?.(event);
|
|
230
|
+
restProps.ontextareaResize?.(event);
|
|
224
231
|
}
|
|
225
232
|
|
|
226
233
|
function onInputNotEmpty(event) {
|
|
227
|
-
|
|
234
|
+
restProps.onInputNotEmpty?.(event);
|
|
235
|
+
restProps.oninputNotEmpty?.(event);
|
|
228
236
|
}
|
|
229
237
|
|
|
230
238
|
function onInputEmpty(event) {
|
|
231
|
-
|
|
239
|
+
restProps.onInputEmpty?.(event);
|
|
240
|
+
restProps.oninputEmpty?.(event);
|
|
232
241
|
}
|
|
233
242
|
|
|
234
243
|
function onInputClear(event) {
|
|
235
|
-
|
|
244
|
+
restProps.onInputClear?.(event);
|
|
245
|
+
restProps.oninputClear?.(event);
|
|
236
246
|
}
|
|
237
247
|
|
|
238
248
|
function onInput(...args) {
|
|
239
|
-
|
|
249
|
+
restProps.onInput?.(...args);
|
|
250
|
+
restProps.oninput?.(...args);
|
|
240
251
|
|
|
241
252
|
if (!(validateOnBlur || validateOnBlur === '') && (validate || validate === '') && inputEl) {
|
|
242
253
|
validateInput(inputEl);
|
|
@@ -247,13 +258,15 @@
|
|
|
247
258
|
}
|
|
248
259
|
|
|
249
260
|
function onFocus(...args) {
|
|
250
|
-
|
|
261
|
+
restProps.onFocus?.(...args);
|
|
262
|
+
restProps.onfocus?.(...args);
|
|
251
263
|
|
|
252
264
|
inputFocused = true;
|
|
253
265
|
}
|
|
254
266
|
|
|
255
267
|
function onBlur(...args) {
|
|
256
|
-
|
|
268
|
+
restProps.onBlur?.(...args);
|
|
269
|
+
restProps.onblur?.(...args);
|
|
257
270
|
|
|
258
271
|
if ((validate || validate === '' || validateOnBlur || validateOnBlur === '') && inputEl) {
|
|
259
272
|
validateInput();
|
|
@@ -262,10 +275,12 @@
|
|
|
262
275
|
}
|
|
263
276
|
|
|
264
277
|
function onChange(...args) {
|
|
265
|
-
|
|
278
|
+
restProps.onChange?.(...args);
|
|
279
|
+
restProps.onchange?.(...args);
|
|
266
280
|
|
|
267
281
|
if (type === 'texteditor') {
|
|
268
|
-
|
|
282
|
+
restProps.onTextEditorChange?.(args[0]);
|
|
283
|
+
restProps.ontextEditorChange?.(args[0]);
|
|
269
284
|
value = args[0];
|
|
270
285
|
}
|
|
271
286
|
}
|
|
@@ -290,7 +305,8 @@
|
|
|
290
305
|
value,
|
|
291
306
|
on: {
|
|
292
307
|
change(calendar, calendarValue) {
|
|
293
|
-
|
|
308
|
+
restProps.onCalendarChange?.(calendarValue);
|
|
309
|
+
restProps.oncalendarChange?.(calendarValue);
|
|
294
310
|
value = calendarValue;
|
|
295
311
|
},
|
|
296
312
|
},
|
|
@@ -303,7 +319,11 @@
|
|
|
303
319
|
value,
|
|
304
320
|
on: {
|
|
305
321
|
change(colorPicker, colorPickerValue) {
|
|
306
|
-
|
|
322
|
+
if (JSON.stringify(value) === JSON.stringify(colorPickerValue)) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
restProps.onColorPickerChange?.(colorPickerValue);
|
|
326
|
+
restProps.oncolorPickerChange?.(colorPickerValue);
|
|
307
327
|
value = colorPickerValue;
|
|
308
328
|
},
|
|
309
329
|
},
|
|
@@ -329,7 +349,7 @@
|
|
|
329
349
|
});
|
|
330
350
|
});
|
|
331
351
|
|
|
332
|
-
|
|
352
|
+
$effect(() => {
|
|
333
353
|
if (!app.f7) return;
|
|
334
354
|
if (updateInputOnDidUpdate) {
|
|
335
355
|
if (!inputEl) return;
|
|
@@ -370,30 +390,36 @@
|
|
|
370
390
|
<!-- svelte-ignore a11y-autofocus -->
|
|
371
391
|
<!-- svelte-ignore a11y-missing-attribute -->
|
|
372
392
|
{#if wrap}
|
|
373
|
-
<li class={classes} {...restProps
|
|
374
|
-
|
|
393
|
+
<li class={classes} {...restProps}>
|
|
394
|
+
{@render rootStart?.()}
|
|
375
395
|
<div class={itemContentClasses}>
|
|
376
|
-
|
|
396
|
+
{@render contentStart?.()}
|
|
377
397
|
{#if isSortable && isSortableOpposite}
|
|
378
398
|
<div class="sortable-handler" />
|
|
379
399
|
{/if}
|
|
380
400
|
|
|
381
401
|
{#if media || hasMediaSlots}
|
|
382
402
|
<div class="item-media">
|
|
383
|
-
{#if typeof media
|
|
384
|
-
|
|
403
|
+
{#if typeof media === 'function'}
|
|
404
|
+
{@render media?.()}
|
|
405
|
+
{:else if typeof media === 'string'}
|
|
406
|
+
<img src={media} />
|
|
407
|
+
{/if}
|
|
385
408
|
</div>
|
|
386
409
|
{/if}
|
|
387
410
|
<div class="item-inner">
|
|
388
|
-
|
|
411
|
+
{@render innerStart?.()}
|
|
389
412
|
{#if typeof label !== 'undefined' || hasLabelSlots}
|
|
390
413
|
<div class={labelClasses}>
|
|
391
|
-
{
|
|
392
|
-
|
|
414
|
+
{#if typeof label === 'function'}
|
|
415
|
+
{@render label?.()}
|
|
416
|
+
{:else}
|
|
417
|
+
{label}
|
|
418
|
+
{/if}
|
|
393
419
|
</div>
|
|
394
420
|
{/if}
|
|
395
421
|
<div class={inputWrapClasses}>
|
|
396
|
-
{#if input}
|
|
422
|
+
{#if input === true}
|
|
397
423
|
{#if type === 'select'}
|
|
398
424
|
<select
|
|
399
425
|
bind:this={inputEl}
|
|
@@ -432,13 +458,13 @@
|
|
|
432
458
|
{tabindex}
|
|
433
459
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
434
460
|
class={inputClasses}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
461
|
+
onfocus={onFocus}
|
|
462
|
+
onblur={onBlur}
|
|
463
|
+
oninput={onInput}
|
|
464
|
+
onchange={onChange}
|
|
439
465
|
value={inputValue}
|
|
440
466
|
>
|
|
441
|
-
|
|
467
|
+
{@render children?.()}
|
|
442
468
|
</select>
|
|
443
469
|
{:else if type === 'textarea'}
|
|
444
470
|
<textarea
|
|
@@ -479,10 +505,10 @@
|
|
|
479
505
|
{tabindex}
|
|
480
506
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
481
507
|
class={inputClasses}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
508
|
+
onfocus={onFocus}
|
|
509
|
+
onblur={onBlur}
|
|
510
|
+
oninput={onInput}
|
|
511
|
+
onchange={onChange}
|
|
486
512
|
value={inputValue}
|
|
487
513
|
/>
|
|
488
514
|
{:else if type === 'texteditor'}
|
|
@@ -536,66 +562,81 @@
|
|
|
536
562
|
tabIndex={tabindex}
|
|
537
563
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
538
564
|
class={inputClasses}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
565
|
+
onfocus={onFocus}
|
|
566
|
+
onblur={onBlur}
|
|
567
|
+
oninput={onInput}
|
|
568
|
+
onchange={onChange}
|
|
543
569
|
value={type === 'datepicker' || type === 'colorpicker' || type === 'file'
|
|
544
570
|
? ''
|
|
545
571
|
: inputValue}
|
|
546
572
|
/>
|
|
547
573
|
{/if}
|
|
548
574
|
{/if}
|
|
549
|
-
|
|
575
|
+
{#if typeof inputContent === 'function'}
|
|
576
|
+
{@render inputContent?.()}
|
|
577
|
+
{/if}
|
|
578
|
+
|
|
550
579
|
{#if hasErrorMessage && errorMessageForce}
|
|
551
580
|
<div class="item-input-error-message">
|
|
552
|
-
{
|
|
553
|
-
|
|
581
|
+
{#if typeof errorMessage === 'function'}
|
|
582
|
+
{@render errorMessage?.()}
|
|
583
|
+
{:else}
|
|
584
|
+
{errorMessage}
|
|
585
|
+
{/if}
|
|
554
586
|
</div>
|
|
555
587
|
{/if}
|
|
556
588
|
{#if clearButton}<span class="input-clear-button" />{/if}
|
|
557
589
|
{#if typeof info !== 'undefined' || hasInfoSlots}
|
|
558
590
|
<div class="item-input-info">
|
|
559
|
-
{
|
|
560
|
-
|
|
591
|
+
{#if typeof info === 'function'}
|
|
592
|
+
{@render info?.()}
|
|
593
|
+
{:else}
|
|
594
|
+
{info}
|
|
595
|
+
{/if}
|
|
561
596
|
</div>
|
|
562
597
|
{/if}
|
|
563
598
|
</div>
|
|
564
|
-
|
|
565
|
-
|
|
599
|
+
{@render inner?.()}
|
|
600
|
+
{@render innerEnd?.()}
|
|
566
601
|
</div>
|
|
567
|
-
|
|
568
|
-
|
|
602
|
+
{@render content?.()}
|
|
603
|
+
{@render contentEnd?.()}
|
|
569
604
|
</div>
|
|
570
605
|
{#if isSortable && !isSortableOpposite}
|
|
571
606
|
<div class="sortable-handler" />
|
|
572
607
|
{/if}
|
|
573
|
-
|
|
574
|
-
|
|
608
|
+
{@render root?.()}
|
|
609
|
+
{@render rootEnd?.()}
|
|
575
610
|
</li>
|
|
576
611
|
{:else}
|
|
577
|
-
<div class={itemContentClasses} {...restProps
|
|
578
|
-
|
|
612
|
+
<div class={itemContentClasses} {...restProps}>
|
|
613
|
+
{@render contentStart?.()}
|
|
579
614
|
{#if isSortable && isSortableOpposite}
|
|
580
615
|
<div class="sortable-handler" />
|
|
581
616
|
{/if}
|
|
582
617
|
|
|
583
618
|
{#if media || hasMediaSlots}
|
|
584
619
|
<div class="item-media">
|
|
585
|
-
{#if typeof media
|
|
586
|
-
|
|
620
|
+
{#if typeof media === 'function'}
|
|
621
|
+
{@render media?.()}
|
|
622
|
+
{:else if typeof media === 'string'}
|
|
623
|
+
<img src={media} />
|
|
624
|
+
{/if}
|
|
587
625
|
</div>
|
|
588
626
|
{/if}
|
|
589
627
|
<div class="item-inner">
|
|
590
|
-
|
|
628
|
+
{@render innerStart?.()}
|
|
591
629
|
{#if typeof label !== 'undefined' || hasLabelSlots}
|
|
592
630
|
<div class={labelClasses}>
|
|
593
|
-
{
|
|
594
|
-
|
|
631
|
+
{#if typeof label === 'function'}
|
|
632
|
+
{@render label?.()}
|
|
633
|
+
{:else}
|
|
634
|
+
{label}
|
|
635
|
+
{/if}
|
|
595
636
|
</div>
|
|
596
637
|
{/if}
|
|
597
638
|
<div class={inputWrapClasses}>
|
|
598
|
-
{#if input}
|
|
639
|
+
{#if input === true}
|
|
599
640
|
{#if type === 'select'}
|
|
600
641
|
<select
|
|
601
642
|
bind:this={inputEl}
|
|
@@ -634,13 +675,13 @@
|
|
|
634
675
|
{tabindex}
|
|
635
676
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
636
677
|
class={inputClasses}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
678
|
+
onfocus={onFocus}
|
|
679
|
+
onblur={onBlur}
|
|
680
|
+
oninput={onInput}
|
|
681
|
+
onchange={onChange}
|
|
641
682
|
value={inputValue}
|
|
642
683
|
>
|
|
643
|
-
|
|
684
|
+
{@render children?.()}
|
|
644
685
|
</select>
|
|
645
686
|
{:else if type === 'textarea'}
|
|
646
687
|
<textarea
|
|
@@ -681,10 +722,10 @@
|
|
|
681
722
|
{tabindex}
|
|
682
723
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
683
724
|
class={inputClasses}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
725
|
+
onfocus={onFocus}
|
|
726
|
+
onblur={onBlur}
|
|
727
|
+
oninput={onInput}
|
|
728
|
+
onchange={onChange}
|
|
688
729
|
value={inputValue}
|
|
689
730
|
/>
|
|
690
731
|
{:else if type === 'texteditor'}
|
|
@@ -738,35 +779,43 @@
|
|
|
738
779
|
tabIndex={tabindex}
|
|
739
780
|
data-error-message={errorMessageForce ? undefined : errorMessage}
|
|
740
781
|
class={inputClasses}
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
782
|
+
onfocus={onFocus}
|
|
783
|
+
onblur={onBlur}
|
|
784
|
+
oninput={onInput}
|
|
785
|
+
onchange={onChange}
|
|
745
786
|
value={type === 'datepicker' || type === 'colorpicker' || type === 'file'
|
|
746
787
|
? ''
|
|
747
788
|
: inputValue}
|
|
748
789
|
/>
|
|
749
790
|
{/if}
|
|
750
791
|
{/if}
|
|
751
|
-
|
|
792
|
+
{#if typeof inputContent === 'function'}
|
|
793
|
+
{@render inputContent?.()}
|
|
794
|
+
{/if}
|
|
752
795
|
{#if hasErrorMessage && errorMessageForce}
|
|
753
796
|
<div class="item-input-error-message">
|
|
754
|
-
{
|
|
755
|
-
|
|
797
|
+
{#if typeof errorMessage === 'function'}
|
|
798
|
+
{@render errorMessage?.()}
|
|
799
|
+
{:else}
|
|
800
|
+
{errorMessage}
|
|
801
|
+
{/if}
|
|
756
802
|
</div>
|
|
757
803
|
{/if}
|
|
758
|
-
{#if clearButton}<span class="input-clear-button"
|
|
804
|
+
{#if clearButton}<span class="input-clear-button"></span>{/if}
|
|
759
805
|
{#if typeof info !== 'undefined' || hasInfoSlots}
|
|
760
806
|
<div class="item-input-info">
|
|
761
|
-
{
|
|
762
|
-
|
|
807
|
+
{#if typeof info === 'function'}
|
|
808
|
+
{@render info?.()}
|
|
809
|
+
{:else}
|
|
810
|
+
{info}
|
|
811
|
+
{/if}
|
|
763
812
|
</div>
|
|
764
813
|
{/if}
|
|
765
814
|
</div>
|
|
766
|
-
|
|
767
|
-
|
|
815
|
+
{@render inner?.()}
|
|
816
|
+
{@render innerEnd?.()}
|
|
768
817
|
</div>
|
|
769
|
-
|
|
770
|
-
|
|
818
|
+
{@render content?.()}
|
|
819
|
+
{@render contentEnd?.()}
|
|
771
820
|
</div>
|
|
772
821
|
{/if}
|