@semcore/bulk-textarea 16.2.0 → 16.2.1-prerelease.1
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/README.md +1 -31
- package/lib/cjs/BulkTextarea.js +28 -28
- package/lib/cjs/BulkTextarea.js.map +1 -1
- package/lib/cjs/BulkTextarea.types.js.map +1 -1
- package/lib/cjs/components/ClearAll.js +2 -2
- package/lib/cjs/components/ClearAll.js.map +1 -1
- package/lib/cjs/components/Counter.js +3 -3
- package/lib/cjs/components/Counter.js.map +1 -1
- package/lib/cjs/components/ErrorsNavigation.js +12 -12
- package/lib/cjs/components/ErrorsNavigation.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.js +87 -91
- package/lib/cjs/components/InputField/InputField.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.types.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/BulkTextarea.js +26 -25
- package/lib/es6/BulkTextarea.js.map +1 -1
- package/lib/es6/BulkTextarea.types.js.map +1 -1
- package/lib/es6/components/ClearAll.js +2 -2
- package/lib/es6/components/ClearAll.js.map +1 -1
- package/lib/es6/components/Counter.js +2 -2
- package/lib/es6/components/Counter.js.map +1 -1
- package/lib/es6/components/ErrorsNavigation.js +9 -9
- package/lib/es6/components/ErrorsNavigation.js.map +1 -1
- package/lib/es6/components/InputField/InputField.js +87 -90
- package/lib/es6/components/InputField/InputField.js.map +1 -1
- package/lib/es6/components/InputField/InputField.types.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/BulkTextarea.mjs +28 -24
- package/lib/esm/components/ClearAll.mjs +1 -1
- package/lib/esm/components/Counter.mjs +2 -2
- package/lib/esm/components/ErrorsNavigation.mjs +3 -3
- package/lib/esm/components/InputField/InputField.mjs +86 -85
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/BulkTextarea.d.ts +1 -1
- package/lib/types/BulkTextarea.types.d.ts +6 -6
- package/lib/types/components/ClearAll.d.ts +2 -2
- package/lib/types/components/Counter.d.ts +4 -4
- package/lib/types/components/ErrorsNavigation.d.ts +2 -2
- package/lib/types/components/InputField/InputField.d.ts +6 -6
- package/lib/types/components/InputField/InputField.types.d.ts +29 -29
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [16.2.1] - 2025-06-13
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/base-components` [16.0.1 ~> 16.0.2]).
|
|
10
|
+
|
|
5
11
|
## [16.2.0] - 2025-05-30
|
|
6
12
|
|
|
7
13
|
### Changed
|
package/README.md
CHANGED
|
@@ -13,40 +13,10 @@
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
npm install
|
|
16
|
+
npm install @semcore/bulk-textarea
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## Usage
|
|
20
19
|
|
|
21
|
-
```jsx
|
|
22
|
-
import BulkTextarea from '@semcore/ui/bulk-textarea';
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
<details>
|
|
26
|
-
<summary>Alternative installation and use</summary>
|
|
27
|
-
|
|
28
|
-
**We do not recommend this usage path due to possible dependency and update issues.**
|
|
29
|
-
|
|
30
|
-
### Install
|
|
31
|
-
|
|
32
|
-
You can only install one package from the design system
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
npm install @semcore/bulk-textarea @semcore/core
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
`@semcore/core` - _is the basic package by which we create our components, and it contains all of the common logic
|
|
39
|
-
of the components that is discussed below. There should only be one version of the package in the project._
|
|
40
|
-
|
|
41
|
-
### Usage
|
|
42
|
-
|
|
43
|
-
You can use the package the same way but without `/ui/` in the import path.
|
|
44
|
-
|
|
45
|
-
```jsx
|
|
46
|
-
import BulkTextarea from '@semcore/bulk-textarea';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
</details>
|
|
50
20
|
|
|
51
21
|
## 👤 Author
|
|
52
22
|
|
package/lib/cjs/BulkTextarea.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var
|
|
10
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
+
var _isNativeReflectConstruct2 = _interopRequireDefault(require("@babel/runtime/helpers/isNativeReflectConstruct"));
|
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
11
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
13
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
var _core = require("@semcore/core");
|
|
15
|
-
var
|
|
16
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
17
|
+
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
16
18
|
var _flexBox = require("@semcore/flex-box");
|
|
17
|
-
var
|
|
18
|
-
var _Counter = require("./components/Counter");
|
|
19
|
+
var _react = _interopRequireDefault(require("react"));
|
|
19
20
|
var _ClearAll = require("./components/ClearAll");
|
|
21
|
+
var _Counter = require("./components/Counter");
|
|
20
22
|
var _ErrorsNavigation = require("./components/ErrorsNavigation");
|
|
23
|
+
var _InputField = require("./components/InputField/InputField");
|
|
21
24
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
22
|
-
|
|
23
|
-
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
25
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, (0, _isNativeReflectConstruct2["default"])() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
24
26
|
var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
25
|
-
(0, _inherits2["default"])(BulkTextareaRoot, _Component);
|
|
26
|
-
var _super = (0, _createSuper2["default"])(BulkTextareaRoot);
|
|
27
27
|
function BulkTextareaRoot() {
|
|
28
28
|
var _this;
|
|
29
29
|
(0, _classCallCheck2["default"])(this, BulkTextareaRoot);
|
|
30
30
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
31
|
args[_key] = arguments[_key];
|
|
32
32
|
}
|
|
33
|
-
_this =
|
|
34
|
-
(0, _defineProperty2["default"])(
|
|
35
|
-
(0, _defineProperty2["default"])(
|
|
36
|
-
(0, _defineProperty2["default"])(
|
|
37
|
-
(0, _defineProperty2["default"])(
|
|
38
|
-
(0, _defineProperty2["default"])(
|
|
39
|
-
(0, _defineProperty2["default"])(
|
|
33
|
+
_this = _callSuper(this, BulkTextareaRoot, [].concat(args));
|
|
34
|
+
(0, _defineProperty2["default"])(_this, "inputFieldRef", /*#__PURE__*/_react["default"].createRef());
|
|
35
|
+
(0, _defineProperty2["default"])(_this, "clearAllButtonRef", /*#__PURE__*/_react["default"].createRef());
|
|
36
|
+
(0, _defineProperty2["default"])(_this, "nextButtonRef", /*#__PURE__*/_react["default"].createRef());
|
|
37
|
+
(0, _defineProperty2["default"])(_this, "prevButtonRef", /*#__PURE__*/_react["default"].createRef());
|
|
38
|
+
(0, _defineProperty2["default"])(_this, "counterRef", /*#__PURE__*/_react["default"].createRef());
|
|
39
|
+
(0, _defineProperty2["default"])(_this, "state", {
|
|
40
40
|
linesCount: 0,
|
|
41
41
|
isEmptyText: true,
|
|
42
42
|
errorIndex: -1,
|
|
43
43
|
highlightErrorIndex: false
|
|
44
44
|
});
|
|
45
|
-
(0, _defineProperty2["default"])(
|
|
45
|
+
(0, _defineProperty2["default"])(_this, "handleChangeLinesCount", function (linesCount) {
|
|
46
46
|
var isEmpty = !linesCount;
|
|
47
47
|
_this.setState({
|
|
48
48
|
linesCount: linesCount,
|
|
@@ -54,7 +54,7 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
54
54
|
_this.handlers.state('normal');
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
(0, _defineProperty2["default"])(
|
|
57
|
+
(0, _defineProperty2["default"])(_this, "handleClickClearAll", function (e) {
|
|
58
58
|
var _this$inputFieldRef$c;
|
|
59
59
|
_this.handlers.showErrors(false);
|
|
60
60
|
_this.handlers.errors([]);
|
|
@@ -64,9 +64,11 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
64
64
|
_this.handlers.value('', e);
|
|
65
65
|
_this.handlers.state('normal');
|
|
66
66
|
var textarea = (_this$inputFieldRef$c = _this.inputFieldRef.current) === null || _this$inputFieldRef$c === void 0 ? void 0 : _this$inputFieldRef$c.querySelector('[role="textbox"]');
|
|
67
|
-
textarea instanceof HTMLDivElement
|
|
67
|
+
if (textarea instanceof HTMLDivElement) {
|
|
68
|
+
textarea.focus();
|
|
69
|
+
}
|
|
68
70
|
});
|
|
69
|
-
(0, _defineProperty2["default"])(
|
|
71
|
+
(0, _defineProperty2["default"])(_this, "handleChangeErrorIndex", function (amount) {
|
|
70
72
|
return function () {
|
|
71
73
|
var _this$asProps$errors = _this.asProps.errors,
|
|
72
74
|
errors = _this$asProps$errors === void 0 ? [] : _this$asProps$errors;
|
|
@@ -97,7 +99,8 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
97
99
|
});
|
|
98
100
|
return _this;
|
|
99
101
|
}
|
|
100
|
-
(0,
|
|
102
|
+
(0, _inherits2["default"])(BulkTextareaRoot, _Component);
|
|
103
|
+
return (0, _createClass2["default"])(BulkTextareaRoot, [{
|
|
101
104
|
key: "uncontrolledProps",
|
|
102
105
|
value: function uncontrolledProps() {
|
|
103
106
|
return {
|
|
@@ -166,10 +169,10 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
166
169
|
if (_this2.asProps.showErrors === false && (validateOn !== null && validateOn !== void 0 && validateOn.includes('blur') || validateOn !== null && validateOn !== void 0 && validateOn.includes('blurLine'))) {
|
|
167
170
|
setTimeout(function () {
|
|
168
171
|
var _this2$nextButtonRef$;
|
|
169
|
-
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0
|
|
172
|
+
(_this2$nextButtonRef$ = _this2.nextButtonRef.current) === null || _this2$nextButtonRef$ === void 0 || _this2$nextButtonRef$.focus();
|
|
170
173
|
}, 250);
|
|
171
174
|
}
|
|
172
|
-
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0
|
|
175
|
+
(_this2$props$onChange = (_this2$props = _this2.props).onChange) === null || _this2$props$onChange === void 0 || _this2$props$onChange.call(_this2$props, value, event);
|
|
173
176
|
},
|
|
174
177
|
showErrors: showErrors,
|
|
175
178
|
validateOn: validateOn,
|
|
@@ -199,7 +202,6 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
199
202
|
}
|
|
200
203
|
}, 10); // this timeout to be sure that code will be after state change
|
|
201
204
|
},
|
|
202
|
-
|
|
203
205
|
highlightErrorIndex: highlightErrorIndex,
|
|
204
206
|
errorIndex: errorIndex,
|
|
205
207
|
onErrorIndexChange: function onErrorIndexChange(newErrorIndex) {
|
|
@@ -291,7 +293,6 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
291
293
|
}, _ref));
|
|
292
294
|
}
|
|
293
295
|
}]);
|
|
294
|
-
return BulkTextareaRoot;
|
|
295
296
|
}(_core.Component);
|
|
296
297
|
(0, _defineProperty2["default"])(BulkTextareaRoot, "displayName", 'BulkTextarea');
|
|
297
298
|
(0, _defineProperty2["default"])(BulkTextareaRoot, "defaultProps", {
|
|
@@ -315,6 +316,5 @@ var BulkTextarea = function () {
|
|
|
315
316
|
ErrorsNavigation: _ErrorsNavigation.ErrorsNavigation
|
|
316
317
|
});
|
|
317
318
|
}();
|
|
318
|
-
var _default = BulkTextarea;
|
|
319
|
-
exports["default"] = _default;
|
|
319
|
+
var _default = exports["default"] = BulkTextarea;
|
|
320
320
|
//# sourceMappingURL=BulkTextarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkTextarea.js","names":["_core","require","_react","_interopRequireDefault","_flexBox","_InputField","_Counter","_ClearAll","_ErrorsNavigation","_intergalacticDynamicLocales","_i18nEnhance","_uniqueID","BulkTextareaRoot","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","React","createRef","linesCount","isEmptyText","errorIndex","highlightErrorIndex","isEmpty","setState","handlers","showErrors","errors","state","e","_this$inputFieldRef$c","value","textarea","inputFieldRef","current","querySelector","HTMLDivElement","focus","amount","_this$asProps$errors","asProps","itemsIndex","newIndex","handleChangeErrorIndex","setTimeout","_createClass2","key","uncontrolledProps","get","uid","getInputFieldProps","_this2","_this$asProps","size","minRows","maxRows","lineValidation","placeholder","validateOn","linesDelimiters","maxLines","disabled","readonly","pasteProps","lineProcessing","_this$asProps$errors2","_this$state","prevError","onChangeLinesCount","handleChangeLinesCount","onChangeLineIndex","includes","onBlur","event","_this2$props$onChange","_this2$props","lastInteraction","isKeyboard","FocusEvent","relatedTarget","clearAllButtonRef","_this2$nextButtonRef$","nextButtonRef","props","onChange","onErrorsChange","newErrors","undefined","_this2$asProps","newState","onErrorIndexChange","newErrorIndex","ref","counterId","getCounterProps","_this$asProps2","getI18nText","_this$state2","counterTheme","id","counterRef","theme","getClearAllProps","_this$asProps3","onClick","handleClickClearAll","isHidden","getErrorsNavigationProps","_this$asProps4","_this$asProps4$errors","onPrevError","onNextError","errorsCount","map","Boolean","prevButtonRef","render","_ref","createElement","Box","assignProps","Component","defaultValue","defaultState","locale","defaultErrors","defaultShowErrors","i18nEnhance","localizedMessages","uniqueIdEnhance","BulkTextarea","createComponent","InputField","Counter","ClearAll","ErrorsNavigation","_default","exports"],"sources":["../../src/BulkTextarea.tsx"],"sourcesContent":["import React from 'react';\nimport { createComponent, Component, Root, lastInteraction } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\n\nimport { BulkTextareaType, BulkTextareaProps } from './BulkTextarea.types';\n\nimport { InputField, InputFieldProps } from './components/InputField/InputField';\nimport { Counter } from './components/Counter';\nimport { ClearAll } from './components/ClearAll';\nimport { ErrorsNavigation } from './components/ErrorsNavigation';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIdEnhance from '@semcore/core/lib/utils/uniqueID';\n\ntype State<T extends string | string[]> = {\n linesCount: number;\n isEmptyText: boolean;\n errorIndex: number;\n highlightErrorIndex: boolean;\n prevError?: InputFieldProps<T>['errors'][number];\n};\n\nclass BulkTextareaRoot<T extends string | string[]> extends Component<\n BulkTextareaProps<T>,\n {},\n State<T>,\n typeof BulkTextareaRoot.enhance\n> {\n static displayName = 'BulkTextarea';\n static defaultProps = {\n defaultValue: '',\n size: 'm',\n defaultState: 'normal',\n minRows: 2,\n maxRows: 10,\n maxLines: 100,\n validateOn: 'blur',\n locale: 'en',\n defaultErrors: [],\n defaultShowErrors: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIdEnhance()] as const;\n\n inputFieldRef = React.createRef<HTMLDivElement>();\n clearAllButtonRef = React.createRef<HTMLButtonElement>();\n nextButtonRef = React.createRef<HTMLButtonElement>();\n prevButtonRef = React.createRef<HTMLButtonElement>();\n counterRef = React.createRef<HTMLDivElement>();\n\n state: State<T> = {\n linesCount: 0,\n isEmptyText: true,\n errorIndex: -1,\n highlightErrorIndex: false,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n state: null,\n showErrors: null,\n errors: null,\n };\n }\n\n get counterId() {\n return `${this.asProps.uid}_counter`;\n }\n\n getInputFieldProps() {\n const {\n value,\n size,\n minRows,\n maxRows,\n lineValidation,\n placeholder,\n validateOn,\n linesDelimiters,\n maxLines,\n disabled,\n readonly,\n pasteProps,\n lineProcessing,\n errors = [],\n showErrors,\n } = this.asProps;\n const { errorIndex, prevError, linesCount, highlightErrorIndex } = this.state;\n\n return {\n value,\n size,\n state: showErrors && errors?.length > 0 ? 'invalid' : 'normal',\n disabled,\n readonly,\n minRows,\n maxRows,\n maxLines,\n placeholder,\n prevError,\n pasteProps,\n linesCount,\n lineProcessing,\n onChangeLinesCount: this.handleChangeLinesCount,\n onChangeLineIndex: () => {\n if (validateOn?.includes('blurLine')) {\n this.handlers.showErrors(true);\n }\n },\n onBlur: (value: T, event: Event) => {\n if (\n validateOn?.includes('blur') &&\n (lastInteraction.isKeyboard() ||\n (event instanceof FocusEvent && event.relatedTarget !== this.clearAllButtonRef.current))\n ) {\n this.handlers.showErrors(true);\n }\n\n if (\n this.asProps.showErrors === false &&\n (validateOn?.includes('blur') || validateOn?.includes('blurLine'))\n ) {\n setTimeout(() => {\n this.nextButtonRef.current?.focus();\n }, 250);\n }\n\n this.props.onChange?.(value, event);\n },\n showErrors,\n validateOn,\n lineValidation: lineValidation,\n errors,\n onErrorsChange: (newErrors: InputFieldProps<T>['errors']) => {\n const prevError = newErrors.length === 0 ? errors[0] : undefined;\n this.handlers.errors(newErrors);\n this.setState({ prevError });\n setTimeout(() => {\n const { showErrors, errors } = this.asProps;\n if (showErrors) {\n const newState = newErrors.length === 0 ? 'normal' : 'invalid';\n this.handlers.state(newState);\n }\n if (errors?.length === 0) {\n this.handlers.showErrors(false);\n\n setTimeout(() => {\n this.setState({ prevError: undefined });\n }, 150);\n }\n }, 10); // this timeout to be sure that code will be after state change\n },\n highlightErrorIndex,\n errorIndex,\n onErrorIndexChange: (newErrorIndex: number) => {\n const prevError = errors[errorIndex];\n\n this.setState({ errorIndex: newErrorIndex, prevError, highlightErrorIndex: false });\n },\n linesDelimiters,\n ref: this.inputFieldRef,\n ['aria-describedby']: this.counterId,\n };\n }\n\n getCounterProps() {\n const { maxLines, getI18nText, size } = this.asProps;\n const { linesCount, isEmptyText } = this.state;\n\n let counterTheme = '';\n\n if (linesCount === maxLines) {\n counterTheme = 'warning';\n } else if (linesCount > maxLines!) {\n counterTheme = 'danger';\n }\n\n return {\n id: this.counterId,\n ref: this.counterRef,\n getI18nText,\n theme: counterTheme,\n linesCount: isEmptyText ? 0 : linesCount,\n maxLines,\n size,\n };\n }\n\n getClearAllProps() {\n const { size, getI18nText, disabled, readonly } = this.asProps;\n\n return {\n onClick: this.handleClickClearAll,\n isHidden: this.state.isEmptyText,\n size,\n getI18nText,\n ref: this.clearAllButtonRef,\n disabled: disabled || readonly,\n };\n }\n\n getErrorsNavigationProps() {\n const { size, getI18nText, disabled, readonly, errors = [], showErrors } = this.asProps;\n const { errorIndex } = this.state;\n return {\n size,\n getI18nText,\n errorIndex: errorIndex,\n onPrevError: this.handleChangeErrorIndex(-1),\n onNextError: this.handleChangeErrorIndex(1),\n errorsCount: errors.map(Boolean).length,\n showErrors,\n disabled: disabled || readonly || false,\n nextButtonRef: this.nextButtonRef,\n prevButtonRef: this.prevButtonRef,\n };\n }\n\n handleChangeLinesCount = (linesCount: number) => {\n const isEmpty = !linesCount;\n this.setState({ linesCount, isEmptyText: isEmpty });\n\n if (isEmpty) {\n this.handlers.showErrors(false);\n this.handlers.errors([]);\n this.handlers.state('normal');\n }\n };\n\n handleClickClearAll = (e: Event) => {\n this.handlers.showErrors(false);\n this.handlers.errors([]);\n this.setState({ errorIndex: -1 });\n this.handlers.value('', e);\n this.handlers.state('normal');\n\n const textarea = this.inputFieldRef.current?.querySelector('[role=\"textbox\"]');\n textarea instanceof HTMLDivElement && textarea.focus();\n };\n\n handleChangeErrorIndex = (amount: number) => () => {\n const { errors = [] } = this.asProps;\n const { errorIndex } = this.state;\n const itemsIndex = errors.length - 1;\n let newIndex = errorIndex + amount;\n\n if (newIndex < 0) {\n newIndex = amount + itemsIndex + 1;\n } else if (newIndex > itemsIndex) {\n newIndex = newIndex - itemsIndex - 1;\n }\n\n if (!errors[newIndex]) {\n this.handleChangeErrorIndex(amount < 0 ? amount - 1 : amount + 1)();\n } else {\n this.handlers.showErrors(false);\n this.setState({ errorIndex: -1 });\n\n setTimeout(() => {\n this.handlers.showErrors(true);\n this.setState({ errorIndex: newIndex, highlightErrorIndex: true });\n });\n }\n };\n\n render() {\n return <Root render={Box} __excludeProps={['onBlur', 'value', 'placeholder']} />;\n }\n}\n\nconst BulkTextarea = (<T extends string | string[]>() =>\n createComponent(BulkTextareaRoot, {\n InputField,\n Counter,\n ClearAll,\n ErrorsNavigation,\n }) as BulkTextareaType<T>)();\n\nexport default BulkTextarea;\n"],"mappings":";;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,C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,MAAM,EAAE,IAAI;EACZC,aAAa,EAAE,EAAE;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAAA,IAAA/G,gBAAA,aAlBGhB,gBAAgB,aAoBH,CAAC,IAAAgI,uBAAW,EAACC,8CAAiB,CAAC,EAAE,IAAAC,oBAAe,GAAE,CAAC;AAqOtE,IAAMC,YAAY,GAAI;EAAA,OACpB,IAAAC,qBAAe,EAACpI,gBAAgB,EAAE;IAChCqI,UAAU,EAAVA,sBAAU;IACVC,OAAO,EAAPA,gBAAO;IACPC,QAAQ,EAARA,kBAAQ;IACRC,gBAAgB,EAAhBA;EACF,CAAC,CAAC;AAAA,CAAuB,EAAG;AAAC,IAAAC,QAAA,GAEhBN,YAAY;AAAAO,OAAA,cAAAD,QAAA"}
|
|
1
|
+
{"version":3,"file":"BulkTextarea.js","names":["_core","require","_i18nEnhance","_interopRequireDefault","_uniqueID","_flexBox","_react","_ClearAll","_Counter","_ErrorsNavigation","_InputField","_intergalacticDynamicLocales","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct2","Reflect","construct","constructor","apply","BulkTextareaRoot","_Component","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","React","createRef","linesCount","isEmptyText","errorIndex","highlightErrorIndex","isEmpty","setState","handlers","showErrors","errors","state","_this$inputFieldRef$c","value","textarea","inputFieldRef","current","querySelector","HTMLDivElement","focus","amount","_this$asProps$errors","asProps","itemsIndex","newIndex","handleChangeErrorIndex","setTimeout","_inherits2","_createClass2","key","uncontrolledProps","get","uid","getInputFieldProps","_this2","_this$asProps","size","minRows","maxRows","lineValidation","placeholder","validateOn","linesDelimiters","maxLines","disabled","readonly","pasteProps","lineProcessing","_this$asProps$errors2","_this$state","prevError","onChangeLinesCount","handleChangeLinesCount","onChangeLineIndex","includes","onBlur","event","_this2$props$onChange","_this2$props","lastInteraction","isKeyboard","FocusEvent","relatedTarget","clearAllButtonRef","_this2$nextButtonRef$","nextButtonRef","props","onChange","call","onErrorsChange","newErrors","undefined","_this2$asProps","newState","onErrorIndexChange","newErrorIndex","ref","counterId","getCounterProps","_this$asProps2","getI18nText","_this$state2","counterTheme","id","counterRef","theme","getClearAllProps","_this$asProps3","onClick","handleClickClearAll","isHidden","getErrorsNavigationProps","_this$asProps4","_this$asProps4$errors","onPrevError","onNextError","errorsCount","map","Boolean","prevButtonRef","render","_ref","createElement","Box","assignProps","Component","defaultValue","defaultState","locale","defaultErrors","defaultShowErrors","i18nEnhance","localizedMessages","uniqueIdEnhance","BulkTextarea","createComponent","InputField","Counter","ClearAll","ErrorsNavigation","_default","exports"],"sources":["../../src/BulkTextarea.tsx"],"sourcesContent":["import { createComponent, Component, Root, lastInteraction } from '@semcore/core';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIdEnhance from '@semcore/core/lib/utils/uniqueID';\nimport { Box } from '@semcore/flex-box';\nimport React from 'react';\n\nimport type { BulkTextareaType, BulkTextareaProps } from './BulkTextarea.types';\nimport { ClearAll } from './components/ClearAll';\nimport { Counter } from './components/Counter';\nimport { ErrorsNavigation } from './components/ErrorsNavigation';\nimport { InputField, type InputFieldProps } from './components/InputField/InputField';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\ntype State<T extends string | string[]> = {\n linesCount: number;\n isEmptyText: boolean;\n errorIndex: number;\n highlightErrorIndex: boolean;\n prevError?: InputFieldProps<T>['errors'][number];\n};\n\nclass BulkTextareaRoot<T extends string | string[]> extends Component<\n BulkTextareaProps<T>,\n {},\n State<T>,\n typeof BulkTextareaRoot.enhance\n> {\n static displayName = 'BulkTextarea';\n static defaultProps = {\n defaultValue: '',\n size: 'm',\n defaultState: 'normal',\n minRows: 2,\n maxRows: 10,\n maxLines: 100,\n validateOn: 'blur',\n locale: 'en',\n defaultErrors: [],\n defaultShowErrors: false,\n };\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIdEnhance()] as const;\n\n inputFieldRef = React.createRef<HTMLDivElement>();\n clearAllButtonRef = React.createRef<HTMLButtonElement>();\n nextButtonRef = React.createRef<HTMLButtonElement>();\n prevButtonRef = React.createRef<HTMLButtonElement>();\n counterRef = React.createRef<HTMLDivElement>();\n\n state: State<T> = {\n linesCount: 0,\n isEmptyText: true,\n errorIndex: -1,\n highlightErrorIndex: false,\n };\n\n uncontrolledProps() {\n return {\n value: null,\n state: null,\n showErrors: null,\n errors: null,\n };\n }\n\n get counterId() {\n return `${this.asProps.uid}_counter`;\n }\n\n getInputFieldProps() {\n const {\n value,\n size,\n minRows,\n maxRows,\n lineValidation,\n placeholder,\n validateOn,\n linesDelimiters,\n maxLines,\n disabled,\n readonly,\n pasteProps,\n lineProcessing,\n errors = [],\n showErrors,\n } = this.asProps;\n const { errorIndex, prevError, linesCount, highlightErrorIndex } = this.state;\n\n return {\n value,\n size,\n state: showErrors && errors?.length > 0 ? 'invalid' : 'normal',\n disabled,\n readonly,\n minRows,\n maxRows,\n maxLines,\n placeholder,\n prevError,\n pasteProps,\n linesCount,\n lineProcessing,\n onChangeLinesCount: this.handleChangeLinesCount,\n onChangeLineIndex: () => {\n if (validateOn?.includes('blurLine')) {\n this.handlers.showErrors(true);\n }\n },\n onBlur: (value: T, event: Event) => {\n if (\n validateOn?.includes('blur') &&\n (lastInteraction.isKeyboard() ||\n (event instanceof FocusEvent && event.relatedTarget !== this.clearAllButtonRef.current))\n ) {\n this.handlers.showErrors(true);\n }\n\n if (\n this.asProps.showErrors === false &&\n (validateOn?.includes('blur') || validateOn?.includes('blurLine'))\n ) {\n setTimeout(() => {\n this.nextButtonRef.current?.focus();\n }, 250);\n }\n\n this.props.onChange?.(value, event);\n },\n showErrors,\n validateOn,\n lineValidation: lineValidation,\n errors,\n onErrorsChange: (newErrors: InputFieldProps<T>['errors']) => {\n const prevError = newErrors.length === 0 ? errors[0] : undefined;\n this.handlers.errors(newErrors);\n this.setState({ prevError });\n setTimeout(() => {\n const { showErrors, errors } = this.asProps;\n if (showErrors) {\n const newState = newErrors.length === 0 ? 'normal' : 'invalid';\n this.handlers.state(newState);\n }\n if (errors?.length === 0) {\n this.handlers.showErrors(false);\n\n setTimeout(() => {\n this.setState({ prevError: undefined });\n }, 150);\n }\n }, 10); // this timeout to be sure that code will be after state change\n },\n highlightErrorIndex,\n errorIndex,\n onErrorIndexChange: (newErrorIndex: number) => {\n const prevError = errors[errorIndex];\n\n this.setState({ errorIndex: newErrorIndex, prevError, highlightErrorIndex: false });\n },\n linesDelimiters,\n ref: this.inputFieldRef,\n ['aria-describedby']: this.counterId,\n };\n }\n\n getCounterProps() {\n const { maxLines, getI18nText, size } = this.asProps;\n const { linesCount, isEmptyText } = this.state;\n\n let counterTheme = '';\n\n if (linesCount === maxLines) {\n counterTheme = 'warning';\n } else if (linesCount > maxLines!) {\n counterTheme = 'danger';\n }\n\n return {\n id: this.counterId,\n ref: this.counterRef,\n getI18nText,\n theme: counterTheme,\n linesCount: isEmptyText ? 0 : linesCount,\n maxLines,\n size,\n };\n }\n\n getClearAllProps() {\n const { size, getI18nText, disabled, readonly } = this.asProps;\n\n return {\n onClick: this.handleClickClearAll,\n isHidden: this.state.isEmptyText,\n size,\n getI18nText,\n ref: this.clearAllButtonRef,\n disabled: disabled || readonly,\n };\n }\n\n getErrorsNavigationProps() {\n const { size, getI18nText, disabled, readonly, errors = [], showErrors } = this.asProps;\n const { errorIndex } = this.state;\n return {\n size,\n getI18nText,\n errorIndex: errorIndex,\n onPrevError: this.handleChangeErrorIndex(-1),\n onNextError: this.handleChangeErrorIndex(1),\n errorsCount: errors.map(Boolean).length,\n showErrors,\n disabled: disabled || readonly || false,\n nextButtonRef: this.nextButtonRef,\n prevButtonRef: this.prevButtonRef,\n };\n }\n\n handleChangeLinesCount = (linesCount: number) => {\n const isEmpty = !linesCount;\n this.setState({ linesCount, isEmptyText: isEmpty });\n\n if (isEmpty) {\n this.handlers.showErrors(false);\n this.handlers.errors([]);\n this.handlers.state('normal');\n }\n };\n\n handleClickClearAll = (e: Event) => {\n this.handlers.showErrors(false);\n this.handlers.errors([]);\n this.setState({ errorIndex: -1 });\n this.handlers.value('', e);\n this.handlers.state('normal');\n\n const textarea = this.inputFieldRef.current?.querySelector('[role=\"textbox\"]');\n if (textarea instanceof HTMLDivElement) {\n textarea.focus();\n }\n };\n\n handleChangeErrorIndex = (amount: number) => () => {\n const { errors = [] } = this.asProps;\n const { errorIndex } = this.state;\n const itemsIndex = errors.length - 1;\n let newIndex = errorIndex + amount;\n\n if (newIndex < 0) {\n newIndex = amount + itemsIndex + 1;\n } else if (newIndex > itemsIndex) {\n newIndex = newIndex - itemsIndex - 1;\n }\n\n if (!errors[newIndex]) {\n this.handleChangeErrorIndex(amount < 0 ? amount - 1 : amount + 1)();\n } else {\n this.handlers.showErrors(false);\n this.setState({ errorIndex: -1 });\n\n setTimeout(() => {\n this.handlers.showErrors(true);\n this.setState({ errorIndex: newIndex, highlightErrorIndex: true });\n });\n }\n };\n\n render() {\n return <Root render={Box} __excludeProps={['onBlur', 'value', 'placeholder']} />;\n }\n}\n\nconst BulkTextarea = (<T extends string | string[]>() =>\n createComponent(BulkTextareaRoot, {\n InputField,\n Counter,\n ClearAll,\n ErrorsNavigation,\n }) as BulkTextareaType<T>)();\n\nexport default BulkTextarea;\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,4BAAA,GAAAV,OAAA;AAAmF,SAAAW,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAA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AAC,oBAAe,EAAC,CAAC,CAAC;AAuOtE,IAAMC,YAAY,GAAI;EAAA,OACpB,IAAAC,qBAAe,EAAC/H,gBAAgB,EAAE;IAChCgI,UAAU,EAAVA,sBAAU;IACVC,OAAO,EAAPA,gBAAO;IACPC,QAAQ,EAARA,kBAAQ;IACRC,gBAAgB,EAAhBA;EACF,CAAC,CAAC;AAAA,CAAuB,CAAE,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEhBP,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkTextarea.types.js","names":[],"sources":["../../src/BulkTextarea.types.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"BulkTextarea.types.js","names":[],"sources":["../../src/BulkTextarea.types.ts"],"sourcesContent":["import type Button from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\n\nimport type { CounterProps } from './components/Counter';\nimport type { ErrorsNavigationProps } from './components/ErrorsNavigation';\nimport type { InputFieldProps } from './components/InputField/InputField';\n\nexport type BulkTextareaProps<T extends string | string[]> = {\n value?: InputFieldProps<T>['value'];\n onChange?: InputFieldProps<T>['onBlur'];\n placeholder?: InputFieldProps<T>['placeholder'];\n size?: InputFieldProps<T>['size'];\n state?: InputFieldProps<T>['state'];\n disabled?: InputFieldProps<T>['disabled'];\n readonly?: InputFieldProps<T>['readonly'];\n\n minRows?: InputFieldProps<T>['minRows'];\n maxRows?: InputFieldProps<T>['maxRows'];\n\n validateOn?: InputFieldProps<T>['validateOn'];\n lineValidation?: InputFieldProps<T>['lineValidation'];\n linesDelimiters?: InputFieldProps<T>['linesDelimiters'];\n pasteProps?: InputFieldProps<T>['pasteProps'];\n\n maxLines?: InputFieldProps<T>['maxLines'];\n lineProcessing?: InputFieldProps<T>['lineProcessing'];\n\n errors?: InputFieldProps<T>['errors'];\n showErrors?: boolean;\n\n onErrorsChange?: InputFieldProps<T>['onErrorsChange'];\n onShowErrorsChange?: InputFieldProps<T>['onShowErrorsChange'];\n};\n\ntype BulkTextareaComponent = (<T extends string | string[]>(\n props: Intergalactic.InternalTypings.ComponentProps<\n 'div',\n 'div',\n BoxProps & BulkTextareaProps<T>\n >,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<'div', 'div', {}>;\n\nexport type BulkTextareaType<T extends string | string[]> = BulkTextareaComponent & {\n InputField: Intergalactic.Component<\n 'div',\n Pick<InputFieldProps<T>, 'commonErrorMessage' | 'id'> & Partial<BulkTextareaProps<T>> & BoxProps\n >;\n Counter: Intergalactic.Component<'div', Partial<CounterProps>>;\n ClearAll: typeof Button;\n ErrorsNavigation: Intergalactic.Component<'div', Partial<ErrorsNavigationProps>>;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ClearAll = ClearAll;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _core = require("@semcore/core");
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
12
11
|
var _m = _interopRequireDefault(require("@semcore/icon/Close/m"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
function ClearAll(props) {
|
|
14
14
|
var _ref = arguments[0],
|
|
15
15
|
_ref2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearAll.js","names":["_core","require","
|
|
1
|
+
{"version":3,"file":"ClearAll.js","names":["_core","require","_button","_interopRequireDefault","_m","_react","ClearAll","props","_ref","arguments[0]","_ref2","SButton","Button","isHidden","sstyled","styles","createElement","cn","_objectSpread2","assignProps","CloseM","getI18nText"],"sources":["../../../src/components/ClearAll.tsx"],"sourcesContent":["import Button from '@semcore/button';\nimport { type IRootComponentProps, Root, sstyled } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport CloseM from '@semcore/icon/Close/m';\nimport React from 'react';\n\nexport function ClearAll(\n props: IRootComponentProps & { isHidden: boolean; getI18nText: ReturnType<typeof useI18n> },\n) {\n const SButton = Root;\n return (\n !props.isHidden &&\n sstyled(props.styles)(\n <SButton render={Button} theme='muted' use='tertiary' addonLeft={CloseM}>\n {props.getI18nText('BulkTextarea.ClearAllButton.buttonText')}\n </SButton>,\n )\n );\n}\n"],"mappings":";;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,EAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEO,SAASK,QAAQA,CACtBC,KAA2F,EAC3F;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EACA,IAAMC,OAAO,GAIQC,kBAAM;EAH3B,OACE,CAACL,KAAK,CAACM,QAAQ,KAAAH,KAAA,GACf,IAAAI,aAAO,EAACP,KAAK,CAACQ,MAAM,CAAC,eACnBV,MAAA,YAAAW,aAAA,CAACL,OAAO,EAAAD,KAAA,CAAAO,EAAA,gBAAAC,cAAA,qBAAAlB,KAAA,CAAAmB,WAAA;IAAA,SAAuB,OAAO;IAAA,OAAK,UAAU;IAAA,aAAYC;EAAM,GAAAZ,IAAA,KACpED,KAAK,CAACc,WAAW,CAAC,wCAAwC,CACpD,CAAC,CACX;AAEL","ignoreList":[]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Counter = Counter;
|
|
8
8
|
var _core = require("@semcore/core");
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _flexBox = require("@semcore/flex-box");
|
|
11
9
|
var _counter = _interopRequireDefault(require("@semcore/counter"));
|
|
10
|
+
var _flexBox = require("@semcore/flex-box");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
function Counter(props) {
|
|
13
13
|
var _ref = arguments[0];
|
|
14
14
|
var theme = props.theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Counter.js","names":["_core","require","
|
|
1
|
+
{"version":3,"file":"Counter.js","names":["_core","require","_counter","_interopRequireDefault","_flexBox","_react","Counter","props","_ref","arguments[0]","theme","linesCount","maxLines","getI18nText","createElement","CounterKit","assignProps","ScreenReaderOnly","rowsNumber"],"sources":["../../../src/components/Counter.tsx"],"sourcesContent":["import { Root } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport CounterKit, { type CounterProps as CounterPropsKit } from '@semcore/counter';\nimport { ScreenReaderOnly } from '@semcore/flex-box';\nimport React from 'react';\n\nexport type CounterProps = {\n theme: CounterPropsKit['theme'];\n linesCount: number;\n maxLines: number;\n getI18nText: ReturnType<typeof useI18n>;\n};\n\nexport function Counter(props: CounterProps) {\n const { theme, linesCount, maxLines, getI18nText } = props;\n\n return (\n <Root render={CounterKit} ml={1} theme={theme}>\n {linesCount}\n <span aria-hidden='true'>\n /\n {maxLines}\n </span>\n <ScreenReaderOnly>\n {getI18nText('BulkTextarea.Counter.ofAllowedRows:sr-message', { rowsNumber: maxLines })}\n </ScreenReaderOnly>\n {theme === 'warning' && (\n <ScreenReaderOnly>\n {getI18nText('BulkTextarea.Counter.limitReached:sr-message')}\n </ScreenReaderOnly>\n )}\n {theme === 'danger' && (\n <ScreenReaderOnly>\n {getI18nText('BulkTextarea.Counter.limitExceeded:sr-message')}\n </ScreenReaderOnly>\n )}\n </Root>\n );\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AASO,SAASK,OAAOA,CAACC,KAAmB,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;EAC3C,IAAQC,KAAK,GAAwCH,KAAK,CAAlDG,KAAK;IAAEC,UAAU,GAA4BJ,KAAK,CAA3CI,UAAU;IAAEC,QAAQ,GAAkBL,KAAK,CAA/BK,QAAQ;IAAEC,WAAW,GAAKN,KAAK,CAArBM,WAAW;EAEhD,oBACER,MAAA,YAAAS,aAAA,CAAcC,mBAAU,MAAAf,KAAA,CAAAgB,WAAA;IAAA,MAAM,CAAC;IAAA,SAASN;EAAK,GAAAF,IAAA,GAC1CG,UAAU,eACXN,MAAA,YAAAS,aAAA;IAAM,eAAY;EAAM,GAAC,GAEvB,EAACF,QACG,CAAC,eACPP,MAAA,YAAAS,aAAA,CAACV,QAAA,CAAAa,gBAAgB,QACdJ,WAAW,CAAC,+CAA+C,EAAE;IAAEK,UAAU,EAAEN;EAAS,CAAC,CACtE,CAAC,EAClBF,KAAK,KAAK,SAAS,iBAClBL,MAAA,YAAAS,aAAA,CAACV,QAAA,CAAAa,gBAAgB,QACdJ,WAAW,CAAC,8CAA8C,CAC3C,CACnB,EACAH,KAAK,KAAK,QAAQ,iBACjBL,MAAA,YAAAS,aAAA,CAACV,QAAA,CAAAa,gBAAgB,QACdJ,WAAW,CAAC,+CAA+C,CAC5C,CAEhB,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ErrorsNavigation = ErrorsNavigation;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
10
9
|
var _flexBox = require("@semcore/flex-box");
|
|
10
|
+
var _m = _interopRequireDefault(require("@semcore/icon/ChevronDown/m"));
|
|
11
|
+
var _m2 = _interopRequireDefault(require("@semcore/icon/ChevronUp/m"));
|
|
11
12
|
var _typography = require("@semcore/typography");
|
|
12
|
-
var
|
|
13
|
-
var _m2 = _interopRequireDefault(require("@semcore/icon/ChevronDown/m"));
|
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
function ErrorsNavigation(props) {
|
|
15
15
|
var errorIndex = props.errorIndex,
|
|
16
16
|
errorsCount = props.errorsCount,
|
|
@@ -26,20 +26,20 @@ function ErrorsNavigation(props) {
|
|
|
26
26
|
alignItems: "center"
|
|
27
27
|
}, errorsCount > 0 && showErrors && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
28
28
|
onClick: onNextError,
|
|
29
|
-
addonLeft:
|
|
30
|
-
use:
|
|
31
|
-
theme:
|
|
29
|
+
addonLeft: _m["default"],
|
|
30
|
+
use: "tertiary",
|
|
31
|
+
theme: "muted",
|
|
32
32
|
"aria-label": getI18nText('BulkTextarea.ErrorsNavigation.nextError:aria-label'),
|
|
33
|
-
hintPlacement:
|
|
33
|
+
hintPlacement: "bottom",
|
|
34
34
|
disabled: disabled,
|
|
35
35
|
ref: nextButtonRef
|
|
36
36
|
}), /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
|
37
37
|
onClick: onPrevError,
|
|
38
|
-
addonLeft:
|
|
39
|
-
use:
|
|
40
|
-
theme:
|
|
38
|
+
addonLeft: _m2["default"],
|
|
39
|
+
use: "tertiary",
|
|
40
|
+
theme: "muted",
|
|
41
41
|
"aria-label": getI18nText('BulkTextarea.ErrorsNavigation.previousError:aria-label'),
|
|
42
|
-
hintPlacement:
|
|
42
|
+
hintPlacement: "bottom",
|
|
43
43
|
disabled: disabled,
|
|
44
44
|
ref: prevButtonRef
|
|
45
45
|
}), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorsNavigation.js","names":["
|
|
1
|
+
{"version":3,"file":"ErrorsNavigation.js","names":["_button","_interopRequireDefault","require","_flexBox","_m","_m2","_typography","_react","ErrorsNavigation","props","errorIndex","errorsCount","onPrevError","onNextError","size","showErrors","getI18nText","disabled","nextButtonRef","prevButtonRef","createElement","Flex","alignItems","Fragment","onClick","addonLeft","ChevronDownM","use","theme","hintPlacement","ref","ChevronUpM","Text","color","ml"],"sources":["../../../src/components/ErrorsNavigation.tsx"],"sourcesContent":["import Button from '@semcore/button';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport { Flex } from '@semcore/flex-box';\nimport ChevronDownM from '@semcore/icon/ChevronDown/m';\nimport ChevronUpM from '@semcore/icon/ChevronUp/m';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nexport type ErrorsNavigationProps = {\n errorIndex: number;\n onPrevError: () => void;\n onNextError: () => void;\n errorsCount: number;\n size: 'm' | 'l';\n showErrors: boolean;\n getI18nText: ReturnType<typeof useI18n>;\n disabled: boolean;\n nextButtonRef: React.RefObject<HTMLButtonElement>;\n prevButtonRef: React.RefObject<HTMLButtonElement>;\n};\n\nexport function ErrorsNavigation(props: ErrorsNavigationProps) {\n const {\n errorIndex,\n errorsCount,\n onPrevError,\n onNextError,\n size,\n showErrors,\n getI18nText,\n disabled,\n nextButtonRef,\n prevButtonRef,\n } = props;\n return (\n <Flex alignItems='center'>\n {errorsCount > 0 && showErrors && (\n <>\n <Button\n onClick={onNextError}\n addonLeft={ChevronDownM}\n use='tertiary'\n theme='muted'\n aria-label={getI18nText('BulkTextarea.ErrorsNavigation.nextError:aria-label')}\n hintPlacement='bottom'\n disabled={disabled}\n ref={nextButtonRef}\n />\n <Button\n onClick={onPrevError}\n addonLeft={ChevronUpM}\n use='tertiary'\n theme='muted'\n aria-label={getI18nText('BulkTextarea.ErrorsNavigation.previousError:aria-label')}\n hintPlacement='bottom'\n disabled={disabled}\n ref={prevButtonRef}\n />\n <Text size={size === 'l' ? 300 : 200} color='text-critical' ml={1} disabled={disabled}>\n {errorIndex === -1\n ? getI18nText('BulkTextarea.ErrorsNavigation.totalErrors', { errorsCount })\n : getI18nText('BulkTextarea.ErrorsNavigation.selectedError', {\n errorIndex: errorIndex + 1,\n errorsCount,\n })}\n </Text>\n </>\n )}\n </Flex>\n );\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,EAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AAeO,SAASM,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,IACEC,UAAU,GAURD,KAAK,CAVPC,UAAU;IACVC,WAAW,GASTF,KAAK,CATPE,WAAW;IACXC,WAAW,GAQTH,KAAK,CARPG,WAAW;IACXC,WAAW,GAOTJ,KAAK,CAPPI,WAAW;IACXC,IAAI,GAMFL,KAAK,CANPK,IAAI;IACJC,UAAU,GAKRN,KAAK,CALPM,UAAU;IACVC,WAAW,GAITP,KAAK,CAJPO,WAAW;IACXC,QAAQ,GAGNR,KAAK,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