@db-ux/react-core-components 3.0.2-copilot2-e7bf98b → 3.0.2-shell2-badc28f
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/README.md +0 -11
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/checkbox/checkbox.d.ts +4 -1
- package/dist/components/checkbox/checkbox.js +2 -2
- package/dist/components/control-panel-brand/control-panel-brand.d.ts +3 -0
- package/dist/components/control-panel-brand/control-panel-brand.js +15 -0
- package/dist/components/control-panel-brand/index.d.ts +1 -0
- package/dist/components/control-panel-brand/index.js +1 -0
- package/dist/components/control-panel-brand/model.d.ts +5 -0
- package/dist/components/control-panel-desktop/control-panel-desktop.d.ts +3 -0
- package/dist/components/control-panel-desktop/control-panel-desktop.js +62 -0
- package/dist/components/control-panel-desktop/index.d.ts +1 -0
- package/dist/components/control-panel-desktop/index.js +1 -0
- package/dist/components/control-panel-desktop/model.d.ts +7 -0
- package/dist/components/control-panel-flat-icon-navigation/control-panel-flat-icon-navigation.d.ts +3 -0
- package/dist/components/control-panel-flat-icon-navigation/control-panel-flat-icon-navigation.js +26 -0
- package/dist/components/control-panel-flat-icon-navigation/index.d.ts +1 -0
- package/dist/components/control-panel-flat-icon-navigation/index.js +1 -0
- package/dist/components/control-panel-flat-icon-navigation/model.d.ts +7 -0
- package/dist/components/control-panel-flat-icon-navigation/model.js +1 -0
- package/dist/components/control-panel-meta-navigation/control-panel-meta-navigation.d.ts +3 -0
- package/dist/components/control-panel-meta-navigation/control-panel-meta-navigation.js +11 -0
- package/dist/components/control-panel-meta-navigation/index.d.ts +1 -0
- package/dist/components/control-panel-meta-navigation/index.js +1 -0
- package/dist/components/control-panel-meta-navigation/model.d.ts +5 -0
- package/dist/components/control-panel-meta-navigation/model.js +1 -0
- package/dist/components/control-panel-mobile/control-panel-mobile.d.ts +3 -0
- package/dist/components/control-panel-mobile/control-panel-mobile.js +41 -0
- package/dist/components/control-panel-mobile/index.d.ts +1 -0
- package/dist/components/control-panel-mobile/index.js +1 -0
- package/dist/components/control-panel-mobile/model.d.ts +30 -0
- package/dist/components/control-panel-mobile/model.js +1 -0
- package/dist/components/control-panel-primary-actions/control-panel-primary-actions.d.ts +3 -0
- package/dist/components/control-panel-primary-actions/control-panel-primary-actions.js +11 -0
- package/dist/components/control-panel-primary-actions/index.d.ts +1 -0
- package/dist/components/control-panel-primary-actions/index.js +1 -0
- package/dist/components/control-panel-primary-actions/model.d.ts +5 -0
- package/dist/components/control-panel-primary-actions/model.js +1 -0
- package/dist/components/control-panel-secondary-actions/control-panel-secondary-actions.d.ts +3 -0
- package/dist/components/control-panel-secondary-actions/control-panel-secondary-actions.js +11 -0
- package/dist/components/control-panel-secondary-actions/index.d.ts +1 -0
- package/dist/components/control-panel-secondary-actions/index.js +1 -0
- package/dist/components/control-panel-secondary-actions/model.d.ts +5 -0
- package/dist/components/control-panel-secondary-actions/model.js +1 -0
- package/dist/components/custom-select/custom-select.d.ts +4 -1
- package/dist/components/custom-select/custom-select.js +7 -7
- package/dist/components/custom-select/model.d.ts +4 -1
- package/dist/components/custom-select-list-item/custom-select-list-item.d.ts +4 -1
- package/dist/components/drawer/drawer.js +4 -4
- package/dist/components/drawer/model.d.ts +5 -1
- package/dist/components/drawer/model.js +1 -1
- package/dist/components/input/input.d.ts +4 -1
- package/dist/components/input/input.js +2 -2
- package/dist/components/navigation/model.d.ts +14 -5
- package/dist/components/navigation/navigation.d.ts +1 -1
- package/dist/components/navigation/navigation.js +96 -6
- package/dist/components/navigation-item/model.d.ts +9 -24
- package/dist/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/components/navigation-item/navigation-item.js +8 -67
- package/dist/components/navigation-item-group/index.d.ts +1 -0
- package/dist/components/navigation-item-group/index.js +1 -0
- package/dist/components/navigation-item-group/model.d.ts +26 -0
- package/dist/components/navigation-item-group/model.js +1 -0
- package/dist/components/navigation-item-group/navigation-item-group.d.ts +3 -0
- package/dist/components/navigation-item-group/navigation-item-group.js +100 -0
- package/dist/components/popover/popover.js +1 -2
- package/dist/components/radio/radio.d.ts +4 -1
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/select.js +2 -2
- package/dist/components/shell/index.d.ts +1 -0
- package/dist/components/shell/index.js +1 -0
- package/dist/components/shell/model.d.ts +50 -0
- package/dist/components/shell/model.js +1 -0
- package/dist/components/shell/shell.d.ts +3 -0
- package/dist/components/{page/page.js → shell/shell.js} +9 -28
- package/dist/components/shell-sub-navigation/index.d.ts +1 -0
- package/dist/components/shell-sub-navigation/index.js +1 -0
- package/dist/components/shell-sub-navigation/model.d.ts +5 -0
- package/dist/components/shell-sub-navigation/model.js +1 -0
- package/dist/components/shell-sub-navigation/shell-sub-navigation.d.ts +3 -0
- package/dist/components/shell-sub-navigation/shell-sub-navigation.js +45 -0
- package/dist/components/switch/switch.d.ts +4 -1
- package/dist/components/tabs/model.d.ts +3 -11
- package/dist/components/tabs/tabs.d.ts +1 -1
- package/dist/components/tabs/tabs.js +3 -3
- package/dist/components/textarea/textarea.d.ts +4 -1
- package/dist/components/textarea/textarea.js +2 -2
- package/dist/components/tooltip/tooltip.js +2 -3
- package/dist/index.d.ts +19 -6
- package/dist/index.js +19 -6
- package/dist/shared/constants.d.ts +3 -0
- package/dist/shared/constants.js +3 -0
- package/dist/shared/model.d.ts +82 -3
- package/dist/shared/model.js +3 -0
- package/dist/utils/floating-components.d.ts +17 -1
- package/dist/utils/floating-components.js +76 -48
- package/dist/utils/navigation.d.ts +2 -6
- package/dist/utils/navigation.js +34 -22
- package/package.json +4 -6
- package/agent/Accordion.md +0 -47
- package/agent/AccordionItem.md +0 -36
- package/agent/Badge.md +0 -43
- package/agent/Brand.md +0 -24
- package/agent/Button.md +0 -60
- package/agent/Card.md +0 -34
- package/agent/Checkbox.md +0 -41
- package/agent/CustomSelect.md +0 -81
- package/agent/Divider.md +0 -32
- package/agent/Drawer.md +0 -87
- package/agent/Header.md +0 -45
- package/agent/Icon.md +0 -31
- package/agent/Infotext.md +0 -36
- package/agent/Input.md +0 -50
- package/agent/Link.md +0 -63
- package/agent/Navigation.md +0 -31
- package/agent/NavigationItem.md +0 -34
- package/agent/Notification.md +0 -45
- package/agent/Page.md +0 -36
- package/agent/Popover.md +0 -55
- package/agent/Radio.md +0 -34
- package/agent/Section.md +0 -32
- package/agent/Select.md +0 -90
- package/agent/Stack.md +0 -46
- package/agent/Switch.md +0 -41
- package/agent/TabItem.md +0 -34
- package/agent/Tabs.md +0 -75
- package/agent/Tag.md +0 -56
- package/agent/Textarea.md +0 -45
- package/agent/Tooltip.md +0 -47
- package/agent/_instructions.md +0 -31
- package/dist/components/brand/brand.d.ts +0 -3
- package/dist/components/brand/brand.js +0 -13
- package/dist/components/brand/index.d.ts +0 -1
- package/dist/components/brand/index.js +0 -1
- package/dist/components/brand/model.d.ts +0 -10
- package/dist/components/header/header.d.ts +0 -3
- package/dist/components/header/header.js +0 -67
- package/dist/components/header/index.d.ts +0 -1
- package/dist/components/header/index.js +0 -1
- package/dist/components/header/model.d.ts +0 -44
- package/dist/components/page/index.d.ts +0 -1
- package/dist/components/page/index.js +0 -1
- package/dist/components/page/model.d.ts +0 -36
- package/dist/components/page/model.js +0 -2
- package/dist/components/page/page.d.ts +0 -3
- /package/dist/components/{brand → control-panel-brand}/model.js +0 -0
- /package/dist/components/{header → control-panel-desktop}/model.js +0 -0
|
@@ -60,9 +60,11 @@ export const handleDataOutside = (el) => {
|
|
|
60
60
|
return dataOutsidePair;
|
|
61
61
|
};
|
|
62
62
|
export const handleFixedDropdown = (element, parent, placement) => {
|
|
63
|
-
// We skip this if we are in mobile it's already fixed
|
|
64
|
-
|
|
63
|
+
// We skip this if we are in mobile it's already fixed or if we don't have a floating dropdown
|
|
64
|
+
const computedStyle = getComputedStyle(element);
|
|
65
|
+
if (computedStyle.zIndex === '9999' || computedStyle.position !== 'fixed' && computedStyle.position !== 'absolute') {
|
|
65
66
|
return;
|
|
67
|
+
}
|
|
66
68
|
const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement } = getFloatingProps(element, parent, placement);
|
|
67
69
|
const fullWidth = element.dataset['width'] === 'full';
|
|
68
70
|
if (fullWidth) {
|
|
@@ -104,27 +106,29 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
104
106
|
let childHeight = childRect.height;
|
|
105
107
|
let childWidth = childRect.width;
|
|
106
108
|
if (placement === 'bottom' || placement === 'top') {
|
|
107
|
-
childWidth = childWidth / 2;
|
|
109
|
+
childWidth = width > childWidth ? 0 : childWidth / 2;
|
|
108
110
|
}
|
|
109
111
|
if (placement === 'left' || placement === 'right') {
|
|
110
|
-
childHeight = childHeight / 2;
|
|
112
|
+
childHeight = height > childHeight ? 0 : childHeight / 2;
|
|
111
113
|
}
|
|
112
|
-
const outsideBottom = bottom + childHeight > innerHeight;
|
|
113
|
-
const outsideTop = top - childHeight < 0;
|
|
114
|
-
const outsideLeft = left - childWidth < 0;
|
|
115
|
-
const outsideRight = right + childWidth > innerWidth;
|
|
114
|
+
const outsideBottom = Math.floor(bottom + childHeight) > innerHeight;
|
|
115
|
+
const outsideTop = Math.ceil(top - childHeight) < 0;
|
|
116
|
+
const outsideLeft = Math.ceil(left - childWidth) < 0;
|
|
117
|
+
const outsideRight = Math.floor(right + childWidth) > innerWidth;
|
|
116
118
|
let correctedPlacement = placement;
|
|
117
119
|
if (placement.startsWith('bottom')) {
|
|
118
120
|
if (outsideBottom) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
if (!outsideTop) {
|
|
122
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('bottom', 'top');
|
|
123
|
+
if (outsideLeft && outsideRight) {
|
|
124
|
+
correctedPlacement = 'top';
|
|
125
|
+
}
|
|
126
|
+
else if (outsideLeft) {
|
|
127
|
+
correctedPlacement = 'top-start';
|
|
128
|
+
}
|
|
129
|
+
else if (outsideRight) {
|
|
130
|
+
correctedPlacement = 'top-end';
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
134
|
else {
|
|
@@ -141,15 +145,17 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
141
145
|
}
|
|
142
146
|
else if (placement.startsWith('top')) {
|
|
143
147
|
if (outsideTop) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
if (!outsideBottom) {
|
|
149
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('top', 'bottom');
|
|
150
|
+
if (outsideLeft && outsideRight) {
|
|
151
|
+
correctedPlacement = 'bottom';
|
|
152
|
+
}
|
|
153
|
+
else if (outsideLeft) {
|
|
154
|
+
correctedPlacement = 'bottom-start';
|
|
155
|
+
}
|
|
156
|
+
else if (outsideRight) {
|
|
157
|
+
correctedPlacement = 'bottom-end';
|
|
158
|
+
}
|
|
153
159
|
}
|
|
154
160
|
}
|
|
155
161
|
else {
|
|
@@ -166,15 +172,17 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
166
172
|
}
|
|
167
173
|
else if (placement.startsWith('left')) {
|
|
168
174
|
if (outsideLeft) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
if (outsideRight) {
|
|
176
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('left', 'right');
|
|
177
|
+
if (outsideBottom && outsideTop) {
|
|
178
|
+
correctedPlacement = 'right';
|
|
179
|
+
}
|
|
180
|
+
else if (outsideBottom) {
|
|
181
|
+
correctedPlacement = 'right-end';
|
|
182
|
+
}
|
|
183
|
+
else if (outsideTop) {
|
|
184
|
+
correctedPlacement = 'right-start';
|
|
185
|
+
}
|
|
178
186
|
}
|
|
179
187
|
}
|
|
180
188
|
else {
|
|
@@ -191,15 +199,17 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
191
199
|
}
|
|
192
200
|
else if (correctedPlacement.startsWith('right')) {
|
|
193
201
|
if (outsideRight) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
if (!outsideLeft) {
|
|
203
|
+
correctedPlacement = placement === null || placement === void 0 ? void 0 : placement.replace('right', 'left');
|
|
204
|
+
if (outsideBottom && outsideTop) {
|
|
205
|
+
correctedPlacement = 'left';
|
|
206
|
+
}
|
|
207
|
+
else if (outsideBottom) {
|
|
208
|
+
correctedPlacement = 'left-end';
|
|
209
|
+
}
|
|
210
|
+
else if (outsideTop) {
|
|
211
|
+
correctedPlacement = 'left-start';
|
|
212
|
+
}
|
|
203
213
|
}
|
|
204
214
|
}
|
|
205
215
|
else {
|
|
@@ -225,13 +235,24 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
225
235
|
childWidth: childRect.width,
|
|
226
236
|
correctedPlacement,
|
|
227
237
|
innerWidth,
|
|
228
|
-
innerHeight
|
|
238
|
+
innerHeight,
|
|
239
|
+
outsideYBoth: outsideTop && outsideBottom,
|
|
240
|
+
outsideXBoth: outsideRight && outsideLeft
|
|
229
241
|
};
|
|
230
242
|
};
|
|
231
243
|
export const handleFixedPopover = (element, parent, placement) => {
|
|
232
|
-
var _a;
|
|
233
|
-
const
|
|
234
|
-
|
|
244
|
+
var _a, _b, _c;
|
|
245
|
+
const computedStyle = getComputedStyle(element);
|
|
246
|
+
// We skip if we don't have a floating popover
|
|
247
|
+
if (computedStyle.position !== 'fixed' && computedStyle.position !== 'absolute') {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
let distance = computedStyle.getPropertyValue('--db-popover-distance');
|
|
251
|
+
if (!distance.length) {
|
|
252
|
+
distance = '0px';
|
|
253
|
+
}
|
|
254
|
+
const elementPlacement = (_c = (_b = (_a = element === null || element === void 0 ? void 0 : element.dataset) === null || _a === void 0 ? void 0 : _a['placement']) !== null && _b !== void 0 ? _b : placement) !== null && _c !== void 0 ? _c : 'bottom';
|
|
255
|
+
const { top, height, width, childHeight, childWidth, right, left, bottom, correctedPlacement, innerWidth, innerHeight, outsideYBoth } = getFloatingProps(element, parent, elementPlacement);
|
|
235
256
|
// Tooltip arrow position
|
|
236
257
|
if (childWidth > width && (correctedPlacement.startsWith('bottom') || correctedPlacement.startsWith('top'))) {
|
|
237
258
|
const diff = width / 2 / childWidth * 100;
|
|
@@ -300,6 +321,13 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
300
321
|
element.style.insetBlockStart = `calc(${bottom}px + ${distance})`;
|
|
301
322
|
element.style.insetBlockEnd = `calc(${end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
302
323
|
}
|
|
324
|
+
// In this case we are outside of top and bottom so we need to scroll
|
|
325
|
+
// We use the full height in this case
|
|
326
|
+
if (outsideYBoth) {
|
|
327
|
+
element.style.overflow = 'hidden auto';
|
|
328
|
+
element.style.insetBlock = distance;
|
|
329
|
+
element.style.maxBlockSize = `calc(${innerHeight}px - 2 * ${distance})`;
|
|
330
|
+
}
|
|
303
331
|
element.style.position = 'fixed';
|
|
304
332
|
element.dataset['correctedPlacement'] = correctedPlacement;
|
|
305
333
|
};
|
|
@@ -23,10 +23,6 @@ export declare class NavigationItemSafeTriangle {
|
|
|
23
23
|
private getTriangleTipY;
|
|
24
24
|
private hasMouseEnteredSubNavigation;
|
|
25
25
|
private getTriangleCoordinates;
|
|
26
|
-
followByMouseEvent(event:
|
|
26
|
+
followByMouseEvent(event: any): void;
|
|
27
27
|
}
|
|
28
|
-
declare const
|
|
29
|
-
isEventTargetNavigationItem: (event: unknown) => boolean;
|
|
30
|
-
NavigationItemSafeTriangle: typeof NavigationItemSafeTriangle;
|
|
31
|
-
};
|
|
32
|
-
export default _default;
|
|
28
|
+
export declare const handleSubNavigationPosition: (element: HTMLElement, level?: number) => void;
|
package/dist/utils/navigation.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { handleDataOutside } from './floating-components';
|
|
1
|
+
import { handleDataOutside, handleFixedPopover } from './floating-components';
|
|
2
2
|
export const isEventTargetNavigationItem = (event) => {
|
|
3
|
-
var _a
|
|
3
|
+
var _a;
|
|
4
4
|
const { target } = event;
|
|
5
|
-
return Boolean(
|
|
5
|
+
return Boolean((_a = target === null || target === void 0 ? void 0 : target.parentElement) === null || _a === void 0 ? void 0 : _a.classList.contains('db-navigation-item'));
|
|
6
6
|
};
|
|
7
7
|
export class NavigationItemSafeTriangle {
|
|
8
8
|
constructor(element, subNavigation) {
|
|
9
|
-
var _a;
|
|
9
|
+
var _a, _b;
|
|
10
10
|
this.parentSubNavigation = null;
|
|
11
11
|
this.initialized = false;
|
|
12
12
|
this.mouseX = 0;
|
|
@@ -16,13 +16,12 @@ export class NavigationItemSafeTriangle {
|
|
|
16
16
|
if (!this.element || !this.subNavigation) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
this.parentSubNavigation = (_a = this.element) === null || _a === void 0 ? void 0 : _a.closest('.db-
|
|
19
|
+
this.parentSubNavigation = (_b = (_a = this.element) === null || _a === void 0 ? void 0 : _a.closest('.db-navigation-item-group-menu')) !== null && _b !== void 0 ? _b : this.element;
|
|
20
20
|
/*
|
|
21
21
|
* only initiate if:
|
|
22
|
-
* 1. item is not at root navigation level
|
|
23
22
|
* 2. item is not in the mobile navigation / within db-drawer
|
|
24
23
|
*/
|
|
25
|
-
if (
|
|
24
|
+
if (!this.element.closest('.db-drawer')) {
|
|
26
25
|
this.init();
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -88,20 +87,10 @@ export class NavigationItemSafeTriangle {
|
|
|
88
87
|
}
|
|
89
88
|
return false;
|
|
90
89
|
}
|
|
91
|
-
getTriangleCoordinates(
|
|
90
|
+
getTriangleCoordinates() {
|
|
92
91
|
if (!this.triangleData) {
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
|
-
if (variant === 'fill-gap') {
|
|
96
|
-
const itemHeight = `${this.triangleData.itemRect.height + 2 * this.triangleData.padding}px`;
|
|
97
|
-
const xStart = `${this.triangleData.parentElementWidth - this.triangleData.padding}px`;
|
|
98
|
-
return {
|
|
99
|
-
lb: `${xStart} ${itemHeight}`,
|
|
100
|
-
lt: `${xStart} 0`,
|
|
101
|
-
rt: '100% 0',
|
|
102
|
-
rb: `100% ${itemHeight}`
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
94
|
const tipX = this.getTriangleTipX();
|
|
106
95
|
const tipY = this.getTriangleTipY();
|
|
107
96
|
const lb = `${tipX}px ${tipY}px`;
|
|
@@ -120,7 +109,7 @@ export class NavigationItemSafeTriangle {
|
|
|
120
109
|
this.mouseX = event.clientX - this.triangleData.itemRect.left;
|
|
121
110
|
this.mouseY = event.clientY - this.triangleData.itemRect.top;
|
|
122
111
|
const isOverSubNavigation = this.hasMouseEnteredSubNavigation();
|
|
123
|
-
const coordinates = this.getTriangleCoordinates(
|
|
112
|
+
const coordinates = this.getTriangleCoordinates();
|
|
124
113
|
if (!coordinates) {
|
|
125
114
|
return;
|
|
126
115
|
}
|
|
@@ -130,7 +119,30 @@ export class NavigationItemSafeTriangle {
|
|
|
130
119
|
}
|
|
131
120
|
}
|
|
132
121
|
}
|
|
133
|
-
export
|
|
134
|
-
|
|
135
|
-
|
|
122
|
+
export const handleSubNavigationPosition = (element, level = 0) => {
|
|
123
|
+
for (const navItem of Array.from(element.querySelectorAll('.db-navigation-item-group'))) {
|
|
124
|
+
const subNavigation = navItem.querySelector('.db-navigation-item-group-menu');
|
|
125
|
+
const button = navItem.querySelector('.db-navigation-item-group-expand-button');
|
|
126
|
+
if (subNavigation && button) {
|
|
127
|
+
/*
|
|
128
|
+
* This is set via css inside:
|
|
129
|
+
* `packages/components/src/components/navigation-item-group/navigation-item-group-menu-popover.scss`.
|
|
130
|
+
* We don't need to calculate the position of the menu as a popover.
|
|
131
|
+
*/
|
|
132
|
+
const isMobile = getComputedStyle(subNavigation).getPropertyValue('--db-navigation-item-group-menu-mobile');
|
|
133
|
+
if (isMobile)
|
|
134
|
+
return;
|
|
135
|
+
if (level > 0 || subNavigation.dataset['open'] === 'horizontal') {
|
|
136
|
+
// Sub-Navigation should be opened horizontal
|
|
137
|
+
handleFixedPopover(subNavigation, button, 'right-start');
|
|
138
|
+
subNavigation.dataset['open'] = 'horizontal';
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
// Sub-Navigation should be opened vertical
|
|
142
|
+
handleFixedPopover(subNavigation, button, 'bottom-start');
|
|
143
|
+
subNavigation.dataset['open'] = 'vertical';
|
|
144
|
+
}
|
|
145
|
+
handleSubNavigationPosition(subNavigation, level + 1);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
136
148
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/react-core-components",
|
|
3
|
-
"version": "3.0.2-
|
|
3
|
+
"version": "3.0.2-shell2-badc28f",
|
|
4
4
|
"description": "React components for @db-ux/core-components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,13 +11,11 @@
|
|
|
11
11
|
"module": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"files": [
|
|
14
|
-
"dist/"
|
|
15
|
-
"agent"
|
|
14
|
+
"dist/"
|
|
16
15
|
],
|
|
17
16
|
"scripts": {
|
|
18
17
|
"build": "npm-run-all tsc",
|
|
19
18
|
"mv:dist": "cpr dist ../../build-outputs/react/dist --overwrite",
|
|
20
|
-
"mv:agent": "cpr agent ../../build-outputs/react/agent -o",
|
|
21
19
|
"mv:package.json": "cpr package.json ../../build-outputs/react/package.json --overwrite",
|
|
22
20
|
"mv:readme": "cpr README.md ../../build-outputs/react/README.md --overwrite",
|
|
23
21
|
"open:report": "npx playwright show-report",
|
|
@@ -40,7 +38,7 @@
|
|
|
40
38
|
},
|
|
41
39
|
"sideEffects": false,
|
|
42
40
|
"dependencies": {
|
|
43
|
-
"@db-ux/core-components": "3.0.2-
|
|
44
|
-
"@db-ux/core-foundations": "3.0.2-
|
|
41
|
+
"@db-ux/core-components": "3.0.2-shell2-badc28f",
|
|
42
|
+
"@db-ux/core-foundations": "3.0.2-shell2-badc28f"
|
|
45
43
|
}
|
|
46
44
|
}
|
package/agent/Accordion.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Accordion Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBAccordion } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Accordion(props: any) {
|
|
10
|
-
function getItems() {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
text: "Item 1 Content",
|
|
14
|
-
headlinePlain: "Item 1",
|
|
15
|
-
disabled: false,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
text: "Item 2 Content",
|
|
19
|
-
headlinePlain: "Item 2",
|
|
20
|
-
disabled: true,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<h1>DBAccordion Documentation Examples</h1>
|
|
28
|
-
<h2>1. Default Accordion</h2>
|
|
29
|
-
<DBAccordion>Default Accordion</DBAccordion>
|
|
30
|
-
<h2>2. Behavior Variants</h2>
|
|
31
|
-
<DBAccordion behavior="multiple">Multiple Behavior</DBAccordion>
|
|
32
|
-
<DBAccordion behavior="single">Single Behavior</DBAccordion>
|
|
33
|
-
<h2>3. Initial Open Index</h2>
|
|
34
|
-
<DBAccordion initOpenIndex={[0, 1]}>Initial Open Index</DBAccordion>
|
|
35
|
-
<h2>4. Items</h2>
|
|
36
|
-
<DBAccordion items={getItems()}>Accordion with Items</DBAccordion>
|
|
37
|
-
<h2>5. Name Attribute</h2>
|
|
38
|
-
<DBAccordion name="accordion-name">With Name</DBAccordion>
|
|
39
|
-
<h2>6. Variant Types</h2>
|
|
40
|
-
<DBAccordion variant="divider">Divider Variant</DBAccordion>
|
|
41
|
-
<DBAccordion variant="card">Card Variant</DBAccordion>
|
|
42
|
-
</>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default Accordion;
|
|
47
|
-
```
|
package/agent/AccordionItem.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# AccordionItem Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBAccordionItem } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function AccordionItem(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBAccordionItem Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Accordion Item</h2>
|
|
14
|
-
<DBAccordionItem>Default Accordion Item</DBAccordionItem>
|
|
15
|
-
<h2>2. Initial State</h2>
|
|
16
|
-
<DBAccordionItem defaultOpen>Initially Open</DBAccordionItem>
|
|
17
|
-
<DBAccordionItem defaultOpen={false}>Initially Closed</DBAccordionItem>
|
|
18
|
-
<h2>3. Disabled State</h2>
|
|
19
|
-
<DBAccordionItem disabled>Disabled Accordion Item</DBAccordionItem>
|
|
20
|
-
<h2>4. Headline Variants</h2>
|
|
21
|
-
<DBAccordionItem headline={<strong>Custom Headline</strong>}>
|
|
22
|
-
With Custom Headline
|
|
23
|
-
</DBAccordionItem>
|
|
24
|
-
<DBAccordionItem headlinePlain="Plain Headline">
|
|
25
|
-
With Plain Headline
|
|
26
|
-
</DBAccordionItem>
|
|
27
|
-
<h2>5. Toggle Event</h2>
|
|
28
|
-
<DBAccordionItem onToggle={(open) => console.log("Toggled:", open)}>
|
|
29
|
-
With Toggle Event
|
|
30
|
-
</DBAccordionItem>
|
|
31
|
-
</>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default AccordionItem;
|
|
36
|
-
```
|
package/agent/Badge.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Badge Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBBadge } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Badge(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBBadge Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Badge</h2>
|
|
14
|
-
<DBBadge>Default Badge</DBBadge>
|
|
15
|
-
<h2>2. Semantic Variants</h2>
|
|
16
|
-
<DBBadge semantic="adaptive">Adaptive</DBBadge>
|
|
17
|
-
<DBBadge semantic="neutral">Neutral</DBBadge>
|
|
18
|
-
<DBBadge semantic="critical">Critical</DBBadge>
|
|
19
|
-
<DBBadge semantic="informational">Informational</DBBadge>
|
|
20
|
-
<DBBadge semantic="warning">Warning</DBBadge>
|
|
21
|
-
<DBBadge semantic="successful">Successful</DBBadge>
|
|
22
|
-
<h2>3. Sizes</h2>
|
|
23
|
-
<DBBadge size="small">Small</DBBadge>
|
|
24
|
-
<DBBadge size="medium">Medium</DBBadge>
|
|
25
|
-
<h2>4. Emphasis Variants</h2>
|
|
26
|
-
<DBBadge emphasis="weak">Weak Emphasis</DBBadge>
|
|
27
|
-
<DBBadge emphasis="strong">Strong Emphasis</DBBadge>
|
|
28
|
-
<h2>5. Placement Variants</h2>
|
|
29
|
-
<DBBadge placement="inline">Inline</DBBadge>
|
|
30
|
-
<DBBadge placement="corner-top-left">Corner Top Left</DBBadge>
|
|
31
|
-
<DBBadge placement="corner-top-right">Corner Top Right</DBBadge>
|
|
32
|
-
<DBBadge placement="corner-center-left">Corner Center Left</DBBadge>
|
|
33
|
-
<DBBadge placement="corner-center-right">Corner Center Right</DBBadge>
|
|
34
|
-
<DBBadge placement="corner-bottom-left">Corner Bottom Left</DBBadge>
|
|
35
|
-
<DBBadge placement="corner-bottom-right">Corner Bottom Right</DBBadge>
|
|
36
|
-
<h2>6. Custom Label</h2>
|
|
37
|
-
<DBBadge label="Custom Label">With Custom Label</DBBadge>
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default Badge;
|
|
43
|
-
```
|
package/agent/Brand.md
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Brand Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBBrand } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Brand(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBBrand Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Brand</h2>
|
|
14
|
-
<DBBrand>Default Brand</DBBrand>
|
|
15
|
-
<h2>2. Icon Visibility</h2>
|
|
16
|
-
<DBBrand showIcon={false}>Icon Hidden</DBBrand>
|
|
17
|
-
<h2>3. Custom Text</h2>
|
|
18
|
-
<DBBrand text="Custom Brand Text">With Custom Text</DBBrand>
|
|
19
|
-
</>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default Brand;
|
|
24
|
-
```
|
package/agent/Button.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Button Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Button(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBButton Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Button</h2>
|
|
14
|
-
<DBButton>Button</DBButton>
|
|
15
|
-
<h2>2. Variants</h2>
|
|
16
|
-
<DBButton variant="filled">Filled</DBButton>
|
|
17
|
-
<DBButton variant="outlined">Outlined</DBButton>
|
|
18
|
-
<DBButton variant="ghost">Ghost</DBButton>
|
|
19
|
-
<DBButton variant="brand">Brand</DBButton>
|
|
20
|
-
<h2>3. Sizes</h2>
|
|
21
|
-
<DBButton size="small">Small</DBButton>
|
|
22
|
-
<DBButton size="medium">Medium</DBButton>
|
|
23
|
-
<h2>4. Icon Only</h2>
|
|
24
|
-
<DBButton icon="check" noText />
|
|
25
|
-
<h2>5. Disabled</h2>
|
|
26
|
-
<DBButton disabled>Disabled</DBButton>
|
|
27
|
-
<h2>6. Button Types</h2>
|
|
28
|
-
<DBButton type="button">Type=button</DBButton>
|
|
29
|
-
<DBButton type="submit">Type=submit</DBButton>
|
|
30
|
-
<DBButton type="reset">Type=reset</DBButton>
|
|
31
|
-
<h2>7. Form Association</h2>
|
|
32
|
-
<form id="example-form">
|
|
33
|
-
<input name="exampleInput" placeholder="Example input" />
|
|
34
|
-
</form>
|
|
35
|
-
<DBButton form="example-form" type="submit">
|
|
36
|
-
Submit Form
|
|
37
|
-
</DBButton>
|
|
38
|
-
<h2>8. Name & Value</h2>
|
|
39
|
-
<DBButton name="testName" value="testValue">
|
|
40
|
-
Name/Value
|
|
41
|
-
</DBButton>
|
|
42
|
-
<h2>9. Width</h2>
|
|
43
|
-
<DBButton width="full">Full width</DBButton>
|
|
44
|
-
<DBButton width="auto">Auto width</DBButton>
|
|
45
|
-
<h2>10. Icon Visibility</h2>
|
|
46
|
-
<DBButton icon="check" showIcon={false}>
|
|
47
|
-
Icon Hidden
|
|
48
|
-
</DBButton>
|
|
49
|
-
<h2>11. Custom Class</h2>
|
|
50
|
-
<DBButton className="my-custom-class">Custom Class</DBButton>
|
|
51
|
-
<h2>12. Click Event</h2>
|
|
52
|
-
<DBButton onClick={(event) => alert("Button clicked!")}>
|
|
53
|
-
Click Me
|
|
54
|
-
</DBButton>
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export default Button;
|
|
60
|
-
```
|
package/agent/Card.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Card Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBCard } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Card(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBCard Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Card</h2>
|
|
14
|
-
<DBCard>Default Card</DBCard>
|
|
15
|
-
<h2>2. Behaviors</h2>
|
|
16
|
-
<DBCard behavior="static">Static</DBCard>
|
|
17
|
-
<DBCard behavior="interactive">Interactive</DBCard>
|
|
18
|
-
<h2>3. Elevation Levels</h2>
|
|
19
|
-
<DBCard elevationLevel="1">Elevation Level 1</DBCard>
|
|
20
|
-
<DBCard elevationLevel="2">Elevation Level 2</DBCard>
|
|
21
|
-
<DBCard elevationLevel="3">Elevation Level 3</DBCard>
|
|
22
|
-
<h2>4. Custom Class</h2>
|
|
23
|
-
<DBCard className="my-custom-class">Custom Class</DBCard>
|
|
24
|
-
<h2>5. Spacing</h2>
|
|
25
|
-
<DBCard spacing="medium">Medium Spacing</DBCard>
|
|
26
|
-
<DBCard spacing="small">Small Spacing</DBCard>
|
|
27
|
-
<DBCard spacing="large">Large Spacing</DBCard>
|
|
28
|
-
<DBCard spacing="none">No Spacing</DBCard>
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default Card;
|
|
34
|
-
```
|
package/agent/Checkbox.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
# Checkbox Examples (react)
|
|
4
|
-
|
|
5
|
-
```tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import { DBCheckbox } from "@db-ux/react-react-core-components";
|
|
8
|
-
|
|
9
|
-
function Checkbox(props: any) {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<h1>DBCheckbox Documentation Examples</h1>
|
|
13
|
-
<h2>1. Default Checkbox</h2>
|
|
14
|
-
<DBCheckbox label="Default Checkbox" />
|
|
15
|
-
<h2>2. Indeterminate State</h2>
|
|
16
|
-
<DBCheckbox label="Indeterminate Checkbox" indeterminate />
|
|
17
|
-
<h2>3. Sizes</h2>
|
|
18
|
-
<DBCheckbox size="small" label="Small Checkbox" />
|
|
19
|
-
<DBCheckbox size="medium" label="Medium Checkbox" />
|
|
20
|
-
<h2>4. Validation States</h2>
|
|
21
|
-
<DBCheckbox validation="valid" label="Valid Checkbox" />
|
|
22
|
-
<DBCheckbox validation="invalid" label="Invalid Checkbox" />
|
|
23
|
-
<DBCheckbox validation="no-validation" label="No Validation Checkbox" />
|
|
24
|
-
<h2>5. Disabled State</h2>
|
|
25
|
-
<DBCheckbox label="Disabled Checkbox" disabled />
|
|
26
|
-
<h2>6. Message Property Example</h2>
|
|
27
|
-
<DBCheckbox
|
|
28
|
-
label="Checkbox with Message"
|
|
29
|
-
message="This is a helper message."
|
|
30
|
-
/>
|
|
31
|
-
<h2>7. Change Event Example</h2>
|
|
32
|
-
<DBCheckbox
|
|
33
|
-
label="Change Event"
|
|
34
|
-
onChange={(event) => console.log("Change event:", event.target.checked)}
|
|
35
|
-
/>
|
|
36
|
-
</>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default Checkbox;
|
|
41
|
-
```
|