@commonsku/styles 1.17.3 → 1.17.4
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.cjs +77 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +77 -9
- package/dist/index.mjs.map +1 -1
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/tables/SelectionTable.d.ts +8 -0
- package/dist/styles/tables/SelectionTable.d.ts.map +1 -0
- package/dist/styles/tables/VirtualTable.d.ts.map +1 -1
- package/dist/styles/tables/VirtualTableStyles.d.ts +1 -0
- package/dist/styles/tables/VirtualTableStyles.d.ts.map +1 -1
- package/dist/styles/tables/index.d.ts +1 -0
- package/dist/styles/tables/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2955,9 +2955,15 @@ declare const VirtualTableStyles: styled_components.StyledComponent<"div", any,
|
|
|
2955
2955
|
hoverRowBg?: string | boolean | undefined;
|
|
2956
2956
|
selectedRowIndex?: number | undefined;
|
|
2957
2957
|
selectedRowStyle?: boolean | CSSObject | undefined;
|
|
2958
|
+
scrollDecoration?: boolean | undefined;
|
|
2958
2959
|
}, never>;
|
|
2959
2960
|
//# sourceMappingURL=VirtualTableStyles.d.ts.map
|
|
2960
2961
|
|
|
2962
|
+
type SelectionTableProps = VirtualTableProps & {
|
|
2963
|
+
onSelectRow?: (row?: object, index?: number) => void;
|
|
2964
|
+
};
|
|
2965
|
+
declare const SelectionTable: (props: SelectionTableProps) => React__default.JSX.Element;
|
|
2966
|
+
|
|
2961
2967
|
type ResponsiveValue<T = string | number> = T | Array<T | null> | {
|
|
2962
2968
|
xs?: T;
|
|
2963
2969
|
sm?: T;
|
|
@@ -3896,4 +3902,4 @@ declare const Dropzone: React__default.ForwardRefExoticComponent<Pick<React__def
|
|
|
3896
3902
|
useDropzoneProps?: boolean | undefined;
|
|
3897
3903
|
} & React__default.RefAttributes<DropzoneRef>>;
|
|
3898
3904
|
|
|
3899
|
-
export { AddIcon, AddNoteIcon, AddShoppingCartIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, ArtworkProps, SKUAsyncSelect as AsyncSelect, Avatar, AvatarColor, AvatarShape, AvatarSize, AwaitingProofIcon, Backdrop, Background, Badge, BaseCskuProps, BotIcon, Box, BulletIcon, Button, ButtonPreset, ButtonProps, ButtonVariant, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarTaskProps, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, ColPropTypes, CollaborateIcon, CollapseStyled, CollapseStyledProps, CollapseWrapper, CollapseWrapperProps, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelProps, CollapsiblePanelTitle, CollapsiblePanelTitleProps, CollapsiblePanels, CollapsiblePanelsProps, CollapsibleProps$1 as CollapsibleProps, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CskuProps, CustomDateInput, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropAreaProps, DropDownContent, Dropdown, DropdownItem, DropdownProps, Dropzone, DropzoneProps, DropzoneTypes, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridItemProps, GridProps, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconButtonProps, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputProps, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCheckboxProps, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledRadioProps, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PopupProps, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, RadioProps, ReceiptLongIcon, RenderChild, ResponsiveTable, Row$1 as Row, RowPropTypes, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SharedStyleTypes, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableProps, SimpleWindowedTableStyles, SizerCss, SizerTypes, SizerWrapper, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG as SvgIcon, TBody, TButtonIcon, TD, TDropdownItem, TH, THSorted, THead, TR, TSize, TSizeOffset, TSizeOffsetRight, TSizeStyle, TTab, Tab, TabBar, Table, TableIcon, Tabs, TabsProps, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TaskProps, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, TextProp, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchProps, ToggleSwitchStatedProps, ToggleSwitchStyled, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
|
|
3905
|
+
export { AddIcon, AddNoteIcon, AddShoppingCartIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, ArtworkProps, SKUAsyncSelect as AsyncSelect, Avatar, AvatarColor, AvatarShape, AvatarSize, AwaitingProofIcon, Backdrop, Background, Badge, BaseCskuProps, BotIcon, Box, BulletIcon, Button, ButtonPreset, ButtonProps, ButtonVariant, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarTaskProps, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, ColPropTypes, CollaborateIcon, CollapseStyled, CollapseStyledProps, CollapseWrapper, CollapseWrapperProps, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelProps, CollapsiblePanelTitle, CollapsiblePanelTitleProps, CollapsiblePanels, CollapsiblePanelsProps, CollapsibleProps$1 as CollapsibleProps, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CskuProps, CustomDateInput, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropAreaProps, DropDownContent, Dropdown, DropdownItem, DropdownProps, Dropzone, DropzoneProps, DropzoneTypes, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridItemProps, GridProps, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconButtonProps, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputProps, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCheckboxProps, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledRadioProps, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PopupProps, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, RadioProps, ReceiptLongIcon, RenderChild, ResponsiveTable, Row$1 as Row, RowPropTypes, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SelectionTable, SharedStyleTypes, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableProps, SimpleWindowedTableStyles, SizerCss, SizerTypes, SizerWrapper, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG as SvgIcon, TBody, TButtonIcon, TD, TDropdownItem, TH, THSorted, THead, TR, TSize, TSizeOffset, TSizeOffsetRight, TSizeStyle, TTab, Tab, TabBar, Table, TableIcon, Tabs, TabsProps, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TaskProps, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, TextProp, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchProps, ToggleSwitchStatedProps, ToggleSwitchStyled, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -6603,6 +6603,8 @@ var VirtualTable = function (props) {
|
|
|
6603
6603
|
var _m = useTable(__assign({ columns: columns, data: data, defaultColumn: defaultColumn, initialState: __assign({}, (defaultSort ? { sortBy: [defaultSort] } : {})), onUpdateData: onUpdateData }, useTableProps), useFlexLayout, useSortBy, useExpanded), getTableProps = _m.getTableProps, getTableBodyProps = _m.getTableBodyProps, headerGroups = _m.headerGroups, footerGroups = _m.footerGroups, totalColumnsWidth = _m.totalColumnsWidth, prepareRow = _m.prepareRow, toggleAllRowsExpanded = _m.toggleAllRowsExpanded, tableData = __rest(_m, ["getTableProps", "getTableBodyProps", "headerGroups", "footerGroups", "totalColumnsWidth", "prepareRow", "toggleAllRowsExpanded"]);
|
|
6604
6604
|
var rows = useMemo(function () { return tableData.rows; }, [tableData.rows]);
|
|
6605
6605
|
var windowSize = useWindowSize();
|
|
6606
|
+
var _o = useState(false), scrolledToTop = _o[0], setScrolledToTop = _o[1];
|
|
6607
|
+
var _p = useState(false), scrolledToBottom = _p[0], setScrolledToBottom = _p[1];
|
|
6606
6608
|
var headerRef = useRef(null);
|
|
6607
6609
|
var footerRef = useRef(null);
|
|
6608
6610
|
var rowsRef = useRef(null);
|
|
@@ -6691,17 +6693,35 @@ var VirtualTable = function (props) {
|
|
|
6691
6693
|
], (headerGroupProps.className || "").split(' '), true), (headerGroup.className || "").split(' '), true).filter(function (v) { return v; }).join(' ');
|
|
6692
6694
|
return __assign(__assign({}, headerGroupProps), { style: headerStyles, className: headerClassNames });
|
|
6693
6695
|
};
|
|
6696
|
+
var handleScroll = useCallback(function (props) {
|
|
6697
|
+
if (onScroll != null) {
|
|
6698
|
+
onScroll(props);
|
|
6699
|
+
}
|
|
6700
|
+
var rows = rowsRef.current;
|
|
6701
|
+
if (rows != null) {
|
|
6702
|
+
setScrolledToTop(rows.scrollTop === 0);
|
|
6703
|
+
setScrolledToBottom(rows.scrollTop === rows.scrollHeight - rows.offsetHeight);
|
|
6704
|
+
}
|
|
6705
|
+
}, [onScroll]);
|
|
6694
6706
|
return (React.createElement("div", __assign({}, getTableProps(), { className: "table ".concat(className || '') }),
|
|
6695
6707
|
React.createElement("div", __assign({}, tableHeaderProps, { className: "thead ".concat(tableHeaderProps.className || ''), style: __assign(__assign({}, (tableHeaderProps.style || {})), (hideHeader ? { display: 'none' } : {})) }), headerGroups.map(function (headerGroup) { return (React.createElement("div", __assign({}, getHeaderGroupProps(headerGroup, false), { ref: headerRef, style: { width: tableWidth, } }), headerGroup.headers.map(function (column) { return (React.createElement("div", __assign({}, getHeaderProps(column, false), { className: "th", onClick: function () { return handleSort(column); } }),
|
|
6696
6708
|
column.render("Header"),
|
|
6697
|
-
React.createElement("span", null, column.
|
|
6709
|
+
React.createElement("span", null, column.canSort &&
|
|
6710
|
+
React.createElement(FilledChevronIcon, { direction: column.isSorted ? sortDirection(column) : 'updown', size: "medium", style: { verticalAlign: 'middle' } })))); }))); })),
|
|
6698
6711
|
React.createElement("div", __assign({ className: "tbody" }, getTableBodyProps()), rows.length === 0 && NoRowsFound ? React.createElement(NoRowsFound, null) :
|
|
6699
|
-
React.createElement(
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6712
|
+
React.createElement("div", { className: "scroll-container" },
|
|
6713
|
+
!scrolledToTop &&
|
|
6714
|
+
React.createElement("div", { className: "scroll-decoration-top" },
|
|
6715
|
+
React.createElement(DoubleArrowIcon, { direction: "up" })),
|
|
6716
|
+
React.createElement(VariableSizeList, { useIsScrolling: true, className: "table-list-rows", height: height, itemCount: rows.length, itemSize: function (i) {
|
|
6717
|
+
if (itemSize) {
|
|
6718
|
+
return itemSize({ row: rows[i], index: i });
|
|
6719
|
+
}
|
|
6720
|
+
return (rows[i] && rows[i].isExpanded ? 300 : 50) + gutterSize;
|
|
6721
|
+
}, width: tableWidth, onScroll: handleScroll, ref: listRef, outerRef: rowsRef }, RenderRow),
|
|
6722
|
+
!scrolledToBottom &&
|
|
6723
|
+
React.createElement("div", { className: "scroll-decoration-bottom" },
|
|
6724
|
+
React.createElement(DoubleArrowIcon, { direction: "down" })))),
|
|
6705
6725
|
!hideFooter ? React.createElement("div", __assign({}, tableFooterProps, { className: "table-footer-wrapper ".concat(tableFooterProps.className || '') }), footerGroups.map(function (footerGroup) { return (React.createElement("div", __assign({}, getHeaderGroupProps(footerGroup, true), { className: "table-footer tr", ref: footerRef }), footerGroup.headers.map(function (column) { return (React.createElement("div", __assign({}, getHeaderProps(column, true)), column.render("Footer"))); }))); })) : null,
|
|
6706
6726
|
TableFooter ? React.createElement(TableFooter, __assign({}, customTableFooterProps)) : null));
|
|
6707
6727
|
};
|
|
@@ -6715,9 +6735,57 @@ function sortDirection(col) {
|
|
|
6715
6735
|
return "updown";
|
|
6716
6736
|
}
|
|
6717
6737
|
|
|
6718
|
-
var VirtualTableStyles = styled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}"], ["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}"])), function (p) { return p.rowClickable ? "\n .tr {\n cursor: pointer;\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-spacing: 0;\n border: 1px solid black;\n " : ''; }, function (p) { return p.tableHeight ? "height: ".concat(p.tableHeight).concat(typeof p.tableHeight === 'number' ? 'px' : '', ";") : ''; }, function (p) { return p.bordered ? 'border-bottom: 1px solid #000;' : ''; }, function (p) { return p.bordered ? "\n :last-child {\n .td {\n border-bottom: 0;\n }\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-bottom: 1px solid black;\n border-right: 1px solid black;\n :last-child {\n border-right: 0;\n }\n " : ''; });
|
|
6738
|
+
var VirtualTableStyles = styled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}\n\n.scroll-container {\n position: relative;\n}\n\n.scroll-decoration-top, .scroll-decoration-bottom {\n", "\n}\n\n.scroll-decoration-top {\n background: linear-gradient(180deg, #DFEEF4 0%, rgba(166, 194, 198, 0.00) 100%);\n top: 0;\n}\n\n.scroll-decoration-bottom {\n background: linear-gradient(0deg, #DFEEF4 0%, rgba(166, 194, 198, 0.00) 100%);\n bottom: 0;\n}"], ["\npadding: 1rem;\n\n.table-list-rows {\n ", "\n}\n\n.table {\n display: inline-flex;\n flex-direction: column;\n ", "\n width: 100% !important;\n min-width: 100% !important;\n ", "\n\n .thead {\n padding-right: 15px;\n ", "\n\n .tr {\n overflow-x: hidden;\n min-width: 100%;\n }\n }\n\n .tbody {\n flex: 1 1 auto;\n height: 80vh;\n }\n\n .tr-group {\n display: flex;\n flex-direction: column;\n\n .tr, .tr-sub {\n width: 99%;\n }\n }\n\n .tr {\n display: flex;\n\n ", "\n }\n\n .tr.header {\n position: sticky;\n }\n\n .th,\n .td {\n margin: 0;\n padding: 0.5rem;\n ", "\n }\n}\n\n.scroll-container {\n position: relative;\n}\n\n.scroll-decoration-top, .scroll-decoration-bottom {\n", "\n}\n\n.scroll-decoration-top {\n background: linear-gradient(180deg, #DFEEF4 0%, rgba(166, 194, 198, 0.00) 100%);\n top: 0;\n}\n\n.scroll-decoration-bottom {\n background: linear-gradient(0deg, #DFEEF4 0%, rgba(166, 194, 198, 0.00) 100%);\n bottom: 0;\n}"])), function (p) { return p.rowClickable ? "\n .tr {\n cursor: pointer;\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-spacing: 0;\n border: 1px solid black;\n " : ''; }, function (p) { return p.tableHeight ? "height: ".concat(p.tableHeight).concat(typeof p.tableHeight === 'number' ? 'px' : '', ";") : ''; }, function (p) { return p.bordered ? 'border-bottom: 1px solid #000;' : ''; }, function (p) { return p.bordered ? "\n :last-child {\n .td {\n border-bottom: 0;\n }\n }\n " : ''; }, function (p) { return p.bordered ? "\n border-bottom: 1px solid black;\n border-right: 1px solid black;\n :last-child {\n border-right: 0;\n }\n " : ''; }, function (p) { return p.scrollDecoration ? "\n position: absolute;\n height: 48px;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 1000000000;\n pointer-events: none;\n" : "\n display: none;\n"; });
|
|
6719
6739
|
var templateObject_1$a;
|
|
6720
6740
|
|
|
6741
|
+
var SelectionTable = function (props) {
|
|
6742
|
+
var columns = props.columns, onSelectRow = props.onSelectRow;
|
|
6743
|
+
var _a = useState(props.data.map(function (row) { return (__assign({ selected: false }, row)); })), data = _a[0], setData = _a[1];
|
|
6744
|
+
var selectionState = useMemo(function () {
|
|
6745
|
+
return !data.some(function (row) { return row.selected === false; })
|
|
6746
|
+
? 'all'
|
|
6747
|
+
: data.some(function (row) { return row.selected === true; })
|
|
6748
|
+
? 'indeterminate'
|
|
6749
|
+
: 'none';
|
|
6750
|
+
}, [data]);
|
|
6751
|
+
var handleSelectHeader = useCallback(function () {
|
|
6752
|
+
switch (selectionState) {
|
|
6753
|
+
case 'none':
|
|
6754
|
+
setData(data.map(function (row) { return (__assign(__assign({}, row), { selected: true })); }));
|
|
6755
|
+
break;
|
|
6756
|
+
case 'all':
|
|
6757
|
+
case 'indeterminate':
|
|
6758
|
+
setData(data.map(function (row) { return (__assign(__assign({}, row), { selected: false })); }));
|
|
6759
|
+
break;
|
|
6760
|
+
}
|
|
6761
|
+
}, [data, selectionState]);
|
|
6762
|
+
var handleSelectRow = useCallback(function (rowIndex) {
|
|
6763
|
+
setData(function (prev) { return prev.map(function (row, index) {
|
|
6764
|
+
if (rowIndex !== index)
|
|
6765
|
+
return row;
|
|
6766
|
+
if (onSelectRow != null) {
|
|
6767
|
+
onSelectRow(row, rowIndex);
|
|
6768
|
+
}
|
|
6769
|
+
return __assign(__assign({}, row), { selected: rowIndex === index
|
|
6770
|
+
? !row.selected
|
|
6771
|
+
: row.selected });
|
|
6772
|
+
}); });
|
|
6773
|
+
}, [onSelectRow]);
|
|
6774
|
+
var selectionHeader = useMemo(function () { return (React.createElement(LabeledCheckbox, { label: "", checked: selectionState === 'all', indeterminate: selectionState === 'indeterminate', onChange: handleSelectHeader })); }, [selectionState, handleSelectHeader]);
|
|
6775
|
+
var selectionColumn = useMemo(function () { return ({
|
|
6776
|
+
Header: selectionHeader,
|
|
6777
|
+
accessor: 'selected',
|
|
6778
|
+
Cell: function (cellObj) {
|
|
6779
|
+
return (React.createElement(LabeledCheckbox, { label: "", checked: cellObj.row.original.selected, onChange: function () { return handleSelectRow(cellObj.row.index); } }));
|
|
6780
|
+
},
|
|
6781
|
+
sticky: 'left',
|
|
6782
|
+
noDrag: true,
|
|
6783
|
+
width: 40,
|
|
6784
|
+
disableSortBy: true,
|
|
6785
|
+
}); }, [handleSelectRow, selectionHeader]);
|
|
6786
|
+
return (React.createElement(VirtualTable, __assign({}, props, { columns: __spreadArray([selectionColumn], columns, true), data: data, minWidth: 40 })));
|
|
6787
|
+
};
|
|
6788
|
+
|
|
6721
6789
|
var psuedoSelectors = {
|
|
6722
6790
|
__after: '&:after',
|
|
6723
6791
|
__before: '&:before',
|
|
@@ -7743,5 +7811,5 @@ var Dropzone = React.forwardRef(function (_a, ref) {
|
|
|
7743
7811
|
React.createElement(RenderChild, { parseProps: parseChildProps }, children))));
|
|
7744
7812
|
});
|
|
7745
7813
|
|
|
7746
|
-
export { AddIcon, AddNoteIcon, AddShoppingCartIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, SKUAsyncSelect as AsyncSelect, Avatar, AwaitingProofIcon, Backdrop, Background, Badge, BotIcon, Box, BulletIcon, Button, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollaborateIcon, CollapseStyled, CollapseWrapper, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent$2 as DropDownContent, Dropdown, DropdownItem$2 as DropdownItem, Dropzone, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, RenderChild, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown$2 as StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG$1 as SvgIcon, TBody, TD$1 as TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchStyled, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper$4 as Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor$1 as getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
|
|
7814
|
+
export { AddIcon, AddNoteIcon, AddShoppingCartIcon, AddTaskIcon, AlertIcon, AlertNotification, ArrowIcon, Artwork, SKUAsyncSelect as AsyncSelect, Avatar, AwaitingProofIcon, Backdrop, Background, Badge, BotIcon, Box, BulletIcon, Button, ButtonsGroup, Calendar, CalendarDayBody, CalendarDaysBody, CalendarDaysHeader, CalendarIcon, CalendarTask, CalendarWrapper, CancelButton, ChangeRequestedIcon, ChatIcon, CheckMark, CheckboxIcon, CheckboxLabel, CheckmarkIcon, ChevronIcon, ChevronPopup, CircleProgressIcon, ClientApprovedIcon, ClipboardIcon, ClockIcon, Col, CollaborateIcon, CollapseStyled, CollapseWrapper, Collapsible$1 as Collapsible, CollapsibleArrowIcon, CollapsibleLabel, CollapsiblePanel, CollapsiblePanelTitle, CollapsiblePanels, Collapsible as CollapsibleV2, Collapsibles, Column, ColumnSelectIcon, CommentIcon, CommunityIcon, CompletedCheckmarkIcon, ConfirmAlertPopup, ConfirmPopup, ConnectedIcon, ConnectedPlusIcon, CouponIcon, SKUCreatableSelect as CreatableSelect, CreditCardIcon, Csku, CustomDateInput, Datepicker, DaysBodyWrapper, DefaultCalendarFooter, DefaultCalendarHeader, DefaultStar, DollarIcon, DoneButton, Dot, DoubleArrowIcon, DownloadIcon, DragIcon, DraggableTasksCalendar, DropArea, DropDownContent$2 as DropDownContent, Dropdown, DropdownItem$2 as DropdownItem, Dropzone, Dropzoned, DropzonedPreviews, EPOIcon, EditIcon, EllipsisIcon, EpsIcon, ErrorBoundary, EstimateCircleIcon, EyeIcon, FeedPost, FileUploadIcon, FilledChevronIcon, FolderIcon, GalleryIcon, GearIcon, GlobalStyle, Grid, GridCell, GridIcon, GridItem, GridRow, GridTable, GridTableContainer, H1, H2, H3, H4, H5, H6, HandleIcon, HeadlessTable, HelpIcon, HistoryIcon, IconButton, IconDoc, ImageIcon, Img, InfoIcon, Input, InputIconLabel, InputIconLabelContainer, InputStepper, InputStepperStyled, IntegrationsIcon, InventoryIcon, Label, LabeledAsyncSelect, LabeledCheckbox, LabeledCreatableSelect, LabeledIconInput, LabeledInput, LabeledMultiProgress, LabeledProgress, LabeledRadio, LabeledRadioGroup, LabeledRadioInButton, LabeledRadioInButtonGroup, LabeledSelect, LabeledTextarea, LightIndicator, Link, LinkWithIcon, ListIcon, Loading, LockIcon, MagicEraserIcon, MagicIcon, MailIcon, MarketingStatusIcon, MenuIcon, MultiProgress, NavConnectIcon, NavFinanceIcon, NavManagementIcon, NavProdIcon, NavResourcesIcon, NavSalesIcon, NoteIcon, Number$1 as Number, NumberInput, OpportunityCircleIcon, OrderStatusIcon, Overlay, Padding, Page, PanelContact, PanelTileContact, PendingApprovalIcon, PercentIcon, PinIcon, Popup, PopupHeader, PresentationCircleIcon, Product, Progress, PromostandardsIcon, ProofReceivedIcon, ProofingCompleteIcon, Publisher, Radio, RadioIcon, RadioLabel, ReceiptLongIcon, RenderChild, ResponsiveTable, Row, SHARED_STYLE_MAPS, SalesArrowIcon, SalesOrderCircleIcon, SearchIcon, SKUSelect as Select, SelectionTable, SharedStyles, ShopIcon, ShoppingCartIcon, ShowPopup, SidePanel, SimpleWindowedTable, SimpleWindowedTableStyles, SizerCss, SizerWrapper, SlideInIcon, Sparkles, Spinner, StarDarkIcon, StarIcon, StarLightIcon, StarRating, StateDropdown, StatusDropdown, StyledCalendarTaskBody, StyledDropArea, StyledDropdown$2 as StyledDropdown, StyledPanel, StyledTask, SubtractIcon, SVG$1 as SvgIcon, TBody, TD$1 as TD, TH, THSorted, THead, TR, Tab, TabBar, Table, TableIcon, Tabs, TargetIcon, Task, TaskBody, TaskIcon, TaskLabel, TaskName, TasksCalendar, TasksCalendarDayBody, TasksCalendarFooter, TemplateIcon, Text, Textarea, Theme, Thermometer, TilesIcon, Toggle, ToggleLink, ToggleSwitch, ToggleSwitchStyled, TrashIcon, TrendIcon, UploadIcon, UserIcon, UsersIcon, VirtualTable, VirtualTableStyles, Wrapper$4 as Wrapper, XIcon, colors, createMeasurementStyle, datepickerStyles, fontFamilies, fontStyles, fonts, getColor$1 as getColor, getFontStyle, getThemeColor, getThemeFontFamily, getThemeFontSize, getThemeFontStyle, getThemeProperty, parseCskuStyles, sizes, themeOptions, toggleSizes$1 as toggleSizes, useCalendar, useClickOutside, useDelayUnmount, useFallbackRef, useLongPress, usePrefersReducedMotion, useRandomInterval, useWindowSize };
|
|
7747
7815
|
//# sourceMappingURL=index.mjs.map
|