@cwellt_software/cwellt-reactjs-lib 1.4.6 → 1.4.8
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.js +90 -101
- package/dist/index.css +2 -2
- package/dist/index.d.ts +13 -8
- package/dist/index.es.js +90 -101
- package/dist/src/components/control/choice/multi-filter/CwMultiFilter.d.ts.map +1 -1
- package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizesTemporal.d.ts +9 -0
- package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizesTemporal.d.ts.map +1 -0
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts +7 -7
- package/dist/src/components/custom/super-scheduler/SuperScheduler.d.ts.map +1 -1
- package/dist/src/components/layout/card/CwCard.d.ts +5 -2
- package/dist/src/components/layout/card/CwCard.d.ts.map +1 -1
- package/dist/src/components/layout/card/CwCardList.d.ts +3 -1
- package/dist/src/components/layout/card/CwCardList.d.ts.map +1 -1
- package/dist/src/playground/pages/CardListPage.d.ts +3 -0
- package/dist/src/playground/pages/CardListPage.d.ts.map +1 -0
- package/dist/test/components/custom/new-scheduler/presentation/logic/getEventSizesTemporal.test.d.ts +2 -0
- package/dist/test/components/custom/new-scheduler/presentation/logic/getEventSizesTemporal.test.d.ts.map +1 -0
- package/dist/test/vitest.setup.d.ts +1 -0
- package/dist/test/vitest.setup.d.ts.map +1 -1
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
|
@@ -624,7 +624,7 @@ interface CwCardProps {
|
|
|
624
624
|
title?: ReactNode;
|
|
625
625
|
/*** Card subtitle content **/
|
|
626
626
|
subtitle?: ReactNode;
|
|
627
|
-
|
|
627
|
+
/** @deprecated Use layout.align instead ("left" → "start", "center" → "center") **/
|
|
628
628
|
alignment?: "center" | "left";
|
|
629
629
|
/*** Main content of the card **/
|
|
630
630
|
children: ReactNode;
|
|
@@ -652,8 +652,10 @@ interface CwCardProps {
|
|
|
652
652
|
chips?: CardChip[];
|
|
653
653
|
/*** Variant design **/
|
|
654
654
|
variant?: "border" | "shadow";
|
|
655
|
-
|
|
655
|
+
/** @deprecated Use layout.direction instead **/
|
|
656
656
|
direction?: "column" | "row";
|
|
657
|
+
/** Card layout: direction controls card flex direction; align controls header content alignment **/
|
|
658
|
+
layout?: CwLayoutProps;
|
|
657
659
|
}
|
|
658
660
|
/**
|
|
659
661
|
* CwCard - A simple card component for displaying content in a contained format
|
|
@@ -701,8 +703,10 @@ interface CwCardListProps<T> extends React__default.HTMLAttributes<HTMLDivElemen
|
|
|
701
703
|
sortOptions?: SortOption<T>[];
|
|
702
704
|
/** Default sort key */
|
|
703
705
|
defaultSortKey?: string;
|
|
706
|
+
/** Extracts a stable unique key from each item to avoid index-based reconciliation bugs */
|
|
707
|
+
keyExtractor?: (item: T, index: number) => string | number;
|
|
704
708
|
}
|
|
705
|
-
declare function CwCardList<T>({ items, renderCard, pageSize, layout, defaultCardWidth, cardGap, isLoading, emptyState, sortOptions, defaultSortKey, ...htmlProps }: CwCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
709
|
+
declare function CwCardList<T>({ items, renderCard, pageSize, layout, defaultCardWidth, cardGap, isLoading, emptyState, sortOptions, defaultSortKey, keyExtractor, ...htmlProps }: CwCardListProps<T>): react_jsx_runtime.JSX.Element;
|
|
706
710
|
|
|
707
711
|
interface CwAccordionContainerProps {
|
|
708
712
|
children?: any;
|
|
@@ -3274,21 +3278,22 @@ interface PinRowHeaderProps extends RowHeaderDm {
|
|
|
3274
3278
|
}
|
|
3275
3279
|
declare const PinRowHeader: FC<RowHeaderProps<PinRowHeaderProps>>;
|
|
3276
3280
|
|
|
3277
|
-
interface SuperSchedulerProps {
|
|
3281
|
+
interface SuperSchedulerProps<T extends PinRowHeaderProps> {
|
|
3278
3282
|
id: string;
|
|
3279
3283
|
state: SchedulerState;
|
|
3280
3284
|
header: SchedulerHeaderContent;
|
|
3281
|
-
rows:
|
|
3285
|
+
rows: T[];
|
|
3286
|
+
headerColumnComp: React.ComponentType<RowHeaderProps<T>>;
|
|
3282
3287
|
events: SchedulerEventDm[];
|
|
3283
3288
|
backgroundEvents: BackgroundEventDm[];
|
|
3284
3289
|
indicatorRows?: IndicatorRowDm[];
|
|
3285
3290
|
contextMenuItems: MenuOption[];
|
|
3286
|
-
pinnedOrderCategory?: OrderCategory<
|
|
3287
|
-
unPinnedOrderCategory?: OrderCategory<
|
|
3291
|
+
pinnedOrderCategory?: OrderCategory<T>[];
|
|
3292
|
+
unPinnedOrderCategory?: OrderCategory<T>[];
|
|
3288
3293
|
onEvent: OnEvent;
|
|
3289
3294
|
rowHeightRem?: number;
|
|
3290
3295
|
}
|
|
3291
|
-
declare const SuperScheduler:
|
|
3296
|
+
declare const SuperScheduler: <T extends PinRowHeaderProps>({ id, state, header, rows, events, headerColumnComp, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, indicatorRows, contextMenuItems, onEvent, rowHeightRem }: SuperSchedulerProps<T>) => react_jsx_runtime.JSX.Element;
|
|
3292
3297
|
|
|
3293
3298
|
declare class OnPinRow implements UiEvent {
|
|
3294
3299
|
readonly id: string;
|
package/dist/index.es.js
CHANGED
|
@@ -1737,7 +1737,9 @@ var styles$n = {"card":"cw-card-module__card__HJUT0","clickable":"cw-card-module
|
|
|
1737
1737
|
* <p>This is the main content of the card.</p>
|
|
1738
1738
|
* </CwCard>
|
|
1739
1739
|
**/
|
|
1740
|
-
const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, disabled = false, style, chips = [], variant = "border", direction = "column", }) => {
|
|
1740
|
+
const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, onEdit, onDelete, extraActions, className = '', clickable = false, onClick, isLoading = false, disabled = false, style, chips = [], variant = "border", direction = "column", layout, }) => {
|
|
1741
|
+
const resolvedDirection = layout?.direction ?? direction;
|
|
1742
|
+
const resolvedAlign = layout?.align ?? (alignment === 'left' ? 'start' : 'center');
|
|
1741
1743
|
// Construct class names using CSS modules
|
|
1742
1744
|
const cardClassNames = [
|
|
1743
1745
|
'cw-card',
|
|
@@ -1756,23 +1758,77 @@ const CwCard = ({ id, title, subtitle, alignment = 'center', children, footer, o
|
|
|
1756
1758
|
// Determine if actions should be rendered
|
|
1757
1759
|
const hasActions = onEdit || onDelete || extraActions;
|
|
1758
1760
|
// Determine if header should be rendered
|
|
1759
|
-
const hasHeader = title || subtitle || (hasActions &&
|
|
1761
|
+
const hasHeader = title || subtitle || (hasActions && resolvedDirection === "column");
|
|
1760
1762
|
// Determine if chips should be rendered
|
|
1761
1763
|
const hasChips = chips.length > 0;
|
|
1762
1764
|
// Determine if footer should be rendered
|
|
1763
|
-
const hasFooter = hasChips || footer || (hasActions &&
|
|
1765
|
+
const hasFooter = hasChips || footer || (hasActions && resolvedDirection === "row");
|
|
1764
1766
|
// Actions component to reuse
|
|
1765
1767
|
const ActionsComponent = hasActions && !disabled ? (jsxs("div", { className: styles$n.actions, children: [extraActions ?? null, onEdit && jsx(CwButton, { variant: "icon", icon: "edit", onClick: onEdit }), onDelete && jsx(CwButton, { variant: "icon", icon: "delete", color: "danger", onClick: onDelete })] })) : null;
|
|
1766
1768
|
return (jsxs("div", { ...(id && { id }), className: cardClassNames, ...(style && { style }), ...(clickable && {
|
|
1767
1769
|
role: 'button',
|
|
1768
1770
|
tabIndex: 0,
|
|
1769
1771
|
onClick: handleClick,
|
|
1770
|
-
}), "data-variant": variant, "data-direction":
|
|
1772
|
+
}), "data-variant": variant, "data-direction": resolvedDirection, children: [hasHeader && (jsxs("header", { children: [(title || subtitle) && (jsxs("div", { className: styles$n.headerContent, "data-align": resolvedAlign, children: [title && jsx("h5", { children: title }), subtitle && jsx("strong", { children: subtitle })] })), resolvedDirection === "column" && ActionsComponent] })), jsx("div", { className: styles$n.content, children: children }), hasFooter && (jsxs("footer", { children: [hasChips && (jsx("div", { className: styles$n.footerTags, children: chips.map((chip, index) => (jsx(CwChip, { label: chip.label, colorScheme: chip.colorScheme, className: styles$n.chip, ...(chip.customColor && { customColor: chip.customColor }), ...(chip.variant && { variant: chip.variant }), ...(chip.icon && { icon: chip.icon }) }, index))) })), footer && (jsx("div", { className: styles$n.footerContent, children: footer }))] })), resolvedDirection === "row" && ActionsComponent, isLoading && (jsx("div", { className: styles$n.loadingOverlay, children: jsx(CwLoading, { isLoading: isLoading, size: "small" }) }))] }));
|
|
1771
1773
|
};
|
|
1772
1774
|
|
|
1773
|
-
var styles$m = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","loading":"cw-card-list-module__loading__cYpND","emptyState":"cw-card-list-module__emptyState__RlqiS"
|
|
1775
|
+
var styles$m = {"cardContainer":"cw-card-list-module__cardContainer__l3YEh","pagination":"cw-card-list-module__pagination__5Ay78","pageInfo":"cw-card-list-module__pageInfo__uiMel","loading":"cw-card-list-module__loading__cYpND","emptyState":"cw-card-list-module__emptyState__RlqiS"};
|
|
1774
1776
|
|
|
1775
|
-
|
|
1777
|
+
/**
|
|
1778
|
+
* Option to display in the CwSelect
|
|
1779
|
+
* @remarks
|
|
1780
|
+
* Must be child of CwSelect
|
|
1781
|
+
* @example
|
|
1782
|
+
* <CwSelect>
|
|
1783
|
+
* <CwOption>A</CwOption>
|
|
1784
|
+
* <CwOption color="#4a90d9">Blue option</CwOption>
|
|
1785
|
+
* <CwOption>C</CwOption>
|
|
1786
|
+
* </CwSelect>
|
|
1787
|
+
*/
|
|
1788
|
+
function CwOption(props) {
|
|
1789
|
+
const { text, color, style, ...optionProps } = props;
|
|
1790
|
+
const mergedStyle = color
|
|
1791
|
+
? { ...style, backgroundColor: color, color: getContrastColor(color) }
|
|
1792
|
+
: style;
|
|
1793
|
+
return (jsx("option", { className: "cw-option", style: mergedStyle, ...optionProps, children: optionProps.children ?? text }));
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
/**
|
|
1797
|
+
* Input for selecting an option from a list
|
|
1798
|
+
* @remarks
|
|
1799
|
+
* ```txt
|
|
1800
|
+
* CwIcon CwLabel CwSelect CwButton
|
|
1801
|
+
* ↑ ↑ ↑ ↑
|
|
1802
|
+
* ╭────────────────────╮╭════╮
|
|
1803
|
+
* ⌂ Cat: │ Choose a cat ╲╱ │║ Ok ║
|
|
1804
|
+
* ╰────────────────────╯╰════╯
|
|
1805
|
+
* │ Orange │ ← CwOption
|
|
1806
|
+
* ├────────────────────┤
|
|
1807
|
+
* │ Black │ ← CwOption
|
|
1808
|
+
* ├────────────────────┤
|
|
1809
|
+
* │ White │ ← CwOption
|
|
1810
|
+
* ╰────────────────────╯
|
|
1811
|
+
* ```
|
|
1812
|
+
* @example
|
|
1813
|
+
* <CwSelect name="cat" iconProps={{iconId:"pet"}} labelProps={{children:"Cat:"}}>
|
|
1814
|
+
* <CwOption value="" > - Choose a cat - </CwOption>
|
|
1815
|
+
* <CwOption value="o" >Orange</CwOption>
|
|
1816
|
+
* <CwOption value="b" >Black</CwOption>
|
|
1817
|
+
* <CwOption value="w" >White</CwOption>
|
|
1818
|
+
* </CwSelect>
|
|
1819
|
+
*/
|
|
1820
|
+
function CwSelect(props) {
|
|
1821
|
+
const { alignProps, labelProps, buttonProps, iconProps, placeholder, feedback, children, style, className, ...selectProps } = props;
|
|
1822
|
+
const feedbackMessages = feedback
|
|
1823
|
+
? Array.isArray(feedback) ? feedback : [feedback]
|
|
1824
|
+
: [];
|
|
1825
|
+
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
1826
|
+
const dataDirection = { 'data-direction': flexDirection };
|
|
1827
|
+
const { backgroundColor, color: textColor, ...wrapperStyle } = style ?? {};
|
|
1828
|
+
return (jsxs("div", { className: `cw-select${className ? ` ${className}` : ''}`, ...dataDirection, style: wrapperStyle, children: [jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-flex-row cw-gap-small cw-flex-grow", children: [jsxs("select", { ...selectProps, style: backgroundColor ? { backgroundColor, color: textColor } : undefined, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', defaultCardWidth = 320, cardGap = 16, isLoading = false, emptyState, sortOptions = [], defaultSortKey, keyExtractor, ...htmlProps }) {
|
|
1776
1832
|
const [currentPage, setCurrentPage] = useState(1);
|
|
1777
1833
|
const [sortKey, setSortKey] = useState(defaultSortKey || sortOptions[0]?.key || '');
|
|
1778
1834
|
const [sortDirection, setSortDirection] = useState('asc');
|
|
@@ -1804,7 +1860,12 @@ function CwCardList({ items, renderCard, pageSize = 10, layout = 'grid', default
|
|
|
1804
1860
|
'--card-width': `${defaultCardWidth}px`,
|
|
1805
1861
|
'--card-gap': `${cardGap}px`
|
|
1806
1862
|
};
|
|
1807
|
-
return (jsxs("div", { ...htmlProps, children: [sortOptions.length > 0 && (
|
|
1863
|
+
return (jsxs("div", { ...htmlProps, children: [sortOptions.length > 0 && (jsx("header", { className: "cw-flex-row cw-align-right-center cw-margin-bottom-small", children: jsx(CwSelect, { labelProps: { text: 'Sort by:', labelWidth: "4rem" }, alignProps: { alignItems: 'center' }, buttonProps: {
|
|
1864
|
+
variant: 'icon',
|
|
1865
|
+
icon: sortDirection === 'asc' ? 'arrow-up' : 'arrow-down',
|
|
1866
|
+
onClick: () => setSortDirection(prev => prev === 'asc' ? 'desc' : 'asc'),
|
|
1867
|
+
title: `Sort ${sortDirection === 'asc' ? 'descending' : 'ascending'}`,
|
|
1868
|
+
}, value: sortKey, onChange: (e) => handleSortChange(e.target.value), children: sortOptions.map(option => (jsx(CwOption, { value: option.key, children: option.label }, option.key))) }) })), isLoading ? (jsx("div", { className: styles$m.loading, children: jsx(CwLoading, { isLoading: isLoading }) })) : sortedItems.length === 0 ? (jsx("div", { className: styles$m.emptyState, children: emptyState || jsx("p", { children: "No items to display" }) })) : (jsxs(Fragment, { children: [jsx("div", { className: `${styles$m.cardContainer}`, "data-layout": layout, style: gridStyle, children: visibleItems.map((item, index) => (jsx(React__default.Fragment, { children: renderCard(item, index) }, keyExtractor ? keyExtractor(item, index) : index))) }), totalPages > 1 && (jsxs("div", { className: styles$m.pagination, children: [jsx(CwButton, { variant: "icon", icon: "chevron-left", disabled: currentPage === 1, onClick: () => setCurrentPage(p => Math.max(1, p - 1)) }), jsxs("span", { className: styles$m.pageInfo, children: [currentPage, " / ", totalPages] }), jsx(CwButton, { variant: "icon", icon: "chevron-right", disabled: currentPage === totalPages, onClick: () => setCurrentPage(p => Math.min(totalPages, p + 1)) })] }))] }))] }));
|
|
1808
1869
|
}
|
|
1809
1870
|
|
|
1810
1871
|
var styles$l = {"cw-accordion":"cw-accordion-module__cw-accordion__ErvlW","cw-accordion-body":"cw-accordion-module__cw-accordion-body__xlI8b"};
|
|
@@ -4237,60 +4298,6 @@ function CwToggle(props) {
|
|
|
4237
4298
|
type: "checkbox", ...inputProps })] }) }));
|
|
4238
4299
|
}
|
|
4239
4300
|
|
|
4240
|
-
/**
|
|
4241
|
-
* Option to display in the CwSelect
|
|
4242
|
-
* @remarks
|
|
4243
|
-
* Must be child of CwSelect
|
|
4244
|
-
* @example
|
|
4245
|
-
* <CwSelect>
|
|
4246
|
-
* <CwOption>A</CwOption>
|
|
4247
|
-
* <CwOption color="#4a90d9">Blue option</CwOption>
|
|
4248
|
-
* <CwOption>C</CwOption>
|
|
4249
|
-
* </CwSelect>
|
|
4250
|
-
*/
|
|
4251
|
-
function CwOption(props) {
|
|
4252
|
-
const { text, color, style, ...optionProps } = props;
|
|
4253
|
-
const mergedStyle = color
|
|
4254
|
-
? { ...style, backgroundColor: color, color: getContrastColor(color) }
|
|
4255
|
-
: style;
|
|
4256
|
-
return (jsx("option", { className: "cw-option", style: mergedStyle, ...optionProps, children: optionProps.children ?? text }));
|
|
4257
|
-
}
|
|
4258
|
-
|
|
4259
|
-
/**
|
|
4260
|
-
* Input for selecting an option from a list
|
|
4261
|
-
* @remarks
|
|
4262
|
-
* ```txt
|
|
4263
|
-
* CwIcon CwLabel CwSelect CwButton
|
|
4264
|
-
* ↑ ↑ ↑ ↑
|
|
4265
|
-
* ╭────────────────────╮╭════╮
|
|
4266
|
-
* ⌂ Cat: │ Choose a cat ╲╱ │║ Ok ║
|
|
4267
|
-
* ╰────────────────────╯╰════╯
|
|
4268
|
-
* │ Orange │ ← CwOption
|
|
4269
|
-
* ├────────────────────┤
|
|
4270
|
-
* │ Black │ ← CwOption
|
|
4271
|
-
* ├────────────────────┤
|
|
4272
|
-
* │ White │ ← CwOption
|
|
4273
|
-
* ╰────────────────────╯
|
|
4274
|
-
* ```
|
|
4275
|
-
* @example
|
|
4276
|
-
* <CwSelect name="cat" iconProps={{iconId:"pet"}} labelProps={{children:"Cat:"}}>
|
|
4277
|
-
* <CwOption value="" > - Choose a cat - </CwOption>
|
|
4278
|
-
* <CwOption value="o" >Orange</CwOption>
|
|
4279
|
-
* <CwOption value="b" >Black</CwOption>
|
|
4280
|
-
* <CwOption value="w" >White</CwOption>
|
|
4281
|
-
* </CwSelect>
|
|
4282
|
-
*/
|
|
4283
|
-
function CwSelect(props) {
|
|
4284
|
-
const { alignProps, labelProps, buttonProps, iconProps, placeholder, feedback, children, style, className, ...selectProps } = props;
|
|
4285
|
-
const feedbackMessages = feedback
|
|
4286
|
-
? Array.isArray(feedback) ? feedback : [feedback]
|
|
4287
|
-
: [];
|
|
4288
|
-
const flexDirection = alignProps?.flexDirection ?? "row";
|
|
4289
|
-
const dataDirection = { 'data-direction': flexDirection };
|
|
4290
|
-
const { backgroundColor, color: textColor, ...wrapperStyle } = style ?? {};
|
|
4291
|
-
return (jsxs("div", { className: `cw-select${className ? ` ${className}` : ''}`, ...dataDirection, style: wrapperStyle, children: [jsxs(CwAlign, { ...alignProps, itemProp: selectProps.required === true ? "required" : "", children: [labelProps && (jsxs(CwLabel, { ...labelProps, children: [iconProps && jsx(CwIcon, { ...iconProps }), labelProps.text] })), jsxs("div", { className: "cw-flex-row cw-gap-small cw-flex-grow", children: [jsxs("select", { ...selectProps, style: backgroundColor ? { backgroundColor, color: textColor } : undefined, children: [placeholder && jsx(CwOption, { value: "", children: placeholder }), children] }), buttonProps && jsx(CwButton, { ...buttonProps })] })] }), feedbackMessages.map((feedbackItem, index) => (jsx("p", { className: "cw-input-info", "data-color": feedbackItem.type, children: feedbackItem.message }, index)))] }));
|
|
4292
|
-
}
|
|
4293
|
-
|
|
4294
4301
|
// ─── Default strategy: below anchor, match width, flip above if needed ────────
|
|
4295
4302
|
function defaultPositionStrategy(anchorRect, panelRect) {
|
|
4296
4303
|
const panelH = panelRect?.height ?? 200;
|
|
@@ -4764,7 +4771,6 @@ var styles$8 = {"cw-multi-filter-catalog-container":"cw-multi-filter-module__cw-
|
|
|
4764
4771
|
* @returns Set the `onChange` callback to a function to check for changes in the selected filters
|
|
4765
4772
|
*/
|
|
4766
4773
|
const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeholder = "Write to filter", allCategoriesLabel = "ALL CATEGORIES", className, style }) => {
|
|
4767
|
-
const [filteredTags, setFilteredTags] = useState(new Set());
|
|
4768
4774
|
const [inputTextValue, setInputTextValue] = useState("");
|
|
4769
4775
|
const [isPanelOpen, setIsPanelOpen] = useState(false);
|
|
4770
4776
|
const [selectedCategory, setSelectedCategory] = useState("All");
|
|
@@ -4774,7 +4780,7 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4774
4780
|
const { panelRef, panelStyle, renderPanel } = useDropdownPortal({
|
|
4775
4781
|
anchorRef: wrapperRef,
|
|
4776
4782
|
isOpen: isPanelOpen,
|
|
4777
|
-
onClose: () => { setIsPanelOpen(false);
|
|
4783
|
+
onClose: () => { setIsPanelOpen(false); setSelectedCategory("All"); setInputTextValue(""); },
|
|
4778
4784
|
});
|
|
4779
4785
|
useEffect(() => {
|
|
4780
4786
|
// Outside-click is now handled by useDropdownPortal
|
|
@@ -4788,10 +4794,19 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4788
4794
|
});
|
|
4789
4795
|
return categoriesMap;
|
|
4790
4796
|
};
|
|
4791
|
-
const
|
|
4797
|
+
const displayTags = useMemo(() => {
|
|
4798
|
+
let tags = Array.from(allTags);
|
|
4799
|
+
if (selectedCategory !== "All") {
|
|
4800
|
+
tags = tags.filter(t => t.Category === selectedCategory);
|
|
4801
|
+
}
|
|
4802
|
+
if (inputTextValue.trim() !== "") {
|
|
4803
|
+
const input = inputTextValue.trim().replaceAll(" ", "").toLowerCase();
|
|
4804
|
+
tags = tags.filter(t => t.Name.replaceAll(" ", "").toLowerCase().includes(input));
|
|
4805
|
+
}
|
|
4806
|
+
return tags;
|
|
4807
|
+
}, [allTags, selectedCategory, inputTextValue]);
|
|
4792
4808
|
const handleClickCategory = (category) => {
|
|
4793
4809
|
setSelectedCategory(category);
|
|
4794
|
-
setFilteredTags(category !== "All" ? (categoriesMappedToTags().get(category) ?? new Set()) : getUnselectedAll());
|
|
4795
4810
|
};
|
|
4796
4811
|
const rgbAString = (r, g, b) => {
|
|
4797
4812
|
return `rgb(${r}, ${g}, ${b})`;
|
|
@@ -4815,36 +4830,15 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4815
4830
|
const handleInputText = (input) => {
|
|
4816
4831
|
if (selectedCategory !== "All")
|
|
4817
4832
|
setSelectedCategory("All");
|
|
4818
|
-
input
|
|
4819
|
-
setInputTextValue(input);
|
|
4820
|
-
if (input !== "") {
|
|
4821
|
-
const newFilterTags = Array.from(allTags).filter(tag => !Array.from(selectedTags).some(t => t.ID === tag.ID) &&
|
|
4822
|
-
tag.Name.replaceAll(" ", "").toLowerCase().includes(input.replaceAll(" ", "").toLowerCase()));
|
|
4823
|
-
setFilteredTags(new Set(newFilterTags));
|
|
4824
|
-
}
|
|
4825
|
-
else {
|
|
4826
|
-
setFilteredTags(getUnselectedAll());
|
|
4827
|
-
}
|
|
4833
|
+
setInputTextValue(input.trimStart());
|
|
4828
4834
|
};
|
|
4829
4835
|
const addTag = (newTag) => {
|
|
4830
|
-
newTag.Selected = true;
|
|
4831
|
-
newTag.Removable = true;
|
|
4832
|
-
newTag.Selectable = false;
|
|
4833
4836
|
if (selectedTags.has(newTag) || Array.from(selectedTags).some(t => t.ID === newTag.ID)) {
|
|
4834
4837
|
return;
|
|
4835
4838
|
}
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
setInputTextValue("");
|
|
4840
|
-
setFilteredTags(selectedCategory === "All" ? getUnselectedAll(updatedTags) : prev => {
|
|
4841
|
-
const next = new Set(prev);
|
|
4842
|
-
const toRemove = Array.from(next).find(t => t.ID === newTag.ID);
|
|
4843
|
-
if (toRemove)
|
|
4844
|
-
next.delete(toRemove);
|
|
4845
|
-
return next;
|
|
4846
|
-
});
|
|
4847
|
-
}
|
|
4839
|
+
const updatedTags = new Set(selectedTags).add(newTag);
|
|
4840
|
+
onChangeSelectedTags(updatedTags);
|
|
4841
|
+
setInputTextValue("");
|
|
4848
4842
|
};
|
|
4849
4843
|
const removeTag = (id) => {
|
|
4850
4844
|
const updatedTags = new Set(selectedTags);
|
|
@@ -4857,11 +4851,6 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4857
4851
|
}
|
|
4858
4852
|
onChangeSelectedTags(updatedTags);
|
|
4859
4853
|
};
|
|
4860
|
-
useEffect(() => {
|
|
4861
|
-
// force to load all tags on first render
|
|
4862
|
-
if (selectedCategory === "All" && filteredTags.size === 0)
|
|
4863
|
-
setFilteredTags(new Set());
|
|
4864
|
-
}, [allTags]);
|
|
4865
4854
|
const handleDivClick = () => {
|
|
4866
4855
|
if (inputRef !== null) {
|
|
4867
4856
|
inputRef.current?.focus();
|
|
@@ -4873,9 +4862,9 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4873
4862
|
switch (e.key) {
|
|
4874
4863
|
case "Enter":
|
|
4875
4864
|
case "Tab": {
|
|
4876
|
-
if (inputTextValue.trim().length > 0 &&
|
|
4865
|
+
if (inputTextValue.trim().length > 0 && displayTags.length > 0) {
|
|
4877
4866
|
const input = inputTextValue.trim().toLowerCase();
|
|
4878
|
-
const tagsArr =
|
|
4867
|
+
const tagsArr = displayTags;
|
|
4879
4868
|
let foundTag = tagsArr.find(tag => tag.Name.trim().toLowerCase() === input);
|
|
4880
4869
|
if (!foundTag) {
|
|
4881
4870
|
foundTag = tagsArr.find(tag => tag.Name.trim().toLowerCase().startsWith(input));
|
|
@@ -4899,7 +4888,7 @@ const CwMultiFilter = ({ allTags, id, onChangeSelectedTags, selectedTags, placeh
|
|
|
4899
4888
|
} })] }), selectedTags.size > 0 && (jsx(CwButton, { type: "button", variant: "icon", color: "neutral", icon: "close", onMouseDown: e => e.preventDefault(), onClick: (e) => { e.stopPropagation(); onChangeSelectedTags(new Set()); setIsPanelOpen(false); }, tabIndex: -1, "aria-label": "Clear all" }))] }), renderPanel(jsxs("section", { ref: panelRef, className: styles$8["cw-multi-filter-catalog-container"], style: panelStyle, children: [jsxs("nav", { children: [jsx("button", { className: selectedCategory === "All" ? styles$8["category-selected"] : undefined, onClick: () => handleClickCategory("All"), children: allCategoriesLabel }), Array.from(categoriesMappedToTags().keys()).map(category => (jsx("button", { className: selectedCategory === category ? styles$8["category-selected"] : undefined, style: {
|
|
4900
4889
|
backgroundColor: getColor(category).primary,
|
|
4901
4890
|
color: getColor(category).onPrimary,
|
|
4902
|
-
}, onClick: () => handleClickCategory(category), children: category }, category)))] }), jsx("ul", { children:
|
|
4891
|
+
}, onClick: () => handleClickCategory(category), children: category }, category)))] }), jsx("ul", { children: displayTags
|
|
4903
4892
|
.sort((a, b) => {
|
|
4904
4893
|
const input = inputTextValue.trim().toLowerCase();
|
|
4905
4894
|
const aName = a.Name.trim().toLowerCase();
|
|
@@ -9783,13 +9772,13 @@ const PinRowHeader = ({ value, width, onEvent }) => {
|
|
|
9783
9772
|
jsxs("span", { className: styles["scheduler-crewmember-functions"], children: ["(", value.title3, ")"] }), value.subtitle2 && jsxs("span", { children: ["-", value.subtitle2] })] })] }), isLoading ? jsx("span", { className: "cwi-icons cwi-spinner" }) : undefined] }) }, value.rowId) }, value.rowId);
|
|
9784
9773
|
};
|
|
9785
9774
|
|
|
9786
|
-
const SuperScheduler = ({ id, state, header, rows, events, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, indicatorRows = [], contextMenuItems, onEvent, rowHeightRem = 1.75 }) => {
|
|
9775
|
+
const SuperScheduler = ({ id, state, header, rows, events, headerColumnComp, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, indicatorRows = [], contextMenuItems, onEvent, rowHeightRem = 1.75 }) => {
|
|
9787
9776
|
const pinnedRows = rows.filter((it) => it.isPinned);
|
|
9788
9777
|
const notPinnedRows = rows.filter((it) => !it.isPinned);
|
|
9789
9778
|
const isFirstVisible = pinnedRows.length > 0;
|
|
9790
|
-
return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: pinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp:
|
|
9779
|
+
return (jsxs(Fragment, { children: [isFirstVisible && (jsxs(Fragment, { children: [jsx(Scheduler, { id: `${id}-pinned`, state: state, header: header, rows: pinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: pinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: headerColumnComp, rowHeightRem: rowHeightRem }), jsx("div", { children: jsx(CwButton, { onClick: () => {
|
|
9791
9780
|
onEvent(new OnClearPinned());
|
|
9792
|
-
}, children: "Clear pinned" }) })] })), jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp:
|
|
9781
|
+
}, children: "Clear pinned" }) })] })), jsx(Scheduler, { id: `${id}-notPinned`, state: { ...state, isHeaderVisible: !isFirstVisible }, header: header, rows: notPinnedRows, events: events, backgroundEvents: backgroundEvents, indicatorRows: indicatorRows, contextMenuItems: contextMenuItems, orderCategories: unPinnedOrderCategory, onEvent: onEvent, EventComp: SchedulerEvent, RowTitleComp: headerColumnComp, rowHeightRem: rowHeightRem })] }));
|
|
9793
9782
|
};
|
|
9794
9783
|
|
|
9795
9784
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CwMultiFilter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/control/choice/multi-filter/CwMultiFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"CwMultiFilter.d.ts","sourceRoot":"","sources":["../../../../../../src/components/control/choice/multi-filter/CwMultiFilter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAwC,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAoB,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGpH,MAAM,WAAW,kBAAkB;IAClC,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,sGAAsG;IACtG,oBAAoB,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACrE,uCAAuC;IACvC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAChC,4CAA4C;IAC5C,YAAY,EAAE,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACzC,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0IG;AACH,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA0OhD,CAAC"}
|
package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizesTemporal.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alternative to getEventSizes using Temporal.Instant and Temporal.Duration.
|
|
3
|
+
* Requires a runtime or polyfill that supports the TC39 Temporal API.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getEventSizesTemporal: (schedulerDate: Temporal.Instant, totalDays: number, startDate: Temporal.Instant, endDate: Temporal.Instant) => {
|
|
6
|
+
left: number;
|
|
7
|
+
width: number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=getEventSizesTemporal.d.ts.map
|
package/dist/src/components/custom/scheduler-new/presentation/logic/getEventSizesTemporal.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEventSizesTemporal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/custom/scheduler-new/presentation/logic/getEventSizesTemporal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,eAAO,MAAM,qBAAqB,GACjC,eAAe,QAAQ,CAAC,OAAO,EAC/B,WAAW,MAAM,EACjB,WAAW,QAAQ,CAAC,OAAO,EAC3B,SAAS,QAAQ,CAAC,OAAO;;;CA8BzB,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { OnEvent } from "../../../common/functions/dsl/UiEventDSL";
|
|
3
2
|
import type { MenuOption } from "../../control/action/contextmenu/CwAnchoredMenu";
|
|
4
3
|
import { SchedulerHeaderContent } from "../scheduler-new/presentation/components/header/SchedulerHeaderState";
|
|
@@ -8,21 +7,22 @@ import type { IndicatorRowDm } from "../scheduler-new/presentation/components/ro
|
|
|
8
7
|
import { OrderCategory } from "../scheduler-new/presentation/NewScheduler";
|
|
9
8
|
import { SchedulerState } from "../scheduler-new/presentation/state/ui/SchedulerState";
|
|
10
9
|
import { PinRowHeaderProps } from "./PinRowHeader";
|
|
11
|
-
|
|
10
|
+
import { RowHeaderProps } from "../scheduler-new/presentation/components/row/DefaultRowHeader";
|
|
11
|
+
export interface SuperSchedulerProps<T extends PinRowHeaderProps> {
|
|
12
12
|
id: string;
|
|
13
13
|
state: SchedulerState;
|
|
14
14
|
header: SchedulerHeaderContent;
|
|
15
|
-
rows:
|
|
15
|
+
rows: T[];
|
|
16
|
+
headerColumnComp: React.ComponentType<RowHeaderProps<T>>;
|
|
16
17
|
events: SchedulerEventDm[];
|
|
17
18
|
backgroundEvents: BackgroundEventDm[];
|
|
18
19
|
indicatorRows?: IndicatorRowDm[];
|
|
19
20
|
contextMenuItems: MenuOption[];
|
|
20
|
-
pinnedOrderCategory?: OrderCategory<
|
|
21
|
-
unPinnedOrderCategory?: OrderCategory<
|
|
21
|
+
pinnedOrderCategory?: OrderCategory<T>[];
|
|
22
|
+
unPinnedOrderCategory?: OrderCategory<T>[];
|
|
22
23
|
onEvent: OnEvent;
|
|
23
24
|
rowHeightRem?: number;
|
|
24
25
|
}
|
|
25
|
-
export declare const SuperScheduler:
|
|
26
|
+
export declare const SuperScheduler: <T extends PinRowHeaderProps>({ id, state, header, rows, events, headerColumnComp, pinnedOrderCategory, unPinnedOrderCategory, backgroundEvents, indicatorRows, contextMenuItems, onEvent, rowHeightRem }: SuperSchedulerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export declare const _preview: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export default SuperScheduler;
|
|
28
28
|
//# sourceMappingURL=SuperScheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuperScheduler.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/super-scheduler/SuperScheduler.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuperScheduler.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/super-scheduler/SuperScheduler.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,0CAA0C,CAAC;AAEjE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAC,sBAAsB,EAAC,MAAM,sEAAsE,CAAC;AAC5G,OAAO,EAAC,iBAAiB,EAAC,MAAM,8DAA8D,CAAC;AAC/F,OAAO,EAAiB,gBAAgB,EAAC,MAAM,oDAAoD,CAAC;AACpG,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2DAA2D,CAAC;AAC9F,OAAO,EAAC,aAAa,EAAY,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAC,cAAc,EAAC,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAe,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAC,cAAc,EAAC,MAAM,+DAA+D,CAAC;AAE7F,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,iBAAiB;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,sBAAsB,CAAC;IAC/B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;IACxD,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,gBAAgB,EAAE,iBAAiB,EAAE,CAAC;IACtC,aAAa,CAAC,EAAE,cAAc,EAAE,CAAC;IACjC,gBAAgB,EAAE,UAAU,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,qBAAqB,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,iBAAiB,EAAG,6KAc3D,mBAAmB,CAAC,CAAC,CAAC,4CAsDvB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CA0BpB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CwChipProps } from '../../display/text/tag/CwChip';
|
|
3
|
+
import { CwLayoutProps } from '../../../common/interfaces/CwLayoutProps';
|
|
3
4
|
export type CardChip = Omit<CwChipProps, 'closable' | 'onClose' | 'className' | 'style'>;
|
|
4
5
|
export interface CwCardProps {
|
|
5
6
|
/*** Unique identifier for the card **/
|
|
@@ -8,7 +9,7 @@ export interface CwCardProps {
|
|
|
8
9
|
title?: ReactNode;
|
|
9
10
|
/*** Card subtitle content **/
|
|
10
11
|
subtitle?: ReactNode;
|
|
11
|
-
|
|
12
|
+
/** @deprecated Use layout.align instead ("left" → "start", "center" → "center") **/
|
|
12
13
|
alignment?: "center" | "left";
|
|
13
14
|
/*** Main content of the card **/
|
|
14
15
|
children: ReactNode;
|
|
@@ -36,8 +37,10 @@ export interface CwCardProps {
|
|
|
36
37
|
chips?: CardChip[];
|
|
37
38
|
/*** Variant design **/
|
|
38
39
|
variant?: "border" | "shadow";
|
|
39
|
-
|
|
40
|
+
/** @deprecated Use layout.direction instead **/
|
|
40
41
|
direction?: "column" | "row";
|
|
42
|
+
/** Card layout: direction controls card flex direction; align controls header content alignment **/
|
|
43
|
+
layout?: CwLayoutProps;
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* CwCard - A simple card component for displaying content in a contained format
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CwCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/card/CwCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAU,WAAW,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"CwCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/card/CwCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAU,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAIzE,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC3B,uCAAuC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2BAA2B;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oFAAoF;IACpF,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,iCAAiC;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,kDAAkD;IAClD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,uBAAuB;IACvB,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC9B,gDAAgD;IAChD,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC7B,oGAAoG;IACpG,MAAM,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA2HxC,CAAC"}
|
|
@@ -25,6 +25,8 @@ export interface CwCardListProps<T> extends React.HTMLAttributes<HTMLDivElement>
|
|
|
25
25
|
sortOptions?: SortOption<T>[];
|
|
26
26
|
/** Default sort key */
|
|
27
27
|
defaultSortKey?: string;
|
|
28
|
+
/** Extracts a stable unique key from each item to avoid index-based reconciliation bugs */
|
|
29
|
+
keyExtractor?: (item: T, index: number) => string | number;
|
|
28
30
|
}
|
|
29
|
-
export declare function CwCardList<T>({ items, renderCard, pageSize, layout, defaultCardWidth, cardGap, isLoading, emptyState, sortOptions, defaultSortKey, ...htmlProps }: CwCardListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function CwCardList<T>({ items, renderCard, pageSize, layout, defaultCardWidth, cardGap, isLoading, emptyState, sortOptions, defaultSortKey, keyExtractor, ...htmlProps }: CwCardListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
30
32
|
//# sourceMappingURL=CwCardList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CwCardList.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/card/CwCardList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CwCardList.d.ts","sourceRoot":"","sources":["../../../../../src/components/layout/card/CwCardList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAO5D,MAAM,WAAW,UAAU,CAAC,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/E,8CAA8C;IAC9C,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,mDAAmD;IACnD,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,6BAA6B;IAC7B,WAAW,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,uBAAuB;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC;CAC3D;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAC7B,KAAK,EACL,UAAU,EACV,QAAa,EACb,MAAe,EACf,gBAAsB,EACtB,OAAY,EACZ,SAAiB,EACjB,UAAU,EACV,WAAgB,EAChB,cAAc,EACd,YAAY,EACZ,GAAG,SAAS,EACZ,EAAE,eAAe,CAAC,CAAC,CAAC,2CAwGpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardListPage.d.ts","sourceRoot":"","sources":["../../../../src/playground/pages/CardListPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmE1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAuEhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEventSizesTemporal.test.d.ts","sourceRoot":"","sources":["../../../../../../../test/components/custom/new-scheduler/presentation/logic/getEventSizesTemporal.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.setup.d.ts","sourceRoot":"","sources":["../../test/vitest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"vitest.setup.d.ts","sourceRoot":"","sources":["../../test/vitest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cwellt_software/cwellt-reactjs-lib",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"react-dom": "^18.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"globals": "^15.12.0",
|
|
38
37
|
"@rollup/plugin-typescript": "12.3.0",
|
|
39
38
|
"@testing-library/jest-dom": "^6.6.3",
|
|
40
39
|
"@testing-library/react": "^16.1.0",
|
|
@@ -51,6 +50,7 @@
|
|
|
51
50
|
"csstype": "^3.2.3",
|
|
52
51
|
"eslint": "^9.14.0",
|
|
53
52
|
"eslint-plugin-react": "^7.37.2",
|
|
53
|
+
"globals": "^15.12.0",
|
|
54
54
|
"postcss": "^8.4.49",
|
|
55
55
|
"postcss-import": "^16.1.0",
|
|
56
56
|
"postcss-modules": "^6.0.1",
|
|
@@ -64,14 +64,15 @@
|
|
|
64
64
|
"typescript-eslint": "^8.56.0",
|
|
65
65
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
66
66
|
"vite": "^7.1.8",
|
|
67
|
-
"vitest": "^
|
|
67
|
+
"vitest": "^4.1.8"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"react-draggable": "^4.4.6",
|
|
71
|
-
"react-window": "^1.8.11",
|
|
72
70
|
"@react-buddy/ide-toolbox": "^2.4.0",
|
|
73
71
|
"date-fns": "^2.30.0",
|
|
74
|
-
"react-day-picker": "^9.0.0"
|
|
72
|
+
"react-day-picker": "^9.0.0",
|
|
73
|
+
"react-draggable": "^4.4.6",
|
|
74
|
+
"react-window": "^1.8.11",
|
|
75
|
+
"temporal-polyfill": "^0.3.2"
|
|
75
76
|
},
|
|
76
77
|
"overrides": {
|
|
77
78
|
"postcss-url": {
|