@ganpatiinfo/gids-web-dom-reference 8.0.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.
- package/CHANGELOG.md +57 -0
- package/dist/components/GidsActivityGauge/GidsActivityGauge.d.ts +8 -0
- package/dist/components/GidsActivityGauge/GidsActivityGauge.d.ts.map +1 -0
- package/dist/components/GidsActivityGauge/GidsActivityGauge.js +17 -0
- package/dist/components/GidsActivityGauge/GidsActivityGauge.js.map +1 -0
- package/dist/components/GidsBarChart/GidsBarChart.d.ts +6 -0
- package/dist/components/GidsBarChart/GidsBarChart.d.ts.map +1 -0
- package/dist/components/GidsBarChart/GidsBarChart.js +19 -0
- package/dist/components/GidsBarChart/GidsBarChart.js.map +1 -0
- package/dist/components/GidsCalendar/GidsCalendar.d.ts +6 -0
- package/dist/components/GidsCalendar/GidsCalendar.d.ts.map +1 -0
- package/dist/components/GidsCalendar/GidsCalendar.js +36 -0
- package/dist/components/GidsCalendar/GidsCalendar.js.map +1 -0
- package/dist/components/GidsCalendarCell/GidsCalendarCell.d.ts +8 -0
- package/dist/components/GidsCalendarCell/GidsCalendarCell.d.ts.map +1 -0
- package/dist/components/GidsCalendarCell/GidsCalendarCell.js +55 -0
- package/dist/components/GidsCalendarCell/GidsCalendarCell.js.map +1 -0
- package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.d.ts +6 -0
- package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.d.ts.map +1 -0
- package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.js +17 -0
- package/dist/components/GidsCalendarDayCell/GidsCalendarDayCell.js.map +1 -0
- package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.d.ts +13 -0
- package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.d.ts.map +1 -0
- package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.js +45 -0
- package/dist/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.js.map +1 -0
- package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.d.ts +6 -0
- package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.d.ts.map +1 -0
- package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.js +19 -0
- package/dist/components/GidsCalendarMonthList/GidsCalendarMonthList.js.map +1 -0
- package/dist/components/GidsCalendarYearList/GidsCalendarYearList.d.ts +6 -0
- package/dist/components/GidsCalendarYearList/GidsCalendarYearList.d.ts.map +1 -0
- package/dist/components/GidsCalendarYearList/GidsCalendarYearList.js +34 -0
- package/dist/components/GidsCalendarYearList/GidsCalendarYearList.js.map +1 -0
- package/dist/components/GidsChart/GidsChart.d.ts +8 -0
- package/dist/components/GidsChart/GidsChart.d.ts.map +1 -0
- package/dist/components/GidsChart/GidsChart.js +16 -0
- package/dist/components/GidsChart/GidsChart.js.map +1 -0
- package/dist/components/GidsChartLegend/GidsChartLegend.d.ts +8 -0
- package/dist/components/GidsChartLegend/GidsChartLegend.d.ts.map +1 -0
- package/dist/components/GidsChartLegend/GidsChartLegend.js +13 -0
- package/dist/components/GidsChartLegend/GidsChartLegend.js.map +1 -0
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts +8 -0
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.d.ts.map +1 -0
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js +14 -0
- package/dist/components/GidsChartLegendItem/GidsChartLegendItem.js.map +1 -0
- package/dist/components/GidsChevronButton/GidsChevronButton.d.ts +7 -0
- package/dist/components/GidsChevronButton/GidsChevronButton.d.ts.map +1 -0
- package/dist/components/GidsChevronButton/GidsChevronButton.js +18 -0
- package/dist/components/GidsChevronButton/GidsChevronButton.js.map +1 -0
- package/dist/components/GidsDot/GidsDot.d.ts +6 -0
- package/dist/components/GidsDot/GidsDot.d.ts.map +1 -0
- package/dist/components/GidsDot/GidsDot.js +19 -0
- package/dist/components/GidsDot/GidsDot.js.map +1 -0
- package/dist/components/GidsDropdown/GidsDropdown.d.ts +15 -0
- package/dist/components/GidsDropdown/GidsDropdown.d.ts.map +1 -0
- package/dist/components/GidsDropdown/GidsDropdown.js +62 -0
- package/dist/components/GidsDropdown/GidsDropdown.js.map +1 -0
- package/dist/components/GidsDropdownField/GidsDropdownField.d.ts +10 -0
- package/dist/components/GidsDropdownField/GidsDropdownField.d.ts.map +1 -0
- package/dist/components/GidsDropdownField/GidsDropdownField.js +38 -0
- package/dist/components/GidsDropdownField/GidsDropdownField.js.map +1 -0
- package/dist/components/GidsDropdownItem/GidsDropdownItem.d.ts +1 -1
- package/dist/components/GidsDropdownItem/GidsDropdownItem.d.ts.map +1 -1
- package/dist/components/GidsDropdownItem/GidsDropdownItem.js +5 -2
- package/dist/components/GidsDropdownItem/GidsDropdownItem.js.map +1 -1
- package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts +1 -1
- package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts.map +1 -1
- package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.js +15 -4
- package/dist/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.js.map +1 -1
- package/dist/components/GidsDropdownPicker/GidsDropdownPicker.d.ts +20 -0
- package/dist/components/GidsDropdownPicker/GidsDropdownPicker.d.ts.map +1 -0
- package/dist/components/GidsDropdownPicker/GidsDropdownPicker.js +62 -0
- package/dist/components/GidsDropdownPicker/GidsDropdownPicker.js.map +1 -0
- package/dist/components/GidsLevelGauge/GidsLevelGauge.d.ts +6 -0
- package/dist/components/GidsLevelGauge/GidsLevelGauge.d.ts.map +1 -0
- package/dist/components/GidsLevelGauge/GidsLevelGauge.js +17 -0
- package/dist/components/GidsLevelGauge/GidsLevelGauge.js.map +1 -0
- package/dist/components/GidsLineChart/GidsLineChart.d.ts +6 -0
- package/dist/components/GidsLineChart/GidsLineChart.d.ts.map +1 -0
- package/dist/components/GidsLineChart/GidsLineChart.js +19 -0
- package/dist/components/GidsLineChart/GidsLineChart.js.map +1 -0
- package/dist/components/GidsListItem/GidsListItem.d.ts.map +1 -1
- package/dist/components/GidsListItem/GidsListItem.js +21 -10
- package/dist/components/GidsListItem/GidsListItem.js.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.js +0 -7
- package/dist/components/GidsMenu/GidsMenu.js.map +1 -1
- package/dist/components/GidsMenuGroup/GidsMenuGroup.d.ts.map +1 -1
- package/dist/components/GidsMenuGroup/GidsMenuGroup.js +0 -7
- package/dist/components/GidsMenuGroup/GidsMenuGroup.js.map +1 -1
- package/dist/components/GidsPageTitle/GidsPageTitle.d.ts +9 -0
- package/dist/components/GidsPageTitle/GidsPageTitle.d.ts.map +1 -0
- package/dist/components/GidsPageTitle/GidsPageTitle.js +32 -0
- package/dist/components/GidsPageTitle/GidsPageTitle.js.map +1 -0
- package/dist/components/GidsPieChart/GidsPieChart.d.ts +8 -0
- package/dist/components/GidsPieChart/GidsPieChart.d.ts.map +1 -0
- package/dist/components/GidsPieChart/GidsPieChart.js +16 -0
- package/dist/components/GidsPieChart/GidsPieChart.js.map +1 -0
- package/dist/components/GidsProgressCircle/GidsProgressCircle.d.ts +6 -0
- package/dist/components/GidsProgressCircle/GidsProgressCircle.d.ts.map +1 -0
- package/dist/components/GidsProgressCircle/GidsProgressCircle.js +17 -0
- package/dist/components/GidsProgressCircle/GidsProgressCircle.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GidsActivityGauge/GidsActivityGauge.ts +48 -0
- package/src/components/GidsBarChart/GidsBarChart.ts +47 -0
- package/src/components/GidsCalendar/GidsCalendar.ts +72 -0
- package/src/components/GidsCalendarCell/GidsCalendarCell.ts +95 -0
- package/src/components/GidsCalendarDayCell/GidsCalendarDayCell.ts +29 -0
- package/src/components/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.ts +107 -0
- package/src/components/GidsCalendarMonthList/GidsCalendarMonthList.ts +56 -0
- package/src/components/GidsCalendarYearList/GidsCalendarYearList.ts +76 -0
- package/src/components/GidsChart/GidsChart.ts +41 -0
- package/src/components/GidsChartLegend/GidsChartLegend.ts +38 -0
- package/src/components/GidsChartLegendItem/GidsChartLegendItem.ts +40 -0
- package/src/components/GidsChevronButton/GidsChevronButton.ts +55 -0
- package/src/components/GidsDot/GidsDot.ts +42 -0
- package/src/components/GidsDropdown/GidsDropdown.ts +149 -0
- package/src/components/GidsDropdownField/GidsDropdownField.ts +106 -0
- package/src/components/GidsDropdownItem/GidsDropdownItem.ts +6 -1
- package/src/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.ts +23 -3
- package/src/components/GidsDropdownPicker/GidsDropdownPicker.ts +144 -0
- package/src/components/GidsLevelGauge/GidsLevelGauge.ts +46 -0
- package/src/components/GidsLineChart/GidsLineChart.ts +50 -0
- package/src/components/GidsListItem/GidsListItem.ts +24 -12
- package/src/components/GidsMenu/GidsMenu.ts +0 -8
- package/src/components/GidsMenuGroup/GidsMenuGroup.ts +0 -8
- package/src/components/GidsPageTitle/GidsPageTitle.ts +60 -0
- package/src/components/GidsPieChart/GidsPieChart.ts +43 -0
- package/src/components/GidsProgressCircle/GidsProgressCircle.ts +46 -0
- package/src/index.ts +21 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCalendarHeaderPanelWebProps,
|
|
3
|
+
GidsCalendarHeaderPanelWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
|
|
6
|
+
const { getGidsCalendarHeaderPanelClassNames } =
|
|
7
|
+
GidsCalendarHeaderPanelWebUtils;
|
|
8
|
+
|
|
9
|
+
export interface GidsCalendarHeaderPanelToggleEventDetail {
|
|
10
|
+
expandedMonthPicker: boolean;
|
|
11
|
+
expandedYearPicker: boolean;
|
|
12
|
+
originalEvent?: Event;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type GidsCalendarHeaderPanelElement = HTMLElement &
|
|
16
|
+
GidsCalendarHeaderPanelWebProps;
|
|
17
|
+
|
|
18
|
+
export interface GidsCalendarHeaderPanelDomProps extends GidsCalendarHeaderPanelWebProps {
|
|
19
|
+
onToggleMonthPicker?: (
|
|
20
|
+
detail: GidsCalendarHeaderPanelToggleEventDetail,
|
|
21
|
+
) => void;
|
|
22
|
+
onToggleYearPicker?: (
|
|
23
|
+
detail: GidsCalendarHeaderPanelToggleEventDetail,
|
|
24
|
+
) => void;
|
|
25
|
+
extraClasses?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const GidsCalendarHeaderPanelDom = ({
|
|
29
|
+
appearance = 'primary',
|
|
30
|
+
selectedMonthNumber,
|
|
31
|
+
startYear,
|
|
32
|
+
endYear,
|
|
33
|
+
selectedYear,
|
|
34
|
+
monthPickerDisabled = false,
|
|
35
|
+
yearPickerDisabled = false,
|
|
36
|
+
panelDisabled = false,
|
|
37
|
+
previousDisabled = false,
|
|
38
|
+
nextDisabled = false,
|
|
39
|
+
expandedMonthPicker = false,
|
|
40
|
+
expandedYearPicker = false,
|
|
41
|
+
onNextChange,
|
|
42
|
+
onPreviousChange,
|
|
43
|
+
onPanelMonthChange,
|
|
44
|
+
onPanelYearChange,
|
|
45
|
+
onToggleMonthPicker,
|
|
46
|
+
onToggleYearPicker,
|
|
47
|
+
extraClasses,
|
|
48
|
+
}: GidsCalendarHeaderPanelDomProps): HTMLElement => {
|
|
49
|
+
const calendarHeaderPanel = document.createElement(
|
|
50
|
+
'gids-calendar-header-panel',
|
|
51
|
+
) as GidsCalendarHeaderPanelElement;
|
|
52
|
+
|
|
53
|
+
calendarHeaderPanel.appearance = appearance;
|
|
54
|
+
calendarHeaderPanel.selectedMonthNumber = selectedMonthNumber;
|
|
55
|
+
calendarHeaderPanel.selectedYear = selectedYear;
|
|
56
|
+
calendarHeaderPanel.monthPickerDisabled = monthPickerDisabled;
|
|
57
|
+
calendarHeaderPanel.yearPickerDisabled = yearPickerDisabled;
|
|
58
|
+
calendarHeaderPanel.panelDisabled = panelDisabled;
|
|
59
|
+
calendarHeaderPanel.previousDisabled = previousDisabled;
|
|
60
|
+
calendarHeaderPanel.nextDisabled = nextDisabled;
|
|
61
|
+
calendarHeaderPanel.expandedMonthPicker = expandedMonthPicker;
|
|
62
|
+
calendarHeaderPanel.expandedYearPicker = expandedYearPicker;
|
|
63
|
+
calendarHeaderPanel.startYear = startYear;
|
|
64
|
+
calendarHeaderPanel.endYear = endYear;
|
|
65
|
+
|
|
66
|
+
calendarHeaderPanel.className =
|
|
67
|
+
getGidsCalendarHeaderPanelClassNames(extraClasses);
|
|
68
|
+
|
|
69
|
+
if (onPanelMonthChange) {
|
|
70
|
+
calendarHeaderPanel.onPanelMonthChange = onPanelMonthChange;
|
|
71
|
+
}
|
|
72
|
+
if (onPanelYearChange) {
|
|
73
|
+
calendarHeaderPanel.onPanelYearChange = onPanelYearChange;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (onNextChange) {
|
|
77
|
+
calendarHeaderPanel.onNextChange = onNextChange;
|
|
78
|
+
}
|
|
79
|
+
if (onPreviousChange) {
|
|
80
|
+
calendarHeaderPanel.onPreviousChange = onPreviousChange;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (onToggleMonthPicker) {
|
|
84
|
+
calendarHeaderPanel.addEventListener(
|
|
85
|
+
'gidsCalendarHeaderPanelMonthToggle',
|
|
86
|
+
(event: Event) => {
|
|
87
|
+
onToggleMonthPicker(
|
|
88
|
+
(event as CustomEvent<GidsCalendarHeaderPanelToggleEventDetail>)
|
|
89
|
+
.detail,
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
if (onToggleYearPicker) {
|
|
95
|
+
calendarHeaderPanel.addEventListener(
|
|
96
|
+
'gidsCalendarHeaderPanelYearToggle',
|
|
97
|
+
(event: Event) => {
|
|
98
|
+
onToggleYearPicker(
|
|
99
|
+
(event as CustomEvent<GidsCalendarHeaderPanelToggleEventDetail>)
|
|
100
|
+
.detail,
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return calendarHeaderPanel;
|
|
107
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCalendarMonthListWebProps,
|
|
3
|
+
GidsCalendarMonthListWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import {
|
|
6
|
+
GidsCalendarMonthListItemSelectEventDetail,
|
|
7
|
+
GidsMenuGroupType,
|
|
8
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
9
|
+
|
|
10
|
+
const { getGidsCalendarMonthListClassNames } = GidsCalendarMonthListWebUtils;
|
|
11
|
+
|
|
12
|
+
type GidsCalendarMonthListElement = HTMLElement & {
|
|
13
|
+
type?: GidsMenuGroupType;
|
|
14
|
+
noOptionsText?: string;
|
|
15
|
+
disabledIndices?: number[];
|
|
16
|
+
selectedMonthNumber?: number;
|
|
17
|
+
divider?: boolean;
|
|
18
|
+
onSelectionMonthChange?: (
|
|
19
|
+
detail: GidsCalendarMonthListItemSelectEventDetail,
|
|
20
|
+
) => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export interface GidsCalendarMonthListDomProps extends GidsCalendarMonthListWebProps {
|
|
24
|
+
extraClasses?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const GidsCalendarMonthListDom = ({
|
|
28
|
+
type = 'default',
|
|
29
|
+
noOptionsText,
|
|
30
|
+
onSelectionMonthChange,
|
|
31
|
+
disabledIndices = [],
|
|
32
|
+
divider = false,
|
|
33
|
+
selectedMonthNumber,
|
|
34
|
+
extraClasses,
|
|
35
|
+
}: GidsCalendarMonthListDomProps): HTMLElement => {
|
|
36
|
+
const calendarMonthList = document.createElement(
|
|
37
|
+
'gids-calendar-month-list',
|
|
38
|
+
) as GidsCalendarMonthListElement;
|
|
39
|
+
|
|
40
|
+
calendarMonthList.type = type;
|
|
41
|
+
if (noOptionsText) {
|
|
42
|
+
calendarMonthList.noOptionsText = noOptionsText;
|
|
43
|
+
}
|
|
44
|
+
calendarMonthList.disabledIndices = disabledIndices;
|
|
45
|
+
calendarMonthList.divider = divider;
|
|
46
|
+
calendarMonthList.selectedMonthNumber = selectedMonthNumber;
|
|
47
|
+
|
|
48
|
+
calendarMonthList.className =
|
|
49
|
+
getGidsCalendarMonthListClassNames(extraClasses);
|
|
50
|
+
|
|
51
|
+
if (onSelectionMonthChange) {
|
|
52
|
+
calendarMonthList.onSelectionMonthChange = onSelectionMonthChange;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return calendarMonthList;
|
|
56
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCalendarYearListWebProps,
|
|
3
|
+
GidsCalendarYearListWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import {
|
|
6
|
+
GidsCalendarYearListItemSelectEventDetail,
|
|
7
|
+
GidsMenuGroupType,
|
|
8
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
9
|
+
|
|
10
|
+
const { getGidsCalendarYearListClassNames, isValidFourDigitYear } =
|
|
11
|
+
GidsCalendarYearListWebUtils;
|
|
12
|
+
|
|
13
|
+
type GidsCalendarYearListElement = HTMLElement & {
|
|
14
|
+
type?: GidsMenuGroupType;
|
|
15
|
+
noOptionsText?: string;
|
|
16
|
+
disabledIndices?: number[];
|
|
17
|
+
selectedYear?: number;
|
|
18
|
+
divider?: boolean;
|
|
19
|
+
startYear?: number;
|
|
20
|
+
endYear?: number;
|
|
21
|
+
onSelectionYearChange?: (
|
|
22
|
+
detail: GidsCalendarYearListItemSelectEventDetail,
|
|
23
|
+
) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export interface GidsCalendarYearListDomProps extends GidsCalendarYearListWebProps {
|
|
27
|
+
extraClasses?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const GidsCalendarYearListDom = ({
|
|
31
|
+
type = 'default',
|
|
32
|
+
noOptionsText,
|
|
33
|
+
disabledIndices = [],
|
|
34
|
+
divider = false,
|
|
35
|
+
selectedYear,
|
|
36
|
+
startYear,
|
|
37
|
+
endYear,
|
|
38
|
+
onSelectionYearChange,
|
|
39
|
+
extraClasses,
|
|
40
|
+
}: GidsCalendarYearListDomProps): HTMLElement => {
|
|
41
|
+
const calendarYearList = document.createElement(
|
|
42
|
+
'gids-calendar-year-list',
|
|
43
|
+
) as GidsCalendarYearListElement;
|
|
44
|
+
|
|
45
|
+
calendarYearList.type = type;
|
|
46
|
+
if (noOptionsText) {
|
|
47
|
+
calendarYearList.noOptionsText = noOptionsText;
|
|
48
|
+
}
|
|
49
|
+
calendarYearList.disabledIndices = disabledIndices;
|
|
50
|
+
calendarYearList.divider = divider;
|
|
51
|
+
calendarYearList.selectedYear = selectedYear;
|
|
52
|
+
|
|
53
|
+
calendarYearList.className = getGidsCalendarYearListClassNames(extraClasses);
|
|
54
|
+
|
|
55
|
+
if (onSelectionYearChange) {
|
|
56
|
+
calendarYearList.onSelectionYearChange = onSelectionYearChange;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let newStartYear = 0;
|
|
60
|
+
let newEndYear = 0;
|
|
61
|
+
if (startYear && startYear > 0 && isValidFourDigitYear(startYear)) {
|
|
62
|
+
newStartYear = startYear;
|
|
63
|
+
} else {
|
|
64
|
+
newStartYear = new Date().getFullYear();
|
|
65
|
+
}
|
|
66
|
+
if (endYear && endYear > 0 && isValidFourDigitYear(endYear)) {
|
|
67
|
+
newEndYear = endYear;
|
|
68
|
+
} else {
|
|
69
|
+
newEndYear = newStartYear + 100;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
calendarYearList.startYear = newStartYear;
|
|
73
|
+
calendarYearList.endYear = newEndYear;
|
|
74
|
+
|
|
75
|
+
return calendarYearList;
|
|
76
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsChartWebProps,
|
|
3
|
+
GidsChartWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
|
|
6
|
+
const { getGidsChartClassNames } = GidsChartWebUtils;
|
|
7
|
+
|
|
8
|
+
type GidsChartBaseWebProps = GidsChartWebProps;
|
|
9
|
+
|
|
10
|
+
type GidsChartElement = HTMLElement & GidsChartBaseWebProps;
|
|
11
|
+
|
|
12
|
+
export interface GidsChartDomProps extends GidsChartBaseWebProps {
|
|
13
|
+
extraClasses?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const GidsChartDom = ({
|
|
17
|
+
breakpoint = 'desktop',
|
|
18
|
+
chartType = 'line-chart',
|
|
19
|
+
lineChartProps,
|
|
20
|
+
barChartProps,
|
|
21
|
+
pieChartProps,
|
|
22
|
+
activityGaugeProps,
|
|
23
|
+
levelGaugeProps,
|
|
24
|
+
progressCircleProps,
|
|
25
|
+
extraClasses,
|
|
26
|
+
}: GidsChartDomProps): HTMLElement => {
|
|
27
|
+
const chart = document.createElement('gids-chart') as GidsChartElement;
|
|
28
|
+
|
|
29
|
+
chart.breakpoint = breakpoint;
|
|
30
|
+
chart.chartType = chartType;
|
|
31
|
+
chart.lineChartProps = lineChartProps;
|
|
32
|
+
chart.barChartProps = barChartProps;
|
|
33
|
+
chart.pieChartProps = pieChartProps;
|
|
34
|
+
chart.activityGaugeProps = activityGaugeProps;
|
|
35
|
+
chart.levelGaugeProps = levelGaugeProps;
|
|
36
|
+
chart.progressCircleProps = progressCircleProps;
|
|
37
|
+
|
|
38
|
+
chart.className = getGidsChartClassNames(extraClasses);
|
|
39
|
+
|
|
40
|
+
return chart;
|
|
41
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsChartLegendWebProps,
|
|
3
|
+
GidsChartLegendWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { appendAsChildren, DomChildren } from '../../utils/domUtils';
|
|
6
|
+
|
|
7
|
+
const { getGidsChartLegendClassNames } = GidsChartLegendWebUtils;
|
|
8
|
+
|
|
9
|
+
type GidsChartLegendElement = HTMLElement &
|
|
10
|
+
GidsChartLegendWebProps<DomChildren>;
|
|
11
|
+
|
|
12
|
+
export interface GidsChartLegendDomProps extends GidsChartLegendWebProps<DomChildren> {
|
|
13
|
+
children?: HTMLElement | HTMLElement[];
|
|
14
|
+
extraClasses?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const GidsChartLegendDom = ({
|
|
18
|
+
children,
|
|
19
|
+
orientation = 'horizontal',
|
|
20
|
+
extraClasses,
|
|
21
|
+
}: GidsChartLegendDomProps): HTMLElement => {
|
|
22
|
+
const chartLegend = document.createElement(
|
|
23
|
+
'gids-chart-legend',
|
|
24
|
+
) as GidsChartLegendElement;
|
|
25
|
+
|
|
26
|
+
if (children) {
|
|
27
|
+
appendAsChildren(chartLegend, children);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
chartLegend.orientation = orientation;
|
|
31
|
+
|
|
32
|
+
chartLegend.className = getGidsChartLegendClassNames(
|
|
33
|
+
{ orientation },
|
|
34
|
+
extraClasses,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return chartLegend;
|
|
38
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsChartLegendItemWebProps,
|
|
3
|
+
GidsChartLegendItemWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { appendAsChildren, DomChildren } from '../../utils/domUtils';
|
|
6
|
+
|
|
7
|
+
const { getGidsChartLegendItemClassNames } = GidsChartLegendItemWebUtils;
|
|
8
|
+
|
|
9
|
+
type GidsChartLegendItemElement = HTMLElement &
|
|
10
|
+
GidsChartLegendItemWebProps<DomChildren>;
|
|
11
|
+
|
|
12
|
+
export interface GidsChartLegendItemDomProps extends GidsChartLegendItemWebProps<DomChildren> {
|
|
13
|
+
children?: HTMLElement | HTMLElement[];
|
|
14
|
+
extraClasses?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const GidsChartLegendItemDom = ({
|
|
18
|
+
children,
|
|
19
|
+
seriesType = '1',
|
|
20
|
+
orientation = 'horizontal',
|
|
21
|
+
extraClasses,
|
|
22
|
+
}: GidsChartLegendItemDomProps): HTMLElement => {
|
|
23
|
+
const chartLegendItem = document.createElement(
|
|
24
|
+
'gids-chart-legend-item',
|
|
25
|
+
) as GidsChartLegendItemElement;
|
|
26
|
+
|
|
27
|
+
if (children) {
|
|
28
|
+
appendAsChildren(chartLegendItem, children);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
chartLegendItem.seriesType = seriesType;
|
|
32
|
+
chartLegendItem.orientation = orientation;
|
|
33
|
+
|
|
34
|
+
chartLegendItem.className = getGidsChartLegendItemClassNames(
|
|
35
|
+
{ seriesType, orientation },
|
|
36
|
+
extraClasses,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return chartLegendItem;
|
|
40
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsChevronButtonWebProps,
|
|
3
|
+
GidsChevronButtonWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { GidsButtonDomProps } from '../GidsButton/GidsButton';
|
|
6
|
+
import { GidsButtonSize } from '@ganpatiinfo/gids-core-shared';
|
|
7
|
+
// import { GidsIconDom } from '../GidsIcon/GidsIcon';
|
|
8
|
+
|
|
9
|
+
const { getGidsChevronButtonClassNames } = GidsChevronButtonWebUtils;
|
|
10
|
+
|
|
11
|
+
export interface GidsChevronButtonDomProps extends GidsChevronButtonWebProps {
|
|
12
|
+
extraClasses?: string;
|
|
13
|
+
gidsChevronButton?: (this: HTMLButtonElement, event: Event) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type GidsChevronButtonElement = HTMLElement & {
|
|
17
|
+
size?: GidsButtonSize;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
'aria-expanded'?: string;
|
|
21
|
+
'aria-haspopup'?: string;
|
|
22
|
+
'aria-autocomplete'?: string;
|
|
23
|
+
'aria-controls'?: string;
|
|
24
|
+
} & Pick<GidsButtonDomProps<'button'>, 'onClick'>;
|
|
25
|
+
|
|
26
|
+
export const GidsChevronButtonDom = ({
|
|
27
|
+
size = 'xs',
|
|
28
|
+
disabled,
|
|
29
|
+
gidsChevronButton,
|
|
30
|
+
extraClasses,
|
|
31
|
+
ariaLabel,
|
|
32
|
+
ariaHaspopup,
|
|
33
|
+
ariaExpanded,
|
|
34
|
+
ariaControls,
|
|
35
|
+
}: GidsChevronButtonDomProps): HTMLElement => {
|
|
36
|
+
const chevronButton = document.createElement(
|
|
37
|
+
'gids-chevron-button',
|
|
38
|
+
) as GidsChevronButtonElement;
|
|
39
|
+
chevronButton.className = getGidsChevronButtonClassNames(
|
|
40
|
+
{ size },
|
|
41
|
+
extraClasses,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
chevronButton.size = size;
|
|
45
|
+
chevronButton.disabled = disabled;
|
|
46
|
+
chevronButton['aria-label'] = ariaLabel ?? '';
|
|
47
|
+
chevronButton['aria-haspopup'] = ariaHaspopup ?? '';
|
|
48
|
+
chevronButton['aria-expanded'] = ariaExpanded ?? '';
|
|
49
|
+
chevronButton['aria-controls'] = ariaControls ?? '';
|
|
50
|
+
if (gidsChevronButton) {
|
|
51
|
+
chevronButton.addEventListener('click', gidsChevronButton);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return chevronButton;
|
|
55
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { GidsDotAppearance, GidsDotSize } from '@ganpatiinfo/gids-core-shared';
|
|
2
|
+
import { GidsDotWebProps, GidsDotWebUtils } from '@ganpatiinfo/gids-web-shared';
|
|
3
|
+
|
|
4
|
+
const { getGidsDotClassNames } = GidsDotWebUtils;
|
|
5
|
+
|
|
6
|
+
export interface GidsDotDomProps extends GidsDotWebProps {
|
|
7
|
+
extraClasses?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type GidsDotElement = HTMLElement & {
|
|
11
|
+
appearance?: GidsDotAppearance;
|
|
12
|
+
size?: GidsDotSize;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const GidsDotDom = ({
|
|
17
|
+
appearance = 'subtle',
|
|
18
|
+
disabled = false,
|
|
19
|
+
size = 'xs',
|
|
20
|
+
extraClasses,
|
|
21
|
+
}: GidsDotDomProps): HTMLElement => {
|
|
22
|
+
const dot = document.createElement('gids-dot') as GidsDotElement;
|
|
23
|
+
dot.className = getGidsDotClassNames(
|
|
24
|
+
{ appearance, size, disabled },
|
|
25
|
+
extraClasses,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
dot.setAttribute('appearance', appearance);
|
|
29
|
+
dot.setAttribute('size', size);
|
|
30
|
+
|
|
31
|
+
if (disabled) {
|
|
32
|
+
dot.setAttribute('disabled', '');
|
|
33
|
+
} else {
|
|
34
|
+
dot.removeAttribute('disabled');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
dot.appearance = appearance;
|
|
38
|
+
dot.size = size;
|
|
39
|
+
dot.disabled = disabled;
|
|
40
|
+
|
|
41
|
+
return dot;
|
|
42
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GidsDropdownChangeEventDetail,
|
|
3
|
+
type GidsInputAppearance,
|
|
4
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
5
|
+
import {
|
|
6
|
+
type GidsDropdownWebProps,
|
|
7
|
+
GidsDropdownWebUtils,
|
|
8
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
9
|
+
import {
|
|
10
|
+
appendAsChildren,
|
|
11
|
+
assignToSlot,
|
|
12
|
+
DomChildren,
|
|
13
|
+
} from '../../utils/domUtils.js';
|
|
14
|
+
|
|
15
|
+
const { getGidsDropdownClassNames } = GidsDropdownWebUtils;
|
|
16
|
+
|
|
17
|
+
type NativeInputForwardedProps = Partial<
|
|
18
|
+
Omit<HTMLInputElement, 'value' | 'readOnly' | 'name' | 'disabled'>
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
type GidsDropdownInputA11yProps = NativeInputForwardedProps & {
|
|
22
|
+
role?: string | null;
|
|
23
|
+
'aria-expanded'?: string;
|
|
24
|
+
'aria-haspopup'?: string;
|
|
25
|
+
'aria-autocomplete'?: string;
|
|
26
|
+
'aria-controls'?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export interface GidsDropdownToggleEventDetail {
|
|
30
|
+
expanded: boolean;
|
|
31
|
+
originalEvent?: Event;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type GidsDropdownElement = HTMLElement & {
|
|
35
|
+
appearance?: GidsInputAppearance;
|
|
36
|
+
expanded?: boolean;
|
|
37
|
+
inputProps?: NativeInputForwardedProps;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
readOnly?: boolean;
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
value?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
onSelectionChange?: (detail: GidsDropdownChangeEventDetail) => void;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface GidsDropdownDomProps extends GidsDropdownWebProps<
|
|
48
|
+
DomChildren,
|
|
49
|
+
NativeInputForwardedProps,
|
|
50
|
+
DomChildren
|
|
51
|
+
> {
|
|
52
|
+
children?: HTMLElement | HTMLElement[];
|
|
53
|
+
onToggle?: (detail: GidsDropdownToggleEventDetail) => void;
|
|
54
|
+
extraClasses?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const GidsDropdownDom = ({
|
|
58
|
+
appearance,
|
|
59
|
+
expanded,
|
|
60
|
+
loading = false,
|
|
61
|
+
leadingIcon,
|
|
62
|
+
value,
|
|
63
|
+
name,
|
|
64
|
+
disabled = false,
|
|
65
|
+
readOnly = false,
|
|
66
|
+
children,
|
|
67
|
+
onSelectionChange,
|
|
68
|
+
inputProps,
|
|
69
|
+
onToggle,
|
|
70
|
+
extraClasses,
|
|
71
|
+
required = false,
|
|
72
|
+
leadingAccessory,
|
|
73
|
+
}: GidsDropdownDomProps): HTMLElement => {
|
|
74
|
+
const dropdown = document.createElement(
|
|
75
|
+
'gids-dropdown',
|
|
76
|
+
) as GidsDropdownElement;
|
|
77
|
+
|
|
78
|
+
if (appearance) {
|
|
79
|
+
dropdown.appearance = appearance;
|
|
80
|
+
}
|
|
81
|
+
if (typeof expanded === 'boolean') {
|
|
82
|
+
dropdown.expanded = expanded;
|
|
83
|
+
}
|
|
84
|
+
dropdown.loading = loading;
|
|
85
|
+
|
|
86
|
+
if (leadingIcon) {
|
|
87
|
+
// @ts-expect-error expected err
|
|
88
|
+
assignToSlot(dropdown, 'leadingIconDropdown', leadingIcon);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (leadingAccessory) {
|
|
92
|
+
// @ts-expect-error expected err
|
|
93
|
+
assignToSlot(dropdown, 'leadingAccessoryDropdown', leadingAccessory);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
dropdown.disabled = disabled;
|
|
97
|
+
dropdown.readOnly = readOnly;
|
|
98
|
+
if (typeof value === 'string') {
|
|
99
|
+
dropdown.value = value;
|
|
100
|
+
}
|
|
101
|
+
if (name) {
|
|
102
|
+
dropdown.name = name;
|
|
103
|
+
}
|
|
104
|
+
dropdown.required = required;
|
|
105
|
+
|
|
106
|
+
const isInteractive = !(disabled || readOnly);
|
|
107
|
+
const isExpanded = Boolean(expanded) && isInteractive;
|
|
108
|
+
const hasMenuContent = children !== undefined;
|
|
109
|
+
|
|
110
|
+
const inputId =
|
|
111
|
+
typeof inputProps?.id === 'string' ? inputProps.id : undefined;
|
|
112
|
+
const menuId = typeof inputId === 'string' ? `${inputId}__menu` : undefined;
|
|
113
|
+
const inputPropsWithA11y: GidsDropdownInputA11yProps = {
|
|
114
|
+
...(inputProps ?? {}),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
if (hasMenuContent) {
|
|
118
|
+
inputPropsWithA11y.role = 'combobox';
|
|
119
|
+
inputPropsWithA11y['aria-expanded'] = isExpanded ? 'true' : 'false';
|
|
120
|
+
inputPropsWithA11y['aria-haspopup'] = 'listbox';
|
|
121
|
+
inputPropsWithA11y['aria-autocomplete'] = 'list';
|
|
122
|
+
if (typeof menuId === 'string') {
|
|
123
|
+
inputPropsWithA11y['aria-controls'] = menuId;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
dropdown.className = getGidsDropdownClassNames(
|
|
128
|
+
{ expanded: isExpanded },
|
|
129
|
+
extraClasses,
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
dropdown.inputProps = inputPropsWithA11y;
|
|
133
|
+
|
|
134
|
+
if (onSelectionChange) {
|
|
135
|
+
dropdown.onSelectionChange = onSelectionChange;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (onToggle) {
|
|
139
|
+
dropdown.addEventListener('gidsDropdownToggle', (event: Event) => {
|
|
140
|
+
onToggle((event as CustomEvent<GidsDropdownToggleEventDetail>).detail);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (children !== undefined && children !== null) {
|
|
145
|
+
appendAsChildren(dropdown, children);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return dropdown;
|
|
149
|
+
};
|