@onesy/ui-react 1.0.151 → 1.0.152
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/Transition/Transition.js +3 -9
- package/Transitions/Transitions.js +0 -3
- package/esm/Transition/Transition.js +3 -9
- package/esm/Transitions/Transitions.js +0 -3
- package/esm/index.js +1 -1
- package/esm/utils.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils.d.ts +1 -1
- package/utils.js +1 -1
package/Transition/Transition.js
CHANGED
|
@@ -195,9 +195,6 @@ const Transition = props_ => {
|
|
|
195
195
|
const add = async status_ => {
|
|
196
196
|
if (!add_ || refs.status.current !== status_) return;
|
|
197
197
|
updateStatus('add');
|
|
198
|
-
|
|
199
|
-
// Reflow
|
|
200
|
-
(0, _utils2.reflow)(refs.root.current);
|
|
201
198
|
await delay('add');
|
|
202
199
|
|
|
203
200
|
// Prevent update batches
|
|
@@ -212,9 +209,6 @@ const Transition = props_ => {
|
|
|
212
209
|
var _refs$status$current;
|
|
213
210
|
if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
|
|
214
211
|
updateStatus('enter');
|
|
215
|
-
|
|
216
|
-
// Reflow
|
|
217
|
-
(0, _utils2.reflow)(refs.root.current);
|
|
218
212
|
await delay('enter');
|
|
219
213
|
|
|
220
214
|
// Prevent update batches
|
|
@@ -227,9 +221,6 @@ const Transition = props_ => {
|
|
|
227
221
|
var _refs$status$current2;
|
|
228
222
|
if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
|
|
229
223
|
updateStatus('exit');
|
|
230
|
-
|
|
231
|
-
// Reflow
|
|
232
|
-
(0, _utils2.reflow)(refs.root.current);
|
|
233
224
|
await delay('exit');
|
|
234
225
|
|
|
235
226
|
// Prevent update batches
|
|
@@ -309,6 +300,9 @@ const Transition = props_ => {
|
|
|
309
300
|
className_ = className_.replace(/ +/g, ' ').trim();
|
|
310
301
|
if ((_refs$root$current$cl2 = refs.root.current.className) !== null && _refs$root$current$cl2 !== void 0 && _refs$root$current$cl2.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
|
|
311
302
|
}
|
|
303
|
+
|
|
304
|
+
// reflow
|
|
305
|
+
(0, _utils2.reflow)(refs.root.current);
|
|
312
306
|
};
|
|
313
307
|
if (status === 'removed') return null;
|
|
314
308
|
const value_ = {
|
|
@@ -43,9 +43,6 @@ const Transitions = props_ => {
|
|
|
43
43
|
};
|
|
44
44
|
refs.element.current = element;
|
|
45
45
|
refs.status.current = status;
|
|
46
|
-
|
|
47
|
-
// No transition controll
|
|
48
|
-
// bug solve in nextjs
|
|
49
46
|
_react.default.useEffect(() => {
|
|
50
47
|
if (id !== undefined) {
|
|
51
48
|
if (id !== refs.id.current) {
|
|
@@ -184,9 +184,6 @@ const Transition = props_ => {
|
|
|
184
184
|
const add = async status_ => {
|
|
185
185
|
if (!add_ || refs.status.current !== status_) return;
|
|
186
186
|
updateStatus('add');
|
|
187
|
-
|
|
188
|
-
// Reflow
|
|
189
|
-
reflow(refs.root.current);
|
|
190
187
|
await delay('add');
|
|
191
188
|
|
|
192
189
|
// Prevent update batches
|
|
@@ -200,9 +197,6 @@ const Transition = props_ => {
|
|
|
200
197
|
const enter = async status_ => {
|
|
201
198
|
if (!enter_ || status_ !== 'appended' && (refs.status.current !== status_ || !refs.inProp.current)) return;
|
|
202
199
|
updateStatus('enter');
|
|
203
|
-
|
|
204
|
-
// Reflow
|
|
205
|
-
reflow(refs.root.current);
|
|
206
200
|
await delay('enter');
|
|
207
201
|
|
|
208
202
|
// Prevent update batches
|
|
@@ -214,9 +208,6 @@ const Transition = props_ => {
|
|
|
214
208
|
const exit = async status_ => {
|
|
215
209
|
if (!exit_ || refs.status.current !== status_ || refs.inProp.current) return;
|
|
216
210
|
updateStatus('exit');
|
|
217
|
-
|
|
218
|
-
// Reflow
|
|
219
|
-
reflow(refs.root.current);
|
|
220
211
|
await delay('exit');
|
|
221
212
|
|
|
222
213
|
// Prevent update batches
|
|
@@ -295,6 +286,9 @@ const Transition = props_ => {
|
|
|
295
286
|
className_ = className_.replace(/ +/g, ' ').trim();
|
|
296
287
|
if (refs.root.current.className?.baseVal) refs.root.current.className.baseVal = className_;else refs.root.current.className = className_;
|
|
297
288
|
}
|
|
289
|
+
|
|
290
|
+
// reflow
|
|
291
|
+
reflow(refs.root.current);
|
|
298
292
|
};
|
|
299
293
|
if (status === 'removed') return null;
|
|
300
294
|
const value_ = {
|
package/esm/index.js
CHANGED
package/esm/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { is, canvasFilterBrightness, canvasFilterContrast, canvasFilterSaturation, canvasFilterFade, canvasFilterInvert, canvasFilterOldPhoto, download, clamp, isEnvironment } from '@onesy/utils';
|
|
2
2
|
export function reflow(element) {
|
|
3
|
-
element?.offsetHeight;
|
|
3
|
+
return element?.offsetHeight;
|
|
4
4
|
}
|
|
5
5
|
export const staticClassName = (name, theme) => {
|
|
6
6
|
return theme?.ui?.elements?.[`onesy-${name}`]?.className?.static !== undefined ? theme?.ui?.elements?.[`onesy-${name}`]?.className?.static : theme?.ui?.className.static;
|
package/index.js
CHANGED
package/package.json
CHANGED
package/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IPoint } from './types';
|
|
2
|
-
export declare function reflow(element: HTMLElement):
|
|
2
|
+
export declare function reflow(element: HTMLElement): number;
|
|
3
3
|
export declare const staticClassName: (name: string, theme: any) => any;
|
|
4
4
|
export declare const iconSizeToFontSize: (value: string | number) => any;
|
|
5
5
|
export declare const valueBreakpoints: (item: any, value: any, breakpoints: any, theme: any) => any;
|
package/utils.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.reflow = reflow;
|
|
|
8
8
|
exports.valueBreakpoints = exports.toNumber = exports.staticClassName = exports.save = exports.sanitize = exports.replace = void 0;
|
|
9
9
|
var _utils = require("@onesy/utils");
|
|
10
10
|
function reflow(element) {
|
|
11
|
-
element === null || element === void 0
|
|
11
|
+
return element === null || element === void 0 ? void 0 : element.offsetHeight;
|
|
12
12
|
}
|
|
13
13
|
const staticClassName = (name, theme) => {
|
|
14
14
|
var _theme$ui, _theme$ui2, _theme$ui3;
|