@alfalab/core-components-with-suffix 4.0.21 → 4.0.22

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
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var tslib = require('tslib');
3
4
  var React = require('react');
4
5
  var mergeRefs = require('react-merge-refs');
5
6
  var cn = require('classnames');
@@ -11,52 +12,13 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
11
12
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
12
13
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
13
14
 
14
- /******************************************************************************
15
- Copyright (c) Microsoft Corporation.
16
-
17
- Permission to use, copy, modify, and/or distribute this software for any
18
- purpose with or without fee is hereby granted.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
- PERFORMANCE OF THIS SOFTWARE.
27
- ***************************************************************************** */
28
- var __assign = function () {
29
- __assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s)
33
- if (Object.prototype.hasOwnProperty.call(s, p))
34
- t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return __assign.apply(this, arguments);
39
- };
40
- function __rest(s, e) {
41
- var t = {};
42
- for (var p in s)
43
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
44
- t[p] = s[p];
45
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
46
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
47
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
48
- t[p[i]] = s[p[i]];
49
- }
50
- return t;
51
- }
52
-
53
- var styles = {"suffixContainer":"with-suffix__suffixContainer_u1fqp","suffixVisible":"with-suffix__suffixVisible_u1fqp","hasSuffix":"with-suffix__hasSuffix_u1fqp","spacer":"with-suffix__spacer_u1fqp","suffix":"with-suffix__suffix_u1fqp","disabled":"with-suffix__disabled_u1fqp","readOnly":"with-suffix__readOnly_u1fqp"};
15
+ var styles = {"suffixContainer":"with-suffix__suffixContainer_hv3es","suffixVisible":"with-suffix__suffixVisible_hv3es","hasSuffix":"with-suffix__hasSuffix_hv3es","spacer":"with-suffix__spacer_hv3es","suffix":"with-suffix__suffix_hv3es","disabled":"with-suffix__disabled_hv3es","readOnly":"with-suffix__readOnly_hv3es"};
54
16
  require('./index.css')
55
17
 
56
18
  var withSuffix = function (Input) {
57
19
  return React.forwardRef(function (_a, ref) {
58
20
  var _b, _c;
59
- var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _d = _a.suffix, suffix = _d === void 0 ? '' : _d, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = __rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
21
+ var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _d = _a.suffix, suffix = _d === void 0 ? '' : _d, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = tslib.__rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
60
22
  var uncontrolled = value === undefined;
61
23
  var inputRef = React.useRef(null);
62
24
  var _e = React.useState(defaultValue || ''), stateValue = _e[0], setStateValue = _e[1];
@@ -81,7 +43,7 @@ var withSuffix = function (Input) {
81
43
  function () { return inputRef.current.parentElement; }, []);
82
44
  var visibleValue = uncontrolled ? stateValue : value;
83
45
  return (React__default.default.createElement(React.Fragment, null,
84
- React__default.default.createElement(Input, __assign({ ref: mergeRefs__default.default([ref, inputRef]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
46
+ React__default.default.createElement(Input, tslib.__assign({ ref: mergeRefs__default.default([ref, inputRef]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
85
47
  _b[styles.suffixVisible] = Boolean(visibleValue),
86
48
  _b[styles.hasSuffix] = suffix,
87
49
  _b)) }, restProps)),
package/cssm/Component.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var tslib = require('tslib');
3
4
  var React = require('react');
4
5
  var mergeRefs = require('react-merge-refs');
5
6
  var cn = require('classnames');
@@ -13,49 +14,10 @@ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
13
14
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
14
15
  var styles__default = /*#__PURE__*/_interopDefaultCompat(styles);
15
16
 
16
- /******************************************************************************
17
- Copyright (c) Microsoft Corporation.
18
-
19
- Permission to use, copy, modify, and/or distribute this software for any
20
- purpose with or without fee is hereby granted.
21
-
22
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
25
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
26
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
27
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
- PERFORMANCE OF THIS SOFTWARE.
29
- ***************************************************************************** */
30
- var __assign = function () {
31
- __assign = Object.assign || function __assign(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s)
35
- if (Object.prototype.hasOwnProperty.call(s, p))
36
- t[p] = s[p];
37
- }
38
- return t;
39
- };
40
- return __assign.apply(this, arguments);
41
- };
42
- function __rest(s, e) {
43
- var t = {};
44
- for (var p in s)
45
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
46
- t[p] = s[p];
47
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
48
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
49
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
50
- t[p[i]] = s[p[i]];
51
- }
52
- return t;
53
- }
54
-
55
17
  var withSuffix = function (Input) {
56
18
  return React.forwardRef(function (_a, ref) {
57
19
  var _b, _c;
58
- var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _d = _a.suffix, suffix = _d === void 0 ? '' : _d, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = __rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
20
+ var value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, onClear = _a.onClear, _d = _a.suffix, suffix = _d === void 0 ? '' : _d, placeholder = _a.placeholder, className = _a.className, disabled = _a.disabled, readOnly = _a.readOnly, suffixContainerClassName = _a.suffixContainerClassName, restProps = tslib.__rest(_a, ["value", "defaultValue", "onChange", "onClear", "suffix", "placeholder", "className", "disabled", "readOnly", "suffixContainerClassName"]);
59
21
  var uncontrolled = value === undefined;
60
22
  var inputRef = React.useRef(null);
61
23
  var _e = React.useState(defaultValue || ''), stateValue = _e[0], setStateValue = _e[1];
@@ -80,7 +42,7 @@ var withSuffix = function (Input) {
80
42
  function () { return inputRef.current.parentElement; }, []);
81
43
  var visibleValue = uncontrolled ? stateValue : value;
82
44
  return (React__default.default.createElement(React.Fragment, null,
83
- React__default.default.createElement(Input, __assign({ ref: mergeRefs__default.default([ref, inputRef]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
45
+ React__default.default.createElement(Input, tslib.__assign({ ref: mergeRefs__default.default([ref, inputRef]), value: visibleValue, disabled: disabled, readOnly: readOnly, onChange: handleInputChange, onClear: handleClear, placeholder: placeholder, className: cn__default.default(className, (_b = {},
84
46
  _b[styles__default.default.suffixVisible] = Boolean(visibleValue),
85
47
  _b[styles__default.default.hasSuffix] = suffix,
86
48
  _b)) }, restProps)),
package/cssm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component = require('./Component.js');
4
+ require('tslib');
4
5
  require('react');
5
6
  require('react-merge-refs');
6
7
  require('classnames');
package/esm/Component.js CHANGED
@@ -1,48 +1,10 @@
1
+ import { __rest, __assign } from 'tslib';
1
2
  import React, { forwardRef, useRef, useState, useCallback, Fragment } from 'react';
2
3
  import mergeRefs from 'react-merge-refs';
3
4
  import cn from 'classnames';
4
5
  import { Portal } from '@alfalab/core-components-portal/esm';
5
6
 
6
- /******************************************************************************
7
- Copyright (c) Microsoft Corporation.
8
-
9
- Permission to use, copy, modify, and/or distribute this software for any
10
- purpose with or without fee is hereby granted.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
- PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */
20
- var __assign = function () {
21
- __assign = Object.assign || function __assign(t) {
22
- for (var s, i = 1, n = arguments.length; i < n; i++) {
23
- s = arguments[i];
24
- for (var p in s)
25
- if (Object.prototype.hasOwnProperty.call(s, p))
26
- t[p] = s[p];
27
- }
28
- return t;
29
- };
30
- return __assign.apply(this, arguments);
31
- };
32
- function __rest(s, e) {
33
- var t = {};
34
- for (var p in s)
35
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
36
- t[p] = s[p];
37
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
38
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
39
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
40
- t[p[i]] = s[p[i]];
41
- }
42
- return t;
43
- }
44
-
45
- var styles = {"suffixContainer":"with-suffix__suffixContainer_u1fqp","suffixVisible":"with-suffix__suffixVisible_u1fqp","hasSuffix":"with-suffix__hasSuffix_u1fqp","spacer":"with-suffix__spacer_u1fqp","suffix":"with-suffix__suffix_u1fqp","disabled":"with-suffix__disabled_u1fqp","readOnly":"with-suffix__readOnly_u1fqp"};
7
+ var styles = {"suffixContainer":"with-suffix__suffixContainer_hv3es","suffixVisible":"with-suffix__suffixVisible_hv3es","hasSuffix":"with-suffix__hasSuffix_hv3es","spacer":"with-suffix__spacer_hv3es","suffix":"with-suffix__suffix_hv3es","disabled":"with-suffix__disabled_hv3es","readOnly":"with-suffix__readOnly_hv3es"};
46
8
  require('./index.css')
47
9
 
48
10
  var withSuffix = function (Input) {
package/esm/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: oz8hn */
1
+ /* hash: 1gcyd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(11, 31, 53, 0.7);
@@ -28,7 +28,7 @@
28
28
  /* display */
29
29
 
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
- } .with-suffix__suffixContainer_u1fqp {
31
+ } .with-suffix__suffixContainer_hv3es {
32
32
  font-size: 16px;
33
33
  line-height: 20px;
34
34
  font-weight: 400;
@@ -40,20 +40,20 @@
40
40
  align-items: center;
41
41
  display: none;
42
42
  pointer-events: none;
43
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_u1fqp,
44
- .with-suffix__suffixVisible_u1fqp .with-suffix__suffixContainer_u1fqp {
43
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_hv3es,
44
+ .with-suffix__suffixVisible_hv3es .with-suffix__suffixContainer_hv3es {
45
45
  display: inline-flex;
46
- } .with-suffix__hasSuffix_u1fqp input:focus::placeholder {
46
+ } .with-suffix__hasSuffix_hv3es input:focus::placeholder {
47
47
  color: transparent;
48
48
  transition: none;
49
- } .with-suffix__spacer_u1fqp {
49
+ } .with-suffix__spacer_hv3es {
50
50
  visibility: hidden;
51
51
  flex-shrink: 0;
52
52
  white-space: pre;
53
- } .with-suffix__suffix_u1fqp {
53
+ } .with-suffix__suffix_hv3es {
54
54
  white-space: pre;
55
- } .with-suffix__disabled_u1fqp {
55
+ } .with-suffix__disabled_hv3es {
56
56
  color: var(--input-disabled-color);
57
- } .with-suffix__readOnly_u1fqp {
57
+ } .with-suffix__readOnly_hv3es {
58
58
  color: var(--input-read-only-color);
59
59
  }
package/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { withSuffix } from './Component.js';
2
+ import 'tslib';
2
3
  import 'react';
3
4
  import 'react-merge-refs';
4
5
  import 'classnames';
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: oz8hn */
1
+ /* hash: 1gcyd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(11, 31, 53, 0.7);
@@ -28,7 +28,7 @@
28
28
  /* display */
29
29
 
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
- } .with-suffix__suffixContainer_u1fqp {
31
+ } .with-suffix__suffixContainer_hv3es {
32
32
  font-size: 16px;
33
33
  line-height: 20px;
34
34
  font-weight: 400;
@@ -40,20 +40,20 @@
40
40
  align-items: center;
41
41
  display: none;
42
42
  pointer-events: none;
43
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_u1fqp,
44
- .with-suffix__suffixVisible_u1fqp .with-suffix__suffixContainer_u1fqp {
43
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_hv3es,
44
+ .with-suffix__suffixVisible_hv3es .with-suffix__suffixContainer_hv3es {
45
45
  display: inline-flex;
46
- } .with-suffix__hasSuffix_u1fqp input:focus::placeholder {
46
+ } .with-suffix__hasSuffix_hv3es input:focus::placeholder {
47
47
  color: transparent;
48
48
  transition: none;
49
- } .with-suffix__spacer_u1fqp {
49
+ } .with-suffix__spacer_hv3es {
50
50
  visibility: hidden;
51
51
  flex-shrink: 0;
52
52
  white-space: pre;
53
- } .with-suffix__suffix_u1fqp {
53
+ } .with-suffix__suffix_hv3es {
54
54
  white-space: pre;
55
- } .with-suffix__disabled_u1fqp {
55
+ } .with-suffix__disabled_hv3es {
56
56
  color: var(--input-disabled-color);
57
- } .with-suffix__readOnly_u1fqp {
57
+ } .with-suffix__readOnly_hv3es {
58
58
  color: var(--input-read-only-color);
59
59
  }
package/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Component = require('./Component.js');
4
+ require('tslib');
4
5
  require('react');
5
6
  require('react-merge-refs');
6
7
  require('classnames');
@@ -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_u1fqp","suffixVisible":"with-suffix__suffixVisible_u1fqp","hasSuffix":"with-suffix__hasSuffix_u1fqp","spacer":"with-suffix__spacer_u1fqp","suffix":"with-suffix__suffix_u1fqp","disabled":"with-suffix__disabled_u1fqp","readOnly":"with-suffix__readOnly_u1fqp"};
6
+ const styles = {"suffixContainer":"with-suffix__suffixContainer_hv3es","suffixVisible":"with-suffix__suffixVisible_hv3es","hasSuffix":"with-suffix__hasSuffix_hv3es","spacer":"with-suffix__spacer_hv3es","suffix":"with-suffix__suffix_hv3es","disabled":"with-suffix__disabled_hv3es","readOnly":"with-suffix__readOnly_hv3es"};
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) => {
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: oz8hn */
1
+ /* hash: 1gcyd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-secondary: rgba(11, 31, 53, 0.7);
@@ -28,7 +28,7 @@
28
28
  /* display */
29
29
 
30
30
  /* управляет видимостью иконки ошибки, если она стоит рядом с другой иконкой */
31
- } .with-suffix__suffixContainer_u1fqp {
31
+ } .with-suffix__suffixContainer_hv3es {
32
32
  font-size: 16px;
33
33
  line-height: 20px;
34
34
  font-weight: 400;
@@ -40,20 +40,20 @@
40
40
  align-items: center;
41
41
  display: none;
42
42
  pointer-events: none;
43
- } input:focus:not(:read-only) + .with-suffix__suffixContainer_u1fqp,
44
- .with-suffix__suffixVisible_u1fqp .with-suffix__suffixContainer_u1fqp {
43
+ } input:focus:not(:read-only) + .with-suffix__suffixContainer_hv3es,
44
+ .with-suffix__suffixVisible_hv3es .with-suffix__suffixContainer_hv3es {
45
45
  display: inline-flex;
46
- } .with-suffix__hasSuffix_u1fqp input:focus::placeholder {
46
+ } .with-suffix__hasSuffix_hv3es input:focus::placeholder {
47
47
  color: transparent;
48
48
  transition: none;
49
- } .with-suffix__spacer_u1fqp {
49
+ } .with-suffix__spacer_hv3es {
50
50
  visibility: hidden;
51
51
  flex-shrink: 0;
52
52
  white-space: pre;
53
- } .with-suffix__suffix_u1fqp {
53
+ } .with-suffix__suffix_hv3es {
54
54
  white-space: pre;
55
- } .with-suffix__disabled_u1fqp {
55
+ } .with-suffix__disabled_hv3es {
56
56
  color: var(--input-disabled-color);
57
- } .with-suffix__readOnly_u1fqp {
57
+ } .with-suffix__readOnly_hv3es {
58
58
  color: var(--input-read-only-color);
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-with-suffix",
3
- "version": "4.0.21",
3
+ "version": "4.0.22",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -17,9 +17,10 @@
17
17
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@alfalab/core-components-input": "^11.1.6",
21
- "@alfalab/core-components-portal": "^3.1.2",
20
+ "@alfalab/core-components-input": "^11.1.7",
21
+ "@alfalab/core-components-portal": "^3.1.3",
22
22
  "classnames": "^2.3.1",
23
- "react-merge-refs": "^1.1.0"
23
+ "react-merge-refs": "^1.1.0",
24
+ "tslib": "^2.4.0"
24
25
  }
25
26
  }