@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.
Files changed (172) hide show
  1. package/CHANGELOG.md +131 -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/GidsCrossTable/GidsCrossTable.d.ts +18 -0
  35. package/dist/components/GidsCrossTable/GidsCrossTable.d.ts.map +1 -0
  36. package/dist/components/GidsCrossTable/GidsCrossTable.js +141 -0
  37. package/dist/components/GidsCrossTable/GidsCrossTable.js.map +1 -0
  38. package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts +13 -0
  39. package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts.map +1 -0
  40. package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js +79 -0
  41. package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js.map +1 -0
  42. package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts +13 -0
  43. package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts.map +1 -0
  44. package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js +128 -0
  45. package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js.map +1 -0
  46. package/dist/components/GidsDialog/GidsDialog.d.ts +13 -0
  47. package/dist/components/GidsDialog/GidsDialog.d.ts.map +1 -0
  48. package/dist/components/GidsDialog/GidsDialog.js +102 -0
  49. package/dist/components/GidsDialog/GidsDialog.js.map +1 -0
  50. package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts +32 -0
  51. package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -0
  52. package/dist/components/GidsMatrixTable/GidsMatrixTable.js +75 -0
  53. package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -0
  54. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +32 -0
  55. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -0
  56. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +75 -0
  57. package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js.map +1 -0
  58. package/dist/components/GidsMdTable/GidsMdTable.d.ts +11 -2
  59. package/dist/components/GidsMdTable/GidsMdTable.d.ts.map +1 -1
  60. package/dist/components/GidsMdTable/GidsMdTable.js +3 -0
  61. package/dist/components/GidsMdTable/GidsMdTable.js.map +1 -1
  62. package/dist/components/GidsMenu/GidsMenu.d.ts +1 -1
  63. package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -1
  64. package/dist/components/GidsMenu/GidsMenu.js +10 -1
  65. package/dist/components/GidsMenu/GidsMenu.js.map +1 -1
  66. package/dist/components/GidsPagination/GidsPagination.d.ts +10 -0
  67. package/dist/components/GidsPagination/GidsPagination.d.ts.map +1 -1
  68. package/dist/components/GidsPagination/GidsPagination.js +5 -0
  69. package/dist/components/GidsPagination/GidsPagination.js.map +1 -1
  70. package/dist/components/GidsPaginator/GidsPaginator.d.ts +8 -0
  71. package/dist/components/GidsPaginator/GidsPaginator.d.ts.map +1 -0
  72. package/dist/components/GidsPaginator/GidsPaginator.js +154 -0
  73. package/dist/components/GidsPaginator/GidsPaginator.js.map +1 -0
  74. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts +9 -0
  75. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.d.ts.map +1 -0
  76. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js +33 -0
  77. package/dist/components/GidsPaginatorItem/GidsPaginatorItem.js.map +1 -0
  78. package/dist/components/GidsSkeleton/GidsSkeleton.d.ts +8 -0
  79. package/dist/components/GidsSkeleton/GidsSkeleton.d.ts.map +1 -0
  80. package/dist/components/GidsSkeleton/GidsSkeleton.js +16 -0
  81. package/dist/components/GidsSkeleton/GidsSkeleton.js.map +1 -0
  82. package/dist/components/GidsTable/GidsTable.d.ts +18 -0
  83. package/dist/components/GidsTable/GidsTable.d.ts.map +1 -0
  84. package/dist/components/GidsTable/GidsTable.js +121 -0
  85. package/dist/components/GidsTable/GidsTable.js.map +1 -0
  86. package/dist/components/GidsTableBody/GidsTableBody.d.ts +13 -0
  87. package/dist/components/GidsTableBody/GidsTableBody.d.ts.map +1 -0
  88. package/dist/components/GidsTableBody/GidsTableBody.js +61 -0
  89. package/dist/components/GidsTableBody/GidsTableBody.js.map +1 -0
  90. package/dist/components/GidsTableCell/GidsTableCell.d.ts +28 -0
  91. package/dist/components/GidsTableCell/GidsTableCell.d.ts.map +1 -0
  92. package/dist/components/GidsTableCell/GidsTableCell.js +146 -0
  93. package/dist/components/GidsTableCell/GidsTableCell.js.map +1 -0
  94. package/dist/components/GidsTableEntry/GidsTableEntry.d.ts +13 -0
  95. package/dist/components/GidsTableEntry/GidsTableEntry.d.ts.map +1 -0
  96. package/dist/components/GidsTableEntry/GidsTableEntry.js +305 -0
  97. package/dist/components/GidsTableEntry/GidsTableEntry.js.map +1 -0
  98. package/dist/components/GidsTableFooter/GidsTableFooter.d.ts +13 -0
  99. package/dist/components/GidsTableFooter/GidsTableFooter.d.ts.map +1 -0
  100. package/dist/components/GidsTableFooter/GidsTableFooter.js +53 -0
  101. package/dist/components/GidsTableFooter/GidsTableFooter.js.map +1 -0
  102. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts +11 -0
  103. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts.map +1 -0
  104. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js +99 -0
  105. package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js.map +1 -0
  106. package/dist/components/GidsTableHeader/GidsTableHeader.d.ts +13 -0
  107. package/dist/components/GidsTableHeader/GidsTableHeader.d.ts.map +1 -0
  108. package/dist/components/GidsTableHeader/GidsTableHeader.js +49 -0
  109. package/dist/components/GidsTableHeader/GidsTableHeader.js.map +1 -0
  110. package/dist/components/GidsTableRow/GidsTableRow.d.ts +13 -0
  111. package/dist/components/GidsTableRow/GidsTableRow.d.ts.map +1 -0
  112. package/dist/components/GidsTableRow/GidsTableRow.js +71 -0
  113. package/dist/components/GidsTableRow/GidsTableRow.js.map +1 -0
  114. package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts +11 -0
  115. package/dist/components/GidsTableToolbar/GidsTableToolbar.d.ts.map +1 -0
  116. package/dist/components/GidsTableToolbar/GidsTableToolbar.js +92 -0
  117. package/dist/components/GidsTableToolbar/GidsTableToolbar.js.map +1 -0
  118. package/dist/components/GidsTransferList/GidsTransferList.d.ts +8 -0
  119. package/dist/components/GidsTransferList/GidsTransferList.d.ts.map +1 -0
  120. package/dist/components/GidsTransferList/GidsTransferList.js +25 -0
  121. package/dist/components/GidsTransferList/GidsTransferList.js.map +1 -0
  122. package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts +10 -0
  123. package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts.map +1 -0
  124. package/dist/components/_GidsDialogControl/GidsDialogControl.js +133 -0
  125. package/dist/components/_GidsDialogControl/GidsDialogControl.js.map +1 -0
  126. package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts +10 -0
  127. package/dist/components/_GidsPaginationItem/GidsPaginationItem.d.ts.map +1 -1
  128. package/dist/components/_GidsPaginationItem/GidsPaginationItem.js +5 -0
  129. package/dist/components/_GidsPaginationItem/GidsPaginationItem.js.map +1 -1
  130. package/dist/index.d.ts +118 -97
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +118 -97
  133. package/dist/index.js.map +1 -1
  134. package/package.json +4 -4
  135. package/src/components/GidsAdvancedTooltip/GidsAdvancedTooltip.ts +42 -0
  136. package/src/components/GidsBasicTableBody/GidsBasicTableBody.ts +66 -5
  137. package/src/components/GidsBasicTableHead/GidsBasicTableHead.ts +15 -0
  138. package/src/components/GidsBasicTableHeader/GidsBasicTableHeader.ts +45 -5
  139. package/src/components/GidsBasicTableRow/GidsBasicTableRow.ts +65 -7
  140. package/src/components/GidsBsTable/GidsBsTable.ts +81 -19
  141. package/src/components/GidsChartLegendItem/GidsChartLegendItem.ts +2 -0
  142. package/src/components/GidsColorSwatch/GidsColorSwatch.ts +107 -0
  143. package/src/components/GidsCrossTable/GidsCrossTable.ts +259 -0
  144. package/src/components/GidsCrossTableBody/GidsCrossTableBody.ts +171 -0
  145. package/src/components/GidsCrossTableRow/GidsCrossTableRow.ts +230 -0
  146. package/src/components/GidsDialog/GidsDialog.ts +161 -0
  147. package/src/components/GidsMatrixTable/GidsMatrixTable.ts +187 -0
  148. package/src/components/GidsMatrixTableBody/GidsMatrixTableBody.ts +185 -0
  149. package/src/components/GidsMdTable/GidsMdTable.ts +14 -2
  150. package/src/components/GidsMenu/GidsMenu.ts +15 -0
  151. package/src/components/GidsPagination/GidsPagination.ts +14 -2
  152. package/src/components/GidsPaginator/GidsPaginator.ts +241 -0
  153. package/src/components/GidsPaginatorItem/GidsPaginatorItem.ts +72 -0
  154. package/src/components/GidsSkeleton/GidsSkeleton.ts +40 -0
  155. package/src/components/GidsTable/GidsTable.ts +240 -0
  156. package/src/components/GidsTableBody/GidsTableBody.ts +137 -0
  157. package/src/components/GidsTableCell/GidsTableCell.ts +276 -0
  158. package/src/components/GidsTableEntry/GidsTableEntry.ts +515 -0
  159. package/src/components/GidsTableFooter/GidsTableFooter.ts +119 -0
  160. package/src/components/GidsTableFooterControl/GidsTableFooterControl.ts +166 -0
  161. package/src/components/GidsTableHeader/GidsTableHeader.ts +112 -0
  162. package/src/components/GidsTableRow/GidsTableRow.ts +152 -0
  163. package/src/components/GidsTableToolbar/GidsTableToolbar.ts +180 -0
  164. package/src/components/GidsTransferList/GidsTransferList.ts +58 -0
  165. package/src/components/_GidsDialogControl/GidsDialogControl.ts +198 -0
  166. package/src/components/_GidsPaginationItem/GidsPaginationItem.ts +14 -2
  167. package/src/index.ts +118 -97
  168. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts +0 -9
  169. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.d.ts.map +0 -1
  170. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js +0 -48
  171. package/dist/components/GidsBasicTableCell/GidsBasicTableCell.js.map +0 -1
  172. package/src/components/GidsBasicTableCell/GidsBasicTableCell.ts +0 -99
@@ -0,0 +1,166 @@
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
+ appearance = 'surface-default',
34
+ children,
35
+ bulkStatus,
36
+ rangeStatus,
37
+ tableViewControllerSettings,
38
+ paginatorSettings,
39
+ tableViewControllerVisible,
40
+ paginatorVisible,
41
+ extraClasses,
42
+ }: GidsTableFooterControlDomProps): HTMLDivElement => {
43
+ const tableFooterControl = document.createElement('div');
44
+ tableFooterControl.className = getGidsTableFooterControlClassNames(
45
+ { appearance },
46
+ extraClasses,
47
+ );
48
+
49
+ if (appearance) {
50
+ tableFooterControl.setAttribute('control-appearance', appearance);
51
+ }
52
+
53
+ if (isValidChildren(children)) {
54
+ appendAsChildren(tableFooterControl, children);
55
+ } else {
56
+ const mainContainer = document.createElement('div');
57
+ mainContainer.className = 'gids-table-footer-control__main-container';
58
+
59
+ const informativeContainer = document.createElement('div');
60
+ informativeContainer.className =
61
+ 'gids-table-footer-control__informative-container';
62
+
63
+ // Table View Controller
64
+ if (
65
+ tableViewControllerVisible &&
66
+ tableViewControllerSettings &&
67
+ Object.keys(tableViewControllerSettings).length > 0
68
+ ) {
69
+ const { tableViewControllerOptions, ...restTableViewControllerSettings } =
70
+ tableViewControllerSettings;
71
+
72
+ if (tableViewControllerOptions && tableViewControllerOptions.length) {
73
+ const sectionsCount = tableViewControllerOptions.length;
74
+
75
+ informativeContainer.append(
76
+ GidsDropdownFieldDom({
77
+ ...restTableViewControllerSettings,
78
+ inputProps: {
79
+ ...restTableViewControllerSettings.inputProps,
80
+ placeholder:
81
+ restTableViewControllerSettings?.inputProps?.placeholder ??
82
+ 'Rows per page',
83
+ },
84
+ children: GidsDropdownMenuGroupDom({
85
+ type: 'default',
86
+ children: Array.from(
87
+ { length: sectionsCount },
88
+ (_, sectionIndex) => {
89
+ const section = tableViewControllerOptions[sectionIndex];
90
+ const items = section?.items ?? [];
91
+
92
+ return GidsDropdownMenuDom({
93
+ sectionLabel: section?.label,
94
+ children: Array.from(
95
+ { length: items.length },
96
+ (_, optionIndex) => {
97
+ const item = items[optionIndex];
98
+ return GidsDropdownItemDom({
99
+ ...item,
100
+ id: item?.id ?? `${optionIndex + 1}`,
101
+ });
102
+ },
103
+ ),
104
+ });
105
+ },
106
+ ),
107
+ }),
108
+ }),
109
+ );
110
+ }
111
+ }
112
+
113
+ // Range Status
114
+ if (rangeStatus && rangeStatus !== '') {
115
+ const rangeStatusLabel = document.createElement('span');
116
+ rangeStatusLabel.className =
117
+ 'gids-table-footer-control__range-status-label';
118
+ rangeStatusLabel.textContent = rangeStatus;
119
+
120
+ appendAsChildren(informativeContainer, rangeStatusLabel);
121
+ }
122
+
123
+ // Bulk Status
124
+ if (bulkStatus && bulkStatus !== '') {
125
+ const bulkStatusLabel = document.createElement('span');
126
+ bulkStatusLabel.className =
127
+ 'gids-table-footer-control__bulk-status-label';
128
+ bulkStatusLabel.textContent = bulkStatus;
129
+ informativeContainer.append(bulkStatusLabel);
130
+
131
+ appendAsChildren(informativeContainer, bulkStatusLabel);
132
+ }
133
+
134
+ appendAsChildren(mainContainer, informativeContainer);
135
+
136
+ // Paginator
137
+ if (
138
+ paginatorVisible &&
139
+ paginatorSettings &&
140
+ Object.keys(paginatorSettings).length > 0
141
+ ) {
142
+ const paginatorContainer = document.createElement('div');
143
+ paginatorContainer.className =
144
+ 'gids-table-footer-control__paginator-container';
145
+
146
+ paginatorContainer.append(
147
+ GidsPaginatorDom({
148
+ ...paginatorSettings,
149
+ size: paginatorSettings?.size ?? 'md',
150
+ shape: paginatorSettings?.shape ?? 'rounded',
151
+ variant: paginatorSettings?.variant ?? 'default',
152
+ showFirstPageBtn: paginatorSettings?.showFirstPageBtn ?? true,
153
+ showLastPageBtn: paginatorSettings?.showLastPageBtn ?? true,
154
+ showNextBtn: paginatorSettings?.showNextBtn ?? true,
155
+ showPreviousBtn: paginatorSettings?.showPreviousBtn ?? true,
156
+ }),
157
+ );
158
+
159
+ appendAsChildren(mainContainer, paginatorContainer);
160
+ }
161
+
162
+ appendAsChildren(tableFooterControl, mainContainer);
163
+ }
164
+
165
+ return tableFooterControl;
166
+ };
@@ -0,0 +1,112 @@
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
+ onHeaderAction,
42
+ extraClasses,
43
+ entryAlignment = 'center',
44
+ colorSwatchLabelColor = 'default',
45
+ colorSwatchLabelPosition = 'left',
46
+ colorSwatchLabelTypography = 'label-medium',
47
+ colorSwatchSize = 'sm',
48
+ colorSwatchShape = 'oval',
49
+ colorSwatchShadow = 'shadow-overlay',
50
+ colorSwatchBorderRadius = 'none',
51
+ colorSwatchApplyBorders = true,
52
+ colorSwatchBorderWidth = 'thick',
53
+ progressBarSize = 'sm',
54
+ progressBarEndCap = true,
55
+ avatarSize = 'sm',
56
+ avatarGroupAppearance = 'spread',
57
+ avatarGroupLayout = 'wrap',
58
+ statusTagAppearance = 'subtle',
59
+ statusTagSize = 'sm',
60
+ progressBarContainerMinWidth = 200,
61
+ displayTagsOrientation = 'horizontal',
62
+ statusTagsOrientation = 'horizontal',
63
+ progressBarsOrientation = 'horizontal',
64
+ colorSwatchesOrientation = 'horizontal',
65
+ badgesOrientation = 'horizontal',
66
+ children,
67
+ }: GidsTableHeaderDomProps) => {
68
+ const tableHeader = document.createElement('thead');
69
+ tableHeader.className = getGidsTableHeaderClassNames(extraClasses);
70
+
71
+ if (isValidChildren<DomChildren>(children)) {
72
+ appendAsChildren(tableHeader, children);
73
+ } else {
74
+ if (headerItems && headerItems.length > 0) {
75
+ const rowContent = GidsTableRowDom({
76
+ rows: headerItems,
77
+ rowType: 'header',
78
+ entryAlignment,
79
+ colorSwatchLabelColor,
80
+ colorSwatchLabelPosition,
81
+ colorSwatchLabelTypography,
82
+ colorSwatchSize,
83
+ colorSwatchShape,
84
+ colorSwatchShadow,
85
+ colorSwatchBorderRadius,
86
+ colorSwatchApplyBorders,
87
+ colorSwatchBorderWidth,
88
+ progressBarSize,
89
+ progressBarEndCap,
90
+ avatarSize,
91
+ avatarGroupAppearance,
92
+ avatarGroupLayout,
93
+ statusTagAppearance,
94
+ statusTagSize,
95
+ progressBarContainerMinWidth,
96
+ displayTagsOrientation,
97
+ statusTagsOrientation,
98
+ progressBarsOrientation,
99
+ colorSwatchesOrientation,
100
+ badgesOrientation,
101
+ textAlignment,
102
+ labelTypography,
103
+ appearance,
104
+ onRowAction: onHeaderAction,
105
+ });
106
+
107
+ tableHeader.append(rowContent);
108
+ }
109
+ }
110
+
111
+ return tableHeader;
112
+ };
@@ -0,0 +1,152 @@
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
+ onRowAction,
42
+ textAlignment = 'center',
43
+ appearance = 'none',
44
+ labelTypography = 'label-medium',
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,
59
+ avatarGroupLayout,
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
+ actionsBackgroundColor,
69
+ actionsContentColor,
70
+ backgroundColor,
71
+ contentColor,
72
+ children,
73
+ extraClasses,
74
+ }: GidsTableRowDomProps): HTMLElement | DocumentFragment => {
75
+ const rowClassName = getGidsTableRowClassNames(extraClasses);
76
+
77
+ // 3. Handling Horizontal Layout (Standard Single Row)
78
+ const tableRow = document.createElement('tr');
79
+ tableRow.className = rowClassName;
80
+
81
+ if (isValidChildren<DomChildren>(children)) {
82
+ appendAsChildren(tableRow, children);
83
+ } else {
84
+ function onEntryActionBtnClick({
85
+ event,
86
+ entryIndex,
87
+ }: {
88
+ event: GidsTableEntryActionBaseEvent;
89
+ entryIndex: number;
90
+ }) {
91
+ if (onRowAction) {
92
+ onRowAction({
93
+ ...event,
94
+ details: {
95
+ ...event.details,
96
+ entryIndex,
97
+ },
98
+ });
99
+ }
100
+ }
101
+
102
+ if (rows && rows.length > 0) {
103
+ rows.forEach((row, indexJ) => {
104
+ const rowLabel = row?.label;
105
+
106
+ tableRow.append(
107
+ GidsTableEntryDom({
108
+ ...row,
109
+ actionsBackgroundColor,
110
+ actionsContentColor,
111
+ backgroundColor,
112
+ contentColor,
113
+ label: rowLabel,
114
+ entryType: rowType,
115
+ leadingActions: row?.leadingActions ?? [],
116
+ trailingActions: row?.trailingActions ?? [],
117
+ entryAlignment,
118
+ colorSwatchLabelColor,
119
+ colorSwatchLabelPosition,
120
+ colorSwatchLabelTypography,
121
+ colorSwatchSize,
122
+ colorSwatchShape,
123
+ colorSwatchShadow,
124
+ colorSwatchBorderRadius,
125
+ colorSwatchApplyBorders,
126
+ colorSwatchBorderWidth,
127
+ progressBarSize,
128
+ progressBarEndCap,
129
+ avatarSize,
130
+ avatarGroupAppearance,
131
+ avatarGroupLayout,
132
+ statusTagAppearance,
133
+ statusTagSize,
134
+ progressBarContainerMinWidth,
135
+ displayTagsOrientation,
136
+ statusTagsOrientation,
137
+ progressBarsOrientation,
138
+ colorSwatchesOrientation,
139
+ badgesOrientation,
140
+ textAlignment,
141
+ labelTypography,
142
+ appearance,
143
+ onEntryAction: (event: GidsTableEntryActionBaseEvent) =>
144
+ onEntryActionBtnClick({ event, entryIndex: indexJ }),
145
+ }),
146
+ );
147
+ });
148
+ }
149
+ }
150
+
151
+ return tableRow;
152
+ };
@@ -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
+ };
@@ -0,0 +1,58 @@
1
+ import {
2
+ type GidsTransferListWebProps,
3
+ GidsTransferListWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+
6
+ const { getGidsTransferListClassNames } = GidsTransferListWebUtils;
7
+
8
+ type GidsTransferListBaseWebProps = GidsTransferListWebProps<Event>;
9
+
10
+ type GidsTransferListElement = HTMLElement & GidsTransferListBaseWebProps;
11
+
12
+ export interface GidsTransferListDomProps extends GidsTransferListBaseWebProps {
13
+ extraClasses?: string;
14
+ }
15
+
16
+ export const GidsTransferListDom = ({
17
+ leftListHeading = 'Choices',
18
+ rightListHeading = 'Choosen',
19
+ moveAllVisible = false,
20
+ transferListType = 'basic',
21
+ leftListItems = [],
22
+ rightListItems = [],
23
+ onTransferAction,
24
+ onTransferListSelect,
25
+ listsMaxHeight = '200px',
26
+ extraClasses,
27
+ }: GidsTransferListDomProps): HTMLElement => {
28
+ const transferList = document.createElement(
29
+ 'gids-transfer-list',
30
+ ) as GidsTransferListElement;
31
+
32
+ transferList.transferListType = transferListType;
33
+
34
+ if (transferListType === 'enhanced' && leftListHeading) {
35
+ transferList.leftListHeading = leftListHeading;
36
+ }
37
+
38
+ if (transferListType === 'enhanced' && rightListHeading) {
39
+ transferList.rightListHeading = rightListHeading;
40
+ }
41
+
42
+ transferList.moveAllVisible = moveAllVisible;
43
+ transferList.leftListItems = leftListItems;
44
+ transferList.rightListItems = rightListItems;
45
+ transferList.listsMaxHeight = listsMaxHeight;
46
+
47
+ transferList.className = getGidsTransferListClassNames(extraClasses);
48
+
49
+ if (onTransferAction) {
50
+ transferList.onTransferAction = onTransferAction;
51
+ }
52
+
53
+ if (onTransferListSelect) {
54
+ transferList.onTransferListSelect = onTransferListSelect;
55
+ }
56
+
57
+ return transferList;
58
+ };