@semcore/input 3.5.9 → 3.5.11
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/CHANGELOG.md +2 -2
- package/lib/cjs/Input.js +27 -39
- package/lib/cjs/Input.js.map +1 -1
- package/lib/es6/Input.js +19 -28
- package/lib/es6/Input.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [3.5.
|
|
5
|
+
## [3.5.11] - 2023-03-13
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
-
- Version patch update due to children dependencies update (`@semcore/utils` [3.
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.47.1 ~> 3.47.2], `@semcore/flex-box` [4.7.10 ~> 4.7.11]).
|
|
10
10
|
|
|
11
11
|
## [3.5.8] - 2023-02-09
|
|
12
12
|
|
package/lib/cjs/Input.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
|
+
|
|
12
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
15
|
|
|
14
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -17,9 +19,7 @@ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
17
19
|
|
|
18
20
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
21
|
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
22
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
23
23
|
|
|
24
24
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
25
|
|
|
@@ -35,49 +35,37 @@ var _autoFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhan
|
|
|
35
35
|
|
|
36
36
|
var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
|
|
37
37
|
|
|
38
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
|
-
|
|
40
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
|
-
|
|
42
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
|
-
|
|
44
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
|
-
|
|
46
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
47
|
-
|
|
48
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
-
|
|
50
38
|
/*__reshadow-styles__:"./style/input.shadow.css"*/
|
|
51
39
|
var style = (
|
|
52
40
|
/*__reshadow_css_start__*/
|
|
53
41
|
_core.sstyled.insert(
|
|
54
42
|
/*__inner_css_start__*/
|
|
55
|
-
".
|
|
43
|
+
".___SInput_132nj_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_132nj_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_132nj_gg_ input:-webkit-autofill~.___SOutline_132nj_gg_{background-color:#faffbd}.___SValue_132nj_gg_{min-width:0;width:100%;height:100%;padding:0;border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:0 0}.___SValue_132nj_gg_:focus{outline:0}.___SValue_132nj_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_132nj_gg_::placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_132nj_gg_:not(:disabled):-moz-read-only~.___SOutline_132nj_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_132nj_gg_:not(:disabled):read-only~.___SOutline_132nj_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_132nj_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_132nj_gg_:disabled~.___SOutline_132nj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_132nj_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:var(--intergalactic-control-rounded, 6px);z-index:-1;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SAddon_132nj_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 var(--intergalactic-spacing-2x, 8px);height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6)}.___SAddon_132nj_gg_.__interactive_132nj_gg_{cursor:pointer}@media (hover:hover){.___SAddon_132nj_gg_.__interactive_132nj_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SAddon_132nj_gg_.__disabled_132nj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInput_132nj_gg_._size_m_132nj_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SValue_132nj_gg_._size_l_132nj_gg_,.___SValue_132nj_gg_._size_m_132nj_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SInput_132nj_gg_._size_l_132nj_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px);padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px)}.___SInput_132nj_gg_.__focused_132nj_gg_{z-index:1}.___SInput_132nj_gg_._state_normal_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_132nj_gg_._state_normal_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SInput_132nj_gg_._state_valid_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-success, #59ddaa)}.___SInput_132nj_gg_._state_valid_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.3))}.___SInput_132nj_gg_._state_invalid_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SInput_132nj_gg_._state_invalid_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.3))}.___SInput_132nj_gg_._neighborLocation_right_132nj_gg_ .___SOutline_132nj_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_132nj_gg_._neighborLocation_both_132nj_gg_ .___SOutline_132nj_gg_{border-radius:0;border-left:none}.___SInput_132nj_gg_._neighborLocation_left_132nj_gg_ .___SOutline_132nj_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_132nj_gg_._neighborLocation_right_132nj_gg_{padding-right:0}.___SValue_132nj_gg_._neighborLocation_both_132nj_gg_{padding-left:0;padding-right:0}.___SValue_132nj_gg_._neighborLocation_left_132nj_gg_{padding-left:0}"
|
|
56
44
|
/*__inner_css_end__*/
|
|
57
|
-
, "
|
|
45
|
+
, "132nj_gg_")
|
|
58
46
|
/*__reshadow_css_end__*/
|
|
59
47
|
, {
|
|
60
|
-
"__SInput": "
|
|
61
|
-
"__SOutline": "
|
|
62
|
-
"__SValue": "
|
|
63
|
-
"__SAddon": "
|
|
64
|
-
"_interactive": "
|
|
65
|
-
"_disabled": "
|
|
66
|
-
"_size_m": "
|
|
67
|
-
"_size_l": "
|
|
68
|
-
"_focused": "
|
|
69
|
-
"_state_normal": "
|
|
70
|
-
"_state_valid": "
|
|
71
|
-
"_state_invalid": "
|
|
72
|
-
"_neighborLocation_right": "
|
|
73
|
-
"_neighborLocation_both": "
|
|
74
|
-
"_neighborLocation_left": "
|
|
48
|
+
"__SInput": "___SInput_132nj_gg_",
|
|
49
|
+
"__SOutline": "___SOutline_132nj_gg_",
|
|
50
|
+
"__SValue": "___SValue_132nj_gg_",
|
|
51
|
+
"__SAddon": "___SAddon_132nj_gg_",
|
|
52
|
+
"_interactive": "__interactive_132nj_gg_",
|
|
53
|
+
"_disabled": "__disabled_132nj_gg_",
|
|
54
|
+
"_size_m": "_size_m_132nj_gg_",
|
|
55
|
+
"_size_l": "_size_l_132nj_gg_",
|
|
56
|
+
"_focused": "__focused_132nj_gg_",
|
|
57
|
+
"_state_normal": "_state_normal_132nj_gg_",
|
|
58
|
+
"_state_valid": "_state_valid_132nj_gg_",
|
|
59
|
+
"_state_invalid": "_state_invalid_132nj_gg_",
|
|
60
|
+
"_neighborLocation_right": "_neighborLocation_right_132nj_gg_",
|
|
61
|
+
"_neighborLocation_both": "_neighborLocation_both_132nj_gg_",
|
|
62
|
+
"_neighborLocation_left": "_neighborLocation_left_132nj_gg_"
|
|
75
63
|
});
|
|
76
64
|
|
|
77
65
|
var Input = /*#__PURE__*/function (_Component) {
|
|
78
66
|
(0, _inherits2["default"])(Input, _Component);
|
|
79
67
|
|
|
80
|
-
var _super =
|
|
68
|
+
var _super = (0, _createSuper2["default"])(Input);
|
|
81
69
|
|
|
82
70
|
function Input() {
|
|
83
71
|
var _this;
|
|
@@ -151,7 +139,7 @@ var Input = /*#__PURE__*/function (_Component) {
|
|
|
151
139
|
}, function (neighborLocation) {
|
|
152
140
|
var _ref4;
|
|
153
141
|
|
|
154
|
-
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SInput, _ref4.cn("SInput",
|
|
142
|
+
return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SInput, _ref4.cn("SInput", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
155
143
|
"focused": focused,
|
|
156
144
|
"neighborLocation": neighborLocation
|
|
157
145
|
}, _ref))), /*#__PURE__*/_react["default"].createElement(_neighborLocation["default"], _ref4.cn("NeighborLocation", {
|
|
@@ -173,7 +161,7 @@ var Input = /*#__PURE__*/function (_Component) {
|
|
|
173
161
|
var Value = /*#__PURE__*/function (_Component2) {
|
|
174
162
|
(0, _inherits2["default"])(Value, _Component2);
|
|
175
163
|
|
|
176
|
-
var _super2 =
|
|
164
|
+
var _super2 = (0, _createSuper2["default"])(Value);
|
|
177
165
|
|
|
178
166
|
function Value() {
|
|
179
167
|
(0, _classCallCheck2["default"])(this, Value);
|
|
@@ -203,7 +191,7 @@ var Value = /*#__PURE__*/function (_Component2) {
|
|
|
203
191
|
}, function (neighborLocation) {
|
|
204
192
|
var _ref5;
|
|
205
193
|
|
|
206
|
-
return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SValue, _ref5.cn("SValue",
|
|
194
|
+
return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SValue, _ref5.cn("SValue", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
207
195
|
"neighborLocation": neighborLocation,
|
|
208
196
|
"tag": "input",
|
|
209
197
|
"type": "text",
|
|
@@ -231,7 +219,7 @@ function Addon(props) {
|
|
|
231
219
|
}, function (neighborLocation) {
|
|
232
220
|
var _ref6;
|
|
233
221
|
|
|
234
|
-
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref6.cn("SAddon",
|
|
222
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SAddon, _ref6.cn("SAddon", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
235
223
|
"neighborLocation": neighborLocation
|
|
236
224
|
}, _ref3))), /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {})));
|
|
237
225
|
});
|
package/lib/cjs/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["Input","focused","React","createRef","e","preventDefault","inputRef","current","focus","setState","disabled","asProps","onMouseDown","handleMouseDownAddon","size","state","ref","onFocus","bindHandlerValueFocused","onBlur","SInput","Box","SOutline","Children","styles","neighborLocation","controlsLength","sstyled","Component","style","Value","value","target","SValue","defaultValue","keyboardFocusEnhance","autoFocusEnhance","Addon","props","SAddon","createComponent"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (e) => {\n e.preventDefault();\n this.inputRef.current?.focus();\n };\n\n bindHandlerValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getValueProps() {\n const { size, disabled, state } = this.asProps;\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandlerValueFocused(true),\n onBlur: this.bindHandlerValueFocused(false),\n };\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput render={Box} focused={focused} neighborLocation={neighborLocation}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline />\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag=\"input\"\n type=\"text\"\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"Input.js","names":["Input","focused","React","createRef","e","preventDefault","inputRef","current","focus","setState","disabled","asProps","onMouseDown","handleMouseDownAddon","size","state","ref","onFocus","bindHandlerValueFocused","onBlur","SInput","Box","SOutline","Children","styles","neighborLocation","controlsLength","sstyled","Component","style","Value","value","target","SValue","defaultValue","keyboardFocusEnhance","autoFocusEnhance","Addon","props","SAddon","createComponent"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (e) => {\n e.preventDefault();\n this.inputRef.current?.focus();\n };\n\n bindHandlerValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getValueProps() {\n const { size, disabled, state } = this.asProps;\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandlerValueFocused(true),\n onBlur: this.bindHandlerValueFocused(false),\n };\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput render={Box} focused={focused} neighborLocation={neighborLocation}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline />\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag=\"input\"\n type=\"text\"\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,K;;;;;;;;;;;;;;;8FASI;MACNC,OAAO,EAAE;IADH,C;8GAIGC,iBAAA,CAAMC,SAAN,E;6GAEY,UAACC,CAAD,EAAO;MAAA;;MAC5BA,CAAC,CAACC,cAAF;MACA,+BAAKC,QAAL,CAAcC,OAAd,gFAAuBC,KAAvB;IACD,C;gHAEyB,UAACP,OAAD;MAAA,OAAa;QAAA,OAAM,MAAKQ,QAAL,CAAc;UAAER,OAAO,EAAPA;QAAF,CAAd,CAAN;MAAA,CAAb;IAAA,C;;;;;;WAE1B,yBAAgB;MACd,IAAQS,QAAR,GAAqB,KAAKC,OAA1B,CAAQD,QAAR;MACA,O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H,CADF;AAWD;;eAEc,IAAAe,gBAAA,EAAgBxC,KAAhB,EAAuB;EACpCqC,KAAK,EAALA,KADoC;EAEpCP,KAAK,EAALA;AAFoC,CAAvB,C"}
|
package/lib/es6/Input.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
4
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
9
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
10
10
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
11
11
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
12
|
import React from 'react';
|
|
22
13
|
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
23
14
|
import { Box } from '@semcore/flex-box';
|
|
@@ -30,26 +21,26 @@ var style = (
|
|
|
30
21
|
/*__reshadow_css_start__*/
|
|
31
22
|
_sstyled.insert(
|
|
32
23
|
/*__inner_css_start__*/
|
|
33
|
-
".
|
|
24
|
+
".___SInput_132nj_gg_{display:inline-flex;width:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInput_132nj_gg_ input:-webkit-autofill{border-radius:var(--intergalactic-control-rounded, 6px);-webkit-box-shadow:0 0 0 30px #faffbd inset}.___SInput_132nj_gg_ input:-webkit-autofill~.___SOutline_132nj_gg_{background-color:#faffbd}.___SValue_132nj_gg_{min-width:0;width:100%;height:100%;padding:0;border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;text-overflow:ellipsis;font-family:inherit;background:0 0}.___SValue_132nj_gg_:focus{outline:0}.___SValue_132nj_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_132nj_gg_::placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_132nj_gg_:not(:disabled):-moz-read-only~.___SOutline_132nj_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_132nj_gg_:not(:disabled):read-only~.___SOutline_132nj_gg_{background:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SValue_132nj_gg_:disabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_132nj_gg_:disabled~.___SOutline_132nj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SOutline_132nj_gg_{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-radius:var(--intergalactic-control-rounded, 6px);z-index:-1;background:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SAddon_132nj_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;padding:0 var(--intergalactic-spacing-2x, 8px);height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6)}.___SAddon_132nj_gg_.__interactive_132nj_gg_{cursor:pointer}@media (hover:hover){.___SAddon_132nj_gg_.__interactive_132nj_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SAddon_132nj_gg_.__disabled_132nj_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInput_132nj_gg_._size_m_132nj_gg_{font-size:var(--intergalactic-fs-200, 14px);height:var(--intergalactic-form-control-m, 28px)}.___SValue_132nj_gg_._size_l_132nj_gg_,.___SValue_132nj_gg_._size_m_132nj_gg_{padding:0 var(--intergalactic-spacing-2x, 8px)}.___SInput_132nj_gg_._size_l_132nj_gg_{font-size:var(--intergalactic-fs-300, 16px);height:var(--intergalactic-form-control-l, 40px);padding-left:var(--intergalactic-spacing-1x, 4px);padding-right:var(--intergalactic-spacing-1x, 4px)}.___SInput_132nj_gg_.__focused_132nj_gg_{z-index:1}.___SInput_132nj_gg_._state_normal_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-primary, #c4c7cf)}.___SInput_132nj_gg_._state_normal_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SInput_132nj_gg_._state_valid_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-success, #59ddaa)}.___SInput_132nj_gg_._state_valid_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.3))}.___SInput_132nj_gg_._state_invalid_132nj_gg_ .___SOutline_132nj_gg_{border-color:var(--intergalactic-border-critical, #ffaeb5)}.___SInput_132nj_gg_._state_invalid_132nj_gg_ .___SValue_132nj_gg_:focus~.___SOutline_132nj_gg_{border-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.3))}.___SInput_132nj_gg_._neighborLocation_right_132nj_gg_ .___SOutline_132nj_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SInput_132nj_gg_._neighborLocation_both_132nj_gg_ .___SOutline_132nj_gg_{border-radius:0;border-left:none}.___SInput_132nj_gg_._neighborLocation_left_132nj_gg_ .___SOutline_132nj_gg_{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.___SValue_132nj_gg_._neighborLocation_right_132nj_gg_{padding-right:0}.___SValue_132nj_gg_._neighborLocation_both_132nj_gg_{padding-left:0;padding-right:0}.___SValue_132nj_gg_._neighborLocation_left_132nj_gg_{padding-left:0}"
|
|
34
25
|
/*__inner_css_end__*/
|
|
35
|
-
, "
|
|
26
|
+
, "132nj_gg_")
|
|
36
27
|
/*__reshadow_css_end__*/
|
|
37
28
|
, {
|
|
38
|
-
"__SInput": "
|
|
39
|
-
"__SOutline": "
|
|
40
|
-
"__SValue": "
|
|
41
|
-
"__SAddon": "
|
|
42
|
-
"_interactive": "
|
|
43
|
-
"_disabled": "
|
|
44
|
-
"_size_m": "
|
|
45
|
-
"_size_l": "
|
|
46
|
-
"_focused": "
|
|
47
|
-
"_state_normal": "
|
|
48
|
-
"_state_valid": "
|
|
49
|
-
"_state_invalid": "
|
|
50
|
-
"_neighborLocation_right": "
|
|
51
|
-
"_neighborLocation_both": "
|
|
52
|
-
"_neighborLocation_left": "
|
|
29
|
+
"__SInput": "___SInput_132nj_gg_",
|
|
30
|
+
"__SOutline": "___SOutline_132nj_gg_",
|
|
31
|
+
"__SValue": "___SValue_132nj_gg_",
|
|
32
|
+
"__SAddon": "___SAddon_132nj_gg_",
|
|
33
|
+
"_interactive": "__interactive_132nj_gg_",
|
|
34
|
+
"_disabled": "__disabled_132nj_gg_",
|
|
35
|
+
"_size_m": "_size_m_132nj_gg_",
|
|
36
|
+
"_size_l": "_size_l_132nj_gg_",
|
|
37
|
+
"_focused": "__focused_132nj_gg_",
|
|
38
|
+
"_state_normal": "_state_normal_132nj_gg_",
|
|
39
|
+
"_state_valid": "_state_valid_132nj_gg_",
|
|
40
|
+
"_state_invalid": "_state_invalid_132nj_gg_",
|
|
41
|
+
"_neighborLocation_right": "_neighborLocation_right_132nj_gg_",
|
|
42
|
+
"_neighborLocation_both": "_neighborLocation_both_132nj_gg_",
|
|
43
|
+
"_neighborLocation_left": "_neighborLocation_left_132nj_gg_"
|
|
53
44
|
});
|
|
54
45
|
|
|
55
46
|
var Input = /*#__PURE__*/function (_Component) {
|
package/lib/es6/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","autoFocusEnhance","keyboardFocusEnhance","Input","focused","createRef","e","preventDefault","inputRef","current","focus","setState","disabled","asProps","onMouseDown","handleMouseDownAddon","size","state","ref","onFocus","bindHandlerValueFocused","onBlur","SInput","SOutline","Children","styles","neighborLocation","controlsLength","style","Value","value","target","SValue","defaultValue","Addon","props","SAddon"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (e) => {\n e.preventDefault();\n this.inputRef.current?.focus();\n };\n\n bindHandlerValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getValueProps() {\n const { size, disabled, state } = this.asProps;\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandlerValueFocused(true),\n onBlur: this.bindHandlerValueFocused(false),\n };\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput render={Box} focused={focused} neighborLocation={neighborLocation}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline />\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag=\"input\"\n type=\"text\"\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.js","names":["React","createComponent","Component","sstyled","Root","Box","NeighborLocation","autoFocusEnhance","keyboardFocusEnhance","Input","focused","createRef","e","preventDefault","inputRef","current","focus","setState","disabled","asProps","onMouseDown","handleMouseDownAddon","size","state","ref","onFocus","bindHandlerValueFocused","onBlur","SInput","SOutline","Children","styles","neighborLocation","controlsLength","style","Value","value","target","SValue","defaultValue","Addon","props","SAddon"],"sources":["../../src/Input.jsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport NeighborLocation from '@semcore/neighbor-location';\nimport autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\nimport style from './style/input.shadow.css';\n\nclass Input extends Component {\n static displayName = 'Input';\n\n static defaultProps = {\n size: 'm',\n state: 'normal',\n };\n static style = style;\n\n state = {\n focused: false,\n };\n\n inputRef = React.createRef();\n\n handleMouseDownAddon = (e) => {\n e.preventDefault();\n this.inputRef.current?.focus();\n };\n\n bindHandlerValueFocused = (focused) => () => this.setState({ focused });\n\n getAddonProps() {\n const { disabled } = this.asProps;\n return {\n disabled,\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getValueProps() {\n const { size, disabled, state } = this.asProps;\n return {\n ref: this.inputRef,\n size,\n disabled,\n state,\n onFocus: this.bindHandlerValueFocused(true),\n onBlur: this.bindHandlerValueFocused(false),\n };\n }\n\n render() {\n const SInput = Root;\n const SOutline = 'div';\n const { Children, styles, neighborLocation, controlsLength } = this.asProps;\n const { focused } = this.state;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SInput render={Box} focused={focused} neighborLocation={neighborLocation}>\n <NeighborLocation controlsLength={controlsLength}>\n <Children />\n </NeighborLocation>\n <SOutline />\n </SInput>,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nclass Value extends Component {\n static defaultProps = {\n defaultValue: '',\n };\n static enhance = [keyboardFocusEnhance(), autoFocusEnhance()];\n\n uncontrolledProps() {\n return {\n value: (e) => e.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n const { styles, neighborLocation, state } = this.asProps;\n\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SValue\n render={Box}\n neighborLocation={neighborLocation}\n tag=\"input\"\n type=\"text\"\n aria-invalid={state === 'invalid'}\n />,\n )\n }\n </NeighborLocation.Detect>\n );\n }\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n const { Children, styles, neighborLocation } = props;\n return (\n <NeighborLocation.Detect neighborLocation={neighborLocation}>\n {(neighborLocation) =>\n sstyled(styles)(\n <SAddon render={Box} neighborLocation={neighborLocation}>\n <Children />\n </SAddon>,\n )\n }\n </NeighborLocation.Detect>\n );\n}\n\nexport default createComponent(Input, {\n Addon,\n Value,\n});\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,gBAAP,MAA6B,4BAA7B;AACA,OAAOC,gBAAP,MAA6B,8CAA7B;AACA,OAAOC,o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