@db-ux/react-core-components 2.0.0-0-6589a60 → 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/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +2 -2
- 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/input/input.d.ts +1 -1
- package/dist/components/input/input.js +4 -4
- package/dist/components/radio/radio.d.ts +1 -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 -6
- package/dist/components/switch/switch.d.ts +1 -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 -4
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +2 -2
- 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 +31 -14
- 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 +3 -3
|
@@ -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,7 +98,7 @@ 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);
|
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
|
@@ -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
|
/**
|
|
@@ -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
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@db-ux/react-core-components",
|
|
3
|
-
"version": "2.0.0-0-
|
|
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",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@db-ux/core-components": "2.0.0-0-
|
|
41
|
-
"@db-ux/core-foundations": "2.0.0-0-
|
|
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
|
}
|