@alfalab/core-components-with-suffix 4.1.1 → 4.1.2

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/Component.js CHANGED
@@ -14,7 +14,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
14
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
15
15
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
16
16
 
17
- var styles = {"suffixContainer":"with-suffix__suffixContainer_1yd32","suffixVisible":"with-suffix__suffixVisible_1yd32","hasSuffix":"with-suffix__hasSuffix_1yd32","spacer":"with-suffix__spacer_1yd32","suffix":"with-suffix__suffix_1yd32","disabled":"with-suffix__disabled_1yd32","readOnly":"with-suffix__readOnly_1yd32"};
17
+ var styles = {"suffixContainer":"with-suffix__suffixContainer_1u5qu","suffixVisible":"with-suffix__suffixVisible_1u5qu","hasSuffix":"with-suffix__hasSuffix_1u5qu","spacer":"with-suffix__spacer_1u5qu","suffix":"with-suffix__suffix_1u5qu","disabled":"with-suffix__disabled_1u5qu","readOnly":"with-suffix__readOnly_1u5qu"};
18
18
  require('./index.css')
19
19
 
20
20
  var withSuffix = function (Input) {
@@ -42,7 +42,7 @@ var withSuffix = function (Input) {
42
42
  }, [onClear, uncontrolled]);
43
43
  var getPortalContainer = React.useCallback(
44
44
  // TODO: Изменить сигнатуру getPortalContainer в Portal
45
- function () { return inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement; }, [inputNode]);
45
+ function () { return ((inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement) || null); }, [inputNode]);
46
46
  var visibleValue = uncontrolled ? stateValue : value;
47
47
  return (React__default.default.createElement(React.Fragment, null,
48
48
  React__default.default.createElement(Input, tslib.__assign({ ref: mergeRefs__default.default([ref, setInputNode]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
package/cssm/Component.js CHANGED
@@ -41,7 +41,7 @@ var withSuffix = function (Input) {
41
41
  }, [onClear, uncontrolled]);
42
42
  var getPortalContainer = React.useCallback(
43
43
  // TODO: Изменить сигнатуру getPortalContainer в Portal
44
- function () { return inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement; }, [inputNode]);
44
+ function () { return ((inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement) || null); }, [inputNode]);
45
45
  var visibleValue = uncontrolled ? stateValue : value;
46
46
  return (React__default.default.createElement(React.Fragment, null,
47
47
  React__default.default.createElement(Input, tslib.__assign({ ref: mergeRefs__default.default([ref, setInputNode]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
package/esm/Component.js CHANGED
@@ -4,7 +4,7 @@ import mergeRefs from 'react-merge-refs';
4
4
  import cn from 'classnames';
5
5
  import { Portal } from '@alfalab/core-components-portal/esm';
6
6
 
7
- var styles = {"suffixContainer":"with-suffix__suffixContainer_1yd32","suffixVisible":"with-suffix__suffixVisible_1yd32","hasSuffix":"with-suffix__hasSuffix_1yd32","spacer":"with-suffix__spacer_1yd32","suffix":"with-suffix__suffix_1yd32","disabled":"with-suffix__disabled_1yd32","readOnly":"with-suffix__readOnly_1yd32"};
7
+ var styles = {"suffixContainer":"with-suffix__suffixContainer_1u5qu","suffixVisible":"with-suffix__suffixVisible_1u5qu","hasSuffix":"with-suffix__hasSuffix_1u5qu","spacer":"with-suffix__spacer_1u5qu","suffix":"with-suffix__suffix_1u5qu","disabled":"with-suffix__disabled_1u5qu","readOnly":"with-suffix__readOnly_1u5qu"};
8
8
  require('./index.css')
9
9
 
10
10
  var withSuffix = function (Input) {
@@ -32,7 +32,7 @@ var withSuffix = function (Input) {
32
32
  }, [onClear, uncontrolled]);
33
33
  var getPortalContainer = useCallback(
34
34
  // TODO: Изменить сигнатуру getPortalContainer в Portal
35
- function () { return inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement; }, [inputNode]);
35
+ function () { return ((inputNode === null || inputNode === void 0 ? void 0 : inputNode.parentElement) || null); }, [inputNode]);
36
36
  var visibleValue = uncontrolled ? stateValue : value;
37
37
  return (React.createElement(Fragment, null,
38
38
  React.createElement(Input, __assign({ ref: mergeRefs([ref, setInputNode]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn(className, (_b = {},
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7xgc8 */
1
+ /* hash: 1b9y2 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(60, 60, 67, 0.66); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -30,7 +30,7 @@
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
31
 
32
32
  /* mobile */
33
- } .with-suffix__suffixContainer_1yd32 {
33
+ } .with-suffix__suffixContainer_1u5qu {
34
34
  font-size: 16px;
35
35
  line-height: 20px;
36
36
  font-weight: 400;
@@ -42,20 +42,20 @@
42
42
  align-items: center;
43
43
  display: none;
44
44
  pointer-events: none;
45
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_1yd32,
46
- .with-suffix__suffixVisible_1yd32 .with-suffix__suffixContainer_1yd32 {
45
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_1u5qu,
46
+ .with-suffix__suffixVisible_1u5qu .with-suffix__suffixContainer_1u5qu {
47
47
  display: inline-flex;
48
- } .with-suffix__hasSuffix_1yd32 input:focus::placeholder {
48
+ } .with-suffix__hasSuffix_1u5qu input:focus::placeholder {
49
49
  color: transparent;
50
50
  transition: none;
51
- } .with-suffix__spacer_1yd32 {
51
+ } .with-suffix__spacer_1u5qu {
52
52
  visibility: hidden;
53
53
  flex-shrink: 0;
54
54
  white-space: pre;
55
- } .with-suffix__suffix_1yd32 {
55
+ } .with-suffix__suffix_1u5qu {
56
56
  white-space: pre;
57
- } .with-suffix__disabled_1yd32 {
57
+ } .with-suffix__disabled_1u5qu {
58
58
  color: var(--input-disabled-color);
59
- } .with-suffix__readOnly_1yd32 {
59
+ } .with-suffix__readOnly_1u5qu {
60
60
  color: var(--input-read-only-color);
61
61
  }
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7xgc8 */
1
+ /* hash: 1b9y2 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(60, 60, 67, 0.66); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -30,7 +30,7 @@
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
31
 
32
32
  /* mobile */
33
- } .with-suffix__suffixContainer_1yd32 {
33
+ } .with-suffix__suffixContainer_1u5qu {
34
34
  font-size: 16px;
35
35
  line-height: 20px;
36
36
  font-weight: 400;
@@ -42,20 +42,20 @@
42
42
  align-items: center;
43
43
  display: none;
44
44
  pointer-events: none;
45
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_1yd32,
46
- .with-suffix__suffixVisible_1yd32 .with-suffix__suffixContainer_1yd32 {
45
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_1u5qu,
46
+ .with-suffix__suffixVisible_1u5qu .with-suffix__suffixContainer_1u5qu {
47
47
  display: inline-flex;
48
- } .with-suffix__hasSuffix_1yd32 input:focus::placeholder {
48
+ } .with-suffix__hasSuffix_1u5qu input:focus::placeholder {
49
49
  color: transparent;
50
50
  transition: none;
51
- } .with-suffix__spacer_1yd32 {
51
+ } .with-suffix__spacer_1u5qu {
52
52
  visibility: hidden;
53
53
  flex-shrink: 0;
54
54
  white-space: pre;
55
- } .with-suffix__suffix_1yd32 {
55
+ } .with-suffix__suffix_1u5qu {
56
56
  white-space: pre;
57
- } .with-suffix__disabled_1yd32 {
57
+ } .with-suffix__disabled_1u5qu {
58
58
  color: var(--input-disabled-color);
59
- } .with-suffix__readOnly_1yd32 {
59
+ } .with-suffix__readOnly_1u5qu {
60
60
  color: var(--input-read-only-color);
61
61
  }
@@ -3,7 +3,7 @@ import mergeRefs from 'react-merge-refs';
3
3
  import cn from 'classnames';
4
4
  import { Portal } from '@alfalab/core-components-portal/modern';
5
5
 
6
- const styles = {"suffixContainer":"with-suffix__suffixContainer_1yd32","suffixVisible":"with-suffix__suffixVisible_1yd32","hasSuffix":"with-suffix__hasSuffix_1yd32","spacer":"with-suffix__spacer_1yd32","suffix":"with-suffix__suffix_1yd32","disabled":"with-suffix__disabled_1yd32","readOnly":"with-suffix__readOnly_1yd32"};
6
+ const styles = {"suffixContainer":"with-suffix__suffixContainer_1u5qu","suffixVisible":"with-suffix__suffixVisible_1u5qu","hasSuffix":"with-suffix__hasSuffix_1u5qu","spacer":"with-suffix__spacer_1u5qu","suffix":"with-suffix__suffix_1u5qu","disabled":"with-suffix__disabled_1u5qu","readOnly":"with-suffix__readOnly_1u5qu"};
7
7
  require('./index.css')
8
8
 
9
9
  const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onClear, suffix = '', placeholder, className, disabled, readOnly, suffixContainerClassName, ...restProps }, ref) => {
@@ -28,7 +28,7 @@ const withSuffix = (Input) => forwardRef(({ value, defaultValue, onChange, onCle
28
28
  }, [onClear, uncontrolled]);
29
29
  const getPortalContainer = useCallback(
30
30
  // TODO: Изменить сигнатуру getPortalContainer в Portal
31
- () => inputNode?.parentElement, [inputNode]);
31
+ () => (inputNode?.parentElement || null), [inputNode]);
32
32
  const visibleValue = uncontrolled ? stateValue : value;
33
33
  return (React.createElement(Fragment, null,
34
34
  React.createElement(Input, { ref: mergeRefs([ref, setInputNode]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn(className, {
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 7xgc8 */
1
+ /* hash: 1b9y2 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(60, 60, 67, 0.66); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -30,7 +30,7 @@
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
31
 
32
32
  /* mobile */
33
- } .with-suffix__suffixContainer_1yd32 {
33
+ } .with-suffix__suffixContainer_1u5qu {
34
34
  font-size: 16px;
35
35
  line-height: 20px;
36
36
  font-weight: 400;
@@ -42,20 +42,20 @@
42
42
  align-items: center;
43
43
  display: none;
44
44
  pointer-events: none;
45
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_1yd32,
46
- .with-suffix__suffixVisible_1yd32 .with-suffix__suffixContainer_1yd32 {
45
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_1u5qu,
46
+ .with-suffix__suffixVisible_1u5qu .with-suffix__suffixContainer_1u5qu {
47
47
  display: inline-flex;
48
- } .with-suffix__hasSuffix_1yd32 input:focus::placeholder {
48
+ } .with-suffix__hasSuffix_1u5qu input:focus::placeholder {
49
49
  color: transparent;
50
50
  transition: none;
51
- } .with-suffix__spacer_1yd32 {
51
+ } .with-suffix__spacer_1u5qu {
52
52
  visibility: hidden;
53
53
  flex-shrink: 0;
54
54
  white-space: pre;
55
- } .with-suffix__suffix_1yd32 {
55
+ } .with-suffix__suffix_1u5qu {
56
56
  white-space: pre;
57
- } .with-suffix__disabled_1yd32 {
57
+ } .with-suffix__disabled_1u5qu {
58
58
  color: var(--input-disabled-color);
59
- } .with-suffix__readOnly_1yd32 {
59
+ } .with-suffix__readOnly_1u5qu {
60
60
  color: var(--input-read-only-color);
61
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-with-suffix",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-input": "^12.0.1",
17
+ "@alfalab/core-components-input": "^12.0.2",
18
18
  "@alfalab/core-components-portal": "^3.2.0",
19
19
  "classnames": "^2.3.1",
20
20
  "react-merge-refs": "^1.1.0",
package/src/Component.tsx CHANGED
@@ -81,7 +81,7 @@ export const withSuffix = (Input: FC<InputProps & RefAttributes<HTMLInputElement
81
81
 
82
82
  const getPortalContainer = useCallback(
83
83
  // TODO: Изменить сигнатуру getPortalContainer в Portal
84
- () => inputNode?.parentElement as HTMLElement,
84
+ () => (inputNode?.parentElement || null) as HTMLElement,
85
85
  [inputNode],
86
86
  );
87
87