@ballistix.digital/react-components 3.3.2 → 4.0.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/dist/index.d.ts +7 -1
- package/dist/index.esm.js +10 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { DeepPartialType } from 'types/DeepPartialType';
|
|
|
3
3
|
import { IconName } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { Placement } from '@floating-ui/react';
|
|
5
5
|
import { Menu } from '@headlessui/react';
|
|
6
|
+
import { AnchorProps } from '@headlessui/react/dist/internal/floating';
|
|
6
7
|
import { ColumnDef, SortingState, ColumnOrderState, Row, Table } from '@tanstack/react-table';
|
|
7
8
|
import { TButtonElementStyles as TButtonElementStyles$1 } from 'components/Element/Button';
|
|
8
9
|
import { TDropdownElementStyles as TDropdownElementStyles$1 } from 'components/Element/Dropdown';
|
|
@@ -159,7 +160,7 @@ type TProps$c = {
|
|
|
159
160
|
trigger?: ReactNode;
|
|
160
161
|
dataCy?: string;
|
|
161
162
|
type?: 'button' | 'compact';
|
|
162
|
-
direction?:
|
|
163
|
+
direction?: AnchorProps;
|
|
163
164
|
isEscapingOverflow?: boolean;
|
|
164
165
|
styles?: TDropdownElementStyles;
|
|
165
166
|
};
|
|
@@ -495,6 +496,11 @@ declare const base$e: {
|
|
|
495
496
|
container: string;
|
|
496
497
|
row: string;
|
|
497
498
|
checkbox: string;
|
|
499
|
+
column: {
|
|
500
|
+
pinned: {
|
|
501
|
+
cell: string;
|
|
502
|
+
};
|
|
503
|
+
};
|
|
498
504
|
cell: {
|
|
499
505
|
container: string;
|
|
500
506
|
text: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -11,7 +11,7 @@ import { fas } from '@fortawesome/pro-solid-svg-icons';
|
|
|
11
11
|
import { fat } from '@fortawesome/pro-thin-svg-icons';
|
|
12
12
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
13
|
import { useFloating, offset, flip, shift, arrow, autoUpdate, useHover, useFocus, useDismiss, useRole, useInteractions, FloatingArrow } from '@floating-ui/react';
|
|
14
|
-
import { Menu, Transition, Dialog, Popover, Switch as Switch$1 } from '@headlessui/react';
|
|
14
|
+
import { Menu, MenuButton, Transition, MenuItems, Dialog, Popover, Switch as Switch$1 } from '@headlessui/react';
|
|
15
15
|
import { useMask } from '@react-input/mask';
|
|
16
16
|
import { ViewColumnsIcon, ChevronDownIcon as ChevronDownIcon$1, TableCellsIcon, XMarkIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
17
17
|
import { useReactTable, getCoreRowModel, flexRender, createColumnHelper as createColumnHelper$1 } from '@tanstack/react-table';
|
|
@@ -730,18 +730,18 @@ var styles$r = {
|
|
|
730
730
|
};
|
|
731
731
|
|
|
732
732
|
var Container$3 = function (props) {
|
|
733
|
-
var children = props.children, label = props.label, trigger = props.trigger, dataCy = props.dataCy, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom
|
|
733
|
+
var children = props.children, label = props.label, trigger = props.trigger, dataCy = props.dataCy, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom end' : _b, _c = props.isEscapingOverflow, isEscapingOverflow = _c === void 0 ? false : _c, stylesOverrides = props.styles;
|
|
734
734
|
var handleGenerateStyle = function () {
|
|
735
735
|
var result = deepCopyObject(styles$q.base);
|
|
736
736
|
var keys = calculateNestedKeys(styles$q.base);
|
|
737
737
|
keys.forEach(function (key) {
|
|
738
|
-
set(result, key, toClassName(get(styles$q.base, key), type && get(styles$q[type], key),
|
|
738
|
+
set(result, key, toClassName(get(styles$q.base, key), type && get(styles$q[type], key), get(stylesOverrides, key)));
|
|
739
739
|
});
|
|
740
740
|
return result;
|
|
741
741
|
};
|
|
742
742
|
var styles = handleGenerateStyle();
|
|
743
743
|
return (jsxs(Menu, { as: "div", className: toClassName(styles.container, !isEscapingOverflow && 'relative'), children: [jsxs("div", { children: [type === 'button' &&
|
|
744
|
-
(!trigger ? (jsxs(
|
|
744
|
+
(!trigger ? (jsxs(MenuButton, { className: styles.button, "data-cy": dataCy, children: [label, jsx(ChevronDownIcon, { className: "-mr-1 ml-2 h-5 w-5", "aria-hidden": "true" })] })) : (jsx(MenuButton, { "data-cy": dataCy, children: trigger }))), type === 'compact' && (jsxs(MenuButton, { className: styles.compact, "data-cy": dataCy, children: [jsx("span", { className: "sr-only", children: label }), jsx(EllipsisVerticalIcon, { className: styles.dots, "aria-hidden": "true" })] }))] }), jsx(Transition, { as: Fragment$1, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95", children: jsx(MenuItems, { anchor: direction, className: styles.items, children: children }) })] }));
|
|
745
745
|
};
|
|
746
746
|
var DropdownElement = {
|
|
747
747
|
Container: Container$3,
|
|
@@ -6064,7 +6064,7 @@ var TableList2 = function (props) {
|
|
|
6064
6064
|
: ChevronDownIcon;
|
|
6065
6065
|
}
|
|
6066
6066
|
return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, 'border-b', header.column.getCanSort() && 'cursor-pointer', header.column.getIsPinned() &&
|
|
6067
|
-
styles.body.table.
|
|
6067
|
+
styles.body.table.head.column.pinned.cell), onClick: header.column.getToggleSortingHandler(), style: __assign$1({ minWidth: !!header.column.columnDef.size &&
|
|
6068
6068
|
header.column.columnDef.size !== 150
|
|
6069
6069
|
? "".concat(header.column.columnDef.size, "px")
|
|
6070
6070
|
: 'auto' }, getCommonPinningStyles(header.column)), children: jsxs("div", { className: "grid gap-x-1 items-center", style: {
|
|
@@ -6111,6 +6111,11 @@ var base$c = {
|
|
|
6111
6111
|
container: '',
|
|
6112
6112
|
row: '',
|
|
6113
6113
|
checkbox: 'absolute left-4 top-1/2 -mt-2 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500 sm:left-6',
|
|
6114
|
+
column: {
|
|
6115
|
+
pinned: {
|
|
6116
|
+
cell: 'bg-white sticky z-10 overflow-hidden text-ellipsis',
|
|
6117
|
+
},
|
|
6118
|
+
},
|
|
6114
6119
|
cell: {
|
|
6115
6120
|
container: ' py-3.5 px-3 text-left text-sm font-semibold text-gray-900 group',
|
|
6116
6121
|
text: 'whitespace-normal break-words',
|