@porsche-design-system/components-react 3.28.0-rc.3 → 3.29.0-rc.0
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 +27 -0
- package/cjs/lib/components/input-number.wrapper.cjs +29 -0
- 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/select.wrapper.cjs +3 -3
- package/cjs/lib/components/textarea.wrapper.cjs +1 -1
- package/cjs/public-api.cjs +6 -0
- package/esm/lib/components/index.d.ts +3 -0
- package/esm/lib/components/input-number.wrapper.d.ts +192 -0
- package/esm/lib/components/input-number.wrapper.mjs +27 -0
- 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/select.wrapper.d.ts +8 -0
- package/esm/lib/components/select.wrapper.mjs +3 -3
- package/esm/lib/components/textarea.wrapper.d.ts +4 -4
- package/esm/lib/components/textarea.wrapper.mjs +1 -1
- package/esm/lib/types.d.ts +29 -4
- package/esm/public-api.mjs +3 -0
- package/package.json +3 -3
- package/ssr/cjs/components/dist/styles/esm/styles-entry.cjs +429 -271
- package/ssr/cjs/components/dist/utils/esm/utils-entry.cjs +4 -24
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.cjs +40 -0
- 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/select.wrapper.cjs +4 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs +1 -1
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs +26 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs +44 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.cjs +11 -11
- 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 +43 -0
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.cjs +10 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs +1 -3
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs +6 -5
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.cjs +5 -4
- package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/public-api.cjs +6 -0
- package/ssr/esm/components/dist/styles/esm/styles-entry.mjs +393 -243
- package/ssr/esm/components/dist/utils/esm/utils-entry.mjs +4 -22
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/input-number.wrapper.mjs +38 -0
- 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/select.wrapper.mjs +4 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.mjs +1 -1
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.mjs +1 -1
- 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 +24 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.mjs +42 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-password.mjs +12 -12
- 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 +41 -0
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select-option.mjs +11 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.mjs +2 -4
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.mjs +6 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select.mjs +6 -5
- package/ssr/esm/components-react/projects/react-ssr-wrapper/src/public-api.mjs +3 -0
- package/ssr/esm/lib/components/index.d.ts +3 -0
- package/ssr/esm/lib/components/input-number.wrapper.d.ts +192 -0
- 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/select.wrapper.d.ts +8 -0
- package/ssr/esm/lib/components/textarea.wrapper.d.ts +4 -4
- package/ssr/esm/lib/dsr-components/input-base.d.ts +33 -0
- package/ssr/esm/lib/dsr-components/input-number.d.ts +19 -0
- package/ssr/esm/lib/dsr-components/input-password.d.ts +6 -3
- 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/multi-select.d.ts +0 -1
- package/ssr/esm/lib/dsr-components/select.d.ts +2 -1
- package/ssr/esm/lib/types.d.ts +29 -4
- package/{tailwind → tailwindcss}/index.css +194 -133
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { BaseProps } from '../../BaseProps';
|
|
2
|
+
import type { InputSearchAutoComplete, BreakpointCustomizable, InputSearchBlurEventDetail, InputSearchChangeEventDetail, InputSearchInputEventDetail, InputSearchState, Theme } from '../types';
|
|
3
|
+
export type PInputSearchProps = BaseProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies whether the input can be autofilled by the browser
|
|
6
|
+
*/
|
|
7
|
+
autoComplete?: InputSearchAutoComplete;
|
|
8
|
+
/**
|
|
9
|
+
* Show clear input value button
|
|
10
|
+
*/
|
|
11
|
+
clear?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Displays as a compact version.
|
|
14
|
+
*/
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The description text.
|
|
18
|
+
*/
|
|
19
|
+
description?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Marks the search input as disabled.
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The id of a form element the search 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
|
+
* Show search indicator icon
|
|
34
|
+
*/
|
|
35
|
+
indicator?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The label text.
|
|
38
|
+
*/
|
|
39
|
+
label?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @experimental Shows a loading indicator.
|
|
42
|
+
*/
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The message styled depending on validation state.
|
|
46
|
+
*/
|
|
47
|
+
message?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The name of the search input.
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/**
|
|
53
|
+
* Emitted when the search input has lost focus.
|
|
54
|
+
*/
|
|
55
|
+
onBlur?: (event: CustomEvent<InputSearchBlurEventDetail>) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Emitted when the search input loses focus after its value was changed.
|
|
58
|
+
*/
|
|
59
|
+
onChange?: (event: CustomEvent<InputSearchChangeEventDetail>) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Emitted when the value has been changed as a direct result of a user action.
|
|
62
|
+
*/
|
|
63
|
+
onInput?: (event: CustomEvent<InputSearchInputEventDetail>) => void;
|
|
64
|
+
/**
|
|
65
|
+
* The placeholder text.
|
|
66
|
+
*/
|
|
67
|
+
placeholder?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies whether the search input should be read-only.
|
|
70
|
+
*/
|
|
71
|
+
readOnly?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Marks the search input as required.
|
|
74
|
+
*/
|
|
75
|
+
required?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The validation state.
|
|
78
|
+
*/
|
|
79
|
+
state?: InputSearchState;
|
|
80
|
+
/**
|
|
81
|
+
* Adapts the color depending on the theme.
|
|
82
|
+
*/
|
|
83
|
+
theme?: Theme;
|
|
84
|
+
/**
|
|
85
|
+
* The search input value.
|
|
86
|
+
*/
|
|
87
|
+
value?: string;
|
|
88
|
+
};
|
|
89
|
+
export declare const PInputSearch: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
|
|
90
|
+
/**
|
|
91
|
+
* Specifies whether the input can be autofilled by the browser
|
|
92
|
+
*/
|
|
93
|
+
autoComplete?: InputSearchAutoComplete;
|
|
94
|
+
/**
|
|
95
|
+
* Show clear input value button
|
|
96
|
+
*/
|
|
97
|
+
clear?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Displays as a compact version.
|
|
100
|
+
*/
|
|
101
|
+
compact?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* The description text.
|
|
104
|
+
*/
|
|
105
|
+
description?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Marks the search input as disabled.
|
|
108
|
+
*/
|
|
109
|
+
disabled?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The id of a form element the search input should be associated with.
|
|
112
|
+
*/
|
|
113
|
+
form?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Show or hide label and description text. For better accessibility it is recommended to show the label.
|
|
116
|
+
*/
|
|
117
|
+
hideLabel?: BreakpointCustomizable<boolean>;
|
|
118
|
+
/**
|
|
119
|
+
* Show search indicator icon
|
|
120
|
+
*/
|
|
121
|
+
indicator?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* The label text.
|
|
124
|
+
*/
|
|
125
|
+
label?: string;
|
|
126
|
+
/**
|
|
127
|
+
* @experimental Shows a loading indicator.
|
|
128
|
+
*/
|
|
129
|
+
loading?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The message styled depending on validation state.
|
|
132
|
+
*/
|
|
133
|
+
message?: string;
|
|
134
|
+
/**
|
|
135
|
+
* The name of the search input.
|
|
136
|
+
*/
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* Emitted when the search input has lost focus.
|
|
140
|
+
*/
|
|
141
|
+
onBlur?: (event: CustomEvent<InputSearchBlurEventDetail>) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Emitted when the search input loses focus after its value was changed.
|
|
144
|
+
*/
|
|
145
|
+
onChange?: (event: CustomEvent<InputSearchChangeEventDetail>) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Emitted when the value has been changed as a direct result of a user action.
|
|
148
|
+
*/
|
|
149
|
+
onInput?: (event: CustomEvent<InputSearchInputEventDetail>) => void;
|
|
150
|
+
/**
|
|
151
|
+
* The placeholder text.
|
|
152
|
+
*/
|
|
153
|
+
placeholder?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Specifies whether the search input should be read-only.
|
|
156
|
+
*/
|
|
157
|
+
readOnly?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Marks the search input as required.
|
|
160
|
+
*/
|
|
161
|
+
required?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* The validation state.
|
|
164
|
+
*/
|
|
165
|
+
state?: InputSearchState;
|
|
166
|
+
/**
|
|
167
|
+
* Adapts the color depending on the theme.
|
|
168
|
+
*/
|
|
169
|
+
theme?: Theme;
|
|
170
|
+
/**
|
|
171
|
+
* The search input value.
|
|
172
|
+
*/
|
|
173
|
+
value?: string;
|
|
174
|
+
} & {
|
|
175
|
+
children?: import("react").ReactNode | undefined;
|
|
176
|
+
} & 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 PInputSearch = /*#__PURE__*/ forwardRef(({ autoComplete, clear = false, compact = false, description = '', disabled = false, form, hideLabel = false, indicator = true, label = '', loading = false, message = '', name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, 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-search');
|
|
13
|
+
const propsToSync = [autoComplete, clear, compact, description, disabled, form, hideLabel, indicator, label, loading, message, name, placeholder, readOnly, required, state, theme || useTheme(), value];
|
|
14
|
+
useBrowserLayoutEffect(() => {
|
|
15
|
+
const { current } = elementRef;
|
|
16
|
+
['autoComplete', 'clear', 'compact', 'description', 'disabled', 'form', 'hideLabel', 'indicator', 'label', 'loading', 'message', 'name', 'placeholder', 'readOnly', 'required', '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 { PInputSearch };
|
|
@@ -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 };
|
|
@@ -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,
|
|
@@ -18,7 +18,7 @@ export type PTextareaProps = BaseProps & {
|
|
|
18
18
|
*/
|
|
19
19
|
form?: string;
|
|
20
20
|
/**
|
|
21
|
-
* Show or hide label. For better accessibility it is recommended to show the label.
|
|
21
|
+
* Show or hide label. For better accessibility, it is recommended to show the label.
|
|
22
22
|
*/
|
|
23
23
|
hideLabel?: BreakpointCustomizable<boolean>;
|
|
24
24
|
/**
|
|
@@ -70,7 +70,7 @@ export type PTextareaProps = BaseProps & {
|
|
|
70
70
|
*/
|
|
71
71
|
resize?: TextareaResize;
|
|
72
72
|
/**
|
|
73
|
-
* The
|
|
73
|
+
* The number of rows of the textarea.
|
|
74
74
|
*/
|
|
75
75
|
rows?: number;
|
|
76
76
|
/**
|
|
@@ -116,7 +116,7 @@ export declare const PTextarea: import("react").ForwardRefExoticComponent<import
|
|
|
116
116
|
*/
|
|
117
117
|
form?: string;
|
|
118
118
|
/**
|
|
119
|
-
* Show or hide label. For better accessibility it is recommended to show the label.
|
|
119
|
+
* Show or hide label. For better accessibility, it is recommended to show the label.
|
|
120
120
|
*/
|
|
121
121
|
hideLabel?: BreakpointCustomizable<boolean>;
|
|
122
122
|
/**
|
|
@@ -168,7 +168,7 @@ export declare const PTextarea: import("react").ForwardRefExoticComponent<import
|
|
|
168
168
|
*/
|
|
169
169
|
resize?: TextareaResize;
|
|
170
170
|
/**
|
|
171
|
-
* The
|
|
171
|
+
* The number of rows of the textarea.
|
|
172
172
|
*/
|
|
173
173
|
rows?: number;
|
|
174
174
|
/**
|
|
@@ -4,7 +4,7 @@ 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, description = '', disabled = false, form, hideLabel = false, label = '', maxLength, message = '', minLength, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, resize = 'vertical', rows = 7, showCounter = true, 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);
|
package/esm/lib/types.d.ts
CHANGED
|
@@ -1088,18 +1088,44 @@ declare const ICON_COLORS: readonly [
|
|
|
1088
1088
|
"state-disabled"
|
|
1089
1089
|
];
|
|
1090
1090
|
export type IconColor = (typeof ICON_COLORS)[number];
|
|
1091
|
+
export type InputNumberState = FormState;
|
|
1092
|
+
declare const INPUT_NUMBER_AUTO_COMPLETE: readonly [
|
|
1093
|
+
"off",
|
|
1094
|
+
"on"
|
|
1095
|
+
];
|
|
1096
|
+
export type InputNumberAutoComplete = (typeof INPUT_NUMBER_AUTO_COMPLETE)[number];
|
|
1097
|
+
export type InputNumberChangeEventDetail = Event;
|
|
1098
|
+
export type InputNumberBlurEventDetail = Event;
|
|
1099
|
+
export type InputNumberInputEventDetail = InputEvent;
|
|
1091
1100
|
export type InputPasswordState = FormState;
|
|
1092
1101
|
declare const INPUT_PASSWORD_AUTO_COMPLETE: readonly [
|
|
1093
1102
|
"off",
|
|
1094
1103
|
"on",
|
|
1095
1104
|
"current-password",
|
|
1096
|
-
"new-password"
|
|
1097
|
-
""
|
|
1105
|
+
"new-password"
|
|
1098
1106
|
];
|
|
1099
1107
|
export type InputPasswordAutoComplete = (typeof INPUT_PASSWORD_AUTO_COMPLETE)[number];
|
|
1100
1108
|
export type InputPasswordChangeEventDetail = Event;
|
|
1101
1109
|
export type InputPasswordBlurEventDetail = Event;
|
|
1102
1110
|
export type InputPasswordInputEventDetail = InputEvent;
|
|
1111
|
+
export type InputSearchState = FormState;
|
|
1112
|
+
declare const INPUT_SEARCH_AUTO_COMPLETE: readonly [
|
|
1113
|
+
"off",
|
|
1114
|
+
"on"
|
|
1115
|
+
];
|
|
1116
|
+
export type InputSearchAutoComplete = (typeof INPUT_SEARCH_AUTO_COMPLETE)[number];
|
|
1117
|
+
export type InputSearchChangeEventDetail = Event;
|
|
1118
|
+
export type InputSearchBlurEventDetail = Event;
|
|
1119
|
+
export type InputSearchInputEventDetail = InputEvent;
|
|
1120
|
+
export type InputTextState = FormState;
|
|
1121
|
+
declare const INPUT_TEXT_AUTO_COMPLETE: readonly [
|
|
1122
|
+
"off",
|
|
1123
|
+
"on"
|
|
1124
|
+
];
|
|
1125
|
+
export type InputTextAutoComplete = (typeof INPUT_TEXT_AUTO_COMPLETE)[number];
|
|
1126
|
+
export type InputTextChangeEventDetail = Event;
|
|
1127
|
+
export type InputTextBlurEventDetail = Event;
|
|
1128
|
+
export type InputTextInputEventDetail = InputEvent;
|
|
1103
1129
|
export type LinkIcon = LinkButtonIconName;
|
|
1104
1130
|
export type LinkPureIcon = LinkButtonIconName;
|
|
1105
1131
|
export type LinkPureAriaAttribute = LinkAriaAttribute;
|
|
@@ -1490,8 +1516,7 @@ export type TextListType = (typeof TEXT_LIST_TYPES)[number];
|
|
|
1490
1516
|
export type TextareaState = FormState;
|
|
1491
1517
|
declare const AUTO_COMPLETE: readonly [
|
|
1492
1518
|
"off",
|
|
1493
|
-
"on"
|
|
1494
|
-
""
|
|
1519
|
+
"on"
|
|
1495
1520
|
];
|
|
1496
1521
|
export type TextareaAutoComplete = (typeof AUTO_COMPLETE)[number];
|
|
1497
1522
|
declare const TEXTAREA_WRAPS: readonly [
|
package/esm/public-api.mjs
CHANGED
|
@@ -27,7 +27,10 @@ export { PHeading } from './lib/components/heading.wrapper.mjs';
|
|
|
27
27
|
export { PHeadline } from './lib/components/headline.wrapper.mjs';
|
|
28
28
|
export { PIcon } from './lib/components/icon.wrapper.mjs';
|
|
29
29
|
export { PInlineNotification } from './lib/components/inline-notification.wrapper.mjs';
|
|
30
|
+
export { PInputNumber } from './lib/components/input-number.wrapper.mjs';
|
|
30
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';
|
|
31
34
|
export { PLink } from './lib/components/link.wrapper.mjs';
|
|
32
35
|
export { PLinkPure } from './lib/components/link-pure.wrapper.mjs';
|
|
33
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.0",
|
|
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.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"ag-grid-community": ">= 33.0.0 <34.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"default": "./styles/vanilla-extract/cjs/vanilla-extract/index.cjs"
|
|
77
77
|
},
|
|
78
78
|
"./tailwindcss": {
|
|
79
|
-
"style": "./
|
|
79
|
+
"style": "./tailwindcss/index.css"
|
|
80
80
|
},
|
|
81
81
|
"./ag-grid": {
|
|
82
82
|
"types": "./ag-grid/esm/index.d.ts",
|