@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
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const DrawerBackdropList = ['none', 'strong', 'weak', 'invisible'];
|
|
2
|
-
export const DrawerDirectionList = ['left', 'right', 'up', 'down'];
|
|
2
|
+
export const DrawerDirectionList = ['custom', 'left', 'right', 'up', 'down'];
|
|
3
3
|
export const DrawerVariantList = ['modal', 'inside'];
|
|
4
4
|
export const DrawerPositionList = ['fixed', 'absolute'];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "value" | "size" | "icon" | keyof import("../../shared/model").GlobalProps | "showIcon" | "showIconLeading" | "showIconTrailing" | "iconLeading" | "iconTrailing" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").
|
|
2
|
+
declare const DBInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "name" | "value" | "label" | "disabled" | "size" | "icon" | keyof import("../../shared/model").GlobalProps | "showIcon" | "showIconLeading" | "showIconTrailing" | "iconLeading" | "iconTrailing" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").RequiredProps | "showLabel" | keyof import("../../shared/model").FormMessageProps | keyof import("./model").DBInputDefaultProps | keyof import("../../shared/model").FormTextProps | keyof import("../../shared/model").InputEventProps<HTMLInputElement>> & import("./model").DBInputDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").FormTextProps & import("../../shared/model").InputEventProps<HTMLInputElement> & import("../../shared/model").ChangeEventProps<HTMLInputElement> & import("../../shared/model").FocusEventProps<HTMLInputElement> & import("../../shared/model").CustomFormProps & {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
} & import("../../shared/model").DisabledProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").IconProps & import("../../shared/model").IconTrailingProps & import("../../shared/model").FormMessageProps & import("../../shared/model").ShowIconProps & import("../../shared/model").IconLeadingProps & import("../../shared/model").ShowIconLeadingProps & import("../../shared/model").ShowIconTrailingProps & import("../../shared/model").FormSizeProps & React.RefAttributes<any>>;
|
|
3
6
|
export default DBInput;
|
|
@@ -31,7 +31,7 @@ function DBInputFn(props, component) {
|
|
|
31
31
|
DEFAULT_INVALID_MESSAGE);
|
|
32
32
|
if (hasVoiceOver()) {
|
|
33
33
|
set_voiceOverFallback(_invalidMessage);
|
|
34
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
34
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
else if (hasValidState() &&
|
|
@@ -40,7 +40,7 @@ function DBInputFn(props, component) {
|
|
|
40
40
|
set_descByIds(_validMessageId);
|
|
41
41
|
if (hasVoiceOver()) {
|
|
42
42
|
set_voiceOverFallback((_d = props.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE);
|
|
43
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
43
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
else if (stringPropVisible(props.message, props.showMessage)) {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { GlobalProps, GlobalState } from '../../shared/model';
|
|
2
|
-
export type DBNavigationDefaultProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export type
|
|
1
|
+
import { GlobalProps, GlobalState, InitializedState, NavigationItemGroupVariant, NavigationItemGroupVariantType, OverflowScrollButtonProps, OverflowScrollButtonState } from '../../shared/model';
|
|
2
|
+
export type DBNavigationDefaultProps = {
|
|
3
|
+
showTreeLine?: boolean | string;
|
|
4
|
+
};
|
|
5
|
+
export type DBNavigationProps = DBNavigationDefaultProps & GlobalProps & OverflowScrollButtonProps & NavigationItemGroupVariant;
|
|
6
|
+
export type DBNavigationDefaultState = {
|
|
7
|
+
onScroll: () => void;
|
|
8
|
+
_variant?: NavigationItemGroupVariantType;
|
|
9
|
+
_shellDesktopPosition?: string | null;
|
|
10
|
+
_subNavigationDesktopPosition?: string | null;
|
|
11
|
+
_handleSubNavigation: () => void;
|
|
12
|
+
_isSubNavigation?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type DBNavigationState = DBNavigationDefaultState & GlobalState & OverflowScrollButtonState & InitializedState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBNavigation: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps> & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
2
|
+
declare const DBNavigation: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "variant" | keyof import("../..").GlobalProps | "showTreeLine" | "arrowScrollDistance"> & import("./model").DBNavigationDefaultProps & import("../..").GlobalProps & import("../..").OverflowScrollButtonProps & import("../..").NavigationItemGroupVariant & React.RefAttributes<any>>;
|
|
3
3
|
export default DBNavigation;
|
|
@@ -2,16 +2,106 @@
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
4
|
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { cls, delay, getBooleanAsString } from "../../utils";
|
|
6
|
+
import { handleSubNavigationPosition } from "../../utils/navigation";
|
|
7
|
+
import DBButton from "../button/button";
|
|
7
8
|
function DBNavigationFn(props, component) {
|
|
9
|
+
var _a;
|
|
8
10
|
const _ref = component || useRef(component);
|
|
9
|
-
const
|
|
11
|
+
const menuRef = useRef(null);
|
|
12
|
+
const [showScrollLeft, setShowScrollLeft] = useState(() => false);
|
|
13
|
+
const [showScrollRight, setShowScrollRight] = useState(() => false);
|
|
14
|
+
const [_shellDesktopPosition, set_shellDesktopPosition] = useState(() => undefined);
|
|
15
|
+
const [_subNavigationDesktopPosition, set_subNavigationDesktopPosition] = useState(() => undefined);
|
|
16
|
+
const [_variant, set_variant] = useState(() => undefined);
|
|
17
|
+
const [initialized, setInitialized] = useState(() => false);
|
|
18
|
+
const [_isSubNavigation, set_isSubNavigation] = useState(() => false);
|
|
19
|
+
function evaluateScrollButtons(tList) {
|
|
20
|
+
const needsScroll = tList.scrollWidth > tList.clientWidth;
|
|
21
|
+
const scrollLeft = Math.ceil(tList.scrollLeft);
|
|
22
|
+
setShowScrollLeft(needsScroll && scrollLeft > 1);
|
|
23
|
+
setShowScrollRight(needsScroll && scrollLeft < tList.scrollWidth - tList.clientWidth);
|
|
24
|
+
}
|
|
25
|
+
function scroll(left) {
|
|
26
|
+
var _a;
|
|
27
|
+
let step = Number(props.arrowScrollDistance) || 100;
|
|
28
|
+
if (left) {
|
|
29
|
+
step *= -1;
|
|
30
|
+
}
|
|
31
|
+
(_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.scrollBy({
|
|
32
|
+
top: 0,
|
|
33
|
+
left: step,
|
|
34
|
+
behavior: "smooth",
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function onScroll() {
|
|
38
|
+
evaluateScrollButtons(menuRef.current);
|
|
39
|
+
_handleSubNavigation();
|
|
40
|
+
}
|
|
41
|
+
function _handleSubNavigation() {
|
|
42
|
+
handleSubNavigationPosition(menuRef.current, _shellDesktopPosition === "left" ||
|
|
43
|
+
(_shellDesktopPosition === "top" &&
|
|
44
|
+
_subNavigationDesktopPosition === "left" &&
|
|
45
|
+
_isSubNavigation)
|
|
46
|
+
? 1
|
|
47
|
+
: 0);
|
|
48
|
+
}
|
|
10
49
|
useEffect(() => {
|
|
11
|
-
|
|
50
|
+
setInitialized(true);
|
|
12
51
|
}, []);
|
|
13
|
-
|
|
14
|
-
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (_ref.current && initialized) {
|
|
54
|
+
void delay(() => {
|
|
55
|
+
var _a, _b, _c, _d, _e;
|
|
56
|
+
const element = _ref.current;
|
|
57
|
+
if (!element)
|
|
58
|
+
return;
|
|
59
|
+
let endVariant = (_a = props.variant) !== null && _a !== void 0 ? _a : "popover";
|
|
60
|
+
const parentClassList = ((_b = element.parentElement) === null || _b === void 0 ? void 0 : _b.nodeName.startsWith("DB"))
|
|
61
|
+
? (_d = (_c = element.parentElement) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.classList
|
|
62
|
+
: (_e = element.parentElement) === null || _e === void 0 ? void 0 : _e.classList;
|
|
63
|
+
const shell = element.closest(".db-shell");
|
|
64
|
+
const shellDesktopPosition = shell === null || shell === void 0 ? void 0 : shell.getAttribute("data-control-panel-desktop-position");
|
|
65
|
+
const shellSubNaviDesktopPosition = shell === null || shell === void 0 ? void 0 : shell.getAttribute("data-sub-navigation-desktop-position");
|
|
66
|
+
set_shellDesktopPosition(shellDesktopPosition);
|
|
67
|
+
set_subNavigationDesktopPosition(shellSubNaviDesktopPosition);
|
|
68
|
+
const isSubNavigation = parentClassList === null || parentClassList === void 0 ? void 0 : parentClassList.contains("db-shell-sub-navigation");
|
|
69
|
+
set_isSubNavigation(isSubNavigation);
|
|
70
|
+
const requiresPopover = (shellDesktopPosition === "top" &&
|
|
71
|
+
(parentClassList === null || parentClassList === void 0 ? void 0 : parentClassList.contains("db-control-panel-desktop-scroll-container"))) ||
|
|
72
|
+
((shellSubNaviDesktopPosition === "top" ||
|
|
73
|
+
shellDesktopPosition === "left") &&
|
|
74
|
+
isSubNavigation);
|
|
75
|
+
if (requiresPopover) {
|
|
76
|
+
endVariant = "popover";
|
|
77
|
+
}
|
|
78
|
+
set_variant(endVariant);
|
|
79
|
+
}, 1);
|
|
80
|
+
}
|
|
81
|
+
}, [_ref.current, props.variant, initialized]);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
var _a;
|
|
84
|
+
if (menuRef.current && _variant) {
|
|
85
|
+
if (!_variant || _variant === "popover") {
|
|
86
|
+
_handleSubNavigation();
|
|
87
|
+
}
|
|
88
|
+
else if (_variant === "tree") {
|
|
89
|
+
for (const menu of Array.from(menuRef.current.querySelectorAll(".db-navigation-item-group-menu"))) {
|
|
90
|
+
menu.style.position = "";
|
|
91
|
+
}
|
|
92
|
+
for (const navItem of Array.from(menuRef.current.querySelectorAll(".db-navigation-item, .db-navigation-item-group"))) {
|
|
93
|
+
// TODO: Add keyboard navigation support
|
|
94
|
+
navItem.setAttribute("role", "none");
|
|
95
|
+
(_a = navItem.querySelector("a, button")) === null || _a === void 0 ? void 0 : _a.setAttribute("role", "treeitem");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
evaluateScrollButtons(menuRef.current);
|
|
99
|
+
}
|
|
100
|
+
}, [menuRef.current, _variant, _shellDesktopPosition]);
|
|
101
|
+
return (React.createElement("nav", Object.assign({ ref: _ref }, filterPassingProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { id: props.id, "data-variant": _variant, "data-show-tree-line": getBooleanAsString((_a = props.showTreeLine) !== null && _a !== void 0 ? _a : "true"), onScroll: (event) => onScroll() }, getRootProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { className: cls("db-navigation", props.className) }),
|
|
102
|
+
showScrollLeft ? (React.createElement(DBButton, { className: "overflow-scroll-left-button", variant: "filled", icon: "chevron_left", type: "button", noText: true, onClick: (event) => scroll(true) }, "Scroll left")) : null,
|
|
103
|
+
React.createElement("menu", { role: _variant === "tree" ? "tree" : undefined, ref: menuRef, onScroll: (event) => onScroll() }, props.children),
|
|
104
|
+
showScrollRight ? (React.createElement(DBButton, { className: "overflow-scroll-right-button", variant: "filled", icon: "chevron_right", type: "button", noText: true, onClick: (event) => scroll() }, "Scroll right")) : null));
|
|
15
105
|
}
|
|
16
106
|
const DBNavigation = forwardRef(DBNavigationFn);
|
|
17
107
|
export default DBNavigation;
|
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NavigationItemSafeTriangle } from '../../utils/navigation';
|
|
1
|
+
import { AdditionalInformationSlotProps, DisabledProps, GlobalProps, GlobalState, IconProps, ShowIconProps } from '../../shared/model';
|
|
3
2
|
export type DBNavigationItemDefaultProps = {
|
|
4
3
|
/**
|
|
5
4
|
* Alternative indicator for active navigation item (bold font). In contrast to the use of aria-current="page" on the contained anchor, this does not guarantee correct a11y.
|
|
6
5
|
*/
|
|
7
6
|
active?: boolean;
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* If you use DBShell with controlPanelDesktopPosition="left" you need
|
|
9
|
+
* to add a tooltip for collapsed navigation
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
tooltip?: string;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Set the text for the navigation-item
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This is for mobile navigation only, if it is set the sub-navigation is a static overlay
|
|
18
|
-
*/
|
|
19
|
-
subNavigationExpanded?: boolean | string;
|
|
20
|
-
};
|
|
21
|
-
export type DBNavigationItemProps = DBNavigationItemDefaultProps & GlobalProps & ClickEventProps<HTMLButtonElement> & IconProps & WidthProps & WrapProps & NavigationBackButtonProps & ShowIconProps & TextProps;
|
|
22
|
-
export type DBNavigationItemDefaultState = {
|
|
23
|
-
handleBackClick: (event: ClickEvent<HTMLButtonElement>) => void;
|
|
24
|
-
hasAreaPopup: boolean;
|
|
25
|
-
isSubNavigationExpanded: boolean;
|
|
26
|
-
subNavigationId: string;
|
|
27
|
-
/**
|
|
28
|
-
* Internal state property to show/hide sub-navigation button
|
|
29
|
-
*/
|
|
30
|
-
hasSubNavigation?: boolean;
|
|
31
|
-
navigationItemSafeTriangle?: NavigationItemSafeTriangle;
|
|
32
|
-
autoClose?: boolean;
|
|
15
|
+
text?: string;
|
|
33
16
|
};
|
|
34
|
-
export type
|
|
17
|
+
export type DBNavigationItemProps = DBNavigationItemDefaultProps & GlobalProps & IconProps & ShowIconProps & DisabledProps & AdditionalInformationSlotProps;
|
|
18
|
+
export type DBNavigationItemDefaultState = {};
|
|
19
|
+
export type DBNavigationItemState = DBNavigationItemDefaultState & GlobalState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBNavigationItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "
|
|
2
|
+
declare const DBNavigationItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "disabled" | "icon" | keyof import("../..").GlobalProps | "showIcon" | "additionalInformation" | keyof import("./model").DBNavigationItemDefaultProps> & import("./model").DBNavigationItemDefaultProps & import("../..").GlobalProps & import("../..").IconProps & import("../..").ShowIconProps & import("../..").DisabledProps & import("../..").AdditionalInformationSlotProps & React.RefAttributes<any>>;
|
|
3
3
|
export default DBNavigationItem;
|
|
@@ -1,76 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { cls,
|
|
7
|
-
import
|
|
8
|
-
import DBButton from "../button/button";
|
|
4
|
+
import { useRef, forwardRef } from "react";
|
|
5
|
+
import { DEFAULT_LABEL } from "../../shared/constants";
|
|
6
|
+
import { cls, getBooleanAsString } from "../../utils";
|
|
7
|
+
import DBTooltip from "../tooltip/tooltip";
|
|
9
8
|
function DBNavigationItemFn(props, component) {
|
|
10
9
|
var _a;
|
|
11
10
|
const _ref = component || useRef(component);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const [autoClose, setAutoClose] = useState(() => false);
|
|
17
|
-
const [subNavigationId, setSubNavigationId] = useState(() => "sub-navigation-" + uuid());
|
|
18
|
-
const [navigationItemSafeTriangle, setNavigationItemSafeTriangle] = useState(() => undefined);
|
|
19
|
-
function handleNavigationItemClick(event) {
|
|
20
|
-
var _a;
|
|
21
|
-
if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "A") {
|
|
22
|
-
setAutoClose(true);
|
|
23
|
-
void delay(() => {
|
|
24
|
-
setAutoClose(false);
|
|
25
|
-
}, 1000);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function handleClick(event) {
|
|
29
|
-
if (props.onClick) {
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
props.onClick(event);
|
|
32
|
-
}
|
|
33
|
-
if (hasAreaPopup) {
|
|
34
|
-
setIsSubNavigationExpanded(true);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function handleBackClick(event) {
|
|
38
|
-
event.stopPropagation();
|
|
39
|
-
setIsSubNavigationExpanded(false);
|
|
40
|
-
}
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
setInitialized(true);
|
|
43
|
-
}, []);
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (props.subNavigationExpanded !== undefined) {
|
|
46
|
-
setIsSubNavigationExpanded(!!getBoolean(props.subNavigationExpanded, "subNavigationExpanded"));
|
|
47
|
-
}
|
|
48
|
-
}, [props.subNavigationExpanded]);
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
var _a;
|
|
51
|
-
if (initialized && _ref.current) {
|
|
52
|
-
const subNavigationSlot = _ref.current.querySelector("menu");
|
|
53
|
-
if (subNavigationSlot) {
|
|
54
|
-
if (((_a = subNavigationSlot.children) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
55
|
-
setHasAreaPopup(true);
|
|
56
|
-
if (!navigationItemSafeTriangle) {
|
|
57
|
-
setNavigationItemSafeTriangle(new NavigationItemSafeTriangle(_ref.current, subNavigationSlot));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
setHasSubNavigation(false);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}, [initialized, _ref.current]);
|
|
66
|
-
return (React.createElement("li", Object.assign({ ref: _ref }, filterPassingProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { id: props.id, onMouseOver: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.enableFollow(), onMouseLeave: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.disableFollow(), onMouseMove: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.followByMouseEvent(event) }, getRootProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { className: cls("db-navigation-item", props.className), "data-width": props.width, "data-icon": props.icon, "data-show-icon": getBooleanAsString(props.showIcon), "data-active": props.active, "data-wrap": getBooleanAsString(props.wrap), "aria-disabled": getBooleanAsString(props.disabled) }),
|
|
67
|
-
!hasSubNavigation ? (React.createElement(React.Fragment, null, props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children))) : null,
|
|
68
|
-
hasSubNavigation ? (React.createElement(React.Fragment, null,
|
|
69
|
-
React.createElement("button", { className: "db-navigation-item-expand-button", "aria-haspopup": hasAreaPopup, "aria-expanded": isSubNavigationExpanded, disabled: getBoolean(props.disabled, "disabled"), onClick: (event) => handleClick(event) }, props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children)),
|
|
70
|
-
React.createElement("menu", { className: "db-sub-navigation", "data-force-close": autoClose, id: subNavigationId, onClick: (event) => handleNavigationItemClick(event) },
|
|
71
|
-
hasAreaPopup ? (React.createElement("div", { className: "db-mobile-navigation-back" },
|
|
72
|
-
React.createElement(DBButton, { icon: "arrow_left", variant: "ghost", id: props.backButtonId, onClick: (event) => handleBackClick(event) }, (_a = props.backButtonText) !== null && _a !== void 0 ? _a : DEFAULT_BACK))) : null,
|
|
73
|
-
React.createElement(React.Fragment, null, props.subNavigation)))) : null));
|
|
11
|
+
return (React.createElement("li", Object.assign({ ref: _ref }, filterPassingProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { id: props.id }, getRootProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { className: cls("db-navigation-item", props.className), "data-icon": props.icon, "data-show-icon": getBooleanAsString(props.showIcon), "data-active": getBooleanAsString(props.active), "aria-disabled": getBooleanAsString(props.disabled) }),
|
|
12
|
+
props.children,
|
|
13
|
+
React.createElement(React.Fragment, null, props.additionalInformation),
|
|
14
|
+
React.createElement(DBTooltip, { placement: "right", delay: "slow" }, (_a = props.tooltip) !== null && _a !== void 0 ? _a : DEFAULT_LABEL)));
|
|
74
15
|
}
|
|
75
16
|
const DBNavigationItem = forwardRef(DBNavigationItemFn);
|
|
76
17
|
export default DBNavigationItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBNavigationItemGroup } from './navigation-item-group';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBNavigationItemGroup } from './navigation-item-group';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AdditionalInformationSlotProps, ClickEvent, ClickEventProps, ClickEventState, DisabledProps, GlobalProps, GlobalState, IconProps, InitializedState, NavigationBackButtonProps, NavigationBehaviorState, NavigationItemGroupVariant, ShowIconProps } from '../../shared/model';
|
|
2
|
+
import { NavigationItemSafeTriangle } from '../../utils/navigation';
|
|
3
|
+
import { DBNavigationItemDefaultProps } from '../navigation-item/model';
|
|
4
|
+
export type DBNavigationItemGroupDefaultProps = {
|
|
5
|
+
/**
|
|
6
|
+
* This is for mobile navigation only, if it is set the sub-navigation is a static overlay
|
|
7
|
+
*/
|
|
8
|
+
expanded?: boolean | string;
|
|
9
|
+
};
|
|
10
|
+
export type DBNavigationItemGroupProps = DBNavigationItemGroupDefaultProps & NavigationBackButtonProps & ClickEventProps<HTMLButtonElement> & GlobalProps & IconProps & ShowIconProps & DBNavigationItemDefaultProps & DisabledProps & NavigationItemGroupVariant & AdditionalInformationSlotProps;
|
|
11
|
+
export type DBNavigationItemGroupDefaultState = {
|
|
12
|
+
handleBackClick: (event: ClickEvent<HTMLButtonElement>) => void;
|
|
13
|
+
isSubNavigationExpanded: boolean;
|
|
14
|
+
subNavigationId: string;
|
|
15
|
+
/**
|
|
16
|
+
* Internal state property to show/hide sub-navigation button
|
|
17
|
+
*/
|
|
18
|
+
hasSubNavigation?: boolean;
|
|
19
|
+
hasPopup?: boolean;
|
|
20
|
+
navigationItemSafeTriangle?: NavigationItemSafeTriangle;
|
|
21
|
+
autoClose?: boolean;
|
|
22
|
+
onScroll: () => void;
|
|
23
|
+
handleEscape: (event: any) => void;
|
|
24
|
+
forceClose: () => void;
|
|
25
|
+
};
|
|
26
|
+
export type DBNavigationItemGroupState = DBNavigationItemGroupDefaultState & ClickEventState<HTMLButtonElement> & GlobalState & NavigationBehaviorState & InitializedState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBNavigationItemGroup: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "variant" | "expanded" | "disabled" | "icon" | "onClick" | keyof import("../../shared/model").GlobalProps | "showIcon" | "additionalInformation" | keyof import("../..").DBNavigationItemDefaultProps | keyof import("../../shared/model").NavigationBackButtonProps> & import("./model").DBNavigationItemGroupDefaultProps & import("../../shared/model").NavigationBackButtonProps & import("../../shared/model").ClickEventProps<HTMLButtonElement> & import("../../shared/model").GlobalProps & import("../../shared/model").IconProps & import("../../shared/model").ShowIconProps & import("../..").DBNavigationItemDefaultProps & import("../../shared/model").DisabledProps & import("../../shared/model").NavigationItemGroupVariant & import("../../shared/model").AdditionalInformationSlotProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBNavigationItemGroup;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
5
|
+
import { DEFAULT_BACK } from "../../shared/constants";
|
|
6
|
+
import { cls, delay, getBoolean, getBooleanAsString, getHideProp, uuid, } from "../../utils";
|
|
7
|
+
import { handleSubNavigationPosition, NavigationItemSafeTriangle, } from "../../utils/navigation";
|
|
8
|
+
import DBButton from "../button/button";
|
|
9
|
+
function DBNavigationItemGroupFn(props, component) {
|
|
10
|
+
var _a;
|
|
11
|
+
const _ref = component || useRef(undefined);
|
|
12
|
+
const _menuRef = useRef(undefined);
|
|
13
|
+
const _buttonRef = useRef(undefined);
|
|
14
|
+
const [hasSubNavigation, setHasSubNavigation] = useState(() => true);
|
|
15
|
+
const [isSubNavigationExpanded, setIsSubNavigationExpanded] = useState(() => false);
|
|
16
|
+
const [autoClose, setAutoClose] = useState(() => false);
|
|
17
|
+
const [hasPopup, setHasPopup] = useState(() => false);
|
|
18
|
+
const [initialized, setInitialized] = useState(() => false);
|
|
19
|
+
const [subNavigationId, setSubNavigationId] = useState(() => "db-navigation-item-group-menu-" + uuid());
|
|
20
|
+
const [navigationItemSafeTriangle, setNavigationItemSafeTriangle] = useState(() => undefined);
|
|
21
|
+
function onScroll() {
|
|
22
|
+
if (hasPopup) {
|
|
23
|
+
handleSubNavigationPosition(_ref.current);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function handleNavigationItemClick(event) {
|
|
27
|
+
var _a;
|
|
28
|
+
if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "A") {
|
|
29
|
+
forceClose();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function forceClose() {
|
|
33
|
+
setAutoClose(true);
|
|
34
|
+
void delay(() => {
|
|
35
|
+
setAutoClose(false);
|
|
36
|
+
}, 300);
|
|
37
|
+
}
|
|
38
|
+
function handleClick(event) {
|
|
39
|
+
if (props.onClick) {
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
props.onClick(event);
|
|
42
|
+
}
|
|
43
|
+
setIsSubNavigationExpanded(!isSubNavigationExpanded);
|
|
44
|
+
}
|
|
45
|
+
function handleBackClick(event) {
|
|
46
|
+
event.stopPropagation();
|
|
47
|
+
setIsSubNavigationExpanded(false);
|
|
48
|
+
}
|
|
49
|
+
function handleEscape(event) {
|
|
50
|
+
if (!event || event.key === "Escape") {
|
|
51
|
+
forceClose();
|
|
52
|
+
_buttonRef.current.blur();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setInitialized(true);
|
|
57
|
+
}, []);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (props.expanded !== undefined) {
|
|
60
|
+
setIsSubNavigationExpanded(!!getBoolean(props.expanded, "subNavigationExpanded"));
|
|
61
|
+
}
|
|
62
|
+
}, [props.expanded]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (_ref.current && initialized) {
|
|
65
|
+
setInitialized(false);
|
|
66
|
+
// We delay this because the navigation variant check is delayed as well
|
|
67
|
+
void delay(() => {
|
|
68
|
+
const element = _ref.current;
|
|
69
|
+
const nav = element.closest(".db-navigation");
|
|
70
|
+
setHasPopup(!nav ||
|
|
71
|
+
!nav.dataset["variant"] ||
|
|
72
|
+
nav.dataset["variant"] === "popover");
|
|
73
|
+
}, 200);
|
|
74
|
+
}
|
|
75
|
+
}, [_ref.current, initialized]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (_ref.current &&
|
|
78
|
+
_buttonRef.current &&
|
|
79
|
+
_menuRef.current &&
|
|
80
|
+
hasPopup &&
|
|
81
|
+
!navigationItemSafeTriangle) {
|
|
82
|
+
void delay(() => {
|
|
83
|
+
setNavigationItemSafeTriangle(new NavigationItemSafeTriangle(_ref.current, _menuRef.current));
|
|
84
|
+
}, 1);
|
|
85
|
+
["mouseenter", "focusin"].forEach((event) => {
|
|
86
|
+
_ref.current.addEventListener(event, () => handleSubNavigationPosition(_menuRef.current));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}, [_ref.current, _menuRef.current, _buttonRef.current, hasPopup]);
|
|
90
|
+
return (React.createElement("li", Object.assign({ ref: _ref }, filterPassingProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { id: props.id, onMouseOver: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.enableFollow(), onMouseLeave: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.disableFollow(), onMouseMove: (event) => navigationItemSafeTriangle === null || navigationItemSafeTriangle === void 0 ? void 0 : navigationItemSafeTriangle.followByMouseEvent(event), onKeyDown: (event) => handleEscape(event) }, getRootProps(props, ["data-icon-variant", "data-icon-variant-before", "data-icon-variant-after", "data-icon-weight", "data-icon-weight-before", "data-icon-weight-after", "data-interactive", "data-force-mobile", "data-color", "data-container-color", "data-bg-color", "data-on-bg-color", "data-color-scheme", "data-font-size", "data-headline-size", "data-divider", "data-focus", "data-font"]), { className: cls("db-navigation-item-group", props.className), "data-icon": props.icon, "data-hide-icon": getHideProp(props.showIcon), "data-active": props.active, "aria-disabled": getBooleanAsString(props.disabled) }),
|
|
91
|
+
React.createElement("button", { type: "button", className: "db-navigation-item-group-expand-button", ref: _buttonRef, "aria-haspopup": getBooleanAsString(hasPopup ? true : undefined), "aria-owns": hasPopup ? undefined : subNavigationId, "aria-expanded": getBooleanAsString(isSubNavigationExpanded), disabled: getBoolean(props.disabled, "disabled"), onClick: (event) => handleClick(event) },
|
|
92
|
+
props.text,
|
|
93
|
+
React.createElement(React.Fragment, null, props.additionalInformation)),
|
|
94
|
+
React.createElement("menu", { className: "db-navigation-item-group-menu", role: "group", ref: _menuRef, "data-force-close": getBooleanAsString(autoClose), id: subNavigationId, onScroll: (event) => onScroll(), onClick: (event) => handleNavigationItemClick(event) },
|
|
95
|
+
React.createElement("div", { className: "db-navigation-item-group-back-button" },
|
|
96
|
+
React.createElement(DBButton, { icon: "arrow_left", variant: "ghost", id: props.backButtonId, onClick: (event) => handleBackClick(event) }, (_a = props.backButtonText) !== null && _a !== void 0 ? _a : DEFAULT_BACK)),
|
|
97
|
+
props.children)));
|
|
98
|
+
}
|
|
99
|
+
const DBNavigationItemGroup = forwardRef(DBNavigationItemGroupFn);
|
|
100
|
+
export default DBNavigationItemGroup;
|
|
@@ -27,8 +27,7 @@ function DBPopoverFn(props, component) {
|
|
|
27
27
|
if (article) {
|
|
28
28
|
// This is a workaround for angular
|
|
29
29
|
utilsDelay(() => {
|
|
30
|
-
|
|
31
|
-
handleFixedPopover(article, _ref.current, (_a = props.placement) !== null && _a !== void 0 ? _a : "bottom");
|
|
30
|
+
handleFixedPopover(article, _ref.current);
|
|
32
31
|
}, 1);
|
|
33
32
|
}
|
|
34
33
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBRadio: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "value" | "size" | "checked" | keyof import("../../shared/model").GlobalProps | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").
|
|
2
|
+
declare const DBRadio: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "name" | "value" | "label" | "disabled" | "size" | "checked" | keyof import("../../shared/model").GlobalProps | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").RequiredProps | "showLabel"> & import("../../shared/model").GlobalProps & import("../../shared/model").ChangeEventProps<HTMLInputElement> & import("../../shared/model").FocusEventProps<HTMLInputElement> & import("../../shared/model").CustomFormProps & {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
} & import("../../shared/model").DisabledProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").FormCheckProps & import("../../shared/model").SizeProps & React.RefAttributes<any>>;
|
|
3
6
|
export default DBRadio;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBSelect: React.ForwardRefExoticComponent<Omit<React.SelectHTMLAttributes<any>, "value" | "size" | "icon" | "onClick" | keyof import("../../shared/model").GlobalProps | "showIcon" | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").
|
|
2
|
+
declare const DBSelect: React.ForwardRefExoticComponent<Omit<React.SelectHTMLAttributes<any>, "name" | "value" | "label" | "disabled" | "size" | "icon" | "onClick" | keyof import("../../shared/model").GlobalProps | "showIcon" | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").RequiredProps | "showLabel" | keyof import("../../shared/model").FormMessageProps | keyof import("../../shared/model").ChangeEventProps<HTMLSelectElement> | keyof import("../../shared/model").FocusEventProps<HTMLSelectElement> | keyof import("../../shared/model").InputEventProps<HTMLSelectElement> | keyof import("./model").DBSelectDefaultProps> & import("../../shared/model").GlobalProps & import("../../shared/model").ClickEventProps<HTMLSelectElement> & import("../../shared/model").ChangeEventProps<HTMLSelectElement> & import("../../shared/model").FocusEventProps<HTMLSelectElement> & import("../../shared/model").InputEventProps<HTMLSelectElement> & import("../../shared/model").CustomFormProps & {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
} & import("../../shared/model").DisabledProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").IconProps & import("../../shared/model").FormMessageProps & import("./model").DBSelectDefaultProps & import("../../shared/model").ShowIconProps & import("../../shared/model").FormSizeProps & React.RefAttributes<any>>;
|
|
3
6
|
export default DBSelect;
|
|
@@ -32,7 +32,7 @@ function DBSelectFn(props, component) {
|
|
|
32
32
|
DEFAULT_INVALID_MESSAGE);
|
|
33
33
|
if (hasVoiceOver()) {
|
|
34
34
|
set_voiceOverFallback(_invalidMessage);
|
|
35
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
35
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
else if (hasValidState() &&
|
|
@@ -41,7 +41,7 @@ function DBSelectFn(props, component) {
|
|
|
41
41
|
set_descByIds(_validMessageId);
|
|
42
42
|
if (hasVoiceOver()) {
|
|
43
43
|
set_voiceOverFallback((_d = props.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE);
|
|
44
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
44
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
else if (stringPropVisible(props.message, props.showMessage)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBShell } from './shell';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBShell } from './shell';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, ShellControlPanelDesktopPositionType, ShellControlPanelMobilePositionType } from '../../shared/model';
|
|
2
|
+
export declare const ShellSubNavigationMobilePosition: readonly ["top", "bottom"];
|
|
3
|
+
export type ShellSubNavigationMobilePositionType = (typeof ShellSubNavigationMobilePosition)[number];
|
|
4
|
+
export type DBShellDefaultProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The slot can be used for React to set a desktopControlPanel.
|
|
7
|
+
*/
|
|
8
|
+
controlPanelDesktop?: any;
|
|
9
|
+
/**
|
|
10
|
+
* Change the position of the desktop content panel
|
|
11
|
+
*/
|
|
12
|
+
controlPanelDesktopPosition?: ShellControlPanelDesktopPositionType;
|
|
13
|
+
/**
|
|
14
|
+
* The slot can be used for React to set a mobileControlPanel.
|
|
15
|
+
*/
|
|
16
|
+
controlPanelMobile?: any;
|
|
17
|
+
/**
|
|
18
|
+
* Change the position of the mobile content panel
|
|
19
|
+
*/
|
|
20
|
+
controlPanelMobilePosition?: ShellControlPanelMobilePositionType;
|
|
21
|
+
/**
|
|
22
|
+
* Set this to have a transition with opacity to avoid layout-shifts https://simonhearne.com/2021/layout-shifts-webfonts/
|
|
23
|
+
*/
|
|
24
|
+
fadeIn?: boolean | string;
|
|
25
|
+
/**
|
|
26
|
+
* Adds `class` to `<main>` element
|
|
27
|
+
*/
|
|
28
|
+
mainClass?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The slot can be used for React to set a subNavigation.
|
|
31
|
+
*/
|
|
32
|
+
subNavigation?: any;
|
|
33
|
+
/**
|
|
34
|
+
* Change the position of the optional sub navigation for desktop
|
|
35
|
+
*/
|
|
36
|
+
subNavigationDesktopPosition?: ShellControlPanelDesktopPositionType;
|
|
37
|
+
/**
|
|
38
|
+
* Change the position of the optional sub navigation for mobile
|
|
39
|
+
*/
|
|
40
|
+
subNavigationMobilePosition?: ShellSubNavigationMobilePositionType;
|
|
41
|
+
/**
|
|
42
|
+
* Shows sub-navigation
|
|
43
|
+
*/
|
|
44
|
+
showSubNavigation?: boolean | string;
|
|
45
|
+
};
|
|
46
|
+
export type DBShellProps = DBShellDefaultProps & GlobalProps;
|
|
47
|
+
export type DBShellDefaultState = {
|
|
48
|
+
fontsLoaded?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type DBShellState = DBShellDefaultState & GlobalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ShellSubNavigationMobilePosition = ['top', 'bottom'];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBShell: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps | keyof import("./model").DBShellDefaultProps> & import("./model").DBShellDefaultProps & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBShell;
|