@semcore/bulk-textarea 16.6.2 → 17.0.0-prerelease.17
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 +4 -4
- package/lib/cjs/BulkTextarea.js +248 -269
- package/lib/cjs/BulkTextarea.js.map +1 -1
- package/lib/cjs/BulkTextarea.types.js.map +1 -1
- package/lib/cjs/components/ClearAll.js +9 -8
- package/lib/cjs/components/ClearAll.js.map +1 -1
- package/lib/cjs/components/Counter.js +12 -10
- package/lib/cjs/components/Counter.js.map +1 -1
- package/lib/cjs/components/ErrorsNavigation.js +22 -20
- package/lib/cjs/components/ErrorsNavigation.js.map +1 -1
- package/lib/cjs/components/InputField/InputField.js +916 -1045
- package/lib/cjs/components/InputField/InputField.js.map +1 -1
- package/lib/cjs/index.js +3 -3
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/BulkTextarea.js +242 -263
- package/lib/es6/BulkTextarea.js.map +1 -1
- package/lib/es6/BulkTextarea.types.js.map +1 -1
- package/lib/es6/components/ClearAll.js +8 -7
- package/lib/es6/components/ClearAll.js.map +1 -1
- package/lib/es6/components/Counter.js +7 -5
- package/lib/es6/components/Counter.js.map +1 -1
- package/lib/es6/components/ErrorsNavigation.js +15 -13
- package/lib/es6/components/ErrorsNavigation.js.map +1 -1
- package/lib/es6/components/InputField/InputField.js +910 -1040
- package/lib/es6/components/InputField/InputField.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/BulkTextarea.mjs +244 -223
- package/lib/esm/components/ClearAll.mjs +8 -7
- package/lib/esm/components/Counter.mjs +7 -2
- package/lib/esm/components/ErrorsNavigation.mjs +13 -2
- package/lib/esm/components/InputField/InputField.mjs +903 -981
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/types/BulkTextarea.types.d.ts +1 -1
- package/lib/types/components/InputField/InputField.d.ts +6 -2
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BulkTextarea.types.js","names":[],"sources":["../../src/BulkTextarea.types.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"BulkTextarea.types.js","names":[],"sources":["../../src/BulkTextarea.types.ts"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport type Button from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\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":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
1
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
3
2
|
import Button from '@semcore/button';
|
|
4
3
|
import { Root, sstyled } from '@semcore/core';
|
|
@@ -7,11 +6,13 @@ import React from 'react';
|
|
|
7
6
|
export function ClearAll(props) {
|
|
8
7
|
var _ref = arguments[0],
|
|
9
8
|
_ref2;
|
|
10
|
-
|
|
11
|
-
return !props.isHidden && (_ref2 = sstyled(props.styles), /*#__PURE__*/React.createElement(SButton, _ref2.cn("SButton",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const SButton = Button;
|
|
10
|
+
return !props.isHidden && (_ref2 = sstyled(props.styles), /*#__PURE__*/React.createElement(SButton, _ref2.cn("SButton", {
|
|
11
|
+
..._assignProps({
|
|
12
|
+
"theme": 'muted',
|
|
13
|
+
"use": 'tertiary',
|
|
14
|
+
"addonLeft": CloseM
|
|
15
|
+
}, _ref)
|
|
16
|
+
}), props.getI18nText('BulkTextarea.ClearAllButton.buttonText')));
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=ClearAll.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearAll.js","names":["Button","Root","sstyled","CloseM","React","ClearAll","props","_ref","arguments[0]","_ref2","SButton","isHidden","styles","createElement","cn","
|
|
1
|
+
{"version":3,"file":"ClearAll.js","names":["Button","Root","sstyled","CloseM","React","ClearAll","props","_ref","arguments[0]","_ref2","SButton","isHidden","styles","createElement","cn","_assignProps","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":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAAmCC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AAEvE,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,KAAK,MAAM,OAAO;AAEzB,OAAO,SAASC,QAAQA,CACtBC,KAA2F,EAC3F;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EACA,MAAMC,OAAO,GAIQV,MAAM;EAH3B,OACE,CAACM,KAAK,CAACK,QAAQ,KAAAF,KAAA,GACfP,OAAO,CAACI,KAAK,CAACM,MAAM,CAAC,eACnBR,KAAA,CAAAS,aAAA,CAACH,OAAO,EAAAD,KAAA,CAAAK,EAAA;IAAA,GAAAC,YAAA;MAAA,SAAuB,OAAO;MAAA,OAAK,UAAU;MAAA,aAAYZ;IAAM,GAAAI,IAAA;EAAA,IACpED,KAAK,CAACU,WAAW,CAAC,wCAAwC,CACpD,CAAC,CACX;AAEL","ignoreList":[]}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
2
|
+
import { ScreenReaderOnly } from '@semcore/base-components';
|
|
2
3
|
import { Root } from '@semcore/core';
|
|
3
4
|
import CounterKit from '@semcore/counter';
|
|
4
|
-
import { ScreenReaderOnly } from '@semcore/flex-box';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
export function Counter(props) {
|
|
7
7
|
var _ref = arguments[0];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const {
|
|
9
|
+
theme,
|
|
10
|
+
linesCount,
|
|
11
|
+
maxLines,
|
|
12
|
+
getI18nText
|
|
13
|
+
} = props;
|
|
12
14
|
return /*#__PURE__*/React.createElement(CounterKit, _assignProps({
|
|
13
15
|
"ml": 1,
|
|
14
16
|
"theme": theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Counter.js","names":["
|
|
1
|
+
{"version":3,"file":"Counter.js","names":["ScreenReaderOnly","Root","CounterKit","React","Counter","props","_ref","arguments[0]","theme","linesCount","maxLines","getI18nText","createElement","_assignProps","rowsNumber"],"sources":["../../../src/components/Counter.tsx"],"sourcesContent":["import { ScreenReaderOnly } from '@semcore/base-components';\nimport { Root } from '@semcore/core';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\nimport CounterKit, { type CounterProps as CounterPropsKit } from '@semcore/counter';\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,SAASA,gBAAgB,QAAQ,0BAA0B;AAC3D,SAASC,IAAI,QAAQ,eAAe;AAEpC,OAAOC,UAAU,MAAgD,kBAAkB;AACnF,OAAOC,KAAK,MAAM,OAAO;AASzB,OAAO,SAASC,OAAOA,CAACC,KAAmB,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;EAC3C,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAGN,KAAK;EAE1D,oBACEF,KAAA,CAAAS,aAAA,CAAcV,UAAU,EAAAW,YAAA;IAAA,MAAM,CAAC;IAAA,SAASL;EAAK,GAAAF,IAAA,GAC1CG,UAAU,eACXN,KAAA,CAAAS,aAAA;IAAM,eAAY;EAAM,GAAC,GAEvB,EAACF,QACG,CAAC,eACPP,KAAA,CAAAS,aAAA,CAACZ,gBAAgB,QACdW,WAAW,CAAC,+CAA+C,EAAE;IAAEG,UAAU,EAAEJ;EAAS,CAAC,CACtE,CAAC,EAClBF,KAAK,KAAK,SAAS,iBAClBL,KAAA,CAAAS,aAAA,CAACZ,gBAAgB,QACdW,WAAW,CAAC,8CAA8C,CAC3C,CACnB,EACAH,KAAK,KAAK,QAAQ,iBACjBL,KAAA,CAAAS,aAAA,CAACZ,gBAAgB,QACdW,WAAW,CAAC,+CAA+C,CAC5C,CAEhB,CAAC;AAEX","ignoreList":[]}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import { Flex } from '@semcore/base-components';
|
|
1
2
|
import Button from '@semcore/button';
|
|
2
|
-
import { Flex } from '@semcore/flex-box';
|
|
3
3
|
import ChevronDownM from '@semcore/icon/ChevronDown/m';
|
|
4
4
|
import ChevronUpM from '@semcore/icon/ChevronUp/m';
|
|
5
5
|
import { Text } from '@semcore/typography';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
export function ErrorsNavigation(props) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
const {
|
|
9
|
+
errorIndex,
|
|
10
|
+
errorsCount,
|
|
11
|
+
onPrevError,
|
|
12
|
+
onNextError,
|
|
13
|
+
size,
|
|
14
|
+
showErrors,
|
|
15
|
+
getI18nText,
|
|
16
|
+
disabled,
|
|
17
|
+
nextButtonRef,
|
|
18
|
+
prevButtonRef
|
|
19
|
+
} = props;
|
|
18
20
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
19
21
|
alignItems: "center"
|
|
20
22
|
}, errorsCount > 0 && showErrors && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -41,10 +43,10 @@ export function ErrorsNavigation(props) {
|
|
|
41
43
|
ml: 1,
|
|
42
44
|
disabled: disabled
|
|
43
45
|
}, errorIndex === -1 ? getI18nText('BulkTextarea.ErrorsNavigation.totalErrors', {
|
|
44
|
-
errorsCount
|
|
46
|
+
errorsCount
|
|
45
47
|
}) : getI18nText('BulkTextarea.ErrorsNavigation.selectedError', {
|
|
46
48
|
errorIndex: errorIndex + 1,
|
|
47
|
-
errorsCount
|
|
49
|
+
errorsCount
|
|
48
50
|
}))));
|
|
49
51
|
}
|
|
50
52
|
//# sourceMappingURL=ErrorsNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorsNavigation.js","names":["
|
|
1
|
+
{"version":3,"file":"ErrorsNavigation.js","names":["Flex","Button","ChevronDownM","ChevronUpM","Text","React","ErrorsNavigation","props","errorIndex","errorsCount","onPrevError","onNextError","size","showErrors","getI18nText","disabled","nextButtonRef","prevButtonRef","createElement","alignItems","Fragment","onClick","addonLeft","use","theme","hintPlacement","ref","color","ml"],"sources":["../../../src/components/ErrorsNavigation.tsx"],"sourcesContent":["import { Flex } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';\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,SAASA,IAAI,QAAQ,0BAA0B;AAC/C,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,OAAOC,YAAY,MAAM,6BAA6B;AACtD,OAAOC,UAAU,MAAM,2BAA2B;AAClD,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,KAAK,MAAM,OAAO;AAezB,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,MAAM;IACJC,UAAU;IACVC,WAAW;IACXC,WAAW;IACXC,WAAW;IACXC,IAAI;IACJC,UAAU;IACVC,WAAW;IACXC,QAAQ;IACRC,aAAa;IACbC;EACF,CAAC,GAAGV,KAAK;EACT,oBACEF,KAAA,CAAAa,aAAA,CAAClB,IAAI;IAACmB,UAAU,EAAC;EAAQ,GACtBV,WAAW,GAAG,CAAC,IAAII,UAAU,iBAC5BR,KAAA,CAAAa,aAAA,CAAAb,KAAA,CAAAe,QAAA,qBACEf,KAAA,CAAAa,aAAA,CAACjB,MAAM;IACLoB,OAAO,EAAEV,WAAY;IACrBW,SAAS,EAAEpB,YAAa;IACxBqB,GAAG,EAAC,UAAU;IACdC,KAAK,EAAC,OAAO;IACb,cAAYV,WAAW,CAAC,oDAAoD,CAAE;IAC9EW,aAAa,EAAC,QAAQ;IACtBV,QAAQ,EAAEA,QAAS;IACnBW,GAAG,EAAEV;EAAc,CACpB,CAAC,eACFX,KAAA,CAAAa,aAAA,CAACjB,MAAM;IACLoB,OAAO,EAAEX,WAAY;IACrBY,SAAS,EAAEnB,UAAW;IACtBoB,GAAG,EAAC,UAAU;IACdC,KAAK,EAAC,OAAO;IACb,cAAYV,WAAW,CAAC,wDAAwD,CAAE;IAClFW,aAAa,EAAC,QAAQ;IACtBV,QAAQ,EAAEA,QAAS;IACnBW,GAAG,EAAET;EAAc,CACpB,CAAC,eACFZ,KAAA,CAAAa,aAAA,CAACd,IAAI;IAACQ,IAAI,EAAEA,IAAI,KAAK,GAAG,GAAG,GAAG,GAAG,GAAI;IAACe,KAAK,EAAC,eAAe;IAACC,EAAE,EAAE,CAAE;IAACb,QAAQ,EAAEA;EAAS,GACnFP,UAAU,KAAK,CAAC,CAAC,GACdM,WAAW,CAAC,2CAA2C,EAAE;IAAEL;EAAY,CAAC,CAAC,GACzEK,WAAW,CAAC,6CAA6C,EAAE;IACzDN,UAAU,EAAEA,UAAU,GAAG,CAAC;IAC1BC;EACF,CAAC,CACD,CACN,CAEA,CAAC;AAEX","ignoreList":[]}
|