@semcore/inline-input 4.47.1 → 4.48.0-prerelease.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/CHANGELOG.md +6 -0
- package/lib/cjs/InlineInput.js +14 -14
- package/lib/es6/InlineInput.js +14 -14
- package/lib/esm/InlineInput.mjs +127 -127
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [4.48.0] - 2025-04-11
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version minor update due to children dependencies update (`@semcore/icon` [4.60.2 ~> 4.61.0]).
|
|
10
|
+
|
|
5
11
|
## [4.47.1] - 2025-04-04
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/lib/cjs/InlineInput.js
CHANGED
|
@@ -27,20 +27,20 @@ var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i
|
|
|
27
27
|
var _inputNumber = _interopRequireDefault(require("@semcore/input-number"));
|
|
28
28
|
var _hasParent = require("@semcore/utils/lib/hasParent");
|
|
29
29
|
/*__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
30
|
-
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".
|
|
31
|
-
"__SInlineInput": "
|
|
32
|
-
"_disabled": "
|
|
33
|
-
"__SUnderline": "
|
|
34
|
-
"__SAddon": "
|
|
35
|
-
"_focused": "
|
|
36
|
-
"_state_valid": "
|
|
37
|
-
"_state_invalid": "
|
|
38
|
-
"__SValue": "
|
|
39
|
-
"__SControls": "
|
|
40
|
-
"__SInvalidPattern": "
|
|
41
|
-
"__SConfirmIcon": "
|
|
42
|
-
"__SCancelIcon": "
|
|
43
|
-
"_type_number": "
|
|
30
|
+
var style = ( /*__reshadow_css_start__*/_index.sstyled.insert( /*__inner_css_start__*/".___SInlineInput_yeczz_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_yeczz_gg_.__disabled_yeczz_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_yeczz_gg_{min-width:0;width:100%;height:100%;padding:0 var(--intergalactic-spacing-1x, 4px);border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SValue_yeczz_gg_:focus{outline:0}.___SValue_yeczz_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_.__disabled_yeczz_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_yeczz_gg_::-webkit-inner-spin-button,.___SValue_yeczz_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_yeczz_gg_._type_number_yeczz_gg_{-moz-appearance:textfield}.___SUnderline_yeczz_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SAddon_yeczz_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);padding:0 var(--intergalactic-spacing-1x, 4px)}.___SAddon_yeczz_gg_.__disabled_yeczz_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_{z-index:1}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SValue_yeczz_gg_:focus~.___SControls_yeczz_gg_{display:flex}.___SInvalidPattern_yeczz_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}" /*__inner_css_end__*/, "yeczz_gg_") /*__reshadow_css_end__*/, {
|
|
31
|
+
"__SInlineInput": "___SInlineInput_yeczz_gg_",
|
|
32
|
+
"_disabled": "__disabled_yeczz_gg_",
|
|
33
|
+
"__SUnderline": "___SUnderline_yeczz_gg_",
|
|
34
|
+
"__SAddon": "___SAddon_yeczz_gg_",
|
|
35
|
+
"_focused": "__focused_yeczz_gg_",
|
|
36
|
+
"_state_valid": "_state_valid_yeczz_gg_",
|
|
37
|
+
"_state_invalid": "_state_invalid_yeczz_gg_",
|
|
38
|
+
"__SValue": "___SValue_yeczz_gg_",
|
|
39
|
+
"__SControls": "___SControls_yeczz_gg_",
|
|
40
|
+
"__SInvalidPattern": "___SInvalidPattern_yeczz_gg_",
|
|
41
|
+
"__SConfirmIcon": "___SConfirmIcon_yeczz_gg_",
|
|
42
|
+
"__SCancelIcon": "___SCancelIcon_yeczz_gg_",
|
|
43
|
+
"_type_number": "_type_number_yeczz_gg_"
|
|
44
44
|
});
|
|
45
45
|
var pointInsideOfRect = function pointInsideOfRect(_ref17) {
|
|
46
46
|
var x = _ref17.x,
|
package/lib/es6/InlineInput.js
CHANGED
|
@@ -20,20 +20,20 @@ import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
|
20
20
|
import { Box, InvalidStateBox } from '@semcore/flex-box';
|
|
21
21
|
import autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';
|
|
22
22
|
/*__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
23
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
24
|
-
"__SInlineInput": "
|
|
25
|
-
"_disabled": "
|
|
26
|
-
"__SUnderline": "
|
|
27
|
-
"__SAddon": "
|
|
28
|
-
"_focused": "
|
|
29
|
-
"_state_valid": "
|
|
30
|
-
"_state_invalid": "
|
|
31
|
-
"__SValue": "
|
|
32
|
-
"__SControls": "
|
|
33
|
-
"__SInvalidPattern": "
|
|
34
|
-
"__SConfirmIcon": "
|
|
35
|
-
"__SCancelIcon": "
|
|
36
|
-
"_type_number": "
|
|
23
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SInlineInput_yeczz_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_yeczz_gg_.__disabled_yeczz_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_yeczz_gg_{min-width:0;width:100%;height:100%;padding:0 var(--intergalactic-spacing-1x, 4px);border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SValue_yeczz_gg_:focus{outline:0}.___SValue_yeczz_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_.__disabled_yeczz_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_yeczz_gg_::-webkit-inner-spin-button,.___SValue_yeczz_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_yeczz_gg_._type_number_yeczz_gg_{-moz-appearance:textfield}.___SUnderline_yeczz_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SAddon_yeczz_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);padding:0 var(--intergalactic-spacing-1x, 4px)}.___SAddon_yeczz_gg_.__disabled_yeczz_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_{z-index:1}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SValue_yeczz_gg_:focus~.___SControls_yeczz_gg_{display:flex}.___SInvalidPattern_yeczz_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}" /*__inner_css_end__*/, "yeczz_gg_") /*__reshadow_css_end__*/, {
|
|
24
|
+
"__SInlineInput": "___SInlineInput_yeczz_gg_",
|
|
25
|
+
"_disabled": "__disabled_yeczz_gg_",
|
|
26
|
+
"__SUnderline": "___SUnderline_yeczz_gg_",
|
|
27
|
+
"__SAddon": "___SAddon_yeczz_gg_",
|
|
28
|
+
"_focused": "__focused_yeczz_gg_",
|
|
29
|
+
"_state_valid": "_state_valid_yeczz_gg_",
|
|
30
|
+
"_state_invalid": "_state_invalid_yeczz_gg_",
|
|
31
|
+
"__SValue": "___SValue_yeczz_gg_",
|
|
32
|
+
"__SControls": "___SControls_yeczz_gg_",
|
|
33
|
+
"__SInvalidPattern": "___SInvalidPattern_yeczz_gg_",
|
|
34
|
+
"__SConfirmIcon": "___SConfirmIcon_yeczz_gg_",
|
|
35
|
+
"__SCancelIcon": "___SCancelIcon_yeczz_gg_",
|
|
36
|
+
"_type_number": "_type_number_yeczz_gg_"
|
|
37
37
|
});
|
|
38
38
|
import CheckM from '@semcore/icon/Check/m';
|
|
39
39
|
import CloseM from '@semcore/icon/Close/m';
|
package/lib/esm/InlineInput.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import b from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import R from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import k from "@babel/runtime/helpers/esm/createClass";
|
|
4
4
|
import f from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
@@ -6,8 +6,8 @@ import E from "@babel/runtime/helpers/esm/inherits";
|
|
|
6
6
|
import $ from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import s from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
8
|
import { sstyled as H } from "@semcore/utils/lib/core/index";
|
|
9
|
-
import M, { sstyled as m, assignProps as
|
|
10
|
-
import
|
|
9
|
+
import M, { sstyled as m, assignProps as C, Component as V } from "@semcore/core";
|
|
10
|
+
import _ from "react";
|
|
11
11
|
import { Box as I, InvalidStateBox as K } from "@semcore/flex-box";
|
|
12
12
|
import N from "@semcore/utils/lib/enhances/autoFocusEnhance";
|
|
13
13
|
import U from "@semcore/icon/Check/m";
|
|
@@ -22,88 +22,88 @@ var j = (
|
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
23
|
(H.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
|
-
".
|
|
26
|
-
"
|
|
25
|
+
".___SInlineInput_yeczz_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SConfirmIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_yeczz_gg_ .___SCancelIcon_yeczz_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_yeczz_gg_.__disabled_yeczz_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_yeczz_gg_{min-width:0;width:100%;height:100%;padding:0 var(--intergalactic-spacing-1x, 4px);border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SValue_yeczz_gg_:focus{outline:0}.___SValue_yeczz_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_yeczz_gg_.__disabled_yeczz_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_yeczz_gg_::-webkit-inner-spin-button,.___SValue_yeczz_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_yeczz_gg_._type_number_yeczz_gg_{-moz-appearance:textfield}.___SUnderline_yeczz_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SAddon_yeczz_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);padding:0 var(--intergalactic-spacing-1x, 4px)}.___SAddon_yeczz_gg_.__disabled_yeczz_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_{z-index:1}.___SInlineInput_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5))}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_yeczz_gg_._state_valid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_yeczz_gg_._state_invalid_yeczz_gg_.__focused_yeczz_gg_ .___SUnderline_yeczz_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SValue_yeczz_gg_:focus~.___SControls_yeczz_gg_{display:flex}.___SInvalidPattern_yeczz_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}",
|
|
26
|
+
"yeczz_gg_"
|
|
27
27
|
), {
|
|
28
|
-
__SInlineInput: "
|
|
29
|
-
_disabled: "
|
|
30
|
-
__SUnderline: "
|
|
31
|
-
__SAddon: "
|
|
32
|
-
_focused: "
|
|
33
|
-
_state_valid: "
|
|
34
|
-
_state_invalid: "
|
|
35
|
-
__SValue: "
|
|
36
|
-
__SControls: "
|
|
37
|
-
__SInvalidPattern: "
|
|
38
|
-
__SConfirmIcon: "
|
|
39
|
-
__SCancelIcon: "
|
|
40
|
-
_type_number: "
|
|
28
|
+
__SInlineInput: "___SInlineInput_yeczz_gg_",
|
|
29
|
+
_disabled: "__disabled_yeczz_gg_",
|
|
30
|
+
__SUnderline: "___SUnderline_yeczz_gg_",
|
|
31
|
+
__SAddon: "___SAddon_yeczz_gg_",
|
|
32
|
+
_focused: "__focused_yeczz_gg_",
|
|
33
|
+
_state_valid: "_state_valid_yeczz_gg_",
|
|
34
|
+
_state_invalid: "_state_invalid_yeczz_gg_",
|
|
35
|
+
__SValue: "___SValue_yeczz_gg_",
|
|
36
|
+
__SControls: "___SControls_yeczz_gg_",
|
|
37
|
+
__SInvalidPattern: "___SInvalidPattern_yeczz_gg_",
|
|
38
|
+
__SConfirmIcon: "___SConfirmIcon_yeczz_gg_",
|
|
39
|
+
__SCancelIcon: "___SCancelIcon_yeczz_gg_",
|
|
40
|
+
_type_number: "_type_number_yeczz_gg_"
|
|
41
41
|
})
|
|
42
42
|
), O = function(n) {
|
|
43
|
-
var
|
|
44
|
-
return
|
|
43
|
+
var l = n.x, e = n.y, t = n.rect;
|
|
44
|
+
return l >= t.x && l <= t.x + t.width && e >= t.y && e <= t.y + t.height;
|
|
45
45
|
}, x = /* @__PURE__ */ function(p) {
|
|
46
|
-
E(
|
|
47
|
-
var n = $(
|
|
48
|
-
function
|
|
46
|
+
E(l, p);
|
|
47
|
+
var n = $(l);
|
|
48
|
+
function l() {
|
|
49
49
|
var e;
|
|
50
|
-
R(this,
|
|
51
|
-
for (var
|
|
52
|
-
|
|
53
|
-
return e = n.call.apply(n, [this].concat(
|
|
50
|
+
R(this, l);
|
|
51
|
+
for (var t = arguments.length, u = new Array(t), g = 0; g < t; g++)
|
|
52
|
+
u[g] = arguments[g];
|
|
53
|
+
return e = n.call.apply(n, [this].concat(u)), s(f(e), "state", {
|
|
54
54
|
focused: !1
|
|
55
|
-
}), s(f(e), "rootRef", /* @__PURE__ */
|
|
55
|
+
}), s(f(e), "rootRef", /* @__PURE__ */ _.createRef()), s(f(e), "inputRef", /* @__PURE__ */ _.createRef()), s(f(e), "inputHandlersRef", /* @__PURE__ */ _.createRef()), s(f(e), "initValue", ""), s(f(e), "lastMouseDownPosition", null), s(f(e), "lastHandledKeyboardEvent", -1), s(f(e), "handleDocumentMouseDown", function(r) {
|
|
56
56
|
e.lastMouseDownPosition = {
|
|
57
|
-
x:
|
|
58
|
-
y:
|
|
57
|
+
x: r.clientX,
|
|
58
|
+
y: r.clientY
|
|
59
59
|
}, e.lastHandledKeyboardEvent = -1;
|
|
60
60
|
}), s(f(e), "handleDocumentKeyDown", function() {
|
|
61
61
|
e.lastMouseDownPosition = null;
|
|
62
|
-
}), s(f(e), "increment", function(
|
|
63
|
-
var
|
|
64
|
-
((
|
|
65
|
-
}), s(f(e), "decrement", function(
|
|
66
|
-
var
|
|
67
|
-
((
|
|
68
|
-
}), s(f(e), "bindHandlerValueFocused", function(
|
|
62
|
+
}), s(f(e), "increment", function(r) {
|
|
63
|
+
var i, o, a, d, c;
|
|
64
|
+
((i = e.inputRef.current) === null || i === void 0 ? void 0 : i.value) === "" && (e.inputRef.current.value = e.inputRef.current.min || "0"), (o = e.inputRef.current) === null || o === void 0 || (a = o.stepUp) === null || a === void 0 || a.call(o, r), (d = e.inputHandlersRef.current) === null || d === void 0 || d.value((c = e.inputRef.current) === null || c === void 0 ? void 0 : c.value, r);
|
|
65
|
+
}), s(f(e), "decrement", function(r) {
|
|
66
|
+
var i, o, a, d, c;
|
|
67
|
+
((i = e.inputRef.current) === null || i === void 0 ? void 0 : i.value) === "" && (e.inputRef.current.value = e.inputRef.current.max || "0"), (o = e.inputRef.current) === null || o === void 0 || (a = o.stepDown) === null || a === void 0 || a.call(o, r), (d = e.inputHandlersRef.current) === null || d === void 0 || d.value((c = e.inputRef.current) === null || c === void 0 ? void 0 : c.value, r);
|
|
68
|
+
}), s(f(e), "bindHandlerValueFocused", function(r) {
|
|
69
69
|
return function() {
|
|
70
70
|
e.setState({
|
|
71
|
-
focused:
|
|
71
|
+
focused: r
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
}), s(f(e), "handleMouseDownAddon", function(
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
}), s(f(e), "handleConfirm", function(
|
|
78
|
-
var
|
|
79
|
-
(
|
|
80
|
-
}), s(f(e), "handleCancel", function(
|
|
81
|
-
var
|
|
82
|
-
(
|
|
83
|
-
}), s(f(e), "handleBlur", function(
|
|
84
|
-
var
|
|
85
|
-
if (
|
|
74
|
+
}), s(f(e), "handleMouseDownAddon", function(r) {
|
|
75
|
+
var i;
|
|
76
|
+
r.preventDefault(), (i = e.inputRef.current) === null || i === void 0 || i.focus();
|
|
77
|
+
}), s(f(e), "handleConfirm", function(r, i) {
|
|
78
|
+
var o, a;
|
|
79
|
+
(o = (a = e.asProps).onConfirm) === null || o === void 0 || o.call(a, r, i);
|
|
80
|
+
}), s(f(e), "handleCancel", function(r, i) {
|
|
81
|
+
var o, a;
|
|
82
|
+
(o = (a = e.asProps).onCancel) === null || o === void 0 || o.call(a, r, i);
|
|
83
|
+
}), s(f(e), "handleBlur", function(r) {
|
|
84
|
+
var i, o, a = e.asProps, d = a.onConfirm, c = a.onCancel, y = a.onBlurBehavior;
|
|
85
|
+
if (y && !(Date.now() - e.lastHandledKeyboardEvent < 250) && !L(r.relatedTarget, e.rootRef.current)) {
|
|
86
86
|
if (e.lastMouseDownPosition && e.rootRef.current) {
|
|
87
|
-
var
|
|
87
|
+
var S = e.lastMouseDownPosition, v = S.x, h = S.y, z = e.rootRef.current.getBoundingClientRect();
|
|
88
88
|
if (O({
|
|
89
89
|
x: v,
|
|
90
|
-
y,
|
|
91
|
-
rect:
|
|
90
|
+
y: h,
|
|
91
|
+
rect: z
|
|
92
92
|
}))
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
y === "confirm" && (d == null || d((i = (o = e.inputRef.current) === null || o === void 0 ? void 0 : o.value) !== null && i !== void 0 ? i : "", r)), y === "cancel" && (c == null || c(e.initValue, r));
|
|
96
96
|
}
|
|
97
|
-
}), s(f(e), "handleKeyDown", function(
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
var d,
|
|
101
|
-
|
|
97
|
+
}), s(f(e), "handleKeyDown", function(r) {
|
|
98
|
+
var i = e.asProps, o = i.onConfirm, a = i.onCancel;
|
|
99
|
+
if (r.key === "Enter") {
|
|
100
|
+
var d, c;
|
|
101
|
+
o == null || o((d = (c = e.inputRef.current) === null || c === void 0 ? void 0 : c.value) !== null && d !== void 0 ? d : "", r), e.lastHandledKeyboardEvent = Date.now();
|
|
102
102
|
}
|
|
103
|
-
|
|
103
|
+
r.key === "Escape" && (a == null || a(e.initValue, r), e.lastHandledKeyboardEvent = Date.now());
|
|
104
104
|
}), e;
|
|
105
105
|
}
|
|
106
|
-
return k(
|
|
106
|
+
return k(l, [{
|
|
107
107
|
key: "componentDidMount",
|
|
108
108
|
value: function() {
|
|
109
109
|
this.asProps.onBlurBehavior && (document.body.addEventListener("mousedown", this.handleDocumentMouseDown), document.body.addEventListener("keydown", this.handleDocumentKeyDown));
|
|
@@ -123,33 +123,33 @@ var j = (
|
|
|
123
123
|
}, {
|
|
124
124
|
key: "getConfirmControlProps",
|
|
125
125
|
value: function() {
|
|
126
|
-
var
|
|
126
|
+
var t, u = this.asProps, g = u.loading, r = u.getI18nText;
|
|
127
127
|
return {
|
|
128
|
-
value: (
|
|
128
|
+
value: (t = this.inputRef.current) === null || t === void 0 ? void 0 : t.value,
|
|
129
129
|
loading: g,
|
|
130
130
|
onConfirm: this.handleConfirm,
|
|
131
|
-
getI18nText:
|
|
131
|
+
getI18nText: r
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
}, {
|
|
135
135
|
key: "getCancelControlProps",
|
|
136
136
|
value: function() {
|
|
137
|
-
var
|
|
137
|
+
var t = this.asProps, u = t.loading, g = t.disabled, r = t.getI18nText;
|
|
138
138
|
return {
|
|
139
139
|
value: this.initValue,
|
|
140
140
|
// because double disabled(root disabled and addon disabled)
|
|
141
|
-
disabled:
|
|
141
|
+
disabled: u && !g,
|
|
142
142
|
onCancel: this.handleCancel,
|
|
143
|
-
getI18nText:
|
|
143
|
+
getI18nText: r
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
}, {
|
|
147
147
|
key: "getValueProps",
|
|
148
148
|
value: function() {
|
|
149
|
-
var
|
|
149
|
+
var t = this.asProps.state;
|
|
150
150
|
return {
|
|
151
151
|
ref: this.inputRef,
|
|
152
|
-
state:
|
|
152
|
+
state: t,
|
|
153
153
|
onKeyDown: this.handleKeyDown,
|
|
154
154
|
onFocus: this.bindHandlerValueFocused(!0),
|
|
155
155
|
onBlur: this.bindHandlerValueFocused(!1)
|
|
@@ -158,11 +158,11 @@ var j = (
|
|
|
158
158
|
}, {
|
|
159
159
|
key: "getNumberValueProps",
|
|
160
160
|
value: function() {
|
|
161
|
-
var
|
|
161
|
+
var t = new Intl.NumberFormat(this.asProps.locale, {
|
|
162
162
|
style: "decimal"
|
|
163
163
|
});
|
|
164
164
|
return {
|
|
165
|
-
numberFormatter:
|
|
165
|
+
numberFormatter: t,
|
|
166
166
|
inputRef: this.inputRef,
|
|
167
167
|
inputHandlerRefs: this.inputHandlersRef,
|
|
168
168
|
increment: this.increment,
|
|
@@ -174,24 +174,24 @@ var j = (
|
|
|
174
174
|
}, {
|
|
175
175
|
key: "getNumberControlsProps",
|
|
176
176
|
value: function() {
|
|
177
|
-
var
|
|
177
|
+
var t = this.asProps.getI18nText;
|
|
178
178
|
return {
|
|
179
179
|
increment: this.increment,
|
|
180
180
|
decrement: this.decrement,
|
|
181
|
-
getI18nText:
|
|
181
|
+
getI18nText: t
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
}, {
|
|
185
185
|
key: "render",
|
|
186
186
|
value: function() {
|
|
187
|
-
var
|
|
188
|
-
return
|
|
187
|
+
var t = this.asProps, u, g = I, r = "div", i = K, o = this.asProps, a = o.Children, d = o.styles, c = o.state, y = this.state.focused;
|
|
188
|
+
return u = m(d), /* @__PURE__ */ _.createElement(g, u.cn("SInlineInput", b({}, C({
|
|
189
189
|
ref: this.rootRef,
|
|
190
|
-
focused:
|
|
190
|
+
focused: y,
|
|
191
191
|
onBlur: this.handleBlur
|
|
192
|
-
},
|
|
192
|
+
}, t))), /* @__PURE__ */ _.createElement(r, u.cn("SUnderline", {}), c === "invalid" && /* @__PURE__ */ _.createElement(i, u.cn("SInvalidPattern", {})), /* @__PURE__ */ _.createElement(a, u.cn("Children", {}))));
|
|
193
193
|
}
|
|
194
|
-
}]),
|
|
194
|
+
}]), l;
|
|
195
195
|
}(V);
|
|
196
196
|
s(x, "displayName", "InlineInput");
|
|
197
197
|
s(x, "enhance", [T(B)]);
|
|
@@ -203,30 +203,30 @@ s(x, "defaultProps", {
|
|
|
203
203
|
});
|
|
204
204
|
s(x, "style", j);
|
|
205
205
|
var P = /* @__PURE__ */ function(p) {
|
|
206
|
-
E(
|
|
207
|
-
var n = $(
|
|
208
|
-
function
|
|
209
|
-
return R(this,
|
|
206
|
+
E(l, p);
|
|
207
|
+
var n = $(l);
|
|
208
|
+
function l() {
|
|
209
|
+
return R(this, l), n.apply(this, arguments);
|
|
210
210
|
}
|
|
211
|
-
return k(
|
|
211
|
+
return k(l, [{
|
|
212
212
|
key: "uncontrolledProps",
|
|
213
213
|
value: function() {
|
|
214
214
|
return {
|
|
215
|
-
value: function(
|
|
216
|
-
return
|
|
215
|
+
value: function(u) {
|
|
216
|
+
return u.target.value;
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
}, {
|
|
221
221
|
key: "render",
|
|
222
222
|
value: function() {
|
|
223
|
-
var
|
|
224
|
-
return
|
|
223
|
+
var t = this.asProps, u, g = I;
|
|
224
|
+
return u = m(this.asProps.styles), /* @__PURE__ */ _.createElement(g, u.cn("SValue", b({}, C({
|
|
225
225
|
tag: "input",
|
|
226
226
|
type: "text"
|
|
227
|
-
},
|
|
227
|
+
}, t))));
|
|
228
228
|
}
|
|
229
|
-
}]),
|
|
229
|
+
}]), l;
|
|
230
230
|
}(V);
|
|
231
231
|
s(P, "defaultProps", {
|
|
232
232
|
defaultValue: ""
|
|
@@ -234,61 +234,61 @@ s(P, "defaultProps", {
|
|
|
234
234
|
s(P, "enhance", [N()]);
|
|
235
235
|
s(P, "hoistProps", ["disabled"]);
|
|
236
236
|
var W = function(n) {
|
|
237
|
-
var
|
|
238
|
-
return e = m(n.styles), /* @__PURE__ */
|
|
237
|
+
var l = arguments[0], e, t = I;
|
|
238
|
+
return e = m(n.styles), /* @__PURE__ */ _.createElement(t, e.cn("SAddon", b({}, C({}, l))));
|
|
239
239
|
}, X = function(n) {
|
|
240
|
-
var
|
|
241
|
-
var
|
|
242
|
-
(
|
|
243
|
-
}, [n.onConfirm, n.value]), d =
|
|
244
|
-
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(),
|
|
245
|
-
}, [
|
|
240
|
+
var l = arguments[0], e, t, u, g = I, r = n.Children, i = n.children, o = (t = n.title) !== null && t !== void 0 ? t : n.getI18nText("confirm"), a = _.useCallback(function(v) {
|
|
241
|
+
var h, z;
|
|
242
|
+
(h = n.onConfirm) === null || h === void 0 || h.call(n, (z = n.value) !== null && z !== void 0 ? z : "", v);
|
|
243
|
+
}, [n.onConfirm, n.value]), d = _.useCallback(function(v) {
|
|
244
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(), a(v));
|
|
245
|
+
}, [a]);
|
|
246
246
|
if (n.loading) {
|
|
247
|
-
var
|
|
248
|
-
return
|
|
247
|
+
var c;
|
|
248
|
+
return c = m(n.styles), /* @__PURE__ */ _.createElement(g, c.cn("SAddon", b({}, C({}, l))), i ? /* @__PURE__ */ _.createElement(r, c.cn("Children", {})) : /* @__PURE__ */ _.createElement(F, c.cn("Spin", {
|
|
249
249
|
size: "xs"
|
|
250
250
|
})));
|
|
251
251
|
}
|
|
252
|
-
var
|
|
253
|
-
return e = m(n.styles), /* @__PURE__ */
|
|
252
|
+
var y = m(n.styles), S = y.cn("SConfirmIcon", {});
|
|
253
|
+
return e = m(n.styles), /* @__PURE__ */ _.createElement(g, e.cn("SAddon", b({}, C({
|
|
254
254
|
onKeyDown: d
|
|
255
|
-
},
|
|
256
|
-
addonLeft: (
|
|
255
|
+
}, l))), i ? /* @__PURE__ */ _.createElement(r, e.cn("Children", {})) : /* @__PURE__ */ _.createElement(D, e.cn("ButtonLink", {
|
|
256
|
+
addonLeft: (u = n.icon) !== null && u !== void 0 ? u : U,
|
|
257
257
|
use: "secondary",
|
|
258
|
-
onClick:
|
|
259
|
-
className:
|
|
260
|
-
style:
|
|
261
|
-
"aria-label":
|
|
258
|
+
onClick: a,
|
|
259
|
+
className: S.className,
|
|
260
|
+
style: S.style,
|
|
261
|
+
"aria-label": o
|
|
262
262
|
})));
|
|
263
263
|
}, Y = function(n) {
|
|
264
|
-
var
|
|
265
|
-
var
|
|
266
|
-
(
|
|
267
|
-
}, [n.onCancel, n.value]), d =
|
|
268
|
-
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(),
|
|
269
|
-
}, [
|
|
264
|
+
var l = arguments[0], e, t, u, g = I, r = n.Children, i = n.children, o = (t = n.title) !== null && t !== void 0 ? t : n.getI18nText("discard"), a = _.useCallback(function(v) {
|
|
265
|
+
var h, z;
|
|
266
|
+
(h = n.onCancel) === null || h === void 0 || h.call(n, (z = n.value) !== null && z !== void 0 ? z : "", v);
|
|
267
|
+
}, [n.onCancel, n.value]), d = _.useCallback(function(v) {
|
|
268
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(), a(v));
|
|
269
|
+
}, [a]);
|
|
270
270
|
if (n.disabled) {
|
|
271
|
-
var
|
|
272
|
-
return
|
|
271
|
+
var c;
|
|
272
|
+
return c = m(n.styles), /* @__PURE__ */ _.createElement(g, c.cn("SAddon", b({}, C({}, l))), i ? /* @__PURE__ */ _.createElement(r, c.cn("Children", {})) : /* @__PURE__ */ _.createElement(w, c.cn("CloseM", {})));
|
|
273
273
|
}
|
|
274
|
-
var
|
|
275
|
-
return e = m(n.styles), /* @__PURE__ */
|
|
274
|
+
var y = m(n.styles), S = y.cn("SCancelIcon", {});
|
|
275
|
+
return e = m(n.styles), /* @__PURE__ */ _.createElement(g, e.cn("SAddon", b({}, C({
|
|
276
276
|
onKeyDown: d
|
|
277
|
-
},
|
|
277
|
+
}, l))), i ? /* @__PURE__ */ _.createElement(r, e.cn("Children", {})) : /* @__PURE__ */ _.createElement(D, e.cn("ButtonLink", {
|
|
278
278
|
use: "secondary",
|
|
279
|
-
addonLeft: (
|
|
280
|
-
onClick:
|
|
281
|
-
className:
|
|
282
|
-
style:
|
|
283
|
-
"aria-label":
|
|
279
|
+
addonLeft: (u = n.icon) !== null && u !== void 0 ? u : w,
|
|
280
|
+
onClick: a,
|
|
281
|
+
className: S.className,
|
|
282
|
+
style: S.style,
|
|
283
|
+
"aria-label": o
|
|
284
284
|
})));
|
|
285
285
|
}, q = function(n) {
|
|
286
|
-
var
|
|
287
|
-
return e = m(n.styles), /* @__PURE__ */
|
|
286
|
+
var l = arguments[0], e, t = A.Value;
|
|
287
|
+
return e = m(n.styles), /* @__PURE__ */ _.createElement(t, e.cn("SValue", b({}, C({}, l))));
|
|
288
288
|
};
|
|
289
289
|
function G(p) {
|
|
290
|
-
var n = arguments[0],
|
|
291
|
-
return
|
|
290
|
+
var n = arguments[0], l, e = A.Controls;
|
|
291
|
+
return l = m(p.styles), /* @__PURE__ */ _.createElement(e, l.cn("SControls", b({}, C({
|
|
292
292
|
tag: J.Addon
|
|
293
293
|
}, n))));
|
|
294
294
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/inline-input",
|
|
3
3
|
"description": "Semrush Input Component",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.48.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@semcore/flex-box": "5.41.2",
|
|
18
|
-
"@semcore/icon": "4.
|
|
18
|
+
"@semcore/icon": "4.61.0-prerelease.0",
|
|
19
19
|
"@semcore/spin": "5.41.2",
|
|
20
20
|
"@semcore/tooltip": "6.49.2",
|
|
21
21
|
"@semcore/utils": "4.48.2",
|