@ganpatiinfo/gids-react-web 14.0.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts +29 -5
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts.map +1 -1
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js +19 -3
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js.map +1 -1
- package/dist/components/GidsBasicTableHead/GidsBasicTableHead.d.ts +25 -0
- package/dist/components/GidsBasicTableHead/GidsBasicTableHead.d.ts.map +1 -1
- package/dist/components/GidsBasicTableHead/GidsBasicTableHead.js +5 -0
- package/dist/components/GidsBasicTableHead/GidsBasicTableHead.js.map +1 -1
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.d.ts +23 -4
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.d.ts.map +1 -1
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js +7 -2
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js.map +1 -1
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts +20 -4
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts.map +1 -1
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js +20 -5
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js.map +1 -1
- package/dist/components/GidsBsTable/GidsBsTable.d.ts +29 -5
- package/dist/components/GidsBsTable/GidsBsTable.d.ts.map +1 -1
- package/dist/components/GidsBsTable/GidsBsTable.js +21 -5
- package/dist/components/GidsBsTable/GidsBsTable.js.map +1 -1
- package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts +7 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts.map +1 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.js +41 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.js.map +1 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts +17 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts.map +1 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js +73 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts +12 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js +65 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts +12 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js +34 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js.map +1 -0
- package/dist/components/GidsDialog/GidsDialog.d.ts +13 -0
- package/dist/components/GidsDialog/GidsDialog.d.ts.map +1 -0
- package/dist/components/GidsDialog/GidsDialog.js +111 -0
- package/dist/components/GidsDialog/GidsDialog.js.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts +34 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js +38 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +34 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +58 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js.map +1 -0
- package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.js +6 -3
- package/dist/components/GidsMenu/GidsMenu.js.map +1 -1
- package/dist/components/GidsPagination/GidsPagination.d.ts +9 -0
- package/dist/components/GidsPagination/GidsPagination.d.ts.map +1 -1
- package/dist/components/GidsPagination/GidsPagination.js +9 -15
- package/dist/components/GidsPagination/GidsPagination.js.map +1 -1
- package/dist/components/GidsPaginator/GidsPaginator.d.ts +7 -0
- package/dist/components/GidsPaginator/GidsPaginator.d.ts.map +1 -0
- package/dist/components/GidsPaginator/GidsPaginator.js +142 -0
- package/dist/components/GidsPaginator/GidsPaginator.js.map +1 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts +7 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts.map +1 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js +29 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js.map +1 -0
- package/dist/components/GidsTable/GidsTable.d.ts +16 -0
- package/dist/components/GidsTable/GidsTable.d.ts.map +1 -0
- package/dist/components/GidsTable/GidsTable.js +57 -0
- package/dist/components/GidsTable/GidsTable.js.map +1 -0
- package/dist/components/GidsTableBody/GidsTableBody.d.ts +12 -0
- package/dist/components/GidsTableBody/GidsTableBody.d.ts.map +1 -0
- package/dist/components/GidsTableBody/GidsTableBody.js +44 -0
- package/dist/components/GidsTableBody/GidsTableBody.js.map +1 -0
- package/dist/components/GidsTableCell/GidsTableCell.d.ts +22 -0
- package/dist/components/GidsTableCell/GidsTableCell.d.ts.map +1 -0
- package/dist/components/GidsTableCell/GidsTableCell.js +91 -0
- package/dist/components/GidsTableCell/GidsTableCell.js.map +1 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.d.ts +10 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.d.ts.map +1 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.js +175 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.js.map +1 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts +12 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts.map +1 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.js +23 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.js.map +1 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts +8 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts.map +1 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js +45 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js.map +1 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts +10 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts.map +1 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.js +20 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.js.map +1 -0
- package/dist/components/GidsTableRow/GidsTableRow.d.ts +10 -0
- package/dist/components/GidsTableRow/GidsTableRow.d.ts.map +1 -0
- package/dist/components/GidsTableRow/GidsTableRow.js +24 -0
- package/dist/components/GidsTableRow/GidsTableRow.js.map +1 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts +15 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts.map +1 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.js +26 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.js.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts +8 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js +79 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js.map +1 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts +9 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts.map +1 -1
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.js +4 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.js.map +1 -1
- package/dist/components/stencil-generated/components.d.ts +3 -0
- package/dist/components/stencil-generated/components.d.ts.map +1 -1
- package/dist/components/stencil-generated/components.js +3 -0
- package/dist/components/stencil-generated/components.js.map +1 -1
- package/dist/components/stencil-generated/gids-advanced-tooltip.d.ts +10 -0
- package/dist/components/stencil-generated/gids-advanced-tooltip.d.ts.map +1 -0
- package/dist/components/stencil-generated/gids-advanced-tooltip.js +13 -0
- package/dist/components/stencil-generated/gids-advanced-tooltip.js.map +1 -0
- package/dist/components/stencil-generated/gids-skeleton.d.ts +10 -0
- package/dist/components/stencil-generated/gids-skeleton.d.ts.map +1 -0
- package/dist/components/stencil-generated/gids-skeleton.js +13 -0
- package/dist/components/stencil-generated/gids-skeleton.js.map +1 -0
- package/dist/components/stencil-generated/gids-transfer-list.d.ts +10 -0
- package/dist/components/stencil-generated/gids-transfer-list.d.ts.map +1 -0
- package/dist/components/stencil-generated/gids-transfer-list.js +13 -0
- package/dist/components/stencil-generated/gids-transfer-list.js.map +1 -0
- package/dist/index.d.ts +104 -84
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +104 -84
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts +0 -6
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts.map +0 -1
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js +0 -22
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GidsCrossTableWebUtils, isValidChildren, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { GidsTableToolbar, } from '../GidsTableToolbar/GidsTableToolbar';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { GidsTableHeader, } from '../GidsTableHeader/GidsTableHeader';
|
|
6
|
+
import { GidsCrossTableBody, } from '../GidsCrossTableBody/GidsCrossTableBody';
|
|
7
|
+
import { GidsTableFooter } from '../GidsTableFooter/GidsTableFooter';
|
|
8
|
+
import { GidsTableFooterControl } from '../GidsTableFooterControl/GidsTableFooterControl';
|
|
9
|
+
const { getGidsCrossTableClassNames, getCustomisedCrossTableHeaderEntries, getCustomisedCrossTableFooterEntries, getCrossTableBodyBorder, } = GidsCrossTableWebUtils;
|
|
10
|
+
export const GidsCrossTable = ({ toolbar, toolbarChildren, headerItems = [], bodyContent = [], isHeaderVisible, isToolbarVisible, bodySettings, toolbarSettings, headerSettings, tableBorders, tableBorderRadius, tableBodyMaxHeight = 200, horizontalScroll = false, crossHeaderSettings, onCrossTableAction, footerItems = [], footerSettings, isFooterVisible = false, isFooterControlVisible = false, footerControlSettings, footerControl, children, className, }) => {
|
|
11
|
+
const scrollContainerClassName = clsx('gids-cross-table__scroll-container', {
|
|
12
|
+
'gids-cross-table__scroll-container--horizontal-scroll': horizontalScroll,
|
|
13
|
+
});
|
|
14
|
+
const scrollContainerStyle = tableBodyMaxHeight
|
|
15
|
+
? {
|
|
16
|
+
maxHeight: `${tableBodyMaxHeight}px`,
|
|
17
|
+
}
|
|
18
|
+
: undefined;
|
|
19
|
+
function onActionBtnClick(event) {
|
|
20
|
+
if (onCrossTableAction) {
|
|
21
|
+
onCrossTableAction({
|
|
22
|
+
...event,
|
|
23
|
+
details: {
|
|
24
|
+
...event.details,
|
|
25
|
+
columnIndex: event?.details?.entryIndex,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const renderTableToolbar = () => {
|
|
31
|
+
/*
|
|
32
|
+
* Toolbar
|
|
33
|
+
*/
|
|
34
|
+
if (isValidChildren(toolbar)) {
|
|
35
|
+
return toolbar;
|
|
36
|
+
}
|
|
37
|
+
else if (isToolbarVisible) {
|
|
38
|
+
return (React.createElement(GidsTableToolbar, { ...toolbarSettings, onBlur: toolbarSettings?.onBlur, onChange: toolbarSettings?.onChange, onFocus: toolbarSettings?.onFocus, onInput: toolbarSettings?.onInput, onGidsSearchBarClear: toolbarSettings?.onGidsSearchBarClear }, toolbarChildren));
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
};
|
|
42
|
+
const renderFooterControl = () => {
|
|
43
|
+
/*
|
|
44
|
+
* Footer Control
|
|
45
|
+
*/
|
|
46
|
+
if (isFooterControlVisible || isValidChildren(footerControl)) {
|
|
47
|
+
return (React.createElement(GidsTableFooterControl, { ...footerControlSettings, tableViewControllerSettings: footerControlSettings?.tableViewControllerSettings }, footerControl));
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
};
|
|
51
|
+
return (React.createElement("div", { className: getGidsCrossTableClassNames({ tableBorders, tableBorderRadius }, className) },
|
|
52
|
+
renderTableToolbar(),
|
|
53
|
+
isValidChildren(children) ? (React.createElement("div", { className: scrollContainerClassName, style: scrollContainerStyle },
|
|
54
|
+
React.createElement("table", { className: clsx('gids-cross-table__main-table', {
|
|
55
|
+
'gids-cross-table__main-table--horizontal-scroll': horizontalScroll,
|
|
56
|
+
}) }, children))) : (React.createElement("div", { className: scrollContainerClassName, style: scrollContainerStyle },
|
|
57
|
+
React.createElement("table", { className: clsx('gids-cross-table__main-table', {
|
|
58
|
+
'gids-cross-table__main-table--horizontal-scroll': horizontalScroll,
|
|
59
|
+
}) },
|
|
60
|
+
isHeaderVisible && headerItems && headerItems.length > 0 ? (React.createElement(GidsTableHeader, { ...headerSettings, headerItems: getCustomisedCrossTableHeaderEntries({
|
|
61
|
+
headerItems: [{}, ...headerItems],
|
|
62
|
+
tableBorders,
|
|
63
|
+
}), onHeaderAction: onActionBtnClick })) : undefined,
|
|
64
|
+
bodyContent && bodyContent.length > 0 ? (React.createElement(GidsCrossTableBody, { bodyBorder: getCrossTableBodyBorder({
|
|
65
|
+
tableBorders,
|
|
66
|
+
}), bodyContent: bodyContent, bodySettings: bodySettings, crossHeaderSettings: crossHeaderSettings, onCrossTableBodyAction: onActionBtnClick })) : undefined,
|
|
67
|
+
isFooterVisible && footerItems && footerItems.length > 0 ? (React.createElement(GidsTableFooter, { ...footerSettings, footerItems: getCustomisedCrossTableFooterEntries({
|
|
68
|
+
footerItems: [{}, ...footerItems],
|
|
69
|
+
tableBorders,
|
|
70
|
+
}), onFooterAction: onActionBtnClick })) : undefined))),
|
|
71
|
+
renderFooterControl()));
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=GidsCrossTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTable.js","sourceRoot":"","sources":["../../../src/components/GidsCrossTable/GidsCrossTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAIN,MAAM,OAAO,CAAC;AAMf,OAAO,EAEN,sBAAsB,EAEtB,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,gBAAgB,GAEhB,MAAM,sCAAsC,CAAC;AAK9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACN,eAAe,GAEf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,kBAAkB,GAElB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAE1F,MAAM,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,oCAAoC,EACpC,uBAAuB,GACvB,GAAG,sBAAsB,CAAC;AAyD3B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC9B,OAAO,EACP,eAAe,EACf,WAAW,GAAG,EAAE,EAChB,WAAW,GAAG,EAAE,EAChB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GAAG,GAAG,EACxB,gBAAgB,GAAG,KAAK,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,GAAG,EAAE,EAChB,cAAc,EACd,eAAe,GAAG,KAAK,EACvB,sBAAsB,GAAG,KAAK,EAC9B,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,SAAS,GACY,EAAE,EAAE;IACzB,MAAM,wBAAwB,GAAG,IAAI,CAAC,oCAAoC,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AAC,EAAE,EAAE,GAAG,WAAW,CAAC;wBACjC,YAAY;qBACZ,CAAC,EACF,cAAc,EAAE,gBAAgB,GAC/B,CACF,CAAC,CAAC,CAAC,SAAS,CACN,CACH,CACN;QACA,mBAAmB,EAAE,CACjB,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type MouseEvent, type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import { GidsCrossTableBodyActionEvent } from '@ganpatiinfo/gids-core-shared';
|
|
3
|
+
import { GidsCrossTableBodyWebProps, GidsTableEntryTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
4
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
5
|
+
type GidsCrossTableBodyBaseWebProps = GidsCrossTableBodyWebProps<GidsTableEntryTypographyStyle, IconName, IconAppearance, ReactNode> & Pick<ComponentPropsWithoutRef<'tbody'>, 'className'>;
|
|
6
|
+
export type GidsCrossTableBodyActionBaseEvent = GidsCrossTableBodyActionEvent<MouseEvent, GidsTableEntryTypographyStyle, IconName, IconAppearance>;
|
|
7
|
+
export interface GidsCrossTableBodyProps extends GidsCrossTableBodyBaseWebProps {
|
|
8
|
+
onCrossTableBodyAction?: (event: GidsCrossTableBodyActionBaseEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const GidsCrossTableBody: ({ bodySettings, bodyContent, bodyBorder, crossHeaderSettings, onCrossTableBodyAction, className, children, }: GidsCrossTableBodyProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=GidsCrossTableBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableBody.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCrossTableBody/GidsCrossTableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACb,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EACN,0BAA0B,EAE1B,6BAA6B,EAE7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAa/C,KAAK,8BAA8B,GAAG,0BAA0B,CAC/D,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,SAAS,CACT,GACA,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;AAEtD,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAC5E,UAAU,EACV,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,uBAAwB,SAAQ,8BAA8B;IAC9E,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,IAAI,CAAC;CAC5E;AAED,eAAO,MAAM,kBAAkB,GAAI,8GAQhC,uBAAuB,sBA+GzB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GidsCrossTableBodyWebUtils, isValidChildren, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { GidsCrossTableRow } from '../GidsCrossTableRow/GidsCrossTableRow';
|
|
4
|
+
const { getGidsCrossTableBodyClassNames, getConstructedCrossTableBodyContent, getCrossTableBodyRowEntryBackgroundColor, getCrossTableBodyRowEntryContentColor, getCrossTableBodyRowEntryActionsBackgroundColor, getCrossTableBodyRowEntryActionsContentColor, } = GidsCrossTableBodyWebUtils;
|
|
5
|
+
export const GidsCrossTableBody = ({ bodySettings, bodyContent = [], bodyBorder = 'none', crossHeaderSettings, onCrossTableBodyAction, className, children, }) => {
|
|
6
|
+
const constructedCrossTableBodyContent = getConstructedCrossTableBodyContent({
|
|
7
|
+
bodyContent,
|
|
8
|
+
bodyBorder,
|
|
9
|
+
});
|
|
10
|
+
function onCrossTableRowActionBtnClick({ event, rowIndex, }) {
|
|
11
|
+
if (onCrossTableBodyAction) {
|
|
12
|
+
onCrossTableBodyAction({
|
|
13
|
+
...event,
|
|
14
|
+
details: {
|
|
15
|
+
...event.details,
|
|
16
|
+
rowIndex,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return (React.createElement("tbody", { className: getGidsCrossTableBodyClassNames(className) }, isValidChildren(children)
|
|
22
|
+
? children
|
|
23
|
+
: constructedCrossTableBodyContent.map((constructedCrossTableBody, indexI) => {
|
|
24
|
+
const constructedBodyRowItems = constructedCrossTableBody?.rowItems ?? [];
|
|
25
|
+
const rowBgColor = getCrossTableBodyRowEntryBackgroundColor({
|
|
26
|
+
bodySettings,
|
|
27
|
+
rowIndex: indexI,
|
|
28
|
+
});
|
|
29
|
+
const rowContentColor = getCrossTableBodyRowEntryContentColor({
|
|
30
|
+
bodySettings,
|
|
31
|
+
rowIndex: indexI,
|
|
32
|
+
});
|
|
33
|
+
const rowActionsBgColor = getCrossTableBodyRowEntryActionsBackgroundColor({
|
|
34
|
+
bodySettings,
|
|
35
|
+
rowIndex: indexI,
|
|
36
|
+
});
|
|
37
|
+
const rowActionsContentColor = getCrossTableBodyRowEntryActionsContentColor({
|
|
38
|
+
bodySettings,
|
|
39
|
+
rowIndex: indexI,
|
|
40
|
+
});
|
|
41
|
+
return (React.createElement(GidsCrossTableRow, { ...bodySettings, key: `${indexI + 1}`, rows: constructedBodyRowItems,
|
|
42
|
+
/*
|
|
43
|
+
* Cross Header
|
|
44
|
+
*
|
|
45
|
+
* sideHeaderItem = actual content
|
|
46
|
+
* for this specific row.
|
|
47
|
+
*/
|
|
48
|
+
crossHeaderItem: constructedCrossTableBody?.crossHeaderItem,
|
|
49
|
+
/*
|
|
50
|
+
* Cross Header Settings
|
|
51
|
+
*
|
|
52
|
+
* Shared configuration/style for
|
|
53
|
+
* all side-header cells.
|
|
54
|
+
*/
|
|
55
|
+
crossHeaderSettings: crossHeaderSettings,
|
|
56
|
+
/*
|
|
57
|
+
* Body row styling
|
|
58
|
+
*/
|
|
59
|
+
backgroundColor: rowBgColor, contentColor: rowContentColor, actionsBackgroundColor: rowActionsBgColor, actionsContentColor: rowActionsContentColor, onCrossTableRowAction: (event) => onCrossTableRowActionBtnClick({
|
|
60
|
+
event,
|
|
61
|
+
rowIndex: indexI,
|
|
62
|
+
}) }));
|
|
63
|
+
})));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=GidsCrossTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableBody.js","sourceRoot":"","sources":["../../../src/components/GidsCrossTableBody/GidsCrossTableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAIN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEN,0BAA0B,EAE1B,eAAe,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,MAAM,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,wCAAwC,EACxC,qCAAqC,EACrC,+CAA+C,EAC/C,4CAA4C,GAC5C,GAAG,0BAA0B,CAAC;AAqB/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAClC,YAAY,EACZ,WAAW,GAAG,EAAE,EAChB,UAAU,GAAG,MAAM,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACiB,EAAE,EAAE;IAC7B,MAAM,gCAAgC,GAAG,mCAAmC,CAAC;QAC5E,WAAW;QACX,UAAU;KACV,CAAC,CAAC;IAEH,SAAS,6BAA6B,CAAC,EACtC,KAAK,EACL,QAAQ,GAIR;QACA,IAAI,sBAAsB,EAAE,CAAC;YAC5B,sBAAsB,CAAC;gBACtB,GAAG,KAAK;gBACR,OAAO,EAAE;oBACR,GAAG,KAAK,CAAC,OAAO;oBAChB,QAAQ;iBAC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,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type MouseEvent, type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import { GidsCrossTableRowActionEvent } from '@ganpatiinfo/gids-core-shared';
|
|
3
|
+
import { GidsCrossTableRowWebProps, GidsTableEntryTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
4
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
5
|
+
type GidsCrossTableRowBaseWebProps = GidsCrossTableRowWebProps<GidsTableEntryTypographyStyle, IconName, IconAppearance, ReactNode> & Omit<ComponentPropsWithoutRef<'tr'>, 'children' | 'onClick'>;
|
|
6
|
+
export type GidsCrossTableRowActionBaseEvent = GidsCrossTableRowActionEvent<MouseEvent, GidsTableEntryTypographyStyle, IconName, IconAppearance>;
|
|
7
|
+
export interface GidsCrossTableRowProps extends GidsCrossTableRowBaseWebProps {
|
|
8
|
+
onCrossTableRowAction?: (event: GidsCrossTableRowActionBaseEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const GidsCrossTableRow: ({ rows, crossHeaderItem, crossHeaderSettings, onCrossTableRowAction, textAlignment, appearance, labelTypography, entryAlignment, colorSwatchLabelColor, colorSwatchLabelPosition, colorSwatchLabelTypography, colorSwatchSize, colorSwatchShape, colorSwatchShadow, colorSwatchBorderRadius, colorSwatchApplyBorders, colorSwatchBorderWidth, progressBarSize, progressBarEndCap, avatarSize, avatarGroupAppearance, avatarGroupLayout, statusTagAppearance, statusTagSize, progressBarContainerMinWidth, displayTagsOrientation, statusTagsOrientation, progressBarsOrientation, colorSwatchesOrientation, badgesOrientation, actionsBackgroundColor, actionsContentColor, backgroundColor, contentColor, children, className, }: GidsCrossTableRowProps) => React.JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=GidsCrossTableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableRow.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCrossTableRow/GidsCrossTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACb,KAAK,UAAU,EACf,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EACN,yBAAyB,EAEzB,6BAA6B,EAE7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAM/C,KAAK,6BAA6B,GAAG,yBAAyB,CAC7D,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,SAAS,CACT,GACA,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAC9D,MAAM,MAAM,gCAAgC,GAAG,4BAA4B,CAC1E,UAAU,EACV,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC5E,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;CAC1E;AAED,eAAO,MAAM,iBAAiB,GAAI,msBAqC/B,sBAAsB,sBAwJxB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GidsCrossTableRowWebUtils, isValidChildren, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { GidsTableEntry } from '../GidsTableEntry/GidsTableEntry';
|
|
4
|
+
const { getGidsCrossTableRowClassNames } = GidsCrossTableRowWebUtils;
|
|
5
|
+
export const GidsCrossTableRow = ({ rows = [], crossHeaderItem, crossHeaderSettings, onCrossTableRowAction, textAlignment = 'center', appearance = 'none', labelTypography = 'label-medium', entryAlignment = 'center', colorSwatchLabelColor = 'default', colorSwatchLabelPosition = 'left', colorSwatchLabelTypography = 'label-medium', colorSwatchSize = 'sm', colorSwatchShape = 'oval', colorSwatchShadow = 'shadow-overlay', colorSwatchBorderRadius = 'none', colorSwatchApplyBorders = true, colorSwatchBorderWidth = 'thick', progressBarSize = 'sm', progressBarEndCap = true, avatarSize = 'sm', avatarGroupAppearance, avatarGroupLayout, statusTagAppearance = 'subtle', statusTagSize = 'sm', progressBarContainerMinWidth = 200, displayTagsOrientation = 'horizontal', statusTagsOrientation = 'horizontal', progressBarsOrientation = 'horizontal', colorSwatchesOrientation = 'horizontal', badgesOrientation = 'horizontal', actionsBackgroundColor, actionsContentColor, backgroundColor, contentColor, children, className, }) => {
|
|
6
|
+
function onEntryActionBtnClick({ event, entryIndex, }) {
|
|
7
|
+
if (onCrossTableRowAction) {
|
|
8
|
+
onCrossTableRowAction({
|
|
9
|
+
...event,
|
|
10
|
+
details: {
|
|
11
|
+
...event.details,
|
|
12
|
+
entryIndex,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (isValidChildren(children)) {
|
|
18
|
+
return (React.createElement("tr", { className: getGidsCrossTableRowClassNames(className) }, children));
|
|
19
|
+
}
|
|
20
|
+
return (React.createElement("tr", { className: getGidsCrossTableRowClassNames(className) },
|
|
21
|
+
crossHeaderItem && Object.keys(crossHeaderItem).length > 0 ? (React.createElement(GidsTableEntry, { ...crossHeaderItem, ...crossHeaderSettings, label: crossHeaderItem?.label, entryType: "header", leadingActions: crossHeaderItem?.leadingActions ?? [], trailingActions: crossHeaderItem?.trailingActions ?? [], entryAlignment: crossHeaderSettings?.entryAlignment ?? 'center', colorSwatchLabelColor: crossHeaderSettings?.colorSwatchLabelColor ?? 'default', colorSwatchLabelPosition: crossHeaderSettings?.colorSwatchLabelPosition ?? 'left', colorSwatchLabelTypography: crossHeaderSettings?.colorSwatchLabelTypography ?? 'label-medium', colorSwatchSize: crossHeaderSettings?.colorSwatchSize ?? 'sm', colorSwatchShape: crossHeaderSettings?.colorSwatchShape ?? 'oval', colorSwatchShadow: crossHeaderSettings?.colorSwatchShadow ?? 'shadow-overlay', colorSwatchBorderRadius: crossHeaderSettings?.colorSwatchBorderRadius ?? 'none', colorSwatchApplyBorders: crossHeaderSettings?.colorSwatchApplyBorders ?? true, colorSwatchBorderWidth: crossHeaderSettings?.colorSwatchBorderWidth ?? 'thick', progressBarSize: crossHeaderSettings?.progressBarSize ?? 'sm', progressBarEndCap: crossHeaderSettings?.progressBarEndCap ?? true, avatarSize: crossHeaderSettings?.avatarSize ?? 'sm', avatarGroupAppearance: crossHeaderSettings?.avatarGroupAppearance ?? 'spread', avatarGroupLayout: crossHeaderSettings?.avatarGroupLayout ?? 'wrap', statusTagAppearance: crossHeaderSettings?.statusTagAppearance ?? 'subtle', statusTagSize: crossHeaderSettings?.statusTagSize ?? 'sm', progressBarContainerMinWidth: crossHeaderSettings?.progressBarContainerMinWidth ?? 200, displayTagsOrientation: crossHeaderSettings?.displayTagsOrientation ?? 'horizontal', statusTagsOrientation: crossHeaderSettings?.statusTagsOrientation ?? 'horizontal', progressBarsOrientation: crossHeaderSettings?.progressBarsOrientation ?? 'horizontal', colorSwatchesOrientation: crossHeaderSettings?.colorSwatchesOrientation ?? 'horizontal', badgesOrientation: crossHeaderSettings?.badgesOrientation ?? 'horizontal', textAlignment: crossHeaderSettings?.textAlignment ?? 'center', labelTypography: crossHeaderSettings?.labelTypography ?? 'label-medium', appearance: crossHeaderSettings?.appearance ?? 'none', onEntryAction: (event) => onEntryActionBtnClick({
|
|
22
|
+
event,
|
|
23
|
+
entryIndex: -1,
|
|
24
|
+
}) })) : undefined,
|
|
25
|
+
rows && rows.length > 0
|
|
26
|
+
? rows.map((row, index) => {
|
|
27
|
+
return (React.createElement(GidsTableEntry, { ...row, key: `${index + 1}`, entryType: "body", leadingActions: row?.leadingActions ?? [], trailingActions: row?.trailingActions ?? [], entryAlignment: entryAlignment, colorSwatchLabelColor: colorSwatchLabelColor, colorSwatchLabelPosition: colorSwatchLabelPosition, colorSwatchLabelTypography: colorSwatchLabelTypography, colorSwatchSize: colorSwatchSize, colorSwatchShape: colorSwatchShape, colorSwatchShadow: colorSwatchShadow, colorSwatchBorderRadius: colorSwatchBorderRadius, colorSwatchApplyBorders: colorSwatchApplyBorders, colorSwatchBorderWidth: colorSwatchBorderWidth, progressBarSize: progressBarSize, progressBarEndCap: progressBarEndCap, avatarSize: avatarSize, avatarGroupAppearance: avatarGroupAppearance, avatarGroupLayout: avatarGroupLayout, statusTagAppearance: statusTagAppearance, statusTagSize: statusTagSize, progressBarContainerMinWidth: progressBarContainerMinWidth, displayTagsOrientation: displayTagsOrientation, statusTagsOrientation: statusTagsOrientation, progressBarsOrientation: progressBarsOrientation, colorSwatchesOrientation: colorSwatchesOrientation, badgesOrientation: badgesOrientation, textAlignment: textAlignment, labelTypography: labelTypography, appearance: appearance, backgroundColor: backgroundColor, contentColor: contentColor, actionsBackgroundColor: actionsBackgroundColor, actionsContentColor: actionsContentColor, onEntryAction: (event) => onEntryActionBtnClick({
|
|
28
|
+
event,
|
|
29
|
+
entryIndex: index,
|
|
30
|
+
}) }));
|
|
31
|
+
})
|
|
32
|
+
: undefined));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=GidsCrossTableRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableRow.js","sourceRoot":"","sources":["../../../src/components/GidsCrossTableRow/GidsCrossTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAIN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEN,yBAAyB,EAEzB,eAAe,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,MAAM,EAAE,8BAA8B,EAAE,GAAG,yBAAyB,CAAC;AAoBrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EACjC,IAAI,GAAG,EAAE,EACT,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,G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EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,EAC5C,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,4BAA4B,EAAE,4BAA4B,EAC1D,sBAAsB,EAAE,sBAAsB,EAC9C,qBAAqB,EAAE,qBAAqB,EAC5C,uBAAuB,EAAE,uBAAuB,EAChD,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,CAAC,KAAoC,EAAE,EAAE,CACvD,qBAAqB,CAAC;wBACrB,KAAK;wBACL,UAAU,EAAE,KAAK;qBACjB,CAAC,GAEF,CACF,CAAC;YACH,CAAC,CAAC;YACH,CAAC,CAAC,SAAS,CACR,CACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type GidsDialogWebProps } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
4
|
+
type GidsDialogBaseWebProps = GidsDialogWebProps<React.ReactNode | string, React.MouseEvent | Event, IconName, IconAppearance>;
|
|
5
|
+
export type GidsDialogCustomElement = Omit<HTMLDivElement, 'open'> & {
|
|
6
|
+
element: HTMLDialogElement;
|
|
7
|
+
open: (parent?: HTMLElement) => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
export type GidsDialogProps = GidsDialogBaseWebProps;
|
|
11
|
+
export declare const GidsDialog: React.ForwardRefExoticComponent<GidsDialogBaseWebProps & React.RefAttributes<GidsDialogCustomElement>>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=GidsDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsDialog.d.ts","sourceRoot":"","sources":["../../../src/components/GidsDialog/GidsDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEN,KAAK,kBAAkB,EACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAM/C,KAAK,sBAAsB,GAAG,kBAAkB,CAC/C,KAAK,CAAC,SAAS,GAAG,MAAM,EACxB,KAAK,CAAC,UAAU,GAAG,KAAK,EACxB,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IACpE,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACrC,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAErD,eAAO,MAAM,UAAU,wGA6KtB,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useImperativeHandle, useRef, useState, useEffect } from 'react';
|
|
3
|
+
import { GidsDialogWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
4
|
+
import { GidsDialogControl } from '../_GidsDialogControl/GidsDialogControl.js';
|
|
5
|
+
const { getGidsDialogClassNames } = GidsDialogWebUtils;
|
|
6
|
+
export const GidsDialog = React.forwardRef(({ variant = 'alert', maxWidth = 'sm', scrollMode = 'paper', draggable = false, headerTitle, closeVisible = true, children, footerActions = [], headerDividerVisible = false, footerDividerVisible = false, transition = 'none', cancellable, onCloseDialog, onDialogFooterAction, }, ref) => {
|
|
7
|
+
const wrapperRef = useRef(null);
|
|
8
|
+
const [isActive, setIsActive] = useState(false);
|
|
9
|
+
const nativeClose = HTMLDialogElement.prototype.close;
|
|
10
|
+
const getInnerDialog = () => {
|
|
11
|
+
if (!wrapperRef.current)
|
|
12
|
+
return null;
|
|
13
|
+
return wrapperRef.current.querySelector('dialog');
|
|
14
|
+
};
|
|
15
|
+
function executeClose(event) {
|
|
16
|
+
if (onCloseDialog) {
|
|
17
|
+
onCloseDialog({ originalEvent: event?.originalEvent });
|
|
18
|
+
}
|
|
19
|
+
const innerDialog = getInnerDialog();
|
|
20
|
+
if (innerDialog) {
|
|
21
|
+
nativeClose.call(innerDialog);
|
|
22
|
+
}
|
|
23
|
+
if (scrollMode === 'body') {
|
|
24
|
+
document.body.style.overflow = '';
|
|
25
|
+
}
|
|
26
|
+
setIsActive(false);
|
|
27
|
+
}
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const el = getInnerDialog();
|
|
30
|
+
if (!el)
|
|
31
|
+
return;
|
|
32
|
+
const handleNativeClose = () => {
|
|
33
|
+
if (scrollMode === 'body') {
|
|
34
|
+
document.body.style.overflow = '';
|
|
35
|
+
}
|
|
36
|
+
setIsActive(false);
|
|
37
|
+
};
|
|
38
|
+
el.addEventListener('close', handleNativeClose);
|
|
39
|
+
return () => el.removeEventListener('close', handleNativeClose);
|
|
40
|
+
}, [isActive, scrollMode]);
|
|
41
|
+
// 1. Expose orchestration contracts cleanly to your parent trigger references
|
|
42
|
+
useImperativeHandle(ref, () => {
|
|
43
|
+
const wrapperEl = wrapperRef.current;
|
|
44
|
+
const interfaceMock = {};
|
|
45
|
+
interfaceMock.open = (parent = document.body) => {
|
|
46
|
+
if (wrapperRef.current) {
|
|
47
|
+
if (!wrapperRef.current.isConnected) {
|
|
48
|
+
parent.appendChild(wrapperRef.current);
|
|
49
|
+
}
|
|
50
|
+
setIsActive(true);
|
|
51
|
+
const innerDialog = getInnerDialog();
|
|
52
|
+
if (innerDialog) {
|
|
53
|
+
// 2. BODY SCROLL PROTECTION: Inject layout protections inline immediately
|
|
54
|
+
if (scrollMode === 'body') {
|
|
55
|
+
innerDialog.style.setProperty('position', 'absolute', 'important');
|
|
56
|
+
innerDialog.style.setProperty('max-height', 'none', 'important');
|
|
57
|
+
innerDialog.style.setProperty('overflow', 'visible', 'important');
|
|
58
|
+
}
|
|
59
|
+
// 3. RESTORED: Backdrop click tracking rule natively bounded inside the script
|
|
60
|
+
if (cancellable) {
|
|
61
|
+
innerDialog.onclick = (event) => {
|
|
62
|
+
if (event.target === innerDialog) {
|
|
63
|
+
const rect = innerDialog.getBoundingClientRect();
|
|
64
|
+
const isOutside = event.clientX < rect.left ||
|
|
65
|
+
event.clientX > rect.right ||
|
|
66
|
+
event.clientY < rect.top ||
|
|
67
|
+
event.clientY > rect.bottom;
|
|
68
|
+
if (isOutside) {
|
|
69
|
+
executeClose({ originalEvent: event });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (scrollMode === 'body') {
|
|
75
|
+
document.body.style.overflow = 'hidden';
|
|
76
|
+
}
|
|
77
|
+
void innerDialog.offsetHeight;
|
|
78
|
+
innerDialog.showModal();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
interfaceMock.close = () => {
|
|
83
|
+
if (scrollMode === 'body') {
|
|
84
|
+
document.body.style.overflow = '';
|
|
85
|
+
}
|
|
86
|
+
const innerDialog = getInnerDialog();
|
|
87
|
+
if (innerDialog) {
|
|
88
|
+
nativeClose.call(innerDialog);
|
|
89
|
+
}
|
|
90
|
+
setIsActive(false);
|
|
91
|
+
};
|
|
92
|
+
Object.defineProperty(interfaceMock, 'element', {
|
|
93
|
+
get: () => getInnerDialog() || wrapperEl,
|
|
94
|
+
configurable: true,
|
|
95
|
+
});
|
|
96
|
+
return interfaceMock;
|
|
97
|
+
}, [transition, cancellable, scrollMode]);
|
|
98
|
+
// 4. Assemble look and feel design class lists cleanly
|
|
99
|
+
const dialogClasses = ['gids-dialog'];
|
|
100
|
+
const transitionClasses = getGidsDialogClassNames({ transition });
|
|
101
|
+
if (transitionClasses) {
|
|
102
|
+
transitionClasses.split(' ').forEach((className) => {
|
|
103
|
+
if (className.trim())
|
|
104
|
+
dialogClasses.push(className.trim());
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return (React.createElement("div", { ref: wrapperRef, style: !isActive ? { display: 'none' } : { display: 'contents' } },
|
|
108
|
+
React.createElement(GidsDialogControl, { className: dialogClasses.join(' '), variant: variant, maxWidth: maxWidth, scrollMode: scrollMode, draggable: draggable, headerTitle: headerTitle, closeVisible: closeVisible, footerActions: footerActions, headerDividerVisible: headerDividerVisible, footerDividerVisible: footerDividerVisible, onCloseDialogControl: executeClose, onDialogControlFooterAction: onDialogFooterAction }, children)));
|
|
109
|
+
});
|
|
110
|
+
GidsDialog.displayName = 'GidsDialog';
|
|
111
|
+
//# sourceMappingURL=GidsDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsDialog.js","sourceRoot":"","sources":["../../../src/components/GidsDialog/GidsDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EACN,kBAAkB,GAElB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAG/E,MAAM,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAAC;AAiBvD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAIzC,CACC,EACC,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,IAAI,EACf,UAAU,GAAG,OAAO,EACpB,SAAS,GAAG,KAAK,EACjB,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React, { MouseEvent, type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { GidsMatrixTableBodyActionButtonEvent } from '@ganpatiinfo/gids-core-shared';
|
|
3
|
+
import { GidsMatrixTableWebProps, GidsTableCellTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
4
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*
|
|
8
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
9
|
+
*/
|
|
10
|
+
type GidsMatrixTableBaseWebProps = GidsMatrixTableWebProps<GidsTableCellTypographyStyle, IconName, IconAppearance>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
*
|
|
14
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
15
|
+
*/
|
|
16
|
+
type GidsMatrixTableActionButtonBaseEvent = GidsMatrixTableBodyActionButtonEvent<MouseEvent, GidsTableCellTypographyStyle, IconName, IconAppearance>;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*
|
|
20
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
21
|
+
*/
|
|
22
|
+
export interface GidsMatrixTableProps extends GidsMatrixTableBaseWebProps, Omit<ComponentPropsWithoutRef<'div'>, 'children' | 'onClick' | 'onChange'> {
|
|
23
|
+
onClickMatrixTableActionBtn?: (event: GidsMatrixTableActionButtonBaseEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This is React implementation of `GidsMatrixTable` component.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated
|
|
29
|
+
*
|
|
30
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const GidsMatrixTable: ({ topHeaderCells, tableBodyItems, width, isTopHeaderVisible, topHeaderAppearance, topHeaderLabelTypography, topHeaderTextAlignment, rowAppearance, rowLabelTypography, rowTextAlignment, tableBorders, tableBorderRadius, tableBodyMaxHeight, rowCellPrimaryActionButtons, rowCellSecondaryActionButtons, topHeaderPrimaryActionButtons, topHeaderSecondaryActionButtons, onClickMatrixTableActionBtn, matrixHeaderAppearance, matrixHeaderLabelTypography, matrixHeaderTextAlignment, matrixHeaderCellPrimaryActionButtons, matrixHeaderCellSecondaryActionButtons, className, }: GidsMatrixTableProps) => React.JSX.Element;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=GidsMatrixTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsMatrixTable.d.ts","sourceRoot":"","sources":["../../../src/components/GidsMatrixTable/GidsMatrixTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EACN,uBAAuB,EAEvB,4BAA4B,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAc/C;;;;GAIG;AACH,KAAK,2BAA2B,GAAG,uBAAuB,CACzD,4BAA4B,EAC5B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF;;;;GAIG;AACH,KAAK,oCAAoC,GACxC,oCAAoC,CACnC,UAAU,EACV,4BAA4B,EAC5B,QAAQ,EACR,cAAc,CACd,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAChB,SACC,2BAA2B,EAC3B,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3E,2BAA2B,CAAC,EAAE,CAC7B,KAAK,EAAE,oCAAoC,KACvC,IAAI,CAAC;CACV;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,mjBAyB7B,oBAAoB,sBAoFtB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GidsMatrixTableWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { GidsBasicTableHeader, } from '../GidsBasicTableHeader/GidsBasicTableHeader';
|
|
4
|
+
import { GidsMatrixTableBody } from '../GidsMatrixTableBody/GidsMatrixTableBody';
|
|
5
|
+
const { getGidsMatrixTableClassNames, getCustomisedTopHeaderMatrixTableCells, getMatrixTableBodyBorder, getMatrixTableClasses, } = GidsMatrixTableWebUtils;
|
|
6
|
+
/**
|
|
7
|
+
* This is React implementation of `GidsMatrixTable` component.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated
|
|
10
|
+
*
|
|
11
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
12
|
+
*/
|
|
13
|
+
export const GidsMatrixTable = ({ topHeaderCells = [], tableBodyItems = [], width = 'full', isTopHeaderVisible = false, topHeaderAppearance = 'none', topHeaderLabelTypography = 'eyebrow-small', topHeaderTextAlignment = 'left', rowAppearance = 'none', rowLabelTypography = 'label-small', rowTextAlignment = 'left', tableBorders = 'none', tableBorderRadius = [], tableBodyMaxHeight = 200, rowCellPrimaryActionButtons = [], rowCellSecondaryActionButtons = [], topHeaderPrimaryActionButtons = [], topHeaderSecondaryActionButtons = [], onClickMatrixTableActionBtn, matrixHeaderAppearance = 'none', matrixHeaderLabelTypography = 'label-medium', matrixHeaderTextAlignment = 'left', matrixHeaderCellPrimaryActionButtons = [], matrixHeaderCellSecondaryActionButtons = [], className, }) => {
|
|
14
|
+
function onTopHeaderActionBtnClick(event) {
|
|
15
|
+
if (onClickMatrixTableActionBtn) {
|
|
16
|
+
onClickMatrixTableActionBtn({
|
|
17
|
+
...event,
|
|
18
|
+
details: {
|
|
19
|
+
...event.details,
|
|
20
|
+
columnIndex: event?.details?.cellIndex,
|
|
21
|
+
headerType: 'top',
|
|
22
|
+
rowIndex: event?.details?.cellIndex,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return (React.createElement("div", { className: getGidsMatrixTableClassNames({ width, tableBorders, tableBorderRadius }, className) },
|
|
28
|
+
React.createElement("div", { className: "gids-matrix-table__scroll-container", style: (tableBodyMaxHeight
|
|
29
|
+
? { '--gidsMatrixTable-body-max-height': `${tableBodyMaxHeight}px` }
|
|
30
|
+
: {}) },
|
|
31
|
+
React.createElement("table", { className: getMatrixTableClasses({ width }) },
|
|
32
|
+
isTopHeaderVisible && topHeaderCells && topHeaderCells.length > 0 ? (React.createElement(GidsBasicTableHeader, { appearance: topHeaderAppearance, labelTypography: topHeaderLabelTypography, textAlignment: topHeaderTextAlignment, className: "gids-matrix-table__top-thead", headerCells: getCustomisedTopHeaderMatrixTableCells({
|
|
33
|
+
topHeaderCells,
|
|
34
|
+
tableBorders,
|
|
35
|
+
}), width: width, cellPrimaryActionButtons: topHeaderPrimaryActionButtons, cellSecondaryActionButtons: topHeaderSecondaryActionButtons, onClickHeaderActionBtn: onTopHeaderActionBtnClick })) : undefined,
|
|
36
|
+
tableBodyItems && tableBodyItems.length > 0 ? (React.createElement(GidsMatrixTableBody, { width: width, tableBodyItems: tableBodyItems, tableBorders: getMatrixTableBodyBorder({ tableBorders }), rowAppearance: rowAppearance, rowLabelTypography: rowLabelTypography, rowTextAlignment: rowTextAlignment, matrixHeaderAppearance: matrixHeaderAppearance, matrixHeaderLabelTypography: matrixHeaderLabelTypography, matrixHeaderTextAlignment: matrixHeaderTextAlignment, rowCellPrimaryActionButtons: rowCellPrimaryActionButtons, rowCellSecondaryActionButtons: rowCellSecondaryActionButtons, matrixHeaderCellPrimaryActionButtons: matrixHeaderCellPrimaryActionButtons, matrixHeaderCellSecondaryActionButtons: matrixHeaderCellSecondaryActionButtons, onClickMatrixBodyCellActionBtn: onClickMatrixTableActionBtn })) : undefined))));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=GidsMatrixTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsMatrixTable.js","sourceRoot":"","sources":["../../../src/components/GidsMatrixTable/GidsMatrixTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAEzE,OAAO,EAEN,uBAAuB,GAEvB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EACN,oBAAoB,GAEpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,MAAM,EACL,4BAA4B,EAC5B,sCAAsC,EACtC,wBAAwB,EACxB,qBAAqB,GACrB,GAAG,uBAAuB,CAAC;AAwC5B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC/B,cAAc,GAAG,EAAE,EACnB,cAAc,GAAG,EAAE,EACnB,KAAK,GAAG,MAAM,EACd,kBAAkB,GAAG,KAAK,EAC1B,mBAAmB,GAAG,MAAM,EAC5B,wBAAwB,GAAG,eAAe,EAC1C,sBAAsB,GAAG,MAAM,EAC/B,aAAa,GAAG,MAAM,EACtB,kBAAkB,GAAG,aAAa,EAClC,gBAAgB,GAAG,MAAM,EACzB,YAAY,GAAG,MAAM,EACrB,iBAAiB,GAAG,EAAE,EACtB,kBAAkB,GAAG,GAAG,EACxB,2BAA2B,GAAG,EAAE,EAChC,6BAA6B,GAAG,EAAE,EAClC,6BAA6B,GAAG,EAAE,EAClC,+BAA+B,GAAG,EAAE,EACpC,2BAA2B,EAC3B,sBAAsB,GAAG,MAAM,EAC/B,2BAA2B,GAAG,cAAc,EAC5C,yBAAyB,GAAG,MAAM,EAClC,oCAAoC,GAAG,EAAE,EACzC,sCAAsC,GAAG,EAAE,EAC3C,SAAS,GACa,EAAE,EAAE;IAC1B,SAAS,yBAAyB,CACjC,KAAgD;QAEhD,IAAI,2BAA2B,EAAE,CAAC;YACjC,2BAA2B,CAAC;gBAC3B,GAAG,KAAK;gBACR,OAAO,EAAE;oBACR,GAAG,KAAK,CAAC,OAAO;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sB,EAAE,sBAAsB,EAC9C,2BAA2B,EAAE,2BAA2B,EACxD,yBAAyB,EAAE,yBAAyB,EACpD,2BAA2B,EAAE,2BAA2B,EACxD,6BAA6B,EAAE,6BAA6B,EAC5D,oCAAoC,EACnC,oCAAoC,EAErC,sCAAsC,EACrC,sCAAsC,EAEvC,8BAA8B,EAAE,2BAA2B,GAC1D,CACF,CAAC,CAAC,CAAC,SAAS,CACN,CACH,CACD,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { MouseEvent, type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { GidsMatrixTableBodyWebProps, GidsTableCellTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
4
|
+
import { GidsMatrixTableBodyActionButtonEvent } from '@ganpatiinfo/gids-core-shared';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*
|
|
8
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
9
|
+
*/
|
|
10
|
+
type GidsMatrixTableBodyBaseWebProps = GidsMatrixTableBodyWebProps<GidsTableCellTypographyStyle, IconName, IconAppearance>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
*
|
|
14
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
15
|
+
*/
|
|
16
|
+
export type GidsMatrixTableBodyActionButtonBaseEvent = GidsMatrixTableBodyActionButtonEvent<MouseEvent, GidsTableCellTypographyStyle, IconName, IconAppearance>;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
*
|
|
20
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
21
|
+
*/
|
|
22
|
+
export interface GidsMatrixTableBodyProps extends GidsMatrixTableBodyBaseWebProps, Omit<ComponentPropsWithoutRef<'tbody'>, 'children'> {
|
|
23
|
+
onClickMatrixBodyCellActionBtn?: (event: GidsMatrixTableBodyActionButtonBaseEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This is React implementation of `GidsMatrixTableBody` component.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated
|
|
29
|
+
*
|
|
30
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const GidsMatrixTableBody: ({ width, tableBodyItems, tableBorders, rowAppearance, rowLabelTypography, rowTextAlignment, matrixHeaderAppearance, matrixHeaderLabelTypography, matrixHeaderTextAlignment, rowCellPrimaryActionButtons, rowCellSecondaryActionButtons, matrixHeaderCellPrimaryActionButtons, matrixHeaderCellSecondaryActionButtons, onClickMatrixBodyCellActionBtn, className, }: GidsMatrixTableBodyProps) => React.JSX.Element;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=GidsMatrixTableBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsMatrixTableBody.d.ts","sourceRoot":"","sources":["../../../src/components/GidsMatrixTableBody/GidsMatrixTableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EACN,2BAA2B,EAE3B,4BAA4B,EAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,oCAAoC,EAGpC,MAAM,+BAA+B,CAAC;AASvC;;;;GAIG;AACH,KAAK,+BAA+B,GAAG,2BAA2B,CACjE,4BAA4B,EAC5B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,GACnD,oCAAoC,CACnC,UAAU,EACV,4BAA4B,EAC5B,QAAQ,EACR,cAAc,CACd,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,wBAChB,SACC,+BAA+B,EAC/B,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IACpD,8BAA8B,CAAC,EAAE,CAChC,KAAK,EAAE,wCAAwC,KAC3C,IAAI,CAAC;CACV;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,oWAgBjC,wBAAwB,sBAyG1B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GidsMatrixTableBodyWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { GidsTableCell, } from '../GidsTableCell/GidsTableCell';
|
|
4
|
+
const { getGidsMatrixTableBodyClassNames, getConstructedMatrixTableBodyItems } = GidsMatrixTableBodyWebUtils;
|
|
5
|
+
/**
|
|
6
|
+
* This is React implementation of `GidsMatrixTableBody` component.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated
|
|
9
|
+
*
|
|
10
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
11
|
+
*/
|
|
12
|
+
export const GidsMatrixTableBody = ({ width = 'full', tableBodyItems = [], tableBorders = 'none', rowAppearance = 'none', rowLabelTypography = 'label-medium', rowTextAlignment = 'center', matrixHeaderAppearance = 'none', matrixHeaderLabelTypography = 'label-medium', matrixHeaderTextAlignment = 'center', rowCellPrimaryActionButtons = [], rowCellSecondaryActionButtons = [], matrixHeaderCellPrimaryActionButtons = [], matrixHeaderCellSecondaryActionButtons = [], onClickMatrixBodyCellActionBtn, className, }) => {
|
|
13
|
+
const constructedTableBodyItems = getConstructedMatrixTableBodyItems({
|
|
14
|
+
rowAppearance,
|
|
15
|
+
rowLabelTypography,
|
|
16
|
+
rowTextAlignment,
|
|
17
|
+
matrixHeaderAppearance,
|
|
18
|
+
matrixHeaderLabelTypography,
|
|
19
|
+
matrixHeaderTextAlignment,
|
|
20
|
+
tableBodyItems,
|
|
21
|
+
tableBorders,
|
|
22
|
+
matrixHeaderCellPrimaryActionButtons,
|
|
23
|
+
matrixHeaderCellSecondaryActionButtons,
|
|
24
|
+
});
|
|
25
|
+
function onMatrixBodyCellActionBtnClick({ event, rowIndex, columnIndex, item, }) {
|
|
26
|
+
if (onClickMatrixBodyCellActionBtn) {
|
|
27
|
+
onClickMatrixBodyCellActionBtn({
|
|
28
|
+
...event,
|
|
29
|
+
details: {
|
|
30
|
+
...event.details,
|
|
31
|
+
rowIndex,
|
|
32
|
+
columnIndex,
|
|
33
|
+
isHeaderCell: item?.isHeader,
|
|
34
|
+
headerType: item?.headerType ?? 'none',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return (React.createElement("tbody", { className: getGidsMatrixTableBodyClassNames({ width }, className) }, constructedTableBodyItems.map((constructedTableBodyItem, indexI) => {
|
|
40
|
+
const { headerItem, rowItems = [] } = constructedTableBodyItem;
|
|
41
|
+
return (React.createElement("tr", null,
|
|
42
|
+
React.createElement(GidsTableCell, { ...headerItem, width: width, isHeaderCell: headerItem?.isHeader ?? true, cellPrimaryActionButtons: matrixHeaderCellPrimaryActionButtons, cellSecondaryActionButtons: matrixHeaderCellSecondaryActionButtons, onClickCellActionBtn: (event) => onMatrixBodyCellActionBtnClick({
|
|
43
|
+
event,
|
|
44
|
+
rowIndex: indexI,
|
|
45
|
+
columnIndex: undefined,
|
|
46
|
+
item: headerItem,
|
|
47
|
+
}) }),
|
|
48
|
+
rowItems.map((rowItem, indexJ) => {
|
|
49
|
+
return (React.createElement(GidsTableCell, { ...rowItem, width: width, isHeaderCell: rowItem?.isHeader ?? false, cellPrimaryActionButtons: rowCellPrimaryActionButtons, cellSecondaryActionButtons: rowCellSecondaryActionButtons, onClickCellActionBtn: (event) => onMatrixBodyCellActionBtnClick({
|
|
50
|
+
event,
|
|
51
|
+
rowIndex: indexI,
|
|
52
|
+
columnIndex: indexJ,
|
|
53
|
+
item: rowItem,
|
|
54
|
+
}) }));
|
|
55
|
+
})));
|
|
56
|
+
})));
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=GidsMatrixTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsMatrixTableBody.js","sourceRoot":"","sources":["../../../src/components/GidsMatrixTableBody/GidsMatrixTableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAEN,2BAA2B,GAE3B,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EACN,aAAa,GAEb,MAAM,gCAAgC,CAAC;AAExC,MAAM,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,GAC7E,2BAA2B,CAAC;AAwC7B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EACnC,KAAK,GAAG,MAAM,EACd,cAAc,GAAG,EAAE,EACnB,YAAY,GAAG,MAAM,EACrB,aAAa,GAAG,MAAM,EACtB,kBAAkB,GAAG,cAAc,EACnC,gBAAgB,GAAG,QAAQ,EAC3B,sBAAsB,GAAG,MAAM,EAC/B,2BAA2B,GAAG,cAAc,EAC5C,yBAAyB,GAAG,QAAQ,EACpC,2BAA2B,GAAG,EAAE,EAChC,6BAA6B,GAAG,EAAE,EAClC,oCAAoC,GAAG,EAAE,EACzC,sCAAsC,GAAG,EAAE,EAC3C,8BAA8B,EAC9B,SAAS,GACiB,EAAE,EAAE;IAC9B,MAAM,yBAAyB,GAAG,kCAAkC,CAIlE;QACD,aAAa;QACb,kBAAkB;QAClB,gBAAgB;QAChB,sBAAsB;QACtB,2BAA2B;QAC3B,yBAAyB;QACzB,cAAc;QACd,YAAY;QACZ,oCAAoC;QACpC,sCAAsC;KACtC,CAAC,CAAC;IAEH,SAAS,8BAA8B,CAAC,EACvC,KAAK,EACL,QAAQ,EACR,WAAW,EACX,IAAI,GAgBJ;QACA,IAAI,8BAA8B,EAAE,CAAC;YACpC,8BAA8B,CAAC;gBAC9B,GAAG,KAAK;gBACR,OAAO,EAAE;oBACR,GAAG,KAAK,CA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K,CACR,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/GidsMenu/GidsMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EACb,KAAK,EAAE,EACP,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AACf,OAAO,EACN,gBAAgB,EAEhB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"GidsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/GidsMenu/GidsMenu.tsx"],"names":[],"mappings":"AAAA,OAAc,EACb,KAAK,EAAE,EACP,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EACd,MAAM,OAAO,CAAC;AACf,OAAO,EACN,gBAAgB,EAEhB,MAAM,8BAA8B,CAAC;AAMtC,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC,GAC1E,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAE/D,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmCtC,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GidsMenuWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
3
3
|
import { GidsHeading } from '../GidsHeading/GidsHeading.js';
|
|
4
|
+
import { GidsDivider } from '../GidsDivider/GidsDivider.js';
|
|
4
5
|
const { getGidsMenuClassNames } = GidsMenuWebUtils;
|
|
5
|
-
export const GidsMenu = ({ children, heading, supportingText, supportingTextTypography, className, ...restProps }) => {
|
|
6
|
-
return (React.createElement("div", { className: getGidsMenuClassNames(className) },
|
|
6
|
+
export const GidsMenu = ({ children, heading, supportingText, level, supportingTextTypography, isHeaderDividerVisible = false, className, ...restProps }) => {
|
|
7
|
+
return (React.createElement("div", { className: getGidsMenuClassNames(className), ...restProps },
|
|
7
8
|
(heading !== undefined && heading !== null && heading !== '') ||
|
|
8
9
|
(supportingText !== undefined &&
|
|
9
10
|
supportingText !== null &&
|
|
10
|
-
supportingText !== '') ? (React.createElement(GidsHeading, { heading: heading, supportingText: supportingText, supportingTextTypography: supportingTextTypography ?? 'eyebrow-medium',
|
|
11
|
+
supportingText !== '') ? (React.createElement(GidsHeading, { heading: heading, supportingText: supportingText, supportingTextTypography: supportingTextTypography ?? 'eyebrow-medium', level: level })) : null,
|
|
12
|
+
isHeaderDividerVisible ? (React.createElement("div", { className: "gids-menu__header-divider" },
|
|
13
|
+
React.createElement(GidsDivider, { orientation: "horizontal" }))) : undefined,
|
|
11
14
|
children !== undefined && children !== null ? (React.createElement("div", { className: "gids-menu__children" }, children)) : null));
|
|
12
15
|
};
|
|
13
16
|
//# sourceMappingURL=GidsMenu.js.map
|