@ganpatiinfo/gids-web-dom-reference 12.0.0 → 14.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/CHANGELOG.md +131 -2
- package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.d.ts +8 -0
- package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.d.ts.map +1 -0
- package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.js +14 -0
- package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.js.map +1 -0
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts +26 -3
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts.map +1 -1
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js +22 -3
- package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js.map +1 -1
- package/dist/components/GidsBasicTableHead/GidsBasicTableHead.d.ts +15 -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 +26 -3
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.d.ts.map +1 -1
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js +9 -1
- package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js.map +1 -1
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts +22 -3
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts.map +1 -1
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js +27 -6
- package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js.map +1 -1
- package/dist/components/GidsBsTable/GidsBsTable.d.ts +26 -3
- package/dist/components/GidsBsTable/GidsBsTable.d.ts.map +1 -1
- package/dist/components/GidsBsTable/GidsBsTable.js +36 -14
- package/dist/components/GidsBsTable/GidsBsTable.js.map +1 -1
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts +1 -1
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts.map +1 -1
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js +2 -1
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js.map +1 -1
- package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts +8 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts.map +1 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.js +62 -0
- package/dist/components/GidsColorSwatch/GidsColorSwatch.js.map +1 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts +18 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts.map +1 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js +141 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts +13 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js +79 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts +13 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js +128 -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 +102 -0
- package/dist/components/GidsDialog/GidsDialog.js.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts +32 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js +75 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +32 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +75 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js.map +1 -0
- package/dist/components/GidsMdTable/GidsMdTable.d.ts +11 -2
- package/dist/components/GidsMdTable/GidsMdTable.d.ts.map +1 -1
- package/dist/components/GidsMdTable/GidsMdTable.js +3 -0
- package/dist/components/GidsMdTable/GidsMdTable.js.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.d.ts +1 -1
- package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.js +10 -1
- package/dist/components/GidsMenu/GidsMenu.js.map +1 -1
- package/dist/components/GidsPagination/GidsPagination.d.ts +10 -0
- package/dist/components/GidsPagination/GidsPagination.d.ts.map +1 -1
- package/dist/components/GidsPagination/GidsPagination.js +5 -0
- package/dist/components/GidsPagination/GidsPagination.js.map +1 -1
- package/dist/components/GidsPaginator/GidsPaginator.d.ts +8 -0
- package/dist/components/GidsPaginator/GidsPaginator.d.ts.map +1 -0
- package/dist/components/GidsPaginator/GidsPaginator.js +154 -0
- package/dist/components/GidsPaginator/GidsPaginator.js.map +1 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts +9 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts.map +1 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js +33 -0
- package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js.map +1 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.d.ts +8 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.d.ts.map +1 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.js +16 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.js.map +1 -0
- package/dist/components/GidsTable/GidsTable.d.ts +18 -0
- package/dist/components/GidsTable/GidsTable.d.ts.map +1 -0
- package/dist/components/GidsTable/GidsTable.js +121 -0
- package/dist/components/GidsTable/GidsTable.js.map +1 -0
- package/dist/components/GidsTableBody/GidsTableBody.d.ts +13 -0
- package/dist/components/GidsTableBody/GidsTableBody.d.ts.map +1 -0
- package/dist/components/GidsTableBody/GidsTableBody.js +61 -0
- package/dist/components/GidsTableBody/GidsTableBody.js.map +1 -0
- package/dist/components/GidsTableCell/GidsTableCell.d.ts +28 -0
- package/dist/components/GidsTableCell/GidsTableCell.d.ts.map +1 -0
- package/dist/components/GidsTableCell/GidsTableCell.js +146 -0
- package/dist/components/GidsTableCell/GidsTableCell.js.map +1 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.d.ts +13 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.d.ts.map +1 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.js +305 -0
- package/dist/components/GidsTableEntry/GidsTableEntry.js.map +1 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts +13 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts.map +1 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.js +53 -0
- package/dist/components/GidsTableFooter/GidsTableFooter.js.map +1 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts +11 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts.map +1 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js +99 -0
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js.map +1 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts +13 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts.map +1 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.js +49 -0
- package/dist/components/GidsTableHeader/GidsTableHeader.js.map +1 -0
- package/dist/components/GidsTableRow/GidsTableRow.d.ts +13 -0
- package/dist/components/GidsTableRow/GidsTableRow.d.ts.map +1 -0
- package/dist/components/GidsTableRow/GidsTableRow.js +71 -0
- package/dist/components/GidsTableRow/GidsTableRow.js.map +1 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts +11 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts.map +1 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.js +92 -0
- package/dist/components/GidsTableToolbar/GidsTableToolbar.js.map +1 -0
- package/dist/components/GidsTransferList/GidsTransferList.d.ts +8 -0
- package/dist/components/GidsTransferList/GidsTransferList.d.ts.map +1 -0
- package/dist/components/GidsTransferList/GidsTransferList.js +25 -0
- package/dist/components/GidsTransferList/GidsTransferList.js.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts +10 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js +133 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js.map +1 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts +10 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts.map +1 -1
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.js +5 -0
- package/dist/components/_GidsPaginationItem/GidsPaginationItem.js.map +1 -1
- package/dist/index.d.ts +118 -97
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -97
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/GidsAdvancedTooltip/GidsAdvancedTooltip.ts +42 -0
- package/src/components/GidsBasicTableBody/GidsBasicTableBody.ts +66 -5
- package/src/components/GidsBasicTableHead/GidsBasicTableHead.ts +15 -0
- package/src/components/GidsBasicTableHeader/GidsBasicTableHeader.ts +45 -5
- package/src/components/GidsBasicTableRow/GidsBasicTableRow.ts +65 -7
- package/src/components/GidsBsTable/GidsBsTable.ts +81 -19
- package/src/components/GidsChartLegendItem/GidsChartLegendItem.ts +2 -0
- package/src/components/GidsColorSwatch/GidsColorSwatch.ts +107 -0
- package/src/components/GidsCrossTable/GidsCrossTable.ts +259 -0
- package/src/components/GidsCrossTableBody/GidsCrossTableBody.ts +171 -0
- package/src/components/GidsCrossTableRow/GidsCrossTableRow.ts +230 -0
- package/src/components/GidsDialog/GidsDialog.ts +161 -0
- package/src/components/GidsMatrixTable/GidsMatrixTable.ts +187 -0
- package/src/components/GidsMatrixTableBody/GidsMatrixTableBody.ts +185 -0
- package/src/components/GidsMdTable/GidsMdTable.ts +14 -2
- package/src/components/GidsMenu/GidsMenu.ts +15 -0
- package/src/components/GidsPagination/GidsPagination.ts +14 -2
- package/src/components/GidsPaginator/GidsPaginator.ts +241 -0
- package/src/components/GidsPaginatorItem/GidsPaginatorItem.ts +72 -0
- package/src/components/GidsSkeleton/GidsSkeleton.ts +40 -0
- package/src/components/GidsTable/GidsTable.ts +240 -0
- package/src/components/GidsTableBody/GidsTableBody.ts +137 -0
- package/src/components/GidsTableCell/GidsTableCell.ts +276 -0
- package/src/components/GidsTableEntry/GidsTableEntry.ts +515 -0
- package/src/components/GidsTableFooter/GidsTableFooter.ts +119 -0
- package/src/components/GidsTableFooterControl/GidsTableFooterControl.ts +166 -0
- package/src/components/GidsTableHeader/GidsTableHeader.ts +112 -0
- package/src/components/GidsTableRow/GidsTableRow.ts +152 -0
- package/src/components/GidsTableToolbar/GidsTableToolbar.ts +180 -0
- package/src/components/GidsTransferList/GidsTransferList.ts +58 -0
- package/src/components/_GidsDialogControl/GidsDialogControl.ts +198 -0
- package/src/components/_GidsPaginationItem/GidsPaginationItem.ts +14 -2
- package/src/index.ts +118 -97
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts +0 -9
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts.map +0 -1
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js +0 -48
- package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js.map +0 -1
- package/src/components/GidsBasicTableCell/GidsBasicTableCell.ts +0 -99
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { GidsBsTableWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
2
|
import { GidsBasicTableHeadDom, } from '../GidsBasicTableHead/GidsBasicTableHead';
|
|
3
|
-
import { GidsBasicTableHeaderDom } from '../GidsBasicTableHeader/GidsBasicTableHeader';
|
|
4
|
-
import { GidsBasicTableBodyDom } from '../GidsBasicTableBody/GidsBasicTableBody';
|
|
3
|
+
import { GidsBasicTableHeaderDom, } from '../GidsBasicTableHeader/GidsBasicTableHeader';
|
|
4
|
+
import { GidsBasicTableBodyDom, } from '../GidsBasicTableBody/GidsBasicTableBody';
|
|
5
5
|
const { getGidsBsTableClassNames, getCustomisedTopHeaderCells, getBsTableClasses, getBsTableBodyBorder, } = GidsBsTableWebUtils;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated
|
|
8
|
+
*
|
|
9
|
+
* Use `GidsTable` and its props and functions instead.
|
|
10
|
+
*/
|
|
6
11
|
export const GidsBsTableDom = ({
|
|
7
12
|
// Table properties
|
|
8
|
-
topHeaderCells = [], tableBody = [], width = 'full', isTopHeaderVisible = false, isHeadVisible = true, topHeaderAppearance = 'none', topHeaderLabelTypography = 'eyebrow-small', topHeaderTextAlignment = 'left', rowAppearance = 'none', rowLabelTypography = 'label-small', rowTextAlignment = 'left', tableBorders = 'none', tableBorderRadius = [], tableBodyMaxHeight = 200, extraClasses,
|
|
13
|
+
topHeaderCells = [], tableBody = [], width = 'full', isTopHeaderVisible = false, isHeadVisible = true, topHeaderAppearance = 'none', topHeaderLabelTypography = 'eyebrow-small', topHeaderTextAlignment = 'left', rowAppearance = 'none', rowLabelTypography = 'label-small', rowTextAlignment = 'left', tableBorders = 'none', tableBorderRadius = [], tableBodyMaxHeight = 200, tableBodyPrimaryActionButtons = [], tableBodySecondaryActionButtons = [], topHeaderPrimaryActionButtons = [], topHeaderSecondaryActionButtons = [], onClickBsTableActionBtn, extraClasses,
|
|
9
14
|
// Table Head properties
|
|
10
15
|
actionGroup = false, allFiltersTabVisible = false, moreFiltersTabVisible = false, clearAllFiltersVisible = true, clearAllFiltersButtonAppearance = 'primary', primaryFilters = [], secondaryFilters = [], filterSize = 'xs', filterAllIsDefaultSelected = true, dropdownDividerVisible, onToggleActionBarAllFilter, onToggleActionBarDropdownFilter, onToggleActionBarMoreFilter, onToggleActionBarNoneFilter, onDropdownSelectionActionBarFilterChange, onMoreSelectionActionBarFilterChange, onClearAllFiltersButton, actionBarDisabled = false, searchDisabled = false, allFiltersData, moreFiltersData, children, searchVisible = true, filtersVisible = true, childrenPosition = 'top-most', tabVisible = false, tabProps, headBorderSides = [], headBorderRadiusSides = [], leadingIcon, leadingLabel, trailingLabel, loading, readOnly, onGidsSearchBarClear, onChange, onInput, onFocus, onBlur, headValue = '', inputProps, headAppearance = 'surface-default', ...restProps }) => {
|
|
11
|
-
const
|
|
12
|
-
|
|
16
|
+
const bsTableDiv = document.createElement('div');
|
|
17
|
+
bsTableDiv.className = getGidsBsTableClassNames({ width, tableBorders, tableBorderRadius }, extraClasses);
|
|
13
18
|
// Table Head properties
|
|
14
19
|
if (isHeadVisible) {
|
|
15
|
-
|
|
20
|
+
bsTableDiv.append(GidsBasicTableHeadDom({
|
|
16
21
|
actionGroup,
|
|
17
22
|
allFiltersTabVisible,
|
|
18
23
|
moreFiltersTabVisible,
|
|
@@ -66,11 +71,22 @@ actionGroup = false, allFiltersTabVisible = false, moreFiltersTabVisible = false
|
|
|
66
71
|
tableScrollContainer.style.setProperty('--gidsBsTable-body-max-height', `${tableBodyMaxHeight}px`);
|
|
67
72
|
}
|
|
68
73
|
// Table properties
|
|
69
|
-
const
|
|
70
|
-
|
|
74
|
+
const bsTable = document.createElement('table');
|
|
75
|
+
bsTable.className = getBsTableClasses({ width, isHeadVisible });
|
|
76
|
+
function onActionBtnClick(event) {
|
|
77
|
+
if (onClickBsTableActionBtn) {
|
|
78
|
+
onClickBsTableActionBtn({
|
|
79
|
+
...event,
|
|
80
|
+
details: {
|
|
81
|
+
...event.details,
|
|
82
|
+
columnIndex: event?.details?.cellIndex,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
71
87
|
if (isTopHeaderVisible && topHeaderCells && topHeaderCells.length > 0) {
|
|
72
88
|
// Append Table Header
|
|
73
|
-
|
|
89
|
+
bsTable.append(GidsBasicTableHeaderDom({
|
|
74
90
|
appearance: topHeaderAppearance,
|
|
75
91
|
labelTypography: topHeaderLabelTypography,
|
|
76
92
|
textAlignment: topHeaderTextAlignment,
|
|
@@ -79,21 +95,27 @@ actionGroup = false, allFiltersTabVisible = false, moreFiltersTabVisible = false
|
|
|
79
95
|
tableBorders,
|
|
80
96
|
}),
|
|
81
97
|
width: isHeadVisible ? 'full' : width,
|
|
98
|
+
cellPrimaryActionButtons: topHeaderPrimaryActionButtons,
|
|
99
|
+
cellSecondaryActionButtons: topHeaderSecondaryActionButtons,
|
|
100
|
+
onClickHeaderActionBtn: onActionBtnClick,
|
|
82
101
|
}));
|
|
83
102
|
}
|
|
84
103
|
if (tableBody && tableBody.length > 0) {
|
|
85
|
-
|
|
104
|
+
bsTable.append(GidsBasicTableBodyDom({
|
|
86
105
|
width: isHeadVisible ? 'full' : width,
|
|
87
106
|
tableBorders: getBsTableBodyBorder({ tableBorders }),
|
|
88
107
|
tableBodyData: tableBody,
|
|
89
108
|
rowAppearance,
|
|
90
109
|
rowLabelTypography,
|
|
91
110
|
rowTextAlignment,
|
|
111
|
+
tableBodyCellPrimaryActionButtons: tableBodyPrimaryActionButtons,
|
|
112
|
+
tableBodyCellSecondaryActionButtons: tableBodySecondaryActionButtons,
|
|
113
|
+
onClickBodyCellActionBtn: onActionBtnClick,
|
|
92
114
|
}));
|
|
93
115
|
}
|
|
94
|
-
// Structural Append hierarchy:
|
|
95
|
-
tableScrollContainer.appendChild(
|
|
96
|
-
|
|
97
|
-
return
|
|
116
|
+
// Structural Append hierarchy: bsTable -> scroll wrapper -> root container
|
|
117
|
+
tableScrollContainer.appendChild(bsTable);
|
|
118
|
+
bsTableDiv.appendChild(tableScrollContainer);
|
|
119
|
+
return bsTableDiv;
|
|
98
120
|
};
|
|
99
121
|
//# sourceMappingURL=GidsBsTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsBsTable.js","sourceRoot":"","sources":["../../../src/components/GidsBsTable/GidsBsTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,mBAAmB,GACnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACN,qBAAqB,GAErB,MAAM,0CAA0C,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"GidsBsTable.js","sourceRoot":"","sources":["../../../src/components/GidsBsTable/GidsBsTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,mBAAmB,GACnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACN,qBAAqB,GAErB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEN,uBAAuB,GACvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEN,qBAAqB,GACrB,MAAM,0CAA0C,CAAC;AAOlD,MAAM,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,GACpB,GAAG,mBAAmB,CAAC;AA2CxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;AAC9B,mBAAmB;AACnB,cAAc,GAAG,EAAE,EACnB,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,MAAM,EACd,kBAAkB,GAAG,KAAK,EAC1B,aAAa,GAAG,IAAI,EACpB,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,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LegendItemWebProps
|
|
|
4
4
|
children?: HTMLElement | HTMLElement[];
|
|
5
5
|
extraClasses?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const GidsChartLegendItemDom: ({ children, seriesType, orientation, extraClasses, }: GidsChartLegendItemDomProps) => HTMLElement;
|
|
7
|
+
export declare const GidsChartLegendItemDom: ({ children, seriesType, seriesColor, orientation, extraClasses, }: GidsChartLegendItemDomProps) => HTMLElement;
|
|
8
8
|
//# sourceMappingURL=GidsChartLegendItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsChartLegendItem.d.ts","sourceRoot":"","sources":["../../../src/components/GidsChartLegendItem/GidsChartLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAE3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOrE,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B,CAAC,WAAW,CAAC;IAC5F,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,GAAI,
|
|
1
|
+
{"version":3,"file":"GidsChartLegendItem.d.ts","sourceRoot":"","sources":["../../../src/components/GidsChartLegendItem/GidsChartLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAE3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOrE,MAAM,WAAW,2BAA4B,SAAQ,2BAA2B,CAAC,WAAW,CAAC;IAC5F,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,KAAG,WAmBhC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { GidsChartLegendItemWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
2
|
import { appendAsChildren } from '../../utils/domUtils';
|
|
3
3
|
const { getGidsChartLegendItemClassNames } = GidsChartLegendItemWebUtils;
|
|
4
|
-
export const GidsChartLegendItemDom = ({ children, seriesType = '1', orientation = 'horizontal', extraClasses, }) => {
|
|
4
|
+
export const GidsChartLegendItemDom = ({ children, seriesType = '1', seriesColor, orientation = 'horizontal', extraClasses, }) => {
|
|
5
5
|
const chartLegendItem = document.createElement('gids-chart-legend-item');
|
|
6
6
|
if (children) {
|
|
7
7
|
appendAsChildren(chartLegendItem, children);
|
|
8
8
|
}
|
|
9
9
|
chartLegendItem.seriesType = seriesType;
|
|
10
|
+
chartLegendItem.seriesColor = seriesColor;
|
|
10
11
|
chartLegendItem.orientation = orientation;
|
|
11
12
|
chartLegendItem.className = getGidsChartLegendItemClassNames({ seriesType, orientation }, extraClasses);
|
|
12
13
|
return chartLegendItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GidsChartLegendItem.js","sourceRoot":"","sources":["../../../src/components/GidsChartLegendItem/GidsChartLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,2BAA2B,GAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAErE,MAAM,EAAE,gCAAgC,EAAE,GAAG,2BAA2B,CAAC;AAUzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACtC,QAAQ,EACR,UAAU,GAAG,GAAG,EAChB,WAAW,GAAG,YAAY,EAC1B,YAAY,GACiB,EAAe,EAAE;IAC9C,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAC7C,wBAAwB,CACM,CAAC;IAEhC,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;IACxC,eAAe,CAAC,WAAW,GAAG,WAAW,CAAC;IAE1C,eAAe,CAAC,SAAS,GAAG,gCAAgC,CAC3D,EAAE,UAAU,EAAE,WAAW,EAAE,EAC3B,YAAY,CACZ,CAAC;IAEF,OAAO,eAAe,CAAC;AACxB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"GidsChartLegendItem.js","sourceRoot":"","sources":["../../../src/components/GidsChartLegendItem/GidsChartLegendItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,2BAA2B,GAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAErE,MAAM,EAAE,gCAAgC,EAAE,GAAG,2BAA2B,CAAC;AAUzE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACtC,QAAQ,EACR,UAAU,GAAG,GAAG,EAChB,WAAW,EACX,WAAW,GAAG,YAAY,EAC1B,YAAY,GACiB,EAAe,EAAE;IAC9C,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAC7C,wBAAwB,CACM,CAAC;IAEhC,IAAI,QAAQ,EAAE,CAAC;QACd,gBAAgB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,eAAe,CAAC,UAAU,GAAG,UAAU,CAAC;IACxC,eAAe,CAAC,WAAW,GAAG,WAAW,CAAC;IAC1C,eAAe,CAAC,WAAW,GAAG,WAAW,CAAC;IAE1C,eAAe,CAAC,SAAS,GAAG,gCAAgC,CAC3D,EAAE,UAAU,EAAE,WAAW,EAAE,EAC3B,YAAY,CACZ,CAAC;IAEF,OAAO,eAAe,CAAC;AACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GidsColorSwatchTypographyStyle, type GidsColorSwatchWebProps } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
type GidsColorSwatchBaseWebProps = GidsColorSwatchWebProps<GidsColorSwatchTypographyStyle>;
|
|
3
|
+
export interface GidsColorSwatchDomProps extends GidsColorSwatchBaseWebProps {
|
|
4
|
+
extraClasses?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const GidsColorSwatchDom: ({ label, labelColor, labelTypography, labelPosition, swatchColor, swatchSize, swatchShape, swatchShadow, borderRadius, applyBorders, borderColor, borderWidth, extraClasses, }: GidsColorSwatchDomProps) => HTMLDivElement;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=GidsColorSwatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsColorSwatch.d.ts","sourceRoot":"","sources":["../../../src/components/GidsColorSwatch/GidsColorSwatch.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,8BAA8B,EAC9B,KAAK,uBAAuB,EAE5B,MAAM,8BAA8B,CAAC;AAQtC,KAAK,2BAA2B,GAC/B,uBAAuB,CAAC,8BAA8B,CAAC,CAAC;AAEzD,MAAM,WAAW,uBAAwB,SAAQ,2BAA2B;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,GAAI,gLAchC,uBAAuB,KAAG,cAyE5B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { GidsColorSwatchWebUtils, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
const { getGidsColorSwatchClassNames, getGidsColorSwatchPanelClasses, getGidsColorSwatchLabelClasses, } = GidsColorSwatchWebUtils;
|
|
3
|
+
export const GidsColorSwatchDom = ({ label, labelColor = 'default', labelTypography = 'label-x-small', labelPosition = 'left', swatchColor, swatchSize = 'xs', swatchShape = 'rectangle', swatchShadow = 'none', borderRadius = 'none', applyBorders = false, borderColor = 'input', borderWidth = 'default', extraClasses, }) => {
|
|
4
|
+
const colorSwatch = document.createElement('div');
|
|
5
|
+
colorSwatch.className = getGidsColorSwatchClassNames({ labelPosition }, extraClasses);
|
|
6
|
+
colorSwatch.setAttribute('swatch-shape', swatchShape);
|
|
7
|
+
if (swatchColor) {
|
|
8
|
+
colorSwatch.setAttribute('swatch-color', swatchColor);
|
|
9
|
+
}
|
|
10
|
+
colorSwatch.setAttribute('swatch-shadow', swatchShadow);
|
|
11
|
+
colorSwatch.setAttribute('swatch-size', swatchSize);
|
|
12
|
+
colorSwatch.setAttribute('border-radius', borderRadius);
|
|
13
|
+
colorSwatch.setAttribute('border-color', borderColor);
|
|
14
|
+
colorSwatch.setAttribute('label-color', labelColor);
|
|
15
|
+
if (applyBorders) {
|
|
16
|
+
colorSwatch.setAttribute('apply-borders', 'true');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
colorSwatch.removeAttribute('apply-borders');
|
|
20
|
+
}
|
|
21
|
+
const spanLabel = document.createElement('span');
|
|
22
|
+
spanLabel.className = getGidsColorSwatchLabelClasses({
|
|
23
|
+
labelTypography,
|
|
24
|
+
});
|
|
25
|
+
spanLabel.style.color =
|
|
26
|
+
labelColor === 'swatch-color'
|
|
27
|
+
? `${swatchColor}`
|
|
28
|
+
: `var(--gids-color-text-default)`;
|
|
29
|
+
if (label &&
|
|
30
|
+
label !== '' &&
|
|
31
|
+
(labelPosition === 'top' || labelPosition === 'left')) {
|
|
32
|
+
spanLabel.textContent = label;
|
|
33
|
+
colorSwatch.appendChild(spanLabel);
|
|
34
|
+
}
|
|
35
|
+
if (swatchColor && swatchColor !== '') {
|
|
36
|
+
const colorSwatchPanel = document.createElement('div');
|
|
37
|
+
colorSwatchPanel.className = getGidsColorSwatchPanelClasses({
|
|
38
|
+
swatchShape,
|
|
39
|
+
swatchSize,
|
|
40
|
+
applyPanelClass: true,
|
|
41
|
+
});
|
|
42
|
+
colorSwatchPanel.style.backgroundColor = `${swatchColor}`;
|
|
43
|
+
if (applyBorders) {
|
|
44
|
+
colorSwatchPanel.style.border = `var(--gids-border-width-${borderWidth}) solid var(--gids-color-border-${borderColor})`;
|
|
45
|
+
}
|
|
46
|
+
if (swatchShadow !== 'none') {
|
|
47
|
+
colorSwatchPanel.style.boxShadow = `var(--gids-elevation-${swatchShadow})`;
|
|
48
|
+
}
|
|
49
|
+
if (swatchShape === 'rectangle' || swatchShape === 'square') {
|
|
50
|
+
colorSwatchPanel.style.borderRadius = `var(--gids-border-radius-${borderRadius})`;
|
|
51
|
+
}
|
|
52
|
+
colorSwatch.appendChild(colorSwatchPanel);
|
|
53
|
+
}
|
|
54
|
+
if (label &&
|
|
55
|
+
label !== '' &&
|
|
56
|
+
(labelPosition === 'bottom' || labelPosition === 'right')) {
|
|
57
|
+
spanLabel.textContent = label;
|
|
58
|
+
colorSwatch.appendChild(spanLabel);
|
|
59
|
+
}
|
|
60
|
+
return colorSwatch;
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=GidsColorSwatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsColorSwatch.js","sourceRoot":"","sources":["../../../src/components/GidsColorSwatch/GidsColorSwatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,uBAAuB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,GAC9B,GAAG,uBAAuB,CAAC;AAS5B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAClC,KAAK,EACL,UAAU,GAAG,SAAS,EACtB,eAAe,GAAG,eAAe,EACjC,aAAa,GAAG,MAAM,EACtB,WAAW,EACX,UAAU,GAAG,IAAI,EACjB,WAAW,GAAG,WAAW,EACzB,YAAY,GAAG,MAAM,EACrB,YAAY,GAAG,MAAM,EACrB,YAAY,GAAG,KAAK,EACpB,WAAW,GAAG,OAAO,EACrB,WAAW,GAAG,SAAS,EACvB,YAAY,GACa,EAAkB,EAAE;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAClD,WAAW,CAAC,SAAS,GAAG,4BAA4B,CACnD,EAAE,aAAa,EAAE,EACjB,YAAY,CACZ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KAAK,CAAC,CAAC;QACvD,gBAAgB,CAAC,SAAS,GAAG,8BAA8B,CAAC;YAC3D,WAAW;YACX,UAAU;YACV,eAAe,EAAE,IAAI;SACrB,CAAC,CAAC;QAEH,gBAAgB,CAAC,KAAK,CAAC,eAAe,GAAG,GAAG,WAAW,EAAE,CAAC;QAC1D,IAAI,YAAY,EAAE,CAAC;YAClB,gBAAgB,CAAC,KAAK,CAAC,MAAM,GAAG,2BAA2B,WAAW,mCAAmC,WAAW,GAAG,CAAC;QACzH,CAAC;QACD,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;YAC7B,gBAAgB,CAAC,KAAK,CAAC,SAAS,GAAG,wBAAwB,YAAY,GAAG,CAAC;QAC5E,CAAC;QACD,IAAI,WAAW,KAAK,WAAW,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;YAC7D,gBAAgB,CAAC,KAAK,CAAC,YAAY,GAAG,4BAA4B,YAAY,GAAG,CAAC;QACnF,CAAC;QAED,WAAW,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;IAED,IACC,KAAK;QACL,KAAK,KAAK,EAAE;QACZ,CAAC,aAAa,KAAK,QAAQ,IAAI,aAAa,KAAK,OAAO,CAAC,EACxD,CAAC;QACF,SAAS,CAAC,WAAW,GAAG,KAAK,CAAC;QAC9B,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GidsCrossTableActionEvent, GidsCrossTableToolbarSettings, GidsInputStatus } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { DomChildren } from '../../utils/domUtils';
|
|
3
|
+
import { HtmlInputAttributes } from '../GidsInput/GidsInput';
|
|
4
|
+
import { GidsTableToolbarDomProps } from '../GidsTableToolbar/GidsTableToolbar';
|
|
5
|
+
import { GidsCrossTableWebProps, GidsTableEntryTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
7
|
+
export type GidsCrossTableToolbarBaseSettings = GidsCrossTableToolbarSettings<DomChildren, Event, Element, HtmlInputAttributes, GidsInputStatus> & Pick<GidsTableToolbarDomProps, 'onChange' | 'onInput' | 'onFocus' | 'onBlur' | 'onGidsSearchBarClear'>;
|
|
8
|
+
type GidsCrossTableBaseWebProps = Omit<GidsCrossTableWebProps<DomChildren, GidsTableEntryTypographyStyle, IconName, IconAppearance, DomChildren, Event, Element, HtmlInputAttributes>, 'toolbarSettings'> & {
|
|
9
|
+
toolbarSettings?: GidsCrossTableToolbarBaseSettings;
|
|
10
|
+
};
|
|
11
|
+
type GidsCrossTableActionBaseEvent = GidsCrossTableActionEvent<Event, GidsTableEntryTypographyStyle, IconName, IconAppearance>;
|
|
12
|
+
export interface GidsCrossTableDomProps extends GidsCrossTableBaseWebProps {
|
|
13
|
+
extraClasses?: string;
|
|
14
|
+
onCrossTableAction?: (event: GidsCrossTableActionBaseEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const GidsCrossTableDom: ({ toolbar, toolbarChildren, children, headerItems, bodyContent, isHeaderVisible, isToolbarVisible, bodySettings, toolbarSettings, headerSettings, tableBorders, tableBorderRadius, tableBodyMaxHeight, horizontalScroll, crossHeaderSettings, onCrossTableAction, footerItems, footerSettings, isFooterVisible, isFooterControlVisible, footerControlSettings, footerControl, extraClasses, }: GidsCrossTableDomProps) => HTMLDivElement;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=GidsCrossTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTable.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCrossTable/GidsCrossTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,EACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAoB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAEN,wBAAwB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,sBAAsB,EAEtB,6BAA6B,EAE7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAmB/C,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAC5E,WAAW,EACX,KAAK,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,CACf,GACA,IAAI,CACH,wBAAwB,EACxB,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,sBAAsB,CACtE,CAAC;AAEH,KAAK,0BAA0B,GAAG,IAAI,CACrC,sBAAsB,CACrB,WAAW,EACX,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,KAAK,EACL,OAAO,EACP,mBAAmB,CACnB,EACD,iBAAiB,CACjB,GAAG;IACH,eAAe,CAAC,EAAE,iCAAiC,CAAC;CACpD,CAAC;AAEF,KAAK,6BAA6B,GAAG,yBAAyB,CAC7D,KAAK,EACL,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,0BAA0B;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,IAAI,CAAC;CACpE;AAED,eAAO,MAAM,iBAAiB,GAAI,+XAwB/B,sBAAsB,KAAG,cA2J3B,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { appendAsChildren } from '../../utils/domUtils';
|
|
2
|
+
import { GidsTableToolbarDom, } from '../GidsTableToolbar/GidsTableToolbar';
|
|
3
|
+
import { GidsCrossTableWebUtils, isValidChildren, } from '@ganpatiinfo/gids-web-shared';
|
|
4
|
+
import { GidsTableHeaderDom, } from '../GidsTableHeader/GidsTableHeader';
|
|
5
|
+
import { GidsCrossTableBodyDom, } from '../GidsCrossTableBody/GidsCrossTableBody';
|
|
6
|
+
import { GidsTableFooterDom } from '../GidsTableFooter/GidsTableFooter';
|
|
7
|
+
import { GidsTableFooterControlDom } from '../GidsTableFooterControl/GidsTableFooterControl';
|
|
8
|
+
const { getGidsCrossTableClassNames, getCustomisedCrossTableHeaderEntries, getCustomisedCrossTableFooterEntries, getCrossTableBodyBorder, } = GidsCrossTableWebUtils;
|
|
9
|
+
export const GidsCrossTableDom = ({ toolbar, toolbarChildren, children, headerItems = [], bodyContent = [], isHeaderVisible, isToolbarVisible, bodySettings, toolbarSettings, headerSettings, tableBorders, tableBorderRadius, tableBodyMaxHeight = 200, horizontalScroll = false, crossHeaderSettings, onCrossTableAction, footerItems = [], footerSettings, isFooterVisible = false, isFooterControlVisible = false, footerControlSettings, footerControl, extraClasses, }) => {
|
|
10
|
+
/*
|
|
11
|
+
* Cross Table Root
|
|
12
|
+
*/
|
|
13
|
+
const crossTableDiv = document.createElement('div');
|
|
14
|
+
crossTableDiv.className = getGidsCrossTableClassNames({ tableBorders, tableBorderRadius }, extraClasses);
|
|
15
|
+
/*
|
|
16
|
+
* Toolbar
|
|
17
|
+
*/
|
|
18
|
+
if (isValidChildren(toolbar)) {
|
|
19
|
+
appendAsChildren(crossTableDiv, toolbar);
|
|
20
|
+
}
|
|
21
|
+
else if (isToolbarVisible) {
|
|
22
|
+
const tableToolbar = GidsTableToolbarDom({
|
|
23
|
+
...toolbarSettings,
|
|
24
|
+
children: toolbarChildren,
|
|
25
|
+
});
|
|
26
|
+
crossTableDiv.append(tableToolbar);
|
|
27
|
+
}
|
|
28
|
+
/*
|
|
29
|
+
* Scroll Container
|
|
30
|
+
*/
|
|
31
|
+
const tableScrollContainer = document.createElement('div');
|
|
32
|
+
tableScrollContainer.className = [
|
|
33
|
+
'gids-cross-table__scroll-container',
|
|
34
|
+
horizontalScroll
|
|
35
|
+
? 'gids-cross-table__scroll-container--horizontal-scroll'
|
|
36
|
+
: '',
|
|
37
|
+
]
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.join(' ');
|
|
40
|
+
if (tableBodyMaxHeight) {
|
|
41
|
+
tableScrollContainer.style.maxHeight = `${tableBodyMaxHeight}px`;
|
|
42
|
+
}
|
|
43
|
+
/*
|
|
44
|
+
* Cross Table
|
|
45
|
+
*/
|
|
46
|
+
const crossTable = document.createElement('table');
|
|
47
|
+
crossTable.className = 'gids-cross-table__main-table';
|
|
48
|
+
/*
|
|
49
|
+
* Horizontal scroll is enabled:
|
|
50
|
+
*
|
|
51
|
+
* The table is allowed to become wider than the viewport.
|
|
52
|
+
*
|
|
53
|
+
* Horizontal scroll is disabled:
|
|
54
|
+
*
|
|
55
|
+
* The table stays 100% wide and cells wrap exactly like GidsTable.
|
|
56
|
+
*/
|
|
57
|
+
if (horizontalScroll) {
|
|
58
|
+
crossTable.classList.add('gids-cross-table__main-table--horizontal-scroll');
|
|
59
|
+
}
|
|
60
|
+
/*
|
|
61
|
+
* Custom Children
|
|
62
|
+
*/
|
|
63
|
+
if (isValidChildren(children)) {
|
|
64
|
+
appendAsChildren(crossTable, children);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
function onActionBtnClick(event) {
|
|
68
|
+
if (onCrossTableAction) {
|
|
69
|
+
onCrossTableAction({
|
|
70
|
+
...event,
|
|
71
|
+
details: {
|
|
72
|
+
...event.details,
|
|
73
|
+
columnIndex: event?.details?.entryIndex,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/*
|
|
79
|
+
* Header
|
|
80
|
+
*/
|
|
81
|
+
if (isHeaderVisible && headerItems && headerItems.length > 0) {
|
|
82
|
+
const crossTableHeader = GidsTableHeaderDom({
|
|
83
|
+
...headerSettings,
|
|
84
|
+
headerItems: getCustomisedCrossTableHeaderEntries({
|
|
85
|
+
headerItems: [{}, ...headerItems],
|
|
86
|
+
tableBorders,
|
|
87
|
+
}),
|
|
88
|
+
onHeaderAction: onActionBtnClick,
|
|
89
|
+
});
|
|
90
|
+
crossTable.append(crossTableHeader);
|
|
91
|
+
}
|
|
92
|
+
/*
|
|
93
|
+
* Body
|
|
94
|
+
*/
|
|
95
|
+
if (bodyContent && bodyContent.length > 0) {
|
|
96
|
+
crossTable.append(GidsCrossTableBodyDom({
|
|
97
|
+
bodyBorder: getCrossTableBodyBorder({
|
|
98
|
+
tableBorders,
|
|
99
|
+
}),
|
|
100
|
+
bodyContent,
|
|
101
|
+
bodySettings,
|
|
102
|
+
crossHeaderSettings,
|
|
103
|
+
onCrossTableBodyAction: onActionBtnClick,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
/*
|
|
107
|
+
* Footer
|
|
108
|
+
*/
|
|
109
|
+
if (isFooterVisible && footerItems && footerItems.length > 0) {
|
|
110
|
+
const crossTableFooter = GidsTableFooterDom({
|
|
111
|
+
...footerSettings,
|
|
112
|
+
footerItems: getCustomisedCrossTableFooterEntries({
|
|
113
|
+
footerItems: [{}, ...footerItems],
|
|
114
|
+
tableBorders,
|
|
115
|
+
}),
|
|
116
|
+
onFooterAction: onActionBtnClick,
|
|
117
|
+
});
|
|
118
|
+
crossTable.append(crossTableFooter);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/*
|
|
122
|
+
* Put cross table inside scroll container
|
|
123
|
+
*/
|
|
124
|
+
tableScrollContainer.appendChild(crossTable);
|
|
125
|
+
/*
|
|
126
|
+
* Put scroll container inside Cross Table div
|
|
127
|
+
*/
|
|
128
|
+
crossTableDiv.appendChild(tableScrollContainer);
|
|
129
|
+
/*
|
|
130
|
+
* Footer Control
|
|
131
|
+
*/
|
|
132
|
+
if (isFooterControlVisible || isValidChildren(footerControl)) {
|
|
133
|
+
crossTableDiv.append(GidsTableFooterControlDom({
|
|
134
|
+
...footerControlSettings,
|
|
135
|
+
tableViewControllerSettings: footerControlSettings?.tableViewControllerSettings,
|
|
136
|
+
children: footerControl,
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
return crossTableDiv;
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=GidsCrossTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTable.js","sourceRoot":"","sources":["../../../src/components/GidsCrossTable/GidsCrossTable.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAErE,OAAO,EACN,mBAAmB,GAEnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAEN,sBAAsB,EAEtB,eAAe,GACf,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAEN,kBAAkB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEN,qBAAqB,GACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAE7F,MAAM,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,oCAAoC,EACpC,uBAAuB,GACvB,GAAG,sBAAsB,CAAC;AA0C3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EACjC,OAAO,EACP,eAAe,EACf,QAAQ,EACR,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,YAAY,GACY,EAAkB,EAAE;IAC5C;;OAEG;IACH,MAAM,aAAa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AEH,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE7C;;OAEG;IACH,aAAa,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAEhD;;OAEG;IACH,IAAI,sBAAsB,IAAI,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9D,aAAa,CAAC,MAAM,CACnB,yBAAyB,CAAC;YACzB,GAAG,qBAAqB;YACxB,2BAA2B,EAC1B,qBAAqB,EAAE,2BAA2B;YACnD,QAAQ,EAAE,aAAa;SACvB,CAAC,CACF,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GidsCrossTableBodyActionEvent } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { GidsCrossTableBodyWebProps, GidsTableEntryTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
4
|
+
import { DomChildren } from '../../utils/domUtils';
|
|
5
|
+
type GidsCrossTableBodyBaseWebProps = GidsCrossTableBodyWebProps<GidsTableEntryTypographyStyle, IconName, IconAppearance, DomChildren>;
|
|
6
|
+
export type GidsCrossTableBodyActionBaseEvent = GidsCrossTableBodyActionEvent<Event, GidsTableEntryTypographyStyle, IconName, IconAppearance>;
|
|
7
|
+
export interface GidsCrossTableBodyDomProps extends GidsCrossTableBodyBaseWebProps {
|
|
8
|
+
extraClasses?: string;
|
|
9
|
+
onCrossTableBodyAction?: (event: GidsCrossTableBodyActionBaseEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const GidsCrossTableBodyDom: ({ bodySettings, bodyContent, bodyBorder, crossHeaderSettings, children, onCrossTableBodyAction, extraClasses, }: GidsCrossTableBodyDomProps) => HTMLElement;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=GidsCrossTableBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableBody.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCrossTableBody/GidsCrossTableBody.ts"],"names":[],"mappings":"AAAA,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;AAC/C,OAAO,EAAoB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAerE,KAAK,8BAA8B,GAAG,0BAA0B,CAC/D,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,WAAW,CACX,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,6BAA6B,CAC5E,KAAK,EACL,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,8BAA8B;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,IAAI,CAAC;CAC5E;AAED,eAAO,MAAM,qBAAqB,GAAI,iHAQnC,0BAA0B,KAAG,WAqH/B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { GidsCrossTableBodyWebUtils, isValidChildren, } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { appendAsChildren } from '../../utils/domUtils';
|
|
3
|
+
import { GidsCrossTableRowDom, } from '../GidsCrossTableRow/GidsCrossTableRow';
|
|
4
|
+
const { getGidsCrossTableBodyClassNames, getConstructedCrossTableBodyContent, getCrossTableBodyRowEntryBackgroundColor, getCrossTableBodyRowEntryContentColor, getCrossTableBodyRowEntryActionsBackgroundColor, getCrossTableBodyRowEntryActionsContentColor, } = GidsCrossTableBodyWebUtils;
|
|
5
|
+
export const GidsCrossTableBodyDom = ({ bodySettings, bodyContent = [], bodyBorder = 'none', crossHeaderSettings, children, onCrossTableBodyAction, extraClasses, }) => {
|
|
6
|
+
const crossTableBody = document.createElement('tbody');
|
|
7
|
+
crossTableBody.className = getGidsCrossTableBodyClassNames(extraClasses);
|
|
8
|
+
if (isValidChildren(children)) {
|
|
9
|
+
appendAsChildren(crossTableBody, children);
|
|
10
|
+
return crossTableBody;
|
|
11
|
+
}
|
|
12
|
+
if (bodyContent && bodyContent.length > 0) {
|
|
13
|
+
const constructedCrossTableBodyContent = getConstructedCrossTableBodyContent({
|
|
14
|
+
bodyContent,
|
|
15
|
+
bodyBorder,
|
|
16
|
+
});
|
|
17
|
+
function onCrossTableRowActionBtnClick({ event, rowIndex, }) {
|
|
18
|
+
if (onCrossTableBodyAction) {
|
|
19
|
+
onCrossTableBodyAction({
|
|
20
|
+
...event,
|
|
21
|
+
details: {
|
|
22
|
+
...event.details,
|
|
23
|
+
rowIndex,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
constructedCrossTableBodyContent.forEach((constructedCrossTableBody, indexI) => {
|
|
29
|
+
const constructedBodyRowItems = constructedCrossTableBody?.rowItems ?? [];
|
|
30
|
+
const rowBgColor = getCrossTableBodyRowEntryBackgroundColor({
|
|
31
|
+
bodySettings,
|
|
32
|
+
rowIndex: indexI,
|
|
33
|
+
});
|
|
34
|
+
const rowContentColor = getCrossTableBodyRowEntryContentColor({
|
|
35
|
+
bodySettings,
|
|
36
|
+
rowIndex: indexI,
|
|
37
|
+
});
|
|
38
|
+
const rowActionsBgColor = getCrossTableBodyRowEntryActionsBackgroundColor({
|
|
39
|
+
bodySettings,
|
|
40
|
+
rowIndex: indexI,
|
|
41
|
+
});
|
|
42
|
+
const rowActionsContentColor = getCrossTableBodyRowEntryActionsContentColor({
|
|
43
|
+
bodySettings,
|
|
44
|
+
rowIndex: indexI,
|
|
45
|
+
});
|
|
46
|
+
crossTableBody.append(GidsCrossTableRowDom({
|
|
47
|
+
...bodySettings,
|
|
48
|
+
rows: constructedBodyRowItems,
|
|
49
|
+
/*
|
|
50
|
+
* Cross Header
|
|
51
|
+
*
|
|
52
|
+
* sideHeaderItem = actual content
|
|
53
|
+
* for this specific row.
|
|
54
|
+
*/
|
|
55
|
+
crossHeaderItem: constructedCrossTableBody?.crossHeaderItem,
|
|
56
|
+
/*
|
|
57
|
+
* Cross Header Settings
|
|
58
|
+
*
|
|
59
|
+
* Shared configuration/style for
|
|
60
|
+
* all side-header cells.
|
|
61
|
+
*/
|
|
62
|
+
crossHeaderSettings,
|
|
63
|
+
/*
|
|
64
|
+
* Body row styling
|
|
65
|
+
*/
|
|
66
|
+
backgroundColor: rowBgColor,
|
|
67
|
+
contentColor: rowContentColor,
|
|
68
|
+
actionsBackgroundColor: rowActionsBgColor,
|
|
69
|
+
actionsContentColor: rowActionsContentColor,
|
|
70
|
+
onCrossTableRowAction: (event) => onCrossTableRowActionBtnClick({
|
|
71
|
+
event,
|
|
72
|
+
rowIndex: indexI,
|
|
73
|
+
}),
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return crossTableBody;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=GidsCrossTableBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableBody.js","sourceRoot":"","sources":["../../../src/components/GidsCrossTableBody/GidsCrossTableBody.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,0BAA0B,EAE1B,eAAe,GACf,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAEN,oBAAoB,GACpB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,EACL,+BAA+B,EAC/B,mCAAmC,EACnC,wCAAwC,EACxC,qCAAqC,EACrC,+CAA+C,EAC/C,4CAA4C,GAC5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C;gBACD,YAAY;gBACZ,QAAQ,EAAE,MAAM;aAChB,CAAC,CAAC;YAEJ,MAAM,sBAAsB,GAC3B,4CAA4C,CAI1C;gBACD,YAAY;gBACZ,QAAQ,EAAE,MAAM;aAChB,CAAC,CAAC;YAEJ,cAAc,CAAC,MAAM,CACpB,oBAAoB,CAAC;gBACpB,GAAG,YAAY;gBAEf,IAAI,EAAE,uBAAuB;gBAC7B;;;;;mBAKG;gBACH,eAAe,EAAE,yBAAyB,EAAE,eAAe;gBAC3D;;;;;mBAKG;gBACH,mBAAmB;gBACnB;;mBAEG;gBACH,eAAe,EAAE,UAAU;gBAC3B,YAAY,EAAE,eAAe;gBAC7B,sBAAsB,EAAE,iBAAiB;gBACzC,mBAAmB,EAAE,sBAAsB;gBAC3C,qBAAqB,EAAE,CAAC,KAAuC,EAAE,EAAE,CAClE,6BAA6B,CAAC;oBAC7B,KAAK;oBACL,QAAQ,EAAE,MAAM;iBAChB,CAAC;aACH,CAAC,CACF,CAAC;QACH,CAAC,CACD,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GidsCrossTableRowWebProps, GidsTableEntryTypographyStyle } from '@ganpatiinfo/gids-web-shared';
|
|
2
|
+
import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
3
|
+
import { DomChildren } from '../../utils/domUtils';
|
|
4
|
+
import { GidsCrossTableRowActionEvent } from '@ganpatiinfo/gids-core-shared';
|
|
5
|
+
type GidsCrossTableRowBaseWebProps = GidsCrossTableRowWebProps<GidsTableEntryTypographyStyle, IconName, IconAppearance, DomChildren>;
|
|
6
|
+
export type GidsCrossTableRowActionBaseEvent = GidsCrossTableRowActionEvent<Event, GidsTableEntryTypographyStyle, IconName, IconAppearance>;
|
|
7
|
+
export interface GidsCrossTableRowDomProps extends GidsCrossTableRowBaseWebProps {
|
|
8
|
+
extraClasses?: string;
|
|
9
|
+
onCrossTableRowAction?: (event: GidsCrossTableRowActionBaseEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const GidsCrossTableRowDom: ({ 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, extraClasses, }: GidsCrossTableRowDomProps) => HTMLTableRowElement;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=GidsCrossTableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GidsCrossTableRow.d.ts","sourceRoot":"","sources":["../../../src/components/GidsCrossTableRow/GidsCrossTableRow.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yBAAyB,EACzB,6BAA6B,EAG7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAoB,MAAM,sBAAsB,CAAC;AAKrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAI7E,KAAK,6BAA6B,GAAG,yBAAyB,CAC7D,6BAA6B,EAC7B,QAAQ,EACR,cAAc,EACd,WAAW,CACX,CAAC;AACF,MAAM,MAAM,gCAAgC,GAAG,4BAA4B,CAC1E,KAAK,EACL,6BAA6B,EAC7B,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,yBAA0B,SAAQ,6BAA6B;IAC/E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;CAC1E;AAED,eAAO,MAAM,oBAAoB,GAAI,ssBAqClC,yBAAyB,KAAG,mBA2J9B,CAAC"}
|