@ganpatiinfo/gids-web-dom-reference 7.2.0 → 9.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 (167) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/components/GidsActivityGauge/GidsActivityGauge.d.ts +8 -0
  3. package/dist/components/GidsActivityGauge/GidsActivityGauge.d.ts.map +1 -0
  4. package/dist/components/GidsActivityGauge/GidsActivityGauge.js +17 -0
  5. package/dist/components/GidsActivityGauge/GidsActivityGauge.js.map +1 -0
  6. package/dist/components/GidsBarChart/GidsBarChart.d.ts +6 -0
  7. package/dist/components/GidsBarChart/GidsBarChart.d.ts.map +1 -0
  8. package/dist/components/GidsBarChart/GidsBarChart.js +19 -0
  9. package/dist/components/GidsBarChart/GidsBarChart.js.map +1 -0
  10. package/dist/components/GidsButton/GidsButton.d.ts +1 -1
  11. package/dist/components/GidsButton/GidsButton.d.ts.map +1 -1
  12. package/dist/components/GidsButton/GidsButton.js +2 -2
  13. package/dist/components/GidsButton/GidsButton.js.map +1 -1
  14. package/dist/components/GidsCalendar/GidsCalendar.d.ts +6 -0
  15. package/dist/components/GidsCalendar/GidsCalendar.d.ts.map +1 -0
  16. package/dist/components/GidsCalendar/GidsCalendar.js +36 -0
  17. package/dist/components/GidsCalendar/GidsCalendar.js.map +1 -0
  18. package/dist/components/GidsCalendarCell/GidsCalendarCell.d.ts +8 -0
  19. package/dist/components/GidsCalendarCell/GidsCalendarCell.d.ts.map +1 -0
  20. package/dist/components/GidsCalendarCell/GidsCalendarCell.js +55 -0
  21. package/dist/components/GidsCalendarCell/GidsCalendarCell.js.map +1 -0
  22. package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.d.ts +6 -0
  23. package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.d.ts.map +1 -0
  24. package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.js +17 -0
  25. package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.js.map +1 -0
  26. package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.d.ts +13 -0
  27. package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.d.ts.map +1 -0
  28. package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.js +45 -0
  29. package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.js.map +1 -0
  30. package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.d.ts +6 -0
  31. package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.d.ts.map +1 -0
  32. package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.js +19 -0
  33. package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.js.map +1 -0
  34. package/dist/components/GidsCalendarYearList/GidsCalendarYearList.d.ts +6 -0
  35. package/dist/components/GidsCalendarYearList/GidsCalendarYearList.d.ts.map +1 -0
  36. package/dist/components/GidsCalendarYearList/GidsCalendarYearList.js +34 -0
  37. package/dist/components/GidsCalendarYearList/GidsCalendarYearList.js.map +1 -0
  38. package/dist/components/GidsChart/GidsChart.d.ts +8 -0
  39. package/dist/components/GidsChart/GidsChart.d.ts.map +1 -0
  40. package/dist/components/GidsChart/GidsChart.js +16 -0
  41. package/dist/components/GidsChart/GidsChart.js.map +1 -0
  42. package/dist/components/GidsChartLegend/GidsChartLegend.d.ts +8 -0
  43. package/dist/components/GidsChartLegend/GidsChartLegend.d.ts.map +1 -0
  44. package/dist/components/GidsChartLegend/GidsChartLegend.js +13 -0
  45. package/dist/components/GidsChartLegend/GidsChartLegend.js.map +1 -0
  46. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts +8 -0
  47. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts.map +1 -0
  48. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js +14 -0
  49. package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js.map +1 -0
  50. package/dist/components/GidsChevronButton/GidsChevronButton.d.ts +7 -0
  51. package/dist/components/GidsChevronButton/GidsChevronButton.d.ts.map +1 -0
  52. package/dist/components/GidsChevronButton/GidsChevronButton.js +18 -0
  53. package/dist/components/GidsChevronButton/GidsChevronButton.js.map +1 -0
  54. package/dist/components/GidsDot/GidsDot.d.ts +6 -0
  55. package/dist/components/GidsDot/GidsDot.d.ts.map +1 -0
  56. package/dist/components/GidsDot/GidsDot.js +19 -0
  57. package/dist/components/GidsDot/GidsDot.js.map +1 -0
  58. package/dist/components/GidsDropdown/GidsDropdown.d.ts +15 -0
  59. package/dist/components/GidsDropdown/GidsDropdown.d.ts.map +1 -0
  60. package/dist/components/GidsDropdown/GidsDropdown.js +62 -0
  61. package/dist/components/GidsDropdown/GidsDropdown.js.map +1 -0
  62. package/dist/components/GidsDropdownField/GidsDropdownField.d.ts +10 -0
  63. package/dist/components/GidsDropdownField/GidsDropdownField.d.ts.map +1 -0
  64. package/dist/components/GidsDropdownField/GidsDropdownField.js +38 -0
  65. package/dist/components/GidsDropdownField/GidsDropdownField.js.map +1 -0
  66. package/dist/components/GidsDropdownItem/GidsDropdownItem.d.ts +10 -0
  67. package/dist/components/GidsDropdownItem/GidsDropdownItem.d.ts.map +1 -0
  68. package/dist/components/GidsDropdownItem/GidsDropdownItem.js +34 -0
  69. package/dist/components/GidsDropdownItem/GidsDropdownItem.js.map +1 -0
  70. package/dist/components/GidsDropdownMenu/GidsDropdownMenu.d.ts +7 -0
  71. package/dist/components/GidsDropdownMenu/GidsDropdownMenu.d.ts.map +1 -0
  72. package/dist/components/GidsDropdownMenu/GidsDropdownMenu.js +24 -0
  73. package/dist/components/GidsDropdownMenu/GidsDropdownMenu.js.map +1 -0
  74. package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts +7 -0
  75. package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts.map +1 -0
  76. package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.js +24 -0
  77. package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.js.map +1 -0
  78. package/dist/components/GidsDropdownPicker/GidsDropdownPicker.d.ts +20 -0
  79. package/dist/components/GidsDropdownPicker/GidsDropdownPicker.d.ts.map +1 -0
  80. package/dist/components/GidsDropdownPicker/GidsDropdownPicker.js +62 -0
  81. package/dist/components/GidsDropdownPicker/GidsDropdownPicker.js.map +1 -0
  82. package/dist/components/GidsEditButton/GidsEditButton.d.ts +8 -0
  83. package/dist/components/GidsEditButton/GidsEditButton.d.ts.map +1 -0
  84. package/dist/components/GidsEditButton/GidsEditButton.js +44 -0
  85. package/dist/components/GidsEditButton/GidsEditButton.js.map +1 -0
  86. package/dist/components/GidsLevelGauge/GidsLevelGauge.d.ts +6 -0
  87. package/dist/components/GidsLevelGauge/GidsLevelGauge.d.ts.map +1 -0
  88. package/dist/components/GidsLevelGauge/GidsLevelGauge.js +17 -0
  89. package/dist/components/GidsLevelGauge/GidsLevelGauge.js.map +1 -0
  90. package/dist/components/GidsLineChart/GidsLineChart.d.ts +6 -0
  91. package/dist/components/GidsLineChart/GidsLineChart.d.ts.map +1 -0
  92. package/dist/components/GidsLineChart/GidsLineChart.js +19 -0
  93. package/dist/components/GidsLineChart/GidsLineChart.js.map +1 -0
  94. package/dist/components/GidsListItem/GidsListItem.d.ts +11 -0
  95. package/dist/components/GidsListItem/GidsListItem.d.ts.map +1 -0
  96. package/dist/components/GidsListItem/GidsListItem.js +207 -0
  97. package/dist/components/GidsListItem/GidsListItem.js.map +1 -0
  98. package/dist/components/GidsMenu/GidsMenu.d.ts +7 -0
  99. package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -0
  100. package/dist/components/GidsMenu/GidsMenu.js +27 -0
  101. package/dist/components/GidsMenu/GidsMenu.js.map +1 -0
  102. package/dist/components/GidsMenuGroup/GidsMenuGroup.d.ts +7 -0
  103. package/dist/components/GidsMenuGroup/GidsMenuGroup.d.ts.map +1 -0
  104. package/dist/components/GidsMenuGroup/GidsMenuGroup.js +24 -0
  105. package/dist/components/GidsMenuGroup/GidsMenuGroup.js.map +1 -0
  106. package/dist/components/GidsPageTitle/GidsPageTitle.d.ts +9 -0
  107. package/dist/components/GidsPageTitle/GidsPageTitle.d.ts.map +1 -0
  108. package/dist/components/GidsPageTitle/GidsPageTitle.js +32 -0
  109. package/dist/components/GidsPageTitle/GidsPageTitle.js.map +1 -0
  110. package/dist/components/GidsPieChart/GidsPieChart.d.ts +8 -0
  111. package/dist/components/GidsPieChart/GidsPieChart.d.ts.map +1 -0
  112. package/dist/components/GidsPieChart/GidsPieChart.js +16 -0
  113. package/dist/components/GidsPieChart/GidsPieChart.js.map +1 -0
  114. package/dist/components/GidsPopover/GidsPopover.d.ts +7 -0
  115. package/dist/components/GidsPopover/GidsPopover.d.ts.map +1 -0
  116. package/dist/components/GidsPopover/GidsPopover.js +16 -0
  117. package/dist/components/GidsPopover/GidsPopover.js.map +1 -0
  118. package/dist/components/GidsProgressCircle/GidsProgressCircle.d.ts +6 -0
  119. package/dist/components/GidsProgressCircle/GidsProgressCircle.d.ts.map +1 -0
  120. package/dist/components/GidsProgressCircle/GidsProgressCircle.js +17 -0
  121. package/dist/components/GidsProgressCircle/GidsProgressCircle.js.map +1 -0
  122. package/dist/components/GidsTooltip/GidsTooltip.d.ts +6 -0
  123. package/dist/components/GidsTooltip/GidsTooltip.d.ts.map +1 -0
  124. package/dist/components/GidsTooltip/GidsTooltip.js +20 -0
  125. package/dist/components/GidsTooltip/GidsTooltip.js.map +1 -0
  126. package/dist/index.d.ts +31 -0
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +31 -0
  129. package/dist/index.js.map +1 -1
  130. package/dist/utils/childrenValidationUtils.d.ts +9 -0
  131. package/dist/utils/childrenValidationUtils.d.ts.map +1 -0
  132. package/dist/utils/childrenValidationUtils.js +27 -0
  133. package/dist/utils/childrenValidationUtils.js.map +1 -0
  134. package/package.json +45 -45
  135. package/src/components/GidsActivityGauge/GidsActivityGauge.ts +48 -0
  136. package/src/components/GidsBarChart/GidsBarChart.ts +47 -0
  137. package/src/components/GidsButton/GidsButton.ts +2 -1
  138. package/src/components/GidsCalendar/GidsCalendar.ts +72 -0
  139. package/src/components/GidsCalendarCell/GidsCalendarCell.ts +95 -0
  140. package/src/components/GidsCalendarDayCell/GidsCalendarDayCell.ts +29 -0
  141. package/src/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.ts +107 -0
  142. package/src/components/GidsCalendarMonthList/GidsCalendarMonthList.ts +56 -0
  143. package/src/components/GidsCalendarYearList/GidsCalendarYearList.ts +76 -0
  144. package/src/components/GidsChart/GidsChart.ts +41 -0
  145. package/src/components/GidsChartLegend/GidsChartLegend.ts +38 -0
  146. package/src/components/GidsChartLegendItem/GidsChartLegendItem.ts +40 -0
  147. package/src/components/GidsChevronButton/GidsChevronButton.ts +55 -0
  148. package/src/components/GidsDot/GidsDot.ts +42 -0
  149. package/src/components/GidsDropdown/GidsDropdown.ts +149 -0
  150. package/src/components/GidsDropdownField/GidsDropdownField.ts +106 -0
  151. package/src/components/GidsDropdownItem/GidsDropdownItem.ts +67 -0
  152. package/src/components/GidsDropdownMenu/GidsDropdownMenu.ts +43 -0
  153. package/src/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.ts +46 -0
  154. package/src/components/GidsDropdownPicker/GidsDropdownPicker.ts +144 -0
  155. package/src/components/GidsEditButton/GidsEditButton.ts +71 -0
  156. package/src/components/GidsLevelGauge/GidsLevelGauge.ts +46 -0
  157. package/src/components/GidsLineChart/GidsLineChart.ts +50 -0
  158. package/src/components/GidsListItem/GidsListItem.ts +293 -0
  159. package/src/components/GidsMenu/GidsMenu.ts +56 -0
  160. package/src/components/GidsMenuGroup/GidsMenuGroup.ts +43 -0
  161. package/src/components/GidsPageTitle/GidsPageTitle.ts +60 -0
  162. package/src/components/GidsPieChart/GidsPieChart.ts +43 -0
  163. package/src/components/GidsPopover/GidsPopover.ts +32 -0
  164. package/src/components/GidsProgressCircle/GidsProgressCircle.ts +46 -0
  165. package/src/components/GidsTooltip/GidsTooltip.ts +37 -0
  166. package/src/index.ts +31 -0
  167. package/src/utils/childrenValidationUtils.ts +47 -0
@@ -0,0 +1,43 @@
1
+ import {
2
+ GidsMenuGroupWebProps,
3
+ GidsMenuGroupWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
6
+ import { GidsSpinnerDom } from '../GidsSpinner/GidsSpinner.js';
7
+
8
+ const { getGidsMenuGroupClassNames } = GidsMenuGroupWebUtils;
9
+
10
+ export interface GidsMenuGroupDomProps extends GidsMenuGroupWebProps<DomChildren> {
11
+ extraClasses?: string;
12
+ }
13
+
14
+ export const GidsMenuGroupDom = ({
15
+ type = 'no-options',
16
+ supportingText = 'No options',
17
+ children,
18
+ extraClasses,
19
+ }: GidsMenuGroupDomProps): HTMLDivElement => {
20
+ const menuGroup = document.createElement('div');
21
+ menuGroup.className = getGidsMenuGroupClassNames({ type }, extraClasses);
22
+
23
+ if (type === 'loading') {
24
+ menuGroup.append(
25
+ GidsSpinnerDom({
26
+ indeterminate: true,
27
+ size: 'md',
28
+ }),
29
+ );
30
+ }
31
+
32
+ if (type === 'no-options') {
33
+ const noOptionText = document.createElement('span');
34
+ noOptionText.textContent = supportingText;
35
+ appendAsChildren(menuGroup, noOptionText);
36
+ }
37
+
38
+ if (type === 'default' && children !== undefined && children !== null) {
39
+ appendAsChildren(menuGroup, children);
40
+ }
41
+
42
+ return menuGroup;
43
+ };
@@ -0,0 +1,60 @@
1
+ import {
2
+ GidsPageTitleWebProps,
3
+ GidsPageTitleWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+ import {
6
+ appendAsChildren,
7
+ DomChildren,
8
+ DomNodeOrString,
9
+ } from '../../utils/domUtils';
10
+
11
+ const { getGidsPageTitleClassNames } = GidsPageTitleWebUtils;
12
+
13
+ type GidsPageTitleBaseWebProps = GidsPageTitleWebProps<
14
+ DomChildren,
15
+ DomNodeOrString
16
+ >;
17
+
18
+ export interface GidsPageTitleDomProps extends GidsPageTitleBaseWebProps {
19
+ extraClasses?: string;
20
+ }
21
+
22
+ export const GidsPageTitleDom = ({
23
+ level = 'parent',
24
+ children,
25
+ leadingAccessory,
26
+ trailingAccessory,
27
+ extraClasses,
28
+ }: GidsPageTitleDomProps): HTMLDivElement => {
29
+ const pageTitle = document.createElement('div');
30
+ pageTitle.className = getGidsPageTitleClassNames(extraClasses);
31
+
32
+ if (leadingAccessory && level === 'child') {
33
+ const leadingAccContainer = document.createElement('div');
34
+ leadingAccContainer.className = 'gids-page-title__leading-accessory';
35
+ appendAsChildren(leadingAccContainer, leadingAccessory);
36
+ pageTitle.append(leadingAccContainer);
37
+ }
38
+
39
+ if (children) {
40
+ const h1El = document.createElement('h1');
41
+ h1El.className = 'gids-page-title__heading';
42
+
43
+ if (children instanceof Node) {
44
+ h1El.append(children);
45
+ } else {
46
+ h1El.textContent = children;
47
+ }
48
+
49
+ appendAsChildren(pageTitle, h1El);
50
+ }
51
+
52
+ if (trailingAccessory) {
53
+ const trailingAccContainer = document.createElement('div');
54
+ trailingAccContainer.className = 'gids-page-title__trailing-accessory';
55
+ appendAsChildren(trailingAccContainer, trailingAccessory);
56
+ pageTitle.append(trailingAccContainer);
57
+ }
58
+
59
+ return pageTitle;
60
+ };
@@ -0,0 +1,43 @@
1
+ import {
2
+ GidsPieChartWebProps,
3
+ GidsPieChartWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+
6
+ const { getGidsPieChartClassNames } = GidsPieChartWebUtils;
7
+
8
+ type GidsPieChartBaseWebProps = GidsPieChartWebProps;
9
+
10
+ type GidsPieChartElement = HTMLElement & GidsPieChartBaseWebProps;
11
+
12
+ export interface GidsPieChartDomProps extends GidsPieChartBaseWebProps {
13
+ extraClasses?: string;
14
+ }
15
+
16
+ export const GidsPieChartDom = ({
17
+ breakpoint = 'desktop',
18
+ chartLoading = false,
19
+ chartLoaderSize,
20
+ chartLoadingSupportingText,
21
+ chartLoadingTitle,
22
+ legendVisible,
23
+ size = 'xxs',
24
+ chartData = [],
25
+ extraClasses,
26
+ }: GidsPieChartDomProps): HTMLElement => {
27
+ const pieChart = document.createElement(
28
+ 'gids-pie-chart',
29
+ ) as GidsPieChartElement;
30
+
31
+ pieChart.breakpoint = breakpoint;
32
+ pieChart.size = size;
33
+ pieChart.legendVisible = legendVisible;
34
+ pieChart.chartData = chartData;
35
+ pieChart.chartLoading = chartLoading;
36
+ pieChart.chartLoaderSize = chartLoaderSize;
37
+ pieChart.chartLoadingTitle = chartLoadingTitle;
38
+ pieChart.chartLoadingSupportingText = chartLoadingSupportingText;
39
+
40
+ pieChart.className = getGidsPieChartClassNames({ breakpoint }, extraClasses);
41
+
42
+ return pieChart;
43
+ };
@@ -0,0 +1,32 @@
1
+ import {
2
+ GidsPopoverWebProps,
3
+ GidsPopoverWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+ import { appendAsChildren, DomChildren } from '../../utils/domUtils.js';
6
+
7
+ const { getGidsPopoverClassNames } = GidsPopoverWebUtils;
8
+
9
+ export interface GidsPopoverDomProps extends GidsPopoverWebProps<DomChildren> {
10
+ extraClasses?: string;
11
+ }
12
+
13
+ export const GidsPopoverDom = ({
14
+ placement,
15
+ htmlFor,
16
+ extraClasses,
17
+ children,
18
+ }: GidsPopoverDomProps): HTMLElement => {
19
+ const popover = document.createElement('gids-popover');
20
+ popover.className = getGidsPopoverClassNames(extraClasses);
21
+
22
+ if (placement !== undefined) {
23
+ popover.setAttribute('placement', placement);
24
+ }
25
+ if (htmlFor !== undefined) {
26
+ popover.setAttribute('for', htmlFor);
27
+ }
28
+
29
+ appendAsChildren(popover, children);
30
+
31
+ return popover;
32
+ };
@@ -0,0 +1,46 @@
1
+ import {
2
+ GidsProgressCircleWebProps,
3
+ GidsProgressCircleWebUtils,
4
+ } from '@ganpatiinfo/gids-web-shared';
5
+
6
+ const { getGidsProgressCircleClassNames } = GidsProgressCircleWebUtils;
7
+
8
+ type GidsProgressCircleElement = HTMLElement & GidsProgressCircleWebProps;
9
+
10
+ export interface GidsProgressCircleDomProps extends GidsProgressCircleWebProps {
11
+ extraClasses?: string;
12
+ }
13
+
14
+ export const GidsProgressCircleDom = ({
15
+ label,
16
+ shape = 'circle',
17
+ value = 0,
18
+ breakpoint = 'desktop',
19
+ chartLoading = false,
20
+ chartLoaderSize,
21
+ chartLoadingSupportingText,
22
+ chartLoadingTitle,
23
+ size = 'xxs',
24
+ extraClasses,
25
+ }: GidsProgressCircleDomProps): HTMLElement => {
26
+ const progressCircle = document.createElement(
27
+ 'gids-progress-circle',
28
+ ) as GidsProgressCircleElement;
29
+
30
+ progressCircle.breakpoint = breakpoint;
31
+ progressCircle.size = size;
32
+ progressCircle.label = label;
33
+ progressCircle.value = value;
34
+ progressCircle.shape = shape;
35
+ progressCircle.chartLoading = chartLoading;
36
+ progressCircle.chartLoaderSize = chartLoaderSize;
37
+ progressCircle.chartLoadingTitle = chartLoadingTitle;
38
+ progressCircle.chartLoadingSupportingText = chartLoadingSupportingText;
39
+
40
+ progressCircle.className = getGidsProgressCircleClassNames(
41
+ { breakpoint },
42
+ extraClasses,
43
+ );
44
+
45
+ return progressCircle;
46
+ };
@@ -0,0 +1,37 @@
1
+ import { GidsTooltipWebProps } from '@ganpatiinfo/gids-web-shared';
2
+ import { GidsTooltipWebUtils } from '@ganpatiinfo/gids-web-shared';
3
+
4
+ const { getGidsTooltipClassNames } = GidsTooltipWebUtils;
5
+
6
+ export interface GidsTooltipDomProps extends GidsTooltipWebProps {
7
+ extraClasses?: string;
8
+ }
9
+
10
+ export const GidsTooltipDom = ({
11
+ tooltipText,
12
+ placement,
13
+ htmlFor,
14
+ showWithoutDelay,
15
+ extraClasses,
16
+ }: GidsTooltipDomProps): HTMLElement => {
17
+ const tooltip = document.createElement('gids-tooltip');
18
+ tooltip.className = getGidsTooltipClassNames(extraClasses);
19
+
20
+ if (tooltipText !== undefined) {
21
+ tooltip.setAttribute('tooltip-text', tooltipText);
22
+ }
23
+
24
+ if (placement !== undefined) {
25
+ tooltip.setAttribute('placement', placement);
26
+ }
27
+
28
+ if (htmlFor !== undefined) {
29
+ tooltip.setAttribute('for', htmlFor);
30
+ }
31
+
32
+ if (showWithoutDelay) {
33
+ tooltip.setAttribute('show-without-delay', '');
34
+ }
35
+
36
+ return tooltip;
37
+ };
package/src/index.ts CHANGED
@@ -71,8 +71,39 @@ export * from './components/GidsAccordionItemHeader/GidsAccordionItemHeader.js';
71
71
  export * from './components/GidsAccordionItemContent/GidsAccordionItemContent.js';
72
72
  export * from './components/GidsAccordionItem/GidsAccordionItem.js';
73
73
  export * from './components/GidsAccordion/GidsAccordion.js';
74
+ export * from './components/GidsTooltip/GidsTooltip.js';
75
+ export * from './components/GidsPopover/GidsPopover.js';
76
+ export * from './components/GidsEditButton/GidsEditButton.js';
77
+ export * from './components/GidsListItem/GidsListItem.js';
78
+ export * from './components/GidsMenu/GidsMenu.js';
79
+ export * from './components/GidsMenuGroup/GidsMenuGroup.js';
80
+ export * from './components/GidsDropdownItem/GidsDropdownItem.js';
81
+ export * from './components/GidsDropdownMenu/GidsDropdownMenu.js';
82
+ export * from './components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.js';
83
+ export * from './components/GidsDropdown/GidsDropdown.js';
84
+ export * from './components/GidsChevronButton/GidsChevronButton.js';
85
+ export * from './components/GidsDropdownField/GidsDropdownField.js';
86
+ export * from './components/GidsCalendarCell/GidsCalendarCell.js';
87
+ export * from './components/GidsDot/GidsDot.js';
88
+ export * from './components/GidsCalendarDayCell/GidsCalendarDayCell.js';
89
+ export * from './components/GidsCalendarMonthList/GidsCalendarMonthList.js';
90
+ export * from './components/GidsCalendarYearList/GidsCalendarYearList.js';
91
+ export * from './components/GidsDropdownPicker/GidsDropdownPicker.js';
92
+ export * from './components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.js';
93
+ export * from './components/GidsCalendar/GidsCalendar.js';
94
+ export * from './components/GidsPageTitle/GidsPageTitle.js';
95
+ export * from './components/GidsChartLegendItem/GidsChartLegendItem.js';
96
+ export * from './components/GidsChartLegend/GidsChartLegend.js';
97
+ export * from './components/GidsLineChart/GidsLineChart.js';
98
+ export * from './components/GidsBarChart/GidsBarChart.js';
99
+ export * from './components/GidsPieChart/GidsPieChart.js';
100
+ export * from './components/GidsLevelGauge/GidsLevelGauge.js';
101
+ export * from './components/GidsProgressCircle/GidsProgressCircle.js';
102
+ export * from './components/GidsActivityGauge/GidsActivityGauge.js';
103
+ export * from './components/GidsChart/GidsChart.js';
74
104
 
75
105
  /**
76
106
  * Utilities
77
107
  */
78
108
  export * from './utils/domUtils.js';
109
+ export * from './utils/childrenValidationUtils.js';
@@ -0,0 +1,47 @@
1
+ import { DomChildren } from './domUtils';
2
+
3
+ export interface TestDomChildrenValidity {
4
+ children?: DomChildren;
5
+ classNameToBeValidated?: string;
6
+ childrenNameToBeValidated?: string;
7
+ currentComponentName?: string;
8
+ }
9
+
10
+ export const testDomChildrenValidity = ({
11
+ children,
12
+ classNameToBeValidated,
13
+ childrenNameToBeValidated,
14
+ currentComponentName,
15
+ }: TestDomChildrenValidity) => {
16
+ if (children !== undefined && children !== null) {
17
+ // --- STRICTOR DOM TYPE VALIDATION BLOCK ---
18
+ // Normalize children to an array to handle both single items and collections safely
19
+ const childrenArray = Array.isArray(children) ? children : [children];
20
+
21
+ for (const child of childrenArray) {
22
+ // 1. Ensure the child is a real DOM node/element (ignore raw strings if they aren't allowed)
23
+ if (child instanceof HTMLElement) {
24
+ // Standard Check A: Using a custom class list or dataset identifier if GidsListItem sets one
25
+ const isGidsListItem =
26
+ child.classList.contains(classNameToBeValidated ?? '') ||
27
+ child.dataset.component === childrenNameToBeValidated;
28
+
29
+ // Standard Check B (Alternative): If GidsListItem returns a custom web component type instance
30
+ // const isGidsListItem = child.tagName.toLowerCase() === 'gids-list-item';
31
+
32
+ if (!isGidsListItem) {
33
+ throw new Error(
34
+ `DOM Validation Error: ${currentComponentName} only accepts ${childrenNameToBeValidated} nodes as children. ` +
35
+ `Received an element with class layout: "${child.className}".`,
36
+ );
37
+ }
38
+ } else {
39
+ // If a string or a non-element node was passed illegally
40
+ throw new Error(
41
+ `DOM Validation Error: Invalid type passed to children. Expected ${childrenNameToBeValidated} DOM elements.`,
42
+ );
43
+ }
44
+ }
45
+ // --- END OF VALIDATION BLOCK ---
46
+ }
47
+ };