@seniorsistemas/scala-ng 2.1.0 → 2.2.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/README.md +4 -5
- package/avatar-summary/README.md +6 -2
- package/avatar-summary/public-api.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
- package/banner/README.md +13 -9
- package/banner/public-api.d.ts +1 -1
- package/breadcrumb/README.md +15 -8
- package/breadcrumb/public-api.d.ts +3 -3
- package/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.d.ts +1 -0
- package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +7 -1
- package/card/README.md +1 -0
- package/checkbox/README.md +3 -1
- package/date-picker/README.md +1 -0
- package/date-picker/public-api.d.ts +1 -1
- package/drawer/README.md +4 -0
- package/empty-state/README.md +17 -11
- package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
- package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/avatar-summary/public-api.mjs +1 -1
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +2 -2
- package/esm2022/banner/public-api.mjs +2 -2
- package/esm2022/banner/src/banner/banner.component.mjs +4 -4
- package/esm2022/breadcrumb/public-api.mjs +2 -2
- package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +4 -4
- package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +6 -3
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-route-data.mjs +1 -1
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +23 -6
- package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +2 -2
- package/esm2022/card/src/card/card.component.mjs +4 -4
- package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +3 -3
- package/esm2022/date-picker/public-api.mjs +2 -2
- package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +4 -4
- package/esm2022/drawer/src/drawer/drawer.component.mjs +3 -3
- package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +4 -4
- package/esm2022/input/src/input/input.component.mjs +3 -4
- package/esm2022/item-strip/public-api.mjs +1 -1
- package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +59 -11
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +97 -9
- package/esm2022/lib/chip/chip.utils.mjs +2 -2
- package/esm2022/lib/overlay/scroll-lock.utils.mjs +1 -1
- package/esm2022/lib/theme/theme.service.mjs +2 -2
- package/esm2022/list/public-api.mjs +1 -1
- package/esm2022/list/src/list/list.component.mjs +3 -3
- package/esm2022/list/src/list/list.models.mjs +1 -1
- package/esm2022/list/src/list-item/list-item.component.mjs +26 -5
- package/esm2022/locale/fallback.mjs +1 -2
- package/esm2022/page-header/src/page-header/page-header.component.mjs +8 -6
- package/esm2022/paginator/src/paginator/paginator.component.mjs +2 -2
- package/esm2022/panel/src/panel/panel.component.mjs +4 -4
- package/esm2022/public-api.mjs +5 -5
- package/esm2022/radio-button/public-api.mjs +2 -2
- package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +3 -3
- package/esm2022/select/src/select/select.component.mjs +5 -5
- package/esm2022/select-button/src/select-button/select-button.component.mjs +4 -4
- package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +5 -28
- package/esm2022/switch/src/switch/switch.component.mjs +3 -3
- package/esm2022/table/public-api.mjs +1 -1
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +10 -5
- package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +1 -1
- package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +2 -2
- package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +3 -3
- package/esm2022/table/src/directives/table-container.directive.mjs +3 -3
- package/esm2022/table/src/table/table.component.mjs +3 -3
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/esm2022/table/src/utils/table-lazy-event.utils.mjs +1 -1
- package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +32 -0
- package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +5 -3
- package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +77 -23
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs +53 -53
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +30 -11
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-card.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +154 -18
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-list.mjs +27 -6
- package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs +0 -1
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +7 -5
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +3 -3
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select.mjs +4 -4
- package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +4 -27
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs +2 -2
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs} +10 -5
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D6ffnUl1.mjs.map +1 -0
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs} +3 -3
- package/fesm2022/{seniorsistemas-scala-ng-table-table-toolbar.component-DWhF_ejJ.mjs.map → seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map} +1 -1
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +21 -21
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +109 -24
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng.mjs +55 -55
- package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
- package/filter-tag/README.md +2 -1
- package/item-strip/README.md +11 -4
- package/item-strip/public-api.d.ts +1 -1
- package/item-strip/src/item-strip/item-strip.component.d.ts +12 -1
- package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +32 -3
- package/list/README.md +17 -0
- package/list/public-api.d.ts +1 -1
- package/list/src/list/list.models.d.ts +19 -0
- package/list/src/list-item/list-item.component.d.ts +15 -2
- package/package.json +1 -7
- package/page-header/README.md +68 -24
- package/page-header/src/page-header/page-header.component.d.ts +5 -3
- package/panel/README.md +5 -1
- package/public-api.d.ts +7 -7
- package/radio-button/README.md +8 -1
- package/radio-button/public-api.d.ts +2 -2
- package/schematics/ng-add/index.js +39 -23
- package/schematics/ng-add/index.js.map +1 -1
- package/select/src/select/select.component.d.ts +3 -3
- package/select-button/README.md +1 -0
- package/selection-chip/README.md +1 -0
- package/stats-card/README.md +35 -29
- package/stats-card/src/stats-card/stats-card.component.d.ts +18 -31
- package/styles/tailwind-tokens.js +103 -1
- package/styles/tokens/radius.scss +0 -2
- package/styles/tokens/spacing.scss +0 -2
- package/styles/tokens/typography.scss +0 -2
- package/styles.scss +2 -0
- package/switch/README.md +7 -1
- package/table/README.md +21 -10
- package/table/public-api.d.ts +4 -4
- package/table/src/table/table.models.d.ts +2 -1
- package/tooltip/README.md +15 -5
- package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +16 -0
- package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +3 -1
- package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +21 -5
- package/avatar-profile/README.md +0 -204
- package/avatar-profile/index.d.ts +0 -5
- package/avatar-profile/package.json +0 -3
- package/avatar-profile/public-api.d.ts +0 -1
- package/avatar-profile/src/avatar-profile/avatar-profile.component.d.ts +0 -21
- package/esm2022/avatar-profile/public-api.mjs +0 -2
- package/esm2022/avatar-profile/seniorsistemas-scala-ng-avatar-profile.mjs +0 -5
- package/esm2022/avatar-profile/src/avatar-profile/avatar-profile.component.mjs +0 -33
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs +0 -40
- package/fesm2022/seniorsistemas-scala-ng-avatar-profile.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DZU3DYW8.mjs.map +0 -1
|
@@ -3,18 +3,19 @@ import { viewChild, input, model, computed, Component } from '@angular/core';
|
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
6
|
+
import { SdsTooltipDirective } from '@seniorsistemas/scala-ng/tooltip';
|
|
6
7
|
|
|
7
8
|
class SdsPageHeaderComponent {
|
|
8
9
|
static idCounter = 0;
|
|
9
10
|
_titleId;
|
|
10
11
|
titleElementRef = viewChild("titleEl");
|
|
11
12
|
/** Page title. The component's floor — always rendered, everything else here is optional. */
|
|
12
|
-
|
|
13
|
+
heading = input.required();
|
|
13
14
|
/** Supporting text below the title row; truncates to two lines. Omitted when empty. */
|
|
14
15
|
description = input("");
|
|
15
16
|
/** Shows the automatic route breadcrumb trail (`sds-breadcrumb-router`). Turn off on top-level pages. */
|
|
16
17
|
hasBreadcrumb = input(true);
|
|
17
|
-
/** Heading level
|
|
18
|
+
/** Heading level, rendered as the matching `<h1>`–`<h6>`; adjust to match the host screen's hierarchy. */
|
|
18
19
|
headingLevel = input(1);
|
|
19
20
|
/** Secondary/primary/"more options" actions, rendered left to right; the primary action never groups into "more". */
|
|
20
21
|
actions = input(null);
|
|
@@ -43,12 +44,12 @@ class SdsPageHeaderComponent {
|
|
|
43
44
|
this.titleElementRef()?.nativeElement.focus();
|
|
44
45
|
}
|
|
45
46
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsPageHeaderComponent, isStandalone: true, selector: "sds-page-header", inputs: {
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsPageHeaderComponent, isStandalone: true, selector: "sds-page-header", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, hasBreadcrumb: { classPropertyName: "hasBreadcrumb", publicName: "hasBreadcrumb", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, scopeFilterItems: { classPropertyName: "scopeFilterItems", publicName: "scopeFilterItems", isSignal: true, isRequired: false, transformFunction: null }, scopeFilterAriaLabel: { classPropertyName: "scopeFilterAriaLabel", publicName: "scopeFilterAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, scopeFilterValue: { classPropertyName: "scopeFilterValue", publicName: "scopeFilterValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scopeFilterValue: "scopeFilterValueChange" }, host: { attributes: { "role": "region" }, properties: { "attr.aria-labelledby": "_titleId" }, classAttribute: "flex w-full flex-col gap-space-1 border-b border-solid border-color-border bg-surface-default px-space-2-5 py-space-2" }, viewQueries: [{ propertyName: "titleElementRef", first: true, predicate: ["titleEl"], descendants: true, isSignal: true }], ngImport: i0, template: "@let resolvedMoreActionsAriaLabel = \"platform.scala-ng.page_header_more_actions_label\" | translate;\n@let resolvedScopeFilterAriaLabel =\n scopeFilterAriaLabel() || (\"platform.scala-ng.page_header_scope_filter_label\" | translate);\n\n@if (hasBreadcrumb()) {\n @defer (on idle; prefetch on immediate) {\n <sds-breadcrumb-router />\n } @placeholder {\n <div class=\"h-[29px]\"></div>\n }\n}\n\n<div class=\"flex flex-col gap-space-0-75\">\n <div class=\"flex items-center gap-space-3\">\n <!-- Native heading tags instead of the ARIA heading role, so every assistive technology recognizes them. -->\n @switch (headingLevel()) {\n @default {\n <h1\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h1>\n }\n @case (2) {\n <h2\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h2>\n }\n @case (3) {\n <h3\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h3>\n }\n @case (4) {\n <h4\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h4>\n }\n @case (5) {\n <h5\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h5>\n }\n @case (6) {\n <h6\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h6>\n }\n }\n\n @if (hasActions()) {\n @defer (on idle; prefetch on immediate) {\n <div class=\"flex shrink-0 items-center gap-space-1\">\n @if (actions()?.secondaryAction; as action) {\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.primaryAction; as action) {\n <button\n sdsButton\n type=\"primary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.moreActions?.length) {\n <button\n sdsButton\n type=\"secondary\"\n [sdsTieredMenu]=\"actions()!.moreActions!\"\n [attr.aria-label]=\"resolvedMoreActionsAriaLabel\"\n [sdsTooltip]=\"resolvedMoreActionsAriaLabel\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis-vertical\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n } @placeholder {\n <div class=\"h-[40px] w-[40px] shrink-0\"></div>\n }\n }\n </div>\n\n @if (hasDescription()) {\n <p\n class=\"line-clamp-2 text-font-size-2 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >\n {{ description() }}\n </p>\n }\n</div>\n\n@if (hasScopeFilter()) {\n @defer (on idle; prefetch on immediate) {\n <sds-select-button\n [items]=\"scopeFilterItems()\"\n [ariaLabel]=\"resolvedScopeFilterAriaLabel\"\n [(ngModel)]=\"scopeFilterValue\"\n />\n } @placeholder {\n <div class=\"h-[38px]\"></div>\n }\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: SdsTooltipDirective, selector: "[sdsTooltip]", inputs: ["sdsTooltip", "sdsTooltipContext", "sdsTooltipTitle", "sdsTooltipPosition", "sdsTooltipShowArrow", "sdsTooltipOpenDelay", "sdsTooltipDisabled", "sdsTooltipCheckTruncatedText", "sdsTooltipFocusable", "sdsTooltipDescribeHost"] }], deferBlockDependencies: [() => [import('@seniorsistemas/scala-ng/breadcrumb').then(m => m.SdsBreadcrumbRouterComponent)], () => [import('@seniorsistemas/scala-ng/button').then(m => m.SdsButtonComponent), import('@seniorsistemas/scala-ng/tiered-menu').then(m => m.SdsTieredMenuDirective), SdsTooltipDirective], () => [i1.NgControlStatus, i1.NgModel, import('@seniorsistemas/scala-ng/select-button').then(m => m.SdsSelectButtonComponent)]] });
|
|
47
48
|
}
|
|
48
49
|
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.14", ngImport: i0, type: SdsPageHeaderComponent, resolveDeferredDeps: () => [import('@seniorsistemas/scala-ng/breadcrumb').then(m => m.SdsBreadcrumbRouterComponent), import('@seniorsistemas/scala-ng/button').then(m => m.SdsButtonComponent), import('@seniorsistemas/scala-ng/tiered-menu').then(m => m.SdsTieredMenuDirective), import('@seniorsistemas/scala-ng/select-button').then(m => m.SdsSelectButtonComponent)], resolveMetadata: (SdsBreadcrumbRouterComponent, SdsButtonComponent, SdsTieredMenuDirective, SdsSelectButtonComponent) => ({ decorators: [{
|
|
49
50
|
type: Component,
|
|
50
51
|
args: [{ selector: "sds-page-header", standalone: true, host: {
|
|
51
|
-
class: "flex w-full flex-col gap-space-1 border-b border-solid border-color-border
|
|
52
|
+
class: "flex w-full flex-col gap-space-1 border-b border-solid border-color-border bg-surface-default px-space-2-5 py-space-2",
|
|
52
53
|
role: "region",
|
|
53
54
|
"[attr.aria-labelledby]": "_titleId",
|
|
54
55
|
}, imports: [
|
|
@@ -58,7 +59,8 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.14", n
|
|
|
58
59
|
SdsButtonComponent,
|
|
59
60
|
SdsSelectButtonComponent,
|
|
60
61
|
SdsTieredMenuDirective,
|
|
61
|
-
|
|
62
|
+
SdsTooltipDirective,
|
|
63
|
+
], template: "@let resolvedMoreActionsAriaLabel = \"platform.scala-ng.page_header_more_actions_label\" | translate;\n@let resolvedScopeFilterAriaLabel =\n scopeFilterAriaLabel() || (\"platform.scala-ng.page_header_scope_filter_label\" | translate);\n\n@if (hasBreadcrumb()) {\n @defer (on idle; prefetch on immediate) {\n <sds-breadcrumb-router />\n } @placeholder {\n <div class=\"h-[29px]\"></div>\n }\n}\n\n<div class=\"flex flex-col gap-space-0-75\">\n <div class=\"flex items-center gap-space-3\">\n <!-- Native heading tags instead of the ARIA heading role, so every assistive technology recognizes them. -->\n @switch (headingLevel()) {\n @default {\n <h1\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h1>\n }\n @case (2) {\n <h2\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h2>\n }\n @case (3) {\n <h3\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h3>\n }\n @case (4) {\n <h4\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h4>\n }\n @case (5) {\n <h5\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h5>\n }\n @case (6) {\n <h6\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h6>\n }\n }\n\n @if (hasActions()) {\n @defer (on idle; prefetch on immediate) {\n <div class=\"flex shrink-0 items-center gap-space-1\">\n @if (actions()?.secondaryAction; as action) {\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.primaryAction; as action) {\n <button\n sdsButton\n type=\"primary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.moreActions?.length) {\n <button\n sdsButton\n type=\"secondary\"\n [sdsTieredMenu]=\"actions()!.moreActions!\"\n [attr.aria-label]=\"resolvedMoreActionsAriaLabel\"\n [sdsTooltip]=\"resolvedMoreActionsAriaLabel\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis-vertical\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n } @placeholder {\n <div class=\"h-[40px] w-[40px] shrink-0\"></div>\n }\n }\n </div>\n\n @if (hasDescription()) {\n <p\n class=\"line-clamp-2 text-font-size-2 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >\n {{ description() }}\n </p>\n }\n</div>\n\n@if (hasScopeFilter()) {\n @defer (on idle; prefetch on immediate) {\n <sds-select-button\n [items]=\"scopeFilterItems()\"\n [ariaLabel]=\"resolvedScopeFilterAriaLabel\"\n [(ngModel)]=\"scopeFilterValue\"\n />\n } @placeholder {\n <div class=\"h-[38px]\"></div>\n }\n}\n" }]
|
|
62
64
|
}], ctorParameters: () => [], propDecorators: null }) });
|
|
63
65
|
|
|
64
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng-page-header.mjs","sources":["../../projects/scala-ng/page-header/src/page-header/page-header.component.ts","../../projects/scala-ng/page-header/src/page-header/page-header.component.html","../../projects/scala-ng/page-header/seniorsistemas-scala-ng-page-header.ts"],"sourcesContent":["import { Component, computed, ElementRef, input, model, viewChild } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsBreadcrumbRouterComponent } from \"@seniorsistemas/scala-ng/breadcrumb\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsSelectButtonComponent,\n type SelectButtonItem,\n} from \"@seniorsistemas/scala-ng/select-button\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\n\nexport interface SdsPageHeaderAction {\n /** Visible label. Omit for an icon-only button — `ariaLabel` becomes required in practice then. */\n label?: string;\n icon?: string;\n /** Accessible name used when the button has no visible label. */\n ariaLabel?: string;\n disabled?: boolean;\n onClick: () => void;\n}\n\nexport interface SdsPageHeaderActionsConfig {\n secondaryAction?: SdsPageHeaderAction;\n primaryAction?: SdsPageHeaderAction;\n /** Ações de menor peso, agrupadas no botão \"Mais\" (a partir de 3 ações no total). */\n moreActions?: SdsTieredMenuItem[];\n}\n\n@Component({\n selector: \"sds-page-header\",\n standalone: true,\n host: {\n class:\n \"flex w-full flex-col gap-space-1 border-b border-solid border-color-border-bold bg-surface-default px-space-2-5 py-space-2\",\n role: \"region\",\n \"[attr.aria-labelledby]\": \"_titleId\",\n },\n imports: [\n FormsModule,\n TranslatePipe,\n SdsBreadcrumbRouterComponent,\n SdsButtonComponent,\n SdsSelectButtonComponent,\n SdsTieredMenuDirective,\n ],\n templateUrl: \"./page-header.component.html\",\n})\nexport class SdsPageHeaderComponent<T = unknown, R = unknown> {\n private static idCounter = 0;\n\n protected readonly _titleId: string;\n\n private readonly titleElementRef = viewChild<ElementRef<HTMLElement>>(\"titleEl\");\n\n /** Page title. The component's floor — always rendered, everything else here is optional. */\n readonly title = input.required<string>();\n\n /** Supporting text below the title row; truncates to two lines. Omitted when empty. */\n readonly description = input<string>(\"\");\n\n /** Shows the automatic route breadcrumb trail (`sds-breadcrumb-router`). Turn off on top-level pages. */\n readonly hasBreadcrumb = input<boolean>(true);\n\n /** Heading level exposed as `role=\"heading\"`/`aria-level`; adjust to match the host screen's hierarchy. */\n readonly headingLevel = input<1 | 2 | 3 | 4 | 5 | 6>(1);\n\n /** Secondary/primary/\"more options\" actions, rendered left to right; the primary action never groups into \"more\". */\n readonly actions = input<SdsPageHeaderActionsConfig | null>(null);\n\n /** Scope-filter segments (`sds-select-button`) rendered below the title. Omitted when empty. */\n readonly scopeFilterItems = input<SelectButtonItem<T, R>[]>([]);\n\n /** Accessible name for the scope filter; falls back to a translated default when empty. */\n readonly scopeFilterAriaLabel = input<string>(\"\");\n\n /** Two-way bound scope-filter selection. */\n readonly scopeFilterValue = model<T | null>(null);\n\n protected readonly hasDescription = computed(() => this.description().length > 0);\n\n protected readonly hasActions = computed(() => {\n const config = this.actions();\n return (\n !!config &&\n (!!config.secondaryAction || !!config.primaryAction || (config.moreActions?.length ?? 0) > 0)\n );\n });\n\n protected readonly hasScopeFilter = computed(() => this.scopeFilterItems().length > 0);\n\n constructor() {\n SdsPageHeaderComponent.idCounter++;\n this._titleId = `sds-page-header-title-${SdsPageHeaderComponent.idCounter}`;\n }\n\n /**\n * Moves focus to the title. Call this after navigating or reloading the page's content so screen\n * readers announce the change — nothing else here signals that the page changed.\n */\n focusTitle(): void {\n this.titleElementRef()?.nativeElement.focus();\n }\n}\n","@let resolvedMoreActionsAriaLabel = \"platform.scala-ng.page_header_more_actions_label\" | translate;\n@let resolvedScopeFilterAriaLabel =\n scopeFilterAriaLabel() || (\"platform.scala-ng.page_header_scope_filter_label\" | translate);\n\n@if (hasBreadcrumb()) {\n @defer (on idle; prefetch on immediate) {\n <sds-breadcrumb-router />\n } @placeholder {\n <div class=\"h-[29px]\"></div>\n }\n}\n\n<div class=\"flex flex-col gap-space-0-75\">\n <div class=\"flex items-center gap-space-3\">\n <div\n #titleEl\n [id]=\"_titleId\"\n role=\"heading\"\n [attr.aria-level]=\"headingLevel()\"\n tabindex=\"-1\"\n [title]=\"title()\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n >\n {{ title() }}\n </div>\n\n @if (hasActions()) {\n @defer (on idle; prefetch on immediate) {\n <div class=\"flex shrink-0 items-center gap-space-1\">\n @if (actions()?.secondaryAction; as action) {\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.primaryAction; as action) {\n <button\n sdsButton\n type=\"primary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.moreActions?.length) {\n <button\n sdsButton\n type=\"secondary\"\n [sdsTieredMenu]=\"actions()!.moreActions!\"\n [attr.aria-label]=\"resolvedMoreActionsAriaLabel\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis-vertical\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n } @placeholder {\n <div class=\"h-[40px] w-[40px] shrink-0\"></div>\n }\n }\n </div>\n\n @if (hasDescription()) {\n <p\n class=\"line-clamp-2 text-font-size-2 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >\n {{ description() }}\n </p>\n }\n</div>\n\n@if (hasScopeFilter()) {\n @defer (on idle; prefetch on immediate) {\n <sds-select-button\n [items]=\"scopeFilterItems()\"\n [ariaLabel]=\"resolvedScopeFilterAriaLabel\"\n [(ngModel)]=\"scopeFilterValue\"\n />\n } @placeholder {\n <div class=\"h-[38px]\"></div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAkDa,sBAAsB,CAAA;AACzB,IAAA,OAAO,SAAS,GAAG,CAAC,CAAC;AAEV,IAAA,QAAQ,CAAS;AAEnB,IAAA,eAAe,GAAG,SAAS,CAA0B,SAAS,CAAC,CAAC;;AAGxE,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAGjC,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGhC,IAAA,aAAa,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;;AAGrC,IAAA,YAAY,GAAG,KAAK,CAAwB,CAAC,CAAC,CAAC;;AAG/C,IAAA,OAAO,GAAG,KAAK,CAAoC,IAAI,CAAC,CAAC;;AAGzD,IAAA,gBAAgB,GAAG,KAAK,CAA2B,EAAE,CAAC,CAAC;;AAGvD,IAAA,oBAAoB,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGzC,IAAA,gBAAgB,GAAG,KAAK,CAAW,IAAI,CAAC,CAAC;AAE/B,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAE/D,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAK;AAC5C,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9B,QACE,CAAC,CAAC,MAAM;aACP,CAAC,CAAC,MAAM,CAAC,eAAe,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,IA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ClB,wBAAwB;4BACxB,sBAAsB;AACvB,yBAAA,EAAA,QAAA,EAAA,w3GAAA,EAAA,CAAA;;;AE/CH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-scala-ng-page-header.mjs","sources":["../../projects/scala-ng/page-header/src/page-header/page-header.component.ts","../../projects/scala-ng/page-header/src/page-header/page-header.component.html","../../projects/scala-ng/page-header/seniorsistemas-scala-ng-page-header.ts"],"sourcesContent":["import { Component, computed, ElementRef, input, model, viewChild } from \"@angular/core\";\nimport { FormsModule } from \"@angular/forms\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsBreadcrumbRouterComponent } from \"@seniorsistemas/scala-ng/breadcrumb\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsSelectButtonComponent,\n type SelectButtonItem,\n} from \"@seniorsistemas/scala-ng/select-button\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\nimport { SdsTooltipDirective } from \"@seniorsistemas/scala-ng/tooltip\";\n\nexport interface SdsPageHeaderAction {\n /** Visible label. Omit for an icon-only button — `ariaLabel` becomes required in practice then. */\n label?: string;\n icon?: string;\n /** Accessible name used when the button has no visible label. */\n ariaLabel?: string;\n /** Tooltip text, also announced as the button's description; icon-only buttons fall back to `ariaLabel`. */\n tooltip?: string;\n disabled?: boolean;\n onClick: () => void;\n}\n\nexport interface SdsPageHeaderActionsConfig {\n secondaryAction?: SdsPageHeaderAction;\n primaryAction?: SdsPageHeaderAction;\n /** Ações de menor peso, agrupadas no botão \"Mais\" (a partir de 3 ações no total). */\n moreActions?: SdsTieredMenuItem[];\n}\n\n@Component({\n selector: \"sds-page-header\",\n standalone: true,\n host: {\n class:\n \"flex w-full flex-col gap-space-1 border-b border-solid border-color-border bg-surface-default px-space-2-5 py-space-2\",\n role: \"region\",\n \"[attr.aria-labelledby]\": \"_titleId\",\n },\n imports: [\n FormsModule,\n TranslatePipe,\n SdsBreadcrumbRouterComponent,\n SdsButtonComponent,\n SdsSelectButtonComponent,\n SdsTieredMenuDirective,\n SdsTooltipDirective,\n ],\n templateUrl: \"./page-header.component.html\",\n})\nexport class SdsPageHeaderComponent<T = unknown, R = unknown> {\n private static idCounter = 0;\n\n protected readonly _titleId: string;\n\n private readonly titleElementRef = viewChild<ElementRef<HTMLElement>>(\"titleEl\");\n\n /** Page title. The component's floor — always rendered, everything else here is optional. */\n readonly heading = input.required<string>();\n\n /** Supporting text below the title row; truncates to two lines. Omitted when empty. */\n readonly description = input<string>(\"\");\n\n /** Shows the automatic route breadcrumb trail (`sds-breadcrumb-router`). Turn off on top-level pages. */\n readonly hasBreadcrumb = input<boolean>(true);\n\n /** Heading level, rendered as the matching `<h1>`–`<h6>`; adjust to match the host screen's hierarchy. */\n readonly headingLevel = input<1 | 2 | 3 | 4 | 5 | 6>(1);\n\n /** Secondary/primary/\"more options\" actions, rendered left to right; the primary action never groups into \"more\". */\n readonly actions = input<SdsPageHeaderActionsConfig | null>(null);\n\n /** Scope-filter segments (`sds-select-button`) rendered below the title. Omitted when empty. */\n readonly scopeFilterItems = input<SelectButtonItem<T, R>[]>([]);\n\n /** Accessible name for the scope filter; falls back to a translated default when empty. */\n readonly scopeFilterAriaLabel = input<string>(\"\");\n\n /** Two-way bound scope-filter selection. */\n readonly scopeFilterValue = model<T | null>(null);\n\n protected readonly hasDescription = computed(() => this.description().length > 0);\n\n protected readonly hasActions = computed(() => {\n const config = this.actions();\n return (\n !!config &&\n (!!config.secondaryAction || !!config.primaryAction || (config.moreActions?.length ?? 0) > 0)\n );\n });\n\n protected readonly hasScopeFilter = computed(() => this.scopeFilterItems().length > 0);\n\n constructor() {\n SdsPageHeaderComponent.idCounter++;\n this._titleId = `sds-page-header-title-${SdsPageHeaderComponent.idCounter}`;\n }\n\n /**\n * Moves focus to the title. Call this after navigating or reloading the page's content so screen\n * readers announce the change — nothing else here signals that the page changed.\n */\n focusTitle(): void {\n this.titleElementRef()?.nativeElement.focus();\n }\n}\n","@let resolvedMoreActionsAriaLabel = \"platform.scala-ng.page_header_more_actions_label\" | translate;\n@let resolvedScopeFilterAriaLabel =\n scopeFilterAriaLabel() || (\"platform.scala-ng.page_header_scope_filter_label\" | translate);\n\n@if (hasBreadcrumb()) {\n @defer (on idle; prefetch on immediate) {\n <sds-breadcrumb-router />\n } @placeholder {\n <div class=\"h-[29px]\"></div>\n }\n}\n\n<div class=\"flex flex-col gap-space-0-75\">\n <div class=\"flex items-center gap-space-3\">\n <!-- Native heading tags instead of the ARIA heading role, so every assistive technology recognizes them. -->\n @switch (headingLevel()) {\n @default {\n <h1\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h1>\n }\n @case (2) {\n <h2\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h2>\n }\n @case (3) {\n <h3\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h3>\n }\n @case (4) {\n <h4\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h4>\n }\n @case (5) {\n <h5\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h5>\n }\n @case (6) {\n <h6\n #titleEl\n [id]=\"_titleId\"\n tabindex=\"-1\"\n class=\"min-w-0 flex-1 truncate text-font-size-6 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary outline-none\"\n [sdsTooltip]=\"heading()\"\n [sdsTooltipCheckTruncatedText]=\"true\"\n >\n {{ heading() }}\n </h6>\n }\n }\n\n @if (hasActions()) {\n @defer (on idle; prefetch on immediate) {\n <div class=\"flex shrink-0 items-center gap-space-1\">\n @if (actions()?.secondaryAction; as action) {\n <button\n sdsButton\n type=\"secondary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.primaryAction; as action) {\n <button\n sdsButton\n type=\"primary\"\n [disabled]=\"action.disabled ?? false\"\n [attr.aria-label]=\"action.label ? null : action.ariaLabel\"\n [sdsTooltip]=\"action.tooltip || (action.label ? '' : (action.ariaLabel ?? ''))\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <i\n sdsLeadingIcon\n [class]=\"action.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n @if (action.label) {\n {{ action.label }}\n }\n </button>\n }\n @if (actions()?.moreActions?.length) {\n <button\n sdsButton\n type=\"secondary\"\n [sdsTieredMenu]=\"actions()!.moreActions!\"\n [attr.aria-label]=\"resolvedMoreActionsAriaLabel\"\n [sdsTooltip]=\"resolvedMoreActionsAriaLabel\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-ellipsis-vertical\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n </div>\n } @placeholder {\n <div class=\"h-[40px] w-[40px] shrink-0\"></div>\n }\n }\n </div>\n\n @if (hasDescription()) {\n <p\n class=\"line-clamp-2 text-font-size-2 font-font-weight-regular leading-line-height-150 text-color-text-neutral-secondary\"\n >\n {{ description() }}\n </p>\n }\n</div>\n\n@if (hasScopeFilter()) {\n @defer (on idle; prefetch on immediate) {\n <sds-select-button\n [items]=\"scopeFilterItems()\"\n [ariaLabel]=\"resolvedScopeFilterAriaLabel\"\n [(ngModel)]=\"scopeFilterValue\"\n />\n } @placeholder {\n <div class=\"h-[38px]\"></div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAsDa,sBAAsB,CAAA;AACzB,IAAA,OAAO,SAAS,GAAG,CAAC,CAAC;AAEV,IAAA,QAAQ,CAAS;AAEnB,IAAA,eAAe,GAAG,SAAS,CAA0B,SAAS,CAAC,CAAC;;AAGxE,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAGnC,IAAA,WAAW,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGhC,IAAA,aAAa,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;;AAGrC,IAAA,YAAY,GAAG,KAAK,CAAwB,CAAC,CAAC,CAAC;;AAG/C,IAAA,OAAO,GAAG,KAAK,CAAoC,IAAI,CAAC,CAAC;;AAGzD,IAAA,gBAAgB,GAAG,KAAK,CAA2B,EAAE,CAAC,CAAC;;AAGvD,IAAA,oBAAoB,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGzC,IAAA,gBAAgB,GAAG,KAAK,CAAW,IAAI,CAAC,CAAC;AAE/B,IAAA,cAAc,GAAG,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,wCAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,wBAAA,CAAA,CAAA,EAAA,eAAA,EAAA,CAAA,4BAAA,EAAA,kBAAA,EAAA,sBAAA,EAAA,wBAAA,MAAA,EAAA,UAAA,EAAA,CAAA;sBApBlC,SAAS;mCACE,iBAAiB,EAAA,UAAA,EACf,IAAI,EACV,IAAA,EAAA;AACJ,4BAAA,KAAK,EACH,uHAAuH;AACzH,4BAAA,IAAI,EAAE,QAAQ;AACd,4BAAA,wBAAwB,EAAE,UAAU;yBACrC,EACQ,OAAA,EAAA;4BACP,WAAW;4BACX,aAAa;4BACb,4BAA4B;4BAC5B,kBAAkB;4BAClB,wBAAwB;4BACxB,sBAAsB;4BACtB,mBAAmB;AACpB,yBAAA,EAAA,QAAA,EAAA,41LAAA,EAAA,CAAA;;;AEnDH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
import { inject, Injector, viewChild, ElementRef, input, output, computed, effect, afterNextRender, Component } from '@angular/core';
|
|
3
|
-
import { DOCUMENT } from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
6
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng-paginator.mjs","sources":["../../projects/scala-ng/paginator/src/paginator/paginator.utils.ts","../../projects/scala-ng/paginator/src/paginator/paginator.component.ts","../../projects/scala-ng/paginator/src/paginator/paginator.component.html","../../projects/scala-ng/paginator/seniorsistemas-scala-ng-paginator.ts"],"sourcesContent":["/** Quantas páginas existem no total, dado o total de itens e o tamanho de página. Nunca menor que 1, mesmo com `totalItems` zerado. */\nexport function computePageCount(totalItems: number, pageSize: number): number {\n return Math.max(1, Math.ceil(totalItems / pageSize));\n}\n\n/**\n * Intervalo (1-based, inclusivo) de itens exibidos na página atual. `end` nunca ultrapassa\n * `totalItems` — a última página, mesmo parcial, mostra o total real de itens, não `page * pageSize`.\n */\nexport function computePageRange(\n page: number,\n pageSize: number,\n totalItems: number,\n): { start: number; end: number } {\n if (totalItems === 0) {\n return { start: 0, end: 0 };\n }\n return {\n start: (page - 1) * pageSize + 1,\n end: Math.min(page * pageSize, totalItems),\n };\n}\n","import {\n afterNextRender,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n output,\n viewChild,\n} from \"@angular/core\";\nimport { DOCUMENT } from \"@angular/common\";\nimport { FormControl, FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport { SdsInputComponent } from \"@seniorsistemas/scala-ng/input\";\nimport { SdsSelectComponent } from \"@seniorsistemas/scala-ng/select\";\nimport type { SelectOption } from \"@seniorsistemas/scala-ng/select\";\nimport type { PaginatorPageEvent } from \"./paginator.models\";\nimport { computePageCount, computePageRange } from \"./paginator.utils\";\n\n@Component({\n selector: \"sds-paginator\",\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TranslatePipe,\n SdsButtonComponent,\n SdsInputComponent,\n SdsSelectComponent,\n ],\n templateUrl: \"./paginator.component.html\",\n})\nexport class SdsPaginatorComponent {\n private readonly injector = inject(Injector);\n private readonly document = inject(DOCUMENT);\n private readonly navigation = viewChild.required<ElementRef<HTMLElement>>(\"navigation\");\n private readonly previousButton = viewChild.required(\"previousButton\", { read: ElementRef });\n private readonly nextButton = viewChild.required(\"nextButton\", { read: ElementRef });\n\n /** Navigation button the keyboard user was on, kept while focus is parked on the landmark. */\n private focusedNavigationButton: \"previous\" | \"next\" | null = null;\n\n /** Página atual, 1-based. */\n readonly page = input<number>(1);\n /** Quantidade de itens exibidos por página. */\n readonly pageSize = input<number>(10);\n /** Total de itens paginados. */\n readonly totalItems = input.required<number>();\n /** Opções exibidas no seletor \"Itens por página\". */\n readonly pageSizeOptions = input<number[]>([10, 25, 50, 100]);\n /** Quando `true`, desabilita todos os controles interativos (seletor, campo \"ir para\" e navegação). */\n readonly loading = input<boolean>(false);\n /** Exibe o texto \"Mostrando X-Y de Z itens\". */\n readonly showCounter = input<boolean>(true);\n /** Exibe o seletor \"Itens por página\". */\n readonly showPageSize = input<boolean>(true);\n /** Exibe o campo \"Ir para\" (navegação direta por número de página). */\n readonly showJumpToPage = input<boolean>(true);\n /** Exibe o texto \"Página X de Y\". */\n readonly showPageIndicator = input<boolean>(true);\n\n /** Emitido ao navegar (anterior/próximo/ir-para) ou trocar o tamanho de página. */\n readonly pageChange = output<PaginatorPageEvent>();\n\n protected readonly pageCount = computed(() =>\n computePageCount(this.totalItems(), this.pageSize()),\n );\n protected readonly isFirstPage = computed(() => this.page() <= 1);\n protected readonly isLastPage = computed(() => this.page() >= this.pageCount());\n protected readonly isPreviousDisabled = computed(() => this.isFirstPage() || this.loading());\n protected readonly isNextDisabled = computed(() => this.isLastPage() || this.loading());\n protected readonly pageRange = computed(() =>\n computePageRange(this.page(), this.pageSize(), this.totalItems()),\n );\n\n protected readonly pageSizeSelectOptions = computed<SelectOption<number>[]>(() =>\n this.pageSizeOptions().map((size) => ({ label: String(size), value: size })),\n );\n\n protected readonly jumpControl = new FormControl(String(this.page()), { nonNullable: true });\n\n constructor() {\n // `FormControl#setValue`/`enable`/`disable` synchronously call the bound `sds-input`'s CVA\n // methods (`writeValue`/`setDisabledState`), which write to that component's own signals —\n // a one-directional, non-cyclic side effect these two effects exist specifically to cause,\n // so `allowSignalWrites` is the sanctioned escape hatch here, not a footgun.\n effect(\n () => {\n const page = String(this.page());\n if (this.jumpControl.value !== page) {\n this.jumpControl.setValue(page, { emitEvent: false });\n }\n },\n { allowSignalWrites: true },\n );\n effect(\n () => {\n if (this.loading()) {\n this.jumpControl.disable({ emitEvent: false });\n } else {\n this.jumpControl.enable({ emitEvent: false });\n }\n },\n { allowSignalWrites: true },\n );\n // A natively disabled button drops focus to <body>; keep it inside the paginator instead.\n effect(() => {\n this.isPreviousDisabled();\n this.isNextDisabled();\n afterNextRender(() => this.keepNavigationFocus(), { injector: this.injector });\n });\n }\n\n protected _onPrev(): void {\n if (this.isFirstPage() || this.loading()) {\n return;\n }\n this.pageChange.emit({ page: this.page() - 1, pageSize: this.pageSize() });\n }\n\n protected _onNext(): void {\n if (this.isLastPage() || this.loading()) {\n return;\n }\n this.pageChange.emit({ page: this.page() + 1, pageSize: this.pageSize() });\n }\n\n protected _onFocusIn(event: FocusEvent): void {\n if (event.target === this.previousButton().nativeElement) {\n this.focusedNavigationButton = \"previous\";\n } else if (event.target === this.nextButton().nativeElement) {\n this.focusedNavigationButton = \"next\";\n } else if (event.target !== this.navigation().nativeElement) {\n this.focusedNavigationButton = null;\n }\n }\n\n protected _onFocusOut(event: FocusEvent): void {\n const blurredElement = event.target as HTMLElement;\n // Focus lost because the button was just disabled, not because the user moved away.\n if (blurredElement instanceof HTMLButtonElement && blurredElement.disabled) {\n return;\n }\n const nextTarget = event.relatedTarget;\n if (!(nextTarget instanceof Node && this.navigation().nativeElement.contains(nextTarget))) {\n this.focusedNavigationButton = null;\n }\n }\n\n private keepNavigationFocus(): void {\n if (this.focusedNavigationButton === null) {\n return;\n }\n const previousButton: HTMLButtonElement = this.previousButton().nativeElement;\n const nextButton: HTMLButtonElement = this.nextButton().nativeElement;\n const navigation = this.navigation().nativeElement;\n const lastButton = this.focusedNavigationButton === \"previous\" ? previousButton : nextButton;\n const otherButton = lastButton === previousButton ? nextButton : previousButton;\n const activeElement = this.document.activeElement;\n const focusIsLost =\n activeElement === null ||\n activeElement === this.document.body ||\n activeElement === navigation ||\n (activeElement === lastButton && lastButton.disabled);\n if (!focusIsLost) {\n return;\n }\n const target = [lastButton, otherButton].find((button) => !button.disabled) ?? navigation;\n if (target !== activeElement) {\n target.focus();\n }\n }\n\n protected _onPageSizeSelect(newSize: number): void {\n this.pageChange.emit({ page: 1, pageSize: newSize });\n }\n\n private static readonly JUMP_ALLOWED_KEYS = new Set([\n \"Backspace\",\n \"Delete\",\n \"Tab\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"Escape\",\n ]);\n\n protected _onJumpKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._onJumpCommit();\n return;\n }\n const isDigit = /^\\d$/.test(event.key);\n const isAllowed =\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n isDigit ||\n SdsPaginatorComponent.JUMP_ALLOWED_KEYS.has(event.key);\n if (!isAllowed) {\n event.preventDefault();\n }\n }\n\n protected _onJumpCommit(): void {\n const parsed = Number.parseInt(this.jumpControl.value, 10);\n if (Number.isNaN(parsed)) {\n this.jumpControl.setValue(String(this.page()), { emitEvent: false });\n return;\n }\n const clamped = Math.min(Math.max(parsed, 1), this.pageCount());\n if (clamped === this.page()) {\n this.jumpControl.setValue(String(this.page()), { emitEvent: false });\n return;\n }\n this.pageChange.emit({ page: clamped, pageSize: this.pageSize() });\n }\n}\n","<nav\n #navigation\n class=\"flex w-full flex-wrap items-center gap-space-2 focus:outline-none\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'platform.scala-ng.paginator_navigation_label' | translate\"\n (focusin)=\"_onFocusIn($event)\"\n (focusout)=\"_onFocusOut($event)\"\n>\n @if (showCounter()) {\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{\n \"platform.scala-ng.paginator_showing\"\n | translate: { first: pageRange().start, last: pageRange().end, total: totalItems() }\n }}\n </span>\n }\n\n <div class=\"min-w-space-2 flex-1\"></div>\n\n @if (showPageSize()) {\n <div class=\"flex items-center gap-space-1\">\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{ \"platform.scala-ng.paginator_items_per_page\" | translate }}:\n </span>\n <div class=\"w-20\">\n <sds-select\n size=\"small\"\n [showLabel]=\"false\"\n [showHelper]=\"false\"\n [label]=\"'platform.scala-ng.paginator_items_per_page' | translate\"\n [options]=\"pageSizeSelectOptions()\"\n [disabled]=\"loading()\"\n [ngModel]=\"pageSize()\"\n (ngModelChange)=\"_onPageSizeSelect($event)\"\n />\n </div>\n </div>\n }\n\n @if (showJumpToPage()) {\n <div class=\"flex items-center gap-space-1\">\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{ \"platform.scala-ng.paginator_go_to_page\" | translate }}:\n </span>\n <sds-input\n size=\"small\"\n [label]=\"'platform.scala-ng.paginator_go_to_page_aria' | translate\"\n [showLabel]=\"false\"\n [showHelper]=\"false\"\n type=\"text\"\n inputMode=\"numeric\"\n containerClassName=\"w-16\"\n [formControl]=\"jumpControl\"\n (inputKeydown)=\"_onJumpKeydown($event)\"\n (focusOut)=\"_onJumpCommit()\"\n />\n </div>\n }\n\n <button\n #previousButton\n sdsButton\n type=\"ghost\"\n size=\"small\"\n [disabled]=\"isPreviousDisabled()\"\n (click)=\"_onPrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n {{ \"platform.scala-ng.paginator_previous\" | translate }}\n </button>\n\n @if (showPageIndicator()) {\n <span\n class=\"min-w-[120px] whitespace-nowrap text-center text-font-size-2 text-color-text-neutral-secondary\"\n >\n {{ \"platform.scala-ng.paginator_page_of\" | translate: { page: page(), total: pageCount() } }}\n </span>\n }\n\n <button\n #nextButton\n sdsButton\n type=\"ghost\"\n size=\"small\"\n [disabled]=\"isNextDisabled()\"\n (click)=\"_onNext()\"\n >\n {{ \"platform.scala-ng.paginator_next\" | translate }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=\"true\"\n ></i>\n </button>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mapp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EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,6MACnB,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,kBAAkB,EAClB,QAAA,EAAA,iCAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,iBAAiB,yoBACjB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,aAAA,EAAA,OAAA,EAAA,cAAA,EAAA,UAAA,EAAA,YAAA,EAAA,MAAA,EAAA,UAAA,EAAA,eAAA,EAAA,UAAA,EAAA,UAAA,EAAA,aAAA,EAAA,WAAA,EAAA,YAAA,EAAA,YAAA,EAAA,mBAAA,EAAA,UAAA,EAAA,eAAA,EAAA,cAAA,EAAA,SAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIT,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;+BACE,eAAe,EAAA,UAAA,EACb,IAAI,EACP,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,aAAa;wBACb,kBAAkB;wBAClB,iBAAiB;wBACjB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EAAA,i9FAAA,EAAA,CAAA;;;AEhCH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-scala-ng-paginator.mjs","sources":["../../projects/scala-ng/paginator/src/paginator/paginator.utils.ts","../../projects/scala-ng/paginator/src/paginator/paginator.component.ts","../../projects/scala-ng/paginator/src/paginator/paginator.component.html","../../projects/scala-ng/paginator/seniorsistemas-scala-ng-paginator.ts"],"sourcesContent":["/** Quantas páginas existem no total, dado o total de itens e o tamanho de página. Nunca menor que 1, mesmo com `totalItems` zerado. */\nexport function computePageCount(totalItems: number, pageSize: number): number {\n return Math.max(1, Math.ceil(totalItems / pageSize));\n}\n\n/**\n * Intervalo (1-based, inclusivo) de itens exibidos na página atual. `end` nunca ultrapassa\n * `totalItems` — a última página, mesmo parcial, mostra o total real de itens, não `page * pageSize`.\n */\nexport function computePageRange(\n page: number,\n pageSize: number,\n totalItems: number,\n): { start: number; end: number } {\n if (totalItems === 0) {\n return { start: 0, end: 0 };\n }\n return {\n start: (page - 1) * pageSize + 1,\n end: Math.min(page * pageSize, totalItems),\n };\n}\n","import { DOCUMENT } from \"@angular/common\";\nimport {\n afterNextRender,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n output,\n viewChild,\n} from \"@angular/core\";\nimport { FormControl, FormsModule, ReactiveFormsModule } from \"@angular/forms\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport { SdsInputComponent } from \"@seniorsistemas/scala-ng/input\";\nimport type { SelectOption } from \"@seniorsistemas/scala-ng/select\";\nimport { SdsSelectComponent } from \"@seniorsistemas/scala-ng/select\";\nimport type { PaginatorPageEvent } from \"./paginator.models\";\nimport { computePageCount, computePageRange } from \"./paginator.utils\";\n\n@Component({\n selector: \"sds-paginator\",\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n TranslatePipe,\n SdsButtonComponent,\n SdsInputComponent,\n SdsSelectComponent,\n ],\n templateUrl: \"./paginator.component.html\",\n})\nexport class SdsPaginatorComponent {\n private readonly injector = inject(Injector);\n private readonly document = inject(DOCUMENT);\n private readonly navigation = viewChild.required<ElementRef<HTMLElement>>(\"navigation\");\n private readonly previousButton = viewChild.required(\"previousButton\", { read: ElementRef });\n private readonly nextButton = viewChild.required(\"nextButton\", { read: ElementRef });\n\n /** Navigation button the keyboard user was on, kept while focus is parked on the landmark. */\n private focusedNavigationButton: \"previous\" | \"next\" | null = null;\n\n /** Página atual, 1-based. */\n readonly page = input<number>(1);\n /** Quantidade de itens exibidos por página. */\n readonly pageSize = input<number>(10);\n /** Total de itens paginados. */\n readonly totalItems = input.required<number>();\n /** Opções exibidas no seletor \"Itens por página\". */\n readonly pageSizeOptions = input<number[]>([10, 25, 50, 100]);\n /** Quando `true`, desabilita todos os controles interativos (seletor, campo \"ir para\" e navegação). */\n readonly loading = input<boolean>(false);\n /** Exibe o texto \"Mostrando X-Y de Z itens\". */\n readonly showCounter = input<boolean>(true);\n /** Exibe o seletor \"Itens por página\". */\n readonly showPageSize = input<boolean>(true);\n /** Exibe o campo \"Ir para\" (navegação direta por número de página). */\n readonly showJumpToPage = input<boolean>(true);\n /** Exibe o texto \"Página X de Y\". */\n readonly showPageIndicator = input<boolean>(true);\n\n /** Emitido ao navegar (anterior/próximo/ir-para) ou trocar o tamanho de página. */\n readonly pageChange = output<PaginatorPageEvent>();\n\n protected readonly pageCount = computed(() =>\n computePageCount(this.totalItems(), this.pageSize()),\n );\n protected readonly isFirstPage = computed(() => this.page() <= 1);\n protected readonly isLastPage = computed(() => this.page() >= this.pageCount());\n protected readonly isPreviousDisabled = computed(() => this.isFirstPage() || this.loading());\n protected readonly isNextDisabled = computed(() => this.isLastPage() || this.loading());\n protected readonly pageRange = computed(() =>\n computePageRange(this.page(), this.pageSize(), this.totalItems()),\n );\n\n protected readonly pageSizeSelectOptions = computed<SelectOption<number>[]>(() =>\n this.pageSizeOptions().map((size) => ({ label: String(size), value: size })),\n );\n\n protected readonly jumpControl = new FormControl(String(this.page()), { nonNullable: true });\n\n constructor() {\n // `FormControl#setValue`/`enable`/`disable` synchronously call the bound `sds-input`'s CVA\n // methods (`writeValue`/`setDisabledState`), which write to that component's own signals —\n // a one-directional, non-cyclic side effect these two effects exist specifically to cause,\n // so `allowSignalWrites` is the sanctioned escape hatch here, not a footgun.\n effect(\n () => {\n const page = String(this.page());\n if (this.jumpControl.value !== page) {\n this.jumpControl.setValue(page, { emitEvent: false });\n }\n },\n { allowSignalWrites: true },\n );\n effect(\n () => {\n if (this.loading()) {\n this.jumpControl.disable({ emitEvent: false });\n } else {\n this.jumpControl.enable({ emitEvent: false });\n }\n },\n { allowSignalWrites: true },\n );\n // A natively disabled button drops focus to <body>; keep it inside the paginator instead.\n effect(() => {\n this.isPreviousDisabled();\n this.isNextDisabled();\n afterNextRender(() => this.keepNavigationFocus(), { injector: this.injector });\n });\n }\n\n protected _onPrev(): void {\n if (this.isFirstPage() || this.loading()) {\n return;\n }\n this.pageChange.emit({ page: this.page() - 1, pageSize: this.pageSize() });\n }\n\n protected _onNext(): void {\n if (this.isLastPage() || this.loading()) {\n return;\n }\n this.pageChange.emit({ page: this.page() + 1, pageSize: this.pageSize() });\n }\n\n protected _onFocusIn(event: FocusEvent): void {\n if (event.target === this.previousButton().nativeElement) {\n this.focusedNavigationButton = \"previous\";\n } else if (event.target === this.nextButton().nativeElement) {\n this.focusedNavigationButton = \"next\";\n } else if (event.target !== this.navigation().nativeElement) {\n this.focusedNavigationButton = null;\n }\n }\n\n protected _onFocusOut(event: FocusEvent): void {\n const blurredElement = event.target as HTMLElement;\n // Focus lost because the button was just disabled, not because the user moved away.\n if (blurredElement instanceof HTMLButtonElement && blurredElement.disabled) {\n return;\n }\n const nextTarget = event.relatedTarget;\n if (!(nextTarget instanceof Node && this.navigation().nativeElement.contains(nextTarget))) {\n this.focusedNavigationButton = null;\n }\n }\n\n private keepNavigationFocus(): void {\n if (this.focusedNavigationButton === null) {\n return;\n }\n const previousButton: HTMLButtonElement = this.previousButton().nativeElement;\n const nextButton: HTMLButtonElement = this.nextButton().nativeElement;\n const navigation = this.navigation().nativeElement;\n const lastButton = this.focusedNavigationButton === \"previous\" ? previousButton : nextButton;\n const otherButton = lastButton === previousButton ? nextButton : previousButton;\n const activeElement = this.document.activeElement;\n const focusIsLost =\n activeElement === null ||\n activeElement === this.document.body ||\n activeElement === navigation ||\n (activeElement === lastButton && lastButton.disabled);\n if (!focusIsLost) {\n return;\n }\n const target = [lastButton, otherButton].find((button) => !button.disabled) ?? navigation;\n if (target !== activeElement) {\n target.focus();\n }\n }\n\n protected _onPageSizeSelect(newSize: number): void {\n this.pageChange.emit({ page: 1, pageSize: newSize });\n }\n\n private static readonly JUMP_ALLOWED_KEYS = new Set([\n \"Backspace\",\n \"Delete\",\n \"Tab\",\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"Escape\",\n ]);\n\n protected _onJumpKeydown(event: KeyboardEvent): void {\n if (event.key === \"Enter\") {\n event.preventDefault();\n this._onJumpCommit();\n return;\n }\n const isDigit = /^\\d$/.test(event.key);\n const isAllowed =\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n isDigit ||\n SdsPaginatorComponent.JUMP_ALLOWED_KEYS.has(event.key);\n if (!isAllowed) {\n event.preventDefault();\n }\n }\n\n protected _onJumpCommit(): void {\n const parsed = Number.parseInt(this.jumpControl.value, 10);\n if (Number.isNaN(parsed)) {\n this.jumpControl.setValue(String(this.page()), { emitEvent: false });\n return;\n }\n const clamped = Math.min(Math.max(parsed, 1), this.pageCount());\n if (clamped === this.page()) {\n this.jumpControl.setValue(String(this.page()), { emitEvent: false });\n return;\n }\n this.pageChange.emit({ page: clamped, pageSize: this.pageSize() });\n }\n}\n","<nav\n #navigation\n class=\"flex w-full flex-wrap items-center gap-space-2 focus:outline-none\"\n tabindex=\"-1\"\n [attr.aria-label]=\"'platform.scala-ng.paginator_navigation_label' | translate\"\n (focusin)=\"_onFocusIn($event)\"\n (focusout)=\"_onFocusOut($event)\"\n>\n @if (showCounter()) {\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{\n \"platform.scala-ng.paginator_showing\"\n | translate: { first: pageRange().start, last: pageRange().end, total: totalItems() }\n }}\n </span>\n }\n\n <div class=\"min-w-space-2 flex-1\"></div>\n\n @if (showPageSize()) {\n <div class=\"flex items-center gap-space-1\">\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{ \"platform.scala-ng.paginator_items_per_page\" | translate }}:\n </span>\n <div class=\"w-20\">\n <sds-select\n size=\"small\"\n [showLabel]=\"false\"\n [showHelper]=\"false\"\n [label]=\"'platform.scala-ng.paginator_items_per_page' | translate\"\n [options]=\"pageSizeSelectOptions()\"\n [disabled]=\"loading()\"\n [ngModel]=\"pageSize()\"\n (ngModelChange)=\"_onPageSizeSelect($event)\"\n />\n </div>\n </div>\n }\n\n @if (showJumpToPage()) {\n <div class=\"flex items-center gap-space-1\">\n <span class=\"whitespace-nowrap text-font-size-2 text-color-text-neutral-secondary\">\n {{ \"platform.scala-ng.paginator_go_to_page\" | translate }}:\n </span>\n <sds-input\n size=\"small\"\n [label]=\"'platform.scala-ng.paginator_go_to_page_aria' | translate\"\n [showLabel]=\"false\"\n [showHelper]=\"false\"\n type=\"text\"\n inputMode=\"numeric\"\n containerClassName=\"w-16\"\n [formControl]=\"jumpControl\"\n (inputKeydown)=\"_onJumpKeydown($event)\"\n (focusOut)=\"_onJumpCommit()\"\n />\n </div>\n }\n\n <button\n #previousButton\n sdsButton\n type=\"ghost\"\n size=\"small\"\n [disabled]=\"isPreviousDisabled()\"\n (click)=\"_onPrev()\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-left text-xs\"\n aria-hidden=\"true\"\n ></i>\n {{ \"platform.scala-ng.paginator_previous\" | translate }}\n </button>\n\n @if (showPageIndicator()) {\n <span\n class=\"min-w-[120px] whitespace-nowrap text-center text-font-size-2 text-color-text-neutral-secondary\"\n >\n {{ \"platform.scala-ng.paginator_page_of\" | translate: { page: page(), total: pageCount() } }}\n </span>\n }\n\n <button\n #nextButton\n sdsButton\n type=\"ghost\"\n size=\"small\"\n [disabled]=\"isNextDisabled()\"\n (click)=\"_onNext()\"\n >\n {{ \"platform.scala-ng.paginator_next\" | translate }}\n <i\n sdsTrailingIcon\n class=\"fa-solid fa-chevron-right text-xs\"\n aria-hidden=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,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,mBAAmB,6MACnB,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACb,kBAAkB,EAClB,QAAA,EAAA,iCAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,iBAAiB,yoBACjB,kBAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,aAAA,EAAA,OAAA,EAAA,cAAA,EAAA,UAAA,EAAA,YAAA,EAAA,MAAA,EAAA,UAAA,EAAA,eAAA,EAAA,UAAA,EAAA,UAAA,EAAA,aAAA,EAAA,WAAA,EAAA,YAAA,EAAA,YAAA,EAAA,mBAAA,EAAA,UAAA,EAAA,eAAA,EAAA,cAAA,EAAA,SAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIT,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;+BACE,eAAe,EAAA,UAAA,EACb,IAAI,EACP,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,aAAa;wBACb,kBAAkB;wBAClB,iBAAiB;wBACjB,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EAAA,i9FAAA,EAAA,CAAA;;;AEhCH;;AAEG;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { input, model, output, contentChild, computed, signal, Component } from '@angular/core';
|
|
4
|
+
import { TranslatePipe } from '@ngx-translate/core';
|
|
4
5
|
import { SdsButtonComponent } from '@seniorsistemas/scala-ng/button';
|
|
5
6
|
import { SdsContentLifecycleComponent } from '@seniorsistemas/scala-ng/content-lifecycle';
|
|
6
7
|
import { SdsTieredMenuDirective } from '@seniorsistemas/scala-ng/tiered-menu';
|
|
7
|
-
import { TranslatePipe } from '@ngx-translate/core';
|
|
8
8
|
|
|
9
9
|
class SdsPanelComponent {
|
|
10
10
|
static idCounter = 0;
|
|
@@ -93,7 +93,7 @@ class SdsPanelComponent {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsPanelComponent, isStandalone: true, selector: "sds-panel", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: true, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, tertiaryLabel: { classPropertyName: "tertiaryLabel", publicName: "tertiaryLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryLabel: { classPropertyName: "secondaryLabel", publicName: "secondaryLabel", isSignal: true, isRequired: false, transformFunction: null }, primaryLabel: { classPropertyName: "primaryLabel", publicName: "primaryLabel", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, headerActionMenuItems: { classPropertyName: "headerActionMenuItems", publicName: "headerActionMenuItems", isSignal: true, isRequired: false, transformFunction: null }, contentLifecycle: { classPropertyName: "contentLifecycle", publicName: "contentLifecycle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange", tertiaryClick: "tertiaryClick", secondaryClick: "secondaryClick", primaryClick: "primaryClick", headerActionClick: "headerActionClick" }, host: { attributes: { "role": "region" }, properties: { "attr.aria-label": "heading()" }, classAttribute: "block" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border
|
|
96
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: SdsPanelComponent, isStandalone: true, selector: "sds-panel", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: true, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, tertiaryLabel: { classPropertyName: "tertiaryLabel", publicName: "tertiaryLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryLabel: { classPropertyName: "secondaryLabel", publicName: "secondaryLabel", isSignal: true, isRequired: false, transformFunction: null }, primaryLabel: { classPropertyName: "primaryLabel", publicName: "primaryLabel", isSignal: true, isRequired: false, transformFunction: null }, headerAction: { classPropertyName: "headerAction", publicName: "headerAction", isSignal: true, isRequired: false, transformFunction: null }, headerActionMenuItems: { classPropertyName: "headerActionMenuItems", publicName: "headerActionMenuItems", isSignal: true, isRequired: false, transformFunction: null }, contentLifecycle: { classPropertyName: "contentLifecycle", publicName: "contentLifecycle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expanded: "expandedChange", tertiaryClick: "tertiaryClick", secondaryClick: "secondaryClick", primaryClick: "primaryClick", headerActionClick: "headerActionClick" }, host: { attributes: { "role": "region" }, properties: { "attr.aria-label": "heading()" }, classAttribute: "block" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "bodyTemplate", first: true, predicate: ["body"], descendants: true, isSignal: true }, { propertyName: "footerTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border bg-surface-default outline-2 outline-offset-[-1px] outline-color-border-focused\"\n [class.outline]=\"isToggleFocused()\"\n>\n <div\n class=\"flex h-[48px] w-full shrink-0 items-center border-color-border px-space-2 transition-colors duration-200\"\n [class.border-b]=\"isBodyVisible()\"\n [class.cursor-pointer]=\"collapsible()\"\n role=\"presentation\"\n (click)=\"onHeaderClick()\"\n >\n <div class=\"flex w-full items-center gap-space-1\">\n @if (collapsible()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-none\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"_bodyId\"\n [attr.aria-label]=\"\n (expanded() ? 'platform.scala-ng.panel_collapse' : 'platform.scala-ng.panel_expand')\n | translate\n \"\n (focus)=\"handleToggleFocus($event)\"\n (blur)=\"isToggleFocused.set(false)\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down transition-transform duration-150\"\n [class.rotate-180]=\"expanded()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n\n @if (headerTemplate(); as template) {\n <div class=\"min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"template\" />\n </div>\n } @else {\n <p\n class=\"min-w-0 flex-1 break-words font-inter text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >\n {{ heading() }}\n </p>\n }\n\n @if (hasHeaderAction()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-offset-[-2px]\"\n [sdsTieredMenu]=\"headerActionMenuItems()\"\n [attr.aria-label]=\"headerAction()?.ariaLabel || null\"\n (click)=\"$event.stopPropagation(); onHeaderActionClick()\"\n >\n {{ headerAction()?.label }}\n @if (headerAction()?.icon; as icon) {\n <i\n sdsTrailingIcon\n [class]=\"icon\"\n aria-hidden=\"true\"\n ></i>\n }\n </button>\n }\n </div>\n </div>\n\n <div\n [id]=\"_bodyId\"\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-in-out\"\n [class]=\"collapseRowsClass()\"\n [attr.inert]=\"isBodyVisible() ? null : ''\"\n (transitionend)=\"onCollapseTransitionEnd($event, bodyContent)\"\n >\n <div class=\"min-h-0 overflow-hidden\">\n <div class=\"flex w-full flex-col gap-space-2-5 p-space-2\">\n <sds-content-lifecycle\n #bodyContent\n [bodyTemplate]=\"bodyTemplate()\"\n [visible]=\"isBodyVisible()\"\n [contentLifecycle]=\"contentLifecycle()\"\n >\n <ng-content />\n </sds-content-lifecycle>\n </div>\n\n @if (hasFooter()) {\n <hr class=\"m-0 border-t border-color-border\" />\n <div class=\"flex w-full items-center justify-end gap-space-1-5 p-space-2\">\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n @if (tertiaryLabel()) {\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"tertiaryClick.emit()\"\n >\n {{ tertiaryLabel() }}\n </button>\n }\n @if (secondaryLabel()) {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"secondaryClick.emit()\"\n >\n {{ secondaryLabel() }}\n </button>\n }\n @if (primaryLabel()) {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"primaryClick.emit()\"\n >\n {{ primaryLabel() }}\n </button>\n }\n }\n </div>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdsButtonComponent, selector: "button[sdsButton], a[sdsButton]", inputs: ["type", "destructive", "disabled", "size"] }, { kind: "component", type: SdsContentLifecycleComponent, selector: "sds-content-lifecycle", inputs: ["bodyTemplate", "visible", "contentLifecycle"] }, { kind: "directive", type: SdsTieredMenuDirective, selector: "button[sdsTieredMenu], a[sdsTieredMenu]", inputs: ["sdsTieredMenu", "sdsTieredMenuHeader", "ariaLabel", "secondaryActionLabel", "primaryActionLabel"], outputs: ["secondaryAction", "primaryAction"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
97
97
|
}
|
|
98
98
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsPanelComponent, decorators: [{
|
|
99
99
|
type: Component,
|
|
@@ -107,7 +107,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
107
107
|
SdsContentLifecycleComponent,
|
|
108
108
|
SdsTieredMenuDirective,
|
|
109
109
|
TranslatePipe,
|
|
110
|
-
], template: "<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border
|
|
110
|
+
], template: "<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border bg-surface-default outline-2 outline-offset-[-1px] outline-color-border-focused\"\n [class.outline]=\"isToggleFocused()\"\n>\n <div\n class=\"flex h-[48px] w-full shrink-0 items-center border-color-border px-space-2 transition-colors duration-200\"\n [class.border-b]=\"isBodyVisible()\"\n [class.cursor-pointer]=\"collapsible()\"\n role=\"presentation\"\n (click)=\"onHeaderClick()\"\n >\n <div class=\"flex w-full items-center gap-space-1\">\n @if (collapsible()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-none\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"_bodyId\"\n [attr.aria-label]=\"\n (expanded() ? 'platform.scala-ng.panel_collapse' : 'platform.scala-ng.panel_expand')\n | translate\n \"\n (focus)=\"handleToggleFocus($event)\"\n (blur)=\"isToggleFocused.set(false)\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down transition-transform duration-150\"\n [class.rotate-180]=\"expanded()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n\n @if (headerTemplate(); as template) {\n <div class=\"min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"template\" />\n </div>\n } @else {\n <p\n class=\"min-w-0 flex-1 break-words font-inter text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >\n {{ heading() }}\n </p>\n }\n\n @if (hasHeaderAction()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-offset-[-2px]\"\n [sdsTieredMenu]=\"headerActionMenuItems()\"\n [attr.aria-label]=\"headerAction()?.ariaLabel || null\"\n (click)=\"$event.stopPropagation(); onHeaderActionClick()\"\n >\n {{ headerAction()?.label }}\n @if (headerAction()?.icon; as icon) {\n <i\n sdsTrailingIcon\n [class]=\"icon\"\n aria-hidden=\"true\"\n ></i>\n }\n </button>\n }\n </div>\n </div>\n\n <div\n [id]=\"_bodyId\"\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-in-out\"\n [class]=\"collapseRowsClass()\"\n [attr.inert]=\"isBodyVisible() ? null : ''\"\n (transitionend)=\"onCollapseTransitionEnd($event, bodyContent)\"\n >\n <div class=\"min-h-0 overflow-hidden\">\n <div class=\"flex w-full flex-col gap-space-2-5 p-space-2\">\n <sds-content-lifecycle\n #bodyContent\n [bodyTemplate]=\"bodyTemplate()\"\n [visible]=\"isBodyVisible()\"\n [contentLifecycle]=\"contentLifecycle()\"\n >\n <ng-content />\n </sds-content-lifecycle>\n </div>\n\n @if (hasFooter()) {\n <hr class=\"m-0 border-t border-color-border\" />\n <div class=\"flex w-full items-center justify-end gap-space-1-5 p-space-2\">\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n @if (tertiaryLabel()) {\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"tertiaryClick.emit()\"\n >\n {{ tertiaryLabel() }}\n </button>\n }\n @if (secondaryLabel()) {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"secondaryClick.emit()\"\n >\n {{ secondaryLabel() }}\n </button>\n }\n @if (primaryLabel()) {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"primaryClick.emit()\"\n >\n {{ primaryLabel() }}\n </button>\n }\n }\n </div>\n }\n </div>\n </div>\n</div>\n" }]
|
|
111
111
|
}], ctorParameters: () => [] });
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-scala-ng-panel.mjs","sources":["../../projects/scala-ng/panel/src/panel/panel.component.ts","../../projects/scala-ng/panel/src/panel/panel.component.html","../../projects/scala-ng/panel/seniorsistemas-scala-ng-panel.ts"],"sourcesContent":["import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n computed,\n contentChild,\n input,\n model,\n output,\n signal,\n TemplateRef,\n} from \"@angular/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsContentLifecycleComponent,\n type ContentLifecycleHost,\n type ContentLifecycleMode,\n} from \"@seniorsistemas/scala-ng/content-lifecycle\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\n\n/**\n * Configuração do botão de ação do header. `label`, `icon` e `ariaLabel` descrevem o mesmo botão\n * renderizado na tela, agrupados num único objeto em vez de três inputs soltos. Todos opcionais:\n * `label` vazio = botão icon-only (nesse caso `ariaLabel` é obrigatório na prática, já que sem\n * texto visível o botão não tem nome acessível a menos que `ariaLabel` seja informado).\n */\nexport interface SdsPanelHeaderAction {\n label?: string;\n icon?: string;\n ariaLabel?: string;\n}\n\n@Component({\n selector: \"sds-panel\",\n standalone: true,\n host: {\n class: \"block\",\n role: \"region\",\n \"[attr.aria-label]\": \"heading()\",\n },\n imports: [\n NgTemplateOutlet,\n SdsButtonComponent,\n SdsContentLifecycleComponent,\n SdsTieredMenuDirective,\n TranslatePipe,\n ],\n templateUrl: \"./panel.component.html\",\n})\nexport class SdsPanelComponent implements ContentLifecycleHost {\n private static idCounter = 0;\n\n protected readonly _id: string;\n protected readonly _bodyId: string;\n\n /** Panel heading, also the region's `aria-label` even when `#header` is overridden. */\n readonly heading = input.required<string>();\n\n /** Shows the expand/collapse toggle in the header. */\n readonly collapsible = input<boolean>(false);\n\n /** Whether the panel is expanded. Only has an effect when `collapsible` is `true`. */\n readonly expanded = model<boolean>(true);\n\n /** Label of the footer tertiary (ghost) button; the button shows only when non-empty. */\n readonly tertiaryLabel = input<string>(\"\");\n\n /** Label of the footer secondary button; the button shows only when non-empty. */\n readonly secondaryLabel = input<string>(\"\");\n\n /** Label of the footer primary button; the button shows only when non-empty. */\n readonly primaryLabel = input<string>(\"\");\n\n /** Emits when the footer tertiary button is clicked. */\n readonly tertiaryClick = output<void>();\n\n /** Emits when the footer secondary button is clicked. */\n readonly secondaryClick = output<void>();\n\n /** Emits when the footer primary button is clicked. */\n readonly primaryClick = output<void>();\n\n /** Header action button config; the button shows when `label` is non-empty or `headerActionMenuItems` is set. */\n readonly headerAction = input<SdsPanelHeaderAction | null>(null);\n\n /**\n * Tiered menu items opened by the header action button.\n * When set, clicking opens the menu instead of emitting `headerActionClick`.\n */\n readonly headerActionMenuItems = input<SdsTieredMenuItem[]>([]);\n\n /** Emits when the header action button is clicked and `headerActionMenuItems` is empty. */\n readonly headerActionClick = output<void>();\n\n /**\n * Replaces only the header title; the toggle and action button are still rendered.\n * When `collapsible`, the whole header toggles on click, so interactive elements\n * inside need `$event.stopPropagation()`.\n */\n protected readonly headerTemplate = contentChild<TemplateRef<void>>(\"header\");\n\n /** Replaces the body; falls back to `ng-content`. */\n protected readonly bodyTemplate = contentChild<TemplateRef<void>>(\"body\");\n\n /**\n * Controls when the `#body` template is created/destroyed: `\"always\"` (mounted up front),\n * `\"lazy\"` (mounted on first expand) or `\"destroy\"` (destroyed after each collapse animation).\n * Values other than `\"always\"` require `#body`, since plain `ng-content` can't be controlled.\n */\n readonly contentLifecycle = input<ContentLifecycleMode>(\"always\");\n\n /** Replaces the default footer buttons. */\n protected readonly footerTemplate = contentChild<TemplateRef<void>>(\"footer\");\n\n protected readonly isBodyVisible = computed(() => !this.collapsible() || this.expanded());\n\n protected readonly hasFooter = computed(\n () =>\n !!this.tertiaryLabel() ||\n !!this.secondaryLabel() ||\n !!this.primaryLabel() ||\n !!this.footerTemplate(),\n );\n\n protected readonly hasHeaderAction = computed(\n () => !!this.headerAction()?.label || this.headerActionMenuItems().length > 0,\n );\n\n protected readonly collapseRowsClass = computed(() =>\n this.isBodyVisible() ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\",\n );\n\n /** Keyboard focus on the toggle; the focus outline is drawn on the whole panel, per the DS spec. */\n protected readonly isToggleFocused = signal(false);\n\n constructor() {\n SdsPanelComponent.idCounter++;\n this._id = `sds-panel-${SdsPanelComponent.idCounter}`;\n this._bodyId = `${this._id}-body`;\n }\n\n /** Tells the content lifecycle the collapse animation ended, so `\"destroy\"` mode can unmount the body. */\n protected onCollapseTransitionEnd(\n event: TransitionEvent,\n bodyContent: SdsContentLifecycleComponent,\n ): void {\n const isOwnGridTransition =\n event.target === event.currentTarget && event.propertyName === \"grid-template-rows\";\n if (isOwnGridTransition) {\n bodyContent.notifyCollapseTransitionEnd();\n }\n }\n\n protected toggle(): void {\n this.expanded.set(!this.expanded());\n }\n\n /** Mouse clicks also focus the toggle; only keyboard focus (`:focus-visible`) shows the outline. */\n protected handleToggleFocus(event: FocusEvent): void {\n const toggleButton = event.target as HTMLElement;\n this.isToggleFocused.set(toggleButton.matches(\":focus-visible\"));\n }\n\n protected onHeaderClick(): void {\n if (this.collapsible()) {\n this.toggle();\n }\n }\n\n protected onHeaderActionClick(): void {\n if (this.headerActionMenuItems().length === 0) {\n this.headerActionClick.emit();\n }\n }\n}\n","<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border-bold bg-surface-default outline-2 outline-offset-[-1px] outline-color-border-focused\"\n [class.outline]=\"isToggleFocused()\"\n>\n <div\n class=\"flex h-[48px] w-full shrink-0 items-center border-color-border-bold px-space-2 transition-colors duration-200\"\n [class.border-b]=\"isBodyVisible()\"\n [class.cursor-pointer]=\"collapsible()\"\n role=\"presentation\"\n (click)=\"onHeaderClick()\"\n >\n <div class=\"flex w-full items-center gap-space-1\">\n @if (collapsible()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-none\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"_bodyId\"\n [attr.aria-label]=\"\n (expanded() ? 'platform.scala-ng.panel_collapse' : 'platform.scala-ng.panel_expand')\n | translate\n \"\n (focus)=\"handleToggleFocus($event)\"\n (blur)=\"isToggleFocused.set(false)\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down transition-transform duration-150\"\n [class.rotate-180]=\"expanded()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n\n @if (headerTemplate(); as template) {\n <div class=\"min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"template\" />\n </div>\n } @else {\n <p\n class=\"min-w-0 flex-1 break-words font-inter text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >\n {{ heading() }}\n </p>\n }\n\n @if (hasHeaderAction()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-offset-[-2px]\"\n [sdsTieredMenu]=\"headerActionMenuItems()\"\n [attr.aria-label]=\"headerAction()?.ariaLabel || null\"\n (click)=\"$event.stopPropagation(); onHeaderActionClick()\"\n >\n {{ headerAction()?.label }}\n @if (headerAction()?.icon; as icon) {\n <i\n sdsTrailingIcon\n [class]=\"icon\"\n aria-hidden=\"true\"\n ></i>\n }\n </button>\n }\n </div>\n </div>\n\n <div\n [id]=\"_bodyId\"\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-in-out\"\n [class]=\"collapseRowsClass()\"\n [attr.inert]=\"isBodyVisible() ? null : ''\"\n (transitionend)=\"onCollapseTransitionEnd($event, bodyContent)\"\n >\n <div class=\"min-h-0 overflow-hidden\">\n <div class=\"flex w-full flex-col gap-space-2-5 p-space-2\">\n <sds-content-lifecycle\n #bodyContent\n [bodyTemplate]=\"bodyTemplate()\"\n [visible]=\"isBodyVisible()\"\n [contentLifecycle]=\"contentLifecycle()\"\n >\n <ng-content />\n </sds-content-lifecycle>\n </div>\n\n @if (hasFooter()) {\n <hr class=\"m-0 border-t border-color-border-bold\" />\n <div class=\"flex w-full items-center justify-end gap-space-1-5 p-space-2\">\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n @if (tertiaryLabel()) {\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"tertiaryClick.emit()\"\n >\n {{ tertiaryLabel() }}\n </button>\n }\n @if (secondaryLabel()) {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"secondaryClick.emit()\"\n >\n {{ secondaryLabel() }}\n </button>\n }\n @if (primaryLabel()) {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"primaryClick.emit()\"\n >\n {{ primaryLabel() }}\n </button>\n }\n }\n </div>\n }\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAoDa,iBAAiB,CAAA;AACpB,IAAA,OAAO,SAAS,GAAG,CAAC,CAAC;AAEV,IAAA,GAAG,CAAS;AACZ,IAAA,OAAO,CAAS;;AAG1B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAGnC,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;;AAGpC,IAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;;AAGhC,IAAA,aAAa,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGlC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,IAAA,EAChB,kBAAkB,EAAA,QAAA,EAAA,iCAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,aAAA,EAAA,UAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAClB,4BAA4B,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,SAAA,EAAA,kBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAC5B,sBAAsB,EAAA,QAAA,EAAA,yCAAA,EAAA,MAAA,EAAA,CAAA,eAAA,EAAA,qBAAA,EAAA,WAAA,EAAA,sBAAA,EAAA,oBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,iBAAA,EAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACtB,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAjB7B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EACV,IAAA,EAAA;AACJ,wBAAA,KAAK,EAAE,OAAO;AACd,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,mBAAmB,EAAE,WAAW;qBACjC,EACQ,OAAA,EAAA;wBACP,gBAAgB;wBAChB,kBAAkB;wBAClB,4BAA4B;wBAC5B,sBAAsB;wBACtB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,isIAAA,EAAA,CAAA;;;AEjDH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-scala-ng-panel.mjs","sources":["../../projects/scala-ng/panel/src/panel/panel.component.ts","../../projects/scala-ng/panel/src/panel/panel.component.html","../../projects/scala-ng/panel/seniorsistemas-scala-ng-panel.ts"],"sourcesContent":["import { NgTemplateOutlet } from \"@angular/common\";\nimport {\n Component,\n computed,\n contentChild,\n input,\n model,\n output,\n signal,\n TemplateRef,\n} from \"@angular/core\";\nimport { TranslatePipe } from \"@ngx-translate/core\";\nimport { SdsButtonComponent } from \"@seniorsistemas/scala-ng/button\";\nimport {\n SdsContentLifecycleComponent,\n type ContentLifecycleHost,\n type ContentLifecycleMode,\n} from \"@seniorsistemas/scala-ng/content-lifecycle\";\nimport {\n SdsTieredMenuDirective,\n type SdsTieredMenuItem,\n} from \"@seniorsistemas/scala-ng/tiered-menu\";\n\n/**\n * Configuração do botão de ação do header. `label`, `icon` e `ariaLabel` descrevem o mesmo botão\n * renderizado na tela, agrupados num único objeto em vez de três inputs soltos. Todos opcionais:\n * `label` vazio = botão icon-only (nesse caso `ariaLabel` é obrigatório na prática, já que sem\n * texto visível o botão não tem nome acessível a menos que `ariaLabel` seja informado).\n */\nexport interface SdsPanelHeaderAction {\n label?: string;\n icon?: string;\n ariaLabel?: string;\n}\n\n@Component({\n selector: \"sds-panel\",\n standalone: true,\n host: {\n class: \"block\",\n role: \"region\",\n \"[attr.aria-label]\": \"heading()\",\n },\n imports: [\n NgTemplateOutlet,\n SdsButtonComponent,\n SdsContentLifecycleComponent,\n SdsTieredMenuDirective,\n TranslatePipe,\n ],\n templateUrl: \"./panel.component.html\",\n})\nexport class SdsPanelComponent implements ContentLifecycleHost {\n private static idCounter = 0;\n\n protected readonly _id: string;\n protected readonly _bodyId: string;\n\n /** Panel heading, also the region's `aria-label` even when `#header` is overridden. */\n readonly heading = input.required<string>();\n\n /** Shows the expand/collapse toggle in the header. */\n readonly collapsible = input<boolean>(false);\n\n /** Whether the panel is expanded. Only has an effect when `collapsible` is `true`. */\n readonly expanded = model<boolean>(true);\n\n /** Label of the footer tertiary (ghost) button; the button shows only when non-empty. */\n readonly tertiaryLabel = input<string>(\"\");\n\n /** Label of the footer secondary button; the button shows only when non-empty. */\n readonly secondaryLabel = input<string>(\"\");\n\n /** Label of the footer primary button; the button shows only when non-empty. */\n readonly primaryLabel = input<string>(\"\");\n\n /** Emits when the footer tertiary button is clicked. */\n readonly tertiaryClick = output<void>();\n\n /** Emits when the footer secondary button is clicked. */\n readonly secondaryClick = output<void>();\n\n /** Emits when the footer primary button is clicked. */\n readonly primaryClick = output<void>();\n\n /** Header action button config; the button shows when `label` is non-empty or `headerActionMenuItems` is set. */\n readonly headerAction = input<SdsPanelHeaderAction | null>(null);\n\n /**\n * Tiered menu items opened by the header action button.\n * When set, clicking opens the menu instead of emitting `headerActionClick`.\n */\n readonly headerActionMenuItems = input<SdsTieredMenuItem[]>([]);\n\n /** Emits when the header action button is clicked and `headerActionMenuItems` is empty. */\n readonly headerActionClick = output<void>();\n\n /**\n * Replaces only the header title; the toggle and action button are still rendered.\n * When `collapsible`, the whole header toggles on click, so interactive elements\n * inside need `$event.stopPropagation()`.\n */\n protected readonly headerTemplate = contentChild<TemplateRef<void>>(\"header\");\n\n /** Replaces the body; falls back to `ng-content`. */\n protected readonly bodyTemplate = contentChild<TemplateRef<void>>(\"body\");\n\n /**\n * Controls when the `#body` template is created/destroyed: `\"always\"` (mounted up front),\n * `\"lazy\"` (mounted on first expand) or `\"destroy\"` (destroyed after each collapse animation).\n * Values other than `\"always\"` require `#body`, since plain `ng-content` can't be controlled.\n */\n readonly contentLifecycle = input<ContentLifecycleMode>(\"always\");\n\n /** Replaces the default footer buttons. */\n protected readonly footerTemplate = contentChild<TemplateRef<void>>(\"footer\");\n\n protected readonly isBodyVisible = computed(() => !this.collapsible() || this.expanded());\n\n protected readonly hasFooter = computed(\n () =>\n !!this.tertiaryLabel() ||\n !!this.secondaryLabel() ||\n !!this.primaryLabel() ||\n !!this.footerTemplate(),\n );\n\n protected readonly hasHeaderAction = computed(\n () => !!this.headerAction()?.label || this.headerActionMenuItems().length > 0,\n );\n\n protected readonly collapseRowsClass = computed(() =>\n this.isBodyVisible() ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\",\n );\n\n /** Keyboard focus on the toggle; the focus outline is drawn on the whole panel, per the DS spec. */\n protected readonly isToggleFocused = signal(false);\n\n constructor() {\n SdsPanelComponent.idCounter++;\n this._id = `sds-panel-${SdsPanelComponent.idCounter}`;\n this._bodyId = `${this._id}-body`;\n }\n\n /** Tells the content lifecycle the collapse animation ended, so `\"destroy\"` mode can unmount the body. */\n protected onCollapseTransitionEnd(\n event: TransitionEvent,\n bodyContent: SdsContentLifecycleComponent,\n ): void {\n const isOwnGridTransition =\n event.target === event.currentTarget && event.propertyName === \"grid-template-rows\";\n if (isOwnGridTransition) {\n bodyContent.notifyCollapseTransitionEnd();\n }\n }\n\n protected toggle(): void {\n this.expanded.set(!this.expanded());\n }\n\n /** Mouse clicks also focus the toggle; only keyboard focus (`:focus-visible`) shows the outline. */\n protected handleToggleFocus(event: FocusEvent): void {\n const toggleButton = event.target as HTMLElement;\n this.isToggleFocused.set(toggleButton.matches(\":focus-visible\"));\n }\n\n protected onHeaderClick(): void {\n if (this.collapsible()) {\n this.toggle();\n }\n }\n\n protected onHeaderActionClick(): void {\n if (this.headerActionMenuItems().length === 0) {\n this.headerActionClick.emit();\n }\n }\n}\n","<div\n class=\"flex w-full flex-col overflow-hidden rounded-radius-xlarge border border-solid border-color-border bg-surface-default outline-2 outline-offset-[-1px] outline-color-border-focused\"\n [class.outline]=\"isToggleFocused()\"\n>\n <div\n class=\"flex h-[48px] w-full shrink-0 items-center border-color-border px-space-2 transition-colors duration-200\"\n [class.border-b]=\"isBodyVisible()\"\n [class.cursor-pointer]=\"collapsible()\"\n role=\"presentation\"\n (click)=\"onHeaderClick()\"\n >\n <div class=\"flex w-full items-center gap-space-1\">\n @if (collapsible()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-none\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"_bodyId\"\n [attr.aria-label]=\"\n (expanded() ? 'platform.scala-ng.panel_collapse' : 'platform.scala-ng.panel_expand')\n | translate\n \"\n (focus)=\"handleToggleFocus($event)\"\n (blur)=\"isToggleFocused.set(false)\"\n >\n <i\n sdsLeadingIcon\n class=\"fa-solid fa-chevron-down transition-transform duration-150\"\n [class.rotate-180]=\"expanded()\"\n aria-hidden=\"true\"\n ></i>\n </button>\n }\n\n @if (headerTemplate(); as template) {\n <div class=\"min-w-0 flex-1\">\n <ng-container [ngTemplateOutlet]=\"template\" />\n </div>\n } @else {\n <p\n class=\"min-w-0 flex-1 break-words font-inter text-font-size-2 font-font-weight-medium leading-line-height-125 text-color-text-neutral-primary\"\n >\n {{ heading() }}\n </p>\n }\n\n @if (hasHeaderAction()) {\n <button\n sdsButton\n type=\"ghost\"\n class=\"shrink-0 focus-visible:!outline-offset-[-2px]\"\n [sdsTieredMenu]=\"headerActionMenuItems()\"\n [attr.aria-label]=\"headerAction()?.ariaLabel || null\"\n (click)=\"$event.stopPropagation(); onHeaderActionClick()\"\n >\n {{ headerAction()?.label }}\n @if (headerAction()?.icon; as icon) {\n <i\n sdsTrailingIcon\n [class]=\"icon\"\n aria-hidden=\"true\"\n ></i>\n }\n </button>\n }\n </div>\n </div>\n\n <div\n [id]=\"_bodyId\"\n class=\"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-in-out\"\n [class]=\"collapseRowsClass()\"\n [attr.inert]=\"isBodyVisible() ? null : ''\"\n (transitionend)=\"onCollapseTransitionEnd($event, bodyContent)\"\n >\n <div class=\"min-h-0 overflow-hidden\">\n <div class=\"flex w-full flex-col gap-space-2-5 p-space-2\">\n <sds-content-lifecycle\n #bodyContent\n [bodyTemplate]=\"bodyTemplate()\"\n [visible]=\"isBodyVisible()\"\n [contentLifecycle]=\"contentLifecycle()\"\n >\n <ng-content />\n </sds-content-lifecycle>\n </div>\n\n @if (hasFooter()) {\n <hr class=\"m-0 border-t border-color-border\" />\n <div class=\"flex w-full items-center justify-end gap-space-1-5 p-space-2\">\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template\" />\n } @else {\n @if (tertiaryLabel()) {\n <button\n sdsButton\n type=\"ghost\"\n (click)=\"tertiaryClick.emit()\"\n >\n {{ tertiaryLabel() }}\n </button>\n }\n @if (secondaryLabel()) {\n <button\n sdsButton\n type=\"secondary\"\n (click)=\"secondaryClick.emit()\"\n >\n {{ secondaryLabel() }}\n </button>\n }\n @if (primaryLabel()) {\n <button\n sdsButton\n type=\"primary\"\n (click)=\"primaryClick.emit()\"\n >\n {{ primaryLabel() }}\n </button>\n }\n }\n </div>\n }\n </div>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAoDa,iBAAiB,CAAA;AACpB,IAAA,OAAO,SAAS,GAAG,CAAC,CAAC;AAEV,IAAA,GAAG,CAAS;AACZ,IAAA,OAAO,CAAS;;AAG1B,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;;AAGnC,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;;AAGpC,IAAA,QAAQ,GAAG,KAAK,CAAU,IAAI,CAAC,CAAC;;AAGhC,IAAA,aAAa,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGlC,IAAA,cAAc,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;AAGnC,IAAA,YAAY,GAAG,KAAK,CAAS,EAAE,CAAC,CAAC;;IAGjC,aAAa,GAAG,MAAM,EAAQ,CAAC;;IAG/B,cAAc,GAAG,MAAM,EAAQ,CAAC;;IAGhC,YAAY,GAAG,MAAM,EAAQ,CAAC;;AAG9B,IAAA,YAAY,GAAG,KAAK,CAA8B,IAAI,CAAC,CAAC;AAEjE;;;AAGG;AACM,IAAA,qBAAqB,GAAG,KAAK,CAAsB,EAAE,CAAC,CAAC;;IAGvD,iBAAiB,GAAG,MAAM,EAAQ,CAAC;AAE5C;;;;AAIG;AACgB,IAAA,cAAc,GAAG,YAAY,CAAoB,QAAQ,CAAC,CAAC;;AAG3D,IAAA,YAAY,GAAG,YAAY,CAAoB,MAAM,CAAC,CAAC;AAE1E;;;;AAIG;AACM,IAAA,gBAAgB,GAAG,K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,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIJ,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAjB7B,SAAS;+BACE,WAAW,EAAA,UAAA,EACT,IAAI,EACV,IAAA,EAAA;AACJ,wBAAA,KAAK,EAAE,OAAO;AACd,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,mBAAmB,EAAE,WAAW;qBACjC,EACQ,OAAA,EAAA;wBACP,gBAAgB;wBAChB,kBAAkB;wBAClB,4BAA4B;wBAC5B,sBAAsB;wBACtB,aAAa;AACd,qBAAA,EAAA,QAAA,EAAA,krIAAA,EAAA,CAAA;;;AEjDH;;AAEG;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NgClass } from '@angular/common';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
2
|
import { InjectionToken, Injectable, inject, Injector, signal, computed, input, model, output, forwardRef, Component } from '@angular/core';
|
|
4
3
|
import * as i1 from '@angular/forms';
|
|
5
4
|
import { NgControl, FormControlName, NgModel, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
|
+
import { NgClass } from '@angular/common';
|
|
6
6
|
|
|
7
7
|
const RADIO_GROUP_ERROR = new InjectionToken("SDS_RADIO_GROUP_ERROR");
|
|
8
8
|
|
|
@@ -120,7 +120,7 @@ class SdsRadioButtonComponent {
|
|
|
120
120
|
useExisting: forwardRef(() => SdsRadioButtonComponent),
|
|
121
121
|
multi: true,
|
|
122
122
|
},
|
|
123
|
-
], ngImport: i0, template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly();\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n\n<label\n class=\"
|
|
123
|
+
], ngImport: i0, template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly();\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n\n<label\n class=\"inline-flex items-center gap-2 align-top\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [attr.value]=\"value()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly && !disabled ? 'true' : null\"\n (change)=\"select()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex size-4 shrink-0 items-center justify-center rounded-full border border-solid transition-colors duration-150\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n 'border-color-border-disable': disabled || (!disabled && isReadonly),\n 'bg-color-background-disable': disabled,\n 'bg-color-background-interactive-secondary':\n (!disabled && isReadonly) || (normal && !hovered && !checked),\n 'bg-color-background-selected-bold': normal && !hovered && checked,\n 'bg-color-background-selected-bold-hovered': normal && hovered && checked,\n 'bg-color-background-interactive-secondary-hovered': normal && hovered && !checked,\n 'border-color-border-destructive': normal && error,\n 'border-color-border-interactive-primary': normal && !error && checked,\n 'border-color-border-interactive-secondary': normal && !error && !checked,\n 'peer-focus-visible:shadow-[0px_0px_4px_0px_var(--sds-color-shadow-input-hovered)] peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-[3px] peer-focus-visible:outline-color-border-focused':\n !isReadonly,\n }\"\n >\n @if (checked) {\n <div\n class=\"size-2 rounded-full\"\n [ngClass]=\"{ 'bg-color-icon-inverse': !disabled, 'bg-color-icon-disable': disabled }\"\n ></div>\n }\n </div>\n\n @if (showLabel()) {\n <span\n class=\"select-none text-[length:var(--sds-font-size-3,16px)] font-normal leading-[1.5]\"\n [ngClass]=\"{\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'cursor-pointer': !disabled && !isReadonly,\n }\"\n >{{ label() }}</span\n >\n }\n</label>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
124
124
|
}
|
|
125
125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SdsRadioButtonComponent, decorators: [{
|
|
126
126
|
type: Component,
|
|
@@ -130,7 +130,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
130
130
|
useExisting: forwardRef(() => SdsRadioButtonComponent),
|
|
131
131
|
multi: true,
|
|
132
132
|
},
|
|
133
|
-
], template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly();\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n\n<label\n class=\"
|
|
133
|
+
], template: "@let checked = isChecked();\n@let hovered = isHovered();\n@let disabled = isDisabled();\n@let isReadonly = readonly();\n@let error = isError;\n@let normal = !disabled && !isReadonly;\n\n<label\n class=\"inline-flex items-center gap-2 align-top\"\n [class.cursor-pointer]=\"!disabled && !isReadonly\"\n [for]=\"inputId()\"\n (mouseenter)=\"isHovered.set(true)\"\n (mouseleave)=\"isHovered.set(false)\"\n>\n <input\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [name]=\"name()\"\n [attr.value]=\"value()\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.aria-invalid]=\"error ? 'true' : null\"\n [attr.aria-readonly]=\"isReadonly && !disabled ? 'true' : null\"\n (change)=\"select()\"\n (focus)=\"focused.emit($event)\"\n (blur)=\"blurred.emit($event)\"\n />\n\n <div\n class=\"relative flex size-4 shrink-0 items-center justify-center rounded-full border border-solid transition-colors duration-150\"\n aria-hidden=\"true\"\n [ngClass]=\"{\n 'border-color-border-disable': disabled || (!disabled && isReadonly),\n 'bg-color-background-disable': disabled,\n 'bg-color-background-interactive-secondary':\n (!disabled && isReadonly) || (normal && !hovered && !checked),\n 'bg-color-background-selected-bold': normal && !hovered && checked,\n 'bg-color-background-selected-bold-hovered': normal && hovered && checked,\n 'bg-color-background-interactive-secondary-hovered': normal && hovered && !checked,\n 'border-color-border-destructive': normal && error,\n 'border-color-border-interactive-primary': normal && !error && checked,\n 'border-color-border-interactive-secondary': normal && !error && !checked,\n 'peer-focus-visible:shadow-[0px_0px_4px_0px_var(--sds-color-shadow-input-hovered)] peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-[3px] peer-focus-visible:outline-color-border-focused':\n !isReadonly,\n }\"\n >\n @if (checked) {\n <div\n class=\"size-2 rounded-full\"\n [ngClass]=\"{ 'bg-color-icon-inverse': !disabled, 'bg-color-icon-disable': disabled }\"\n ></div>\n }\n </div>\n\n @if (showLabel()) {\n <span\n class=\"select-none text-[length:var(--sds-font-size-3,16px)] font-normal leading-[1.5]\"\n [ngClass]=\"{\n 'text-color-text-neutral-primary': !disabled,\n 'text-color-text-disable': disabled,\n 'cursor-pointer': !disabled && !isReadonly,\n }\"\n >{{ label() }}</span\n >\n }\n</label>\n" }]
|
|
134
134
|
}] });
|
|
135
135
|
|
|
136
136
|
class SdsRadioButtonGroupComponent {
|