@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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCrossTableRowWebProps,
|
|
3
|
+
GidsTableEntryTypographyStyle,
|
|
4
|
+
GidsCrossTableRowWebUtils,
|
|
5
|
+
isValidChildren,
|
|
6
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
7
|
+
import {
|
|
8
|
+
IconAppearance,
|
|
9
|
+
IconName,
|
|
10
|
+
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
11
|
+
import { DomChildren, appendAsChildren } from '../../utils/domUtils';
|
|
12
|
+
import {
|
|
13
|
+
GidsTableEntryActionBaseEvent,
|
|
14
|
+
GidsTableEntryDom,
|
|
15
|
+
} from '../GidsTableEntry/GidsTableEntry';
|
|
16
|
+
import { GidsCrossTableRowActionEvent } from '@ganpatiinfo/gids-core-shared';
|
|
17
|
+
|
|
18
|
+
const { getGidsCrossTableRowClassNames } = GidsCrossTableRowWebUtils;
|
|
19
|
+
|
|
20
|
+
type GidsCrossTableRowBaseWebProps = GidsCrossTableRowWebProps<
|
|
21
|
+
GidsTableEntryTypographyStyle,
|
|
22
|
+
IconName,
|
|
23
|
+
IconAppearance,
|
|
24
|
+
DomChildren
|
|
25
|
+
>;
|
|
26
|
+
export type GidsCrossTableRowActionBaseEvent = GidsCrossTableRowActionEvent<
|
|
27
|
+
Event,
|
|
28
|
+
GidsTableEntryTypographyStyle,
|
|
29
|
+
IconName,
|
|
30
|
+
IconAppearance
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export interface GidsCrossTableRowDomProps extends GidsCrossTableRowBaseWebProps {
|
|
34
|
+
extraClasses?: string;
|
|
35
|
+
onCrossTableRowAction?: (event: GidsCrossTableRowActionBaseEvent) => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const GidsCrossTableRowDom = ({
|
|
39
|
+
rows = [],
|
|
40
|
+
crossHeaderItem,
|
|
41
|
+
crossHeaderSettings,
|
|
42
|
+
onCrossTableRowAction,
|
|
43
|
+
textAlignment = 'center',
|
|
44
|
+
appearance = 'none',
|
|
45
|
+
labelTypography = 'label-medium',
|
|
46
|
+
entryAlignment = 'center',
|
|
47
|
+
colorSwatchLabelColor = 'default',
|
|
48
|
+
colorSwatchLabelPosition = 'left',
|
|
49
|
+
colorSwatchLabelTypography = 'label-medium',
|
|
50
|
+
colorSwatchSize = 'sm',
|
|
51
|
+
colorSwatchShape = 'oval',
|
|
52
|
+
colorSwatchShadow = 'shadow-overlay',
|
|
53
|
+
colorSwatchBorderRadius = 'none',
|
|
54
|
+
colorSwatchApplyBorders = true,
|
|
55
|
+
colorSwatchBorderWidth = 'thick',
|
|
56
|
+
progressBarSize = 'sm',
|
|
57
|
+
progressBarEndCap = true,
|
|
58
|
+
avatarSize = 'sm',
|
|
59
|
+
avatarGroupAppearance,
|
|
60
|
+
avatarGroupLayout,
|
|
61
|
+
statusTagAppearance = 'subtle',
|
|
62
|
+
statusTagSize = 'sm',
|
|
63
|
+
progressBarContainerMinWidth = 200,
|
|
64
|
+
displayTagsOrientation = 'horizontal',
|
|
65
|
+
statusTagsOrientation = 'horizontal',
|
|
66
|
+
progressBarsOrientation = 'horizontal',
|
|
67
|
+
colorSwatchesOrientation = 'horizontal',
|
|
68
|
+
badgesOrientation = 'horizontal',
|
|
69
|
+
actionsBackgroundColor,
|
|
70
|
+
actionsContentColor,
|
|
71
|
+
backgroundColor,
|
|
72
|
+
contentColor,
|
|
73
|
+
children,
|
|
74
|
+
extraClasses,
|
|
75
|
+
}: GidsCrossTableRowDomProps): HTMLTableRowElement => {
|
|
76
|
+
const crossTableRow = document.createElement('tr');
|
|
77
|
+
crossTableRow.className = getGidsCrossTableRowClassNames(extraClasses);
|
|
78
|
+
|
|
79
|
+
if (isValidChildren<DomChildren>(children)) {
|
|
80
|
+
appendAsChildren(crossTableRow, children);
|
|
81
|
+
|
|
82
|
+
return crossTableRow;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function onEntryActionBtnClick({
|
|
86
|
+
event,
|
|
87
|
+
entryIndex,
|
|
88
|
+
}: {
|
|
89
|
+
event: GidsTableEntryActionBaseEvent;
|
|
90
|
+
entryIndex: number;
|
|
91
|
+
}) {
|
|
92
|
+
if (onCrossTableRowAction) {
|
|
93
|
+
onCrossTableRowAction({
|
|
94
|
+
...event,
|
|
95
|
+
details: {
|
|
96
|
+
...event.details,
|
|
97
|
+
entryIndex,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
* Cross Header
|
|
105
|
+
*
|
|
106
|
+
* IMPORTANT:
|
|
107
|
+
* Cross header settings are completely independent
|
|
108
|
+
* from the body row settings.
|
|
109
|
+
*/
|
|
110
|
+
if (crossHeaderItem && Object.keys(crossHeaderItem).length > 0) {
|
|
111
|
+
crossTableRow.append(
|
|
112
|
+
GidsTableEntryDom({
|
|
113
|
+
...crossHeaderItem,
|
|
114
|
+
...crossHeaderSettings,
|
|
115
|
+
label: crossHeaderItem?.label,
|
|
116
|
+
entryType: 'header',
|
|
117
|
+
/*
|
|
118
|
+
* Cross header uses its own settings first.
|
|
119
|
+
*/
|
|
120
|
+
leadingActions: crossHeaderItem?.leadingActions ?? [],
|
|
121
|
+
trailingActions: crossHeaderItem?.trailingActions ?? [],
|
|
122
|
+
entryAlignment: crossHeaderSettings?.entryAlignment ?? 'center',
|
|
123
|
+
colorSwatchLabelColor:
|
|
124
|
+
crossHeaderSettings?.colorSwatchLabelColor ?? 'default',
|
|
125
|
+
colorSwatchLabelPosition:
|
|
126
|
+
crossHeaderSettings?.colorSwatchLabelPosition ?? 'left',
|
|
127
|
+
colorSwatchLabelTypography:
|
|
128
|
+
crossHeaderSettings?.colorSwatchLabelTypography ?? 'label-medium',
|
|
129
|
+
colorSwatchSize: crossHeaderSettings?.colorSwatchSize ?? 'sm',
|
|
130
|
+
colorSwatchShape: crossHeaderSettings?.colorSwatchShape ?? 'oval',
|
|
131
|
+
colorSwatchShadow:
|
|
132
|
+
crossHeaderSettings?.colorSwatchShadow ?? 'shadow-overlay',
|
|
133
|
+
colorSwatchBorderRadius:
|
|
134
|
+
crossHeaderSettings?.colorSwatchBorderRadius ?? 'none',
|
|
135
|
+
colorSwatchApplyBorders:
|
|
136
|
+
crossHeaderSettings?.colorSwatchApplyBorders ?? true,
|
|
137
|
+
colorSwatchBorderWidth:
|
|
138
|
+
crossHeaderSettings?.colorSwatchBorderWidth ?? 'thick',
|
|
139
|
+
progressBarSize: crossHeaderSettings?.progressBarSize ?? 'sm',
|
|
140
|
+
progressBarEndCap: crossHeaderSettings?.progressBarEndCap ?? true,
|
|
141
|
+
avatarSize: crossHeaderSettings?.avatarSize ?? 'sm',
|
|
142
|
+
avatarGroupAppearance:
|
|
143
|
+
crossHeaderSettings?.avatarGroupAppearance ?? 'spread',
|
|
144
|
+
avatarGroupLayout: crossHeaderSettings?.avatarGroupLayout ?? 'wrap',
|
|
145
|
+
statusTagAppearance:
|
|
146
|
+
crossHeaderSettings?.statusTagAppearance ?? 'subtle',
|
|
147
|
+
statusTagSize: crossHeaderSettings?.statusTagSize ?? 'sm',
|
|
148
|
+
progressBarContainerMinWidth:
|
|
149
|
+
crossHeaderSettings?.progressBarContainerMinWidth ?? 200,
|
|
150
|
+
displayTagsOrientation:
|
|
151
|
+
crossHeaderSettings?.displayTagsOrientation ?? 'horizontal',
|
|
152
|
+
statusTagsOrientation:
|
|
153
|
+
crossHeaderSettings?.statusTagsOrientation ?? 'horizontal',
|
|
154
|
+
progressBarsOrientation:
|
|
155
|
+
crossHeaderSettings?.progressBarsOrientation ?? 'horizontal',
|
|
156
|
+
colorSwatchesOrientation:
|
|
157
|
+
crossHeaderSettings?.colorSwatchesOrientation ?? 'horizontal',
|
|
158
|
+
badgesOrientation:
|
|
159
|
+
crossHeaderSettings?.badgesOrientation ?? 'horizontal',
|
|
160
|
+
textAlignment: crossHeaderSettings?.textAlignment ?? 'center',
|
|
161
|
+
labelTypography: crossHeaderSettings?.labelTypography ?? 'label-medium',
|
|
162
|
+
appearance: crossHeaderSettings?.appearance ?? 'none',
|
|
163
|
+
/*
|
|
164
|
+
* Most importantly, colors come from crossHeaderSettings,
|
|
165
|
+
* never from the body row.
|
|
166
|
+
*/
|
|
167
|
+
onEntryAction: (event: GidsTableEntryActionBaseEvent) =>
|
|
168
|
+
onEntryActionBtnClick({
|
|
169
|
+
event,
|
|
170
|
+
entryIndex: -1,
|
|
171
|
+
}),
|
|
172
|
+
}),
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/*
|
|
177
|
+
* Body Cells
|
|
178
|
+
*
|
|
179
|
+
* These continue using the normal row settings.
|
|
180
|
+
*/
|
|
181
|
+
if (rows && rows.length > 0) {
|
|
182
|
+
rows.forEach((row, index) => {
|
|
183
|
+
crossTableRow.append(
|
|
184
|
+
GidsTableEntryDom({
|
|
185
|
+
...row,
|
|
186
|
+
entryType: 'body',
|
|
187
|
+
leadingActions: row?.leadingActions ?? [],
|
|
188
|
+
trailingActions: row?.trailingActions ?? [],
|
|
189
|
+
entryAlignment,
|
|
190
|
+
colorSwatchLabelColor,
|
|
191
|
+
colorSwatchLabelPosition,
|
|
192
|
+
colorSwatchLabelTypography,
|
|
193
|
+
colorSwatchSize,
|
|
194
|
+
colorSwatchShape,
|
|
195
|
+
colorSwatchShadow,
|
|
196
|
+
colorSwatchBorderRadius,
|
|
197
|
+
colorSwatchApplyBorders,
|
|
198
|
+
colorSwatchBorderWidth,
|
|
199
|
+
progressBarSize,
|
|
200
|
+
progressBarEndCap,
|
|
201
|
+
avatarSize,
|
|
202
|
+
avatarGroupAppearance,
|
|
203
|
+
avatarGroupLayout,
|
|
204
|
+
statusTagAppearance,
|
|
205
|
+
statusTagSize,
|
|
206
|
+
progressBarContainerMinWidth,
|
|
207
|
+
displayTagsOrientation,
|
|
208
|
+
statusTagsOrientation,
|
|
209
|
+
progressBarsOrientation,
|
|
210
|
+
colorSwatchesOrientation,
|
|
211
|
+
badgesOrientation,
|
|
212
|
+
textAlignment,
|
|
213
|
+
labelTypography,
|
|
214
|
+
appearance,
|
|
215
|
+
backgroundColor,
|
|
216
|
+
contentColor,
|
|
217
|
+
actionsBackgroundColor,
|
|
218
|
+
actionsContentColor,
|
|
219
|
+
onEntryAction: (event: GidsTableEntryActionBaseEvent) =>
|
|
220
|
+
onEntryActionBtnClick({
|
|
221
|
+
event,
|
|
222
|
+
entryIndex: index,
|
|
223
|
+
}),
|
|
224
|
+
}),
|
|
225
|
+
);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return crossTableRow;
|
|
230
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsDialogWebUtils,
|
|
3
|
+
type GidsDialogWebProps,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { DomNodeOrString } from '../../utils/domUtils.js';
|
|
6
|
+
import {
|
|
7
|
+
IconAppearance,
|
|
8
|
+
IconName,
|
|
9
|
+
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
10
|
+
import { GidsDialogControlDom } from '../_GidsDialogControl/GidsDialogControl.js';
|
|
11
|
+
import { GidsDialogControlCloseEvent } from '@ganpatiinfo/gids-core-shared';
|
|
12
|
+
|
|
13
|
+
const { getGidsDialogClassNames } = GidsDialogWebUtils;
|
|
14
|
+
|
|
15
|
+
type GidsDialogBaseWebProps = GidsDialogWebProps<
|
|
16
|
+
DomNodeOrString,
|
|
17
|
+
Event,
|
|
18
|
+
IconName,
|
|
19
|
+
IconAppearance
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
// 1. Create a custom type that represents your modified element
|
|
23
|
+
export type GidsDialogCustomElement = HTMLDialogElement & {
|
|
24
|
+
element: HTMLDialogElement;
|
|
25
|
+
open: (parent?: HTMLElement) => void;
|
|
26
|
+
close: () => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type GidsDialogDomProps = GidsDialogBaseWebProps;
|
|
30
|
+
|
|
31
|
+
export const GidsDialogDom = ({
|
|
32
|
+
variant = 'alert',
|
|
33
|
+
maxWidth = 'sm',
|
|
34
|
+
scrollMode = 'paper',
|
|
35
|
+
draggable = false,
|
|
36
|
+
headerTitle,
|
|
37
|
+
closeVisible = true,
|
|
38
|
+
children,
|
|
39
|
+
footerActions = [],
|
|
40
|
+
headerDividerVisible = false,
|
|
41
|
+
footerDividerVisible = false,
|
|
42
|
+
transition = 'none',
|
|
43
|
+
cancellable,
|
|
44
|
+
onCloseDialog,
|
|
45
|
+
onDialogFooterAction,
|
|
46
|
+
}: GidsDialogDomProps): GidsDialogCustomElement => {
|
|
47
|
+
const nativeClose = HTMLDialogElement.prototype.close;
|
|
48
|
+
|
|
49
|
+
function executeClose(event: GidsDialogControlCloseEvent<Event>) {
|
|
50
|
+
if (onCloseDialog) {
|
|
51
|
+
onCloseDialog({ originalEvent: event?.originalEvent });
|
|
52
|
+
}
|
|
53
|
+
dialog.close();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 1. Generate the pristine native dialog instance directly from the control function
|
|
57
|
+
const dialog = GidsDialogControlDom({
|
|
58
|
+
variant,
|
|
59
|
+
maxWidth,
|
|
60
|
+
scrollMode,
|
|
61
|
+
draggable,
|
|
62
|
+
headerTitle,
|
|
63
|
+
closeVisible,
|
|
64
|
+
children,
|
|
65
|
+
footerActions,
|
|
66
|
+
headerDividerVisible,
|
|
67
|
+
footerDividerVisible,
|
|
68
|
+
onCloseDialogControl: executeClose,
|
|
69
|
+
onDialogControlFooterAction: onDialogFooterAction,
|
|
70
|
+
}) as unknown as GidsDialogCustomElement;
|
|
71
|
+
|
|
72
|
+
// 2. CRITICAL BODY SCROLL PROTECTION: Inject layout protections inline immediately
|
|
73
|
+
if (scrollMode === 'body') {
|
|
74
|
+
dialog.style.setProperty('position', 'absolute', 'important');
|
|
75
|
+
dialog.style.setProperty('max-height', 'none', 'important');
|
|
76
|
+
dialog.style.setProperty('overflow', 'visible', 'important');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 3. RESTORED: Backdrop-only click cancellation logic for DOM target implementation
|
|
80
|
+
if (cancellable) {
|
|
81
|
+
dialog.addEventListener('click', (event: MouseEvent) => {
|
|
82
|
+
if (event.target === dialog) {
|
|
83
|
+
const rect = dialog.getBoundingClientRect();
|
|
84
|
+
const isOutside =
|
|
85
|
+
event.clientX < rect.left ||
|
|
86
|
+
event.clientX > rect.right ||
|
|
87
|
+
event.clientY < rect.top ||
|
|
88
|
+
event.clientY > rect.bottom;
|
|
89
|
+
|
|
90
|
+
if (isOutside) {
|
|
91
|
+
executeClose({ originalEvent: event });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
dialog.element = dialog as unknown as HTMLDialogElement;
|
|
98
|
+
|
|
99
|
+
// 4. Overwrite orchestration controllers cleanly via Object.defineProperty
|
|
100
|
+
Object.defineProperty(dialog, 'open', {
|
|
101
|
+
value: (parent: HTMLElement = document.body) => {
|
|
102
|
+
// Append the node directly to the DOM tree first
|
|
103
|
+
if (!dialog.isConnected) {
|
|
104
|
+
parent.appendChild(dialog);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (scrollMode === 'body') {
|
|
108
|
+
document.body.style.overflow = 'hidden';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Add base classes and transition modifiers ONLY when open() runs to stop the jumping bug
|
|
112
|
+
dialog.classList.add('gids-dialog');
|
|
113
|
+
|
|
114
|
+
const transitionClasses = getGidsDialogClassNames({ transition });
|
|
115
|
+
if (transitionClasses) {
|
|
116
|
+
transitionClasses.split(' ').forEach((className) => {
|
|
117
|
+
if (className.trim()) {
|
|
118
|
+
dialog.classList.add(className.trim());
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Force a quick layout reflow to initialize your animation coordinates perfectly
|
|
124
|
+
void dialog.offsetHeight;
|
|
125
|
+
|
|
126
|
+
// Open modal cleanly on the top layer
|
|
127
|
+
dialog.showModal();
|
|
128
|
+
},
|
|
129
|
+
writable: true,
|
|
130
|
+
configurable: true,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
Object.defineProperty(dialog, 'close', {
|
|
134
|
+
value: () => {
|
|
135
|
+
if (scrollMode === 'body') {
|
|
136
|
+
document.body.style.overflow = '';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Clean up all added classes on close so they completely reset for the next run
|
|
140
|
+
dialog.classList.remove('gids-dialog');
|
|
141
|
+
const transitionClasses = getGidsDialogClassNames({ transition });
|
|
142
|
+
if (transitionClasses) {
|
|
143
|
+
transitionClasses.split(' ').forEach((className) => {
|
|
144
|
+
if (className.trim()) {
|
|
145
|
+
dialog.classList.remove(className.trim());
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
nativeClose.call(dialog);
|
|
151
|
+
|
|
152
|
+
if (dialog.isConnected) {
|
|
153
|
+
dialog.remove();
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
writable: true,
|
|
157
|
+
configurable: true,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return dialog;
|
|
161
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { GidsMatrixTableBodyActionButtonEvent } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import {
|
|
3
|
+
GidsMatrixTableWebProps,
|
|
4
|
+
GidsMatrixTableWebUtils,
|
|
5
|
+
GidsTableCellTypographyStyle,
|
|
6
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
7
|
+
import {
|
|
8
|
+
IconAppearance,
|
|
9
|
+
IconName,
|
|
10
|
+
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
11
|
+
import {
|
|
12
|
+
GidsBasicTableHeaderActionButtonBaseEvent,
|
|
13
|
+
GidsBasicTableHeaderDom,
|
|
14
|
+
} from '../GidsBasicTableHeader/GidsBasicTableHeader';
|
|
15
|
+
import { GidsMatrixTableBodyDom } from '../GidsMatrixTableBody/GidsMatrixTableBody';
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
getGidsMatrixTableClassNames,
|
|
19
|
+
getCustomisedTopHeaderMatrixTableCells,
|
|
20
|
+
getMatrixTableBodyBorder,
|
|
21
|
+
getMatrixTableClasses,
|
|
22
|
+
} = GidsMatrixTableWebUtils;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
*
|
|
27
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
28
|
+
*/
|
|
29
|
+
type GidsMatrixTableBaseWebProps = GidsMatrixTableWebProps<
|
|
30
|
+
GidsTableCellTypographyStyle,
|
|
31
|
+
IconName,
|
|
32
|
+
IconAppearance
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated
|
|
37
|
+
*
|
|
38
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
39
|
+
*/
|
|
40
|
+
type GidsMatrixTableActionButtonBaseEvent =
|
|
41
|
+
GidsMatrixTableBodyActionButtonEvent<
|
|
42
|
+
Event,
|
|
43
|
+
GidsTableCellTypographyStyle,
|
|
44
|
+
IconName,
|
|
45
|
+
IconAppearance
|
|
46
|
+
>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
*
|
|
51
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
52
|
+
*/
|
|
53
|
+
export interface GidsMatrixTableDomProps extends GidsMatrixTableBaseWebProps {
|
|
54
|
+
extraClasses?: string;
|
|
55
|
+
onClickMatrixTableActionBtn?: (
|
|
56
|
+
event: GidsMatrixTableActionButtonBaseEvent,
|
|
57
|
+
) => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
*
|
|
63
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
64
|
+
*/
|
|
65
|
+
export const GidsMatrixTableDom = ({
|
|
66
|
+
topHeaderCells = [],
|
|
67
|
+
tableBodyItems = [],
|
|
68
|
+
width = 'full',
|
|
69
|
+
isTopHeaderVisible = false,
|
|
70
|
+
topHeaderAppearance = 'none',
|
|
71
|
+
topHeaderLabelTypography = 'eyebrow-small',
|
|
72
|
+
topHeaderTextAlignment = 'left',
|
|
73
|
+
rowAppearance = 'none',
|
|
74
|
+
rowLabelTypography = 'label-small',
|
|
75
|
+
rowTextAlignment = 'left',
|
|
76
|
+
tableBorders = 'none',
|
|
77
|
+
tableBorderRadius = [],
|
|
78
|
+
tableBodyMaxHeight = 200,
|
|
79
|
+
rowCellPrimaryActionButtons = [],
|
|
80
|
+
rowCellSecondaryActionButtons = [],
|
|
81
|
+
topHeaderPrimaryActionButtons = [],
|
|
82
|
+
topHeaderSecondaryActionButtons = [],
|
|
83
|
+
onClickMatrixTableActionBtn,
|
|
84
|
+
matrixHeaderAppearance = 'none',
|
|
85
|
+
matrixHeaderLabelTypography = 'label-medium',
|
|
86
|
+
matrixHeaderTextAlignment = 'left',
|
|
87
|
+
matrixHeaderCellPrimaryActionButtons = [],
|
|
88
|
+
matrixHeaderCellSecondaryActionButtons = [],
|
|
89
|
+
extraClasses,
|
|
90
|
+
}: GidsMatrixTableDomProps): HTMLElement => {
|
|
91
|
+
const matrixTableDiv = document.createElement('div');
|
|
92
|
+
matrixTableDiv.className = getGidsMatrixTableClassNames<
|
|
93
|
+
GidsTableCellTypographyStyle,
|
|
94
|
+
IconName,
|
|
95
|
+
IconAppearance
|
|
96
|
+
>({ width, tableBorders, tableBorderRadius }, extraClasses);
|
|
97
|
+
|
|
98
|
+
// Wrapper Container to safely handle scroll containment
|
|
99
|
+
const matrixTableScrollContainer = document.createElement('div');
|
|
100
|
+
matrixTableScrollContainer.className = 'gids-matrix-table__scroll-container';
|
|
101
|
+
|
|
102
|
+
// Safe injection of the custom property value into the container element
|
|
103
|
+
if (tableBodyMaxHeight) {
|
|
104
|
+
matrixTableScrollContainer.style.setProperty(
|
|
105
|
+
'--gidsMatrixTable-body-max-height',
|
|
106
|
+
`${tableBodyMaxHeight}px`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const matrixTable = document.createElement('table');
|
|
111
|
+
matrixTable.className = getMatrixTableClasses<
|
|
112
|
+
GidsTableCellTypographyStyle,
|
|
113
|
+
IconName,
|
|
114
|
+
IconAppearance
|
|
115
|
+
>({ width });
|
|
116
|
+
|
|
117
|
+
if (isTopHeaderVisible && topHeaderCells && topHeaderCells.length > 0) {
|
|
118
|
+
function onTopHeaderActionBtnClick(
|
|
119
|
+
event: GidsBasicTableHeaderActionButtonBaseEvent,
|
|
120
|
+
) {
|
|
121
|
+
if (onClickMatrixTableActionBtn) {
|
|
122
|
+
onClickMatrixTableActionBtn({
|
|
123
|
+
...event,
|
|
124
|
+
details: {
|
|
125
|
+
...event.details,
|
|
126
|
+
columnIndex: event?.details?.cellIndex,
|
|
127
|
+
headerType: 'top',
|
|
128
|
+
rowIndex: event?.details?.cellIndex,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Append Table Header
|
|
135
|
+
matrixTable.append(
|
|
136
|
+
GidsBasicTableHeaderDom({
|
|
137
|
+
appearance: topHeaderAppearance,
|
|
138
|
+
labelTypography: topHeaderLabelTypography,
|
|
139
|
+
textAlignment: topHeaderTextAlignment,
|
|
140
|
+
extraClasses: 'gids-matrix-table__top-thead',
|
|
141
|
+
headerCells: getCustomisedTopHeaderMatrixTableCells<
|
|
142
|
+
GidsTableCellTypographyStyle,
|
|
143
|
+
IconName,
|
|
144
|
+
IconAppearance
|
|
145
|
+
>({
|
|
146
|
+
topHeaderCells,
|
|
147
|
+
tableBorders,
|
|
148
|
+
}),
|
|
149
|
+
width,
|
|
150
|
+
cellPrimaryActionButtons: topHeaderPrimaryActionButtons,
|
|
151
|
+
cellSecondaryActionButtons: topHeaderSecondaryActionButtons,
|
|
152
|
+
onClickHeaderActionBtn: onTopHeaderActionBtnClick,
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (tableBodyItems && tableBodyItems.length > 0) {
|
|
158
|
+
matrixTable.append(
|
|
159
|
+
GidsMatrixTableBodyDom({
|
|
160
|
+
width,
|
|
161
|
+
tableBodyItems,
|
|
162
|
+
tableBorders: getMatrixTableBodyBorder<
|
|
163
|
+
GidsTableCellTypographyStyle,
|
|
164
|
+
IconName,
|
|
165
|
+
IconAppearance
|
|
166
|
+
>({ tableBorders }),
|
|
167
|
+
rowAppearance,
|
|
168
|
+
rowLabelTypography,
|
|
169
|
+
rowTextAlignment,
|
|
170
|
+
matrixHeaderAppearance,
|
|
171
|
+
matrixHeaderLabelTypography,
|
|
172
|
+
matrixHeaderTextAlignment,
|
|
173
|
+
rowCellPrimaryActionButtons,
|
|
174
|
+
rowCellSecondaryActionButtons,
|
|
175
|
+
matrixHeaderCellPrimaryActionButtons,
|
|
176
|
+
matrixHeaderCellSecondaryActionButtons,
|
|
177
|
+
onClickMatrixBodyCellActionBtn: onClickMatrixTableActionBtn,
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Structural Append hierarchy: matrixTable -> scroll wrapper -> root container
|
|
183
|
+
matrixTableScrollContainer.appendChild(matrixTable);
|
|
184
|
+
matrixTableDiv.appendChild(matrixTableScrollContainer);
|
|
185
|
+
|
|
186
|
+
return matrixTableDiv;
|
|
187
|
+
};
|