@ozen-ui/kit 0.9.0 → 0.9.1
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/__inner__/cjs/components/FieldInput/FieldInput.js +2 -1
- package/__inner__/cjs/components/FieldLabel/FieldLabel.js +2 -1
- package/__inner__/cjs/components/InputNumber/InputNumber.css +1 -0
- package/__inner__/esm/components/FieldInput/FieldInput.js +3 -2
- package/__inner__/esm/components/FieldLabel/FieldLabel.js +3 -2
- package/__inner__/esm/components/InputNumber/InputNumber.css +1 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ exports.FieldInput = exports.cnFieldInput = exports.FIELD_INPUT_DEFAULT_TAG = vo
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var useControlled_1 = require("../../hooks/useControlled");
|
|
7
|
+
var useIsomorphicEffect_1 = require("../../hooks/useIsomorphicEffect");
|
|
7
8
|
var classname_1 = require("../../utils/classname");
|
|
8
9
|
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
|
|
9
10
|
var FieldControl_1 = require("../FieldControl");
|
|
@@ -31,7 +32,7 @@ exports.FieldInput = (0, polymorphicComponentWithRef_1.polymorphicComponentWithR
|
|
|
31
32
|
disabled = fieldControl.disabled;
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
(0,
|
|
35
|
+
(0, useIsomorphicEffect_1.useIsomorphicEffect)(function () {
|
|
35
36
|
setFieldControl(function (prevState) { return (tslib_1.__assign(tslib_1.__assign({}, prevState), { filled: filled, focused: focused, value: valueState })); });
|
|
36
37
|
}, [filled, focused, valueState]);
|
|
37
38
|
var handleChange = (0, react_1.useCallback)(function (e) {
|
|
@@ -4,6 +4,7 @@ exports.FieldLabel = exports.cnFieldLabel = exports.FIELD_LABEL_DEFAULT_TAG = vo
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("./FieldLabel.css");
|
|
6
6
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
7
|
+
var useIsomorphicEffect_1 = require("../../hooks/useIsomorphicEffect");
|
|
7
8
|
var classname_1 = require("../../utils/classname");
|
|
8
9
|
var FieldControl_1 = require("../FieldControl");
|
|
9
10
|
exports.FIELD_LABEL_DEFAULT_TAG = 'span';
|
|
@@ -18,7 +19,7 @@ exports.FieldLabel = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
18
19
|
var disabled = disabledProp;
|
|
19
20
|
var focused = focusedProp;
|
|
20
21
|
var filled = filledProp;
|
|
21
|
-
(0,
|
|
22
|
+
(0, useIsomorphicEffect_1.useIsomorphicEffect)(function () {
|
|
22
23
|
setFieldControl(function (prevState) { return (tslib_1.__assign(tslib_1.__assign({}, prevState), { label: children })); });
|
|
23
24
|
}, [children]);
|
|
24
25
|
if (!children) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
|
-
import React, { useCallback, useContext, useState
|
|
2
|
+
import React, { useCallback, useContext, useState } from 'react';
|
|
3
3
|
import { useControlled } from '../../hooks/useControlled';
|
|
4
|
+
import { useIsomorphicEffect } from '../../hooks/useIsomorphicEffect';
|
|
4
5
|
import { cn } from '../../utils/classname';
|
|
5
6
|
import { polymorphicComponentWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
6
7
|
import { FieldControlContext } from '../FieldControl';
|
|
@@ -28,7 +29,7 @@ export var FieldInput = polymorphicComponentWithRef(function (_a, ref) {
|
|
|
28
29
|
disabled = fieldControl.disabled;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
+
useIsomorphicEffect(function () {
|
|
32
33
|
setFieldControl(function (prevState) { return (__assign(__assign({}, prevState), { filled: filled, focused: focused, value: valueState })); });
|
|
33
34
|
}, [filled, focused, valueState]);
|
|
34
35
|
var handleChange = useCallback(function (e) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __assign, __read } from "tslib";
|
|
2
2
|
import './FieldLabel.css';
|
|
3
|
-
import React, { forwardRef, useContext
|
|
3
|
+
import React, { forwardRef, useContext } from 'react';
|
|
4
|
+
import { useIsomorphicEffect } from '../../hooks/useIsomorphicEffect';
|
|
4
5
|
import { cn } from '../../utils/classname';
|
|
5
6
|
import { FieldControlContext } from '../FieldControl';
|
|
6
7
|
export var FIELD_LABEL_DEFAULT_TAG = 'span';
|
|
@@ -15,7 +16,7 @@ export var FieldLabel = forwardRef(function (_a, ref) {
|
|
|
15
16
|
var disabled = disabledProp;
|
|
16
17
|
var focused = focusedProp;
|
|
17
18
|
var filled = filledProp;
|
|
18
|
-
|
|
19
|
+
useIsomorphicEffect(function () {
|
|
19
20
|
setFieldControl(function (prevState) { return (__assign(__assign({}, prevState), { label: children })); });
|
|
20
21
|
}, [children]);
|
|
21
22
|
if (!children) {
|