@ganpatiinfo/gids-web-dom-reference 13.0.0 → 14.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 +67 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts +18 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.d.ts.map +1 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js +141 -0
- package/dist/components/GidsCrossTable/GidsCrossTable.js.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts +13 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.d.ts.map +1 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js +79 -0
- package/dist/components/GidsCrossTableBody/GidsCrossTableBody.js.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts +13 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.d.ts.map +1 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js +128 -0
- package/dist/components/GidsCrossTableRow/GidsCrossTableRow.js.map +1 -0
- package/dist/components/GidsDialog/GidsDialog.d.ts +13 -0
- package/dist/components/GidsDialog/GidsDialog.d.ts.map +1 -0
- package/dist/components/GidsDialog/GidsDialog.js +102 -0
- package/dist/components/GidsDialog/GidsDialog.js.map +1 -0
- package/dist/components/GidsHeaderNavigation/GidsHeaderNavigation.d.ts +8 -0
- package/dist/components/GidsHeaderNavigation/GidsHeaderNavigation.d.ts.map +1 -0
- package/dist/components/GidsHeaderNavigation/GidsHeaderNavigation.js +29 -0
- package/dist/components/GidsHeaderNavigation/GidsHeaderNavigation.js.map +1 -0
- package/dist/components/GidsHeaderNavigationItem/GidsHeaderNavigationItem.d.ts +8 -0
- package/dist/components/GidsHeaderNavigationItem/GidsHeaderNavigationItem.d.ts.map +1 -0
- package/dist/components/GidsHeaderNavigationItem/GidsHeaderNavigationItem.js +57 -0
- package/dist/components/GidsHeaderNavigationItem/GidsHeaderNavigationItem.js.map +1 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts +20 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.d.ts.map +1 -1
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js +5 -0
- package/dist/components/GidsMatrixTable/GidsMatrixTable.js.map +1 -1
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts +20 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.d.ts.map +1 -1
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js +5 -0
- package/dist/components/GidsMatrixTableBody/GidsMatrixTableBody.js.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.d.ts +1 -1
- package/dist/components/GidsMenu/GidsMenu.d.ts.map +1 -1
- package/dist/components/GidsMenu/GidsMenu.js +10 -1
- package/dist/components/GidsMenu/GidsMenu.js.map +1 -1
- package/dist/components/GidsProfile/GidsProfile.d.ts +8 -0
- package/dist/components/GidsProfile/GidsProfile.d.ts.map +1 -0
- package/dist/components/GidsProfile/GidsProfile.js +58 -0
- package/dist/components/GidsProfile/GidsProfile.js.map +1 -0
- package/dist/components/GidsProfileMenu/GidsProfileMenu.d.ts +7 -0
- package/dist/components/GidsProfileMenu/GidsProfileMenu.d.ts.map +1 -0
- package/dist/components/GidsProfileMenu/GidsProfileMenu.js +25 -0
- package/dist/components/GidsProfileMenu/GidsProfileMenu.js.map +1 -0
- package/dist/components/GidsProfileMenuHeader/GidsProfileMenuHeader.d.ts +7 -0
- package/dist/components/GidsProfileMenuHeader/GidsProfileMenuHeader.d.ts.map +1 -0
- package/dist/components/GidsProfileMenuHeader/GidsProfileMenuHeader.js +24 -0
- package/dist/components/GidsProfileMenuHeader/GidsProfileMenuHeader.js.map +1 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.d.ts +8 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.d.ts.map +1 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.js +16 -0
- package/dist/components/GidsSkeleton/GidsSkeleton.js.map +1 -0
- package/dist/components/GidsTable/GidsTable.d.ts +1 -1
- package/dist/components/GidsTable/GidsTable.d.ts.map +1 -1
- package/dist/components/GidsTable/GidsTable.js +27 -2
- package/dist/components/GidsTable/GidsTable.js.map +1 -1
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts +2 -2
- package/dist/components/GidsTableFooter/GidsTableFooter.d.ts.map +1 -1
- package/dist/components/GidsTableFooter/GidsTableFooter.js +2 -24
- package/dist/components/GidsTableFooter/GidsTableFooter.js.map +1 -1
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts +1 -1
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.d.ts.map +1 -1
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js +5 -3
- package/dist/components/GidsTableFooterControl/GidsTableFooterControl.js.map +1 -1
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts +1 -1
- package/dist/components/GidsTableHeader/GidsTableHeader.d.ts.map +1 -1
- package/dist/components/GidsTableHeader/GidsTableHeader.js +1 -3
- package/dist/components/GidsTableHeader/GidsTableHeader.js.map +1 -1
- package/dist/components/GidsTableRow/GidsTableRow.d.ts +1 -1
- package/dist/components/GidsTableRow/GidsTableRow.d.ts.map +1 -1
- package/dist/components/GidsTableRow/GidsTableRow.js +3 -3
- package/dist/components/GidsTableRow/GidsTableRow.js.map +1 -1
- package/dist/components/GidsTransferList/GidsTransferList.d.ts +8 -0
- package/dist/components/GidsTransferList/GidsTransferList.d.ts.map +1 -0
- package/dist/components/GidsTransferList/GidsTransferList.js +25 -0
- package/dist/components/GidsTransferList/GidsTransferList.js.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts +10 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.d.ts.map +1 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js +133 -0
- package/dist/components/_GidsDialogControl/GidsDialogControl.js.map +1 -0
- package/dist/index.d.ts +120 -108
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -108
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/GidsCrossTable/GidsCrossTable.ts +259 -0
- package/src/components/GidsCrossTableBody/GidsCrossTableBody.ts +171 -0
- package/src/components/GidsCrossTableRow/GidsCrossTableRow.ts +230 -0
- package/src/components/GidsDialog/GidsDialog.ts +161 -0
- package/src/components/GidsHeaderNavigation/GidsHeaderNavigation.ts +75 -0
- package/src/components/GidsHeaderNavigationItem/GidsHeaderNavigationItem.ts +103 -0
- package/src/components/GidsMatrixTable/GidsMatrixTable.ts +20 -0
- package/src/components/GidsMatrixTableBody/GidsMatrixTableBody.ts +21 -0
- package/src/components/GidsMenu/GidsMenu.ts +15 -0
- package/src/components/GidsProfile/GidsProfile.ts +120 -0
- package/src/components/GidsProfileMenu/GidsProfileMenu.ts +60 -0
- package/src/components/GidsProfileMenuHeader/GidsProfileMenuHeader.ts +66 -0
- package/src/components/GidsSkeleton/GidsSkeleton.ts +40 -0
- package/src/components/GidsTable/GidsTable.ts +41 -4
- package/src/components/GidsTableFooter/GidsTableFooter.ts +1 -39
- package/src/components/GidsTableFooterControl/GidsTableFooterControl.ts +9 -2
- package/src/components/GidsTableHeader/GidsTableHeader.ts +0 -4
- package/src/components/GidsTableRow/GidsTableRow.ts +2 -4
- package/src/components/GidsTransferList/GidsTransferList.ts +58 -0
- package/src/components/_GidsDialogControl/GidsDialogControl.ts +198 -0
- package/src/index.ts +120 -108
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsDialogWebUtils,
|
|
3
|
+
type GidsDialogWebProps,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { DomNodeOrString } from '../../utils/domUtils.js';
|
|
6
|
+
import {
|
|
7
|
+
IconAppearance,
|
|
8
|
+
IconName,
|
|
9
|
+
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
10
|
+
import { GidsDialogControlDom } from '../_GidsDialogControl/GidsDialogControl.js';
|
|
11
|
+
import { GidsDialogControlCloseEvent } from '@ganpatiinfo/gids-core-shared';
|
|
12
|
+
|
|
13
|
+
const { getGidsDialogClassNames } = GidsDialogWebUtils;
|
|
14
|
+
|
|
15
|
+
type GidsDialogBaseWebProps = GidsDialogWebProps<
|
|
16
|
+
DomNodeOrString,
|
|
17
|
+
Event,
|
|
18
|
+
IconName,
|
|
19
|
+
IconAppearance
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
// 1. Create a custom type that represents your modified element
|
|
23
|
+
export type GidsDialogCustomElement = HTMLDialogElement & {
|
|
24
|
+
element: HTMLDialogElement;
|
|
25
|
+
open: (parent?: HTMLElement) => void;
|
|
26
|
+
close: () => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type GidsDialogDomProps = GidsDialogBaseWebProps;
|
|
30
|
+
|
|
31
|
+
export const GidsDialogDom = ({
|
|
32
|
+
variant = 'alert',
|
|
33
|
+
maxWidth = 'sm',
|
|
34
|
+
scrollMode = 'paper',
|
|
35
|
+
draggable = false,
|
|
36
|
+
headerTitle,
|
|
37
|
+
closeVisible = true,
|
|
38
|
+
children,
|
|
39
|
+
footerActions = [],
|
|
40
|
+
headerDividerVisible = false,
|
|
41
|
+
footerDividerVisible = false,
|
|
42
|
+
transition = 'none',
|
|
43
|
+
cancellable,
|
|
44
|
+
onCloseDialog,
|
|
45
|
+
onDialogFooterAction,
|
|
46
|
+
}: GidsDialogDomProps): GidsDialogCustomElement => {
|
|
47
|
+
const nativeClose = HTMLDialogElement.prototype.close;
|
|
48
|
+
|
|
49
|
+
function executeClose(event: GidsDialogControlCloseEvent<Event>) {
|
|
50
|
+
if (onCloseDialog) {
|
|
51
|
+
onCloseDialog({ originalEvent: event?.originalEvent });
|
|
52
|
+
}
|
|
53
|
+
dialog.close();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 1. Generate the pristine native dialog instance directly from the control function
|
|
57
|
+
const dialog = GidsDialogControlDom({
|
|
58
|
+
variant,
|
|
59
|
+
maxWidth,
|
|
60
|
+
scrollMode,
|
|
61
|
+
draggable,
|
|
62
|
+
headerTitle,
|
|
63
|
+
closeVisible,
|
|
64
|
+
children,
|
|
65
|
+
footerActions,
|
|
66
|
+
headerDividerVisible,
|
|
67
|
+
footerDividerVisible,
|
|
68
|
+
onCloseDialogControl: executeClose,
|
|
69
|
+
onDialogControlFooterAction: onDialogFooterAction,
|
|
70
|
+
}) as unknown as GidsDialogCustomElement;
|
|
71
|
+
|
|
72
|
+
// 2. CRITICAL BODY SCROLL PROTECTION: Inject layout protections inline immediately
|
|
73
|
+
if (scrollMode === 'body') {
|
|
74
|
+
dialog.style.setProperty('position', 'absolute', 'important');
|
|
75
|
+
dialog.style.setProperty('max-height', 'none', 'important');
|
|
76
|
+
dialog.style.setProperty('overflow', 'visible', 'important');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 3. RESTORED: Backdrop-only click cancellation logic for DOM target implementation
|
|
80
|
+
if (cancellable) {
|
|
81
|
+
dialog.addEventListener('click', (event: MouseEvent) => {
|
|
82
|
+
if (event.target === dialog) {
|
|
83
|
+
const rect = dialog.getBoundingClientRect();
|
|
84
|
+
const isOutside =
|
|
85
|
+
event.clientX < rect.left ||
|
|
86
|
+
event.clientX > rect.right ||
|
|
87
|
+
event.clientY < rect.top ||
|
|
88
|
+
event.clientY > rect.bottom;
|
|
89
|
+
|
|
90
|
+
if (isOutside) {
|
|
91
|
+
executeClose({ originalEvent: event });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
dialog.element = dialog as unknown as HTMLDialogElement;
|
|
98
|
+
|
|
99
|
+
// 4. Overwrite orchestration controllers cleanly via Object.defineProperty
|
|
100
|
+
Object.defineProperty(dialog, 'open', {
|
|
101
|
+
value: (parent: HTMLElement = document.body) => {
|
|
102
|
+
// Append the node directly to the DOM tree first
|
|
103
|
+
if (!dialog.isConnected) {
|
|
104
|
+
parent.appendChild(dialog);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (scrollMode === 'body') {
|
|
108
|
+
document.body.style.overflow = 'hidden';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Add base classes and transition modifiers ONLY when open() runs to stop the jumping bug
|
|
112
|
+
dialog.classList.add('gids-dialog');
|
|
113
|
+
|
|
114
|
+
const transitionClasses = getGidsDialogClassNames({ transition });
|
|
115
|
+
if (transitionClasses) {
|
|
116
|
+
transitionClasses.split(' ').forEach((className) => {
|
|
117
|
+
if (className.trim()) {
|
|
118
|
+
dialog.classList.add(className.trim());
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Force a quick layout reflow to initialize your animation coordinates perfectly
|
|
124
|
+
void dialog.offsetHeight;
|
|
125
|
+
|
|
126
|
+
// Open modal cleanly on the top layer
|
|
127
|
+
dialog.showModal();
|
|
128
|
+
},
|
|
129
|
+
writable: true,
|
|
130
|
+
configurable: true,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
Object.defineProperty(dialog, 'close', {
|
|
134
|
+
value: () => {
|
|
135
|
+
if (scrollMode === 'body') {
|
|
136
|
+
document.body.style.overflow = '';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Clean up all added classes on close so they completely reset for the next run
|
|
140
|
+
dialog.classList.remove('gids-dialog');
|
|
141
|
+
const transitionClasses = getGidsDialogClassNames({ transition });
|
|
142
|
+
if (transitionClasses) {
|
|
143
|
+
transitionClasses.split(' ').forEach((className) => {
|
|
144
|
+
if (className.trim()) {
|
|
145
|
+
dialog.classList.remove(className.trim());
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
nativeClose.call(dialog);
|
|
151
|
+
|
|
152
|
+
if (dialog.isConnected) {
|
|
153
|
+
dialog.remove();
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
writable: true,
|
|
157
|
+
configurable: true,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return dialog;
|
|
161
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsHeaderNavigationWebProps,
|
|
3
|
+
GidsHeaderNavigationWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { IconName } from '@ganpatiinfo/gids-web-theme-interface';
|
|
6
|
+
|
|
7
|
+
const { getGidsHeaderNavigationClassNames } = GidsHeaderNavigationWebUtils;
|
|
8
|
+
|
|
9
|
+
export type GidsHeaderNavigationBaseWebProps = GidsHeaderNavigationWebProps<
|
|
10
|
+
Event,
|
|
11
|
+
IconName
|
|
12
|
+
>;
|
|
13
|
+
|
|
14
|
+
type GidsHeaderNavigationElement = HTMLElement &
|
|
15
|
+
GidsHeaderNavigationBaseWebProps;
|
|
16
|
+
|
|
17
|
+
export interface GidsHeaderNavigationDomProps extends GidsHeaderNavigationBaseWebProps {
|
|
18
|
+
extraClasses?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const GidsHeaderNavigationDom = ({
|
|
22
|
+
type = 'gap',
|
|
23
|
+
navMenus = [],
|
|
24
|
+
appearance = 'default',
|
|
25
|
+
selectionAppearance = 'default',
|
|
26
|
+
applyShadow = false,
|
|
27
|
+
borderRadius = 'none',
|
|
28
|
+
mode = 'wrap',
|
|
29
|
+
applySeparators = false,
|
|
30
|
+
size = 'md',
|
|
31
|
+
selectionType = 'single-deselection-not-allowed',
|
|
32
|
+
defaultNavItemId,
|
|
33
|
+
defaultNavMenuId,
|
|
34
|
+
defaultNavMenuItemId,
|
|
35
|
+
onHeaderNavigationItemChange,
|
|
36
|
+
extraClasses,
|
|
37
|
+
}: GidsHeaderNavigationDomProps): HTMLElement => {
|
|
38
|
+
const headerNavigation = document.createElement(
|
|
39
|
+
'gids-header-navigation',
|
|
40
|
+
) as GidsHeaderNavigationElement;
|
|
41
|
+
|
|
42
|
+
headerNavigation.setAttribute('header-nav-appearance', appearance);
|
|
43
|
+
headerNavigation.setAttribute('header-nav-size', size);
|
|
44
|
+
headerNavigation.setAttribute(
|
|
45
|
+
'header-nav-selection-appearance',
|
|
46
|
+
selectionAppearance,
|
|
47
|
+
);
|
|
48
|
+
headerNavigation.setAttribute('header-nav-type', type);
|
|
49
|
+
|
|
50
|
+
headerNavigation.navMenus = navMenus;
|
|
51
|
+
headerNavigation.appearance = appearance;
|
|
52
|
+
headerNavigation.selectionAppearance = selectionAppearance;
|
|
53
|
+
headerNavigation.applyShadow = applyShadow;
|
|
54
|
+
headerNavigation.borderRadius = borderRadius;
|
|
55
|
+
headerNavigation.mode = mode;
|
|
56
|
+
headerNavigation.applySeparators = applySeparators;
|
|
57
|
+
headerNavigation.size = size;
|
|
58
|
+
headerNavigation.type = type;
|
|
59
|
+
headerNavigation.selectionType = selectionType;
|
|
60
|
+
headerNavigation.defaultNavItemId = defaultNavItemId;
|
|
61
|
+
headerNavigation.defaultNavMenuId = defaultNavMenuId;
|
|
62
|
+
headerNavigation.defaultNavMenuItemId = defaultNavMenuItemId;
|
|
63
|
+
|
|
64
|
+
headerNavigation.className = getGidsHeaderNavigationClassNames(
|
|
65
|
+
{ mode, type },
|
|
66
|
+
extraClasses,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (onHeaderNavigationItemChange) {
|
|
70
|
+
headerNavigation.onHeaderNavigationItemChange =
|
|
71
|
+
onHeaderNavigationItemChange;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return headerNavigation;
|
|
75
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsHeaderNavigationItemWebProps,
|
|
3
|
+
GidsHeaderNavigationItemWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import { assignToSlot, DomChildren } from '../../utils/domUtils';
|
|
6
|
+
|
|
7
|
+
const { getGidsHeaderNavigationItemClassNames } =
|
|
8
|
+
GidsHeaderNavigationItemWebUtils;
|
|
9
|
+
|
|
10
|
+
export type GidsHeaderNavigationItemBaseWebProps =
|
|
11
|
+
GidsHeaderNavigationItemWebProps<Event, DomChildren>;
|
|
12
|
+
|
|
13
|
+
type GidsHeaderNavigationItemElement = HTMLElement &
|
|
14
|
+
GidsHeaderNavigationItemBaseWebProps;
|
|
15
|
+
|
|
16
|
+
export interface GidsHeaderNavigationItemDomProps extends GidsHeaderNavigationItemBaseWebProps {
|
|
17
|
+
extraClasses?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const GidsHeaderNavigationItemDom = ({
|
|
21
|
+
id,
|
|
22
|
+
menuId,
|
|
23
|
+
appearance = 'default',
|
|
24
|
+
selectionAppearance = 'default',
|
|
25
|
+
expanded = false,
|
|
26
|
+
selected = false,
|
|
27
|
+
selectedMenuItemId,
|
|
28
|
+
label,
|
|
29
|
+
leadingIcon,
|
|
30
|
+
menuItems = [],
|
|
31
|
+
size = 'sm',
|
|
32
|
+
borderRadius = 'none',
|
|
33
|
+
applyShadow = false,
|
|
34
|
+
selectionType = 'single-deselection-allowed',
|
|
35
|
+
onPressNavigationItem,
|
|
36
|
+
onMenuItemChange,
|
|
37
|
+
extraClasses,
|
|
38
|
+
}: GidsHeaderNavigationItemDomProps): HTMLElement => {
|
|
39
|
+
const headerNavigationItem = document.createElement(
|
|
40
|
+
'gids-header-navigation-item',
|
|
41
|
+
) as GidsHeaderNavigationItemElement;
|
|
42
|
+
|
|
43
|
+
headerNavigationItem.setAttribute('id', id);
|
|
44
|
+
headerNavigationItem.setAttribute('header-nav-item-appearance', appearance);
|
|
45
|
+
headerNavigationItem.setAttribute('header-nav-item-size', size);
|
|
46
|
+
headerNavigationItem.setAttribute(
|
|
47
|
+
'header-nav-item-selection-appearance',
|
|
48
|
+
selectionAppearance,
|
|
49
|
+
);
|
|
50
|
+
if (menuId) {
|
|
51
|
+
headerNavigationItem.setAttribute('menu-id', menuId);
|
|
52
|
+
}
|
|
53
|
+
if (selected) {
|
|
54
|
+
headerNavigationItem.setAttribute('header-nav-item-selected', 'true');
|
|
55
|
+
} else {
|
|
56
|
+
headerNavigationItem.removeAttribute('header-nav-item-selected');
|
|
57
|
+
}
|
|
58
|
+
if (expanded) {
|
|
59
|
+
headerNavigationItem.setAttribute('header-nav-item-expanded', 'true');
|
|
60
|
+
} else {
|
|
61
|
+
headerNavigationItem.removeAttribute('header-nav-item-expanded');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
headerNavigationItem.id = id;
|
|
65
|
+
headerNavigationItem.appearance = appearance;
|
|
66
|
+
headerNavigationItem.selectionAppearance = selectionAppearance;
|
|
67
|
+
headerNavigationItem.selected = selected;
|
|
68
|
+
headerNavigationItem.label = label;
|
|
69
|
+
headerNavigationItem.menuItems = menuItems;
|
|
70
|
+
headerNavigationItem.size = size;
|
|
71
|
+
headerNavigationItem.expanded = expanded;
|
|
72
|
+
headerNavigationItem.borderRadius = borderRadius;
|
|
73
|
+
headerNavigationItem.applyShadow = applyShadow;
|
|
74
|
+
headerNavigationItem.selectedMenuItemId = selectedMenuItemId;
|
|
75
|
+
headerNavigationItem.selectionType = selectionType;
|
|
76
|
+
|
|
77
|
+
if (leadingIcon) {
|
|
78
|
+
// @ts-expect-error error expected
|
|
79
|
+
assignToSlot(headerNavigationItem, 'headerNavItemLeadingIcon', leadingIcon);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
headerNavigationItem.className = getGidsHeaderNavigationItemClassNames(
|
|
83
|
+
{
|
|
84
|
+
selected,
|
|
85
|
+
appearance,
|
|
86
|
+
selectionAppearance,
|
|
87
|
+
size,
|
|
88
|
+
applyShadow,
|
|
89
|
+
borderRadius,
|
|
90
|
+
},
|
|
91
|
+
extraClasses,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
if (onPressNavigationItem) {
|
|
95
|
+
headerNavigationItem.onPressNavigationItem = onPressNavigationItem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (onMenuItemChange) {
|
|
99
|
+
headerNavigationItem.onMenuItemChange = onMenuItemChange;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return headerNavigationItem;
|
|
103
|
+
};
|
|
@@ -21,12 +21,22 @@ const {
|
|
|
21
21
|
getMatrixTableClasses,
|
|
22
22
|
} = GidsMatrixTableWebUtils;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
*
|
|
27
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
28
|
+
*/
|
|
24
29
|
type GidsMatrixTableBaseWebProps = GidsMatrixTableWebProps<
|
|
25
30
|
GidsTableCellTypographyStyle,
|
|
26
31
|
IconName,
|
|
27
32
|
IconAppearance
|
|
28
33
|
>;
|
|
29
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated
|
|
37
|
+
*
|
|
38
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
39
|
+
*/
|
|
30
40
|
type GidsMatrixTableActionButtonBaseEvent =
|
|
31
41
|
GidsMatrixTableBodyActionButtonEvent<
|
|
32
42
|
Event,
|
|
@@ -35,6 +45,11 @@ type GidsMatrixTableActionButtonBaseEvent =
|
|
|
35
45
|
IconAppearance
|
|
36
46
|
>;
|
|
37
47
|
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
*
|
|
51
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
52
|
+
*/
|
|
38
53
|
export interface GidsMatrixTableDomProps extends GidsMatrixTableBaseWebProps {
|
|
39
54
|
extraClasses?: string;
|
|
40
55
|
onClickMatrixTableActionBtn?: (
|
|
@@ -42,6 +57,11 @@ export interface GidsMatrixTableDomProps extends GidsMatrixTableBaseWebProps {
|
|
|
42
57
|
) => void;
|
|
43
58
|
}
|
|
44
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
*
|
|
63
|
+
* Use `GidsCrossTable` and its props and functions instead.
|
|
64
|
+
*/
|
|
45
65
|
export const GidsMatrixTableDom = ({
|
|
46
66
|
topHeaderCells = [],
|
|
47
67
|
tableBodyItems = [],
|
|
@@ -20,11 +20,22 @@ import {
|
|
|
20
20
|
const { getGidsMatrixTableBodyClassNames, getConstructedMatrixTableBodyItems } =
|
|
21
21
|
GidsMatrixTableBodyWebUtils;
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
*
|
|
26
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
27
|
+
*/
|
|
23
28
|
type GidsMatrixTableBodyBaseWebProps = GidsMatrixTableBodyWebProps<
|
|
24
29
|
GidsTableCellTypographyStyle,
|
|
25
30
|
IconName,
|
|
26
31
|
IconAppearance
|
|
27
32
|
>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*
|
|
37
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
38
|
+
*/
|
|
28
39
|
export type GidsMatrixTableBodyActionButtonBaseEvent =
|
|
29
40
|
GidsMatrixTableBodyActionButtonEvent<
|
|
30
41
|
Event,
|
|
@@ -33,6 +44,11 @@ export type GidsMatrixTableBodyActionButtonBaseEvent =
|
|
|
33
44
|
IconAppearance
|
|
34
45
|
>;
|
|
35
46
|
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated
|
|
49
|
+
*
|
|
50
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
51
|
+
*/
|
|
36
52
|
export interface GidsMatrixTableBodyDomProps extends GidsMatrixTableBodyBaseWebProps {
|
|
37
53
|
extraClasses?: string;
|
|
38
54
|
onClickMatrixBodyCellActionBtn?: (
|
|
@@ -40,6 +56,11 @@ export interface GidsMatrixTableBodyDomProps extends GidsMatrixTableBodyBaseWebP
|
|
|
40
56
|
) => void;
|
|
41
57
|
}
|
|
42
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*
|
|
62
|
+
* Use `GidsCrossTableBody` and its props and functions instead.
|
|
63
|
+
*/
|
|
43
64
|
export const GidsMatrixTableBodyDom = ({
|
|
44
65
|
width = 'full',
|
|
45
66
|
tableBodyItems = [],
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
DomNodeOrString,
|
|
9
9
|
} from '../../utils/domUtils.js';
|
|
10
10
|
import { GidsHeadingDom } from '../GidsHeading/GidsHeading.js';
|
|
11
|
+
import { GidsDividerDom } from '../GidsDivider/GidsDivider.js';
|
|
11
12
|
|
|
12
13
|
const { getGidsMenuClassNames } = GidsMenuWebUtils;
|
|
13
14
|
|
|
@@ -24,6 +25,7 @@ export const GidsMenuDom = ({
|
|
|
24
25
|
heading,
|
|
25
26
|
supportingText,
|
|
26
27
|
supportingTextTypography,
|
|
28
|
+
isHeaderDividerVisible = false,
|
|
27
29
|
...restProps
|
|
28
30
|
}: GidsMenuDomProps): HTMLDivElement => {
|
|
29
31
|
const menu = document.createElement('div');
|
|
@@ -45,6 +47,19 @@ export const GidsMenuDom = ({
|
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
if (isHeaderDividerVisible) {
|
|
51
|
+
const dividerContainer = document.createElement('div');
|
|
52
|
+
dividerContainer.className = 'gids-menu__header-divider';
|
|
53
|
+
|
|
54
|
+
dividerContainer.append(
|
|
55
|
+
GidsDividerDom({
|
|
56
|
+
orientation: 'horizontal',
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
menu.append(dividerContainer);
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
if (children !== undefined && children !== null) {
|
|
49
64
|
const childrenContainer = document.createElement('div');
|
|
50
65
|
childrenContainer.className = 'gids-menu__children';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsProfileWebProps,
|
|
3
|
+
GidsProfileWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
import {
|
|
6
|
+
IconAppearance,
|
|
7
|
+
IconName,
|
|
8
|
+
} from '@ganpatiinfo/gids-web-theme-interface';
|
|
9
|
+
|
|
10
|
+
const { getGidsProfileClassNames } = GidsProfileWebUtils;
|
|
11
|
+
|
|
12
|
+
export type GidsProfileBaseWebProps = GidsProfileWebProps<
|
|
13
|
+
Event,
|
|
14
|
+
IconName,
|
|
15
|
+
IconAppearance,
|
|
16
|
+
string
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
type GidsProfileElement = HTMLElement & GidsProfileBaseWebProps;
|
|
20
|
+
|
|
21
|
+
export interface GidsProfileDomProps extends GidsProfileBaseWebProps {
|
|
22
|
+
extraClasses?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const GidsProfileDom = ({
|
|
26
|
+
id,
|
|
27
|
+
menuId,
|
|
28
|
+
profileControlAppearance = 'default',
|
|
29
|
+
profileControlAvatarProps,
|
|
30
|
+
profileControlAvatarVisible = true,
|
|
31
|
+
profileControlAvatarBadgeVisible = true,
|
|
32
|
+
profileControlBorderRadius = 'none',
|
|
33
|
+
profileControlLeadingIcon,
|
|
34
|
+
profileControlShadow = 'none',
|
|
35
|
+
profileControlSupportingText,
|
|
36
|
+
profileControlTitle,
|
|
37
|
+
profileControlTrailingIcon,
|
|
38
|
+
profileMenuItems = [],
|
|
39
|
+
headerDividerVisible = false,
|
|
40
|
+
headerVisible = false,
|
|
41
|
+
headerItem,
|
|
42
|
+
expanded = false,
|
|
43
|
+
listSectionDividerVisible = false,
|
|
44
|
+
profileControlLeadingIconSize = 'sm',
|
|
45
|
+
profileControlTrailingIconSize = 'sm',
|
|
46
|
+
profileControlLeadingIconAppearance = 'filled',
|
|
47
|
+
profileControlTrailingIconAppearance = 'filled',
|
|
48
|
+
onHeaderAvatarPress,
|
|
49
|
+
onHeaderSupportingTextPress,
|
|
50
|
+
onHeaderTitlePress,
|
|
51
|
+
onProfileMenuItemPress,
|
|
52
|
+
onPressProfileControl,
|
|
53
|
+
extraClasses,
|
|
54
|
+
}: GidsProfileDomProps): HTMLElement => {
|
|
55
|
+
const profile = document.createElement('gids-profile') as GidsProfileElement;
|
|
56
|
+
|
|
57
|
+
profile.setAttribute('id', id);
|
|
58
|
+
|
|
59
|
+
if (expanded) {
|
|
60
|
+
profile.setAttribute('menu-expanded', 'true');
|
|
61
|
+
} else {
|
|
62
|
+
profile.removeAttribute('menu-expanded');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
profile.id = id;
|
|
66
|
+
profile.menuId = menuId;
|
|
67
|
+
profile.expanded = expanded;
|
|
68
|
+
profile.profileControlAppearance = profileControlAppearance;
|
|
69
|
+
profile.profileControlBorderRadius = profileControlBorderRadius;
|
|
70
|
+
profile.profileControlShadow = profileControlShadow;
|
|
71
|
+
profile.profileControlAvatarProps = profileControlAvatarProps;
|
|
72
|
+
profile.profileControlAvatarVisible = profileControlAvatarVisible;
|
|
73
|
+
profile.profileControlLeadingIcon = profileControlLeadingIcon;
|
|
74
|
+
profile.profileControlLeadingIconSize = profileControlLeadingIconSize;
|
|
75
|
+
profile.profileControlTrailingIconSize = profileControlTrailingIconSize;
|
|
76
|
+
profile.profileControlLeadingIconAppearance =
|
|
77
|
+
profileControlLeadingIconAppearance;
|
|
78
|
+
profile.profileControlTrailingIconAppearance =
|
|
79
|
+
profileControlTrailingIconAppearance;
|
|
80
|
+
profile.profileControlSupportingText = profileControlSupportingText;
|
|
81
|
+
profile.profileControlTitle = profileControlTitle;
|
|
82
|
+
profile.profileControlTrailingIcon = profileControlTrailingIcon;
|
|
83
|
+
profile.profileMenuItems = profileMenuItems;
|
|
84
|
+
profile.headerDividerVisible = headerDividerVisible;
|
|
85
|
+
profile.headerVisible = headerVisible;
|
|
86
|
+
profile.headerItem = headerItem;
|
|
87
|
+
profile.listSectionDividerVisible = listSectionDividerVisible;
|
|
88
|
+
profile.profileControlAvatarBadgeVisible = profileControlAvatarBadgeVisible;
|
|
89
|
+
|
|
90
|
+
profile.className = getGidsProfileClassNames(
|
|
91
|
+
{
|
|
92
|
+
profileControlAppearance,
|
|
93
|
+
profileControlBorderRadius,
|
|
94
|
+
profileControlShadow,
|
|
95
|
+
},
|
|
96
|
+
extraClasses,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
if (onHeaderAvatarPress) {
|
|
100
|
+
profile.onHeaderAvatarPress = onHeaderAvatarPress;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (onHeaderTitlePress) {
|
|
104
|
+
profile.onHeaderTitlePress = onHeaderTitlePress;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (onHeaderSupportingTextPress) {
|
|
108
|
+
profile.onHeaderSupportingTextPress = onHeaderSupportingTextPress;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (onProfileMenuItemPress) {
|
|
112
|
+
profile.onProfileMenuItemPress = onProfileMenuItemPress;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (onPressProfileControl) {
|
|
116
|
+
profile.onPressProfileControl = onPressProfileControl;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return profile;
|
|
120
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GidsProfileMenuWebProps,
|
|
3
|
+
GidsProfileMenuWebUtils,
|
|
4
|
+
} from '@ganpatiinfo/gids-web-shared';
|
|
5
|
+
|
|
6
|
+
const { getGidsProfileMenuClassNames } = GidsProfileMenuWebUtils;
|
|
7
|
+
|
|
8
|
+
export type GidsProfileMenuBaseWebProps = GidsProfileMenuWebProps<
|
|
9
|
+
Event,
|
|
10
|
+
string
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
type GidsProfileMenuElement = HTMLElement & GidsProfileMenuBaseWebProps;
|
|
14
|
+
|
|
15
|
+
export interface GidsProfileMenuDomProps extends GidsProfileMenuBaseWebProps {
|
|
16
|
+
extraClasses?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const GidsProfileMenuDom = ({
|
|
20
|
+
headerItem,
|
|
21
|
+
headerVisible = false,
|
|
22
|
+
profileMenuItems = [],
|
|
23
|
+
listSectionDividerVisible = false,
|
|
24
|
+
headerDividerVisible = true,
|
|
25
|
+
onHeaderAvatarPress,
|
|
26
|
+
onHeaderTitlePress,
|
|
27
|
+
onHeaderSupportingTextPress,
|
|
28
|
+
onProfileMenuItemPress,
|
|
29
|
+
extraClasses,
|
|
30
|
+
}: GidsProfileMenuDomProps): HTMLElement => {
|
|
31
|
+
const profileMenu = document.createElement(
|
|
32
|
+
'gids-profile-menu',
|
|
33
|
+
) as GidsProfileMenuElement;
|
|
34
|
+
|
|
35
|
+
profileMenu.headerItem = headerItem;
|
|
36
|
+
profileMenu.headerVisible = headerVisible;
|
|
37
|
+
profileMenu.profileMenuItems = profileMenuItems;
|
|
38
|
+
profileMenu.listSectionDividerVisible = listSectionDividerVisible;
|
|
39
|
+
profileMenu.headerDividerVisible = headerDividerVisible;
|
|
40
|
+
|
|
41
|
+
profileMenu.className = getGidsProfileMenuClassNames(extraClasses);
|
|
42
|
+
|
|
43
|
+
if (onHeaderAvatarPress) {
|
|
44
|
+
profileMenu.onHeaderAvatarPress = onHeaderAvatarPress;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (onHeaderTitlePress) {
|
|
48
|
+
profileMenu.onHeaderTitlePress = onHeaderTitlePress;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (onHeaderSupportingTextPress) {
|
|
52
|
+
profileMenu.onHeaderSupportingTextPress = onHeaderSupportingTextPress;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (onProfileMenuItemPress) {
|
|
56
|
+
profileMenu.onProfileMenuItemPress = onProfileMenuItemPress;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return profileMenu;
|
|
60
|
+
};
|