@ionic/core 8.8.4-dev.11777393099.1a6ea277 → 8.8.4-dev.11777478428.1c0338ab
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-item-option.js +1 -1
- package/components/ion-item-sliding.js +1 -1
- package/dist/cjs/ion-item-option_3.cjs.entry.js +94 -56
- package/dist/collection/components/item-option/item-option.ionic.css +4 -0
- package/dist/collection/components/item-sliding/item-sliding.ionic.css +280 -0
- package/dist/collection/components/item-sliding/{item-sliding.css → item-sliding.ios.css} +76 -7
- package/dist/collection/components/item-sliding/item-sliding.js +93 -55
- package/dist/collection/components/item-sliding/item-sliding.md.css +196 -0
- package/dist/docs.json +1 -1
- package/dist/esm/ion-item-option_3.entry.js +94 -56
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-b236b0a7.entry.js +4 -0
- package/hydrate/index.js +94 -56
- package/hydrate/index.mjs +94 -56
- package/package.json +1 -1
- package/dist/ionic/p-7959826e.entry.js +0 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a pixels given value into rem
|
|
3
|
+
*
|
|
4
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
5
|
+
* @param context (optional) - Baseline value
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert a font size to a dynamic font size.
|
|
9
|
+
* Fonts that participate in Dynamic Type should use
|
|
10
|
+
* dynamic font sizes.
|
|
11
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
12
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
13
|
+
* convert to a unit other than $baselineUnit.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Convert a font size to a dynamic font size but impose
|
|
17
|
+
* a maximum font size.
|
|
18
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
19
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
20
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
21
|
+
* convert to a unit other than $baselineUnit.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Convert a font size to a dynamic font size but impose
|
|
25
|
+
* a minimum font size.
|
|
26
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
27
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
28
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
29
|
+
* convert to a unit other than $baselineUnit.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Convert a font size to a dynamic font size but impose
|
|
33
|
+
* maximum and minimum font sizes.
|
|
34
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
35
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
36
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
37
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
38
|
+
* convert to a unit other than $baselineUnit.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* A heuristic that applies CSS to tablet
|
|
42
|
+
* viewports.
|
|
43
|
+
*
|
|
44
|
+
* Usage:
|
|
45
|
+
* @include tablet-viewport() {
|
|
46
|
+
* :host {
|
|
47
|
+
* background-color: green;
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* A heuristic that applies CSS to mobile
|
|
53
|
+
* viewports (i.e. phones, not tablets).
|
|
54
|
+
*
|
|
55
|
+
* Usage:
|
|
56
|
+
* @include mobile-viewport() {
|
|
57
|
+
* :host {
|
|
58
|
+
* background-color: blue;
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
ion-item-sliding {
|
|
63
|
+
display: block;
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 100%;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
user-select: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ion-item-sliding .item {
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.item-sliding-active-slide.item-sliding-dragging .item {
|
|
75
|
+
transition: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.item-sliding-active-slide.item-sliding-full-swipe-transition .item {
|
|
79
|
+
transition: transform 250ms ease-out;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.item-sliding-closing ion-item-options {
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.item-sliding-active-swipe-end .item-options-end .item-option-expandable {
|
|
87
|
+
/* stylelint-disable-next-line property-disallowed-list */
|
|
88
|
+
padding-left: 100%;
|
|
89
|
+
order: 1;
|
|
90
|
+
transition-duration: 0.6s;
|
|
91
|
+
transition-property: padding-left;
|
|
92
|
+
}
|
|
93
|
+
:host-context([dir=rtl]) .item-sliding-active-swipe-end .item-options-end .item-option-expandable {
|
|
94
|
+
order: -1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[dir=rtl] .item-sliding-active-swipe-end .item-options-end .item-option-expandable {
|
|
98
|
+
order: -1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@supports selector(:dir(rtl)) {
|
|
102
|
+
.item-sliding-active-swipe-end .item-options-end .item-option-expandable:dir(rtl) {
|
|
103
|
+
order: -1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.item-sliding-active-swipe-start .item-options-start .item-option-expandable {
|
|
108
|
+
/* stylelint-disable-next-line property-disallowed-list */
|
|
109
|
+
padding-right: 100%;
|
|
110
|
+
order: -1;
|
|
111
|
+
transition-duration: 0.6s;
|
|
112
|
+
transition-property: padding-right;
|
|
113
|
+
}
|
|
114
|
+
:host-context([dir=rtl]) .item-sliding-active-swipe-start .item-options-start .item-option-expandable {
|
|
115
|
+
order: 1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[dir=rtl] .item-sliding-active-swipe-start .item-options-start .item-option-expandable {
|
|
119
|
+
order: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@supports selector(:dir(rtl)) {
|
|
123
|
+
.item-sliding-active-swipe-start .item-options-start .item-option-expandable:dir(rtl) {
|
|
124
|
+
order: 1;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A heuristic that applies CSS to tablet
|
|
130
|
+
* viewports.
|
|
131
|
+
*
|
|
132
|
+
* Usage:
|
|
133
|
+
* @include tablet-viewport() {
|
|
134
|
+
* :host {
|
|
135
|
+
* background-color: green;
|
|
136
|
+
* }
|
|
137
|
+
* }
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* A heuristic that applies CSS to mobile
|
|
141
|
+
* viewports (i.e. phones, not tablets).
|
|
142
|
+
*
|
|
143
|
+
* Usage:
|
|
144
|
+
* @include mobile-viewport() {
|
|
145
|
+
* :host {
|
|
146
|
+
* background-color: blue;
|
|
147
|
+
* }
|
|
148
|
+
* }
|
|
149
|
+
*/
|
|
150
|
+
/**
|
|
151
|
+
* Convert a pixels given value into rem
|
|
152
|
+
*
|
|
153
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
154
|
+
* @param context (optional) - Baseline value
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* Convert a font size to a dynamic font size.
|
|
158
|
+
* Fonts that participate in Dynamic Type should use
|
|
159
|
+
* dynamic font sizes.
|
|
160
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
161
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
162
|
+
* convert to a unit other than $baselineUnit.
|
|
163
|
+
*/
|
|
164
|
+
/**
|
|
165
|
+
* Convert a font size to a dynamic font size but impose
|
|
166
|
+
* a maximum font size.
|
|
167
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
168
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
169
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
170
|
+
* convert to a unit other than $baselineUnit.
|
|
171
|
+
*/
|
|
172
|
+
/**
|
|
173
|
+
* Convert a font size to a dynamic font size but impose
|
|
174
|
+
* a minimum font size.
|
|
175
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
176
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
177
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
178
|
+
* convert to a unit other than $baselineUnit.
|
|
179
|
+
*/
|
|
180
|
+
/**
|
|
181
|
+
* Convert a font size to a dynamic font size but impose
|
|
182
|
+
* maximum and minimum font sizes.
|
|
183
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
184
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
185
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
186
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
187
|
+
* convert to a unit other than $baselineUnit.
|
|
188
|
+
*/
|
|
189
|
+
/**
|
|
190
|
+
* Convert a pixels given value into rem
|
|
191
|
+
*
|
|
192
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
193
|
+
* @param context (optional) - Baseline value
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* Convert a font size to a dynamic font size.
|
|
197
|
+
* Fonts that participate in Dynamic Type should use
|
|
198
|
+
* dynamic font sizes.
|
|
199
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
200
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
201
|
+
* convert to a unit other than $baselineUnit.
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* Convert a font size to a dynamic font size but impose
|
|
205
|
+
* a maximum font size.
|
|
206
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
207
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
208
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
209
|
+
* convert to a unit other than $baselineUnit.
|
|
210
|
+
*/
|
|
211
|
+
/**
|
|
212
|
+
* Convert a font size to a dynamic font size but impose
|
|
213
|
+
* a minimum font size.
|
|
214
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
215
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
216
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
217
|
+
* convert to a unit other than $baselineUnit.
|
|
218
|
+
*/
|
|
219
|
+
/**
|
|
220
|
+
* Convert a font size to a dynamic font size but impose
|
|
221
|
+
* maximum and minimum font sizes.
|
|
222
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
223
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
224
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
225
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
226
|
+
* convert to a unit other than $baselineUnit.
|
|
227
|
+
*/
|
|
228
|
+
/**
|
|
229
|
+
* A heuristic that applies CSS to tablet
|
|
230
|
+
* viewports.
|
|
231
|
+
*
|
|
232
|
+
* Usage:
|
|
233
|
+
* @include tablet-viewport() {
|
|
234
|
+
* :host {
|
|
235
|
+
* background-color: green;
|
|
236
|
+
* }
|
|
237
|
+
* }
|
|
238
|
+
*/
|
|
239
|
+
/**
|
|
240
|
+
* A heuristic that applies CSS to mobile
|
|
241
|
+
* viewports (i.e. phones, not tablets).
|
|
242
|
+
*
|
|
243
|
+
* Usage:
|
|
244
|
+
* @include mobile-viewport() {
|
|
245
|
+
* :host {
|
|
246
|
+
* background-color: blue;
|
|
247
|
+
* }
|
|
248
|
+
* }
|
|
249
|
+
*/
|
|
250
|
+
.item-sliding-transition-open .item {
|
|
251
|
+
transition: transform 250ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.item-sliding-transition-snapback .item {
|
|
255
|
+
transition: transform var(--token-transition-time-300, 300ms) var(--token-transition-curve-bounce, cubic-bezier(0.47, 0, 0.23, 1.38));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.item-sliding-ionic-confirm-item-in .item {
|
|
259
|
+
transition: transform var(--token-transition-time-150, 150ms) var(--token-transition-curve-base, cubic-bezier(0.4, 0, 1, 1));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.item-sliding-ionic-confirm-item-back .item {
|
|
263
|
+
transition: transform var(--token-transition-time-500, 500ms) var(--token-transition-curve-bounce, cubic-bezier(0.47, 0, 0.23, 1.38));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
ion-item-option.item-sliding-expandable-width-in {
|
|
267
|
+
transition: width var(--token-transition-time-150, 150ms) var(--token-transition-curve-base, cubic-bezier(0.4, 0, 1, 1));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
ion-item-option.item-sliding-expandable-width-back {
|
|
271
|
+
transition: width var(--token-transition-time-500, 500ms) var(--token-transition-curve-bounce, cubic-bezier(0.47, 0, 0.23, 1.38));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.item-sliding-active-slide .item {
|
|
275
|
+
position: relative;
|
|
276
|
+
opacity: 1;
|
|
277
|
+
z-index: 2;
|
|
278
|
+
pointer-events: none;
|
|
279
|
+
will-change: transform;
|
|
280
|
+
}
|
|
@@ -71,13 +71,12 @@ ion-item-sliding .item {
|
|
|
71
71
|
user-select: none;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.item-sliding-active-slide .item {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
will-change: transform;
|
|
74
|
+
.item-sliding-active-slide.item-sliding-dragging .item {
|
|
75
|
+
transition: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.item-sliding-active-slide.item-sliding-full-swipe-transition .item {
|
|
79
|
+
transition: transform 250ms ease-out;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
.item-sliding-closing ion-item-options {
|
|
@@ -124,4 +123,74 @@ ion-item-sliding .item {
|
|
|
124
123
|
.item-sliding-active-swipe-start .item-options-start .item-option-expandable:dir(rtl) {
|
|
125
124
|
order: 1;
|
|
126
125
|
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Convert a pixels given value into rem
|
|
130
|
+
*
|
|
131
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
132
|
+
* @param context (optional) - Baseline value
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* Convert a font size to a dynamic font size.
|
|
136
|
+
* Fonts that participate in Dynamic Type should use
|
|
137
|
+
* dynamic font sizes.
|
|
138
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
139
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
140
|
+
* convert to a unit other than $baselineUnit.
|
|
141
|
+
*/
|
|
142
|
+
/**
|
|
143
|
+
* Convert a font size to a dynamic font size but impose
|
|
144
|
+
* a maximum font size.
|
|
145
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
146
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
147
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
148
|
+
* convert to a unit other than $baselineUnit.
|
|
149
|
+
*/
|
|
150
|
+
/**
|
|
151
|
+
* Convert a font size to a dynamic font size but impose
|
|
152
|
+
* a minimum font size.
|
|
153
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
154
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
155
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
156
|
+
* convert to a unit other than $baselineUnit.
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* Convert a font size to a dynamic font size but impose
|
|
160
|
+
* maximum and minimum font sizes.
|
|
161
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
162
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
163
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
164
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
165
|
+
* convert to a unit other than $baselineUnit.
|
|
166
|
+
*/
|
|
167
|
+
/**
|
|
168
|
+
* A heuristic that applies CSS to tablet
|
|
169
|
+
* viewports.
|
|
170
|
+
*
|
|
171
|
+
* Usage:
|
|
172
|
+
* @include tablet-viewport() {
|
|
173
|
+
* :host {
|
|
174
|
+
* background-color: green;
|
|
175
|
+
* }
|
|
176
|
+
* }
|
|
177
|
+
*/
|
|
178
|
+
/**
|
|
179
|
+
* A heuristic that applies CSS to mobile
|
|
180
|
+
* viewports (i.e. phones, not tablets).
|
|
181
|
+
*
|
|
182
|
+
* Usage:
|
|
183
|
+
* @include mobile-viewport() {
|
|
184
|
+
* :host {
|
|
185
|
+
* background-color: blue;
|
|
186
|
+
* }
|
|
187
|
+
* }
|
|
188
|
+
*/
|
|
189
|
+
.item-sliding-active-slide .item {
|
|
190
|
+
position: relative;
|
|
191
|
+
transition: transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);
|
|
192
|
+
opacity: 1;
|
|
193
|
+
z-index: 2;
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
will-change: transform;
|
|
127
196
|
}
|
|
@@ -9,18 +9,17 @@ import { watchForOptions } from "../../utils/watch-options";
|
|
|
9
9
|
import { getIonTheme } from "../../global/ionic-global";
|
|
10
10
|
const SWIPE_MARGIN = 30;
|
|
11
11
|
const ELASTIC_FACTOR = 0.55;
|
|
12
|
+
const IONIC_ELASTIC_FACTOR = 0.15;
|
|
12
13
|
const IONIC_SNAP_OPEN_RATIO = 0.4;
|
|
13
|
-
const IONIC_EXPAND_TRIGGER =
|
|
14
|
-
const IONIC_VELOCITY_THRESHOLD =
|
|
14
|
+
const IONIC_EXPAND_TRIGGER = 40;
|
|
15
|
+
const IONIC_VELOCITY_THRESHOLD = 400;
|
|
15
16
|
const IONIC_ACTION_BASE_WIDTH = 64;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const IONIC_CONFIRM_EASE_IN = '150ms ease-in';
|
|
19
|
-
const IONIC_CONFIRM_SNAPBACK = '480ms cubic-bezier(0.34, 1.4, 0.64, 1)';
|
|
20
|
-
const IONIC_CONFIRM_PAUSE = 900;
|
|
17
|
+
const IONIC_CONFIRM_PAUSE = 300;
|
|
18
|
+
const FULL_SWIPE_TRANSITION_MS = 250;
|
|
21
19
|
const IONIC_EXPAND_RESISTANCE_FACTOR = 0.95;
|
|
22
20
|
/** Expandable, non-disabled option (matches item-option expandable class). */
|
|
23
21
|
const EXPANDABLE_OPTION_SELECTOR = 'ion-item-option.item-option-expandable:not(.item-option-disabled)';
|
|
22
|
+
const ITEM_OPTION_EXPAND_THRESHOLD_CLASS = 'item-option-expand-threshold';
|
|
24
23
|
let openSlidingItem;
|
|
25
24
|
/**
|
|
26
25
|
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
|
@@ -247,7 +246,7 @@ export class ItemSliding {
|
|
|
247
246
|
if (!this.item) {
|
|
248
247
|
return resolve();
|
|
249
248
|
}
|
|
250
|
-
this.
|
|
249
|
+
this.el.classList.add('item-sliding-full-swipe-transition');
|
|
251
250
|
this.item.style.transform = `translate3d(${-position}px, 0, 0)`;
|
|
252
251
|
const id = setTimeout(resolve, duration);
|
|
253
252
|
signal.addEventListener('abort', () => {
|
|
@@ -288,7 +287,7 @@ export class ItemSliding {
|
|
|
288
287
|
await this.delay(100, signal);
|
|
289
288
|
// Animate off-screen while maintaining the expanded state
|
|
290
289
|
const offScreenDistance = direction === 'end' ? window.innerWidth : -window.innerWidth;
|
|
291
|
-
await this.animateToPosition(offScreenDistance,
|
|
290
|
+
await this.animateToPosition(offScreenDistance, FULL_SWIPE_TRANSITION_MS, signal);
|
|
292
291
|
// Trigger action
|
|
293
292
|
if (options) {
|
|
294
293
|
options.fireSwipeEvent();
|
|
@@ -296,7 +295,7 @@ export class ItemSliding {
|
|
|
296
295
|
// Small delay before returning
|
|
297
296
|
await this.delay(300, signal);
|
|
298
297
|
// Return to closed state
|
|
299
|
-
await this.animateToPosition(0,
|
|
298
|
+
await this.animateToPosition(0, FULL_SWIPE_TRANSITION_MS, signal);
|
|
300
299
|
}
|
|
301
300
|
catch (_a) {
|
|
302
301
|
// Animation was aborted (e.g. component disconnected). finally handles cleanup.
|
|
@@ -304,8 +303,8 @@ export class ItemSliding {
|
|
|
304
303
|
finally {
|
|
305
304
|
this.animationAbortController = undefined;
|
|
306
305
|
// Reset state
|
|
306
|
+
this.el.classList.remove('item-sliding-full-swipe-transition');
|
|
307
307
|
if (this.item) {
|
|
308
|
-
this.item.style.transition = '';
|
|
309
308
|
this.item.style.transform = '';
|
|
310
309
|
}
|
|
311
310
|
this.openAmount = 0;
|
|
@@ -340,27 +339,41 @@ export class ItemSliding {
|
|
|
340
339
|
getExpandableBaseWidth(direction) {
|
|
341
340
|
return direction === 'end' ? this.rightExpandableBaseWidth : this.leftExpandableBaseWidth;
|
|
342
341
|
}
|
|
343
|
-
setIonicExpandableWidth(direction, width,
|
|
342
|
+
setIonicExpandableWidth(direction, width, opening) {
|
|
344
343
|
const expandableOption = this.getExpandableOption(direction);
|
|
345
344
|
if (!expandableOption) {
|
|
346
345
|
return;
|
|
347
346
|
}
|
|
348
347
|
const style = expandableOption.style;
|
|
349
|
-
|
|
348
|
+
if (opening) {
|
|
349
|
+
expandableOption.classList.remove('item-sliding-expandable-snapback');
|
|
350
|
+
expandableOption.classList.add('item-sliding-expandable-open');
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
expandableOption.classList.remove('item-sliding-expandable-open');
|
|
354
|
+
expandableOption.classList.add('item-sliding-expandable-snapback');
|
|
355
|
+
}
|
|
350
356
|
const baseWidth = this.getExpandableBaseWidth(direction);
|
|
351
357
|
style.width = `${Math.max(baseWidth, width)}px`;
|
|
352
358
|
}
|
|
353
359
|
resetIonicExpandableOptions() {
|
|
354
360
|
[this.leftOptions, this.rightOptions].forEach((options) => {
|
|
361
|
+
if (!options) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
options.querySelectorAll(EXPANDABLE_OPTION_SELECTOR).forEach((node) => {
|
|
365
|
+
node.classList.remove(ITEM_OPTION_EXPAND_THRESHOLD_CLASS);
|
|
366
|
+
});
|
|
355
367
|
const expandableOption = this.queryExpandableOption(options);
|
|
356
368
|
if (!expandableOption) {
|
|
357
369
|
return;
|
|
358
370
|
}
|
|
359
|
-
expandableOption.style.transition = '';
|
|
360
371
|
expandableOption.style.width = '';
|
|
372
|
+
expandableOption.classList.remove('item-sliding-expandable-open', 'item-sliding-expandable-snapback', 'item-sliding-expandable-width-in', 'item-sliding-expandable-width-back');
|
|
361
373
|
});
|
|
362
374
|
}
|
|
363
375
|
updateIonicExpandableFromOpenAmount(openAmount, isFinal, previousOpenAmount) {
|
|
376
|
+
var _a;
|
|
364
377
|
if ((this.state & 128 /* SlidingState.AnimatingFullSwipe */) !== 0) {
|
|
365
378
|
return;
|
|
366
379
|
}
|
|
@@ -371,7 +384,8 @@ export class ItemSliding {
|
|
|
371
384
|
this.resetIonicExpandableOptions();
|
|
372
385
|
return;
|
|
373
386
|
}
|
|
374
|
-
this.
|
|
387
|
+
(_a = this.queryExpandableOption(previousDirection === 'end' ? this.rightOptions : this.leftOptions)) === null || _a === void 0 ? void 0 : _a.classList.remove(ITEM_OPTION_EXPAND_THRESHOLD_CLASS);
|
|
388
|
+
this.setIonicExpandableWidth(previousDirection, this.getExpandableBaseWidth(previousDirection), false);
|
|
375
389
|
return;
|
|
376
390
|
}
|
|
377
391
|
const baseWidth = this.getExpandableBaseWidth(direction);
|
|
@@ -379,8 +393,16 @@ export class ItemSliding {
|
|
|
379
393
|
const extraWidth = Math.max(0, Math.abs(openAmount) - optionsWidth);
|
|
380
394
|
const resistedExtraWidth = isFinal ? extraWidth : extraWidth * IONIC_EXPAND_RESISTANCE_FACTOR;
|
|
381
395
|
const targetWidth = baseWidth + resistedExtraWidth;
|
|
382
|
-
const
|
|
383
|
-
|
|
396
|
+
const expandableOption = this.getExpandableOption(direction);
|
|
397
|
+
if (expandableOption) {
|
|
398
|
+
if (!isFinal && extraWidth >= IONIC_EXPAND_TRIGGER) {
|
|
399
|
+
expandableOption.classList.add(ITEM_OPTION_EXPAND_THRESHOLD_CLASS);
|
|
400
|
+
}
|
|
401
|
+
else {
|
|
402
|
+
expandableOption.classList.remove(ITEM_OPTION_EXPAND_THRESHOLD_CLASS);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
this.setIonicExpandableWidth(direction, targetWidth, true);
|
|
384
406
|
}
|
|
385
407
|
async animateIonicFullSwipe(direction) {
|
|
386
408
|
const abortController = new AbortController();
|
|
@@ -404,19 +426,23 @@ export class ItemSliding {
|
|
|
404
426
|
const expandableTargetWidth = Math.max(baseWidth, itemWidth - 16);
|
|
405
427
|
const offScreenPosition = direction === 'end' ? itemWidth : -itemWidth;
|
|
406
428
|
if (expandableOption) {
|
|
407
|
-
expandableOption.
|
|
429
|
+
expandableOption.classList.remove('item-sliding-expandable-width-back');
|
|
430
|
+
expandableOption.classList.add('item-sliding-expandable-width-in');
|
|
408
431
|
expandableOption.style.width = `${expandableTargetWidth}px`;
|
|
409
432
|
}
|
|
410
|
-
this.
|
|
433
|
+
this.el.classList.remove('item-sliding-ionic-confirm-item-back');
|
|
434
|
+
this.el.classList.add('item-sliding-ionic-confirm-item-in');
|
|
411
435
|
this.item.style.transform = `translate3d(${-offScreenPosition}px, 0, 0)`;
|
|
412
436
|
await this.delay(150, signal);
|
|
413
437
|
options === null || options === void 0 ? void 0 : options.fireSwipeEvent();
|
|
414
438
|
await this.delay(IONIC_CONFIRM_PAUSE, signal);
|
|
415
439
|
if (expandableOption) {
|
|
416
|
-
expandableOption.
|
|
440
|
+
expandableOption.classList.remove('item-sliding-expandable-width-in');
|
|
441
|
+
expandableOption.classList.add('item-sliding-expandable-width-back');
|
|
417
442
|
expandableOption.style.width = `${baseWidth}px`;
|
|
418
443
|
}
|
|
419
|
-
this.
|
|
444
|
+
this.el.classList.remove('item-sliding-ionic-confirm-item-in');
|
|
445
|
+
this.el.classList.add('item-sliding-ionic-confirm-item-back');
|
|
420
446
|
this.item.style.transform = 'translate3d(0, 0, 0)';
|
|
421
447
|
await this.delay(480, signal);
|
|
422
448
|
}
|
|
@@ -425,8 +451,8 @@ export class ItemSliding {
|
|
|
425
451
|
}
|
|
426
452
|
finally {
|
|
427
453
|
this.animationAbortController = undefined;
|
|
454
|
+
this.el.classList.remove('item-sliding-ionic-confirm-item-in', 'item-sliding-ionic-confirm-item-back');
|
|
428
455
|
if (this.item) {
|
|
429
|
-
this.item.style.transition = '';
|
|
430
456
|
this.item.style.transform = '';
|
|
431
457
|
}
|
|
432
458
|
this.resetIonicExpandableOptions();
|
|
@@ -507,7 +533,12 @@ export class ItemSliding {
|
|
|
507
533
|
}
|
|
508
534
|
this.initialOpenAmount = this.openAmount;
|
|
509
535
|
if (this.item) {
|
|
510
|
-
this.
|
|
536
|
+
if (this.isIonicTheme()) {
|
|
537
|
+
this.el.classList.remove('item-sliding-transition-open', 'item-sliding-transition-snapback');
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
this.el.classList.add('item-sliding-dragging');
|
|
541
|
+
}
|
|
511
542
|
}
|
|
512
543
|
}
|
|
513
544
|
onMove(gesture) {
|
|
@@ -530,18 +561,31 @@ export class ItemSliding {
|
|
|
530
561
|
printIonWarning('[ion-item-sliding] - invalid ItemSideFlags value', this.sides);
|
|
531
562
|
break;
|
|
532
563
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
564
|
+
if (this.isIonicTheme()) {
|
|
565
|
+
if (openAmount > this.optsWidthRightSide) {
|
|
566
|
+
const overDrag = openAmount - this.optsWidthRightSide;
|
|
567
|
+
openAmount = this.optsWidthRightSide + overDrag * IONIC_ELASTIC_FACTOR;
|
|
568
|
+
}
|
|
569
|
+
else if (openAmount < -this.optsWidthLeftSide) {
|
|
570
|
+
const overDrag = openAmount + this.optsWidthLeftSide;
|
|
571
|
+
openAmount = -this.optsWidthLeftSide + overDrag * IONIC_ELASTIC_FACTOR;
|
|
572
|
+
}
|
|
537
573
|
}
|
|
538
|
-
else
|
|
539
|
-
optsWidth
|
|
540
|
-
|
|
574
|
+
else {
|
|
575
|
+
let optsWidth;
|
|
576
|
+
if (openAmount > this.optsWidthRightSide) {
|
|
577
|
+
optsWidth = this.optsWidthRightSide;
|
|
578
|
+
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
|
579
|
+
}
|
|
580
|
+
else if (openAmount < -this.optsWidthLeftSide) {
|
|
581
|
+
optsWidth = -this.optsWidthLeftSide;
|
|
582
|
+
openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
|
583
|
+
}
|
|
541
584
|
}
|
|
542
585
|
this.setOpenAmount(openAmount, false);
|
|
543
586
|
}
|
|
544
587
|
onEnd(gesture) {
|
|
588
|
+
this.el.classList.remove('item-sliding-dragging');
|
|
545
589
|
this.restoreContentScrollAfterSlide();
|
|
546
590
|
if (this.isIonicTheme()) {
|
|
547
591
|
this.onEndIonic(gesture);
|
|
@@ -605,8 +649,10 @@ export class ItemSliding {
|
|
|
605
649
|
const extraWidth = Math.max(0, Math.abs(this.openAmount) - optionsWidth);
|
|
606
650
|
const hasExpandable = this.hasExpandableOptions(activeDirection === 'end' ? this.rightOptions : this.leftOptions);
|
|
607
651
|
const wasRevealed = Math.abs(this.initialOpenAmount) >= optionsWidth;
|
|
608
|
-
|
|
609
|
-
|
|
652
|
+
const closeDirection = activeDirection === 'end' ? velocityX > IONIC_VELOCITY_THRESHOLD : velocityX < -IONIC_VELOCITY_THRESHOLD;
|
|
653
|
+
if (!closeDirection &&
|
|
654
|
+
hasExpandable &&
|
|
655
|
+
(extraWidth >= IONIC_EXPAND_TRIGGER || (extraWidth > 0 && (wasRevealed && Math.abs(velocityX) > IONIC_VELOCITY_THRESHOLD)))) {
|
|
610
656
|
this.animateIonicFullSwipe(activeDirection).catch(() => {
|
|
611
657
|
if (this.gesture) {
|
|
612
658
|
this.gesture.enable(!this.disabled);
|
|
@@ -614,9 +660,6 @@ export class ItemSliding {
|
|
|
614
660
|
});
|
|
615
661
|
return;
|
|
616
662
|
}
|
|
617
|
-
const closeDirection = activeDirection === 'end'
|
|
618
|
-
? velocityX > IONIC_VELOCITY_THRESHOLD * 1000
|
|
619
|
-
: velocityX < -IONIC_VELOCITY_THRESHOLD * 1000;
|
|
620
663
|
if (closeDirection) {
|
|
621
664
|
this.setOpenAmount(0, true);
|
|
622
665
|
return;
|
|
@@ -670,8 +713,14 @@ export class ItemSliding {
|
|
|
670
713
|
if (this.isIonicTheme()) {
|
|
671
714
|
this.updateIonicExpandableFromOpenAmount(openAmount, isFinal, previousOpenAmount);
|
|
672
715
|
}
|
|
673
|
-
if (isFinal) {
|
|
674
|
-
|
|
716
|
+
if (this.isIonicTheme() && isFinal) {
|
|
717
|
+
const closing = Math.abs(openAmount) < Math.abs(previousOpenAmount);
|
|
718
|
+
if (closing) {
|
|
719
|
+
this.el.classList.add('item-sliding-transition-snapback');
|
|
720
|
+
}
|
|
721
|
+
else {
|
|
722
|
+
this.el.classList.add('item-sliding-transition-open');
|
|
723
|
+
}
|
|
675
724
|
}
|
|
676
725
|
if (openAmount > 0) {
|
|
677
726
|
const fullSwipe = !this.isIonicTheme() && openAmount >= this.optsWidthRightSide + SWIPE_MARGIN;
|
|
@@ -682,18 +731,7 @@ export class ItemSliding {
|
|
|
682
731
|
this.state = fullSwipe ? 16 /* SlidingState.Start */ | 64 /* SlidingState.SwipeStart */ : 16 /* SlidingState.Start */;
|
|
683
732
|
}
|
|
684
733
|
else {
|
|
685
|
-
/**
|
|
686
|
-
* The sliding options should not be
|
|
687
|
-
* clickable while the item is closing.
|
|
688
|
-
*/
|
|
689
734
|
el.classList.add('item-sliding-closing');
|
|
690
|
-
/**
|
|
691
|
-
* Item sliding cannot be interrupted
|
|
692
|
-
* while closing the item. If it did,
|
|
693
|
-
* it would allow the item to get into an
|
|
694
|
-
* inconsistent state where multiple
|
|
695
|
-
* items are then open at the same time.
|
|
696
|
-
*/
|
|
697
735
|
if (this.gesture) {
|
|
698
736
|
this.gesture.enable(false);
|
|
699
737
|
}
|
|
@@ -728,7 +766,7 @@ export class ItemSliding {
|
|
|
728
766
|
}
|
|
729
767
|
render() {
|
|
730
768
|
const theme = getIonTheme(this);
|
|
731
|
-
return (h(Host, { key: '
|
|
769
|
+
return (h(Host, { key: '948e61ebcd5fc08bcb6091b62f797da04f931e16', class: {
|
|
732
770
|
[theme]: true,
|
|
733
771
|
'item-sliding-active-slide': this.state !== 2 /* SlidingState.Disabled */,
|
|
734
772
|
'item-sliding-active-options-end': (this.state & 8 /* SlidingState.End */) !== 0,
|
|
@@ -740,16 +778,16 @@ export class ItemSliding {
|
|
|
740
778
|
static get is() { return "ion-item-sliding"; }
|
|
741
779
|
static get originalStyleUrls() {
|
|
742
780
|
return {
|
|
743
|
-
"ios": ["item-sliding.scss"],
|
|
744
|
-
"md": ["item-sliding.scss"],
|
|
745
|
-
"ionic": ["item-sliding.scss"]
|
|
781
|
+
"ios": ["item-sliding.ios.scss"],
|
|
782
|
+
"md": ["item-sliding.md.scss"],
|
|
783
|
+
"ionic": ["item-sliding.ionic.scss"]
|
|
746
784
|
};
|
|
747
785
|
}
|
|
748
786
|
static get styleUrls() {
|
|
749
787
|
return {
|
|
750
|
-
"ios": ["item-sliding.css"],
|
|
751
|
-
"md": ["item-sliding.css"],
|
|
752
|
-
"ionic": ["item-sliding.css"]
|
|
788
|
+
"ios": ["item-sliding.ios.css"],
|
|
789
|
+
"md": ["item-sliding.md.css"],
|
|
790
|
+
"ionic": ["item-sliding.ionic.css"]
|
|
753
791
|
};
|
|
754
792
|
}
|
|
755
793
|
static get properties() {
|