@salutejs/plasma-new-hope 0.251.0-canary.1730.13052948140.0 → 0.251.1-canary.1712.13062616456.0
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/cjs/components/Autocomplete/Autocomplete.css +30 -30
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +30 -30
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +30 -30
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +30 -30
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +30 -30
- package/cjs/components/Pagination/Pagination.css +30 -30
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +30 -30
- package/cjs/components/Portal/Portal.js +5 -1
- package/cjs/components/Portal/Portal.js.map +1 -1
- package/cjs/components/Range/Range.css +30 -30
- package/cjs/components/Select/Select.css +30 -30
- package/cjs/components/Select/ui/Target/Target.css +30 -30
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +30 -30
- package/cjs/components/Slider/Slider.css +30 -30
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +30 -30
- package/cjs/components/TextField/TextField.styles.js +42 -42
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/TextField.styles_kh1zhz.css +22 -0
- package/cjs/components/TextField/ui/Hint/Hint.css +20 -20
- package/cjs/components/TextField/variations/_clear/base.js +1 -1
- package/cjs/components/TextField/variations/_clear/base_gm5pwg.css +1 -0
- package/cjs/components/TextField/variations/_disabled/base.js +1 -1
- package/{es/components/TextField/variations/_disabled/base_2tv0nz.css → cjs/components/TextField/variations/_disabled/base_4d3opa.css} +1 -1
- package/cjs/components/TextField/variations/_hint-size/base.js +1 -1
- package/{es/components/TextField/variations/_hint-size/base_z7a2uf.css → cjs/components/TextField/variations/_hint-size/base_1x99605.css} +1 -1
- package/cjs/components/TextField/variations/_hint-view/base.js +1 -1
- package/cjs/components/TextField/variations/_hint-view/{base_1htnb8e.css → base_l8etux.css} +1 -1
- package/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/cjs/components/TextField/variations/_label-placement/base_if7w35.css +1 -0
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base_17ypmu7.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base_7va3kt.css +1 -0
- package/cjs/components/TextField/variations/_view/base.js +1 -1
- package/cjs/components/TextField/variations/_view/base_1uzaktg.css +1 -0
- package/cjs/components/TextFieldGroup/TextFieldGroup.css +1 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base.js +1 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base_52bndd.css +1 -0
- package/cjs/components/Toast/ToastController.js +1 -13
- package/cjs/components/Toast/ToastController.js.map +1 -1
- package/cjs/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/cjs/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
- package/cjs/index.css +29 -29
- package/emotion/cjs/components/Portal/Portal.js +5 -1
- package/emotion/cjs/components/TextField/TextField.styles.js +44 -45
- package/emotion/cjs/components/Toast/ToastController.js +3 -16
- package/emotion/cjs/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/emotion/es/components/Portal/Portal.js +5 -1
- package/emotion/es/components/TextField/TextField.styles.js +44 -45
- package/emotion/es/components/Toast/ToastController.js +2 -14
- package/emotion/es/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/es/components/Autocomplete/Autocomplete.css +30 -30
- package/es/components/Combobox/ComboboxNew/Combobox.css +30 -30
- package/es/components/DatePicker/RangeDate/RangeDate.css +30 -30
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +30 -30
- package/es/components/DatePicker/SingleDate/SingleDate.css +30 -30
- package/es/components/Pagination/Pagination.css +30 -30
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +30 -30
- package/es/components/Portal/Portal.js +5 -1
- package/es/components/Portal/Portal.js.map +1 -1
- package/es/components/Range/Range.css +30 -30
- package/es/components/Select/Select.css +30 -30
- package/es/components/Select/ui/Target/Target.css +30 -30
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +30 -30
- package/es/components/Slider/Slider.css +30 -30
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +30 -30
- package/es/components/TextField/TextField.styles.js +42 -42
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/TextField.styles_kh1zhz.css +22 -0
- package/es/components/TextField/ui/Hint/Hint.css +20 -20
- package/es/components/TextField/variations/_clear/base.js +1 -1
- package/es/components/TextField/variations/_clear/base_gm5pwg.css +1 -0
- package/es/components/TextField/variations/_disabled/base.js +1 -1
- package/{cjs/components/TextField/variations/_disabled/base_2tv0nz.css → es/components/TextField/variations/_disabled/base_4d3opa.css} +1 -1
- package/es/components/TextField/variations/_hint-size/base.js +1 -1
- package/{cjs/components/TextField/variations/_hint-size/base_z7a2uf.css → es/components/TextField/variations/_hint-size/base_1x99605.css} +1 -1
- package/es/components/TextField/variations/_hint-view/base.js +1 -1
- package/es/components/TextField/variations/_hint-view/{base_1htnb8e.css → base_l8etux.css} +1 -1
- package/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/es/components/TextField/variations/_label-placement/base_if7w35.css +1 -0
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base_17ypmu7.css +1 -0
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base_7va3kt.css +1 -0
- package/es/components/TextField/variations/_view/base.js +1 -1
- package/es/components/TextField/variations/_view/base_1uzaktg.css +1 -0
- package/es/components/TextFieldGroup/TextFieldGroup.css +1 -1
- package/es/components/TextFieldGroup/variations/_shape/base.js +1 -1
- package/es/components/TextFieldGroup/variations/_shape/base_52bndd.css +1 -0
- package/es/components/Toast/ToastController.js +2 -14
- package/es/components/Toast/ToastController.js.map +1 -1
- package/es/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/es/components/Toast/ToastProvider/ToastProvider.js.map +1 -1
- package/es/index.css +29 -29
- package/package.json +2 -2
- package/styled-components/cjs/components/Portal/Portal.js +5 -1
- package/styled-components/cjs/components/TextField/TextField.styles.js +22 -23
- package/styled-components/cjs/components/Toast/ToastController.js +3 -16
- package/styled-components/cjs/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/styled-components/es/components/Portal/Portal.js +5 -1
- package/styled-components/es/components/TextField/TextField.styles.js +22 -23
- package/styled-components/es/components/Toast/ToastController.js +2 -14
- package/styled-components/es/components/Toast/ToastProvider/ToastProvider.js +16 -3
- package/types/components/Portal/Portal.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +1 -1
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/Toast/ToastController.d.ts.map +1 -1
- package/types/components/Toast/ToastProvider/ToastProvider.d.ts.map +1 -1
- package/cjs/components/TextField/TextField.styles_1cdp5eg.css +0 -22
- package/cjs/components/TextField/variations/_clear/base_appgl3.css +0 -1
- package/cjs/components/TextField/variations/_label-placement/base_jfnl8i.css +0 -1
- package/cjs/components/TextField/variations/_read-only/base_oizdmx.css +0 -1
- package/cjs/components/TextField/variations/_size/base_uulqii.css +0 -1
- package/cjs/components/TextField/variations/_view/base_1npz45o.css +0 -1
- package/cjs/components/TextFieldGroup/variations/_shape/base_1e0je21.css +0 -1
- package/es/components/TextField/TextField.styles_1cdp5eg.css +0 -22
- package/es/components/TextField/variations/_clear/base_appgl3.css +0 -1
- package/es/components/TextField/variations/_label-placement/base_jfnl8i.css +0 -1
- package/es/components/TextField/variations/_read-only/base_oizdmx.css +0 -1
- package/es/components/TextField/variations/_size/base_uulqii.css +0 -1
- package/es/components/TextField/variations/_view/base_1npz45o.css +0 -1
- package/es/components/TextFieldGroup/variations/_shape/base_1e0je21.css +0 -1
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.ToastControllerHoc = void 0;
|
8
|
-
var _react = /*#__PURE__*/
|
8
|
+
var _react = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("react"));
|
9
9
|
var _Toast = /*#__PURE__*/require("./Toast.tokens");
|
10
10
|
var _Toast2 = /*#__PURE__*/require("./Toast.styles");
|
11
11
|
var _ToastProvider = /*#__PURE__*/require("./ToastProvider");
|
12
12
|
var _utils = /*#__PURE__*/require("./utils");
|
13
13
|
var _excluded = ["position", "offset", "fade", "text"];
|
14
|
-
function
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
16
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
17
16
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
18
17
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -30,9 +29,7 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
|
|
30
29
|
rest = _objectWithoutProperties(props, _excluded);
|
31
30
|
var _useToastInner = (0, _ToastProvider.useToastInner)(),
|
32
31
|
hideToast = _useToastInner.hideToast,
|
33
|
-
isVisible = _useToastInner.isVisible
|
34
|
-
hideTimeout = _useToastInner.hideTimeout,
|
35
|
-
animationRunTimeout = _useToastInner.animationRunTimeout;
|
32
|
+
isVisible = _useToastInner.isVisible;
|
36
33
|
var toastKey = "".concat(text).concat(position);
|
37
34
|
var showedClass = isVisible ? _Toast.classes.toastShowed : _Toast.classes.toastHidden;
|
38
35
|
var showedFadeClass = isVisible ? _Toast.classes.toastFadeShowed : _Toast.classes.toastFadeHidden;
|
@@ -40,16 +37,6 @@ var ToastControllerHoc = exports.ToastControllerHoc = function ToastControllerHo
|
|
40
37
|
text: text,
|
41
38
|
onCloseButtonClick: hideToast
|
42
39
|
}, rest);
|
43
|
-
(0, _react.useEffect)(function () {
|
44
|
-
return function () {
|
45
|
-
if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
|
46
|
-
clearTimeout(hideTimeout.current);
|
47
|
-
}
|
48
|
-
if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
|
49
|
-
clearTimeout(animationRunTimeout.current);
|
50
|
-
}
|
51
|
-
};
|
52
|
-
}, []);
|
53
40
|
if (!text) {
|
54
41
|
return null;
|
55
42
|
}
|
@@ -153,13 +153,13 @@ var ToastProviderHoc = exports.ToastProviderHoc = function ToastProviderHoc(Toas
|
|
153
153
|
var onHide = toastInfo.onHide,
|
154
154
|
timeout = toastInfo.timeout;
|
155
155
|
var hideToast = (0, _react.useCallback)(function () {
|
156
|
-
if (!isVisible) {
|
157
|
-
return;
|
158
|
-
}
|
159
156
|
if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
|
160
157
|
clearTimeout(hideTimeout.current);
|
161
158
|
hideTimeout.current = null;
|
162
159
|
}
|
160
|
+
if (!isVisible) {
|
161
|
+
return;
|
162
|
+
}
|
163
163
|
onHide === null || onHide === void 0 || onHide();
|
164
164
|
setIsVisible(false);
|
165
165
|
animationRunTimeout.current = setTimeout(function () {
|
@@ -172,13 +172,26 @@ var ToastProviderHoc = exports.ToastProviderHoc = function ToastProviderHoc(Toas
|
|
172
172
|
clearTimeout(animationRunTimeout.current);
|
173
173
|
animationRunTimeout.current = null;
|
174
174
|
}
|
175
|
+
return function () {
|
176
|
+
if (animationRunTimeout !== null && animationRunTimeout !== void 0 && animationRunTimeout.current) {
|
177
|
+
clearTimeout(animationRunTimeout.current);
|
178
|
+
}
|
179
|
+
};
|
175
180
|
}, [timeout]);
|
181
|
+
|
182
|
+
// очистка таймаутов перенесена из ToastController, т. к. в StrictМоde react делает дополнительный unmount
|
176
183
|
(0, _react.useEffect)(function () {
|
177
184
|
if (timeout && isVisible) {
|
178
185
|
hideTimeout.current = setTimeout(function () {
|
179
186
|
hideToast();
|
180
187
|
}, timeout);
|
181
188
|
}
|
189
|
+
return function () {
|
190
|
+
if (hideTimeout !== null && hideTimeout !== void 0 && hideTimeout.current) {
|
191
|
+
clearTimeout(hideTimeout.current);
|
192
|
+
hideTimeout.current = null;
|
193
|
+
}
|
194
|
+
};
|
182
195
|
}, [isVisible, timeout]);
|
183
196
|
return /*#__PURE__*/_react["default"].createElement(ToastContext.Provider, {
|
184
197
|
value: {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import ReactDOM from 'react-dom';
|
3
|
+
import { canUseDOM } from '../../utils';
|
3
4
|
/**
|
4
5
|
* Вспомогательный компонент. Используется в Popup, Popover.
|
5
6
|
* Представляет собой ReactDOM.createPortal() в форме компонента.
|
@@ -9,6 +10,9 @@ export var Portal = function Portal(_ref) {
|
|
9
10
|
container = _ref.container,
|
10
11
|
_ref$disabled = _ref.disabled,
|
11
12
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
13
|
+
if (!canUseDOM) {
|
14
|
+
return null;
|
15
|
+
}
|
12
16
|
var portalContainer = typeof container === 'function' ? container() : container;
|
13
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, disabled || !portalContainer
|
17
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (disabled || !portalContainer) && children, !disabled && portalContainer && /*#__PURE__*/ReactDOM.createPortal(children, portalContainer));
|
14
18
|
};
|