@semcore/inline-input 3.5.31 → 3.5.33
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 +8 -4
- package/lib/cjs/InlineInput.js +11 -11
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/es6/InlineInput.js +11 -11
- package/lib/es6/index.d.js.map +1 -1
- package/lib/types/index.d.ts +0 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
-
## [3.5.
|
|
5
|
+
## [3.5.33] - 2023-05-10
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Removed mistaken types.
|
|
10
|
+
|
|
11
|
+
## [3.5.32] - 2023-05-10
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
8
14
|
|
|
9
|
-
- Version patch update due to children dependencies update (`@semcore/
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/tooltip` [5.4.9 ~> 5.4.10]).
|
|
10
16
|
|
|
11
17
|
## [3.5.29] - 2023-04-24
|
|
12
18
|
|
|
13
|
-
## [3.5.28] - 2023-04-14
|
|
14
|
-
|
|
15
19
|
### Fixed
|
|
16
20
|
|
|
17
21
|
- Improvements for a11y. Hidden controls because they are accessible via the keyboard.
|
package/lib/cjs/InlineInput.js
CHANGED
|
@@ -24,17 +24,17 @@ var _spin = _interopRequireDefault(require("@semcore/spin"));
|
|
|
24
24
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
25
25
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
26
26
|
/*__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
27
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
28
|
-
"__SInlineInput": "
|
|
29
|
-
"_disabled": "
|
|
30
|
-
"__SValue": "
|
|
31
|
-
"__SUnderline": "
|
|
32
|
-
"__SAddon": "
|
|
33
|
-
"__SConfirmIcon": "
|
|
34
|
-
"__SCancelIcon": "
|
|
35
|
-
"_focused": "
|
|
36
|
-
"_state_valid": "
|
|
37
|
-
"_state_invalid": "
|
|
27
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SInlineInput_17zko_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SInlineInput_17zko_gg_.__disabled_17zko_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_17zko_gg_{min-width:0;width:100%;height:100%;padding:0 var(--intergalactic-spacing-1x, 4px);border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SValue_17zko_gg_:focus{outline:0}.___SValue_17zko_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_17zko_gg_::placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_17zko_gg_.__disabled_17zko_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SUnderline_17zko_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SAddon_17zko_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);padding:0 var(--intergalactic-spacing-1x, 4px)}.___SAddon_17zko_gg_.__disabled_17zko_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SConfirmIcon_17zko_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SConfirmIcon_17zko_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #009f81)}}.___SCancelIcon_17zko_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SCancelIcon_17zko_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SInlineInput_17zko_gg_.__focused_17zko_gg_{z-index:1}.___SInlineInput_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SInlineInput_17zko_gg_._state_valid_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_17zko_gg_._state_valid_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.3))}.___SInlineInput_17zko_gg_._state_invalid_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_17zko_gg_._state_invalid_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.3))}" /*__inner_css_end__*/, "17zko_gg_") /*__reshadow_css_end__*/, {
|
|
28
|
+
"__SInlineInput": "___SInlineInput_17zko_gg_",
|
|
29
|
+
"_disabled": "__disabled_17zko_gg_",
|
|
30
|
+
"__SValue": "___SValue_17zko_gg_",
|
|
31
|
+
"__SUnderline": "___SUnderline_17zko_gg_",
|
|
32
|
+
"__SAddon": "___SAddon_17zko_gg_",
|
|
33
|
+
"__SConfirmIcon": "___SConfirmIcon_17zko_gg_",
|
|
34
|
+
"__SCancelIcon": "___SCancelIcon_17zko_gg_",
|
|
35
|
+
"_focused": "__focused_17zko_gg_",
|
|
36
|
+
"_state_valid": "_state_valid_17zko_gg_",
|
|
37
|
+
"_state_invalid": "_state_invalid_17zko_gg_"
|
|
38
38
|
});
|
|
39
39
|
var isFocusOutsideOf = function isFocusOutsideOf(element) {
|
|
40
40
|
var traversed = document.activeElement;
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n *
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm';\n locale?: string;\n}\n\nexport interface IInlineInputAddonProps extends IBoxProps {}\nexport interface IInlineInputValueProps extends IBoxProps {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * visual state of component\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements\n */\n loading?: boolean;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n}\nexport interface IInlineInputConfirmControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n}\nexport interface IInlineInputCancelControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n}\n\ninterface IInlineInputCtx {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n}\n\ndeclare const InlineInput: (<T>(\n props: CProps<IInlineInputProps & T, IInlineInputCtx>,\n) => React.ReactElement) & {\n Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;\n Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;\n ConfirmControl: <T>(\n props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n CancelControl: <T>(\n props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n};\nexport default InlineInput;\n"],"mappings":""}
|
package/lib/es6/InlineInput.js
CHANGED
|
@@ -19,17 +19,17 @@ import { Box } from '@semcore/flex-box';
|
|
|
19
19
|
import autoFocusEnhance from '@semcore/utils/lib/enhances/autoFocusEnhance';
|
|
20
20
|
import Tooltip from '@semcore/tooltip';
|
|
21
21
|
/*__reshadow-styles__:"./style/inline-input.shadow.css"*/
|
|
22
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
23
|
-
"__SInlineInput": "
|
|
24
|
-
"_disabled": "
|
|
25
|
-
"__SValue": "
|
|
26
|
-
"__SUnderline": "
|
|
27
|
-
"__SAddon": "
|
|
28
|
-
"__SConfirmIcon": "
|
|
29
|
-
"__SCancelIcon": "
|
|
30
|
-
"_focused": "
|
|
31
|
-
"_state_valid": "
|
|
32
|
-
"_state_invalid": "
|
|
22
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SInlineInput_17zko_gg_{display:inline-flex;width:100%;height:100%;align-items:center;position:relative;z-index:0;vertical-align:middle;padding:1px;box-sizing:border-box;background-color:var(--intergalactic-bg-primary-neutral, #ffffff)}.___SInlineInput_17zko_gg_.__disabled_17zko_gg_{cursor:default;pointer-events:none;opacity:var(--intergalactic-disabled-opacity, 0.3)}.___SValue_17zko_gg_{min-width:0;width:100%;height:100%;padding:0 var(--intergalactic-spacing-1x, 4px);border:0;box-sizing:border-box;color:var(--intergalactic-text-primary, #191b23);font-size:inherit;line-height:1.2;text-overflow:ellipsis;font-family:inherit;background:0 0;min-height:1em}.___SValue_17zko_gg_:focus{outline:0}.___SValue_17zko_gg_::-moz-placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_17zko_gg_::placeholder{color:var(--intergalactic-text-placeholder, #a9abb6)}.___SValue_17zko_gg_.__disabled_17zko_gg_{-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SUnderline_17zko_gg_{display:flex;flex-direction:row;align-items:center;flex-grow:1;width:100%;height:100%;min-height:1em;border:1px solid transparent;border-bottom:1px solid var(--intergalactic-border-primary, #c4c7cf)}.___SAddon_17zko_gg_{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;height:100%;color:var(--intergalactic-icon-secondary-neutral, #a9abb6);padding:0 var(--intergalactic-spacing-1x, 4px)}.___SAddon_17zko_gg_.__disabled_17zko_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SConfirmIcon_17zko_gg_{color:var(--intergalactic-icon-secondary-success, #00c192);cursor:pointer}@media (hover:hover){.___SConfirmIcon_17zko_gg_:hover{color:var(--intergalactic-icon-secondary-success-hover-active, #009f81)}}.___SCancelIcon_17zko_gg_{color:var(--intergalactic-icon-secondary-neutral, #a9abb6);cursor:pointer}@media (hover:hover){.___SCancelIcon_17zko_gg_:hover{color:var(--intergalactic-icon-secondary-neutral-hover-active, #8a8e9b)}}.___SInlineInput_17zko_gg_.__focused_17zko_gg_{z-index:1}.___SInlineInput_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-info-active, #006dca);box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.3))}.___SInlineInput_17zko_gg_._state_valid_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65)}.___SInlineInput_17zko_gg_._state_valid_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-success-active, #007c65);box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.3))}.___SInlineInput_17zko_gg_._state_invalid_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f)}.___SInlineInput_17zko_gg_._state_invalid_17zko_gg_.__focused_17zko_gg_ .___SUnderline_17zko_gg_{border-bottom-color:var(--intergalactic-border-critical-active, #d1002f);box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.3))}" /*__inner_css_end__*/, "17zko_gg_") /*__reshadow_css_end__*/, {
|
|
23
|
+
"__SInlineInput": "___SInlineInput_17zko_gg_",
|
|
24
|
+
"_disabled": "__disabled_17zko_gg_",
|
|
25
|
+
"__SValue": "___SValue_17zko_gg_",
|
|
26
|
+
"__SUnderline": "___SUnderline_17zko_gg_",
|
|
27
|
+
"__SAddon": "___SAddon_17zko_gg_",
|
|
28
|
+
"__SConfirmIcon": "___SConfirmIcon_17zko_gg_",
|
|
29
|
+
"__SCancelIcon": "___SCancelIcon_17zko_gg_",
|
|
30
|
+
"_focused": "__focused_17zko_gg_",
|
|
31
|
+
"_state_valid": "_state_valid_17zko_gg_",
|
|
32
|
+
"_state_invalid": "_state_invalid_17zko_gg_"
|
|
33
33
|
});
|
|
34
34
|
import CheckM from '@semcore/icon/Check/m';
|
|
35
35
|
import CloseM from '@semcore/icon/Close/m';
|
package/lib/es6/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n *
|
|
1
|
+
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { PropGetterFn } from '@semcore/core';\nimport { IBoxProps } from '@semcore/flex-box';\n\n/* utils type */\ntype CProps<Props, Ctx = {}, UCProps = {}> = Props & {\n children?:\n | ((props: Props & Ctx, handlers: UCProps) => React.ReactNode)\n | React.ReactNode\n | React.ReactNode[];\n};\n/* utils type */\n\nexport interface IInlineInputProps extends IBoxProps {\n /**\n * Visual state of inline input\n * @default normal\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * Disabled input and shows spinner instead of confirm control\n * @default false\n */\n loading?: boolean;\n /**\n * Disabled input and controls\n * @default false\n */\n disabled?: boolean;\n /**\n * Fired with entered value when user clicks confirm control or hits `Enter` or `Space`\n */\n onConfirm?: (\n value: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`\n */\n onCancel?: (\n prevValue: string,\n event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,\n ) => void;\n /**\n * Text value of input. Should be used with `onChange` property together\n */\n value?: string;\n /**\n * Initial text value of input\n */\n defaultValue?: string;\n /**\n * Makes component to catch browser focus on component mount\n * @default false\n */\n autoFocus?: boolean;\n /**\n * Gray text displayed in empty input\n */\n placeholder?: string;\n /**\n * defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired\n * Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)\n */\n onBlurBehavior?: 'cancel' | 'confirm';\n locale?: string;\n}\n\nexport interface IInlineInputAddonProps extends IBoxProps {}\nexport interface IInlineInputValueProps extends IBoxProps {\n /**\n * id attribute of input tag\n */\n id?: string;\n /**\n * when `true`, element is focused immediately after mount\n */\n autoFocus?: boolean;\n /**\n * value of input tag\n */\n value?: string;\n /**\n * uncontrolled value of input tag\n */\n defaultValue?: string;\n /**\n * callback invoked on every change of input tag value\n */\n onChange?: (value: string, event: React.ChangeEvent) => void;\n /**\n * visual state of component\n */\n state?: 'normal' | 'valid' | 'invalid';\n /**\n * shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements\n */\n loading?: boolean;\n /**\n * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n}\nexport interface IInlineInputConfirmControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Confirm\n */\n title?: string;\n /**\n * Icon component\n * @default CheckM\n */\n icon?: React.FC;\n}\nexport interface IInlineInputCancelControlProps extends IBoxProps {\n /**\n * Text of tooltip\n * @default Cancel\n */\n title?: string;\n /**\n * Icon component\n * @default CloseM\n */\n icon?: React.FC;\n}\n\ninterface IInlineInputCtx {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n}\n\ndeclare const InlineInput: (<T>(\n props: CProps<IInlineInputProps & T, IInlineInputCtx>,\n) => React.ReactElement) & {\n Addon: <T>(props: CProps<IInlineInputAddonProps & T, IInlineInputProps>) => React.ReactElement;\n Value: <T>(props: CProps<IInlineInputValueProps & T, IInlineInputProps>) => React.ReactElement;\n ConfirmControl: <T>(\n props: CProps<IInlineInputConfirmControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n CancelControl: <T>(\n props: CProps<IInlineInputCancelControlProps & T, IInlineInputProps>,\n ) => React.ReactElement;\n};\nexport default InlineInput;\n"],"mappings":""}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -58,18 +58,6 @@ export interface IInlineInputProps extends IBoxProps {
|
|
|
58
58
|
* Gray text displayed in empty input
|
|
59
59
|
*/
|
|
60
60
|
placeholder?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Fired on every input value change. Should be used with `value` property together
|
|
63
|
-
*/
|
|
64
|
-
onChange?: (value: string, event: React.ChangeEvent) => void;
|
|
65
|
-
/**
|
|
66
|
-
* Fired when browser focus leaves component.
|
|
67
|
-
*/
|
|
68
|
-
onBlur?: (event: React.FocusEvent) => void;
|
|
69
|
-
/**
|
|
70
|
-
* Fired when browser focus enters component.
|
|
71
|
-
*/
|
|
72
|
-
onFocus?: (event: React.FocusEvent) => void;
|
|
73
61
|
/**
|
|
74
62
|
* defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
|
|
75
63
|
* Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
|