@ganpatiinfo/gids-web-dom-reference 8.0.0 → 9.1.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 +71 -0
- package/dist/components/GidsActionBar/GidsActionBar.d.ts +8 -0
- package/dist/components/GidsActionBar/GidsActionBar.d.ts.map +1 -0
- package/dist/components/GidsActionBar/GidsActionBar.js +29 -0
- package/dist/components/GidsActionBar/GidsActionBar.js.map +1 -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 +8 -3
- 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/GidsFilter/GidsFilter.d.ts +16 -0
- package/dist/components/GidsFilter/GidsFilter.d.ts.map +1 -0
- package/dist/components/GidsFilter/GidsFilter.js +49 -0
- package/dist/components/GidsFilter/GidsFilter.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 +30 -15
- 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 +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GidsActionBar/GidsActionBar.ts +67 -0
- 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 +11 -3
- package/src/components/GidsDropdownMenuGroup/GidsDropdownMenuGroup.ts +23 -3
- package/src/components/GidsDropdownPicker/GidsDropdownPicker.ts +144 -0
- package/src/components/GidsFilter/GidsFilter.ts +110 -0
- package/src/components/GidsLevelGauge/GidsLevelGauge.ts +46 -0
- package/src/components/GidsLineChart/GidsLineChart.ts +50 -0
- package/src/components/GidsListItem/GidsListItem.ts +39 -18
- 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 +23 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCalendarWebProps,
|
|
3
|
+
GidsCalendarWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
|
|
6
|
+
const { getGidsCalendarClassNames } = GidsCalendarWebUtils;
|
|
7
|
+
|
|
8
|
+
type GidsCalendarElement = HTMLElement & GidsCalendarWebProps;
|
|
9
|
+
|
|
10
|
+
export interface GidsCalendarDomProps extends GidsCalendarWebProps {
|
|
11
|
+
extraClasses?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const GidsCalendarDom = ({
|
|
15
|
+
width = 'intrinsic',
|
|
16
|
+
activeMonthNumber,
|
|
17
|
+
activeYear,
|
|
18
|
+
panelActionsAppearance,
|
|
19
|
+
selectedDate,
|
|
20
|
+
dotVisibleDates = [],
|
|
21
|
+
endYear,
|
|
22
|
+
startYear,
|
|
23
|
+
monthPickerDisabled,
|
|
24
|
+
nextDisabled,
|
|
25
|
+
panelDisabled,
|
|
26
|
+
previousDisabled,
|
|
27
|
+
yearPickerDisabled,
|
|
28
|
+
onNextChange,
|
|
29
|
+
onPreviousChange,
|
|
30
|
+
onPanelMonthChange,
|
|
31
|
+
onPanelYearChange,
|
|
32
|
+
onSelectionCalendarCell,
|
|
33
|
+
extraClasses,
|
|
34
|
+
}: GidsCalendarDomProps): HTMLElement => {
|
|
35
|
+
const calendar = document.createElement(
|
|
36
|
+
'gids-calendar',
|
|
37
|
+
) as GidsCalendarElement;
|
|
38
|
+
|
|
39
|
+
calendar.width = width;
|
|
40
|
+
calendar.activeMonthNumber = activeMonthNumber;
|
|
41
|
+
calendar.activeYear = activeYear;
|
|
42
|
+
calendar.panelActionsAppearance = panelActionsAppearance;
|
|
43
|
+
calendar.selectedDate = selectedDate;
|
|
44
|
+
calendar.dotVisibleDates = dotVisibleDates;
|
|
45
|
+
calendar.startYear = startYear;
|
|
46
|
+
calendar.endYear = endYear;
|
|
47
|
+
calendar.monthPickerDisabled = monthPickerDisabled;
|
|
48
|
+
calendar.yearPickerDisabled = yearPickerDisabled;
|
|
49
|
+
calendar.nextDisabled = nextDisabled;
|
|
50
|
+
calendar.panelDisabled = panelDisabled;
|
|
51
|
+
calendar.previousDisabled = previousDisabled;
|
|
52
|
+
|
|
53
|
+
calendar.className = getGidsCalendarClassNames({ width }, extraClasses);
|
|
54
|
+
|
|
55
|
+
if (onNextChange) {
|
|
56
|
+
calendar.onNextChange = onNextChange;
|
|
57
|
+
}
|
|
58
|
+
if (onPreviousChange) {
|
|
59
|
+
calendar.onPreviousChange = onPreviousChange;
|
|
60
|
+
}
|
|
61
|
+
if (onPanelMonthChange) {
|
|
62
|
+
calendar.onPanelMonthChange = onPanelMonthChange;
|
|
63
|
+
}
|
|
64
|
+
if (onPanelYearChange) {
|
|
65
|
+
calendar.onPanelYearChange = onPanelYearChange;
|
|
66
|
+
}
|
|
67
|
+
if (onSelectionCalendarCell) {
|
|
68
|
+
calendar.onSelectionCalendarCell = onSelectionCalendarCell;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return calendar;
|
|
72
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsCalendarCellWebProps,
|
|
3
|
+
GidsCalendarCellWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import {
|
|
6
|
+
GidsCalendarCellSelectEventDetail,
|
|
7
|
+
GidsDotAppearance,
|
|
8
|
+
} from '@ganpatiinfo/gids-core-shared';
|
|
9
|
+
import { GidsDotDom } from '../GidsDot/GidsDot';
|
|
10
|
+
|
|
11
|
+
const { getGidsCalendarCellClassNames } = GidsCalendarCellWebUtils;
|
|
12
|
+
|
|
13
|
+
export interface GidsCalendarCellDomProps extends GidsCalendarCellWebProps {
|
|
14
|
+
onPressCalendarCell?: (
|
|
15
|
+
event: CustomEvent<GidsCalendarCellSelectEventDetail>,
|
|
16
|
+
) => void;
|
|
17
|
+
extraClasses?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const GidsCalendarCellDom = ({
|
|
21
|
+
id,
|
|
22
|
+
name,
|
|
23
|
+
label,
|
|
24
|
+
dot,
|
|
25
|
+
disabled = false,
|
|
26
|
+
selected,
|
|
27
|
+
today,
|
|
28
|
+
onPressCalendarCell,
|
|
29
|
+
extraClasses,
|
|
30
|
+
cellType = 'effective',
|
|
31
|
+
}: GidsCalendarCellDomProps): HTMLButtonElement => {
|
|
32
|
+
const calendarCell = document.createElement('button');
|
|
33
|
+
calendarCell.type = 'button';
|
|
34
|
+
calendarCell.className = getGidsCalendarCellClassNames(
|
|
35
|
+
{ disabled, selected, today, cellType, dot },
|
|
36
|
+
extraClasses,
|
|
37
|
+
);
|
|
38
|
+
calendarCell.setAttribute('role', 'gridcell');
|
|
39
|
+
calendarCell.setAttribute('aria-selected', selected ? 'true' : 'false');
|
|
40
|
+
calendarCell.disabled = disabled;
|
|
41
|
+
if (id) {
|
|
42
|
+
calendarCell.setAttribute('id', id);
|
|
43
|
+
}
|
|
44
|
+
if (name) {
|
|
45
|
+
calendarCell.name = name;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (label) {
|
|
49
|
+
const childrenLabel = document.createElement('span');
|
|
50
|
+
childrenLabel.textContent = label;
|
|
51
|
+
calendarCell.appendChild(childrenLabel);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (dot) {
|
|
55
|
+
let dotAppearance: GidsDotAppearance = 'subtle';
|
|
56
|
+
if (selected && !disabled) {
|
|
57
|
+
dotAppearance = 'static-inverse';
|
|
58
|
+
}
|
|
59
|
+
calendarCell.appendChild(
|
|
60
|
+
GidsDotDom({
|
|
61
|
+
appearance: dotAppearance,
|
|
62
|
+
disabled,
|
|
63
|
+
size: 'xs',
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const hasPressableContent = !disabled && cellType === 'effective';
|
|
69
|
+
|
|
70
|
+
calendarCell.addEventListener('click', (event: MouseEvent) => {
|
|
71
|
+
if (event.defaultPrevented || disabled || !hasPressableContent) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const customEvent = new CustomEvent<GidsCalendarCellSelectEventDetail>(
|
|
75
|
+
'onPressCalendarCell',
|
|
76
|
+
{
|
|
77
|
+
bubbles: true,
|
|
78
|
+
composed: true,
|
|
79
|
+
detail: {
|
|
80
|
+
cellValue: label,
|
|
81
|
+
selected,
|
|
82
|
+
disabled,
|
|
83
|
+
dot,
|
|
84
|
+
today,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
if (onPressCalendarCell) {
|
|
90
|
+
onPressCalendarCell(customEvent);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return calendarCell;
|
|
95
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GidsCalendarDayCellWebProps,
|
|
3
|
+
GidsCalendarDayCellWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { GidsCalendarCellDom } from '../GidsCalendarCell/GidsCalendarCell';
|
|
6
|
+
|
|
7
|
+
const { getGidsCalendarDayCellClassNames } = GidsCalendarDayCellWebUtils;
|
|
8
|
+
|
|
9
|
+
export interface GidsCalendarDayCellDomProps extends GidsCalendarDayCellWebProps {
|
|
10
|
+
extraClasses?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const GidsCalendarDayCellDom = ({
|
|
14
|
+
label,
|
|
15
|
+
id,
|
|
16
|
+
extraClasses,
|
|
17
|
+
}: GidsCalendarDayCellDomProps): HTMLButtonElement => {
|
|
18
|
+
return GidsCalendarCellDom({
|
|
19
|
+
id,
|
|
20
|
+
name: label,
|
|
21
|
+
label,
|
|
22
|
+
dot: false,
|
|
23
|
+
disabled: false,
|
|
24
|
+
selected: false,
|
|
25
|
+
today: false,
|
|
26
|
+
cellType: 'non-effective',
|
|
27
|
+
extraClasses: getGidsCalendarDayCellClassNames(extraClasses),
|
|
28
|
+
});
|
|
29
|
+
};
|
|
@@ -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
|
+
};
|