@db-ux/react-core-components 3.0.0 → 3.0.2-copilot-66b0168
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 +11 -0
- package/agent/Accordion.md +47 -0
- package/agent/AccordionItem.md +36 -0
- package/agent/Badge.md +43 -0
- package/agent/Brand.md +24 -0
- package/agent/Button.md +60 -0
- package/agent/Card.md +34 -0
- package/agent/Checkbox.md +41 -0
- package/agent/CustomSelect.md +81 -0
- package/agent/Divider.md +32 -0
- package/agent/Drawer.md +87 -0
- package/agent/Header.md +45 -0
- package/agent/Icon.md +31 -0
- package/agent/Infotext.md +36 -0
- package/agent/Input.md +50 -0
- package/agent/Link.md +63 -0
- package/agent/Navigation.md +31 -0
- package/agent/NavigationItem.md +34 -0
- package/agent/Notification.md +45 -0
- package/agent/Page.md +36 -0
- package/agent/Popover.md +55 -0
- package/agent/Radio.md +34 -0
- package/agent/Section.md +32 -0
- package/agent/Select.md +90 -0
- package/agent/Stack.md +46 -0
- package/agent/Switch.md +41 -0
- package/agent/TabItem.md +34 -0
- package/agent/Tabs.md +75 -0
- package/agent/Tag.md +56 -0
- package/agent/Textarea.md +45 -0
- package/agent/Tooltip.md +47 -0
- package/agent/_instructions.md +31 -0
- package/dist/components/checkbox/checkbox.js +3 -2
- package/dist/components/custom-select/custom-select.js +14 -6
- package/dist/components/custom-select/model.d.ts +1 -0
- package/dist/components/header/header.js +12 -17
- package/dist/components/input/input.js +4 -3
- package/dist/components/select/select.js +2 -1
- package/dist/components/tabs/tabs.js +21 -16
- package/dist/components/textarea/textarea.js +3 -2
- package/dist/index.d.ts +39 -0
- package/dist/index.js +39 -0
- package/package.json +17 -15
package/agent/Tag.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Tag Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
+
import { DBCheckbox } from "@db-ux/react-react-core-components";
|
|
9
|
+
import { DBLink } from "@db-ux/react-react-core-components";
|
|
10
|
+
import { DBRadio } from "@db-ux/react-react-core-components";
|
|
11
|
+
import { DBTag } from "@db-ux/react-react-core-components";
|
|
12
|
+
|
|
13
|
+
function Tag(props: any) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<h1>DBTag Documentation Examples</h1>
|
|
17
|
+
<h2>1. Default Tags</h2>
|
|
18
|
+
<DBTag>
|
|
19
|
+
<DBButton>Tag as Button</DBButton>
|
|
20
|
+
</DBTag>
|
|
21
|
+
<DBTag>
|
|
22
|
+
<DBLink>Tag as Link</DBLink>
|
|
23
|
+
</DBTag>
|
|
24
|
+
<DBTag>
|
|
25
|
+
<DBCheckbox>Tag as Checkbox</DBCheckbox>
|
|
26
|
+
</DBTag>
|
|
27
|
+
<DBTag>
|
|
28
|
+
<DBRadio>Tag as Radio</DBRadio>
|
|
29
|
+
</DBTag>
|
|
30
|
+
<DBTag>Static Tag</DBTag>
|
|
31
|
+
<h2>2. Overflow Example</h2>
|
|
32
|
+
<DBTag overflow>
|
|
33
|
+
<span>Static Tag with overflow</span>
|
|
34
|
+
</DBTag>
|
|
35
|
+
<h2>3. Removable Tag</h2>
|
|
36
|
+
<DBTag
|
|
37
|
+
behavior="removable"
|
|
38
|
+
onRemove={(event) => console.log("Tag removed")}
|
|
39
|
+
>
|
|
40
|
+
Removable Tag
|
|
41
|
+
</DBTag>
|
|
42
|
+
<h2>4. Semantic Variants</h2>
|
|
43
|
+
<DBTag semantic="adaptive">Adaptive Tag</DBTag>
|
|
44
|
+
<DBTag semantic="neutral">Neutral Tag</DBTag>
|
|
45
|
+
<DBTag semantic="critical">Critical Tag</DBTag>
|
|
46
|
+
<DBTag semantic="informational">Informational Tag</DBTag>
|
|
47
|
+
<DBTag semantic="warning">Warning Tag</DBTag>
|
|
48
|
+
<DBTag semantic="successful">Successful Tag</DBTag>
|
|
49
|
+
<h2>5. Icon Support</h2>
|
|
50
|
+
<DBTag icon="user">Tag with Icon</DBTag>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default Tag;
|
|
56
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Textarea Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBTextarea } from "@db-ux/react-react-core-components";
|
|
8
|
+
|
|
9
|
+
function Textarea(props: any) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<h1>DBTextarea Documentation Examples</h1>
|
|
13
|
+
<h2>1. Default Textarea</h2>
|
|
14
|
+
<DBTextarea label="Default Textarea" />
|
|
15
|
+
<h2>2. Resizable Variants</h2>
|
|
16
|
+
<DBTextarea resize="none" label="No Resize" />
|
|
17
|
+
<DBTextarea resize="both" label="Resize Both" />
|
|
18
|
+
<DBTextarea resize="horizontal" label="Resize Horizontal" />
|
|
19
|
+
<DBTextarea resize="vertical" label="Resize Vertical" />
|
|
20
|
+
<h2>3. Rows and Columns</h2>
|
|
21
|
+
<DBTextarea label="Custom Rows and Columns" rows={5} cols={30} />
|
|
22
|
+
<h2>4. Wrap Variants</h2>
|
|
23
|
+
<DBTextarea wrap="hard" label="Hard Wrap" />
|
|
24
|
+
<DBTextarea wrap="soft" label="Soft Wrap" />
|
|
25
|
+
<DBTextarea wrap="off" label="No Wrap" />
|
|
26
|
+
<h2>5. Disabled State</h2>
|
|
27
|
+
<DBTextarea label="Disabled Textarea" disabled />
|
|
28
|
+
<h2>6. Placeholder Examples</h2>
|
|
29
|
+
<DBTextarea placeholder="Enter text here" label="With Placeholder" />
|
|
30
|
+
<h2>7. Message Property Example</h2>
|
|
31
|
+
<DBTextarea
|
|
32
|
+
label="Textarea with Message"
|
|
33
|
+
message="This is a helper message."
|
|
34
|
+
/>
|
|
35
|
+
<h2>8. Input Event Example</h2>
|
|
36
|
+
<DBTextarea
|
|
37
|
+
label="Input Event"
|
|
38
|
+
onInput={(event) => console.log("Input event:", event.target.value)}
|
|
39
|
+
/>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default Textarea;
|
|
45
|
+
```
|
package/agent/Tooltip.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# Tooltip Examples (react)
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { DBButton } from "@db-ux/react-react-core-components";
|
|
8
|
+
import { DBTooltip } from "@db-ux/react-react-core-components";
|
|
9
|
+
|
|
10
|
+
function Tooltip(props: any) {
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<h1>DBTooltip Documentation Examples</h1>
|
|
14
|
+
<h2>1. Default Tooltip</h2>
|
|
15
|
+
<DBButton>
|
|
16
|
+
Hover on me to open Tooltip
|
|
17
|
+
<DBTooltip>Tooltip</DBTooltip>
|
|
18
|
+
</DBButton>
|
|
19
|
+
<h2>2. Tooltip Variants</h2>
|
|
20
|
+
<DBButton>
|
|
21
|
+
Description Tooltip
|
|
22
|
+
<DBTooltip variant="description">Description Tooltip Content</DBTooltip>
|
|
23
|
+
</DBButton>
|
|
24
|
+
<DBButton>
|
|
25
|
+
Label Tooltip
|
|
26
|
+
<DBTooltip variant="label">Label Tooltip Content</DBTooltip>
|
|
27
|
+
</DBButton>
|
|
28
|
+
<h2>3. Tooltip with Arrow</h2>
|
|
29
|
+
<DBButton>
|
|
30
|
+
Tooltip with Arrow
|
|
31
|
+
<DBTooltip showArrow>Tooltip Content with Arrow</DBTooltip>
|
|
32
|
+
</DBButton>
|
|
33
|
+
<h2>4. Placement Variants</h2>
|
|
34
|
+
<DBButton>
|
|
35
|
+
Top Placement
|
|
36
|
+
<DBTooltip placement="top">Tooltip Content at Top</DBTooltip>
|
|
37
|
+
</DBButton>
|
|
38
|
+
<DBButton>
|
|
39
|
+
Bottom Placement
|
|
40
|
+
<DBTooltip placement="bottom">Tooltip Content at Bottom</DBTooltip>
|
|
41
|
+
</DBButton>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default Tooltip;
|
|
47
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
- Use "@db-ux/react-core-components" as import for components:
|
|
2
|
+
- use for `DBDrawer` or `Drawer` the file __agent-path__/Drawer.md
|
|
3
|
+
- use for `DBTooltip` or `Tooltip` the file __agent-path__/Tooltip.md
|
|
4
|
+
- use for `DBTextarea` or `Textarea` the file __agent-path__/Textarea.md
|
|
5
|
+
- use for `DBTag` or `Tag` the file __agent-path__/Tag.md
|
|
6
|
+
- use for `DBTabs` or `Tabs` the file __agent-path__/Tabs.md
|
|
7
|
+
- use for `DBTabItem` or `TabItem` the file __agent-path__/TabItem.md
|
|
8
|
+
- use for `DBSwitch` or `Switch` the file __agent-path__/Switch.md
|
|
9
|
+
- use for `DBStack` or `Stack` the file __agent-path__/Stack.md
|
|
10
|
+
- use for `DBSelect` or `Select` the file __agent-path__/Select.md
|
|
11
|
+
- use for `DBSection` or `Section` the file __agent-path__/Section.md
|
|
12
|
+
- use for `DBRadio` or `Radio` the file __agent-path__/Radio.md
|
|
13
|
+
- use for `DBPopover` or `Popover` the file __agent-path__/Popover.md
|
|
14
|
+
- use for `DBPage` or `Page` the file __agent-path__/Page.md
|
|
15
|
+
- use for `DBNotification` or `Notification` the file __agent-path__/Notification.md
|
|
16
|
+
- use for `DBNavigationItem` or `NavigationItem` the file __agent-path__/NavigationItem.md
|
|
17
|
+
- use for `DBNavigation` or `Navigation` the file __agent-path__/Navigation.md
|
|
18
|
+
- use for `DBLink` or `Link` the file __agent-path__/Link.md
|
|
19
|
+
- use for `DBInput` or `Input` the file __agent-path__/Input.md
|
|
20
|
+
- use for `DBInfotext` or `Infotext` the file __agent-path__/Infotext.md
|
|
21
|
+
- use for `DBIcon` or `Icon` the file __agent-path__/Icon.md
|
|
22
|
+
- use for `DBHeader` or `Header` the file __agent-path__/Header.md
|
|
23
|
+
- use for `DBDivider` or `Divider` the file __agent-path__/Divider.md
|
|
24
|
+
- use for `DBCustomSelect` or `CustomSelect` the file __agent-path__/CustomSelect.md
|
|
25
|
+
- use for `DBCheckbox` or `Checkbox` the file __agent-path__/Checkbox.md
|
|
26
|
+
- use for `DBCard` or `Card` the file __agent-path__/Card.md
|
|
27
|
+
- use for `DBButton` or `Button` the file __agent-path__/Button.md
|
|
28
|
+
- use for `DBBrand` or `Brand` the file __agent-path__/Brand.md
|
|
29
|
+
- use for `DBBadge` or `Badge` the file __agent-path__/Badge.md
|
|
30
|
+
- use for `DBAccordionItem` or `AccordionItem` the file __agent-path__/AccordionItem.md
|
|
31
|
+
- use for `DBAccordion` or `Accordion` the file __agent-path__/Accordion.md
|
|
@@ -14,7 +14,7 @@ function DBCheckboxFn(props, component) {
|
|
|
14
14
|
const [_validMessageId, set_validMessageId] = useState(() => undefined);
|
|
15
15
|
const [_invalidMessageId, set_invalidMessageId] = useState(() => undefined);
|
|
16
16
|
const [_invalidMessage, set_invalidMessage] = useState(() => undefined);
|
|
17
|
-
const [_descByIds, set_descByIds] = useState(() =>
|
|
17
|
+
const [_descByIds, set_descByIds] = useState(() => undefined);
|
|
18
18
|
const [_voiceOverFallback, set_voiceOverFallback] = useState(() => "");
|
|
19
19
|
function hasValidState() {
|
|
20
20
|
var _a;
|
|
@@ -46,7 +46,7 @@ function DBCheckboxFn(props, component) {
|
|
|
46
46
|
set_descByIds(_messageId);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
set_descByIds(
|
|
49
|
+
set_descByIds(undefined);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function handleChange(event) {
|
|
@@ -90,6 +90,7 @@ function DBCheckboxFn(props, component) {
|
|
|
90
90
|
if (stringPropVisible(props.message, props.showMessage)) {
|
|
91
91
|
set_descByIds(messageId);
|
|
92
92
|
}
|
|
93
|
+
handleValidation();
|
|
93
94
|
}
|
|
94
95
|
}, [_id]);
|
|
95
96
|
useEffect(() => {
|
|
@@ -34,7 +34,8 @@ function DBCustomSelectFn(props, component) {
|
|
|
34
34
|
const [_placeholderId, set_placeholderId] = useState(() => undefined);
|
|
35
35
|
const [_infoTextId, set_infoTextId] = useState(() => undefined);
|
|
36
36
|
const [_validity, set_validity] = useState(() => "no-validation");
|
|
37
|
-
const [
|
|
37
|
+
const [_userInteraction, set_userInteraction] = useState(() => false);
|
|
38
|
+
const [_descByIds, set_descByIds] = useState(() => undefined);
|
|
38
39
|
const [_selectedLabels, set_selectedLabels] = useState(() => "");
|
|
39
40
|
const [_selectedLabelsId, set_selectedLabelsId] = useState(() => undefined);
|
|
40
41
|
const [_voiceOverFallback, set_voiceOverFallback] = useState(() => "");
|
|
@@ -76,7 +77,9 @@ function DBCustomSelectFn(props, component) {
|
|
|
76
77
|
set_voiceOverFallback(_invalidMessage);
|
|
77
78
|
delay(() => set_voiceOverFallback(""), 1000);
|
|
78
79
|
}
|
|
79
|
-
|
|
80
|
+
if (_userInteraction) {
|
|
81
|
+
set_validity((_c = props.validation) !== null && _c !== void 0 ? _c : "invalid");
|
|
82
|
+
}
|
|
80
83
|
}
|
|
81
84
|
else if (hasValidState() &&
|
|
82
85
|
((_d = selectRef.current) === null || _d === void 0 ? void 0 : _d.validity.valid) &&
|
|
@@ -300,6 +303,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
300
303
|
if (skip)
|
|
301
304
|
return;
|
|
302
305
|
set_values(values);
|
|
306
|
+
set_userInteraction(true);
|
|
303
307
|
if (props.onOptionSelected) {
|
|
304
308
|
props.onOptionSelected(values !== null && values !== void 0 ? values : []);
|
|
305
309
|
}
|
|
@@ -485,7 +489,7 @@ function DBCustomSelectFn(props, component) {
|
|
|
485
489
|
else if (_options) {
|
|
486
490
|
set_hasNoOptions(_options.length === 0);
|
|
487
491
|
}
|
|
488
|
-
}, [props.showNoResults, _options]);
|
|
492
|
+
}, [props.showNoResults, props.showLoading, _options]);
|
|
489
493
|
useEffect(() => {
|
|
490
494
|
var _a;
|
|
491
495
|
setSelectAllEnabled(Boolean(props.multiple && ((_a = props.showSelectAll) !== null && _a !== void 0 ? _a : amountOptions > 5)));
|
|
@@ -503,8 +507,10 @@ function DBCustomSelectFn(props, component) {
|
|
|
503
507
|
}
|
|
504
508
|
}, [props.values]);
|
|
505
509
|
useEffect(() => {
|
|
506
|
-
|
|
507
|
-
|
|
510
|
+
if (selectRef.current) {
|
|
511
|
+
handleValidation();
|
|
512
|
+
}
|
|
513
|
+
}, [_values, selectRef.current]);
|
|
508
514
|
useEffect(() => {
|
|
509
515
|
set_validity(props.validation);
|
|
510
516
|
}, [props.validation]);
|
|
@@ -611,7 +617,9 @@ function DBCustomSelectFn(props, component) {
|
|
|
611
617
|
React.createElement(DBInput, { type: "search", ref: searchInputRef, name: _id, form: _id, showLabel: false, value: _searchValue, label: (_d = props.searchLabel) !== null && _d !== void 0 ? _d : DEFAULT_LABEL, placeholder: (_e = props.searchPlaceholder) !== null && _e !== void 0 ? _e : props.searchLabel, ariaDescribedBy: _hasNoOptions || props.showLoading
|
|
612
618
|
? _infoTextId
|
|
613
619
|
: undefined, onInput: (event) => handleSearch(event) }))) : null,
|
|
614
|
-
_hasNoOptions || props.showLoading ? (React.createElement(DBInfotext, { id: _infoTextId, icon:
|
|
620
|
+
_hasNoOptions || props.showLoading ? (React.createElement(DBInfotext, { id: _infoTextId, icon: props.showLoading ? "circular_arrows" : undefined, semantic: props.showLoading ? "informational" : "warning" }, (_f = (props.showLoading
|
|
621
|
+
? props.loadingText
|
|
622
|
+
: props.noResultsText)) !== null && _f !== void 0 ? _f : DEFAULT_MESSAGE)) : (React.createElement(React.Fragment, null,
|
|
615
623
|
React.createElement(React.Fragment, null,
|
|
616
624
|
selectAllEnabled ? (React.createElement("div", null,
|
|
617
625
|
React.createElement("div", { className: "db-checkbox db-custom-select-list-item" },
|
|
@@ -190,6 +190,7 @@ export type DBCustomSelectDefaultState = {
|
|
|
190
190
|
_internalChangeTimestamp: number;
|
|
191
191
|
_documentClickListenerCallbackId?: string;
|
|
192
192
|
_searchValue?: string;
|
|
193
|
+
_userInteraction?: boolean;
|
|
193
194
|
getNativeSelectValue: () => string;
|
|
194
195
|
getOptionLabel: (option: CustomSelectOptionType) => string;
|
|
195
196
|
getOptionChecked: (value?: string) => boolean;
|
|
@@ -2,15 +2,14 @@
|
|
|
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 { DEFAULT_BURGER_MENU
|
|
6
|
-
import { addAttributeToChildren, cls, getBoolean
|
|
5
|
+
import { DEFAULT_BURGER_MENU } from "../../shared/constants";
|
|
6
|
+
import { addAttributeToChildren, cls, getBoolean } from "../../utils";
|
|
7
7
|
import { isEventTargetNavigationItem } from "../../utils/navigation";
|
|
8
8
|
import DBButton from "../button/button";
|
|
9
9
|
import DBDrawer from "../drawer/drawer";
|
|
10
10
|
function DBHeaderFn(props, component) {
|
|
11
11
|
var _a;
|
|
12
12
|
const _ref = component || useRef(component);
|
|
13
|
-
const [_id, set_id] = useState(() => DEFAULT_ID);
|
|
14
13
|
const [initialized, setInitialized] = useState(() => false);
|
|
15
14
|
const [forcedToMobile, setForcedToMobile] = useState(() => false);
|
|
16
15
|
function handleToggle(event) {
|
|
@@ -29,23 +28,19 @@ function DBHeaderFn(props, component) {
|
|
|
29
28
|
}
|
|
30
29
|
useEffect(() => {
|
|
31
30
|
setInitialized(true);
|
|
32
|
-
set_id(props.id || "header-" + uuid());
|
|
33
31
|
}, []);
|
|
34
32
|
useEffect(() => {
|
|
35
|
-
if (initialized &&
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
value: "true",
|
|
43
|
-
});
|
|
44
|
-
}
|
|
33
|
+
if (initialized && _ref.current && props.forceMobile) {
|
|
34
|
+
// Adds this attribute to the header to enable all styling which would have
|
|
35
|
+
// @media screen and (min-width: $db-screens-m) to show mobile navigation on a desktop device
|
|
36
|
+
addAttributeToChildren(_ref.current, {
|
|
37
|
+
key: "data-force-mobile",
|
|
38
|
+
value: "true",
|
|
39
|
+
});
|
|
45
40
|
setForcedToMobile(true);
|
|
46
41
|
}
|
|
47
|
-
}, [initialized]);
|
|
48
|
-
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-header", props.className), id:
|
|
42
|
+
}, [initialized, _ref.current]);
|
|
43
|
+
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-header", props.className), id: props.id, "data-width": props.width, "data-on-forcing-mobile": props.forceMobile && !forcedToMobile }),
|
|
49
44
|
React.createElement(DBDrawer, { className: "db-header-drawer", spacing: "small", rounded: true, open: getBoolean(props.drawerOpen), onClose: (event) => handleToggle() },
|
|
50
45
|
React.createElement("div", { className: "db-header-drawer-navigation" },
|
|
51
46
|
React.createElement("div", { className: "db-header-navigation", onClick: (event) => handleNavigationItemClick(event) }, props.children),
|
|
@@ -64,7 +59,7 @@ function DBHeaderFn(props, component) {
|
|
|
64
59
|
React.createElement(React.Fragment, null, props.primaryAction))),
|
|
65
60
|
React.createElement("div", { className: "db-header-action-container" },
|
|
66
61
|
React.createElement("div", { className: "db-header-burger-menu-container" },
|
|
67
|
-
React.createElement(DBButton, { icon: "menu", variant: "ghost",
|
|
62
|
+
React.createElement(DBButton, { icon: "menu", variant: "ghost", noText: true, onClick: (event) => handleToggle() }, (_a = props.burgerMenuLabel) !== null && _a !== void 0 ? _a : DEFAULT_BURGER_MENU)),
|
|
68
63
|
React.createElement("div", { className: "db-header-secondary-action" },
|
|
69
64
|
React.createElement(React.Fragment, null, props.secondaryAction))))));
|
|
70
65
|
}
|
|
@@ -14,8 +14,8 @@ function DBInputFn(props, component) {
|
|
|
14
14
|
const [_invalidMessageId, set_invalidMessageId] = useState(() => undefined);
|
|
15
15
|
const [_invalidMessage, set_invalidMessage] = useState(() => undefined);
|
|
16
16
|
const [_dataListId, set_dataListId] = useState(() => undefined);
|
|
17
|
-
const [_descByIds, set_descByIds] = useState(() =>
|
|
18
|
-
const [_value, set_value] = useState(() =>
|
|
17
|
+
const [_descByIds, set_descByIds] = useState(() => undefined);
|
|
18
|
+
const [_value, set_value] = useState(() => undefined);
|
|
19
19
|
const [_voiceOverFallback, set_voiceOverFallback] = useState(() => "");
|
|
20
20
|
function hasValidState() {
|
|
21
21
|
var _a;
|
|
@@ -47,7 +47,7 @@ function DBInputFn(props, component) {
|
|
|
47
47
|
set_descByIds(_messageId);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
set_descByIds(
|
|
50
|
+
set_descByIds(undefined);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function handleInput(event) {
|
|
@@ -108,6 +108,7 @@ function DBInputFn(props, component) {
|
|
|
108
108
|
if (stringPropVisible(props.message, props.showMessage)) {
|
|
109
109
|
set_descByIds(messageId);
|
|
110
110
|
}
|
|
111
|
+
handleValidation();
|
|
111
112
|
}
|
|
112
113
|
}, [_id]);
|
|
113
114
|
useEffect(() => {
|
|
@@ -14,7 +14,7 @@ function DBSelectFn(props, component) {
|
|
|
14
14
|
const [_invalidMessageId, set_invalidMessageId] = useState(() => undefined);
|
|
15
15
|
const [_invalidMessage, set_invalidMessage] = useState(() => undefined);
|
|
16
16
|
const [_placeholderId, set_placeholderId] = useState(() => "");
|
|
17
|
-
const [_descByIds, set_descByIds] = useState(() =>
|
|
17
|
+
const [_descByIds, set_descByIds] = useState(() => undefined);
|
|
18
18
|
const [_value, set_value] = useState(() => "");
|
|
19
19
|
const [initialized, setInitialized] = useState(() => false);
|
|
20
20
|
const [_voiceOverFallback, set_voiceOverFallback] = useState(() => "");
|
|
@@ -113,6 +113,7 @@ function DBSelectFn(props, component) {
|
|
|
113
113
|
else {
|
|
114
114
|
set_descByIds(placeholderId);
|
|
115
115
|
}
|
|
116
|
+
handleValidation();
|
|
116
117
|
setInitialized(false);
|
|
117
118
|
}
|
|
118
119
|
}, [_id, initialized]);
|
|
@@ -102,24 +102,29 @@ function DBTabsFn(props, component) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
function handleChange(event) {
|
|
105
|
-
var _a
|
|
105
|
+
var _a;
|
|
106
106
|
event.stopPropagation();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
if (event.target) {
|
|
108
|
+
const target = event.target;
|
|
109
|
+
const parent = target.parentElement;
|
|
110
|
+
if (parent &&
|
|
111
|
+
parent.parentElement &&
|
|
112
|
+
((_a = parent.parentElement) === null || _a === void 0 ? void 0 : _a.nodeName) === "LI") {
|
|
113
|
+
const tabItem = parent.parentElement;
|
|
114
|
+
if (tabItem) {
|
|
115
|
+
const list = tabItem.parentElement;
|
|
116
|
+
if (list) {
|
|
117
|
+
const indices = Array.from(list.childNodes).indexOf(tabItem);
|
|
118
|
+
if (props.onIndexChange) {
|
|
119
|
+
props.onIndexChange(indices);
|
|
120
|
+
}
|
|
121
|
+
if (props.onTabSelect) {
|
|
122
|
+
props.onTabSelect(event);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
|
-
if (props.onTabSelect) {
|
|
121
|
-
props.onTabSelect(event);
|
|
122
|
-
}
|
|
123
128
|
}
|
|
124
129
|
useEffect(() => {
|
|
125
130
|
set_id(props.id || _id);
|
|
@@ -148,7 +153,7 @@ function DBTabsFn(props, component) {
|
|
|
148
153
|
setInitialized(false);
|
|
149
154
|
}
|
|
150
155
|
}, [_ref.current, initialized]);
|
|
151
|
-
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", "onTabSelect", "onIndexChange"]), { id: _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-tabs", props.className), "data-orientation": props.orientation, "data-scroll-behavior": props.behavior, "data-alignment": (_a = props.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = props.width) !== null && _b !== void 0 ? _b : "auto", onInput: (event) => handleChange(event) }),
|
|
156
|
+
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", "onTabSelect", "onIndexChange"]), { id: _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-tabs", props.className), "data-orientation": props.orientation, "data-scroll-behavior": props.behavior, "data-alignment": (_a = props.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = props.width) !== null && _b !== void 0 ? _b : "auto", onInput: (event) => handleChange(event), onChange: (event) => handleChange(event) }),
|
|
152
157
|
showScrollLeft ? (React.createElement(DBButton, { className: "tabs-scroll-left", variant: "ghost", icon: "chevron_left", type: "button", noText: true, onClick: (event) => scroll(true) }, "Scroll left")) : null,
|
|
153
158
|
props.tabs ? (React.createElement(React.Fragment, null,
|
|
154
159
|
React.createElement(DBTabList, null, (_c = convertTabs()) === null || _c === void 0 ? void 0 : _c.map((tab, index) => (React.createElement(DBTabItem, { key: props.name + "tab-item" + index, active: tab.active, label: tab.label, iconTrailing: tab.iconTrailing, icon: tab.icon, noText: tab.noText })))), (_d = convertTabs()) === null || _d === void 0 ? void 0 :
|
|
@@ -13,7 +13,7 @@ function DBTextareaFn(props, component) {
|
|
|
13
13
|
const [_validMessageId, set_validMessageId] = useState(() => undefined);
|
|
14
14
|
const [_invalidMessageId, set_invalidMessageId] = useState(() => undefined);
|
|
15
15
|
const [_invalidMessage, set_invalidMessage] = useState(() => undefined);
|
|
16
|
-
const [_descByIds, set_descByIds] = useState(() =>
|
|
16
|
+
const [_descByIds, set_descByIds] = useState(() => undefined);
|
|
17
17
|
const [_value, set_value] = useState(() => "");
|
|
18
18
|
const [_voiceOverFallback, set_voiceOverFallback] = useState(() => "");
|
|
19
19
|
function hasValidState() {
|
|
@@ -46,7 +46,7 @@ function DBTextareaFn(props, component) {
|
|
|
46
46
|
set_descByIds(_messageId);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
set_descByIds(
|
|
49
|
+
set_descByIds(undefined);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
function handleInput(event) {
|
|
@@ -95,6 +95,7 @@ function DBTextareaFn(props, component) {
|
|
|
95
95
|
if (stringPropVisible(props.message, props.showMessage)) {
|
|
96
96
|
set_descByIds(messageId);
|
|
97
97
|
}
|
|
98
|
+
handleValidation();
|
|
98
99
|
}
|
|
99
100
|
}, [_id]);
|
|
100
101
|
useEffect(() => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,40 +1,79 @@
|
|
|
1
1
|
export * from './components/accordion';
|
|
2
2
|
export * from './components/accordion-item';
|
|
3
|
+
export * from './components/accordion-item/model';
|
|
4
|
+
export * from './components/accordion/model';
|
|
3
5
|
export * from './components/badge';
|
|
6
|
+
export * from './components/badge/model';
|
|
4
7
|
export * from './components/brand';
|
|
8
|
+
export * from './components/brand/model';
|
|
5
9
|
export * from './components/button';
|
|
10
|
+
export * from './components/button/model';
|
|
6
11
|
export * from './components/card';
|
|
12
|
+
export * from './components/card/model';
|
|
7
13
|
export * from './components/checkbox';
|
|
14
|
+
export * from './components/checkbox/model';
|
|
8
15
|
export * from './components/custom-select';
|
|
9
16
|
export * from './components/custom-select-dropdown';
|
|
17
|
+
export * from './components/custom-select-dropdown/model';
|
|
10
18
|
export * from './components/custom-select-form-field';
|
|
19
|
+
export * from './components/custom-select-form-field/model';
|
|
11
20
|
export * from './components/custom-select-list';
|
|
12
21
|
export * from './components/custom-select-list-item';
|
|
22
|
+
export * from './components/custom-select-list-item/model';
|
|
23
|
+
export * from './components/custom-select-list/model';
|
|
24
|
+
export * from './components/custom-select/model';
|
|
13
25
|
export * from './components/divider';
|
|
26
|
+
export * from './components/divider/model';
|
|
14
27
|
export * from './components/drawer';
|
|
28
|
+
export * from './components/drawer/model';
|
|
15
29
|
export * from './components/header';
|
|
30
|
+
export * from './components/header/model';
|
|
16
31
|
export * from './components/icon';
|
|
32
|
+
export * from './components/icon/model';
|
|
17
33
|
export * from './components/infotext';
|
|
34
|
+
export * from './components/infotext/model';
|
|
18
35
|
export * from './components/input';
|
|
36
|
+
export * from './components/input/model';
|
|
19
37
|
export * from './components/link';
|
|
38
|
+
export * from './components/link/model';
|
|
20
39
|
export * from './components/navigation';
|
|
21
40
|
export * from './components/navigation-item';
|
|
41
|
+
export * from './components/navigation-item/model';
|
|
42
|
+
export * from './components/navigation/model';
|
|
22
43
|
export * from './components/notification';
|
|
44
|
+
export * from './components/notification/model';
|
|
23
45
|
export * from './components/page';
|
|
46
|
+
export * from './components/page/model';
|
|
24
47
|
export * from './components/popover';
|
|
48
|
+
export * from './components/popover/model';
|
|
25
49
|
export * from './components/radio';
|
|
50
|
+
export * from './components/radio/model';
|
|
26
51
|
export * from './components/section';
|
|
52
|
+
export * from './components/section/model';
|
|
27
53
|
export * from './components/select';
|
|
54
|
+
export * from './components/select/model';
|
|
28
55
|
export * from './components/stack';
|
|
56
|
+
export * from './components/stack/model';
|
|
29
57
|
export * from './components/switch';
|
|
58
|
+
export * from './components/switch/model';
|
|
30
59
|
export * from './components/tab-item';
|
|
60
|
+
export * from './components/tab-item/model';
|
|
31
61
|
export * from './components/tab-list';
|
|
62
|
+
export * from './components/tab-list/model';
|
|
32
63
|
export * from './components/tab-panel';
|
|
64
|
+
export * from './components/tab-panel/model';
|
|
33
65
|
export * from './components/tabs';
|
|
66
|
+
export * from './components/tabs/model';
|
|
34
67
|
export * from './components/tag';
|
|
68
|
+
export * from './components/tag/model';
|
|
35
69
|
export * from './components/textarea';
|
|
70
|
+
export * from './components/textarea/model';
|
|
36
71
|
export * from './components/tooltip';
|
|
72
|
+
export * from './components/tooltip/model';
|
|
37
73
|
export * from './shared/constants';
|
|
38
74
|
export * from './shared/model';
|
|
75
|
+
export * from './utils/document-click-listener';
|
|
76
|
+
export * from './utils/document-scroll-listener';
|
|
77
|
+
export * from './utils/floating-components';
|
|
39
78
|
export * from './utils/index';
|
|
40
79
|
export * from './utils/navigation';
|
package/dist/index.js
CHANGED
|
@@ -1,40 +1,79 @@
|
|
|
1
1
|
export * from './components/accordion';
|
|
2
2
|
export * from './components/accordion-item';
|
|
3
|
+
export * from './components/accordion-item/model';
|
|
4
|
+
export * from './components/accordion/model';
|
|
3
5
|
export * from './components/badge';
|
|
6
|
+
export * from './components/badge/model';
|
|
4
7
|
export * from './components/brand';
|
|
8
|
+
export * from './components/brand/model';
|
|
5
9
|
export * from './components/button';
|
|
10
|
+
export * from './components/button/model';
|
|
6
11
|
export * from './components/card';
|
|
12
|
+
export * from './components/card/model';
|
|
7
13
|
export * from './components/checkbox';
|
|
14
|
+
export * from './components/checkbox/model';
|
|
8
15
|
export * from './components/custom-select';
|
|
9
16
|
export * from './components/custom-select-dropdown';
|
|
17
|
+
export * from './components/custom-select-dropdown/model';
|
|
10
18
|
export * from './components/custom-select-form-field';
|
|
19
|
+
export * from './components/custom-select-form-field/model';
|
|
11
20
|
export * from './components/custom-select-list';
|
|
12
21
|
export * from './components/custom-select-list-item';
|
|
22
|
+
export * from './components/custom-select-list-item/model';
|
|
23
|
+
export * from './components/custom-select-list/model';
|
|
24
|
+
export * from './components/custom-select/model';
|
|
13
25
|
export * from './components/divider';
|
|
26
|
+
export * from './components/divider/model';
|
|
14
27
|
export * from './components/drawer';
|
|
28
|
+
export * from './components/drawer/model';
|
|
15
29
|
export * from './components/header';
|
|
30
|
+
export * from './components/header/model';
|
|
16
31
|
export * from './components/icon';
|
|
32
|
+
export * from './components/icon/model';
|
|
17
33
|
export * from './components/infotext';
|
|
34
|
+
export * from './components/infotext/model';
|
|
18
35
|
export * from './components/input';
|
|
36
|
+
export * from './components/input/model';
|
|
19
37
|
export * from './components/link';
|
|
38
|
+
export * from './components/link/model';
|
|
20
39
|
export * from './components/navigation';
|
|
21
40
|
export * from './components/navigation-item';
|
|
41
|
+
export * from './components/navigation-item/model';
|
|
42
|
+
export * from './components/navigation/model';
|
|
22
43
|
export * from './components/notification';
|
|
44
|
+
export * from './components/notification/model';
|
|
23
45
|
export * from './components/page';
|
|
46
|
+
export * from './components/page/model';
|
|
24
47
|
export * from './components/popover';
|
|
48
|
+
export * from './components/popover/model';
|
|
25
49
|
export * from './components/radio';
|
|
50
|
+
export * from './components/radio/model';
|
|
26
51
|
export * from './components/section';
|
|
52
|
+
export * from './components/section/model';
|
|
27
53
|
export * from './components/select';
|
|
54
|
+
export * from './components/select/model';
|
|
28
55
|
export * from './components/stack';
|
|
56
|
+
export * from './components/stack/model';
|
|
29
57
|
export * from './components/switch';
|
|
58
|
+
export * from './components/switch/model';
|
|
30
59
|
export * from './components/tab-item';
|
|
60
|
+
export * from './components/tab-item/model';
|
|
31
61
|
export * from './components/tab-list';
|
|
62
|
+
export * from './components/tab-list/model';
|
|
32
63
|
export * from './components/tab-panel';
|
|
64
|
+
export * from './components/tab-panel/model';
|
|
33
65
|
export * from './components/tabs';
|
|
66
|
+
export * from './components/tabs/model';
|
|
34
67
|
export * from './components/tag';
|
|
68
|
+
export * from './components/tag/model';
|
|
35
69
|
export * from './components/textarea';
|
|
70
|
+
export * from './components/textarea/model';
|
|
36
71
|
export * from './components/tooltip';
|
|
72
|
+
export * from './components/tooltip/model';
|
|
37
73
|
export * from './shared/constants';
|
|
38
74
|
export * from './shared/model';
|
|
75
|
+
export * from './utils/document-click-listener';
|
|
76
|
+
export * from './utils/document-scroll-listener';
|
|
77
|
+
export * from './utils/floating-components';
|
|
39
78
|
export * from './utils/index';
|
|
40
79
|
export * from './utils/navigation';
|