@porsche-design-system/components-angular 4.5.0-rc.1 → 4.6.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 +10 -0
- package/bin/pds-skill.js +259 -0
- package/fesm2022/porsche-design-system-components-angular.mjs.map +1 -1
- package/package.json +5 -2
- package/skill/SKILL.md +124 -0
- package/skill/references/components/p-accordion/examples/Default.ts +26 -0
- package/skill/references/components/p-accordion/examples/InteractiveElementsInSummary.ts +30 -0
- package/skill/references/components/p-accordion/examples/StickySummary.ts +26 -0
- package/skill/references/components/p-accordion/p-accordion.md +95 -0
- package/skill/references/components/p-ai-tag/examples/Default.ts +13 -0
- package/skill/references/components/p-ai-tag/examples/WithinCheckbox.ts +33 -0
- package/skill/references/components/p-ai-tag/examples/WithinFormLabel.ts +40 -0
- package/skill/references/components/p-ai-tag/examples/WithinImage.ts +16 -0
- package/skill/references/components/p-ai-tag/examples/WithinInputSearch.ts +15 -0
- package/skill/references/components/p-ai-tag/examples/WithinRadioGroup.ts +32 -0
- package/skill/references/components/p-ai-tag/examples/WithinTable.ts +94 -0
- package/skill/references/components/p-ai-tag/examples/WithinText.ts +17 -0
- package/skill/references/components/p-ai-tag/p-ai-tag.md +47 -0
- package/skill/references/components/p-banner/examples/Customization.ts +37 -0
- package/skill/references/components/p-banner/examples/Default.ts +26 -0
- package/skill/references/components/p-banner/p-banner.md +92 -0
- package/skill/references/components/p-button/examples/Default.ts +15 -0
- package/skill/references/components/p-button/examples/Form.ts +26 -0
- package/skill/references/components/p-button/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button/p-button.md +118 -0
- package/skill/references/components/p-button-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-button-pure/examples/Form.ts +26 -0
- package/skill/references/components/p-button-pure/examples/FormAttribute.ts +30 -0
- package/skill/references/components/p-button-pure/p-button-pure.md +118 -0
- package/skill/references/components/p-button-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-button-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-button-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-button-tile/examples/Hyphens.ts +38 -0
- package/skill/references/components/p-button-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-button-tile/p-button-tile.md +115 -0
- package/skill/references/components/p-canvas/examples/Default.ts +13 -0
- package/skill/references/components/p-canvas/p-canvas.md +91 -0
- package/skill/references/components/p-carousel/examples/Default.ts +26 -0
- package/skill/references/components/p-carousel/examples/DynamicSlides.ts +37 -0
- package/skill/references/components/p-carousel/examples/FlexibleWidths.ts +32 -0
- package/skill/references/components/p-carousel/examples/FocusOnCenterSlide.ts +65 -0
- package/skill/references/components/p-carousel/examples/Intl.ts +23 -0
- package/skill/references/components/p-carousel/examples/JumpToSlide.ts +50 -0
- package/skill/references/components/p-carousel/p-carousel.md +142 -0
- package/skill/references/components/p-checkbox/examples/Default.ts +13 -0
- package/skill/references/components/p-checkbox/examples/Form.ts +31 -0
- package/skill/references/components/p-checkbox/examples/Indeterminate.ts +16 -0
- package/skill/references/components/p-checkbox/examples/Slots.ts +57 -0
- package/skill/references/components/p-checkbox/examples/WrappedLabel.ts +27 -0
- package/skill/references/components/p-checkbox/p-checkbox.md +122 -0
- package/skill/references/components/p-crest/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-crest/examples/Default.ts +13 -0
- package/skill/references/components/p-crest/examples/Link.ts +13 -0
- package/skill/references/components/p-crest/p-crest.md +65 -0
- package/skill/references/components/p-display/examples/Color.ts +15 -0
- package/skill/references/components/p-display/examples/Default.ts +15 -0
- package/skill/references/components/p-display/examples/Semantics.ts +21 -0
- package/skill/references/components/p-display/examples/Size.ts +15 -0
- package/skill/references/components/p-display/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-display/p-display.md +78 -0
- package/skill/references/components/p-divider/examples/Default.ts +13 -0
- package/skill/references/components/p-divider/examples/Responsive.ts +15 -0
- package/skill/references/components/p-divider/examples/Vertical.ts +15 -0
- package/skill/references/components/p-divider/p-divider.md +49 -0
- package/skill/references/components/p-drilldown/examples/CustomContent.ts +166 -0
- package/skill/references/components/p-drilldown/examples/Default.ts +119 -0
- package/skill/references/components/p-drilldown/p-drilldown.md +168 -0
- package/skill/references/components/p-fieldset/examples/Default.ts +15 -0
- package/skill/references/components/p-fieldset/examples/Required.ts +16 -0
- package/skill/references/components/p-fieldset/examples/SlottedLabel.ts +18 -0
- package/skill/references/components/p-fieldset/examples/SlottedMessage.ts +18 -0
- package/skill/references/components/p-fieldset/p-fieldset.md +88 -0
- package/skill/references/components/p-flag/examples/Default.ts +13 -0
- package/skill/references/components/p-flag/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-flag/examples/Size.ts +16 -0
- package/skill/references/components/p-flag/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-flag/p-flag.md +68 -0
- package/skill/references/components/p-flyout/examples/CustomStyling.ts +47 -0
- package/skill/references/components/p-flyout/examples/Default.ts +44 -0
- package/skill/references/components/p-flyout/examples/Form.ts +47 -0
- package/skill/references/components/p-flyout/examples/StickyTop.ts +44 -0
- package/skill/references/components/p-flyout/p-flyout.md +128 -0
- package/skill/references/components/p-heading/examples/Color.ts +15 -0
- package/skill/references/components/p-heading/examples/Default.ts +15 -0
- package/skill/references/components/p-heading/examples/Semantics.ts +21 -0
- package/skill/references/components/p-heading/p-heading.md +78 -0
- package/skill/references/components/p-icon/examples/Color.ts +16 -0
- package/skill/references/components/p-icon/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-icon/examples/Custom.ts +13 -0
- package/skill/references/components/p-icon/examples/Default.ts +13 -0
- package/skill/references/components/p-icon/examples/Overview.ts +591 -0
- package/skill/references/components/p-icon/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-icon/examples/Size.ts +16 -0
- package/skill/references/components/p-icon/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-icon/p-icon.md +88 -0
- package/skill/references/components/p-inline-notification/examples/ActionButton.ts +29 -0
- package/skill/references/components/p-inline-notification/examples/Default.ts +13 -0
- package/skill/references/components/p-inline-notification/examples/EventHandling.ts +31 -0
- package/skill/references/components/p-inline-notification/p-inline-notification.md +74 -0
- package/skill/references/components/p-input-date/examples/Default.ts +13 -0
- package/skill/references/components/p-input-date/examples/Form.ts +31 -0
- package/skill/references/components/p-input-date/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-date/p-input-date.md +138 -0
- package/skill/references/components/p-input-email/examples/Default.ts +13 -0
- package/skill/references/components/p-input-email/examples/Form.ts +31 -0
- package/skill/references/components/p-input-email/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-email/p-input-email.md +142 -0
- package/skill/references/components/p-input-month/examples/Default.ts +13 -0
- package/skill/references/components/p-input-month/examples/Form.ts +31 -0
- package/skill/references/components/p-input-month/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-month/p-input-month.md +138 -0
- package/skill/references/components/p-input-number/examples/Default.ts +13 -0
- package/skill/references/components/p-input-number/examples/Form.ts +31 -0
- package/skill/references/components/p-input-number/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-number/p-input-number.md +146 -0
- package/skill/references/components/p-input-password/examples/Default.ts +13 -0
- package/skill/references/components/p-input-password/examples/Form.ts +31 -0
- package/skill/references/components/p-input-password/examples/Slots.ts +42 -0
- package/skill/references/components/p-input-password/examples/Toggle.ts +13 -0
- package/skill/references/components/p-input-password/p-input-password.md +141 -0
- package/skill/references/components/p-input-search/examples/AriaCombobox.ts +38 -0
- package/skill/references/components/p-input-search/examples/Default.ts +13 -0
- package/skill/references/components/p-input-search/examples/Form.ts +31 -0
- package/skill/references/components/p-input-search/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-search/p-input-search.md +178 -0
- package/skill/references/components/p-input-tel/examples/Default.ts +13 -0
- package/skill/references/components/p-input-tel/examples/Form.ts +31 -0
- package/skill/references/components/p-input-tel/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-tel/p-input-tel.md +141 -0
- package/skill/references/components/p-input-text/examples/Controlled.ts +36 -0
- package/skill/references/components/p-input-text/examples/Default.ts +13 -0
- package/skill/references/components/p-input-text/examples/Form.ts +31 -0
- package/skill/references/components/p-input-text/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-text/p-input-text.md +146 -0
- package/skill/references/components/p-input-time/examples/Default.ts +13 -0
- package/skill/references/components/p-input-time/examples/Form.ts +31 -0
- package/skill/references/components/p-input-time/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-time/p-input-time.md +140 -0
- package/skill/references/components/p-input-url/examples/Default.ts +13 -0
- package/skill/references/components/p-input-url/examples/Form.ts +31 -0
- package/skill/references/components/p-input-url/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-url/p-input-url.md +141 -0
- package/skill/references/components/p-input-week/examples/Default.ts +13 -0
- package/skill/references/components/p-input-week/examples/Form.ts +31 -0
- package/skill/references/components/p-input-week/examples/Slots.ts +44 -0
- package/skill/references/components/p-input-week/p-input-week.md +138 -0
- package/skill/references/components/p-link/examples/Default.ts +15 -0
- package/skill/references/components/p-link/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link/examples/Icon.ts +20 -0
- package/skill/references/components/p-link/p-link.md +101 -0
- package/skill/references/components/p-link-pure/examples/CustomClickableArea.ts +15 -0
- package/skill/references/components/p-link-pure/examples/Default.ts +15 -0
- package/skill/references/components/p-link-pure/examples/FrameworkRouting.ts +17 -0
- package/skill/references/components/p-link-pure/examples/Icon.ts +20 -0
- package/skill/references/components/p-link-pure/p-link-pure.md +110 -0
- package/skill/references/components/p-link-tile/examples/ColorScheme.ts +18 -0
- package/skill/references/components/p-link-tile/examples/Default.ts +21 -0
- package/skill/references/components/p-link-tile/examples/FooterSlot.ts +32 -0
- package/skill/references/components/p-link-tile/examples/Hyphens.ts +39 -0
- package/skill/references/components/p-link-tile/examples/UiBehaviour.ts +44 -0
- package/skill/references/components/p-link-tile/examples/WithVideo.ts +18 -0
- package/skill/references/components/p-link-tile/p-link-tile.md +105 -0
- package/skill/references/components/p-link-tile-product/examples/Default.ts +24 -0
- package/skill/references/components/p-link-tile-product/examples/FrameworkRouting.ts +27 -0
- package/skill/references/components/p-link-tile-product/p-link-tile-product.md +93 -0
- package/skill/references/components/p-modal/examples/AlertDialog.ts +41 -0
- package/skill/references/components/p-modal/examples/CustomStyling.ts +28 -0
- package/skill/references/components/p-modal/examples/Default.ts +41 -0
- package/skill/references/components/p-modal/examples/Scrollable.ts +45 -0
- package/skill/references/components/p-modal/p-modal.md +135 -0
- package/skill/references/components/p-model-signature/examples/CustomStyling.ts +17 -0
- package/skill/references/components/p-model-signature/examples/Default.ts +13 -0
- package/skill/references/components/p-model-signature/examples/MaskBlendMode.ts +35 -0
- package/skill/references/components/p-model-signature/examples/MaskImage.ts +15 -0
- package/skill/references/components/p-model-signature/examples/MaskVideo.ts +15 -0
- package/skill/references/components/p-model-signature/examples/SafeZone.ts +63 -0
- package/skill/references/components/p-model-signature/p-model-signature.md +62 -0
- package/skill/references/components/p-multi-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-multi-select/examples/Default.ts +32 -0
- package/skill/references/components/p-multi-select/examples/Form.ts +38 -0
- package/skill/references/components/p-multi-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-multi-select/examples/SelectedSlot.ts +103 -0
- package/skill/references/components/p-multi-select/examples/SetValue.ts +76 -0
- package/skill/references/components/p-multi-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-multi-select/p-multi-select.md +197 -0
- package/skill/references/components/p-pagination/examples/Default.ts +13 -0
- package/skill/references/components/p-pagination/p-pagination.md +83 -0
- package/skill/references/components/p-pin-code/examples/CopyPaste.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Default.ts +13 -0
- package/skill/references/components/p-pin-code/examples/Form.ts +31 -0
- package/skill/references/components/p-pin-code/examples/Slots.ts +42 -0
- package/skill/references/components/p-pin-code/p-pin-code.md +109 -0
- package/skill/references/components/p-popover/examples/Default.ts +17 -0
- package/skill/references/components/p-popover/examples/SlottedButton.ts +18 -0
- package/skill/references/components/p-popover/p-popover.md +116 -0
- package/skill/references/components/p-radio-group/examples/Default.ts +20 -0
- package/skill/references/components/p-radio-group/examples/Form.ts +38 -0
- package/skill/references/components/p-radio-group/examples/Slots.ts +72 -0
- package/skill/references/components/p-radio-group/p-radio-group.md +157 -0
- package/skill/references/components/p-scroller/examples/Default.ts +54 -0
- package/skill/references/components/p-scroller/examples/Height.ts +29 -0
- package/skill/references/components/p-scroller/examples/ScrollToPosition.ts +43 -0
- package/skill/references/components/p-scroller/p-scroller.md +93 -0
- package/skill/references/components/p-segmented-control/examples/Default.ts +29 -0
- package/skill/references/components/p-segmented-control/examples/Form.ts +37 -0
- package/skill/references/components/p-segmented-control/examples/Slots.ts +57 -0
- package/skill/references/components/p-segmented-control/examples/WithLabels.ts +29 -0
- package/skill/references/components/p-segmented-control/p-segmented-control.md +162 -0
- package/skill/references/components/p-select/examples/AsyncFilter.ts +149 -0
- package/skill/references/components/p-select/examples/Default.ts +32 -0
- package/skill/references/components/p-select/examples/Form.ts +38 -0
- package/skill/references/components/p-select/examples/Optgroups.ts +45 -0
- package/skill/references/components/p-select/examples/Required.ts +48 -0
- package/skill/references/components/p-select/examples/SelectedSlot.ts +130 -0
- package/skill/references/components/p-select/examples/SetValue.ts +71 -0
- package/skill/references/components/p-select/examples/Slots.ts +51 -0
- package/skill/references/components/p-select/examples/SlottedImages.ts +38 -0
- package/skill/references/components/p-select/p-select.md +194 -0
- package/skill/references/components/p-sheet/examples/Default.ts +33 -0
- package/skill/references/components/p-sheet/p-sheet.md +121 -0
- package/skill/references/components/p-spinner/examples/Color.ts +16 -0
- package/skill/references/components/p-spinner/examples/ColorCssVar.ts +13 -0
- package/skill/references/components/p-spinner/examples/Default.ts +13 -0
- package/skill/references/components/p-spinner/examples/ResponsiveSize.ts +13 -0
- package/skill/references/components/p-spinner/examples/Size.ts +16 -0
- package/skill/references/components/p-spinner/examples/SizeCssVar.ts +13 -0
- package/skill/references/components/p-spinner/p-spinner.md +96 -0
- package/skill/references/components/p-stepper-horizontal/examples/Default.ts +26 -0
- package/skill/references/components/p-stepper-horizontal/examples/FrameworkImplementation.ts +107 -0
- package/skill/references/components/p-stepper-horizontal/p-stepper-horizontal.md +109 -0
- package/skill/references/components/p-switch/examples/Default.ts +21 -0
- package/skill/references/components/p-switch/p-switch.md +103 -0
- package/skill/references/components/p-table/examples/Advanced.ts +162 -0
- package/skill/references/components/p-table/examples/CaptionProperty.ts +40 -0
- package/skill/references/components/p-table/examples/CaptionSlot.ts +43 -0
- package/skill/references/components/p-table/examples/Default.ts +120 -0
- package/skill/references/components/p-table/examples/HideLabel.ts +40 -0
- package/skill/references/components/p-table/examples/LayoutFixed.ts +53 -0
- package/skill/references/components/p-table/examples/Sorting.ts +79 -0
- package/skill/references/components/p-table/p-table.md +189 -0
- package/skill/references/components/p-tabs/examples/ActiveTab.ts +29 -0
- package/skill/references/components/p-tabs/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs/examples/Gradient.ts +114 -0
- package/skill/references/components/p-tabs/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs/p-tabs.md +136 -0
- package/skill/references/components/p-tabs-bar/examples/Default.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Gradient.ts +80 -0
- package/skill/references/components/p-tabs-bar/examples/Labelling.ts +29 -0
- package/skill/references/components/p-tabs-bar/examples/Links.ts +23 -0
- package/skill/references/components/p-tabs-bar/p-tabs-bar.md +181 -0
- package/skill/references/components/p-tag/examples/Default.ts +15 -0
- package/skill/references/components/p-tag/examples/Multiline.ts +17 -0
- package/skill/references/components/p-tag/examples/SlottedButton.ts +44 -0
- package/skill/references/components/p-tag/examples/SlottedLink.ts +44 -0
- package/skill/references/components/p-tag/p-tag.md +66 -0
- package/skill/references/components/p-tag-dismissible/examples/Default.ts +15 -0
- package/skill/references/components/p-tag-dismissible/p-tag-dismissible.md +75 -0
- package/skill/references/components/p-text/examples/Default.ts +15 -0
- package/skill/references/components/p-text/examples/Semantics.ts +21 -0
- package/skill/references/components/p-text/examples/Size.ts +15 -0
- package/skill/references/components/p-text/examples/SizeResponsive.ts +15 -0
- package/skill/references/components/p-text/p-text.md +68 -0
- package/skill/references/components/p-text-list/examples/Default.ts +31 -0
- package/skill/references/components/p-text-list/p-text-list.md +68 -0
- package/skill/references/components/p-textarea/examples/Default.ts +13 -0
- package/skill/references/components/p-textarea/examples/Form.ts +31 -0
- package/skill/references/components/p-textarea/examples/Slots.ts +42 -0
- package/skill/references/components/p-textarea/p-textarea.md +122 -0
- package/skill/references/components/p-toast/examples/Default.ts +23 -0
- package/skill/references/components/p-toast/p-toast.md +61 -0
- package/skill/references/components/p-wordmark/examples/CustomClickableArea.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Default.ts +13 -0
- package/skill/references/components/p-wordmark/examples/Size.ts +13 -0
- package/skill/references/components/p-wordmark/p-wordmark.md +66 -0
- package/skill/references/icons.md +5 -0
- package/skill/references/styles/emotion.md +439 -0
- package/skill/references/styles/scss.md +402 -0
- package/skill/references/styles/tailwindcss.md +356 -0
- package/skill/references/styles/vanilla-extract.md +444 -0
- package/skill/references/stylesheets.md +331 -0
- package/skill/references/tokens.md +323 -0
- package/types/porsche-design-system-components-angular.d.ts +2 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="flex flex-col gap-fluid-sm">
|
|
9
|
+
<p-input-password formControlName="myInputPassword" [label]="'Some Label'" [toggle]="true" />
|
|
10
|
+
<div class="flex gap-fluid-sm">
|
|
11
|
+
<p-button type="submit">Submit</p-button>
|
|
12
|
+
<p-button type="reset">Reset</p-button>
|
|
13
|
+
</div>
|
|
14
|
+
<p-text>Last submitted data: {{ submittedValue }}</p-text>
|
|
15
|
+
</form>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule, FormsModule, ReactiveFormsModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
export class ExampleComponent {
|
|
22
|
+
form = new FormGroup({
|
|
23
|
+
myInputPassword: new FormControl<string>(''),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
submittedValue: any = undefined;
|
|
27
|
+
|
|
28
|
+
onSubmit(): void {
|
|
29
|
+
this.submittedValue = JSON.stringify(this.form.value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-password state="error">
|
|
8
|
+
<span slot="label">
|
|
9
|
+
Some label with a
|
|
10
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
11
|
+
link
|
|
12
|
+
</a>
|
|
13
|
+
and a "label-after" slot.
|
|
14
|
+
</span>
|
|
15
|
+
<p-popover slot="label-after">
|
|
16
|
+
Some Popover content with a
|
|
17
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
18
|
+
link
|
|
19
|
+
</a>
|
|
20
|
+
.
|
|
21
|
+
</p-popover>
|
|
22
|
+
<span slot="description">
|
|
23
|
+
Some description with a
|
|
24
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
25
|
+
link
|
|
26
|
+
</a>
|
|
27
|
+
.
|
|
28
|
+
</span>
|
|
29
|
+
<span slot="message">
|
|
30
|
+
Some error message with a
|
|
31
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
32
|
+
link
|
|
33
|
+
</a>
|
|
34
|
+
.
|
|
35
|
+
</span>
|
|
36
|
+
</p-input-password>
|
|
37
|
+
`,
|
|
38
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
39
|
+
standalone: true,
|
|
40
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
41
|
+
})
|
|
42
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-password label="Some label" name="some-name" [toggle]="true"></p-input-password>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# p-input-password
|
|
2
|
+
|
|
3
|
+
The `p-input-password` component enables secure password entry by obscuring the typed characters. Displayed as a one-line plain text editor, it ensures the password remains hidden to protect user privacy. Additionally, the component includes a toggle button that allows users to reveal the password in clear text when needed, offering both security and convenience.
|
|
4
|
+
|
|
5
|
+
A `label` is a caption which informs the user what information a particular form field is asking for. The `p-input-password` component can be used with or without a label, but it's recommended to keep the label visible for better accessibility whenever possible. When used without a label, it's mandatory to provide a descriptive label text for screen readers.
|
|
6
|
+
|
|
7
|
+
While a `placeholder` is optional but recommended to be set whenever bits of example content or hints shall be shown to give the user visual cues to fill out the form.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Do:
|
|
12
|
+
|
|
13
|
+
- Use when a text input of the user is required or optional.
|
|
14
|
+
- Use for password input.
|
|
15
|
+
- Use without a label only when the context is clear.
|
|
16
|
+
- Use for validation and error of input.
|
|
17
|
+
- Use asterisk for required fields.
|
|
18
|
+
|
|
19
|
+
### Don't:
|
|
20
|
+
|
|
21
|
+
- Don't use labels with more than two words whenever possible (keep it short and descriptive).
|
|
22
|
+
- Don't use instructional or description text for the label.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Related Components
|
|
27
|
+
|
|
28
|
+
- [Input Date](../p-input-date/p-input-date.md)
|
|
29
|
+
- [Input Email](../p-input-email/p-input-email.md)
|
|
30
|
+
- [Input Month](../p-input-month/p-input-month.md)
|
|
31
|
+
- [Input Number](../p-input-number/p-input-number.md)
|
|
32
|
+
- [Input Search](../p-input-search/p-input-search.md)
|
|
33
|
+
- [Input Tel](../p-input-tel/p-input-tel.md)
|
|
34
|
+
- [Input Text](../p-input-text/p-input-text.md)
|
|
35
|
+
- [Input Time](../p-input-time/p-input-time.md)
|
|
36
|
+
- [Input Url](../p-input-url/p-input-url.md)
|
|
37
|
+
- [Input Week](../p-input-week/p-input-week.md)
|
|
38
|
+
|
|
39
|
+
## Accessibility support
|
|
40
|
+
|
|
41
|
+
### Keyboard
|
|
42
|
+
|
|
43
|
+
| Key / state | Function |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
46
|
+
|
|
47
|
+
### ARIA enhancements
|
|
48
|
+
|
|
49
|
+
#### Internal **ARIA** that is managed by the component:
|
|
50
|
+
|
|
51
|
+
| ARIA | Usage |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `aria-label="STRING"` | Defines the accessible name combined with the description and status message. |
|
|
54
|
+
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
|
|
55
|
+
| `aria-hidden="true"` | If `required` attribute is set, the visible asterisk indicator is hidden from assistive technologies. |
|
|
56
|
+
| `aria-invalid="true"` | If `error` state is set. |
|
|
57
|
+
| `aria-live="polite"` | If the `maxlength` attribute is present, the counter is announced via ARIA live region. |
|
|
58
|
+
| `aria-pressed="BOOLEAN"` | Defines the state of the visibility for the toggle button. |
|
|
59
|
+
|
|
60
|
+
## Development considerations
|
|
61
|
+
|
|
62
|
+
### Disabled state
|
|
63
|
+
|
|
64
|
+
In general, avoid using the `disabled` state. Disabled elements are no longer focusable and may be missed by screen reader users. They can also confuse sighted users if the reason they are disabled is not made clear.
|
|
65
|
+
|
|
66
|
+
### Common do's and don'ts
|
|
67
|
+
|
|
68
|
+
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
69
|
+
- **Do** use the component state/message API so validation and status changes are announced.
|
|
70
|
+
- **Do** use clear error wording that helps users recover.
|
|
71
|
+
- **Don't** rely on placeholder text as the only label.
|
|
72
|
+
- **Don't** use `hide-label` without an accessible name.
|
|
73
|
+
|
|
74
|
+
## Limitations
|
|
75
|
+
|
|
76
|
+
Due to the nature of **Web Components** and **shadow DOM**, there are limitations when using some **ARIA** attributes to define relationships between elements across different shadow DOMs or shadow DOM/light DOM combinations.
|
|
77
|
+
|
|
78
|
+
| ARIA | Support |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `aria-labelledby` | 🚫 |
|
|
81
|
+
| `aria-describedby` | 🚫 |
|
|
82
|
+
|
|
83
|
+
## API
|
|
84
|
+
|
|
85
|
+
### Properties
|
|
86
|
+
|
|
87
|
+
| Property | Type | Default | Description |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
| `autoComplete` | `string` | `undefined` | Provides the browser with a password autofill hint (e.g. `autocomplete='current-password'` or `autocomplete='new-password'`). |
|
|
90
|
+
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
91
|
+
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
92
|
+
| `disabled` | `boolean` | `false` | Disables the field, preventing all input. The value is not submitted with the form. |
|
|
93
|
+
| `form` | `string` | `undefined` | Associates the field with a form element by its ID when the field is not nested directly inside it. |
|
|
94
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
95
|
+
| `label` | `string` | `''` | Sets the visible label text displayed above the input field. |
|
|
96
|
+
| `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables the field and displays a loading spinner to indicate an ongoing operation. |
|
|
97
|
+
| `maxLength` | `number` | `undefined` | Sets the maximum number of characters the user can enter. |
|
|
98
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the field when `state` is `success` or `error`. |
|
|
99
|
+
| `minLength` | `number` | `undefined` | Sets the minimum number of characters required for the field to be considered valid. |
|
|
100
|
+
| `name` _(required)_ | `string` | `undefined` | Sets the name submitted with the form data to identify this field's value on the server. |
|
|
101
|
+
| `placeholder` | `string` | `''` | Sets placeholder text shown inside the field when it is empty. |
|
|
102
|
+
| `readOnly` | `boolean` | `false` | Makes the field read-only — the value is displayed but cannot be edited. The value is still submitted with the form. |
|
|
103
|
+
| `required` | `boolean` | `false` | Marks the field as required — form submission is blocked while this field is empty. |
|
|
104
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state, controlling the visual appearance and style of the feedback message (`none`, `success`, `error`). |
|
|
105
|
+
| `toggle` | `boolean` | `false` | Shows a toggle button that switches the password between masked and plain text visibility. |
|
|
106
|
+
| `value` | `string | null` | `''` | Sets the current password value of the field. |
|
|
107
|
+
|
|
108
|
+
### Events
|
|
109
|
+
|
|
110
|
+
| Event | Type | Description |
|
|
111
|
+
| --- | --- | --- |
|
|
112
|
+
| `blur` | `CustomEvent<InputPasswordBlurEventDetail>`<br>`Event` | Emitted when the password input has lost focus. |
|
|
113
|
+
| `change` | `CustomEvent<InputPasswordChangeEventDetail>`<br>`Event` | Emitted when the password input loses focus after its value was changed. |
|
|
114
|
+
| `input` | `CustomEvent<InputPasswordInputEventDetail>`<br>`InputEvent` | Emitted when the value has been changed as a direct result of a user action. |
|
|
115
|
+
|
|
116
|
+
### Slots
|
|
117
|
+
|
|
118
|
+
| Slot | Required | Allowed tag names | Description |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
121
|
+
| `label-after` | no | — | Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`). |
|
|
122
|
+
| `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
123
|
+
| `message` | no | — | Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
124
|
+
| `start` | no | — | Shows content at the start of the input (e.g. unit prefix). |
|
|
125
|
+
| `end` | no | — | Shows content at the end of the input (e.g. toggle button, unit suffix). |
|
|
126
|
+
|
|
127
|
+
### CSS Variables
|
|
128
|
+
|
|
129
|
+
| CSS Variable | Default | Description |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `--ref-p-input-slotted-padding` | — | When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly. |
|
|
132
|
+
| `--ref-p-input-slotted-margin` | — | When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly. |
|
|
133
|
+
|
|
134
|
+
## Examples
|
|
135
|
+
|
|
136
|
+
| Example | When to use | File |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
139
|
+
| Form | The `p-input-password` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.ts) |
|
|
140
|
+
| Show password toggle button | If you want to show the password toggle button, you can pass `toggle="true"`. | [./examples/Toggle.ts](./examples/Toggle.ts) |
|
|
141
|
+
| Slots | Use named slots when `label`, `description` or `message` need markup such as a link. | [./examples/Slots.ts](./examples/Slots.ts) |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<div class="flex w-full max-w-md flex-col gap-static-xs self-start [&>p-input-search]:min-w-0">
|
|
8
|
+
<p-input-search label="Search" name="aria-sketch" [indicator]="true" [clear]="true" [aria]="{'role': 'combobox', 'aria-expanded': 'true', 'aria-haspopup': 'listbox', 'aria-autocomplete': 'list', 'aria-controls': 'listbox'}"></p-input-search>
|
|
9
|
+
<div id="listbox" role="listbox" [tabIndex]="0" aria-label="Search options" class="max-h-48 p-static-sm overflow-y-auto rounded-xl border-thin border-contrast-lower bg-background-base shadow-md ">
|
|
10
|
+
<div role="option" aria-selected="false" class="px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
11
|
+
718
|
|
12
|
+
</div>
|
|
13
|
+
<div role="option" aria-selected="false" class="px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
14
|
+
911
|
|
15
|
+
</div>
|
|
16
|
+
<div role="option" aria-selected="true" class="flex px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
17
|
+
<span>
|
|
18
|
+
Cayenne
|
|
19
|
+
</span>
|
|
20
|
+
<p-icon name="check" color="primary" [aria-hidden]="true" class="ms-auto"></p-icon>
|
|
21
|
+
</div>
|
|
22
|
+
<div role="option" aria-selected="false" class="px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
23
|
+
Macan
|
|
24
|
+
</div>
|
|
25
|
+
<div role="option" aria-selected="false" class="px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
26
|
+
Panamera
|
|
27
|
+
</div>
|
|
28
|
+
<div role="option" aria-selected="false" class="px-static-sm py-static-sm cursor-pointer bg-background-base hover:bg-frosted transition-colors duration-300 rounded-sm">
|
|
29
|
+
Taycan
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
`,
|
|
34
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
35
|
+
standalone: true,
|
|
36
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
37
|
+
})
|
|
38
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-search label="Some label" name="Some name" [clear]="true" [indicator]="true"></p-input-search>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="flex flex-col gap-fluid-sm">
|
|
9
|
+
<p-input-search formControlName="myInputSearch" [label]="'Some Label'" [indicator]="true" [clear]="true" />
|
|
10
|
+
<div class="flex gap-fluid-sm">
|
|
11
|
+
<p-button type="submit">Submit</p-button>
|
|
12
|
+
<p-button type="reset">Reset</p-button>
|
|
13
|
+
</div>
|
|
14
|
+
<p-text>Last submitted data: {{ submittedValue }}</p-text>
|
|
15
|
+
</form>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule, FormsModule, ReactiveFormsModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
export class ExampleComponent {
|
|
22
|
+
form = new FormGroup({
|
|
23
|
+
myInputSearch: new FormControl<string>(''),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
submittedValue: any = undefined;
|
|
27
|
+
|
|
28
|
+
onSubmit(): void {
|
|
29
|
+
this.submittedValue = JSON.stringify(this.form.value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-search state="error">
|
|
8
|
+
<span slot="label">
|
|
9
|
+
Some label with a
|
|
10
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
11
|
+
link
|
|
12
|
+
</a>
|
|
13
|
+
and a "label-after" slot.
|
|
14
|
+
</span>
|
|
15
|
+
<p-popover slot="label-after">
|
|
16
|
+
Some Popover content with a
|
|
17
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
18
|
+
link
|
|
19
|
+
</a>
|
|
20
|
+
.
|
|
21
|
+
</p-popover>
|
|
22
|
+
<span slot="description">
|
|
23
|
+
Some description with a
|
|
24
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
25
|
+
link
|
|
26
|
+
</a>
|
|
27
|
+
.
|
|
28
|
+
</span>
|
|
29
|
+
<p-icon slot="start" name="pin" color="contrast-medium" [aria-hidden]="true"></p-icon>
|
|
30
|
+
<p-button-pure slot="end" icon="locate" [hideLabel]="true" class="p-(--ref-p-input-slotted-padding) m-(--ref-p-input-slotted-margin)" [aria]="{'aria-label': 'Locate'}"></p-button-pure>
|
|
31
|
+
<span slot="message">
|
|
32
|
+
Some error message with a
|
|
33
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
34
|
+
link
|
|
35
|
+
</a>
|
|
36
|
+
.
|
|
37
|
+
</span>
|
|
38
|
+
</p-input-search>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# p-input-search
|
|
2
|
+
|
|
3
|
+
The `p-input-search` component offers a versatile, user-friendly interface for entering and submitting search queries. It supports direct keyboard input and includes a clear button for convenience. The `start` and `end` slots enable flexible insertion of custom content.
|
|
4
|
+
|
|
5
|
+
A `label` is a caption which informs the user what information a particular form field is asking for. The `p-input-search` component can be used with or without a label, but it's recommended to keep the label visible for better accessibility whenever possible. When used without a label, it's mandatory to provide a descriptive label text for screen readers.
|
|
6
|
+
|
|
7
|
+
While a `placeholder` is optional but recommended to be set whenever bits of example content or hints shall be shown to give the user visual cues to fill out the form.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Do:
|
|
12
|
+
|
|
13
|
+
- Use when a keyword or key value for a search request is necessary.
|
|
14
|
+
- Use without a label only when the context is clear.
|
|
15
|
+
- Use with a slotted locate button when a locate action can be performed.
|
|
16
|
+
- Use a loading state to indicate a search is being performed.
|
|
17
|
+
- Use an asterisk to indicate required fields.
|
|
18
|
+
- Use success or error messages if the user input was inappropriate.
|
|
19
|
+
- Use search suggestions or recent history when it adds contextual value.
|
|
20
|
+
|
|
21
|
+
### Don't:
|
|
22
|
+
|
|
23
|
+
- Don’t use labels with more than two words whenever possible (keep them short and descriptive).
|
|
24
|
+
- Don’t use instructional or descriptive text as the label.
|
|
25
|
+
- Don’t use p-input-search for purposes other than search.
|
|
26
|
+
- Don’t use compact variants in marketing applications.
|
|
27
|
+
- Don’t manipulate or replace the default search icon.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Related Components
|
|
32
|
+
|
|
33
|
+
- [Input Date](../p-input-date/p-input-date.md)
|
|
34
|
+
- [Input Email](../p-input-email/p-input-email.md)
|
|
35
|
+
- [Input Month](../p-input-month/p-input-month.md)
|
|
36
|
+
- [Input Number](../p-input-number/p-input-number.md)
|
|
37
|
+
- [Input Password](../p-input-password/p-input-password.md)
|
|
38
|
+
- [Input Tel](../p-input-tel/p-input-tel.md)
|
|
39
|
+
- [Input Text](../p-input-text/p-input-text.md)
|
|
40
|
+
- [Input Time](../p-input-time/p-input-time.md)
|
|
41
|
+
- [Input Url](../p-input-url/p-input-url.md)
|
|
42
|
+
- [Input Week](../p-input-week/p-input-week.md)
|
|
43
|
+
|
|
44
|
+
## Accessibility support
|
|
45
|
+
|
|
46
|
+
### Keyboard
|
|
47
|
+
|
|
48
|
+
| Key / state | Function |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
51
|
+
|
|
52
|
+
### ARIA enhancements
|
|
53
|
+
|
|
54
|
+
#### External **ARIA** provided by the `aria` property:
|
|
55
|
+
|
|
56
|
+
Use the `aria` property to pass supported attributes to the **native `<input>` inside the shadow DOM**, for example when you implement a combobox-style pattern (search field + suggestion list).
|
|
57
|
+
|
|
58
|
+
| ARIA | Usage |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `role` | Overrides the implicit role when needed (e.g. `combobox` for an autocomplete pattern alongside a separate listbox). |
|
|
61
|
+
| `aria-autocomplete` | Indicates whether and how the component predicts text (`none`, `inline`, `list`, `both`). |
|
|
62
|
+
| `aria-controls` | Identifies the element(s) whose contents or presence are controlled by the input (e.g. the suggestion list’s id). |
|
|
63
|
+
| `aria-expanded` | Indicates whether the suggestion popup or related surface is expanded or collapsed. |
|
|
64
|
+
| `aria-haspopup` | Indicates that activating the input triggers a popup (e.g. `listbox`, `dialog`). |
|
|
65
|
+
| `aria-label` | Defines an accessible name when the visible label is insufficient or hidden; prefer a visible `label` for most cases. |
|
|
66
|
+
|
|
67
|
+
You can pass a JSON object on the element (vanilla JS) or use your framework’s prop binding, for example `aria={{ role: 'combobox', 'aria-expanded': isOpen, 'aria-haspopup': 'listbox' }}`.
|
|
68
|
+
|
|
69
|
+
#### Internal **ARIA** that is managed by the component:
|
|
70
|
+
|
|
71
|
+
The following apply in addition to any `aria` values you pass. On the **native search input**, `aria-describedby`, `aria-invalid`, `aria-disabled`, and `aria-readonly` are always set by the component and **take precedence** over the same keys if they were supplied in `aria`.
|
|
72
|
+
|
|
73
|
+
| ARIA | Usage |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `aria-describedby="IDREF"` | Combines references for description, state message, and loading feedback on the native input. |
|
|
76
|
+
| `aria-invalid="true"` | When `state` is `error`. |
|
|
77
|
+
| `aria-disabled="true"` | When `disabled` or `loading` is active. |
|
|
78
|
+
| `aria-readonly="true"` | When `readOnly` is active. |
|
|
79
|
+
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` change, the status message region is exposed for announcements. |
|
|
80
|
+
| `aria-hidden="true"` | On decorative icons (e.g. search indicator). |
|
|
81
|
+
|
|
82
|
+
## Development considerations
|
|
83
|
+
|
|
84
|
+
### Disabled state
|
|
85
|
+
|
|
86
|
+
In general, avoid using the `disabled` state. Disabled elements are no longer focusable and may be missed by screen reader users. They can also confuse sighted users if the reason they are disabled is not made clear.
|
|
87
|
+
|
|
88
|
+
### Combobox and suggestion lists
|
|
89
|
+
|
|
90
|
+
For a search field that controls a separate list of suggestions, set the `aria` property so the input exposes the expected semantics supported by this component, for example:
|
|
91
|
+
|
|
92
|
+
- `role: 'combobox'`
|
|
93
|
+
- `aria-controls` referring to the id of the associated listbox (or other controlled region). Hint: currently not supported across shadow DOM boundaries
|
|
94
|
+
- `aria-expanded` reflecting open/closed state
|
|
95
|
+
- `aria-haspopup` indicating the presence of a popup (e.g. `listbox`)
|
|
96
|
+
- `aria-autocomplete` as required by your pattern
|
|
97
|
+
|
|
98
|
+
Associate the suggestion list and keyboard interaction in the host application according to the [ARIA combobox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) you implement there.
|
|
99
|
+
|
|
100
|
+
### Common do's and don'ts
|
|
101
|
+
|
|
102
|
+
- **Do** keep a persistent `label` and pass combobox-related ARIA through the `aria` prop when needed.
|
|
103
|
+
- **Do** use the component state/message API so validation and status changes are announced.
|
|
104
|
+
- **Do** use clear error wording that helps users recover.
|
|
105
|
+
- **Don't** rely on placeholder text as the only label.
|
|
106
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
107
|
+
- **Don't** use `hide-label` without an accessible name.
|
|
108
|
+
|
|
109
|
+
## Limitations
|
|
110
|
+
|
|
111
|
+
Due to the nature of **Web Components** and **shadow DOM**, there are limitations when using some **ARIA** attributes to define (IDREF) relationships between elements across different shadow DOMs or shadow DOM/light DOM combinations.
|
|
112
|
+
|
|
113
|
+
| ARIA | Support |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| `aria-owns` | 🚫 |
|
|
116
|
+
| `aria-activedescendant` | 🚫 |
|
|
117
|
+
|
|
118
|
+
## API
|
|
119
|
+
|
|
120
|
+
### Properties
|
|
121
|
+
|
|
122
|
+
| Property | Type | Default | Description |
|
|
123
|
+
| --- | --- | --- | --- |
|
|
124
|
+
| `aria` | `InputSearchAriaAttribute` | `undefined` | Sets additional ARIA attributes on the search input, useful for combobox patterns (e.g. `role="combobox"`, `aria-expanded`). |
|
|
125
|
+
| `autoComplete` | `string` | `undefined` | Provides the browser with a data type hint to enable relevant autofill suggestions. |
|
|
126
|
+
| `clear` | `boolean` | `false` | Shows a clear button (×) inside the field that resets the value to empty when clicked. |
|
|
127
|
+
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
128
|
+
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
129
|
+
| `disabled` | `boolean` | `false` | Disables the field, preventing all input. The value is not submitted with the form. |
|
|
130
|
+
| `form` | `string` | `undefined` | Associates the field with a form element by its ID when the field is not nested directly inside it. |
|
|
131
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
132
|
+
| `indicator` | `boolean` | `false` | Shows a magnifying glass icon inside the field as a visual affordance for search input. |
|
|
133
|
+
| `label` | `string` | `''` | Sets the visible label text displayed above the input field. |
|
|
134
|
+
| `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables the field and displays a loading spinner to indicate an ongoing operation. |
|
|
135
|
+
| `maxLength` | `number` | `undefined` | Sets the maximum number of characters the user can enter. |
|
|
136
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the field when `state` is `success` or `error`. |
|
|
137
|
+
| `minLength` | `number` | `undefined` | Sets the minimum number of characters required for the field to be considered valid. |
|
|
138
|
+
| `name` _(required)_ | `string` | `undefined` | Sets the name submitted with the form data to identify this field's value on the server. |
|
|
139
|
+
| `placeholder` | `string` | `''` | Sets placeholder text shown inside the field when it is empty. |
|
|
140
|
+
| `readOnly` | `boolean` | `false` | Makes the field read-only — the value is displayed but cannot be edited. The value is still submitted with the form. |
|
|
141
|
+
| `required` | `boolean` | `false` | Marks the field as required — form submission is blocked while this field is empty. |
|
|
142
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state, controlling the visual appearance and style of the feedback message (`none`, `success`, `error`). |
|
|
143
|
+
| `value` | `string | null` | `''` | Sets the current search query value of the field. |
|
|
144
|
+
|
|
145
|
+
### Events
|
|
146
|
+
|
|
147
|
+
| Event | Type | Description |
|
|
148
|
+
| --- | --- | --- |
|
|
149
|
+
| `blur` | `CustomEvent<InputSearchBlurEventDetail>`<br>`Event` | Emitted when the input loses focus, regardless of whether the value changed. |
|
|
150
|
+
| `change` | `CustomEvent<InputSearchChangeEventDetail>`<br>`Event` | Emitted when the input loses focus after its value was changed. |
|
|
151
|
+
| `input` | `CustomEvent<InputSearchInputEventDetail>`<br>`InputEvent` | Emitted when the value has been changed as a direct result of a user action. |
|
|
152
|
+
|
|
153
|
+
### Slots
|
|
154
|
+
|
|
155
|
+
| Slot | Required | Allowed tag names | Description |
|
|
156
|
+
| --- | --- | --- | --- |
|
|
157
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
158
|
+
| `label-after` | no | — | Places additional content after the label text (for content that should not be part of the label, e.g. external links or `p-popover`). |
|
|
159
|
+
| `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
160
|
+
| `message` | no | — | Shows a state message. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
161
|
+
| `start` | no | — | Shows content at the start of the input (e.g. icon). |
|
|
162
|
+
| `end` | no | — | Shows content at the end of the input (e.g. search button). |
|
|
163
|
+
|
|
164
|
+
### CSS Variables
|
|
165
|
+
|
|
166
|
+
| CSS Variable | Default | Description |
|
|
167
|
+
| --- | --- | --- |
|
|
168
|
+
| `--ref-p-input-slotted-padding` | — | When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `padding` in oder to adjust the alignment correctly. |
|
|
169
|
+
| `--ref-p-input-slotted-margin` | — | When slotting a `p-button-pure` or `p-link-pure` this variable needs to be set as `margin` in oder to adjust the spacings correctly. |
|
|
170
|
+
|
|
171
|
+
## Examples
|
|
172
|
+
|
|
173
|
+
| Example | When to use | File |
|
|
174
|
+
| --- | --- | --- |
|
|
175
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
176
|
+
| Form | The `p-input-search` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.ts) |
|
|
177
|
+
| Slots | Use named slots when `label`, `description` or `message` need markup such as a link. | [./examples/Slots.ts](./examples/Slots.ts) |
|
|
178
|
+
| Used as a Combobox | You can pass an `aria` property to expose extra semantics on the **native input** (see [accessibility](./p-input-search.md)). | [./examples/AriaCombobox.ts](./examples/AriaCombobox.ts) |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-tel label="Some label" name="some-name" [indicator]="true"></p-input-tel>
|
|
8
|
+
`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
12
|
+
})
|
|
13
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'porsche-design-system-app',
|
|
7
|
+
template: `
|
|
8
|
+
<form [formGroup]="form" (ngSubmit)="onSubmit()" class="flex flex-col gap-fluid-sm">
|
|
9
|
+
<p-input-tel formControlName="myInputTel" [label]="'Some Label'" [indicator]="true" />
|
|
10
|
+
<div class="flex gap-fluid-sm">
|
|
11
|
+
<p-button type="submit">Submit</p-button>
|
|
12
|
+
<p-button type="reset">Reset</p-button>
|
|
13
|
+
</div>
|
|
14
|
+
<p-text>Last submitted data: {{ submittedValue }}</p-text>
|
|
15
|
+
</form>
|
|
16
|
+
`,
|
|
17
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [PorscheDesignSystemModule, FormsModule, ReactiveFormsModule], // <-- PDS module is imported here
|
|
20
|
+
})
|
|
21
|
+
export class ExampleComponent {
|
|
22
|
+
form = new FormGroup({
|
|
23
|
+
myInputTel: new FormControl<string>(''),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
submittedValue: any = undefined;
|
|
27
|
+
|
|
28
|
+
onSubmit(): void {
|
|
29
|
+
this.submittedValue = JSON.stringify(this.form.value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'porsche-design-system-app',
|
|
6
|
+
template: `
|
|
7
|
+
<p-input-tel state="error">
|
|
8
|
+
<span slot="label">
|
|
9
|
+
Some label with a
|
|
10
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
11
|
+
link
|
|
12
|
+
</a>
|
|
13
|
+
and a "label-after" slot.
|
|
14
|
+
</span>
|
|
15
|
+
<p-popover slot="label-after">
|
|
16
|
+
Some Popover content with a
|
|
17
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
18
|
+
link
|
|
19
|
+
</a>
|
|
20
|
+
.
|
|
21
|
+
</p-popover>
|
|
22
|
+
<span slot="description">
|
|
23
|
+
Some description with a
|
|
24
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
25
|
+
link
|
|
26
|
+
</a>
|
|
27
|
+
.
|
|
28
|
+
</span>
|
|
29
|
+
<p-icon slot="start" name="home" color="contrast-medium" [aria-hidden]="true"></p-icon>
|
|
30
|
+
<p-button-pure slot="end" icon="delete" [hideLabel]="true" class="p-(--ref-p-input-slotted-padding) m-(--ref-p-input-slotted-margin)" [aria]="{'aria-label': 'Delete'}"></p-button-pure>
|
|
31
|
+
<span slot="message">
|
|
32
|
+
Some error message with a
|
|
33
|
+
<a href="https://designsystem.porsche.com" class="underline">
|
|
34
|
+
link
|
|
35
|
+
</a>
|
|
36
|
+
.
|
|
37
|
+
</span>
|
|
38
|
+
</p-input-tel>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|