@semcore/inline-input 16.1.5-prerelease.3 → 16.1.5
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.
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ButtonLinkComponent } from '@semcore/button';
|
|
2
|
+
import type { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
+
import type { BoxProps } from '@semcore/flex-box';
|
|
4
|
+
import type { InputNumberControlsProps } from '@semcore/input-number';
|
|
5
|
+
import type React from 'react';
|
|
6
|
+
/** @deprecated */
|
|
7
|
+
export interface IInlineInputProps extends InlineInputProps, UnknownProperties {
|
|
8
|
+
}
|
|
9
|
+
export type InlineInputProps = BoxProps & {
|
|
10
|
+
/**
|
|
11
|
+
* Visual state of inline input
|
|
12
|
+
* @default normal
|
|
13
|
+
*/
|
|
14
|
+
state?: 'normal' | 'valid' | 'invalid';
|
|
15
|
+
/**
|
|
16
|
+
* Disabled input and shows spinner instead of confirm control
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Disabled input and controls
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
|
|
27
|
+
*/
|
|
28
|
+
onConfirm?: (value: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
|
|
31
|
+
*/
|
|
32
|
+
onCancel?: (prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Text value of input. Should be used with `onChange` property together
|
|
35
|
+
*/
|
|
36
|
+
value?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Initial text value of input
|
|
39
|
+
*/
|
|
40
|
+
defaultValue?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Makes component to catch browser focus on component mount
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
autoFocus?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Gray text displayed in empty input
|
|
48
|
+
*/
|
|
49
|
+
placeholder?: string;
|
|
50
|
+
/**
|
|
51
|
+
* defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
|
|
52
|
+
* Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
|
|
53
|
+
*/
|
|
54
|
+
onBlurBehavior?: 'cancel' | 'confirm' | 'none';
|
|
55
|
+
locale?: string;
|
|
56
|
+
};
|
|
57
|
+
/** @deprecated */
|
|
58
|
+
export interface IInlineInputAddonProps extends InlineInputAddonProps, UnknownProperties {
|
|
59
|
+
}
|
|
60
|
+
export type InlineInputAddonProps = BoxProps & {};
|
|
61
|
+
/** @deprecated */
|
|
62
|
+
export interface IInlineInputValueProps extends InlineInputValueProps, UnknownProperties {
|
|
63
|
+
}
|
|
64
|
+
export type InlineInputValueProps = BoxProps & {
|
|
65
|
+
/**
|
|
66
|
+
* id attribute of input tag
|
|
67
|
+
*/
|
|
68
|
+
id?: string;
|
|
69
|
+
/**
|
|
70
|
+
* when `true`, element is focused immediately after mount
|
|
71
|
+
*/
|
|
72
|
+
autoFocus?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* value of input tag
|
|
75
|
+
*/
|
|
76
|
+
value?: string;
|
|
77
|
+
/**
|
|
78
|
+
* uncontrolled value of input tag
|
|
79
|
+
*/
|
|
80
|
+
defaultValue?: string;
|
|
81
|
+
/**
|
|
82
|
+
* callback invoked on every change of input tag value
|
|
83
|
+
*/
|
|
84
|
+
onChange?: (value: string, event: React.ChangeEvent) => void;
|
|
85
|
+
/**
|
|
86
|
+
* visual state of component
|
|
87
|
+
*/
|
|
88
|
+
state?: 'normal' | 'valid' | 'invalid';
|
|
89
|
+
/**
|
|
90
|
+
* shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
|
|
91
|
+
*/
|
|
92
|
+
loading?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* disables interactive elements
|
|
95
|
+
*/
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* gray text in empty input tag
|
|
99
|
+
*/
|
|
100
|
+
placeholder?: string;
|
|
101
|
+
};
|
|
102
|
+
/** @deprecated */
|
|
103
|
+
export interface IInlineInputConfirmControlProps extends InlineInputConfirmControlProps, UnknownProperties {
|
|
104
|
+
}
|
|
105
|
+
export type InlineInputConfirmControlProps = BoxProps & {
|
|
106
|
+
/**
|
|
107
|
+
* Text of tooltip
|
|
108
|
+
* @default Confirm
|
|
109
|
+
*/
|
|
110
|
+
title?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Icon component
|
|
113
|
+
* @default CheckM
|
|
114
|
+
*/
|
|
115
|
+
icon?: React.FC;
|
|
116
|
+
};
|
|
117
|
+
/** @deprecated */
|
|
118
|
+
export interface IInlineInputCancelControlProps extends InlineInputCancelControlProps, UnknownProperties {
|
|
119
|
+
}
|
|
120
|
+
export type InlineInputCancelControlProps = BoxProps & {
|
|
121
|
+
/**
|
|
122
|
+
* Text of tooltip
|
|
123
|
+
* @default Cancel
|
|
124
|
+
*/
|
|
125
|
+
title?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Icon component
|
|
128
|
+
* @default CloseM
|
|
129
|
+
*/
|
|
130
|
+
icon?: React.FC;
|
|
131
|
+
};
|
|
132
|
+
type InlineInputCtx = {
|
|
133
|
+
getAddonProps: PropGetterFn;
|
|
134
|
+
getConfirmControlProps: PropGetterFn;
|
|
135
|
+
getCancelControlProps: PropGetterFn;
|
|
136
|
+
getValueProps: PropGetterFn;
|
|
137
|
+
};
|
|
138
|
+
export type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {
|
|
139
|
+
Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;
|
|
140
|
+
Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;
|
|
141
|
+
ConfirmControl: Intergalactic.Component<ButtonLinkComponent, InlineInputConfirmControlProps, InlineInputProps>;
|
|
142
|
+
CancelControl: Intergalactic.Component<ButtonLinkComponent, InlineInputCancelControlProps, InlineInputProps>;
|
|
143
|
+
NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;
|
|
144
|
+
NumberControls: Intergalactic.Component<'div', InputNumberControlsProps, InlineInputProps>;
|
|
145
|
+
};
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const localizedMessages: {
|
|
2
|
+
de: {
|
|
3
|
+
confirm: string;
|
|
4
|
+
discard: string;
|
|
5
|
+
};
|
|
6
|
+
en: {
|
|
7
|
+
confirm: string;
|
|
8
|
+
discard: string;
|
|
9
|
+
};
|
|
10
|
+
es: {
|
|
11
|
+
confirm: string;
|
|
12
|
+
discard: string;
|
|
13
|
+
};
|
|
14
|
+
fr: {
|
|
15
|
+
confirm: string;
|
|
16
|
+
discard: string;
|
|
17
|
+
};
|
|
18
|
+
it: {
|
|
19
|
+
confirm: string;
|
|
20
|
+
discard: string;
|
|
21
|
+
};
|
|
22
|
+
ja: {
|
|
23
|
+
confirm: string;
|
|
24
|
+
discard: string;
|
|
25
|
+
};
|
|
26
|
+
ko: {
|
|
27
|
+
confirm: string;
|
|
28
|
+
discard: string;
|
|
29
|
+
};
|
|
30
|
+
nl: {
|
|
31
|
+
confirm: string;
|
|
32
|
+
discard: string;
|
|
33
|
+
};
|
|
34
|
+
pt: {
|
|
35
|
+
confirm: string;
|
|
36
|
+
discard: string;
|
|
37
|
+
};
|
|
38
|
+
tr: {
|
|
39
|
+
confirm: string;
|
|
40
|
+
discard: string;
|
|
41
|
+
};
|
|
42
|
+
vi: {
|
|
43
|
+
confirm: string;
|
|
44
|
+
discard: string;
|
|
45
|
+
};
|
|
46
|
+
zh: {
|
|
47
|
+
confirm: string;
|
|
48
|
+
discard: string;
|
|
49
|
+
};
|
|
50
|
+
pl: {
|
|
51
|
+
confirm: string;
|
|
52
|
+
discard: string;
|
|
53
|
+
};
|
|
54
|
+
sv: {
|
|
55
|
+
confirm: string;
|
|
56
|
+
discard: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/inline-input",
|
|
3
3
|
"description": "Semrush Input Component",
|
|
4
|
-
"version": "16.1.5
|
|
4
|
+
"version": "16.1.5",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "16.0.5
|
|
18
|
-
"@semcore/icon": "16.4.0
|
|
19
|
-
"@semcore/spin": "16.0.5
|
|
20
|
-
"@semcore/tooltip": "16.0.5
|
|
21
|
-
"@semcore/input-number": "16.0.5
|
|
22
|
-
"@semcore/input": "16.0.5
|
|
23
|
-
"@semcore/button": "16.0.5
|
|
17
|
+
"@semcore/flex-box": "16.0.5",
|
|
18
|
+
"@semcore/icon": "16.4.0",
|
|
19
|
+
"@semcore/spin": "16.0.5",
|
|
20
|
+
"@semcore/tooltip": "16.0.5",
|
|
21
|
+
"@semcore/input-number": "16.0.5",
|
|
22
|
+
"@semcore/input": "16.0.5",
|
|
23
|
+
"@semcore/button": "16.0.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@semcore/
|
|
26
|
+
"@semcore/core": "16.0.4",
|
|
27
27
|
"@semcore/testing-utils": "1.0.0",
|
|
28
|
-
"@semcore/
|
|
29
|
-
"@semcore/
|
|
28
|
+
"@semcore/spin": "16.0.5",
|
|
29
|
+
"@semcore/tooltip": "16.0.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@semcore/base-components": "^16.
|
|
32
|
+
"@semcore/base-components": "^16.0.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"directory": "semcore/inline-input"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "pnpm semcore-builder --source=
|
|
40
|
+
"build": "pnpm semcore-builder --source=ts && pnpm vite build"
|
|
41
41
|
}
|
|
42
42
|
}
|