@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
package/README.md
CHANGED
|
@@ -59,17 +59,6 @@ import { DBButton } from '@db-ux/react-core-components';
|
|
|
59
59
|
...
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
## Documentation for AI Agents
|
|
63
|
-
|
|
64
|
-
We provide a documentation for every component in the DB UX Design System via `docs` folder.
|
|
65
|
-
To consume those documentation for AI Agents the best way is to copy the `docs` folder into your project.
|
|
66
|
-
|
|
67
|
-
We provide a CLI tool to do this automatically, which you can run with:
|
|
68
|
-
|
|
69
|
-
```shell
|
|
70
|
-
npx @db-ux/agent-cli
|
|
71
|
-
```
|
|
72
|
-
|
|
73
62
|
## Deutsche Bahn brand
|
|
74
63
|
|
|
75
64
|
As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound of clear guidelines and restrictions even if being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights regarding the Deutsche Bahn brand, even though that we're providing the code of DB UX Design System products free to use and release it under the Apache 2.0 license.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBButton: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<any>, "width" | "text" | "size" | "icon" | "onClick" | keyof import("../..").GlobalProps |
|
|
2
|
+
declare const DBButton: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<any>, "width" | "text" | "size" | "icon" | "onClick" | keyof import("../..").GlobalProps | keyof import("./model").DBButtonDefaultProps | "showIcon" | "showIconLeading" | "showIconTrailing" | "iconLeading" | "iconTrailing"> & import("./model").DBButtonDefaultProps & import("../..").GlobalProps & import("../..").ClickEventProps<HTMLButtonElement> & import("../..").IconProps & import("../..").WidthProps & import("../..").SizeProps & import("../..").ShowIconProps & import("../..").TextProps & import("../..").ShowIconLeadingProps & import("../..").ShowIconTrailingProps & import("../..").IconLeadingProps & import("../..").IconTrailingProps & React.RefAttributes<any>>;
|
|
3
3
|
export default DBButton;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBCheckbox: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "value" | "size" | "checked" | keyof import("../../shared/model").GlobalProps | "indeterminate" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").
|
|
2
|
+
declare const DBCheckbox: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<any>, "name" | "value" | "label" | "disabled" | "size" | "checked" | keyof import("../../shared/model").GlobalProps | "indeterminate" | 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> & import("./model").DBCheckboxDefaultProps & 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").FormMessageProps & import("../../shared/model").SizeProps & React.RefAttributes<any>>;
|
|
3
6
|
export default DBCheckbox;
|
|
@@ -30,7 +30,7 @@ function DBCheckboxFn(props, component) {
|
|
|
30
30
|
DEFAULT_INVALID_MESSAGE);
|
|
31
31
|
if (hasVoiceOver()) {
|
|
32
32
|
set_voiceOverFallback(_invalidMessage);
|
|
33
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
33
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
else if (hasValidState() &&
|
|
@@ -39,7 +39,7 @@ function DBCheckboxFn(props, component) {
|
|
|
39
39
|
set_descByIds(_validMessageId);
|
|
40
40
|
if (hasVoiceOver()) {
|
|
41
41
|
set_voiceOverFallback((_d = props.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE);
|
|
42
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
42
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
else if (stringPropVisible(props.message, props.showMessage)) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelBrand: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "text" | "icon" | keyof import("../..").GlobalProps | "showIcon" | "additionalInformation"> & import("../..").GlobalProps & import("../..").IconProps & import("../..").ShowIconProps & import("../..").TextProps & import("../..").AdditionalInformationSlotProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelBrand;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useRef, forwardRef } from "react";
|
|
5
|
+
import { DEFAULT_ICON } from "../../shared/constants";
|
|
6
|
+
import { cls, getBooleanAsString } from "../../utils";
|
|
7
|
+
function DBControlPanelBrandFn(props, component) {
|
|
8
|
+
var _a;
|
|
9
|
+
const _ref = component || useRef(component);
|
|
10
|
+
return (React.createElement("div", 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"]), { "data-icon": (_a = props.icon) !== null && _a !== void 0 ? _a : DEFAULT_ICON, "data-show-icon": getBooleanAsString(props.showIcon), 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-control-panel-brand", props.className) }),
|
|
11
|
+
props.text ? React.createElement(React.Fragment, null, props.text) : React.createElement(React.Fragment, null, props.children),
|
|
12
|
+
React.createElement(React.Fragment, null, props.additionalInformation)));
|
|
13
|
+
}
|
|
14
|
+
const DBControlPanelBrand = forwardRef(DBControlPanelBrandFn);
|
|
15
|
+
export default DBControlPanelBrand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelBrand } from './control-panel-brand';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelBrand } from './control-panel-brand';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AdditionalInformationSlotProps, GlobalProps, GlobalState, IconProps, ShowIconProps, TextProps } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelBrandDefaultProps = {};
|
|
3
|
+
export type DBControlPanelBrandProps = DBControlPanelBrandDefaultProps & GlobalProps & IconProps & ShowIconProps & TextProps & AdditionalInformationSlotProps;
|
|
4
|
+
export type DBControlPanelBrandDefaultState = {};
|
|
5
|
+
export type DBControlPanelBrandState = DBControlPanelBrandDefaultState & GlobalState;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelDesktop: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "width" | "orientation" | keyof import("../..").GlobalProps | keyof import("../..").ControlPanelProps | keyof import("../..").SidebarProps> & import("../..").GlobalProps & import("../..").ContainerWidthProps & import("../..").ControlPanelProps & import("../..").OrientationProps & import("../..").SidebarProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelDesktop;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useState, useRef, forwardRef } from "react";
|
|
5
|
+
import { DEFAULT_COLLAPSE, DEFAULT_EXPAND } from "../../shared/constants";
|
|
6
|
+
import { cls, getBoolean, getBooleanAsString, uuid } from "../../utils";
|
|
7
|
+
import { handleSubNavigationPosition } from "../../utils/navigation";
|
|
8
|
+
import DBButton from "../button/button";
|
|
9
|
+
import DBTooltip from "../tooltip/tooltip";
|
|
10
|
+
function DBControlPanelDesktopFn(props, component) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const _ref = component || useRef(component);
|
|
13
|
+
const _scrollContainerRef = useRef(null);
|
|
14
|
+
const [_id, set_id] = useState(() => `db-control-panel-desktop-${uuid()}`);
|
|
15
|
+
const [_open, set_open] = useState(() => true);
|
|
16
|
+
function handleToggle(event) {
|
|
17
|
+
if (typeof event.detail !== "object") {
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
set_open(!_open);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function getToggleButtonText() {
|
|
23
|
+
if (props.onExpandButtonTooltipFn) {
|
|
24
|
+
const open = _open;
|
|
25
|
+
return props.onExpandButtonTooltipFn(open);
|
|
26
|
+
}
|
|
27
|
+
if (props.expandButtonTooltip) {
|
|
28
|
+
return props.expandButtonTooltip;
|
|
29
|
+
}
|
|
30
|
+
return _open ? DEFAULT_COLLAPSE : DEFAULT_EXPAND;
|
|
31
|
+
}
|
|
32
|
+
function onScroll() {
|
|
33
|
+
if (!_scrollContainerRef.current)
|
|
34
|
+
return;
|
|
35
|
+
const popoverNavigation = _scrollContainerRef.current.querySelector('.db-navigation[data-variant="popover"]');
|
|
36
|
+
if (!popoverNavigation)
|
|
37
|
+
return;
|
|
38
|
+
const navigationMenu = popoverNavigation.querySelector("menu");
|
|
39
|
+
if (navigationMenu) {
|
|
40
|
+
handleSubNavigationPosition(navigationMenu);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const hasInitialized = useRef(false);
|
|
44
|
+
if (!hasInitialized.current) {
|
|
45
|
+
if (props.expanded !== undefined) {
|
|
46
|
+
set_open((_a = getBoolean(props.expanded, "expanded")) !== null && _a !== void 0 ? _a : true);
|
|
47
|
+
}
|
|
48
|
+
hasInitialized.current = true;
|
|
49
|
+
}
|
|
50
|
+
return (React.createElement("header", 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", "onToggle"]), 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-control-panel-desktop", props.className), id: (_b = props.id) !== null && _b !== void 0 ? _b : _id, "data-width": props.width, "data-orientation": props.orientation, "data-open": getBooleanAsString(_open) }),
|
|
51
|
+
React.createElement(React.Fragment, null, props.brand),
|
|
52
|
+
React.createElement("div", { className: "db-control-panel-desktop-scroll-container", ref: _scrollContainerRef, onScroll: (event) => onScroll() },
|
|
53
|
+
props.children,
|
|
54
|
+
React.createElement(React.Fragment, null, props.metaNavigation)),
|
|
55
|
+
React.createElement(React.Fragment, null, props.primaryActions),
|
|
56
|
+
React.createElement(React.Fragment, null, props.secondaryActions),
|
|
57
|
+
React.createElement("div", { className: "db-control-panel-desktop-button" },
|
|
58
|
+
React.createElement(DBButton, { variant: "ghost", type: "button", icon: "double_chevron_left", onClick: (event) => handleToggle(event), "aria-controls": (_c = props.id) !== null && _c !== void 0 ? _c : _id, "aria-expanded": _open, noText: true },
|
|
59
|
+
React.createElement(DBTooltip, { variant: "label", placement: "right" }, getToggleButtonText())))));
|
|
60
|
+
}
|
|
61
|
+
const DBControlPanelDesktop = forwardRef(DBControlPanelDesktopFn);
|
|
62
|
+
export default DBControlPanelDesktop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelDesktop } from './control-panel-desktop';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelDesktop } from './control-panel-desktop';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ContainerWidthProps, ControlPanelProps, GlobalProps, GlobalState, OrientationProps, SidebarProps, SidebarState, ToggleEventState } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelDesktopDefaultProps = {};
|
|
3
|
+
export type DBControlPanelDesktopProps = DBControlPanelDesktopDefaultProps & GlobalProps & ContainerWidthProps & ControlPanelProps & OrientationProps & SidebarProps;
|
|
4
|
+
export type DBControlPanelDesktopDefaultState = {
|
|
5
|
+
onScroll: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type DBControlPanelDesktopState = DBControlPanelDesktopDefaultState & GlobalState & ToggleEventState<HTMLButtonElement> & SidebarState;
|
package/dist/components/control-panel-flat-icon-navigation/control-panel-flat-icon-navigation.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelFlatIconNavigation: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps | "noText"> & import("./model").DBControlPanelFlatIconNavigationDefaultProps & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelFlatIconNavigation;
|
package/dist/components/control-panel-flat-icon-navigation/control-panel-flat-icon-navigation.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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 { cls, getBooleanAsString } from "../../utils";
|
|
6
|
+
function DBControlPanelFlatIconNavigationFn(props, component) {
|
|
7
|
+
const _ref = component || useRef(undefined);
|
|
8
|
+
const [initialized, setInitialized] = useState(() => false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setInitialized(true);
|
|
11
|
+
}, []);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (_ref.current && initialized) {
|
|
14
|
+
const tooltips = _ref.current.querySelectorAll(".db-tooltip");
|
|
15
|
+
if ((tooltips === null || tooltips === void 0 ? void 0 : tooltips.length) > 0) {
|
|
16
|
+
const array = Array.from(tooltips);
|
|
17
|
+
for (const tooltip of array) {
|
|
18
|
+
tooltip.dataset["placement"] = "top";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}, [_ref.current, initialized]);
|
|
23
|
+
return (React.createElement("div", 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-no-text": getBooleanAsString(props.noText) }, 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-control-panel-flat-icon-navigation", props.className) }), props.children));
|
|
24
|
+
}
|
|
25
|
+
const DBControlPanelFlatIconNavigation = forwardRef(DBControlPanelFlatIconNavigationFn);
|
|
26
|
+
export default DBControlPanelFlatIconNavigation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelFlatIconNavigation } from "./control-panel-flat-icon-navigation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelFlatIconNavigation } from "./control-panel-flat-icon-navigation";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState, InitializedState } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelFlatIconNavigationDefaultProps = {
|
|
3
|
+
noText?: string | boolean;
|
|
4
|
+
};
|
|
5
|
+
export type DBControlPanelFlatIconNavigationProps = DBControlPanelFlatIconNavigationDefaultProps & GlobalProps;
|
|
6
|
+
export type DBControlPanelFlatIconNavigationDefaultState = {};
|
|
7
|
+
export type DBControlPanelFlatIconNavigationState = DBControlPanelFlatIconNavigationDefaultState & GlobalState & InitializedState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelMetaNavigation: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps> & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelMetaNavigation;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useRef, forwardRef } from "react";
|
|
5
|
+
import { cls } from "../../utils";
|
|
6
|
+
function DBControlPanelMetaNavigationFn(props, component) {
|
|
7
|
+
const _ref = component || useRef(undefined);
|
|
8
|
+
return (React.createElement("div", 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-control-panel-meta-navigation", props.className) }), props.children));
|
|
9
|
+
}
|
|
10
|
+
const DBControlPanelMetaNavigation = forwardRef(DBControlPanelMetaNavigationFn);
|
|
11
|
+
export default DBControlPanelMetaNavigation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelMetaNavigation } from './control-panel-meta-navigation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelMetaNavigation } from './control-panel-meta-navigation';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelMetaNavigationDefaultProps = {};
|
|
3
|
+
export type DBControlPanelMetaNavigationProps = DBControlPanelMetaNavigationDefaultProps & GlobalProps;
|
|
4
|
+
export type DBControlPanelMetaNavigationDefaultState = {};
|
|
5
|
+
export type DBControlPanelMetaNavigationState = DBControlPanelMetaNavigationDefaultState & GlobalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelMobile: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "width" | keyof import("../..").GlobalProps | keyof import("../..").ToggleEventProps | keyof import("../..").ControlPanelProps | keyof import("./model").DBControlPanelMobileDefaultProps> & import("./model").DBControlPanelMobileDefaultProps & import("../..").GlobalProps & import("../..").ToggleEventProps & import("../..").ContainerWidthProps & import("../..").ControlPanelProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelMobile;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useState, useRef, forwardRef } from "react";
|
|
5
|
+
import { DEFAULT_BURGER_MENU } from "../../shared/constants";
|
|
6
|
+
import { cls } from "../../utils";
|
|
7
|
+
import { isEventTargetNavigationItem } from "../../utils/navigation";
|
|
8
|
+
import DBButton from "../button/button";
|
|
9
|
+
import DBDrawer from "../drawer/drawer";
|
|
10
|
+
function DBControlPanelMobileFn(props, component) {
|
|
11
|
+
var _a;
|
|
12
|
+
const _ref = component || useRef(undefined);
|
|
13
|
+
const [open, setOpen] = useState(() => false);
|
|
14
|
+
function handleToggle(event) {
|
|
15
|
+
if (event.stopPropagation) {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
}
|
|
18
|
+
const reverseOpen = !open;
|
|
19
|
+
setOpen(reverseOpen);
|
|
20
|
+
if (props.onToggle) {
|
|
21
|
+
props.onToggle(reverseOpen);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function handleNavigationItemClick(event) {
|
|
25
|
+
if (isEventTargetNavigationItem(event)) {
|
|
26
|
+
handleToggle(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return (React.createElement("header", Object.assign({ "data-density": "regular", 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-width": props.width, "data-position": props.position, "data-variant": props.variant }, 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-control-panel-mobile", props.className) }),
|
|
30
|
+
React.createElement(DBDrawer, { direction: "custom", spacing: "small", drawerHeaderPlain: props.drawerHeadlinePlain, rounded: true, open: open, onClose: (event) => handleToggle(event) },
|
|
31
|
+
React.createElement("div", { className: "db-control-panel-mobile-drawer-scroll-container", onClick: (event) => handleNavigationItemClick(event) },
|
|
32
|
+
props.children,
|
|
33
|
+
React.createElement(React.Fragment, null, props.metaNavigation)),
|
|
34
|
+
React.createElement(React.Fragment, null, props.secondaryActions)),
|
|
35
|
+
React.createElement(React.Fragment, null, props.flatIconNavigation),
|
|
36
|
+
React.createElement(React.Fragment, null, props.brand),
|
|
37
|
+
React.createElement(React.Fragment, null, props.primaryActions),
|
|
38
|
+
React.createElement(DBButton, { className: "db-control-panel-mobile-button", icon: "menu", type: "button", variant: "ghost", noText: true, onClick: (event) => handleToggle(event) }, (_a = props.burgerMenuLabel) !== null && _a !== void 0 ? _a : DEFAULT_BURGER_MENU)));
|
|
39
|
+
}
|
|
40
|
+
const DBControlPanelMobile = forwardRef(DBControlPanelMobileFn);
|
|
41
|
+
export default DBControlPanelMobile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelMobile } from './control-panel-mobile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelMobile } from './control-panel-mobile';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ContainerWidthProps, ControlPanelProps, GlobalProps, GlobalState, NavigationBehaviorState, ShellControlPanelMobilePositionType, ToggleEventProps, ToggleEventState } from '../../shared/model';
|
|
2
|
+
export declare const ShellControlPanelMobileVariant: readonly ["drawer", "flat-icon"];
|
|
3
|
+
export type ShellControlPanelMobileVariantType = (typeof ShellControlPanelMobileVariant)[number];
|
|
4
|
+
export type DBControlPanelMobileDefaultProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Text to pass in a headline for the drawer header.
|
|
7
|
+
*/
|
|
8
|
+
drawerHeadlinePlain?: string;
|
|
9
|
+
/**
|
|
10
|
+
* This attribute sets the label for the burger menu button for mobile control-panel-desktops.
|
|
11
|
+
*/
|
|
12
|
+
burgerMenuLabel?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Change the position of the mobile content panel
|
|
15
|
+
*/
|
|
16
|
+
position?: ShellControlPanelMobilePositionType;
|
|
17
|
+
/**
|
|
18
|
+
* Change the variant of the mobile content panel
|
|
19
|
+
*/
|
|
20
|
+
variant?: ShellControlPanelMobileVariantType;
|
|
21
|
+
/**
|
|
22
|
+
* Optional flat icon navigation for a mobile app look. Only visible by using variant="flat-icon" as well.
|
|
23
|
+
*/
|
|
24
|
+
flatIconNavigation?: any;
|
|
25
|
+
};
|
|
26
|
+
export type DBControlPanelMobileProps = DBControlPanelMobileDefaultProps & GlobalProps & ToggleEventProps & ContainerWidthProps & ControlPanelProps;
|
|
27
|
+
export type DBControlPanelMobileDefaultState = {
|
|
28
|
+
open: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type DBControlPanelMobileState = DBControlPanelMobileDefaultState & GlobalState & ToggleEventState<HTMLElement> & NavigationBehaviorState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ShellControlPanelMobileVariant = ['drawer', 'flat-icon'];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelPrimaryActions: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps> & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelPrimaryActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useRef, forwardRef } from "react";
|
|
5
|
+
import { cls } from "../../utils";
|
|
6
|
+
function DBControlPanelPrimaryActionsFn(props, component) {
|
|
7
|
+
const _ref = component || useRef(undefined);
|
|
8
|
+
return (React.createElement("div", 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-control-panel-primary-actions", props.className) }), props.children));
|
|
9
|
+
}
|
|
10
|
+
const DBControlPanelPrimaryActions = forwardRef(DBControlPanelPrimaryActionsFn);
|
|
11
|
+
export default DBControlPanelPrimaryActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelPrimaryActions } from './control-panel-primary-actions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelPrimaryActions } from './control-panel-primary-actions';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelPrimaryActionsDefaultProps = {};
|
|
3
|
+
export type DBControlPanelPrimaryActionsProps = DBControlPanelPrimaryActionsDefaultProps & GlobalProps;
|
|
4
|
+
export type DBControlPanelPrimaryActionsDefaultState = {};
|
|
5
|
+
export type DBControlPanelPrimaryActionsState = DBControlPanelPrimaryActionsDefaultState & GlobalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const DBControlPanelSecondaryActions: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, keyof import("../..").GlobalProps> & import("../..").GlobalProps & React.RefAttributes<any>>;
|
|
3
|
+
export default DBControlPanelSecondaryActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
|
+
import { useRef, forwardRef } from "react";
|
|
5
|
+
import { cls } from "../../utils";
|
|
6
|
+
function DBControlPanelSecondaryActionsFn(props, component) {
|
|
7
|
+
const _ref = component || useRef(undefined);
|
|
8
|
+
return (React.createElement("div", 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-control-panel-secondary-actions", props.className) }), props.children));
|
|
9
|
+
}
|
|
10
|
+
const DBControlPanelSecondaryActions = forwardRef(DBControlPanelSecondaryActionsFn);
|
|
11
|
+
export default DBControlPanelSecondaryActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelSecondaryActions } from './control-panel-secondary-actions';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DBControlPanelSecondaryActions } from './control-panel-secondary-actions';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GlobalProps, GlobalState } from '../../shared/model';
|
|
2
|
+
export type DBControlPanelSecondaryActionsDefaultProps = {};
|
|
3
|
+
export type DBControlPanelSecondaryActionsProps = DBControlPanelSecondaryActionsDefaultProps & GlobalProps;
|
|
4
|
+
export type DBControlPanelSecondaryActionsDefaultState = {};
|
|
5
|
+
export type DBControlPanelSecondaryActionsState = DBControlPanelSecondaryActionsDefaultState & GlobalState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBCustomSelect: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "
|
|
2
|
+
declare const DBCustomSelect: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "name" | "label" | "disabled" | "icon" | keyof import("../../shared/model").GlobalProps | "showIcon" | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").RequiredProps | "showLabel" | keyof import("../../shared/model").FormMessageProps | keyof import("./model").DBCustomSelectDefaultProps | keyof import("./model").DBCustomSelectEvents> & import("../../shared/model").GlobalProps & import("../../shared/model").CustomFormProps & {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
} & import("../../shared/model").DisabledProps & import("../../shared/model").RequiredProps & import("../../shared/model").FormMessageProps & import("./model").DBCustomSelectDefaultProps & import("./model").DBCustomSelectEvents & import("../../shared/model").IconProps & import("../../shared/model").ShowIconProps & import("../../shared/model").ShowLabelProps & React.RefAttributes<any>>;
|
|
3
6
|
export default DBCustomSelect;
|
|
@@ -75,7 +75,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
75
75
|
DEFAULT_INVALID_MESSAGE);
|
|
76
76
|
if (hasVoiceOver()) {
|
|
77
77
|
set_voiceOverFallback(_invalidMessage);
|
|
78
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
78
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
79
79
|
}
|
|
80
80
|
if (_userInteraction) {
|
|
81
81
|
set_validity((_c = props.validation) !== null && _c !== void 0 ? _c : "invalid");
|
|
@@ -87,7 +87,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
87
87
|
set_descByIds(_validMessageId);
|
|
88
88
|
if (hasVoiceOver()) {
|
|
89
89
|
set_voiceOverFallback((_e = props.validMessage) !== null && _e !== void 0 ? _e : DEFAULT_VALID_MESSAGE);
|
|
90
|
-
delay(() => set_voiceOverFallback(""), 1000);
|
|
90
|
+
void delay(() => set_voiceOverFallback(""), 1000);
|
|
91
91
|
}
|
|
92
92
|
set_validity((_f = props.validation) !== null && _f !== void 0 ? _f : "valid");
|
|
93
93
|
}
|
|
@@ -176,7 +176,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
176
176
|
const dropdown = detailsRef.current.querySelector("article");
|
|
177
177
|
if (dropdown) {
|
|
178
178
|
// This is a workaround for Angular
|
|
179
|
-
delay(() => {
|
|
179
|
+
void delay(() => {
|
|
180
180
|
var _a;
|
|
181
181
|
handleFixedDropdown(dropdown, detailsRef.current, (_a = props.placement) !== null && _a !== void 0 ? _a : "bottom");
|
|
182
182
|
}, 1);
|
|
@@ -217,7 +217,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
217
217
|
// or to the last checkbox
|
|
218
218
|
const search = getSearchInput(detailsRef.current);
|
|
219
219
|
if (search) {
|
|
220
|
-
delay(() => {
|
|
220
|
+
void delay(() => {
|
|
221
221
|
search.focus();
|
|
222
222
|
}, 100);
|
|
223
223
|
}
|
|
@@ -282,7 +282,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
282
282
|
if (!detailsRef.current.contains(relatedTarget)) {
|
|
283
283
|
// We need to use delay here because the combination of `contains`
|
|
284
284
|
// and changing the DOM element causes a race condition inside browser
|
|
285
|
-
delay(() => (detailsRef.current.open = false), 1);
|
|
285
|
+
void delay(() => (detailsRef.current.open = false), 1);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -355,7 +355,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
355
355
|
? checkboxes.at(1)
|
|
356
356
|
: first;
|
|
357
357
|
if (checkbox) {
|
|
358
|
-
delay(() => {
|
|
358
|
+
void delay(() => {
|
|
359
359
|
// Takes some time until element can be focused
|
|
360
360
|
checkbox.focus();
|
|
361
361
|
}, 1);
|
|
@@ -368,7 +368,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
368
368
|
// Focus search if possible
|
|
369
369
|
const search = getSearchInput(detailsRef.current);
|
|
370
370
|
if (search) {
|
|
371
|
-
delay(() => {
|
|
371
|
+
void delay(() => {
|
|
372
372
|
// Takes some time until element can be focused
|
|
373
373
|
search.focus();
|
|
374
374
|
}, 1);
|
|
@@ -189,6 +189,9 @@ export type DBCustomSelectDefaultState = {
|
|
|
189
189
|
_infoTextId?: string;
|
|
190
190
|
_internalChangeTimestamp: number;
|
|
191
191
|
_documentClickListenerCallbackId?: string;
|
|
192
|
+
_documentScrollListenerCallbackId?: string;
|
|
193
|
+
handleDocumentScroll: (event: any) => void;
|
|
194
|
+
_observer?: IntersectionObserver;
|
|
192
195
|
_searchValue?: string;
|
|
193
196
|
_userInteraction?: boolean;
|
|
194
197
|
getNativeSelectValue: () => string;
|
|
@@ -199,7 +202,7 @@ export type DBCustomSelectDefaultState = {
|
|
|
199
202
|
searchEnabled: boolean;
|
|
200
203
|
amountOptions: number;
|
|
201
204
|
setDescById: (descId?: string) => void;
|
|
202
|
-
handleTagRemove: (option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | void) => void;
|
|
205
|
+
handleTagRemove: (option: CustomSelectOptionType, event?: ClickEvent<HTMLButtonElement> | void | any) => void;
|
|
203
206
|
handleSummaryFocus: () => void;
|
|
204
207
|
handleSelect: (value?: string) => void;
|
|
205
208
|
handleSelectAll: (event: any) => void;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBCustomSelectListItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "value" | "icon" | "checked" | keyof import("../../shared/model").GlobalProps | "showIcon" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("
|
|
2
|
+
declare const DBCustomSelectListItem: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<any>, "name" | "value" | "label" | "disabled" | "icon" | "checked" | keyof import("../../shared/model").GlobalProps | "showIcon" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("./model").DBCustomSelectListItemDefaultProps | "isGroupTitle" | "showDivider"> & import("./model").DBCustomSelectListItemDefaultProps & import("../../shared/model").GlobalProps & {
|
|
3
|
+
label?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
} & import("../../shared/model").DisabledProps & import("../../shared/model").ValueProps & import("../../shared/model").FormCheckProps & import("../../shared/model").ChangeEventProps<HTMLInputElement> & {
|
|
3
6
|
isGroupTitle?: boolean;
|
|
4
7
|
showDivider?: boolean;
|
|
5
8
|
} & import("../../shared/model").IconProps & import("../../shared/model").ShowIconProps & React.RefAttributes<any>>;
|
|
@@ -58,7 +58,7 @@ function DBDrawerFn(props, component) {
|
|
|
58
58
|
if (dialogContainerRef.current) {
|
|
59
59
|
dialogContainerRef.current.hidden = true;
|
|
60
60
|
}
|
|
61
|
-
delay(() => {
|
|
61
|
+
void delay(() => {
|
|
62
62
|
var _a;
|
|
63
63
|
if (dialogContainerRef.current) {
|
|
64
64
|
dialogContainerRef.current.hidden = false;
|
|
@@ -87,9 +87,9 @@ function DBDrawerFn(props, component) {
|
|
|
87
87
|
return (React.createElement("dialog", Object.assign({ className: "db-drawer", id: props.id, 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", "onClose"]), { onClick: (event) => handleClose(event), onKeyDown: (event) => handleClose(event), "data-position": props.position, "data-backdrop": props.backdrop, "data-direction": props.direction, "data-variant": props.variant }),
|
|
88
88
|
React.createElement("article", Object.assign({ ref: dialogContainerRef }, 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-drawer-container", props.className), "data-spacing": props.spacing, "data-width": props.width, "data-direction": props.direction, "data-rounded": getBooleanAsString(props.rounded) }),
|
|
89
89
|
React.createElement("header", { className: "db-drawer-header" },
|
|
90
|
-
React.createElement("div", { className: "db-drawer-header-text" },
|
|
91
|
-
React.createElement(React.Fragment, null, props.drawerHeader)),
|
|
92
|
-
React.createElement(DBButton, { className: "button-close-drawer", icon: "cross", variant: "ghost", id: props.closeButtonId, noText: true, onClick: (event) => handleClose(event, true) }, (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : DEFAULT_CLOSE_BUTTON)),
|
|
90
|
+
React.createElement("div", { className: "db-drawer-header-text" }, props.drawerHeaderPlain ? (React.createElement(React.Fragment, null, props.drawerHeaderPlain)) : (React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement(React.Fragment, null, props.drawerHeader)))),
|
|
92
|
+
React.createElement(DBButton, { className: "button-close-drawer", icon: "cross", variant: "ghost", type: "button", id: props.closeButtonId, noText: true, onClick: (event) => handleClose(event, true) }, (_a = props.closeButtonText) !== null && _a !== void 0 ? _a : DEFAULT_CLOSE_BUTTON)),
|
|
93
93
|
React.createElement("div", { className: "db-drawer-content" }, props.children))));
|
|
94
94
|
}
|
|
95
95
|
const DBDrawer = forwardRef(DBDrawerFn);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClickEvent, CloseEventProps, CloseEventState, GeneralKeyboardEvent, GlobalProps, GlobalState, InitializedState, InnerCloseButtonProps, SpacingProps, WidthProps } from '../../shared/model';
|
|
2
2
|
export declare const DrawerBackdropList: readonly ["none", "strong", "weak", "invisible"];
|
|
3
3
|
export type DrawerBackdropType = (typeof DrawerBackdropList)[number];
|
|
4
|
-
export declare const DrawerDirectionList: readonly ["left", "right", "up", "down"];
|
|
4
|
+
export declare const DrawerDirectionList: readonly ["custom", "left", "right", "up", "down"];
|
|
5
5
|
export type DrawerDirectionType = (typeof DrawerDirectionList)[number];
|
|
6
6
|
export declare const DrawerVariantList: readonly ["modal", "inside"];
|
|
7
7
|
export type DrawerVariantType = (typeof DrawerVariantList)[number];
|
|
@@ -22,6 +22,10 @@ export type DBDrawerDefaultProps = {
|
|
|
22
22
|
* Slot for changing the header of the drawer.
|
|
23
23
|
*/
|
|
24
24
|
drawerHeader?: any;
|
|
25
|
+
/**
|
|
26
|
+
* Text for changing the header of the drawer.
|
|
27
|
+
*/
|
|
28
|
+
drawerHeaderPlain?: string;
|
|
25
29
|
/**
|
|
26
30
|
* The open attribute opens or closes the drawer based on the state.
|
|
27
31
|
*/
|