@rdlabo/ionic-theme-ios27 1.2.0-3 → 1.2.0-4
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/README.md +15 -2
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/css/ionic-theme-ios27.css +1 -1
- package/dist/css/vertical-bars.css +1 -1
- package/dist/focus-controller/index.d.ts +4 -2
- package/dist/focus-controller/index.d.ts.map +1 -1
- package/dist/focus-controller/index.js +100 -57
- package/dist/focus-controller/index.js.map +1 -0
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -60
- package/dist/index.js.map +1 -0
- package/dist/native/components/index.d.ts +13 -10
- package/dist/native/components/index.d.ts.map +1 -1
- package/dist/native/components/index.js +39 -41
- package/dist/native/components/index.js.map +1 -0
- package/dist/native/components/ion-back-button.d.ts +6 -1
- package/dist/native/components/ion-back-button.d.ts.map +1 -1
- package/dist/native/components/ion-back-button.js +19 -13
- package/dist/native/components/ion-back-button.js.map +1 -0
- package/dist/native/components/ion-button.d.ts +8 -2
- package/dist/native/components/ion-button.d.ts.map +1 -1
- package/dist/native/components/ion-button.js +22 -17
- package/dist/native/components/ion-button.js.map +1 -0
- package/dist/native/components/ion-buttons.d.ts +8 -2
- package/dist/native/components/ion-buttons.d.ts.map +1 -1
- package/dist/native/components/ion-buttons.js +29 -33
- package/dist/native/components/ion-buttons.js.map +1 -0
- package/dist/native/components/ion-fab.d.ts +6 -1
- package/dist/native/components/ion-fab.d.ts.map +1 -1
- package/dist/native/components/ion-fab.js +131 -151
- package/dist/native/components/ion-fab.js.map +1 -0
- package/dist/native/components/ion-menu-button.d.ts +8 -2
- package/dist/native/components/ion-menu-button.d.ts.map +1 -1
- package/dist/native/components/ion-menu-button.js +29 -19
- package/dist/native/components/ion-menu-button.js.map +1 -0
- package/dist/native/components/ion-segment.d.ts +6 -1
- package/dist/native/components/ion-segment.d.ts.map +1 -1
- package/dist/native/components/ion-segment.js +29 -23
- package/dist/native/components/ion-segment.js.map +1 -0
- package/dist/native/components/ion-tab-bar.d.ts +6 -1
- package/dist/native/components/ion-tab-bar.d.ts.map +1 -1
- package/dist/native/components/ion-tab-bar.js +49 -40
- package/dist/native/components/ion-tab-bar.js.map +1 -0
- package/dist/native/components/searchable-tabs.d.ts +17 -15
- package/dist/native/components/searchable-tabs.d.ts.map +1 -1
- package/dist/native/components/searchable-tabs.js +382 -434
- package/dist/native/components/searchable-tabs.js.map +1 -0
- package/dist/native/definitions.d.ts +118 -111
- package/dist/native/definitions.d.ts.map +1 -1
- package/dist/native/definitions.js +0 -1
- package/dist/native/foldable/fold-state.d.ts +5 -0
- package/dist/native/foldable/fold-state.d.ts.map +1 -0
- package/dist/native/foldable/fold-state.js +14 -0
- package/dist/native/foldable/fold-state.js.map +1 -0
- package/dist/native/foldable/types.d.ts +12 -0
- package/dist/native/foldable/types.d.ts.map +1 -0
- package/dist/native/foldable/types.js +0 -0
- package/dist/native/index.d.ts +6 -3
- package/dist/native/index.d.ts.map +1 -1
- package/dist/native/index.js +228 -204
- package/dist/native/index.js.map +1 -0
- package/dist/native/prehide.d.ts +4 -2
- package/dist/native/prehide.d.ts.map +1 -1
- package/dist/native/prehide.js +220 -242
- package/dist/native/prehide.js.map +1 -0
- package/dist/native/runtime.d.ts +3 -1
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +626 -730
- package/dist/native/runtime.js.map +1 -0
- package/dist/native/shared/candidate.d.ts +16 -11
- package/dist/native/shared/candidate.d.ts.map +1 -1
- package/dist/native/shared/candidate.js +96 -95
- package/dist/native/shared/candidate.js.map +1 -0
- package/dist/native/shared/crossfade.d.ts +6 -4
- package/dist/native/shared/crossfade.d.ts.map +1 -1
- package/dist/native/shared/crossfade.js +49 -45
- package/dist/native/shared/crossfade.js.map +1 -0
- package/dist/native/shared/dom.d.ts +7 -5
- package/dist/native/shared/dom.d.ts.map +1 -1
- package/dist/native/shared/dom.js +163 -211
- package/dist/native/shared/dom.js.map +1 -0
- package/dist/native/shared/events.d.ts +8 -6
- package/dist/native/shared/events.d.ts.map +1 -1
- package/dist/native/shared/events.js +12 -7
- package/dist/native/shared/events.js.map +1 -0
- package/dist/native/shared/icons.d.ts +4 -2
- package/dist/native/shared/icons.d.ts.map +1 -1
- package/dist/native/shared/icons.js +59 -53
- package/dist/native/shared/icons.js.map +1 -0
- package/dist/native/shared/modal.d.ts +3 -1
- package/dist/native/shared/modal.d.ts.map +1 -1
- package/dist/native/shared/modal.js +156 -139
- package/dist/native/shared/modal.js.map +1 -0
- package/dist/native/vertical-bars-web.d.ts +3 -1
- package/dist/native/vertical-bars-web.d.ts.map +1 -1
- package/dist/native/vertical-bars-web.js +332 -346
- package/dist/native/vertical-bars-web.js.map +1 -0
- package/dist/native-integration/index.d.ts +10 -8
- package/dist/native-integration/index.d.ts.map +1 -1
- package/dist/native-integration/index.js +102 -100
- package/dist/native-integration/index.js.map +1 -0
- package/dist/native-integration/transition.d.ts +3 -1
- package/dist/native-integration/transition.d.ts.map +1 -1
- package/dist/native-integration/transition.js +15 -6
- package/dist/native-integration/transition.js.map +1 -0
- package/dist/searchbar/index.d.ts +4 -2
- package/dist/searchbar/index.d.ts.map +1 -1
- package/dist/searchbar/index.js +64 -56
- package/dist/searchbar/index.js.map +1 -0
- package/dist/segment/index.d.ts +3 -1
- package/dist/segment/index.d.ts.map +1 -1
- package/dist/segment/index.js +465 -324
- package/dist/segment/index.js.map +1 -0
- package/dist/sheets-of-glass/animations.d.ts +13 -12
- package/dist/sheets-of-glass/animations.d.ts.map +1 -1
- package/dist/sheets-of-glass/animations.js +496 -306
- package/dist/sheets-of-glass/animations.js.map +1 -0
- package/dist/sheets-of-glass/index.d.ts +3 -1
- package/dist/sheets-of-glass/index.d.ts.map +1 -1
- package/dist/sheets-of-glass/index.js +294 -357
- package/dist/sheets-of-glass/index.js.map +1 -0
- package/dist/sheets-of-glass/interfaces.d.ts +11 -9
- package/dist/sheets-of-glass/interfaces.d.ts.map +1 -1
- package/dist/sheets-of-glass/interfaces.js +0 -1
- package/dist/tab-bar-searchable/animations/enter.d.ts +4 -2
- package/dist/tab-bar-searchable/animations/enter.d.ts.map +1 -1
- package/dist/tab-bar-searchable/animations/enter.js +50 -69
- package/dist/tab-bar-searchable/animations/enter.js.map +1 -0
- package/dist/tab-bar-searchable/animations/leave.d.ts +4 -2
- package/dist/tab-bar-searchable/animations/leave.d.ts.map +1 -1
- package/dist/tab-bar-searchable/animations/leave.js +48 -62
- package/dist/tab-bar-searchable/animations/leave.js.map +1 -0
- package/dist/tab-bar-searchable/index.d.ts +5 -3
- package/dist/tab-bar-searchable/index.d.ts.map +1 -1
- package/dist/tab-bar-searchable/index.js +123 -135
- package/dist/tab-bar-searchable/index.js.map +1 -0
- package/dist/transition/index.d.ts +9 -8
- package/dist/transition/index.d.ts.map +1 -1
- package/dist/transition/index.js +203 -192
- package/dist/transition/index.js.map +1 -0
- package/dist/transition/ios.transition.d.ts +7 -5
- package/dist/transition/ios.transition.d.ts.map +1 -1
- package/dist/transition/ios.transition.js +15 -11
- package/dist/transition/ios.transition.js.map +1 -0
- package/dist/utils.d.ts +10 -8
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +58 -66
- package/dist/utils.js.map +1 -0
- package/dist/vertical-bars.d.ts +5 -4
- package/dist/vertical-bars.js +4 -2
- package/docs/iphone-duo-with-original-theme.md +18 -29
- package/docs/iphone-duo.md +44 -204
- package/docs/native-ui-shell.md +10 -8
- package/docs/special-markup.md +2 -0
- package/docs/vertical-bars.md +283 -0
- package/ios/Sources/IonicNativeUIShellPlugin/Components/ShellVerticalBars.swift +34 -14
- package/ios/Sources/IonicNativeUIShellPlugin/Shared/ShellSnapshot.swift +2 -0
- package/ios/Tests/IonicNativeUIShellPluginTests/ShellSnapshotTests.swift +3 -0
- package/package.json +9 -6
- package/src/native/components/index.ts +3 -2
- package/src/native/components/ion-button.ts +3 -2
- package/src/native/components/ion-buttons.ts +4 -3
- package/src/native/components/ion-menu-button.ts +3 -2
- package/src/native/definitions.ts +22 -1
- package/src/native/foldable/fold-state.ts +9 -0
- package/src/native/foldable/types.ts +4 -0
- package/src/native/index.ts +17 -3
- package/src/native/prehide.ts +3 -1
- package/src/native/runtime.ts +2 -2
- package/src/native/shared/candidate.ts +39 -10
- package/src/native/shared/dom.ts +4 -4
- package/src/styles/vertical-bars.scss +4 -2
- package/src/vertical-bars.ts +9 -1
- package/dist/vertical-bars.d.ts.map +0 -1
|
@@ -1,435 +1,383 @@
|
|
|
1
|
-
import { getNativeSearchBindings, requestNativeSearch } from
|
|
2
|
-
import { excluded, inFixedToolbar, isShellDisabled, marker, text, visible } from
|
|
3
|
-
import { iconSource } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (!state ||
|
|
380
|
-
!state.binding.active ||
|
|
381
|
-
((event.phase === 'input' || event.phase === 'clear') && event.valueVersion !== state.valueVersion) ||
|
|
382
|
-
event.revision < state.minimumRevision ||
|
|
383
|
-
event.sequence <= state.editSequence ||
|
|
384
|
-
state.bar.disabled)
|
|
385
|
-
return;
|
|
386
|
-
state.editSequence = event.sequence;
|
|
387
|
-
const { input, binding } = state;
|
|
388
|
-
if (event.phase === 'input') {
|
|
389
|
-
if (state.composing !== event.composing)
|
|
390
|
-
input.dispatchEvent(new CompositionEvent(event.composing ? 'compositionstart' : 'compositionend', { bubbles: true, data: event.value }));
|
|
391
|
-
state.composing = event.composing;
|
|
392
|
-
input.value = event.value;
|
|
393
|
-
state.applyingInput = true;
|
|
394
|
-
try {
|
|
395
|
-
input.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true, isComposing: event.composing }));
|
|
396
|
-
}
|
|
397
|
-
finally {
|
|
398
|
-
state.applyingInput = false;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
else if (event.phase === 'clear') {
|
|
402
|
-
state.bar.querySelector('.searchbar-clear-button')?.click();
|
|
403
|
-
}
|
|
404
|
-
else if (event.phase === 'commit') {
|
|
405
|
-
input.dispatchEvent(new Event('change', { bubbles: true }));
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
if (state.focused === (event.phase === 'focus'))
|
|
409
|
-
return;
|
|
410
|
-
state.focused = binding.focused = event.phase === 'focus';
|
|
411
|
-
input.dispatchEvent(new FocusEvent(event.phase, { composed: true }));
|
|
412
|
-
}
|
|
413
|
-
schedule();
|
|
414
|
-
},
|
|
415
|
-
retire(binding) {
|
|
416
|
-
const state = states.get(binding);
|
|
417
|
-
if (state?.keyboardHidden && keyboardVisible)
|
|
418
|
-
binding.tabBar.classList.add('tab-bar-hidden');
|
|
419
|
-
if (state?.focused) {
|
|
420
|
-
state.focused = false;
|
|
421
|
-
state.input.dispatchEvent(new FocusEvent('blur'));
|
|
422
|
-
}
|
|
423
|
-
binding.active = binding.focused = false;
|
|
424
|
-
releaseKeyboardResize();
|
|
425
|
-
},
|
|
426
|
-
destroy() {
|
|
427
|
-
states.forEach((state) => {
|
|
428
|
-
this.retire(state.binding);
|
|
429
|
-
state.restore();
|
|
430
|
-
});
|
|
431
|
-
states.clear();
|
|
432
|
-
releaseKeyboardResize();
|
|
433
|
-
},
|
|
434
|
-
};
|
|
1
|
+
import { getNativeSearchBindings, requestNativeSearch } from "../../native-integration/index.js";
|
|
2
|
+
import { excluded, inFixedToolbar, isShellDisabled, marker, text, visible } from "../shared/dom.js";
|
|
3
|
+
import { iconSource } from "../shared/icons.js";
|
|
4
|
+
//#region src/native/components/searchable-tabs.ts
|
|
5
|
+
const createSearchSupport = (doc, id, schedule) => {
|
|
6
|
+
const states = /* @__PURE__ */ new Map();
|
|
7
|
+
let keyboardVisible = false;
|
|
8
|
+
let heldKeyboardResize = null;
|
|
9
|
+
let keyboardResizeGeneration = 0;
|
|
10
|
+
const keyboardPlugin = () => doc.defaultView?.Capacitor?.Plugins?.Keyboard;
|
|
11
|
+
const projected = (binding) => binding.footer.hasAttribute(marker);
|
|
12
|
+
const holdKeyboardResize = () => {
|
|
13
|
+
const keyboard = keyboardPlugin();
|
|
14
|
+
if (!keyboard?.setResizeMode || heldKeyboardResize !== null) return;
|
|
15
|
+
const setResizeMode = keyboard.setResizeMode.bind(keyboard);
|
|
16
|
+
const generation = ++keyboardResizeGeneration;
|
|
17
|
+
heldKeyboardResize = "native";
|
|
18
|
+
(async () => {
|
|
19
|
+
let restoreMode = "native";
|
|
20
|
+
try {
|
|
21
|
+
const current = await keyboard.getResizeMode?.();
|
|
22
|
+
if (typeof current?.mode === "string") restoreMode = current.mode;
|
|
23
|
+
} catch {}
|
|
24
|
+
if (generation !== keyboardResizeGeneration) return;
|
|
25
|
+
heldKeyboardResize = restoreMode;
|
|
26
|
+
try {
|
|
27
|
+
await setResizeMode({ mode: "none" });
|
|
28
|
+
} catch {
|
|
29
|
+
if (generation === keyboardResizeGeneration) heldKeyboardResize = null;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (generation !== keyboardResizeGeneration) setResizeMode({ mode: restoreMode }).catch(() => void 0);
|
|
33
|
+
})();
|
|
34
|
+
};
|
|
35
|
+
const hasActiveProjection = () => [...states.keys()].some((binding) => binding.active && projected(binding));
|
|
36
|
+
const releaseKeyboardResize = () => {
|
|
37
|
+
if (hasActiveProjection()) return;
|
|
38
|
+
keyboardResizeGeneration++;
|
|
39
|
+
const mode = heldKeyboardResize;
|
|
40
|
+
heldKeyboardResize = null;
|
|
41
|
+
if (!mode) return;
|
|
42
|
+
keyboardPlugin()?.setResizeMode?.({ mode });
|
|
43
|
+
};
|
|
44
|
+
const isCurrent = (state) => state.bar.isConnected && state.binding.footer.querySelector("ion-searchbar") === state.bar && state.bar.querySelector("input.searchbar-input") === state.input;
|
|
45
|
+
const install = (binding, bar, input) => {
|
|
46
|
+
const originalFocus = bar.setFocus;
|
|
47
|
+
const ownValue = Object.getOwnPropertyDescriptor(bar, "value");
|
|
48
|
+
let owner = bar;
|
|
49
|
+
let value = ownValue;
|
|
50
|
+
while (!value && (owner = Object.getPrototypeOf(owner))) value = Object.getOwnPropertyDescriptor(owner, "value");
|
|
51
|
+
const focus = async () => {
|
|
52
|
+
if (projected(binding) && await requestNativeSearch(binding, true, true)) return;
|
|
53
|
+
await originalFocus.call(bar);
|
|
54
|
+
};
|
|
55
|
+
bar.setFocus = focus;
|
|
56
|
+
let wrapped;
|
|
57
|
+
if (value?.get && value.set && ownValue?.configurable !== false) {
|
|
58
|
+
const descriptor = value;
|
|
59
|
+
wrapped = {
|
|
60
|
+
configurable: true,
|
|
61
|
+
enumerable: value.enumerable,
|
|
62
|
+
get: () => descriptor.get.call(bar),
|
|
63
|
+
set: (next) => {
|
|
64
|
+
if (state.applyingInput) state.applyingInput = false;
|
|
65
|
+
else state.valueVersion++;
|
|
66
|
+
descriptor.set.call(bar, next);
|
|
67
|
+
schedule();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
Object.defineProperty(bar, "value", wrapped);
|
|
71
|
+
}
|
|
72
|
+
const state = {
|
|
73
|
+
binding,
|
|
74
|
+
bar,
|
|
75
|
+
input,
|
|
76
|
+
editSequence: 0,
|
|
77
|
+
composing: false,
|
|
78
|
+
focused: false,
|
|
79
|
+
minimumRevision: 0,
|
|
80
|
+
valueVersion: 0,
|
|
81
|
+
applyingInput: false,
|
|
82
|
+
restore: () => {
|
|
83
|
+
if (bar.setFocus === focus) bar.setFocus = originalFocus;
|
|
84
|
+
if (wrapped && Object.getOwnPropertyDescriptor(bar, "value")?.set === wrapped.set) {
|
|
85
|
+
if (ownValue) Object.defineProperty(bar, "value", ownValue);
|
|
86
|
+
else Reflect.deleteProperty(bar, "value");
|
|
87
|
+
}
|
|
88
|
+
binding.active = binding.focused = false;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
states.set(binding, state);
|
|
92
|
+
return state;
|
|
93
|
+
};
|
|
94
|
+
const readIcon = (element, owner, candidate) => {
|
|
95
|
+
const style = getComputedStyle(element);
|
|
96
|
+
const rect = element.getBoundingClientRect();
|
|
97
|
+
const item = {
|
|
98
|
+
id: id(owner),
|
|
99
|
+
x: rect.x,
|
|
100
|
+
y: rect.y,
|
|
101
|
+
width: rect.width,
|
|
102
|
+
height: rect.height,
|
|
103
|
+
label: text(element),
|
|
104
|
+
accessibilityLabel: owner.getAttribute("aria-label") ?? text(element),
|
|
105
|
+
disabled: false,
|
|
106
|
+
selected: false,
|
|
107
|
+
fontSize: parseFloat(style.fontSize),
|
|
108
|
+
fontWeight: parseInt(style.fontWeight, 10) || 400,
|
|
109
|
+
color: style.color
|
|
110
|
+
};
|
|
111
|
+
const icon = element.matches("ion-icon") ? element : element.querySelector("ion-icon");
|
|
112
|
+
const svg = icon?.shadowRoot?.querySelector("svg") ?? element.querySelector("svg");
|
|
113
|
+
if (svg) {
|
|
114
|
+
const source = iconSource(svg);
|
|
115
|
+
if (!source) return;
|
|
116
|
+
const iconStyle = getComputedStyle(icon ?? svg);
|
|
117
|
+
item.iconWidth = parseFloat(iconStyle.width);
|
|
118
|
+
item.iconHeight = parseFloat(iconStyle.height);
|
|
119
|
+
const box = svg.viewBox?.baseVal;
|
|
120
|
+
if (box?.width && box.height && svg.getAttribute("preserveAspectRatio") !== "none") {
|
|
121
|
+
const scale = Math.min(item.iconWidth / box.width, item.iconHeight / box.height);
|
|
122
|
+
item.iconWidth = box.width * scale;
|
|
123
|
+
item.iconHeight = box.height * scale;
|
|
124
|
+
}
|
|
125
|
+
candidate.icons.push({
|
|
126
|
+
item,
|
|
127
|
+
source
|
|
128
|
+
});
|
|
129
|
+
} else if (!item.label) return;
|
|
130
|
+
return item;
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
keyboard(visible) {
|
|
134
|
+
keyboardVisible = visible;
|
|
135
|
+
if (!visible) {
|
|
136
|
+
for (const [binding, state] of states) {
|
|
137
|
+
if (state.keyboardHidden) binding.tabBar.classList.remove("tab-bar-hidden");
|
|
138
|
+
state.keyboardHidden = false;
|
|
139
|
+
}
|
|
140
|
+
releaseKeyboardResize();
|
|
141
|
+
}
|
|
142
|
+
schedule();
|
|
143
|
+
},
|
|
144
|
+
keepSearchTabsVisible() {
|
|
145
|
+
if (!keyboardVisible) return;
|
|
146
|
+
for (const [binding, state] of states) if (binding.active && projected(binding) && binding.tabBar.classList.contains("tab-bar-hidden")) {
|
|
147
|
+
state.keyboardHidden = true;
|
|
148
|
+
binding.tabBar.classList.remove("tab-bar-hidden");
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
decorate(candidates, blocked) {
|
|
152
|
+
var _candidate$control;
|
|
153
|
+
const bindings = getNativeSearchBindings(doc);
|
|
154
|
+
for (const [binding, state] of states) if (!bindings.includes(binding) || !isCurrent(state)) {
|
|
155
|
+
this.retire(binding);
|
|
156
|
+
state.restore();
|
|
157
|
+
states.delete(binding);
|
|
158
|
+
}
|
|
159
|
+
const inactive = [];
|
|
160
|
+
const pageHidden = (element) => !!element.closest(".ion-page-hidden, .ion-page-invisible");
|
|
161
|
+
const retainInactive = (candidate, state, keepAvailable = false) => {
|
|
162
|
+
if (state?.last) inactive.push([candidate, {
|
|
163
|
+
...state.last,
|
|
164
|
+
active: false,
|
|
165
|
+
available: keepAvailable,
|
|
166
|
+
focused: false
|
|
167
|
+
}]);
|
|
168
|
+
};
|
|
169
|
+
for (const binding of bindings) {
|
|
170
|
+
const candidate = candidates.find((c) => c.element === binding.tabBar);
|
|
171
|
+
if (!candidate || candidate.control.search || binding.tabBar.getAttribute("slot") !== "bottom") continue;
|
|
172
|
+
const fab = binding.trigger.parentElement;
|
|
173
|
+
if (!fab?.matches("ion-fab[slot=\"fixed\"]") || !(fab.parentElement?.matches("ion-content") || fab.parentElement?.matches(".ion-page") && !fab.closest("ion-content"))) continue;
|
|
174
|
+
if (isShellDisabled(fab) || isShellDisabled(binding.footer)) continue;
|
|
175
|
+
const pageUnavailable = blocked(binding.footer) || !!binding.footer.closest(excluded);
|
|
176
|
+
const existing = states.get(binding);
|
|
177
|
+
if (pageUnavailable) {
|
|
178
|
+
retainInactive(candidate, existing, !!existing?.last?.available && !pageHidden(binding.footer));
|
|
179
|
+
if (existing?.last) continue;
|
|
180
|
+
}
|
|
181
|
+
if (binding.active && existing && isCurrent(existing) && existing.last && !pageUnavailable) {
|
|
182
|
+
const back = binding.footer.querySelector("ion-buttons[slot=start] ion-button");
|
|
183
|
+
if (back && !back.disabled && !back.closest(excluded)) {
|
|
184
|
+
candidate.control.search = {
|
|
185
|
+
...existing.last,
|
|
186
|
+
active: true,
|
|
187
|
+
available: true,
|
|
188
|
+
focused: binding.focused,
|
|
189
|
+
value: existing.bar.value ?? "",
|
|
190
|
+
placeholder: existing.bar.placeholder ?? "",
|
|
191
|
+
disabled: existing.bar.disabled,
|
|
192
|
+
editSequence: existing.editSequence,
|
|
193
|
+
valueVersion: existing.valueVersion
|
|
194
|
+
};
|
|
195
|
+
existing.last = candidate.control.search;
|
|
196
|
+
candidate.sources = [
|
|
197
|
+
binding.tabBar,
|
|
198
|
+
binding.trigger.closest("ion-fab") ?? binding.trigger,
|
|
199
|
+
binding.footer
|
|
200
|
+
];
|
|
201
|
+
candidate.actions.set(existing.last.trigger.id, binding.trigger);
|
|
202
|
+
candidate.actions.set(existing.last.closeId, back);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (!visible(binding.trigger) && !pageUnavailable) {
|
|
207
|
+
retainInactive(candidate, existing);
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const bar = binding.footer.querySelector("ion-searchbar");
|
|
211
|
+
const input = bar?.querySelector("input.searchbar-input");
|
|
212
|
+
const back = binding.footer.querySelector("ion-buttons[slot=start] ion-button");
|
|
213
|
+
if (!bar || !input || !back || !binding.footer.matches("ion-footer") || !inFixedToolbar(bar) || !inFixedToolbar(back) || !pageUnavailable && bar.closest(excluded) || !bar.classList.contains("ios") || bar.classList.contains("searchbar-classic")) {
|
|
214
|
+
retainInactive(candidate, existing);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (bar.color || back.fill !== "default" || back.color || bar.maxlength != null || bar.minlength != null || bar.inputmode || bar.enterkeyhint || !["off", "none"].includes(bar.autocapitalize) || bar.autocomplete !== "off" || ![
|
|
218
|
+
false,
|
|
219
|
+
"off",
|
|
220
|
+
void 0
|
|
221
|
+
].includes(bar.autocorrect) || bar.spellcheck || bar.showClearButton !== "always" || bar.clearIcon) {
|
|
222
|
+
retainInactive(candidate, existing);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (bar.showCancelButton !== "never" || bar.type !== "search" || !getComputedStyle(input).backdropFilter.includes("blur")) {
|
|
226
|
+
retainInactive(candidate, existing);
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
const fabButton = binding.trigger;
|
|
230
|
+
const nativeTrigger = fabButton.shadowRoot?.querySelector("[part=native]");
|
|
231
|
+
if (!pageUnavailable && binding.trigger.closest(excluded) || !pageUnavailable && back.closest(excluded) || back.disabled || fabButton.disabled || fabButton.color || fabButton.type !== "button" || fabButton.href || !nativeTrigger || getComputedStyle(fabButton).backgroundColor !== "rgba(0, 0, 0, 0)" || !getComputedStyle(nativeTrigger).backdropFilter.includes("blur")) {
|
|
232
|
+
retainInactive(candidate, existing);
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
const state = existing ?? install(binding, bar, input);
|
|
236
|
+
const trigger = readIcon(binding.trigger, binding.trigger, candidate);
|
|
237
|
+
const searchIcon = bar.querySelector(".searchbar-search-icon");
|
|
238
|
+
const field = searchIcon && readIcon(searchIcon, bar, candidate);
|
|
239
|
+
if (!trigger || !field) {
|
|
240
|
+
retainInactive(candidate, state);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
field.label = "";
|
|
244
|
+
field.accessibilityLabel = bar.getAttribute("aria-label") ?? input.getAttribute("aria-label") ?? "Search";
|
|
245
|
+
if (!trigger.accessibilityLabel) trigger.accessibilityLabel = field.accessibilityLabel;
|
|
246
|
+
state.layout = JSON.stringify([
|
|
247
|
+
innerWidth,
|
|
248
|
+
innerHeight,
|
|
249
|
+
candidate.control.x,
|
|
250
|
+
candidate.control.y,
|
|
251
|
+
candidate.control.width,
|
|
252
|
+
candidate.control.height,
|
|
253
|
+
candidate.control.rtl,
|
|
254
|
+
trigger.x,
|
|
255
|
+
trigger.y,
|
|
256
|
+
trigger.width,
|
|
257
|
+
trigger.height,
|
|
258
|
+
candidate.control.items,
|
|
259
|
+
candidate.icons.map(({ source }) => source),
|
|
260
|
+
field,
|
|
261
|
+
trigger,
|
|
262
|
+
bar.placeholder,
|
|
263
|
+
bar.disabled
|
|
264
|
+
]);
|
|
265
|
+
if (state.rejectedLayout === state.layout) {
|
|
266
|
+
retainInactive(candidate, state);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
const available = !pageUnavailable && visible(binding.trigger);
|
|
270
|
+
candidate.control.search = {
|
|
271
|
+
id: id(input),
|
|
272
|
+
field,
|
|
273
|
+
trigger,
|
|
274
|
+
closeId: id(back),
|
|
275
|
+
active: available && binding.active,
|
|
276
|
+
available,
|
|
277
|
+
focused: available && binding.focused,
|
|
278
|
+
value: bar.value ?? "",
|
|
279
|
+
placeholder: bar.placeholder ?? "",
|
|
280
|
+
disabled: bar.disabled,
|
|
281
|
+
editSequence: state.editSequence,
|
|
282
|
+
valueVersion: state.valueVersion
|
|
283
|
+
};
|
|
284
|
+
state.last = candidate.control.search;
|
|
285
|
+
if (available) {
|
|
286
|
+
candidate.sources = [
|
|
287
|
+
binding.tabBar,
|
|
288
|
+
binding.trigger.closest("ion-fab") ?? binding.trigger,
|
|
289
|
+
binding.footer
|
|
290
|
+
];
|
|
291
|
+
candidate.actions.set(id(binding.trigger), binding.trigger);
|
|
292
|
+
candidate.actions.set(id(back), back);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
for (const [candidate, configuration] of inactive) (_candidate$control = candidate.control).search ?? (_candidate$control.search = configuration);
|
|
296
|
+
const groups = candidates.filter((c) => c.control.search);
|
|
297
|
+
return candidates.filter((c) => !groups.some((group) => group !== c && group.sources?.some((source) => source.contains(c.element))));
|
|
298
|
+
},
|
|
299
|
+
projected,
|
|
300
|
+
hasActive() {
|
|
301
|
+
for (const [binding] of states) if (binding.active && projected(binding)) return true;
|
|
302
|
+
return false;
|
|
303
|
+
},
|
|
304
|
+
begin(binding, revision) {
|
|
305
|
+
const state = states.get(binding);
|
|
306
|
+
if (state) state.minimumRevision = revision;
|
|
307
|
+
},
|
|
308
|
+
/** Enter / focus / leave. `focused` is ignored when leaving. */
|
|
309
|
+
setStatus(binding, active, focused = false) {
|
|
310
|
+
if (!active) {
|
|
311
|
+
this.retire(binding);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
binding.active = true;
|
|
315
|
+
binding.focused = focused;
|
|
316
|
+
holdKeyboardResize();
|
|
317
|
+
},
|
|
318
|
+
release(element) {
|
|
319
|
+
for (const binding of states.keys()) if (binding.footer === element) this.retire(binding);
|
|
320
|
+
},
|
|
321
|
+
reject(ids) {
|
|
322
|
+
states.forEach((state) => {
|
|
323
|
+
if (ids.includes(id(state.binding.tabBar))) {
|
|
324
|
+
state.rejectedLayout = state.layout;
|
|
325
|
+
state.last = void 0;
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
},
|
|
329
|
+
event(event) {
|
|
330
|
+
const state = Array.from(states.values()).find((s) => id(s.input) === event.id && projected(s.binding) && isCurrent(s));
|
|
331
|
+
if (!state || !state.binding.active || (event.phase === "input" || event.phase === "clear") && event.valueVersion !== state.valueVersion || event.revision < state.minimumRevision || event.sequence <= state.editSequence || state.bar.disabled) return;
|
|
332
|
+
state.editSequence = event.sequence;
|
|
333
|
+
const { input, binding } = state;
|
|
334
|
+
if (event.phase === "input") {
|
|
335
|
+
if (state.composing !== event.composing) input.dispatchEvent(new CompositionEvent(event.composing ? "compositionstart" : "compositionend", {
|
|
336
|
+
bubbles: true,
|
|
337
|
+
data: event.value
|
|
338
|
+
}));
|
|
339
|
+
state.composing = event.composing;
|
|
340
|
+
input.value = event.value;
|
|
341
|
+
state.applyingInput = true;
|
|
342
|
+
try {
|
|
343
|
+
input.dispatchEvent(new InputEvent("input", {
|
|
344
|
+
bubbles: true,
|
|
345
|
+
composed: true,
|
|
346
|
+
isComposing: event.composing
|
|
347
|
+
}));
|
|
348
|
+
} finally {
|
|
349
|
+
state.applyingInput = false;
|
|
350
|
+
}
|
|
351
|
+
} else if (event.phase === "clear") state.bar.querySelector(".searchbar-clear-button")?.click();
|
|
352
|
+
else if (event.phase === "commit") input.dispatchEvent(new Event("change", { bubbles: true }));
|
|
353
|
+
else {
|
|
354
|
+
if (state.focused === (event.phase === "focus")) return;
|
|
355
|
+
state.focused = binding.focused = event.phase === "focus";
|
|
356
|
+
input.dispatchEvent(new FocusEvent(event.phase, { composed: true }));
|
|
357
|
+
}
|
|
358
|
+
schedule();
|
|
359
|
+
},
|
|
360
|
+
retire(binding) {
|
|
361
|
+
const state = states.get(binding);
|
|
362
|
+
if (state?.keyboardHidden && keyboardVisible) binding.tabBar.classList.add("tab-bar-hidden");
|
|
363
|
+
if (state?.focused) {
|
|
364
|
+
state.focused = false;
|
|
365
|
+
state.input.dispatchEvent(new FocusEvent("blur"));
|
|
366
|
+
}
|
|
367
|
+
binding.active = binding.focused = false;
|
|
368
|
+
releaseKeyboardResize();
|
|
369
|
+
},
|
|
370
|
+
destroy() {
|
|
371
|
+
states.forEach((state) => {
|
|
372
|
+
this.retire(state.binding);
|
|
373
|
+
state.restore();
|
|
374
|
+
});
|
|
375
|
+
states.clear();
|
|
376
|
+
releaseKeyboardResize();
|
|
377
|
+
}
|
|
378
|
+
};
|
|
435
379
|
};
|
|
380
|
+
//#endregion
|
|
381
|
+
export { createSearchSupport };
|
|
382
|
+
|
|
383
|
+
//# sourceMappingURL=searchable-tabs.js.map
|