@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.
Files changed (132) hide show
  1. package/CHANGELOG.md +84 -2
  2. package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.d.ts +8 -0
  3. package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.d.ts.map +1 -0
  4. package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.js +14 -0
  5. package/dist/components/GidsAdvancedTooltip/GidsAdvancedTooltip.js.map +1 -0
  6. package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts +26 -3
  7. package/dist/components/GidsBasicTableBody/GidsBasicTableBody.d.ts.map +1 -1
  8. package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js +22 -3
  9. package/dist/components/GidsBasicTableBody/GidsBasicTableBody.js.map +1 -1
  10. package/dist/components/GidsBasicTableHead/GidsBasicTableHead.d.ts +15 -0
  11. package/dist/components/GidsBasicTableHead/GidsBasicTableHead.d.ts.map +1 -1
  12. package/dist/components/GidsBasicTableHead/GidsBasicTableHead.js +5 -0
  13. package/dist/components/GidsBasicTableHead/GidsBasicTableHead.js.map +1 -1
  14. package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.d.ts +26 -3
  15. package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.d.ts.map +1 -1
  16. package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js +9 -1
  17. package/dist/components/GidsBasicTableHeader/GidsBasicTableHeader.js.map +1 -1
  18. package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts +22 -3
  19. package/dist/components/GidsBasicTableRow/GidsBasicTableRow.d.ts.map +1 -1
  20. package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js +27 -6
  21. package/dist/components/GidsBasicTableRow/GidsBasicTableRow.js.map +1 -1
  22. package/dist/components/GidsBsTable/GidsBsTable.d.ts +26 -3
  23. package/dist/components/GidsBsTable/GidsBsTable.d.ts.map +1 -1
  24. package/dist/components/GidsBsTable/GidsBsTable.js +36 -14
  25. package/dist/components/GidsBsTable/GidsBsTable.js.map +1 -1
  26. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts +1 -1
  27. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts.map +1 -1
  28. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js +2 -1
  29. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js.map +1 -1
  30. package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts +8 -0
  31. package/dist/components/GidsColorSwatch/GidsColorSwatch.d.ts.map +1 -0
  32. package/dist/components/GidsColorSwatch/GidsColorSwatch.js +62 -0
  33. package/dist/components/GidsColorSwatch/GidsColorSwatch.js.map +1 -0
  34. package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts +12 -0
  35. package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -0
  36. package/dist/components/GidsMatrixTable/GidsMatrixTable.js +70 -0
  37. package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -0
  38. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +12 -0
  39. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -0
  40. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +70 -0
  41. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js.map +1 -0
  42. package/dist/components/GidsMdTable/GidsMdTable.d.ts +11 -2
  43. package/dist/components/GidsMdTable/GidsMdTable.d.ts.map +1 -1
  44. package/dist/components/GidsMdTable/GidsMdTable.js +3 -0
  45. package/dist/components/GidsMdTable/GidsMdTable.js.map +1 -1
  46. package/dist/components/GidsPagination/GidsPagination.d.ts +10 -0
  47. package/dist/components/GidsPagination/GidsPagination.d.ts.map +1 -1
  48. package/dist/components/GidsPagination/GidsPagination.js +5 -0
  49. package/dist/components/GidsPagination/GidsPagination.js.map +1 -1
  50. package/dist/components/GidsPaginator/GidsPaginator.d.ts +8 -0
  51. package/dist/components/GidsPaginator/GidsPaginator.d.ts.map +1 -0
  52. package/dist/components/GidsPaginator/GidsPaginator.js +154 -0
  53. package/dist/components/GidsPaginator/GidsPaginator.js.map +1 -0
  54. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts +9 -0
  55. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts.map +1 -0
  56. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js +33 -0
  57. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js.map +1 -0
  58. package/dist/components/GidsTable/GidsTable.d.ts +18 -0
  59. package/dist/components/GidsTable/GidsTable.d.ts.map +1 -0
  60. package/dist/components/GidsTable/GidsTable.js +96 -0
  61. package/dist/components/GidsTable/GidsTable.js.map +1 -0
  62. package/dist/components/GidsTableBody/GidsTableBody.d.ts +13 -0
  63. package/dist/components/GidsTableBody/GidsTableBody.d.ts.map +1 -0
  64. package/dist/components/GidsTableBody/GidsTableBody.js +61 -0
  65. package/dist/components/GidsTableBody/GidsTableBody.js.map +1 -0
  66. package/dist/components/GidsTableCell/GidsTableCell.d.ts +28 -0
  67. package/dist/components/GidsTableCell/GidsTableCell.d.ts.map +1 -0
  68. package/dist/components/GidsTableCell/GidsTableCell.js +146 -0
  69. package/dist/components/GidsTableCell/GidsTableCell.js.map +1 -0
  70. package/dist/components/GidsTableEntry/GidsTableEntry.d.ts +13 -0
  71. package/dist/components/GidsTableEntry/GidsTableEntry.d.ts.map +1 -0
  72. package/dist/components/GidsTableEntry/GidsTableEntry.js +305 -0
  73. package/dist/components/GidsTableEntry/GidsTableEntry.js.map +1 -0
  74. package/dist/components/GidsTableFooter/GidsTableFooter.d.ts +13 -0
  75. package/dist/components/GidsTableFooter/GidsTableFooter.d.ts.map +1 -0
  76. package/dist/components/GidsTableFooter/GidsTableFooter.js +75 -0
  77. package/dist/components/GidsTableFooter/GidsTableFooter.js.map +1 -0
  78. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts +11 -0
  79. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts.map +1 -0
  80. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js +97 -0
  81. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js.map +1 -0
  82. package/dist/components/GidsTableHeader/GidsTableHeader.d.ts +13 -0
  83. package/dist/components/GidsTableHeader/GidsTableHeader.d.ts.map +1 -0
  84. package/dist/components/GidsTableHeader/GidsTableHeader.js +51 -0
  85. package/dist/components/GidsTableHeader/GidsTableHeader.js.map +1 -0
  86. package/dist/components/GidsTableRow/GidsTableRow.d.ts +13 -0
  87. package/dist/components/GidsTableRow/GidsTableRow.d.ts.map +1 -0
  88. package/dist/components/GidsTableRow/GidsTableRow.js +71 -0
  89. package/dist/components/GidsTableRow/GidsTableRow.js.map +1 -0
  90. package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts +11 -0
  91. package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts.map +1 -0
  92. package/dist/components/GidsTableToolbar/GidsTableToolbar.js +92 -0
  93. package/dist/components/GidsTableToolbar/GidsTableToolbar.js.map +1 -0
  94. package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts +10 -0
  95. package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts.map +1 -1
  96. package/dist/components/_GidsPaginationItem/GidsPaginationItem.js +5 -0
  97. package/dist/components/_GidsPaginationItem/GidsPaginationItem.js.map +1 -1
  98. package/dist/index.d.ts +15 -1
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +15 -1
  101. package/dist/index.js.map +1 -1
  102. package/package.json +4 -4
  103. package/src/components/GidsAdvancedTooltip/GidsAdvancedTooltip.ts +42 -0
  104. package/src/components/GidsBasicTableBody/GidsBasicTableBody.ts +66 -5
  105. package/src/components/GidsBasicTableHead/GidsBasicTableHead.ts +15 -0
  106. package/src/components/GidsBasicTableHeader/GidsBasicTableHeader.ts +45 -5
  107. package/src/components/GidsBasicTableRow/GidsBasicTableRow.ts +65 -7
  108. package/src/components/GidsBsTable/GidsBsTable.ts +81 -19
  109. package/src/components/GidsChartLegendItem/GidsChartLegendItem.ts +2 -0
  110. package/src/components/GidsColorSwatch/GidsColorSwatch.ts +107 -0
  111. package/src/components/GidsMatrixTable/GidsMatrixTable.ts +167 -0
  112. package/src/components/GidsMatrixTableBody/GidsMatrixTableBody.ts +164 -0
  113. package/src/components/GidsMdTable/GidsMdTable.ts +14 -2
  114. package/src/components/GidsPagination/GidsPagination.ts +14 -2
  115. package/src/components/GidsPaginator/GidsPaginator.ts +241 -0
  116. package/src/components/GidsPaginatorItem/GidsPaginatorItem.ts +72 -0
  117. package/src/components/GidsTable/GidsTable.ts +203 -0
  118. package/src/components/GidsTableBody/GidsTableBody.ts +137 -0
  119. package/src/components/GidsTableCell/GidsTableCell.ts +276 -0
  120. package/src/components/GidsTableEntry/GidsTableEntry.ts +515 -0
  121. package/src/components/GidsTableFooter/GidsTableFooter.ts +157 -0
  122. package/src/components/GidsTableFooterControl/GidsTableFooterControl.ts +159 -0
  123. package/src/components/GidsTableHeader/GidsTableHeader.ts +116 -0
  124. package/src/components/GidsTableRow/GidsTableRow.ts +154 -0
  125. package/src/components/GidsTableToolbar/GidsTableToolbar.ts +180 -0
  126. package/src/components/_GidsPaginationItem/GidsPaginationItem.ts +14 -2
  127. package/src/index.ts +15 -1
  128. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts +0 -9
  129. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts.map +0 -1
  130. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js +0 -48
  131. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js.map +0 -1
  132. package/src/components/GidsBasicTableCell/GidsBasicTableCell.ts +0 -99
@@ -0,0 +1,159 @@
1
+ import {
2
+ type GidsTableFooterControlWebProps,
3
+ GidsTableFooterControlWebUtils,
4
+ isValidChildren,
5
+ } from '@ganpatiinfo/gids-web-shared';
6
+ import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
7
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils';
8
+ import { GidsPaginatorDom } from '../GidsPaginator/GidsPaginator';
9
+ import { GidsDropdownFieldDom } from '../GidsDropdownField/GidsDropdownField';
10
+ import { GidsDropdownMenuGroupDom } from '../GidsDropdownMenuGroup/GidsDropdownMenuGroup';
11
+ import { GidsDropdownMenuDom } from '../GidsDropdownMenu/GidsDropdownMenu';
12
+ import { GidsDropdownItemDom } from '../GidsDropdownItem/GidsDropdownItem';
13
+
14
+ const { getGidsTableFooterControlClassNames } = GidsTableFooterControlWebUtils;
15
+
16
+ type NativeInputForwardedProps = Partial<
17
+ Omit<HTMLInputElement, 'value' | 'readOnly' | 'name' | 'disabled'>
18
+ >;
19
+
20
+ export type GidsTableFooterControlBaseWebProps = GidsTableFooterControlWebProps<
21
+ IconName,
22
+ DomChildren,
23
+ NativeInputForwardedProps,
24
+ DomChildren,
25
+ Event
26
+ >;
27
+
28
+ export interface GidsTableFooterControlDomProps extends GidsTableFooterControlBaseWebProps {
29
+ extraClasses?: string;
30
+ }
31
+
32
+ export const GidsTableFooterControlDom = ({
33
+ children,
34
+ bulkStatus,
35
+ rangeStatus,
36
+ tableViewControllerSettings,
37
+ paginatorSettings,
38
+ tableViewControllerVisible,
39
+ paginatorVisible,
40
+ extraClasses,
41
+ }: GidsTableFooterControlDomProps): HTMLDivElement => {
42
+ const tableFooterControl = document.createElement('div');
43
+ tableFooterControl.className =
44
+ getGidsTableFooterControlClassNames(extraClasses);
45
+
46
+ if (isValidChildren(children)) {
47
+ appendAsChildren(tableFooterControl, children);
48
+ } else {
49
+ const mainContainer = document.createElement('div');
50
+ mainContainer.className = 'gids-table-footer-control__main-container';
51
+
52
+ const informativeContainer = document.createElement('div');
53
+ informativeContainer.className =
54
+ 'gids-table-footer-control__informative-container';
55
+
56
+ // Table View Controller
57
+ if (
58
+ tableViewControllerVisible &&
59
+ tableViewControllerSettings &&
60
+ Object.keys(tableViewControllerSettings).length > 0
61
+ ) {
62
+ const { tableViewControllerOptions, ...restTableViewControllerSettings } =
63
+ tableViewControllerSettings;
64
+
65
+ if (tableViewControllerOptions && tableViewControllerOptions.length) {
66
+ const sectionsCount = tableViewControllerOptions.length;
67
+
68
+ informativeContainer.append(
69
+ GidsDropdownFieldDom({
70
+ ...restTableViewControllerSettings,
71
+ inputProps: {
72
+ ...restTableViewControllerSettings.inputProps,
73
+ placeholder:
74
+ restTableViewControllerSettings?.inputProps?.placeholder ??
75
+ 'Rows per page',
76
+ },
77
+ children: GidsDropdownMenuGroupDom({
78
+ type: 'default',
79
+ children: Array.from(
80
+ { length: sectionsCount },
81
+ (_, sectionIndex) => {
82
+ const section = tableViewControllerOptions[sectionIndex];
83
+ const items = section?.items ?? [];
84
+
85
+ return GidsDropdownMenuDom({
86
+ sectionLabel: section?.label,
87
+ children: Array.from(
88
+ { length: items.length },
89
+ (_, optionIndex) => {
90
+ const item = items[optionIndex];
91
+ return GidsDropdownItemDom({
92
+ ...item,
93
+ id: item?.id ?? `${optionIndex + 1}`,
94
+ });
95
+ },
96
+ ),
97
+ });
98
+ },
99
+ ),
100
+ }),
101
+ }),
102
+ );
103
+ }
104
+ }
105
+
106
+ // Range Status
107
+ if (rangeStatus && rangeStatus !== '') {
108
+ const rangeStatusLabel = document.createElement('span');
109
+ rangeStatusLabel.className =
110
+ 'gids-table-footer-control__range-status-label';
111
+ rangeStatusLabel.textContent = rangeStatus;
112
+
113
+ appendAsChildren(informativeContainer, rangeStatusLabel);
114
+ }
115
+
116
+ // Bulk Status
117
+ if (bulkStatus && bulkStatus !== '') {
118
+ const bulkStatusLabel = document.createElement('span');
119
+ bulkStatusLabel.className =
120
+ 'gids-table-footer-control__bulk-status-label';
121
+ bulkStatusLabel.textContent = bulkStatus;
122
+ informativeContainer.append(bulkStatusLabel);
123
+
124
+ appendAsChildren(informativeContainer, bulkStatusLabel);
125
+ }
126
+
127
+ appendAsChildren(mainContainer, informativeContainer);
128
+
129
+ // Paginator
130
+ if (
131
+ paginatorVisible &&
132
+ paginatorSettings &&
133
+ Object.keys(paginatorSettings).length > 0
134
+ ) {
135
+ const paginatorContainer = document.createElement('div');
136
+ paginatorContainer.className =
137
+ 'gids-table-footer-control__paginator-container';
138
+
139
+ paginatorContainer.append(
140
+ GidsPaginatorDom({
141
+ ...paginatorSettings,
142
+ size: paginatorSettings?.size ?? 'md',
143
+ shape: paginatorSettings?.shape ?? 'rounded',
144
+ variant: paginatorSettings?.variant ?? 'default',
145
+ showFirstPageBtn: paginatorSettings?.showFirstPageBtn ?? true,
146
+ showLastPageBtn: paginatorSettings?.showLastPageBtn ?? true,
147
+ showNextBtn: paginatorSettings?.showNextBtn ?? true,
148
+ showPreviousBtn: paginatorSettings?.showPreviousBtn ?? true,
149
+ }),
150
+ );
151
+
152
+ appendAsChildren(mainContainer, paginatorContainer);
153
+ }
154
+
155
+ appendAsChildren(tableFooterControl, mainContainer);
156
+ }
157
+
158
+ return tableFooterControl;
159
+ };
@@ -0,0 +1,116 @@
1
+ import {
2
+ GidsTableEntryTypographyStyle,
3
+ GidsTableHeaderWebProps,
4
+ GidsTableHeaderWebUtils,
5
+ isValidChildren,
6
+ } from '@ganpatiinfo/gids-web-shared';
7
+ import { GidsTableRowDom } from '../GidsTableRow/GidsTableRow';
8
+ import { GidsTableHeaderActionEvent } from '@ganpatiinfo/gids-core-shared';
9
+ import {
10
+ IconAppearance,
11
+ IconName,
12
+ } from '@ganpatiinfo/gids-web-theme-interface';
13
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils';
14
+
15
+ const { getGidsTableHeaderClassNames } = GidsTableHeaderWebUtils;
16
+
17
+ type GidsTableHeaderBaseWebProps = GidsTableHeaderWebProps<
18
+ GidsTableEntryTypographyStyle,
19
+ IconName,
20
+ IconAppearance,
21
+ DomChildren
22
+ >;
23
+
24
+ export type GidsTableHeaderActionBaseEvent = GidsTableHeaderActionEvent<
25
+ Event,
26
+ GidsTableEntryTypographyStyle,
27
+ IconName,
28
+ IconAppearance
29
+ >;
30
+
31
+ export interface GidsTableHeaderDomProps extends GidsTableHeaderBaseWebProps {
32
+ extraClasses?: string;
33
+ onHeaderAction?: (event: GidsTableHeaderActionBaseEvent) => void;
34
+ }
35
+
36
+ export const GidsTableHeaderDom = ({
37
+ headerItems = [],
38
+ appearance = 'none',
39
+ labelTypography = 'label-medium',
40
+ textAlignment = 'center',
41
+ leadingActions = [],
42
+ trailingActions = [],
43
+ onHeaderAction,
44
+ extraClasses,
45
+ entryAlignment = 'center',
46
+ colorSwatchLabelColor = 'default',
47
+ colorSwatchLabelPosition = 'left',
48
+ colorSwatchLabelTypography = 'label-medium',
49
+ colorSwatchSize = 'sm',
50
+ colorSwatchShape = 'oval',
51
+ colorSwatchShadow = 'shadow-overlay',
52
+ colorSwatchBorderRadius = 'none',
53
+ colorSwatchApplyBorders = true,
54
+ colorSwatchBorderWidth = 'thick',
55
+ progressBarSize = 'sm',
56
+ progressBarEndCap = true,
57
+ avatarSize = 'sm',
58
+ avatarGroupAppearance = 'spread',
59
+ avatarGroupLayout = 'wrap',
60
+ statusTagAppearance = 'subtle',
61
+ statusTagSize = 'sm',
62
+ progressBarContainerMinWidth = 200,
63
+ displayTagsOrientation = 'horizontal',
64
+ statusTagsOrientation = 'horizontal',
65
+ progressBarsOrientation = 'horizontal',
66
+ colorSwatchesOrientation = 'horizontal',
67
+ badgesOrientation = 'horizontal',
68
+ children,
69
+ }: GidsTableHeaderDomProps) => {
70
+ const tableHeader = document.createElement('thead');
71
+ tableHeader.className = getGidsTableHeaderClassNames(extraClasses);
72
+
73
+ if (isValidChildren<DomChildren>(children)) {
74
+ appendAsChildren(tableHeader, children);
75
+ } else {
76
+ if (headerItems && headerItems.length > 0) {
77
+ const rowContent = GidsTableRowDom({
78
+ rows: headerItems,
79
+ rowType: 'header',
80
+ leadingActions,
81
+ trailingActions,
82
+ entryAlignment,
83
+ colorSwatchLabelColor,
84
+ colorSwatchLabelPosition,
85
+ colorSwatchLabelTypography,
86
+ colorSwatchSize,
87
+ colorSwatchShape,
88
+ colorSwatchShadow,
89
+ colorSwatchBorderRadius,
90
+ colorSwatchApplyBorders,
91
+ colorSwatchBorderWidth,
92
+ progressBarSize,
93
+ progressBarEndCap,
94
+ avatarSize,
95
+ avatarGroupAppearance,
96
+ avatarGroupLayout,
97
+ statusTagAppearance,
98
+ statusTagSize,
99
+ progressBarContainerMinWidth,
100
+ displayTagsOrientation,
101
+ statusTagsOrientation,
102
+ progressBarsOrientation,
103
+ colorSwatchesOrientation,
104
+ badgesOrientation,
105
+ textAlignment,
106
+ labelTypography,
107
+ appearance,
108
+ onRowAction: onHeaderAction,
109
+ });
110
+
111
+ tableHeader.append(rowContent);
112
+ }
113
+ }
114
+
115
+ return tableHeader;
116
+ };
@@ -0,0 +1,154 @@
1
+ import {
2
+ GidsTableEntryTypographyStyle,
3
+ type GidsTableRowWebProps,
4
+ GidsTableRowWebUtils,
5
+ isValidChildren,
6
+ } from '@ganpatiinfo/gids-web-shared';
7
+ import {
8
+ GidsTableEntryActionBaseEvent,
9
+ GidsTableEntryDom,
10
+ } from '../GidsTableEntry/GidsTableEntry.js';
11
+ import {
12
+ IconAppearance,
13
+ IconName,
14
+ } from '@ganpatiinfo/gids-web-theme-interface';
15
+ import { GidsTableRowActionEvent } from '@ganpatiinfo/gids-core-shared';
16
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
17
+
18
+ const { getGidsTableRowClassNames } = GidsTableRowWebUtils;
19
+
20
+ type GidsTableRowBaseWebProps = GidsTableRowWebProps<
21
+ GidsTableEntryTypographyStyle,
22
+ IconName,
23
+ IconAppearance,
24
+ DomChildren
25
+ >;
26
+ export type GidsTableRowActionBaseEvent = GidsTableRowActionEvent<
27
+ Event,
28
+ GidsTableEntryTypographyStyle,
29
+ IconName,
30
+ IconAppearance
31
+ >;
32
+
33
+ export interface GidsTableRowDomProps extends GidsTableRowBaseWebProps {
34
+ extraClasses?: string;
35
+ onRowAction?: (event: GidsTableRowActionBaseEvent) => void;
36
+ }
37
+
38
+ export const GidsTableRowDom = ({
39
+ rows,
40
+ rowType = 'body',
41
+ leadingActions,
42
+ trailingActions,
43
+ onRowAction,
44
+ textAlignment = 'center',
45
+ appearance = 'none',
46
+ labelTypography = 'label-medium',
47
+ entryAlignment = 'center',
48
+ colorSwatchLabelColor = 'default',
49
+ colorSwatchLabelPosition = 'left',
50
+ colorSwatchLabelTypography = 'label-medium',
51
+ colorSwatchSize = 'sm',
52
+ colorSwatchShape = 'oval',
53
+ colorSwatchShadow = 'shadow-overlay',
54
+ colorSwatchBorderRadius = 'none',
55
+ colorSwatchApplyBorders = true,
56
+ colorSwatchBorderWidth = 'thick',
57
+ progressBarSize = 'sm',
58
+ progressBarEndCap = true,
59
+ avatarSize = 'sm',
60
+ avatarGroupAppearance,
61
+ avatarGroupLayout,
62
+ statusTagAppearance = 'subtle',
63
+ statusTagSize = 'sm',
64
+ progressBarContainerMinWidth = 200,
65
+ displayTagsOrientation = 'horizontal',
66
+ statusTagsOrientation = 'horizontal',
67
+ progressBarsOrientation = 'horizontal',
68
+ colorSwatchesOrientation = 'horizontal',
69
+ badgesOrientation = 'horizontal',
70
+ actionsBackgroundColor,
71
+ actionsContentColor,
72
+ backgroundColor,
73
+ contentColor,
74
+ children,
75
+ extraClasses,
76
+ }: GidsTableRowDomProps): HTMLElement | DocumentFragment => {
77
+ const rowClassName = getGidsTableRowClassNames(extraClasses);
78
+
79
+ // 3. Handling Horizontal Layout (Standard Single Row)
80
+ const tableRow = document.createElement('tr');
81
+ tableRow.className = rowClassName;
82
+
83
+ if (isValidChildren<DomChildren>(children)) {
84
+ appendAsChildren(tableRow, children);
85
+ } else {
86
+ function onEntryActionBtnClick({
87
+ event,
88
+ entryIndex,
89
+ }: {
90
+ event: GidsTableEntryActionBaseEvent;
91
+ entryIndex: number;
92
+ }) {
93
+ if (onRowAction) {
94
+ onRowAction({
95
+ ...event,
96
+ details: {
97
+ ...event.details,
98
+ entryIndex,
99
+ },
100
+ });
101
+ }
102
+ }
103
+
104
+ if (rows && rows.length > 0) {
105
+ rows.forEach((row, indexJ) => {
106
+ const rowLabel = row?.label;
107
+
108
+ tableRow.append(
109
+ GidsTableEntryDom({
110
+ ...row,
111
+ actionsBackgroundColor,
112
+ actionsContentColor,
113
+ backgroundColor,
114
+ contentColor,
115
+ label: rowLabel,
116
+ entryType: rowType,
117
+ leadingActions,
118
+ trailingActions,
119
+ entryAlignment,
120
+ colorSwatchLabelColor,
121
+ colorSwatchLabelPosition,
122
+ colorSwatchLabelTypography,
123
+ colorSwatchSize,
124
+ colorSwatchShape,
125
+ colorSwatchShadow,
126
+ colorSwatchBorderRadius,
127
+ colorSwatchApplyBorders,
128
+ colorSwatchBorderWidth,
129
+ progressBarSize,
130
+ progressBarEndCap,
131
+ avatarSize,
132
+ avatarGroupAppearance,
133
+ avatarGroupLayout,
134
+ statusTagAppearance,
135
+ statusTagSize,
136
+ progressBarContainerMinWidth,
137
+ displayTagsOrientation,
138
+ statusTagsOrientation,
139
+ progressBarsOrientation,
140
+ colorSwatchesOrientation,
141
+ badgesOrientation,
142
+ textAlignment,
143
+ labelTypography,
144
+ appearance,
145
+ onEntryAction: (event: GidsTableEntryActionBaseEvent) =>
146
+ onEntryActionBtnClick({ event, entryIndex: indexJ }),
147
+ }),
148
+ );
149
+ });
150
+ }
151
+ }
152
+
153
+ return tableRow;
154
+ };
@@ -0,0 +1,180 @@
1
+ import {
2
+ type GidsTableToolbarWebProps,
3
+ GidsTableToolbarWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+ import type { HtmlInputAttributes } from '../GidsInput/GidsInput';
6
+ import {
7
+ GidsSearchBarDom,
8
+ GidsSearchBarDomProps,
9
+ } from '../GidsSearchBar/GidsSearchBar';
10
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils';
11
+ import { GidsActionBarDom } from '../GidsActionBar/GidsActionBar';
12
+ import { GidsTabDom } from '../GidsTab/GidsTab';
13
+ import { GidsTabItemDom } from '../GidsTabItem/GidsTabItem';
14
+
15
+ const { getGidsTableToolbarClassNames } = GidsTableToolbarWebUtils;
16
+
17
+ type GidsTableToolbarBaseWebProps = GidsTableToolbarWebProps<
18
+ DomChildren,
19
+ Event,
20
+ Element,
21
+ HtmlInputAttributes
22
+ > &
23
+ Pick<
24
+ GidsSearchBarDomProps,
25
+ 'onChange' | 'onInput' | 'onFocus' | 'onBlur' | 'onGidsSearchBarClear'
26
+ >;
27
+
28
+ export interface GidsTableToolbarDomProps extends GidsTableToolbarBaseWebProps {
29
+ extraClasses?: string;
30
+ }
31
+
32
+ export const GidsTableToolbarDom = ({
33
+ actionGroup = false,
34
+ allFiltersTabVisible = false,
35
+ moreFiltersTabVisible = false,
36
+ clearAllFiltersVisible = true,
37
+ clearAllFiltersButtonAppearance = 'primary',
38
+ primaryFilters = [],
39
+ secondaryFilters = [],
40
+ filterSize = 'xs',
41
+ filterAllIsDefaultSelected = true,
42
+ dropdownDividerVisible,
43
+ onToggleActionBarAllFilter,
44
+ onToggleActionBarDropdownFilter,
45
+ onToggleActionBarMoreFilter,
46
+ onToggleActionBarNoneFilter,
47
+ onDropdownSelectionActionBarFilterChange,
48
+ onMoreSelectionActionBarFilterChange,
49
+ onClearAllFiltersButton,
50
+ actionBarDisabled = false,
51
+ searchDisabled = false,
52
+ allFiltersData,
53
+ moreFiltersData,
54
+ children,
55
+ searchVisible = true,
56
+ filtersVisible = true,
57
+ childrenPosition = 'top-most',
58
+ tabVisible = false,
59
+ tabProps,
60
+ borderSides = [],
61
+ borderRadiusSides = [],
62
+ leadingIcon,
63
+ leadingLabel,
64
+ trailingLabel,
65
+ loading,
66
+ readOnly,
67
+ onGidsSearchBarClear,
68
+ onChange,
69
+ onInput,
70
+ onFocus,
71
+ onBlur,
72
+ value = '',
73
+ inputProps,
74
+ tableToolbarAppearance = 'surface-default',
75
+ extraClasses,
76
+ ...restProps
77
+ }: GidsTableToolbarDomProps): HTMLElement => {
78
+ const tableToolbar = document.createElement('div');
79
+ tableToolbar.className = getGidsTableToolbarClassNames(
80
+ { borderSides, borderRadiusSides, tableToolbarAppearance },
81
+ extraClasses,
82
+ );
83
+
84
+ tableToolbar.setAttribute('table-toolbar-appearance', tableToolbarAppearance);
85
+
86
+ const tableToolbarContent = document.createElement('div');
87
+ tableToolbarContent.className = 'gids-table-toolbar__content-wrapper';
88
+
89
+ if (tabVisible && tabProps?.tabItems && tabProps.tabItems.length > 0) {
90
+ const tabItemsData = tabProps.tabItems;
91
+ const tabAppearance = tabProps?.appearance ?? 'underlined';
92
+ const tabWidth = tabProps?.width ?? 'full';
93
+ tableToolbarContent.append(
94
+ GidsTabDom({
95
+ appearance: tabAppearance,
96
+ width: tabWidth,
97
+ activeTabId: tabProps?.activeTabId ?? undefined,
98
+ onPressGidsTab: tabProps?.onPressGidsTab,
99
+ children: Array.from({ length: tabItemsData.length }, (_, index) => {
100
+ const tabItem = tabItemsData[index];
101
+ return GidsTabItemDom({
102
+ ...tabItem,
103
+ itemId: tabItem?.itemId ?? `${index + 1}`,
104
+ });
105
+ }),
106
+ }),
107
+ );
108
+ }
109
+
110
+ if (children && childrenPosition === 'top-most') {
111
+ const childrenContainer = document.createElement('div');
112
+ childrenContainer.className = 'gids-table-toolbar__children-container';
113
+
114
+ appendAsChildren(childrenContainer, children);
115
+ appendAsChildren(tableToolbarContent, childrenContainer);
116
+ }
117
+
118
+ if (searchVisible) {
119
+ tableToolbarContent.append(
120
+ GidsSearchBarDom({
121
+ ...restProps,
122
+ type: 'default',
123
+ appearance: 'default',
124
+ status: 'default',
125
+ leadingIcon,
126
+ leadingLabel,
127
+ trailingLabel,
128
+ loading,
129
+ readOnly,
130
+ onGidsSearchBarClear,
131
+ onChange,
132
+ onInput,
133
+ onFocus,
134
+ onBlur,
135
+ value,
136
+ disabled: searchDisabled,
137
+ inputProps,
138
+ }),
139
+ );
140
+ }
141
+
142
+ if (filtersVisible) {
143
+ tableToolbarContent.append(
144
+ GidsActionBarDom({
145
+ actionGroup,
146
+ allFiltersTabVisible,
147
+ moreFiltersTabVisible,
148
+ clearAllFiltersVisible,
149
+ clearAllFiltersButtonAppearance,
150
+ primaryFilters,
151
+ secondaryFilters,
152
+ filterSize,
153
+ filterAllIsDefaultSelected,
154
+ dropdownDividerVisible,
155
+ onToggleActionBarAllFilter,
156
+ onToggleActionBarDropdownFilter,
157
+ onToggleActionBarMoreFilter,
158
+ onToggleActionBarNoneFilter,
159
+ onDropdownSelectionActionBarFilterChange,
160
+ onMoreSelectionActionBarFilterChange,
161
+ onClearAllFiltersButton,
162
+ disabled: actionBarDisabled,
163
+ allFiltersData,
164
+ moreFiltersData,
165
+ }),
166
+ );
167
+ }
168
+
169
+ if (children && childrenPosition === 'bottom-most') {
170
+ const childrenContainer = document.createElement('div');
171
+ childrenContainer.className = 'gids-table-toolbar__children-container';
172
+
173
+ appendAsChildren(childrenContainer, children);
174
+ appendAsChildren(tableToolbarContent, childrenContainer);
175
+ }
176
+
177
+ appendAsChildren(tableToolbar, tableToolbarContent);
178
+
179
+ return tableToolbar;
180
+ };
@@ -17,12 +17,24 @@ import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
17
17
  const { getGidsPaginationItemClassNames } = GidsPaginationItemWebUtils;
18
18
  const { getPaginationItemIconSize } = GidsPaginationItemCommonUtils;
19
19
 
20
- export interface GidsPaginationItemDomProps
21
- extends GidsPaginationItemCommonProps<DomChildren, DomNodeOrString> {
20
+ /**
21
+ * @deprecated
22
+ *
23
+ * Use `GidsPaginator` and its props and functions instead.
24
+ */
25
+ export interface GidsPaginationItemDomProps extends GidsPaginationItemCommonProps<
26
+ DomChildren,
27
+ DomNodeOrString
28
+ > {
22
29
  extraClasses?: ClassValue;
23
30
  onClickItem?: (event: MouseEvent) => void;
24
31
  }
25
32
 
33
+ /**
34
+ * @deprecated
35
+ *
36
+ * Use `GidsPaginator` and its props and functions instead.
37
+ */
26
38
  export const GidsPaginationItemDom = ({
27
39
  selectColor = 'default',
28
40
  variant = 'default',
package/src/index.ts CHANGED
@@ -110,12 +110,26 @@ export * from './components/GidsExpansionBodyListItem/GidsExpansionBodyListItem.
110
110
  export * from './components/GidsExpansionBodyList/GidsExpansionBodyList.js';
111
111
  export * from './components/GidsExpansionGroup/GidsExpansionGroup.js';
112
112
  export * from './components/GidsBasicTableHead/GidsBasicTableHead.js';
113
- export * from './components/GidsBasicTableCell/GidsBasicTableCell.js';
113
+ export * from './components/GidsTableCell/GidsTableCell.js';
114
114
  export * from './components/GidsBasicTableRow/GidsBasicTableRow.js';
115
115
  export * from './components/GidsBasicTableHeader/GidsBasicTableHeader.js';
116
116
  export * from './components/GidsMdTable/GidsMdTable.js';
117
117
  export * from './components/GidsBsTable/GidsBsTable.js';
118
118
  export * from './components/GidsBasicTableBody/GidsBasicTableBody.js';
119
+ export * from './components/GidsAdvancedTooltip/GidsAdvancedTooltip.js';
120
+ export * from './components/GidsMatrixTableBody/GidsMatrixTableBody.js';
121
+ export * from './components/GidsMatrixTable/GidsMatrixTable.js';
122
+ export * from './components/GidsColorSwatch/GidsColorSwatch.js';
123
+ export * from './components/GidsTableToolbar/GidsTableToolbar.js';
124
+ export * from './components/GidsTableEntry/GidsTableEntry.js';
125
+ export * from './components/GidsTableRow/GidsTableRow.js';
126
+ export * from './components/GidsTableHeader/GidsTableHeader.js';
127
+ export * from './components/GidsTableBody/GidsTableBody.js';
128
+ export * from './components/GidsTable/GidsTable.js';
129
+ export * from './components/GidsTableFooterControl/GidsTableFooterControl.js';
130
+ export * from './components/GidsPaginatorItem/GidsPaginatorItem.js';
131
+ export * from './components/GidsPaginator/GidsPaginator.js';
132
+ export * from './components/GidsTableFooter/GidsTableFooter.js';
119
133
 
120
134
  /**
121
135
  * Utilities
@@ -1,9 +0,0 @@
1
- import { GidsBasicTableCellTypographyStyle, GidsBasicTableCellWebProps } from '@ganpatiinfo/gids-web-shared';
2
- import { IconAppearance, IconName } from '@ganpatiinfo/gids-web-theme-interface';
3
- type GidsBasicTableCellBaseWebProps = GidsBasicTableCellWebProps<GidsBasicTableCellTypographyStyle, IconName, IconAppearance>;
4
- export interface GidsBasicTableCellDomProps extends GidsBasicTableCellBaseWebProps {
5
- extraClasses?: string;
6
- }
7
- export declare const GidsBasicTableCellDom: ({ id, uniqueKey, extraData, label, cellDataType, displayTags, width, borderSides, borderRadiusSides, appearance, textAlignment, labelTypography, isHeaderCell, extraClasses, }: GidsBasicTableCellDomProps) => HTMLElement;
8
- export {};
9
- //# sourceMappingURL=GidsBasicTableCell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GidsBasicTableCell.d.ts","sourceRoot":"","sources":["../../../src/components/GidsBasicTableCell/GidsBasicTableCell.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iCAAiC,EACjC,0BAA0B,EAE1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACN,cAAc,EACd,QAAQ,EACR,MAAM,uCAAuC,CAAC;AAS/C,KAAK,8BAA8B,GAAG,0BAA0B,CAC/D,iCAAiC,EACjC,QAAQ,EACR,cAAc,CACd,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,8BAA8B;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,GAAI,gLAenC,0BAA0B,KAAG,WAuD/B,CAAC"}