@sixbell-telco/sdk 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -1
- package/README.md +98 -66
- package/_index.css +2 -1586
- package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
- package/components/alert/README.md +27 -0
- package/components/alert/index.d.ts +5 -0
- package/components/alert/public-api.d.ts +1 -0
- package/components/alert/src/alert.component.d.ts +85 -0
- package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
- package/components/audio-player/button-play/button-play.component.d.ts +7 -7
- package/components/audio-player/src/audio-player.component.d.ts +2 -2
- package/components/audio-player/volume-control/volume-control.component.d.ts +1 -1
- package/components/avatar/README.md +1 -0
- package/components/avatar/src/avatar.component.d.ts +2 -2
- package/components/badge/src/badge.component.d.ts +4 -4
- package/components/button/README.md +5 -4
- package/components/button/src/button.component.d.ts +38 -16
- package/components/card/README.md +2 -0
- package/components/card/card-footer/card-footer.component.d.ts +37 -2
- package/components/card/card-section-group/card-section-group.component.d.ts +1 -1
- package/components/card/src/card.component.d.ts +6 -6
- package/components/countdown/src/countdown.component.d.ts +4 -4
- package/components/data-table/README.md +26 -0
- package/components/data-table/expandable/expandable.component.d.ts +4 -4
- package/components/data-table/sortable-header/sortable-header.component.d.ts +1 -1
- package/components/data-table/src/data-table.component.d.ts +15 -8
- package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +1 -1
- package/components/description-list/README.md +27 -0
- package/components/description-list/index.d.ts +5 -0
- package/components/description-list/public-api.d.ts +1 -0
- package/components/description-list/src/description-list.component.d.ts +90 -0
- package/components/dialog/README.md +10 -6
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +4 -0
- package/components/dialog/src/dialog.component.d.ts +27 -6
- package/components/dialog/src/fullscreen-block-scroll-strategy.d.ts +31 -0
- package/components/divider/src/divider.component.d.ts +1 -1
- package/components/dropdown/README.md +2 -2
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -4
- package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +5 -5
- package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +5 -5
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +11 -14
- package/components/dropdown-menu/README.md +2 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +6 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +3 -3
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +4 -4
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +3 -1
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/dropdown-menu-chevron/dropdown-menu-chevron.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -3
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +2 -1
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/empty-state/README.md +40 -0
- package/components/empty-state/index.d.ts +5 -0
- package/components/empty-state/public-api.d.ts +1 -0
- package/components/empty-state/src/empty-state.component.d.ts +73 -0
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +4 -4
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +2 -2
- package/components/forms/checkbox/src/checkbox.component.d.ts +1 -1
- package/components/forms/combobox/README.md +2 -1
- package/components/forms/combobox/src/combobox.component.d.ts +31 -18
- package/components/forms/date-picker/src/date-picker.component.d.ts +16 -9
- package/components/forms/form-hint/README.md +29 -0
- package/components/forms/form-hint/index.d.ts +5 -0
- package/components/forms/form-hint/public-api.d.ts +1 -0
- package/components/forms/form-hint/src/form-hint.component.d.ts +38 -0
- package/components/forms/form-item/src/form-item.component.d.ts +45 -1
- package/components/forms/input/src/input.component.d.ts +15 -8
- package/components/forms/radio/src/radio.component.d.ts +1 -1
- package/components/forms/range/src/range.component.d.ts +18 -4
- package/components/forms/select/README.md +2 -1
- package/components/forms/select/src/select.component.d.ts +30 -16
- package/components/forms/switch/src/switch.component.d.ts +1 -1
- package/components/forms/textarea/src/textarea.component.d.ts +12 -5
- package/components/forms/toggle/src/toggle.component.d.ts +1 -1
- package/components/notification/src/notification.component.d.ts +1 -1
- package/components/overlay/README.md +7 -2
- package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +1 -1
- package/components/overlay/src/overlay.component.d.ts +10 -9
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +3 -3
- package/components/progress/src/progress.component.d.ts +1 -1
- package/components/segmented-button/README.md +57 -0
- package/components/segmented-button/index.d.ts +5 -0
- package/components/segmented-button/public-api.d.ts +1 -0
- package/components/segmented-button/src/segmented-button.component.d.ts +110 -0
- package/components/sonner/toaster/src/toaster.component.d.ts +3 -3
- package/components/tab/src/tab.component.d.ts +2 -2
- package/components/table/README.md +51 -3
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +20 -13
- package/components/table/table-action/table-action.component.d.ts +14 -3
- package/components/table/table-actions/table-actions.component.d.ts +12 -1
- package/components/table/tokens/README.md +7 -0
- package/components/table/tokens/index.d.ts +5 -0
- package/components/table/tokens/public-api.d.ts +1 -0
- package/components/table/tokens/table-empty-state.d.ts +6 -0
- package/components/tooltip/README.md +25 -7
- package/components/tooltip/src/tooltip.component.d.ts +44 -12
- package/components/tree/README.md +73 -0
- package/components/tree/index.d.ts +5 -0
- package/components/tree/public-api.d.ts +1 -0
- package/components/tree/src/tree.component.d.ts +180 -0
- package/components/wizard/README.md +9 -0
- package/components/wizard/wizard-content/wizard-content.component.d.ts +1 -1
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +15 -6
- package/directives/auto-focus/src/auto-focus.directive.d.ts +1 -1
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -1
- package/directives/truncate/README.md +49 -0
- package/directives/truncate/index.d.ts +5 -0
- package/directives/truncate/public-api.d.ts +1 -0
- package/directives/truncate/src/truncate-popover.component.d.ts +11 -0
- package/directives/truncate/src/truncate.directive.d.ts +96 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs +152 -0
- package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +15 -15
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +53 -19
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -14
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +34 -33
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs +200 -0
- package/fesm2022/sixbell-telco-sdk-components-description-list.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +128 -17
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +33 -24
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +7 -3
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +25 -14
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +43 -72
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs +131 -0
- package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +104 -72
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +23 -12
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs +81 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +45 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +27 -13
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +29 -7
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +84 -56
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +27 -22
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +41 -79
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +329 -0
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs +14 -0
- package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +63 -32
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +187 -75
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs +478 -0
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +339 -0
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +69 -41
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +15 -2
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +87 -2
- package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +234 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs +203 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs +150 -0
- package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs.map +1 -0
- package/i18n/sdk/en.json +224 -0
- package/i18n/sdk/es.json +224 -0
- package/i18n/sdk/pt.json +224 -0
- package/layouts/README.md +18 -11
- package/layouts/public-api.d.ts +1 -1
- package/layouts/src/app-layout/app-layout.component.d.ts +11 -8
- package/layouts/src/layout.config.d.ts +1 -1
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/navbar/navbar.component.d.ts +5 -5
- package/layouts/src/page-banner/page-banner.component.d.ts +19 -2
- package/layouts/src/side-menu/side-menu.component.d.ts +2 -2
- package/layouts/src/user-menu/user-menu.component.d.ts +5 -5
- package/package.json +64 -20
- package/src/_index.css +1701 -0
- package/utils/mfe/README.md +1 -0
- package/utils/mfe/src/hoist-property-rules.d.ts +13 -0
- package/utils/mfe/src/mfe-shadow-shell.component.d.ts +3 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/theme/README.md +94 -1
- package/utils/theme/public-api.d.ts +2 -1
- package/utils/theme/src/models/theme.d.ts +32 -0
- package/utils/theme/src/overlay/theme-overlay.d.ts +33 -0
- package/utils/theme/src/providers/theme.provider.types.d.ts +7 -0
- package/utils/translation/README.md +63 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
- package/utils/translation/testing/index.d.ts +5 -0
- package/utils/translation/testing/public-api.d.ts +2 -0
- package/utils/translation/testing/src/translation-testing.d.ts +96 -0
- package/utils/unsaved-changes/README.md +33 -0
- package/utils/unsaved-changes/index.d.ts +5 -0
- package/utils/unsaved-changes/public-api.d.ts +1 -0
- package/utils/unsaved-changes/src/unsaved-changes-dialog.component.d.ts +24 -0
- package/utils/unsaved-changes/src/unsaved-changes.d.ts +50 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, ChangeDetectionStrategy, Component, model, output, signal, effect, computed } from '@angular/core';
|
|
3
|
+
import { input, ChangeDetectionStrategy, Component, booleanAttribute, model, output, signal, effect, computed } from '@angular/core';
|
|
4
4
|
import { toObservable, toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
8
|
+
import { optionalBooleanAttribute, injectFormFieldA11y } from '@sixbell-telco/sdk/components/forms/form-item';
|
|
8
9
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
9
10
|
import { matVisibilityOutline, matVisibilityOffOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
|
|
10
11
|
import { AutofocusDirective } from '@sixbell-telco/sdk/directives/auto-focus';
|
|
@@ -12,7 +13,7 @@ import { OnlyNumbersDirective } from '@sixbell-telco/sdk/directives/only-numbers
|
|
|
12
13
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
13
14
|
import { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';
|
|
14
15
|
import { cva } from 'class-variance-authority';
|
|
15
|
-
import { Subject, switchMap, startWith, skip,
|
|
16
|
+
import { Subject, switchMap, startWith, skip, timer, map, distinctUntilChanged } from 'rxjs';
|
|
16
17
|
|
|
17
18
|
class InputContentComponent {
|
|
18
19
|
alignment = input.required();
|
|
@@ -102,12 +103,23 @@ class InputComponent {
|
|
|
102
103
|
* Whether to show optional indicator
|
|
103
104
|
* @defaultValue false
|
|
104
105
|
*/
|
|
105
|
-
showOptional = input(false);
|
|
106
|
+
showOptional = input(false, { transform: booleanAttribute });
|
|
106
107
|
/**
|
|
107
108
|
* Optional indicator text (translation key or literal)
|
|
108
109
|
* @defaultValue 'sdk.formFields.optional'
|
|
109
110
|
*/
|
|
110
111
|
optionalText = input('sdk.formFields.optional');
|
|
112
|
+
/**
|
|
113
|
+
* Mark the field as required: shows the `*` marker and announces the field as required.
|
|
114
|
+
* When not set, the enclosing `st-form-item` `required`, then `Validators.required` on the bound control decide.
|
|
115
|
+
*/
|
|
116
|
+
required = input(undefined, { transform: optionalBooleanAttribute });
|
|
117
|
+
/** @internal Required state and hint ids from the enclosing `st-form-item`. */
|
|
118
|
+
fieldA11y = injectFormFieldA11y({
|
|
119
|
+
required: () => this.required(),
|
|
120
|
+
control: () => this.formControl(),
|
|
121
|
+
status: () => this.statusSignal(),
|
|
122
|
+
});
|
|
111
123
|
/**
|
|
112
124
|
* HTML input type
|
|
113
125
|
* @defaultValue 'text'
|
|
@@ -125,7 +137,7 @@ class InputComponent {
|
|
|
125
137
|
* Show a built-in button that reveals or hides the value when `type` is `password`
|
|
126
138
|
* @defaultValue false
|
|
127
139
|
*/
|
|
128
|
-
passwordToggle = input(false);
|
|
140
|
+
passwordToggle = input(false, { transform: booleanAttribute });
|
|
129
141
|
/**
|
|
130
142
|
* Input placeholder text
|
|
131
143
|
*/
|
|
@@ -134,18 +146,18 @@ class InputComponent {
|
|
|
134
146
|
* Whether the input is read-only
|
|
135
147
|
* @defaultValue false
|
|
136
148
|
*/
|
|
137
|
-
readonly = input(false);
|
|
138
|
-
focus = input(false);
|
|
149
|
+
readonly = input(false, { transform: booleanAttribute });
|
|
150
|
+
focus = input(false, { transform: booleanAttribute });
|
|
139
151
|
/**
|
|
140
152
|
* Whether to restrict input to numeric characters only
|
|
141
153
|
* @defaultValue false
|
|
142
154
|
*/
|
|
143
|
-
onlyNumbers = input(false);
|
|
155
|
+
onlyNumbers = input(false, { transform: booleanAttribute });
|
|
144
156
|
/**
|
|
145
157
|
* Whether to use ghost (transparent) styling
|
|
146
158
|
* @defaultValue false
|
|
147
159
|
*/
|
|
148
|
-
ghost = input(false);
|
|
160
|
+
ghost = input(false, { transform: booleanAttribute });
|
|
149
161
|
/**
|
|
150
162
|
* Two-way bindable input value
|
|
151
163
|
*/
|
|
@@ -170,7 +182,7 @@ class InputComponent {
|
|
|
170
182
|
* Stop event propagation for activation events
|
|
171
183
|
* @defaultValue false
|
|
172
184
|
*/
|
|
173
|
-
stopPropagation = input(false);
|
|
185
|
+
stopPropagation = input(false, { transform: booleanAttribute });
|
|
174
186
|
/**
|
|
175
187
|
* Event emitted on Enter keydown
|
|
176
188
|
*/
|
|
@@ -355,19 +367,21 @@ class InputComponent {
|
|
|
355
367
|
*/
|
|
356
368
|
setupDebounce() {
|
|
357
369
|
this.debounceAction$
|
|
358
|
-
.pipe(switchMap((time) => this.value$.pipe(skip(1),
|
|
370
|
+
.pipe(switchMap((time) => this.value$.pipe(skip(1),
|
|
371
|
+
// switchMap + timer instead of debounceTime: debounceTime flushes its pending value when the source completes, while here takeUntilDestroyed unsubscribes and the pending timer is dropped
|
|
372
|
+
switchMap((value) => timer(time).pipe(map(() => value))), distinctUntilChanged())), takeUntilDestroyed())
|
|
359
373
|
.subscribe((value) => {
|
|
360
374
|
this.valueDebounced.emit(`${value}`);
|
|
361
375
|
});
|
|
362
376
|
}
|
|
363
377
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
364
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: InputComponent, isStandalone: true, selector: "st-input", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, passwordToggle: { classPropertyName: "passwordToggle", publicName: "passwordToggle", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, focus: { classPropertyName: "focus", publicName: "focus", isSignal: true, isRequired: false, transformFunction: null }, onlyNumbers: { classPropertyName: "onlyNumbers", publicName: "onlyNumbers", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", keyDownEnter: "keyDownEnter", triggered: "triggered", clicked: "clicked", blurred: "blurred", valueDebounced: "valueDebounced" }, providers: [
|
|
378
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: InputComponent, isStandalone: true, selector: "st-input", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, passwordToggle: { classPropertyName: "passwordToggle", publicName: "passwordToggle", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, focus: { classPropertyName: "focus", publicName: "focus", isSignal: true, isRequired: false, transformFunction: null }, onlyNumbers: { classPropertyName: "onlyNumbers", publicName: "onlyNumbers", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", keyDownEnter: "keyDownEnter", triggered: "triggered", clicked: "clicked", blurred: "blurred", valueDebounced: "valueDebounced" }, providers: [
|
|
365
379
|
{
|
|
366
380
|
provide: NG_VALUE_ACCESSOR,
|
|
367
381
|
useExisting: InputComponent,
|
|
368
382
|
multi: true,
|
|
369
383
|
},
|
|
370
|
-
], ngImport: i0, template: "@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AutofocusDirective, selector: "[stAutofocus]", inputs: ["focus"] }, { kind: "directive", type: OnlyNumbersDirective, selector: "[stOnlyNumbers]", inputs: ["stOnlyNumbers"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }] });
|
|
384
|
+
], ngImport: i0, template: "@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ labelVar }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AutofocusDirective, selector: "[stAutofocus]", inputs: ["focus"] }, { kind: "directive", type: OnlyNumbersDirective, selector: "[stOnlyNumbers]", inputs: ["stOnlyNumbers"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }] });
|
|
371
385
|
}
|
|
372
386
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: InputComponent, decorators: [{
|
|
373
387
|
type: Component,
|
|
@@ -377,7 +391,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
377
391
|
useExisting: InputComponent,
|
|
378
392
|
multi: true,
|
|
379
393
|
},
|
|
380
|
-
], template: "@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n" }]
|
|
394
|
+
], template: "@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ labelVar }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n" }]
|
|
381
395
|
}], ctorParameters: () => [] });
|
|
382
396
|
|
|
383
397
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-input.mjs","sources":["../../../projects/sdk/components/forms/input/input-content/input-content.component.ts","../../../projects/sdk/components/forms/input/input-content/input-content.component.html","../../../projects/sdk/components/forms/input/src/input.component.ts","../../../projects/sdk/components/forms/input/src/input.component.html","../../../projects/sdk/components/forms/input/sixbell-telco-sdk-components-forms-input.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\ntype InputContentAligment = 'start' | 'end';\n\n@Component({\n\tselector: 'st-input-content',\n\timports: [CommonModule],\n\ttemplateUrl: './input-content.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputContentComponent {\n\talignment = input.required<InputContentAligment>();\n}\n","@let alignmentVar = alignment();\n\n<!-- <div [class]=\"aligmentVar === 'start' ? 'st-input-content-left' : 'st-input-content-right'\">\n\t<ng-content></ng-content>\n</div> -->\n<!-- input-content.component.html -->\n<div class=\"inline-flex items-center align-top\" [class.justify-start]=\"alignmentVar === 'start'\" [class.justify-end]=\"alignmentVar === 'end'\">\n\t<ng-content></ng-content>\n</div>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { IconComponent } from '@sixbell-telco/sdk/components/icon';\nimport { matVisibilityOffOutline, matVisibilityOutline } from '@sixbell-telco/sdk/components/icon/material/outline';\nimport { AutofocusDirective } from '@sixbell-telco/sdk/directives/auto-focus';\nimport { OnlyNumbersDirective } from '@sixbell-telco/sdk/directives/only-numbers';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';\nimport { cva } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, skip, startWith, Subject, switchMap } from 'rxjs';\n\n/**\n * @internal\n * Generates base input classes with style variants using class-variance-authority\n */\nconst inputComponent = cva(['font-body', 'w-full', 'input', 'leading-normal', 'grow', 'rounded-field'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tbase: [],\n\t\t\tprimary: ['input-primary'],\n\t\t\tsecondary: ['input-secondary'],\n\t\t\ttertiary: ['input-tertiary'],\n\t\t\taccent: ['input-accent'],\n\t\t\tinfo: ['input-info'],\n\t\t\tsuccess: ['input-success'],\n\t\t\twarning: ['input-warning'],\n\t\t\terror: ['input-error'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['input-xs'],\n\t\t\tsm: ['input-sm'],\n\t\t\tmd: ['input-md'],\n\t\t\tlg: ['input-lg'],\n\t\t\txl: ['input-xl'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'base',\n\t\tsize: 'md',\n\t},\n});\n\n/** Possible input style variants */\nexport type InputVariantProps =\n\t'base' | 'primary' | 'secondary' | 'tertiary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\n/** Possible input size variants */\nexport type InputSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for input styling */\nexport type InputProps = {\n\tvariant?: InputVariantProps;\n\tsize?: InputSizeProps;\n};\n\n/** Native HTML input types supported by the component */\ntype HTMLNativeInputType = 'text' | 'email' | 'number' | 'password' | 'file';\n\nlet nextInputId = 0;\n\n/**\n * A customizable input component with validation, debouncing, and styling variants\n *\n * @remarks\n * Implements ControlValueAccessor for seamless integration with Angular forms.\n * Supports both template-driven and reactive forms, with automatic validation styling.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <st-input label=\"Username\" [(value)]=\"username\"></st-input>\n * ```\n *\n * @example\n * ```html\n * <!-- With validation and custom styling -->\n * <st-input\n * variant=\"secondary\"\n * size=\"lg\"\n * label=\"Email\"\n * type=\"email\"\n * [parentForm]=\"userForm\"\n * formControlName=\"email\"\n * ></st-input>\n * ```\n */\n@Component({\n\tselector: 'st-input',\n\timports: [FormsModule, AutofocusDirective, OnlyNumbersDirective, TranslatePipe, IconComponent],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: InputComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './input.component.html',\n})\nexport class InputComponent implements ControlValueAccessor {\n\t/**\n\t * Input style variant\n\t * @defaultValue 'base'\n\t */\n\tvariant = input<InputVariantProps>('base');\n\n\t/**\n\t * Input size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<InputSizeProps>('md');\n\n\t/**\n\t * Label text displayed above the input\n\t */\n\tlabel = input<string>('');\n\n\t/**\n\t * Whether to show optional indicator\n\t * @defaultValue false\n\t */\n\tshowOptional = input<boolean>(false);\n\n\t/**\n\t * Optional indicator text (translation key or literal)\n\t * @defaultValue 'sdk.formFields.optional'\n\t */\n\toptionalText = input<string>('sdk.formFields.optional');\n\n\t/**\n\t * HTML input type\n\t * @defaultValue 'text'\n\t */\n\ttype = input<HTMLNativeInputType>('text');\n\n\t/**\n\t * HTML name attribute for the input\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * Id of the inner `<input>`, used by its label. A unique id is generated when omitted.\n\t */\n\tinputId = input<string | null>(null);\n\n\t/**\n\t * Show a built-in button that reveals or hides the value when `type` is `password`\n\t * @defaultValue false\n\t */\n\tpasswordToggle = input<boolean>(false);\n\n\t/**\n\t * Input placeholder text\n\t */\n\tplaceholder = input<string>('');\n\n\t/**\n\t * Whether the input is read-only\n\t * @defaultValue false\n\t */\n\treadonly = input<boolean>(false);\n\n\tfocus = input<boolean>(false);\n\n\t/**\n\t * Whether to restrict input to numeric characters only\n\t * @defaultValue false\n\t */\n\tonlyNumbers = input<boolean>(false);\n\n\t/**\n\t * Whether to use ghost (transparent) styling\n\t * @defaultValue false\n\t */\n\tghost = input<boolean>(false);\n\n\t/**\n\t * Two-way bindable input value\n\t */\n\tvalue = model<string>('');\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t// ControlValueAccessor implementation\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Whether the input is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input<boolean>(false);\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (Enter)\n\t */\n\ttriggered = output<void>();\n\n\t/**\n\t * Event emitted on click\n\t */\n\tclicked = output<MouseEvent>();\n\n\t/**\n\t * Event emitted when input loses focus\n\t */\n\tblurred = output<string>();\n\n\t/**\n\t * Event emitted with debounced value changes\n\t */\n\tvalueDebounced = output<string>();\n\n\t/**\n\t * Debounce time in milliseconds for value changes\n\t * @defaultValue 500\n\t */\n\tdebounceTime = input(500);\n\n\t// Internal implementation details\n\tprivate blurTrigger = signal(0);\n\tprivate debounceAction$ = new Subject<number>();\n\tprivate debounceTimeEffect = effect(() => {\n\t\tthis.debounceAction$.next(this.debounceTime());\n\t});\n\tprivate value$ = toObservable(this.value);\n\n\tprivate readonly generatedId = `st-input-${nextInputId++}`;\n\tprivate readonly translateLabel = injectLabelTranslator();\n\n\t/** @internal Whether the password value is currently shown as plain text */\n\tprotected readonly passwordVisible = signal(false);\n\n\t/** @internal Id applied to the inner input and referenced by its label */\n\tprotected readonly resolvedId = computed(() => this.inputId() || this.generatedId);\n\n\t/** @internal Whether the built-in password reveal button is rendered */\n\tprotected readonly showPasswordToggle = computed(() => this.passwordToggle() && this.type() === 'password');\n\n\t/** @internal Native type applied to the inner input */\n\tprotected readonly nativeType = computed(() => (this.showPasswordToggle() && this.passwordVisible() ? 'text' : this.type()));\n\n\t/** @internal Name of the icon-only password reveal button */\n\tprotected readonly passwordToggleLabel = computed(() =>\n\t\tthis.passwordVisible()\n\t\t\t? this.translateLabel({ key: 'sdk.input.hidePassword', fallback: 'Hide password' })\n\t\t\t: this.translateLabel({ key: 'sdk.input.showPassword', fallback: 'Show password' }),\n\t);\n\n\t/** @internal */\n\tprotected readonly iconShowPassword = matVisibilityOutline;\n\t/** @internal */\n\tprotected readonly iconHidePassword = matVisibilityOffOutline;\n\n\tconstructor() {\n\t\tthis.setupDebounce();\n\t}\n\n\t/** @internal Toggles password visibility */\n\ttogglePasswordVisibility(): void {\n\t\tthis.passwordVisible.update((visible) => !visible);\n\t}\n\n\t/**\n\t * @internal\n\t * Computed base input classes\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed error state classes\n\t */\n\terrorClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed success state classes\n\t */\n\tsuccessClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t// ControlValueAccessor implementation methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles input value changes\n\t */\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.clicked.emit(event);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter key press\n\t */\n\thandleEnter(event: Event) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t\tthis.triggered.emit();\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.blurred.emit(this.value());\n\t\tthis.onControlTouch();\n\t\tthis.blurTrigger.update((v) => v + 1);\n\t}\n\n\t/** @internal */\n\tprivate formControl = computed(() => this.parentForm()?.get(this.formControlName()) as FormControl | null);\n\t/** @internal */\n\tprivate formControl$ = toObservable(this.formControl);\n\t/** @internal */\n\tprivate statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));\n\t/** @internal */\n\tprivate stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));\n\t/** @internal */\n\tprivate statusSignal = toSignal(this.statusChanges$);\n\t/** @internal */\n\tprivate stateSignal = toSignal(this.stateChanges$);\n\n\t/**\n\t * @internal\n\t * Reactive validation class computation\n\t */\n\tvalidationClass = computed(() => {\n\t\tconst control = this.formControl();\n\t\tconst trigger = this.blurTrigger();\n\n\t\tif (!control) return this.componentClass();\n\n\t\tconst isTouched = control.touched || trigger > 0;\n\t\tthis.statusSignal();\n\t\tthis.stateSignal();\n\n\t\tif (control.dirty || isTouched) {\n\t\t\tif (control.invalid) return this.errorClass();\n\t\t\tif (control.valid) return this.successClass();\n\t\t}\n\n\t\treturn this.componentClass();\n\t});\n\n\t/**\n\t * @internal\n\t * Sets up debounced value changes\n\t */\n\tprivate setupDebounce() {\n\t\tthis.debounceAction$\n\t\t\t.pipe(\n\t\t\t\tswitchMap((time: number) => this.value$.pipe(skip(1), debounceTime(time), distinctUntilChanged())),\n\t\t\t\ttakeUntilDestroyed(),\n\t\t\t)\n\t\t\t.subscribe((value) => {\n\t\t\t\tthis.valueDebounced.emit(`${value}`);\n\t\t\t});\n\t}\n}\n","@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span>{{ labelVar }}</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;MAWa,qBAAqB,CAAA;AACjC,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAwB;wGADtC,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECXlC,sZASA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDFW,YAAY,EAAA,CAAA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IAAA,EAAE,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAUjF,cAAc,EAAA,UAAA,EAAA,CAAA;kBAZ1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EACX,CAAC,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,SAAA,EACnF;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,cAAgB;AAC3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,w7DAAA,EAAA;;;AEnGF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-input.mjs","sources":["../../../projects/sdk/components/forms/input/input-content/input-content.component.ts","../../../projects/sdk/components/forms/input/input-content/input-content.component.html","../../../projects/sdk/components/forms/input/src/input.component.ts","../../../projects/sdk/components/forms/input/src/input.component.html","../../../projects/sdk/components/forms/input/sixbell-telco-sdk-components-forms-input.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\ntype InputContentAligment = 'start' | 'end';\n\n@Component({\n\tselector: 'st-input-content',\n\timports: [CommonModule],\n\ttemplateUrl: './input-content.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputContentComponent {\n\talignment = input.required<InputContentAligment>();\n}\n","@let alignmentVar = alignment();\n\n<!-- <div [class]=\"aligmentVar === 'start' ? 'st-input-content-left' : 'st-input-content-right'\">\n\t<ng-content></ng-content>\n</div> -->\n<!-- input-content.component.html -->\n<div class=\"inline-flex items-center align-top\" [class.justify-start]=\"alignmentVar === 'start'\" [class.justify-end]=\"alignmentVar === 'end'\">\n\t<ng-content></ng-content>\n</div>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { booleanAttribute, Component, computed, effect, input, model, output, signal } from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { injectFormFieldA11y, optionalBooleanAttribute } from '@sixbell-telco/sdk/components/forms/form-item';\nimport { IconComponent } from '@sixbell-telco/sdk/components/icon';\nimport { matVisibilityOffOutline, matVisibilityOutline } from '@sixbell-telco/sdk/components/icon/material/outline';\nimport { AutofocusDirective } from '@sixbell-telco/sdk/directives/auto-focus';\nimport { OnlyNumbersDirective } from '@sixbell-telco/sdk/directives/only-numbers';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';\nimport { cva } from 'class-variance-authority';\nimport { distinctUntilChanged, map, skip, startWith, Subject, switchMap, timer } from 'rxjs';\n\n/**\n * @internal\n * Generates base input classes with style variants using class-variance-authority\n */\nconst inputComponent = cva(['font-body', 'w-full', 'input', 'leading-normal', 'grow', 'rounded-field'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tbase: [],\n\t\t\tprimary: ['input-primary'],\n\t\t\tsecondary: ['input-secondary'],\n\t\t\ttertiary: ['input-tertiary'],\n\t\t\taccent: ['input-accent'],\n\t\t\tinfo: ['input-info'],\n\t\t\tsuccess: ['input-success'],\n\t\t\twarning: ['input-warning'],\n\t\t\terror: ['input-error'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['input-xs'],\n\t\t\tsm: ['input-sm'],\n\t\t\tmd: ['input-md'],\n\t\t\tlg: ['input-lg'],\n\t\t\txl: ['input-xl'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'base',\n\t\tsize: 'md',\n\t},\n});\n\n/** Possible input style variants */\nexport type InputVariantProps =\n\t'base' | 'primary' | 'secondary' | 'tertiary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\n/** Possible input size variants */\nexport type InputSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for input styling */\nexport type InputProps = {\n\tvariant?: InputVariantProps;\n\tsize?: InputSizeProps;\n};\n\n/** Native HTML input types supported by the component */\ntype HTMLNativeInputType = 'text' | 'email' | 'number' | 'password' | 'file';\n\nlet nextInputId = 0;\n\n/**\n * A customizable input component with validation, debouncing, and styling variants\n *\n * @remarks\n * Implements ControlValueAccessor for seamless integration with Angular forms.\n * Supports both template-driven and reactive forms, with automatic validation styling.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <st-input label=\"Username\" [(value)]=\"username\"></st-input>\n * ```\n *\n * @example\n * ```html\n * <!-- With validation and custom styling -->\n * <st-input\n * variant=\"secondary\"\n * size=\"lg\"\n * label=\"Email\"\n * type=\"email\"\n * [parentForm]=\"userForm\"\n * formControlName=\"email\"\n * ></st-input>\n * ```\n */\n@Component({\n\tselector: 'st-input',\n\timports: [FormsModule, AutofocusDirective, OnlyNumbersDirective, TranslatePipe, IconComponent],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: InputComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './input.component.html',\n})\nexport class InputComponent implements ControlValueAccessor {\n\t/**\n\t * Input style variant\n\t * @defaultValue 'base'\n\t */\n\tvariant = input<InputVariantProps>('base');\n\n\t/**\n\t * Input size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<InputSizeProps>('md');\n\n\t/**\n\t * Label text displayed above the input\n\t */\n\tlabel = input<string>('');\n\n\t/**\n\t * Whether to show optional indicator\n\t * @defaultValue false\n\t */\n\tshowOptional = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Optional indicator text (translation key or literal)\n\t * @defaultValue 'sdk.formFields.optional'\n\t */\n\toptionalText = input<string>('sdk.formFields.optional');\n\n\t/**\n\t * Mark the field as required: shows the `*` marker and announces the field as required.\n\t * When not set, the enclosing `st-form-item` `required`, then `Validators.required` on the bound control decide.\n\t */\n\trequired = input<boolean | undefined, unknown>(undefined, { transform: optionalBooleanAttribute });\n\n\t/** @internal Required state and hint ids from the enclosing `st-form-item`. */\n\tprotected readonly fieldA11y = injectFormFieldA11y({\n\t\trequired: () => this.required(),\n\t\tcontrol: () => this.formControl(),\n\t\tstatus: () => this.statusSignal(),\n\t});\n\n\t/**\n\t * HTML input type\n\t * @defaultValue 'text'\n\t */\n\ttype = input<HTMLNativeInputType>('text');\n\n\t/**\n\t * HTML name attribute for the input\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * Id of the inner `<input>`, used by its label. A unique id is generated when omitted.\n\t */\n\tinputId = input<string | null>(null);\n\n\t/**\n\t * Show a built-in button that reveals or hides the value when `type` is `password`\n\t * @defaultValue false\n\t */\n\tpasswordToggle = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Input placeholder text\n\t */\n\tplaceholder = input<string>('');\n\n\t/**\n\t * Whether the input is read-only\n\t * @defaultValue false\n\t */\n\treadonly = input(false, { transform: booleanAttribute });\n\n\tfocus = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether to restrict input to numeric characters only\n\t * @defaultValue false\n\t */\n\tonlyNumbers = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Whether to use ghost (transparent) styling\n\t * @defaultValue false\n\t */\n\tghost = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Two-way bindable input value\n\t */\n\tvalue = model<string>('');\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t// ControlValueAccessor implementation\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Whether the input is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (Enter)\n\t */\n\ttriggered = output<void>();\n\n\t/**\n\t * Event emitted on click\n\t */\n\tclicked = output<MouseEvent>();\n\n\t/**\n\t * Event emitted when input loses focus\n\t */\n\tblurred = output<string>();\n\n\t/**\n\t * Event emitted with debounced value changes\n\t */\n\tvalueDebounced = output<string>();\n\n\t/**\n\t * Debounce time in milliseconds for value changes\n\t * @defaultValue 500\n\t */\n\tdebounceTime = input(500);\n\n\t// Internal implementation details\n\tprivate blurTrigger = signal(0);\n\tprivate debounceAction$ = new Subject<number>();\n\tprivate debounceTimeEffect = effect(() => {\n\t\tthis.debounceAction$.next(this.debounceTime());\n\t});\n\tprivate value$ = toObservable(this.value);\n\n\tprivate readonly generatedId = `st-input-${nextInputId++}`;\n\tprivate readonly translateLabel = injectLabelTranslator();\n\n\t/** @internal Whether the password value is currently shown as plain text */\n\tprotected readonly passwordVisible = signal(false);\n\n\t/** @internal Id applied to the inner input and referenced by its label */\n\tprotected readonly resolvedId = computed(() => this.inputId() || this.generatedId);\n\n\t/** @internal Whether the built-in password reveal button is rendered */\n\tprotected readonly showPasswordToggle = computed(() => this.passwordToggle() && this.type() === 'password');\n\n\t/** @internal Native type applied to the inner input */\n\tprotected readonly nativeType = computed(() => (this.showPasswordToggle() && this.passwordVisible() ? 'text' : this.type()));\n\n\t/** @internal Name of the icon-only password reveal button */\n\tprotected readonly passwordToggleLabel = computed(() =>\n\t\tthis.passwordVisible()\n\t\t\t? this.translateLabel({ key: 'sdk.input.hidePassword', fallback: 'Hide password' })\n\t\t\t: this.translateLabel({ key: 'sdk.input.showPassword', fallback: 'Show password' }),\n\t);\n\n\t/** @internal */\n\tprotected readonly iconShowPassword = matVisibilityOutline;\n\t/** @internal */\n\tprotected readonly iconHidePassword = matVisibilityOffOutline;\n\n\tconstructor() {\n\t\tthis.setupDebounce();\n\t}\n\n\t/** @internal Toggles password visibility */\n\ttogglePasswordVisibility(): void {\n\t\tthis.passwordVisible.update((visible) => !visible);\n\t}\n\n\t/**\n\t * @internal\n\t * Computed base input classes\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed error state classes\n\t */\n\terrorClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t/**\n\t * @internal\n\t * Computed success state classes\n\t */\n\tsuccessClass = computed(() => {\n\t\treturn cn(\n\t\t\tinputComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{\n\t\t\t\t'input-ghost': this.ghost(),\n\t\t\t},\n\t\t);\n\t});\n\n\t// ControlValueAccessor implementation methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles input value changes\n\t */\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.clicked.emit(event);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter key press\n\t */\n\thandleEnter(event: Event) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t\tthis.triggered.emit();\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.blurred.emit(this.value());\n\t\tthis.onControlTouch();\n\t\tthis.blurTrigger.update((v) => v + 1);\n\t}\n\n\t/** @internal */\n\tprivate formControl = computed(() => this.parentForm()?.get(this.formControlName()) as FormControl | null);\n\t/** @internal */\n\tprivate formControl$ = toObservable(this.formControl);\n\t/** @internal */\n\tprivate statusChanges$ = this.formControl$.pipe(switchMap((control) => control?.statusChanges.pipe(startWith(control.status)) || []));\n\t/** @internal */\n\tprivate stateChanges$ = this.formControl$.pipe(switchMap((control) => control?.valueChanges.pipe(startWith(control.value)) || []));\n\t/** @internal */\n\tprivate statusSignal = toSignal(this.statusChanges$);\n\t/** @internal */\n\tprivate stateSignal = toSignal(this.stateChanges$);\n\n\t/**\n\t * @internal\n\t * Reactive validation class computation\n\t */\n\tvalidationClass = computed(() => {\n\t\tconst control = this.formControl();\n\t\tconst trigger = this.blurTrigger();\n\n\t\tif (!control) return this.componentClass();\n\n\t\tconst isTouched = control.touched || trigger > 0;\n\t\tthis.statusSignal();\n\t\tthis.stateSignal();\n\n\t\tif (control.dirty || isTouched) {\n\t\t\tif (control.invalid) return this.errorClass();\n\t\t\tif (control.valid) return this.successClass();\n\t\t}\n\n\t\treturn this.componentClass();\n\t});\n\n\t/**\n\t * @internal\n\t * Sets up debounced value changes\n\t */\n\tprivate setupDebounce() {\n\t\tthis.debounceAction$\n\t\t\t.pipe(\n\t\t\t\tswitchMap((time: number) =>\n\t\t\t\t\tthis.value$.pipe(\n\t\t\t\t\t\tskip(1),\n\t\t\t\t\t\t// switchMap + timer instead of debounceTime: debounceTime flushes its pending value when the source completes, while here takeUntilDestroyed unsubscribes and the pending timer is dropped\n\t\t\t\t\t\tswitchMap((value) => timer(time).pipe(map(() => value))),\n\t\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntilDestroyed(),\n\t\t\t)\n\t\t\t.subscribe((value) => {\n\t\t\t\tthis.valueDebounced.emit(`${value}`);\n\t\t\t});\n\t}\n}\n","@let labelVar = label();\n\n<fieldset class=\"fieldset p-0\">\n\t@if (labelVar) {\n\t\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t\t<span\n\t\t\t\t>{{ labelVar }}\n\t\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t\t}\n\t\t\t</span>\n\t\t\t@if (showOptional()) {\n\t\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t\t}\n\t\t</legend>\n\t}\n\t<div [class]=\"validationClass()\">\n\t\t<!-- Left content -->\n\t\t<ng-content select=\"st-input-content[alignment='start']\"></ng-content>\n\n\t\t<!-- Input field -->\n\t\t<input\n\t\t\tclass=\"placeholder-base-placeholder w-full grow\"\n\t\t\t[id]=\"resolvedId()\"\n\t\t\t[attr.aria-required]=\"fieldA11y.required() || null\"\n\t\t\t[attr.aria-describedby]=\"fieldA11y.describedBy()\"\n\t\t\t[type]=\"nativeType()\"\n\t\t\t[attr.name]=\"name()\"\n\t\t\t[attr.placeholder]=\"placeholder()\"\n\t\t\t[(ngModel)]=\"value\"\n\t\t\t[disabled]=\"disabled()\"\n\t\t\t[readonly]=\"readonly()\"\n\t\t\t(ngModelChange)=\"handleChange()\"\n\t\t\t(keydown.enter)=\"handleEnter($event)\"\n\t\t\t(click)=\"handleClick($event)\"\n\t\t\t(blur)=\"handleBlur()\"\n\t\t\t[stOnlyNumbers]=\"onlyNumbers()\"\n\t\t\t[focus]=\"focus()\"\n\t\t\tstAutofocus\n\t\t/>\n\n\t\t<!-- Right content -->\n\t\t<ng-content select=\"st-input-content[alignment='end']\"></ng-content>\n\n\t\t@if (showPasswordToggle()) {\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdata-st-password-toggle\n\t\t\t\tclass=\"btn btn-ghost btn-square shrink-0 cursor-pointer [--fontsize:1em] [--size:1.25em]\"\n\t\t\t\t[attr.aria-label]=\"passwordToggleLabel()\"\n\t\t\t\t[attr.aria-controls]=\"resolvedId()\"\n\t\t\t\t[disabled]=\"disabled()\"\n\t\t\t\t(click)=\"togglePasswordVisibility()\"\n\t\t\t>\n\t\t\t\t<st-icon [icon]=\"passwordVisible() ? iconHidePassword : iconShowPassword\"></st-icon>\n\t\t\t</button>\n\t\t}\n\t</div>\n\n\t@if (labelVar) {\n\t\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ labelVar }}</label>\n\t}\n\n\t<!-- Additional content -->\n\t<ng-content select=\":not(st-input-content)\"></ng-content>\n</fieldset>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAWa,qBAAqB,CAAA;AACjC,IAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAwB;wGADtC,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAA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A;;4FAUjF,cAAc,EAAA,UAAA,EAAA,CAAA;kBAZ1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EACX,CAAC,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,SAAA,EACnF;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,cAAgB;AAC3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,6tEAAA,EAAA;;;AEpGF;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, model, output, booleanAttribute, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
@@ -113,7 +113,7 @@ class RadioComponent {
|
|
|
113
113
|
* Stop event propagation for activation events
|
|
114
114
|
* @defaultValue false
|
|
115
115
|
*/
|
|
116
|
-
stopPropagation = input(false);
|
|
116
|
+
stopPropagation = input(false, { transform: booleanAttribute });
|
|
117
117
|
/**
|
|
118
118
|
* Event emitted on click
|
|
119
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-radio.mjs","sources":["../../../projects/sdk/components/forms/radio/src/radio.component.ts","../../../projects/sdk/components/forms/radio/src/radio.component.html","../../../projects/sdk/components/forms/radio/sixbell-telco-sdk-components-forms-radio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\n/**\n * @internal\n * Generates base radio button classes with style variants\n */\nconst radioComponent = cva(['radio', 'font-body'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tbase: [],\n\t\t\tprimary: ['radio-primary'],\n\t\t\tsecondary: ['radio-secondary'],\n\t\t\ttertiary: ['radio-tertiary'],\n\t\t\taccent: ['radio-accent'],\n\t\t\tsuccess: ['radio-success'],\n\t\t\twarning: ['radio-warning'],\n\t\t\tinfo: ['radio-info'],\n\t\t\terror: ['radio-error'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['radio-xs'],\n\t\t\tsm: ['radio-sm'],\n\t\t\tmd: ['radio-md'],\n\t\t\tlg: ['radio-lg'],\n\t\t\txl: ['radio-xl'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'base',\n\t\tsize: 'md',\n\t},\n});\n\n/** Possible radio button color variants */\nexport type RadioVariantProps =\n\t'base' | 'primary' | 'secondary' | 'tertiary' | 'accent' | 'success' | 'warning' | 'info' | 'error' | null | undefined;\n\n/** Possible radio button size variants */\nexport type RadioSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for radio button styling */\nexport type RadioProps = {\n\tvariant?: RadioVariantProps;\n\tsize?: RadioSizeProps;\n};\n\n/**\n * A customizable radio button component with form integration\n *\n * @remarks\n * Implements ControlValueAccessor for seamless Angular form integration.\n * Supports grouped radio buttons through name attribute binding.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <st-radio value=\"option1\" [(selected)]=\"selectedOption\"></st-radio>\n * ```\n *\n * @example\n * ```html\n * <!-- Grouped radio buttons with labels -->\n * <st-radio\n * variant=\"success\"\n * size=\"lg\"\n * label=\"Option 1\"\n * value=\"opt1\"\n * name=\"options\"\n * [(selected)]=\"selectedOption\"\n * ></st-radio>\n * <st-radio\n * variant=\"success\"\n * size=\"lg\"\n * label=\"Option 2\"\n * value=\"opt2\"\n * name=\"options\"\n * [(selected)]=\"selectedOption\"\n * ></st-radio>\n * ```\n */\n@Component({\n\tselector: 'st-radio',\n\timports: [FormsModule],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RadioComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './radio.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RadioComponent implements ControlValueAccessor {\n\t/**\n\t * Radio button color variant\n\t * @defaultValue 'base'\n\t */\n\tvariant = input<RadioVariantProps>('base');\n\n\t/**\n\t * Radio button size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<RadioSizeProps>('md');\n\n\t/**\n\t * Label text displayed next to the radio button\n\t */\n\tlabel = input<string>('');\n\n\t/**\n\t * Group name for radio button selection\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * The value associated with this radio button\n\t */\n\tvalue = input.required<any>();\n\n\t/**\n\t * Two-way bindable selected value for radio group\n\t */\n\tselected = model<any>();\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t/**\n\t * Event emitted when radio button is selected\n\t */\n\tvalueUpdated = output<any>();\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input<boolean>(false);\n\n\t/**\n\t * Event emitted on click\n\t */\n\tclicked = output<MouseEvent>();\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on Space keydown\n\t */\n\tkeyDownSpace = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (click or keyboard)\n\t */\n\ttriggered = output<void>();\n\n\t// ControlValueAccessor implementation\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Whether the radio button is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * @internal\n\t * Computed class string for the radio button\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\tradioComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t);\n\t});\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.selected.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles radio button selection changes\n\t */\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.valueUpdated.emit(this.value());\n\t\tthis.selected.set(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t/**\n\t * @internal\n\t * Handles click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.clicked.emit(event);\n\t\tthis.triggered.emit();\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter keydown activation\n\t */\n\thandleKeyDownEnter(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Space keydown activation\n\t */\n\thandleKeyDownSpace(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownSpace.emit(event as KeyboardEvent);\n\t}\n}\n","<label class=\"fieldset-label text-base-content font-body font-normal text-pretty\">\n\t<input\n\t\ttype=\"radio\"\n\t\t[class]=\"componentClass()\"\n\t\t[value]=\"value()\"\n\t\t[checked]=\"selected() === value()\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\t/>\n\t{{ label() }}\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;AAMA;;;AAGG;AACH,MAAM,cAAc,GAAG,GAAG,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE;AAClD,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,SAAS,EAAE,CAAC,iBAAiB,CAAC;YAC9B,QAAQ,EAAE,CAAC,gBAAgB,CAAC;YAC5B,MAAM,EAAE,CAAC,cAAc,CAAC;YACxB,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,KAAK,EAAE,CAAC,aAAa,CAAC;AACtB,SAAA;AACD,QAAA,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;AAChB,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE,EAA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ACD,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC9FF,kgBAgBA,2CDuEW,WAAW,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAWT,cAAc,EAAA,UAAA,EAAA,CAAA;kBAb1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,OAAA,EACX,CAAC,WAAW,CAAC,EAAA,SAAA,EACX;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,cAAgB;AAC3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kgBAAA,EAAA;;;AEhGhD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-radio.mjs","sources":["../../../projects/sdk/components/forms/radio/src/radio.component.ts","../../../projects/sdk/components/forms/radio/src/radio.component.html","../../../projects/sdk/components/forms/radio/sixbell-telco-sdk-components-forms-radio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { booleanAttribute, ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\n/**\n * @internal\n * Generates base radio button classes with style variants\n */\nconst radioComponent = cva(['radio', 'font-body'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tbase: [],\n\t\t\tprimary: ['radio-primary'],\n\t\t\tsecondary: ['radio-secondary'],\n\t\t\ttertiary: ['radio-tertiary'],\n\t\t\taccent: ['radio-accent'],\n\t\t\tsuccess: ['radio-success'],\n\t\t\twarning: ['radio-warning'],\n\t\t\tinfo: ['radio-info'],\n\t\t\terror: ['radio-error'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['radio-xs'],\n\t\t\tsm: ['radio-sm'],\n\t\t\tmd: ['radio-md'],\n\t\t\tlg: ['radio-lg'],\n\t\t\txl: ['radio-xl'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'base',\n\t\tsize: 'md',\n\t},\n});\n\n/** Possible radio button color variants */\nexport type RadioVariantProps =\n\t'base' | 'primary' | 'secondary' | 'tertiary' | 'accent' | 'success' | 'warning' | 'info' | 'error' | null | undefined;\n\n/** Possible radio button size variants */\nexport type RadioSizeProps = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | null | undefined;\n\n/** Configuration object for radio button styling */\nexport type RadioProps = {\n\tvariant?: RadioVariantProps;\n\tsize?: RadioSizeProps;\n};\n\n/**\n * A customizable radio button component with form integration\n *\n * @remarks\n * Implements ControlValueAccessor for seamless Angular form integration.\n * Supports grouped radio buttons through name attribute binding.\n *\n * @example\n * ```html\n * <!-- Basic usage -->\n * <st-radio value=\"option1\" [(selected)]=\"selectedOption\"></st-radio>\n * ```\n *\n * @example\n * ```html\n * <!-- Grouped radio buttons with labels -->\n * <st-radio\n * variant=\"success\"\n * size=\"lg\"\n * label=\"Option 1\"\n * value=\"opt1\"\n * name=\"options\"\n * [(selected)]=\"selectedOption\"\n * ></st-radio>\n * <st-radio\n * variant=\"success\"\n * size=\"lg\"\n * label=\"Option 2\"\n * value=\"opt2\"\n * name=\"options\"\n * [(selected)]=\"selectedOption\"\n * ></st-radio>\n * ```\n */\n@Component({\n\tselector: 'st-radio',\n\timports: [FormsModule],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RadioComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './radio.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RadioComponent implements ControlValueAccessor {\n\t/**\n\t * Radio button color variant\n\t * @defaultValue 'base'\n\t */\n\tvariant = input<RadioVariantProps>('base');\n\n\t/**\n\t * Radio button size variant\n\t * @defaultValue 'md'\n\t */\n\tsize = input<RadioSizeProps>('md');\n\n\t/**\n\t * Label text displayed next to the radio button\n\t */\n\tlabel = input<string>('');\n\n\t/**\n\t * Group name for radio button selection\n\t */\n\tname = input<string | null>(null);\n\n\t/**\n\t * The value associated with this radio button\n\t */\n\tvalue = input.required<any>();\n\n\t/**\n\t * Two-way bindable selected value for radio group\n\t */\n\tselected = model<any>();\n\n\t/**\n\t * Parent form group for reactive forms\n\t */\n\tparentForm = input<FormGroup | null>(null);\n\n\t/**\n\t * Form control name for reactive forms\n\t */\n\tformControlName = input<string>('');\n\n\t/**\n\t * Event emitted when radio button is selected\n\t */\n\tvalueUpdated = output<any>();\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input(false, { transform: booleanAttribute });\n\n\t/**\n\t * Event emitted on click\n\t */\n\tclicked = output<MouseEvent>();\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on Space keydown\n\t */\n\tkeyDownSpace = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (click or keyboard)\n\t */\n\ttriggered = output<void>();\n\n\t// ControlValueAccessor implementation\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\n\t/**\n\t * Whether the radio button is disabled\n\t * @defaultValue false\n\t */\n\tdisabled = model<boolean>(false);\n\n\t/**\n\t * @internal\n\t * Computed class string for the radio button\n\t */\n\tcomponentClass = computed(() => {\n\t\treturn cn(\n\t\t\tradioComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t);\n\t});\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.selected.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles radio button selection changes\n\t */\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.valueUpdated.emit(this.value());\n\t\tthis.selected.set(this.value());\n\t}\n\n\t/**\n\t * @internal\n\t * Handles blur event\n\t */\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t/**\n\t * @internal\n\t * Handles click activation\n\t */\n\thandleClick(event: MouseEvent): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.clicked.emit(event);\n\t\tthis.triggered.emit();\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Enter keydown activation\n\t */\n\thandleKeyDownEnter(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t}\n\n\t/**\n\t * @internal\n\t * Handles Space keydown activation\n\t */\n\thandleKeyDownSpace(event: Event): void {\n\t\tif (this.disabled()) return;\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownSpace.emit(event as KeyboardEvent);\n\t}\n}\n","<label class=\"fieldset-label text-base-content font-body font-normal text-pretty\">\n\t<input\n\t\ttype=\"radio\"\n\t\t[class]=\"componentClass()\"\n\t\t[value]=\"value()\"\n\t\t[checked]=\"selected() === value()\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\t/>\n\t{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C3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAAA,eAAA,EAEgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kgBAAA,EAAA;;;AEhGhD;;AAEG;;;;"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, computed, model, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
5
|
import { TranslatePipe } from '@ngx-translate/core';
|
|
6
|
+
import { optionalBooleanAttribute, injectFormFieldA11y } from '@sixbell-telco/sdk/components/forms/form-item';
|
|
6
7
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
8
|
+
import { injectLabelTranslator } from '@sixbell-telco/sdk/utils/translation';
|
|
7
9
|
import { cva } from 'class-variance-authority';
|
|
8
10
|
|
|
9
11
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -85,12 +87,22 @@ class RangeComponent {
|
|
|
85
87
|
* Whether to show optional indicator
|
|
86
88
|
* @defaultValue false
|
|
87
89
|
*/
|
|
88
|
-
showOptional = input(false);
|
|
90
|
+
showOptional = input(false, { transform: booleanAttribute });
|
|
89
91
|
/**
|
|
90
92
|
* Optional indicator text (translation key or literal)
|
|
91
93
|
* @defaultValue 'sdk.formFields.optional'
|
|
92
94
|
*/
|
|
93
95
|
optionalText = input('sdk.formFields.optional');
|
|
96
|
+
/**
|
|
97
|
+
* Mark the field as required: shows the `*` marker and announces the field as required.
|
|
98
|
+
* When not set, the enclosing `st-form-item` `required`, then `Validators.required` on the bound control decide.
|
|
99
|
+
*/
|
|
100
|
+
required = input(undefined, { transform: optionalBooleanAttribute });
|
|
101
|
+
/** @internal Required state and hint ids from the enclosing `st-form-item`. */
|
|
102
|
+
fieldA11y = injectFormFieldA11y({
|
|
103
|
+
required: () => this.required(),
|
|
104
|
+
control: () => this.parentForm()?.get(this.formControlName()),
|
|
105
|
+
});
|
|
94
106
|
/**
|
|
95
107
|
* HTML name attribute for the range slider
|
|
96
108
|
*/
|
|
@@ -103,6 +115,16 @@ class RangeComponent {
|
|
|
103
115
|
generatedId = `st-range-${nextRangeId++}`;
|
|
104
116
|
/** @internal Id applied to the focusable control and referenced by its label */
|
|
105
117
|
resolvedId = computed(() => this.inputId() || this.generatedId);
|
|
118
|
+
translateLabel = injectLabelTranslator();
|
|
119
|
+
/** @internal Id of the visually hidden "Required" note; `aria-required` is not allowed on the slider role. */
|
|
120
|
+
requiredNoteId = computed(() => `${this.resolvedId()}-required`);
|
|
121
|
+
/** @internal */
|
|
122
|
+
requiredNote = computed(() => this.translateLabel({ key: 'sdk.formFields.required', fallback: 'Required' }));
|
|
123
|
+
/** @internal Hint ids plus the required note, for the slider's `aria-describedby`. */
|
|
124
|
+
describedBy = computed(() => {
|
|
125
|
+
const ids = [this.fieldA11y.describedBy(), this.fieldA11y.required() ? this.requiredNoteId() : null].filter(Boolean);
|
|
126
|
+
return ids.length ? ids.join(' ') : null;
|
|
127
|
+
});
|
|
106
128
|
/**
|
|
107
129
|
* Minimum value of the range slider
|
|
108
130
|
* @defaultValue 0
|
|
@@ -117,7 +139,7 @@ class RangeComponent {
|
|
|
117
139
|
* Whether to show min/max values
|
|
118
140
|
* @defaultValue true
|
|
119
141
|
*/
|
|
120
|
-
showRange = input(true);
|
|
142
|
+
showRange = input(true, { transform: booleanAttribute });
|
|
121
143
|
/**
|
|
122
144
|
* Number of steps to display (0 for continuous)
|
|
123
145
|
* @defaultValue 0
|
|
@@ -170,7 +192,7 @@ class RangeComponent {
|
|
|
170
192
|
* Stop event propagation for activation events
|
|
171
193
|
* @defaultValue false
|
|
172
194
|
*/
|
|
173
|
-
stopPropagation = input(false);
|
|
195
|
+
stopPropagation = input(false, { transform: booleanAttribute });
|
|
174
196
|
/**
|
|
175
197
|
* Event emitted on click
|
|
176
198
|
*/
|
|
@@ -238,13 +260,13 @@ class RangeComponent {
|
|
|
238
260
|
this.pointerDown.emit(event);
|
|
239
261
|
}
|
|
240
262
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: RangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
241
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: RangeComponent, isStandalone: true, selector: "st-range", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, showRange: { classPropertyName: "showRange", publicName: "showRange", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", valueUpdated: "valueUpdated", clicked: "clicked", pointerDown: "pointerDown", triggered: "triggered" }, providers: [
|
|
263
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: RangeComponent, isStandalone: true, selector: "st-range", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showOptional: { classPropertyName: "showOptional", publicName: "showOptional", isSignal: true, isRequired: false, transformFunction: null }, optionalText: { classPropertyName: "optionalText", publicName: "optionalText", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, showRange: { classPropertyName: "showRange", publicName: "showRange", isSignal: true, isRequired: false, transformFunction: null }, steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", valueUpdated: "valueUpdated", clicked: "clicked", pointerDown: "pointerDown", triggered: "triggered" }, providers: [
|
|
242
264
|
{
|
|
243
265
|
provide: NG_VALUE_ACCESSOR,
|
|
244
266
|
useExisting: RangeComponent,
|
|
245
267
|
multi: true,
|
|
246
268
|
},
|
|
247
|
-
], ngImport: i0, template: "@if (label()) {\n\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t<span>{{ label() }}</span>\n\t\t@if (showOptional()) {\n\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t}\n\t</legend>\n}\n\n<div class=\"font-body w-full text-pretty\">\n\t<input\n\t\t[class]=\"componentClass()\"\n\t\t[id]=\"resolvedId()\"\n\t\t[attr.name]=\"name()\"\n\t\ttype=\"range\"\n\t\t[min]=\"min()\"\n\t\t[max]=\"max()\"\n\t\t[step]=\"jumpSize()\"\n\t\t[value]=\"value()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(pointerdown)=\"handlePointerDown($event)\"\n\t/>\n\t@if (steps() > 0 && !showRange()) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() <= 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() > 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n</div>\n\n@if (label()) {\n\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label() }}</label>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
269
|
+
], ngImport: i0, template: "@if (label()) {\n\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t<span\n\t\t\t>{{ label() }}\n\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t}\n\t\t</span>\n\t\t@if (showOptional()) {\n\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t}\n\t</legend>\n}\n\n<div class=\"font-body w-full text-pretty\">\n\t<input\n\t\t[class]=\"componentClass()\"\n\t\t[id]=\"resolvedId()\"\n\t\t[attr.aria-describedby]=\"describedBy()\"\n\t\t[attr.name]=\"name()\"\n\t\ttype=\"range\"\n\t\t[min]=\"min()\"\n\t\t[max]=\"max()\"\n\t\t[step]=\"jumpSize()\"\n\t\t[value]=\"value()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(pointerdown)=\"handlePointerDown($event)\"\n\t/>\n\t@if (steps() > 0 && !showRange()) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() <= 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() > 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n</div>\n\n@if (fieldA11y.required()) {\n\t<span class=\"sr-only\" [id]=\"requiredNoteId()\">{{ requiredNote() }}</span>\n}\n\n@if (label()) {\n\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label() }}</label>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
248
270
|
}
|
|
249
271
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: RangeComponent, decorators: [{
|
|
250
272
|
type: Component,
|
|
@@ -254,7 +276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
254
276
|
useExisting: RangeComponent,
|
|
255
277
|
multi: true,
|
|
256
278
|
},
|
|
257
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label()) {\n\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t<span>{{ label() }}</span>\n\t\t@if (showOptional()) {\n\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t}\n\t</legend>\n}\n\n<div class=\"font-body w-full text-pretty\">\n\t<input\n\t\t[class]=\"componentClass()\"\n\t\t[id]=\"resolvedId()\"\n\t\t[attr.name]=\"name()\"\n\t\ttype=\"range\"\n\t\t[min]=\"min()\"\n\t\t[max]=\"max()\"\n\t\t[step]=\"jumpSize()\"\n\t\t[value]=\"value()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(pointerdown)=\"handlePointerDown($event)\"\n\t/>\n\t@if (steps() > 0 && !showRange()) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() <= 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() > 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n</div>\n\n@if (label()) {\n\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label() }}</label>\n}\n" }]
|
|
279
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label()) {\n\t<legend class=\"fieldset-legend font-body w-full items-center justify-between gap-2 pt-0 font-normal text-pretty\">\n\t\t<span\n\t\t\t>{{ label() }}\n\t\t\t@if (fieldA11y.required()) {\n\t\t\t\t<span aria-hidden=\"true\" data-st-required-marker class=\"text-error-strong ms-0.5\">*</span>\n\t\t\t}\n\t\t</span>\n\t\t@if (showOptional()) {\n\t\t\t<span class=\"label font-body text-xs font-normal\">{{ optionalText() | translate }}</span>\n\t\t}\n\t</legend>\n}\n\n<div class=\"font-body w-full text-pretty\">\n\t<input\n\t\t[class]=\"componentClass()\"\n\t\t[id]=\"resolvedId()\"\n\t\t[attr.aria-describedby]=\"describedBy()\"\n\t\t[attr.name]=\"name()\"\n\t\ttype=\"range\"\n\t\t[min]=\"min()\"\n\t\t[max]=\"max()\"\n\t\t[step]=\"jumpSize()\"\n\t\t[value]=\"value()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(click)=\"handleClick($event)\"\n\t\t(pointerdown)=\"handlePointerDown($event)\"\n\t/>\n\t@if (steps() > 0 && !showRange()) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() <= 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n\n\t@if (showRange() && steps() > 0) {\n\t\t<div class=\"mt-2 flex justify-between px-2.5 text-xs\">\n\t\t\t<span>{{ min() }}</span>\n\t\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t\t<span>|</span>\n\t\t\t}\n\t\t\t<span>{{ max() }}</span>\n\t\t</div>\n\t}\n</div>\n\n@if (fieldA11y.required()) {\n\t<span class=\"sr-only\" [id]=\"requiredNoteId()\">{{ requiredNote() }}</span>\n}\n\n@if (label()) {\n\t<label class=\"sr-only\" [for]=\"resolvedId()\">{{ label() }}</label>\n}\n" }]
|
|
258
280
|
}] });
|
|
259
281
|
|
|
260
282
|
/**
|