@ballistix.digital/react-components 0.4.14 → 0.4.16

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/dist/index.d.ts CHANGED
@@ -261,6 +261,7 @@ type TTableListProps<TData> = {
261
261
  current: number;
262
262
  }) => ReactNode;
263
263
  type?: 'normal' | 'panel' | 'full';
264
+ isLoading?: boolean;
264
265
  isStriped?: boolean;
265
266
  hasStickyHeader?: boolean;
266
267
  hasVerticalSeparators?: boolean;
package/dist/index.esm.js CHANGED
@@ -537,7 +537,7 @@ var InputGroupForm = function (props) {
537
537
  };
538
538
  var styles = handleGenerateStyle();
539
539
  var invalidIcon = (jsx(ExclamationCircleIcon, { className: "h-5 w-5 text-red-500", "aria-hidden": "true" }));
540
- return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: styles.head }, { children: [label && (jsx("label", __assign({ htmlFor: name, className: styles.label }, { children: label }))), !required && !isRequired && typeof label === 'string' && (jsx("span", __assign({ className: styles.hint }, { children: "Optional" }))), required && required({ isRequired: isRequired })] })), jsxs("div", __assign({ className: styles.body }, { children: [leading && jsx("div", __assign({ className: styles.leading }, { children: leading })), jsx("input", { type: mask !== '' ? 'text' : htmlType, ref: mask && ref, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), type === 'floored' && (jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsx("div", __assign({ className: styles.trailing }, { children: trailing }))), isTouched && !isValid && (jsx("div", __assign({ className: styles.trailing }, { children: invalidIcon })))] })), jsxs("div", __assign({ className: styles.foot }, { children: [description && !error && (jsx("p", __assign({ className: styles.description }, { children: description }))), error && isTouched && jsx("p", __assign({ className: styles.error }, { children: error }))] }))] })));
540
+ return (jsxs("div", __assign({ className: styles.container }, { children: [jsxs("div", __assign({ className: styles.head }, { children: [label && (jsx("label", __assign({ htmlFor: name, className: styles.label }, { children: label }))), !required && !isRequired && typeof label === 'string' && (jsx("span", __assign({ className: styles.hint }, { children: "Optional" }))), required && required({ isRequired: isRequired })] })), jsxs("div", __assign({ className: styles.body }, { children: [leading && jsx("div", __assign({ className: styles.leading }, { children: leading })), jsx("input", { type: mask !== '' ? 'text' : htmlType, ref: mask && ref, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), type === 'floored' && (jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsx("div", __assign({ className: styles.trailing }, { children: trailing }))), isTouched && !isValid && (jsx("div", __assign({ className: styles.trailing }, { children: invalidIcon })))] })), jsxs("div", __assign({ className: styles.foot }, { children: [description && !(error && isTouched) && (jsx("p", __assign({ className: styles.description }, { children: description }))), error && isTouched && jsx("p", __assign({ className: styles.error }, { children: error }))] }))] })));
541
541
  };
542
542
 
543
543
  var base$d = {
@@ -16897,7 +16897,7 @@ var styles$8 = {
16897
16897
  };
16898
16898
 
16899
16899
  var TableList = function (props) {
16900
- var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
16900
+ var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, _a = props.type, type = _a === void 0 ? 'normal' : _a, isLoading = props.isLoading, _b = props.isStriped, isStriped = _b === void 0 ? false : _b, _c = props.hasStickyHeader, hasStickyHeader = _c === void 0 ? false : _c, _d = props.hasVerticalSeparators, hasVerticalSeparators = _d === void 0 ? false : _d, _e = props.areControlsVisible, areControlsVisible = _e === void 0 ? true : _e, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
16901
16901
  var write = useExcel().write;
16902
16902
  var handleGenerateStyle = function () {
16903
16903
  var result = deepCopyObject(styles$7.base);
@@ -17037,20 +17037,21 @@ var TableList = function (props) {
17037
17037
  : { container: '!py-1.5 !px-3' }, onClick: function () {
17038
17038
  var sheets = handleCalculateSheets();
17039
17039
  write(sheets, { fileName: 'users-export' });
17040
- } }, { children: jsx(TableCellsIcon, { className: "w-6 h-6" }) }))] })), jsx("div", __assign({ className: styles.body.container }, { children: jsx("div", __assign({ className: styles.body.wrapper }, { children: jsx("div", __assign({ className: styles.body.content }, { children: jsx("div", __assign({ className: styles.body.styleWrapper }, { children: jsxs("table", __assign({ className: styles.body.table.container, style: hasStickyHeader ? { borderSpacing: 0 } : {} }, { children: [jsx("thead", __assign({ className: styles.body.table.head.container }, { children: table === null || table === void 0 ? void 0 : table.getHeaderGroups().map(function (headerGroup) { return (jsx("tr", { children: headerGroup.headers.map(function (header) { return (jsxs("th", __assign({ colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell, header.column.getCanSort() && 'cursor-pointer'), onClick: header.column.getToggleSortingHandler() }, { children: [header.isPlaceholder
17041
- ? null
17042
- : flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanSort() && (jsx("span", __assign({ className: toClassName(styles.sortIndicator.container, header.column.getIsSorted()
17043
- ? styles.sortIndicator.isSorted
17044
- : styles.sortIndicator.isNotSorted) }, { children: jsx(ChevronDownIcon$1, { className: toClassName(styles.sortIndicator.icon.container, header.column.getIsSorted() === 'asc' &&
17045
- '-scale-100'), "aria-hidden": "true" }) })))] }), header.id)); }) }, headerGroup.id)); }) })), jsx("tbody", __assign({ className: styles.body.table.body.container }, { children: table === null || table === void 0 ? void 0 : table.getRowModel().rows.map(function (row, index) { return (jsx("tr", __assign({ className: toClassName(styles.body.table.body.row, isStriped && index % 2 === 0 && 'bg-gray-50') }, { children: row.getVisibleCells().map(function (cell) {
17046
- var _a, _b;
17047
- return (jsx("td", __assign({ className: toClassName(styles.body.table.body.cell, hasStickyHeader &&
17048
- index !==
17049
- ((_b = (_a = table === null || table === void 0 ? void 0 : table.getState()) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.pageSize) - 1 &&
17050
- 'border-b border-gray-200') }, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
17051
- }) }), row.id)); }) }))] })) })) })) })) })), jsx(PanelPaginationNavigation, __assign({ max: page.total, styles: (stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation)
17040
+ } }, { children: jsx(TableCellsIcon, { className: "w-6 h-6" }) }))] })), jsx("div", __assign({ className: styles.body.container }, { children: jsx("div", __assign({ className: styles.body.wrapper }, { children: jsx("div", __assign({ className: styles.body.content }, { children: jsxs("div", __assign({ className: styles.body.styleWrapper }, { children: [isLoading && (jsx("div", __assign({ className: "flex flex-col gap-y-2" }, { children: new Array(8).fill(undefined).map(function (index) { return (jsx("div", { className: "w-full h-14 rounded-md bg-gray-100 animate-pulse" }, index)); }) }))), !isLoading && (jsxs("table", __assign({ className: styles.body.table.container, style: hasStickyHeader ? { borderSpacing: 0 } : {} }, { children: [jsx("thead", __assign({ className: styles.body.table.head.container }, { children: table === null || table === void 0 ? void 0 : table.getHeaderGroups().map(function (headerGroup) { return (jsx("tr", { children: headerGroup.headers.map(function (header) { return (jsxs("th", __assign({ colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell, header.column.getCanSort() && 'cursor-pointer'), onClick: header.column.getToggleSortingHandler() }, { children: [header.isPlaceholder
17041
+ ? null
17042
+ : flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanSort() && (jsx("span", __assign({ className: toClassName(styles.sortIndicator.container, header.column.getIsSorted()
17043
+ ? styles.sortIndicator.isSorted
17044
+ : styles.sortIndicator.isNotSorted) }, { children: jsx(ChevronDownIcon$1, { className: toClassName(styles.sortIndicator.icon.container, header.column.getIsSorted() === 'asc' &&
17045
+ '-scale-100'), "aria-hidden": "true" }) })))] }), header.id)); }) }, headerGroup.id)); }) })), jsx("tbody", __assign({ className: styles.body.table.body.container }, { children: table === null || table === void 0 ? void 0 : table.getRowModel().rows.map(function (row, index) { return (jsx("tr", __assign({ className: toClassName(styles.body.table.body.row, isStriped && index % 2 === 0 && 'bg-gray-50') }, { children: row.getVisibleCells().map(function (cell) {
17046
+ var _a, _b;
17047
+ return (jsx("td", __assign({ className: toClassName(styles.body.table.body.cell, hasStickyHeader &&
17048
+ index !==
17049
+ ((_b = (_a = table === null || table === void 0 ? void 0 : table.getState()) === null || _a === void 0 ? void 0 : _a.pagination) === null || _b === void 0 ? void 0 : _b.pageSize) -
17050
+ 1 &&
17051
+ 'border-b border-gray-200') }, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
17052
+ }) }), row.id)); }) }))] })))] })) })) })) })), !isLoading && (jsx(PanelPaginationNavigation, __assign({ max: page.total, styles: (stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation)
17052
17053
  ? stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.components.panelPaginationNavigation
17053
- : { container: 'mt-4' }, onChange: onPaginate }, { children: children }))] })) }));
17054
+ : { container: 'mt-4' }, onChange: onPaginate }, { children: children })))] })) }));
17054
17055
  };
17055
17056
 
17056
17057
  var base$6 = {