@ionic/core 8.6.1-dev.11749572912.152b544d → 8.6.1-dev.11749648223.169ce853
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/ion-reorder-group.js +20 -2
- package/components/modal.js +47 -78
- package/dist/cjs/ion-modal.cjs.entry.js +47 -78
- package/dist/cjs/ion-reorder_2.cjs.entry.js +20 -2
- package/dist/collection/components/modal/gestures/sheet.js +47 -78
- package/dist/collection/components/reorder-group/reorder-group.js +80 -5
- package/dist/docs.json +73 -3
- package/dist/esm/ion-modal.entry.js +47 -78
- package/dist/esm/ion-reorder_2.entry.js +20 -2
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-25979025.entry.js +4 -0
- package/dist/ionic/p-90f87086.entry.js +4 -0
- package/dist/types/components/reorder-group/reorder-group-interface.d.ts +17 -0
- package/dist/types/components/reorder-group/reorder-group.d.ts +24 -4
- package/dist/types/components.d.ts +20 -4
- package/dist/types/interface.d.ts +5 -1
- package/hydrate/index.js +67 -80
- package/hydrate/index.mjs +67 -80
- package/package.json +1 -1
- package/dist/ionic/p-2020aa51.entry.js +0 -4
- package/dist/ionic/p-c045d121.entry.js +0 -4
|
@@ -53,7 +53,7 @@ export class ReorderGroup {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Completes the reorder operation. Must be called by the `
|
|
56
|
+
* Completes the reorder operation. Must be called by the `ionReorderEnd` event.
|
|
57
57
|
*
|
|
58
58
|
* If a list of items is passed, the list will be reordered and returned in the
|
|
59
59
|
* proper order.
|
|
@@ -120,6 +120,7 @@ export class ReorderGroup {
|
|
|
120
120
|
this.state = 1 /* ReorderGroupState.Active */;
|
|
121
121
|
item.classList.add(ITEM_REORDER_SELECTED);
|
|
122
122
|
hapticSelectionStart();
|
|
123
|
+
this.ionReorderStart.emit();
|
|
123
124
|
}
|
|
124
125
|
onMove(ev) {
|
|
125
126
|
const selectedItem = this.selectedItemEl;
|
|
@@ -134,6 +135,7 @@ export class ReorderGroup {
|
|
|
134
135
|
const currentY = Math.max(top, Math.min(ev.currentY, bottom));
|
|
135
136
|
const deltaY = scroll + currentY - ev.startY;
|
|
136
137
|
const normalizedY = currentY - top;
|
|
138
|
+
const fromIndex = this.lastToIndex;
|
|
137
139
|
const toIndex = this.itemIndexForTop(normalizedY);
|
|
138
140
|
if (toIndex !== this.lastToIndex) {
|
|
139
141
|
const fromIndex = indexForItem(selectedItem);
|
|
@@ -143,6 +145,10 @@ export class ReorderGroup {
|
|
|
143
145
|
}
|
|
144
146
|
// Update selected item position
|
|
145
147
|
selectedItem.style.transform = `translateY(${deltaY}px)`;
|
|
148
|
+
this.ionReorderMove.emit({
|
|
149
|
+
from: fromIndex,
|
|
150
|
+
to: toIndex,
|
|
151
|
+
});
|
|
146
152
|
}
|
|
147
153
|
onEnd() {
|
|
148
154
|
const selectedItemEl = this.selectedItemEl;
|
|
@@ -154,14 +160,23 @@ export class ReorderGroup {
|
|
|
154
160
|
const toIndex = this.lastToIndex;
|
|
155
161
|
const fromIndex = indexForItem(selectedItemEl);
|
|
156
162
|
if (toIndex === fromIndex) {
|
|
163
|
+
this.ionReorderEnd.emit({
|
|
164
|
+
complete: this.completeReorder.bind(this),
|
|
165
|
+
});
|
|
157
166
|
this.completeReorder();
|
|
158
167
|
}
|
|
159
168
|
else {
|
|
169
|
+
// TODO(FW-6590): Remove this once the deprecated event is removed
|
|
160
170
|
this.ionItemReorder.emit({
|
|
161
171
|
from: fromIndex,
|
|
162
172
|
to: toIndex,
|
|
163
173
|
complete: this.completeReorder.bind(this),
|
|
164
174
|
});
|
|
175
|
+
this.ionReorderEnd.emit({
|
|
176
|
+
from: fromIndex,
|
|
177
|
+
to: toIndex,
|
|
178
|
+
complete: this.completeReorder.bind(this),
|
|
179
|
+
});
|
|
165
180
|
}
|
|
166
181
|
hapticSelectionEnd();
|
|
167
182
|
}
|
|
@@ -241,7 +256,7 @@ export class ReorderGroup {
|
|
|
241
256
|
}
|
|
242
257
|
render() {
|
|
243
258
|
const mode = getIonMode(this);
|
|
244
|
-
return (h(Host, { key: '
|
|
259
|
+
return (h(Host, { key: '8f47e24dfc7b8ef53ad3f5816fa13a8fa07de2a6', class: {
|
|
245
260
|
[mode]: true,
|
|
246
261
|
'reorder-enabled': !this.disabled,
|
|
247
262
|
'reorder-list-active': this.state !== 0 /* ReorderGroupState.Idle */,
|
|
@@ -295,8 +310,11 @@ export class ReorderGroup {
|
|
|
295
310
|
"cancelable": true,
|
|
296
311
|
"composed": true,
|
|
297
312
|
"docs": {
|
|
298
|
-
"tags": [
|
|
299
|
-
|
|
313
|
+
"tags": [{
|
|
314
|
+
"name": "deprecated",
|
|
315
|
+
"text": "Use `ionReorderEnd` instead. The new event is emitted\nat the end of every reorder gesture, even if the positions do not\nchange. If you were accessing `event.detail.from` or `event.detail.to`,\nyou should now add `undefined` checks as they can be `undefined` in\n`ionReorderEnd`."
|
|
316
|
+
}],
|
|
317
|
+
"text": "TODO(FW-6590): Remove this in a major release."
|
|
300
318
|
},
|
|
301
319
|
"complexType": {
|
|
302
320
|
"original": "ItemReorderEventDetail",
|
|
@@ -309,6 +327,63 @@ export class ReorderGroup {
|
|
|
309
327
|
}
|
|
310
328
|
}
|
|
311
329
|
}
|
|
330
|
+
}, {
|
|
331
|
+
"method": "ionReorderStart",
|
|
332
|
+
"name": "ionReorderStart",
|
|
333
|
+
"bubbles": true,
|
|
334
|
+
"cancelable": true,
|
|
335
|
+
"composed": true,
|
|
336
|
+
"docs": {
|
|
337
|
+
"tags": [],
|
|
338
|
+
"text": "Event that is emitted when the reorder gesture starts."
|
|
339
|
+
},
|
|
340
|
+
"complexType": {
|
|
341
|
+
"original": "void",
|
|
342
|
+
"resolved": "void",
|
|
343
|
+
"references": {}
|
|
344
|
+
}
|
|
345
|
+
}, {
|
|
346
|
+
"method": "ionReorderMove",
|
|
347
|
+
"name": "ionReorderMove",
|
|
348
|
+
"bubbles": true,
|
|
349
|
+
"cancelable": true,
|
|
350
|
+
"composed": true,
|
|
351
|
+
"docs": {
|
|
352
|
+
"tags": [],
|
|
353
|
+
"text": "Event that is emitted as the reorder gesture moves."
|
|
354
|
+
},
|
|
355
|
+
"complexType": {
|
|
356
|
+
"original": "ReorderMoveEventDetail",
|
|
357
|
+
"resolved": "ReorderMoveEventDetail",
|
|
358
|
+
"references": {
|
|
359
|
+
"ReorderMoveEventDetail": {
|
|
360
|
+
"location": "import",
|
|
361
|
+
"path": "./reorder-group-interface",
|
|
362
|
+
"id": "src/components/reorder-group/reorder-group-interface.ts::ReorderMoveEventDetail"
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}, {
|
|
367
|
+
"method": "ionReorderEnd",
|
|
368
|
+
"name": "ionReorderEnd",
|
|
369
|
+
"bubbles": true,
|
|
370
|
+
"cancelable": true,
|
|
371
|
+
"composed": true,
|
|
372
|
+
"docs": {
|
|
373
|
+
"tags": [],
|
|
374
|
+
"text": "Event that is emitted when the reorder gesture ends.\nThe from and to properties are only available if the reorder gesture\nmoved the item. If the item did not move, the from and to properties\nwill be undefined.\nOnce the event has been emitted, the `complete()` method then needs\nto be called in order to finalize the reorder action."
|
|
375
|
+
},
|
|
376
|
+
"complexType": {
|
|
377
|
+
"original": "ReorderEndEventDetail",
|
|
378
|
+
"resolved": "ReorderEndEventDetail",
|
|
379
|
+
"references": {
|
|
380
|
+
"ReorderEndEventDetail": {
|
|
381
|
+
"location": "import",
|
|
382
|
+
"path": "./reorder-group-interface",
|
|
383
|
+
"id": "src/components/reorder-group/reorder-group-interface.ts::ReorderEndEventDetail"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
312
387
|
}];
|
|
313
388
|
}
|
|
314
389
|
static get methods() {
|
|
@@ -330,7 +405,7 @@ export class ReorderGroup {
|
|
|
330
405
|
"return": "Promise<any>"
|
|
331
406
|
},
|
|
332
407
|
"docs": {
|
|
333
|
-
"text": "Completes the reorder operation. Must be called by the `
|
|
408
|
+
"text": "Completes the reorder operation. Must be called by the `ionReorderEnd` event.\n\nIf a list of items is passed, the list will be reordered and returned in the\nproper order.\n\nIf no parameters are passed or if `true` is passed in, the reorder will complete\nand the item will remain in the position it was dragged to. If `false` is passed,\nthe reorder will complete and the item will bounce back to its original position.",
|
|
334
409
|
"tags": [{
|
|
335
410
|
"name": "param",
|
|
336
411
|
"text": "listOrReorder A list of items to be sorted and returned in the new order or a\nboolean of whether or not the reorder should reposition the item."
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-06-
|
|
2
|
+
"timestamp": "2025-06-11T13:25:15",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.33.1",
|
|
@@ -27019,7 +27019,7 @@
|
|
|
27019
27019
|
"docs": "A list of items to be sorted and returned in the new order or a\nboolean of whether or not the reorder should reposition the item."
|
|
27020
27020
|
}
|
|
27021
27021
|
],
|
|
27022
|
-
"docs": "Completes the reorder operation. Must be called by the `
|
|
27022
|
+
"docs": "Completes the reorder operation. Must be called by the `ionReorderEnd` event.\n\nIf a list of items is passed, the list will be reordered and returned in the\nproper order.\n\nIf no parameters are passed or if `true` is passed in, the reorder will complete\nand the item will remain in the position it was dragged to. If `false` is passed,\nthe reorder will complete and the item will bounce back to its original position.",
|
|
27023
27023
|
"docsTags": [
|
|
27024
27024
|
{
|
|
27025
27025
|
"name": "param",
|
|
@@ -27046,7 +27046,67 @@
|
|
|
27046
27046
|
},
|
|
27047
27047
|
"cancelable": true,
|
|
27048
27048
|
"composed": true,
|
|
27049
|
-
"docs": "
|
|
27049
|
+
"docs": "TODO(FW-6590): Remove this in a major release.",
|
|
27050
|
+
"docsTags": [
|
|
27051
|
+
{
|
|
27052
|
+
"name": "deprecated",
|
|
27053
|
+
"text": "Use `ionReorderEnd` instead. The new event is emitted\nat the end of every reorder gesture, even if the positions do not\nchange. If you were accessing `event.detail.from` or `event.detail.to`,\nyou should now add `undefined` checks as they can be `undefined` in\n`ionReorderEnd`."
|
|
27054
|
+
}
|
|
27055
|
+
],
|
|
27056
|
+
"deprecation": "Use `ionReorderEnd` instead. The new event is emitted\nat the end of every reorder gesture, even if the positions do not\nchange. If you were accessing `event.detail.from` or `event.detail.to`,\nyou should now add `undefined` checks as they can be `undefined` in\n`ionReorderEnd`."
|
|
27057
|
+
},
|
|
27058
|
+
{
|
|
27059
|
+
"event": "ionReorderEnd",
|
|
27060
|
+
"detail": "ReorderEndEventDetail",
|
|
27061
|
+
"bubbles": true,
|
|
27062
|
+
"complexType": {
|
|
27063
|
+
"original": "ReorderEndEventDetail",
|
|
27064
|
+
"resolved": "ReorderEndEventDetail",
|
|
27065
|
+
"references": {
|
|
27066
|
+
"ReorderEndEventDetail": {
|
|
27067
|
+
"location": "import",
|
|
27068
|
+
"path": "./reorder-group-interface",
|
|
27069
|
+
"id": "src/components/reorder-group/reorder-group-interface.ts::ReorderEndEventDetail"
|
|
27070
|
+
}
|
|
27071
|
+
}
|
|
27072
|
+
},
|
|
27073
|
+
"cancelable": true,
|
|
27074
|
+
"composed": true,
|
|
27075
|
+
"docs": "Event that is emitted when the reorder gesture ends.\nThe from and to properties are only available if the reorder gesture\nmoved the item. If the item did not move, the from and to properties\nwill be undefined.\nOnce the event has been emitted, the `complete()` method then needs\nto be called in order to finalize the reorder action.",
|
|
27076
|
+
"docsTags": []
|
|
27077
|
+
},
|
|
27078
|
+
{
|
|
27079
|
+
"event": "ionReorderMove",
|
|
27080
|
+
"detail": "ReorderMoveEventDetail",
|
|
27081
|
+
"bubbles": true,
|
|
27082
|
+
"complexType": {
|
|
27083
|
+
"original": "ReorderMoveEventDetail",
|
|
27084
|
+
"resolved": "ReorderMoveEventDetail",
|
|
27085
|
+
"references": {
|
|
27086
|
+
"ReorderMoveEventDetail": {
|
|
27087
|
+
"location": "import",
|
|
27088
|
+
"path": "./reorder-group-interface",
|
|
27089
|
+
"id": "src/components/reorder-group/reorder-group-interface.ts::ReorderMoveEventDetail"
|
|
27090
|
+
}
|
|
27091
|
+
}
|
|
27092
|
+
},
|
|
27093
|
+
"cancelable": true,
|
|
27094
|
+
"composed": true,
|
|
27095
|
+
"docs": "Event that is emitted as the reorder gesture moves.",
|
|
27096
|
+
"docsTags": []
|
|
27097
|
+
},
|
|
27098
|
+
{
|
|
27099
|
+
"event": "ionReorderStart",
|
|
27100
|
+
"detail": "void",
|
|
27101
|
+
"bubbles": true,
|
|
27102
|
+
"complexType": {
|
|
27103
|
+
"original": "void",
|
|
27104
|
+
"resolved": "void",
|
|
27105
|
+
"references": {}
|
|
27106
|
+
},
|
|
27107
|
+
"cancelable": true,
|
|
27108
|
+
"composed": true,
|
|
27109
|
+
"docs": "Event that is emitted when the reorder gesture starts.",
|
|
27050
27110
|
"docsTags": []
|
|
27051
27111
|
}
|
|
27052
27112
|
],
|
|
@@ -37466,6 +37526,16 @@
|
|
|
37466
37526
|
"docstring": "",
|
|
37467
37527
|
"path": "src/components/reorder-group/reorder-group-interface.ts"
|
|
37468
37528
|
},
|
|
37529
|
+
"src/components/reorder-group/reorder-group-interface.ts::ReorderMoveEventDetail": {
|
|
37530
|
+
"declaration": "export interface ReorderMoveEventDetail {\n from: number;\n to: number;\n}",
|
|
37531
|
+
"docstring": "",
|
|
37532
|
+
"path": "src/components/reorder-group/reorder-group-interface.ts"
|
|
37533
|
+
},
|
|
37534
|
+
"src/components/reorder-group/reorder-group-interface.ts::ReorderEndEventDetail": {
|
|
37535
|
+
"declaration": "export interface ReorderEndEventDetail {\n from?: number;\n to?: number;\n complete: (data?: boolean | any[]) => any;\n}",
|
|
37536
|
+
"docstring": "",
|
|
37537
|
+
"path": "src/components/reorder-group/reorder-group-interface.ts"
|
|
37538
|
+
},
|
|
37469
37539
|
"src/components/route/route-interface.ts::NavigationHookCallback": {
|
|
37470
37540
|
"declaration": "() => NavigationHookResult | Promise<NavigationHookResult>",
|
|
37471
37541
|
"docstring": "",
|
|
@@ -827,7 +827,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
827
827
|
let offset = 0;
|
|
828
828
|
let canDismissBlocksGesture = false;
|
|
829
829
|
let cachedScrollEl = null;
|
|
830
|
-
let
|
|
830
|
+
let cachedFooterEl = null;
|
|
831
831
|
let cachedFooterYPosition = null;
|
|
832
832
|
let currentFooterState = null;
|
|
833
833
|
const canDismissMaxStep = 0.95;
|
|
@@ -864,81 +864,60 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
864
864
|
* @param newPosition Whether the footer is in a moving or stationary position.
|
|
865
865
|
*/
|
|
866
866
|
const swapFooterPosition = (newPosition) => {
|
|
867
|
-
if (!
|
|
868
|
-
|
|
869
|
-
if (!
|
|
867
|
+
if (!cachedFooterEl) {
|
|
868
|
+
cachedFooterEl = baseEl.querySelector('ion-footer');
|
|
869
|
+
if (!cachedFooterEl) {
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
873
|
const page = baseEl.querySelector('.ion-page');
|
|
874
874
|
currentFooterState = newPosition;
|
|
875
875
|
if (newPosition === 'stationary') {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
887
|
-
});
|
|
876
|
+
// Reset positioning styles to allow normal document flow
|
|
877
|
+
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
878
|
+
cachedFooterEl.style.removeProperty('position');
|
|
879
|
+
cachedFooterEl.style.removeProperty('width');
|
|
880
|
+
cachedFooterEl.style.removeProperty('height');
|
|
881
|
+
cachedFooterEl.style.removeProperty('top');
|
|
882
|
+
cachedFooterEl.style.removeProperty('left');
|
|
883
|
+
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
884
|
+
// Move to page
|
|
885
|
+
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
888
886
|
}
|
|
889
887
|
else {
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
// so that we don't cause layouts to shift while calculating the footer positions.
|
|
924
|
-
// Otherwise, with multiple footers we'll end up capturing the wrong positions.
|
|
925
|
-
cachedFooterEls.forEach((cachedFooterEl) => {
|
|
926
|
-
// Add padding to the parent element to prevent content from being hidden
|
|
927
|
-
// when the footer is positioned absolutely. This has to be done before we
|
|
928
|
-
// make the footer absolutely positioned or we may accidentally cause the
|
|
929
|
-
// sheet to scroll.
|
|
930
|
-
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeights}px`);
|
|
931
|
-
// Apply positioning styles to keep footer at bottom
|
|
932
|
-
cachedFooterEl.classList.add('modal-footer-moving');
|
|
933
|
-
// Apply our preserved styles to pin the footer
|
|
934
|
-
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
935
|
-
cachedFooterEl.style.setProperty('width', 'var(--pinned-width)');
|
|
936
|
-
cachedFooterEl.style.setProperty('height', 'var(--pinned-height)');
|
|
937
|
-
cachedFooterEl.style.setProperty('top', 'var(--pinned-top)');
|
|
938
|
-
cachedFooterEl.style.setProperty('left', 'var(--pinned-left)');
|
|
939
|
-
// Move the element to the body when everything else is done
|
|
940
|
-
document.body.appendChild(cachedFooterEl);
|
|
941
|
-
});
|
|
888
|
+
// Get both the footer and document body positions
|
|
889
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
890
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
891
|
+
// Add padding to the parent element to prevent content from being hidden
|
|
892
|
+
// when the footer is positioned absolutely. This has to be done before we
|
|
893
|
+
// make the footer absolutely positioned or we may accidentally cause the
|
|
894
|
+
// sheet to scroll.
|
|
895
|
+
const footerHeight = cachedFooterEl.clientHeight;
|
|
896
|
+
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
897
|
+
// Apply positioning styles to keep footer at bottom
|
|
898
|
+
cachedFooterEl.classList.add('modal-footer-moving');
|
|
899
|
+
// Calculate absolute position relative to body
|
|
900
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
901
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
902
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
903
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
904
|
+
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
905
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
906
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
907
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
908
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
909
|
+
// Also cache the footer Y position, which we use to determine if the
|
|
910
|
+
// sheet has been moved below the footer. When that happens, we need to swap
|
|
911
|
+
// the position back so it will collapse correctly.
|
|
912
|
+
cachedFooterYPosition = absoluteTop;
|
|
913
|
+
// If there's a toolbar, we need to combine the toolbar height with the footer position
|
|
914
|
+
// because the toolbar moves with the drag handle, so when it starts overlapping the footer,
|
|
915
|
+
// we need to account for that.
|
|
916
|
+
const toolbar = baseEl.querySelector('ion-toolbar');
|
|
917
|
+
if (toolbar) {
|
|
918
|
+
cachedFooterYPosition -= toolbar.clientHeight;
|
|
919
|
+
}
|
|
920
|
+
document.body.appendChild(cachedFooterEl);
|
|
942
921
|
}
|
|
943
922
|
};
|
|
944
923
|
/**
|
|
@@ -1130,16 +1109,6 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
1130
1109
|
* is not scrolled to the top.
|
|
1131
1110
|
*/
|
|
1132
1111
|
if (!expandToScroll && detail.deltaY <= 0 && cachedScrollEl && cachedScrollEl.scrollTop > 0) {
|
|
1133
|
-
/**
|
|
1134
|
-
* If expand to scroll is disabled, we need to make sure we swap the footer position
|
|
1135
|
-
* back to stationary so that it will collapse correctly if the modal is dismissed without
|
|
1136
|
-
* dragging (e.g. through a dismiss button).
|
|
1137
|
-
* This can cause issues if the user has a modal with content that can be dragged, as we'll
|
|
1138
|
-
* swap to moving on drag and if we don't swap back here then the footer will get stuck.
|
|
1139
|
-
*/
|
|
1140
|
-
if (!expandToScroll) {
|
|
1141
|
-
swapFooterPosition('stationary');
|
|
1142
|
-
}
|
|
1143
1112
|
return;
|
|
1144
1113
|
}
|
|
1145
1114
|
/**
|
|
@@ -44,6 +44,9 @@ const ReorderGroup = class {
|
|
|
44
44
|
constructor(hostRef) {
|
|
45
45
|
registerInstance(this, hostRef);
|
|
46
46
|
this.ionItemReorder = createEvent(this, "ionItemReorder", 7);
|
|
47
|
+
this.ionReorderStart = createEvent(this, "ionReorderStart", 7);
|
|
48
|
+
this.ionReorderMove = createEvent(this, "ionReorderMove", 7);
|
|
49
|
+
this.ionReorderEnd = createEvent(this, "ionReorderEnd", 7);
|
|
47
50
|
this.lastToIndex = -1;
|
|
48
51
|
this.cachedHeights = [];
|
|
49
52
|
this.scrollElTop = 0;
|
|
@@ -89,7 +92,7 @@ const ReorderGroup = class {
|
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
/**
|
|
92
|
-
* Completes the reorder operation. Must be called by the `
|
|
95
|
+
* Completes the reorder operation. Must be called by the `ionReorderEnd` event.
|
|
93
96
|
*
|
|
94
97
|
* If a list of items is passed, the list will be reordered and returned in the
|
|
95
98
|
* proper order.
|
|
@@ -156,6 +159,7 @@ const ReorderGroup = class {
|
|
|
156
159
|
this.state = 1 /* ReorderGroupState.Active */;
|
|
157
160
|
item.classList.add(ITEM_REORDER_SELECTED);
|
|
158
161
|
hapticSelectionStart();
|
|
162
|
+
this.ionReorderStart.emit();
|
|
159
163
|
}
|
|
160
164
|
onMove(ev) {
|
|
161
165
|
const selectedItem = this.selectedItemEl;
|
|
@@ -170,6 +174,7 @@ const ReorderGroup = class {
|
|
|
170
174
|
const currentY = Math.max(top, Math.min(ev.currentY, bottom));
|
|
171
175
|
const deltaY = scroll + currentY - ev.startY;
|
|
172
176
|
const normalizedY = currentY - top;
|
|
177
|
+
const fromIndex = this.lastToIndex;
|
|
173
178
|
const toIndex = this.itemIndexForTop(normalizedY);
|
|
174
179
|
if (toIndex !== this.lastToIndex) {
|
|
175
180
|
const fromIndex = indexForItem(selectedItem);
|
|
@@ -179,6 +184,10 @@ const ReorderGroup = class {
|
|
|
179
184
|
}
|
|
180
185
|
// Update selected item position
|
|
181
186
|
selectedItem.style.transform = `translateY(${deltaY}px)`;
|
|
187
|
+
this.ionReorderMove.emit({
|
|
188
|
+
from: fromIndex,
|
|
189
|
+
to: toIndex,
|
|
190
|
+
});
|
|
182
191
|
}
|
|
183
192
|
onEnd() {
|
|
184
193
|
const selectedItemEl = this.selectedItemEl;
|
|
@@ -190,14 +199,23 @@ const ReorderGroup = class {
|
|
|
190
199
|
const toIndex = this.lastToIndex;
|
|
191
200
|
const fromIndex = indexForItem(selectedItemEl);
|
|
192
201
|
if (toIndex === fromIndex) {
|
|
202
|
+
this.ionReorderEnd.emit({
|
|
203
|
+
complete: this.completeReorder.bind(this),
|
|
204
|
+
});
|
|
193
205
|
this.completeReorder();
|
|
194
206
|
}
|
|
195
207
|
else {
|
|
208
|
+
// TODO(FW-6590): Remove this once the deprecated event is removed
|
|
196
209
|
this.ionItemReorder.emit({
|
|
197
210
|
from: fromIndex,
|
|
198
211
|
to: toIndex,
|
|
199
212
|
complete: this.completeReorder.bind(this),
|
|
200
213
|
});
|
|
214
|
+
this.ionReorderEnd.emit({
|
|
215
|
+
from: fromIndex,
|
|
216
|
+
to: toIndex,
|
|
217
|
+
complete: this.completeReorder.bind(this),
|
|
218
|
+
});
|
|
201
219
|
}
|
|
202
220
|
hapticSelectionEnd();
|
|
203
221
|
}
|
|
@@ -277,7 +295,7 @@ const ReorderGroup = class {
|
|
|
277
295
|
}
|
|
278
296
|
render() {
|
|
279
297
|
const mode = getIonMode(this);
|
|
280
|
-
return (h(Host, { key: '
|
|
298
|
+
return (h(Host, { key: '8f47e24dfc7b8ef53ad3f5816fa13a8fa07de2a6', class: {
|
|
281
299
|
[mode]: true,
|
|
282
300
|
'reorder-enabled': !this.disabled,
|
|
283
301
|
'reorder-list-active': this.state !== 0 /* ReorderGroupState.Idle */,
|