@porsche-design-system/components-angular 4.5.0 → 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 +8 -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,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-url label="Some label" name="some-name" [indicator]="true"></p-input-url>
|
|
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-url formControlName="myInputUrl" [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
|
+
myInputUrl: 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-url 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-url>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# p-input-url
|
|
2
|
+
|
|
3
|
+
The `p-input-url` component provides a user-friendly, accessible interface for entering valid website URLs. It leverages native HTML5 URL validation and ensures appropriate keyboard behavior on mobile devices. It includes `start` and `end` slots to flexibly incorporate icons, buttons, or other elements within the input field.
|
|
4
|
+
|
|
5
|
+
A `label` tells the user what information a form field is asking for. The `p-input-url` component can be used with or without a label, but it is recommended to keep the label visible whenever possible for better accessibility. When used without a label, a descriptive label text for screen readers is required.
|
|
6
|
+
|
|
7
|
+
A `placeholder` is optional, but recommended when example content or hints should be shown to give the user visual cues for completing the form.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
The `p-input-url` component is specifically designed for collecting website URLs. It leverages built-in browser validation to ensure that the input follows the correct URL format. This makes it a better choice than a generic text input when URL validation, proper keyboard behavior on mobile devices, and accessibility are important. For further guidance, see the [MDN documentation on url inputs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/url).
|
|
12
|
+
|
|
13
|
+
### Do:
|
|
14
|
+
|
|
15
|
+
- Use when requesting a website URL from the user.
|
|
16
|
+
- Use without a label only when the context is clear.
|
|
17
|
+
- Use it when URL validation and clear input errors are needed.
|
|
18
|
+
- Use an asterisk for required fields.
|
|
19
|
+
|
|
20
|
+
### Don't:
|
|
21
|
+
|
|
22
|
+
- Don't use labels with more than two words whenever possible (keep it short and descriptive).
|
|
23
|
+
- Don't use an instructional or description text for the label.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Related Components
|
|
28
|
+
|
|
29
|
+
- [Input Date](../p-input-date/p-input-date.md)
|
|
30
|
+
- [Input Email](../p-input-email/p-input-email.md)
|
|
31
|
+
- [Input Month](../p-input-month/p-input-month.md)
|
|
32
|
+
- [Input Number](../p-input-number/p-input-number.md)
|
|
33
|
+
- [Input Password](../p-input-password/p-input-password.md)
|
|
34
|
+
- [Input Search](../p-input-search/p-input-search.md)
|
|
35
|
+
- [Input Tel](../p-input-tel/p-input-tel.md)
|
|
36
|
+
- [Input Text](../p-input-text/p-input-text.md)
|
|
37
|
+
- [Input Time](../p-input-time/p-input-time.md)
|
|
38
|
+
- [Input Week](../p-input-week/p-input-week.md)
|
|
39
|
+
|
|
40
|
+
## Accessibility support
|
|
41
|
+
|
|
42
|
+
### Keyboard
|
|
43
|
+
|
|
44
|
+
| Key / state | Function |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
47
|
+
|
|
48
|
+
### ARIA enhancements
|
|
49
|
+
|
|
50
|
+
#### Internal **ARIA** that is managed by the component:
|
|
51
|
+
|
|
52
|
+
| ARIA | Usage |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| `aria-describedby="IDREF"` | Defines the accessible description combined with the status message. |
|
|
55
|
+
| `role="status"`, `role="alert"` | When `message` and `state` or `loading` prop change, the status message is announced. |
|
|
56
|
+
| `aria-hidden="true"` | If `required` attribute is set, the visible asterisk indicator is hidden from assistive technologies. |
|
|
57
|
+
| `aria-invalid="true"` | If `error` state is set. |
|
|
58
|
+
| `aria-live="polite"` | If the `maxlength` attribute is present, the counter is announced via ARIA live region. |
|
|
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 URL autofill hint (e.g. `autocomplete='url'`). |
|
|
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
|
+
| `indicator` | `boolean` | `false` | Shows a URL/link icon at the start of the field as a visual indicator. |
|
|
96
|
+
| `label` | `string` | `''` | Sets the visible label text displayed above the input field. |
|
|
97
|
+
| `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables the field and displays a loading spinner to indicate an ongoing operation. |
|
|
98
|
+
| `maxLength` | `number` | `undefined` | Sets the maximum number of characters the user can enter. |
|
|
99
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the field when `state` is `success` or `error`. |
|
|
100
|
+
| `minLength` | `number` | `undefined` | Sets the minimum number of characters required for the field to be considered valid. |
|
|
101
|
+
| `name` _(required)_ | `string` | `undefined` | Sets the name submitted with the form data to identify this field's value on the server. |
|
|
102
|
+
| `pattern` | `string` | `undefined` | Sets a regular expression the entered value must match to be valid. Overrides the browser's default URL validation. |
|
|
103
|
+
| `placeholder` | `string` | `''` | Sets placeholder text shown inside the field when it is empty, such as an example URL. |
|
|
104
|
+
| `readOnly` | `boolean` | `false` | Makes the field read-only — the value is displayed but cannot be edited. The value is still submitted with the form. |
|
|
105
|
+
| `required` | `boolean` | `false` | Marks the field as required — form submission is blocked while this field is empty. |
|
|
106
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state, controlling the visual appearance and style of the feedback message (`none`, `success`, `error`). |
|
|
107
|
+
| `value` | `string | null` | `''` | Sets the current URL value. Must be an absolute URL (e.g. `https://porsche.com`) to pass browser validation. |
|
|
108
|
+
|
|
109
|
+
### Events
|
|
110
|
+
|
|
111
|
+
| Event | Type | Description |
|
|
112
|
+
| --- | --- | --- |
|
|
113
|
+
| `blur` | `CustomEvent<InputUrlBlurEventDetail>`<br>`Event` | Emitted when the input loses focus, regardless of whether the value changed. |
|
|
114
|
+
| `change` | `CustomEvent<InputUrlChangeEventDetail>`<br>`Event` | Emitted when the input loses focus after its value was changed. |
|
|
115
|
+
| `input` | `CustomEvent<InputUrlInputEventDetail>`<br>`InputEvent` | Emitted on every value change as the user types. |
|
|
116
|
+
|
|
117
|
+
### Slots
|
|
118
|
+
|
|
119
|
+
| Slot | Required | Allowed tag names | Description |
|
|
120
|
+
| --- | --- | --- | --- |
|
|
121
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
122
|
+
| `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`). |
|
|
123
|
+
| `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
124
|
+
| `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. |
|
|
125
|
+
| `start` | no | — | Shows content at the start of the input (e.g. unit prefix). |
|
|
126
|
+
| `end` | no | — | Shows content at the end of the input (e.g. toggle button, unit suffix). |
|
|
127
|
+
|
|
128
|
+
### CSS Variables
|
|
129
|
+
|
|
130
|
+
| CSS Variable | Default | Description |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| `--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. |
|
|
133
|
+
| `--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. |
|
|
134
|
+
|
|
135
|
+
## Examples
|
|
136
|
+
|
|
137
|
+
| Example | When to use | File |
|
|
138
|
+
| --- | --- | --- |
|
|
139
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
140
|
+
| Form | The `p-input-url` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.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,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-week label="Some label" name="some-name"></p-input-week>
|
|
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-week formControlName="myInputWeek" [label]="'Some Label'" />
|
|
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
|
+
myInputWeek: 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-week state="error">
|
|
8
|
+
<span slot="label" id="some-label-id">
|
|
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" id="some-description-id">
|
|
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="shopping-cart" 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" id="some-message-id">
|
|
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-week>
|
|
39
|
+
`,
|
|
40
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
41
|
+
standalone: true,
|
|
42
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
43
|
+
})
|
|
44
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# p-input-week
|
|
2
|
+
|
|
3
|
+
The `p-input-week` component provides a versatile, user‑friendly interface for entering week values. It supports direct keyboard input, including arrow-key adjustments for precise changes. It has a start and end slot in order to support flexible slotted content.
|
|
4
|
+
|
|
5
|
+
A `label` is a caption which informs the user what information a particular form field is asking for. The `p-input-week` 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
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
`p-input-week` is intended for week input scenarios. It should not be used for values that merely happen to consist of digits. For those cases, consider using another input with an appropriate input mode. For further guidance, see the [MDN documentation on week inputs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/week#using_date_inputs).
|
|
10
|
+
|
|
11
|
+
### Do:
|
|
12
|
+
|
|
13
|
+
- Use when a week value is required or optional.
|
|
14
|
+
- Use without a label only when the context is clear.
|
|
15
|
+
- Use for validation and error of input.
|
|
16
|
+
- Use asterisk for required fields.
|
|
17
|
+
|
|
18
|
+
### Don't:
|
|
19
|
+
|
|
20
|
+
- Don't use labels with more than two words whenever possible (keep it short and descriptive).
|
|
21
|
+
- Don't use instructional or description text for the label.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Related Components
|
|
26
|
+
|
|
27
|
+
- [Input Date](../p-input-date/p-input-date.md)
|
|
28
|
+
- [Input Email](../p-input-email/p-input-email.md)
|
|
29
|
+
- [Input Month](../p-input-month/p-input-month.md)
|
|
30
|
+
- [Input Number](../p-input-number/p-input-number.md)
|
|
31
|
+
- [Input Password](../p-input-password/p-input-password.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
|
+
|
|
38
|
+
## Accessibility support
|
|
39
|
+
|
|
40
|
+
### Keyboard
|
|
41
|
+
|
|
42
|
+
| Key / state | Function |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
45
|
+
| `Arrow Up/Down` | Sets increments/decrements in regards of the steps |
|
|
46
|
+
|
|
47
|
+
### ARIA enhancements
|
|
48
|
+
|
|
49
|
+
#### Internal **ARIA** that is managed by the component:
|
|
50
|
+
|
|
51
|
+
| ARIA | Usage |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `aria-describedby="IDREF"` | Defines the accessible description combined with the 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
|
+
|
|
59
|
+
## Development considerations
|
|
60
|
+
|
|
61
|
+
### Disabled state
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
### Common do's and don'ts
|
|
66
|
+
|
|
67
|
+
- **Do** keep a persistent label and use helper/description text when additional context is required.
|
|
68
|
+
- **Do** use the component state/message API so validation and status changes are announced.
|
|
69
|
+
- **Do** use clear error wording that helps users recover.
|
|
70
|
+
- **Don't** rely on placeholder text as the only label.
|
|
71
|
+
- **Don't** use `hide-label` without an accessible name.
|
|
72
|
+
|
|
73
|
+
## Limitations
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
| ARIA | Support |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `aria-labelledby` | 🚫 |
|
|
80
|
+
| `aria-describedby` | 🚫 |
|
|
81
|
+
|
|
82
|
+
## API
|
|
83
|
+
|
|
84
|
+
### Properties
|
|
85
|
+
|
|
86
|
+
| Property | Type | Default | Description |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| `autoComplete` | `string` | `undefined` | Provides the browser with a week/year autofill hint. |
|
|
89
|
+
| `compact` | `boolean` | `false` | Reduces the input height and padding for a more compact layout. |
|
|
90
|
+
| `description` | `string` | `''` | Sets a supplementary description displayed below the label to provide additional context. |
|
|
91
|
+
| `disabled` | `boolean` | `false` | Disables the field, preventing week selection. The value is not submitted with the form. |
|
|
92
|
+
| `form` | `string` | `undefined` | Associates the field with a form element by its ID when the field is not nested directly inside it. |
|
|
93
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
94
|
+
| `label` | `string` | `''` | Sets the visible label text displayed above the input field. |
|
|
95
|
+
| `loading` _(experimental)_ | `boolean` | `false` | @experimental Disables the field and displays a loading spinner to indicate an ongoing operation. |
|
|
96
|
+
| `max` | `string` | `undefined` | Sets the latest selectable week in YYYY-Www format. Weeks after this are disabled in the picker. |
|
|
97
|
+
| `message` | `string` | `''` | Sets the validation feedback message displayed below the field when `state` is `success` or `error`. |
|
|
98
|
+
| `min` | `string` | `undefined` | Sets the earliest selectable week in YYYY-Www format. Weeks before this are disabled in the picker. |
|
|
99
|
+
| `name` _(required)_ | `string` | `undefined` | Sets the name submitted with the form data to identify this field's value on the server. |
|
|
100
|
+
| `readOnly` | `boolean` | `false` | Makes the field read-only — the value is displayed but cannot be changed. The value is still submitted with the form. |
|
|
101
|
+
| `required` | `boolean` | `false` | Marks the field as required — form submission is blocked while no week is selected. |
|
|
102
|
+
| `state` | `'none'` `'error'` `'success'` | `'none'` | Sets the validation state, controlling the visual appearance and style of the feedback message (`none`, `success`, `error`). |
|
|
103
|
+
| `step` | `number` | `1` | Sets the stepping interval in weeks. |
|
|
104
|
+
| `value` | `string | null` | `''` | Sets the current ISO week value in YYYY-Www format (e.g. `2025-W27`). |
|
|
105
|
+
|
|
106
|
+
### Events
|
|
107
|
+
|
|
108
|
+
| Event | Type | Description |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| `blur` | `CustomEvent<InputWeekBlurEventDetail>`<br>`Event` | Emitted when the input loses focus, regardless of whether the value changed. |
|
|
111
|
+
| `change` | `CustomEvent<InputWeekChangeEventDetail>`<br>`Event` | Emitted when the input loses focus after its value was changed. |
|
|
112
|
+
| `input` | `CustomEvent<InputWeekInputEventDetail>`<br>`InputEvent` | Emitted on every value change as the user interacts with the week picker. |
|
|
113
|
+
|
|
114
|
+
### Slots
|
|
115
|
+
|
|
116
|
+
| Slot | Required | Allowed tag names | Description |
|
|
117
|
+
| --- | --- | --- | --- |
|
|
118
|
+
| `label` | no | — | Shows a label. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
119
|
+
| `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`). |
|
|
120
|
+
| `description` | no | — | Shows a description. Only [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content) is allowed. |
|
|
121
|
+
| `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. |
|
|
122
|
+
| `start` | no | — | Shows content at the start of the input (e.g. unit prefix). |
|
|
123
|
+
| `end` | no | — | Shows content at the end of the input (e.g. toggle button, unit suffix). |
|
|
124
|
+
|
|
125
|
+
### CSS Variables
|
|
126
|
+
|
|
127
|
+
| CSS Variable | Default | Description |
|
|
128
|
+
| --- | --- | --- |
|
|
129
|
+
| `--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. |
|
|
130
|
+
| `--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. |
|
|
131
|
+
|
|
132
|
+
## Examples
|
|
133
|
+
|
|
134
|
+
| Example | When to use | File |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
137
|
+
| Form | The `p-input-week` can be integrated into a form in two ways: **controlled** or **uncontrolled**, depending on your needs. | [./examples/Form.ts](./examples/Form.ts) |
|
|
138
|
+
| Slots | Use named slots when `label`, `description` or `message` need markup such as a link. | [./examples/Slots.ts](./examples/Slots.ts) |
|
|
@@ -0,0 +1,15 @@
|
|
|
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-link href="https://porsche.com">
|
|
8
|
+
Some label
|
|
9
|
+
</p-link>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,17 @@
|
|
|
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-link>
|
|
8
|
+
<a href="https://porsche.com">
|
|
9
|
+
Some label
|
|
10
|
+
</a>
|
|
11
|
+
</p-link>
|
|
12
|
+
`,
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
16
|
+
})
|
|
17
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 gap-static-sm">
|
|
8
|
+
<p-link href="https://porsche.com" icon="phone">
|
|
9
|
+
Some label
|
|
10
|
+
</p-link>
|
|
11
|
+
<p-link href="https://porsche.com" iconSource="assets/icon-custom-kaixin.svg" [hideLabel]="true">
|
|
12
|
+
Some label
|
|
13
|
+
</p-link>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
+
standalone: true,
|
|
18
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
19
|
+
})
|
|
20
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# p-link
|
|
2
|
+
|
|
3
|
+
The `p-link` component is essential to perform changes in **page routes**. For an optimal user guidance and dedicated pursuit of business or sales goals, different types of Links (**Primary** and **Secondary**) are available for usage. A Link can be used with or without a label, but it's recommended to keep the **label visible** for better **usability** whenever possible. When used without a label, it is mandatory for **accessibility** to provide a descriptive label text for screen readers. In case you want the user to execute an action, you should select the [Button](../p-button/p-button.md) component instead.
|
|
4
|
+
|
|
5
|
+
You can use native `click`, `focus`, `focusin`, `blur` and `focusout` events on the `p-link`.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Do:
|
|
10
|
+
|
|
11
|
+
- Use a Link to navigate to another page.
|
|
12
|
+
- Use a [Button](../p-button/p-button.md) instead of a Link if you want to change a state (e.g. send form)
|
|
13
|
+
- Use a Primary Link filled for one or two high-priority actions within a page.
|
|
14
|
+
- Use a Secondary Link for all other stand-alone Links that aren't high priority.
|
|
15
|
+
- Use a [Link Pure](../p-link-pure/p-link-pure.md) as a subordinated link version in combination with a filled link (primary or secondary) or stand-alone when the priority of the action is lower compared to all other link actions within the page.
|
|
16
|
+
- Use an Icon and text variant only when appropriate (e.g. external link).
|
|
17
|
+
- Use an Icon-only variant only in cases where the user is fully aware of the link function.
|
|
18
|
+
- Ensure that the link remains legible even in a multiline state by using max. 100 characters per line.
|
|
19
|
+
|
|
20
|
+
### Don't:
|
|
21
|
+
|
|
22
|
+
- Don't use a Primary Link for all links on a page.
|
|
23
|
+
- Don't use a multiline Link, as it is recommended to keep the text label short and avoid multiline links.
|
|
24
|
+
- Don't use a width that's too wide and makes the link difficult to read.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Related components
|
|
29
|
+
|
|
30
|
+
- [Button](../p-button/p-button.md)
|
|
31
|
+
- [Link Pure](../p-link-pure/p-link-pure.md)
|
|
32
|
+
|
|
33
|
+
## Accessibility support
|
|
34
|
+
|
|
35
|
+
### Keyboard
|
|
36
|
+
|
|
37
|
+
| Key / state | Function |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `Tab`, `Shift-Tab` | Moves focus to the next (or previous) focusable element. |
|
|
40
|
+
| `Enter` | Activates the link. |
|
|
41
|
+
|
|
42
|
+
### ARIA enhancements
|
|
43
|
+
|
|
44
|
+
#### External **ARIA** provided by the `aria` property:
|
|
45
|
+
|
|
46
|
+
| ARIA | Usage |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| `aria-label` | Defines a string value that labels the interactive element. |
|
|
49
|
+
| `aria-description` | Defines a string value that adds a more detailed description of the interactive element. |
|
|
50
|
+
| `aria-current` | Exposes the current state of the link. |
|
|
51
|
+
| `aria-haspopup` | Defines that the link opens a popup (e.g. `dialog`). |
|
|
52
|
+
|
|
53
|
+
#### Internal **ARIA** that is managed by the component:
|
|
54
|
+
|
|
55
|
+
| ARIA | Usage |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `aria-hidden="true"` | When the `icon` prop is set, the icon is hidden from the screen reader. |
|
|
58
|
+
|
|
59
|
+
## Development considerations
|
|
60
|
+
|
|
61
|
+
### Labelling
|
|
62
|
+
|
|
63
|
+
If the text of a link does not clearly indicate what the link's target is, add a brief, descriptive label using the `aria` property with the `aria-label` value to provide more context for screen reader users. Phrases like "Detail" or "Click" can be unclear when read out of context by a screen reader. In such instances, provide an alternative text that offers more detailed information, such as "Details of product XYZ."
|
|
64
|
+
|
|
65
|
+
### Common do's and don'ts
|
|
66
|
+
|
|
67
|
+
- **Do** pass ARIA attributes via the `aria` prop, for example `aria="{ 'aria-current': 'page' }"` when indicating the current page.
|
|
68
|
+
- **Do** provide a clear accessible name for icon-only actions via slotted label or `aria` property.
|
|
69
|
+
- **Don't** add native `aria-*` attributes directly on the component host.
|
|
70
|
+
- **Don't** rely on short generic link labels like "Show" or "Add" without context.
|
|
71
|
+
|
|
72
|
+
## API
|
|
73
|
+
|
|
74
|
+
### Properties
|
|
75
|
+
|
|
76
|
+
| Property | Type | Default | Description |
|
|
77
|
+
| --- | --- | --- | --- |
|
|
78
|
+
| `aria` | `LinkAriaAttribute` | `undefined` | Sets ARIA attributes on the link element to improve accessibility for screen readers. |
|
|
79
|
+
| `compact` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Reduces the link's padding and height for denser layouts. Supports responsive breakpoint values. |
|
|
80
|
+
| `download` | `string` | `undefined` | Sets the native `download` attribute to trigger a file download. Only applies when `href` is set. |
|
|
81
|
+
| `hideLabel` | `boolean`<br>`BreakpointCustomizable<boolean>` | `false` | Hides the visible label while keeping it accessible to screen readers. Supports responsive breakpoint values. |
|
|
82
|
+
| `href` | `string` | `undefined` | When set, the component renders as an anchor navigating to this URL. Otherwise, provide a slotted anchor element. |
|
|
83
|
+
| `icon` | `'none'`<br>one of 290 icon names — see [icon names](references/icons.md) | `'none'` | Sets the icon displayed next to the link label. Use `none` to show no icon. |
|
|
84
|
+
| `iconSource` | `string` | `undefined` | Sets a path to a custom SVG icon, used instead of the built-in icon set. |
|
|
85
|
+
| `rel` | `string` | `undefined` | Sets the `rel` attribute on the link (e.g. `noopener`). Only applies when `href` is set. |
|
|
86
|
+
| `target` | `'_self'` `'_blank'` `'_parent'` `'_top'` `'string'` | `'_self'` | Specifies where to open the linked URL (e.g. `_self`, `_blank`). Only applies when `href` is set. |
|
|
87
|
+
| `variant` | `'primary'` `'secondary'` | `'primary'` | Sets the visual style variant of the link (`primary` or `secondary`). |
|
|
88
|
+
|
|
89
|
+
### Slots
|
|
90
|
+
|
|
91
|
+
| Slot | Required | Allowed tag names | Description |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| _(default)_ | no | — | Default slot to render the link label. This slot can be used to slot an anchor tag instead of using the href prop. |
|
|
94
|
+
|
|
95
|
+
## Examples
|
|
96
|
+
|
|
97
|
+
| Example | When to use | File |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Default | Minimal default configuration. | [./examples/Default.ts](./examples/Default.ts) |
|
|
100
|
+
| Framework routing (anchor nesting) | To support custom anchor tags (e.g. framework specific routing) you can provide them as a **slotted element** of the component. | [./examples/FrameworkRouting.ts](./examples/FrameworkRouting.ts) |
|
|
101
|
+
| Link with specific icon | If an icon needs to be implemented, just set another predefined icon. | [./examples/Icon.ts](./examples/Icon.ts) |
|
|
@@ -0,0 +1,15 @@
|
|
|
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-link-pure href="https://porsche.com" class="p-static-md">
|
|
8
|
+
Some label
|
|
9
|
+
</p-link-pure>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|
|
@@ -0,0 +1,15 @@
|
|
|
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-link-pure href="https://porsche.com">
|
|
8
|
+
Some label
|
|
9
|
+
</p-link-pure>
|
|
10
|
+
`,
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [PorscheDesignSystemModule], // <-- PDS module is imported here
|
|
14
|
+
})
|
|
15
|
+
export class ExampleComponent {}
|