@siemens/element-ng 47.2.0 → 47.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/README.md +18 -6
- package/autocomplete/index.d.ts +8 -0
- package/autocomplete/package.json +3 -0
- package/autocomplete/si-autocomplete-listbox.directive.d.ts +31 -0
- package/autocomplete/si-autocomplete-option.directive.d.ts +31 -0
- package/autocomplete/si-autocomplete.directive.d.ts +14 -0
- package/autocomplete/si-autocomplete.model.d.ts +7 -0
- package/autocomplete/si-autocomplete.module.d.ts +9 -0
- package/badge/index.d.ts +5 -0
- package/badge/package.json +3 -0
- package/badge/si-badge.component.d.ts +17 -0
- package/breadcrumb/breadcrumb-item.model.d.ts +36 -0
- package/breadcrumb/index.d.ts +7 -0
- package/breadcrumb/package.json +3 -0
- package/breadcrumb/si-breadcrumb-item-template.directive.d.ts +10 -0
- package/breadcrumb/si-breadcrumb.component.d.ts +46 -0
- package/breadcrumb/si-breadcrumb.module.d.ts +7 -0
- package/card/index.d.ts +6 -0
- package/card/package.json +3 -0
- package/card/si-card.component.d.ts +79 -0
- package/card/si-card.module.d.ts +7 -0
- package/circle-status/index.d.ts +6 -0
- package/circle-status/package.json +3 -0
- package/circle-status/si-circle-status.component.d.ts +66 -0
- package/circle-status/si-circle-status.module.d.ts +7 -0
- package/column-selection-dialog/column-selection-editor/si-column-selection-editor.component.d.ts +23 -0
- package/column-selection-dialog/index.d.ts +6 -0
- package/column-selection-dialog/package.json +3 -0
- package/column-selection-dialog/si-column-selection-dialog.component.d.ts +114 -0
- package/column-selection-dialog/si-column-selection-dialog.service.d.ts +20 -0
- package/column-selection-dialog/si-column-selection-dialog.types.d.ts +68 -0
- package/common/models/status-type.model.d.ts +2 -2
- package/content-action-bar/index.d.ts +7 -0
- package/content-action-bar/package.json +3 -0
- package/content-action-bar/si-content-action-bar-toggle.component.d.ts +6 -0
- package/content-action-bar/si-content-action-bar.component.d.ts +72 -0
- package/content-action-bar/si-content-action-bar.model.d.ts +9 -0
- package/content-action-bar/si-content-action-bar.module.d.ts +7 -0
- package/date-range-filter/index.d.ts +8 -0
- package/date-range-filter/package.json +3 -0
- package/date-range-filter/si-date-range-calculation.service.d.ts +33 -0
- package/date-range-filter/si-date-range-filter.component.d.ts +248 -0
- package/date-range-filter/si-date-range-filter.module.d.ts +7 -0
- package/date-range-filter/si-date-range-filter.types.d.ts +40 -0
- package/date-range-filter/si-relative-date.component.d.ts +31 -0
- package/datepicker/components/si-calendar-body.component.d.ts +137 -0
- package/datepicker/components/si-calendar-date-cell.directive.d.ts +16 -0
- package/datepicker/components/si-calendar-direction-button.component.d.ts +18 -0
- package/datepicker/components/si-compare-adapter.d.ts +37 -0
- package/datepicker/components/si-day-selection.component.d.ts +76 -0
- package/datepicker/components/si-initial-focus.component.d.ts +74 -0
- package/datepicker/components/si-month-selection.component.d.ts +62 -0
- package/datepicker/components/si-year-selection.component.d.ts +65 -0
- package/datepicker/date-time-helper.d.ts +302 -0
- package/datepicker/index.d.ts +15 -0
- package/datepicker/package.json +3 -0
- package/datepicker/si-calendar-button.component.d.ts +49 -0
- package/datepicker/si-date-input.directive.d.ts +114 -0
- package/datepicker/si-date-range.component.d.ts +150 -0
- package/datepicker/si-datepicker-overlay.component.d.ts +82 -0
- package/datepicker/si-datepicker-overlay.directive.d.ts +104 -0
- package/datepicker/si-datepicker.component.d.ts +228 -0
- package/datepicker/si-datepicker.directive.d.ts +62 -0
- package/datepicker/si-datepicker.model.d.ts +129 -0
- package/datepicker/si-datepicker.module.d.ts +12 -0
- package/datepicker/si-timepicker.component.d.ts +214 -0
- package/electron-titlebar/electron.helpers.d.ts +5 -0
- package/electron-titlebar/index.d.ts +7 -0
- package/electron-titlebar/package.json +3 -0
- package/electron-titlebar/si-electron-titlebar.component.d.ts +72 -0
- package/electron-titlebar/si-electron-titlebar.module.d.ts +7 -0
- package/fesm2022/siemens-element-ng-application-header.mjs +2 -2
- package/fesm2022/siemens-element-ng-application-header.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-autocomplete.mjs +235 -0
- package/fesm2022/siemens-element-ng-autocomplete.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-badge.mjs +59 -0
- package/fesm2022/siemens-element-ng-badge.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-breadcrumb.mjs +302 -0
- package/fesm2022/siemens-element-ng-breadcrumb.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-card.mjs +122 -0
- package/fesm2022/siemens-element-ng-card.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-circle-status.mjs +146 -0
- package/fesm2022/siemens-element-ng-circle-status.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs +369 -0
- package/fesm2022/siemens-element-ng-column-selection-dialog.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-common.mjs +1 -1
- package/fesm2022/siemens-element-ng-common.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-content-action-bar.mjs +200 -0
- package/fesm2022/siemens-element-ng-content-action-bar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-date-range-filter.mjs +649 -0
- package/fesm2022/siemens-element-ng-date-range-filter.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-datepicker.mjs +4231 -0
- package/fesm2022/siemens-element-ng-datepicker.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs +142 -0
- package/fesm2022/siemens-element-ng-electron-titlebar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-file-uploader.mjs +751 -0
- package/fesm2022/siemens-element-ng-file-uploader.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-filter-bar.mjs +153 -0
- package/fesm2022/siemens-element-ng-filter-bar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-form.mjs +827 -0
- package/fesm2022/siemens-element-ng-form.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-icon-status.mjs +65 -0
- package/fesm2022/siemens-element-ng-icon-status.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-icon.mjs +22 -2
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-info-page.mjs +63 -0
- package/fesm2022/siemens-element-ng-info-page.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-inline-notification.mjs +4 -6
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-ip-input.mjs +451 -0
- package/fesm2022/siemens-element-ng-ip-input.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-language-switcher.mjs +90 -0
- package/fesm2022/siemens-element-ng-language-switcher.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-localization.mjs +306 -0
- package/fesm2022/siemens-element-ng-localization.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-number-input.mjs +267 -0
- package/fesm2022/siemens-element-ng-number-input.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-password-strength.mjs +177 -0
- package/fesm2022/siemens-element-ng-password-strength.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-photo-upload.mjs +480 -0
- package/fesm2022/siemens-element-ng-photo-upload.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-pills-input.mjs +397 -0
- package/fesm2022/siemens-element-ng-pills-input.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-popover-next.mjs +259 -0
- package/fesm2022/siemens-element-ng-popover-next.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-popover.mjs +256 -0
- package/fesm2022/siemens-element-ng-popover.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-progressbar.mjs +83 -0
- package/fesm2022/siemens-element-ng-progressbar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-search-bar.mjs +193 -0
- package/fesm2022/siemens-element-ng-search-bar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-select.mjs +1166 -0
- package/fesm2022/siemens-element-ng-select.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-skip-links.mjs +117 -0
- package/fesm2022/siemens-element-ng-skip-links.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-slider.mjs +313 -0
- package/fesm2022/siemens-element-ng-slider.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-sort-bar.mjs +89 -0
- package/fesm2022/siemens-element-ng-sort-bar.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-split.mjs +575 -0
- package/fesm2022/siemens-element-ng-split.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-status-toggle.mjs +196 -0
- package/fesm2022/siemens-element-ng-status-toggle.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-summary-widget.mjs +77 -0
- package/fesm2022/siemens-element-ng-summary-widget.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-system-banner.mjs +47 -0
- package/fesm2022/siemens-element-ng-system-banner.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-tabs.mjs +395 -0
- package/fesm2022/siemens-element-ng-tabs.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-toast-notification.mjs +227 -0
- package/fesm2022/siemens-element-ng-toast-notification.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-typeahead.mjs +746 -0
- package/fesm2022/siemens-element-ng-typeahead.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-unauthorized-page.mjs +76 -0
- package/fesm2022/siemens-element-ng-unauthorized-page.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-wizard.mjs +465 -0
- package/fesm2022/siemens-element-ng-wizard.mjs.map +1 -0
- package/file-uploader/index.d.ts +8 -0
- package/file-uploader/package.json +3 -0
- package/file-uploader/si-file-dropzone.component.d.ts +106 -0
- package/file-uploader/si-file-uploader.component.d.ts +296 -0
- package/file-uploader/si-file-uploader.model.d.ts +12 -0
- package/file-uploader/si-file-uploader.module.d.ts +8 -0
- package/filter-bar/filter.d.ts +26 -0
- package/filter-bar/index.d.ts +8 -0
- package/filter-bar/package.json +3 -0
- package/filter-bar/si-filter-bar.component.d.ts +65 -0
- package/filter-bar/si-filter-bar.module.d.ts +7 -0
- package/filter-bar/si-filter-pill.component.d.ts +20 -0
- package/form/form-fieldset/si-form-fieldset.component.d.ts +40 -0
- package/form/index.d.ts +14 -0
- package/form/package.json +3 -0
- package/form/si-form-container/si-form-container.component.d.ts +155 -0
- package/form/si-form-item/si-form-field-native.control.d.ts +22 -0
- package/form/si-form-item/si-form-item.component.d.ts +90 -0
- package/form/si-form-item-control-input.directive.d.ts +18 -0
- package/form/si-form-item.control.d.ts +35 -0
- package/form/si-form-validation-error.model.d.ts +55 -0
- package/form/si-form-validation-error.provider.d.ts +11 -0
- package/form/si-form-validation-error.service.d.ts +42 -0
- package/form/si-form-validation-tooltip/si-form-validation-tooltip.component.d.ts +13 -0
- package/form/si-form-validation-tooltip/si-form-validation-tooltip.directive.d.ts +42 -0
- package/form/si-form.module.d.ts +25 -0
- package/icon/element-icons.d.ts +20 -0
- package/icon-status/index.d.ts +6 -0
- package/icon-status/package.json +3 -0
- package/icon-status/si-icon-status.component.d.ts +24 -0
- package/icon-status/si-icon-status.module.d.ts +7 -0
- package/info-page/index.d.ts +5 -0
- package/info-page/package.json +3 -0
- package/info-page/si-info-page.component.d.ts +38 -0
- package/inline-notification/si-inline-notification.component.d.ts +0 -2
- package/ip-input/address-utils.d.ts +28 -0
- package/ip-input/address-validators.d.ts +21 -0
- package/ip-input/index.d.ts +7 -0
- package/ip-input/package.json +3 -0
- package/ip-input/si-ip-input.directive.d.ts +53 -0
- package/ip-input/si-ip4-input.directive.d.ts +9 -0
- package/ip-input/si-ip6-input.directive.d.ts +10 -0
- package/language-switcher/index.d.ts +7 -0
- package/language-switcher/iso-language-value.d.ts +14 -0
- package/language-switcher/package.json +3 -0
- package/language-switcher/si-language-switcher.component.d.ts +32 -0
- package/language-switcher/si-language-switcher.module.d.ts +7 -0
- package/localization/index.d.ts +8 -0
- package/localization/package.json +3 -0
- package/localization/si-directionality.d.ts +41 -0
- package/localization/si-locale-id.d.ts +22 -0
- package/localization/si-locale-store.d.ts +16 -0
- package/localization/si-locale.service.d.ts +73 -0
- package/number-input/index.d.ts +6 -0
- package/number-input/package.json +3 -0
- package/number-input/si-number-input.component.d.ts +106 -0
- package/number-input/si-number-input.module.d.ts +7 -0
- package/package.json +163 -3
- package/password-strength/index.d.ts +7 -0
- package/password-strength/package.json +3 -0
- package/password-strength/si-password-strength.component.d.ts +25 -0
- package/password-strength/si-password-strength.directive.d.ts +54 -0
- package/password-strength/si-password-strength.module.d.ts +8 -0
- package/photo-upload/index.d.ts +6 -0
- package/photo-upload/package.json +3 -0
- package/photo-upload/si-image-cropper-style.component.d.ts +5 -0
- package/photo-upload/si-photo-upload.component.d.ts +298 -0
- package/pills-input/index.d.ts +9 -0
- package/pills-input/package.json +3 -0
- package/pills-input/si-input-pill.component.d.ts +9 -0
- package/pills-input/si-pills-input-csv.directive.d.ts +8 -0
- package/pills-input/si-pills-input-email.directive.d.ts +10 -0
- package/pills-input/si-pills-input-pattern-base.d.ts +19 -0
- package/pills-input/si-pills-input-value-handler.d.ts +12 -0
- package/pills-input/si-pills-input.component.d.ts +87 -0
- package/pills-input/si-pills-input.module.d.ts +9 -0
- package/popover/index.d.ts +6 -0
- package/popover/package.json +3 -0
- package/popover/si-popover.component.d.ts +26 -0
- package/popover/si-popover.directive.d.ts +89 -0
- package/popover/si-popover.module.d.ts +7 -0
- package/popover-next/index.d.ts +7 -0
- package/popover-next/package.json +3 -0
- package/popover-next/si-popover-description.directive.d.ts +7 -0
- package/popover-next/si-popover-next.directive.d.ts +61 -0
- package/popover-next/si-popover-title.directive.d.ts +7 -0
- package/popover-next/si-popover.component.d.ts +27 -0
- package/progressbar/index.d.ts +6 -0
- package/progressbar/package.json +3 -0
- package/progressbar/si-progressbar.component.d.ts +43 -0
- package/progressbar/si-progressbar.module.d.ts +7 -0
- package/search-bar/index.d.ts +6 -0
- package/search-bar/package.json +3 -0
- package/search-bar/si-search-bar.component.d.ts +87 -0
- package/search-bar/si-search-bar.module.d.ts +7 -0
- package/select/index.d.ts +18 -0
- package/select/options/si-select-complex-options.directive.d.ts +69 -0
- package/select/options/si-select-lazy-options.directive.d.ts +38 -0
- package/select/options/si-select-option.source.d.ts +49 -0
- package/select/options/si-select-options-strategy.base.d.ts +35 -0
- package/select/options/si-select-options-strategy.d.ts +37 -0
- package/select/options/si-select-simple-options.directive.d.ts +34 -0
- package/select/package.json +3 -0
- package/select/select-input/si-select-input.component.d.ts +43 -0
- package/select/select-list/si-select-list-has-filter.component.d.ts +20 -0
- package/select/select-list/si-select-list.base.d.ts +37 -0
- package/select/select-list/si-select-list.component.d.ts +15 -0
- package/select/select-option/si-select-option-row.component.d.ts +16 -0
- package/select/select-option/si-select-option.component.d.ts +9 -0
- package/select/selection/si-select-multi-value.directive.d.ts +26 -0
- package/select/selection/si-select-selection-strategy.d.ts +58 -0
- package/select/selection/si-select-single-value.directive.d.ts +26 -0
- package/select/si-select-action.directive.d.ts +12 -0
- package/select/si-select-actions.directive.d.ts +5 -0
- package/select/si-select-group-template.directive.d.ts +20 -0
- package/select/si-select-option-row-template.directive.d.ts +9 -0
- package/select/si-select-option-template.directive.d.ts +21 -0
- package/select/si-select.component.d.ts +96 -0
- package/select/si-select.module.d.ts +15 -0
- package/select/si-select.types.d.ts +65 -0
- package/skip-links/index.d.ts +5 -0
- package/skip-links/package.json +3 -0
- package/skip-links/si-skip-link-target.directive.d.ts +27 -0
- package/skip-links/si-skip-links.component.d.ts +9 -0
- package/skip-links/skip-link.service.d.ts +14 -0
- package/slider/index.d.ts +6 -0
- package/slider/package.json +3 -0
- package/slider/si-slider.component.d.ts +129 -0
- package/slider/si-slider.module.d.ts +7 -0
- package/sort-bar/index.d.ts +6 -0
- package/sort-bar/package.json +3 -0
- package/sort-bar/si-sort-bar.component.d.ts +42 -0
- package/sort-bar/si-sort-bar.module.d.ts +7 -0
- package/split/index.d.ts +8 -0
- package/split/package.json +3 -0
- package/split/si-split-part.component.d.ts +154 -0
- package/split/si-split.component.d.ts +48 -0
- package/split/si-split.interfaces.d.ts +17 -0
- package/split/si-split.module.d.ts +8 -0
- package/status-toggle/index.d.ts +6 -0
- package/status-toggle/package.json +3 -0
- package/status-toggle/si-status-toggle.component.d.ts +54 -0
- package/status-toggle/status-toggle.model.d.ts +26 -0
- package/summary-widget/index.d.ts +5 -0
- package/summary-widget/package.json +3 -0
- package/summary-widget/si-summary-widget.component.d.ts +44 -0
- package/system-banner/index.d.ts +5 -0
- package/system-banner/package.json +3 -0
- package/system-banner/system-banner.component.d.ts +23 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/package.json +3 -0
- package/tabs/si-tab/index.d.ts +5 -0
- package/tabs/si-tab/si-tab.component.d.ts +58 -0
- package/tabs/si-tabs.module.d.ts +8 -0
- package/tabs/si-tabset/index.d.ts +5 -0
- package/tabs/si-tabset/si-tabset.component.d.ts +100 -0
- package/template-i18n.json +111 -1
- package/toast-notification/index.d.ts +6 -0
- package/toast-notification/package.json +3 -0
- package/toast-notification/si-toast-notification/si-toast-notification.component.d.ts +17 -0
- package/toast-notification/si-toast-notification-drawer/si-toast-notification-drawer.component.d.ts +9 -0
- package/toast-notification/si-toast-notification.service.d.ts +41 -0
- package/toast-notification/si-toast.model.d.ts +25 -0
- package/translate/si-translatable-keys.interface.d.ts +110 -0
- package/typeahead/index.d.ts +8 -0
- package/typeahead/package.json +3 -0
- package/typeahead/si-typeahead-item-template.directive.d.ts +7 -0
- package/typeahead/si-typeahead.component.d.ts +22 -0
- package/typeahead/si-typeahead.directive.d.ts +196 -0
- package/typeahead/si-typeahead.model.d.ts +60 -0
- package/typeahead/si-typeahead.module.d.ts +8 -0
- package/typeahead/si-typeahead.sorting.d.ts +10 -0
- package/unauthorized-page/index.d.ts +6 -0
- package/unauthorized-page/package.json +3 -0
- package/unauthorized-page/si-unauthorized-page.component.d.ts +35 -0
- package/unauthorized-page/si-unauthorized-page.module.d.ts +7 -0
- package/wizard/index.d.ts +7 -0
- package/wizard/package.json +3 -0
- package/wizard/si-wizard-step.component.d.ts +21 -0
- package/wizard/si-wizard.component.d.ts +196 -0
- package/wizard/si-wizard.module.d.ts +8 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { NgClass } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, input, booleanAttribute, computed, signal, viewChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
4
|
+
import { BlinkService } from '@siemens/element-ng/common';
|
|
5
|
+
import { STATUS_ICON_CONFIG, addIcons, elementRight4, SiIconNextComponent } from '@siemens/element-ng/icon';
|
|
6
|
+
import * as i1 from '@siemens/element-translate-ng/translate';
|
|
7
|
+
import { SiTranslateModule } from '@siemens/element-translate-ng/translate';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Copyright Siemens 2016 - 2025.
|
|
11
|
+
* SPDX-License-Identifier: MIT
|
|
12
|
+
*/
|
|
13
|
+
class SiCircleStatusComponent {
|
|
14
|
+
statusIcons = inject(STATUS_ICON_CONFIG);
|
|
15
|
+
/**
|
|
16
|
+
* The status (success, info, warning, danger) to be visualized.
|
|
17
|
+
*/
|
|
18
|
+
status = input();
|
|
19
|
+
/* DO NOT REMOVE: Even though the input is marked as deprecated, the core-team decided not to remove the
|
|
20
|
+
input. The possibility to have custom color is often requested by projects, so we keep it.
|
|
21
|
+
however in order to discourage it's use, we keep it marked deprecated.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* A custom color (e.g. `#fefefe`) for exceptional cases.
|
|
25
|
+
* @deprecated use the semantic `status` input instead.
|
|
26
|
+
*/
|
|
27
|
+
color = input();
|
|
28
|
+
/**
|
|
29
|
+
* Set a domain type icon (e.g. `element-door`) for which the status shall be shown.
|
|
30
|
+
* Leave undefined for visualizing the status without an icon.
|
|
31
|
+
*/
|
|
32
|
+
icon = input();
|
|
33
|
+
/**
|
|
34
|
+
* Set the size using either regular or small only works when used together with `icon`
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue 'regular'
|
|
37
|
+
*/
|
|
38
|
+
size = input('regular');
|
|
39
|
+
/**
|
|
40
|
+
* event direction is out
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue false
|
|
43
|
+
*/
|
|
44
|
+
eventOut = input(false, { transform: booleanAttribute });
|
|
45
|
+
/**
|
|
46
|
+
* Custom icon class for event out
|
|
47
|
+
*/
|
|
48
|
+
eventIcon = input();
|
|
49
|
+
/**
|
|
50
|
+
* Whether the status should appear with a pulsing circle around the badge.
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue false
|
|
53
|
+
*/
|
|
54
|
+
blink = input(false, { transform: booleanAttribute });
|
|
55
|
+
/**
|
|
56
|
+
* Blink pulse generator for synchronized blinking with other components
|
|
57
|
+
*/
|
|
58
|
+
blinkPulse = input();
|
|
59
|
+
/**
|
|
60
|
+
* Aria label for icon and status combo. Needed for a11y
|
|
61
|
+
*/
|
|
62
|
+
ariaLabel = input();
|
|
63
|
+
backgroundClass = computed(() => this.statusIcon()?.background ?? '');
|
|
64
|
+
theAriaLabel = computed(() => this.ariaLabel() ?? this.autoLabel());
|
|
65
|
+
autoLabel = computed(() => {
|
|
66
|
+
const status = this.status();
|
|
67
|
+
const statusName = status && this.statusIcons[status] ? status : 'none';
|
|
68
|
+
const direction = this.eventOut() ? ' out' : '';
|
|
69
|
+
const iconName = this.icon()?.replace(/^element-{0,1}/, '') ?? '';
|
|
70
|
+
return `${iconName.toLocaleLowerCase()}${this.status() && this.icon() ? ' in ' : ''}status ${statusName}${direction}`;
|
|
71
|
+
});
|
|
72
|
+
statusIcon = computed(() => {
|
|
73
|
+
const status = this.status();
|
|
74
|
+
return status ? this.statusIcons[status] : undefined;
|
|
75
|
+
});
|
|
76
|
+
blinkOn = signal(false);
|
|
77
|
+
contrastFix = signal(false);
|
|
78
|
+
icons = addIcons({ elementRight4 });
|
|
79
|
+
blinkSubs;
|
|
80
|
+
bg = viewChild.required('bg');
|
|
81
|
+
blinkService = inject(BlinkService);
|
|
82
|
+
ngOnChanges(changes) {
|
|
83
|
+
if (this.blinkService && changes.blink) {
|
|
84
|
+
this.blinkSubs?.unsubscribe();
|
|
85
|
+
if (this.blink()) {
|
|
86
|
+
const pulse = this.blinkPulse() ?? this.blinkService.pulse$;
|
|
87
|
+
this.blinkSubs = pulse.subscribe(onOff => {
|
|
88
|
+
this.blinkOn.set(onOff);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
this.blinkOn.set(false);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (changes.color || changes.blink) {
|
|
96
|
+
queueMicrotask(() => {
|
|
97
|
+
this.contrastFix.set(!!this.color() && this.blink() && this.calculateContrastFix());
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
ngOnDestroy() {
|
|
102
|
+
this.blinkSubs?.unsubscribe();
|
|
103
|
+
}
|
|
104
|
+
calculateContrastFix() {
|
|
105
|
+
// see https://www.w3.org/TR/AERT/#color-contrast
|
|
106
|
+
const rgb = getComputedStyle(this.bg().nativeElement)
|
|
107
|
+
.backgroundColor?.match(/\d+/g)
|
|
108
|
+
?.map(v => +v);
|
|
109
|
+
return !!rgb && Math.round((rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000) <= 128;
|
|
110
|
+
}
|
|
111
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
112
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiCircleStatusComponent, isStandalone: true, selector: "si-circle-status", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, eventOut: { classPropertyName: "eventOut", publicName: "eventOut", isSignal: true, isRequired: false, transformFunction: null }, eventIcon: { classPropertyName: "eventIcon", publicName: "eventIcon", isSignal: true, isRequired: false, transformFunction: null }, blink: { classPropertyName: "blink", publicName: "blink", isSignal: true, isRequired: false, transformFunction: null }, blinkPulse: { classPropertyName: "blinkPulse", publicName: "blinkPulse", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "bg", first: true, predicate: ["bg"], descendants: true, isSignal: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"status-indication d-flex align-items-center justify-content-center\"\n role=\"status\"\n [class.has-icon]=\"icon()\"\n [class.small]=\"size() === 'small'\"\n [attr.aria-label]=\"theAriaLabel() | translate\"\n>\n <div\n #bg\n class=\"bg\"\n [class.pulse]=\"blinkOn()\"\n [class.deprecated-color]=\"!status()\"\n [class.contrast-fix]=\"contrastFix()\"\n [ngClass]=\"backgroundClass()\"\n [style.background-color]=\"color()\"\n ></div>\n @if (!status()) {\n <div class=\"deprecated-dot\" [style.background-color]=\"color()\"></div>\n }\n @let iconConfig = statusIcon();\n @if (iconConfig) {\n <span class=\"status-icon icon-stack indicator\">\n <si-icon-next class=\"status-icon\" [ngClass]=\"iconConfig.color\" [icon]=\"iconConfig.icon\" />\n <si-icon-next\n class=\"status-icon\"\n [ngClass]=\"iconConfig.stackedColor\"\n [icon]=\"iconConfig.stacked\"\n />\n </span>\n }\n @let eventIconValue = eventIcon();\n @if (eventOut()) {\n <si-icon-next class=\"icon text-body event-out flip-rtl\" [icon]=\"icons.elementRight4\" />\n } @else if (eventIconValue) {\n <si-icon-next class=\"icon text-body event-out\" [icon]=\"eventIconValue\" />\n }\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon position-relative text-body\" [icon]=\"iconValue\" />\n }\n</div>\n", styles: [":host{display:inline-block;vertical-align:middle}:host .status-indication ::ng-deep .status-icon{font-size:24px}:host .status-indication.has-icon.small ::ng-deep .status-icon,:host .status-indication.has-icon.small ::ng-deep .event-out{font-size:16px}.deprecated-dot{inline-size:10px;block-size:10px;border-radius:50%}.event-out{position:absolute;inset-block-end:-2px;inset-inline-end:-13px}.status-indication{position:relative;inline-size:40px;block-size:40px;border-radius:50%;border:1px solid transparent}.status-indication.has-icon{border-color:var(--element-ui-4);background-color:var(--element-base-1);margin-block:6px;margin-inline:0 12px}.status-indication.has-icon .deprecated-dot,.status-indication.has-icon .indicator{position:absolute}.status-indication.has-icon .deprecated-dot{inset-block-start:-2px;inset-inline-end:0}.status-indication.has-icon .indicator{inset-block-start:-9px;inset-inline-end:-13px}.status-indication.has-icon.small{inline-size:32px;block-size:32px;margin-block:4px;margin-inline:0 8px}.status-indication.has-icon.small .event-out{inset-block-end:1px;inset-inline-end:-9px}.status-indication.has-icon.small .deprecated-dot{inline-size:8px;block-size:8px;inset-block-start:-1px;inset-inline-end:-1px}.status-indication.has-icon.small .indicator{inset-block-start:-6px;inset-inline-end:-8px}.status-indication>*{pointer-events:none;line-height:0}.bg{position:absolute;inset:0;border-radius:50%;transition:opacity calc(.5s * var(--element-animations-enabled, 1));opacity:0}.pulse.deprecated-color{opacity:.5}.pulse.deprecated-color.contrast-fix{opacity:.25}.pulse:not(.deprecated-color){opacity:1}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
113
|
+
}
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusComponent, decorators: [{
|
|
115
|
+
type: Component,
|
|
116
|
+
args: [{ selector: 'si-circle-status', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgClass, SiIconNextComponent, SiTranslateModule], template: "<div\n class=\"status-indication d-flex align-items-center justify-content-center\"\n role=\"status\"\n [class.has-icon]=\"icon()\"\n [class.small]=\"size() === 'small'\"\n [attr.aria-label]=\"theAriaLabel() | translate\"\n>\n <div\n #bg\n class=\"bg\"\n [class.pulse]=\"blinkOn()\"\n [class.deprecated-color]=\"!status()\"\n [class.contrast-fix]=\"contrastFix()\"\n [ngClass]=\"backgroundClass()\"\n [style.background-color]=\"color()\"\n ></div>\n @if (!status()) {\n <div class=\"deprecated-dot\" [style.background-color]=\"color()\"></div>\n }\n @let iconConfig = statusIcon();\n @if (iconConfig) {\n <span class=\"status-icon icon-stack indicator\">\n <si-icon-next class=\"status-icon\" [ngClass]=\"iconConfig.color\" [icon]=\"iconConfig.icon\" />\n <si-icon-next\n class=\"status-icon\"\n [ngClass]=\"iconConfig.stackedColor\"\n [icon]=\"iconConfig.stacked\"\n />\n </span>\n }\n @let eventIconValue = eventIcon();\n @if (eventOut()) {\n <si-icon-next class=\"icon text-body event-out flip-rtl\" [icon]=\"icons.elementRight4\" />\n } @else if (eventIconValue) {\n <si-icon-next class=\"icon text-body event-out\" [icon]=\"eventIconValue\" />\n }\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon position-relative text-body\" [icon]=\"iconValue\" />\n }\n</div>\n", styles: [":host{display:inline-block;vertical-align:middle}:host .status-indication ::ng-deep .status-icon{font-size:24px}:host .status-indication.has-icon.small ::ng-deep .status-icon,:host .status-indication.has-icon.small ::ng-deep .event-out{font-size:16px}.deprecated-dot{inline-size:10px;block-size:10px;border-radius:50%}.event-out{position:absolute;inset-block-end:-2px;inset-inline-end:-13px}.status-indication{position:relative;inline-size:40px;block-size:40px;border-radius:50%;border:1px solid transparent}.status-indication.has-icon{border-color:var(--element-ui-4);background-color:var(--element-base-1);margin-block:6px;margin-inline:0 12px}.status-indication.has-icon .deprecated-dot,.status-indication.has-icon .indicator{position:absolute}.status-indication.has-icon .deprecated-dot{inset-block-start:-2px;inset-inline-end:0}.status-indication.has-icon .indicator{inset-block-start:-9px;inset-inline-end:-13px}.status-indication.has-icon.small{inline-size:32px;block-size:32px;margin-block:4px;margin-inline:0 8px}.status-indication.has-icon.small .event-out{inset-block-end:1px;inset-inline-end:-9px}.status-indication.has-icon.small .deprecated-dot{inline-size:8px;block-size:8px;inset-block-start:-1px;inset-inline-end:-1px}.status-indication.has-icon.small .indicator{inset-block-start:-6px;inset-inline-end:-8px}.status-indication>*{pointer-events:none;line-height:0}.bg{position:absolute;inset:0;border-radius:50%;transition:opacity calc(.5s * var(--element-animations-enabled, 1));opacity:0}.pulse.deprecated-color{opacity:.5}.pulse.deprecated-color.contrast-fix{opacity:.25}.pulse:not(.deprecated-color){opacity:1}\n"] }]
|
|
117
|
+
}] });
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Copyright Siemens 2016 - 2025.
|
|
121
|
+
* SPDX-License-Identifier: MIT
|
|
122
|
+
*/
|
|
123
|
+
class SiCircleStatusModule {
|
|
124
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
125
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusModule, imports: [SiCircleStatusComponent], exports: [SiCircleStatusComponent] });
|
|
126
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusModule, imports: [SiCircleStatusComponent] });
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiCircleStatusModule, decorators: [{
|
|
129
|
+
type: NgModule,
|
|
130
|
+
args: [{
|
|
131
|
+
imports: [SiCircleStatusComponent],
|
|
132
|
+
exports: [SiCircleStatusComponent]
|
|
133
|
+
}]
|
|
134
|
+
}] });
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Copyright Siemens 2016 - 2025.
|
|
138
|
+
* SPDX-License-Identifier: MIT
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Generated bundle index. Do not edit.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
export { SiCircleStatusComponent, SiCircleStatusModule };
|
|
146
|
+
//# sourceMappingURL=siemens-element-ng-circle-status.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-circle-status.mjs","sources":["../../../../projects/element-ng/circle-status/si-circle-status.component.ts","../../../../projects/element-ng/circle-status/si-circle-status.component.html","../../../../projects/element-ng/circle-status/si-circle-status.module.ts","../../../../projects/element-ng/circle-status/index.ts","../../../../projects/element-ng/circle-status/siemens-element-ng-circle-status.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { NgClass } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n input,\n OnChanges,\n OnDestroy,\n signal,\n SimpleChanges,\n viewChild\n} from '@angular/core';\nimport { BlinkService, EntityStatusType, StatusIcon } from '@siemens/element-ng/common';\nimport {\n addIcons,\n elementRight4,\n SiIconNextComponent,\n STATUS_ICON_CONFIG\n} from '@siemens/element-ng/icon';\nimport { SiTranslateModule } from '@siemens/element-translate-ng/translate';\nimport { Observable, Subscription } from 'rxjs';\n\n@Component({\n selector: 'si-circle-status',\n templateUrl: './si-circle-status.component.html',\n styleUrl: './si-circle-status.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgClass, SiIconNextComponent, SiTranslateModule]\n})\nexport class SiCircleStatusComponent implements OnChanges, OnDestroy {\n private readonly statusIcons = inject(STATUS_ICON_CONFIG);\n /**\n * The status (success, info, warning, danger) to be visualized.\n */\n readonly status = input<EntityStatusType>();\n\n /* DO NOT REMOVE: Even though the input is marked as deprecated, the core-team decided not to remove the\n input. The possibility to have custom color is often requested by projects, so we keep it.\n however in order to discourage it's use, we keep it marked deprecated.\n */\n /**\n * A custom color (e.g. `#fefefe`) for exceptional cases.\n * @deprecated use the semantic `status` input instead.\n */\n readonly color = input<string>();\n\n /**\n * Set a domain type icon (e.g. `element-door`) for which the status shall be shown.\n * Leave undefined for visualizing the status without an icon.\n */\n readonly icon = input<string>();\n\n /**\n * Set the size using either regular or small only works when used together with `icon`\n *\n * @defaultValue 'regular'\n */\n readonly size = input<'regular' | 'small'>('regular');\n\n /**\n * event direction is out\n *\n * @defaultValue false\n */\n readonly eventOut = input(false, { transform: booleanAttribute });\n\n /**\n * Custom icon class for event out\n */\n readonly eventIcon = input<string>();\n\n /**\n * Whether the status should appear with a pulsing circle around the badge.\n *\n * @defaultValue false\n */\n readonly blink = input(false, { transform: booleanAttribute });\n\n /**\n * Blink pulse generator for synchronized blinking with other components\n */\n readonly blinkPulse = input<Observable<boolean>>();\n\n /**\n * Aria label for icon and status combo. Needed for a11y\n */\n readonly ariaLabel = input<string>();\n\n protected readonly backgroundClass = computed(() => this.statusIcon()?.background ?? '');\n protected readonly theAriaLabel = computed(() => this.ariaLabel() ?? this.autoLabel());\n protected readonly autoLabel = computed(() => {\n const status = this.status();\n const statusName = status && this.statusIcons[status] ? status : 'none';\n const direction = this.eventOut() ? ' out' : '';\n const iconName = this.icon()?.replace(/^element-{0,1}/, '') ?? '';\n return `${iconName.toLocaleLowerCase()}${\n this.status() && this.icon() ? ' in ' : ''\n }status ${statusName}${direction}`;\n });\n protected readonly statusIcon = computed<StatusIcon | undefined>(() => {\n const status = this.status();\n return status ? this.statusIcons[status] : undefined;\n });\n protected readonly blinkOn = signal(false);\n protected readonly contrastFix = signal(false);\n protected readonly icons = addIcons({ elementRight4 });\n private blinkSubs?: Subscription;\n\n private readonly bg = viewChild.required<ElementRef>('bg');\n\n private blinkService = inject(BlinkService);\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.blinkService && changes.blink) {\n this.blinkSubs?.unsubscribe();\n\n if (this.blink()) {\n const pulse = this.blinkPulse() ?? this.blinkService.pulse$;\n this.blinkSubs = pulse.subscribe(onOff => {\n this.blinkOn.set(onOff);\n });\n } else {\n this.blinkOn.set(false);\n }\n }\n if (changes.color || changes.blink) {\n queueMicrotask(() => {\n this.contrastFix.set(!!this.color() && this.blink() && this.calculateContrastFix());\n });\n }\n }\n\n ngOnDestroy(): void {\n this.blinkSubs?.unsubscribe();\n }\n\n private calculateContrastFix(): boolean {\n // see https://www.w3.org/TR/AERT/#color-contrast\n const rgb = getComputedStyle(this.bg().nativeElement)\n .backgroundColor?.match(/\\d+/g)\n ?.map(v => +v);\n return !!rgb && Math.round((rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000) <= 128;\n }\n}\n","<div\n class=\"status-indication d-flex align-items-center justify-content-center\"\n role=\"status\"\n [class.has-icon]=\"icon()\"\n [class.small]=\"size() === 'small'\"\n [attr.aria-label]=\"theAriaLabel() | translate\"\n>\n <div\n #bg\n class=\"bg\"\n [class.pulse]=\"blinkOn()\"\n [class.deprecated-color]=\"!status()\"\n [class.contrast-fix]=\"contrastFix()\"\n [ngClass]=\"backgroundClass()\"\n [style.background-color]=\"color()\"\n ></div>\n @if (!status()) {\n <div class=\"deprecated-dot\" [style.background-color]=\"color()\"></div>\n }\n @let iconConfig = statusIcon();\n @if (iconConfig) {\n <span class=\"status-icon icon-stack indicator\">\n <si-icon-next class=\"status-icon\" [ngClass]=\"iconConfig.color\" [icon]=\"iconConfig.icon\" />\n <si-icon-next\n class=\"status-icon\"\n [ngClass]=\"iconConfig.stackedColor\"\n [icon]=\"iconConfig.stacked\"\n />\n </span>\n }\n @let eventIconValue = eventIcon();\n @if (eventOut()) {\n <si-icon-next class=\"icon text-body event-out flip-rtl\" [icon]=\"icons.elementRight4\" />\n } @else if (eventIconValue) {\n <si-icon-next class=\"icon text-body event-out\" [icon]=\"eventIconValue\" />\n }\n @let iconValue = icon();\n @if (iconValue) {\n <si-icon-next class=\"icon position-relative text-body\" [icon]=\"iconValue\" />\n }\n</div>\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiCircleStatusComponent } from './si-circle-status.component';\n\n@NgModule({\n imports: [SiCircleStatusComponent],\n exports: [SiCircleStatusComponent]\n})\nexport class SiCircleStatusModule {}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-circle-status.component';\nexport * from './si-circle-status.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, inject, viewChild, ElementRef, HostListener, ChangeDetectionStrategy, Component, booleanAttribute, model, viewChildren, Injectable } from '@angular/core';
|
|
3
|
+
import { ModalRef, SiModalService, createModalConfig } from '@siemens/element-ng/modal';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
6
|
+
import { CdkDragHandle, moveItemInArray, CdkDrag, CdkDropList, CDK_DRAG_CONFIG } from '@angular/cdk/drag-drop';
|
|
7
|
+
import { CdkOption, CdkListbox } from '@angular/cdk/listbox';
|
|
8
|
+
import * as i1 from '@angular/cdk/scrolling';
|
|
9
|
+
import { CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
10
|
+
import { addIcons, elementShow, elementLock, elementMenu, elementHide, SiIconNextComponent, elementCancel } from '@siemens/element-ng/icon';
|
|
11
|
+
import * as i2 from '@siemens/element-translate-ng/translate';
|
|
12
|
+
import { SiTranslateService, SiTranslateModule } from '@siemens/element-translate-ng/translate';
|
|
13
|
+
import { first } from 'rxjs/operators';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Copyright Siemens 2016 - 2025.
|
|
17
|
+
* SPDX-License-Identifier: MIT
|
|
18
|
+
*/
|
|
19
|
+
class SiColumnSelectionEditorComponent {
|
|
20
|
+
column = input.required();
|
|
21
|
+
selected = input.required();
|
|
22
|
+
renameInputLabel = input.required();
|
|
23
|
+
columnVisibilityConfigurable = input.required();
|
|
24
|
+
titleChange = output();
|
|
25
|
+
visibilityChange = output();
|
|
26
|
+
cdkOption = inject(CdkOption);
|
|
27
|
+
editing = false;
|
|
28
|
+
title = viewChild.required('title');
|
|
29
|
+
elementRef = inject(ElementRef);
|
|
30
|
+
icons = addIcons({
|
|
31
|
+
elementHide,
|
|
32
|
+
elementMenu,
|
|
33
|
+
elementLock,
|
|
34
|
+
elementShow
|
|
35
|
+
});
|
|
36
|
+
tryEdit(event) {
|
|
37
|
+
if (this.column().editable) {
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
this.startEdit();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
updateTitle(value) {
|
|
43
|
+
this.column().title = value;
|
|
44
|
+
this.titleChange.emit();
|
|
45
|
+
}
|
|
46
|
+
startEdit() {
|
|
47
|
+
if (this.column().editable) {
|
|
48
|
+
this.editing = true;
|
|
49
|
+
setTimeout(() => this.title().nativeElement.focus());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
stopEdit() {
|
|
53
|
+
this.editing = false;
|
|
54
|
+
this.elementRef.nativeElement.focus();
|
|
55
|
+
}
|
|
56
|
+
toggleVisibility() {
|
|
57
|
+
this.cdkOption.toggle();
|
|
58
|
+
// manually toggling does not emit an event, so we have to fire one
|
|
59
|
+
this.visibilityChange.emit();
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiColumnSelectionEditorComponent, isStandalone: true, selector: "si-column-selection-editor", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: true, transformFunction: null }, renameInputLabel: { classPropertyName: "renameInputLabel", publicName: "renameInputLabel", isSignal: true, isRequired: true, transformFunction: null }, columnVisibilityConfigurable: { classPropertyName: "columnVisibilityConfigurable", publicName: "columnVisibilityConfigurable", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { titleChange: "titleChange", visibilityChange: "visibilityChange" }, host: { listeners: { "keydown.enter": "tryEdit($event)" }, classAttribute: "d-block my-4 mx-1 rounded-2 elevation-1" }, viewQueries: [{ propertyName: "title", first: true, predicate: ["title"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"d-flex p-4\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <div class=\"d-flex w-100\" [attr.aria-label]=\"column().title\">\n @if (editing) {\n <input\n #title\n type=\"text\"\n class=\"form-control w-100\"\n [attr.aria-label]=\"renameInputLabel()\"\n [value]=\"column().title\"\n (input)=\"updateTitle(title.value)\"\n (keydown.enter)=\"stopEdit()\"\n (blur)=\"stopEdit()\"\n />\n } @else {\n <span\n class=\"form-control text-truncate w-100\"\n [class.border-0]=\"!column().editable\"\n [class.px-0]=\"!column().editable\"\n [class.disabled]=\"column().disabled\"\n (click)=\"startEdit()\"\n >{{ column().title }}</span\n >\n }\n </div>\n\n <div class=\"d-flex align-items-center\">\n @if (columnVisibilityConfigurable()) {\n <span\n class=\"btn btn-circle btn-sm btn-tertiary ms-4\"\n [class.text-primary]=\"!column().disabled\"\n [class.disabled]=\"column().disabled\"\n (click)=\"toggleVisibility()\"\n >\n <si-icon-next [icon]=\"selected() ? icons.elementShow : icons.elementHide\" />\n </span>\n }\n <span\n cdkDragHandle\n class=\"btn btn-circle btn-sm btn-tertiary ms-4\"\n [class.disabled]=\"column().disabled\"\n [class.pe-none]=\"!column().draggable\"\n >\n <si-icon-next\n [class.pe-none]=\"!column().draggable\"\n [icon]=\"column().draggable ? icons.elementMenu : icons.elementLock\"\n />\n </span>\n </div>\n</div>\n", styles: [".form-control{cursor:text}\n"], dependencies: [{ kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
63
|
+
}
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionEditorComponent, decorators: [{
|
|
65
|
+
type: Component,
|
|
66
|
+
args: [{ selector: 'si-column-selection-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CdkDragHandle, SiIconNextComponent], host: {
|
|
67
|
+
class: 'd-block my-4 mx-1 rounded-2 elevation-1'
|
|
68
|
+
}, template: "<div class=\"d-flex p-4\" (click)=\"$event.stopPropagation()\" (keydown)=\"$event.stopPropagation()\">\n <div class=\"d-flex w-100\" [attr.aria-label]=\"column().title\">\n @if (editing) {\n <input\n #title\n type=\"text\"\n class=\"form-control w-100\"\n [attr.aria-label]=\"renameInputLabel()\"\n [value]=\"column().title\"\n (input)=\"updateTitle(title.value)\"\n (keydown.enter)=\"stopEdit()\"\n (blur)=\"stopEdit()\"\n />\n } @else {\n <span\n class=\"form-control text-truncate w-100\"\n [class.border-0]=\"!column().editable\"\n [class.px-0]=\"!column().editable\"\n [class.disabled]=\"column().disabled\"\n (click)=\"startEdit()\"\n >{{ column().title }}</span\n >\n }\n </div>\n\n <div class=\"d-flex align-items-center\">\n @if (columnVisibilityConfigurable()) {\n <span\n class=\"btn btn-circle btn-sm btn-tertiary ms-4\"\n [class.text-primary]=\"!column().disabled\"\n [class.disabled]=\"column().disabled\"\n (click)=\"toggleVisibility()\"\n >\n <si-icon-next [icon]=\"selected() ? icons.elementShow : icons.elementHide\" />\n </span>\n }\n <span\n cdkDragHandle\n class=\"btn btn-circle btn-sm btn-tertiary ms-4\"\n [class.disabled]=\"column().disabled\"\n [class.pe-none]=\"!column().draggable\"\n >\n <si-icon-next\n [class.pe-none]=\"!column().draggable\"\n [icon]=\"column().draggable ? icons.elementMenu : icons.elementLock\"\n />\n </span>\n </div>\n</div>\n", styles: [".form-control{cursor:text}\n"] }]
|
|
69
|
+
}], propDecorators: { tryEdit: [{
|
|
70
|
+
type: HostListener,
|
|
71
|
+
args: ['keydown.enter', ['$event']]
|
|
72
|
+
}] } });
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Copyright Siemens 2016 - 2025.
|
|
76
|
+
* SPDX-License-Identifier: MIT
|
|
77
|
+
*/
|
|
78
|
+
const dragConfig = {
|
|
79
|
+
dragStartThreshold: 0,
|
|
80
|
+
pointerDirectionChangeThreshold: 5,
|
|
81
|
+
zIndex: 10000
|
|
82
|
+
};
|
|
83
|
+
class SiColumnSelectionDialogComponent {
|
|
84
|
+
titleId = input();
|
|
85
|
+
heading = input();
|
|
86
|
+
bodyTitle = input();
|
|
87
|
+
/**
|
|
88
|
+
* @defaultValue
|
|
89
|
+
* ```
|
|
90
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.SUBMIT:Apply`
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
submitBtnName = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.SUBMIT:Apply`);
|
|
94
|
+
/**
|
|
95
|
+
* @defaultValue
|
|
96
|
+
* ```
|
|
97
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.CANCEL:Cancel`
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
cancelBtnName = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.CANCEL:Cancel`);
|
|
101
|
+
/**
|
|
102
|
+
* @defaultValue
|
|
103
|
+
* ```
|
|
104
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.RESTORE_TO_DEFAULT:Restore to default`
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
restoreToDefaultBtnName = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.RESTORE_TO_DEFAULT:Restore to default`);
|
|
108
|
+
/**
|
|
109
|
+
* @defaultValue
|
|
110
|
+
* ```
|
|
111
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.HIDDEN:Hidden`
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
hiddenText = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.HIDDEN:Hidden`);
|
|
115
|
+
/**
|
|
116
|
+
* @defaultValue
|
|
117
|
+
* ```
|
|
118
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.VISIBLE:Visible`
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
visibleText = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.VISIBLE:Visible`);
|
|
122
|
+
/** @defaultValue false */
|
|
123
|
+
restoreEnabled = input(false, { transform: booleanAttribute });
|
|
124
|
+
columns = model.required();
|
|
125
|
+
/**
|
|
126
|
+
* @defaultValue
|
|
127
|
+
* ```
|
|
128
|
+
* {}
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
translationParams = input({});
|
|
132
|
+
/**
|
|
133
|
+
* @defaultValue
|
|
134
|
+
* ```
|
|
135
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.LIST_ARIA_LABEL:
|
|
136
|
+
* List of possible columns.
|
|
137
|
+
* Items can be moved using Alt+ArrowUp or Alt+ArrowDown.
|
|
138
|
+
* Press Enter to rename supported items.`
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
listAriaLabel = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.LIST_ARIA_LABEL:List of possible columns. Items can be moved using Alt+ArrowUp or Alt+ArrowDown. Press Enter to rename supported items.`);
|
|
142
|
+
/**
|
|
143
|
+
* @defaultValue
|
|
144
|
+
* ```
|
|
145
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.RENAME_INPUT_ARIA_LABEL:Rename column`
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
renameInputAriaLabel = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.RENAME_INPUT_ARIA_LABEL:Rename column`);
|
|
149
|
+
/**
|
|
150
|
+
* @defaultValue
|
|
151
|
+
* ```
|
|
152
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.ITEM_MOVED:Item is now at position {{targetPosition}}`
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
a11yItemMovedMessage = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.ITEM_MOVED:Item is now at position {{targetPosition}}`);
|
|
156
|
+
/**
|
|
157
|
+
* @defaultValue
|
|
158
|
+
* ```
|
|
159
|
+
* $localize`:@@SI_COLUMN_SELECTION_DIALOG.ITEM_NOT_MOVED:Item was not moved`
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
a11yItemNotMovedMessage = input($localize `:@@SI_COLUMN_SELECTION_DIALOG.ITEM_NOT_MOVED:Item was not moved`);
|
|
163
|
+
/** @defaultValue true */
|
|
164
|
+
columnVisibilityConfigurable = input(true, { transform: booleanAttribute });
|
|
165
|
+
listOptions = viewChildren(CdkOption);
|
|
166
|
+
modalBodyElement = viewChild.required('modalBody');
|
|
167
|
+
tempHeaderData = [];
|
|
168
|
+
modalRef = inject((ModalRef));
|
|
169
|
+
icons = addIcons({ elementCancel });
|
|
170
|
+
visibleIds = [];
|
|
171
|
+
liveAnnouncer = inject(LiveAnnouncer);
|
|
172
|
+
translateService = inject(SiTranslateService);
|
|
173
|
+
ngOnInit() {
|
|
174
|
+
this.setupColumnData();
|
|
175
|
+
}
|
|
176
|
+
/** @internal */
|
|
177
|
+
get backupColumns() {
|
|
178
|
+
return this.tempHeaderData;
|
|
179
|
+
}
|
|
180
|
+
submitColumnSelection() {
|
|
181
|
+
this.modalRef.hide({ type: 'ok', columns: this.columns() });
|
|
182
|
+
}
|
|
183
|
+
cancelColumnSelection() {
|
|
184
|
+
this.columns.set([]);
|
|
185
|
+
this.tempHeaderData.forEach(element => this.columns.update(a => [...a, element]));
|
|
186
|
+
this.modalRef.hide({ type: 'cancel', columns: this.columns() });
|
|
187
|
+
}
|
|
188
|
+
drop(event) {
|
|
189
|
+
const columns = this.columns();
|
|
190
|
+
if (columns[event.currentIndex].draggable) {
|
|
191
|
+
moveItemInArray(columns, event.previousIndex, event.currentIndex);
|
|
192
|
+
this.emitChange();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
restoreToDefault() {
|
|
196
|
+
this.modalRef.hidden.next({
|
|
197
|
+
type: 'restoreDefault',
|
|
198
|
+
columns: this.columns(),
|
|
199
|
+
updateColumns: columns => {
|
|
200
|
+
this.columns.set(columns);
|
|
201
|
+
this.setupColumnData();
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
moveDown(index, event) {
|
|
206
|
+
const columns = this.columns();
|
|
207
|
+
const listOptions = this.listOptions();
|
|
208
|
+
if (columns[index].draggable) {
|
|
209
|
+
let targetIndex = index + 1;
|
|
210
|
+
while (columns[targetIndex] && !columns[targetIndex].draggable) {
|
|
211
|
+
targetIndex++;
|
|
212
|
+
}
|
|
213
|
+
if (targetIndex !== index && columns[targetIndex]?.draggable) {
|
|
214
|
+
event.preventDefault();
|
|
215
|
+
moveItemInArray(columns, index, targetIndex);
|
|
216
|
+
// When moving the first partially visible item down,
|
|
217
|
+
// the browser tries to keep its position stable within the viewport by automatically scrolling down.
|
|
218
|
+
// This behavior is not wanted here, so we restore the previous scroll after moving the item
|
|
219
|
+
// TODO: check if this could be solved easier
|
|
220
|
+
if (listOptions.at(index).element.getBoundingClientRect().top <=
|
|
221
|
+
this.modalBodyElement().nativeElement.getBoundingClientRect().top) {
|
|
222
|
+
const previousScrollTop = this.modalBodyElement().nativeElement.scrollTop;
|
|
223
|
+
setTimeout(() => (this.modalBodyElement().nativeElement.scrollTop = previousScrollTop));
|
|
224
|
+
}
|
|
225
|
+
// When moving the last visible element down, the scroll position is not adopted. So its scroll out of view.
|
|
226
|
+
// We correct this manually by scrolling it back into view
|
|
227
|
+
const targetElement = listOptions.at(targetIndex).element;
|
|
228
|
+
if (targetElement.getBoundingClientRect().bottom >
|
|
229
|
+
this.modalBodyElement().nativeElement.getBoundingClientRect().bottom) {
|
|
230
|
+
targetElement.scrollIntoView({ block: 'end' });
|
|
231
|
+
}
|
|
232
|
+
this.announceSuccessfulMove(targetIndex);
|
|
233
|
+
this.emitChange();
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
this.announceNotSuccessfulMove();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
moveUp(index, event) {
|
|
241
|
+
const columns = this.columns();
|
|
242
|
+
if (columns[index].draggable) {
|
|
243
|
+
let targetIndex = index - 1;
|
|
244
|
+
while (columns[targetIndex] && !columns[targetIndex].draggable) {
|
|
245
|
+
targetIndex--;
|
|
246
|
+
}
|
|
247
|
+
if (targetIndex !== index && columns[targetIndex]?.draggable) {
|
|
248
|
+
event.preventDefault();
|
|
249
|
+
moveItemInArray(columns, index, targetIndex);
|
|
250
|
+
// it seems like this is only necessary for move up. Don't know why
|
|
251
|
+
setTimeout(() => this.listOptions().at(targetIndex).focus());
|
|
252
|
+
this.announceSuccessfulMove(targetIndex);
|
|
253
|
+
this.emitChange();
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this.announceNotSuccessfulMove();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
emitChange() {
|
|
261
|
+
this.modalRef.hidden.next({ type: 'instant', columns: this.columns() });
|
|
262
|
+
}
|
|
263
|
+
updateVisibility() {
|
|
264
|
+
const value = this.listOptions()
|
|
265
|
+
.filter(option => option.isSelected())
|
|
266
|
+
.map(option => option.value);
|
|
267
|
+
for (const column of this.columns()) {
|
|
268
|
+
column.visible = value.includes(column.id);
|
|
269
|
+
}
|
|
270
|
+
this.emitChange();
|
|
271
|
+
}
|
|
272
|
+
setupColumnData() {
|
|
273
|
+
const columns = this.columns();
|
|
274
|
+
this.tempHeaderData = columns.map(x => Object.assign({}, x));
|
|
275
|
+
this.visibleIds = columns.filter(column => column.visible).map(column => column.id);
|
|
276
|
+
}
|
|
277
|
+
announceSuccessfulMove(index) {
|
|
278
|
+
this.announceMove(this.a11yItemMovedMessage(), {
|
|
279
|
+
...this.translationParams,
|
|
280
|
+
targetPosition: index + 1
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
announceNotSuccessfulMove() {
|
|
284
|
+
this.announceMove(this.a11yItemNotMovedMessage(), this.translationParams());
|
|
285
|
+
}
|
|
286
|
+
announceMove(message, translationParams) {
|
|
287
|
+
if (message) {
|
|
288
|
+
this.translateService
|
|
289
|
+
.translateAsync(message, translationParams)
|
|
290
|
+
.pipe(first())
|
|
291
|
+
.subscribe(translatedMessage => this.liveAnnouncer.announce(translatedMessage));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
295
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiColumnSelectionDialogComponent, isStandalone: true, selector: "si-column-selection-dialog", inputs: { titleId: { classPropertyName: "titleId", publicName: "titleId", isSignal: true, isRequired: false, transformFunction: null }, heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: false, transformFunction: null }, bodyTitle: { classPropertyName: "bodyTitle", publicName: "bodyTitle", isSignal: true, isRequired: false, transformFunction: null }, submitBtnName: { classPropertyName: "submitBtnName", publicName: "submitBtnName", isSignal: true, isRequired: false, transformFunction: null }, cancelBtnName: { classPropertyName: "cancelBtnName", publicName: "cancelBtnName", isSignal: true, isRequired: false, transformFunction: null }, restoreToDefaultBtnName: { classPropertyName: "restoreToDefaultBtnName", publicName: "restoreToDefaultBtnName", isSignal: true, isRequired: false, transformFunction: null }, hiddenText: { classPropertyName: "hiddenText", publicName: "hiddenText", isSignal: true, isRequired: false, transformFunction: null }, visibleText: { classPropertyName: "visibleText", publicName: "visibleText", isSignal: true, isRequired: false, transformFunction: null }, restoreEnabled: { classPropertyName: "restoreEnabled", publicName: "restoreEnabled", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, translationParams: { classPropertyName: "translationParams", publicName: "translationParams", isSignal: true, isRequired: false, transformFunction: null }, listAriaLabel: { classPropertyName: "listAriaLabel", publicName: "listAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, renameInputAriaLabel: { classPropertyName: "renameInputAriaLabel", publicName: "renameInputAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, a11yItemMovedMessage: { classPropertyName: "a11yItemMovedMessage", publicName: "a11yItemMovedMessage", isSignal: true, isRequired: false, transformFunction: null }, a11yItemNotMovedMessage: { classPropertyName: "a11yItemNotMovedMessage", publicName: "a11yItemNotMovedMessage", isSignal: true, isRequired: false, transformFunction: null }, columnVisibilityConfigurable: { classPropertyName: "columnVisibilityConfigurable", publicName: "columnVisibilityConfigurable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columns: "columnsChange" }, providers: [{ provide: CDK_DRAG_CONFIG, useValue: dragConfig }], viewQueries: [{ propertyName: "listOptions", predicate: CdkOption, descendants: true, isSignal: true }, { propertyName: "modalBodyElement", first: true, predicate: ["modalBody"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"modal-header\">\n <span class=\"modal-title\" [id]=\"titleId()\">{{ heading() | translate: translationParams() }}</span>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost\"\n [attr.aria-label]=\"cancelBtnName() | translate\"\n (click)=\"cancelColumnSelection()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n</div>\n<p class=\"text-secondary px-8 pb-5 mb-0\">{{ bodyTitle() | translate: translationParams() }}</p>\n<div #modalBody class=\"modal-body\" tabindex=\"-1\" cdkScrollable>\n <div\n cdkListbox\n cdkListboxMultiple\n cdkDropList\n [cdkListboxValue]=\"visibleIds\"\n [attr.aria-label]=\"listAriaLabel() | translate: translationParams\"\n (cdkListboxValueChange)=\"updateVisibility()\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (column of columns(); track column) {\n <si-column-selection-editor\n #cdkOption=\"cdkOption\"\n cdkDrag\n class=\"focus-inside\"\n [cdkDragDisabled]=\"!column.draggable\"\n [cdkOption]=\"column.id\"\n [cdkOptionDisabled]=\"column.disabled\"\n [column]=\"column\"\n [selected]=\"cdkOption.isSelected()\"\n [renameInputLabel]=\"renameInputAriaLabel() | translate: translationParams\"\n [columnVisibilityConfigurable]=\"columnVisibilityConfigurable()\"\n (titleChange)=\"emitChange()\"\n (visibilityChange)=\"updateVisibility()\"\n (keydown.alt.arrowUp)=\"moveUp($index, $event)\"\n (keydown.alt.arrowDown)=\"moveDown($index, $event)\"\n />\n }\n </div>\n</div>\n<div class=\"modal-footer\">\n @if (restoreEnabled()) {\n <button type=\"button\" class=\"btn btn-tertiary me-auto\" (click)=\"restoreToDefault()\">\n {{ restoreToDefaultBtnName() | translate }}\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelColumnSelection()\">\n {{ cancelBtnName() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"submitColumnSelection()\">\n {{ submitBtnName() | translate }}\n </button>\n</div>\n", styles: [":host{-webkit-user-select:none;user-select:none;max-block-size:100%;overflow:hidden;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkListbox, selector: "[cdkListbox]", inputs: ["id", "tabindex", "cdkListboxValue", "cdkListboxMultiple", "cdkListboxDisabled", "cdkListboxUseActiveDescendant", "cdkListboxOrientation", "cdkListboxCompareWith", "cdkListboxNavigationWrapDisabled", "cdkListboxNavigatesDisabledOptions"], outputs: ["cdkListboxValueChange"], exportAs: ["cdkListbox"] }, { kind: "directive", type: CdkOption, selector: "[cdkOption]", inputs: ["id", "cdkOption", "cdkOptionTypeaheadLabel", "cdkOptionDisabled", "tabindex"], exportAs: ["cdkOption"] }, { kind: "ngmodule", type: CdkScrollableModule }, { kind: "directive", type: i1.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i2.SiTranslatePipe, name: "translate" }, { kind: "component", type: SiColumnSelectionEditorComponent, selector: "si-column-selection-editor", inputs: ["column", "selected", "renameInputLabel", "columnVisibilityConfigurable"], outputs: ["titleChange", "visibilityChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
296
|
+
}
|
|
297
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionDialogComponent, decorators: [{
|
|
298
|
+
type: Component,
|
|
299
|
+
args: [{ selector: 'si-column-selection-dialog', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
300
|
+
CdkDrag,
|
|
301
|
+
CdkDropList,
|
|
302
|
+
CdkListbox,
|
|
303
|
+
CdkOption,
|
|
304
|
+
CdkScrollableModule,
|
|
305
|
+
SiIconNextComponent,
|
|
306
|
+
SiTranslateModule,
|
|
307
|
+
SiColumnSelectionEditorComponent
|
|
308
|
+
], providers: [{ provide: CDK_DRAG_CONFIG, useValue: dragConfig }], template: "<div class=\"modal-header\">\n <span class=\"modal-title\" [id]=\"titleId()\">{{ heading() | translate: translationParams() }}</span>\n <button\n type=\"button\"\n class=\"btn btn-circle btn-sm btn-ghost\"\n [attr.aria-label]=\"cancelBtnName() | translate\"\n (click)=\"cancelColumnSelection()\"\n >\n <si-icon-next [icon]=\"icons.elementCancel\" />\n </button>\n</div>\n<p class=\"text-secondary px-8 pb-5 mb-0\">{{ bodyTitle() | translate: translationParams() }}</p>\n<div #modalBody class=\"modal-body\" tabindex=\"-1\" cdkScrollable>\n <div\n cdkListbox\n cdkListboxMultiple\n cdkDropList\n [cdkListboxValue]=\"visibleIds\"\n [attr.aria-label]=\"listAriaLabel() | translate: translationParams\"\n (cdkListboxValueChange)=\"updateVisibility()\"\n (cdkDropListDropped)=\"drop($event)\"\n >\n @for (column of columns(); track column) {\n <si-column-selection-editor\n #cdkOption=\"cdkOption\"\n cdkDrag\n class=\"focus-inside\"\n [cdkDragDisabled]=\"!column.draggable\"\n [cdkOption]=\"column.id\"\n [cdkOptionDisabled]=\"column.disabled\"\n [column]=\"column\"\n [selected]=\"cdkOption.isSelected()\"\n [renameInputLabel]=\"renameInputAriaLabel() | translate: translationParams\"\n [columnVisibilityConfigurable]=\"columnVisibilityConfigurable()\"\n (titleChange)=\"emitChange()\"\n (visibilityChange)=\"updateVisibility()\"\n (keydown.alt.arrowUp)=\"moveUp($index, $event)\"\n (keydown.alt.arrowDown)=\"moveDown($index, $event)\"\n />\n }\n </div>\n</div>\n<div class=\"modal-footer\">\n @if (restoreEnabled()) {\n <button type=\"button\" class=\"btn btn-tertiary me-auto\" (click)=\"restoreToDefault()\">\n {{ restoreToDefaultBtnName() | translate }}\n </button>\n }\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancelColumnSelection()\">\n {{ cancelBtnName() | translate }}\n </button>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"submitColumnSelection()\">\n {{ submitBtnName() | translate }}\n </button>\n</div>\n", styles: [":host{-webkit-user-select:none;user-select:none;max-block-size:100%;overflow:hidden;display:flex;flex-direction:column}\n"] }]
|
|
309
|
+
}] });
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Copyright Siemens 2016 - 2025.
|
|
313
|
+
* SPDX-License-Identifier: MIT
|
|
314
|
+
*/
|
|
315
|
+
class SiColumnSelectionDialogService {
|
|
316
|
+
modalService = inject(SiModalService);
|
|
317
|
+
/**
|
|
318
|
+
* Opens a column selection dialog.
|
|
319
|
+
*
|
|
320
|
+
* Despite other dialogs,
|
|
321
|
+
* this dialog informs the consumer not ONLY with clicking `submit` or `cancel`,
|
|
322
|
+
* but also with changing the place or visibility of a dialog row
|
|
323
|
+
* thanks to the `instant` type of emitted event.
|
|
324
|
+
*
|
|
325
|
+
* {@label WITH_OBJECT}
|
|
326
|
+
*/
|
|
327
|
+
showColumnSelectionDialog(dialogConfig, diOptions) {
|
|
328
|
+
return new Observable(subscriber => {
|
|
329
|
+
const config = createModalConfig(dialogConfig);
|
|
330
|
+
Object.assign(config, diOptions);
|
|
331
|
+
config.class += ' modal-dialog-scrollable';
|
|
332
|
+
config.keyboard = true;
|
|
333
|
+
const modalRef = this.modalService.show(SiColumnSelectionDialogComponent, config);
|
|
334
|
+
const subscription = modalRef.hidden.subscribe((confirmationResult) => {
|
|
335
|
+
const keepModalOpen = confirmationResult?.type === 'instant' || confirmationResult?.type === 'restoreDefault';
|
|
336
|
+
confirmationResult ??= { type: 'cancel', columns: modalRef.content.backupColumns };
|
|
337
|
+
subscriber.next(confirmationResult);
|
|
338
|
+
if (!keepModalOpen) {
|
|
339
|
+
subscription.unsubscribe();
|
|
340
|
+
subscriber.complete();
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return () => {
|
|
344
|
+
if (!subscription.closed) {
|
|
345
|
+
subscription.unsubscribe();
|
|
346
|
+
modalRef.detach();
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
352
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionDialogService, providedIn: 'root' });
|
|
353
|
+
}
|
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColumnSelectionDialogService, decorators: [{
|
|
355
|
+
type: Injectable,
|
|
356
|
+
args: [{ providedIn: 'root' }]
|
|
357
|
+
}] });
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Copyright Siemens 2016 - 2025.
|
|
361
|
+
* SPDX-License-Identifier: MIT
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Generated bundle index. Do not edit.
|
|
366
|
+
*/
|
|
367
|
+
|
|
368
|
+
export { SiColumnSelectionDialogService };
|
|
369
|
+
//# sourceMappingURL=siemens-element-ng-column-selection-dialog.mjs.map
|