@ganpatiinfo/gids-web-dom-reference 12.0.0 → 13.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 +84 -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/GidsMatrixTable/GidsMatrixTable.d.ts +12 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js +70 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +12 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +70 -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/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/GidsTable/GidsTable.d.ts +18 -0
- package/dist/components/GidsTable/GidsTable.d.ts.map +1 -0
- package/dist/components/GidsTable/GidsTable.js +96 -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 +75 -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 +97 -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 +51 -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/_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 +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- 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/GidsMatrixTable/GidsMatrixTable.ts +167 -0
- package/src/components/GidsMatrixTableBody/GidsMatrixTableBody.ts +164 -0
- package/src/components/GidsMdTable/GidsMdTable.ts +14 -2
- 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/GidsTable/GidsTable.ts +203 -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 +157 -0
- package/src/components/GidsTableFooterControl/GidsTableFooterControl.ts +159 -0
- package/src/components/GidsTableHeader/GidsTableHeader.ts +116 -0
- package/src/components/GidsTableRow/GidsTableRow.ts +154 -0
- package/src/components/GidsTableToolbar/GidsTableToolbar.ts +180 -0
- package/src/components/_GidsPaginationItem/GidsPaginationItem.ts +14 -2
- package/src/index.ts +15 -1
- 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,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
GidsTableCellTypographyStyle,
|
|
3
3
|
GidsBasicTableHeaderWebProps,
|
|
4
4
|
GidsBasicTableHeaderWebUtils,
|
|
5
5
|
} from '@ganpatiinfo/gids-web-shared';
|
|
6
6
|
import { GidsBasicTableRowDom } from '../GidsBasicTableRow/GidsBasicTableRow';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
GidsBasicTableHeaderActionButtonEvent,
|
|
9
|
+
GidsBasicTableRowItem,
|
|
10
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
8
11
|
import {
|
|
9
12
|
IconAppearance,
|
|
10
13
|
IconName,
|
|
@@ -12,16 +15,47 @@ import {
|
|
|
12
15
|
|
|
13
16
|
const { getGidsBasicTableHeaderClassNames } = GidsBasicTableHeaderWebUtils;
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
*
|
|
21
|
+
* Use `GidsTableHeader` and its props and functions instead.
|
|
22
|
+
*/
|
|
15
23
|
type GidsBasicTableHeaderBaseWebProps = GidsBasicTableHeaderWebProps<
|
|
16
|
-
|
|
24
|
+
GidsTableCellTypographyStyle,
|
|
17
25
|
IconName,
|
|
18
26
|
IconAppearance
|
|
19
27
|
>;
|
|
20
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated
|
|
31
|
+
*
|
|
32
|
+
* Use `GidsTableHeader` and its props and functions instead.
|
|
33
|
+
*/
|
|
34
|
+
export type GidsBasicTableHeaderActionButtonBaseEvent =
|
|
35
|
+
GidsBasicTableHeaderActionButtonEvent<
|
|
36
|
+
Event,
|
|
37
|
+
GidsTableCellTypographyStyle,
|
|
38
|
+
IconName,
|
|
39
|
+
IconAppearance
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*
|
|
45
|
+
* Use `GidsTableHeader` and its props and functions instead.
|
|
46
|
+
*/
|
|
21
47
|
export interface GidsBasicTableHeaderDomProps extends GidsBasicTableHeaderBaseWebProps {
|
|
22
48
|
extraClasses?: string;
|
|
49
|
+
onClickHeaderActionBtn?: (
|
|
50
|
+
event: GidsBasicTableHeaderActionButtonBaseEvent,
|
|
51
|
+
) => void;
|
|
23
52
|
}
|
|
24
53
|
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated
|
|
56
|
+
*
|
|
57
|
+
* Use `GidsTableHeader` and its props and functions instead.
|
|
58
|
+
*/
|
|
25
59
|
export const GidsBasicTableHeaderDom = ({
|
|
26
60
|
width = 'full',
|
|
27
61
|
headerCells = [],
|
|
@@ -29,6 +63,9 @@ export const GidsBasicTableHeaderDom = ({
|
|
|
29
63
|
labelTypography = 'label-medium',
|
|
30
64
|
textAlignment = 'center',
|
|
31
65
|
layout = 'horizontal',
|
|
66
|
+
cellPrimaryActionButtons,
|
|
67
|
+
cellSecondaryActionButtons,
|
|
68
|
+
onClickHeaderActionBtn,
|
|
32
69
|
extraClasses,
|
|
33
70
|
}: GidsBasicTableHeaderDomProps) => {
|
|
34
71
|
const basicTableHeader = document.createElement('thead');
|
|
@@ -40,14 +77,14 @@ export const GidsBasicTableHeaderDom = ({
|
|
|
40
77
|
if (headerCells && headerCells.length > 0) {
|
|
41
78
|
// 1. Map cells to forward global table header styles/props into each row item
|
|
42
79
|
const mappedHeaderCells: GidsBasicTableRowItem<
|
|
43
|
-
|
|
80
|
+
GidsTableCellTypographyStyle,
|
|
44
81
|
IconName,
|
|
45
82
|
IconAppearance
|
|
46
83
|
>[] = headerCells.map(
|
|
47
84
|
(
|
|
48
85
|
cell,
|
|
49
86
|
): GidsBasicTableRowItem<
|
|
50
|
-
|
|
87
|
+
GidsTableCellTypographyStyle,
|
|
51
88
|
IconName,
|
|
52
89
|
IconAppearance
|
|
53
90
|
> => ({
|
|
@@ -64,6 +101,9 @@ export const GidsBasicTableHeaderDom = ({
|
|
|
64
101
|
layout,
|
|
65
102
|
rows: mappedHeaderCells,
|
|
66
103
|
isHeaderRow: true,
|
|
104
|
+
cellPrimaryActionButtons,
|
|
105
|
+
cellSecondaryActionButtons,
|
|
106
|
+
onClickRowActionBtn: onClickHeaderActionBtn,
|
|
67
107
|
});
|
|
68
108
|
|
|
69
109
|
basicTableHeader.append(rowContent);
|
|
@@ -1,51 +1,105 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
GidsTableCellTypographyStyle,
|
|
3
3
|
type GidsBasicTableRowWebProps,
|
|
4
4
|
GidsBasicTableRowWebUtils,
|
|
5
5
|
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
GidsTableCellActionButtonBaseEvent,
|
|
8
|
+
GidsTableCellDom,
|
|
9
|
+
} from '../GidsTableCell/GidsTableCell.js';
|
|
7
10
|
import {
|
|
8
11
|
IconAppearance,
|
|
9
12
|
IconName,
|
|
10
13
|
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
14
|
+
import { GidsBasicTableRowActionButtonEvent } from '@ganpatiinfo/gids-core-shared';
|
|
11
15
|
|
|
12
16
|
const { getGidsBasicTableRowClassNames } = GidsBasicTableRowWebUtils;
|
|
13
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
* Use `GidsTableRow` and its props and functions instead.
|
|
21
|
+
*/
|
|
14
22
|
type GidsBasicTableRowBaseWebProps = GidsBasicTableRowWebProps<
|
|
15
|
-
|
|
23
|
+
GidsTableCellTypographyStyle,
|
|
16
24
|
IconName,
|
|
17
25
|
IconAppearance
|
|
18
26
|
>;
|
|
19
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
* Use `GidsTableRow` and its props and functions instead.
|
|
31
|
+
*/
|
|
32
|
+
export type GidsBasicTableRowActionButtonBaseEvent =
|
|
33
|
+
GidsBasicTableRowActionButtonEvent<
|
|
34
|
+
Event,
|
|
35
|
+
GidsTableCellTypographyStyle,
|
|
36
|
+
IconName,
|
|
37
|
+
IconAppearance
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
* Use `GidsTableRow` and its props and functions instead.
|
|
43
|
+
*/
|
|
20
44
|
export interface GidsBasicTableRowDomProps extends GidsBasicTableRowBaseWebProps {
|
|
21
45
|
extraClasses?: string;
|
|
46
|
+
onClickRowActionBtn?: (event: GidsBasicTableRowActionButtonBaseEvent) => void;
|
|
22
47
|
}
|
|
23
48
|
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated
|
|
51
|
+
* Use `GidsTableRow` and its props and functions instead.
|
|
52
|
+
*/
|
|
24
53
|
export const GidsBasicTableRowDom = ({
|
|
25
54
|
width = 'full',
|
|
26
55
|
layout = 'horizontal',
|
|
27
56
|
rows,
|
|
28
57
|
isHeaderRow = false,
|
|
58
|
+
cellPrimaryActionButtons,
|
|
59
|
+
cellSecondaryActionButtons,
|
|
60
|
+
onClickRowActionBtn,
|
|
29
61
|
extraClasses,
|
|
30
62
|
}: GidsBasicTableRowDomProps): HTMLElement | DocumentFragment => {
|
|
31
63
|
const rowClassName = getGidsBasicTableRowClassNames({ width }, extraClasses);
|
|
32
64
|
|
|
65
|
+
function onCellActionBtnClick({
|
|
66
|
+
event,
|
|
67
|
+
cellIndex,
|
|
68
|
+
}: {
|
|
69
|
+
event: GidsTableCellActionButtonBaseEvent;
|
|
70
|
+
cellIndex: number;
|
|
71
|
+
}) {
|
|
72
|
+
if (onClickRowActionBtn) {
|
|
73
|
+
onClickRowActionBtn({
|
|
74
|
+
...event,
|
|
75
|
+
details: {
|
|
76
|
+
...event.details,
|
|
77
|
+
cellIndex,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
33
83
|
// 2. Handling Vertical Layout
|
|
34
84
|
if (layout === 'vertical' && rows && rows.length > 0) {
|
|
35
85
|
const fragment = document.createDocumentFragment();
|
|
36
86
|
|
|
37
|
-
rows.forEach((tableRow) => {
|
|
87
|
+
rows.forEach((tableRow, indexI) => {
|
|
38
88
|
// Create a clean, independent <tr> wrapper for each vertical entry
|
|
39
89
|
const singleRowEl = document.createElement('tr');
|
|
40
90
|
singleRowEl.className = rowClassName;
|
|
41
91
|
|
|
42
92
|
const rowLabel = tableRow?.label;
|
|
43
93
|
singleRowEl.append(
|
|
44
|
-
|
|
94
|
+
GidsTableCellDom({
|
|
45
95
|
...tableRow,
|
|
46
96
|
width: width,
|
|
47
97
|
label: rowLabel,
|
|
48
98
|
isHeaderCell: isHeaderRow,
|
|
99
|
+
cellPrimaryActionButtons,
|
|
100
|
+
cellSecondaryActionButtons,
|
|
101
|
+
onClickCellActionBtn: (event: GidsTableCellActionButtonBaseEvent) =>
|
|
102
|
+
onCellActionBtnClick({ event, cellIndex: indexI }),
|
|
49
103
|
}),
|
|
50
104
|
);
|
|
51
105
|
|
|
@@ -61,15 +115,19 @@ export const GidsBasicTableRowDom = ({
|
|
|
61
115
|
basicTableRow.className = rowClassName;
|
|
62
116
|
|
|
63
117
|
if (rows && rows.length > 0) {
|
|
64
|
-
rows.forEach((tableRow) => {
|
|
118
|
+
rows.forEach((tableRow, indexJ) => {
|
|
65
119
|
const rowLabel = tableRow?.label;
|
|
66
120
|
|
|
67
121
|
basicTableRow.append(
|
|
68
|
-
|
|
122
|
+
GidsTableCellDom({
|
|
69
123
|
...tableRow,
|
|
70
124
|
width: width,
|
|
71
125
|
label: rowLabel,
|
|
72
126
|
isHeaderCell: isHeaderRow,
|
|
127
|
+
cellPrimaryActionButtons,
|
|
128
|
+
cellSecondaryActionButtons,
|
|
129
|
+
onClickCellActionBtn: (event: GidsTableCellActionButtonBaseEvent) =>
|
|
130
|
+
onCellActionBtnClick({ event, cellIndex: indexJ }),
|
|
73
131
|
}),
|
|
74
132
|
);
|
|
75
133
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
GidsTableCellTypographyStyle,
|
|
3
3
|
GidsBsTableWebProps,
|
|
4
4
|
GidsBsTableWebUtils,
|
|
5
5
|
} from '@ganpatiinfo/gids-web-shared';
|
|
@@ -9,12 +9,19 @@ import {
|
|
|
9
9
|
GidsBasicTableHeadDom,
|
|
10
10
|
GidsBasicTableHeadDomProps,
|
|
11
11
|
} from '../GidsBasicTableHead/GidsBasicTableHead';
|
|
12
|
-
import {
|
|
13
|
-
|
|
12
|
+
import {
|
|
13
|
+
GidsBasicTableHeaderActionButtonBaseEvent,
|
|
14
|
+
GidsBasicTableHeaderDom,
|
|
15
|
+
} from '../GidsBasicTableHeader/GidsBasicTableHeader';
|
|
16
|
+
import {
|
|
17
|
+
GidsBasicTableBodyActionButtonBaseEvent,
|
|
18
|
+
GidsBasicTableBodyDom,
|
|
19
|
+
} from '../GidsBasicTableBody/GidsBasicTableBody';
|
|
14
20
|
import {
|
|
15
21
|
IconAppearance,
|
|
16
22
|
IconName,
|
|
17
23
|
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
24
|
+
import { GidsBsTableActionButtonEvent } from '@ganpatiinfo/gids-core-shared';
|
|
18
25
|
|
|
19
26
|
const {
|
|
20
27
|
getGidsBsTableClassNames,
|
|
@@ -23,8 +30,13 @@ const {
|
|
|
23
30
|
getBsTableBodyBorder,
|
|
24
31
|
} = GidsBsTableWebUtils;
|
|
25
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated
|
|
35
|
+
*
|
|
36
|
+
* Use `GidsTable` and its props and functions instead.
|
|
37
|
+
*/
|
|
26
38
|
type GidsBsTableBaseWebProps = GidsBsTableWebProps<
|
|
27
|
-
|
|
39
|
+
GidsTableCellTypographyStyle,
|
|
28
40
|
IconName,
|
|
29
41
|
IconAppearance,
|
|
30
42
|
DomChildren,
|
|
@@ -37,10 +49,33 @@ type GidsBsTableBaseWebProps = GidsBsTableWebProps<
|
|
|
37
49
|
'onChange' | 'onInput' | 'onFocus' | 'onBlur' | 'onGidsSearchBarClear'
|
|
38
50
|
>;
|
|
39
51
|
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated
|
|
54
|
+
*
|
|
55
|
+
* Use `GidsTable` and its props and functions instead.
|
|
56
|
+
*/
|
|
57
|
+
type GidsBsTableActionButtonBaseEvent = GidsBsTableActionButtonEvent<
|
|
58
|
+
Event,
|
|
59
|
+
GidsTableCellTypographyStyle,
|
|
60
|
+
IconName,
|
|
61
|
+
IconAppearance
|
|
62
|
+
>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*
|
|
67
|
+
* Use `GidsTable` and its props and functions instead.
|
|
68
|
+
*/
|
|
40
69
|
export interface GidsBsTableDomProps extends GidsBsTableBaseWebProps {
|
|
41
70
|
extraClasses?: string;
|
|
71
|
+
onClickBsTableActionBtn?: (event: GidsBsTableActionButtonBaseEvent) => void;
|
|
42
72
|
}
|
|
43
73
|
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*
|
|
77
|
+
* Use `GidsTable` and its props and functions instead.
|
|
78
|
+
*/
|
|
44
79
|
export const GidsBsTableDom = ({
|
|
45
80
|
// Table properties
|
|
46
81
|
topHeaderCells = [],
|
|
@@ -57,6 +92,11 @@ export const GidsBsTableDom = ({
|
|
|
57
92
|
tableBorders = 'none',
|
|
58
93
|
tableBorderRadius = [],
|
|
59
94
|
tableBodyMaxHeight = 200,
|
|
95
|
+
tableBodyPrimaryActionButtons = [],
|
|
96
|
+
tableBodySecondaryActionButtons = [],
|
|
97
|
+
topHeaderPrimaryActionButtons = [],
|
|
98
|
+
topHeaderSecondaryActionButtons = [],
|
|
99
|
+
onClickBsTableActionBtn,
|
|
60
100
|
extraClasses,
|
|
61
101
|
|
|
62
102
|
// Table Head properties
|
|
@@ -104,16 +144,16 @@ export const GidsBsTableDom = ({
|
|
|
104
144
|
headAppearance = 'surface-default',
|
|
105
145
|
...restProps
|
|
106
146
|
}: GidsBsTableDomProps): HTMLDivElement => {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
147
|
+
const bsTableDiv = document.createElement('div');
|
|
148
|
+
bsTableDiv.className = getGidsBsTableClassNames<
|
|
149
|
+
GidsTableCellTypographyStyle,
|
|
110
150
|
IconName,
|
|
111
151
|
IconAppearance
|
|
112
152
|
>({ width, tableBorders, tableBorderRadius }, extraClasses);
|
|
113
153
|
|
|
114
154
|
// Table Head properties
|
|
115
155
|
if (isHeadVisible) {
|
|
116
|
-
|
|
156
|
+
bsTableDiv.append(
|
|
117
157
|
GidsBasicTableHeadDom({
|
|
118
158
|
actionGroup,
|
|
119
159
|
allFiltersTabVisible,
|
|
@@ -175,22 +215,38 @@ export const GidsBsTableDom = ({
|
|
|
175
215
|
}
|
|
176
216
|
|
|
177
217
|
// Table properties
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
218
|
+
const bsTable = document.createElement('table');
|
|
219
|
+
bsTable.className = getBsTableClasses<
|
|
220
|
+
GidsTableCellTypographyStyle,
|
|
181
221
|
IconName,
|
|
182
222
|
IconAppearance
|
|
183
223
|
>({ width, isHeadVisible });
|
|
184
224
|
|
|
225
|
+
function onActionBtnClick(
|
|
226
|
+
event:
|
|
227
|
+
| GidsBasicTableHeaderActionButtonBaseEvent
|
|
228
|
+
| GidsBasicTableBodyActionButtonBaseEvent,
|
|
229
|
+
) {
|
|
230
|
+
if (onClickBsTableActionBtn) {
|
|
231
|
+
onClickBsTableActionBtn({
|
|
232
|
+
...event,
|
|
233
|
+
details: {
|
|
234
|
+
...event.details,
|
|
235
|
+
columnIndex: event?.details?.cellIndex,
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
185
241
|
if (isTopHeaderVisible && topHeaderCells && topHeaderCells.length > 0) {
|
|
186
242
|
// Append Table Header
|
|
187
|
-
|
|
243
|
+
bsTable.append(
|
|
188
244
|
GidsBasicTableHeaderDom({
|
|
189
245
|
appearance: topHeaderAppearance,
|
|
190
246
|
labelTypography: topHeaderLabelTypography,
|
|
191
247
|
textAlignment: topHeaderTextAlignment,
|
|
192
248
|
headerCells: getCustomisedTopHeaderCells<
|
|
193
|
-
|
|
249
|
+
GidsTableCellTypographyStyle,
|
|
194
250
|
IconName,
|
|
195
251
|
IconAppearance
|
|
196
252
|
>({
|
|
@@ -198,16 +254,19 @@ export const GidsBsTableDom = ({
|
|
|
198
254
|
tableBorders,
|
|
199
255
|
}),
|
|
200
256
|
width: isHeadVisible ? 'full' : width,
|
|
257
|
+
cellPrimaryActionButtons: topHeaderPrimaryActionButtons,
|
|
258
|
+
cellSecondaryActionButtons: topHeaderSecondaryActionButtons,
|
|
259
|
+
onClickHeaderActionBtn: onActionBtnClick,
|
|
201
260
|
}),
|
|
202
261
|
);
|
|
203
262
|
}
|
|
204
263
|
|
|
205
264
|
if (tableBody && tableBody.length > 0) {
|
|
206
|
-
|
|
265
|
+
bsTable.append(
|
|
207
266
|
GidsBasicTableBodyDom({
|
|
208
267
|
width: isHeadVisible ? 'full' : width,
|
|
209
268
|
tableBorders: getBsTableBodyBorder<
|
|
210
|
-
|
|
269
|
+
GidsTableCellTypographyStyle,
|
|
211
270
|
IconName,
|
|
212
271
|
IconAppearance
|
|
213
272
|
>({ tableBorders }),
|
|
@@ -215,13 +274,16 @@ export const GidsBsTableDom = ({
|
|
|
215
274
|
rowAppearance,
|
|
216
275
|
rowLabelTypography,
|
|
217
276
|
rowTextAlignment,
|
|
277
|
+
tableBodyCellPrimaryActionButtons: tableBodyPrimaryActionButtons,
|
|
278
|
+
tableBodyCellSecondaryActionButtons: tableBodySecondaryActionButtons,
|
|
279
|
+
onClickBodyCellActionBtn: onActionBtnClick,
|
|
218
280
|
}),
|
|
219
281
|
);
|
|
220
282
|
}
|
|
221
283
|
|
|
222
|
-
// Structural Append hierarchy:
|
|
223
|
-
tableScrollContainer.appendChild(
|
|
224
|
-
|
|
284
|
+
// Structural Append hierarchy: bsTable -> scroll wrapper -> root container
|
|
285
|
+
tableScrollContainer.appendChild(bsTable);
|
|
286
|
+
bsTableDiv.appendChild(tableScrollContainer);
|
|
225
287
|
|
|
226
|
-
return
|
|
288
|
+
return bsTableDiv;
|
|
227
289
|
};
|
|
@@ -17,6 +17,7 @@ export interface GidsChartLegendItemDomProps extends GidsChartLegendItemWebProps
|
|
|
17
17
|
export const GidsChartLegendItemDom = ({
|
|
18
18
|
children,
|
|
19
19
|
seriesType = '1',
|
|
20
|
+
seriesColor,
|
|
20
21
|
orientation = 'horizontal',
|
|
21
22
|
extraClasses,
|
|
22
23
|
}: GidsChartLegendItemDomProps): HTMLElement => {
|
|
@@ -29,6 +30,7 @@ export const GidsChartLegendItemDom = ({
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
chartLegendItem.seriesType = seriesType;
|
|
33
|
+
chartLegendItem.seriesColor = seriesColor;
|
|
32
34
|
chartLegendItem.orientation = orientation;
|
|
33
35
|
|
|
34
36
|
chartLegendItem.className = getGidsChartLegendItemClassNames(
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsColorSwatchTypographyStyle,
|
|
3
|
+
type GidsColorSwatchWebProps,
|
|
4
|
+
GidsColorSwatchWebUtils,
|
|
5
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
getGidsColorSwatchClassNames,
|
|
9
|
+
getGidsColorSwatchPanelClasses,
|
|
10
|
+
getGidsColorSwatchLabelClasses,
|
|
11
|
+
} = GidsColorSwatchWebUtils;
|
|
12
|
+
|
|
13
|
+
type GidsColorSwatchBaseWebProps =
|
|
14
|
+
GidsColorSwatchWebProps<GidsColorSwatchTypographyStyle>;
|
|
15
|
+
|
|
16
|
+
export interface GidsColorSwatchDomProps extends GidsColorSwatchBaseWebProps {
|
|
17
|
+
extraClasses?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const GidsColorSwatchDom = ({
|
|
21
|
+
label,
|
|
22
|
+
labelColor = 'default',
|
|
23
|
+
labelTypography = 'label-x-small',
|
|
24
|
+
labelPosition = 'left',
|
|
25
|
+
swatchColor,
|
|
26
|
+
swatchSize = 'xs',
|
|
27
|
+
swatchShape = 'rectangle',
|
|
28
|
+
swatchShadow = 'none',
|
|
29
|
+
borderRadius = 'none',
|
|
30
|
+
applyBorders = false,
|
|
31
|
+
borderColor = 'input',
|
|
32
|
+
borderWidth = 'default',
|
|
33
|
+
extraClasses,
|
|
34
|
+
}: GidsColorSwatchDomProps): HTMLDivElement => {
|
|
35
|
+
const colorSwatch = document.createElement('div');
|
|
36
|
+
colorSwatch.className = getGidsColorSwatchClassNames(
|
|
37
|
+
{ labelPosition },
|
|
38
|
+
extraClasses,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
colorSwatch.setAttribute('swatch-shape', swatchShape);
|
|
42
|
+
if (swatchColor) {
|
|
43
|
+
colorSwatch.setAttribute('swatch-color', swatchColor);
|
|
44
|
+
}
|
|
45
|
+
colorSwatch.setAttribute('swatch-shadow', swatchShadow);
|
|
46
|
+
colorSwatch.setAttribute('swatch-size', swatchSize);
|
|
47
|
+
colorSwatch.setAttribute('border-radius', borderRadius);
|
|
48
|
+
colorSwatch.setAttribute('border-color', borderColor);
|
|
49
|
+
colorSwatch.setAttribute('label-color', labelColor);
|
|
50
|
+
|
|
51
|
+
if (applyBorders) {
|
|
52
|
+
colorSwatch.setAttribute('apply-borders', 'true');
|
|
53
|
+
} else {
|
|
54
|
+
colorSwatch.removeAttribute('apply-borders');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const spanLabel = document.createElement('span');
|
|
58
|
+
spanLabel.className = getGidsColorSwatchLabelClasses({
|
|
59
|
+
labelTypography,
|
|
60
|
+
});
|
|
61
|
+
spanLabel.style.color =
|
|
62
|
+
labelColor === 'swatch-color'
|
|
63
|
+
? `${swatchColor}`
|
|
64
|
+
: `var(--gids-color-text-default)`;
|
|
65
|
+
|
|
66
|
+
if (
|
|
67
|
+
label &&
|
|
68
|
+
label !== '' &&
|
|
69
|
+
(labelPosition === 'top' || labelPosition === 'left')
|
|
70
|
+
) {
|
|
71
|
+
spanLabel.textContent = label;
|
|
72
|
+
colorSwatch.appendChild(spanLabel);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (swatchColor && swatchColor !== '') {
|
|
76
|
+
const colorSwatchPanel = document.createElement('div');
|
|
77
|
+
colorSwatchPanel.className = getGidsColorSwatchPanelClasses({
|
|
78
|
+
swatchShape,
|
|
79
|
+
swatchSize,
|
|
80
|
+
applyPanelClass: true,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
colorSwatchPanel.style.backgroundColor = `${swatchColor}`;
|
|
84
|
+
if (applyBorders) {
|
|
85
|
+
colorSwatchPanel.style.border = `var(--gids-border-width-${borderWidth}) solid var(--gids-color-border-${borderColor})`;
|
|
86
|
+
}
|
|
87
|
+
if (swatchShadow !== 'none') {
|
|
88
|
+
colorSwatchPanel.style.boxShadow = `var(--gids-elevation-${swatchShadow})`;
|
|
89
|
+
}
|
|
90
|
+
if (swatchShape === 'rectangle' || swatchShape === 'square') {
|
|
91
|
+
colorSwatchPanel.style.borderRadius = `var(--gids-border-radius-${borderRadius})`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
colorSwatch.appendChild(colorSwatchPanel);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (
|
|
98
|
+
label &&
|
|
99
|
+
label !== '' &&
|
|
100
|
+
(labelPosition === 'bottom' || labelPosition === 'right')
|
|
101
|
+
) {
|
|
102
|
+
spanLabel.textContent = label;
|
|
103
|
+
colorSwatch.appendChild(spanLabel);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return colorSwatch;
|
|
107
|
+
};
|