@semcore/inline-input 4.46.1-prerelease.8 → 4.47.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 +107 -107
- package/package.json +11 -11
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.47.0] - 2025-03-21
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version minor update due to children dependencies update (`@semcore/button` [5.42.1 ~> 5.43.0]).
|
|
10
|
+
|
|
5
11
|
## [4.46.1] - 2025-03-20
|
|
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_y9k9i_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_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_y9k9i_gg_.__disabled_y9k9i_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_y9k9i_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_y9k9i_gg_:focus{outline:0}.___SValue_y9k9i_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_.__disabled_y9k9i_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_y9k9i_gg_::-webkit-inner-spin-button,.___SValue_y9k9i_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_y9k9i_gg_._type_number_y9k9i_gg_{-moz-appearance:textfield}.___SUnderline_y9k9i_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_y9k9i_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_y9k9i_gg_.__disabled_y9k9i_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_{z-index:1}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_valid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_y9k9i_gg_._state_valid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_invalid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_y9k9i_gg_._state_invalid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_:focus~.___SControls_y9k9i_gg_{display:flex}.___SInvalidPattern_y9k9i_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}" /*__inner_css_end__*/, "y9k9i_gg_") /*__reshadow_css_end__*/, {
|
|
31
|
+
"__SInlineInput": "___SInlineInput_y9k9i_gg_",
|
|
32
|
+
"_disabled": "__disabled_y9k9i_gg_",
|
|
33
|
+
"__SUnderline": "___SUnderline_y9k9i_gg_",
|
|
34
|
+
"__SAddon": "___SAddon_y9k9i_gg_",
|
|
35
|
+
"_focused": "__focused_y9k9i_gg_",
|
|
36
|
+
"_state_valid": "_state_valid_y9k9i_gg_",
|
|
37
|
+
"_state_invalid": "_state_invalid_y9k9i_gg_",
|
|
38
|
+
"__SValue": "___SValue_y9k9i_gg_",
|
|
39
|
+
"__SControls": "___SControls_y9k9i_gg_",
|
|
40
|
+
"__SInvalidPattern": "___SInvalidPattern_y9k9i_gg_",
|
|
41
|
+
"__SConfirmIcon": "___SConfirmIcon_y9k9i_gg_",
|
|
42
|
+
"__SCancelIcon": "___SCancelIcon_y9k9i_gg_",
|
|
43
|
+
"_type_number": "_type_number_y9k9i_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_y9k9i_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_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_y9k9i_gg_.__disabled_y9k9i_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_y9k9i_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_y9k9i_gg_:focus{outline:0}.___SValue_y9k9i_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_.__disabled_y9k9i_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_y9k9i_gg_::-webkit-inner-spin-button,.___SValue_y9k9i_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_y9k9i_gg_._type_number_y9k9i_gg_{-moz-appearance:textfield}.___SUnderline_y9k9i_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_y9k9i_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_y9k9i_gg_.__disabled_y9k9i_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_{z-index:1}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_valid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_y9k9i_gg_._state_valid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_invalid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_y9k9i_gg_._state_invalid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_:focus~.___SControls_y9k9i_gg_{display:flex}.___SInvalidPattern_y9k9i_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}" /*__inner_css_end__*/, "y9k9i_gg_") /*__reshadow_css_end__*/, {
|
|
24
|
+
"__SInlineInput": "___SInlineInput_y9k9i_gg_",
|
|
25
|
+
"_disabled": "__disabled_y9k9i_gg_",
|
|
26
|
+
"__SUnderline": "___SUnderline_y9k9i_gg_",
|
|
27
|
+
"__SAddon": "___SAddon_y9k9i_gg_",
|
|
28
|
+
"_focused": "__focused_y9k9i_gg_",
|
|
29
|
+
"_state_valid": "_state_valid_y9k9i_gg_",
|
|
30
|
+
"_state_invalid": "_state_invalid_y9k9i_gg_",
|
|
31
|
+
"__SValue": "___SValue_y9k9i_gg_",
|
|
32
|
+
"__SControls": "___SControls_y9k9i_gg_",
|
|
33
|
+
"__SInvalidPattern": "___SInvalidPattern_y9k9i_gg_",
|
|
34
|
+
"__SConfirmIcon": "___SConfirmIcon_y9k9i_gg_",
|
|
35
|
+
"__SCancelIcon": "___SCancelIcon_y9k9i_gg_",
|
|
36
|
+
"_type_number": "_type_number_y9k9i_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,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import k from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import R from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import E from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import
|
|
4
|
+
import f from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
5
|
import $ from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import V from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import s from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
8
|
import { sstyled as M } from "@semcore/utils/lib/core/index";
|
|
9
|
-
import K, { sstyled as
|
|
9
|
+
import K, { sstyled as m, assignProps as C, Component as D } from "@semcore/core";
|
|
10
10
|
import u from "react";
|
|
11
11
|
import { Box as I, InvalidStateBox as N } from "@semcore/flex-box";
|
|
12
12
|
import U from "@semcore/utils/lib/enhances/autoFocusEnhance";
|
|
13
13
|
import z from "@semcore/icon/Check/m";
|
|
14
|
-
import
|
|
14
|
+
import w from "@semcore/icon/Close/m";
|
|
15
15
|
import F from "@semcore/spin";
|
|
16
16
|
import { ButtonLink as B } from "@semcore/button";
|
|
17
17
|
import { localizedMessages as A } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
@@ -22,85 +22,85 @@ var j = (
|
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
23
|
(M.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
|
-
".
|
|
26
|
-
"
|
|
25
|
+
".___SInlineInput_y9k9i_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_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SConfirmIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #049B75)}}.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SInlineInput_y9k9i_gg_ .___SCancelIcon_y9k9i_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #878992)}}.___SInlineInput_y9k9i_gg_.__disabled_y9k9i_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_y9k9i_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_y9k9i_gg_:focus{outline:0}.___SValue_y9k9i_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_::placeholder{color:var(--intergalactic-text-placeholder, #8a8e9b)}.___SValue_y9k9i_gg_.__disabled_y9k9i_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SValue_y9k9i_gg_::-webkit-inner-spin-button,.___SValue_y9k9i_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SValue_y9k9i_gg_._type_number_y9k9i_gg_{-moz-appearance:textfield}.___SUnderline_y9k9i_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_y9k9i_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_y9k9i_gg_.__disabled_y9k9i_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_{z-index:1}.___SInlineInput_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_valid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_y9k9i_gg_._state_valid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_._state_invalid_y9k9i_gg_ .___SUnderline_y9k9i_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_y9k9i_gg_._state_invalid_y9k9i_gg_.__focused_y9k9i_gg_ .___SUnderline_y9k9i_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_y9k9i_gg_:focus~.___SControls_y9k9i_gg_{display:flex}.___SInvalidPattern_y9k9i_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}",
|
|
26
|
+
"y9k9i_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_y9k9i_gg_",
|
|
29
|
+
_disabled: "__disabled_y9k9i_gg_",
|
|
30
|
+
__SUnderline: "___SUnderline_y9k9i_gg_",
|
|
31
|
+
__SAddon: "___SAddon_y9k9i_gg_",
|
|
32
|
+
_focused: "__focused_y9k9i_gg_",
|
|
33
|
+
_state_valid: "_state_valid_y9k9i_gg_",
|
|
34
|
+
_state_invalid: "_state_invalid_y9k9i_gg_",
|
|
35
|
+
__SValue: "___SValue_y9k9i_gg_",
|
|
36
|
+
__SControls: "___SControls_y9k9i_gg_",
|
|
37
|
+
__SInvalidPattern: "___SInvalidPattern_y9k9i_gg_",
|
|
38
|
+
__SConfirmIcon: "___SConfirmIcon_y9k9i_gg_",
|
|
39
|
+
__SCancelIcon: "___SCancelIcon_y9k9i_gg_",
|
|
40
|
+
_type_number: "_type_number_y9k9i_gg_"
|
|
41
41
|
})
|
|
42
42
|
), O = function(n) {
|
|
43
43
|
var l = n.x, e = n.y, t = n.rect;
|
|
44
44
|
return l >= t.x && l <= t.x + t.width && e >= t.y && e <= t.y + t.height;
|
|
45
|
-
},
|
|
46
|
-
$(l,
|
|
45
|
+
}, x = /* @__PURE__ */ function(p) {
|
|
46
|
+
$(l, p);
|
|
47
47
|
var n = V(l);
|
|
48
48
|
function l() {
|
|
49
49
|
var e;
|
|
50
|
-
|
|
51
|
-
for (var t = arguments.length, c = new Array(t),
|
|
52
|
-
c[
|
|
53
|
-
return e = n.call.apply(n, [this].concat(c)), s(
|
|
50
|
+
R(this, l);
|
|
51
|
+
for (var t = arguments.length, c = new Array(t), g = 0; g < t; g++)
|
|
52
|
+
c[g] = arguments[g];
|
|
53
|
+
return e = n.call.apply(n, [this].concat(c)), s(f(e), "state", {
|
|
54
54
|
focused: !1
|
|
55
|
-
}), s(
|
|
55
|
+
}), s(f(e), "rootRef", /* @__PURE__ */ u.createRef()), s(f(e), "inputRef", /* @__PURE__ */ u.createRef()), s(f(e), "inputHandlersRef", /* @__PURE__ */ u.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
57
|
x: r.clientX,
|
|
58
58
|
y: r.clientY
|
|
59
59
|
}, e.lastHandledKeyboardEvent = -1;
|
|
60
|
-
}), s(
|
|
60
|
+
}), s(f(e), "handleDocumentKeyDown", function() {
|
|
61
61
|
e.lastMouseDownPosition = null;
|
|
62
|
-
}), s(
|
|
63
|
-
var i, o,
|
|
64
|
-
((
|
|
65
|
-
}), s(
|
|
66
|
-
var i, o,
|
|
67
|
-
((
|
|
68
|
-
}), s(
|
|
62
|
+
}), s(f(e), "increment", function(r) {
|
|
63
|
+
var a, i, o, d, _;
|
|
64
|
+
((a = e.inputRef.current) === null || a === void 0 ? void 0 : a.value) === "" && (e.inputRef.current.value = e.inputRef.current.min || "0"), (i = e.inputRef.current) === null || i === void 0 || (o = i.stepUp) === null || o === void 0 || o.call(i, r), (d = e.inputHandlersRef.current) === null || d === void 0 || d.value((_ = e.inputRef.current) === null || _ === void 0 ? void 0 : _.value, r);
|
|
65
|
+
}), s(f(e), "decrement", function(r) {
|
|
66
|
+
var a, i, o, d, _;
|
|
67
|
+
((a = e.inputRef.current) === null || a === void 0 ? void 0 : a.value) === "" && (e.inputRef.current.value = e.inputRef.current.max || "0"), (i = e.inputRef.current) === null || i === void 0 || (o = i.stepDown) === null || o === void 0 || o.call(i, r), (d = e.inputHandlersRef.current) === null || d === void 0 || d.value((_ = e.inputRef.current) === null || _ === void 0 ? void 0 : _.value, r);
|
|
68
|
+
}), s(f(e), "bindHandlerValueFocused", function(r) {
|
|
69
69
|
return function() {
|
|
70
70
|
e.setState({
|
|
71
71
|
focused: r
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
|
-
}), s(
|
|
75
|
-
var
|
|
76
|
-
r.preventDefault(), (
|
|
77
|
-
}), s(
|
|
78
|
-
var
|
|
79
|
-
(
|
|
80
|
-
}), s(
|
|
81
|
-
var
|
|
82
|
-
(
|
|
83
|
-
}), s(
|
|
84
|
-
var i, o
|
|
85
|
-
if (
|
|
74
|
+
}), s(f(e), "handleMouseDownAddon", function(r) {
|
|
75
|
+
var a;
|
|
76
|
+
r.preventDefault(), (a = e.inputRef.current) === null || a === void 0 || a.focus();
|
|
77
|
+
}), s(f(e), "handleConfirm", function(r, a) {
|
|
78
|
+
var i, o;
|
|
79
|
+
(i = (o = e.asProps).onConfirm) === null || i === void 0 || i.call(o, r, a);
|
|
80
|
+
}), s(f(e), "handleCancel", function(r, a) {
|
|
81
|
+
var i, o;
|
|
82
|
+
(i = (o = e.asProps).onCancel) === null || i === void 0 || i.call(o, r, a);
|
|
83
|
+
}), s(f(e), "handleBlur", function(r) {
|
|
84
|
+
var a, i, o = e.asProps, d = o.onConfirm, _ = o.onCancel, y = o.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 S = e.lastMouseDownPosition,
|
|
87
|
+
var S = e.lastMouseDownPosition, v = S.x, h = S.y, b = e.rootRef.current.getBoundingClientRect();
|
|
88
88
|
if (O({
|
|
89
|
-
x:
|
|
90
|
-
y:
|
|
91
|
-
rect:
|
|
89
|
+
x: v,
|
|
90
|
+
y: h,
|
|
91
|
+
rect: b
|
|
92
92
|
}))
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
y === "confirm" && (d == null || d((a = (i = e.inputRef.current) === null || i === void 0 ? void 0 : i.value) !== null && a !== void 0 ? a : "", r)), y === "cancel" && (_ == null || _(e.initValue, r));
|
|
96
96
|
}
|
|
97
|
-
}), s(
|
|
98
|
-
var
|
|
97
|
+
}), s(f(e), "handleKeyDown", function(r) {
|
|
98
|
+
var a = e.asProps, i = a.onConfirm, o = a.onCancel;
|
|
99
99
|
if (r.key === "Enter") {
|
|
100
100
|
var d, _;
|
|
101
|
-
|
|
101
|
+
i == null || i((d = (_ = e.inputRef.current) === null || _ === void 0 ? void 0 : _.value) !== null && d !== void 0 ? d : "", r), e.lastHandledKeyboardEvent = Date.now();
|
|
102
102
|
}
|
|
103
|
-
r.key === "Escape" && (
|
|
103
|
+
r.key === "Escape" && (o == null || o(e.initValue, r), e.lastHandledKeyboardEvent = Date.now());
|
|
104
104
|
}), e;
|
|
105
105
|
}
|
|
106
106
|
return E(l, [{
|
|
@@ -123,10 +123,10 @@ var j = (
|
|
|
123
123
|
}, {
|
|
124
124
|
key: "getConfirmControlProps",
|
|
125
125
|
value: function() {
|
|
126
|
-
var t, c = this.asProps,
|
|
126
|
+
var t, c = this.asProps, g = c.loading, r = c.getI18nText;
|
|
127
127
|
return {
|
|
128
128
|
value: (t = this.inputRef.current) === null || t === void 0 ? void 0 : t.value,
|
|
129
|
-
loading:
|
|
129
|
+
loading: g,
|
|
130
130
|
onConfirm: this.handleConfirm,
|
|
131
131
|
getI18nText: r
|
|
132
132
|
};
|
|
@@ -134,11 +134,11 @@ var j = (
|
|
|
134
134
|
}, {
|
|
135
135
|
key: "getCancelControlProps",
|
|
136
136
|
value: function() {
|
|
137
|
-
var t = this.asProps, c = t.loading,
|
|
137
|
+
var t = this.asProps, c = 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: c && !
|
|
141
|
+
disabled: c && !g,
|
|
142
142
|
onCancel: this.handleCancel,
|
|
143
143
|
getI18nText: r
|
|
144
144
|
};
|
|
@@ -184,29 +184,29 @@ var j = (
|
|
|
184
184
|
}, {
|
|
185
185
|
key: "render",
|
|
186
186
|
value: function() {
|
|
187
|
-
var t = this.asProps, c,
|
|
188
|
-
return c =
|
|
187
|
+
var t = this.asProps, c, g = I, r = "div", a = N, i = this.asProps, o = i.Children, d = i.styles, _ = i.state, y = this.state.focused;
|
|
188
|
+
return c = m(d), /* @__PURE__ */ u.createElement(g, c.cn("SInlineInput", k({}, C({
|
|
189
189
|
ref: this.rootRef,
|
|
190
|
-
focused:
|
|
190
|
+
focused: y,
|
|
191
191
|
onBlur: this.handleBlur
|
|
192
|
-
}, t))), /* @__PURE__ */ u.createElement(r, c.cn("SUnderline", {}), _ === "invalid" && /* @__PURE__ */ u.createElement(
|
|
192
|
+
}, t))), /* @__PURE__ */ u.createElement(r, c.cn("SUnderline", {}), _ === "invalid" && /* @__PURE__ */ u.createElement(a, c.cn("SInvalidPattern", {})), /* @__PURE__ */ u.createElement(o, c.cn("Children", {}))));
|
|
193
193
|
}
|
|
194
194
|
}]), l;
|
|
195
195
|
}(D);
|
|
196
|
-
s(
|
|
197
|
-
s(
|
|
198
|
-
s(
|
|
196
|
+
s(x, "displayName", "InlineInput");
|
|
197
|
+
s(x, "enhance", [T(A)]);
|
|
198
|
+
s(x, "defaultProps", {
|
|
199
199
|
state: "normal",
|
|
200
200
|
onBlurBehavior: "confirm",
|
|
201
201
|
i18n: A,
|
|
202
202
|
locale: "en"
|
|
203
203
|
});
|
|
204
|
-
s(
|
|
205
|
-
var
|
|
206
|
-
$(l,
|
|
204
|
+
s(x, "style", j);
|
|
205
|
+
var P = /* @__PURE__ */ function(p) {
|
|
206
|
+
$(l, p);
|
|
207
207
|
var n = V(l);
|
|
208
208
|
function l() {
|
|
209
|
-
return
|
|
209
|
+
return R(this, l), n.apply(this, arguments);
|
|
210
210
|
}
|
|
211
211
|
return E(l, [{
|
|
212
212
|
key: "uncontrolledProps",
|
|
@@ -220,81 +220,81 @@ var w = /* @__PURE__ */ function(f) {
|
|
|
220
220
|
}, {
|
|
221
221
|
key: "render",
|
|
222
222
|
value: function() {
|
|
223
|
-
var t = this.asProps, c,
|
|
224
|
-
return c =
|
|
223
|
+
var t = this.asProps, c, g = I;
|
|
224
|
+
return c = m(this.asProps.styles), /* @__PURE__ */ u.createElement(g, c.cn("SValue", k({}, C({
|
|
225
225
|
tag: "input",
|
|
226
226
|
type: "text"
|
|
227
227
|
}, t))));
|
|
228
228
|
}
|
|
229
229
|
}]), l;
|
|
230
230
|
}(D);
|
|
231
|
-
s(
|
|
231
|
+
s(P, "defaultProps", {
|
|
232
232
|
defaultValue: ""
|
|
233
233
|
});
|
|
234
|
-
s(
|
|
235
|
-
s(
|
|
234
|
+
s(P, "enhance", [U()]);
|
|
235
|
+
s(P, "hoistProps", ["disabled"]);
|
|
236
236
|
var W = function(n) {
|
|
237
237
|
var l = arguments[0], e, t = I;
|
|
238
|
-
return e =
|
|
238
|
+
return e = m(n.styles), /* @__PURE__ */ u.createElement(t, e.cn("SAddon", k({}, C({}, l))));
|
|
239
239
|
}, X = function(n) {
|
|
240
|
-
var l = arguments[0], e, t, c,
|
|
241
|
-
var
|
|
242
|
-
(
|
|
243
|
-
}, [n.onConfirm, n.value]), d = u.useCallback(function(
|
|
244
|
-
(
|
|
245
|
-
}, [
|
|
240
|
+
var l = arguments[0], e, t, c, g = I, r = n.Children, a = n.children, i = (t = n.title) !== null && t !== void 0 ? t : n.getI18nText("confirm"), o = u.useCallback(function(v) {
|
|
241
|
+
var h, b;
|
|
242
|
+
(h = n.onConfirm) === null || h === void 0 || h.call(n, (b = n.value) !== null && b !== void 0 ? b : "", v);
|
|
243
|
+
}, [n.onConfirm, n.value]), d = u.useCallback(function(v) {
|
|
244
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(), o(v));
|
|
245
|
+
}, [o]);
|
|
246
246
|
if (n.loading) {
|
|
247
247
|
var _;
|
|
248
|
-
return _ =
|
|
248
|
+
return _ = m(n.styles), /* @__PURE__ */ u.createElement(g, _.cn("SAddon", k({}, C({}, l))), a ? /* @__PURE__ */ u.createElement(r, _.cn("Children", {})) : /* @__PURE__ */ u.createElement(F, _.cn("Spin", {
|
|
249
249
|
size: "xs"
|
|
250
250
|
})));
|
|
251
251
|
}
|
|
252
|
-
var
|
|
253
|
-
return e =
|
|
252
|
+
var y = m(n.styles), S = y.cn("SConfirmIcon", {});
|
|
253
|
+
return e = m(n.styles), /* @__PURE__ */ u.createElement(g, e.cn("SAddon", k({}, C({
|
|
254
254
|
onKeyDown: d
|
|
255
|
-
}, l))),
|
|
255
|
+
}, l))), a ? /* @__PURE__ */ u.createElement(r, e.cn("Children", {})) : /* @__PURE__ */ u.createElement(B, e.cn("ButtonLink", {
|
|
256
256
|
addonLeft: (c = n.icon) !== null && c !== void 0 ? c : z,
|
|
257
257
|
use: "secondary",
|
|
258
|
-
onClick:
|
|
258
|
+
onClick: o,
|
|
259
259
|
className: S.className,
|
|
260
260
|
style: S.style,
|
|
261
|
-
"aria-label":
|
|
261
|
+
"aria-label": i
|
|
262
262
|
})));
|
|
263
263
|
}, Y = function(n) {
|
|
264
|
-
var l = arguments[0], e, t, c,
|
|
265
|
-
var
|
|
266
|
-
(
|
|
267
|
-
}, [n.onCancel, n.value]), d = u.useCallback(function(
|
|
268
|
-
(
|
|
269
|
-
}, [
|
|
264
|
+
var l = arguments[0], e, t, c, g = I, r = n.Children, a = n.children, i = (t = n.title) !== null && t !== void 0 ? t : n.getI18nText("discard"), o = u.useCallback(function(v) {
|
|
265
|
+
var h, b;
|
|
266
|
+
(h = n.onCancel) === null || h === void 0 || h.call(n, (b = n.value) !== null && b !== void 0 ? b : "", v);
|
|
267
|
+
}, [n.onCancel, n.value]), d = u.useCallback(function(v) {
|
|
268
|
+
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), v.stopPropagation(), o(v));
|
|
269
|
+
}, [o]);
|
|
270
270
|
if (n.disabled) {
|
|
271
271
|
var _;
|
|
272
|
-
return _ =
|
|
272
|
+
return _ = m(n.styles), /* @__PURE__ */ u.createElement(g, _.cn("SAddon", k({}, C({}, l))), a ? /* @__PURE__ */ u.createElement(r, _.cn("Children", {})) : /* @__PURE__ */ u.createElement(w, _.cn("CloseM", {})));
|
|
273
273
|
}
|
|
274
|
-
var
|
|
275
|
-
return e =
|
|
274
|
+
var y = m(n.styles), S = y.cn("SCancelIcon", {});
|
|
275
|
+
return e = m(n.styles), /* @__PURE__ */ u.createElement(g, e.cn("SAddon", k({}, C({
|
|
276
276
|
onKeyDown: d
|
|
277
|
-
}, l))),
|
|
277
|
+
}, l))), a ? /* @__PURE__ */ u.createElement(r, e.cn("Children", {})) : /* @__PURE__ */ u.createElement(B, e.cn("ButtonLink", {
|
|
278
278
|
use: "secondary",
|
|
279
|
-
addonLeft: (c = n.icon) !== null && c !== void 0 ? c :
|
|
280
|
-
onClick:
|
|
279
|
+
addonLeft: (c = n.icon) !== null && c !== void 0 ? c : w,
|
|
280
|
+
onClick: o,
|
|
281
281
|
className: S.className,
|
|
282
282
|
style: S.style,
|
|
283
|
-
"aria-label":
|
|
283
|
+
"aria-label": i
|
|
284
284
|
})));
|
|
285
285
|
}, q = function(n) {
|
|
286
286
|
var l = arguments[0], e, t = H.Value;
|
|
287
|
-
return e =
|
|
287
|
+
return e = m(n.styles), /* @__PURE__ */ u.createElement(t, e.cn("SValue", k({}, C({}, l))));
|
|
288
288
|
};
|
|
289
|
-
function G(
|
|
289
|
+
function G(p) {
|
|
290
290
|
var n = arguments[0], l, e = H.Controls;
|
|
291
|
-
return l =
|
|
291
|
+
return l = m(p.styles), /* @__PURE__ */ u.createElement(e, l.cn("SControls", k({}, C({
|
|
292
292
|
tag: J.Addon
|
|
293
293
|
}, n))));
|
|
294
294
|
}
|
|
295
|
-
var J = K(
|
|
295
|
+
var J = K(x, {
|
|
296
296
|
Addon: W,
|
|
297
|
-
Value:
|
|
297
|
+
Value: P,
|
|
298
298
|
ConfirmControl: X,
|
|
299
299
|
CancelControl: Y,
|
|
300
300
|
NumberValue: q,
|
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.47.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",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "5.41.1
|
|
18
|
-
"@semcore/icon": "4.60.1
|
|
19
|
-
"@semcore/spin": "5.41.1
|
|
20
|
-
"@semcore/tooltip": "6.49.1
|
|
21
|
-
"@semcore/utils": "4.48.1
|
|
22
|
-
"@semcore/input-number": "5.41.1
|
|
23
|
-
"@semcore/input": "4.42.1
|
|
24
|
-
"@semcore/core": "2.39.1
|
|
25
|
-
"@semcore/button": "5.
|
|
17
|
+
"@semcore/flex-box": "5.41.1",
|
|
18
|
+
"@semcore/icon": "4.60.1",
|
|
19
|
+
"@semcore/spin": "5.41.1",
|
|
20
|
+
"@semcore/tooltip": "6.49.1",
|
|
21
|
+
"@semcore/utils": "4.48.1",
|
|
22
|
+
"@semcore/input-number": "5.41.1",
|
|
23
|
+
"@semcore/input": "4.42.1",
|
|
24
|
+
"@semcore/core": "2.39.1",
|
|
25
|
+
"@semcore/button": "5.43.0-prerelease.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "18.0.21",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@semcore/tooltip": "*"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@semcore/core": "^2.
|
|
34
|
+
"@semcore/core": "^2.17.5",
|
|
35
35
|
"react": "16.8 - 18",
|
|
36
36
|
"react-dom": "16.8 - 18"
|
|
37
37
|
},
|