@porsche-design-system/components-react 3.28.0 → 3.29.0-rc.1
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/CHANGELOG.md +56 -2
- package/cjs/lib/components/input-number.wrapper.cjs +3 -3
- package/cjs/lib/components/input-password.wrapper.cjs +3 -3
- package/cjs/lib/components/input-search.wrapper.cjs +29 -0
- package/cjs/lib/components/input-text.wrapper.cjs +29 -0
- package/cjs/lib/components/popover.wrapper.cjs +4 -3
- package/cjs/lib/components/select.wrapper.cjs +3 -3
- package/cjs/lib/components/textarea.wrapper.cjs +3 -3
- package/cjs/public-api.cjs +4 -0
- package/esm/lib/components/index.d.ts +2 -0
- package/esm/lib/components/input-number.wrapper.d.ts +12 -4
- package/esm/lib/components/input-number.wrapper.mjs +3 -3
- package/esm/lib/components/input-password.wrapper.d.ts +10 -2
- package/esm/lib/components/input-password.wrapper.mjs +3 -3
- package/esm/lib/components/input-search.wrapper.d.ts +176 -0
- package/esm/lib/components/input-search.wrapper.mjs +27 -0
- package/esm/lib/components/input-text.wrapper.d.ts +192 -0
- package/esm/lib/components/input-text.wrapper.mjs +27 -0
- package/esm/lib/components/popover.wrapper.d.ts +16 -0
- package/esm/lib/components/popover.wrapper.mjs +5 -4
- package/esm/lib/components/select.wrapper.d.ts +8 -0
- package/esm/lib/components/select.wrapper.mjs +3 -3
- package/esm/lib/components/textarea.wrapper.d.ts +12 -12
- package/esm/lib/components/textarea.wrapper.mjs +3 -3
- package/esm/lib/types.d.ts +22 -5
- package/esm/public-api.mjs +2 -0
- package/package.json +2 -2
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +183 -80
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +5 -27
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-search.wrapper.cjs +40 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.cjs +40 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.cjs +5 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +8 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +5 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +4 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.cjs +47 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.cjs +44 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.cjs +10 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +4 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.cjs +4 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +4 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +152 -51
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +5 -26
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-password.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-search.wrapper.mjs +38 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-text.wrapper.mjs +38 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/popover.wrapper.mjs +6 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/accordion.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/banner.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-group.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-pure.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button-tile.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/button.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/canvas.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/carousel.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/checkbox.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/content-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/crest.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/display.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/divider.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown-link.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/drilldown.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset-wrapper.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/fieldset.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flex.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/flyout.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid-item.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/grid.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/heading.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/headline.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/icon.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/inline-notification.mjs +2 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.mjs +8 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +6 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +5 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.mjs +45 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.mjs +42 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/popover.mjs +10 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +5 -2
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/textarea.mjs +5 -6
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +2 -0
- package/ssr/esm/lib/components/index.d.ts +2 -0
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +12 -4
- package/ssr/esm/lib/components/input-password.wrapper.d.ts +10 -2
- package/ssr/esm/lib/components/input-search.wrapper.d.ts +176 -0
- package/ssr/esm/lib/components/input-text.wrapper.d.ts +192 -0
- package/ssr/esm/lib/components/popover.wrapper.d.ts +16 -0
- package/ssr/esm/lib/components/select.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +12 -12
- package/ssr/esm/lib/dsr-components/input-base.d.ts +4 -2
- package/ssr/esm/lib/dsr-components/input-number.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-password.d.ts +1 -0
- package/ssr/esm/lib/dsr-components/input-search.d.ts +20 -0
- package/ssr/esm/lib/dsr-components/input-text.d.ts +19 -0
- package/ssr/esm/lib/dsr-components/popover.d.ts +3 -1
- package/ssr/esm/lib/dsr-components/select.d.ts +2 -0
- package/ssr/esm/lib/dsr-components/textarea.d.ts +0 -3
- package/ssr/esm/lib/types.d.ts +22 -5
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type { BaseProps } from '../../BaseProps';
|
|
2
|
+
import type { InputTextAutoComplete, BreakpointCustomizable, InputTextBlurEventDetail, InputTextChangeEventDetail, InputTextInputEventDetail, InputTextState, Theme } from '../types';
|
|
3
|
+
export type PInputTextProps = BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies whether the input can be autofilled by the browser
|
|
6
|
+
*/
|
|
7
|
+
autoComplete?: InputTextAutoComplete;
|
|
8
|
+
/**
|
|
9
|
+
* Displays as a compact version.
|
|
10
|
+
*/
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Show or hide the character counter.
|
|
14
|
+
*/
|
|
15
|
+
counter?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The description text.
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Marks the text input as disabled.
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The id of a form element the text input should be associated with.
|
|
26
|
+
*/
|
|
27
|
+
form?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Show or hide label and description text. For better accessibility, it is recommended to show the label.
|
|
30
|
+
*/
|
|
31
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* The label text.
|
|
34
|
+
*/
|
|
35
|
+
label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* @experimental Shows a loading indicator.
|
|
38
|
+
*/
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The max length of the text input.
|
|
42
|
+
*/
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The message styled depending on validation state.
|
|
46
|
+
*/
|
|
47
|
+
message?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The min length of the text input.
|
|
50
|
+
*/
|
|
51
|
+
minLength?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The name of the text input.
|
|
54
|
+
*/
|
|
55
|
+
name: string;
|
|
56
|
+
/**
|
|
57
|
+
* Emitted when the text input has lost focus.
|
|
58
|
+
*/
|
|
59
|
+
onBlur?: (event: CustomEvent<InputTextBlurEventDetail>) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Emitted when the text input loses focus after its value was changed.
|
|
62
|
+
*/
|
|
63
|
+
onChange?: (event: CustomEvent<InputTextChangeEventDetail>) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Emitted when the value has been changed as a direct result of a user action.
|
|
66
|
+
*/
|
|
67
|
+
onInput?: (event: CustomEvent<InputTextInputEventDetail>) => void;
|
|
68
|
+
/**
|
|
69
|
+
* The placeholder text.
|
|
70
|
+
*/
|
|
71
|
+
placeholder?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies whether the text input should be read-only.
|
|
74
|
+
*/
|
|
75
|
+
readOnly?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Marks the text input as required.
|
|
78
|
+
*/
|
|
79
|
+
required?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Indicate whether to enable spell-checking.
|
|
82
|
+
*/
|
|
83
|
+
spellCheck?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* The validation state.
|
|
86
|
+
*/
|
|
87
|
+
state?: InputTextState;
|
|
88
|
+
/**
|
|
89
|
+
* Adapts the color depending on the theme.
|
|
90
|
+
*/
|
|
91
|
+
theme?: Theme;
|
|
92
|
+
/**
|
|
93
|
+
* The text input value.
|
|
94
|
+
*/
|
|
95
|
+
value?: string;
|
|
96
|
+
};
|
|
97
|
+
export declare const PInputText: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
|
|
98
|
+
/**
|
|
99
|
+
* Specifies whether the input can be autofilled by the browser
|
|
100
|
+
*/
|
|
101
|
+
autoComplete?: InputTextAutoComplete;
|
|
102
|
+
/**
|
|
103
|
+
* Displays as a compact version.
|
|
104
|
+
*/
|
|
105
|
+
compact?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Show or hide the character counter.
|
|
108
|
+
*/
|
|
109
|
+
counter?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The description text.
|
|
112
|
+
*/
|
|
113
|
+
description?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Marks the text input as disabled.
|
|
116
|
+
*/
|
|
117
|
+
disabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The id of a form element the text input should be associated with.
|
|
120
|
+
*/
|
|
121
|
+
form?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Show or hide label and description text. For better accessibility, it is recommended to show the label.
|
|
124
|
+
*/
|
|
125
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
126
|
+
/**
|
|
127
|
+
* The label text.
|
|
128
|
+
*/
|
|
129
|
+
label?: string;
|
|
130
|
+
/**
|
|
131
|
+
* @experimental Shows a loading indicator.
|
|
132
|
+
*/
|
|
133
|
+
loading?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* The max length of the text input.
|
|
136
|
+
*/
|
|
137
|
+
maxLength?: number;
|
|
138
|
+
/**
|
|
139
|
+
* The message styled depending on validation state.
|
|
140
|
+
*/
|
|
141
|
+
message?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The min length of the text input.
|
|
144
|
+
*/
|
|
145
|
+
minLength?: number;
|
|
146
|
+
/**
|
|
147
|
+
* The name of the text input.
|
|
148
|
+
*/
|
|
149
|
+
name: string;
|
|
150
|
+
/**
|
|
151
|
+
* Emitted when the text input has lost focus.
|
|
152
|
+
*/
|
|
153
|
+
onBlur?: (event: CustomEvent<InputTextBlurEventDetail>) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Emitted when the text input loses focus after its value was changed.
|
|
156
|
+
*/
|
|
157
|
+
onChange?: (event: CustomEvent<InputTextChangeEventDetail>) => void;
|
|
158
|
+
/**
|
|
159
|
+
* Emitted when the value has been changed as a direct result of a user action.
|
|
160
|
+
*/
|
|
161
|
+
onInput?: (event: CustomEvent<InputTextInputEventDetail>) => void;
|
|
162
|
+
/**
|
|
163
|
+
* The placeholder text.
|
|
164
|
+
*/
|
|
165
|
+
placeholder?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Specifies whether the text input should be read-only.
|
|
168
|
+
*/
|
|
169
|
+
readOnly?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Marks the text input as required.
|
|
172
|
+
*/
|
|
173
|
+
required?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Indicate whether to enable spell-checking.
|
|
176
|
+
*/
|
|
177
|
+
spellCheck?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The validation state.
|
|
180
|
+
*/
|
|
181
|
+
state?: InputTextState;
|
|
182
|
+
/**
|
|
183
|
+
* Adapts the color depending on the theme.
|
|
184
|
+
*/
|
|
185
|
+
theme?: Theme;
|
|
186
|
+
/**
|
|
187
|
+
* The text input value.
|
|
188
|
+
*/
|
|
189
|
+
value?: string;
|
|
190
|
+
} & {
|
|
191
|
+
children?: import("react").ReactNode | undefined;
|
|
192
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useRef } from 'react';
|
|
4
|
+
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
|
+
import { syncRef } from '../../utils.mjs';
|
|
6
|
+
|
|
7
|
+
const PInputText = /*#__PURE__*/ forwardRef(({ autoComplete, compact = false, counter = false, description = '', disabled = false, form, hideLabel = false, label = '', loading = false, maxLength, message = '', minLength, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, spellCheck, state = 'none', theme, value = '', className, ...rest }, ref) => {
|
|
8
|
+
const elementRef = useRef(undefined);
|
|
9
|
+
useEventCallback(elementRef, 'blur', onBlur);
|
|
10
|
+
useEventCallback(elementRef, 'change', onChange);
|
|
11
|
+
useEventCallback(elementRef, 'input', onInput);
|
|
12
|
+
const WebComponentTag = usePrefix('p-input-text');
|
|
13
|
+
const propsToSync = [autoComplete, compact, counter, description, disabled, form, hideLabel, label, loading, maxLength, message, minLength, name, placeholder, readOnly, required, spellCheck, state, theme || useTheme(), value];
|
|
14
|
+
useBrowserLayoutEffect(() => {
|
|
15
|
+
const { current } = elementRef;
|
|
16
|
+
['autoComplete', 'compact', 'counter', 'description', 'disabled', 'form', 'hideLabel', 'label', 'loading', 'maxLength', 'message', 'minLength', 'name', 'placeholder', 'readOnly', 'required', 'spellCheck', 'state', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
}, propsToSync);
|
|
18
|
+
const props = {
|
|
19
|
+
...rest,
|
|
20
|
+
class: useMergedClass(elementRef, className),
|
|
21
|
+
ref: syncRef(elementRef, ref)
|
|
22
|
+
};
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
return jsx(WebComponentTag, { ...props });
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export { PInputText };
|
|
@@ -13,6 +13,14 @@ export type PPopoverProps = BaseProps & {
|
|
|
13
13
|
* Preferred direction in which popover should open, given there is enough space in viewport. Otherwise, it will be opened in the direction with most available space.
|
|
14
14
|
*/
|
|
15
15
|
direction?: PopoverDirection;
|
|
16
|
+
/**
|
|
17
|
+
* Emitted when the component requests to be dismissed.
|
|
18
|
+
*/
|
|
19
|
+
onDismiss?: (event: CustomEvent<void>) => void;
|
|
20
|
+
/**
|
|
21
|
+
* If true, the popover is open.
|
|
22
|
+
*/
|
|
23
|
+
open?: boolean;
|
|
16
24
|
/**
|
|
17
25
|
* Adapts the popover color depending on the theme.
|
|
18
26
|
*/
|
|
@@ -31,6 +39,14 @@ export declare const PPopover: import("react").ForwardRefExoticComponent<import(
|
|
|
31
39
|
* Preferred direction in which popover should open, given there is enough space in viewport. Otherwise, it will be opened in the direction with most available space.
|
|
32
40
|
*/
|
|
33
41
|
direction?: PopoverDirection;
|
|
42
|
+
/**
|
|
43
|
+
* Emitted when the component requests to be dismissed.
|
|
44
|
+
*/
|
|
45
|
+
onDismiss?: (event: CustomEvent<void>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* If true, the popover is open.
|
|
48
|
+
*/
|
|
49
|
+
open?: boolean;
|
|
34
50
|
/**
|
|
35
51
|
* Adapts the popover color depending on the theme.
|
|
36
52
|
*/
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef, useRef } from 'react';
|
|
4
|
-
import { usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
4
|
+
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PPopover = /*#__PURE__*/ forwardRef(({ aria, description, direction = 'bottom', theme, className, ...rest }, ref) => {
|
|
7
|
+
const PPopover = /*#__PURE__*/ forwardRef(({ aria, description, direction = 'bottom', onDismiss, open = false, theme, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef(undefined);
|
|
9
|
+
useEventCallback(elementRef, 'dismiss', onDismiss);
|
|
9
10
|
const WebComponentTag = usePrefix('p-popover');
|
|
10
|
-
const propsToSync = [aria, description, direction, theme || useTheme()];
|
|
11
|
+
const propsToSync = [aria, description, direction, open, theme || useTheme()];
|
|
11
12
|
useBrowserLayoutEffect(() => {
|
|
12
13
|
const { current } = elementRef;
|
|
13
|
-
['aria', 'description', 'direction', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['aria', 'description', 'direction', 'open', 'theme'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
15
|
}, propsToSync);
|
|
15
16
|
const props = {
|
|
16
17
|
...rest,
|
|
@@ -17,6 +17,10 @@ export type PSelectProps = BaseProps & {
|
|
|
17
17
|
* Changes the direction to which the dropdown list appears.
|
|
18
18
|
*/
|
|
19
19
|
dropdownDirection?: SelectDropdownDirection;
|
|
20
|
+
/**
|
|
21
|
+
* Shows an input in the dropdown allowing options to be filtered.
|
|
22
|
+
*/
|
|
23
|
+
filter?: boolean;
|
|
20
24
|
/**
|
|
21
25
|
* The id of a form element the select should be associated with.
|
|
22
26
|
*/
|
|
@@ -75,6 +79,10 @@ export declare const PSelect: import("react").ForwardRefExoticComponent<import("
|
|
|
75
79
|
* Changes the direction to which the dropdown list appears.
|
|
76
80
|
*/
|
|
77
81
|
dropdownDirection?: SelectDropdownDirection;
|
|
82
|
+
/**
|
|
83
|
+
* Shows an input in the dropdown allowing options to be filtered.
|
|
84
|
+
*/
|
|
85
|
+
filter?: boolean;
|
|
78
86
|
/**
|
|
79
87
|
* The id of a form element the select should be associated with.
|
|
80
88
|
*/
|
|
@@ -4,14 +4,14 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PSelect = /*#__PURE__*/ forwardRef(({ compact = false, description = '', disabled = false, dropdownDirection = 'auto', form, hideLabel = false, label = '', message = '', name, onUpdate, required = false, state = 'none', theme, value, className, ...rest }, ref) => {
|
|
7
|
+
const PSelect = /*#__PURE__*/ forwardRef(({ compact = false, description = '', disabled = false, dropdownDirection = 'auto', filter = false, form, hideLabel = false, label = '', message = '', name, onUpdate, required = false, state = 'none', theme, value, className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef(undefined);
|
|
9
9
|
useEventCallback(elementRef, 'update', onUpdate);
|
|
10
10
|
const WebComponentTag = usePrefix('p-select');
|
|
11
|
-
const propsToSync = [compact, description, disabled, dropdownDirection, form, hideLabel, label, message, name, required, state, theme || useTheme(), value];
|
|
11
|
+
const propsToSync = [compact, description, disabled, dropdownDirection, filter, form, hideLabel, label, message, name, required, state, theme || useTheme(), value];
|
|
12
12
|
useBrowserLayoutEffect(() => {
|
|
13
13
|
const { current } = elementRef;
|
|
14
|
-
['compact', 'description', 'disabled', 'dropdownDirection', 'form', 'hideLabel', 'label', 'message', 'name', 'required', 'state', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
14
|
+
['compact', 'description', 'disabled', 'dropdownDirection', 'filter', 'form', 'hideLabel', 'label', 'message', 'name', 'required', 'state', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
15
15
|
}, propsToSync);
|
|
16
16
|
const props = {
|
|
17
17
|
...rest,
|
|
@@ -5,6 +5,10 @@ export type PTextareaProps = BaseProps & {
|
|
|
5
5
|
* Specifies whether the input can be autofilled by the browser
|
|
6
6
|
*/
|
|
7
7
|
autoComplete?: TextareaAutoComplete;
|
|
8
|
+
/**
|
|
9
|
+
* Show or hide the character counter.
|
|
10
|
+
*/
|
|
11
|
+
counter?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* The description text.
|
|
10
14
|
*/
|
|
@@ -18,7 +22,7 @@ export type PTextareaProps = BaseProps & {
|
|
|
18
22
|
*/
|
|
19
23
|
form?: string;
|
|
20
24
|
/**
|
|
21
|
-
* Show or hide label. For better accessibility it is recommended to show the label.
|
|
25
|
+
* Show or hide label. For better accessibility, it is recommended to show the label.
|
|
22
26
|
*/
|
|
23
27
|
hideLabel?: BreakpointCustomizable<boolean>;
|
|
24
28
|
/**
|
|
@@ -70,13 +74,9 @@ export type PTextareaProps = BaseProps & {
|
|
|
70
74
|
*/
|
|
71
75
|
resize?: TextareaResize;
|
|
72
76
|
/**
|
|
73
|
-
* The
|
|
77
|
+
* The number of rows of the textarea.
|
|
74
78
|
*/
|
|
75
79
|
rows?: number;
|
|
76
|
-
/**
|
|
77
|
-
* Show or hide max character count.
|
|
78
|
-
*/
|
|
79
|
-
showCounter?: boolean;
|
|
80
80
|
/**
|
|
81
81
|
* Specifies whether the input should have its spelling and grammar checked
|
|
82
82
|
*/
|
|
@@ -103,6 +103,10 @@ export declare const PTextarea: import("react").ForwardRefExoticComponent<import
|
|
|
103
103
|
* Specifies whether the input can be autofilled by the browser
|
|
104
104
|
*/
|
|
105
105
|
autoComplete?: TextareaAutoComplete;
|
|
106
|
+
/**
|
|
107
|
+
* Show or hide the character counter.
|
|
108
|
+
*/
|
|
109
|
+
counter?: boolean;
|
|
106
110
|
/**
|
|
107
111
|
* The description text.
|
|
108
112
|
*/
|
|
@@ -116,7 +120,7 @@ export declare const PTextarea: import("react").ForwardRefExoticComponent<import
|
|
|
116
120
|
*/
|
|
117
121
|
form?: string;
|
|
118
122
|
/**
|
|
119
|
-
* Show or hide label. For better accessibility it is recommended to show the label.
|
|
123
|
+
* Show or hide label. For better accessibility, it is recommended to show the label.
|
|
120
124
|
*/
|
|
121
125
|
hideLabel?: BreakpointCustomizable<boolean>;
|
|
122
126
|
/**
|
|
@@ -168,13 +172,9 @@ export declare const PTextarea: import("react").ForwardRefExoticComponent<import
|
|
|
168
172
|
*/
|
|
169
173
|
resize?: TextareaResize;
|
|
170
174
|
/**
|
|
171
|
-
* The
|
|
175
|
+
* The number of rows of the textarea.
|
|
172
176
|
*/
|
|
173
177
|
rows?: number;
|
|
174
|
-
/**
|
|
175
|
-
* Show or hide max character count.
|
|
176
|
-
*/
|
|
177
|
-
showCounter?: boolean;
|
|
178
178
|
/**
|
|
179
179
|
* Specifies whether the input should have its spelling and grammar checked
|
|
180
180
|
*/
|
|
@@ -4,16 +4,16 @@ import { forwardRef, useRef } from 'react';
|
|
|
4
4
|
import { useEventCallback, usePrefix, useTheme, useBrowserLayoutEffect, useMergedClass } from '../../hooks.mjs';
|
|
5
5
|
import { syncRef } from '../../utils.mjs';
|
|
6
6
|
|
|
7
|
-
const PTextarea = /*#__PURE__*/ forwardRef(({ autoComplete =
|
|
7
|
+
const PTextarea = /*#__PURE__*/ forwardRef(({ autoComplete, counter = false, description = '', disabled = false, form, hideLabel = false, label = '', maxLength, message = '', minLength, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, resize = 'vertical', rows = 7, spellCheck, state = 'none', theme, value = '', wrap = 'soft', className, ...rest }, ref) => {
|
|
8
8
|
const elementRef = useRef(undefined);
|
|
9
9
|
useEventCallback(elementRef, 'blur', onBlur);
|
|
10
10
|
useEventCallback(elementRef, 'change', onChange);
|
|
11
11
|
useEventCallback(elementRef, 'input', onInput);
|
|
12
12
|
const WebComponentTag = usePrefix('p-textarea');
|
|
13
|
-
const propsToSync = [autoComplete, description, disabled, form, hideLabel, label, maxLength, message, minLength, name, placeholder, readOnly, required, resize, rows,
|
|
13
|
+
const propsToSync = [autoComplete, counter, description, disabled, form, hideLabel, label, maxLength, message, minLength, name, placeholder, readOnly, required, resize, rows, spellCheck, state, theme || useTheme(), value, wrap];
|
|
14
14
|
useBrowserLayoutEffect(() => {
|
|
15
15
|
const { current } = elementRef;
|
|
16
|
-
['autoComplete', 'description', 'disabled', 'form', 'hideLabel', 'label', 'maxLength', 'message', 'minLength', 'name', 'placeholder', 'readOnly', 'required', 'resize', 'rows', '
|
|
16
|
+
['autoComplete', 'counter', 'description', 'disabled', 'form', 'hideLabel', 'label', 'maxLength', 'message', 'minLength', 'name', 'placeholder', 'readOnly', 'required', 'resize', 'rows', 'spellCheck', 'state', 'theme', 'value', 'wrap'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
17
|
}, propsToSync);
|
|
18
18
|
const props = {
|
|
19
19
|
...rest,
|
package/esm/lib/types.d.ts
CHANGED
|
@@ -221,6 +221,8 @@ declare const ICON_NAMES: readonly [
|
|
|
221
221
|
"add",
|
|
222
222
|
"adjust",
|
|
223
223
|
"aggregation",
|
|
224
|
+
"ai-spark",
|
|
225
|
+
"ai-spark-filled",
|
|
224
226
|
"arrow-compact-down",
|
|
225
227
|
"arrow-compact-left",
|
|
226
228
|
"arrow-compact-right",
|
|
@@ -1091,8 +1093,7 @@ export type IconColor = (typeof ICON_COLORS)[number];
|
|
|
1091
1093
|
export type InputNumberState = FormState;
|
|
1092
1094
|
declare const INPUT_NUMBER_AUTO_COMPLETE: readonly [
|
|
1093
1095
|
"off",
|
|
1094
|
-
"on"
|
|
1095
|
-
""
|
|
1096
|
+
"on"
|
|
1096
1097
|
];
|
|
1097
1098
|
export type InputNumberAutoComplete = (typeof INPUT_NUMBER_AUTO_COMPLETE)[number];
|
|
1098
1099
|
export type InputNumberChangeEventDetail = Event;
|
|
@@ -1102,7 +1103,6 @@ export type InputPasswordState = FormState;
|
|
|
1102
1103
|
declare const INPUT_PASSWORD_AUTO_COMPLETE: readonly [
|
|
1103
1104
|
"off",
|
|
1104
1105
|
"on",
|
|
1105
|
-
"",
|
|
1106
1106
|
"current-password",
|
|
1107
1107
|
"new-password"
|
|
1108
1108
|
];
|
|
@@ -1110,6 +1110,24 @@ export type InputPasswordAutoComplete = (typeof INPUT_PASSWORD_AUTO_COMPLETE)[nu
|
|
|
1110
1110
|
export type InputPasswordChangeEventDetail = Event;
|
|
1111
1111
|
export type InputPasswordBlurEventDetail = Event;
|
|
1112
1112
|
export type InputPasswordInputEventDetail = InputEvent;
|
|
1113
|
+
export type InputSearchState = FormState;
|
|
1114
|
+
declare const INPUT_SEARCH_AUTO_COMPLETE: readonly [
|
|
1115
|
+
"off",
|
|
1116
|
+
"on"
|
|
1117
|
+
];
|
|
1118
|
+
export type InputSearchAutoComplete = (typeof INPUT_SEARCH_AUTO_COMPLETE)[number];
|
|
1119
|
+
export type InputSearchChangeEventDetail = Event;
|
|
1120
|
+
export type InputSearchBlurEventDetail = Event;
|
|
1121
|
+
export type InputSearchInputEventDetail = InputEvent;
|
|
1122
|
+
export type InputTextState = FormState;
|
|
1123
|
+
declare const INPUT_TEXT_AUTO_COMPLETE: readonly [
|
|
1124
|
+
"off",
|
|
1125
|
+
"on"
|
|
1126
|
+
];
|
|
1127
|
+
export type InputTextAutoComplete = (typeof INPUT_TEXT_AUTO_COMPLETE)[number];
|
|
1128
|
+
export type InputTextChangeEventDetail = Event;
|
|
1129
|
+
export type InputTextBlurEventDetail = Event;
|
|
1130
|
+
export type InputTextInputEventDetail = InputEvent;
|
|
1113
1131
|
export type LinkIcon = LinkButtonIconName;
|
|
1114
1132
|
export type LinkPureIcon = LinkButtonIconName;
|
|
1115
1133
|
export type LinkPureAriaAttribute = LinkAriaAttribute;
|
|
@@ -1500,8 +1518,7 @@ export type TextListType = (typeof TEXT_LIST_TYPES)[number];
|
|
|
1500
1518
|
export type TextareaState = FormState;
|
|
1501
1519
|
declare const AUTO_COMPLETE: readonly [
|
|
1502
1520
|
"off",
|
|
1503
|
-
"on"
|
|
1504
|
-
""
|
|
1521
|
+
"on"
|
|
1505
1522
|
];
|
|
1506
1523
|
export type TextareaAutoComplete = (typeof AUTO_COMPLETE)[number];
|
|
1507
1524
|
declare const TEXTAREA_WRAPS: readonly [
|
package/esm/public-api.mjs
CHANGED
|
@@ -29,6 +29,8 @@ export { PIcon } from './lib/components/icon.wrapper.mjs';
|
|
|
29
29
|
export { PInlineNotification } from './lib/components/inline-notification.wrapper.mjs';
|
|
30
30
|
export { PInputNumber } from './lib/components/input-number.wrapper.mjs';
|
|
31
31
|
export { PInputPassword } from './lib/components/input-password.wrapper.mjs';
|
|
32
|
+
export { PInputSearch } from './lib/components/input-search.wrapper.mjs';
|
|
33
|
+
export { PInputText } from './lib/components/input-text.wrapper.mjs';
|
|
32
34
|
export { PLink } from './lib/components/link.wrapper.mjs';
|
|
33
35
|
export { PLinkPure } from './lib/components/link-pure.wrapper.mjs';
|
|
34
36
|
export { PLinkSocial } from './lib/components/link-social.wrapper.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@porsche-design-system/components-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.0-rc.1",
|
|
4
4
|
"description": "Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"porsche",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE",
|
|
18
18
|
"homepage": "https://designsystem.porsche.com",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@porsche-design-system/components-js": "3.
|
|
20
|
+
"@porsche-design-system/components-js": "3.29.0-rc.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"ag-grid-community": ">= 33.0.0 <34.0.0",
|