@semcore/bulk-textarea 17.2.1 → 17.2.2-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 +12 -0
- package/lib/cjs/BulkTextarea.js +18 -12
- package/lib/cjs/BulkTextarea.js.map +1 -1
- package/lib/cjs/BulkTextarea.types.js.map +1 -1
- package/lib/cjs/components/ClearAll.js.map +1 -1
- package/lib/cjs/components/Counter.js.map +1 -1
- package/lib/cjs/components/ErrorsNavigation.js +5 -2
- package/lib/cjs/components/ErrorsNavigation.js.map +1 -1
- package/lib/cjs/components/InputField/History.js +46 -0
- package/lib/cjs/components/InputField/History.js.map +1 -0
- package/lib/cjs/components/InputField/InputField.js +494 -361
- package/lib/cjs/components/InputField/InputField.js.map +1 -1
- package/lib/cjs/components/InputField/inputField.shadow.css +42 -51
- package/lib/cjs/index.js.map +1 -1
- package/lib/es6/BulkTextarea.js +18 -12
- package/lib/es6/BulkTextarea.js.map +1 -1
- package/lib/es6/BulkTextarea.types.js.map +1 -1
- package/lib/es6/components/ClearAll.js.map +1 -1
- package/lib/es6/components/Counter.js.map +1 -1
- package/lib/es6/components/ErrorsNavigation.js +5 -2
- package/lib/es6/components/ErrorsNavigation.js.map +1 -1
- package/lib/es6/components/InputField/History.js +38 -0
- package/lib/es6/components/InputField/History.js.map +1 -0
- package/lib/es6/components/InputField/InputField.js +494 -361
- package/lib/es6/components/InputField/InputField.js.map +1 -1
- package/lib/es6/components/InputField/inputField.shadow.css +42 -51
- package/lib/es6/index.js.map +1 -1
- package/lib/esm/BulkTextarea.mjs +12 -5
- package/lib/esm/components/ErrorsNavigation.mjs +5 -2
- package/lib/esm/components/InputField/History.mjs +40 -0
- package/lib/esm/components/InputField/InputField.mjs +481 -358
- package/lib/esm/components/InputField/inputField.shadow.css +42 -51
- package/lib/types/BulkTextarea.d.ts +108 -2
- package/lib/types/BulkTextarea.types.d.ts +245 -147
- package/lib/types/components/ClearAll.d.ts +4 -6
- package/lib/types/components/Counter.d.ts +4 -9
- package/lib/types/components/ErrorsNavigation.d.ts +4 -14
- package/lib/types/components/InputField/History.d.ts +20 -0
- package/lib/types/components/InputField/InputField.d.ts +30 -24
- package/lib/types/index.d.ts +1 -2
- package/package.json +3 -3
- package/lib/cjs/components/InputField/InputField.types.js +0 -2
- package/lib/cjs/components/InputField/InputField.types.js.map +0 -1
- package/lib/es6/components/InputField/InputField.types.js +0 -2
- package/lib/es6/components/InputField/InputField.types.js.map +0 -1
- package/lib/types/components/InputField/InputField.types.d.ts +0 -44
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
SInputField>
|
|
1
|
+
SInputField>ol {
|
|
2
2
|
box-sizing: content-box;
|
|
3
3
|
outline-color: transparent;
|
|
4
4
|
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
@@ -13,33 +13,22 @@ SInputField>div {
|
|
|
13
13
|
word-wrap: break-word;
|
|
14
14
|
word-break: break-word;
|
|
15
15
|
font-family: inherit;
|
|
16
|
+
margin: 0;
|
|
17
|
+
|
|
18
|
+
list-style-type: none;
|
|
19
|
+
counter-reset: list-counter;
|
|
16
20
|
|
|
17
21
|
&:empty::before {
|
|
18
|
-
content: '1. ' attr(placeholder);
|
|
22
|
+
content: '1. ' attr(data-placeholder);
|
|
19
23
|
color: var(--intergalactic-text-placeholder, oklch(0.098 0.023 157.4 / 0.457));
|
|
20
24
|
position: absolute;
|
|
25
|
+
white-space: pre-wrap;
|
|
26
|
+
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
27
|
+
text-indent: calc(-1 * var(--intergalactic-spacing-4x, 16px));
|
|
21
28
|
}
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
counter-increment: row;
|
|
26
|
-
margin-bottom: var(--intergalactic-spacing-1x, 4px);
|
|
27
|
-
position: relative;
|
|
28
|
-
word-break: break-all;
|
|
29
|
-
|
|
30
|
-
&::before {
|
|
31
|
-
content: counter(row) '.';
|
|
32
|
-
display: inline-block;
|
|
33
|
-
white-space: nowrap;
|
|
34
|
-
text-align: right;
|
|
35
|
-
color: var(--intergalactic-text-secondary, oklch(0.088 0.026 147.7 / 0.583));
|
|
36
|
-
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
>p {
|
|
41
|
-
counter-increment: row;
|
|
42
|
-
/*display: inline-block;*/
|
|
30
|
+
>li {
|
|
31
|
+
counter-increment: list-counter;
|
|
43
32
|
margin: 0 0 var(--intergalactic-spacing-1x, 4px) 0;
|
|
44
33
|
position: relative;
|
|
45
34
|
word-break: break-all;
|
|
@@ -50,16 +39,18 @@ SInputField>div {
|
|
|
50
39
|
margin-bottom: 0;
|
|
51
40
|
}
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
content: counter(
|
|
55
|
-
|
|
42
|
+
&::before {
|
|
43
|
+
content: counter(list-counter) ".";
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: 0;
|
|
56
46
|
white-space: nowrap;
|
|
47
|
+
display: inline-block;
|
|
48
|
+
|
|
57
49
|
text-align: right;
|
|
58
50
|
color: var(--intergalactic-text-secondary, oklch(0.088 0.026 147.7 / 0.583));
|
|
59
51
|
margin-right: var(--intergalactic-spacing-1x, 4px);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
left: 0;
|
|
52
|
+
font-variant-numeric: normal;
|
|
53
|
+
font-weight: 300;
|
|
63
54
|
}
|
|
64
55
|
|
|
65
56
|
&[data-over-max-rows='true'] {
|
|
@@ -67,61 +58,61 @@ SInputField>div {
|
|
|
67
58
|
}
|
|
68
59
|
}
|
|
69
60
|
|
|
70
|
-
&:has(
|
|
71
|
-
>
|
|
61
|
+
&:has(li:nth-child(n + 10)) {
|
|
62
|
+
>li {
|
|
72
63
|
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
73
64
|
}
|
|
74
65
|
|
|
75
|
-
>
|
|
66
|
+
>li:nth-child(-n + 9)::before {
|
|
76
67
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
77
68
|
}
|
|
78
69
|
}
|
|
79
70
|
|
|
80
|
-
&:has(
|
|
81
|
-
>
|
|
71
|
+
&:has(li:nth-child(n + 100)) {
|
|
72
|
+
>li {
|
|
82
73
|
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
83
74
|
}
|
|
84
75
|
|
|
85
|
-
>
|
|
76
|
+
>li:nth-child(-n + 9)::before {
|
|
86
77
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
87
78
|
}
|
|
88
79
|
|
|
89
|
-
>
|
|
80
|
+
>li:nth-child(n + 10)::before {
|
|
90
81
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
91
82
|
}
|
|
92
83
|
|
|
93
|
-
>
|
|
84
|
+
>li:nth-child(n + 100)::before {
|
|
94
85
|
padding-left: 0;
|
|
95
86
|
}
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
&:has(
|
|
99
|
-
>
|
|
89
|
+
&:has(li:nth-child(n + 1000)) {
|
|
90
|
+
> li {
|
|
100
91
|
padding-left: calc(var(--intergalactic-spacing-10x, 40px) + var(--intergalactic-spacing-1x, 4px));
|
|
101
92
|
}
|
|
102
|
-
>
|
|
93
|
+
> li:nth-child(-n + 9)::before {
|
|
103
94
|
padding-left: var(--intergalactic-spacing-6x, 24px);
|
|
104
95
|
}
|
|
105
|
-
>
|
|
96
|
+
> li:nth-child(n + 10)::before {
|
|
106
97
|
padding-left: var(--intergalactic-spacing-4x, 16px);
|
|
107
98
|
}
|
|
108
|
-
>
|
|
99
|
+
> li:nth-child(n + 100)::before {
|
|
109
100
|
padding-left: var(--intergalactic-spacing-2x, 8px);
|
|
110
101
|
}
|
|
111
|
-
>
|
|
102
|
+
> li:nth-child(n + 1000)::before {
|
|
112
103
|
padding-left: 0;
|
|
113
104
|
}
|
|
114
105
|
}
|
|
115
106
|
}
|
|
116
107
|
|
|
117
|
-
SInputField[showErrors]>
|
|
108
|
+
SInputField[showErrors]>ol[aria-invalid]>li[aria-invalid]:after {
|
|
118
109
|
content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo=");
|
|
119
110
|
position: absolute;
|
|
120
111
|
right: 0;
|
|
121
112
|
top: var(--intergalactic-spacing-05x, 2px);
|
|
122
113
|
}
|
|
123
114
|
|
|
124
|
-
SInputField[size='m']>
|
|
115
|
+
SInputField[size='m']>ol {
|
|
125
116
|
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);
|
|
126
117
|
font-size: var(--intergalactic-fs-200, 14px);
|
|
127
118
|
line-height: var(--intergalactic-lh-200, 142%);
|
|
@@ -134,12 +125,12 @@ SInputField[size='m']>div {
|
|
|
134
125
|
padding-left: var(--intergalactic-spacing-8x, 32px);
|
|
135
126
|
|
|
136
127
|
&::before {
|
|
137
|
-
left: var(--intergalactic-spacing-4x, 16px);
|
|
128
|
+
left: calc(var(--intergalactic-spacing-4x, 16px) + 1px);
|
|
138
129
|
}
|
|
139
130
|
}
|
|
140
131
|
}
|
|
141
132
|
|
|
142
|
-
SInputField[size='l']>
|
|
133
|
+
SInputField[size='l']>ol {
|
|
143
134
|
padding: var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);
|
|
144
135
|
font-size: var(--intergalactic-fs-300, 16px);
|
|
145
136
|
line-height: var(--intergalactic-lh-300, 150%);
|
|
@@ -157,7 +148,7 @@ SInputField[size='l']>div {
|
|
|
157
148
|
}
|
|
158
149
|
|
|
159
150
|
|
|
160
|
-
SInputField[state='normal']:not([disabled])>
|
|
151
|
+
SInputField[state='normal']:not([disabled])>ol {
|
|
161
152
|
&:focus {
|
|
162
153
|
border-color: var(--intergalactic-border-info-active, oklch(0.7 0.131 275.2));
|
|
163
154
|
@mixin focus-outline-mixin {
|
|
@@ -167,7 +158,7 @@ SInputField[state='normal']:not([disabled])>div {
|
|
|
167
158
|
}
|
|
168
159
|
}
|
|
169
160
|
|
|
170
|
-
SInputField[state='valid']>
|
|
161
|
+
SInputField[state='valid']>ol {
|
|
171
162
|
border-color: var(--intergalactic-border-success-active, oklch(0.7 0.166 170));
|
|
172
163
|
|
|
173
164
|
&:focus {
|
|
@@ -180,7 +171,7 @@ SInputField[state='valid']>div {
|
|
|
180
171
|
}
|
|
181
172
|
}
|
|
182
173
|
|
|
183
|
-
SInputField[state='invalid']>
|
|
174
|
+
SInputField[state='invalid']>ol {
|
|
184
175
|
border-color: var(--intergalactic-border-critical-active, oklch(0.7 0.21 23));
|
|
185
176
|
|
|
186
177
|
&:focus {
|
|
@@ -200,10 +191,10 @@ SInputField[state='invalid']>div {
|
|
|
200
191
|
background-repeat: repeat-y;
|
|
201
192
|
}
|
|
202
193
|
|
|
203
|
-
SInputField[readonly]>
|
|
194
|
+
SInputField[readonly]>ol {
|
|
204
195
|
background-color: var(--intergalactic-bg-secondary-neutral, oklch(0.98 0.001 180));
|
|
205
196
|
}
|
|
206
197
|
|
|
207
|
-
SInputField[disabled]>
|
|
198
|
+
SInputField[disabled]>ol {
|
|
208
199
|
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
209
200
|
}
|
|
@@ -1,8 +1,114 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Intergalactic } from '@semcore/core';
|
|
2
|
+
import { Component } from '@semcore/core';
|
|
3
|
+
import type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { NSBulktextarea } from './BulkTextarea.types';
|
|
6
|
+
declare class BulkTextareaRoot<T extends string | string[]> extends Component<Intergalactic.InternalTypings.InferComponentProps<NSBulktextarea.Component<T>>, typeof BulkTextareaRoot.enhance, NSBulktextarea.Handlers, WithI18nEnhanceProps, NSBulktextarea.State, NSBulktextarea.DefaultProps<T>> {
|
|
7
|
+
static displayName: string;
|
|
8
|
+
static defaultProps: NSBulktextarea.DefaultProps<string | string[]>;
|
|
9
|
+
static enhance: readonly [(props: any) => {
|
|
10
|
+
getI18nText: ReturnType<(dictionary: import("@semcore/core/lib/utils/enhances/WithI18n").Dictionary, locale?: import("@semcore/core/lib/utils/enhances/WithI18n").LocaleKeys, fallbackDictionary?: import("@semcore/core/lib/utils/enhances/WithI18n").Dictionary) => (messageId: string, variables?: {
|
|
11
|
+
[key: string]: string | number | undefined;
|
|
12
|
+
}) => string>;
|
|
13
|
+
}, (props: any) => {
|
|
14
|
+
uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
|
|
15
|
+
}];
|
|
16
|
+
inputFieldRef: React.RefObject<HTMLOListElement>;
|
|
17
|
+
clearAllButtonRef: React.RefObject<HTMLButtonElement>;
|
|
18
|
+
nextButtonRef: React.RefObject<HTMLButtonElement>;
|
|
19
|
+
prevButtonRef: React.RefObject<HTMLButtonElement>;
|
|
20
|
+
counterRef: React.RefObject<HTMLOListElement>;
|
|
21
|
+
state: NSBulktextarea.State;
|
|
22
|
+
uncontrolledProps(): {
|
|
23
|
+
value: null;
|
|
24
|
+
state: null;
|
|
25
|
+
showErrors: null;
|
|
26
|
+
errors: null;
|
|
27
|
+
};
|
|
28
|
+
get counterId(): string;
|
|
29
|
+
getInputFieldProps(): {
|
|
30
|
+
value: (string | string[] | undefined) & (string | number | readonly string[]);
|
|
31
|
+
size: "m" | "l";
|
|
32
|
+
state: string;
|
|
33
|
+
disabled: boolean | undefined;
|
|
34
|
+
readonly: boolean | undefined;
|
|
35
|
+
minRows: number;
|
|
36
|
+
maxRows: number;
|
|
37
|
+
maxLines: number;
|
|
38
|
+
placeholder: string | string[] | undefined;
|
|
39
|
+
prevError: NSBulktextarea.ErrorItem | undefined;
|
|
40
|
+
pasteProps: {
|
|
41
|
+
delimiter?: string | RegExp;
|
|
42
|
+
lineProcessing?: (line: string, lineIndex: number, totalLinesCount: number) => string;
|
|
43
|
+
skipEmptyLines?: boolean;
|
|
44
|
+
} | undefined;
|
|
45
|
+
linesCount: number;
|
|
46
|
+
lineProcessing: ((line: string, lines: string[]) => string) | undefined;
|
|
47
|
+
onChangeLinesCount: (linesCount: number) => void;
|
|
48
|
+
onChangeLineIndex: () => void;
|
|
49
|
+
onBlur: (value: T, event: Event) => void;
|
|
50
|
+
onPaste: () => void;
|
|
51
|
+
showErrors: boolean;
|
|
52
|
+
validateOn: ("blur" | "blurLine" | "paste")[];
|
|
53
|
+
lineValidation: ((line: string, lines: string[]) => {
|
|
54
|
+
isValid: boolean;
|
|
55
|
+
errorMessage: string;
|
|
56
|
+
}) | undefined;
|
|
57
|
+
errors: NSBulktextarea.ErrorItem[];
|
|
58
|
+
onErrorsChange: (newErrors: NSBulktextarea.ErrorItem[]) => void;
|
|
59
|
+
highlightErrorIndex: boolean;
|
|
60
|
+
errorIndex: number;
|
|
61
|
+
onErrorIndexChange: (newErrorIndex: number) => void;
|
|
62
|
+
linesDelimiters: string[] | undefined;
|
|
63
|
+
ref: React.RefObject<HTMLOListElement>;
|
|
64
|
+
"aria-describedby": string;
|
|
65
|
+
onImmediatelyChange: ((lines: string[], value: string) => void) | undefined;
|
|
66
|
+
};
|
|
67
|
+
getCounterProps(): {
|
|
68
|
+
id: string;
|
|
69
|
+
ref: React.RefObject<HTMLOListElement>;
|
|
70
|
+
getI18nText: ((messageId: string, variables?: {
|
|
71
|
+
[key: string]: string | number | undefined;
|
|
72
|
+
}) => string) & ((key?: string, variables?: {}) => any);
|
|
73
|
+
theme: string;
|
|
74
|
+
linesCount: number;
|
|
75
|
+
maxLines: number;
|
|
76
|
+
size: "m" | "l";
|
|
77
|
+
};
|
|
78
|
+
getClearAllProps(): {
|
|
79
|
+
onClick: (e: Event) => void;
|
|
80
|
+
isHidden: boolean;
|
|
81
|
+
size: "m" | "l";
|
|
82
|
+
getI18nText: ((messageId: string, variables?: {
|
|
83
|
+
[key: string]: string | number | undefined;
|
|
84
|
+
}) => string) & ((key?: string, variables?: {}) => any);
|
|
85
|
+
ref: React.RefObject<HTMLButtonElement>;
|
|
86
|
+
disabled: boolean | undefined;
|
|
87
|
+
};
|
|
88
|
+
getErrorsNavigationProps(): {
|
|
89
|
+
size: "m" | "l";
|
|
90
|
+
getI18nText: ((messageId: string, variables?: {
|
|
91
|
+
[key: string]: string | number | undefined;
|
|
92
|
+
}) => string) & ((key?: string, variables?: {}) => any);
|
|
93
|
+
errorIndex: number;
|
|
94
|
+
onPrevError: () => void;
|
|
95
|
+
onNextError: () => void;
|
|
96
|
+
errorsCount: number;
|
|
97
|
+
showErrors: boolean;
|
|
98
|
+
disabled: boolean;
|
|
99
|
+
nextButtonRef: React.RefObject<HTMLButtonElement>;
|
|
100
|
+
prevButtonRef: React.RefObject<HTMLButtonElement>;
|
|
101
|
+
};
|
|
102
|
+
handleChangeLinesCount: (linesCount: number) => void;
|
|
103
|
+
handleClickClearAll: (e: Event) => void;
|
|
104
|
+
handleChangeErrorIndex: (amount: number) => () => void;
|
|
105
|
+
render(): React.JSX.Element;
|
|
106
|
+
}
|
|
107
|
+
export type BulkTextareaRootType = typeof BulkTextareaRoot;
|
|
2
108
|
/**
|
|
3
109
|
* BulkTextarea
|
|
4
110
|
*
|
|
5
111
|
* {@link https://developer.semrush.com/intergalactic/components/bulk-textarea/bulk-textarea-api/|API} | {@link https://developer.semrush.com/intergalactic/components/bulk-textarea/bulk-textarea-code/|Examples}
|
|
6
112
|
*/
|
|
7
|
-
declare const BulkTextarea:
|
|
113
|
+
declare const BulkTextarea: NSBulktextarea.Component<string | string[]>;
|
|
8
114
|
export default BulkTextarea;
|