@db-ux/react-core-components 1.1.1 → 2.0.0-0-custom-select-16b8cce
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 +2 -2
- package/dist/components/accordion/accordion.js +0 -1
- package/dist/components/accordion-item/accordion-item.js +0 -1
- package/dist/components/badge/badge.js +0 -1
- package/dist/components/brand/brand.js +0 -1
- package/dist/components/button/button.js +0 -1
- package/dist/components/card/card.js +0 -1
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +2 -3
- package/dist/components/custom-select/custom-select.d.ts +3 -0
- package/dist/components/custom-select/custom-select.js +543 -0
- package/dist/components/custom-select/index.d.ts +1 -0
- package/dist/components/custom-select/index.js +1 -0
- package/dist/components/custom-select/model.d.ts +173 -0
- package/dist/components/custom-select/model.js +1 -0
- package/dist/components/custom-select-dropdown/custom-select-dropdown.d.ts +3 -0
- package/dist/components/custom-select-dropdown/custom-select-dropdown.js +12 -0
- package/dist/components/custom-select-dropdown/index.d.ts +1 -0
- package/dist/components/custom-select-dropdown/index.js +1 -0
- package/dist/components/custom-select-dropdown/model.d.ts +15 -0
- package/dist/components/custom-select-dropdown/model.js +1 -0
- package/dist/components/custom-select-form-field/custom-select-form-field.d.ts +3 -0
- package/dist/components/custom-select-form-field/custom-select-form-field.js +11 -0
- package/dist/components/custom-select-form-field/index.d.ts +1 -0
- package/dist/components/custom-select-form-field/index.js +1 -0
- package/dist/components/custom-select-form-field/model.d.ts +5 -0
- package/dist/components/custom-select-form-field/model.js +1 -0
- package/dist/components/custom-select-list/custom-select-list.d.ts +3 -0
- package/dist/components/custom-select-list/custom-select-list.js +12 -0
- package/dist/components/custom-select-list/index.d.ts +1 -0
- package/dist/components/custom-select-list/index.js +1 -0
- package/dist/components/custom-select-list/model.d.ts +8 -0
- package/dist/components/custom-select-list/model.js +1 -0
- package/dist/components/custom-select-list-item/custom-select-list-item.d.ts +6 -0
- package/dist/components/custom-select-list-item/custom-select-list-item.js +40 -0
- package/dist/components/custom-select-list-item/index.d.ts +1 -0
- package/dist/components/custom-select-list-item/index.js +1 -0
- package/dist/components/custom-select-list-item/model.d.ts +29 -0
- package/dist/components/custom-select-list-item/model.js +1 -0
- package/dist/components/divider/divider.js +0 -1
- package/dist/components/drawer/drawer.js +0 -1
- package/dist/components/header/header.js +0 -1
- package/dist/components/icon/icon.js +0 -1
- package/dist/components/infotext/infotext.js +0 -1
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.js +4 -5
- package/dist/components/link/link.js +0 -1
- package/dist/components/navigation/navigation.js +0 -1
- package/dist/components/navigation-item/navigation-item.js +0 -1
- package/dist/components/notification/notification.js +0 -1
- package/dist/components/page/model.d.ts +4 -0
- package/dist/components/page/page.js +1 -2
- package/dist/components/popover/popover.js +0 -1
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +0 -1
- package/dist/components/section/section.js +0 -1
- package/dist/components/select/model.d.ts +3 -3
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/select/select.js +6 -7
- package/dist/components/stack/stack.js +0 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +0 -1
- package/dist/components/tab-item/tab-item.js +0 -1
- package/dist/components/tab-list/tab-list.js +0 -1
- package/dist/components/tab-panel/tab-panel.js +0 -1
- package/dist/components/tabs/tabs.js +0 -1
- package/dist/components/tag/model.d.ts +3 -3
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/tag/tag.js +5 -5
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +2 -3
- package/dist/components/tooltip/tooltip.js +0 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/shared/constants.d.ts +5 -0
- package/dist/shared/constants.js +6 -1
- package/dist/shared/model.d.ts +36 -19
- package/dist/shared/model.js +3 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/react.d.ts +4 -4
- package/package.json +4 -4
|
@@ -6,7 +6,7 @@ import { cls, delay, getHideProp, hasVoiceOver, stringPropVisible, uuid, } from
|
|
|
6
6
|
import { DEFAULT_INVALID_MESSAGE, DEFAULT_INVALID_MESSAGE_ID_SUFFIX, DEFAULT_LABEL, DEFAULT_MESSAGE_ID_SUFFIX, DEFAULT_PLACEHOLDER_ID_SUFFIX, DEFAULT_VALID_MESSAGE, DEFAULT_VALID_MESSAGE_ID_SUFFIX, } from "../../shared/constants";
|
|
7
7
|
import DBInfotext from "../infotext/infotext";
|
|
8
8
|
function DBSelectFn(props, component) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const _ref = component || useRef(component);
|
|
11
11
|
const [_id, set_id] = useState(() => undefined);
|
|
12
12
|
const [_messageId, set_messageId] = useState(() => undefined);
|
|
@@ -78,8 +78,8 @@ function DBSelectFn(props, component) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
function getOptionLabel(option) {
|
|
81
|
-
var _a;
|
|
82
|
-
return (_a = option.label) !== null && _a !== void 0 ? _a : option.value.toString();
|
|
81
|
+
var _a, _b;
|
|
82
|
+
return (_a = option.label) !== null && _a !== void 0 ? _a : (_b = option.value) === null || _b === void 0 ? void 0 : _b.toString();
|
|
83
83
|
}
|
|
84
84
|
useEffect(() => {
|
|
85
85
|
var _a;
|
|
@@ -113,9 +113,9 @@ function DBSelectFn(props, component) {
|
|
|
113
113
|
}, [props.value]);
|
|
114
114
|
return (React.createElement("div", Object.assign({}, 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-select", props.className), "data-variant": props.variant, "data-hide-label": getHideProp(props.showLabel), "data-icon": props.icon, "data-hide-icon": getHideProp(props.showIcon) }),
|
|
115
115
|
React.createElement("label", { htmlFor: _id }, (_a = props.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL),
|
|
116
|
-
React.createElement("select", Object.assign({ "aria-invalid": props.validation === "invalid", "data-custom-validity": props.validation, 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"]), { required: props.required, disabled: props.disabled, id: _id, name: props.name, size: props.size, value: props.value, autoComplete: props.autocomplete, onInput: (event) => handleInput(event), onClick: (event) => handleClick(event), onChange: (event) => handleChange(event), onBlur: (event) => handleBlur(event), onFocus: (event) => handleFocus(event), "aria-describedby": _descByIds }),
|
|
116
|
+
React.createElement("select", Object.assign({ "aria-invalid": props.validation === "invalid", "data-custom-validity": props.validation, 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"]), { required: props.required, disabled: props.disabled, id: _id, name: props.name, size: props.size, value: props.value, autoComplete: props.autocomplete, multiple: props.multiple, onInput: (event) => handleInput(event), onClick: (event) => handleClick(event), onChange: (event) => handleChange(event), onBlur: (event) => handleBlur(event), onFocus: (event) => handleFocus(event), "aria-describedby": _descByIds }),
|
|
117
117
|
React.createElement("option", { hidden: true }),
|
|
118
|
-
props.options ? (React.createElement(React.Fragment,
|
|
118
|
+
props.options ? (React.createElement(React.Fragment, null, (_b = props.options) === null || _b === void 0 ? void 0 : _b.map((option) => {
|
|
119
119
|
var _a;
|
|
120
120
|
return (React.createElement(React.Fragment, { key: uuid() },
|
|
121
121
|
option.options ? (React.createElement("optgroup", { label: getOptionLabel(option) }, (_a = option.options) === null || _a === void 0 ? void 0 : _a.map((optgroupOption) => (React.createElement("option", { key: optgroupOption.value.toString(), value: optgroupOption.value, disabled: optgroupOption.disabled }, getOptionLabel(optgroupOption)))))) : null,
|
|
@@ -125,9 +125,8 @@ function DBSelectFn(props, component) {
|
|
|
125
125
|
React.createElement("span", { id: _placeholderId }, (_c = props.placeholder) !== null && _c !== void 0 ? _c : props.label),
|
|
126
126
|
stringPropVisible(props.message, props.showMessage) ? (React.createElement(DBInfotext, { size: "small", icon: props.messageIcon, id: _messageId }, props.message)) : null,
|
|
127
127
|
React.createElement(DBInfotext, { size: "small", semantic: "successful", id: _validMessageId }, (_d = props.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE),
|
|
128
|
-
React.createElement(DBInfotext, { size: "small", semantic: "critical", id: _invalidMessageId }, (
|
|
128
|
+
React.createElement(DBInfotext, { size: "small", semantic: "critical", id: _invalidMessageId }, (_e = props.invalidMessage) !== null && _e !== void 0 ? _e : (((_f = _ref.current) === null || _f === void 0 ? void 0 : _f.validationMessage) || DEFAULT_INVALID_MESSAGE)),
|
|
129
129
|
React.createElement("span", { "data-visually-hidden": "true", role: "status" }, _voiceOverFallback)));
|
|
130
130
|
}
|
|
131
131
|
const DBSelect = forwardRef(DBSelectFn);
|
|
132
|
-
DBSelect.defaultProps = {};
|
|
133
132
|
export default DBSelect;
|
|
@@ -8,5 +8,4 @@ function DBStackFn(props, component) {
|
|
|
8
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-stack", props.className), "data-gap": props.gap, "data-variant": props.variant, "data-direction": props.direction, "data-alignment": props.alignment, "data-justify-content": props.justifyContent, "data-wrap": getBooleanAsString(props.wrap) }), props.children));
|
|
9
9
|
}
|
|
10
10
|
const DBStack = forwardRef(DBStackFn);
|
|
11
|
-
DBStack.defaultProps = {};
|
|
12
11
|
export default DBStack;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBSwitch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "icon" | "checked" | keyof import("../../shared/model").GlobalProps | "emphasis" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").
|
|
2
|
+
declare const DBSwitch: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "required" | "value" | "size" | "icon" | "checked" | keyof import("../../shared/model").GlobalProps | "emphasis" | keyof import("../../shared/model").ChangeEventProps<HTMLInputElement> | keyof import("../../shared/model").FocusEventProps<HTMLInputElement> | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").BaseFormProps | "showLabel" | "iconAfter" | "visualAid"> & import("./model").DBSwitchDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").ChangeEventProps<HTMLInputElement> & import("../../shared/model").FocusEventProps<HTMLInputElement> & import("../../shared/model").CustomFormProps & import("../../shared/model").BaseFormProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").FormCheckProps & import("../../shared/model").EmphasisProps & import("../../shared/model").SizeProps & import("../../shared/model").IconProps & import("../../shared/model").IconAfterProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
3
|
export default DBSwitch;
|
|
@@ -48,5 +48,4 @@ function DBSwitchFn(props, component) {
|
|
|
48
48
|
props.label ? React.createElement(React.Fragment, null, props.label) : React.createElement(React.Fragment, null, props.children)));
|
|
49
49
|
}
|
|
50
50
|
const DBSwitch = forwardRef(DBSwitchFn);
|
|
51
|
-
DBSwitch.defaultProps = {};
|
|
52
51
|
export default DBSwitch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentSlotProps, GlobalProps, GlobalState, IconProps, InitializedState, OverflowProps, SemanticProps, ShowIconProps, TagEmphasisProps } from '../../shared/model';
|
|
1
|
+
import { ClickEvent, ContentSlotProps, GlobalProps, GlobalState, IconProps, InitializedState, OverflowProps, SemanticProps, ShowIconProps, TagEmphasisProps } from '../../shared/model';
|
|
2
2
|
export declare const TagBehaviorList: readonly ["static", "removable"];
|
|
3
3
|
export type TagBehaviorType = (typeof TagBehaviorList)[number];
|
|
4
4
|
export type DBTagDefaultProps = {
|
|
@@ -19,7 +19,7 @@ export type DBTagDefaultProps = {
|
|
|
19
19
|
/**
|
|
20
20
|
* If "removeButton" attribute is set this function will be called when user clicks cancel button inside the tag.
|
|
21
21
|
*/
|
|
22
|
-
onRemove?: () => void;
|
|
22
|
+
onRemove?: (event?: any) => void;
|
|
23
23
|
/**
|
|
24
24
|
* The removeButton attribute shows the cancel button.
|
|
25
25
|
*/
|
|
@@ -40,6 +40,6 @@ export type DBTagDefaultProps = {
|
|
|
40
40
|
export type DBTagProps = DBTagDefaultProps & GlobalProps & IconProps & SemanticProps & OverflowProps & TagEmphasisProps & ShowIconProps & ContentSlotProps;
|
|
41
41
|
export type DBTagDefaultState = {
|
|
42
42
|
getRemoveButtonText: () => string;
|
|
43
|
-
handleRemove: () => void;
|
|
43
|
+
handleRemove: (event?: ClickEvent<HTMLButtonElement>) => void;
|
|
44
44
|
};
|
|
45
45
|
export type DBTagState = DBTagDefaultState & GlobalState & InitializedState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBTag: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "content" | "overflow" | "icon" | keyof import("
|
|
2
|
+
declare const DBTag: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "content" | "overflow" | "icon" | keyof import("../../shared/model").GlobalProps | "showIcon" | "semantic" | "emphasis" | keyof import("./model").DBTagDefaultProps> & import("./model").DBTagDefaultProps & import("../../shared/model").GlobalProps & import("../../shared/model").IconProps & import("../../shared/model").SemanticProps & import("../../shared/model").OverflowProps & import("../../shared/model").TagEmphasisProps & import("../../shared/model").ShowIconProps & import("../../shared/model").ContentSlotProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export default DBTag;
|
|
@@ -3,13 +3,14 @@ import * as React from "react";
|
|
|
3
3
|
import { filterPassingProps, getRootProps } from "../../utils/react";
|
|
4
4
|
import { useState, useRef, useEffect, forwardRef } from "react";
|
|
5
5
|
import { cls, getBooleanAsString, getHideProp } from "../../utils";
|
|
6
|
+
import { DEFAULT_REMOVE } from "../../shared/constants";
|
|
6
7
|
function DBTagFn(props, component) {
|
|
7
8
|
var _a;
|
|
8
9
|
const _ref = component || useRef(component);
|
|
9
10
|
const [initialized, setInitialized] = useState(() => false);
|
|
10
|
-
function handleRemove() {
|
|
11
|
+
function handleRemove(event) {
|
|
11
12
|
if (props.onRemove) {
|
|
12
|
-
props.onRemove();
|
|
13
|
+
props.onRemove(event);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
function getRemoveButtonText() {
|
|
@@ -17,7 +18,7 @@ function DBTagFn(props, component) {
|
|
|
17
18
|
return props.removeButton;
|
|
18
19
|
}
|
|
19
20
|
// TODO: We should think this through again, if we would really like to have default and especially english, instead of german labels in here
|
|
20
|
-
return
|
|
21
|
+
return DEFAULT_REMOVE;
|
|
21
22
|
}
|
|
22
23
|
const hasInitialized = useRef(false);
|
|
23
24
|
if (!hasInitialized.current) {
|
|
@@ -40,8 +41,7 @@ function DBTagFn(props, component) {
|
|
|
40
41
|
React.createElement(React.Fragment, null, props.content),
|
|
41
42
|
props.children,
|
|
42
43
|
props.text ? React.createElement(React.Fragment, null, props.text) : null,
|
|
43
|
-
props.behavior === "removable" ? (React.createElement("button", { className: "db-button db-tab-remove-button", "data-icon": "cross", "data-size": "small", "data-no-text": "true", "data-variant": "ghost", onClick: (event) => handleRemove(), title: getRemoveButtonText() }, getRemoveButtonText())) : null));
|
|
44
|
+
props.behavior === "removable" ? (React.createElement("button", { className: "db-button db-tab-remove-button", "data-icon": "cross", "data-size": "small", "data-no-text": "true", "data-variant": "ghost", onClick: (event) => handleRemove(event), title: getRemoveButtonText() }, getRemoveButtonText())) : null));
|
|
44
45
|
}
|
|
45
46
|
const DBTag = forwardRef(DBTagFn);
|
|
46
|
-
DBTag.defaultProps = {};
|
|
47
47
|
export default DBTag;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const DBTextarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof import("../../shared/model").GlobalProps | keyof import("../../shared/model").
|
|
2
|
+
declare const DBTextarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "required" | "value" | keyof import("../../shared/model").GlobalProps | keyof import("../../shared/model").CustomFormProps | keyof import("../../shared/model").BaseFormProps | "showLabel" | keyof import("../../shared/model").FormMessageProps | keyof import("../../shared/model").FormTextProps | keyof import("./model").DBTextareaDefaultProps | keyof import("../../shared/model").ChangeEventProps<HTMLTextAreaElement> | keyof import("../../shared/model").InputEventProps<HTMLTextAreaElement> | keyof import("../../shared/model").FocusEventProps<HTMLTextAreaElement>> & import("./model").DBTextareaDefaultProps & import("../../shared/model").ChangeEventProps<HTMLTextAreaElement> & import("../../shared/model").InputEventProps<HTMLTextAreaElement> & import("../../shared/model").FocusEventProps<HTMLTextAreaElement> & import("../../shared/model").CustomFormProps & import("../../shared/model").BaseFormProps & import("../../shared/model").RequiredProps & import("../../shared/model").ShowLabelProps & import("../../shared/model").ValueProps & import("../../shared/model").GlobalProps & import("../../shared/model").FormTextProps & import("../../shared/model").FormMessageProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
3
3
|
export default DBTextarea;
|
|
@@ -6,7 +6,7 @@ import DBInfotext from "../infotext/infotext";
|
|
|
6
6
|
import { cls, delay, getHideProp, hasVoiceOver, stringPropVisible, uuid, } from "../../utils";
|
|
7
7
|
import { DEFAULT_INVALID_MESSAGE, DEFAULT_INVALID_MESSAGE_ID_SUFFIX, DEFAULT_LABEL, DEFAULT_MESSAGE_ID_SUFFIX, DEFAULT_PLACEHOLDER, DEFAULT_ROWS, DEFAULT_VALID_MESSAGE, DEFAULT_VALID_MESSAGE_ID_SUFFIX, } from "../../shared/constants";
|
|
8
8
|
function DBTextareaFn(props, component) {
|
|
9
|
-
var _a, _b, _c, _d, _e, _f
|
|
9
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10
10
|
const _ref = component || useRef(component);
|
|
11
11
|
const [_id, set_id] = useState(() => undefined);
|
|
12
12
|
const [_messageId, set_messageId] = useState(() => undefined);
|
|
@@ -98,9 +98,8 @@ function DBTextareaFn(props, component) {
|
|
|
98
98
|
React.createElement("textarea", Object.assign({ "aria-invalid": props.validation === "invalid", "data-custom-validity": props.validation, 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: _id, "data-resize": props.resize, disabled: props.disabled, required: props.required, readOnly: props.readOnly, form: props.form, maxLength: props.maxLength, minLength: props.minLength, name: props.name, wrap: props.wrap, spellCheck: props.spellCheck, autoComplete: props.autocomplete, onInput: (event) => handleInput(event), onChange: (event) => handleChange(event), onBlur: (event) => handleBlur(event), onFocus: (event) => handleFocus(event), value: props.value, "aria-describedby": _descByIds, placeholder: (_b = props.placeholder) !== null && _b !== void 0 ? _b : DEFAULT_PLACEHOLDER, rows: (_c = props.rows) !== null && _c !== void 0 ? _c : DEFAULT_ROWS, cols: props.cols })),
|
|
99
99
|
stringPropVisible(props.message, props.showMessage) ? (React.createElement(DBInfotext, { size: "small", icon: props.messageIcon, id: _messageId }, props.message)) : null,
|
|
100
100
|
React.createElement(DBInfotext, { size: "small", semantic: "successful", id: _validMessageId }, (_d = props.validMessage) !== null && _d !== void 0 ? _d : DEFAULT_VALID_MESSAGE),
|
|
101
|
-
React.createElement(DBInfotext, { size: "small", semantic: "critical", id: _invalidMessageId }, (
|
|
101
|
+
React.createElement(DBInfotext, { size: "small", semantic: "critical", id: _invalidMessageId }, (_e = props.invalidMessage) !== null && _e !== void 0 ? _e : (((_f = _ref.current) === null || _f === void 0 ? void 0 : _f.validationMessage) || DEFAULT_INVALID_MESSAGE)),
|
|
102
102
|
React.createElement("span", { "data-visually-hidden": "true", role: "status" }, _voiceOverFallback)));
|
|
103
103
|
}
|
|
104
104
|
const DBTextarea = forwardRef(DBTextareaFn);
|
|
105
|
-
DBTextarea.defaultProps = {};
|
|
106
105
|
export default DBTextarea;
|
|
@@ -40,5 +40,4 @@ function DBTooltipFn(props, component) {
|
|
|
40
40
|
return (React.createElement("i", Object.assign({ role: "tooltip", "aria-hidden": "true", "data-gap": "true", 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"]), 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-tooltip", props.className), id: _id, "data-emphasis": props.emphasis, "data-animation": getBooleanAsString((_a = props.animation) !== null && _a !== void 0 ? _a : true), "data-delay": props.delay, "data-width": props.width, "data-show-arrow": getBooleanAsString((_b = props.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": props.placement, onClick: (event) => handleClick(event) }), props.children));
|
|
41
41
|
}
|
|
42
42
|
const DBTooltip = forwardRef(DBTooltipFn);
|
|
43
|
-
DBTooltip.defaultProps = {};
|
|
44
43
|
export default DBTooltip;
|
package/dist/index.d.ts
CHANGED
|
@@ -34,3 +34,8 @@ export * from './shared/model';
|
|
|
34
34
|
export * from './utils/index';
|
|
35
35
|
export * from './utils/navigation';
|
|
36
36
|
export * from './components/stack';
|
|
37
|
+
export * from './components/custom-select';
|
|
38
|
+
export * from './components/custom-select-form-field';
|
|
39
|
+
export * from './components/custom-select-dropdown';
|
|
40
|
+
export * from './components/custom-select-list';
|
|
41
|
+
export * from './components/custom-select-list-item';
|
package/dist/index.js
CHANGED
|
@@ -34,3 +34,8 @@ export * from './shared/model';
|
|
|
34
34
|
export * from './utils/index';
|
|
35
35
|
export * from './utils/navigation';
|
|
36
36
|
export * from './components/stack';
|
|
37
|
+
export * from './components/custom-select';
|
|
38
|
+
export * from './components/custom-select-form-field';
|
|
39
|
+
export * from './components/custom-select-dropdown';
|
|
40
|
+
export * from './components/custom-select-list';
|
|
41
|
+
export * from './components/custom-select-list-item';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const DEFAULT_ID: string;
|
|
2
2
|
export declare const DEFAULT_LABEL: string;
|
|
3
3
|
export declare const DEFAULT_PLACEHOLDER: string;
|
|
4
|
+
export declare const DEFAULT_MESSAGE: string;
|
|
5
|
+
export declare const DEFAULT_LABEL_ID_SUFFIX: string;
|
|
6
|
+
export declare const DEFAULT_SELECT_ID_SUFFIX: string;
|
|
4
7
|
export declare const DEFAULT_MESSAGE_ID_SUFFIX: string;
|
|
5
8
|
export declare const DEFAULT_VALID_MESSAGE_ID_SUFFIX: string;
|
|
6
9
|
export declare const DEFAULT_INVALID_MESSAGE_ID_SUFFIX: string;
|
|
@@ -8,7 +11,9 @@ export declare const DEFAULT_PLACEHOLDER_ID_SUFFIX: string;
|
|
|
8
11
|
export declare const DEFAULT_DATALIST_ID_SUFFIX: string;
|
|
9
12
|
export declare const DEFAULT_VALID_MESSAGE: string;
|
|
10
13
|
export declare const DEFAULT_INVALID_MESSAGE: string;
|
|
14
|
+
export declare const DEFAULT_REMOVE: string;
|
|
11
15
|
export declare const DEFAULT_BACK: string;
|
|
16
|
+
export declare const DEFAULT_SELECTED: string;
|
|
12
17
|
export declare const DEFAULT_BURGER_MENU: string;
|
|
13
18
|
export declare const DEFAULT_ICON: string;
|
|
14
19
|
export declare const DEFAULT_ROWS: number;
|
package/dist/shared/constants.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export const DEFAULT_ID = 'OVERWRITE_DEFAULT_ID';
|
|
2
2
|
export const DEFAULT_LABEL = 'LABEL SHOULD BE SET';
|
|
3
3
|
export const DEFAULT_PLACEHOLDER = ' ';
|
|
4
|
+
export const DEFAULT_MESSAGE = 'MESSAGE SHOULD BE SET';
|
|
5
|
+
export const DEFAULT_LABEL_ID_SUFFIX = '-label';
|
|
6
|
+
export const DEFAULT_SELECT_ID_SUFFIX = '-select';
|
|
4
7
|
export const DEFAULT_MESSAGE_ID_SUFFIX = '-message';
|
|
5
8
|
export const DEFAULT_VALID_MESSAGE_ID_SUFFIX = '-valid-message';
|
|
6
9
|
export const DEFAULT_INVALID_MESSAGE_ID_SUFFIX = '-invalid-message';
|
|
@@ -8,11 +11,13 @@ export const DEFAULT_PLACEHOLDER_ID_SUFFIX = '-placeholder';
|
|
|
8
11
|
export const DEFAULT_DATALIST_ID_SUFFIX = '-datalist';
|
|
9
12
|
export const DEFAULT_VALID_MESSAGE = 'TODO: Add a validMessage';
|
|
10
13
|
export const DEFAULT_INVALID_MESSAGE = 'TODO: Add an invalidMessage';
|
|
14
|
+
export const DEFAULT_REMOVE = 'Remove';
|
|
11
15
|
export const DEFAULT_BACK = 'Back';
|
|
16
|
+
export const DEFAULT_SELECTED = 'Selected';
|
|
12
17
|
export const DEFAULT_BURGER_MENU = 'BurgerMenu';
|
|
13
18
|
export const DEFAULT_ICON = 'brand';
|
|
14
19
|
export const DEFAULT_ROWS = 4;
|
|
15
|
-
export const DEFAULT_CLOSE_BUTTON = 'Close
|
|
20
|
+
export const DEFAULT_CLOSE_BUTTON = 'Close';
|
|
16
21
|
export const DENSITY_CONST = 'density';
|
|
17
22
|
export const COLOR_CONST = 'color';
|
|
18
23
|
export var DENSITY;
|
package/dist/shared/model.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export type SemanticProps = {
|
|
|
39
39
|
};
|
|
40
40
|
export type IconProps = {
|
|
41
41
|
/**
|
|
42
|
-
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://
|
|
42
|
+
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
|
|
43
43
|
*/
|
|
44
44
|
icon?: IconTypes;
|
|
45
45
|
};
|
|
@@ -52,7 +52,7 @@ export type ShowIconProps = {
|
|
|
52
52
|
};
|
|
53
53
|
export type IconAfterProps = {
|
|
54
54
|
/**
|
|
55
|
-
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://
|
|
55
|
+
* Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.
|
|
56
56
|
*/
|
|
57
57
|
iconAfter?: IconTypes;
|
|
58
58
|
};
|
|
@@ -62,7 +62,7 @@ export type SpacingProps = {
|
|
|
62
62
|
/**
|
|
63
63
|
* The spacing attribute changes the padding of the component.
|
|
64
64
|
*/
|
|
65
|
-
spacing?: SpacingType;
|
|
65
|
+
spacing?: SpacingType | string;
|
|
66
66
|
};
|
|
67
67
|
export declare const MarginList: readonly ["medium", "small", "large", "none"];
|
|
68
68
|
export type MarginType = (typeof MarginList)[number];
|
|
@@ -72,7 +72,11 @@ export type MarginProps = {
|
|
|
72
72
|
*/
|
|
73
73
|
margin?: MarginType;
|
|
74
74
|
};
|
|
75
|
-
export declare const
|
|
75
|
+
export declare const PlacementHorizontalList: readonly ["left", "right", "left-start", "left-end", "right-start", "right-end"];
|
|
76
|
+
export type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];
|
|
77
|
+
export declare const PlacementVerticalList: readonly ["top", "bottom", "top-start", "top-end", "bottom-start", "bottom-end"];
|
|
78
|
+
export type PlacementVerticalType = (typeof PlacementVerticalList)[number];
|
|
79
|
+
export declare const PlacementList: readonly ["left", "right", "left-start", "left-end", "right-start", "right-end", "top", "bottom", "top-start", "top-end", "bottom-start", "bottom-end"];
|
|
76
80
|
export type PlacementType = (typeof PlacementList)[number];
|
|
77
81
|
export type PlacementProps = {
|
|
78
82
|
/**
|
|
@@ -117,7 +121,7 @@ export type WidthProps = {
|
|
|
117
121
|
/**
|
|
118
122
|
* Width of the component. Auto width based on children size, full width based on parent elements width.
|
|
119
123
|
*/
|
|
120
|
-
width?: WidthType;
|
|
124
|
+
width?: WidthType | string;
|
|
121
125
|
};
|
|
122
126
|
export declare const MaxWidthList: readonly ["full", "medium", "large", "small"];
|
|
123
127
|
export type MaxWidthType = (typeof MaxWidthList)[number];
|
|
@@ -180,19 +184,29 @@ export type TagEmphasisProps = {
|
|
|
180
184
|
};
|
|
181
185
|
export declare const ValidationList: readonly ["invalid", "valid", "no-validation"];
|
|
182
186
|
export type ValidationType = (typeof ValidationList)[number];
|
|
183
|
-
export type
|
|
187
|
+
export type RequiredProps = {
|
|
184
188
|
/**
|
|
185
|
-
*
|
|
189
|
+
* When the required attribute specified, the user will be required to fill the form element before submitting the form.
|
|
186
190
|
*/
|
|
187
|
-
|
|
191
|
+
required?: boolean;
|
|
192
|
+
};
|
|
193
|
+
export type ShowLabelProps = {
|
|
188
194
|
/**
|
|
189
|
-
*
|
|
195
|
+
* Enables/disables the visibility of the label
|
|
190
196
|
*/
|
|
191
|
-
|
|
197
|
+
showLabel?: boolean;
|
|
198
|
+
};
|
|
199
|
+
export type ValueProps = {
|
|
192
200
|
/**
|
|
193
|
-
*
|
|
201
|
+
* The value property is to receive results from the native form element.
|
|
194
202
|
*/
|
|
195
|
-
|
|
203
|
+
value?: any;
|
|
204
|
+
};
|
|
205
|
+
export type BaseFormProps = {
|
|
206
|
+
/**
|
|
207
|
+
* The disabled attribute can be set to keep a user from clicking on the form element.
|
|
208
|
+
*/
|
|
209
|
+
disabled?: boolean;
|
|
196
210
|
/**
|
|
197
211
|
* The label attribute specifies the caption of the form element.
|
|
198
212
|
*/
|
|
@@ -201,19 +215,22 @@ export type FormProps = {
|
|
|
201
215
|
* The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.
|
|
202
216
|
*/
|
|
203
217
|
name?: string;
|
|
218
|
+
};
|
|
219
|
+
export type CustomFormProps = {
|
|
204
220
|
/**
|
|
205
|
-
*
|
|
221
|
+
* Overwrites auto handling for aria-describedby.
|
|
206
222
|
*/
|
|
207
|
-
|
|
223
|
+
ariaDescribedBy?: string;
|
|
208
224
|
/**
|
|
209
|
-
*
|
|
225
|
+
* Associates the control with a form element
|
|
210
226
|
*/
|
|
211
|
-
|
|
227
|
+
form?: string;
|
|
212
228
|
/**
|
|
213
|
-
*
|
|
229
|
+
* Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.
|
|
214
230
|
*/
|
|
215
|
-
|
|
231
|
+
validation?: ValidationType;
|
|
216
232
|
};
|
|
233
|
+
export type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;
|
|
217
234
|
export type FormTextProps = {
|
|
218
235
|
/**
|
|
219
236
|
* Maximum length (number of characters) of value
|
|
@@ -379,7 +396,7 @@ export type AlignmentProps = {
|
|
|
379
396
|
/**
|
|
380
397
|
* Define the content alignment in full width
|
|
381
398
|
*/
|
|
382
|
-
alignment?: AlignmentType;
|
|
399
|
+
alignment?: AlignmentType | string;
|
|
383
400
|
};
|
|
384
401
|
export type ActiveProps = {
|
|
385
402
|
/**
|
package/dist/shared/model.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'];
|
|
2
2
|
export const SpacingList = ['medium', 'small', 'large', 'none'];
|
|
3
3
|
export const MarginList = ['medium', 'small', 'large', 'none'];
|
|
4
|
-
export const
|
|
4
|
+
export const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'];
|
|
5
|
+
export const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'];
|
|
6
|
+
export const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList];
|
|
5
7
|
export const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'];
|
|
6
8
|
export const OrientationList = ['horizontal', 'vertical'];
|
|
7
9
|
export const WidthList = ['full', 'auto'];
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -31,7 +31,9 @@ export declare const delay: (fn: () => void, ms: number) => Promise<unknown>;
|
|
|
31
31
|
export declare const getBooleanAsString: (originBool?: boolean) => any;
|
|
32
32
|
export declare const getHideProp: (show?: boolean) => any;
|
|
33
33
|
export declare const stringPropVisible: (givenString?: string, showString?: boolean) => string | boolean;
|
|
34
|
+
export declare const getSearchInput: (element: HTMLElement) => HTMLInputElement | null;
|
|
34
35
|
declare const _default: {
|
|
36
|
+
getSearchInput: (element: HTMLElement) => HTMLInputElement;
|
|
35
37
|
cls: (...args: ClassNameArg[]) => string;
|
|
36
38
|
addAttributeToChildren: (element: Element, attribute: {
|
|
37
39
|
key: string;
|
package/dist/utils/index.js
CHANGED
|
@@ -138,7 +138,9 @@ export const stringPropVisible = (givenString, showString) => {
|
|
|
138
138
|
return showString && givenString;
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
+
export const getSearchInput = (element) => element.querySelector(`input[type="search"]`);
|
|
141
142
|
export default {
|
|
143
|
+
getSearchInput,
|
|
142
144
|
cls,
|
|
143
145
|
addAttributeToChildren,
|
|
144
146
|
uuid,
|
package/dist/utils/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const filterPassingProps: (props:
|
|
2
|
-
export declare const getRootProps: (props:
|
|
1
|
+
export declare const filterPassingProps: (props: any, propsPassingFilter: string[]) => Record<string, unknown>;
|
|
2
|
+
export declare const getRootProps: (props: any, rooProps: string[]) => Record<string, unknown>;
|
|
3
3
|
declare const _default: {
|
|
4
|
-
getRootProps: (props:
|
|
5
|
-
filterPassingProps: (props:
|
|
4
|
+
getRootProps: (props: any, rooProps: string[]) => Record<string, unknown>;
|
|
5
|
+
filterPassingProps: (props: any, propsPassingFilter: string[]) => Record<string, unknown>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/react-core-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-0-custom-select-16b8cce",
|
|
4
4
|
"description": "React components for @db-ux/core-components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/db-ux-design-system/core-web.git"
|
|
7
|
+
"url": "git+https://github.com/db-ux-design-system/core-web.git"
|
|
8
8
|
},
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@db-ux/core-components": "
|
|
41
|
-
"@db-ux/core-foundations": "
|
|
40
|
+
"@db-ux/core-components": "2.0.0-0-custom-select-16b8cce",
|
|
41
|
+
"@db-ux/core-foundations": "2.0.0-0-custom-select-16b8cce"
|
|
42
42
|
}
|
|
43
43
|
}
|