ab-ui-library 1.55.2 → 1.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AdvancedTable/Table.d.ts +1 -1
- package/components/AdvancedTable/Table.js +3 -2
- package/components/AdvancedTable/types.d.ts +1 -0
- package/components/MultiTextareaWithChips/MultiTextareaWithChips.js +12 -5
- package/components/MultiTextareaWithChips/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TTableProps } from './types';
|
|
2
2
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
-
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange, rowClassName, }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -111,7 +111,8 @@ function Table(_ref2) {
|
|
|
111
111
|
activeRowId = _ref2.activeRowId,
|
|
112
112
|
getRowId = _ref2.getRowId,
|
|
113
113
|
_ref2$resetExpandedOn = _ref2.resetExpandedOnPageChange,
|
|
114
|
-
resetExpandedOnPageChange = _ref2$resetExpandedOn === void 0 ? true : _ref2$resetExpandedOn
|
|
114
|
+
resetExpandedOnPageChange = _ref2$resetExpandedOn === void 0 ? true : _ref2$resetExpandedOn,
|
|
115
|
+
rowClassName = _ref2.rowClassName;
|
|
115
116
|
var _useState = useState(new Set()),
|
|
116
117
|
_useState2 = _slicedToArray(_useState, 2),
|
|
117
118
|
expandedRows = _useState2[0],
|
|
@@ -268,7 +269,7 @@ function Table(_ref2) {
|
|
|
268
269
|
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
269
270
|
key: row.id
|
|
270
271
|
}, /*#__PURE__*/React.createElement("tr", _extends({}, rowEventsProps, {
|
|
271
|
-
className: classNames({
|
|
272
|
+
className: classNames(rowClassName === null || rowClassName === void 0 ? void 0 : rowClassName(row), {
|
|
272
273
|
selected: row.getIsSelected(),
|
|
273
274
|
active: row.id == activeRowId
|
|
274
275
|
})
|
|
@@ -43,6 +43,7 @@ export type TTableProps<TData> = {
|
|
|
43
43
|
onPaginationChange?: (state: TPaginationState) => void;
|
|
44
44
|
getRowId?: (row: TData) => string;
|
|
45
45
|
resetExpandedOnPageChange?: boolean;
|
|
46
|
+
rowClassName?: (row: Row<TData>) => string | undefined;
|
|
46
47
|
};
|
|
47
48
|
export type Column<TData> = ColumnDef<TData> & {
|
|
48
49
|
enableColumnDragging?: boolean;
|
|
@@ -72,7 +72,9 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
72
72
|
formProps = _ref.formProps,
|
|
73
73
|
minChipLength = _ref.minChipLength,
|
|
74
74
|
maxChipLength = _ref.maxChipLength,
|
|
75
|
-
onBlurConfig = _ref.onBlurConfig
|
|
75
|
+
onBlurConfig = _ref.onBlurConfig,
|
|
76
|
+
_ref$transformToUpper = _ref.transformToUppercase,
|
|
77
|
+
transformToUppercase = _ref$transformToUpper === void 0 ? false : _ref$transformToUpper;
|
|
76
78
|
var _useState = useState(''),
|
|
77
79
|
_useState2 = _slicedToArray(_useState, 2),
|
|
78
80
|
inputValue = _useState2[0],
|
|
@@ -108,7 +110,8 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
108
110
|
var handleSelectOption = function handleSelectOption(option) {
|
|
109
111
|
if (chipManagement.getChipTexts().includes(option)) return;
|
|
110
112
|
try {
|
|
111
|
-
var
|
|
113
|
+
var valueToValidate = transformToUppercase ? option.toUpperCase() : option;
|
|
114
|
+
var validatedChip = chipValidation.createValidatedChip(valueToValidate);
|
|
112
115
|
chipManagement.addChip(validatedChip);
|
|
113
116
|
setInputValue('');
|
|
114
117
|
dropdownLogic.closeDropdown();
|
|
@@ -122,7 +125,8 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
122
125
|
var handleAddCustomValue = useCallback(function (value) {
|
|
123
126
|
if (chipManagement.getChipTexts().includes(value)) return;
|
|
124
127
|
try {
|
|
125
|
-
var
|
|
128
|
+
var valueToValidate = transformToUppercase ? value.toUpperCase() : value;
|
|
129
|
+
var validatedChip = chipValidation.createValidatedChip(valueToValidate);
|
|
126
130
|
chipManagement.addChip(validatedChip);
|
|
127
131
|
setInputValue('');
|
|
128
132
|
setChipError('');
|
|
@@ -131,7 +135,7 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
131
135
|
setChipError(error instanceof Error ? error.message : 'Invalid value');
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
|
-
}, [chipManagement, chipValidation, allowInvalidChips]);
|
|
138
|
+
}, [chipManagement, chipValidation, allowInvalidChips, transformToUppercase]);
|
|
135
139
|
var onBlurLogic = useOnBlurLogic({
|
|
136
140
|
inputValue: inputValue,
|
|
137
141
|
disabled: disabled,
|
|
@@ -154,6 +158,9 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
154
158
|
var handleInputChange = function handleInputChange(e) {
|
|
155
159
|
if (disabled) return;
|
|
156
160
|
var value = e.target.value;
|
|
161
|
+
if (transformToUppercase) {
|
|
162
|
+
value = value.toUpperCase();
|
|
163
|
+
}
|
|
157
164
|
setInputValue(value);
|
|
158
165
|
dropdownLogic.handleInputChange(value);
|
|
159
166
|
};
|
|
@@ -244,7 +251,7 @@ var MultiTextareaWithChipsComponent = function MultiTextareaWithChipsComponent(_
|
|
|
244
251
|
onFocus: handleInputFocus,
|
|
245
252
|
onBlur: handleInputBlur,
|
|
246
253
|
placeholder: inputPlaceholder,
|
|
247
|
-
className:
|
|
254
|
+
className: 'multi-textarea-chips__input',
|
|
248
255
|
disabled: disabled,
|
|
249
256
|
"aria-describedby": hasError ? "".concat(fieldName, "-error") : helperText ? "".concat(fieldName, "-helper") : undefined,
|
|
250
257
|
"aria-invalid": hasError ? 'true' : 'false',
|
|
@@ -30,6 +30,7 @@ export interface TMultiTextareaWithChipsProps extends IFormCompProps {
|
|
|
30
30
|
minChipLength?: number;
|
|
31
31
|
maxChipLength?: number;
|
|
32
32
|
searchPlaceholderText?: string;
|
|
33
|
+
transformToUppercase?: boolean;
|
|
33
34
|
typeAndEnterPlaceholderText?: string;
|
|
34
35
|
noOptionsPlaceholderText?: string;
|
|
35
36
|
fieldName?: string;
|