@seniorsistemas/scala-ng 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/autocomplete/README.md +5 -1
- package/autocomplete/public-api.d.ts +2 -2
- package/autocomplete/src/autocomplete/autocomplete.component.d.ts +6 -6
- package/autocomplete/src/autocomplete/autocomplete.models.d.ts +2 -2
- package/autocomplete/src/autocomplete/panel/autocomplete-panel.component.d.ts +1 -1
- package/avatar-summary/README.md +1 -1
- package/avatar-summary/public-api.d.ts +2 -2
- package/avatar-summary/src/avatar-summary/avatar-summary.component.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.models.d.ts +3 -3
- package/avatar-summary/src/avatar-summary/avatar-summary.tokens.d.ts +1 -1
- package/avatar-summary/src/avatar-summary/avatar-summary.utils.d.ts +1 -1
- package/badge/README.md +1 -1
- package/badge/public-api.d.ts +1 -1
- package/badge/src/badge/badge.component.d.ts +1 -1
- package/banner/README.md +1 -1
- package/banner/public-api.d.ts +3 -3
- package/banner/src/banner/banner.component.d.ts +2 -2
- package/banner/src/banner/banner.models.d.ts +1 -1
- package/banner/src/banner-trigger/banner-trigger.directive.d.ts +2 -2
- package/breadcrumb/README.md +7 -7
- package/breadcrumb/public-api.d.ts +5 -5
- package/breadcrumb/src/breadcrumb/breadcrumb.component.d.ts +2 -2
- package/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.d.ts +2 -2
- package/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.d.ts +3 -3
- package/button/README.md +5 -1
- package/button/public-api.d.ts +1 -1
- package/button/src/button/button.component.d.ts +1 -1
- package/card/README.md +1 -1
- package/card/public-api.d.ts +1 -1
- package/card/src/card/card.component.d.ts +4 -4
- package/checkbox/README.md +5 -5
- package/checkbox/public-api.d.ts +1 -1
- package/checkbox/src/checkbox/checkbox.component.d.ts +1 -1
- package/content-lifecycle/README.md +2 -2
- package/content-lifecycle/public-api.d.ts +2 -2
- package/content-lifecycle/src/content-lifecycle/content-lifecycle.component.d.ts +2 -2
- package/content-lifecycle/src/content-lifecycle/content-lifecycle.models.d.ts +2 -2
- package/date-picker/README.md +6 -6
- package/date-picker/public-api.d.ts +3 -3
- package/date-picker/src/date-picker/date-format.utils.d.ts +2 -2
- package/date-picker/src/date-picker/datepicker.component.d.ts +7 -7
- package/display-tag/README.md +2 -2
- package/display-tag/public-api.d.ts +2 -2
- package/display-tag/src/display-tag/display-tag.component.d.ts +5 -5
- package/drawer/README.md +9 -9
- package/drawer/public-api.d.ts +1 -1
- package/drawer/src/drawer/drawer.component.d.ts +4 -4
- package/empty-state/README.md +1 -1
- package/empty-state/public-api.d.ts +2 -2
- package/empty-state/src/empty-state/empty-state.component.d.ts +1 -1
- package/empty-state/src/empty-state/empty-state.models.d.ts +2 -2
- package/esm2022/autocomplete/public-api.mjs +2 -2
- package/esm2022/autocomplete/src/autocomplete/autocomplete.component.mjs +55 -55
- package/esm2022/autocomplete/src/autocomplete/autocomplete.models.mjs +1 -1
- package/esm2022/autocomplete/src/autocomplete/panel/autocomplete-panel.component.mjs +12 -12
- package/esm2022/avatar-summary/public-api.mjs +2 -2
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.component.mjs +24 -24
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.models.mjs +1 -1
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.tokens.mjs +46 -46
- package/esm2022/avatar-summary/src/avatar-summary/avatar-summary.utils.mjs +4 -4
- package/esm2022/badge/public-api.mjs +2 -2
- package/esm2022/badge/src/badge/badge.component.mjs +25 -25
- package/esm2022/banner/public-api.mjs +3 -3
- package/esm2022/banner/src/banner/banner.component.mjs +33 -33
- package/esm2022/banner/src/banner/banner.models.mjs +1 -1
- package/esm2022/banner/src/banner-trigger/banner-trigger.directive.mjs +11 -11
- package/esm2022/breadcrumb/public-api.mjs +3 -3
- package/esm2022/breadcrumb/src/breadcrumb/breadcrumb.component.mjs +13 -13
- package/esm2022/breadcrumb/src/breadcrumb-item/breadcrumb-item.component.mjs +13 -13
- package/esm2022/breadcrumb/src/breadcrumb-router/breadcrumb-router.component.mjs +11 -11
- package/esm2022/breadcrumb/src/breadcrumb-truncator/breadcrumb-truncator.component.mjs +24 -24
- package/esm2022/button/public-api.mjs +2 -2
- package/esm2022/button/src/button/button.component.mjs +23 -23
- package/esm2022/card/public-api.mjs +2 -2
- package/esm2022/card/src/card/card.component.mjs +37 -37
- package/esm2022/checkbox/public-api.mjs +2 -2
- package/esm2022/checkbox/src/checkbox/checkbox.component.mjs +5 -5
- package/esm2022/content-lifecycle/public-api.mjs +2 -2
- package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.component.mjs +15 -15
- package/esm2022/content-lifecycle/src/content-lifecycle/content-lifecycle.models.mjs +1 -1
- package/esm2022/date-picker/public-api.mjs +3 -3
- package/esm2022/date-picker/src/date-picker/date-format.utils.mjs +39 -39
- package/esm2022/date-picker/src/date-picker/date.utils.mjs +15 -15
- package/esm2022/date-picker/src/date-picker/datepicker.component.mjs +122 -122
- package/esm2022/display-tag/public-api.mjs +2 -2
- package/esm2022/display-tag/src/display-tag/display-tag.component.mjs +36 -36
- package/esm2022/drawer/public-api.mjs +2 -2
- package/esm2022/drawer/src/drawer/drawer.component.mjs +37 -37
- package/esm2022/empty-state/public-api.mjs +2 -2
- package/esm2022/empty-state/src/empty-state/empty-state.component.mjs +26 -26
- package/esm2022/empty-state/src/empty-state/empty-state.models.mjs +1 -1
- package/esm2022/filter-tag/public-api.mjs +2 -2
- package/esm2022/filter-tag/src/filter-tag/filter-tag.component.mjs +12 -12
- package/esm2022/form-field/public-api.mjs +2 -2
- package/esm2022/form-field/src/form-field/form-field.component.mjs +26 -26
- package/esm2022/input/public-api.mjs +2 -2
- package/esm2022/input/src/input/input.component.mjs +55 -44
- package/esm2022/input-feedback/public-api.mjs +2 -2
- package/esm2022/input-feedback/src/input-feedback/input-feedback.component.mjs +12 -12
- package/esm2022/item-strip/public-api.mjs +2 -2
- package/esm2022/item-strip/src/item-strip/item-strip.component.mjs +14 -14
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.component.mjs +37 -37
- package/esm2022/item-strip/src/item-strip-item/item-strip-item.mjs +1 -1
- package/esm2022/lib/a11y/focusable-item.utils.mjs +2 -2
- package/esm2022/lib/chip/chip.utils.mjs +15 -15
- package/esm2022/lib/combobox/combobox.utils.mjs +8 -8
- package/esm2022/lib/forms/control-state.utils.mjs +4 -4
- package/esm2022/lib/overlay/aria-hide.utils.mjs +10 -10
- package/esm2022/lib/overlay/exclusive-dialog.utils.mjs +22 -0
- package/esm2022/lib/overlay/scroll-lock.utils.mjs +5 -5
- package/esm2022/lib/overlay/scrollable-region.utils.mjs +34 -0
- package/esm2022/lib/theme/create-theme.mjs +7 -7
- package/esm2022/lib/theme/semantic-tokens.mjs +1 -1
- package/esm2022/lib/theme/theme.service.mjs +15 -15
- package/esm2022/list/public-api.mjs +2 -2
- package/esm2022/list/src/list/list-id-generator.mjs +4 -4
- package/esm2022/list/src/list/list.component.mjs +16 -16
- package/esm2022/list/src/list/list.models.mjs +2 -2
- package/esm2022/list/src/list/list.tokens.mjs +30 -30
- package/esm2022/list/src/list-group/list-group.component.mjs +7 -7
- package/esm2022/list/src/list-item/list-item-title.utils.mjs +3 -3
- package/esm2022/list/src/list-item/list-item.component.mjs +47 -47
- package/esm2022/loading-state/public-api.mjs +4 -0
- package/esm2022/loading-state/seniorsistemas-scala-ng-loading-state.mjs +5 -0
- package/esm2022/loading-state/src/loading-state/loading-state.directive.mjs +203 -0
- package/esm2022/loading-state/src/loading-state/loading-state.types.mjs +2 -0
- package/esm2022/loading-state/src/loading-state/loading-visibility.utils.mjs +60 -0
- package/esm2022/loading-state/src/pulse/pulse.component.mjs +71 -0
- package/esm2022/loading-state/src/pulse/senior-isotype.component.mjs +11 -0
- package/esm2022/loading-state/src/spinner/loading-spinner.component.mjs +13 -0
- package/esm2022/locale/fallback.mjs +135 -129
- package/esm2022/locale/public-api.mjs +2 -2
- package/esm2022/mask/public-api.mjs +5 -5
- package/esm2022/mask/src/mask/mask.directive.mjs +67 -67
- package/esm2022/mask/src/mask/mask.pipe.mjs +10 -10
- package/esm2022/mask/src/mask/mask.tokens.mjs +16 -16
- package/esm2022/mask/src/mask/mask.utils.mjs +25 -25
- package/esm2022/modal/public-api.mjs +4 -0
- package/esm2022/modal/seniorsistemas-scala-ng-modal.mjs +5 -0
- package/esm2022/modal/src/modal/modal-ref.mjs +84 -0
- package/esm2022/modal/src/modal/modal.component.mjs +262 -0
- package/esm2022/modal/src/modal/modal.service.mjs +119 -0
- package/esm2022/page-header/public-api.mjs +2 -2
- package/esm2022/page-header/src/page-header/page-header.component.mjs +14 -14
- package/esm2022/paginator/public-api.mjs +2 -2
- package/esm2022/paginator/src/paginator/paginator.component.mjs +29 -29
- package/esm2022/panel/public-api.mjs +2 -2
- package/esm2022/panel/src/panel/panel.component.mjs +21 -21
- package/esm2022/progress-bar/public-api.mjs +3 -3
- package/esm2022/progress-bar/src/progress-bar/progress-bar.component.mjs +33 -33
- package/esm2022/progress-bar/src/progress-bar/progress-bar.utils.mjs +5 -5
- package/esm2022/public-api.mjs +11 -9
- package/esm2022/radio-button/public-api.mjs +3 -3
- package/esm2022/radio-button/src/radio-button/radio-button.component.mjs +7 -7
- package/esm2022/radio-button/src/radio-button-group/radio-button-group-error.token.mjs +3 -3
- package/esm2022/radio-button/src/radio-button-group/radio-button-group.component.mjs +7 -7
- package/esm2022/radio-button/src/services/radio-button-registry.service.mjs +4 -4
- package/esm2022/select/public-api.mjs +2 -2
- package/esm2022/select/src/select/select.component.mjs +89 -89
- package/esm2022/select-button/public-api.mjs +2 -2
- package/esm2022/select-button/src/select-button/select-button.component.mjs +131 -131
- package/esm2022/selection-chip/public-api.mjs +2 -2
- package/esm2022/selection-chip/src/selection-chip/selection-chip.component.mjs +24 -24
- package/esm2022/slider/public-api.mjs +2 -2
- package/esm2022/slider/src/slider/slider.component.mjs +82 -82
- package/esm2022/slider/src/slider/slider.types.mjs +1 -1
- package/esm2022/spinner/public-api.mjs +2 -2
- package/esm2022/spinner/src/spinner/spinner.component.mjs +6 -3
- package/esm2022/split-button/public-api.mjs +2 -0
- package/esm2022/split-button/seniorsistemas-scala-ng-split-button.mjs +5 -0
- package/esm2022/split-button/src/split-button/split-button.component.mjs +71 -0
- package/esm2022/stats-card/public-api.mjs +2 -2
- package/esm2022/stats-card/src/stats-card/stats-card.component.mjs +63 -63
- package/esm2022/stats-card/src/stats-card/stats-card.models.mjs +1 -1
- package/esm2022/switch/public-api.mjs +2 -2
- package/esm2022/switch/src/switch/switch.component.mjs +8 -8
- package/esm2022/table/public-api.mjs +3 -3
- package/esm2022/table/src/components/actions-cell/table-actions-cell.component.mjs +7 -7
- package/esm2022/table/src/components/expand-cell/table-expand-cell.component.mjs +4 -4
- package/esm2022/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.mjs +4 -4
- package/esm2022/table/src/components/fields/base-table-field-config.mjs +1 -1
- package/esm2022/table/src/components/fields/date-field-table/date-field-table.component.mjs +11 -11
- package/esm2022/table/src/components/fields/number-field-table/number-field-table.component.mjs +3 -3
- package/esm2022/table/src/components/fields/rich-field-table/rich-field-table.component.mjs +9 -9
- package/esm2022/table/src/components/fields/string-field-table/string-field-table.component.mjs +3 -3
- package/esm2022/table/src/components/filter-row/table-filter-row.component.mjs +10 -10
- package/esm2022/table/src/components/row-group-header/table-row-group-header.component.mjs +6 -6
- package/esm2022/table/src/components/selection-cell/table-selection-cell.component.mjs +10 -10
- package/esm2022/table/src/components/toolbar/table-toolbar.component.mjs +18 -18
- package/esm2022/table/src/directives/table-actions-column.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-body.directive.mjs +3 -3
- package/esm2022/table/src/directives/table-cell.directive.mjs +9 -9
- package/esm2022/table/src/directives/table-container.directive.mjs +5 -5
- package/esm2022/table/src/directives/table-field.directive.mjs +10 -10
- package/esm2022/table/src/directives/table-grid.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-header-cell.directive.mjs +17 -17
- package/esm2022/table/src/directives/table-header-row.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-paginator-container.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-row-detail-cell.directive.mjs +4 -4
- package/esm2022/table/src/directives/table-row.directive.mjs +10 -10
- package/esm2022/table/src/fields/avatar-summary-table-header.mjs +1 -1
- package/esm2022/table/src/fields/date-table-header.mjs +1 -1
- package/esm2022/table/src/fields/date-utc.utils.mjs +6 -6
- package/esm2022/table/src/fields/number-table-header.mjs +1 -1
- package/esm2022/table/src/fields/rich-table-header.mjs +1 -1
- package/esm2022/table/src/fields/string-table-header.mjs +1 -1
- package/esm2022/table/src/fields/table-header.mjs +1 -1
- package/esm2022/table/src/registry/built-in-field-types.mjs +11 -11
- package/esm2022/table/src/registry/table-field-registry.mjs +7 -7
- package/esm2022/table/src/table/table-toolbar.models.mjs +1 -1
- package/esm2022/table/src/table/table.component.mjs +58 -58
- package/esm2022/table/src/table/table.models.mjs +1 -1
- package/esm2022/table/src/utils/table-filter.utils.mjs +7 -7
- package/esm2022/table/src/utils/table-group.utils.mjs +6 -6
- package/esm2022/table/src/utils/table-lazy-event.utils.mjs +2 -2
- package/esm2022/table/src/utils/table-selection.utils.mjs +4 -4
- package/esm2022/table/src/utils/table-sort.utils.mjs +9 -9
- package/esm2022/tiered-menu/public-api.mjs +2 -2
- package/esm2022/tiered-menu/src/tiered-menu-item-row/tiered-menu-item-row.directive.mjs +8 -8
- package/esm2022/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.mjs +16 -16
- package/esm2022/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.mjs +10 -10
- package/esm2022/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.mjs +18 -18
- package/esm2022/toast/public-api.mjs +3 -3
- package/esm2022/toast/src/toast/toast.component.mjs +16 -16
- package/esm2022/toast/src/toast/toast.models.mjs +1 -1
- package/esm2022/toast/src/toast-container/toast-container.component.mjs +20 -20
- package/esm2022/toast/src/toast.service.mjs +31 -31
- package/esm2022/tooltip/public-api.mjs +2 -2
- package/esm2022/tooltip/src/tooltip/tooltip-collision-registry.service.mjs +4 -4
- package/esm2022/tooltip/src/tooltip/tooltip-focus-origin.service.mjs +5 -5
- package/esm2022/tooltip/src/tooltip/tooltip.types.mjs +1 -1
- package/esm2022/tooltip/src/tooltip-panel/tooltip-panel.component.mjs +23 -23
- package/esm2022/tooltip/src/tooltip-trigger/tooltip-trigger.directive.mjs +93 -93
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs +51 -51
- package/fesm2022/seniorsistemas-scala-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs +64 -64
- package/fesm2022/seniorsistemas-scala-ng-avatar-summary.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-badge.mjs +22 -22
- package/fesm2022/seniorsistemas-scala-ng-badge.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs +32 -32
- package/fesm2022/seniorsistemas-scala-ng-banner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs +33 -33
- package/fesm2022/seniorsistemas-scala-ng-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-button.mjs +21 -21
- package/fesm2022/seniorsistemas-scala-ng-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-card.mjs +30 -30
- package/fesm2022/seniorsistemas-scala-ng-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs +1 -1
- package/fesm2022/seniorsistemas-scala-ng-checkbox.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs +12 -12
- package/fesm2022/seniorsistemas-scala-ng-content-lifecycle.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs +159 -159
- package/fesm2022/seniorsistemas-scala-ng-date-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs +33 -33
- package/fesm2022/seniorsistemas-scala-ng-display-tag.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs +29 -29
- package/fesm2022/seniorsistemas-scala-ng-drawer.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs +23 -23
- package/fesm2022/seniorsistemas-scala-ng-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs +7 -7
- package/fesm2022/seniorsistemas-scala-ng-filter-tag.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-form-field.mjs +22 -22
- package/fesm2022/seniorsistemas-scala-ng-form-field.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs +10 -10
- package/fesm2022/seniorsistemas-scala-ng-input-feedback.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-input.mjs +49 -38
- package/fesm2022/seniorsistemas-scala-ng-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs +39 -39
- package/fesm2022/seniorsistemas-scala-ng-item-strip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-list.mjs +84 -84
- package/fesm2022/seniorsistemas-scala-ng-list.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs +354 -0
- package/fesm2022/seniorsistemas-scala-ng-loading-state.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs +134 -128
- package/fesm2022/seniorsistemas-scala-ng-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-mask.mjs +106 -106
- package/fesm2022/seniorsistemas-scala-ng-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-modal.mjs +466 -0
- package/fesm2022/seniorsistemas-scala-ng-modal.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs +9 -9
- package/fesm2022/seniorsistemas-scala-ng-page-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs +20 -20
- package/fesm2022/seniorsistemas-scala-ng-paginator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs +14 -14
- package/fesm2022/seniorsistemas-scala-ng-panel.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs +31 -31
- package/fesm2022/seniorsistemas-scala-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs +6 -6
- package/fesm2022/seniorsistemas-scala-ng-radio-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs +122 -122
- package/fesm2022/seniorsistemas-scala-ng-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-select.mjs +76 -76
- package/fesm2022/seniorsistemas-scala-ng-select.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs +19 -19
- package/fesm2022/seniorsistemas-scala-ng-selection-chip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-slider.mjs +72 -72
- package/fesm2022/seniorsistemas-scala-ng-slider.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-spinner.mjs +4 -1
- package/fesm2022/seniorsistemas-scala-ng-spinner.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-split-button.mjs +78 -0
- package/fesm2022/seniorsistemas-scala-ng-split-button.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs +58 -58
- package/fesm2022/seniorsistemas-scala-ng-stats-card.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs +4 -4
- package/fesm2022/seniorsistemas-scala-ng-switch.mjs.map +1 -1
- package/fesm2022/{seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs → seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs} +2 -2
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-D_eZKncd.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs +27 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-C0Y1KaWD.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs +68 -0
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-C9s1ObGb.mjs.map +1 -0
- package/fesm2022/seniorsistemas-scala-ng-table.mjs +138 -138
- package/fesm2022/seniorsistemas-scala-ng-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs +35 -35
- package/fesm2022/seniorsistemas-scala-ng-tiered-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-toast.mjs +54 -54
- package/fesm2022/seniorsistemas-scala-ng-toast.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs +110 -110
- package/fesm2022/seniorsistemas-scala-ng-tooltip.mjs.map +1 -1
- package/fesm2022/seniorsistemas-scala-ng.mjs +110 -54
- package/fesm2022/seniorsistemas-scala-ng.mjs.map +1 -1
- package/filter-tag/README.md +1 -1
- package/filter-tag/public-api.d.ts +1 -1
- package/filter-tag/src/filter-tag/filter-tag.component.d.ts +1 -1
- package/form-field/public-api.d.ts +2 -2
- package/form-field/src/form-field/form-field.component.d.ts +14 -14
- package/input/README.md +13 -10
- package/input/public-api.d.ts +1 -1
- package/input/src/input/input.component.d.ts +8 -5
- package/input-feedback/README.md +7 -7
- package/input-feedback/public-api.d.ts +1 -1
- package/input-feedback/src/input-feedback/input-feedback.component.d.ts +2 -2
- package/item-strip/README.md +1 -1
- package/item-strip/public-api.d.ts +2 -2
- package/item-strip/src/item-strip/item-strip.component.d.ts +1 -1
- package/item-strip/src/item-strip-item/item-strip-item.component.d.ts +27 -27
- package/item-strip/src/item-strip-item/item-strip-item.d.ts +1 -1
- package/lib/a11y/focusable-item.utils.d.ts +1 -1
- package/lib/chip/chip.utils.d.ts +3 -3
- package/lib/combobox/combobox.utils.d.ts +2 -2
- package/lib/forms/control-state.utils.d.ts +2 -2
- package/lib/overlay/exclusive-dialog.utils.d.ts +7 -0
- package/lib/overlay/scrollable-region.utils.d.ts +5 -0
- package/lib/theme/create-theme.d.ts +2 -2
- package/lib/theme/semantic-tokens.d.ts +1 -1
- package/lib/theme/theme.service.d.ts +1 -1
- package/list/README.md +1 -1
- package/list/public-api.d.ts +2 -2
- package/list/src/list/list.component.d.ts +1 -1
- package/list/src/list/list.models.d.ts +5 -5
- package/list/src/list/list.tokens.d.ts +1 -1
- package/list/src/list-group/list-group.component.d.ts +1 -1
- package/list/src/list-item/list-item.component.d.ts +11 -11
- package/loading-state/README.md +60 -0
- package/loading-state/index.d.ts +5 -0
- package/loading-state/package.json +3 -0
- package/loading-state/public-api.d.ts +5 -0
- package/loading-state/src/loading-state/loading-state.directive.d.ts +37 -0
- package/loading-state/src/loading-state/loading-state.types.d.ts +3 -0
- package/loading-state/src/loading-state/loading-visibility.utils.d.ts +11 -0
- package/loading-state/src/pulse/pulse.component.d.ts +27 -0
- package/loading-state/src/pulse/senior-isotype.component.d.ts +5 -0
- package/loading-state/src/spinner/loading-spinner.component.d.ts +8 -0
- package/locale/public-api.d.ts +1 -1
- package/mask/README.md +1 -1
- package/mask/public-api.d.ts +4 -4
- package/mask/src/mask/mask.directive.d.ts +2 -2
- package/mask/src/mask/mask.pipe.d.ts +2 -2
- package/mask/src/mask/mask.utils.d.ts +1 -1
- package/modal/README.md +435 -0
- package/modal/index.d.ts +5 -0
- package/modal/package.json +3 -0
- package/modal/public-api.d.ts +3 -0
- package/modal/src/modal/modal-ref.d.ts +51 -0
- package/modal/src/modal/modal.component.d.ts +82 -0
- package/modal/src/modal/modal.service.d.ts +62 -0
- package/package.json +22 -1
- package/page-header/README.md +1 -1
- package/page-header/public-api.d.ts +1 -1
- package/page-header/src/page-header/page-header.component.d.ts +2 -2
- package/paginator/public-api.d.ts +2 -2
- package/paginator/src/paginator/paginator.component.d.ts +3 -3
- package/panel/README.md +1 -1
- package/panel/public-api.d.ts +1 -1
- package/panel/src/panel/panel.component.d.ts +3 -3
- package/progress-bar/README.md +4 -4
- package/progress-bar/public-api.d.ts +4 -4
- package/progress-bar/src/progress-bar/progress-bar.component.d.ts +3 -3
- package/progress-bar/src/progress-bar/progress-bar.utils.d.ts +1 -1
- package/public-api.d.ts +11 -9
- package/radio-button/README.md +1 -1
- package/radio-button/public-api.d.ts +3 -3
- package/radio-button/src/radio-button/radio-button.component.d.ts +2 -2
- package/radio-button/src/radio-button-group/radio-button-group-error.token.d.ts +1 -1
- package/radio-button/src/radio-button-group/radio-button-group.component.d.ts +3 -3
- package/radio-button/src/services/radio-button-registry.service.d.ts +1 -1
- package/schematics/migrate-spinner-to-loading-state/index.js +75 -0
- package/schematics/migrate-spinner-to-loading-state/index.js.map +1 -0
- package/schematics/migrations.json +10 -0
- package/schematics/ng-add/index.js +29 -29
- package/select/README.md +19 -15
- package/select/public-api.d.ts +2 -2
- package/select/src/select/select.component.d.ts +11 -11
- package/select-button/README.md +1 -1
- package/select-button/public-api.d.ts +2 -2
- package/select-button/src/select-button/select-button.component.d.ts +7 -7
- package/selection-chip/README.md +1 -1
- package/selection-chip/public-api.d.ts +1 -1
- package/selection-chip/src/selection-chip/selection-chip.component.d.ts +3 -3
- package/slider/README.md +6 -6
- package/slider/public-api.d.ts +2 -2
- package/slider/src/slider/slider.component.d.ts +3 -3
- package/slider/src/slider/slider.types.d.ts +3 -3
- package/spinner/README.md +9 -1
- package/spinner/public-api.d.ts +1 -1
- package/spinner/src/spinner/spinner.component.d.ts +3 -0
- package/split-button/README.md +208 -0
- package/split-button/index.d.ts +5 -0
- package/split-button/package.json +3 -0
- package/split-button/public-api.d.ts +1 -0
- package/split-button/src/split-button/split-button.component.d.ts +29 -0
- package/stats-card/README.md +1 -1
- package/stats-card/public-api.d.ts +2 -2
- package/stats-card/src/stats-card/stats-card.component.d.ts +415 -415
- package/stats-card/src/stats-card/stats-card.models.d.ts +3 -3
- package/styles/tailwind-preset.js +30 -13
- package/styles/tailwind-tokens.js +286 -286
- package/styles/tokens/index.scss +7 -7
- package/styles/tokens/semantic-colors.scss +4 -2
- package/styles.scss +7 -7
- package/switch/README.md +5 -5
- package/switch/public-api.d.ts +1 -1
- package/switch/src/switch/switch.component.d.ts +1 -1
- package/table/README.md +21 -21
- package/table/public-api.d.ts +12 -12
- package/table/src/components/actions-cell/table-actions-cell.component.d.ts +2 -2
- package/table/src/components/fields/avatar-summary-field-table/avatar-summary-field-table.component.d.ts +2 -2
- package/table/src/components/fields/base-table-field-config.d.ts +2 -2
- package/table/src/components/fields/date-field-table/date-field-table.component.d.ts +2 -2
- package/table/src/components/fields/number-field-table/number-field-table.component.d.ts +2 -2
- package/table/src/components/fields/rich-field-table/rich-field-table.component.d.ts +2 -2
- package/table/src/components/fields/string-field-table/string-field-table.component.d.ts +2 -2
- package/table/src/components/filter-row/table-filter-row.component.d.ts +1 -1
- package/table/src/components/selection-cell/table-selection-cell.component.d.ts +2 -2
- package/table/src/components/toolbar/table-toolbar.component.d.ts +3 -3
- package/table/src/directives/table-field.directive.d.ts +1 -1
- package/table/src/fields/avatar-summary-table-header.d.ts +4 -4
- package/table/src/fields/date-table-header.d.ts +3 -3
- package/table/src/fields/number-table-header.d.ts +3 -3
- package/table/src/fields/rich-table-header.d.ts +4 -4
- package/table/src/fields/string-table-header.d.ts +4 -4
- package/table/src/fields/table-header.d.ts +2 -2
- package/table/src/registry/built-in-field-types.d.ts +1 -1
- package/table/src/registry/table-field-registry.d.ts +4 -4
- package/table/src/table/table-toolbar.models.d.ts +1 -1
- package/table/src/table/table.component.d.ts +11 -11
- package/table/src/table/table.models.d.ts +2 -2
- package/table/src/utils/table-filter.utils.d.ts +1 -1
- package/table/src/utils/table-group.utils.d.ts +4 -4
- package/table/src/utils/table-lazy-event.utils.d.ts +3 -3
- package/table/src/utils/table-selection.utils.d.ts +2 -2
- package/table/src/utils/table-sort.utils.d.ts +2 -2
- package/tiered-menu/README.md +2 -2
- package/tiered-menu/public-api.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-panel/tiered-menu-panel.component.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-panel-host/tiered-menu-panel-host.component.d.ts +2 -2
- package/tiered-menu/src/tiered-menu-trigger/tiered-menu-trigger.directive.d.ts +2 -2
- package/toast/README.md +17 -17
- package/toast/public-api.d.ts +3 -3
- package/toast/src/toast/toast.component.d.ts +1 -1
- package/toast/src/toast/toast.models.d.ts +3 -3
- package/toast/src/toast-container/toast-container.component.d.ts +1 -1
- package/toast/src/toast.service.d.ts +5 -5
- package/tooltip/README.md +1 -1
- package/tooltip/public-api.d.ts +2 -2
- package/tooltip/src/tooltip/tooltip-focus-origin.service.d.ts +2 -2
- package/tooltip/src/tooltip/tooltip.types.d.ts +3 -3
- package/tooltip/src/tooltip-panel/tooltip-panel.component.d.ts +4 -4
- package/tooltip/src/tooltip-trigger/tooltip-trigger.directive.d.ts +2 -2
- package/fesm2022/seniorsistemas-scala-ng-table-table-actions-cell.component-DTzDhrMk.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs +0 -27
- package/fesm2022/seniorsistemas-scala-ng-table-table-filter-row.component-BgdQk6tM.mjs.map +0 -1
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs +0 -68
- package/fesm2022/seniorsistemas-scala-ng-table-table-toolbar.component-2YcqyPlh.mjs.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { SdsLoadingStateDirective } from './src/loading-state/loading-state.directive';
|
|
2
|
+
export type { SdsLoadingStateSize, SdsLoadingStateVariant, SdsPulseProgress, } from './src/loading-state/loading-state.types';
|
|
3
|
+
export { SdsPulseComponent } from './src/pulse/pulse.component';
|
|
4
|
+
export { SdsLoadingSpinnerComponent } from './src/spinner/loading-spinner.component';
|
|
5
|
+
export type { SdsLoadingSpinnerSize } from './src/spinner/loading-spinner.component';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SdsLoadingStateSize, SdsLoadingStateVariant, SdsPulseProgress } from './loading-state.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdsLoadingStateDirective {
|
|
4
|
+
private readonly templateRef;
|
|
5
|
+
private readonly viewContainerRef;
|
|
6
|
+
private readonly applicationRef;
|
|
7
|
+
private readonly environmentInjector;
|
|
8
|
+
private readonly injector;
|
|
9
|
+
private readonly renderer;
|
|
10
|
+
/** Whether the content is loading. The indicator only shows after 300 ms and stays at least 500 ms. */
|
|
11
|
+
readonly sdsLoadingState: import("@angular/core").InputSignal<boolean>;
|
|
12
|
+
/** `pulse` blocks the region with an overlay; `spinner` replaces the host content in place. */
|
|
13
|
+
readonly sdsLoadingStateVariant: import("@angular/core").InputSignal<SdsLoadingStateVariant>;
|
|
14
|
+
/** Indicator size: logo of 64px/40px in the pulse, 20px/16px in the spinner. */
|
|
15
|
+
readonly sdsLoadingStateSize: import("@angular/core").InputSignal<SdsLoadingStateSize>;
|
|
16
|
+
/** Status text of the pulse. Defaults to "Atualizando…" (translated). */
|
|
17
|
+
readonly sdsLoadingStateText: import("@angular/core").InputSignal<string | undefined>;
|
|
18
|
+
/** Hides the pulse status text visually; it is still announced to assistive technologies. */
|
|
19
|
+
readonly sdsLoadingStateTextHidden: import("@angular/core").InputSignal<boolean>;
|
|
20
|
+
/** Progress from 0 to 100, or `indeterminate` for a looping bar. Shows a progress bar in the pulse. */
|
|
21
|
+
readonly sdsLoadingStateProgress: import("@angular/core").InputSignal<SdsPulseProgress>;
|
|
22
|
+
private readonly view;
|
|
23
|
+
private readonly visibility;
|
|
24
|
+
private indicator;
|
|
25
|
+
private indicatorVariant;
|
|
26
|
+
private host;
|
|
27
|
+
private addedRelative;
|
|
28
|
+
private disabledChildren;
|
|
29
|
+
constructor();
|
|
30
|
+
private attach;
|
|
31
|
+
private detach;
|
|
32
|
+
private setBlocked;
|
|
33
|
+
private syncInputs;
|
|
34
|
+
private setInput;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsLoadingStateDirective, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SdsLoadingStateDirective, "[sdsLoadingState]", never, { "sdsLoadingState": { "alias": "sdsLoadingState"; "required": false; "isSignal": true; }; "sdsLoadingStateVariant": { "alias": "sdsLoadingStateVariant"; "required": false; "isSignal": true; }; "sdsLoadingStateSize": { "alias": "sdsLoadingStateSize"; "required": false; "isSignal": true; }; "sdsLoadingStateText": { "alias": "sdsLoadingStateText"; "required": false; "isSignal": true; }; "sdsLoadingStateTextHidden": { "alias": "sdsLoadingStateTextHidden"; "required": false; "isSignal": true; }; "sdsLoadingStateProgress": { "alias": "sdsLoadingStateProgress"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
export type SdsLoadingVisibilityState = 'hidden' | 'visible' | 'leaving';
|
|
3
|
+
export declare const LOADING_SHOW_DELAY_MS = 300;
|
|
4
|
+
export declare const LOADING_MIN_VISIBLE_MS = 500;
|
|
5
|
+
export declare const LOADING_LEAVE_MS = 200;
|
|
6
|
+
/**
|
|
7
|
+
* Derives the visibility of a loading indicator from a `loading` flag: it only shows after
|
|
8
|
+
* `LOADING_SHOW_DELAY_MS`, stays at least `LOADING_MIN_VISIBLE_MS` and then fades out during
|
|
9
|
+
* `LOADING_LEAVE_MS`. Must be called in an injection context.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createLoadingVisibility(loading: Signal<boolean>): Signal<SdsLoadingVisibilityState>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SdsLoadingStateSize, SdsPulseProgress } from '../loading-state/loading-state.types';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdsPulseComponent {
|
|
4
|
+
private readonly elementRef;
|
|
5
|
+
private readonly liveAnnouncer;
|
|
6
|
+
private readonly translateService;
|
|
7
|
+
/** Logo size: 64px for `default` and 40px for `small`. */
|
|
8
|
+
readonly size: import("@angular/core").InputSignal<SdsLoadingStateSize>;
|
|
9
|
+
/** Status text. Defaults to the translated "Updating…". */
|
|
10
|
+
readonly text: import("@angular/core").InputSignal<string | undefined>;
|
|
11
|
+
/** Hides the status text visually; it is still announced to assistive technologies. */
|
|
12
|
+
readonly textHidden: import("@angular/core").InputSignal<boolean>;
|
|
13
|
+
/** Progress from 0 to 100, or `indeterminate` for a looping bar. When set, a bar is shown below the status. */
|
|
14
|
+
readonly progress: import("@angular/core").InputSignal<SdsPulseProgress>;
|
|
15
|
+
/** Starts the fade-out. The region is released while leaving. */
|
|
16
|
+
readonly leaving: import("@angular/core").InputSignal<boolean>;
|
|
17
|
+
protected readonly isSmall: import("@angular/core").Signal<boolean>;
|
|
18
|
+
protected readonly isIndeterminate: import("@angular/core").Signal<boolean>;
|
|
19
|
+
protected readonly percent: import("@angular/core").Signal<number | null>;
|
|
20
|
+
private readonly defaultText;
|
|
21
|
+
protected readonly statusText: import("@angular/core").Signal<any>;
|
|
22
|
+
constructor();
|
|
23
|
+
protected blockScroll(event: Event): void;
|
|
24
|
+
private isRegionScrollable;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsPulseComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsPulseComponent, "sds-pulse", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "textHidden": { "alias": "textHidden"; "required": false; "isSignal": true; }; "progress": { "alias": "progress"; "required": false; "isSignal": true; }; "leaving": { "alias": "leaving"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class SdsSeniorIsotypeComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsSeniorIsotypeComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsSeniorIsotypeComponent, "sds-senior-isotype", never, {}, {}, never, never, true, never>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export type SdsLoadingSpinnerSize = 16 | 20;
|
|
3
|
+
export declare class SdsLoadingSpinnerComponent {
|
|
4
|
+
/** Spinner width and height, in pixels. */
|
|
5
|
+
readonly size: import("@angular/core").InputSignal<SdsLoadingSpinnerSize>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsLoadingSpinnerComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsLoadingSpinnerComponent, "sds-loading-spinner", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8
|
+
}
|
package/locale/public-api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fallback } from
|
|
1
|
+
export { fallback } from './fallback';
|
package/mask/README.md
CHANGED
|
@@ -89,7 +89,7 @@ npm install @seniorsistemas/scala-ng
|
|
|
89
89
|
Importe a diretiva e/ou o pipe diretamente no seu standalone component:
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
|
-
import { SdsMaskDirective, SdsMaskPipe } from
|
|
92
|
+
import { SdsMaskDirective, SdsMaskPipe } from '@seniorsistemas/scala-ng/mask';
|
|
93
93
|
|
|
94
94
|
@Component({
|
|
95
95
|
imports: [SdsMaskDirective, SdsMaskPipe],
|
package/mask/public-api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SdsMaskDirective } from
|
|
2
|
-
export { SdsMaskPipe, type SdsMaskPipeOptions } from
|
|
3
|
-
export { DEFAULT_MASK_PATTERNS, DEFAULT_SPECIAL_CHARACTERS, type MaskPatternDef, type MaskPatterns, } from
|
|
4
|
-
export { applyMask, applySeparatorMask, expandRepeat, findNextEditableIndex, findPrevEditableIndex, hideMaskedValue, isMaskComplete, resolvePatterns, selectActiveMask, stripMask, stripObfuscatedMask, stripSeparatorMask, type ApplyMaskOptions, } from
|
|
1
|
+
export { SdsMaskDirective } from './src/mask/mask.directive';
|
|
2
|
+
export { SdsMaskPipe, type SdsMaskPipeOptions } from './src/mask/mask.pipe';
|
|
3
|
+
export { DEFAULT_MASK_PATTERNS, DEFAULT_SPECIAL_CHARACTERS, type MaskPatternDef, type MaskPatterns, } from './src/mask/mask.tokens';
|
|
4
|
+
export { applyMask, applySeparatorMask, expandRepeat, findNextEditableIndex, findPrevEditableIndex, hideMaskedValue, isMaskComplete, resolvePatterns, selectActiveMask, stripMask, stripObfuscatedMask, stripSeparatorMask, type ApplyMaskOptions, } from './src/mask/mask.utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ControlValueAccessor } from
|
|
2
|
-
import { type MaskPatterns } from
|
|
1
|
+
import { type ControlValueAccessor } from '@angular/forms';
|
|
2
|
+
import { type MaskPatterns } from './mask.tokens';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class SdsMaskDirective implements ControlValueAccessor {
|
|
5
5
|
/** Mask pattern. Supports `{n}` repeat and `||` multi-mask. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type PipeTransform } from
|
|
2
|
-
import { type MaskPatterns } from
|
|
1
|
+
import { type PipeTransform } from '@angular/core';
|
|
2
|
+
import { type MaskPatterns } from './mask.tokens';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export interface SdsMaskPipeOptions {
|
|
5
5
|
unmask?: boolean;
|
package/modal/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
# SdsModalComponent
|
|
2
|
+
|
|
3
|
+
> Scala Design System — `@seniorsistemas/scala-ng/modal`
|
|
4
|
+
|
|
5
|
+
Janela central que bloqueia a interface e exige uma resposta antes de continuar. Tem três tamanhos (`small`, `default` e `full`), conteúdo livre, rodapé controlado por propriedades e pode ser aberto de forma declarativa (`[(open)]`) ou por código, com `SdsModalService.open()` e `SdsModalService.confirm()`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Use `sds-modal` quando o usuário precisa preencher, revisar ou decidir algo sem sair da tela atual: um formulário curto, um conteúdo intermediário ou uma tarefa densa que ainda não justifica uma página.
|
|
12
|
+
|
|
13
|
+
O Modal não tem gatilho próprio. Quem controla a abertura é o consumidor, por `[(open)]`, ou pelo `SdsModalService` quando o modal é aberto a partir de um serviço ou de um guard.
|
|
14
|
+
|
|
15
|
+
- **`small`**: 480px, usado pelas confirmações. Para confirmar uma ação, use `SdsModalService.confirm()`, que já monta o Modal com o tamanho, o `dialogRole` e as opções corretos.
|
|
16
|
+
- **`default`**: largura por faixa de viewport; a altura cresce com o conteúdo.
|
|
17
|
+
- **`full`**: ocupa o viewport menos a margem, em largura e altura; só o conteúdo rola.
|
|
18
|
+
|
|
19
|
+
## Anatomy
|
|
20
|
+
|
|
21
|
+
| Elemento | Papel |
|
|
22
|
+
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| Backdrop | Camada que escurece a página; o clique nele não fecha o Modal |
|
|
24
|
+
| Painel (`role="dialog"` ou `"alertdialog"`) | Contêiner com `aria-modal`, nome acessível pelo título e foco preso |
|
|
25
|
+
| Botão Voltar (opcional) | Ícone no início do cabeçalho, com tooltip "Voltar"; `showBack`; emite `backClicked` |
|
|
26
|
+
| Título | Texto de `heading`; é o nome acessível do Modal |
|
|
27
|
+
| Botão Fechar (X, opcional) | Ícone no fim do cabeçalho, com tooltip "Fechar"; `showClose` (padrão `true`); comporta-se como o botão secundário |
|
|
28
|
+
| Conteúdo | Área rolável, com `ng-content` ou o template `#body` |
|
|
29
|
+
| Ação terciária (opcional) | Botão ghost no rodapé, antes dos demais; `tertiaryLabel` |
|
|
30
|
+
| Ação secundária | "Cancelar" (ou "Fechar" quando não há ação principal); `showCancel` a oculta |
|
|
31
|
+
| Ação principal (opcional) | Botão primário com o texto de `confirmLabel`; fica `destructive` em ações irreversíveis |
|
|
32
|
+
|
|
33
|
+
## Behavior
|
|
34
|
+
|
|
35
|
+
O Modal nunca fecha por conta própria quando a ação principal é acionada: ele emite `confirmed` e o consumidor decide quando fechar, por exemplo depois de validar e salvar.
|
|
36
|
+
|
|
37
|
+
- **Abertura**: ao tornar `open` verdadeiro, o painel é criado em um overlay, a rolagem da página é travada e o resto da página é ocultado de leitores de tela.
|
|
38
|
+
- **Tamanho `small`**: 480px, ou o viewport menos 32px quando a tela é menor. A altura cresce com o conteúdo até o viewport menos 96px (menos 32px abaixo de 768px).
|
|
39
|
+
- **Tamanho `default`**: largura de 600 (a partir de 1024px), 720 (1366px), 960 (1920px), 1200 (2560px) e 1400px (3440px). Entre 768 e 1023px usa o viewport menos 64px; abaixo de 768px, o viewport menos 32px.
|
|
40
|
+
- **Tamanho `full`**: viewport menos 96px (margem de 48px), menos 64px entre 768 e 1023px e menos 32px abaixo de 768px, em largura e altura. Não há largura máxima em telas ultrawide.
|
|
41
|
+
- **Altura**: o `default` cresce até o viewport menos 96px (menos 32px abaixo de 768px); depois disso só o conteúdo rola. O `full` tem altura fixa.
|
|
42
|
+
- **Fechamento**: Esc, botão secundário e X emitem `cancelled` e definem `open` como `false`. O clique no backdrop não fecha, para evitar perda de dados.
|
|
43
|
+
- **Loading**: com `loading` verdadeiro, todas as ações ficam desabilitadas, o Esc e o X não fecham e o painel recebe `aria-busy`.
|
|
44
|
+
- **Navegação interna**: com `showBack`, o Modal troca de etapa sem abrir um segundo modal. O consumidor troca o conteúdo e o `heading`; o foco vai para o título da nova etapa.
|
|
45
|
+
- **Somente leitura**: sem `confirmLabel`, só o botão "Fechar" aparece.
|
|
46
|
+
- **Sem "Cancelar"**: com `showCancel` falso, só o botão principal aparece; o Esc continua cancelando.
|
|
47
|
+
- **`alertdialog`**: com `dialogRole="alertdialog"`, o conteúdo é a descrição do diálogo.
|
|
48
|
+
- **Um por vez**: enquanto um Modal está aberto, outro não abre. No uso declarativo, `open` volta a `false` (e há um aviso no console em desenvolvimento); no service, o `closed` do segundo resolve com `undefined`.
|
|
49
|
+
- **Navegação de rota**: um Modal aberto pelo service fecha quando o router inicia uma navegação, resolvendo `closed` com `undefined`. Desative com `closeOnNavigation: false`.
|
|
50
|
+
- **Via service**: `SdsModalService.open()` aceita um componente ou um `TemplateRef`, devolve um `SdsModalRef` e destrói o conteúdo ao fechar. `SdsModalService.confirm()` abre uma confirmação `small` e resolve uma `Promise<boolean>`.
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
|
|
54
|
+
- **Role**: `dialog` (padrão) ou `alertdialog`, com `aria-modal="true"` e `aria-labelledby` apontando para o título. No `alertdialog`, o `aria-describedby` aponta para o conteúdo, e só enquanto ele tem texto (sem mensagem, o atributo não é aplicado).
|
|
55
|
+
- **`aria-busy`**: aplicado ao painel enquanto `loading` é `true`.
|
|
56
|
+
- **Foco preso**: Tab e Shift+Tab ficam dentro do Modal; o restante da página é ocultado de leitores de tela enquanto ele está aberto.
|
|
57
|
+
- **Foco inicial**: ação principal nos tamanhos `small` e `default`; primeiro elemento interativo do conteúdo no `full` (ou a ação principal se não houver nenhum); ação secundária quando `destructive` ou quando não há ação principal.
|
|
58
|
+
- **Área rolável**: quando o conteúdo ultrapassa a altura disponível, a área de conteúdo recebe `tabindex="0"` para que o teclado consiga rolá-la; sem overflow ela não entra na ordem de Tab.
|
|
59
|
+
- **Troca de etapa**: quando o `heading` muda com o Modal aberto, o foco vai para o título.
|
|
60
|
+
- **Ao fechar**: o foco volta para o elemento que abriu o Modal.
|
|
61
|
+
- **Teclado**: Esc fecha (exceto durante `loading`).
|
|
62
|
+
- **Botões só de ícone**: Voltar e Fechar têm `aria-label` traduzido (`platform.scala-ng.modal_back` e `platform.scala-ng.modal_close`).
|
|
63
|
+
- **Tooltip dos botões de ícone**: o Fechar (X) e o Voltar mostram um `sdsTooltip` com o mesmo texto traduzido (`platform.scala-ng.modal_close` e `platform.scala-ng.modal_back`). Como o botão já tem `aria-label`, o tooltip não é ligado a ele por `aria-describedby`, para o leitor de tela não repetir o nome.
|
|
64
|
+
- **Contraste**: o painel usa apenas tokens semânticos, que seguem WCAG 2.1 AA nos temas claro e escuro.
|
|
65
|
+
|
|
66
|
+
## Best Practices
|
|
67
|
+
|
|
68
|
+
**Quando usar**
|
|
69
|
+
|
|
70
|
+
- Formulários curtos e edições que não justificam uma nova página.
|
|
71
|
+
- Conteúdo que exige atenção total antes de continuar.
|
|
72
|
+
- Fluxos de poucas etapas, usando a navegação interna (`showBack`).
|
|
73
|
+
- Confirmar uma ação pontual, com `SdsModalService.confirm()`.
|
|
74
|
+
|
|
75
|
+
**Quando não usar**
|
|
76
|
+
|
|
77
|
+
- Para informar sem exigir decisão — use um alerta.
|
|
78
|
+
- Para feedback temporário — use um toast.
|
|
79
|
+
- Para fluxos extensos, listas para selecionar ou formulários adicionais por cima do atual — use `SdsDrawerComponent`.
|
|
80
|
+
|
|
81
|
+
**Antipadrões comuns**
|
|
82
|
+
|
|
83
|
+
- Abrir um Modal a partir de outro. Dois modais nunca ficam visíveis ao mesmo tempo (o segundo é ignorado); use a navegação interna.
|
|
84
|
+
- Usar `confirmLabel` genérico ("OK", "Sim"). Descreva a ação ("Salvar contato").
|
|
85
|
+
- Fechar o Modal dentro do `(confirmed)` sem validar ou salvar antes.
|
|
86
|
+
- Montar uma confirmação declarando `<sds-modal size="small" dialogRole="alertdialog">` à mão: use sempre `SdsModalService.confirm()`.
|
|
87
|
+
- Abrir uma confirmação (`confirm()`) por cima de um Modal: ela também é ignorada enquanto outro modal está aberto.
|
|
88
|
+
- Colocar `loading` sem desabilitar o que depende do resultado: o Modal já bloqueia as ações dele.
|
|
89
|
+
|
|
90
|
+
## Content Guidelines
|
|
91
|
+
|
|
92
|
+
- O `heading` descreve a tarefa ("Editar contato"), não o tipo de janela.
|
|
93
|
+
- O `confirmLabel` descreve a ação ("Salvar centro de custo"); o cancelamento é sempre "Cancelar".
|
|
94
|
+
- Em ações destrutivas, use `destructive` e explique a consequência no conteúdo.
|
|
95
|
+
- Mantenha o conteúdo do `default` curto; se precisar de muito espaço, considere o tamanho `full` ou uma página.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Installation
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm install @seniorsistemas/scala-ng
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Importe o componente diretamente no seu standalone component:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { SdsModalComponent } from '@seniorsistemas/scala-ng/modal';
|
|
109
|
+
|
|
110
|
+
@Component({
|
|
111
|
+
imports: [SdsModalComponent],
|
|
112
|
+
})
|
|
113
|
+
export class MyComponent {}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Properties
|
|
117
|
+
|
|
118
|
+
| Propriedade | Tipo | Padrão | Obrigatório | Descrição |
|
|
119
|
+
| --------------- | --------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
+
| `open` | `boolean` | `false` | ❌ | Indica se o Modal está aberto (aceita `[(open)]`). Não há gatilho embutido. |
|
|
121
|
+
| `heading` | `string` | — | ✅ | Título, também usado como nome acessível do Modal. |
|
|
122
|
+
| `size` | `SdsModalSize` | `'default'` | ❌ | `'small'` (480px), `'default'` (largura por viewport, cresce com o conteúdo) ou `'full'` (viewport menos as margens). |
|
|
123
|
+
| `dialogRole` | `SdsModalRole` | `'dialog'` | ❌ | `'alertdialog'` para decisões urgentes; liga o conteúdo como descrição do diálogo. |
|
|
124
|
+
| `showCancel` | `boolean` | `true` | ❌ | Mostra o botão "Cancelar" ao lado do principal. Modais somente leitura sempre mantêm o "Fechar". |
|
|
125
|
+
| `confirmLabel` | `string \| undefined` | `undefined` | ❌ | Texto do botão principal. Sem ele, o Modal fica somente leitura, só com "Fechar". |
|
|
126
|
+
| `tertiaryLabel` | `string \| undefined` | `undefined` | ❌ | Texto da ação terciária, exibida antes dos demais botões. |
|
|
127
|
+
| `showBack` | `boolean` | `false` | ❌ | Mostra o botão Voltar no cabeçalho, para navegação interna. |
|
|
128
|
+
| `showClose` | `boolean` | `true` | ❌ | Mostra o botão Fechar (X) no cabeçalho; comporta-se como o botão secundário. |
|
|
129
|
+
| `destructive` | `boolean` | `false` | ❌ | Pinta o botão principal com a cor destrutiva e leva o foco inicial ao botão secundário. |
|
|
130
|
+
| `loading` | `boolean` | `false` | ❌ | Desabilita todas as ações e faz o Esc e o X não fecharem enquanto a ação principal processa. |
|
|
131
|
+
|
|
132
|
+
### Conteúdo
|
|
133
|
+
|
|
134
|
+
| Origem | Descrição |
|
|
135
|
+
| --------------------- | -------------------------------------------------------------------------------------- |
|
|
136
|
+
| `ng-content` | Conteúdo livre, projetado na área rolável. |
|
|
137
|
+
| `<ng-template #body>` | Alternativa ao `ng-content`: o conteúdo só é instanciado enquanto o Modal está aberto. |
|
|
138
|
+
|
|
139
|
+
## Outputs
|
|
140
|
+
|
|
141
|
+
| Output | Tipo | Descrição |
|
|
142
|
+
| ----------------- | ------ | -------------------------------------------------------------------------------------- |
|
|
143
|
+
| `confirmed` | `void` | Emitido ao clicar no botão principal. O Modal continua aberto até o consumidor fechar. |
|
|
144
|
+
| `cancelled` | `void` | Emitido ao dispensar por botão secundário, X ou Esc; `open` vira `false` em seguida. |
|
|
145
|
+
| `tertiaryClicked` | `void` | Emitido ao clicar na ação terciária. O Modal continua aberto. |
|
|
146
|
+
| `backClicked` | `void` | Emitido ao clicar no botão Voltar. O Modal continua aberto. |
|
|
147
|
+
|
|
148
|
+
### `SdsModalSize`
|
|
149
|
+
|
|
150
|
+
`'small' | 'default' | 'full'`
|
|
151
|
+
|
|
152
|
+
### `SdsModalRole`
|
|
153
|
+
|
|
154
|
+
`'dialog' | 'alertdialog'`
|
|
155
|
+
|
|
156
|
+
## SdsModalService
|
|
157
|
+
|
|
158
|
+
Abre um Modal por código, sem ter o `<sds-modal>` no template. O `open()` mostra um componente ou um `TemplateRef` como conteúdo; o `confirm()` mostra uma confirmação pronta.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
// componente como conteúdo, com valores para os inputs dele
|
|
162
|
+
open<Result, Data, Content>(
|
|
163
|
+
content: Type<Content>,
|
|
164
|
+
config: SdsModalComponentConfig<Content, Data>,
|
|
165
|
+
): SdsModalRef<Result, Content>
|
|
166
|
+
|
|
167
|
+
// template como conteúdo
|
|
168
|
+
open<Result, Data>(
|
|
169
|
+
content: TemplateRef<SdsModalTemplateContext<Data, Result>>,
|
|
170
|
+
config: SdsModalConfig<Data>,
|
|
171
|
+
): SdsModalRef<Result>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### `SdsModalConfig`
|
|
175
|
+
|
|
176
|
+
Estende `SdsModalOptions` (os inputs do `SdsModalComponent`, exceto `open`, que `SdsModalRef.update()` também aceita; um input novo do componente aparece aqui sozinho) com `data` e `closeOnNavigation`.
|
|
177
|
+
|
|
178
|
+
| Campo | Tipo | Obrigatório | Descrição |
|
|
179
|
+
| ------------------- | -------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `heading` | `string` | ✅ | Título, também usado como nome acessível do Modal. |
|
|
181
|
+
| `size` | `SdsModalSize` | ❌ | `'small'`, `'default'` ou `'full'`. |
|
|
182
|
+
| `dialogRole` | `SdsModalRole` | ❌ | `'dialog'` (padrão) ou `'alertdialog'`. |
|
|
183
|
+
| `showCancel` | `boolean` | ❌ | Mostra o botão "Cancelar" (padrão `true`). |
|
|
184
|
+
| `confirmLabel` | `string` | ❌ | Texto do botão principal; sem ele o Modal fica somente leitura. |
|
|
185
|
+
| `tertiaryLabel` | `string` | ❌ | Texto da ação terciária. |
|
|
186
|
+
| `showBack` | `boolean` | ❌ | Mostra o botão Voltar. |
|
|
187
|
+
| `showClose` | `boolean` | ❌ | Mostra o botão Fechar (X). |
|
|
188
|
+
| `destructive` | `boolean` | ❌ | Pinta o botão principal com a cor destrutiva. |
|
|
189
|
+
| `loading` | `boolean` | ❌ | Desabilita as ações enquanto processa. |
|
|
190
|
+
| `data` | `Data` | ❌ | Valor injetável no componente por `SDS_MODAL_DATA`, ou lido no contexto do template. |
|
|
191
|
+
| `closeOnNavigation` | `boolean` | ❌ | Fecha o Modal quando o router inicia uma navegação, resolvendo `closed` com `undefined`. Padrão: `true`. |
|
|
192
|
+
|
|
193
|
+
### `SdsModalComponentConfig`
|
|
194
|
+
|
|
195
|
+
Estende `SdsModalConfig` quando o conteúdo é um componente. A conferência dos `inputs` só vale quando o tipo do componente é inferido: chame `open(Componente, ...)` sem argumentos de tipo e declare o tipo do resultado na variável (`SdsModalRef<string, Componente>`). Com `open<string>(...)`, o TypeScript não infere o componente e o `inputs` fica sem checagem.
|
|
196
|
+
|
|
197
|
+
| Campo | Tipo | Obrigatório | Descrição |
|
|
198
|
+
| -------- | ------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
199
|
+
| `inputs` | `SdsModalInputs<Content>` | ❌ | Valores para os `input()`, `input.required()` e `model()` do componente, aplicados antes de ele aparecer. O compilador confere os nomes e os tipos; um input inexistente lança erro. |
|
|
200
|
+
|
|
201
|
+
### `confirm()`
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
confirm(config: SdsModalConfirmConfig): Promise<boolean>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Abre uma confirmação (`small`, `alertdialog`, sem botão X) e resolve `true` ao confirmar, `false` ao cancelar ou pressionar Esc. Abre de forma assíncrona, no ciclo seguinte dos effects.
|
|
208
|
+
|
|
209
|
+
### `SdsModalConfirmConfig`
|
|
210
|
+
|
|
211
|
+
| Campo | Tipo | Obrigatório | Descrição |
|
|
212
|
+
| ------------------- | --------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
+
| `heading` | `string` | ✅ | Pergunta ou afirmação sobre a ação, também usada como nome acessível. |
|
|
214
|
+
| `confirmLabel` | `string` | ✅ | Texto do botão de confirmação; deve descrever a ação. |
|
|
215
|
+
| `message` | `string` | ❌ | Texto explicativo; descreva as consequências quando a ação é irreversível. |
|
|
216
|
+
| `showCancel` | `boolean` | ❌ | Mostra o botão "Cancelar" (padrão `true`). |
|
|
217
|
+
| `destructive` | `boolean` | ❌ | Pinta o botão principal com a cor destrutiva e foca "Cancelar" ao abrir. |
|
|
218
|
+
| `onConfirm` | `() => unknown` | ❌ | Ação executada ao confirmar. Enquanto roda, o modal mostra `loading`; ao terminar com sucesso, ele fecha e o `confirm()` resolve `true`. Se lançar erro, o modal continua aberto para nova tentativa; trate e avise o erro dentro da função. |
|
|
219
|
+
| `closeOnNavigation` | `boolean` | ❌ | Fecha ao navegar, resolvendo `false`. Padrão: `true`. |
|
|
220
|
+
|
|
221
|
+
### `SdsModalRef`
|
|
222
|
+
|
|
223
|
+
Injetável pelo componente aberto, para fechar o Modal. No template, vem como `$implicit`.
|
|
224
|
+
|
|
225
|
+
| Membro | Tipo | Descrição |
|
|
226
|
+
| ------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
227
|
+
| `componentInstance` | `Component` | Instância do componente aberto como conteúdo. Tipada como o componente em `open(Componente, ...)` e como `undefined` em `open(template, ...)`; ainda não existe enquanto o componente está sendo construído. |
|
|
228
|
+
| `closed` | `Promise<Result \| undefined>` | Resolve com o valor de `close()`, ou `undefined` ao dispensar (cancelar, X ou Esc). |
|
|
229
|
+
| `close(result?)` | `(result?: Result) => void` | Fecha o Modal e resolve `closed` com o resultado. |
|
|
230
|
+
| `update(changes)` | `(changes: Partial<SdsModalOptions>)` | Altera opções com o Modal aberto, por exemplo `update({ loading: true })`. |
|
|
231
|
+
| `confirmed` | `Observable<void>` | Emite ao clicar no botão principal; o Modal fica aberto até `close()`. |
|
|
232
|
+
| `tertiaryClicked` | `Observable<void>` | Emite ao clicar na ação terciária. |
|
|
233
|
+
| `backClicked` | `Observable<void>` | Emite ao clicar no botão Voltar. |
|
|
234
|
+
|
|
235
|
+
### `SdsModalTemplateContext`
|
|
236
|
+
|
|
237
|
+
Contexto de um `TemplateRef` aberto pelo service.
|
|
238
|
+
|
|
239
|
+
| Campo | Tipo | Obrigatório | Descrição |
|
|
240
|
+
| ----------- | ------------------- | ----------- | -------------------------------------------- |
|
|
241
|
+
| `$implicit` | `SdsModalRef` | ✅ | Referência do Modal, para fechar por dentro. |
|
|
242
|
+
| `data` | `Data \| undefined` | ❌ | O valor passado em `config.data`. |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Examples
|
|
247
|
+
|
|
248
|
+
### Modal declarativo
|
|
249
|
+
|
|
250
|
+
```html
|
|
251
|
+
<button
|
|
252
|
+
sdsButton
|
|
253
|
+
type="secondary"
|
|
254
|
+
(click)="isOpen.set(true)"
|
|
255
|
+
>
|
|
256
|
+
Editar contato
|
|
257
|
+
</button>
|
|
258
|
+
|
|
259
|
+
<sds-modal
|
|
260
|
+
[(open)]="isOpen"
|
|
261
|
+
heading="Editar contato"
|
|
262
|
+
confirmLabel="Salvar"
|
|
263
|
+
tertiaryLabel="Restaurar padrão"
|
|
264
|
+
(confirmed)="save()"
|
|
265
|
+
(tertiaryClicked)="restore()"
|
|
266
|
+
>
|
|
267
|
+
<sds-input
|
|
268
|
+
label="Nome"
|
|
269
|
+
[formControl]="name"
|
|
270
|
+
/>
|
|
271
|
+
</sds-modal>
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
protected readonly isOpen = signal(false);
|
|
276
|
+
|
|
277
|
+
protected save(): void {
|
|
278
|
+
// valida e salva; só então fecha
|
|
279
|
+
this.isOpen.set(false);
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Confirmação via service
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
private readonly modalService = inject(SdsModalService);
|
|
287
|
+
|
|
288
|
+
protected async deleteRecord(): Promise<void> {
|
|
289
|
+
const confirmed = await this.modalService.confirm({
|
|
290
|
+
heading: "Excluir registro?",
|
|
291
|
+
message: "O registro será removido permanentemente e esta ação não poderá ser desfeita.",
|
|
292
|
+
confirmLabel: "Excluir",
|
|
293
|
+
destructive: true,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
if (confirmed) {
|
|
297
|
+
// exclui o registro
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Confirmação com ação assíncrona
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
const confirmed = await this.modalService.confirm({
|
|
306
|
+
heading: 'Excluir registro?',
|
|
307
|
+
confirmLabel: 'Excluir',
|
|
308
|
+
destructive: true,
|
|
309
|
+
// enquanto roda, o modal fica em `loading`; ao resolver, fecha e o confirm() devolve true
|
|
310
|
+
onConfirm: () => this.recordService.delete(id),
|
|
311
|
+
});
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Tamanho full
|
|
315
|
+
|
|
316
|
+
```html
|
|
317
|
+
<sds-modal
|
|
318
|
+
[(open)]="isOpen"
|
|
319
|
+
size="full"
|
|
320
|
+
heading="Conteúdo denso"
|
|
321
|
+
confirmLabel="Concluir"
|
|
322
|
+
(confirmed)="isOpen.set(false)"
|
|
323
|
+
>
|
|
324
|
+
...
|
|
325
|
+
</sds-modal>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Navegação interna
|
|
329
|
+
|
|
330
|
+
```html
|
|
331
|
+
<sds-modal
|
|
332
|
+
[(open)]="isOpen"
|
|
333
|
+
[heading]="step() === 1 ? 'Dados do contato' : 'Revisar'"
|
|
334
|
+
[showBack]="step() > 1"
|
|
335
|
+
[confirmLabel]="step() === 1 ? 'Continuar' : 'Salvar'"
|
|
336
|
+
(backClicked)="step.set(1)"
|
|
337
|
+
(confirmed)="next()"
|
|
338
|
+
>
|
|
339
|
+
...
|
|
340
|
+
</sds-modal>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Via service com um template
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
private readonly modalService = inject(SdsModalService);
|
|
347
|
+
private readonly contactForm = viewChild.required<TemplateRef<SdsModalTemplateContext>>("contactForm");
|
|
348
|
+
|
|
349
|
+
protected async editContact(): Promise<void> {
|
|
350
|
+
const modalRef = this.modalService.open<string>(this.contactForm(), {
|
|
351
|
+
heading: "Editar contato",
|
|
352
|
+
confirmLabel: "Salvar",
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
modalRef.confirmed.subscribe(() => {
|
|
356
|
+
modalRef.update({ loading: true });
|
|
357
|
+
this.save().then(() => modalRef.close("Contato salvo."));
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const result = await modalRef.closed;
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
```html
|
|
365
|
+
<ng-template #contactForm>
|
|
366
|
+
<sds-input
|
|
367
|
+
label="Nome"
|
|
368
|
+
[formControl]="name"
|
|
369
|
+
/>
|
|
370
|
+
</ng-template>
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Via service com um componente e inputs
|
|
374
|
+
|
|
375
|
+
```typescript
|
|
376
|
+
@Component({ selector: 'app-contact', standalone: true, template: `...` })
|
|
377
|
+
export class ContactComponent {
|
|
378
|
+
readonly name = input.required<string>();
|
|
379
|
+
readonly department = input('Financeiro');
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// O tipo do resultado vai na variável: com `open<string>(...)` o `inputs` perde a conferência de tipos.
|
|
383
|
+
const modalRef: SdsModalRef<string, ContactComponent> = this.modalService.open(ContactComponent, {
|
|
384
|
+
heading: 'Dados do contato',
|
|
385
|
+
confirmLabel: 'Aprovar',
|
|
386
|
+
inputs: { name: 'Ana Souza', department: 'RH' },
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
modalRef.confirmed.subscribe(() => modalRef.close('aprovado'));
|
|
390
|
+
const result = await modalRef.closed;
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Os `output()` do componente se assinam pelo `componentInstance`, logo depois do `open()`:
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
modalRef.componentInstance.saved.subscribe((contact) => modalRef.close(contact));
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Via service com um componente e injeção de dados
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
@Component({ selector: 'app-edit-contact', standalone: true, template: `...` })
|
|
403
|
+
export class EditContactComponent {
|
|
404
|
+
private readonly modalRef = inject<SdsModalRef<string>>(SdsModalRef);
|
|
405
|
+
protected readonly data = inject(SDS_MODAL_DATA) as { name: string };
|
|
406
|
+
|
|
407
|
+
protected done(): void {
|
|
408
|
+
this.modalRef.close('salvo');
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const modalRef = this.modalService.open<string, { name: string }>(EditContactComponent, {
|
|
413
|
+
heading: 'Editar contato',
|
|
414
|
+
confirmLabel: 'Salvar',
|
|
415
|
+
data: { name: 'Ana' },
|
|
416
|
+
});
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Patch Notes
|
|
422
|
+
|
|
423
|
+
### 1.0.0 — 2026-11-12
|
|
424
|
+
|
|
425
|
+
#### Added
|
|
426
|
+
|
|
427
|
+
- Componente `sds-modal` com os tamanhos `small`, `default` e `full`, conteúdo livre por `ng-content` ou `#body` e rodapé por propriedades.
|
|
428
|
+
- Navegação interna (`showBack`), ação terciária, estado `loading` e ação destrutiva.
|
|
429
|
+
- `SdsModalService.open()` e `SdsModalRef`, com conteúdo por componente ou `TemplateRef`.
|
|
430
|
+
- `inputs` no `open()` com componente, que preenche os `input()` dele com tipagem conferida pelo compilador, e `componentInstance` no `SdsModalRef`.
|
|
431
|
+
- `SdsModalService.confirm()`, que abre uma confirmação `small` com `role="alertdialog"` e devolve uma `Promise<boolean>`, com `onConfirm` para ações assíncronas com `loading`.
|
|
432
|
+
- Propriedades `dialogRole` e `showCancel`.
|
|
433
|
+
- Fechamento automático do Modal aberto pelo service ao navegar (`closeOnNavigation`) e bloqueio de um segundo modal enquanto outro está aberto.
|
|
434
|
+
- Tooltip traduzido nos botões Fechar (X) e Voltar, com o `sdsTooltip` da lib.
|
|
435
|
+
- Traduções `modal_cancel`, `modal_close` e `modal_back` nos quatro idiomas.
|
package/modal/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { SdsModalComponent, type SdsModalRole, type SdsModalSize, } from './src/modal/modal.component';
|
|
2
|
+
export { SDS_MODAL_DATA, SdsModalRef, type SdsModalInputs, type SdsModalOptions, } from './src/modal/modal-ref';
|
|
3
|
+
export { SdsModalService, type SdsModalComponentConfig, type SdsModalConfig, type SdsModalConfirmConfig, type SdsModalTemplateContext, } from './src/modal/modal.service';
|