oasys-lib 3.10.1-rc.0 → 3.11.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.
@@ -1393,7 +1393,7 @@ class TextInputComponent {
1393
1393
  showPassword = signal(false, ...(ngDevMode ? [{ debugName: "showPassword" }] : /* istanbul ignore next */ []));
1394
1394
  inputDidChange = signal(false, ...(ngDevMode ? [{ debugName: "inputDidChange" }] : /* istanbul ignore next */ [])); // only show valdiation after a change event (ie. blur)
1395
1395
  textInputType = signal('text', ...(ngDevMode ? [{ debugName: "textInputType" }] : /* istanbul ignore next */ []));
1396
- hasBeenFocused = signal(false, ...(ngDevMode ? [{ debugName: "hasBeenFocused" }] : /* istanbul ignore next */ [])); // once the field is focused, the password hint stays visible
1396
+ isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : /* istanbul ignore next */ [])); // track focus state for password hint display
1397
1397
  id = signal('', ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
1398
1398
  safariAutocorrect = signal('on', ...(ngDevMode ? [{ debugName: "safariAutocorrect" }] : /* istanbul ignore next */ []));
1399
1399
  // Computed signal for hide_password_aria_label that combines the base label with the current input value for better screen reader context
@@ -1405,10 +1405,9 @@ class TextInputComponent {
1405
1405
  if (!this.hint()) {
1406
1406
  return false;
1407
1407
  }
1408
- // For password inputs, wait until the field is first focused, then keep the hint showing.
1409
- // Hiding it again on blur would move everything below it, so a click on the next button could miss.
1408
+ // For password inputs, only show hint when focused
1410
1409
  if (this.type() === 'password') {
1411
- return this.hasBeenFocused();
1410
+ return this.isFocused();
1412
1411
  }
1413
1412
  // For all other input types, always show hint
1414
1413
  return true;
@@ -1438,9 +1437,10 @@ class TextInputComponent {
1438
1437
  this.inputDidChange.set(false);
1439
1438
  }
1440
1439
  onFocus() {
1441
- this.hasBeenFocused.set(true);
1440
+ this.isFocused.set(true);
1442
1441
  }
1443
1442
  onBlur() {
1443
+ this.isFocused.set(false);
1444
1444
  // User left the field — reveal validation errors if still invalid.
1445
1445
  this.inputDidChange.set(true);
1446
1446
  // Mark the form control as touched (standard CVA behavior on blur).
@@ -1493,8 +1493,8 @@ class TextInputComponent {
1493
1493
  // Add error if it exists
1494
1494
  describedBy.push('error_' + this.id());
1495
1495
  }
1496
- // Only point at the hint while it is on the page, so screen readers never look for a missing element
1497
- if (this.shouldShowHint()) {
1496
+ // Add hint if it exists
1497
+ if (this.hint()) {
1498
1498
  describedBy.push('hint_' + this.id());
1499
1499
  }
1500
1500
  return describedBy.length > 0 ? describedBy.join(' ') : undefined;
@@ -3571,6 +3571,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImpo
3571
3571
  type: Input
3572
3572
  }] } });
3573
3573
 
3574
+ // Generated by logos/generate-logo-sprite.mjs. Do not edit by hand.
3575
+ // Add or remove SVGs in logos/ and run `npm run update-logos`.
3576
+ const LOGO_NAMES = [
3577
+ 'amazon',
3578
+ 'amex',
3579
+ 'apple-pay',
3580
+ 'bancontact',
3581
+ 'google-pay',
3582
+ 'ideal',
3583
+ 'klarna',
3584
+ 'maestro',
3585
+ 'mastercard',
3586
+ 'paypal',
3587
+ 'sepa',
3588
+ 'sofort',
3589
+ 'visa',
3590
+ ];
3591
+
3592
+ /**
3593
+ * Renders full-colour artwork from the shared logo sprite. Unlike ui-icon,
3594
+ * logos keep their own colours, so they look the same on every brand. Only
3595
+ * payment provider badges exist so far; they render at a fixed 45 x 32 px so
3596
+ * rows of payment methods line up.
3597
+ */
3598
+ class LogoComponent {
3599
+ logo_name;
3600
+ /** Any CSS length, e.g. '4.8rem'. Sets the height; the width keeps the 45 x 32 ratio. */
3601
+ logo_size_override;
3602
+ /** Accessible name. Leave empty when nearby text already names it. */
3603
+ alt_text = '';
3604
+ get isKnownLogo() {
3605
+ return LOGO_NAMES.includes(this.logo_name);
3606
+ }
3607
+ get logoPath() {
3608
+ return `./shared/assets/logos/logos.svg#logo-${this.logo_name}`;
3609
+ }
3610
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: LogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3611
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: LogoComponent, isStandalone: true, selector: "ui-logo", inputs: { logo_name: "logo_name", logo_size_override: "logo_size_override", alt_text: "alt_text" }, ngImport: i0, template: "@if (isKnownLogo) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"ui-logo\"\n viewBox=\"0 0 45 32\"\n [style.height]=\"logo_size_override\"\n [attr.role]=\"alt_text.length > 0 ? 'img' : 'presentation'\"\n [attr.aria-label]=\"alt_text.length > 0 ? alt_text : null\"\n [attr.aria-hidden]=\"alt_text.length > 0 ? null : 'true'\"\n focusable=\"false\"\n >\n <use [attr.href]=\"logoPath\"></use>\n </svg>\n}\n", styles: [".ui-logo{display:inline-block;height:var(--oasys-size-unit-32);width:auto;aspect-ratio:45/32;vertical-align:middle}\n"], encapsulation: i0.ViewEncapsulation.None });
3612
+ }
3613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: LogoComponent, decorators: [{
3614
+ type: Component,
3615
+ args: [{ selector: 'ui-logo', encapsulation: ViewEncapsulation.None, standalone: true, imports: [], template: "@if (isKnownLogo) {\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"ui-logo\"\n viewBox=\"0 0 45 32\"\n [style.height]=\"logo_size_override\"\n [attr.role]=\"alt_text.length > 0 ? 'img' : 'presentation'\"\n [attr.aria-label]=\"alt_text.length > 0 ? alt_text : null\"\n [attr.aria-hidden]=\"alt_text.length > 0 ? null : 'true'\"\n focusable=\"false\"\n >\n <use [attr.href]=\"logoPath\"></use>\n </svg>\n}\n", styles: [".ui-logo{display:inline-block;height:var(--oasys-size-unit-32);width:auto;aspect-ratio:45/32;vertical-align:middle}\n"] }]
3616
+ }], propDecorators: { logo_name: [{
3617
+ type: Input,
3618
+ args: [{ required: true }]
3619
+ }], logo_size_override: [{
3620
+ type: Input
3621
+ }], alt_text: [{
3622
+ type: Input
3623
+ }] } });
3624
+
3574
3625
  class OasysFormErrorsSummaryItemComponent {
3575
3626
  elementRef = inject(ElementRef);
3576
3627
  itemId = signal('errors-summary-item', ...(ngDevMode ? [{ debugName: "itemId" }] : /* istanbul ignore next */ []));
@@ -3777,5 +3828,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImpo
3777
3828
  * Generated bundle index. Do not edit.
3778
3829
  */
3779
3830
 
3780
- export { BannerComponent, BreadcrumbsComponent, CardComponent, CheckboxComponent, ChipComponent, DividerComponent, FormErrorsComponent, FormGroupComponent, HeroComponent, IMAGE_BREAKPOINTS, IMAGE_URL_PROVIDER, IconComponent, ImageComponent, LayoutBoxComponent, LayoutContainerComponent, LayoutGridColumnComponent, LayoutGridComponent, LayoutStackComponent, OasysAlertCancelDirective, OasysAlertComponent, OasysAlertConfirmDirective, OasysAlertContentDirective, OasysAlertModule, OasysAlertTitleDirective, OasysAutofocusDirective, BannerComponent as OasysBannerComponent, OasysBannerModule, OasysBreadcrumbModule, BreadcrumbsComponent as OasysBreadcrumbsComponent, OasysButtonComponent, OasysButtonGroupComponent, OasysButtonGroupModule, OasysButtonModule, CardComponent as OasysCardComponent, OasysCardModule, CheckboxComponent as OasysCheckboxComponent, OasysCheckboxModule, ChipComponent as OasysChipComponent, OasysChipModule, OasysComboboxComponent, OasysDirectivesModule, DividerComponent as OasysDividerComponent, OasysDividerModule, FormErrorsComponent as OasysFormErrorsComponent, OasysFormErrorsModule, OasysFormErrorsSummaryComponent, OasysFormErrorsSummaryItemComponent, OasysFormErrorsSummaryTitleComponent, FormGroupComponent as OasysFormGroupComponent, OasysFormGroupModule, OasysHeadingComponent, OasysHeadingModule, HeroComponent as OasysHeroComponent, OasysHeroModule, OasysHrefDirective, IconComponent as OasysIconComponent, OasysIconModule, ImageComponent as OasysImageComponent, OasysImageModule, LayoutBoxComponent as OasysLayoutBoxComponent, LayoutContainerComponent as OasysLayoutContainerComponent, LayoutGridColumnComponent as OasysLayoutGridColumnComponent, LayoutGridComponent as OasysLayoutGridComponent, OasysLayoutModule, LayoutStackComponent as OasysLayoutStackComponent, OasysPillComponent, OasysPillGroupComponent, OasysPillGroupModule, OasysPillModule, ProgressBarComponent as OasysProgressBarComponent, PromoCardComponent as OasysPromoCardComponent, OasysPromoCardModule, RadioComponent as OasysRadioComponent, OasysRadioModule, SectionComponent as OasysSectionComponent, SelectCardComponent as OasysSelectCardComponent, OasysSelectCardModule, OasysTabComponent, OasysTabGroupComponent, OasysTabsModule, TextComponent as OasysTextComponent, TextInputComponent as OasysTextInputComponent, OasysTextInputModule, OasysTextModule, TextareaComponent as OasysTextareaComponent, OasysThemeDirective, ProgressBarComponent, PromoCardComponent, ROUTING_HANDLER, RadioComponent, SWIPER_PROVIDER_TOKEN, SectionComponent, SectionModule, SelectCardComponent, SwiperProvider, TextComponent, TextareaComponent };
3831
+ export { BannerComponent, BreadcrumbsComponent, CardComponent, CheckboxComponent, ChipComponent, DividerComponent, FormErrorsComponent, FormGroupComponent, HeroComponent, IMAGE_BREAKPOINTS, IMAGE_URL_PROVIDER, IconComponent, ImageComponent, LOGO_NAMES, LayoutBoxComponent, LayoutContainerComponent, LayoutGridColumnComponent, LayoutGridComponent, LayoutStackComponent, LogoComponent, OasysAlertCancelDirective, OasysAlertComponent, OasysAlertConfirmDirective, OasysAlertContentDirective, OasysAlertModule, OasysAlertTitleDirective, OasysAutofocusDirective, BannerComponent as OasysBannerComponent, OasysBannerModule, OasysBreadcrumbModule, BreadcrumbsComponent as OasysBreadcrumbsComponent, OasysButtonComponent, OasysButtonGroupComponent, OasysButtonGroupModule, OasysButtonModule, CardComponent as OasysCardComponent, OasysCardModule, CheckboxComponent as OasysCheckboxComponent, OasysCheckboxModule, ChipComponent as OasysChipComponent, OasysChipModule, OasysComboboxComponent, OasysDirectivesModule, DividerComponent as OasysDividerComponent, OasysDividerModule, FormErrorsComponent as OasysFormErrorsComponent, OasysFormErrorsModule, OasysFormErrorsSummaryComponent, OasysFormErrorsSummaryItemComponent, OasysFormErrorsSummaryTitleComponent, FormGroupComponent as OasysFormGroupComponent, OasysFormGroupModule, OasysHeadingComponent, OasysHeadingModule, HeroComponent as OasysHeroComponent, OasysHeroModule, OasysHrefDirective, IconComponent as OasysIconComponent, OasysIconModule, ImageComponent as OasysImageComponent, OasysImageModule, LayoutBoxComponent as OasysLayoutBoxComponent, LayoutContainerComponent as OasysLayoutContainerComponent, LayoutGridColumnComponent as OasysLayoutGridColumnComponent, LayoutGridComponent as OasysLayoutGridComponent, OasysLayoutModule, LayoutStackComponent as OasysLayoutStackComponent, LogoComponent as OasysLogoComponent, OasysPillComponent, OasysPillGroupComponent, OasysPillGroupModule, OasysPillModule, ProgressBarComponent as OasysProgressBarComponent, PromoCardComponent as OasysPromoCardComponent, OasysPromoCardModule, RadioComponent as OasysRadioComponent, OasysRadioModule, SectionComponent as OasysSectionComponent, SelectCardComponent as OasysSelectCardComponent, OasysSelectCardModule, OasysTabComponent, OasysTabGroupComponent, OasysTabsModule, TextComponent as OasysTextComponent, TextInputComponent as OasysTextInputComponent, OasysTextInputModule, OasysTextModule, TextareaComponent as OasysTextareaComponent, OasysThemeDirective, ProgressBarComponent, PromoCardComponent, ROUTING_HANDLER, RadioComponent, SWIPER_PROVIDER_TOKEN, SectionComponent, SectionModule, SelectCardComponent, SwiperProvider, TextComponent, TextareaComponent };
3781
3832
  //# sourceMappingURL=oasys-lib.mjs.map