@semcore/inline-input 4.49.0-prerelease.5 → 4.49.0-prerelease.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/InlineInput.js +139 -128
- package/lib/cjs/InlineInput.js.map +1 -1
- package/lib/cjs/index.d.js +2 -0
- package/lib/cjs/index.d.js.map +1 -0
- package/lib/cjs/index.js +3 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/inline-input.shadow.css +55 -52
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/InlineInput.js +130 -122
- package/lib/es6/InlineInput.js.map +1 -1
- package/lib/es6/index.d.js +2 -0
- package/lib/es6/index.d.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/inline-input.shadow.css +55 -52
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/InlineInput.mjs +133 -123
- package/lib/esm/style/inline-input.shadow.css +55 -52
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/index.d.ts +162 -4
- package/package.json +11 -11
- package/lib/cjs/index.type.js +0 -2
- package/lib/cjs/index.type.js.map +0 -1
- package/lib/es6/index.type.js +0 -2
- package/lib/es6/index.type.js.map +0 -1
- package/lib/types/InlineInput.d.ts +0 -4
- package/lib/types/index.type.d.ts +0 -107
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +0 -58
|
@@ -12,63 +12,23 @@ SInlineInput {
|
|
|
12
12
|
|
|
13
13
|
background-color: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
14
14
|
|
|
15
|
-
SConfirmIcon
|
|
15
|
+
SConfirmIcon {
|
|
16
16
|
color: var(--intergalactic-icon-secondary-success, oklch(0.711 0.146 166.9));
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
SConfirmIcon:
|
|
20
|
+
SConfirmIcon:hover {
|
|
21
21
|
color: var(--intergalactic-icon-secondary-success-hover-active, oklch(0.673 0.139 166.3));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
SCancelIcon
|
|
24
|
+
SCancelIcon {
|
|
25
25
|
color: var(--intergalactic-icon-secondary-neutral, oklch(0.104 0.023 162.3 / 0.385));
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
SCancelIcon:
|
|
29
|
+
SCancelIcon:hover {
|
|
30
30
|
color: var(--intergalactic-icon-secondary-neutral-hover-active, oklch(0.1 0.023 159.1 / 0.433));
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
SValue {
|
|
34
|
-
/* hack for firefox */
|
|
35
|
-
min-width: 0;
|
|
36
|
-
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: 100%;
|
|
39
|
-
padding: 0 var(--intergalactic-spacing-1x, 4px);
|
|
40
|
-
border: none;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
43
|
-
font-size: inherit;
|
|
44
|
-
line-height: 1.2;
|
|
45
|
-
text-overflow: ellipsis;
|
|
46
|
-
font-family: inherit;
|
|
47
|
-
background: transparent;
|
|
48
|
-
min-height: 1em;
|
|
49
|
-
|
|
50
|
-
&:focus, &:focus-visible {
|
|
51
|
-
outline: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&::placeholder {
|
|
55
|
-
color: var(--intergalactic-text-placeholder, oklch(0.098 0.023 157.4 / 0.457));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&[disabled] {
|
|
59
|
-
user-select: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&::-webkit-outer-spin-button,
|
|
63
|
-
&::-webkit-inner-spin-button {
|
|
64
|
-
-webkit-appearance: none;
|
|
65
|
-
margin: 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&[type='number'] {
|
|
69
|
-
-moz-appearance: textfield;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
32
|
}
|
|
73
33
|
|
|
74
34
|
SInlineInput[disabled] {
|
|
@@ -77,6 +37,46 @@ SInlineInput[disabled] {
|
|
|
77
37
|
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
78
38
|
}
|
|
79
39
|
|
|
40
|
+
SValue {
|
|
41
|
+
/* hack for firefox */
|
|
42
|
+
min-width: 0;
|
|
43
|
+
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
padding: 0 var(--intergalactic-spacing-1x, 4px);
|
|
47
|
+
border: none;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
color: var(--intergalactic-text-primary, oklch(0.1 0.03 137 / 0.899));
|
|
50
|
+
font-size: inherit;
|
|
51
|
+
line-height: 1.2;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
font-family: inherit;
|
|
54
|
+
background: transparent;
|
|
55
|
+
min-height: 1em;
|
|
56
|
+
|
|
57
|
+
&:focus {
|
|
58
|
+
outline: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&::placeholder {
|
|
62
|
+
color: var(--intergalactic-text-placeholder, oklch(0.098 0.023 157.4 / 0.457));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[disabled] {
|
|
66
|
+
user-select: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::-webkit-outer-spin-button,
|
|
70
|
+
&::-webkit-inner-spin-button {
|
|
71
|
+
-webkit-appearance: none;
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[type='number'] {
|
|
76
|
+
-moz-appearance: textfield;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
80
|
SUnderline {
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
@@ -105,35 +105,38 @@ SAddon[disabled] {
|
|
|
105
105
|
pointer-events: none;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
SInlineInput[focused] {
|
|
109
|
+
z-index: 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
SInlineInput[focused] SUnderline {
|
|
109
113
|
border-bottom-color: var(--intergalactic-border-info-active, oklch(0.443 0.273 264.2 / 0.419));
|
|
110
|
-
|
|
114
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px oklch(0.424 0.269 264.2 / 0.469));
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
SInlineInput[state='valid'] SUnderline {
|
|
114
118
|
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.75 0.153 167.5));
|
|
115
119
|
}
|
|
116
120
|
|
|
117
|
-
SInlineInput[state='valid'] SUnderline
|
|
121
|
+
SInlineInput[state='valid'][focused] SUnderline {
|
|
118
122
|
border-bottom-color: var(--intergalactic-border-success-active, oklch(0.75 0.153 167.5));
|
|
119
|
-
|
|
120
|
-
outline-color: var(--intergalactic-keyboard-focus-valid-outline, oklch(0.711 0.146 166.9));
|
|
123
|
+
box-shadow: var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px oklch(0.711 0.146 166.9));
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
SInlineInput[state='invalid'] SUnderline {
|
|
124
127
|
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
SInlineInput[state='invalid'] SUnderline
|
|
130
|
+
SInlineInput[state='invalid'][focused] SUnderline {
|
|
128
131
|
border-bottom-color: var(--intergalactic-border-critical-active, oklch(0.628 0.258 29 / 0.56));
|
|
129
|
-
|
|
130
|
-
outline-color: var(--intergalactic-keyboard-focus-invalid-outline, oklch(0.628 0.257 28.9 / 0.652));
|
|
132
|
+
box-shadow: var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px oklch(0.628 0.257 28.9 / 0.652));
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
SValue:focus~SControls {
|
|
134
136
|
display: flex;
|
|
135
137
|
}
|
|
136
138
|
|
|
139
|
+
|
|
137
140
|
SInvalidPattern {
|
|
138
141
|
margin-left: -1px;
|
|
139
142
|
margin-top: -1px;
|
|
@@ -6,12 +6,12 @@ import it from "./it.json.mjs";
|
|
|
6
6
|
import ja from "./ja.json.mjs";
|
|
7
7
|
import ko from "./ko.json.mjs";
|
|
8
8
|
import nl from "./nl.json.mjs";
|
|
9
|
-
import pl from "./pl.json.mjs";
|
|
10
9
|
import pt from "./pt.json.mjs";
|
|
11
|
-
import sv from "./sv.json.mjs";
|
|
12
10
|
import tr from "./tr.json.mjs";
|
|
13
11
|
import vi from "./vi.json.mjs";
|
|
14
12
|
import zh from "./zh.json.mjs";
|
|
13
|
+
import pl from "./pl.json.mjs";
|
|
14
|
+
import sv from "./sv.json.mjs";
|
|
15
15
|
var localizedMessages = {
|
|
16
16
|
de,
|
|
17
17
|
en,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,4 +1,162 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropGetterFn, UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
+
import { BoxProps } from '@semcore/flex-box';
|
|
4
|
+
import { ButtonLinkComponent } from '@semcore/button';
|
|
5
|
+
|
|
6
|
+
/** @deprecated */
|
|
7
|
+
export interface IInlineInputProps extends InlineInputProps, UnknownProperties {}
|
|
8
|
+
export type InlineInputProps = BoxProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Visual state of inline input
|
|
11
|
+
* @default normal
|
|
12
|
+
*/
|
|
13
|
+
state?: 'normal' | 'valid' | 'invalid';
|
|
14
|
+
/**
|
|
15
|
+
* Disabled input and shows spinner instead of confirm control
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Disabled input and controls
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
|
|
26
|
+
*/
|
|
27
|
+
onConfirm?: (
|
|
28
|
+
value: string,
|
|
29
|
+
event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
|
|
30
|
+
) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
|
|
33
|
+
*/
|
|
34
|
+
onCancel?: (
|
|
35
|
+
prevValue: string,
|
|
36
|
+
event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent,
|
|
37
|
+
) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Text value of input. Should be used with `onChange` property together
|
|
40
|
+
*/
|
|
41
|
+
value?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Initial text value of input
|
|
44
|
+
*/
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Makes component to catch browser focus on component mount
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
autoFocus?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Gray text displayed in empty input
|
|
53
|
+
*/
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/**
|
|
56
|
+
* defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
|
|
57
|
+
* Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
|
|
58
|
+
*/
|
|
59
|
+
onBlurBehavior?: 'cancel' | 'confirm' | 'none';
|
|
60
|
+
locale?: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** @deprecated */
|
|
64
|
+
export interface IInlineInputAddonProps extends InlineInputAddonProps, UnknownProperties {}
|
|
65
|
+
export type InlineInputAddonProps = BoxProps & {};
|
|
66
|
+
/** @deprecated */
|
|
67
|
+
export interface IInlineInputValueProps extends InlineInputValueProps, UnknownProperties {}
|
|
68
|
+
export type InlineInputValueProps = BoxProps & {
|
|
69
|
+
/**
|
|
70
|
+
* id attribute of input tag
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
73
|
+
/**
|
|
74
|
+
* when `true`, element is focused immediately after mount
|
|
75
|
+
*/
|
|
76
|
+
autoFocus?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* value of input tag
|
|
79
|
+
*/
|
|
80
|
+
value?: string;
|
|
81
|
+
/**
|
|
82
|
+
* uncontrolled value of input tag
|
|
83
|
+
*/
|
|
84
|
+
defaultValue?: string;
|
|
85
|
+
/**
|
|
86
|
+
* callback invoked on every change of input tag value
|
|
87
|
+
*/
|
|
88
|
+
onChange?: (value: string, event: React.ChangeEvent) => void;
|
|
89
|
+
/**
|
|
90
|
+
* visual state of component
|
|
91
|
+
*/
|
|
92
|
+
state?: 'normal' | 'valid' | 'invalid';
|
|
93
|
+
/**
|
|
94
|
+
* shows spinner in `InlineInput.ConfirmControl` and disables other interactive elements
|
|
95
|
+
*/
|
|
96
|
+
loading?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* disables interactive elements
|
|
99
|
+
*/
|
|
100
|
+
disabled?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* gray text in empty input tag
|
|
103
|
+
*/
|
|
104
|
+
placeholder?: string;
|
|
105
|
+
};
|
|
106
|
+
/** @deprecated */
|
|
107
|
+
export interface IInlineInputConfirmControlProps
|
|
108
|
+
extends InlineInputConfirmControlProps,
|
|
109
|
+
UnknownProperties {}
|
|
110
|
+
export type InlineInputConfirmControlProps = BoxProps & {
|
|
111
|
+
/**
|
|
112
|
+
* Text of tooltip
|
|
113
|
+
* @default Confirm
|
|
114
|
+
*/
|
|
115
|
+
title?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Icon component
|
|
118
|
+
* @default CheckM
|
|
119
|
+
*/
|
|
120
|
+
icon?: React.FC;
|
|
121
|
+
};
|
|
122
|
+
/** @deprecated */
|
|
123
|
+
export interface IInlineInputCancelControlProps
|
|
124
|
+
extends InlineInputCancelControlProps,
|
|
125
|
+
UnknownProperties {}
|
|
126
|
+
export type InlineInputCancelControlProps = BoxProps & {
|
|
127
|
+
/**
|
|
128
|
+
* Text of tooltip
|
|
129
|
+
* @default Cancel
|
|
130
|
+
*/
|
|
131
|
+
title?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Icon component
|
|
134
|
+
* @default CloseM
|
|
135
|
+
*/
|
|
136
|
+
icon?: React.FC;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
type InlineInputCtx = {
|
|
140
|
+
getAddonProps: PropGetterFn;
|
|
141
|
+
getConfirmControlProps: PropGetterFn;
|
|
142
|
+
getCancelControlProps: PropGetterFn;
|
|
143
|
+
getValueProps: PropGetterFn;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
declare const InlineInput: Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {
|
|
147
|
+
Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;
|
|
148
|
+
Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;
|
|
149
|
+
ConfirmControl: Intergalactic.Component<
|
|
150
|
+
ButtonLinkComponent,
|
|
151
|
+
InlineInputConfirmControlProps,
|
|
152
|
+
InlineInputProps
|
|
153
|
+
>;
|
|
154
|
+
CancelControl: Intergalactic.Component<
|
|
155
|
+
ButtonLinkComponent,
|
|
156
|
+
InlineInputCancelControlProps,
|
|
157
|
+
InlineInputProps
|
|
158
|
+
>;
|
|
159
|
+
NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;
|
|
160
|
+
NumberControls: Intergalactic.Component<'div', {}, InlineInputProps>;
|
|
161
|
+
};
|
|
162
|
+
export default InlineInput;
|
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.49.0-prerelease.
|
|
4
|
+
"version": "4.49.0-prerelease.7",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "5.42.0-prerelease.
|
|
18
|
-
"@semcore/icon": "4.63.0-prerelease.
|
|
19
|
-
"@semcore/spin": "5.42.0-prerelease.
|
|
20
|
-
"@semcore/tooltip": "6.50.0-prerelease.
|
|
21
|
-
"@semcore/utils": "4.49.0-prerelease.
|
|
22
|
-
"@semcore/input-number": "5.42.0-prerelease.
|
|
23
|
-
"@semcore/input": "4.43.0-prerelease.
|
|
24
|
-
"@semcore/core": "2.40.0-prerelease.
|
|
25
|
-
"@semcore/button": "5.44.0-prerelease.
|
|
17
|
+
"@semcore/flex-box": "5.42.0-prerelease.7",
|
|
18
|
+
"@semcore/icon": "4.63.0-prerelease.7",
|
|
19
|
+
"@semcore/spin": "5.42.0-prerelease.7",
|
|
20
|
+
"@semcore/tooltip": "6.50.0-prerelease.7",
|
|
21
|
+
"@semcore/utils": "4.49.0-prerelease.7",
|
|
22
|
+
"@semcore/input-number": "5.42.0-prerelease.7",
|
|
23
|
+
"@semcore/input": "4.43.0-prerelease.7",
|
|
24
|
+
"@semcore/core": "2.40.0-prerelease.7",
|
|
25
|
+
"@semcore/button": "5.44.0-prerelease.7"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "18.0.21",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@semcore/tooltip": "*"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@semcore/core": "^2.40.0-prerelease.
|
|
34
|
+
"@semcore/core": "^2.40.0-prerelease.7",
|
|
35
35
|
"react": "16.8 - 18",
|
|
36
36
|
"react-dom": "16.8 - 18"
|
|
37
37
|
},
|
package/lib/cjs/index.type.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","names":[],"sources":["../../src/index.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { ButtonLinkComponent } from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { InputNumberControlsProps } from '@semcore/input-number';\nimport type React from 'react';\n\nexport type InlineInputProps = BoxProps & {\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 * 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' | 'none';\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type InlineInputAddonProps = BoxProps & {};\n\nexport type InlineInputValueProps = BoxProps & {\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 * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n};\n\nexport type InlineInputConfirmControlProps = BoxProps & {\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};\n\nexport type InlineInputCancelControlProps = BoxProps & {\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\ntype InlineInputCtx = {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n};\n\nexport type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {\n Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;\n Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;\n ConfirmControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputConfirmControlProps,\n InlineInputProps\n >;\n CancelControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputCancelControlProps,\n InlineInputProps\n >;\n NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;\n NumberControls: Intergalactic.Component<'div', InputNumberControlsProps, InlineInputProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/index.type.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.type.js","names":[],"sources":["../../src/index.type.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type { ButtonLinkComponent } from '@semcore/button';\nimport type { PropGetterFn, Intergalactic } from '@semcore/core';\nimport type { InputNumberControlsProps } from '@semcore/input-number';\nimport type React from 'react';\n\nexport type InlineInputProps = BoxProps & {\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 * 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' | 'none';\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\nexport type InlineInputAddonProps = BoxProps & {};\n\nexport type InlineInputValueProps = BoxProps & {\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 * disables interactive elements\n */\n disabled?: boolean;\n /**\n * gray text in empty input tag\n */\n placeholder?: string;\n};\n\nexport type InlineInputConfirmControlProps = BoxProps & {\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};\n\nexport type InlineInputCancelControlProps = BoxProps & {\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\ntype InlineInputCtx = {\n getAddonProps: PropGetterFn;\n getConfirmControlProps: PropGetterFn;\n getCancelControlProps: PropGetterFn;\n getValueProps: PropGetterFn;\n};\n\nexport type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {\n Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;\n Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;\n ConfirmControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputConfirmControlProps,\n InlineInputProps\n >;\n CancelControl: Intergalactic.Component<\n ButtonLinkComponent,\n InlineInputCancelControlProps,\n InlineInputProps\n >;\n NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;\n NumberControls: Intergalactic.Component<'div', InputNumberControlsProps, InlineInputProps>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { BoxProps } from '@semcore/base-components';
|
|
2
|
-
import type { ButtonLinkComponent } from '@semcore/button';
|
|
3
|
-
import type { PropGetterFn, Intergalactic } from '@semcore/core';
|
|
4
|
-
import type { InputNumberControlsProps } from '@semcore/input-number';
|
|
5
|
-
import type React from 'react';
|
|
6
|
-
export type InlineInputProps = BoxProps & {
|
|
7
|
-
/**
|
|
8
|
-
* Visual state of inline input
|
|
9
|
-
* @default normal
|
|
10
|
-
*/
|
|
11
|
-
state?: 'normal' | 'valid' | 'invalid';
|
|
12
|
-
/**
|
|
13
|
-
* Disabled input and shows spinner instead of confirm control
|
|
14
|
-
* @default false
|
|
15
|
-
*/
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Disabled input and controls
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Fired with entered value when user clicks confirm control or hits `Enter` or `Space`
|
|
24
|
-
*/
|
|
25
|
-
onConfirm?: (value: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
|
|
26
|
-
/**
|
|
27
|
-
* Fired with value (or defaultValue) that was provided during component mount when user clicks cancel control or hits `Escape`
|
|
28
|
-
*/
|
|
29
|
-
onCancel?: (prevValue: string, event: React.MouseEvent | React.FocusEvent | React.KeyboardEvent) => void;
|
|
30
|
-
/**
|
|
31
|
-
* defines callback (`onCancel` or `onConfirm`) triggered when `blur` event out of container fired
|
|
32
|
-
* Triggered after all previous macrotasks completed (internally called inside of `setTimeout`)
|
|
33
|
-
*/
|
|
34
|
-
onBlurBehavior?: 'cancel' | 'confirm' | 'none';
|
|
35
|
-
/** Specifies the locale for i18n support */
|
|
36
|
-
locale?: string;
|
|
37
|
-
};
|
|
38
|
-
export type InlineInputAddonProps = BoxProps & {};
|
|
39
|
-
export type InlineInputValueProps = BoxProps & {
|
|
40
|
-
/**
|
|
41
|
-
* id attribute of input tag
|
|
42
|
-
*/
|
|
43
|
-
id?: string;
|
|
44
|
-
/**
|
|
45
|
-
* when `true`, element is focused immediately after mount
|
|
46
|
-
*/
|
|
47
|
-
autoFocus?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* value of input tag
|
|
50
|
-
*/
|
|
51
|
-
value?: string;
|
|
52
|
-
/**
|
|
53
|
-
* uncontrolled value of input tag
|
|
54
|
-
*/
|
|
55
|
-
defaultValue?: string;
|
|
56
|
-
/**
|
|
57
|
-
* callback invoked on every change of input tag value
|
|
58
|
-
*/
|
|
59
|
-
onChange?: (value: string, event: React.ChangeEvent) => void;
|
|
60
|
-
/**
|
|
61
|
-
* disables interactive elements
|
|
62
|
-
*/
|
|
63
|
-
disabled?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* gray text in empty input tag
|
|
66
|
-
*/
|
|
67
|
-
placeholder?: string;
|
|
68
|
-
};
|
|
69
|
-
export type InlineInputConfirmControlProps = BoxProps & {
|
|
70
|
-
/**
|
|
71
|
-
* Text of tooltip
|
|
72
|
-
* @default Confirm
|
|
73
|
-
*/
|
|
74
|
-
title?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Icon component
|
|
77
|
-
* @default CheckM
|
|
78
|
-
*/
|
|
79
|
-
icon?: React.FC;
|
|
80
|
-
};
|
|
81
|
-
export type InlineInputCancelControlProps = BoxProps & {
|
|
82
|
-
/**
|
|
83
|
-
* Text of tooltip
|
|
84
|
-
* @default Cancel
|
|
85
|
-
*/
|
|
86
|
-
title?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Icon component
|
|
89
|
-
* @default CloseM
|
|
90
|
-
*/
|
|
91
|
-
icon?: React.FC;
|
|
92
|
-
};
|
|
93
|
-
type InlineInputCtx = {
|
|
94
|
-
getAddonProps: PropGetterFn;
|
|
95
|
-
getConfirmControlProps: PropGetterFn;
|
|
96
|
-
getCancelControlProps: PropGetterFn;
|
|
97
|
-
getValueProps: PropGetterFn;
|
|
98
|
-
};
|
|
99
|
-
export type InlineInputComponent = Intergalactic.Component<'div', InlineInputProps, InlineInputCtx> & {
|
|
100
|
-
Addon: Intergalactic.Component<'div', InlineInputAddonProps, InlineInputProps>;
|
|
101
|
-
Value: Intergalactic.Component<'input', InlineInputValueProps, InlineInputProps>;
|
|
102
|
-
ConfirmControl: Intergalactic.Component<ButtonLinkComponent, InlineInputConfirmControlProps, InlineInputProps>;
|
|
103
|
-
CancelControl: Intergalactic.Component<ButtonLinkComponent, InlineInputCancelControlProps, InlineInputProps>;
|
|
104
|
-
NumberValue: Intergalactic.Component<'div', {}, InlineInputProps>;
|
|
105
|
-
NumberControls: Intergalactic.Component<'div', InputNumberControlsProps, InlineInputProps>;
|
|
106
|
-
};
|
|
107
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
};
|