@ionic/core 7.5.4-dev.11699469920.1af6ea12 → 7.5.4-dev.11699632730.1e6d9b70
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-modal.js +2 -2
- package/components/ion-select.js +1 -23
- package/components/ion-toast.js +67 -417
- package/components/overlays.js +1 -2
- package/components/radio-group.js +2 -0
- package/components/radio.js +40 -2
- package/css/ionic.bundle.css +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/css/themes/dark.css +135 -0
- package/css/themes/dark.css.map +1 -0
- package/css/utils.bundle.css +133 -0
- package/css/utils.bundle.css.map +1 -1
- package/dist/cjs/compare-with-utils-c0444525.js +44 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +4 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +6 -27
- package/dist/cjs/ion-toast.cjs.entry.js +83 -430
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-ba1a1e21.js → overlays-d80a2cf2.js} +0 -2
- package/dist/collection/components/modal/gestures/swipe-to-close.js +1 -2
- package/dist/collection/components/radio/radio.js +3 -2
- package/dist/collection/components/radio-group/radio-group.js +24 -0
- package/dist/collection/components/select/select.js +2 -24
- package/dist/collection/components/toast/animations/ios.enter.js +1 -2
- package/dist/collection/components/toast/animations/md.enter.js +1 -2
- package/dist/collection/components/toast/animations/utils.js +0 -11
- package/dist/collection/components/toast/toast.js +1 -104
- package/dist/collection/utils/forms/compare-with-utils.js +39 -0
- package/dist/collection/utils/forms/index.js +1 -0
- package/dist/collection/utils/overlays.js +0 -1
- package/dist/docs.json +43 -38
- package/dist/esm/compare-with-utils-4928c09d.js +41 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +1 -1
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +4 -1
- package/dist/esm/ion-select_3.entry.js +2 -23
- package/dist/esm/ion-toast.entry.js +66 -413
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-d79b34b4.js → overlays-a31c8878.js} +1 -2
- package/dist/esm-es5/compare-with-utils-4928c09d.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-radio_2.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{overlays-d79b34b4.js → overlays-a31c8878.js} +1 -1
- package/dist/html.html-data.json +5 -10
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-02663394.system.js +1 -1
- package/dist/ionic/p-139bd79d.system.entry.js +4 -0
- package/dist/ionic/{p-3dedd258.system.entry.js → p-1e59dd04.system.entry.js} +1 -1
- package/dist/ionic/{p-938c4956.js → p-307963db.js} +1 -1
- package/dist/ionic/{p-1fc6b5a5.system.entry.js → p-3a769110.system.entry.js} +1 -1
- package/dist/ionic/p-3bc3d880.system.js +4 -0
- package/dist/ionic/p-43716898.js +4 -0
- package/dist/ionic/{p-1511dc35.system.js → p-4c75cb48.system.js} +1 -1
- package/dist/ionic/p-539c09e8.system.entry.js +4 -0
- package/dist/ionic/{p-e525dbea.entry.js → p-53b1930e.entry.js} +1 -1
- package/dist/ionic/{p-ab1908ba.system.entry.js → p-59107f99.system.entry.js} +1 -1
- package/dist/ionic/p-6b45cfd0.system.entry.js +4 -0
- package/dist/ionic/{p-664cc492.entry.js → p-75338011.entry.js} +1 -1
- package/dist/ionic/p-7d68e4ea.entry.js +4 -0
- package/dist/ionic/{p-78a8e1e8.entry.js → p-8140a084.entry.js} +1 -1
- package/dist/ionic/{p-2151a4a4.system.entry.js → p-90020ef0.system.entry.js} +1 -1
- package/dist/ionic/{p-53f75103.system.js → p-98c70e3c.system.js} +1 -1
- package/dist/ionic/p-999a7271.entry.js +4 -0
- package/dist/ionic/p-a4e4dba1.entry.js +4 -0
- package/dist/ionic/{p-138a4a93.entry.js → p-b86c6c05.entry.js} +1 -1
- package/dist/ionic/p-be499f29.entry.js +4 -0
- package/dist/ionic/{p-a9424586.entry.js → p-c09fa14d.entry.js} +1 -1
- package/dist/ionic/{p-020dd47f.entry.js → p-c32a6c04.entry.js} +1 -1
- package/dist/ionic/{p-81bdfa1c.system.entry.js → p-d54a8393.system.entry.js} +1 -1
- package/dist/ionic/p-e66f7d10.system.entry.js +4 -0
- package/dist/ionic/{p-cb6c380e.system.entry.js → p-e91c7eb4.system.entry.js} +1 -1
- package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
- package/dist/types/components/radio-group/radio-group.d.ts +8 -1
- package/dist/types/components/select/select.d.ts +4 -1
- package/dist/types/components/toast/animations/utils.d.ts +0 -9
- package/dist/types/components/toast/toast-interface.d.ts +0 -1
- package/dist/types/components/toast/toast.d.ts +1 -28
- package/dist/types/components.d.ts +14 -14
- package/dist/types/utils/forms/compare-with-utils.d.ts +18 -0
- package/dist/types/utils/forms/index.d.ts +1 -0
- package/dist/types/utils/overlays.d.ts +0 -1
- package/hydrate/index.js +107 -436
- package/package.json +1 -1
- package/dist/collection/components/toast/gestures/swipe-to-dismiss.js +0 -267
- package/dist/collection/components/toast/test/swipe-gesture/toast.e2e.js +0 -84
- package/dist/ionic/p-344706aa.entry.js +0 -4
- package/dist/ionic/p-637d836a.system.entry.js +0 -4
- package/dist/ionic/p-6c89025e.system.entry.js +0 -4
- package/dist/ionic/p-8414ed31.entry.js +0 -4
- package/dist/ionic/p-d075c0aa.system.entry.js +0 -4
- package/dist/ionic/p-e3b7a2d0.system.entry.js +0 -4
- package/dist/ionic/p-ea1650b0.entry.js +0 -4
- package/dist/ionic/p-f2d4e3c8.entry.js +0 -4
- package/dist/types/components/toast/gestures/swipe-to-dismiss.d.ts +0 -9
|
@@ -6,7 +6,7 @@ import { ENABLE_HTML_CONTENT_DEFAULT } from "../../utils/config";
|
|
|
6
6
|
import { raf } from "../../utils/helpers";
|
|
7
7
|
import { createLockController } from "../../utils/lock-controller";
|
|
8
8
|
import { printIonWarning } from "../../utils/logging/index";
|
|
9
|
-
import {
|
|
9
|
+
import { createDelegateController, createTriggerController, dismiss, eventMethod, isCancel, prepareOverlay, present, safeCall, setOverlayId, } from "../../utils/overlays";
|
|
10
10
|
import { sanitizeDOMString } from "../../utils/sanitization/index";
|
|
11
11
|
import { createColorClasses, getClassMap } from "../../utils/theme";
|
|
12
12
|
import { config } from "../../global/config";
|
|
@@ -16,7 +16,6 @@ import { iosLeaveAnimation } from "./animations/ios.leave";
|
|
|
16
16
|
import { mdEnterAnimation } from "./animations/md.enter";
|
|
17
17
|
import { mdLeaveAnimation } from "./animations/md.leave";
|
|
18
18
|
import { getAnimationPosition } from "./animations/utils";
|
|
19
|
-
import { createSwipeToDismissGesture } from "./gestures/swipe-to-dismiss";
|
|
20
19
|
// TODO(FW-2832): types
|
|
21
20
|
/**
|
|
22
21
|
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
|
@@ -42,41 +41,6 @@ export class Toast {
|
|
|
42
41
|
this.callButtonHandler(cancelButton);
|
|
43
42
|
}
|
|
44
43
|
};
|
|
45
|
-
/**
|
|
46
|
-
* Create a new swipe gesture so Toast
|
|
47
|
-
* can be swiped to dismiss.
|
|
48
|
-
*/
|
|
49
|
-
this.createSwipeGesture = (toastPosition) => {
|
|
50
|
-
const gesture = (this.gesture = createSwipeToDismissGesture(this.el, toastPosition, () => {
|
|
51
|
-
/**
|
|
52
|
-
* If the gesture completed then
|
|
53
|
-
* we should dismiss the toast.
|
|
54
|
-
*/
|
|
55
|
-
this.dismiss(undefined, GESTURE);
|
|
56
|
-
}));
|
|
57
|
-
gesture.enable(true);
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Destroy an existing swipe gesture
|
|
61
|
-
* so Toast can no longer be swiped to dismiss.
|
|
62
|
-
*/
|
|
63
|
-
this.destroySwipeGesture = () => {
|
|
64
|
-
const { gesture } = this;
|
|
65
|
-
if (gesture === undefined) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
gesture.destroy();
|
|
69
|
-
this.gesture = undefined;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Returns `true` if swipeGesture
|
|
73
|
-
* is configured to a value that enables the swipe behavior.
|
|
74
|
-
* Returns `false` otherwise.
|
|
75
|
-
*/
|
|
76
|
-
this.prefersSwipeGesture = () => {
|
|
77
|
-
const { swipeGesture } = this;
|
|
78
|
-
return swipeGesture === 'vertical';
|
|
79
|
-
};
|
|
80
44
|
this.revealContentToScreenReader = false;
|
|
81
45
|
this.overlayIndex = undefined;
|
|
82
46
|
this.delegate = undefined;
|
|
@@ -97,37 +61,9 @@ export class Toast {
|
|
|
97
61
|
this.animated = true;
|
|
98
62
|
this.icon = undefined;
|
|
99
63
|
this.htmlAttributes = undefined;
|
|
100
|
-
this.swipeGesture = undefined;
|
|
101
64
|
this.isOpen = false;
|
|
102
65
|
this.trigger = undefined;
|
|
103
66
|
}
|
|
104
|
-
swipeGestureChanged() {
|
|
105
|
-
/**
|
|
106
|
-
* If the Toast is presented, then we need to destroy
|
|
107
|
-
* any actives gestures before a new gesture is potentially
|
|
108
|
-
* created below.
|
|
109
|
-
*
|
|
110
|
-
* If the Toast is dismissed, then no gesture should be available
|
|
111
|
-
* since the Toast is not visible. This case should never
|
|
112
|
-
* happen since the "dismiss" method handles destroying
|
|
113
|
-
* any active swipe gestures, but we keep this code
|
|
114
|
-
* around to handle the first case.
|
|
115
|
-
*/
|
|
116
|
-
this.destroySwipeGesture();
|
|
117
|
-
/**
|
|
118
|
-
* A new swipe gesture should only be created
|
|
119
|
-
* if the Toast is presented. If the Toast is not
|
|
120
|
-
* yet presented then the "present" method will
|
|
121
|
-
* handle calling the swipe gesture setup function.
|
|
122
|
-
*/
|
|
123
|
-
if (this.presented && this.prefersSwipeGesture()) {
|
|
124
|
-
/**
|
|
125
|
-
* If the Toast is presented then
|
|
126
|
-
* lastPresentedPosition is defined.
|
|
127
|
-
*/
|
|
128
|
-
this.createSwipeGesture(this.lastPresentedPosition);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
67
|
onIsOpenChange(newValue, oldValue) {
|
|
132
68
|
if (newValue === true && oldValue === false) {
|
|
133
69
|
this.present();
|
|
@@ -189,14 +125,6 @@ export class Toast {
|
|
|
189
125
|
if (this.duration > 0) {
|
|
190
126
|
this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
|
|
191
127
|
}
|
|
192
|
-
/**
|
|
193
|
-
* If the Toast has a swipe gesture then we can
|
|
194
|
-
* create the gesture so users can swipe the
|
|
195
|
-
* presented Toast.
|
|
196
|
-
*/
|
|
197
|
-
if (this.prefersSwipeGesture()) {
|
|
198
|
-
this.createSwipeGesture(animationPosition);
|
|
199
|
-
}
|
|
200
128
|
unlock();
|
|
201
129
|
}
|
|
202
130
|
/**
|
|
@@ -231,11 +159,6 @@ export class Toast {
|
|
|
231
159
|
this.revealContentToScreenReader = false;
|
|
232
160
|
}
|
|
233
161
|
this.lastPresentedPosition = undefined;
|
|
234
|
-
/**
|
|
235
|
-
* If the Toast has a swipe gesture then we can
|
|
236
|
-
* safely destroy it now that it is dismissed.
|
|
237
|
-
*/
|
|
238
|
-
this.destroySwipeGesture();
|
|
239
162
|
unlock();
|
|
240
163
|
return dismissed;
|
|
241
164
|
}
|
|
@@ -776,29 +699,6 @@ export class Toast {
|
|
|
776
699
|
"text": "Additional attributes to pass to the toast."
|
|
777
700
|
}
|
|
778
701
|
},
|
|
779
|
-
"swipeGesture": {
|
|
780
|
-
"type": "string",
|
|
781
|
-
"mutable": false,
|
|
782
|
-
"complexType": {
|
|
783
|
-
"original": "ToastSwipeGestureDirection",
|
|
784
|
-
"resolved": "\"vertical\" | undefined",
|
|
785
|
-
"references": {
|
|
786
|
-
"ToastSwipeGestureDirection": {
|
|
787
|
-
"location": "import",
|
|
788
|
-
"path": "./toast-interface",
|
|
789
|
-
"id": "src/components/toast/toast-interface.ts::ToastSwipeGestureDirection"
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
"required": false,
|
|
794
|
-
"optional": true,
|
|
795
|
-
"docs": {
|
|
796
|
-
"tags": [],
|
|
797
|
-
"text": "If set to 'vertical', the Toast can be dismissed with\na swipe gesture. The swipe direction is determined by\nthe value of the `position` property:\n`top`: The Toast can be swiped up to dismiss.\n`bottom`: The Toast can be swiped down to dismiss.\n`middle`: The Toast can be swiped up or down to dismiss."
|
|
798
|
-
},
|
|
799
|
-
"attribute": "swipe-gesture",
|
|
800
|
-
"reflect": false
|
|
801
|
-
},
|
|
802
702
|
"isOpen": {
|
|
803
703
|
"type": "boolean",
|
|
804
704
|
"mutable": false,
|
|
@@ -1109,9 +1009,6 @@ export class Toast {
|
|
|
1109
1009
|
static get elementRef() { return "el"; }
|
|
1110
1010
|
static get watchers() {
|
|
1111
1011
|
return [{
|
|
1112
|
-
"propName": "swipeGesture",
|
|
1113
|
-
"methodName": "swipeGestureChanged"
|
|
1114
|
-
}, {
|
|
1115
1012
|
"propName": "isOpen",
|
|
1116
1013
|
"methodName": "onIsOpenChange"
|
|
1117
1014
|
}, {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Uses the compareWith param to compare two values to determine if they are equal.
|
|
6
|
+
*
|
|
7
|
+
* @param currentValue The current value of the control.
|
|
8
|
+
* @param compareValue The value to compare against.
|
|
9
|
+
* @param compareWith The function or property name to use to compare values.
|
|
10
|
+
*/
|
|
11
|
+
export const compareOptions = (currentValue, compareValue, compareWith) => {
|
|
12
|
+
if (typeof compareWith === 'function') {
|
|
13
|
+
return compareWith(currentValue, compareValue);
|
|
14
|
+
}
|
|
15
|
+
else if (typeof compareWith === 'string') {
|
|
16
|
+
return currentValue[compareWith] === compareValue[compareWith];
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return Array.isArray(compareValue) ? compareValue.includes(currentValue) : currentValue === compareValue;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Compares a value against the current value(s) to determine if it is selected.
|
|
24
|
+
*
|
|
25
|
+
* @param currentValue The current value of the control.
|
|
26
|
+
* @param compareValue The value to compare against.
|
|
27
|
+
* @param compareWith The function or property name to use to compare values.
|
|
28
|
+
*/
|
|
29
|
+
export const isOptionSelected = (currentValue, compareValue, compareWith) => {
|
|
30
|
+
if (currentValue === undefined) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(currentValue)) {
|
|
34
|
+
return currentValue.some((val) => compareOptions(val, compareValue, compareWith));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return compareOptions(currentValue, compareValue, compareWith);
|
|
38
|
+
}
|
|
39
|
+
};
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2023-11-
|
|
2
|
+
"timestamp": "2023-11-10T16:14:04",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.7.0",
|
|
@@ -19711,6 +19711,42 @@
|
|
|
19711
19711
|
"optional": false,
|
|
19712
19712
|
"required": false
|
|
19713
19713
|
},
|
|
19714
|
+
{
|
|
19715
|
+
"name": "compareWith",
|
|
19716
|
+
"type": "((currentValue: any, compareValue: any) => boolean) | null | string | undefined",
|
|
19717
|
+
"complexType": {
|
|
19718
|
+
"original": "string | RadioGroupCompareFn | null",
|
|
19719
|
+
"resolved": "((currentValue: any, compareValue: any) => boolean) | null | string | undefined",
|
|
19720
|
+
"references": {
|
|
19721
|
+
"RadioGroupCompareFn": {
|
|
19722
|
+
"location": "import",
|
|
19723
|
+
"path": "./radio-group-interface",
|
|
19724
|
+
"id": "src/components/radio-group/radio-group-interface.ts::RadioGroupCompareFn"
|
|
19725
|
+
}
|
|
19726
|
+
}
|
|
19727
|
+
},
|
|
19728
|
+
"mutable": false,
|
|
19729
|
+
"attr": "compare-with",
|
|
19730
|
+
"reflectToAttr": false,
|
|
19731
|
+
"docs": "This property allows developers to specify a custom function or property\nname for comparing objects when determining the selected option in the\nion-radio-group. When not specified, the default behavior will use strict\nequality (===) for comparison.",
|
|
19732
|
+
"docsTags": [],
|
|
19733
|
+
"values": [
|
|
19734
|
+
{
|
|
19735
|
+
"type": "((currentValue: any, compareValue: any) => boolean)"
|
|
19736
|
+
},
|
|
19737
|
+
{
|
|
19738
|
+
"type": "null"
|
|
19739
|
+
},
|
|
19740
|
+
{
|
|
19741
|
+
"type": "string"
|
|
19742
|
+
},
|
|
19743
|
+
{
|
|
19744
|
+
"type": "undefined"
|
|
19745
|
+
}
|
|
19746
|
+
],
|
|
19747
|
+
"optional": true,
|
|
19748
|
+
"required": false
|
|
19749
|
+
},
|
|
19714
19750
|
{
|
|
19715
19751
|
"name": "name",
|
|
19716
19752
|
"type": "string",
|
|
@@ -23909,7 +23945,7 @@
|
|
|
23909
23945
|
"mutable": false,
|
|
23910
23946
|
"attr": "compare-with",
|
|
23911
23947
|
"reflectToAttr": false,
|
|
23912
|
-
"docs": "
|
|
23948
|
+
"docs": "This property allows developers to specify a custom function or property\nname for comparing objects when determining the selected option in the\nion-select. When not specified, the default behavior will use strict\nequality (===) for comparison.",
|
|
23913
23949
|
"docsTags": [],
|
|
23914
23950
|
"values": [
|
|
23915
23951
|
{
|
|
@@ -27785,37 +27821,6 @@
|
|
|
27785
27821
|
"optional": true,
|
|
27786
27822
|
"required": false
|
|
27787
27823
|
},
|
|
27788
|
-
{
|
|
27789
|
-
"name": "swipeGesture",
|
|
27790
|
-
"type": "\"vertical\" | undefined",
|
|
27791
|
-
"complexType": {
|
|
27792
|
-
"original": "ToastSwipeGestureDirection",
|
|
27793
|
-
"resolved": "\"vertical\" | undefined",
|
|
27794
|
-
"references": {
|
|
27795
|
-
"ToastSwipeGestureDirection": {
|
|
27796
|
-
"location": "import",
|
|
27797
|
-
"path": "./toast-interface",
|
|
27798
|
-
"id": "src/components/toast/toast-interface.ts::ToastSwipeGestureDirection"
|
|
27799
|
-
}
|
|
27800
|
-
}
|
|
27801
|
-
},
|
|
27802
|
-
"mutable": false,
|
|
27803
|
-
"attr": "swipe-gesture",
|
|
27804
|
-
"reflectToAttr": false,
|
|
27805
|
-
"docs": "If set to 'vertical', the Toast can be dismissed with\na swipe gesture. The swipe direction is determined by\nthe value of the `position` property:\n`top`: The Toast can be swiped up to dismiss.\n`bottom`: The Toast can be swiped down to dismiss.\n`middle`: The Toast can be swiped up or down to dismiss.",
|
|
27806
|
-
"docsTags": [],
|
|
27807
|
-
"values": [
|
|
27808
|
-
{
|
|
27809
|
-
"value": "vertical",
|
|
27810
|
-
"type": "string"
|
|
27811
|
-
},
|
|
27812
|
-
{
|
|
27813
|
-
"type": "undefined"
|
|
27814
|
-
}
|
|
27815
|
-
],
|
|
27816
|
-
"optional": true,
|
|
27817
|
-
"required": false
|
|
27818
|
-
},
|
|
27819
27824
|
{
|
|
27820
27825
|
"name": "translucent",
|
|
27821
27826
|
"type": "boolean",
|
|
@@ -29229,6 +29234,11 @@
|
|
|
29229
29234
|
"docstring": "",
|
|
29230
29235
|
"path": "src/components/popover/popover-interface.ts"
|
|
29231
29236
|
},
|
|
29237
|
+
"src/components/radio-group/radio-group-interface.ts::RadioGroupCompareFn": {
|
|
29238
|
+
"declaration": "(currentValue: any, compareValue: any) => boolean",
|
|
29239
|
+
"docstring": "",
|
|
29240
|
+
"path": "src/components/radio-group/radio-group-interface.ts"
|
|
29241
|
+
},
|
|
29232
29242
|
"src/components/radio-group/radio-group-interface.ts::RadioGroupChangeEventDetail": {
|
|
29233
29243
|
"declaration": "export interface RadioGroupChangeEventDetail<T = any> {\n value: T;\n event?: Event;\n}",
|
|
29234
29244
|
"docstring": "",
|
|
@@ -29374,11 +29384,6 @@
|
|
|
29374
29384
|
"docstring": "",
|
|
29375
29385
|
"path": "src/components/toast/toast-interface.ts"
|
|
29376
29386
|
},
|
|
29377
|
-
"src/components/toast/toast-interface.ts::ToastSwipeGestureDirection": {
|
|
29378
|
-
"declaration": "\"vertical\"",
|
|
29379
|
-
"docstring": "",
|
|
29380
|
-
"path": "src/components/toast/toast-interface.ts"
|
|
29381
|
-
},
|
|
29382
29387
|
"src/components/toast/toast-interface.ts::ToastPresentOptions": {
|
|
29383
29388
|
"declaration": "export type ToastPresentOptions = ToastPositionAlias & ToastAnimationPosition;",
|
|
29384
29389
|
"docstring": "",
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Uses the compareWith param to compare two values to determine if they are equal.
|
|
6
|
+
*
|
|
7
|
+
* @param currentValue The current value of the control.
|
|
8
|
+
* @param compareValue The value to compare against.
|
|
9
|
+
* @param compareWith The function or property name to use to compare values.
|
|
10
|
+
*/
|
|
11
|
+
const compareOptions = (currentValue, compareValue, compareWith) => {
|
|
12
|
+
if (typeof compareWith === 'function') {
|
|
13
|
+
return compareWith(currentValue, compareValue);
|
|
14
|
+
}
|
|
15
|
+
else if (typeof compareWith === 'string') {
|
|
16
|
+
return currentValue[compareWith] === compareValue[compareWith];
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return Array.isArray(compareValue) ? compareValue.includes(currentValue) : currentValue === compareValue;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Compares a value against the current value(s) to determine if it is selected.
|
|
24
|
+
*
|
|
25
|
+
* @param currentValue The current value of the control.
|
|
26
|
+
* @param compareValue The value to compare against.
|
|
27
|
+
* @param compareWith The function or property name to use to compare values.
|
|
28
|
+
*/
|
|
29
|
+
const isOptionSelected = (currentValue, compareValue, compareWith) => {
|
|
30
|
+
if (currentValue === undefined) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(currentValue)) {
|
|
34
|
+
return currentValue.some((val) => compareOptions(val, compareValue, compareWith));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return compareOptions(currentValue, compareValue, compareWith);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { compareOptions as c, isOptionSelected as i };
|
package/dist/esm/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { c as componentOnReady } from './helpers-3379ba19.js';
|
|
|
12
12
|
export { I as IonicSafeString, g as getMode, s as setupConfig } from './config-96c9ace3.js';
|
|
13
13
|
export { o as openURL } from './theme-17531cdf.js';
|
|
14
14
|
export { m as menuController } from './index-6a48e009.js';
|
|
15
|
-
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-
|
|
15
|
+
export { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays-a31c8878.js';
|
|
16
16
|
import './index-a5d50daf.js';
|
|
17
17
|
import './index-4392ebcb.js';
|
|
18
18
|
import './gesture-controller-0fa396c4.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, d as createEvent, e as readTask, h, H as Host, f
|
|
|
5
5
|
import { c as createButtonActiveGesture } from './button-active-109ba60d.js';
|
|
6
6
|
import { r as raf } from './helpers-3379ba19.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, f as present, g as dismiss, h as eventMethod, s as safeCall, j as prepareOverlay, k as setOverlayId } from './overlays-a31c8878.js';
|
|
9
9
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
10
10
|
import { b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
11
11
|
import { c as createAnimation } from './animation-cf3dd234.js';
|
|
@@ -6,7 +6,7 @@ import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './conf
|
|
|
6
6
|
import { c as createButtonActiveGesture } from './button-active-109ba60d.js';
|
|
7
7
|
import { r as raf } from './helpers-3379ba19.js';
|
|
8
8
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
9
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
9
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-a31c8878.js';
|
|
10
10
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
11
11
|
import { c as config, b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
12
12
|
import { c as createAnimation } from './animation-cf3dd234.js';
|
|
@@ -11,7 +11,7 @@ import { c as chevronBack, o as chevronForward, l as chevronDown, p as caretUpSh
|
|
|
11
11
|
import { b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
12
12
|
import { g as generateDayAriaLabel, a as getDay, i as isBefore, b as isAfter, c as isSameDay, d as getPreviousMonth, e as getNextMonth, v as validateParts, f as getPartsFromCalendarDay, h as getEndOfWeek, j as getStartOfWeek, k as getPreviousDay, l as getNextDay, m as getPreviousWeek, n as getNextWeek, p as parseMinParts, o as parseMaxParts, q as parseDate, w as warnIfValueOutOfBounds, r as convertToArrayOfNumbers, s as convertDataToISO, t as getToday, u as getClosestValidDate, x as getNumDaysInMonth, y as getCombinedDateColumnData, z as getMonthColumnData, A as getDayColumnData, B as getYearColumnData, C as isMonthFirstLocale, D as getTimeColumnsData, E as isLocaleDayPeriodRTL, F as getDaysOfWeek, G as getMonthAndYear, H as getDaysOfMonth, I as generateMonths, J as getHourCycle, K as getLocalizedTime, L as getMonthAndDay, M as formatValue, N as getNextYear, O as getPreviousYear, P as clampDate, Q as parseAmPm, R as calculateHourFromAMPM } from './data-44d9e816.js';
|
|
13
13
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
14
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-
|
|
14
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-a31c8878.js';
|
|
15
15
|
import { c as createAnimation } from './animation-cf3dd234.js';
|
|
16
16
|
import { b as hapticSelectionChanged, h as hapticSelectionEnd, a as hapticSelectionStart } from './haptic-1a66d69f.js';
|
|
17
17
|
import './index-a5d50daf.js';
|
|
@@ -5,7 +5,7 @@ import { r as registerInstance, d as createEvent, h, H as Host, f as getElement
|
|
|
5
5
|
import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './config-96c9ace3.js';
|
|
6
6
|
import { r as raf } from './helpers-3379ba19.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
8
|
-
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-
|
|
8
|
+
import { d as createDelegateController, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod } from './overlays-a31c8878.js';
|
|
9
9
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
10
10
|
import { c as config, b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
11
11
|
import { c as createAnimation } from './animation-cf3dd234.js';
|
|
@@ -6,7 +6,7 @@ import { g as getTimeGivenProgression } from './cubic-bezier-66542bc5.js';
|
|
|
6
6
|
import { G as GESTURE_CONTROLLER } from './gesture-controller-0fa396c4.js';
|
|
7
7
|
import { p as isEndSide, i as inheritAriaAttributes, o as assert, l as clamp } from './helpers-3379ba19.js';
|
|
8
8
|
import { m as menuController } from './index-6a48e009.js';
|
|
9
|
-
import { q as getPresentedOverlay } from './overlays-
|
|
9
|
+
import { q as getPresentedOverlay } from './overlays-a31c8878.js';
|
|
10
10
|
import { c as config, b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
11
11
|
import { c as createColorClasses, h as hostContext } from './theme-17531cdf.js';
|
|
12
12
|
import { u as menuOutline, v as menuSharp } from './index-c132c5f1.js';
|
|
@@ -8,7 +8,7 @@ import { g as getElementRoot, l as clamp, r as raf, k as inheritAttributes, m as
|
|
|
8
8
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
9
9
|
import { p as printIonWarning } from './index-595d62c9.js';
|
|
10
10
|
import { g as getCapacitor } from './capacitor-f1f25364.js';
|
|
11
|
-
import { G as GESTURE,
|
|
11
|
+
import { G as GESTURE, e as createTriggerController, B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as activeAnimations, g as dismiss, h as eventMethod } from './overlays-a31c8878.js';
|
|
12
12
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
13
13
|
import { e as deepReady, w as waitForMount } from './index-50582f1c.js';
|
|
14
14
|
import { b as getIonMode, c as config } from './ionic-global-7efdecd0.js';
|
|
@@ -504,7 +504,7 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
504
504
|
const gesture = createGesture({
|
|
505
505
|
el,
|
|
506
506
|
gestureName: 'modalSwipeToClose',
|
|
507
|
-
gesturePriority:
|
|
507
|
+
gesturePriority: 39,
|
|
508
508
|
direction: 'y',
|
|
509
509
|
threshold: 10,
|
|
510
510
|
canStart,
|
|
@@ -6,7 +6,7 @@ import { C as CoreDelegate, a as attachComponent, d as detachComponent } from '.
|
|
|
6
6
|
import { r as raf, g as getElementRoot, a as addEventListener, m as hasLazyBuild } from './helpers-3379ba19.js';
|
|
7
7
|
import { c as createLockController } from './lock-controller-e8c6c051.js';
|
|
8
8
|
import { p as printIonWarning } from './index-595d62c9.js';
|
|
9
|
-
import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, o as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays-
|
|
9
|
+
import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, o as focusFirstDescendant, g as dismiss, h as eventMethod } from './overlays-a31c8878.js';
|
|
10
10
|
import { b as getIonMode, a as isPlatform } from './ionic-global-7efdecd0.js';
|
|
11
11
|
import { g as getClassMap } from './theme-17531cdf.js';
|
|
12
12
|
import { e as deepReady, w as waitForMount } from './index-50582f1c.js';
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, H as Host, f as getElement } from './index-4392ebcb.js';
|
|
5
5
|
import { c as createLegacyFormController } from './form-controller-ed77647a.js';
|
|
6
6
|
import { a as addEventListener, b as removeEventListener, e as getAriaLabel, d as renderHiddenInput } from './helpers-3379ba19.js';
|
|
7
|
+
import { i as isOptionSelected } from './compare-with-utils-4928c09d.js';
|
|
7
8
|
import { p as printIonWarning } from './index-595d62c9.js';
|
|
8
9
|
import { h as hostContext, c as createColorClasses } from './theme-17531cdf.js';
|
|
9
10
|
import { b as getIonMode } from './ionic-global-7efdecd0.js';
|
|
@@ -24,7 +25,8 @@ const Radio = class {
|
|
|
24
25
|
this.hasLoggedDeprecationWarning = false;
|
|
25
26
|
this.updateState = () => {
|
|
26
27
|
if (this.radioGroup) {
|
|
27
|
-
|
|
28
|
+
const { compareWith, value: radioGroupValue } = this.radioGroup;
|
|
29
|
+
this.checked = isOptionSelected(radioGroupValue, this.value, compareWith);
|
|
28
30
|
}
|
|
29
31
|
};
|
|
30
32
|
this.onClick = () => {
|
|
@@ -246,6 +248,7 @@ const RadioGroup = class {
|
|
|
246
248
|
}
|
|
247
249
|
};
|
|
248
250
|
this.allowEmptySelection = false;
|
|
251
|
+
this.compareWith = undefined;
|
|
249
252
|
this.name = this.inputId;
|
|
250
253
|
this.value = undefined;
|
|
251
254
|
}
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
import { r as registerInstance, d as createEvent, h, H as Host, f as getElement, i as forceUpdate } from './index-4392ebcb.js';
|
|
5
5
|
import { c as createLegacyFormController } from './form-controller-ed77647a.js';
|
|
6
6
|
import { c as createNotchController } from './notch-controller-3f79197e.js';
|
|
7
|
+
import { i as isOptionSelected, c as compareOptions } from './compare-with-utils-4928c09d.js';
|
|
7
8
|
import { k as inheritAttributes, f as focusElement, h as findItemLabel, d as renderHiddenInput, e as getAriaLabel } from './helpers-3379ba19.js';
|
|
8
9
|
import { p as printIonWarning } from './index-595d62c9.js';
|
|
9
|
-
import { c as popoverController, b as actionSheetController, a as alertController, s as safeCall } from './overlays-
|
|
10
|
+
import { c as popoverController, b as actionSheetController, a as alertController, s as safeCall } from './overlays-a31c8878.js';
|
|
10
11
|
import { i as isRTL } from './dir-912e3e13.js';
|
|
11
12
|
import { h as hostContext, c as createColorClasses, g as getClassMap } from './theme-17531cdf.js';
|
|
12
13
|
import { w as watchForOptions } from './watch-options-02d8498b.js';
|
|
@@ -642,17 +643,6 @@ Developers can use the "legacy" property to continue using the legacy form marku
|
|
|
642
643
|
"value": ["styleChanged"]
|
|
643
644
|
}; }
|
|
644
645
|
};
|
|
645
|
-
const isOptionSelected = (currentValue, compareValue, compareWith) => {
|
|
646
|
-
if (currentValue === undefined) {
|
|
647
|
-
return false;
|
|
648
|
-
}
|
|
649
|
-
if (Array.isArray(currentValue)) {
|
|
650
|
-
return currentValue.some((val) => compareOptions(val, compareValue, compareWith));
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
return compareOptions(currentValue, compareValue, compareWith);
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
646
|
const getOptionValue = (el) => {
|
|
657
647
|
const value = el.value;
|
|
658
648
|
return value === undefined ? el.textContent || '' : value;
|
|
@@ -666,17 +656,6 @@ const parseValue = (value) => {
|
|
|
666
656
|
}
|
|
667
657
|
return value.toString();
|
|
668
658
|
};
|
|
669
|
-
const compareOptions = (currentValue, compareValue, compareWith) => {
|
|
670
|
-
if (typeof compareWith === 'function') {
|
|
671
|
-
return compareWith(currentValue, compareValue);
|
|
672
|
-
}
|
|
673
|
-
else if (typeof compareWith === 'string') {
|
|
674
|
-
return currentValue[compareWith] === compareValue[compareWith];
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
return Array.isArray(compareValue) ? compareValue.includes(currentValue) : currentValue === compareValue;
|
|
678
|
-
}
|
|
679
|
-
};
|
|
680
659
|
const generateText = (opts, value, compareWith) => {
|
|
681
660
|
if (value === undefined) {
|
|
682
661
|
return '';
|