@semcore/inline-input 17.3.0 → 18.0.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 +17 -18
- package/lib/cjs/InlineInput.js.map +1 -1
- package/lib/cjs/style/inline-input.shadow.css +59 -35
- package/lib/es6/InlineInput.js +18 -19
- package/lib/es6/InlineInput.js.map +1 -1
- package/lib/es6/style/inline-input.shadow.css +59 -35
- package/lib/esm/InlineInput.mjs +19 -20
- package/lib/esm/style/inline-input.shadow.css +59 -35
- package/lib/types/InlineInput.d.ts.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
package/lib/cjs/InlineInput.js
CHANGED
|
@@ -19,22 +19,23 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
19
19
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
20
20
|
var _Value;
|
|
21
21
|
/*!__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
22
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
22
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SInlineInput_1t5br_gg_{display:inline-flex;width:-moz-fit-content;width:fit-content;max-width:100%;height:100%;align-items:center;position:relative;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,#00d9a5e5)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,oklch(.787 .16 167.8/.898))}}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-success-hover-active,oklch(.673 .139 166.3))}}.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262))}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,#0005026e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,oklch(.1 .023 159.1/.433))}}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_{flex:0 1 auto;min-width:0;max-width:100%;width:auto;height:100%;padding:var(--intergalactic-spacing-1x,4px);border:none;box-sizing:border-box;color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:#0000;min-height:1em;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));text-underline-offset:17%}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus-visible{outline:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,#00060356)}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,#00060356)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_.__disabled_1t5br_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-inner-spin-button,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_._type_number_1t5br_gg_{-moz-appearance:textfield}.___SInlineInput_1t5br_gg_.__disabled_1t5br_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity,.4)}.___SUnderline_1t5br_gg_{display:flex;align-items:center;min-width:0;width:100%;height:100%;min-height:1em;border:1px solid #0000;border-radius:var(--intergalactic-control-rounded,6px);outline-color:#0000;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:background-color}@media (hover:hover){.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) .___SUnderline_1t5br_gg_{background-color:var(--intergalactic-control-secondary-neutral,oklch(.166 .031 175.8/.097))}.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) :is(.___SAddon_1t5br_gg_,.___SValue_1t5br_gg_){cursor:pointer}}.___SAddon_1t5br_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262));padding:0 var(--intergalactic-spacing-content-gap-small,4px)}.___SAddon_1t5br_gg_.__disabled_1t5br_gg_{opacity:var(--intergalactic-disabled-opacity,.4);cursor:default;pointer-events:none}[data-ui-name=\"InlineInput.CancelControl\"]{padding-left:0}.___SInlineInput_1t5br_gg_:not(:focus-within):not(.__loading_1t5br_gg_) :is([data-ui-name=\"InlineInput.CancelControl\"],[data-ui-name=\"InlineInput.ConfirmControl\"]){display:none}.___SUnderline_1t5br_gg_:has(input:focus-visible){background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));outline-color:var(--intergalactic-keyboard-focus-outline,#0020dd78);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;outline-offset:0;transition-property:outline-color,outline-width}@media (color-gamut:p3){.___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-outline,oklch(.424 .269 264.2/.469))}}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,#00be8e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,oklch(.711 .146 166.9))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-invalid-outline,oklch(.628 .257 28.9/.652))}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,#00b991)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,oklch(.7 .166 170))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,#ff6364)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,oklch(.7 .21 23))}}.___SInlineInput_1t5br_gg_.__state_1t5br_gg_:focus-within .___SValue_1t5br_gg_{text-decoration-color:#0000}.___SValue_1t5br_gg_:focus~.___SControls_1t5br_gg_{display:flex}@supports (field-sizing:content){.___SValue_1t5br_gg_{field-sizing:content}}", /*__inner_css_end__*/"1t5br_gg_"),
|
|
23
23
|
/*__reshadow_css_end__*/
|
|
24
24
|
{
|
|
25
|
-
"__SInlineInput": "
|
|
26
|
-
"_disabled": "
|
|
27
|
-
"__SUnderline": "
|
|
28
|
-
"__SAddon": "
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
25
|
+
"__SInlineInput": "___SInlineInput_1t5br_gg_",
|
|
26
|
+
"_disabled": "__disabled_1t5br_gg_",
|
|
27
|
+
"__SUnderline": "___SUnderline_1t5br_gg_",
|
|
28
|
+
"__SAddon": "___SAddon_1t5br_gg_",
|
|
29
|
+
"__SValue": "___SValue_1t5br_gg_",
|
|
30
|
+
"_loading": "__loading_1t5br_gg_",
|
|
31
|
+
"_state_valid": "_state_valid_1t5br_gg_",
|
|
32
|
+
"_state_invalid": "_state_invalid_1t5br_gg_",
|
|
33
|
+
"_state": "__state_1t5br_gg_",
|
|
34
|
+
"__SControls": "___SControls_1t5br_gg_",
|
|
35
|
+
"__SConfirmIcon": "___SConfirmIcon_1t5br_gg_",
|
|
36
|
+
"_color": "__color_1t5br_gg_",
|
|
37
|
+
"__SCancelIcon": "___SCancelIcon_1t5br_gg_",
|
|
38
|
+
"_type_number": "_type_number_1t5br_gg_"
|
|
38
39
|
});
|
|
39
40
|
const pointInsideOfRect = ({
|
|
40
41
|
x,
|
|
@@ -222,18 +223,16 @@ class InlineInputBase extends _core.Component {
|
|
|
222
223
|
_ref8;
|
|
223
224
|
const SInlineInput = _baseComponents.Box;
|
|
224
225
|
const SUnderline = 'div';
|
|
225
|
-
const SInvalidPattern = _baseComponents.InvalidStateBox;
|
|
226
226
|
const {
|
|
227
227
|
Children,
|
|
228
|
-
styles
|
|
229
|
-
state
|
|
228
|
+
styles
|
|
230
229
|
} = this.asProps;
|
|
231
230
|
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SInlineInput, _ref8.cn("SInlineInput", {
|
|
232
231
|
...(0, _core.assignProps)({
|
|
233
232
|
"ref": this.rootRef,
|
|
234
233
|
"onBlur": this.handleBlur
|
|
235
234
|
}, _ref)
|
|
236
|
-
}), /*#__PURE__*/_react.default.createElement(SUnderline, _ref8.cn("SUnderline", {}),
|
|
235
|
+
}), /*#__PURE__*/_react.default.createElement(SUnderline, _ref8.cn("SUnderline", {}), /*#__PURE__*/_react.default.createElement(Children, _ref8.cn("Children", {}))));
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
238
|
(0, _defineProperty2.default)(InlineInputBase, "displayName", 'InlineInput');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineInput.js","names":["_core","require","_baseComponents","_button","_i18nEnhance","_interopRequireDefault","_hasParent","_m","_m2","_inputNumber","_spin","_react","_intergalacticDynamicLocales","_Value","style","sstyled","insert","pointInsideOfRect","x","y","rect","width","height","InlineInputBase","Component","constructor","args","_defineProperty2","default","React","createRef","event","lastMouseDownPosition","clientX","clientY","lastHandledKeyboardEvent","inputRef","current","value","min","stepUp","max","stepDown","preventDefault","focus","text","asProps","onConfirm","prevText","onCancel","onBlurBehavior","Date","now","hasParent","relatedTarget","rootRef","lastInteraction","isKeyboard","isTab","initValue","getBoundingClientRect","key","componentDidMount","updateInert","document","body","addEventListener","handleDocumentMouseDown","handleDocumentKeyDown","componentDidUpdate","prevProps","disabled","componentWillUnmount","removeEventListener","getAddonProps","onMouseDown","handleMouseDownAddon","getConfirmControlProps","loading","getI18nText","handleConfirm","handleCancel","getCancelControlProps","getValueProps","state","ref","onKeyDown","handleKeyDown","getNumberValueProps","numberFormatter","Intl","NumberFormat","locale","increment","decrement","getNumberControlsProps","setAttribute","removeAttribute","render","_ref","_ref8","SInlineInput","Box","SUnderline","SInvalidPattern","InvalidStateBox","Children","styles","createElement","cn","assignProps","handleBlur","i18nEnhance","localizedMessages","i18n","Value","uncontrolledProps","target","_ref2","_ref9","SValue","defaultValue","Addon","props","_ref3","arguments[0]","_ref0","SAddon","ConfirmControl","_ref4","_ref10","children","hasChildren","title","useCallback","handleKeydown","stopPropagation","_ref1","sstyles","sConfirmIconStyles","ButtonLink","icon","CheckM","className","CancelControl","_ref5","_ref12","_ref11","sCancelIconStyles","CloseM","NumberValue","_ref6","_ref13","InputNumber","NumberControls","_ref7","_ref14","SControls","Controls","InlineInput","createComponent","_default","exports"],"sources":["../../src/InlineInput.tsx"],"sourcesContent":["import { Box, InvalidStateBox } from '@semcore/base-components';\nimport { ButtonLink } from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root, lastInteraction } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport CheckM from '@semcore/icon/Check/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport InputNumber from '@semcore/input-number';\nimport Spin from '@semcore/spin';\nimport React from 'react';\n\nimport type { NSInlineInput } from './InlineInput.type';\nimport style from './style/inline-input.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst pointInsideOfRect = ({\n x,\n y,\n rect,\n}: {\n x: number;\n y: number;\n rect: { x: number; y: number; width: number; height: number };\n}) => {\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n};\n\nclass InlineInputBase extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSInlineInput.Component>,\n typeof InlineInputBase.enhance,\n {},\n WithI18nEnhanceProps,\n {},\n NSInlineInput.DefaultProps\n> {\n static displayName = 'InlineInput';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n static defaultProps = {\n state: 'normal',\n onBlurBehavior: 'confirm',\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n static style = style;\n\n rootRef = React.createRef<HTMLElement>();\n inputRef = React.createRef<HTMLInputElement>();\n initValue = '';\n lastMouseDownPosition: { x: number; y: number } | null = null;\n lastHandledKeyboardEvent = -1;\n\n handleDocumentMouseDown = (event: { clientX: number; clientY: number }) => {\n this.lastMouseDownPosition = { x: event.clientX, y: event.clientY };\n this.lastHandledKeyboardEvent = -1;\n };\n\n handleDocumentKeyDown = () => {\n this.lastMouseDownPosition = null;\n };\n\n componentDidMount() {\n this.updateInert();\n\n if (!this.asProps.onBlurBehavior) return;\n document.body.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n componentDidUpdate(prevProps: typeof this.asProps): void {\n if (prevProps.disabled !== this.asProps.disabled) {\n this.updateInert();\n }\n }\n\n componentWillUnmount() {\n if (!this.asProps.onBlurBehavior) return;\n document.body.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n getAddonProps() {\n return {\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getConfirmControlProps() {\n const { loading, getI18nText } = this.asProps;\n return {\n inputRef: this.inputRef,\n loading,\n onConfirm: this.handleConfirm,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getCancelControlProps() {\n const { loading, disabled, getI18nText } = this.asProps;\n return {\n value: this.initValue,\n // because double disabled(root disabled and addon disabled)\n disabled: loading && !disabled,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getValueProps() {\n const { state } = this.asProps;\n return {\n ref: this.inputRef,\n state,\n onKeyDown: this.handleKeyDown,\n };\n }\n\n increment = (event: React.SyntheticEvent | WheelEvent) => {\n // https://stackoverflow.com/questions/68010124/safari-number-input-stepup-stepdown-not-functioning-with-empty-value\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.min || '0';\n this.inputRef.current?.stepUp?.(event as any);\n };\n\n decrement = (event: React.SyntheticEvent | WheelEvent) => {\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.max || '0';\n this.inputRef.current?.stepDown?.(event as any);\n };\n\n getNumberValueProps() {\n const numberFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'decimal' });\n\n return {\n numberFormatter,\n inputRef: this.inputRef,\n increment: this.increment,\n decrement: this.decrement,\n };\n }\n\n getNumberControlsProps() {\n const { getI18nText } = this.asProps;\n return {\n increment: this.increment,\n decrement: this.decrement,\n getI18nText,\n };\n }\n\n handleMouseDownAddon = (event: React.MouseEvent) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n\n handleConfirm = (\n text: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onConfirm?.(text, event);\n };\n\n handleCancel = (\n prevText: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onCancel?.(prevText, event);\n };\n\n handleBlur = (event: React.FocusEvent) => {\n const { onConfirm, onCancel, onBlurBehavior } = this.asProps;\n if (!onBlurBehavior) return;\n if (Date.now() - this.lastHandledKeyboardEvent < 250) return;\n if (hasParent(event.relatedTarget, this.rootRef.current!)) return;\n\n if (lastInteraction.isKeyboard()) {\n if (lastInteraction.isTab) {\n onCancel?.(this.initValue, event);\n }\n return;\n }\n\n if (this.lastMouseDownPosition && this.rootRef.current) {\n const { x, y } = this.lastMouseDownPosition;\n const rect = this.rootRef.current.getBoundingClientRect();\n\n if (pointInsideOfRect({ x, y, rect })) {\n return;\n }\n }\n\n if (onBlurBehavior === 'confirm') onConfirm?.(this.inputRef.current?.value ?? '', event);\n if (onBlurBehavior === 'cancel') onCancel?.(this.initValue, event);\n };\n\n handleKeyDown = (event: React.KeyboardEvent) => {\n const { onConfirm, onCancel } = this.asProps;\n if (event.key === 'Enter') {\n onConfirm?.(this.inputRef.current?.value ?? '', event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n if (event.key === 'Escape') {\n onCancel?.(this.initValue, event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n };\n\n private updateInert() {\n const { disabled } = this.asProps;\n\n if (!this.rootRef.current) return;\n\n if (disabled) {\n this.rootRef.current.setAttribute('inert', '');\n } else {\n this.rootRef.current.removeAttribute('inert');\n }\n }\n\n render() {\n const SInlineInput = Root;\n const SUnderline = 'div';\n const SInvalidPattern = InvalidStateBox;\n const { Children, styles, state } = this.asProps;\n\n return sstyled(styles)(\n <SInlineInput render={Box} ref={this.rootRef} onBlur={this.handleBlur}>\n <SUnderline>\n {state === 'invalid' && <SInvalidPattern />}\n <Children />\n </SUnderline>\n </SInlineInput>,\n );\n }\n}\n\nclass Value extends Component<\n Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Value.Component, typeof InlineInputBase, 'Value'>,\n [],\n NSInlineInput.Value.Handlers\n> {\n static defaultProps: NSInlineInput.Value.DefaultProps = {\n defaultValue: '',\n };\n\n uncontrolledProps() {\n return {\n value: (event: React.ChangeEvent<HTMLInputElement>) => event.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n\n return sstyled(this.asProps.styles)(<SValue render={Box} tag='input' type='text' />);\n }\n}\n\nfunction Addon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Addon.Component, typeof InlineInputBase, 'Addon'>,\n) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} />);\n}\n\nfunction ConfirmControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.ConfirmControl.Component, typeof InlineInputBase, 'ConfirmControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren, inputRef, onCancel } = props;\n const title = props.title ?? props.getI18nText('confirm');\n\n const handleConfirm = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onConfirm?.(inputRef?.current?.value ?? '', event);\n },\n [props.onConfirm, inputRef?.current],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n handleConfirm(event);\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onCancel?.(inputRef?.current?.value ?? '', event);\n }\n },\n [handleConfirm],\n );\n\n if (props.loading) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <Spin size='xs' />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sConfirmIconStyles = sstyles.cn('SConfirmIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n addonLeft={props.icon ?? CheckM}\n use='secondary'\n onClick={handleConfirm}\n className={sConfirmIconStyles.className}\n style={sConfirmIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction CancelControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.CancelControl.Component, typeof InlineInputBase, 'CancelControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren } = props;\n const title = props.title ?? props.getI18nText('discard');\n\n const handleCancel = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onCancel?.(props.value ?? '', event);\n },\n [props.onCancel, props.value],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleCancel(event);\n }\n },\n [handleCancel],\n );\n\n if (props.disabled) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <CloseM />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sCancelIconStyles = sstyles.cn('SCancelIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n use='secondary'\n addonLeft={props.icon ?? CloseM}\n onClick={handleCancel}\n className={sCancelIconStyles.className}\n style={sCancelIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction NumberValue(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberValue.Component, typeof InlineInputBase, 'NumberValue'>,\n) {\n const SValue = Root;\n\n return sstyled(props.styles)(<SValue render={InputNumber.Value} />);\n};\n\nfunction NumberControls(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberControls.Component, typeof InlineInputBase, 'NumberControls'>,\n) {\n const SControls = Root;\n\n return sstyled(props.styles)(\n <SControls render={InputNumber.Controls} tag={InlineInput.Addon} />,\n );\n}\n\n/**\n * InlineInput\n *\n * {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-api/|API} | {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-code/|Examples}\n */\nconst InlineInput = createComponent<\n NSInlineInput.Component,\n typeof InlineInputBase\n>(InlineInputBase, {\n Addon,\n Value,\n ConfirmControl,\n CancelControl,\n NumberValue,\n NumberControls,\n});\n\nexport default InlineInput;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,EAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,GAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,YAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,KAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,MAAA,GAAAN,sBAAA,CAAAJ,OAAA;AAIA,IAAAW,4BAAA,GAAAX,OAAA;AAAmF,IAAAY,MAAA;AAAA;AAAA,MAAAC,KAAA,8BAAAd,KAAA,CAAAe,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAEnF,M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,SAASG,cAAcA,CACrB/B,KAA+I,EAC/I;EAAA,IAAAgC,KAAA,GAAA9B,YAAA;IAAA+B,MAAA;EACA,MAAMC,SAAS,GAGMJ,oBAAW,CAACK,QAAQ;EADzC,OAAAF,MAAA,GAAO,IAAA7I,aAAO,EAAC4G,KAAK,CAAChB,MAAM,CAAC,eAC1BhG,MAAA,CAAAiB,OAAA,CAAAgF,aAAA,CAACiD,SAAS,EAAAD,MAAA,CAAA/C,EAAA;IAAA,OAAA7G,KAAA,CAAA8G,WAAA;MAAA,OAAoCiD,WAAW,CAACrC;IAAK,GAAAiC,KAAA;EAAA,EAAG,CAAC;AAEvE;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMI,WAAW,GAAG,IAAAC,qBAAe,EAGjCzI,eAAe,EAAE;EACjBmG,KAAK;EACLP,KAAK;EACLa,cAAc;EACdgB,aAAa;EACbM,WAAW;EACXI;AACF,CAAC,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAtI,OAAA,GAEYmI,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InlineInput.js","names":["_core","require","_baseComponents","_button","_i18nEnhance","_interopRequireDefault","_hasParent","_m","_m2","_inputNumber","_spin","_react","_intergalacticDynamicLocales","_Value","style","sstyled","insert","pointInsideOfRect","x","y","rect","width","height","InlineInputBase","Component","constructor","args","_defineProperty2","default","React","createRef","event","lastMouseDownPosition","clientX","clientY","lastHandledKeyboardEvent","inputRef","current","value","min","stepUp","max","stepDown","preventDefault","focus","text","asProps","onConfirm","prevText","onCancel","onBlurBehavior","Date","now","hasParent","relatedTarget","rootRef","lastInteraction","isKeyboard","isTab","initValue","getBoundingClientRect","key","componentDidMount","updateInert","document","body","addEventListener","handleDocumentMouseDown","handleDocumentKeyDown","componentDidUpdate","prevProps","disabled","componentWillUnmount","removeEventListener","getAddonProps","onMouseDown","handleMouseDownAddon","getConfirmControlProps","loading","getI18nText","handleConfirm","handleCancel","getCancelControlProps","getValueProps","state","ref","onKeyDown","handleKeyDown","getNumberValueProps","numberFormatter","Intl","NumberFormat","locale","increment","decrement","getNumberControlsProps","setAttribute","removeAttribute","render","_ref","_ref8","SInlineInput","Box","SUnderline","Children","styles","createElement","cn","assignProps","handleBlur","i18nEnhance","localizedMessages","i18n","Value","uncontrolledProps","target","_ref2","_ref9","SValue","defaultValue","Addon","props","_ref3","arguments[0]","_ref0","SAddon","ConfirmControl","_ref4","_ref10","children","hasChildren","title","useCallback","handleKeydown","stopPropagation","_ref1","sstyles","sConfirmIconStyles","ButtonLink","icon","CheckM","className","CancelControl","_ref5","_ref12","_ref11","sCancelIconStyles","CloseM","NumberValue","_ref6","_ref13","InputNumber","NumberControls","_ref7","_ref14","SControls","Controls","InlineInput","createComponent","_default","exports"],"sources":["../../src/InlineInput.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { ButtonLink } from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root, lastInteraction } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport CheckM from '@semcore/icon/Check/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport InputNumber from '@semcore/input-number';\nimport Spin from '@semcore/spin';\nimport React from 'react';\n\nimport type { NSInlineInput } from './InlineInput.type';\nimport style from './style/inline-input.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst pointInsideOfRect = ({\n x,\n y,\n rect,\n}: {\n x: number;\n y: number;\n rect: { x: number; y: number; width: number; height: number };\n}) => {\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n};\n\nclass InlineInputBase extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSInlineInput.Component>,\n typeof InlineInputBase.enhance,\n {},\n WithI18nEnhanceProps,\n {},\n NSInlineInput.DefaultProps\n> {\n static displayName = 'InlineInput';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n static defaultProps = {\n state: 'normal',\n onBlurBehavior: 'confirm',\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n static style = style;\n\n rootRef = React.createRef<HTMLElement>();\n inputRef = React.createRef<HTMLInputElement>();\n initValue = '';\n lastMouseDownPosition: { x: number; y: number } | null = null;\n lastHandledKeyboardEvent = -1;\n\n handleDocumentMouseDown = (event: { clientX: number; clientY: number }) => {\n this.lastMouseDownPosition = { x: event.clientX, y: event.clientY };\n this.lastHandledKeyboardEvent = -1;\n };\n\n handleDocumentKeyDown = () => {\n this.lastMouseDownPosition = null;\n };\n\n componentDidMount() {\n this.updateInert();\n\n if (!this.asProps.onBlurBehavior) return;\n document.body.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n componentDidUpdate(prevProps: typeof this.asProps): void {\n if (prevProps.disabled !== this.asProps.disabled) {\n this.updateInert();\n }\n }\n\n componentWillUnmount() {\n if (!this.asProps.onBlurBehavior) return;\n document.body.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n getAddonProps() {\n return {\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getConfirmControlProps() {\n const { loading, getI18nText } = this.asProps;\n return {\n inputRef: this.inputRef,\n loading,\n onConfirm: this.handleConfirm,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getCancelControlProps() {\n const { loading, disabled, getI18nText } = this.asProps;\n return {\n value: this.initValue,\n // because double disabled(root disabled and addon disabled)\n disabled: loading && !disabled,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getValueProps() {\n const { state } = this.asProps;\n return {\n ref: this.inputRef,\n state,\n onKeyDown: this.handleKeyDown,\n };\n }\n\n increment = (event: React.SyntheticEvent | WheelEvent) => {\n // https://stackoverflow.com/questions/68010124/safari-number-input-stepup-stepdown-not-functioning-with-empty-value\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.min || '0';\n this.inputRef.current?.stepUp?.(event as any);\n };\n\n decrement = (event: React.SyntheticEvent | WheelEvent) => {\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.max || '0';\n this.inputRef.current?.stepDown?.(event as any);\n };\n\n getNumberValueProps() {\n const numberFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'decimal' });\n\n return {\n numberFormatter,\n inputRef: this.inputRef,\n increment: this.increment,\n decrement: this.decrement,\n };\n }\n\n getNumberControlsProps() {\n const { getI18nText } = this.asProps;\n return {\n increment: this.increment,\n decrement: this.decrement,\n getI18nText,\n };\n }\n\n handleMouseDownAddon = (event: React.MouseEvent) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n\n handleConfirm = (\n text: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onConfirm?.(text, event);\n };\n\n handleCancel = (\n prevText: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onCancel?.(prevText, event);\n };\n\n handleBlur = (event: React.FocusEvent) => {\n const { onConfirm, onCancel, onBlurBehavior } = this.asProps;\n if (!onBlurBehavior) return;\n if (Date.now() - this.lastHandledKeyboardEvent < 250) return;\n if (hasParent(event.relatedTarget, this.rootRef.current!)) return;\n\n if (lastInteraction.isKeyboard()) {\n if (lastInteraction.isTab) {\n onCancel?.(this.initValue, event);\n }\n return;\n }\n\n if (this.lastMouseDownPosition && this.rootRef.current) {\n const { x, y } = this.lastMouseDownPosition;\n const rect = this.rootRef.current.getBoundingClientRect();\n\n if (pointInsideOfRect({ x, y, rect })) {\n return;\n }\n }\n\n if (onBlurBehavior === 'confirm') onConfirm?.(this.inputRef.current?.value ?? '', event);\n if (onBlurBehavior === 'cancel') onCancel?.(this.initValue, event);\n };\n\n handleKeyDown = (event: React.KeyboardEvent) => {\n const { onConfirm, onCancel } = this.asProps;\n if (event.key === 'Enter') {\n onConfirm?.(this.inputRef.current?.value ?? '', event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n if (event.key === 'Escape') {\n onCancel?.(this.initValue, event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n };\n\n private updateInert() {\n const { disabled } = this.asProps;\n\n if (!this.rootRef.current) return;\n\n if (disabled) {\n this.rootRef.current.setAttribute('inert', '');\n } else {\n this.rootRef.current.removeAttribute('inert');\n }\n }\n\n render() {\n const SInlineInput = Root;\n const SUnderline = 'div';\n const { Children, styles } = this.asProps;\n\n return sstyled(styles)(\n <SInlineInput render={Box} ref={this.rootRef} onBlur={this.handleBlur}>\n <SUnderline>\n <Children />\n </SUnderline>\n </SInlineInput>,\n );\n }\n}\n\nclass Value extends Component<\n Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Value.Component, typeof InlineInputBase, 'Value'>,\n [],\n NSInlineInput.Value.Handlers\n> {\n static defaultProps: NSInlineInput.Value.DefaultProps = {\n defaultValue: '',\n };\n\n uncontrolledProps() {\n return {\n value: (event: React.ChangeEvent<HTMLInputElement>) => event.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n\n return sstyled(this.asProps.styles)(<SValue render={Box} tag='input' type='text' />);\n }\n}\n\nfunction Addon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Addon.Component, typeof InlineInputBase, 'Addon'>,\n) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} />);\n}\n\nfunction ConfirmControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.ConfirmControl.Component, typeof InlineInputBase, 'ConfirmControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren, inputRef, onCancel } = props;\n const title = props.title ?? props.getI18nText('confirm');\n\n const handleConfirm = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onConfirm?.(inputRef?.current?.value ?? '', event);\n },\n [props.onConfirm, inputRef?.current],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n handleConfirm(event);\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onCancel?.(inputRef?.current?.value ?? '', event);\n }\n },\n [handleConfirm],\n );\n\n if (props.loading) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <Spin size='xs' />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sConfirmIconStyles = sstyles.cn('SConfirmIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n addonLeft={props.icon ?? CheckM}\n use='secondary'\n onClick={handleConfirm}\n className={sConfirmIconStyles.className}\n style={sConfirmIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction CancelControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.CancelControl.Component, typeof InlineInputBase, 'CancelControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren } = props;\n const title = props.title ?? props.getI18nText('discard');\n\n const handleCancel = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onCancel?.(props.value ?? '', event);\n },\n [props.onCancel, props.value],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleCancel(event);\n }\n },\n [handleCancel],\n );\n\n if (props.disabled) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <CloseM />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sCancelIconStyles = sstyles.cn('SCancelIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n use='secondary'\n addonLeft={props.icon ?? CloseM}\n onClick={handleCancel}\n className={sCancelIconStyles.className}\n style={sCancelIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction NumberValue(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberValue.Component, typeof InlineInputBase, 'NumberValue'>,\n) {\n const SValue = Root;\n\n return sstyled(props.styles)(<SValue render={InputNumber.Value} />);\n};\n\nfunction NumberControls(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberControls.Component, typeof InlineInputBase, 'NumberControls'>,\n) {\n const SControls = Root;\n\n return sstyled(props.styles)(\n <SControls render={InputNumber.Controls} tag={InlineInput.Addon} />,\n );\n}\n\n/**\n * InlineInput\n *\n * {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-api/|API} | {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-code/|Examples}\n */\nconst InlineInput = createComponent<\n NSInlineInput.Component,\n typeof InlineInputBase\n>(InlineInputBase, {\n Addon,\n Value,\n ConfirmControl,\n CancelControl,\n NumberValue,\n NumberControls,\n});\n\nexport default InlineInput;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,EAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,GAAA,GAAAH,sBAAA,CAAAJ,OAAA;AACA,IAAAQ,YAAA,GAAAJ,sBAAA,CAAAJ,OAAA;AACA,IAAAS,KAAA,GAAAL,sBAAA,CAAAJ,OAAA;AACA,IAAAU,MAAA,GAAAN,sBAAA,CAAAJ,OAAA;AAIA,IAAAW,4BAAA,GAAAX,OAAA;AAAmF,IAAAY,MAAA;AA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SAASG,cAAcA,CACrB/B,KAA+I,EAC/I;EAAA,IAAAgC,KAAA,GAAA9B,YAAA;IAAA+B,MAAA;EACA,MAAMC,SAAS,GAGMJ,oBAAW,CAACK,QAAQ;EADzC,OAAAF,MAAA,GAAO,IAAA3I,aAAO,EAAC0G,KAAK,CAAChB,MAAM,CAAC,eAC1B9F,MAAA,CAAAiB,OAAA,CAAA8E,aAAA,CAACiD,SAAS,EAAAD,MAAA,CAAA/C,EAAA;IAAA,OAAA3G,KAAA,CAAA4G,WAAA;MAAA,OAAoCiD,WAAW,CAACrC;IAAK,GAAAiC,KAAA;EAAA,EAAG,CAAC;AAEvE;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMI,WAAW,GAAG,IAAAC,qBAAe,EAGjCvI,eAAe,EAAE;EACjBiG,KAAK;EACLP,KAAK;EACLa,cAAc;EACdgB,aAAa;EACbM,WAAW;EACXI;AACF,CAAC,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAApI,OAAA,GAEYiI,WAAW","ignoreList":[]}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
SInlineInput {
|
|
2
2
|
display: inline-flex;
|
|
3
|
-
width:
|
|
3
|
+
width: fit-content;
|
|
4
|
+
max-width: 100%;
|
|
4
5
|
height: 100%;
|
|
5
6
|
align-items: center;
|
|
6
7
|
position: relative;
|
|
7
|
-
z-index: 0;
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
/* disable-tokens-validator */
|
|
10
10
|
padding: 1px;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
|
|
13
|
-
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
14
|
-
|
|
15
13
|
SConfirmIcon:not([color]) {
|
|
16
|
-
color: var(--intergalactic-icon-secondary-success, oklch(0.
|
|
17
|
-
cursor: pointer;
|
|
14
|
+
color: var(--intergalactic-icon-secondary-success, oklch(0.787 0.16 167.8 / 0.898));
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
SConfirmIcon:not([color]):hover {
|
|
@@ -22,8 +19,7 @@ SInlineInput {
|
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
SCancelIcon:not([color]) {
|
|
25
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
26
|
-
cursor: pointer;
|
|
22
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
SCancelIcon:not([color]):hover {
|
|
@@ -31,12 +27,13 @@ SInlineInput {
|
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
SValue {
|
|
34
|
-
|
|
30
|
+
flex: 0 1 auto;
|
|
35
31
|
min-width: 0;
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
width: auto;
|
|
36
34
|
|
|
37
|
-
width: 100%;
|
|
38
35
|
height: 100%;
|
|
39
|
-
padding:
|
|
36
|
+
padding: var(--intergalactic-spacing-1x, 4px);
|
|
40
37
|
border: none;
|
|
41
38
|
box-sizing: border-box;
|
|
42
39
|
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
@@ -46,13 +43,18 @@ SInlineInput {
|
|
|
46
43
|
font-family: inherit;
|
|
47
44
|
background: transparent;
|
|
48
45
|
min-height: 1em;
|
|
46
|
+
text-decoration-line: underline;
|
|
47
|
+
text-decoration-style: dotted;
|
|
48
|
+
text-decoration-thickness: 2px;
|
|
49
|
+
text-decoration-color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
50
|
+
text-underline-offset: 17%;
|
|
49
51
|
|
|
50
52
|
&:focus, &:focus-visible {
|
|
51
53
|
outline: none;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
&::placeholder {
|
|
55
|
-
color: var(--intergalactic-text-placeholder, oklch(0.
|
|
57
|
+
color: var(--intergalactic-text-placeholder, oklch(0.109 0.023 165.5 / 0.337));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
&[disabled] {
|
|
@@ -79,15 +81,26 @@ SInlineInput[disabled] {
|
|
|
79
81
|
|
|
80
82
|
SUnderline {
|
|
81
83
|
display: flex;
|
|
82
|
-
flex-direction: row;
|
|
83
84
|
align-items: center;
|
|
84
|
-
|
|
85
|
+
min-width: 0;
|
|
85
86
|
width: 100%;
|
|
86
87
|
height: 100%;
|
|
87
88
|
min-height: 1em;
|
|
88
89
|
border: 1px solid transparent;
|
|
89
|
-
border-
|
|
90
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
90
91
|
outline-color: transparent;
|
|
92
|
+
transition-duration: calc(var(--intergalactic-duration-extra-fast, 100) * 1ms);
|
|
93
|
+
transition-timing-function: ease-in-out;
|
|
94
|
+
transition-property: background-color;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SUnderline {
|
|
98
|
+
background-color: var(--intergalactic-control-secondary-neutral, oklch(0.166 0.031 175.8 / 0.097));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SAddon,
|
|
102
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SValue {
|
|
103
|
+
cursor: pointer;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
106
|
SAddon {
|
|
@@ -96,8 +109,8 @@ SAddon {
|
|
|
96
109
|
align-items: center;
|
|
97
110
|
flex: 0 0 auto;
|
|
98
111
|
height: 100%;
|
|
99
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
100
|
-
padding: 0 var(--intergalactic-spacing-
|
|
112
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
113
|
+
padding: 0 var(--intergalactic-spacing-content-gap-small, 4px);
|
|
101
114
|
}
|
|
102
115
|
|
|
103
116
|
SAddon[disabled] {
|
|
@@ -106,38 +119,49 @@ SAddon[disabled] {
|
|
|
106
119
|
pointer-events: none;
|
|
107
120
|
}
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@mixin focus-outline-mixin;
|
|
122
|
+
[data-ui-name='InlineInput.CancelControl'] {
|
|
123
|
+
padding-left: 0;
|
|
112
124
|
}
|
|
113
125
|
|
|
114
|
-
SInlineInput[
|
|
115
|
-
|
|
126
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.ConfirmControl'],
|
|
127
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.CancelControl'] {
|
|
128
|
+
display: none;
|
|
116
129
|
}
|
|
117
130
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
@mixin focus-outline-mixin
|
|
121
|
-
|
|
131
|
+
SUnderline:has(input:focus-visible) {
|
|
132
|
+
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
133
|
+
@mixin focus-outline-mixin {
|
|
134
|
+
outline-offset: 0;
|
|
135
|
+
transition-property: outline-color, outline-width;
|
|
136
|
+
}
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
SInlineInput[state='
|
|
125
|
-
|
|
139
|
+
SInlineInput[state='valid'] SUnderline:has(input:focus-visible) {
|
|
140
|
+
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
SInlineInput[state='invalid'] SUnderline:has(input:focus-visible) {
|
|
129
|
-
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
130
|
-
@mixin focus-outline-mixin;
|
|
131
144
|
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
132
145
|
}
|
|
133
146
|
|
|
147
|
+
SInlineInput[state='valid'] SValue {
|
|
148
|
+
text-decoration-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SInlineInput[state='invalid'] SValue {
|
|
152
|
+
text-decoration-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
SInlineInput[state]:focus-within SValue {
|
|
156
|
+
text-decoration-color: transparent;
|
|
157
|
+
}
|
|
158
|
+
|
|
134
159
|
SValue:focus~SControls {
|
|
135
160
|
display: flex;
|
|
136
161
|
}
|
|
137
162
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
height: calc(100% - 3px);
|
|
163
|
+
@supports (field-sizing: content) {
|
|
164
|
+
SValue {
|
|
165
|
+
field-sizing: content;
|
|
166
|
+
}
|
|
143
167
|
}
|
package/lib/es6/InlineInput.js
CHANGED
|
@@ -10,7 +10,7 @@ import { assignProps as _assignProps3 } from "@semcore/core";
|
|
|
10
10
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
11
11
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
12
12
|
var _Value;
|
|
13
|
-
import { Box
|
|
13
|
+
import { Box } from '@semcore/base-components';
|
|
14
14
|
import { ButtonLink } from '@semcore/button';
|
|
15
15
|
import { createComponent, Component, sstyled, Root, lastInteraction } from '@semcore/core';
|
|
16
16
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
@@ -21,22 +21,23 @@ import InputNumber from '@semcore/input-number';
|
|
|
21
21
|
import Spin from '@semcore/spin';
|
|
22
22
|
import React from 'react';
|
|
23
23
|
/*!__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
24
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
24
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SInlineInput_1t5br_gg_{display:inline-flex;width:-moz-fit-content;width:fit-content;max-width:100%;height:100%;align-items:center;position:relative;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,#00d9a5e5)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,oklch(.787 .16 167.8/.898))}}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-success-hover-active,oklch(.673 .139 166.3))}}.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262))}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,#0005026e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,oklch(.1 .023 159.1/.433))}}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_{flex:0 1 auto;min-width:0;max-width:100%;width:auto;height:100%;padding:var(--intergalactic-spacing-1x,4px);border:none;box-sizing:border-box;color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:#0000;min-height:1em;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));text-underline-offset:17%}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus-visible{outline:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,#00060356)}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,#00060356)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_.__disabled_1t5br_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-inner-spin-button,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_._type_number_1t5br_gg_{-moz-appearance:textfield}.___SInlineInput_1t5br_gg_.__disabled_1t5br_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity,.4)}.___SUnderline_1t5br_gg_{display:flex;align-items:center;min-width:0;width:100%;height:100%;min-height:1em;border:1px solid #0000;border-radius:var(--intergalactic-control-rounded,6px);outline-color:#0000;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:background-color}@media (hover:hover){.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) .___SUnderline_1t5br_gg_{background-color:var(--intergalactic-control-secondary-neutral,oklch(.166 .031 175.8/.097))}.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) :is(.___SAddon_1t5br_gg_,.___SValue_1t5br_gg_){cursor:pointer}}.___SAddon_1t5br_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262));padding:0 var(--intergalactic-spacing-content-gap-small,4px)}.___SAddon_1t5br_gg_.__disabled_1t5br_gg_{opacity:var(--intergalactic-disabled-opacity,.4);cursor:default;pointer-events:none}[data-ui-name=\"InlineInput.CancelControl\"]{padding-left:0}.___SInlineInput_1t5br_gg_:not(:focus-within):not(.__loading_1t5br_gg_) :is([data-ui-name=\"InlineInput.CancelControl\"],[data-ui-name=\"InlineInput.ConfirmControl\"]){display:none}.___SUnderline_1t5br_gg_:has(input:focus-visible){background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));outline-color:var(--intergalactic-keyboard-focus-outline,#0020dd78);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;outline-offset:0;transition-property:outline-color,outline-width}@media (color-gamut:p3){.___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-outline,oklch(.424 .269 264.2/.469))}}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,#00be8e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,oklch(.711 .146 166.9))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-invalid-outline,oklch(.628 .257 28.9/.652))}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,#00b991)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,oklch(.7 .166 170))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,#ff6364)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,oklch(.7 .21 23))}}.___SInlineInput_1t5br_gg_.__state_1t5br_gg_:focus-within .___SValue_1t5br_gg_{text-decoration-color:#0000}.___SValue_1t5br_gg_:focus~.___SControls_1t5br_gg_{display:flex}@supports (field-sizing:content){.___SValue_1t5br_gg_{field-sizing:content}}", /*__inner_css_end__*/"1t5br_gg_"),
|
|
25
25
|
/*__reshadow_css_end__*/
|
|
26
26
|
{
|
|
27
|
-
"__SInlineInput": "
|
|
28
|
-
"_disabled": "
|
|
29
|
-
"__SUnderline": "
|
|
30
|
-
"__SAddon": "
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
27
|
+
"__SInlineInput": "___SInlineInput_1t5br_gg_",
|
|
28
|
+
"_disabled": "__disabled_1t5br_gg_",
|
|
29
|
+
"__SUnderline": "___SUnderline_1t5br_gg_",
|
|
30
|
+
"__SAddon": "___SAddon_1t5br_gg_",
|
|
31
|
+
"__SValue": "___SValue_1t5br_gg_",
|
|
32
|
+
"_loading": "__loading_1t5br_gg_",
|
|
33
|
+
"_state_valid": "_state_valid_1t5br_gg_",
|
|
34
|
+
"_state_invalid": "_state_invalid_1t5br_gg_",
|
|
35
|
+
"_state": "__state_1t5br_gg_",
|
|
36
|
+
"__SControls": "___SControls_1t5br_gg_",
|
|
37
|
+
"__SConfirmIcon": "___SConfirmIcon_1t5br_gg_",
|
|
38
|
+
"_color": "__color_1t5br_gg_",
|
|
39
|
+
"__SCancelIcon": "___SCancelIcon_1t5br_gg_",
|
|
40
|
+
"_type_number": "_type_number_1t5br_gg_"
|
|
40
41
|
});
|
|
41
42
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
42
43
|
const pointInsideOfRect = ({
|
|
@@ -225,18 +226,16 @@ class InlineInputBase extends Component {
|
|
|
225
226
|
_ref8;
|
|
226
227
|
const SInlineInput = Box;
|
|
227
228
|
const SUnderline = 'div';
|
|
228
|
-
const SInvalidPattern = InvalidStateBox;
|
|
229
229
|
const {
|
|
230
230
|
Children,
|
|
231
|
-
styles
|
|
232
|
-
state
|
|
231
|
+
styles
|
|
233
232
|
} = this.asProps;
|
|
234
233
|
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SInlineInput, _ref8.cn("SInlineInput", {
|
|
235
234
|
..._assignProps({
|
|
236
235
|
"ref": this.rootRef,
|
|
237
236
|
"onBlur": this.handleBlur
|
|
238
237
|
}, _ref)
|
|
239
|
-
}), /*#__PURE__*/React.createElement(SUnderline, _ref8.cn("SUnderline", {}),
|
|
238
|
+
}), /*#__PURE__*/React.createElement(SUnderline, _ref8.cn("SUnderline", {}), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {}))));
|
|
240
239
|
}
|
|
241
240
|
}
|
|
242
241
|
_defineProperty(InlineInputBase, "displayName", 'InlineInput');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineInput.js","names":["Box","InvalidStateBox","ButtonLink","createComponent","Component","sstyled","Root","lastInteraction","i18nEnhance","hasParent","CheckM","CloseM","InputNumber","Spin","React","style","_sstyled","insert","localizedMessages","pointInsideOfRect","x","y","rect","width","height","InlineInputBase","constructor","args","_defineProperty","createRef","event","lastMouseDownPosition","clientX","clientY","lastHandledKeyboardEvent","inputRef","current","value","min","stepUp","max","stepDown","preventDefault","focus","text","asProps","onConfirm","prevText","onCancel","onBlurBehavior","Date","now","relatedTarget","rootRef","isKeyboard","isTab","initValue","getBoundingClientRect","key","componentDidMount","updateInert","document","body","addEventListener","handleDocumentMouseDown","handleDocumentKeyDown","componentDidUpdate","prevProps","disabled","componentWillUnmount","removeEventListener","getAddonProps","onMouseDown","handleMouseDownAddon","getConfirmControlProps","loading","getI18nText","handleConfirm","handleCancel","getCancelControlProps","getValueProps","state","ref","onKeyDown","handleKeyDown","getNumberValueProps","numberFormatter","Intl","NumberFormat","locale","increment","decrement","getNumberControlsProps","setAttribute","removeAttribute","render","_ref","_ref8","SInlineInput","SUnderline","SInvalidPattern","Children","styles","createElement","cn","_assignProps","handleBlur","i18n","Value","uncontrolledProps","target","_ref2","_ref9","SValue","_assignProps2","_Value","defaultValue","Addon","props","_ref3","arguments[0]","_ref0","SAddon","_assignProps3","ConfirmControl","_ref4","_ref10","children","hasChildren","title","useCallback","handleKeydown","stopPropagation","_ref1","_assignProps4","sstyles","sConfirmIconStyles","_assignProps5","icon","className","CancelControl","_ref5","_ref12","_ref11","_assignProps6","sCancelIconStyles","_assignProps7","NumberValue","_ref6","_ref13","_assignProps8","NumberControls","_ref7","_ref14","SControls","Controls","_assignProps9","InlineInput"],"sources":["../../src/InlineInput.tsx"],"sourcesContent":["import { Box, InvalidStateBox } from '@semcore/base-components';\nimport { ButtonLink } from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root, lastInteraction } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport CheckM from '@semcore/icon/Check/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport InputNumber from '@semcore/input-number';\nimport Spin from '@semcore/spin';\nimport React from 'react';\n\nimport type { NSInlineInput } from './InlineInput.type';\nimport style from './style/inline-input.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst pointInsideOfRect = ({\n x,\n y,\n rect,\n}: {\n x: number;\n y: number;\n rect: { x: number; y: number; width: number; height: number };\n}) => {\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n};\n\nclass InlineInputBase extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSInlineInput.Component>,\n typeof InlineInputBase.enhance,\n {},\n WithI18nEnhanceProps,\n {},\n NSInlineInput.DefaultProps\n> {\n static displayName = 'InlineInput';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n static defaultProps = {\n state: 'normal',\n onBlurBehavior: 'confirm',\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n static style = style;\n\n rootRef = React.createRef<HTMLElement>();\n inputRef = React.createRef<HTMLInputElement>();\n initValue = '';\n lastMouseDownPosition: { x: number; y: number } | null = null;\n lastHandledKeyboardEvent = -1;\n\n handleDocumentMouseDown = (event: { clientX: number; clientY: number }) => {\n this.lastMouseDownPosition = { x: event.clientX, y: event.clientY };\n this.lastHandledKeyboardEvent = -1;\n };\n\n handleDocumentKeyDown = () => {\n this.lastMouseDownPosition = null;\n };\n\n componentDidMount() {\n this.updateInert();\n\n if (!this.asProps.onBlurBehavior) return;\n document.body.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n componentDidUpdate(prevProps: typeof this.asProps): void {\n if (prevProps.disabled !== this.asProps.disabled) {\n this.updateInert();\n }\n }\n\n componentWillUnmount() {\n if (!this.asProps.onBlurBehavior) return;\n document.body.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n getAddonProps() {\n return {\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getConfirmControlProps() {\n const { loading, getI18nText } = this.asProps;\n return {\n inputRef: this.inputRef,\n loading,\n onConfirm: this.handleConfirm,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getCancelControlProps() {\n const { loading, disabled, getI18nText } = this.asProps;\n return {\n value: this.initValue,\n // because double disabled(root disabled and addon disabled)\n disabled: loading && !disabled,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getValueProps() {\n const { state } = this.asProps;\n return {\n ref: this.inputRef,\n state,\n onKeyDown: this.handleKeyDown,\n };\n }\n\n increment = (event: React.SyntheticEvent | WheelEvent) => {\n // https://stackoverflow.com/questions/68010124/safari-number-input-stepup-stepdown-not-functioning-with-empty-value\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.min || '0';\n this.inputRef.current?.stepUp?.(event as any);\n };\n\n decrement = (event: React.SyntheticEvent | WheelEvent) => {\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.max || '0';\n this.inputRef.current?.stepDown?.(event as any);\n };\n\n getNumberValueProps() {\n const numberFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'decimal' });\n\n return {\n numberFormatter,\n inputRef: this.inputRef,\n increment: this.increment,\n decrement: this.decrement,\n };\n }\n\n getNumberControlsProps() {\n const { getI18nText } = this.asProps;\n return {\n increment: this.increment,\n decrement: this.decrement,\n getI18nText,\n };\n }\n\n handleMouseDownAddon = (event: React.MouseEvent) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n\n handleConfirm = (\n text: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onConfirm?.(text, event);\n };\n\n handleCancel = (\n prevText: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onCancel?.(prevText, event);\n };\n\n handleBlur = (event: React.FocusEvent) => {\n const { onConfirm, onCancel, onBlurBehavior } = this.asProps;\n if (!onBlurBehavior) return;\n if (Date.now() - this.lastHandledKeyboardEvent < 250) return;\n if (hasParent(event.relatedTarget, this.rootRef.current!)) return;\n\n if (lastInteraction.isKeyboard()) {\n if (lastInteraction.isTab) {\n onCancel?.(this.initValue, event);\n }\n return;\n }\n\n if (this.lastMouseDownPosition && this.rootRef.current) {\n const { x, y } = this.lastMouseDownPosition;\n const rect = this.rootRef.current.getBoundingClientRect();\n\n if (pointInsideOfRect({ x, y, rect })) {\n return;\n }\n }\n\n if (onBlurBehavior === 'confirm') onConfirm?.(this.inputRef.current?.value ?? '', event);\n if (onBlurBehavior === 'cancel') onCancel?.(this.initValue, event);\n };\n\n handleKeyDown = (event: React.KeyboardEvent) => {\n const { onConfirm, onCancel } = this.asProps;\n if (event.key === 'Enter') {\n onConfirm?.(this.inputRef.current?.value ?? '', event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n if (event.key === 'Escape') {\n onCancel?.(this.initValue, event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n };\n\n private updateInert() {\n const { disabled } = this.asProps;\n\n if (!this.rootRef.current) return;\n\n if (disabled) {\n this.rootRef.current.setAttribute('inert', '');\n } else {\n this.rootRef.current.removeAttribute('inert');\n }\n }\n\n render() {\n const SInlineInput = Root;\n const SUnderline = 'div';\n const SInvalidPattern = InvalidStateBox;\n const { Children, styles, state } = this.asProps;\n\n return sstyled(styles)(\n <SInlineInput render={Box} ref={this.rootRef} onBlur={this.handleBlur}>\n <SUnderline>\n {state === 'invalid' && <SInvalidPattern />}\n <Children />\n </SUnderline>\n </SInlineInput>,\n );\n }\n}\n\nclass Value extends Component<\n Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Value.Component, typeof InlineInputBase, 'Value'>,\n [],\n NSInlineInput.Value.Handlers\n> {\n static defaultProps: NSInlineInput.Value.DefaultProps = {\n defaultValue: '',\n };\n\n uncontrolledProps() {\n return {\n value: (event: React.ChangeEvent<HTMLInputElement>) => event.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n\n return sstyled(this.asProps.styles)(<SValue render={Box} tag='input' type='text' />);\n }\n}\n\nfunction Addon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Addon.Component, typeof InlineInputBase, 'Addon'>,\n) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} />);\n}\n\nfunction ConfirmControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.ConfirmControl.Component, typeof InlineInputBase, 'ConfirmControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren, inputRef, onCancel } = props;\n const title = props.title ?? props.getI18nText('confirm');\n\n const handleConfirm = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onConfirm?.(inputRef?.current?.value ?? '', event);\n },\n [props.onConfirm, inputRef?.current],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n handleConfirm(event);\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onCancel?.(inputRef?.current?.value ?? '', event);\n }\n },\n [handleConfirm],\n );\n\n if (props.loading) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <Spin size='xs' />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sConfirmIconStyles = sstyles.cn('SConfirmIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n addonLeft={props.icon ?? CheckM}\n use='secondary'\n onClick={handleConfirm}\n className={sConfirmIconStyles.className}\n style={sConfirmIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction CancelControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.CancelControl.Component, typeof InlineInputBase, 'CancelControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren } = props;\n const title = props.title ?? props.getI18nText('discard');\n\n const handleCancel = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onCancel?.(props.value ?? '', event);\n },\n [props.onCancel, props.value],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleCancel(event);\n }\n },\n [handleCancel],\n );\n\n if (props.disabled) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <CloseM />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sCancelIconStyles = sstyles.cn('SCancelIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n use='secondary'\n addonLeft={props.icon ?? CloseM}\n onClick={handleCancel}\n className={sCancelIconStyles.className}\n style={sCancelIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction NumberValue(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberValue.Component, typeof InlineInputBase, 'NumberValue'>,\n) {\n const SValue = Root;\n\n return sstyled(props.styles)(<SValue render={InputNumber.Value} />);\n};\n\nfunction NumberControls(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberControls.Component, typeof InlineInputBase, 'NumberControls'>,\n) {\n const SControls = Root;\n\n return sstyled(props.styles)(\n <SControls render={InputNumber.Controls} tag={InlineInput.Addon} />,\n );\n}\n\n/**\n * InlineInput\n *\n * {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-api/|API} | {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-code/|Examples}\n */\nconst InlineInput = createComponent<\n NSInlineInput.Component,\n typeof InlineInputBase\n>(InlineInputBase, {\n Addon,\n Value,\n ConfirmControl,\n CancelControl,\n NumberValue,\n NumberControls,\n});\n\nexport default InlineInput;\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,GAAG,EAAEC,eAAe,QAAQ,0BAA0B;AAC/D,SAASC,UAAU,QAAQ,iBAAiB;AAE5C,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,EAAEC,eAAe,QAAQ,eAAe;AAE1F,OAAOC,WAAW,MAAM,8CAA8C;AACtE,SAASC,SAAS,QAAQ,mCAAmC;AAC7D,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,IAAI,MAAM,eAAe;AAChC,OAAOC,KAAK,MAAM,OA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Jc,KAAK,CAACoB,IAAI,IAAI/H,MAAM;IAAA,WACtBmE,YAAY;IAAA,aACVmE,iBAAiB,CAACN,SAAS;IAAA,SAC/BM,iBAAiB,CAAClI,KAAK;IAAA,cAClBkH;EAAK,EAClB,CAED,CAAC;AAEb;AAEA,SAASkB,WAAWA,CAClB7B,KAAyI,EACzI;EAAA,IAAA8B,KAAA,GAAA5B,YAAA;IAAA6B,MAAA;EACA,MAAMpC,MAAM,GAEiCrG,WAAW,CAACgG,KAAK;EAA9D,OAAAyC,MAAA,GAAOhJ,OAAO,CAACiH,KAAK,CAAChB,MAAM,CAAC,eAACxF,KAAA,CAAAyF,aAAA,CAACU,MAAM,EAAAoC,MAAA,CAAA7C,EAAA;IAAA,GAAA8C,aAAA,KAAAF,KAAA;EAAA,EAA6B,CAAC;AACpE;AAAC;AAED,SAASG,cAAcA,CACrBjC,KAA+I,EAC/I;EAAA,IAAAkC,KAAA,GAAAhC,YAAA;IAAAiC,MAAA;EACA,MAAMC,SAAS,GAGM9I,WAAW,CAAC+I,QAAQ;EADzC,OAAAF,MAAA,GAAOpJ,OAAO,CAACiH,KAAK,CAAChB,MAAM,CAAC,eAC1BxF,KAAA,CAAAyF,aAAA,CAACmD,SAAS,EAAAD,MAAA,CAAAjD,EAAA;IAAA,GAAAoD,aAAA;MAAA,OAAoCC,WAAW,CAACxC;IAAK,GAAAmC,KAAA;EAAA,EAAG,CAAC;AAEvE;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMK,WAAW,GAAG1J,eAAe,CAGjCsB,eAAe,EAAE;EACjB4F,KAAK;EACLT,KAAK;EACLgB,cAAc;EACdgB,aAAa;EACbO,WAAW;EACXI;AACF,CAAC,CAAC;AAEF,eAAeM,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"InlineInput.js","names":["Box","ButtonLink","createComponent","Component","sstyled","Root","lastInteraction","i18nEnhance","hasParent","CheckM","CloseM","InputNumber","Spin","React","style","_sstyled","insert","localizedMessages","pointInsideOfRect","x","y","rect","width","height","InlineInputBase","constructor","args","_defineProperty","createRef","event","lastMouseDownPosition","clientX","clientY","lastHandledKeyboardEvent","inputRef","current","value","min","stepUp","max","stepDown","preventDefault","focus","text","asProps","onConfirm","prevText","onCancel","onBlurBehavior","Date","now","relatedTarget","rootRef","isKeyboard","isTab","initValue","getBoundingClientRect","key","componentDidMount","updateInert","document","body","addEventListener","handleDocumentMouseDown","handleDocumentKeyDown","componentDidUpdate","prevProps","disabled","componentWillUnmount","removeEventListener","getAddonProps","onMouseDown","handleMouseDownAddon","getConfirmControlProps","loading","getI18nText","handleConfirm","handleCancel","getCancelControlProps","getValueProps","state","ref","onKeyDown","handleKeyDown","getNumberValueProps","numberFormatter","Intl","NumberFormat","locale","increment","decrement","getNumberControlsProps","setAttribute","removeAttribute","render","_ref","_ref8","SInlineInput","SUnderline","Children","styles","createElement","cn","_assignProps","handleBlur","i18n","Value","uncontrolledProps","target","_ref2","_ref9","SValue","_assignProps2","_Value","defaultValue","Addon","props","_ref3","arguments[0]","_ref0","SAddon","_assignProps3","ConfirmControl","_ref4","_ref10","children","hasChildren","title","useCallback","handleKeydown","stopPropagation","_ref1","_assignProps4","sstyles","sConfirmIconStyles","_assignProps5","icon","className","CancelControl","_ref5","_ref12","_ref11","_assignProps6","sCancelIconStyles","_assignProps7","NumberValue","_ref6","_ref13","_assignProps8","NumberControls","_ref7","_ref14","SControls","Controls","_assignProps9","InlineInput"],"sources":["../../src/InlineInput.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport { ButtonLink } from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root, lastInteraction } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport { hasParent } from '@semcore/core/lib/utils/hasParent';\nimport CheckM from '@semcore/icon/Check/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport InputNumber from '@semcore/input-number';\nimport Spin from '@semcore/spin';\nimport React from 'react';\n\nimport type { NSInlineInput } from './InlineInput.type';\nimport style from './style/inline-input.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nconst pointInsideOfRect = ({\n x,\n y,\n rect,\n}: {\n x: number;\n y: number;\n rect: { x: number; y: number; width: number; height: number };\n}) => {\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n};\n\nclass InlineInputBase extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSInlineInput.Component>,\n typeof InlineInputBase.enhance,\n {},\n WithI18nEnhanceProps,\n {},\n NSInlineInput.DefaultProps\n> {\n static displayName = 'InlineInput';\n\n static enhance = [i18nEnhance(localizedMessages)] as const;\n static defaultProps = {\n state: 'normal',\n onBlurBehavior: 'confirm',\n i18n: localizedMessages,\n locale: 'en',\n } as const;\n\n static style = style;\n\n rootRef = React.createRef<HTMLElement>();\n inputRef = React.createRef<HTMLInputElement>();\n initValue = '';\n lastMouseDownPosition: { x: number; y: number } | null = null;\n lastHandledKeyboardEvent = -1;\n\n handleDocumentMouseDown = (event: { clientX: number; clientY: number }) => {\n this.lastMouseDownPosition = { x: event.clientX, y: event.clientY };\n this.lastHandledKeyboardEvent = -1;\n };\n\n handleDocumentKeyDown = () => {\n this.lastMouseDownPosition = null;\n };\n\n componentDidMount() {\n this.updateInert();\n\n if (!this.asProps.onBlurBehavior) return;\n document.body.addEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.addEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n componentDidUpdate(prevProps: typeof this.asProps): void {\n if (prevProps.disabled !== this.asProps.disabled) {\n this.updateInert();\n }\n }\n\n componentWillUnmount() {\n if (!this.asProps.onBlurBehavior) return;\n document.body.removeEventListener('mousedown', this.handleDocumentMouseDown);\n document.body.removeEventListener('keydown', this.handleDocumentKeyDown);\n }\n\n getAddonProps() {\n return {\n onMouseDown: this.handleMouseDownAddon,\n };\n }\n\n getConfirmControlProps() {\n const { loading, getI18nText } = this.asProps;\n return {\n inputRef: this.inputRef,\n loading,\n onConfirm: this.handleConfirm,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getCancelControlProps() {\n const { loading, disabled, getI18nText } = this.asProps;\n return {\n value: this.initValue,\n // because double disabled(root disabled and addon disabled)\n disabled: loading && !disabled,\n onCancel: this.handleCancel,\n getI18nText,\n };\n }\n\n getValueProps() {\n const { state } = this.asProps;\n return {\n ref: this.inputRef,\n state,\n onKeyDown: this.handleKeyDown,\n };\n }\n\n increment = (event: React.SyntheticEvent | WheelEvent) => {\n // https://stackoverflow.com/questions/68010124/safari-number-input-stepup-stepdown-not-functioning-with-empty-value\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.min || '0';\n this.inputRef.current?.stepUp?.(event as any);\n };\n\n decrement = (event: React.SyntheticEvent | WheelEvent) => {\n if (this.inputRef.current?.value === '')\n this.inputRef.current.value = this.inputRef.current.max || '0';\n this.inputRef.current?.stepDown?.(event as any);\n };\n\n getNumberValueProps() {\n const numberFormatter = new Intl.NumberFormat(this.asProps.locale, { style: 'decimal' });\n\n return {\n numberFormatter,\n inputRef: this.inputRef,\n increment: this.increment,\n decrement: this.decrement,\n };\n }\n\n getNumberControlsProps() {\n const { getI18nText } = this.asProps;\n return {\n increment: this.increment,\n decrement: this.decrement,\n getI18nText,\n };\n }\n\n handleMouseDownAddon = (event: React.MouseEvent) => {\n event.preventDefault();\n this.inputRef.current?.focus();\n };\n\n handleConfirm = (\n text: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onConfirm?.(text, event);\n };\n\n handleCancel = (\n prevText: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => {\n this.asProps.onCancel?.(prevText, event);\n };\n\n handleBlur = (event: React.FocusEvent) => {\n const { onConfirm, onCancel, onBlurBehavior } = this.asProps;\n if (!onBlurBehavior) return;\n if (Date.now() - this.lastHandledKeyboardEvent < 250) return;\n if (hasParent(event.relatedTarget, this.rootRef.current!)) return;\n\n if (lastInteraction.isKeyboard()) {\n if (lastInteraction.isTab) {\n onCancel?.(this.initValue, event);\n }\n return;\n }\n\n if (this.lastMouseDownPosition && this.rootRef.current) {\n const { x, y } = this.lastMouseDownPosition;\n const rect = this.rootRef.current.getBoundingClientRect();\n\n if (pointInsideOfRect({ x, y, rect })) {\n return;\n }\n }\n\n if (onBlurBehavior === 'confirm') onConfirm?.(this.inputRef.current?.value ?? '', event);\n if (onBlurBehavior === 'cancel') onCancel?.(this.initValue, event);\n };\n\n handleKeyDown = (event: React.KeyboardEvent) => {\n const { onConfirm, onCancel } = this.asProps;\n if (event.key === 'Enter') {\n onConfirm?.(this.inputRef.current?.value ?? '', event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n if (event.key === 'Escape') {\n onCancel?.(this.initValue, event);\n this.lastHandledKeyboardEvent = Date.now();\n }\n };\n\n private updateInert() {\n const { disabled } = this.asProps;\n\n if (!this.rootRef.current) return;\n\n if (disabled) {\n this.rootRef.current.setAttribute('inert', '');\n } else {\n this.rootRef.current.removeAttribute('inert');\n }\n }\n\n render() {\n const SInlineInput = Root;\n const SUnderline = 'div';\n const { Children, styles } = this.asProps;\n\n return sstyled(styles)(\n <SInlineInput render={Box} ref={this.rootRef} onBlur={this.handleBlur}>\n <SUnderline>\n <Children />\n </SUnderline>\n </SInlineInput>,\n );\n }\n}\n\nclass Value extends Component<\n Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Value.Component, typeof InlineInputBase, 'Value'>,\n [],\n NSInlineInput.Value.Handlers\n> {\n static defaultProps: NSInlineInput.Value.DefaultProps = {\n defaultValue: '',\n };\n\n uncontrolledProps() {\n return {\n value: (event: React.ChangeEvent<HTMLInputElement>) => event.target.value,\n };\n }\n\n render() {\n const SValue = Root;\n\n return sstyled(this.asProps.styles)(<SValue render={Box} tag='input' type='text' />);\n }\n}\n\nfunction Addon(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.Addon.Component, typeof InlineInputBase, 'Addon'>,\n) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} />);\n}\n\nfunction ConfirmControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.ConfirmControl.Component, typeof InlineInputBase, 'ConfirmControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren, inputRef, onCancel } = props;\n const title = props.title ?? props.getI18nText('confirm');\n\n const handleConfirm = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onConfirm?.(inputRef?.current?.value ?? '', event);\n },\n [props.onConfirm, inputRef?.current],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.stopPropagation();\n handleConfirm(event);\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n onCancel?.(inputRef?.current?.value ?? '', event);\n }\n },\n [handleConfirm],\n );\n\n if (props.loading) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <Spin size='xs' />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sConfirmIconStyles = sstyles.cn('SConfirmIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n addonLeft={props.icon ?? CheckM}\n use='secondary'\n onClick={handleConfirm}\n className={sConfirmIconStyles.className}\n style={sConfirmIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction CancelControl(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.CancelControl.Component, typeof InlineInputBase, 'CancelControl'>,\n) {\n const SAddon = Root;\n const { Children, children: hasChildren } = props;\n const title = props.title ?? props.getI18nText('discard');\n\n const handleCancel = React.useCallback(\n (event: React.MouseEvent | React.KeyboardEvent) => {\n props.onCancel?.(props.value ?? '', event);\n },\n [props.onCancel, props.value],\n );\n\n const handleKeydown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' || event.key === ' ' || event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n handleCancel(event);\n }\n },\n [handleCancel],\n );\n\n if (props.disabled) {\n return sstyled(props.styles)(\n <SAddon render={Box}>{hasChildren ? <Children /> : <CloseM />}</SAddon>,\n );\n }\n\n const sstyles = sstyled(props.styles);\n const sCancelIconStyles = sstyles.cn('SCancelIcon', {});\n\n return sstyled(props.styles)(\n <SAddon render={Box} onKeyDown={handleKeydown}>\n {hasChildren\n ? (\n <Children />\n )\n : (\n <ButtonLink\n use='secondary'\n addonLeft={props.icon ?? CloseM}\n onClick={handleCancel}\n className={sCancelIconStyles.className}\n style={sCancelIconStyles.style}\n aria-label={title}\n />\n )}\n </SAddon>,\n );\n}\n\nfunction NumberValue(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberValue.Component, typeof InlineInputBase, 'NumberValue'>,\n) {\n const SValue = Root;\n\n return sstyled(props.styles)(<SValue render={InputNumber.Value} />);\n};\n\nfunction NumberControls(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSInlineInput.NumberControls.Component, typeof InlineInputBase, 'NumberControls'>,\n) {\n const SControls = Root;\n\n return sstyled(props.styles)(\n <SControls render={InputNumber.Controls} tag={InlineInput.Addon} />,\n );\n}\n\n/**\n * InlineInput\n *\n * {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-api/|API} | {@link https://developer.semrush.com/intergalactic/components/inline-input/inline-input-code/|Examples}\n */\nconst InlineInput = createComponent<\n NSInlineInput.Component,\n typeof InlineInputBase\n>(InlineInputBase, {\n Addon,\n Value,\n ConfirmControl,\n CancelControl,\n NumberValue,\n NumberControls,\n});\n\nexport default InlineInput;\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,SAASC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CAAC;AAEF,eAAeM,WAAW","ignoreList":[]}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
SInlineInput {
|
|
2
2
|
display: inline-flex;
|
|
3
|
-
width:
|
|
3
|
+
width: fit-content;
|
|
4
|
+
max-width: 100%;
|
|
4
5
|
height: 100%;
|
|
5
6
|
align-items: center;
|
|
6
7
|
position: relative;
|
|
7
|
-
z-index: 0;
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
/* disable-tokens-validator */
|
|
10
10
|
padding: 1px;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
|
|
13
|
-
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
14
|
-
|
|
15
13
|
SConfirmIcon:not([color]) {
|
|
16
|
-
color: var(--intergalactic-icon-secondary-success, oklch(0.
|
|
17
|
-
cursor: pointer;
|
|
14
|
+
color: var(--intergalactic-icon-secondary-success, oklch(0.787 0.16 167.8 / 0.898));
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
SConfirmIcon:not([color]):hover {
|
|
@@ -22,8 +19,7 @@ SInlineInput {
|
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
SCancelIcon:not([color]) {
|
|
25
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
26
|
-
cursor: pointer;
|
|
22
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
SCancelIcon:not([color]):hover {
|
|
@@ -31,12 +27,13 @@ SInlineInput {
|
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
SValue {
|
|
34
|
-
|
|
30
|
+
flex: 0 1 auto;
|
|
35
31
|
min-width: 0;
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
width: auto;
|
|
36
34
|
|
|
37
|
-
width: 100%;
|
|
38
35
|
height: 100%;
|
|
39
|
-
padding:
|
|
36
|
+
padding: var(--intergalactic-spacing-1x, 4px);
|
|
40
37
|
border: none;
|
|
41
38
|
box-sizing: border-box;
|
|
42
39
|
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
@@ -46,13 +43,18 @@ SInlineInput {
|
|
|
46
43
|
font-family: inherit;
|
|
47
44
|
background: transparent;
|
|
48
45
|
min-height: 1em;
|
|
46
|
+
text-decoration-line: underline;
|
|
47
|
+
text-decoration-style: dotted;
|
|
48
|
+
text-decoration-thickness: 2px;
|
|
49
|
+
text-decoration-color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
50
|
+
text-underline-offset: 17%;
|
|
49
51
|
|
|
50
52
|
&:focus, &:focus-visible {
|
|
51
53
|
outline: none;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
&::placeholder {
|
|
55
|
-
color: var(--intergalactic-text-placeholder, oklch(0.
|
|
57
|
+
color: var(--intergalactic-text-placeholder, oklch(0.109 0.023 165.5 / 0.337));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
&[disabled] {
|
|
@@ -79,15 +81,26 @@ SInlineInput[disabled] {
|
|
|
79
81
|
|
|
80
82
|
SUnderline {
|
|
81
83
|
display: flex;
|
|
82
|
-
flex-direction: row;
|
|
83
84
|
align-items: center;
|
|
84
|
-
|
|
85
|
+
min-width: 0;
|
|
85
86
|
width: 100%;
|
|
86
87
|
height: 100%;
|
|
87
88
|
min-height: 1em;
|
|
88
89
|
border: 1px solid transparent;
|
|
89
|
-
border-
|
|
90
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
90
91
|
outline-color: transparent;
|
|
92
|
+
transition-duration: calc(var(--intergalactic-duration-extra-fast, 100) * 1ms);
|
|
93
|
+
transition-timing-function: ease-in-out;
|
|
94
|
+
transition-property: background-color;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SUnderline {
|
|
98
|
+
background-color: var(--intergalactic-control-secondary-neutral, oklch(0.166 0.031 175.8 / 0.097));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SAddon,
|
|
102
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SValue {
|
|
103
|
+
cursor: pointer;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
106
|
SAddon {
|
|
@@ -96,8 +109,8 @@ SAddon {
|
|
|
96
109
|
align-items: center;
|
|
97
110
|
flex: 0 0 auto;
|
|
98
111
|
height: 100%;
|
|
99
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
100
|
-
padding: 0 var(--intergalactic-spacing-
|
|
112
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
113
|
+
padding: 0 var(--intergalactic-spacing-content-gap-small, 4px);
|
|
101
114
|
}
|
|
102
115
|
|
|
103
116
|
SAddon[disabled] {
|
|
@@ -106,38 +119,49 @@ SAddon[disabled] {
|
|
|
106
119
|
pointer-events: none;
|
|
107
120
|
}
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@mixin focus-outline-mixin;
|
|
122
|
+
[data-ui-name='InlineInput.CancelControl'] {
|
|
123
|
+
padding-left: 0;
|
|
112
124
|
}
|
|
113
125
|
|
|
114
|
-
SInlineInput[
|
|
115
|
-
|
|
126
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.ConfirmControl'],
|
|
127
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.CancelControl'] {
|
|
128
|
+
display: none;
|
|
116
129
|
}
|
|
117
130
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
@mixin focus-outline-mixin
|
|
121
|
-
|
|
131
|
+
SUnderline:has(input:focus-visible) {
|
|
132
|
+
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
133
|
+
@mixin focus-outline-mixin {
|
|
134
|
+
outline-offset: 0;
|
|
135
|
+
transition-property: outline-color, outline-width;
|
|
136
|
+
}
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
SInlineInput[state='
|
|
125
|
-
|
|
139
|
+
SInlineInput[state='valid'] SUnderline:has(input:focus-visible) {
|
|
140
|
+
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
SInlineInput[state='invalid'] SUnderline:has(input:focus-visible) {
|
|
129
|
-
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
130
|
-
@mixin focus-outline-mixin;
|
|
131
144
|
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
132
145
|
}
|
|
133
146
|
|
|
147
|
+
SInlineInput[state='valid'] SValue {
|
|
148
|
+
text-decoration-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SInlineInput[state='invalid'] SValue {
|
|
152
|
+
text-decoration-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
SInlineInput[state]:focus-within SValue {
|
|
156
|
+
text-decoration-color: transparent;
|
|
157
|
+
}
|
|
158
|
+
|
|
134
159
|
SValue:focus~SControls {
|
|
135
160
|
display: flex;
|
|
136
161
|
}
|
|
137
162
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
height: calc(100% - 3px);
|
|
163
|
+
@supports (field-sizing: content) {
|
|
164
|
+
SValue {
|
|
165
|
+
field-sizing: content;
|
|
166
|
+
}
|
|
143
167
|
}
|
package/lib/esm/InlineInput.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { sstyled, Component, lastInteraction, assignProps, createComponent } from "@semcore/core";
|
|
3
|
-
import { Box
|
|
3
|
+
import { Box } from "@semcore/base-components";
|
|
4
4
|
import { ButtonLink } from "@semcore/button";
|
|
5
5
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
6
6
|
import { hasParent } from "@semcore/core/lib/utils/hasParent";
|
|
@@ -16,24 +16,25 @@ const style = (
|
|
|
16
16
|
/*__reshadow_css_start__*/
|
|
17
17
|
(sstyled.insert(
|
|
18
18
|
/*__inner_css_start__*/
|
|
19
|
-
|
|
19
|
+
'.___SInlineInput_1t5br_gg_{display:inline-flex;width:-moz-fit-content;width:fit-content;max-width:100%;height:100%;align-items:center;position:relative;vertical-align:middle;padding:1px;box-sizing:border-box}.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,#00d9a5e5)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-success,oklch(.787 .16 167.8/.898))}}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SConfirmIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-success-hover-active,oklch(.673 .139 166.3))}}.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_){color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262))}@media (hover:hover){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,#0005026e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SCancelIcon_1t5br_gg_:not(.__color_1t5br_gg_):hover{color:var(--intergalactic-icon-secondary-neutral-hover-active,oklch(.1 .023 159.1/.433))}}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_{flex:0 1 auto;min-width:0;max-width:100%;width:auto;height:100%;padding:var(--intergalactic-spacing-1x,4px);border:none;box-sizing:border-box;color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:#0000;min-height:1em;text-decoration-line:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-decoration-color:var(--intergalactic-text-primary,oklch(.1 .03 137/.899));text-underline-offset:17%}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_:focus-visible{outline:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,#00060356)}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,#00060356)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::placeholder{color:var(--intergalactic-text-placeholder,oklch(.109 .023 165.5/.337))}}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_.__disabled_1t5br_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-inner-spin-button,.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.___SInlineInput_1t5br_gg_ .___SValue_1t5br_gg_._type_number_1t5br_gg_{-moz-appearance:textfield}.___SInlineInput_1t5br_gg_.__disabled_1t5br_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity,.4)}.___SUnderline_1t5br_gg_{display:flex;align-items:center;min-width:0;width:100%;height:100%;min-height:1em;border:1px solid #0000;border-radius:var(--intergalactic-control-rounded,6px);outline-color:#0000;transition-duration:calc(var(--intergalactic-duration-extra-fast, 100)*1ms);transition-timing-function:ease-in-out;transition-property:background-color}@media (hover:hover){.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) .___SUnderline_1t5br_gg_{background-color:var(--intergalactic-control-secondary-neutral,oklch(.166 .031 175.8/.097))}.___SInlineInput_1t5br_gg_:hover:not(:focus-within):not(.__disabled_1t5br_gg_) :is(.___SAddon_1t5br_gg_,.___SValue_1t5br_gg_){cursor:pointer}}.___SAddon_1t5br_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral,oklch(.118 .023 170.1/.262));padding:0 var(--intergalactic-spacing-content-gap-small,4px)}.___SAddon_1t5br_gg_.__disabled_1t5br_gg_{opacity:var(--intergalactic-disabled-opacity,.4);cursor:default;pointer-events:none}[data-ui-name="InlineInput.CancelControl"]{padding-left:0}.___SInlineInput_1t5br_gg_:not(:focus-within):not(.__loading_1t5br_gg_) :is([data-ui-name="InlineInput.CancelControl"],[data-ui-name="InlineInput.ConfirmControl"]){display:none}.___SUnderline_1t5br_gg_:has(input:focus-visible){background-color:var(--intergalactic-bg-primary-neutral,oklch(1 0 0));outline-color:var(--intergalactic-keyboard-focus-outline,#0020dd78);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;outline-offset:0;transition-property:outline-color,outline-width}@media (color-gamut:p3){.___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-outline,oklch(.424 .269 264.2/.469))}}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,#00be8e)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-valid-outline,oklch(.711 .146 166.9))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SUnderline_1t5br_gg_:has(input:focus-visible){outline-color:var(--intergalactic-keyboard-focus-invalid-outline,oklch(.628 .257 28.9/.652))}.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,#00b991)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_valid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-success-active,oklch(.7 .166 170))}}.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,#ff6364)}@media (color-gamut:p3){.___SInlineInput_1t5br_gg_._state_invalid_1t5br_gg_ .___SValue_1t5br_gg_{text-decoration-color:var(--intergalactic-border-critical-active,oklch(.7 .21 23))}}.___SInlineInput_1t5br_gg_.__state_1t5br_gg_:focus-within .___SValue_1t5br_gg_{text-decoration-color:#0000}.___SValue_1t5br_gg_:focus~.___SControls_1t5br_gg_{display:flex}@supports (field-sizing:content){.___SValue_1t5br_gg_{field-sizing:content}}',
|
|
20
20
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
21
|
+
"1t5br_gg_"
|
|
22
22
|
), /*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SInlineInput": "
|
|
25
|
-
"_disabled": "
|
|
26
|
-
"__SUnderline": "
|
|
27
|
-
"__SAddon": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
24
|
+
"__SInlineInput": "___SInlineInput_1t5br_gg_",
|
|
25
|
+
"_disabled": "__disabled_1t5br_gg_",
|
|
26
|
+
"__SUnderline": "___SUnderline_1t5br_gg_",
|
|
27
|
+
"__SAddon": "___SAddon_1t5br_gg_",
|
|
28
|
+
"__SValue": "___SValue_1t5br_gg_",
|
|
29
|
+
"_loading": "__loading_1t5br_gg_",
|
|
30
|
+
"_state_valid": "_state_valid_1t5br_gg_",
|
|
31
|
+
"_state_invalid": "_state_invalid_1t5br_gg_",
|
|
32
|
+
"_state": "__state_1t5br_gg_",
|
|
33
|
+
"__SControls": "___SControls_1t5br_gg_",
|
|
34
|
+
"__SConfirmIcon": "___SConfirmIcon_1t5br_gg_",
|
|
35
|
+
"_color": "__color_1t5br_gg_",
|
|
36
|
+
"__SCancelIcon": "___SCancelIcon_1t5br_gg_",
|
|
37
|
+
"_type_number": "_type_number_1t5br_gg_"
|
|
37
38
|
})
|
|
38
39
|
);
|
|
39
40
|
const pointInsideOfRect = ({
|
|
@@ -220,18 +221,16 @@ class InlineInputBase extends Component {
|
|
|
220
221
|
var _ref = this.asProps, _ref8;
|
|
221
222
|
const SInlineInput = Box;
|
|
222
223
|
const SUnderline = "div";
|
|
223
|
-
const SInvalidPattern = InvalidStateBox;
|
|
224
224
|
const {
|
|
225
225
|
Children,
|
|
226
|
-
styles
|
|
227
|
-
state
|
|
226
|
+
styles
|
|
228
227
|
} = this.asProps;
|
|
229
228
|
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SInlineInput, _ref8.cn("SInlineInput", {
|
|
230
229
|
...assignProps({
|
|
231
230
|
"ref": this.rootRef,
|
|
232
231
|
"onBlur": this.handleBlur
|
|
233
232
|
}, _ref)
|
|
234
|
-
}), /* @__PURE__ */ React.createElement(SUnderline, _ref8.cn("SUnderline", {}),
|
|
233
|
+
}), /* @__PURE__ */ React.createElement(SUnderline, _ref8.cn("SUnderline", {}), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}))));
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
236
|
_defineProperty(InlineInputBase, "displayName", "InlineInput");
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
SInlineInput {
|
|
2
2
|
display: inline-flex;
|
|
3
|
-
width:
|
|
3
|
+
width: fit-content;
|
|
4
|
+
max-width: 100%;
|
|
4
5
|
height: 100%;
|
|
5
6
|
align-items: center;
|
|
6
7
|
position: relative;
|
|
7
|
-
z-index: 0;
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
/* disable-tokens-validator */
|
|
10
10
|
padding: 1px;
|
|
11
11
|
box-sizing: border-box;
|
|
12
12
|
|
|
13
|
-
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
14
|
-
|
|
15
13
|
SConfirmIcon:not([color]) {
|
|
16
|
-
color: var(--intergalactic-icon-secondary-success, oklch(0.
|
|
17
|
-
cursor: pointer;
|
|
14
|
+
color: var(--intergalactic-icon-secondary-success, oklch(0.787 0.16 167.8 / 0.898));
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
SConfirmIcon:not([color]):hover {
|
|
@@ -22,8 +19,7 @@ SInlineInput {
|
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
SCancelIcon:not([color]) {
|
|
25
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
26
|
-
cursor: pointer;
|
|
22
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
SCancelIcon:not([color]):hover {
|
|
@@ -31,12 +27,13 @@ SInlineInput {
|
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
SValue {
|
|
34
|
-
|
|
30
|
+
flex: 0 1 auto;
|
|
35
31
|
min-width: 0;
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
width: auto;
|
|
36
34
|
|
|
37
|
-
width: 100%;
|
|
38
35
|
height: 100%;
|
|
39
|
-
padding:
|
|
36
|
+
padding: var(--intergalactic-spacing-1x, 4px);
|
|
40
37
|
border: none;
|
|
41
38
|
box-sizing: border-box;
|
|
42
39
|
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
@@ -46,13 +43,18 @@ SInlineInput {
|
|
|
46
43
|
font-family: inherit;
|
|
47
44
|
background: transparent;
|
|
48
45
|
min-height: 1em;
|
|
46
|
+
text-decoration-line: underline;
|
|
47
|
+
text-decoration-style: dotted;
|
|
48
|
+
text-decoration-thickness: 2px;
|
|
49
|
+
text-decoration-color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
50
|
+
text-underline-offset: 17%;
|
|
49
51
|
|
|
50
52
|
&:focus, &:focus-visible {
|
|
51
53
|
outline: none;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
&::placeholder {
|
|
55
|
-
color: var(--intergalactic-text-placeholder, oklch(0.
|
|
57
|
+
color: var(--intergalactic-text-placeholder, oklch(0.109 0.023 165.5 / 0.337));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
&[disabled] {
|
|
@@ -79,15 +81,26 @@ SInlineInput[disabled] {
|
|
|
79
81
|
|
|
80
82
|
SUnderline {
|
|
81
83
|
display: flex;
|
|
82
|
-
flex-direction: row;
|
|
83
84
|
align-items: center;
|
|
84
|
-
|
|
85
|
+
min-width: 0;
|
|
85
86
|
width: 100%;
|
|
86
87
|
height: 100%;
|
|
87
88
|
min-height: 1em;
|
|
88
89
|
border: 1px solid transparent;
|
|
89
|
-
border-
|
|
90
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
90
91
|
outline-color: transparent;
|
|
92
|
+
transition-duration: calc(var(--intergalactic-duration-extra-fast, 100) * 1ms);
|
|
93
|
+
transition-timing-function: ease-in-out;
|
|
94
|
+
transition-property: background-color;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SUnderline {
|
|
98
|
+
background-color: var(--intergalactic-control-secondary-neutral, oklch(0.166 0.031 175.8 / 0.097));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SAddon,
|
|
102
|
+
SInlineInput:hover:not(:focus-within):not([disabled]) SValue {
|
|
103
|
+
cursor: pointer;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
106
|
SAddon {
|
|
@@ -96,8 +109,8 @@ SAddon {
|
|
|
96
109
|
align-items: center;
|
|
97
110
|
flex: 0 0 auto;
|
|
98
111
|
height: 100%;
|
|
99
|
-
color: var(--intergalactic-icon-secondary-neutral, oklch(0.
|
|
100
|
-
padding: 0 var(--intergalactic-spacing-
|
|
112
|
+
color: var(--intergalactic-icon-secondary-neutral, oklch(0.118 0.023 170.1 / 0.262));
|
|
113
|
+
padding: 0 var(--intergalactic-spacing-content-gap-small, 4px);
|
|
101
114
|
}
|
|
102
115
|
|
|
103
116
|
SAddon[disabled] {
|
|
@@ -106,38 +119,49 @@ SAddon[disabled] {
|
|
|
106
119
|
pointer-events: none;
|
|
107
120
|
}
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@mixin focus-outline-mixin;
|
|
122
|
+
[data-ui-name='InlineInput.CancelControl'] {
|
|
123
|
+
padding-left: 0;
|
|
112
124
|
}
|
|
113
125
|
|
|
114
|
-
SInlineInput[
|
|
115
|
-
|
|
126
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.ConfirmControl'],
|
|
127
|
+
SInlineInput:not(:focus-within):not([loading]) [data-ui-name='InlineInput.CancelControl'] {
|
|
128
|
+
display: none;
|
|
116
129
|
}
|
|
117
130
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
@mixin focus-outline-mixin
|
|
121
|
-
|
|
131
|
+
SUnderline:has(input:focus-visible) {
|
|
132
|
+
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
133
|
+
@mixin focus-outline-mixin {
|
|
134
|
+
outline-offset: 0;
|
|
135
|
+
transition-property: outline-color, outline-width;
|
|
136
|
+
}
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
SInlineInput[state='
|
|
125
|
-
|
|
139
|
+
SInlineInput[state='valid'] SUnderline:has(input:focus-visible) {
|
|
140
|
+
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
SInlineInput[state='invalid'] SUnderline:has(input:focus-visible) {
|
|
129
|
-
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
130
|
-
@mixin focus-outline-mixin;
|
|
131
144
|
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
132
145
|
}
|
|
133
146
|
|
|
147
|
+
SInlineInput[state='valid'] SValue {
|
|
148
|
+
text-decoration-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
SInlineInput[state='invalid'] SValue {
|
|
152
|
+
text-decoration-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
SInlineInput[state]:focus-within SValue {
|
|
156
|
+
text-decoration-color: transparent;
|
|
157
|
+
}
|
|
158
|
+
|
|
134
159
|
SValue:focus~SControls {
|
|
135
160
|
display: flex;
|
|
136
161
|
}
|
|
137
162
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
height: calc(100% - 3px);
|
|
163
|
+
@supports (field-sizing: content) {
|
|
164
|
+
SValue {
|
|
165
|
+
field-sizing: content;
|
|
166
|
+
}
|
|
143
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineInput.d.ts","sourceRoot":"","sources":["../../src/InlineInput.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineInput.d.ts","sourceRoot":"","sources":["../../src/InlineInput.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAiYxD;;;;GAIG;AACH,QAAA,MAAM,WAAW,yBAUf,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
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
|
+
"version": "18.0.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,23 +14,23 @@
|
|
|
14
14
|
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/spin": "^
|
|
18
|
-
"@semcore/tooltip": "^
|
|
19
|
-
"@semcore/input-number": "^
|
|
20
|
-
"@semcore/input": "^
|
|
21
|
-
"@semcore/button": "^
|
|
17
|
+
"@semcore/spin": "^18.0.0-prerelease.0",
|
|
18
|
+
"@semcore/tooltip": "^18.0.0-prerelease.0",
|
|
19
|
+
"@semcore/input-number": "^18.0.0-prerelease.0",
|
|
20
|
+
"@semcore/input": "^18.0.0-prerelease.0",
|
|
21
|
+
"@semcore/button": "^18.0.0-prerelease.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@semcore/core": "
|
|
25
|
-
"@semcore/
|
|
24
|
+
"@semcore/core": "18.0.0-prerelease.0",
|
|
25
|
+
"@semcore/tooltip": "18.0.0-prerelease.0",
|
|
26
|
+
"@semcore/base-components": "18.0.0-prerelease.0",
|
|
26
27
|
"@semcore/testing-utils": "1.0.0",
|
|
27
|
-
"@semcore/
|
|
28
|
-
"@semcore/
|
|
29
|
-
"@semcore/icon": "17.3.0"
|
|
28
|
+
"@semcore/icon": "18.0.0-prerelease.0",
|
|
29
|
+
"@semcore/spin": "18.0.0-prerelease.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@semcore/base-components": "^
|
|
33
|
-
"@semcore/icon": "^
|
|
32
|
+
"@semcore/base-components": "^18.0.0-prerelease.0",
|
|
33
|
+
"@semcore/icon": "^18.0.0-prerelease.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|