phx-react 1.3.1833 → 1.3.1836

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.
Files changed (71) hide show
  1. package/dist/cjs/components/ResourceList/component/list.js +1 -1
  2. package/dist/cjs/components/ResourceList/component/list.js.map +1 -1
  3. package/dist/cjs/components/TableSchedule/PHXScheduleTable.d.ts +11 -0
  4. package/dist/cjs/components/TableSchedule/PHXScheduleTable.js +45 -0
  5. package/dist/cjs/components/TableSchedule/PHXScheduleTable.js.map +1 -0
  6. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableBody.d.ts +16 -0
  7. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableBody.js +148 -0
  8. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableBody.js.map +1 -0
  9. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableHead.d.ts +22 -0
  10. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableHead.js +49 -0
  11. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableHead.js.map +1 -0
  12. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableLegend.d.ts +13 -0
  13. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableLegend.js +26 -0
  14. package/dist/cjs/components/TableSchedule/components/PHXScheduleTableLegend.js.map +1 -0
  15. package/dist/cjs/components/TableSchedule/components/useStickyShadow.d.ts +15 -0
  16. package/dist/cjs/components/TableSchedule/components/useStickyShadow.js +37 -0
  17. package/dist/cjs/components/TableSchedule/components/useStickyShadow.js.map +1 -0
  18. package/dist/cjs/components/TableSchedule/constants.d.ts +49 -0
  19. package/dist/cjs/components/TableSchedule/constants.js +85 -0
  20. package/dist/cjs/components/TableSchedule/constants.js.map +1 -0
  21. package/dist/cjs/components/TableSchedule/index.d.ts +1 -0
  22. package/dist/cjs/components/TableSchedule/index.js +5 -0
  23. package/dist/cjs/components/TableSchedule/index.js.map +1 -0
  24. package/dist/cjs/components/TableSchedule/renderers.d.ts +39 -0
  25. package/dist/cjs/components/TableSchedule/renderers.js +138 -0
  26. package/dist/cjs/components/TableSchedule/renderers.js.map +1 -0
  27. package/dist/cjs/components/TableSchedule/types.d.ts +112 -0
  28. package/dist/cjs/components/TableSchedule/types.js +4 -0
  29. package/dist/cjs/components/TableSchedule/types.js.map +1 -0
  30. package/dist/cjs/components/TableSchedule/utils.d.ts +160 -0
  31. package/dist/cjs/components/TableSchedule/utils.js +283 -0
  32. package/dist/cjs/components/TableSchedule/utils.js.map +1 -0
  33. package/dist/cjs/index.d.ts +2 -1
  34. package/dist/cjs/index.js +3 -1
  35. package/dist/cjs/index.js.map +1 -1
  36. package/dist/esm/components/ResourceList/component/list.js +1 -1
  37. package/dist/esm/components/ResourceList/component/list.js.map +1 -1
  38. package/dist/esm/components/TableSchedule/PHXScheduleTable.d.ts +11 -0
  39. package/dist/esm/components/TableSchedule/PHXScheduleTable.js +40 -0
  40. package/dist/esm/components/TableSchedule/PHXScheduleTable.js.map +1 -0
  41. package/dist/esm/components/TableSchedule/components/PHXScheduleTableBody.d.ts +16 -0
  42. package/dist/esm/components/TableSchedule/components/PHXScheduleTableBody.js +143 -0
  43. package/dist/esm/components/TableSchedule/components/PHXScheduleTableBody.js.map +1 -0
  44. package/dist/esm/components/TableSchedule/components/PHXScheduleTableHead.d.ts +22 -0
  45. package/dist/esm/components/TableSchedule/components/PHXScheduleTableHead.js +45 -0
  46. package/dist/esm/components/TableSchedule/components/PHXScheduleTableHead.js.map +1 -0
  47. package/dist/esm/components/TableSchedule/components/PHXScheduleTableLegend.d.ts +13 -0
  48. package/dist/esm/components/TableSchedule/components/PHXScheduleTableLegend.js +21 -0
  49. package/dist/esm/components/TableSchedule/components/PHXScheduleTableLegend.js.map +1 -0
  50. package/dist/esm/components/TableSchedule/components/useStickyShadow.d.ts +15 -0
  51. package/dist/esm/components/TableSchedule/components/useStickyShadow.js +33 -0
  52. package/dist/esm/components/TableSchedule/components/useStickyShadow.js.map +1 -0
  53. package/dist/esm/components/TableSchedule/constants.d.ts +49 -0
  54. package/dist/esm/components/TableSchedule/constants.js +81 -0
  55. package/dist/esm/components/TableSchedule/constants.js.map +1 -0
  56. package/dist/esm/components/TableSchedule/index.d.ts +1 -0
  57. package/dist/esm/components/TableSchedule/index.js +2 -0
  58. package/dist/esm/components/TableSchedule/index.js.map +1 -0
  59. package/dist/esm/components/TableSchedule/renderers.d.ts +39 -0
  60. package/dist/esm/components/TableSchedule/renderers.js +129 -0
  61. package/dist/esm/components/TableSchedule/renderers.js.map +1 -0
  62. package/dist/esm/components/TableSchedule/types.d.ts +112 -0
  63. package/dist/esm/components/TableSchedule/types.js +3 -0
  64. package/dist/esm/components/TableSchedule/types.js.map +1 -0
  65. package/dist/esm/components/TableSchedule/utils.d.ts +160 -0
  66. package/dist/esm/components/TableSchedule/utils.js +264 -0
  67. package/dist/esm/components/TableSchedule/utils.js.map +1 -0
  68. package/dist/esm/index.d.ts +2 -1
  69. package/dist/esm/index.js +2 -1
  70. package/dist/esm/index.js.map +1 -1
  71. package/package.json +1 -1
@@ -0,0 +1,143 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { getCellWrapperAlignClassName } from '../constants';
4
+ import { renderCellBoxContent, renderRowHeaderContent, renderScheduleContent, renderTooltipContent, resolveTooltipClassName, } from '../renderers';
5
+ import { buildDataCellStyle, buildRowHeaderCellStyle, getCellSpan, getClickableCellClassName, getColumnAlign, getDataCellClassName, getRowHeaderClassName, getRowHeaders, getStaticCellClassName, } from '../utils';
6
+ /**
7
+ * Resolves the plain cell content for non-boxed cells.
8
+ *
9
+ * @param {GridCellData} cell The cell data being rendered.
10
+ * @param {string} [userDetailPageUrl] Optional detail-page URL used by schedule links.
11
+ * @returns {React.ReactNode} The plain rendered cell content.
12
+ */
13
+ const getPlainCellContent = (cell, userDetailPageUrl) => {
14
+ if (cell.scheduleContent) {
15
+ return renderScheduleContent(cell.scheduleContent, userDetailPageUrl);
16
+ }
17
+ return cell.content;
18
+ };
19
+ /**
20
+ * Resolves the rendered content for a cell based on the active layout mode.
21
+ *
22
+ * @param {GridCellData} cell The cell data being rendered.
23
+ * @param {'boxed' | 'plain'} cellLayout The layout mode used for the cell.
24
+ * @param {string} [userDetailPageUrl] Optional detail-page URL used by schedule links.
25
+ * @returns {React.ReactNode} The rendered cell content for the selected layout.
26
+ */
27
+ const getBoxContent = (cell, cellLayout, userDetailPageUrl) => cellLayout === 'plain' ? getPlainCellContent(cell, userDetailPageUrl) : renderCellBoxContent(cell);
28
+ /**
29
+ * Creates the click handler payload for an interactive data cell.
30
+ *
31
+ * @param {PHXScheduleTableProps['onCellClick']} onCellClick The optional table click callback.
32
+ * @param {number} rowIndex The zero-based row index of the clicked cell.
33
+ * @param {string} columnKey The column key of the clicked cell.
34
+ * @param {GridCellData} cellData The cell data passed back to the callback.
35
+ * @returns {(() => void) | undefined} The click handler, or `undefined` when clicks are disabled.
36
+ */
37
+ const getCellClickHandler = (onCellClick, rowIndex, columnKey, cellData) => {
38
+ if (!onCellClick) {
39
+ return undefined;
40
+ }
41
+ return () => onCellClick({
42
+ rowIndex,
43
+ columnKey,
44
+ cellData,
45
+ });
46
+ };
47
+ /**
48
+ * Renders the clickable or static wrapper used by a data cell.
49
+ *
50
+ * @param {React.ReactNode} boxContent The rendered content shown inside the cell.
51
+ * @param {'boxed' | 'plain'} cellLayout The active layout mode.
52
+ * @param {string} cellWrapperAlignClassName The alignment class applied to the wrapper.
53
+ * @param {(() => void) | undefined} onClick The optional click handler for interactive cells.
54
+ * @param {PHXScheduleTableProps['ButtonComponent']} [ButtonComponent] Optional custom button component.
55
+ * @returns {React.ReactNode} The rendered cell wrapper.
56
+ */
57
+ const renderInteractiveCellContent = (boxContent, cellLayout, cellWrapperAlignClassName, onClick, ButtonComponent) => {
58
+ if (!onClick) {
59
+ return React.createElement("div", { className: getStaticCellClassName(cellLayout, cellWrapperAlignClassName) }, boxContent);
60
+ }
61
+ if (ButtonComponent) {
62
+ return (React.createElement(ButtonComponent, { tertiary: true, noPadding: true, className: getClickableCellClassName(cellLayout, cellWrapperAlignClassName, true), onClick: onClick }, boxContent));
63
+ }
64
+ return (React.createElement("button", { type: 'button', className: getClickableCellClassName(cellLayout, cellWrapperAlignClassName), onClick: onClick }, boxContent));
65
+ };
66
+ /**
67
+ * Renders the schedule table body, including sticky row headers and data cells.
68
+ *
69
+ * @param {PHXScheduleTableBodyProps} props Body render inputs.
70
+ * @returns {React.ReactNode} The schedule table body.
71
+ */
72
+ export const PHXScheduleTableBody = ({ columns, rows, onCellClick, stickyColumnWidth = 130, defaultCellLayout = 'boxed', userDetailPageUrl, TooltipComponent, ButtonComponent, skipMap, stickyHeaderCount, resolvedStickyColumnWidths, showStickyShadow, }) => {
73
+ /**
74
+ * Wraps a cell with the configured tooltip component when tooltip content exists.
75
+ *
76
+ * @param {GridCellData} cell The cell data being rendered.
77
+ * @param {React.ReactNode} cellContent The rendered cell content before tooltip decoration.
78
+ * @returns {React.ReactNode} The tooltip-wrapped content, or the original content when no tooltip applies.
79
+ */
80
+ const renderTooltipWrappedContent = (cell, cellContent) => {
81
+ const tooltipContent = renderTooltipContent(cell, userDetailPageUrl);
82
+ if (!tooltipContent || !TooltipComponent) {
83
+ return cellContent;
84
+ }
85
+ return (React.createElement(TooltipComponent, { contentClassName: resolveTooltipClassName(cell), content: tooltipContent }, cellContent));
86
+ };
87
+ /**
88
+ * Renders a sticky row-header cell for the current body row.
89
+ *
90
+ * @param {RowHeaderCellRenderParams} params Row-header render inputs.
91
+ * @returns {React.ReactNode} The rendered sticky row-header cell.
92
+ */
93
+ function renderRowHeaderCell(params) {
94
+ var _a;
95
+ const { header, headerIndex, isLast } = params;
96
+ const width = (_a = header.width) !== null && _a !== void 0 ? _a : stickyColumnWidth;
97
+ return (React.createElement("td", { key: headerIndex, rowSpan: header.rowSpan, className: getRowHeaderClassName(header.className, headerIndex, stickyHeaderCount, showStickyShadow), style: buildRowHeaderCellStyle({
98
+ headerIndex,
99
+ stickyWidths: resolvedStickyColumnWidths,
100
+ width,
101
+ isLast,
102
+ customStyle: header.style,
103
+ }) }, renderRowHeaderContent(header)));
104
+ }
105
+ /**
106
+ * Renders a data cell for the current row and column combination.
107
+ *
108
+ * @param {DataCellRenderParams} params Data-cell render inputs.
109
+ * @returns {React.ReactNode} The rendered data cell, or `null` when the coordinate is covered by a span.
110
+ */
111
+ function renderDataCell(params) {
112
+ var _a, _b;
113
+ const { row, rowIndex, col, isLast } = params;
114
+ if (skipMap.has(`${rowIndex},${col.key}`))
115
+ return null;
116
+ const cell = (_a = row.cells[col.key]) !== null && _a !== void 0 ? _a : {};
117
+ const { colSpan: cs, rowSpan: rs } = getCellSpan(cell);
118
+ const columnAlign = getColumnAlign(col.align);
119
+ const cellWrapperAlignClassName = getCellWrapperAlignClassName(columnAlign);
120
+ const cellLayout = (_b = cell.layout) !== null && _b !== void 0 ? _b : defaultCellLayout;
121
+ const boxContent = getBoxContent(cell, cellLayout, userDetailPageUrl);
122
+ const onClick = onCellClick && !cell.disabled ? getCellClickHandler(onCellClick, rowIndex, col.key, cell) : undefined;
123
+ const cellContent = renderInteractiveCellContent(boxContent, cellLayout, cellWrapperAlignClassName, onClick, ButtonComponent);
124
+ const wrappedContent = renderTooltipWrappedContent(cell, cellContent);
125
+ return (React.createElement("td", { key: col.key, colSpan: cs > 1 ? cs : undefined, rowSpan: rs > 1 ? rs : undefined, className: getDataCellClassName(cell.cellClassName), style: buildDataCellStyle(isLast, cell.cellStyle) }, wrappedContent));
126
+ }
127
+ /**
128
+ * Renders a single table body row with its sticky headers and visible data cells.
129
+ *
130
+ * @param {PHXScheduleTableProps['rows'][number]} row The row data being rendered.
131
+ * @param {number} rowIndex The zero-based row index.
132
+ * @returns {React.ReactNode} The rendered table row.
133
+ */
134
+ function renderBodyRow(row, rowIndex) {
135
+ const isLast = rowIndex === rows.length - 1;
136
+ const rowHeaders = getRowHeaders(row, stickyColumnWidth);
137
+ return (React.createElement("tr", { key: rowIndex },
138
+ rowHeaders.map((header, headerIndex) => header ? renderRowHeaderCell({ header, headerIndex, isLast }) : null),
139
+ columns.map((col) => renderDataCell({ row, rowIndex, col, isLast }))));
140
+ }
141
+ return React.createElement("tbody", null, rows.map(renderBodyRow));
142
+ };
143
+ //# sourceMappingURL=PHXScheduleTableBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PHXScheduleTableBody.js","sourceRoot":"","sources":["../../../../../src/components/TableSchedule/components/PHXScheduleTableBody.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,WAAW,EACX,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,sBAAsB,GACvB,MAAM,UAAU,CAAA;AAiCjB;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,CAAC,IAAkB,EAAE,iBAA0B,EAAE,EAAE;IAC7E,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,OAAO,qBAAqB,CAAC,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAA;IACvE,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,CAAA;AACrB,CAAC,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CAAC,IAAkB,EAAE,UAA6B,EAAE,iBAA0B,EAAE,EAAE,CACtG,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAEpG;;;;;;;;GAQG;AACH,MAAM,mBAAmB,GAAG,CAC1B,WAAiD,EACjD,QAAgB,EAChB,SA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;QAC3C,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;QAExD,OAAO,CACL,4BAAI,GAAG,EAAE,QAAQ;YACd,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CACtC,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACrE;YACA,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,CAClE,CACN,CAAA;IACH,CAAC;IAED,OAAO,mCAAQ,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAS,CAAA;AACjD,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { GridHeaderGroup, PHXScheduleTableProps } from '../types';
3
+ type StickyHeaderPlaceholdersProps = {
4
+ stickyHeaderCount: number;
5
+ resolvedStickyColumnWidths: number[];
6
+ showStickyShadow: boolean;
7
+ zIndexBase: number;
8
+ rowSpan?: number;
9
+ };
10
+ type StickyHeaderContext = Pick<StickyHeaderPlaceholdersProps, 'stickyHeaderCount' | 'resolvedStickyColumnWidths' | 'showStickyShadow'>;
11
+ type PHXScheduleTableHeadProps = {
12
+ columns: PHXScheduleTableProps['columns'];
13
+ headerGroups?: GridHeaderGroup[];
14
+ } & StickyHeaderContext;
15
+ /**
16
+ * Renders the table head, including grouped headers and sticky row-header placeholders.
17
+ *
18
+ * @param {PHXScheduleTableHeadProps} props Head render inputs.
19
+ * @returns {React.ReactNode} The schedule table head.
20
+ */
21
+ export declare function PHXScheduleTableHead(props: PHXScheduleTableHeadProps): React.ReactNode;
22
+ export {};
@@ -0,0 +1,45 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { HEADER_TH_CLASSNAME } from '../constants';
4
+ import { buildColumnHeaderCellStyle, buildHeaderGroupCellStyle, buildStickyHeaderCellStyle, getColumnAlign, getStickyHeaderClassName, } from '../utils';
5
+ /**
6
+ * Builds the placeholder props shared by sticky header rows.
7
+ *
8
+ * @param {StickyHeaderContext} stickyHeaderContext Sticky column state shared across header rows.
9
+ * @param {number} zIndexBase The z-index base used for the placeholder row.
10
+ * @param {number} [rowSpan] Optional row span applied to each placeholder cell.
11
+ * @returns {StickyHeaderPlaceholdersProps} The complete placeholder props for a sticky header row.
12
+ */
13
+ const buildStickyHeaderPlaceholderProps = (stickyHeaderContext, zIndexBase, rowSpan) => ({
14
+ ...stickyHeaderContext,
15
+ zIndexBase,
16
+ rowSpan,
17
+ });
18
+ /**
19
+ * Renders placeholder cells that reserve space for sticky row headers in the table head.
20
+ *
21
+ * @param {StickyHeaderPlaceholdersProps} props Sticky placeholder render inputs.
22
+ * @returns {React.ReactNode[]} The sticky placeholder cells.
23
+ */
24
+ const StickyHeaderPlaceholders = ({ stickyHeaderCount, resolvedStickyColumnWidths, showStickyShadow, zIndexBase, rowSpan, }) => Array.from({ length: stickyHeaderCount }).map((_, index) => (React.createElement("th", { key: index, rowSpan: rowSpan, className: getStickyHeaderClassName(index, stickyHeaderCount, showStickyShadow), style: buildStickyHeaderCellStyle({
25
+ index,
26
+ stickyWidths: resolvedStickyColumnWidths,
27
+ zIndexBase,
28
+ }) })));
29
+ /**
30
+ * Renders the table head, including grouped headers and sticky row-header placeholders.
31
+ *
32
+ * @param {PHXScheduleTableHeadProps} props Head render inputs.
33
+ * @returns {React.ReactNode} The schedule table head.
34
+ */
35
+ export function PHXScheduleTableHead(props) {
36
+ const { columns, headerGroups, ...stickyHeaderContext } = props;
37
+ return (React.createElement("thead", null,
38
+ headerGroups && headerGroups.length > 0 && (React.createElement("tr", null,
39
+ React.createElement(StickyHeaderPlaceholders, { ...buildStickyHeaderPlaceholderProps(stickyHeaderContext, 4, 2) }),
40
+ headerGroups.map((group, gi) => (React.createElement("th", { key: gi, colSpan: group.columnKeys.length, className: HEADER_TH_CLASSNAME, style: buildHeaderGroupCellStyle() }, group.header))))),
41
+ React.createElement("tr", null,
42
+ !headerGroups && React.createElement(StickyHeaderPlaceholders, { ...buildStickyHeaderPlaceholderProps(stickyHeaderContext, 3) }),
43
+ columns.map((col) => (React.createElement("th", { key: col.key, className: HEADER_TH_CLASSNAME, style: buildColumnHeaderCellStyle(getColumnAlign(col.align), col.minWidth) }, col.header))))));
44
+ }
45
+ //# sourceMappingURL=PHXScheduleTableHead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PHXScheduleTableHead.js","sourceRoot":"","sources":["../../../../../src/components/TableSchedule/components/PHXScheduleTableHead.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,cAAc,EACd,wBAAwB,GACzB,MAAM,UAAU,CAAA;AAqBjB;;;;;;;GAOG;AACH,MAAM,iCAAiC,GAAG,CACxC,mBAAwC,EACxC,UAAkB,EAClB,OAAgB,EACe,EAAE,CAAC,CAAC;IACnC,GAAG,mBAAmB;IACtB,UAAU;IACV,OAAO;CACR,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,CAAC,EAChC,iBAAiB,EACjB,0BAA0B,EAC1B,gBAAgB,EAChB,UAAU,EACV,OAAO,GACuB,EAAE,EAAE,CAClC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1D,4BACE,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,EAC/E,KAAK,EAAE,0BAA0B,CAAC;QAChC,KAAK;QACL,YAAY,EAAE,0BAA0B;QACxC,UAAU;KACX,CAAC,GACF,CACH,CAAC,CAAA;AAEJ;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAgC;IACnE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,mBAAmB,EAAE,GAAG,KAAK,CAAA;IAE/D,OAAO,CACL;QACG,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1C;YACE,oBAAC,wBAAwB,OAAK,iCAAiC,CAAC,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,GAAI;YAC7F,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAC/B,4BACE,GAAG,EAAE,EAAE,EACP,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,EAChC,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,yBAAyB,EAAE,IAEjC,KAAK,CAAC,MAAM,CACV,CACN,CAAC,CACC,CACN;QAED;YACG,CAAC,YAAY,IAAI,oBAAC,wBAAwB,OAAK,iCAAiC,CAAC,mBAAmB,EAAE,CAAC,CAAC,GAAI;YAC5G,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACpB,4BACE,GAAG,EAAE,GAAG,CAAC,GAAG,EACZ,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,0BAA0B,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,IAEzE,GAAG,CAAC,MAAM,CACR,CACN,CAAC,CACC,CACC,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { GridLegendItem } from '../types';
3
+ type PHXScheduleTableLegendProps = {
4
+ legendItems?: GridLegendItem[];
5
+ };
6
+ /**
7
+ * Renders the optional legend displayed above the schedule table.
8
+ *
9
+ * @param {PHXScheduleTableLegendProps} props Legend configuration.
10
+ * @returns {React.ReactNode} The legend markup, or null when no items exist.
11
+ */
12
+ export declare const PHXScheduleTableLegend: ({ legendItems }: PHXScheduleTableLegendProps) => React.JSX.Element | null;
13
+ export {};
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { LEGEND_INDICATOR_CLASSNAME, LEGEND_ITEM_CLASSNAME, LEGEND_LABEL_CLASSNAME, LEGEND_LAST_ITEM_CLASSNAME, LEGEND_WRAPPER_CLASSNAME, } from '../constants';
4
+ /**
5
+ * Renders the optional legend displayed above the schedule table.
6
+ *
7
+ * @param {PHXScheduleTableLegendProps} props Legend configuration.
8
+ * @returns {React.ReactNode} The legend markup, or null when no items exist.
9
+ */
10
+ export const PHXScheduleTableLegend = ({ legendItems }) => {
11
+ if (!legendItems || legendItems.length === 0) {
12
+ return null;
13
+ }
14
+ return (React.createElement("div", { className: LEGEND_WRAPPER_CLASSNAME }, legendItems.map((item, index) => {
15
+ var _a;
16
+ return (React.createElement("div", { key: index, className: index === legendItems.length - 1 ? LEGEND_LAST_ITEM_CLASSNAME : LEGEND_ITEM_CLASSNAME },
17
+ React.createElement("div", { className: `h-3 w-3 rounded border border-current ${item.variant ? LEGEND_INDICATOR_CLASSNAME[item.variant] : ''} ${(_a = item.indicatorClassName) !== null && _a !== void 0 ? _a : ''}`.trim() }),
18
+ React.createElement("span", { className: LEGEND_LABEL_CLASSNAME }, item.label)));
19
+ })));
20
+ };
21
+ //# sourceMappingURL=PHXScheduleTableLegend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PHXScheduleTableLegend.js","sourceRoot":"","sources":["../../../../../src/components/TableSchedule/components/PHXScheduleTableLegend.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,cAAc,CAAA;AAOrB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,WAAW,EAA+B,EAAE,EAAE;IACrF,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,wBAAwB,IACrC,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;QAAC,OAAA,CAChC,6BACE,GAAG,EAAE,KAAK,EACV,SAAS,EAAE,KAAK,KAAK,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,qBAAqB;YAEhG,6BACE,SAAS,EAAE,yCACT,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC5D,IAAI,MAAA,IAAI,CAAC,kBAAkB,mCAAI,EAAE,EAAE,CAAC,IAAI,EAAE,GAC1C;YACF,8BAAM,SAAS,EAAE,sBAAsB,IAAG,IAAI,CAAC,KAAK,CAAQ,CACxD,CACP,CAAA;KAAA,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { RefObject } from 'react';
2
+ type UseStickyShadowParams = {
3
+ scrollContainerRef: RefObject<HTMLDivElement | null>;
4
+ columnsLength: number;
5
+ rowsLength: number;
6
+ stickyHeaderCount: number;
7
+ };
8
+ /**
9
+ * Tracks whether the sticky-header shadow should be visible based on horizontal scroll.
10
+ *
11
+ * @param {UseStickyShadowParams} params Dependencies required to recalculate shadow visibility.
12
+ * @returns {boolean} True when the table has been horizontally scrolled.
13
+ */
14
+ export declare const useStickyShadow: ({ scrollContainerRef, columnsLength, rowsLength, stickyHeaderCount, }: UseStickyShadowParams) => boolean;
15
+ export {};
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+ import { useEffect, useState } from 'react';
3
+ /**
4
+ * Tracks whether the sticky-header shadow should be visible based on horizontal scroll.
5
+ *
6
+ * @param {UseStickyShadowParams} params Dependencies required to recalculate shadow visibility.
7
+ * @returns {boolean} True when the table has been horizontally scrolled.
8
+ */
9
+ export const useStickyShadow = ({ scrollContainerRef, columnsLength, rowsLength, stickyHeaderCount, }) => {
10
+ const [showStickyShadow, setShowStickyShadow] = useState(false);
11
+ useEffect(() => {
12
+ const container = scrollContainerRef.current;
13
+ if (!container)
14
+ return;
15
+ /**
16
+ * Synchronizes the sticky shadow state with the container's horizontal scroll position.
17
+ *
18
+ * @returns {void}
19
+ */
20
+ const updateStickyShadow = () => {
21
+ setShowStickyShadow(container.scrollLeft > 0);
22
+ };
23
+ updateStickyShadow();
24
+ container.addEventListener('scroll', updateStickyShadow, { passive: true });
25
+ window.addEventListener('resize', updateStickyShadow);
26
+ return () => {
27
+ container.removeEventListener('scroll', updateStickyShadow);
28
+ window.removeEventListener('resize', updateStickyShadow);
29
+ };
30
+ }, [columnsLength, rowsLength, stickyHeaderCount, scrollContainerRef]);
31
+ return showStickyShadow;
32
+ };
33
+ //# sourceMappingURL=useStickyShadow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStickyShadow.js","sourceRoot":"","sources":["../../../../../src/components/TableSchedule/components/useStickyShadow.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAGZ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAS3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,iBAAiB,GACK,EAAE,EAAE;IAC1B,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE/D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAA;QAC5C,IAAI,CAAC,SAAS;YAAE,OAAM;QAEtB;;;;WAIG;QACH,MAAM,kBAAkB,GAAG,GAAG,EAAE;YAC9B,mBAAmB,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAA;QAC/C,CAAC,CAAA;QAED,kBAAkB,EAAE,CAAA;QACpB,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3E,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;QAErD,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;YAC3D,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;QAC1D,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC,CAAA;IAEtE,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { CSSProperties } from 'react';
2
+ import { GridCellVariant, GridColumnAlign, GridRowHeaderAlign } from './types';
3
+ export declare const BORDER = "0.5px solid var(--color-border-tertiary, #e5e7eb)";
4
+ export declare const stickyBase: CSSProperties;
5
+ export declare const thBase: CSSProperties;
6
+ export declare const HEADER_TH_CLASSNAME = "whitespace-nowrap bg-white px-3 py-2 text-xs font-semibold text-gray-900";
7
+ export declare const STICKY_SHADOW_CLASSNAME = "drop-shadow-[4px_0_4px_rgba(0,0,0,0.1)]";
8
+ export declare const LEGEND_WRAPPER_CLASSNAME = "mb-3 flex w-fit items-center gap-2 rounded-lg bg-white p-2";
9
+ export declare const LEGEND_ITEM_CLASSNAME = "ml-2 flex items-center gap-1";
10
+ export declare const LEGEND_LAST_ITEM_CLASSNAME = "ml-2 mr-2 flex items-center gap-1";
11
+ export declare const LEGEND_LABEL_CLASSNAME = "text-xs font-normal text-gray-900";
12
+ export declare const TABLE_SCROLL_CONTAINER_CLASSNAME = "overflow-x-auto rounded-lg bg-white";
13
+ export declare const TABLE_CLASSNAME = "w-full border-collapse";
14
+ export declare const TABLE_SCROLL_CONTAINER_STYLE: CSSProperties;
15
+ export declare const TABLE_STYLE: CSSProperties;
16
+ export declare const ROW_HEADER_CONTENT_CLASSNAME = "flex flex-col";
17
+ export declare const ROW_HEADER_ALIGN_CLASSNAME: Record<GridRowHeaderAlign, string>;
18
+ export declare const ROW_HEADER_TITLE_CLASSNAME = "text-xs font-semibold text-gray-900";
19
+ export declare const ROW_HEADER_DESCRIPTION_CLASSNAME = "text-xs text-gray-600";
20
+ export declare const CELL_BOX_BASE_CLASSNAME = "flex h-[30px] w-[176px] items-center overflow-hidden rounded-lg border-[0.5px] px-2.5 text-left text-xs font-normal shadow-sm";
21
+ export declare const CELL_BOX_VARIANT_CLASSNAME: Record<GridCellVariant, string>;
22
+ export declare const LEGEND_INDICATOR_CLASSNAME: Record<GridCellVariant, string>;
23
+ export declare const CELL_WRAPPER_ALIGN_CLASSNAME: Record<GridColumnAlign, string>;
24
+ /**
25
+ * Returns the wrapper alignment class for a cell based on the column alignment.
26
+ *
27
+ * @param {GridColumnAlign} align The alignment configured for the column.
28
+ * @returns {string} The Tailwind class used to align the cell wrapper content.
29
+ */
30
+ export declare const getCellWrapperAlignClassName: (align: GridColumnAlign) => string;
31
+ export declare const TOOLTIP_CONTENT_CLASSNAME = "flex max-w-[320px] flex-col gap-2 text-left";
32
+ export declare const TOOLTIP_TITLE_CLASSNAME = "text-xs font-semibold leading-5 text-gray-800";
33
+ export declare const TOOLTIP_SECTION_CLASSNAME = "flex flex-col gap-0.5";
34
+ export declare const TOOLTIP_LABEL_CLASSNAME = "text-xs leading-5 text-gray-500";
35
+ export declare const TOOLTIP_VALUE_CLASSNAME = "text-xs font-semibold leading-5 text-gray-800";
36
+ export declare const DEFAULT_TOOLTIP_CLASSNAME = "w-fit !px-5 !py-4";
37
+ export declare const SCHEDULE_CELL_CLASSNAME = "flex flex-col gap-2 text-left";
38
+ export declare const SCHEDULE_TITLE_CLASSNAME = "text-sm font-semibold leading-5 text-gray-800";
39
+ export declare const SCHEDULE_TITLE_DOTTED_CLASSNAME = "inline-block w-fit border-b-2 border-dotted border-gray-300 text-sm font-semibold leading-5 text-gray-800";
40
+ export declare const SCHEDULE_SECTION_CLASSNAME = "flex flex-col gap-1";
41
+ export declare const SCHEDULE_SECTION_LABEL_CLASSNAME = "flex items-center gap-1.5 text-xs font-normal leading-5 text-gray-500";
42
+ export declare const SCHEDULE_SECTION_VALUE_CLASSNAME = "text-sm font-semibold leading-5 text-gray-800";
43
+ export declare const SCHEDULE_EMPTY_TITLE_CLASSNAME = "text-sm font-semibold leading-5 text-gray-800";
44
+ export declare const SCHEDULE_EMPTY_DESCRIPTION_CLASSNAME = "text-xs font-normal leading-5 text-gray-500";
45
+ export declare const BOXED_CELL_PADDING_CLASSNAME = "px-1 py-1";
46
+ export declare const PLAIN_CELL_PADDING_CLASSNAME = "px-2 py-1.5";
47
+ export declare const BUTTON_BASE_CLASSNAME = "!shadow-none !flex !w-full !rounded-none !text-left";
48
+ export declare const CELL_CONTENT_BASE_CLASSNAME = "flex w-full text-left";
49
+ export declare const DATA_CELL_BASE_CLASSNAME = "align-middle border-l p-0";
@@ -0,0 +1,81 @@
1
+ 'use client';
2
+ export const BORDER = '0.5px solid var(--color-border-tertiary, #e5e7eb)';
3
+ export const stickyBase = {
4
+ position: 'sticky',
5
+ left: 0,
6
+ zIndex: 2,
7
+ background: 'var(--color-background-primary, #fff)',
8
+ borderRight: BORDER,
9
+ };
10
+ export const thBase = {
11
+ borderBottom: BORDER,
12
+ textAlign: 'center',
13
+ };
14
+ export const HEADER_TH_CLASSNAME = 'whitespace-nowrap bg-white px-3 py-2 text-xs font-semibold text-gray-900';
15
+ export const STICKY_SHADOW_CLASSNAME = 'drop-shadow-[4px_0_4px_rgba(0,0,0,0.1)]';
16
+ export const LEGEND_WRAPPER_CLASSNAME = 'mb-3 flex w-fit items-center gap-2 rounded-lg bg-white p-2';
17
+ export const LEGEND_ITEM_CLASSNAME = 'ml-2 flex items-center gap-1';
18
+ export const LEGEND_LAST_ITEM_CLASSNAME = 'ml-2 mr-2 flex items-center gap-1';
19
+ export const LEGEND_LABEL_CLASSNAME = 'text-xs font-normal text-gray-900';
20
+ export const TABLE_SCROLL_CONTAINER_CLASSNAME = 'overflow-x-auto rounded-lg bg-white';
21
+ export const TABLE_CLASSNAME = 'w-full border-collapse';
22
+ export const TABLE_SCROLL_CONTAINER_STYLE = {
23
+ border: BORDER,
24
+ };
25
+ export const TABLE_STYLE = {
26
+ width: '100%',
27
+ borderCollapse: 'collapse',
28
+ };
29
+ export const ROW_HEADER_CONTENT_CLASSNAME = 'flex flex-col';
30
+ export const ROW_HEADER_ALIGN_CLASSNAME = {
31
+ left: 'items-start text-left',
32
+ center: 'items-center text-center',
33
+ right: 'items-end text-right',
34
+ };
35
+ export const ROW_HEADER_TITLE_CLASSNAME = 'text-xs font-semibold text-gray-900';
36
+ export const ROW_HEADER_DESCRIPTION_CLASSNAME = 'text-xs text-gray-600';
37
+ export const CELL_BOX_BASE_CLASSNAME = 'flex h-[30px] w-[176px] items-center overflow-hidden rounded-lg border-[0.5px] px-2.5 text-left text-xs font-normal shadow-sm';
38
+ export const CELL_BOX_VARIANT_CLASSNAME = {
39
+ default: 'border-gray-500 bg-white text-gray-900',
40
+ moving: 'border-gray-500 bg-[#FFD6A4] text-gray-900',
41
+ trogiang: 'border-[#00527C] bg-[#E0F0FF] text-[#00527C]',
42
+ empty: 'border-gray-500 bg-white text-gray-900',
43
+ };
44
+ export const LEGEND_INDICATOR_CLASSNAME = {
45
+ default: '',
46
+ moving: 'bg-[#FFD6A4]',
47
+ trogiang: 'border-[#00527C] bg-[#E0F0FF]',
48
+ empty: '',
49
+ };
50
+ export const CELL_WRAPPER_ALIGN_CLASSNAME = {
51
+ left: 'justify-start',
52
+ center: 'justify-center',
53
+ right: 'justify-end',
54
+ };
55
+ /**
56
+ * Returns the wrapper alignment class for a cell based on the column alignment.
57
+ *
58
+ * @param {GridColumnAlign} align The alignment configured for the column.
59
+ * @returns {string} The Tailwind class used to align the cell wrapper content.
60
+ */
61
+ export const getCellWrapperAlignClassName = (align) => CELL_WRAPPER_ALIGN_CLASSNAME[align];
62
+ export const TOOLTIP_CONTENT_CLASSNAME = 'flex max-w-[320px] flex-col gap-2 text-left';
63
+ export const TOOLTIP_TITLE_CLASSNAME = 'text-xs font-semibold leading-5 text-gray-800';
64
+ export const TOOLTIP_SECTION_CLASSNAME = 'flex flex-col gap-0.5';
65
+ export const TOOLTIP_LABEL_CLASSNAME = 'text-xs leading-5 text-gray-500';
66
+ export const TOOLTIP_VALUE_CLASSNAME = 'text-xs font-semibold leading-5 text-gray-800';
67
+ export const DEFAULT_TOOLTIP_CLASSNAME = 'w-fit !px-5 !py-4';
68
+ export const SCHEDULE_CELL_CLASSNAME = 'flex flex-col gap-2 text-left';
69
+ export const SCHEDULE_TITLE_CLASSNAME = 'text-sm font-semibold leading-5 text-gray-800';
70
+ export const SCHEDULE_TITLE_DOTTED_CLASSNAME = 'inline-block w-fit border-b-2 border-dotted border-gray-300 text-sm font-semibold leading-5 text-gray-800';
71
+ export const SCHEDULE_SECTION_CLASSNAME = 'flex flex-col gap-1';
72
+ export const SCHEDULE_SECTION_LABEL_CLASSNAME = 'flex items-center gap-1.5 text-xs font-normal leading-5 text-gray-500';
73
+ export const SCHEDULE_SECTION_VALUE_CLASSNAME = 'text-sm font-semibold leading-5 text-gray-800';
74
+ export const SCHEDULE_EMPTY_TITLE_CLASSNAME = 'text-sm font-semibold leading-5 text-gray-800';
75
+ export const SCHEDULE_EMPTY_DESCRIPTION_CLASSNAME = 'text-xs font-normal leading-5 text-gray-500';
76
+ export const BOXED_CELL_PADDING_CLASSNAME = 'px-1 py-1';
77
+ export const PLAIN_CELL_PADDING_CLASSNAME = 'px-2 py-1.5';
78
+ export const BUTTON_BASE_CLASSNAME = '!shadow-none !flex !w-full !rounded-none !text-left';
79
+ export const CELL_CONTENT_BASE_CLASSNAME = 'flex w-full text-left';
80
+ export const DATA_CELL_BASE_CLASSNAME = 'align-middle border-l p-0';
81
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/components/TableSchedule/constants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAKZ,MAAM,CAAC,MAAM,MAAM,GAAG,mDAAmD,CAAA;AAEzE,MAAM,CAAC,MAAM,UAAU,GAAkB;IACvC,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,uCAAuC;IACnD,WAAW,EAAE,MAAM;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAkB;IACnC,YAAY,EAAE,MAAM;IACpB,SAAS,EAAE,QAAQ;CACpB,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,0EAA0E,CAAA;AAE7G,MAAM,CAAC,MAAM,uBAAuB,GAAG,yCAAyC,CAAA;AAEhF,MAAM,CAAC,MAAM,wBAAwB,GAAG,4DAA4D,CAAA;AACpG,MAAM,CAAC,MAAM,qBAAqB,GAAG,8BAA8B,CAAA;AACnE,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAA;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,mCAAmC,CAAA;AAEzE,MAAM,CAAC,MAAM,gCAAgC,GAAG,qCAAqC,CAAA;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,wBAAwB,CAAA;AACvD,MAAM,CAAC,MAAM,4BAA4B,GAAkB;IACzD,MAAM,EAAE,MAAM;CACf,CAAA;AACD,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,KAAK,EAAE,MAAM;IACb,cAAc,EAAE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AA;AAE5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,+BAA+B,CAAA;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,+CAA+C,CAAA;AACvF,MAAM,CAAC,MAAM,+BAA+B,GAC1C,2GAA2G,CAAA;AAC7G,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAA;AAC/D,MAAM,CAAC,MAAM,gCAAgC,GAAG,uEAAuE,CAAA;AACvH,MAAM,CAAC,MAAM,gCAAgC,GAAG,+CAA+C,CAAA;AAC/F,MAAM,CAAC,MAAM,8BAA8B,GAAG,+CAA+C,CAAA;AAC7F,MAAM,CAAC,MAAM,oCAAoC,GAAG,6CAA6C,CAAA;AAEjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,WAAW,CAAA;AACvD,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAA;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qDAAqD,CAAA;AAC1F,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAAA;AAClE,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './PHXScheduleTable';
@@ -0,0 +1,2 @@
1
+ export * from './PHXScheduleTable';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/TableSchedule/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { GridCellData, GridRowHeader, GridScheduleContent } from './types';
3
+ /**
4
+ * Renders the content displayed inside a sticky row-header cell.
5
+ *
6
+ * @param {GridRowHeader} header The row-header configuration object.
7
+ * @returns {React.ReactNode} The rendered header content, or null when nothing is configured.
8
+ */
9
+ export declare const renderRowHeaderContent: (header: GridRowHeader) => string | number | bigint | true | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | React.JSX.Element | null;
10
+ /**
11
+ * Renders the boxed visual treatment used by default-layout schedule cells.
12
+ *
13
+ * @param {GridCellData} cell The cell data to render.
14
+ * @returns {React.ReactNode} The boxed content node for the cell.
15
+ */
16
+ export declare const renderCellBoxContent: (cell: GridCellData) => React.JSX.Element;
17
+ /**
18
+ * Renders the rich schedule layout used by plain schedule cells.
19
+ *
20
+ * @param {GridScheduleContent} scheduleContent The structured schedule content to render.
21
+ * @param {string} [userDetailPageUrl] The base URL used to build person detail links.
22
+ * @returns {React.ReactNode} The rendered schedule content.
23
+ */
24
+ export declare const renderScheduleContent: (scheduleContent: GridScheduleContent, userDetailPageUrl?: string) => React.JSX.Element;
25
+ /**
26
+ * Resolves and renders the tooltip content for a data cell.
27
+ *
28
+ * @param {GridCellData} cell The cell whose tooltip content should be rendered.
29
+ * @param {string} [userDetailPageUrl] The base URL used to build person detail links.
30
+ * @returns {React.ReactNode} The tooltip content, or null when the cell has no tooltip payload.
31
+ */
32
+ export declare const renderTooltipContent: (cell: GridCellData, userDetailPageUrl?: string) => string | number | bigint | true | Iterable<React.ReactNode> | Promise<React.AwaitedReactNode> | React.JSX.Element | null;
33
+ /**
34
+ * Resolves the tooltip container class name for a cell.
35
+ *
36
+ * @param {GridCellData} cell The cell that may override the tooltip class.
37
+ * @returns {string} The tooltip class name to apply.
38
+ */
39
+ export declare const resolveTooltipClassName: (cell: GridCellData) => string;