@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
|
@@ -3273,29 +3273,12 @@ const getComboboxAriaAttributes = (isOpen, isRequired, labelId, descriptionId, d
|
|
|
3273
3273
|
'aria-controls': dropdownId,
|
|
3274
3274
|
};
|
|
3275
3275
|
};
|
|
3276
|
-
|
|
3277
|
-
const getListAriaAttributes = (label, isRequired, hasFilter, isOpen, multiple = false) => {
|
|
3276
|
+
const getComboboxFilterAriaAttributes = () => {
|
|
3278
3277
|
return {
|
|
3279
|
-
|
|
3280
|
-
'aria-
|
|
3281
|
-
...(isRequired &&
|
|
3282
|
-
!hasFilter && {
|
|
3283
|
-
'aria-required': 'true',
|
|
3284
|
-
}),
|
|
3285
|
-
...(!isOpen && {
|
|
3286
|
-
'aria-hidden': 'true',
|
|
3287
|
-
}),
|
|
3288
|
-
...(multiple && {
|
|
3289
|
-
'aria-multiselectable': 'true',
|
|
3290
|
-
}),
|
|
3278
|
+
'aria-autocomplete': 'list',
|
|
3279
|
+
'aria-expanded': 'true',
|
|
3291
3280
|
};
|
|
3292
3281
|
};
|
|
3293
|
-
const getOptionAriaAttributes = (isSelected, isDisabled, isHidden, hasValue) => ({
|
|
3294
|
-
...(!isHidden && { 'aria-selected': isSelected ? 'true' : 'false' }),
|
|
3295
|
-
'aria-disabled': isDisabled ? 'true' : null,
|
|
3296
|
-
'aria-hidden': isHidden ? 'true' : null,
|
|
3297
|
-
'aria-label': hasValue ? null : 'Empty value',
|
|
3298
|
-
});
|
|
3299
3282
|
|
|
3300
3283
|
const borderWidthBase = '2px';
|
|
3301
3284
|
|
|
@@ -3716,7 +3699,6 @@ const buildImgSrc = (innerManifest) => `${getCDNBaseURL()}/marque/${innerManifes
|
|
|
3716
3699
|
const getSvgUrl = (model) => {
|
|
3717
3700
|
return `${getCDNBaseURL()}/model-signatures/${MODEL_SIGNATURES_MANIFEST[model].src}`;
|
|
3718
3701
|
};
|
|
3719
|
-
const getSelectedOptions = (options) => options.filter((option) => option.selected);
|
|
3720
3702
|
const getSelectedOptionValues = (options) => options.filter((option) => option.selected).map((option) => option.value);
|
|
3721
3703
|
exports.ItemType = void 0;
|
|
3722
3704
|
(function (ItemType) {
|
|
@@ -3938,6 +3920,7 @@ exports.getButtonPureAriaAttributes = getButtonPureAriaAttributes;
|
|
|
3938
3920
|
exports.getCDNBaseURL = getCDNBaseURL;
|
|
3939
3921
|
exports.getClosestHTMLElement = getClosestHTMLElement;
|
|
3940
3922
|
exports.getComboboxAriaAttributes = getComboboxAriaAttributes;
|
|
3923
|
+
exports.getComboboxFilterAriaAttributes = getComboboxFilterAriaAttributes;
|
|
3941
3924
|
exports.getContentAriaAttributes = getContentAriaAttributes;
|
|
3942
3925
|
exports.getCurrentActivePage = getCurrentActivePage;
|
|
3943
3926
|
exports.getDirectChildHTMLElement = getDirectChildHTMLElement;
|
|
@@ -3949,13 +3932,10 @@ exports.getHeadlineTagType = getHeadlineTagType;
|
|
|
3949
3932
|
exports.getIconColor = getIconColor;
|
|
3950
3933
|
exports.getInlineNotificationIconName = getInlineNotificationIconName;
|
|
3951
3934
|
exports.getInnerManifest = getInnerManifest;
|
|
3952
|
-
exports.getListAriaAttributes = getListAriaAttributes;
|
|
3953
|
-
exports.getOptionAriaAttributes = getOptionAriaAttributes;
|
|
3954
3935
|
exports.getSegmentedControlItemAriaAttributes = getSegmentedControlItemAriaAttributes;
|
|
3955
3936
|
exports.getSelectedOptionMap = getSelectedOptionMap;
|
|
3956
3937
|
exports.getSelectedOptionString = getSelectedOptionString;
|
|
3957
3938
|
exports.getSelectedOptionValues = getSelectedOptionValues;
|
|
3958
|
-
exports.getSelectedOptions = getSelectedOptions;
|
|
3959
3939
|
exports.getStepperHorizontalIconName = getStepperHorizontalIconName;
|
|
3960
3940
|
exports.getSvgUrl = getSvgUrl;
|
|
3961
3941
|
exports.getSwitchButtonAriaAttributes = getSwitchButtonAriaAttributes;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var hooks = require('../../hooks.cjs');
|
|
7
|
+
var utils = require('../../utils.cjs');
|
|
8
|
+
var inputNumber = require('../dsr-components/input-number.cjs');
|
|
9
|
+
|
|
10
|
+
const PInputNumber = /*#__PURE__*/ react.forwardRef(({ autoComplete, compact = false, controls = false, description = '', disabled = false, form, hideLabel = false, label = '', loading = false, max, message = '', min, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, state = 'none', step = 1, theme, value = '', className, children, ...rest }, ref) => {
|
|
11
|
+
const elementRef = react.useRef(undefined);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'blur', onBlur);
|
|
13
|
+
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
14
|
+
hooks.useEventCallback(elementRef, 'input', onInput);
|
|
15
|
+
const WebComponentTag = hooks.usePrefix('p-input-number');
|
|
16
|
+
const propsToSync = [autoComplete, compact, controls, description, disabled, form, hideLabel, label, loading, max, message, min, name, placeholder, readOnly, required, state, step, theme || hooks.useTheme(), value];
|
|
17
|
+
hooks.useBrowserLayoutEffect(() => {
|
|
18
|
+
const { current } = elementRef;
|
|
19
|
+
['autoComplete', 'compact', 'controls', 'description', 'disabled', 'form', 'hideLabel', 'label', 'loading', 'max', 'message', 'min', 'name', 'placeholder', 'readOnly', 'required', 'state', 'step', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
20
|
+
}, propsToSync);
|
|
21
|
+
const props = {
|
|
22
|
+
...rest,
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
...(!process.browser
|
|
25
|
+
? {
|
|
26
|
+
children: (jsxRuntime.jsx(inputNumber.DSRInputNumber, { autoComplete, compact, controls, description, disabled, form, hideLabel, label, loading, max, message, min, name, placeholder, readOnly, required, state, step, theme: theme || hooks.useTheme(), value, children })),
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
children,
|
|
30
|
+
suppressHydrationWarning: true,
|
|
31
|
+
}),
|
|
32
|
+
'data-ssr': '',
|
|
33
|
+
class: hooks.useMergedClass(elementRef, className),
|
|
34
|
+
ref: utils.syncRef(elementRef, ref)
|
|
35
|
+
};
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
return jsxRuntime.jsx(WebComponentTag, { ...props });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.PInputNumber = PInputNumber;
|
|
@@ -7,23 +7,23 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var inputPassword = require('../dsr-components/input-password.cjs');
|
|
9
9
|
|
|
10
|
-
const PInputPassword = /*#__PURE__*/ react.forwardRef(({ autoComplete
|
|
10
|
+
const PInputPassword = /*#__PURE__*/ react.forwardRef(({ autoComplete, compact = false, description = '', disabled = false, form, hideLabel = false, label = '', loading = false, maxLength, message = '', minLength, name, onBlur, onChange, onInput, placeholder = '', readOnly = false, required = false, state = 'none', theme, toggle = false, value = '', className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'blur', onBlur);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
14
14
|
hooks.useEventCallback(elementRef, 'input', onInput);
|
|
15
15
|
const WebComponentTag = hooks.usePrefix('p-input-password');
|
|
16
|
-
const propsToSync = [autoComplete, compact, description, disabled, form, hideLabel, label, maxLength, message, minLength, name, placeholder, readOnly, required, state, theme || hooks.useTheme(), toggle, value];
|
|
16
|
+
const propsToSync = [autoComplete, compact, description, disabled, form, hideLabel, label, loading, maxLength, message, minLength, name, placeholder, readOnly, required, state, theme || hooks.useTheme(), toggle, value];
|
|
17
17
|
hooks.useBrowserLayoutEffect(() => {
|
|
18
18
|
const { current } = elementRef;
|
|
19
|
-
['autoComplete', 'compact', 'description', 'disabled', 'form', 'hideLabel', 'label', 'maxLength', 'message', 'minLength', 'name', 'placeholder', 'readOnly', 'required', 'state', 'theme', 'toggle', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
19
|
+
['autoComplete', 'compact', 'description', 'disabled', 'form', 'hideLabel', 'label', 'loading', 'maxLength', 'message', 'minLength', 'name', 'placeholder', 'readOnly', 'required', 'state', 'theme', 'toggle', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
20
20
|
}, propsToSync);
|
|
21
21
|
const props = {
|
|
22
22
|
...rest,
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
...(!process.browser
|
|
25
25
|
? {
|
|
26
|
-
children: (jsxRuntime.jsx(inputPassword.DSRInputPassword, { autoComplete, compact, description, disabled, form, hideLabel, label, maxLength, message, minLength, name, placeholder, readOnly, required, state, theme: theme || hooks.useTheme(), toggle, value, children })),
|
|
26
|
+
children: (jsxRuntime.jsx(inputPassword.DSRInputPassword, { autoComplete, compact, description, disabled, form, hideLabel, label, loading, maxLength, message, minLength, name, placeholder, readOnly, required, state, theme: theme || hooks.useTheme(), toggle, value, children })),
|
|
27
27
|
}
|
|
28
28
|
: {
|
|
29
29
|
children,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var hooks = require('../../hooks.cjs');
|
|
7
|
+
var utils = require('../../utils.cjs');
|
|
8
|
+
var inputSearch = require('../dsr-components/input-search.cjs');
|
|
9
|
+
|
|
10
|
+
const PInputSearch = /*#__PURE__*/ react.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, children, ...rest }, ref) => {
|
|
11
|
+
const elementRef = react.useRef(undefined);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'blur', onBlur);
|
|
13
|
+
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
14
|
+
hooks.useEventCallback(elementRef, 'input', onInput);
|
|
15
|
+
const WebComponentTag = hooks.usePrefix('p-input-search');
|
|
16
|
+
const propsToSync = [autoComplete, clear, compact, description, disabled, form, hideLabel, indicator, label, loading, message, name, placeholder, readOnly, required, state, theme || hooks.useTheme(), value];
|
|
17
|
+
hooks.useBrowserLayoutEffect(() => {
|
|
18
|
+
const { current } = elementRef;
|
|
19
|
+
['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]));
|
|
20
|
+
}, propsToSync);
|
|
21
|
+
const props = {
|
|
22
|
+
...rest,
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
...(!process.browser
|
|
25
|
+
? {
|
|
26
|
+
children: (jsxRuntime.jsx(inputSearch.DSRInputSearch, { autoComplete, clear, compact, description, disabled, form, hideLabel, indicator, label, loading, message, name, placeholder, readOnly, required, state, theme: theme || hooks.useTheme(), value, children })),
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
children,
|
|
30
|
+
suppressHydrationWarning: true,
|
|
31
|
+
}),
|
|
32
|
+
'data-ssr': '',
|
|
33
|
+
class: hooks.useMergedClass(elementRef, className),
|
|
34
|
+
ref: utils.syncRef(elementRef, ref)
|
|
35
|
+
};
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
return jsxRuntime.jsx(WebComponentTag, { ...props });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.PInputSearch = PInputSearch;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var hooks = require('../../hooks.cjs');
|
|
7
|
+
var utils = require('../../utils.cjs');
|
|
8
|
+
var inputText = require('../dsr-components/input-text.cjs');
|
|
9
|
+
|
|
10
|
+
const PInputText = /*#__PURE__*/ react.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, children, ...rest }, ref) => {
|
|
11
|
+
const elementRef = react.useRef(undefined);
|
|
12
|
+
hooks.useEventCallback(elementRef, 'blur', onBlur);
|
|
13
|
+
hooks.useEventCallback(elementRef, 'change', onChange);
|
|
14
|
+
hooks.useEventCallback(elementRef, 'input', onInput);
|
|
15
|
+
const WebComponentTag = hooks.usePrefix('p-input-text');
|
|
16
|
+
const propsToSync = [autoComplete, compact, counter, description, disabled, form, hideLabel, label, loading, maxLength, message, minLength, name, placeholder, readOnly, required, spellCheck, state, theme || hooks.useTheme(), value];
|
|
17
|
+
hooks.useBrowserLayoutEffect(() => {
|
|
18
|
+
const { current } = elementRef;
|
|
19
|
+
['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]));
|
|
20
|
+
}, propsToSync);
|
|
21
|
+
const props = {
|
|
22
|
+
...rest,
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
...(!process.browser
|
|
25
|
+
? {
|
|
26
|
+
children: (jsxRuntime.jsx(inputText.DSRInputText, { autoComplete, compact, counter, description, disabled, form, hideLabel, label, loading, maxLength, message, minLength, name, placeholder, readOnly, required, spellCheck, state, theme: theme || hooks.useTheme(), value, children })),
|
|
27
|
+
}
|
|
28
|
+
: {
|
|
29
|
+
children,
|
|
30
|
+
suppressHydrationWarning: true,
|
|
31
|
+
}),
|
|
32
|
+
'data-ssr': '',
|
|
33
|
+
class: hooks.useMergedClass(elementRef, className),
|
|
34
|
+
ref: utils.syncRef(elementRef, ref)
|
|
35
|
+
};
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
return jsxRuntime.jsx(WebComponentTag, { ...props });
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
exports.PInputText = PInputText;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/select.wrapper.cjs
CHANGED
|
@@ -7,21 +7,21 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var select = require('../dsr-components/select.cjs');
|
|
9
9
|
|
|
10
|
-
const PSelect = /*#__PURE__*/ react.forwardRef(({ compact = false, description = '', disabled = false, dropdownDirection = 'auto', form, hideLabel = false, label = '', message = '', name, onUpdate, required = false, state = 'none', theme, value, className, children, ...rest }, ref) => {
|
|
10
|
+
const PSelect = /*#__PURE__*/ react.forwardRef(({ compact = false, description = '', disabled = false, dropdownDirection = 'auto', filter = false, form, hideLabel = false, label = '', message = '', name, onUpdate, required = false, state = 'none', theme, value, className, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'update', onUpdate);
|
|
13
13
|
const WebComponentTag = hooks.usePrefix('p-select');
|
|
14
|
-
const propsToSync = [compact, description, disabled, dropdownDirection, form, hideLabel, label, message, name, required, state, theme || hooks.useTheme(), value];
|
|
14
|
+
const propsToSync = [compact, description, disabled, dropdownDirection, filter, form, hideLabel, label, message, name, required, state, theme || hooks.useTheme(), value];
|
|
15
15
|
hooks.useBrowserLayoutEffect(() => {
|
|
16
16
|
const { current } = elementRef;
|
|
17
|
-
['compact', 'description', 'disabled', 'dropdownDirection', 'form', 'hideLabel', 'label', 'message', 'name', 'required', 'state', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
17
|
+
['compact', 'description', 'disabled', 'dropdownDirection', 'filter', 'form', 'hideLabel', 'label', 'message', 'name', 'required', 'state', 'theme', 'value'].forEach((propName, i) => (current[propName] = propsToSync[i]));
|
|
18
18
|
}, propsToSync);
|
|
19
19
|
const props = {
|
|
20
20
|
...rest,
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
...(!process.browser
|
|
23
23
|
? {
|
|
24
|
-
children: (jsxRuntime.jsx(select.DSRSelect, { compact, description, disabled, dropdownDirection, form, hideLabel, label, message, name, required, state, theme: theme || hooks.useTheme(), value, children })),
|
|
24
|
+
children: (jsxRuntime.jsx(select.DSRSelect, { compact, description, disabled, dropdownDirection, filter, form, hideLabel, label, message, name, required, state, theme: theme || hooks.useTheme(), value, children })),
|
|
25
25
|
}
|
|
26
26
|
: {
|
|
27
27
|
children,
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/textarea.wrapper.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var hooks = require('../../hooks.cjs');
|
|
|
7
7
|
var utils = require('../../utils.cjs');
|
|
8
8
|
var textarea = require('../dsr-components/textarea.cjs');
|
|
9
9
|
|
|
10
|
-
const PTextarea = /*#__PURE__*/ react.forwardRef(({ autoComplete
|
|
10
|
+
const PTextarea = /*#__PURE__*/ react.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, children, ...rest }, ref) => {
|
|
11
11
|
const elementRef = react.useRef(undefined);
|
|
12
12
|
hooks.useEventCallback(elementRef, 'blur', onBlur);
|
|
13
13
|
hooks.useEventCallback(elementRef, 'change', onChange);
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/components/toast.wrapper.cjs
CHANGED
|
@@ -19,7 +19,7 @@ const PToast = /*#__PURE__*/ react.forwardRef(({ theme, className, ...rest }, re
|
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
...(!process.browser
|
|
21
21
|
? {
|
|
22
|
-
...{ "role": "status"
|
|
22
|
+
...{ "role": "status" },
|
|
23
23
|
children: (jsxRuntime.jsx(toast.DSRToast, { theme: theme || hooks.useTheme() })),
|
|
24
24
|
}
|
|
25
25
|
: {
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-base.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.cjs');
|
|
5
|
+
require('react');
|
|
6
|
+
require('../../provider.cjs');
|
|
7
|
+
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
|
|
8
|
+
var loadingMessage = require('./loading-message.cjs');
|
|
9
|
+
var label = require('./label.cjs');
|
|
10
|
+
var stateMessage = require('./state-message.cjs');
|
|
11
|
+
var spinner_wrapper = require('../components/spinner.wrapper.cjs');
|
|
12
|
+
|
|
13
|
+
const InputBase = ({ children,
|
|
14
|
+
// host,
|
|
15
|
+
id, label: label$1, description, loading, initialLoading, required, disabled, state, message, theme, readOnly, type, form, placeholder, maxLength, minLength, max, min, value, step, spellCheck, autoComplete, name,
|
|
16
|
+
// onInput,
|
|
17
|
+
// onWheel,
|
|
18
|
+
// onChange,
|
|
19
|
+
// onBlur,
|
|
20
|
+
// refElement,
|
|
21
|
+
start, end, }) => {
|
|
22
|
+
const { namedSlotChildren } = splitChildren.splitChildren(children);
|
|
23
|
+
return (jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: !!label$1 || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: !!description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: label$1, description: description, htmlFor: id, isRequired: required, isLoading: loading, isDisabled: disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("slot", { name: "start" }), start, jsxRuntime.jsx("input", { "aria-describedby": loading ? loadingMessage.loadingId : `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": state === 'error' ? 'true' : null, "aria-disabled": disabled || loading ? 'true' : null, "aria-readonly": readOnly ? 'true' : null, id: id, name: name, form: form, type: type, required: required, placeholder: placeholder, maxLength: maxLength, minLength: minLength, spellCheck: spellCheck, max: max, min: min, step: step, value: value, readOnly: readOnly, autoComplete: autoComplete, disabled: disabled }), end, jsxRuntime.jsx("slot", { name: "end" }), loading && jsxRuntime.jsx(spinner_wrapper.PSpinner, { className: "spinner", size: "inherit", theme: theme, "aria-hidden": "true" })] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(state), state: state, message: message, theme: theme, host: null }), jsxRuntime.jsx(loadingMessage.LoadingMessage, { loading: loading, initialLoading: initialLoading })] }));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.InputBase = InputBase;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-number.cjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
require('../../provider.cjs');
|
|
6
|
+
var splitChildren = require('../../splitChildren.cjs');
|
|
7
|
+
var minifyCss = require('../../minifyCss.cjs');
|
|
8
|
+
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
9
|
+
var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
10
|
+
var inputBase = require('./input-base.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
|
+
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
|
+
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
16
|
+
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
|
17
|
+
* @slot {"name": "end", "description": "Shows content at the end of the input (e.g. toggle button, unit suffix)."}
|
|
18
|
+
*/
|
|
19
|
+
class DSRInputNumber extends react.Component {
|
|
20
|
+
host;
|
|
21
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
22
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
23
|
+
internals;
|
|
24
|
+
initialLoading = false;
|
|
25
|
+
inputElement;
|
|
26
|
+
defaultValue;
|
|
27
|
+
formResetCallback() {
|
|
28
|
+
// triggers value watcher
|
|
29
|
+
}
|
|
30
|
+
formDisabledCallback() {
|
|
31
|
+
}
|
|
32
|
+
formStateRestoreCallback() {
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
splitChildren.splitChildren(this.props.children);
|
|
36
|
+
const style = minifyCss.minifyCss(stylesEntry.getInputNumberCss(this.props.disabled, this.props.loading, this.props.hideLabel, this.props.state, this.props.compact, this.props.readOnly, this.props.theme, this.props.controls));
|
|
37
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-number" // prevent React default scroll-to-[increment|decrement] on number inputs
|
|
38
|
+
, name: this.props.name, form: this.props.form, type: "number", required: this.props.required, placeholder: this.props.placeholder, max: this.props.max, min: this.props.min, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, step: this.props.step, loading: this.props.loading, initialLoading: this.props.initialLoading, ...(this.props.controls && {
|
|
39
|
+
end: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(buttonPure_wrapper.PButtonPure, { tabIndex: -1, hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: "minus", disabled: this.props.disabled || this.props.readOnly, children: ["Decrement value by ", this.props.step] }), jsxRuntime.jsxs(buttonPure_wrapper.PButtonPure, { tabIndex: -1, hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: "plus", disabled: this.props.disabled || this.props.readOnly, children: ["Increment value by ", this.props.step] })] })),
|
|
40
|
+
}) })] }), this.props.children] }));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.DSRInputNumber = DSRInputNumber;
|
|
@@ -6,15 +6,15 @@ require('../../provider.cjs');
|
|
|
6
6
|
var splitChildren = require('../../splitChildren.cjs');
|
|
7
7
|
var minifyCss = require('../../minifyCss.cjs');
|
|
8
8
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
9
|
-
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
|
|
10
9
|
var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
11
|
-
var
|
|
12
|
-
var stateMessage = require('./state-message.cjs');
|
|
10
|
+
var inputBase = require('./input-base.cjs');
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
|
-
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."
|
|
16
|
-
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."
|
|
17
|
-
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."
|
|
13
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
|
+
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
|
+
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
16
|
+
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
|
17
|
+
* @slot {"name": "end", "description": "Shows content at the end of the input (e.g. toggle button, unit suffix)."}
|
|
18
18
|
*/
|
|
19
19
|
class DSRInputPassword extends react.Component {
|
|
20
20
|
host;
|
|
@@ -22,20 +22,20 @@ class DSRInputPassword extends react.Component {
|
|
|
22
22
|
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
23
23
|
internals;
|
|
24
24
|
showPassword = false;
|
|
25
|
+
initialLoading = false;
|
|
25
26
|
inputElement;
|
|
26
27
|
defaultValue;
|
|
27
28
|
formResetCallback() {
|
|
28
|
-
|
|
29
|
+
// triggers value watcher
|
|
29
30
|
}
|
|
30
31
|
formDisabledCallback() {
|
|
31
32
|
}
|
|
32
33
|
formStateRestoreCallback() {
|
|
33
34
|
}
|
|
34
35
|
render() {
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: id, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxRuntime.jsxs("div", { className: "wrapper", children: [jsxRuntime.jsx("input", { "aria-describedby": `${utilsEntry.descriptionId} ${stateMessage.messageId}`, "aria-invalid": this.props.state === 'error' ? 'true' : null, id: id, onBlur: this.props.onBlur, name: this.props.name, form: this.props.form, type: this.props.showPassword ? 'text' : 'password', required: this.props.required, placeholder: this.props.placeholder, maxLength: this.props.maxLength, minLength: this.props.minLength, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled }), this.props.toggle && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: this.props.showPassword ? 'view-off' : 'view', disabled: this.props.disabled, aria: { 'aria-pressed': this.props.showPassword ? 'true' : 'false' }, children: "Toggle password visibility" }))] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null })] })] }), this.props.children] }));
|
|
36
|
+
splitChildren.splitChildren(this.props.children);
|
|
37
|
+
const style = minifyCss.minifyCss(stylesEntry.getInputPasswordCss(this.props.disabled, this.props.loading, this.props.hideLabel, this.props.state, this.props.toggle, this.props.compact, this.props.readOnly, this.props.theme));
|
|
38
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-password", name: this.props.name, form: this.props.form, type: this.props.showPassword ? 'text' : 'password', required: this.props.required, placeholder: this.props.placeholder, maxLength: this.props.maxLength, minLength: this.props.minLength, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, loading: this.props.loading, initialLoading: this.props.initialLoading, end: this.props.toggle && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: this.props.showPassword ? 'view-off' : 'view', disabled: this.props.disabled, aria: { 'aria-pressed': this.props.showPassword ? 'true' : 'false' }, children: "Toggle password visibility" })) })] }), this.props.children] }));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-search.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
require('../../provider.cjs');
|
|
6
|
+
var splitChildren = require('../../splitChildren.cjs');
|
|
7
|
+
var minifyCss = require('../../minifyCss.cjs');
|
|
8
|
+
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
9
|
+
var buttonPure_wrapper = require('../components/button-pure.wrapper.cjs');
|
|
10
|
+
var icon_wrapper = require('../components/icon.wrapper.cjs');
|
|
11
|
+
var inputBase = require('./input-base.cjs');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
15
|
+
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
16
|
+
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
17
|
+
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. icon)."}
|
|
18
|
+
* @slot {"name": "end", "description": "Shows content at the end of the input (e.g. search button)."}
|
|
19
|
+
*/
|
|
20
|
+
class DSRInputSearch extends react.Component {
|
|
21
|
+
host;
|
|
22
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
23
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
24
|
+
internals;
|
|
25
|
+
isClearable = false;
|
|
26
|
+
initialLoading = false;
|
|
27
|
+
inputElement;
|
|
28
|
+
defaultValue;
|
|
29
|
+
formResetCallback() {
|
|
30
|
+
// triggers value watcher
|
|
31
|
+
}
|
|
32
|
+
formDisabledCallback() {
|
|
33
|
+
}
|
|
34
|
+
formStateRestoreCallback() {
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
splitChildren.splitChildren(this.props.children);
|
|
38
|
+
const style = minifyCss.minifyCss(stylesEntry.getInputSearchCss(this.props.disabled, this.props.loading, this.props.hideLabel, this.props.state, this.props.compact, this.props.readOnly, this.props.theme, this.props.clear));
|
|
39
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-search", name: this.props.name, form: this.props.form, type: "search", required: this.props.required, placeholder: this.props.placeholder, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, loading: this.props.loading, initialLoading: this.props.initialLoading, ...(this.props.indicator && {
|
|
40
|
+
start: jsxRuntime.jsx(icon_wrapper.PIcon, { "aria-hidden": "true", name: "search", color: "state-disabled", theme: this.props.theme }),
|
|
41
|
+
}), ...(this.props.clear && {
|
|
42
|
+
end: (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { tabIndex: -1, hideLabel: true, theme: this.props.theme, className: "button", type: "button", icon: "close", hidden: !this.props.isClearable, disabled: this.props.readOnly || this.props.disabled, children: "Clear field" })),
|
|
43
|
+
}) })] }), this.props.children] }));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.DSRInputSearch = DSRInputSearch;
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/input-text.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var splitChildren = require('../../splitChildren.cjs');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var minifyCss = require('../../minifyCss.cjs');
|
|
7
|
+
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
8
|
+
var inputBase = require('./input-base.cjs');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @slot {"name": "label", "description": "Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
12
|
+
* @slot {"name": "description", "description": "Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
13
|
+
* @slot {"name": "message", "description": "Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed."}
|
|
14
|
+
* @slot {"name": "start", "description": "Shows content at the start of the input (e.g. unit prefix)."}
|
|
15
|
+
* @slot {"name": "end", "description": "Shows content at the end of the input (e.g. toggle button, unit suffix)."}
|
|
16
|
+
*/
|
|
17
|
+
class DSRInputText extends react.Component {
|
|
18
|
+
host;
|
|
19
|
+
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
20
|
+
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
21
|
+
internals;
|
|
22
|
+
initialLoading = false;
|
|
23
|
+
inputElement;
|
|
24
|
+
defaultValue;
|
|
25
|
+
formResetCallback() {
|
|
26
|
+
// triggers value watcher
|
|
27
|
+
}
|
|
28
|
+
formDisabledCallback() {
|
|
29
|
+
}
|
|
30
|
+
formStateRestoreCallback() {
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
splitChildren.splitChildren(this.props.children);
|
|
34
|
+
const style = minifyCss.minifyCss(stylesEntry.getInputTextCss(this.props.disabled, this.props.loading, this.props.hideLabel, this.props.state, this.props.compact, this.props.readOnly, this.props.theme, this.props.counter));
|
|
35
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx(inputBase.InputBase, { children: this.props.children, host: null, label: this.props.label, description: this.props.description, id: "input-text" // prevent React default scroll-to-[increment|decrement] on text inputs
|
|
36
|
+
, name: this.props.name, form: this.props.form, type: "text", required: this.props.required, placeholder: this.props.placeholder, maxLength: this.props.maxLength, minLength: this.props.minLength, value: this.props.value, readOnly: this.props.readOnly, autoComplete: this.props.autoComplete, disabled: this.props.disabled, state: this.props.state, message: this.props.message, theme: this.props.theme, spellCheck: this.props.spellCheck, loading: this.props.loading, initialLoading: this.props.initialLoading, ...(this.props.counter &&
|
|
37
|
+
this.props.maxLength && {
|
|
38
|
+
end: (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { className: "sr-only", "aria-live": "polite", children: `You have ${this.props.maxLength - this.props.value.length} out of ${this.props.maxLength} characters left` }), jsxRuntime.jsxs("span", { className: "counter", "aria-hidden": "true", children: [this.props.value.length, "/", this.props.maxLength] })] })),
|
|
39
|
+
}) })] }), this.props.children] }));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.DSRInputText = DSRInputText;
|
|
@@ -13,10 +13,17 @@ class DSRMultiSelectOption extends react.Component {
|
|
|
13
13
|
host;
|
|
14
14
|
render() {
|
|
15
15
|
splitChildren.splitChildren(this.props.children);
|
|
16
|
-
const { theme = 'light', selected: isSelected, highlighted } = this.props;
|
|
16
|
+
const { theme = 'light', selected: isSelected, highlighted, hidden } = this.props;
|
|
17
17
|
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
18
|
-
minifyCss.minifyCss(stylesEntry.getMultiSelectOptionCss(theme, isDisabled, isSelected));
|
|
19
|
-
return (jsxRuntime.
|
|
18
|
+
const style = minifyCss.minifyCss(stylesEntry.getMultiSelectOptionCss(theme, isDisabled, isSelected));
|
|
19
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } })
|
|
20
|
+
// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259
|
|
21
|
+
, "// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259", jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: Object.entries({
|
|
22
|
+
option: true,
|
|
23
|
+
'option--selected': isSelected,
|
|
24
|
+
'option--highlighted': highlighted,
|
|
25
|
+
'option--disabled': isDisabled,
|
|
26
|
+
}).map(([key, value]) => value && key).filter(Boolean).join(' '), children: [jsxRuntime.jsx("span", { className: "checkbox", "aria-hidden": "true" }), jsxRuntime.jsx("slot", { slot: "label" })] }) })] }), this.props.children] }));
|
|
20
27
|
}
|
|
21
28
|
}
|
|
22
29
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/multi-select.cjs
CHANGED
|
@@ -25,7 +25,6 @@ class DSRMultiSelect extends react.Component {
|
|
|
25
25
|
// The "name" property is reflected as an attribute to ensure compatibility with native form submission.
|
|
26
26
|
// In the React wrapper, all props are synced as properties on the element ref, so reflecting "name" as an attribute ensures it is properly handled in the form submission process.
|
|
27
27
|
isOpen = false;
|
|
28
|
-
srHighlightedOptionText = '';
|
|
29
28
|
hasFilterResults = true;
|
|
30
29
|
internals;
|
|
31
30
|
defaultValue;
|
|
@@ -58,9 +57,8 @@ class DSRMultiSelect extends react.Component {
|
|
|
58
57
|
const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children);
|
|
59
58
|
const inputId = 'filter';
|
|
60
59
|
const popoverId = 'list';
|
|
61
|
-
const optionsSelectedId = 'options-selected';
|
|
62
60
|
const style = minifyCss.minifyCss(stylesEntry.getMultiSelectCss(this.props.isOpen, this.props.disabled, this.props.hideLabel, this.props.state, this.props.theme));
|
|
63
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }),
|
|
61
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", shadowrootdelegatesfocus: "true", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsxs("div", { className: "root", children: [jsxRuntime.jsx(label.Label, { hasLabel: this.props.label || namedSlotChildren.filter(({ props: { slot } }) => slot === 'label').length > 0, hasDescription: this.props.description || namedSlotChildren.filter(({ props: { slot } }) => slot === 'description').length > 0, host: null, label: this.props.label, description: this.props.description, htmlFor: inputId, isRequired: this.props.required, isDisabled: this.props.disabled }), jsxRuntime.jsxs("div", { className: `wrapper${this.props.disabled ? ' disabled' : ''}`, children: [jsxRuntime.jsx("input", { id: inputId, role: "combobox", autoComplete: "off", disabled: this.props.disabled, required: this.props.required, "aria-invalid": this.props.state === 'error' ? 'true' : null }), jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", name: "arrow-head-down", theme: this.props.theme, "aria-hidden": "true" }), this.props.currentValue && (jsxRuntime.jsx(buttonPure_wrapper.PButtonPure, { type: "button", className: "button", icon: "close", hideLabel: true, theme: this.props.theme, disabled: this.props.disabled, children: "Reset selection" })), jsxRuntime.jsxs("div", { id: popoverId, popover: "manual", tabIndex: -1, children: [!this.props.hasFilterResults && (jsxRuntime.jsxs("div", { className: "no-results", role: "option", children: [jsxRuntime.jsx("span", { "aria-hidden": "true", children: "---" }), jsxRuntime.jsx("span", { className: "sr-only", children: "No results found" })] })), jsxRuntime.jsx("slot", {})] })] }), jsxRuntime.jsx(stateMessage.StateMessage, { hasMessage: (this.props.message || namedSlotChildren.filter(({ props: { slot } }) => slot === 'message').length > 0) && ['success', 'error'].includes(this.props.state), state: this.props.state, message: this.props.message, theme: this.props.theme, host: null })] })] }), this.props.children] }));
|
|
64
62
|
}
|
|
65
63
|
}
|
|
66
64
|
|
package/ssr/cjs/components-react/projects/react-ssr-wrapper/src/lib/dsr-components/select-option.cjs
CHANGED
|
@@ -6,7 +6,6 @@ require('../../provider.cjs');
|
|
|
6
6
|
var splitChildren = require('../../splitChildren.cjs');
|
|
7
7
|
var minifyCss = require('../../minifyCss.cjs');
|
|
8
8
|
var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs');
|
|
9
|
-
var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs');
|
|
10
9
|
var icon_wrapper = require('../components/icon.wrapper.cjs');
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -16,15 +15,17 @@ class DSRSelectOption extends react.Component {
|
|
|
16
15
|
host;
|
|
17
16
|
render() {
|
|
18
17
|
splitChildren.splitChildren(this.props.children);
|
|
19
|
-
const { theme = 'light', selected, highlighted, hidden } = this.props;
|
|
18
|
+
const { theme = 'light', selected: isSelected, highlighted, hidden } = this.props;
|
|
20
19
|
const isDisabled = this.props.disabled || this.props.disabledParent;
|
|
21
20
|
const style = minifyCss.minifyCss(stylesEntry.getSelectOptionCss(theme));
|
|
22
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } })
|
|
21
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } })
|
|
22
|
+
// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259
|
|
23
|
+
, "// TODO: get rid of ARIA sprouting and use `elementInternals` API when AXE-CORE supports it: https://github.com/dequelabs/axe-core/issues/4259", jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: Object.entries({
|
|
23
24
|
option: true,
|
|
24
|
-
'option--selected':
|
|
25
|
+
'option--selected': isSelected,
|
|
25
26
|
'option--highlighted': highlighted,
|
|
26
27
|
'option--disabled': isDisabled,
|
|
27
|
-
}
|
|
28
|
+
}).map(([key, value]) => value && key).filter(Boolean).join(' '), children: [jsxRuntime.jsx("slot", {}), isSelected && (jsxRuntime.jsx(icon_wrapper.PIcon, { className: "icon", "aria-hidden": "true", name: "check", color: isDisabled ? 'state-disabled' : 'primary', theme: theme }))] }) })] }), this.props.children] }));
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|