@semcore/inline-input 16.3.0-prerelease.1 → 16.3.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/lib/cjs/InlineInput.js +31 -37
- package/lib/cjs/InlineInput.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/index.type.js.map +1 -1
- package/lib/cjs/style/inline-input.shadow.css +9 -9
- package/lib/es6/InlineInput.js +25 -31
- package/lib/es6/InlineInput.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/index.type.js.map +1 -1
- package/lib/es6/style/inline-input.shadow.css +9 -9
- package/lib/esm/InlineInput.mjs +28 -33
- package/lib/esm/style/inline-input.shadow.css +9 -9
- package/lib/types/index.d.ts +2 -2
- package/lib/types/index.type.d.ts +2 -48
- package/package.json +12 -12
package/lib/esm/InlineInput.mjs
CHANGED
|
@@ -4,12 +4,11 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
4
4
|
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import {
|
|
7
|
+
import { sstyled, assignProps, Component, createComponent } from "@semcore/core";
|
|
8
|
+
import { Box, InvalidStateBox } from "@semcore/base-components";
|
|
8
9
|
import { ButtonLink } from "@semcore/button";
|
|
9
|
-
import autoFocusEnhance from "@semcore/core/lib/utils/enhances/autoFocusEnhance";
|
|
10
10
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
11
|
import { hasParent } from "@semcore/core/lib/utils/hasParent";
|
|
12
|
-
import { Box, InvalidStateBox } from "@semcore/flex-box";
|
|
13
12
|
import CheckM from "@semcore/icon/Check/m";
|
|
14
13
|
import CloseM from "@semcore/icon/Close/m";
|
|
15
14
|
import InputNumber from "@semcore/input-number";
|
|
@@ -21,23 +20,24 @@ var style = (
|
|
|
21
20
|
/*__reshadow_css_start__*/
|
|
22
21
|
(sstyled.insert(
|
|
23
22
|
/*__inner_css_start__*/
|
|
24
|
-
".
|
|
23
|
+
".___SInlineInput_eqf7o_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, rgb(255, 255, 255))}.___SInlineInput_eqf7o_gg_ .___SConfirmIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-success, rgb(0, 190, 142));cursor:pointer}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_ .___SConfirmIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-success, rgb(0, 190, 142))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_ .___SConfirmIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-success, color(display-p3 0.33388 0.7337 0.56959))}}}@media (hover:hover){.___SInlineInput_eqf7o_gg_ .___SConfirmIcon_eqf7o_gg_:not(.__color_eqf7o_gg_):hover{color:var(--intergalactic-icon-secondary-success-hover-active, rgb(1, 176, 131))}}.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385));cursor:pointer}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_){color:var(--intergalactic-icon-secondary-neutral, color(display-p3 0.0036 0.02041 0.00996 / 0.385))}}}@media (hover:hover){.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, rgba(0, 5, 2, 0.433))}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, rgba(0, 5, 2, 0.433))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_ .___SCancelIcon_eqf7o_gg_:not(.__color_eqf7o_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, color(display-p3 0.00333 0.01824 0.00791 / 0.433))}}}}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_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, rgba(1, 5, 0, 0.899));font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_:focus,.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_:focus-visible{outline:0}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, rgba(0, 5, 2, 0.457))}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_::placeholder{color:var(--intergalactic-text-placeholder, rgba(0, 5, 2, 0.457))}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_.__disabled_eqf7o_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_::-webkit-inner-spin-button,.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SInlineInput_eqf7o_gg_ .___SValue_eqf7o_gg_._type_number_eqf7o_gg_{-moz-appearance:textfield}.___SUnderline_eqf7o_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, rgba(0, 12, 8, 0.161))}@supports (color:color(display-p3 0 0 0%)){.___SUnderline_eqf7o_gg_{border-bottom:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SUnderline_eqf7o_gg_{border-bottom:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SAddon_eqf7o_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385));padding:0 var(--intergalactic-spacing-1x, 4px)}@supports (color:color(display-p3 0 0 0%)){.___SAddon_eqf7o_gg_{color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385))}@media (color-gamut:p3){.___SAddon_eqf7o_gg_{color:var(--intergalactic-icon-secondary-neutral, color(display-p3 0.0036 0.02041 0.00996 / 0.385))}}}.___SAddon_eqf7o_gg_.__disabled_eqf7o_gg_,.___SInlineInput_eqf7o_gg_.__disabled_eqf7o_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}.___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-info-active, rgb(135, 150, 239));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SUnderline_eqf7o_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SUnderline_eqf7o_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-success-active, rgb(0, 185, 145))}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-success-active, rgb(0, 185, 145))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-success-active, color(display-p3 0.21847 0.73243 0.56937))}}}.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-success-active, rgb(0, 185, 145));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-success-active, rgb(0, 185, 145));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-success-active, color(display-p3 0.21847 0.73243 0.56937));outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}@supports (color:oklab(0%0 0%)){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline, rgb(0, 190, 142))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_._state_valid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9))}}}.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100))}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_{border-bottom-color:var(--intergalactic-border-critical-active, color(display-p3 0.95478 0.398 0.38923))}}}.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469));outline-style:solid;outline-width:2px;outline-offset:2px;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:outline-color,outline-width,outline-offset}@supports (color:color(display-p3 0 0 0%)){.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-critical-active, rgb(255, 99, 100));outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 32, 221, 0.469))}@media (color-gamut:p3){.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){border-bottom-color:var(--intergalactic-border-critical-active, color(display-p3 0.95478 0.398 0.38923));outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}@supports (color:oklab(0%0 0%)){.___SInlineInput_eqf7o_gg_._state_invalid_eqf7o_gg_ .___SUnderline_eqf7o_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652))}}.___SValue_eqf7o_gg_:focus~.___SControls_eqf7o_gg_{display:flex}.___SInvalidPattern_eqf7o_gg_{margin-left:-1px;margin-top:-1px;border-radius:0;height:calc(100% - 3px)}",
|
|
25
24
|
/*__inner_css_end__*/
|
|
26
|
-
"
|
|
25
|
+
"eqf7o_gg_"
|
|
27
26
|
), /*__reshadow_css_end__*/
|
|
28
27
|
{
|
|
29
|
-
"__SInlineInput": "
|
|
30
|
-
"_disabled": "
|
|
31
|
-
"__SUnderline": "
|
|
32
|
-
"__SAddon": "
|
|
33
|
-
"_state_valid": "
|
|
34
|
-
"_state_invalid": "
|
|
35
|
-
"__SValue": "
|
|
36
|
-
"__SControls": "
|
|
37
|
-
"__SInvalidPattern": "
|
|
38
|
-
"__SConfirmIcon": "
|
|
39
|
-
"
|
|
40
|
-
"
|
|
28
|
+
"__SInlineInput": "___SInlineInput_eqf7o_gg_",
|
|
29
|
+
"_disabled": "__disabled_eqf7o_gg_",
|
|
30
|
+
"__SUnderline": "___SUnderline_eqf7o_gg_",
|
|
31
|
+
"__SAddon": "___SAddon_eqf7o_gg_",
|
|
32
|
+
"_state_valid": "_state_valid_eqf7o_gg_",
|
|
33
|
+
"_state_invalid": "_state_invalid_eqf7o_gg_",
|
|
34
|
+
"__SValue": "___SValue_eqf7o_gg_",
|
|
35
|
+
"__SControls": "___SControls_eqf7o_gg_",
|
|
36
|
+
"__SInvalidPattern": "___SInvalidPattern_eqf7o_gg_",
|
|
37
|
+
"__SConfirmIcon": "___SConfirmIcon_eqf7o_gg_",
|
|
38
|
+
"_color": "__color_eqf7o_gg_",
|
|
39
|
+
"__SCancelIcon": "___SCancelIcon_eqf7o_gg_",
|
|
40
|
+
"_type_number": "_type_number_eqf7o_gg_"
|
|
41
41
|
})
|
|
42
42
|
);
|
|
43
43
|
var pointInsideOfRect = function pointInsideOfRect2(_ref15) {
|
|
@@ -54,7 +54,6 @@ var InlineInputBase = /* @__PURE__ */ (function(_Component) {
|
|
|
54
54
|
_this = _callSuper(this, InlineInputBase2, [].concat(args));
|
|
55
55
|
_defineProperty(_this, "rootRef", /* @__PURE__ */ React.createRef());
|
|
56
56
|
_defineProperty(_this, "inputRef", /* @__PURE__ */ React.createRef());
|
|
57
|
-
_defineProperty(_this, "inputHandlersRef", /* @__PURE__ */ React.createRef());
|
|
58
57
|
_defineProperty(_this, "initValue", "");
|
|
59
58
|
_defineProperty(_this, "lastMouseDownPosition", null);
|
|
60
59
|
_defineProperty(_this, "lastHandledKeyboardEvent", -1);
|
|
@@ -69,21 +68,19 @@ var InlineInputBase = /* @__PURE__ */ (function(_Component) {
|
|
|
69
68
|
_this.lastMouseDownPosition = null;
|
|
70
69
|
});
|
|
71
70
|
_defineProperty(_this, "increment", function(event) {
|
|
72
|
-
var _this$inputRef$curren, _this$inputRef$curren2, _this$inputRef$curren3
|
|
71
|
+
var _this$inputRef$curren, _this$inputRef$curren2, _this$inputRef$curren3;
|
|
73
72
|
if (((_this$inputRef$curren = _this.inputRef.current) === null || _this$inputRef$curren === void 0 ? void 0 : _this$inputRef$curren.value) === "") _this.inputRef.current.value = _this.inputRef.current.min || "0";
|
|
74
73
|
(_this$inputRef$curren2 = _this.inputRef.current) === null || _this$inputRef$curren2 === void 0 || (_this$inputRef$curren3 = _this$inputRef$curren2.stepUp) === null || _this$inputRef$curren3 === void 0 || _this$inputRef$curren3.call(_this$inputRef$curren2, event);
|
|
75
|
-
(_this$inputHandlersRe = _this.inputHandlersRef.current) === null || _this$inputHandlersRe === void 0 || _this$inputHandlersRe.value((_this$inputRef$curren4 = _this.inputRef.current) === null || _this$inputRef$curren4 === void 0 ? void 0 : _this$inputRef$curren4.value, event);
|
|
76
74
|
});
|
|
77
75
|
_defineProperty(_this, "decrement", function(event) {
|
|
78
|
-
var _this$inputRef$
|
|
79
|
-
if (((_this$inputRef$
|
|
80
|
-
(_this$inputRef$
|
|
81
|
-
(_this$inputHandlersRe2 = _this.inputHandlersRef.current) === null || _this$inputHandlersRe2 === void 0 || _this$inputHandlersRe2.value((_this$inputRef$curren8 = _this.inputRef.current) === null || _this$inputRef$curren8 === void 0 ? void 0 : _this$inputRef$curren8.value, event);
|
|
76
|
+
var _this$inputRef$curren4, _this$inputRef$curren5, _this$inputRef$curren6;
|
|
77
|
+
if (((_this$inputRef$curren4 = _this.inputRef.current) === null || _this$inputRef$curren4 === void 0 ? void 0 : _this$inputRef$curren4.value) === "") _this.inputRef.current.value = _this.inputRef.current.max || "0";
|
|
78
|
+
(_this$inputRef$curren5 = _this.inputRef.current) === null || _this$inputRef$curren5 === void 0 || (_this$inputRef$curren6 = _this$inputRef$curren5.stepDown) === null || _this$inputRef$curren6 === void 0 || _this$inputRef$curren6.call(_this$inputRef$curren5, event);
|
|
82
79
|
});
|
|
83
80
|
_defineProperty(_this, "handleMouseDownAddon", function(event) {
|
|
84
|
-
var _this$inputRef$
|
|
81
|
+
var _this$inputRef$curren7;
|
|
85
82
|
event.preventDefault();
|
|
86
|
-
(_this$inputRef$
|
|
83
|
+
(_this$inputRef$curren7 = _this.inputRef.current) === null || _this$inputRef$curren7 === void 0 || _this$inputRef$curren7.focus();
|
|
87
84
|
});
|
|
88
85
|
_defineProperty(_this, "handleConfirm", function(text, event) {
|
|
89
86
|
var _this$asProps$onConfi, _this$asProps;
|
|
@@ -94,7 +91,7 @@ var InlineInputBase = /* @__PURE__ */ (function(_Component) {
|
|
|
94
91
|
(_this$asProps$onCance = (_this$asProps2 = _this.asProps).onCancel) === null || _this$asProps$onCance === void 0 || _this$asProps$onCance.call(_this$asProps2, prevText, event);
|
|
95
92
|
});
|
|
96
93
|
_defineProperty(_this, "handleBlur", function(event) {
|
|
97
|
-
var _this$inputRef$
|
|
94
|
+
var _this$inputRef$curren8, _this$inputRef$curren9;
|
|
98
95
|
var _this$asProps3 = _this.asProps, onConfirm = _this$asProps3.onConfirm, onCancel = _this$asProps3.onCancel, onBlurBehavior = _this$asProps3.onBlurBehavior;
|
|
99
96
|
if (!onBlurBehavior) return;
|
|
100
97
|
if (Date.now() - _this.lastHandledKeyboardEvent < 250) return;
|
|
@@ -110,14 +107,14 @@ var InlineInputBase = /* @__PURE__ */ (function(_Component) {
|
|
|
110
107
|
return;
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
|
-
if (onBlurBehavior === "confirm") onConfirm === null || onConfirm === void 0 || onConfirm((_this$inputRef$
|
|
110
|
+
if (onBlurBehavior === "confirm") onConfirm === null || onConfirm === void 0 || onConfirm((_this$inputRef$curren8 = (_this$inputRef$curren9 = _this.inputRef.current) === null || _this$inputRef$curren9 === void 0 ? void 0 : _this$inputRef$curren9.value) !== null && _this$inputRef$curren8 !== void 0 ? _this$inputRef$curren8 : "", event);
|
|
114
111
|
if (onBlurBehavior === "cancel") onCancel === null || onCancel === void 0 || onCancel(_this.initValue, event);
|
|
115
112
|
});
|
|
116
113
|
_defineProperty(_this, "handleKeyDown", function(event) {
|
|
117
114
|
var _this$asProps4 = _this.asProps, onConfirm = _this$asProps4.onConfirm, onCancel = _this$asProps4.onCancel;
|
|
118
115
|
if (event.key === "Enter") {
|
|
119
|
-
var _this$inputRef$
|
|
120
|
-
onConfirm === null || onConfirm === void 0 || onConfirm((_this$inputRef$
|
|
116
|
+
var _this$inputRef$curren0, _this$inputRef$curren1;
|
|
117
|
+
onConfirm === null || onConfirm === void 0 || onConfirm((_this$inputRef$curren0 = (_this$inputRef$curren1 = _this.inputRef.current) === null || _this$inputRef$curren1 === void 0 ? void 0 : _this$inputRef$curren1.value) !== null && _this$inputRef$curren0 !== void 0 ? _this$inputRef$curren0 : "", event);
|
|
121
118
|
_this.lastHandledKeyboardEvent = Date.now();
|
|
122
119
|
}
|
|
123
120
|
if (event.key === "Escape") {
|
|
@@ -199,7 +196,6 @@ var InlineInputBase = /* @__PURE__ */ (function(_Component) {
|
|
|
199
196
|
return {
|
|
200
197
|
numberFormatter,
|
|
201
198
|
inputRef: this.inputRef,
|
|
202
|
-
inputHandlerRefs: this.inputHandlersRef,
|
|
203
199
|
increment: this.increment,
|
|
204
200
|
decrement: this.decrement
|
|
205
201
|
};
|
|
@@ -279,8 +275,6 @@ var Value = /* @__PURE__ */ (function(_Component2) {
|
|
|
279
275
|
_defineProperty(Value, "defaultProps", {
|
|
280
276
|
defaultValue: ""
|
|
281
277
|
});
|
|
282
|
-
_defineProperty(Value, "enhance", [autoFocusEnhance()]);
|
|
283
|
-
_defineProperty(Value, "hoistProps", ["disabled"]);
|
|
284
278
|
function Addon(props) {
|
|
285
279
|
var _ref3 = arguments[0], _ref0;
|
|
286
280
|
var SAddon = Box;
|
|
@@ -359,6 +353,7 @@ function NumberValue(props) {
|
|
|
359
353
|
var SValue = InputNumber.Value;
|
|
360
354
|
return _ref13 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SValue, _ref13.cn("SValue", _objectSpread({}, assignProps({}, _ref6))));
|
|
361
355
|
}
|
|
356
|
+
;
|
|
362
357
|
function NumberControls(props) {
|
|
363
358
|
var _ref7 = arguments[0], _ref14;
|
|
364
359
|
var SControls = InputNumber.Controls;
|
|
@@ -12,21 +12,21 @@ SInlineInput {
|
|
|
12
12
|
|
|
13
13
|
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
14
14
|
|
|
15
|
-
SConfirmIcon {
|
|
15
|
+
SConfirmIcon:not([color]) {
|
|
16
16
|
color: var(--intergalactic-icon-secondary-success, oklch(0.711 0.146 166.9));
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
SConfirmIcon:hover {
|
|
20
|
+
SConfirmIcon:not([color]):hover {
|
|
21
21
|
color: var(--intergalactic-icon-secondary-success-hover-active, oklch(0.673 0.139 166.3));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
SCancelIcon {
|
|
24
|
+
SCancelIcon:not([color]) {
|
|
25
25
|
color: var(--intergalactic-icon-secondary-neutral, oklch(0.104 0.023 162.3 / 0.385));
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
SCancelIcon:hover {
|
|
29
|
+
SCancelIcon:not([color]):hover {
|
|
30
30
|
color: var(--intergalactic-icon-secondary-neutral-hover-active, oklch(0.1 0.023 159.1 / 0.433));
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -106,26 +106,26 @@ SAddon[disabled] {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
SUnderline:has(input:focus-visible) {
|
|
109
|
-
border-bottom-color: var(--intergalactic-border-info-active, oklch(0.
|
|
109
|
+
border-bottom-color: var(--intergalactic-border-info-active, oklch(0.7 0.131 275.2));
|
|
110
110
|
@mixin focus-outline-mixin;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
SInlineInput[state='valid'] SUnderline {
|
|
114
|
-
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.
|
|
114
|
+
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
SInlineInput[state='valid'] SUnderline:has(input:focus-visible) {
|
|
118
|
-
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.
|
|
118
|
+
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
119
119
|
@mixin focus-outline-mixin;
|
|
120
120
|
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
SInlineInput[state='invalid'] SUnderline {
|
|
124
|
-
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.
|
|
124
|
+
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
SInlineInput[state='invalid'] SUnderline:has(input:focus-visible) {
|
|
128
|
-
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.
|
|
128
|
+
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
129
129
|
@mixin focus-outline-mixin;
|
|
130
130
|
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
131
131
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InlineInputProps } from './index.type';
|
|
1
|
+
import type { InlineInputProps, InlineInputValueProps } from './index.type';
|
|
2
2
|
import InlineInputBase from './InlineInput';
|
|
3
3
|
export default InlineInputBase;
|
|
4
|
-
export type { InlineInputProps };
|
|
4
|
+
export type { InlineInputProps, InlineInputValueProps };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
import type { BoxProps } from '@semcore/base-components';
|
|
1
2
|
import type { ButtonLinkComponent } from '@semcore/button';
|
|
2
|
-
import type { PropGetterFn,
|
|
3
|
-
import type { BoxProps } from '@semcore/flex-box';
|
|
3
|
+
import type { PropGetterFn, Intergalactic } from '@semcore/core';
|
|
4
4
|
import type { InputNumberControlsProps } from '@semcore/input-number';
|
|
5
5
|
import type React from 'react';
|
|
6
|
-
/** @deprecated */
|
|
7
|
-
export interface IInlineInputProps extends InlineInputProps, UnknownProperties {
|
|
8
|
-
}
|
|
9
6
|
export type InlineInputProps = BoxProps & {
|
|
10
7
|
/**
|
|
11
8
|
* Visual state of inline input
|
|
@@ -30,27 +27,6 @@ export type InlineInputProps = BoxProps & {
|
|
|
30
27
|
* Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
|
|
31
28
|
*/
|
|
32
29
|
onCancel?: (prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
|
|
33
|
-
/**
|
|
34
|
-
* Text value of input. Should be used with `onChange` property together
|
|
35
|
-
* @deprecated
|
|
36
|
-
*/
|
|
37
|
-
value?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Initial text value of input
|
|
40
|
-
* @deprecated
|
|
41
|
-
*/
|
|
42
|
-
defaultValue?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Makes component to catch browser focus on component mount
|
|
45
|
-
* @default false
|
|
46
|
-
* @deprecated
|
|
47
|
-
*/
|
|
48
|
-
autoFocus?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Gray text displayed in empty input
|
|
51
|
-
* @deprecated
|
|
52
|
-
*/
|
|
53
|
-
placeholder?: string;
|
|
54
30
|
/**
|
|
55
31
|
* defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
|
|
56
32
|
* Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
|
|
@@ -59,13 +35,7 @@ export type InlineInputProps = BoxProps & {
|
|
|
59
35
|
/** Specifies the locale for i18n support */
|
|
60
36
|
locale?: string;
|
|
61
37
|
};
|
|
62
|
-
/** @deprecated */
|
|
63
|
-
export interface IInlineInputAddonProps extends InlineInputAddonProps, UnknownProperties {
|
|
64
|
-
}
|
|
65
38
|
export type InlineInputAddonProps = BoxProps & {};
|
|
66
|
-
/** @deprecated */
|
|
67
|
-
export interface IInlineInputValueProps extends InlineInputValueProps, UnknownProperties {
|
|
68
|
-
}
|
|
69
39
|
export type InlineInputValueProps = BoxProps & {
|
|
70
40
|
/**
|
|
71
41
|
* id attribute of input tag
|
|
@@ -87,16 +57,6 @@ export type InlineInputValueProps = BoxProps & {
|
|
|
87
57
|
* callback invoked on every change of input tag value
|
|
88
58
|
*/
|
|
89
59
|
onChange?: (value: string, event: React.ChangeEvent) => void;
|
|
90
|
-
/**
|
|
91
|
-
* visual state of component
|
|
92
|
-
* @deprecated
|
|
93
|
-
*/
|
|
94
|
-
state?: 'normal' | 'valid' | 'invalid';
|
|
95
|
-
/**
|
|
96
|
-
* shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
|
|
97
|
-
* @deprecated
|
|
98
|
-
*/
|
|
99
|
-
loading?: boolean;
|
|
100
60
|
/**
|
|
101
61
|
* disables interactive elements
|
|
102
62
|
*/
|
|
@@ -106,9 +66,6 @@ export type InlineInputValueProps = BoxProps & {
|
|
|
106
66
|
*/
|
|
107
67
|
placeholder?: string;
|
|
108
68
|
};
|
|
109
|
-
/** @deprecated */
|
|
110
|
-
export interface IInlineInputConfirmControlProps extends InlineInputConfirmControlProps, UnknownProperties {
|
|
111
|
-
}
|
|
112
69
|
export type InlineInputConfirmControlProps = BoxProps & {
|
|
113
70
|
/**
|
|
114
71
|
* Text of tooltip
|
|
@@ -121,9 +78,6 @@ export type InlineInputConfirmControlProps = BoxProps & {
|
|
|
121
78
|
*/
|
|
122
79
|
icon?: React.FC;
|
|
123
80
|
};
|
|
124
|
-
/** @deprecated */
|
|
125
|
-
export interface IInlineInputCancelControlProps extends InlineInputCancelControlProps, UnknownProperties {
|
|
126
|
-
}
|
|
127
81
|
export type InlineInputCancelControlProps = BoxProps & {
|
|
128
82
|
/**
|
|
129
83
|
* Text of tooltip
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/inline-input",
|
|
3
3
|
"description": "Semrush Input Component",
|
|
4
|
-
"version": "16.3.0
|
|
4
|
+
"version": "16.3.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "16.1.0
|
|
18
|
-
"@semcore/icon": "16.8.0
|
|
19
|
-
"@semcore/spin": "16.1.0
|
|
20
|
-
"@semcore/tooltip": "16.1.0
|
|
21
|
-
"@semcore/input-number": "16.1.0
|
|
22
|
-
"@semcore/input": "16.2.0
|
|
23
|
-
"@semcore/button": "16.1.0
|
|
17
|
+
"@semcore/flex-box": "16.1.0",
|
|
18
|
+
"@semcore/icon": "16.8.0",
|
|
19
|
+
"@semcore/spin": "16.1.0",
|
|
20
|
+
"@semcore/tooltip": "16.1.0",
|
|
21
|
+
"@semcore/input-number": "16.1.0",
|
|
22
|
+
"@semcore/input": "16.2.0",
|
|
23
|
+
"@semcore/button": "16.1.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@semcore/core": "16.6.0
|
|
27
|
-
"@semcore/spin": "16.1.0-prerelease.1",
|
|
26
|
+
"@semcore/core": "16.6.0",
|
|
28
27
|
"@semcore/testing-utils": "1.0.0",
|
|
29
|
-
"@semcore/
|
|
28
|
+
"@semcore/spin": "16.1.0",
|
|
29
|
+
"@semcore/tooltip": "16.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@semcore/base-components": "^16.6.0
|
|
32
|
+
"@semcore/base-components": "^16.6.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|