@semcore/bulk-textarea 16.3.1-prerelease.1 → 16.4.0-prerelease.2
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 +11 -0
- package/lib/cjs/BulkTextarea.js +4 -3
- package/lib/cjs/BulkTextarea.js.map +1 -1
- package/lib/cjs/BulkTextarea.types.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.js +80 -35
- package/lib/cjs/components/InputField/InputField.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.types.js.map +1 -1
- package/lib/cjs/components/InputField/inputField.shadow.css +18 -0
- package/lib/es6/BulkTextarea.js +4 -3
- package/lib/es6/BulkTextarea.js.map +1 -1
- package/lib/es6/BulkTextarea.types.js.map +1 -1
- package/lib/es6/components/InputField/InputField.js +80 -35
- package/lib/es6/components/InputField/InputField.js.map +1 -1
- package/lib/es6/components/InputField/InputField.types.js.map +1 -1
- package/lib/es6/components/InputField/inputField.shadow.css +18 -0
- package/lib/esm/BulkTextarea.mjs +3 -3
- package/lib/esm/components/InputField/InputField.mjs +67 -23
- package/lib/esm/components/InputField/inputField.shadow.css +18 -0
- package/lib/types/BulkTextarea.types.d.ts +2 -0
- package/lib/types/components/InputField/InputField.d.ts +1 -0
- package/lib/types/components/InputField/InputField.types.d.ts +6 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [16.4.0] - 2025-08-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Controlled mode for errors.
|
|
10
|
+
- `onImmediatelyChange` internal property.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Incorrect paddings for line numbers starting from 1000 lines.
|
|
15
|
+
|
|
5
16
|
## [16.3.1] - 2025-08-29
|
|
6
17
|
|
|
7
18
|
### Changed
|
package/lib/cjs/BulkTextarea.js
CHANGED
|
@@ -135,13 +135,14 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
135
135
|
lineProcessing = _this$asProps.lineProcessing,
|
|
136
136
|
_this$asProps$errors2 = _this$asProps.errors,
|
|
137
137
|
errors = _this$asProps$errors2 === void 0 ? [] : _this$asProps$errors2,
|
|
138
|
-
showErrors = _this$asProps.showErrors
|
|
138
|
+
showErrors = _this$asProps.showErrors,
|
|
139
|
+
onImmediatelyChange = _this$asProps.onImmediatelyChange;
|
|
139
140
|
var _this$state = this.state,
|
|
140
141
|
errorIndex = _this$state.errorIndex,
|
|
141
142
|
prevError = _this$state.prevError,
|
|
142
143
|
linesCount = _this$state.linesCount,
|
|
143
144
|
highlightErrorIndex = _this$state.highlightErrorIndex;
|
|
144
|
-
return (0, _defineProperty2["default"])({
|
|
145
|
+
return (0, _defineProperty2["default"])((0, _defineProperty2["default"])({
|
|
145
146
|
value: value,
|
|
146
147
|
size: size,
|
|
147
148
|
state: showErrors && (errors === null || errors === void 0 ? void 0 : errors.length) > 0 ? 'invalid' : 'normal',
|
|
@@ -214,7 +215,7 @@ var BulkTextareaRoot = /*#__PURE__*/function (_Component) {
|
|
|
214
215
|
},
|
|
215
216
|
linesDelimiters: linesDelimiters,
|
|
216
217
|
ref: this.inputFieldRef
|
|
217
|
-
}, 'aria-describedby', this.counterId);
|
|
218
|
+
}, 'aria-describedby', this.counterId), "onImmediatelyChange", onImmediatelyChange);
|
|
218
219
|
}
|
|
219
220
|
}, {
|
|
220
221
|
key: "getCounterProps",
|
|
@@ -1 +1 @@
|
|
|
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[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AkB,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa;MAAC,GAAAH,IAAA,CAAG,CAAC;IAClF;EAAC;AAAA,EAxPyDI,eAAS;AAAA,IAAA1G,gBAAA,aAA/DX,gBAAgB,iBAMC,cAAc;AAAA,IAAAW,gBAAA,aAN/BX,gBAAgB,kBAOE;EACpBsH,YAAY,EAAE,EAAE;EAChBtE,IAAI,EAAE,GAAG;EACTuE,YAAY,EAAE,QAAQ;EACtBtE,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE,EAAE;EACXK,QAAQ,EAAE,GAAG;EACbF,UAAU,EAAE,MAAM;EAClBmE,MAAM,EAAE,IAAI;EACZC,aAAa,EAAE,EAAE;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAAA,IAAA/G,gBAAA,aAlBGX,gBAAgB,aAoBH,CAAC,IAAA2H,uBAAW,EAACC,8CAAiB,CAAC,EAAE,IAAAC,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
|
+
{"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","onImmediatelyChange","_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 onImmediatelyChange,\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 onImmediatelyChange,\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":";;;;;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IAAA,CAAG,CAAC;IAClF;EAAC;AAAA,EA1PyDI,eAAS;AAAA,IAAA3G,gBAAA,aAA/DX,gBAAgB,iBAMC,cAAc;AAAA,IAAAW,gBAAA,aAN/BX,gBAAgB,kBAOE;EACpBuH,YAAY,EAAE,EAAE;EAChBvE,IAAI,EAAE,GAAG;EACTwE,YAAY,EAAE,QAAQ;EACtBvE,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE,EAAE;EACXK,QAAQ,EAAE,GAAG;EACbF,UAAU,EAAE,MAAM;EAClBoE,MAAM,EAAE,IAAI;EACZC,aAAa,EAAE,EAAE;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAAA,IAAAhH,gBAAA,aAlBGX,gBAAgB,aAoBH,CAAC,IAAA4H,uBAAW,EAACC,8CAAiB,CAAC,EAAE,IAAAC,oBAAe,EAAC,CAAC,CAAC;AAyOtE,IAAMC,YAAY,GAAI;EAAA,OACpB,IAAAC,qBAAe,EAAChI,gBAAgB,EAAE;IAChCiI,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 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 /** The current value */\n value?: InputFieldProps<T>['value'];\n /** Callback triggered when the onBlur event is emmited */\n onChange?: InputFieldProps<T>['onBlur'];\n /** Placeholder text */\n placeholder?: InputFieldProps<T>['placeholder'];\n /** Component size */\n size?: InputFieldProps<T>['size'];\n /** State for show errors or valid(green) borders */\n state?: InputFieldProps<T>['state'];\n /** Defines whether the textarea is disabled */\n disabled?: InputFieldProps<T>['disabled'];\n /** Defines whether the textarea is readonly */\n readonly?: InputFieldProps<T>['readonly'];\n /** Minimum number of rows to display */\n minRows?: InputFieldProps<T>['minRows'];\n /** Maximum number of rows to display */\n maxRows?: InputFieldProps<T>['maxRows'];\n /** An event when a validation occurs */\n validateOn?: InputFieldProps<T>['validateOn'];\n /** A function to valide the line */\n lineValidation?: InputFieldProps<T>['lineValidation'];\n /** Line delimeters */\n linesDelimiters?: InputFieldProps<T>['linesDelimiters'];\n /** Defines the props for paste action */\n pasteProps?: InputFieldProps<T>['pasteProps'];\n /** Maximum number of allowed lines/values */\n maxLines?: InputFieldProps<T>['maxLines'];\n /** Function to process individual lines during input */\n lineProcessing?: InputFieldProps<T>['lineProcessing'];\n /** List of errors */\n errors?: InputFieldProps<T>['errors'];\n /** Defines whether to show errors or not */\n showErrors?: boolean;\n /** Internal */\n onErrorsChange?: InputFieldProps<T>['onErrorsChange'];\n /** Internal */\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
|
+
{"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 /** The current value */\n value?: InputFieldProps<T>['value'];\n /** Callback triggered when the onBlur event is emmited */\n onChange?: InputFieldProps<T>['onBlur'];\n /** Placeholder text */\n placeholder?: InputFieldProps<T>['placeholder'];\n /** Component size */\n size?: InputFieldProps<T>['size'];\n /** State for show errors or valid(green) borders */\n state?: InputFieldProps<T>['state'];\n /** Defines whether the textarea is disabled */\n disabled?: InputFieldProps<T>['disabled'];\n /** Defines whether the textarea is readonly */\n readonly?: InputFieldProps<T>['readonly'];\n /** Minimum number of rows to display */\n minRows?: InputFieldProps<T>['minRows'];\n /** Maximum number of rows to display */\n maxRows?: InputFieldProps<T>['maxRows'];\n /** An event when a validation occurs */\n validateOn?: InputFieldProps<T>['validateOn'];\n /** A function to valide the line */\n lineValidation?: InputFieldProps<T>['lineValidation'];\n /** Line delimeters */\n linesDelimiters?: InputFieldProps<T>['linesDelimiters'];\n /** Defines the props for paste action */\n pasteProps?: InputFieldProps<T>['pasteProps'];\n /** Maximum number of allowed lines/values */\n maxLines?: InputFieldProps<T>['maxLines'];\n /** Function to process individual lines during input */\n lineProcessing?: InputFieldProps<T>['lineProcessing'];\n /** List of errors */\n errors?: InputFieldProps<T>['errors'];\n /** Defines whether to show errors or not */\n showErrors?: boolean;\n /** Internal */\n onErrorsChange?: InputFieldProps<T>['onErrorsChange'];\n /** Internal */\n onShowErrorsChange?: InputFieldProps<T>['onShowErrorsChange'];\n /** Internal */\n onImmediatelyChange?: InputFieldProps<T>['onImmediatelyChange'];\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":[]}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.InputField = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
10
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
11
11
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -24,20 +24,20 @@ var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
|
24
24
|
var _react = _interopRequireDefault(require("react"));
|
|
25
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)); }
|
|
26
26
|
/*!__reshadow-styles__:"./inputField.shadow.css"*/
|
|
27
|
-
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
27
|
+
var style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SInputField_6oo4u_gg_>div{box-sizing:content-box;outline:0;border-radius:var(--intergalactic-control-rounded, 6px);border-color:var(--intergalactic-border-primary, #c4c7cf);border-style:solid;border-width:1px;overflow:auto;position:relative;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);color:var(--intergalactic-text-primary, #191b23);word-wrap:break-word;word-break:break-word;font-family:inherit}.___SInputField_6oo4u_gg_>div:empty::before{content:\"1. \"attr(placeholder);color:var(--intergalactic-text-placeholder, #8a8e9b);position:absolute}.___SInputField_6oo4u_gg_>div:nth-child(even){color:red;counter-increment:row;margin-bottom:var(--intergalactic-spacing-1x, 4px);position:relative;word-break:break-all}.___SInputField_6oo4u_gg_>div:nth-child(even)::before{content:counter(row)\".\";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-1x, 4px)}.___SInputField_6oo4u_gg_>div>p{counter-increment:row;margin:0 0 var(--intergalactic-spacing-1x, 4px)0;position:relative;word-break:break-all;white-space:pre-wrap;padding:0 var(--intergalactic-spacing-5x, 20px)0 var(--intergalactic-spacing-4x, 16px)}.___SInputField_6oo4u_gg_>div>p:last-of-type{margin-bottom:0}.___SInputField_6oo4u_gg_>div>p:not(:empty)::before{content:counter(row)\".\";display:inline-block;white-space:nowrap;text-align:right;color:var(--intergalactic-text-secondary, #6c6e79);margin-right:var(--intergalactic-spacing-1x, 4px);position:absolute;left:0}.___SInputField_6oo4u_gg_>div>p[data-over-max-rows=true]{background-color:var(--intergalactic-bg-secondary-critical, #fff0f7)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+10))>p{padding-left:var(--intergalactic-spacing-6x, 24px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+10))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+100))>p{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+100))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+10)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+100))>p:nth-child(n+100)::before{padding-left:0}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+1000))>p{padding-left:calc(var(--intergalactic-spacing-10x, 40px) + var(--intergalactic-spacing-1x, 4px))}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+1000))>p:nth-child(-n+9)::before{padding-left:var(--intergalactic-spacing-6x, 24px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+10)::before{padding-left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+100)::before{padding-left:var(--intergalactic-spacing-2x, 8px)}.___SInputField_6oo4u_gg_>div:has(p:nth-child(n+1000))>p:nth-child(n+1000)::before{padding-left:0}.___SInputField_6oo4u_gg_.__showErrors_6oo4u_gg_>div[aria-invalid]>p[aria-invalid]:after{content:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsPSIjZDEwMDJmIj48cGF0aCBkPSJNNyA2aDJ2NEg3VjZabTIgN3YtMkg3djJoMloiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMTUyIDEuMTcyYy43MTktMS41NjMgMi45NzctMS41NjMgMy42OTYgMGw2LjA0MyAxMy4xNDFjLjM2My43OTEtLjIyNSAxLjY4Ny0xLjEwOSAxLjY4N0gxLjIxOGMtLjg4NCAwLTEuNDcyLS44OTYtMS4xMDktMS42ODdMNi4xNTIgMS4xNzJabTcuMzc0IDEyLjgzN0w4IDEuOTkgMi40NzQgMTQuMDFoMTEuMDUyWiIvPjwvc3ZnPgo=\\ );position:absolute;right:0;top:var(--intergalactic-spacing-05x, 2px)}.___SInputField_6oo4u_gg_._size_m_6oo4u_gg_>div{padding:var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%);min-height:calc(var(--minRows_6oo4u)*20px);max-height:calc((var(--maxRows_6oo4u) - 1)*(20px + var(--intergalactic-spacing-1x, 4px)) + 18px)}.___SInputField_6oo4u_gg_._size_m_6oo4u_gg_>div:empty{padding-left:var(--intergalactic-spacing-8x, 32px)}.___SInputField_6oo4u_gg_._size_l_6oo4u_gg_>div:empty::before,.___SInputField_6oo4u_gg_._size_m_6oo4u_gg_>div:empty::before{left:var(--intergalactic-spacing-4x, 16px)}.___SInputField_6oo4u_gg_._size_l_6oo4u_gg_>div{padding:var(--intergalactic-spacing-3x, 12px) var(--intergalactic-spacing-4x, 16px);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);min-height:calc(var(--minRows_6oo4u)*24px);max-height:calc((var(--maxRows_6oo4u) - 1)*(24px + var(--intergalactic-spacing-1x, 4px)) + 20px)}.___SInputField_6oo4u_gg_._size_l_6oo4u_gg_>div:empty{padding-left:calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px))}.___SInputField_6oo4u_gg_._state_normal_6oo4u_gg_:not(.__disabled_6oo4u_gg_)>div:focus:focus{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));border-color:var(--intergalactic-border-info-active, #006dca)}.___SInputField_6oo4u_gg_._state_valid_6oo4u_gg_>div{border-color:var(--intergalactic-border-success-active, #007c65)}.___SInputField_6oo4u_gg_._state_valid_6oo4u_gg_>div:focus{box-shadow:var(--intergalactic-keyboard-focus-valid, 0px 0px 0px 3px rgba(0, 159, 129, 0.5))}.___SInputField_6oo4u_gg_._state_invalid_6oo4u_gg_>div{border-color:var(--intergalactic-border-critical-active, #d1002f);background-image:var(--intergalactic-border-critical-pattern, repeating-linear-gradient(315deg, rgba(209, 0, 47, 1) 0, rgba(209, 0, 47, 1) 2px, transparent 0, transparent 50%));background-size:6px 6px;background-color:var(--intergalactic-bg-primary-neutral, #ffffff);border-bottom-left-radius:var(--intergalactic-control-rounded, 6px);border-top-left-radius:var(--intergalactic-control-rounded, 6px);background-repeat:repeat-y}.___SInputField_6oo4u_gg_._state_invalid_6oo4u_gg_>div:focus{box-shadow:var(--intergalactic-keyboard-focus-invalid, 0px 0px 0px 3px rgba(255, 73, 83, 0.5))}.___SInputField_6oo4u_gg_.__readonly_6oo4u_gg_>div{background-color:var(--intergalactic-bg-secondary-neutral, #f4f5f9)}.___SInputField_6oo4u_gg_.__disabled_6oo4u_gg_>div{opacity:var(--intergalactic-disabled-opacity, 0.3)}", /*__inner_css_end__*/"6oo4u_gg_"),
|
|
28
28
|
/*__reshadow_css_end__*/
|
|
29
29
|
{
|
|
30
|
-
"__SInputField": "
|
|
31
|
-
"_showErrors": "
|
|
32
|
-
"_readonly": "
|
|
33
|
-
"_disabled": "
|
|
34
|
-
"_size_m": "
|
|
35
|
-
"--minRows": "--
|
|
36
|
-
"--maxRows": "--
|
|
37
|
-
"_size_l": "
|
|
38
|
-
"_state_normal": "
|
|
39
|
-
"_state_valid": "
|
|
40
|
-
"_state_invalid": "
|
|
30
|
+
"__SInputField": "___SInputField_6oo4u_gg_",
|
|
31
|
+
"_showErrors": "__showErrors_6oo4u_gg_",
|
|
32
|
+
"_readonly": "__readonly_6oo4u_gg_",
|
|
33
|
+
"_disabled": "__disabled_6oo4u_gg_",
|
|
34
|
+
"_size_m": "_size_m_6oo4u_gg_",
|
|
35
|
+
"--minRows": "--minRows_6oo4u",
|
|
36
|
+
"--maxRows": "--maxRows_6oo4u",
|
|
37
|
+
"_size_l": "_size_l_6oo4u_gg_",
|
|
38
|
+
"_state_normal": "_state_normal_6oo4u_gg_",
|
|
39
|
+
"_state_valid": "_state_valid_6oo4u_gg_",
|
|
40
|
+
"_state_invalid": "_state_invalid_6oo4u_gg_"
|
|
41
41
|
});
|
|
42
42
|
var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
43
43
|
function InputField(props) {
|
|
@@ -59,6 +59,7 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
59
59
|
(0, _defineProperty2["default"])(_this, "toggleErrorsPopperTimeout", 0);
|
|
60
60
|
(0, _defineProperty2["default"])(_this, "isFocusing", false);
|
|
61
61
|
(0, _defineProperty2["default"])(_this, "linesCountTimeout", 0);
|
|
62
|
+
(0, _defineProperty2["default"])(_this, "observer", void 0);
|
|
62
63
|
(0, _defineProperty2["default"])(_this, "state", {
|
|
63
64
|
visibleErrorPopper: false,
|
|
64
65
|
keyboardLineIndex: -1,
|
|
@@ -75,6 +76,23 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
75
76
|
_this.handleScroll = _this.handleScroll.bind(_this);
|
|
76
77
|
_this.handleSelectAll = _this.handleSelectAll.bind(_this);
|
|
77
78
|
_this.textarea = _this.createContentEditableElement(props);
|
|
79
|
+
_this.observer = new MutationObserver(function (mutationsList, observer) {
|
|
80
|
+
var _iterator = (0, _createForOfIteratorHelper2["default"])(mutationsList),
|
|
81
|
+
_step;
|
|
82
|
+
try {
|
|
83
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
84
|
+
var mutation = _step.value;
|
|
85
|
+
if (mutation.type === 'characterData' || mutation.type === 'childList') {
|
|
86
|
+
var _this$props$onImmedia, _this$props, _this$textarea$textCo;
|
|
87
|
+
(_this$props$onImmedia = (_this$props = _this.props).onImmediatelyChange) === null || _this$props$onImmedia === void 0 || _this$props$onImmedia.call(_this$props, _this.getValues(), (_this$textarea$textCo = _this.textarea.textContent) !== null && _this$textarea$textCo !== void 0 ? _this$textarea$textCo : '');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
} catch (err) {
|
|
91
|
+
_iterator.e(err);
|
|
92
|
+
} finally {
|
|
93
|
+
_iterator.f();
|
|
94
|
+
}
|
|
95
|
+
});
|
|
78
96
|
return _this;
|
|
79
97
|
}
|
|
80
98
|
(0, _inherits2["default"])(InputField, _Component);
|
|
@@ -93,29 +111,55 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
93
111
|
var _this$containerRef$cu;
|
|
94
112
|
(_this$containerRef$cu = this.containerRef.current) === null || _this$containerRef$cu === void 0 || _this$containerRef$cu.append(this.textarea);
|
|
95
113
|
this.handleValueOutChange();
|
|
114
|
+
var config = {
|
|
115
|
+
childList: true,
|
|
116
|
+
characterData: true,
|
|
117
|
+
subtree: true
|
|
118
|
+
};
|
|
119
|
+
if (this.props.onImmediatelyChange) {
|
|
120
|
+
this.observer.observe(this.textarea, config);
|
|
121
|
+
}
|
|
96
122
|
}
|
|
97
123
|
}, {
|
|
98
124
|
key: "componentDidUpdate",
|
|
99
125
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
100
126
|
var _this2 = this;
|
|
101
|
-
var _this$
|
|
102
|
-
value = _this$
|
|
103
|
-
errors = _this$
|
|
104
|
-
errorIndex = _this$
|
|
105
|
-
showErrors = _this$
|
|
106
|
-
disabled = _this$
|
|
107
|
-
readonly = _this$
|
|
108
|
-
highlightErrorIndex = _this$
|
|
109
|
-
lineProcessing = _this$
|
|
110
|
-
_this$
|
|
111
|
-
ariaDescribedby = _this$
|
|
127
|
+
var _this$props2 = this.props,
|
|
128
|
+
value = _this$props2.value,
|
|
129
|
+
errors = _this$props2.errors,
|
|
130
|
+
errorIndex = _this$props2.errorIndex,
|
|
131
|
+
showErrors = _this$props2.showErrors,
|
|
132
|
+
disabled = _this$props2.disabled,
|
|
133
|
+
readonly = _this$props2.readonly,
|
|
134
|
+
highlightErrorIndex = _this$props2.highlightErrorIndex,
|
|
135
|
+
lineProcessing = _this$props2.lineProcessing,
|
|
136
|
+
_this$props2$ariaDes = _this$props2['aria-describedby'],
|
|
137
|
+
ariaDescribedby = _this$props2$ariaDes === void 0 ? '' : _this$props2$ariaDes;
|
|
112
138
|
if (prevProps.value !== value) {
|
|
113
139
|
var currentValue = this.getValues().join(this.delimiter);
|
|
114
140
|
if (typeof value === 'string' ? value !== currentValue : value.join(this.delimiter) !== currentValue) {
|
|
115
141
|
this.handleValueOutChange();
|
|
116
142
|
}
|
|
117
143
|
}
|
|
118
|
-
if (prevProps.showErrors !== showErrors || prevProps.errors
|
|
144
|
+
if (prevProps.showErrors !== showErrors || prevProps.errors !== errors) {
|
|
145
|
+
if (showErrors) {
|
|
146
|
+
var errorsMap = new Map();
|
|
147
|
+
errors.forEach(function (error) {
|
|
148
|
+
errorsMap.set(error.lineIndex, error);
|
|
149
|
+
});
|
|
150
|
+
this.textarea.childNodes.forEach(function (node, index) {
|
|
151
|
+
if (node instanceof HTMLParagraphElement) {
|
|
152
|
+
var errorItem = errorsMap.get(index);
|
|
153
|
+
if (errorItem) {
|
|
154
|
+
node.setAttribute('aria-invalid', 'true');
|
|
155
|
+
node.dataset.errormessage = errorItem.errorMessage;
|
|
156
|
+
} else {
|
|
157
|
+
node.removeAttribute('aria-invalid');
|
|
158
|
+
node.dataset.errormessage = undefined;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
119
163
|
this.toggleAriaInvalid(showErrors, errors.length);
|
|
120
164
|
if (showErrors === false) {
|
|
121
165
|
this.textarea.setAttribute('aria-describedby', ariaDescribedby);
|
|
@@ -172,6 +216,7 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
172
216
|
key: "componentWillUnmount",
|
|
173
217
|
value: function componentWillUnmount() {
|
|
174
218
|
this.removeEventListeners(this.textarea);
|
|
219
|
+
this.observer.disconnect();
|
|
175
220
|
}
|
|
176
221
|
}, {
|
|
177
222
|
key: "isDisabled",
|
|
@@ -250,9 +295,9 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
250
295
|
}, {
|
|
251
296
|
key: "handleValueOutChange",
|
|
252
297
|
value: function handleValueOutChange() {
|
|
253
|
-
var _this$
|
|
254
|
-
value = _this$
|
|
255
|
-
onChangeLinesCount = _this$
|
|
298
|
+
var _this$props3 = this.props,
|
|
299
|
+
value = _this$props3.value,
|
|
300
|
+
onChangeLinesCount = _this$props3.onChangeLinesCount;
|
|
256
301
|
if (value === '') {
|
|
257
302
|
this.textarea.textContent = '';
|
|
258
303
|
onChangeLinesCount(0);
|
|
@@ -472,7 +517,7 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
472
517
|
this.toggleErrorsPopper('keyboardLineIndex', rowNode, 0);
|
|
473
518
|
}
|
|
474
519
|
var trigger = !isValid || isValid && errors.length === 1 && errors[0].lineNode === rowNode ? rowNode : this.textarea;
|
|
475
|
-
if (showErrors && ((_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.
|
|
520
|
+
if (showErrors && ((_this$popper = this.popper) === null || _this$popper === void 0 || (_this$popper = _this$popper.current) === null || _this$popper === void 0 ? void 0 : _this$popper.state.elements.reference) !== trigger) {
|
|
476
521
|
if (this.shouldChangePopperTrigger(trigger)) {
|
|
477
522
|
var _this$setPopperTrigge;
|
|
478
523
|
(_this$setPopperTrigge = this.setPopperTrigger) === null || _this$setPopperTrigge === void 0 || _this$setPopperTrigge.call(this, trigger);
|
|
@@ -667,11 +712,11 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
667
712
|
this.setSelection(this.textarea, 0, 0);
|
|
668
713
|
} else {
|
|
669
714
|
var isCleaning = false;
|
|
670
|
-
var
|
|
671
|
-
|
|
715
|
+
var _iterator2 = (0, _createForOfIteratorHelper2["default"])(paragraphs),
|
|
716
|
+
_step2;
|
|
672
717
|
try {
|
|
673
|
-
for (
|
|
674
|
-
var paragraph =
|
|
718
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
719
|
+
var paragraph = _step2.value;
|
|
675
720
|
if (paragraph === _anchorParagraph || isCleaning) {
|
|
676
721
|
isCleaning = true;
|
|
677
722
|
if (paragraph === _focusParagraph) {
|
|
@@ -684,9 +729,9 @@ var InputField = exports.InputField = /*#__PURE__*/function (_Component) {
|
|
|
684
729
|
}
|
|
685
730
|
}
|
|
686
731
|
} catch (err) {
|
|
687
|
-
|
|
732
|
+
_iterator2.e(err);
|
|
688
733
|
} finally {
|
|
689
|
-
|
|
734
|
+
_iterator2.f();
|
|
690
735
|
}
|
|
691
736
|
this.validateLine(currentNode);
|
|
692
737
|
}
|