@seniorsistemas/angular-components 19.3.1 → 19.3.3
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/breadcrumb/lib/dynamic-breadcrumb/dynamic-breadcrumb.component.d.ts +1 -2
- package/calendar-mask/lib/calendar-mask/calendar-mask.directive.d.ts +0 -1
- package/chips/lib/chips/chips/chips.component.d.ts +1 -2
- package/code-editor/lib/code-editor/code-editor.component.d.ts +0 -2
- package/code-editor/lib/code-editor/infra/utils/custom-translations/custom-translations.module.d.ts +1 -3
- package/common/lib/svg-factory/svg-factory.directive.d.ts +1 -2
- package/content-generator/lib/content-generator/content-generator.component.d.ts +1 -6
- package/content-generator/lib/services/IAssist/iassist.service.d.ts +0 -3
- package/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.d.ts +0 -3
- package/country-phone-picker/lib/country-phone-picker/country-phone-picker.service.d.ts +0 -2
- package/currency/lib/currency.service.d.ts +0 -2
- package/custom-fields/lib/custom-fields/custom-fields.component.d.ts +3 -7
- package/custom-fields/lib/custom-fields/custom-fields.service.d.ts +0 -2
- package/dynamic-form/dynamic-form/components/lookup/lookup.component.d.ts +2 -4
- package/dynamic-form/dynamic-form/components/lookup/types/lookup-models.d.ts +4 -0
- package/dynamic-form/dynamic-form/form-field/configurations/fields/lookup-field.d.ts +2 -1
- package/dynamic-form/dynamic-form/form-field/fields/autocomplete/autocomplete-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.d.ts +1 -3
- package/dynamic-form/dynamic-form/form-field/fields/calendar/calendar-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/chips/chips-field.component.d.ts +1 -3
- package/dynamic-form/dynamic-form/form-field/fields/country-phone-picker/country-phone-picker-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.d.ts +1 -3
- package/dynamic-form/dynamic-form/form-field/fields/file-picker/file-picker-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.d.ts +1 -3
- package/dynamic-form/dynamic-form/form-field/fields/password/password-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/text/text-field.component.d.ts +1 -2
- package/dynamic-form/dynamic-form/form-field/fields/text-area/text-area-field.component.d.ts +1 -2
- package/dynamic-form/public-api.d.ts +1 -0
- package/empty-state/lib/empty-state/go-back/go-back.component.d.ts +0 -2
- package/esm2022/badge/lib/badge/badge.component.mjs +3 -3
- package/esm2022/breadcrumb/lib/dynamic-breadcrumb/dynamic-breadcrumb.component.mjs +10 -13
- package/esm2022/calendar-mask/lib/calendar-mask/calendar-mask.directive.mjs +7 -11
- package/esm2022/chips/lib/chips/chips/chips.component.mjs +5 -8
- package/esm2022/code-editor/lib/code-editor/code-editor.component.mjs +6 -9
- package/esm2022/code-editor/lib/code-editor/infra/utils/custom-translations/custom-translations.module.mjs +8 -13
- package/esm2022/common/lib/svg-factory/svg-factory.directive.mjs +6 -10
- package/esm2022/content-generator/lib/content-generator/content-generator.component.mjs +24 -30
- package/esm2022/content-generator/lib/services/IAssist/iassist.service.mjs +9 -12
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.component.mjs +15 -23
- package/esm2022/country-phone-picker/lib/country-phone-picker/country-phone-picker.service.mjs +6 -9
- package/esm2022/currency/lib/currency.service.mjs +6 -9
- package/esm2022/custom-fields/lib/custom-fields/custom-fields.component.mjs +17 -25
- package/esm2022/custom-fields/lib/custom-fields/custom-fields.service.mjs +6 -9
- package/esm2022/dynamic-form/dynamic-form/components/lookup/lookup.component.mjs +26 -35
- package/esm2022/dynamic-form/dynamic-form/components/lookup/types/lookup-models.mjs +2 -0
- package/esm2022/dynamic-form/dynamic-form/form-field/configurations/fields/lookup-field.mjs +1 -1
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/autocomplete/autocomplete-field.component.mjs +6 -10
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/bignumber/bignumber-field.component.mjs +12 -17
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/calendar/calendar-field.component.mjs +5 -8
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/chips/chips-field.component.mjs +12 -17
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/country-phone-picker/country-phone-picker-field.component.mjs +5 -8
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/currency/currency-field.component.mjs +13 -19
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/file-picker/file-picker-field.component.mjs +6 -10
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/number/number-field.component.mjs +14 -19
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/password/password-field.component.mjs +5 -8
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/text/text-field.component.mjs +5 -8
- package/esm2022/dynamic-form/dynamic-form/form-field/fields/text-area/text-area-field.component.mjs +5 -8
- package/esm2022/dynamic-form/public-api.mjs +1 -1
- package/esm2022/empty-state/lib/empty-state/go-back/go-back.component.mjs +8 -11
- package/esm2022/file-picker/lib/file-picker/file-picker.component.mjs +17 -21
- package/esm2022/gantt/lib/gantt/components/gantt/gantt.mjs +6 -2
- package/esm2022/gantt/lib/gantt/gantt.component.mjs +8 -4
- package/esm2022/global-search/lib/global-search/global-search.component.mjs +5 -8
- package/esm2022/image-cropper/lib/image-cropper/image-cropper.service.mjs +7 -12
- package/esm2022/infinite-scroll/lib/infinite-scroll/infinite-scroll.directive.mjs +5 -8
- package/esm2022/info-sign/lib/info-sign/info-sign.directive.mjs +6 -10
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-calendar/inline-edit-calendar.component.mjs +9 -12
- package/esm2022/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.mjs +14 -17
- package/esm2022/inline-edit/lib/inline-edit/components/inline-edit-item/inline-edit-item.component.mjs +12 -15
- package/esm2022/insights/lib/insights/components/insights-card/insights-card.component.mjs +15 -19
- package/esm2022/interactive-content/lib/interactive-content/interactive-content.directive.mjs +5 -8
- package/esm2022/kanban/lib/kanban/components/kanban-column/kanban-column.component.mjs +10 -13
- package/esm2022/kanban/lib/kanban/components/kanban-item/kanban-item.component.mjs +10 -13
- package/esm2022/kanban/lib/kanban/kanban.component.mjs +23 -17
- package/esm2022/loading-state/lib/loading-state/loading-state.directive.mjs +10 -16
- package/esm2022/locale/lib/locale/locale.service.mjs +8 -12
- package/esm2022/locale/lib/locale/pipes/localized-bignumber.pipe.mjs +6 -9
- package/esm2022/locale/lib/locale/pipes/localized-currency.pipe.mjs +6 -9
- package/esm2022/locale/lib/locale/pipes/localized-date.pipe.mjs +6 -9
- package/esm2022/locale/lib/locale/pipes/localized-number.pipe.mjs +6 -9
- package/esm2022/locale/lib/locale/pipes/localized-time.pipe.mjs +6 -9
- package/esm2022/localized-number-input/lib/localized-number-input/localized-number-input.directive.mjs +6 -9
- package/esm2022/navigation-button/lib/navigation-button/navigation-button.component.mjs +5 -8
- package/esm2022/numeric/lib/numeric.pipe.mjs +8 -12
- package/esm2022/numeric/lib/numeric.service.mjs +6 -9
- package/esm2022/password-strength/lib/password-strength/password-strength.component.mjs +8 -11
- package/esm2022/password-strength/lib/password-strength/password-strength.directive.mjs +10 -16
- package/esm2022/picklist/lib/picklist/picklist.component.mjs +5 -8
- package/esm2022/profile-picture-picker/lib/profile-picture-picker/profile-picture-picker.component.mjs +15 -19
- package/esm2022/progressbar/lib/progressbar/components/progressbar-determinate/progressbar-determinate.component.mjs +8 -11
- package/esm2022/progressbar/lib/progressbar/progressbar.module.mjs +5 -4
- package/esm2022/select-button/lib/select-button/select-button.component.mjs +3 -3
- package/esm2022/shared/lib/accessibility/paginator-accessibility.directive.mjs +8 -13
- package/esm2022/shared/lib/accessibility/table-checkbox-accessibility.directive.mjs +5 -8
- package/esm2022/slide-in-bar/lib/slide-in-bar/slide-in-bar.component.mjs +9 -12
- package/esm2022/speech-recognition/lib/speech-recognition/speech-recognition/speech-recognition.component.mjs +12 -16
- package/esm2022/speech-recognition/lib/speech-recognition/speech-recognition.service.mjs +12 -16
- package/esm2022/speech-recognition/lib/speech-recognition/text-to-speech.service.mjs +8 -10
- package/esm2022/split-button/lib/split-button/split-button.component.mjs +5 -8
- package/esm2022/table/lib/table/row-toggler/row-toggler.directive.mjs +7 -7
- package/esm2022/table/lib/table/table-column/table-columns.component.mjs +19 -28
- package/esm2022/table/lib/table/table-paging/table-paging.component.mjs +9 -16
- package/esm2022/table-header/lib/table-header/table-header-checkbox.component.mjs +11 -13
- package/esm2022/text-area/lib/text-area/text-area.component.mjs +5 -8
- package/esm2022/thumbnail/lib/thumbnail/thumbnail.component.mjs +8 -11
- package/esm2022/tiered-menu/lib/tiered-menu/components/tiered-menu/tiered-menu.component.mjs +16 -24
- package/esm2022/tiered-menu/lib/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.mjs +8 -11
- package/esm2022/tiered-menu/lib/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.mjs +12 -16
- package/esm2022/tiered-menu/lib/tiered-menu/tiered-menu.directive.mjs +13 -25
- package/esm2022/toast/lib/toast/toast.service.mjs +7 -12
- package/esm2022/tree/lib/tree/components/tree-node-item/tree-node-item.component.mjs +10 -14
- package/esm2022/workspace-switch/lib/workspace-switch/workspace-switch.component.mjs +6 -10
- package/fesm2022/seniorsistemas-angular-components-badge.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-badge.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs +10 -12
- package/fesm2022/seniorsistemas-angular-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs +6 -10
- package/fesm2022/seniorsistemas-angular-components-calendar-mask.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-chips.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-chips.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs +10 -18
- package/fesm2022/seniorsistemas-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-common.mjs +5 -9
- package/fesm2022/seniorsistemas-angular-components-common.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs +29 -40
- package/fesm2022/seniorsistemas-angular-components-content-generator.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs +16 -28
- package/fesm2022/seniorsistemas-angular-components-country-phone-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-currency.mjs +5 -8
- package/fesm2022/seniorsistemas-angular-components-currency.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs +45 -59
- package/fesm2022/seniorsistemas-angular-components-custom-fields.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs +111 -163
- package/fesm2022/seniorsistemas-angular-components-dynamic-form.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-empty-state.mjs +4 -8
- package/fesm2022/seniorsistemas-angular-components-empty-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs +17 -22
- package/fesm2022/seniorsistemas-angular-components-file-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs +12 -4
- package/fesm2022/seniorsistemas-angular-components-gantt.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-global-search.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-image-cropper.mjs +6 -11
- package/fesm2022/seniorsistemas-angular-components-image-cropper.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-infinite-scroll.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-infinite-scroll.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-info-sign.mjs +5 -9
- package/fesm2022/seniorsistemas-angular-components-info-sign.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs +29 -38
- package/fesm2022/seniorsistemas-angular-components-inline-edit.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-insights.mjs +17 -22
- package/fesm2022/seniorsistemas-angular-components-insights.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-interactive-content.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-interactive-content.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-kanban.mjs +30 -30
- package/fesm2022/seniorsistemas-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-loading-state.mjs +7 -15
- package/fesm2022/seniorsistemas-angular-components-loading-state.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-locale.mjs +22 -41
- package/fesm2022/seniorsistemas-angular-components-locale.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-localized-number-input.mjs +5 -8
- package/fesm2022/seniorsistemas-angular-components-localized-number-input.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-navigation-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-numeric.mjs +9 -16
- package/fesm2022/seniorsistemas-angular-components-numeric.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-password-strength.mjs +13 -24
- package/fesm2022/seniorsistemas-angular-components-password-strength.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-picklist.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-picklist.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-profile-picture-picker.mjs +14 -21
- package/fesm2022/seniorsistemas-angular-components-profile-picture-picker.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-progressbar.mjs +11 -14
- package/fesm2022/seniorsistemas-angular-components-progressbar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs +2 -2
- package/fesm2022/seniorsistemas-angular-components-select-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-shared.mjs +10 -18
- package/fesm2022/seniorsistemas-angular-components-shared.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-slide-in-bar.mjs +7 -10
- package/fesm2022/seniorsistemas-angular-components-slide-in-bar.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-speech-recognition.mjs +23 -34
- package/fesm2022/seniorsistemas-angular-components-speech-recognition.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-split-button.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-table-header.mjs +10 -12
- package/fesm2022/seniorsistemas-angular-components-table-header.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-table.mjs +29 -46
- package/fesm2022/seniorsistemas-angular-components-table.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs +4 -7
- package/fesm2022/seniorsistemas-angular-components-text-area.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs +6 -9
- package/fesm2022/seniorsistemas-angular-components-thumbnail.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs +30 -55
- package/fesm2022/seniorsistemas-angular-components-tiered-menu.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-toast.mjs +6 -11
- package/fesm2022/seniorsistemas-angular-components-toast.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-tree.mjs +9 -14
- package/fesm2022/seniorsistemas-angular-components-tree.mjs.map +1 -1
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs +5 -9
- package/fesm2022/seniorsistemas-angular-components-workspace-switch.mjs.map +1 -1
- package/file-picker/lib/file-picker/file-picker.component.d.ts +0 -4
- package/file-upload/README.md +9 -37
- package/gantt/lib/gantt/gantt.component.d.ts +1 -0
- package/global-search/lib/global-search/global-search.component.d.ts +1 -2
- package/ia-insight/README.md +17 -0
- package/image-cropper/lib/image-cropper/image-cropper.service.d.ts +1 -2
- package/infinite-scroll/lib/infinite-scroll/infinite-scroll.directive.d.ts +1 -2
- package/info-sign/lib/info-sign/info-sign.directive.d.ts +1 -2
- package/inline-edit/lib/inline-edit/components/fields/inline-edit-calendar/inline-edit-calendar.component.d.ts +1 -2
- package/inline-edit/lib/inline-edit/components/fields/inline-edit-number/inline-edit-number.component.d.ts +0 -2
- package/inline-edit/lib/inline-edit/components/inline-edit-item/inline-edit-item.component.d.ts +0 -2
- package/insights/lib/insights/components/insights-card/insights-card.component.d.ts +0 -4
- package/interactive-content/lib/interactive-content/interactive-content.directive.d.ts +1 -2
- package/kanban/lib/kanban/components/kanban-column/kanban-column.component.d.ts +0 -2
- package/kanban/lib/kanban/components/kanban-item/kanban-item.component.d.ts +0 -2
- package/kanban/lib/kanban/kanban.component.d.ts +2 -2
- package/loading-state/lib/loading-state/loading-state.directive.d.ts +1 -2
- package/locale/lib/locale/locale.service.d.ts +0 -3
- package/locale/lib/locale/pipes/localized-bignumber.pipe.d.ts +0 -2
- package/locale/lib/locale/pipes/localized-currency.pipe.d.ts +0 -2
- package/locale/lib/locale/pipes/localized-date.pipe.d.ts +0 -2
- package/locale/lib/locale/pipes/localized-number.pipe.d.ts +0 -2
- package/locale/lib/locale/pipes/localized-time.pipe.d.ts +0 -2
- package/localized-number-input/lib/localized-number-input/localized-number-input.directive.d.ts +0 -2
- package/navigation-button/lib/navigation-button/navigation-button.component.d.ts +1 -2
- package/numeric/lib/numeric.pipe.d.ts +0 -3
- package/numeric/lib/numeric.service.d.ts +0 -2
- package/package.json +1 -1
- package/password-strength/lib/password-strength/password-strength.component.d.ts +0 -2
- package/password-strength/lib/password-strength/password-strength.directive.d.ts +1 -2
- package/picklist/lib/picklist/picklist.component.d.ts +1 -2
- package/product-header/README.md +17 -0
- package/profile-picture-picker/lib/profile-picture-picker/profile-picture-picker.component.d.ts +0 -4
- package/progressbar/lib/progressbar/components/progressbar-determinate/progressbar-determinate.component.d.ts +0 -2
- package/progressbar/lib/progressbar/progressbar.module.d.ts +2 -1
- package/shared/lib/accessibility/paginator-accessibility.directive.d.ts +1 -3
- package/shared/lib/accessibility/table-checkbox-accessibility.directive.d.ts +1 -2
- package/slide-in-bar/lib/slide-in-bar/slide-in-bar.component.d.ts +0 -2
- package/speech-recognition/lib/speech-recognition/speech-recognition/speech-recognition.component.d.ts +0 -4
- package/speech-recognition/lib/speech-recognition/speech-recognition.service.d.ts +1 -5
- package/speech-recognition/lib/speech-recognition/text-to-speech.service.d.ts +1 -3
- package/split-button/lib/split-button/split-button.component.d.ts +1 -2
- package/table/lib/table/row-toggler/row-toggler.directive.d.ts +1 -1
- package/table/lib/table/table-column/table-columns.component.d.ts +2 -6
- package/table/lib/table/table-paging/table-paging.component.d.ts +0 -3
- package/table-header/lib/table-header/table-header-checkbox.component.d.ts +1 -1
- package/text-area/lib/text-area/text-area.component.d.ts +1 -2
- package/text-area-ia/README.md +17 -0
- package/thumbnail/lib/thumbnail/thumbnail.component.d.ts +0 -2
- package/tiered-menu/lib/tiered-menu/components/tiered-menu/tiered-menu.component.d.ts +1 -3
- package/tiered-menu/lib/tiered-menu/components/tiered-menu-item/tiered-menu-item.component.d.ts +0 -2
- package/tiered-menu/lib/tiered-menu/components/tiered-menu-nested/tiered-menu-nested.component.d.ts +0 -2
- package/tiered-menu/lib/tiered-menu/tiered-menu.directive.d.ts +1 -5
- package/toast/lib/toast/toast.service.d.ts +0 -2
- package/tree/lib/tree/components/tree-node-item/tree-node-item.component.d.ts +1 -3
- package/workspace-switch/lib/workspace-switch/workspace-switch.component.d.ts +1 -2
- package/confirm-dialog/README.md +0 -226
- package/numeric-mask/README.md +0 -395
- package/pin-code-field/README.md +0 -366
- package/spotlight/README.md +0 -311
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, Component, ViewChild, Input, NgModule } from '@angular/core';
|
|
4
|
+
import { Injectable, inject, Component, ViewChild, Input, NgModule } from '@angular/core';
|
|
5
5
|
import { Subject, from } from 'rxjs';
|
|
6
6
|
import { takeUntil } from 'rxjs/operators';
|
|
7
7
|
|
|
@@ -80,7 +80,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
80
80
|
* @category Data
|
|
81
81
|
*/
|
|
82
82
|
class ThumbnailComponent {
|
|
83
|
-
thumbnailService;
|
|
83
|
+
thumbnailService = inject(ThumbnailService);
|
|
84
84
|
static nextId = 0;
|
|
85
85
|
fallback = false;
|
|
86
86
|
orientation = 0;
|
|
@@ -106,9 +106,6 @@ class ThumbnailComponent {
|
|
|
106
106
|
/** @description Aplica estilo de marca ao thumbnail. @default false */
|
|
107
107
|
isBrand = false;
|
|
108
108
|
ngUnsubscribe = new Subject();
|
|
109
|
-
constructor(thumbnailService) {
|
|
110
|
-
this.thumbnailService = thumbnailService;
|
|
111
|
-
}
|
|
112
109
|
ngOnDestroy() {
|
|
113
110
|
this.ngUnsubscribe.next();
|
|
114
111
|
this.ngUnsubscribe.complete();
|
|
@@ -129,13 +126,13 @@ class ThumbnailComponent {
|
|
|
129
126
|
});
|
|
130
127
|
}
|
|
131
128
|
}
|
|
132
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThumbnailComponent, deps: [
|
|
133
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ThumbnailComponent, selector: "s-thumbnail", inputs: { id: "id", size: "size", imageSource: "imageSource", imageFallback: "imageFallback", imageAlt: "imageAlt", iconClass: "iconClass", hasAction: "hasAction", actionIconClass: "actionIconClass", isTile: "isTile", isBrand: "isBrand" }, viewQueries: [{ propertyName: "imgEl", first: true, predicate: ["img"], descendants: true }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{ size }}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand,\n }\"\n>\n @if (imageSource || imageFallback) {\n <div\n [id]=\"id + '-image-container'\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand,\n }\"\n >\n @if (!fallback) {\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && imageFallback) {\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && !imageFallback) {\n <i class=\"fallback-img-color far fa-image\"> </i>\n }\n </div>\n }\n\n @if (hasAction) {\n <div\n [id]=\"id + '-action-icon-container'\"\n class=\"action-icon-container action-icon-container--{{ size }}\"\n >\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n @if (!imageSource && !imageFallback) {\n <div\n [id]=\"id + '-icon-container'\"\n class=\"icon-container icon-container--{{ size }}\"\n [ngClass]=\"{ 'image-container--rounded': !isBrand }\"\n >\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{align-items:center;background-color:#ccc;display:flex;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}\n"], dependencies: [{ kind: "directive", type:
|
|
129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThumbnailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
130
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: ThumbnailComponent, selector: "s-thumbnail", inputs: { id: "id", size: "size", imageSource: "imageSource", imageFallback: "imageFallback", imageAlt: "imageAlt", iconClass: "iconClass", hasAction: "hasAction", actionIconClass: "actionIconClass", isTile: "isTile", isBrand: "isBrand" }, viewQueries: [{ propertyName: "imgEl", first: true, predicate: ["img"], descendants: true }], ngImport: i0, template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{ size }}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand,\n }\"\n>\n @if (imageSource || imageFallback) {\n <div\n [id]=\"id + '-image-container'\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand,\n }\"\n >\n @if (!fallback) {\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && imageFallback) {\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && !imageFallback) {\n <i class=\"fallback-img-color far fa-image\"> </i>\n }\n </div>\n }\n\n @if (hasAction) {\n <div\n [id]=\"id + '-action-icon-container'\"\n class=\"action-icon-container action-icon-container--{{ size }}\"\n >\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n @if (!imageSource && !imageFallback) {\n <div\n [id]=\"id + '-icon-container'\"\n class=\"icon-container icon-container--{{ size }}\"\n [ngClass]=\"{ 'image-container--rounded': !isBrand }\"\n >\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{align-items:center;background-color:#ccc;display:flex;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
134
131
|
}
|
|
135
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ThumbnailComponent, decorators: [{
|
|
136
133
|
type: Component,
|
|
137
134
|
args: [{ selector: 's-thumbnail', template: "<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{ size }}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand,\n }\"\n>\n @if (imageSource || imageFallback) {\n <div\n [id]=\"id + '-image-container'\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand,\n }\"\n >\n @if (!fallback) {\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && imageFallback) {\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && !imageFallback) {\n <i class=\"fallback-img-color far fa-image\"> </i>\n }\n </div>\n }\n\n @if (hasAction) {\n <div\n [id]=\"id + '-action-icon-container'\"\n class=\"action-icon-container action-icon-container--{{ size }}\"\n >\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n @if (!imageSource && !imageFallback) {\n <div\n [id]=\"id + '-icon-container'\"\n class=\"icon-container icon-container--{{ size }}\"\n [ngClass]=\"{ 'image-container--rounded': !isBrand }\"\n >\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:inline-block}.thumbnail-container{color:#fff;position:relative;text-align:center}.thumbnail-container--large{font-size:50px;height:100px;width:100px}.thumbnail-container--large.thumbnail-container--brand{width:200px}.thumbnail-container--medium{font-size:40px;height:70px;width:70px}.thumbnail-container--medium.thumbnail-container--brand{width:140px}.thumbnail-container--small{font-size:22px;height:40px;width:40px}.thumbnail-container--small.thumbnail-container--brand{width:80px}.thumbnail-container--with-action{cursor:pointer}.action-icon-container{background-color:#428bca;border-radius:50%;bottom:0;position:absolute;right:0}.action-icon-container--large,.action-icon-container--medium{font-size:10pt;height:25px;padding:3px;width:25px}.action-icon-container--small{font-size:6pt;height:16px;padding:2px;width:16px}.icon-container,.image-container{align-items:center;height:100%;overflow:hidden;width:100%}.icon-container--rounded,.image-container--rounded{border-radius:50%}.smallThumbnail{height:40px!important}.icon-container{background-color:#ccc;color:#fff}.icon-container--large{line-height:98px}.icon-container--medium{line-height:68px}.icon-container--small{line-height:38px}.image-container{align-items:center;background-color:#ccc;display:flex;justify-content:center}.image-container img{width:100%}.image-container img.exif-orientation-2{transform:rotateY(180deg)}.image-container img.exif-orientation-3{transform:rotate(180deg)}.image-container img.exif-orientation-4{transform:rotate(180deg) rotateY(180deg)}.image-container img.exif-orientation-5{transform:rotate(270deg) rotateY(180deg)}.image-container img.exif-orientation-6{transform:rotate(90deg)}.image-container img.exif-orientation-7{transform:rotate(90deg) rotateY(180deg)}.image-container img.exif-orientation-8{transform:rotate(270deg)}.fallback-img-color{color:#fff}\n"] }]
|
|
138
|
-
}],
|
|
135
|
+
}], propDecorators: { imgEl: [{
|
|
139
136
|
type: ViewChild,
|
|
140
137
|
args: ['img', { static: false }]
|
|
141
138
|
}], id: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seniorsistemas-angular-components-thumbnail.mjs","sources":["../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.service.ts","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.component.ts","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.component.html","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.module.ts","../../projects/angular-components/thumbnail/src/seniorsistemas-angular-components-thumbnail.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\n\n@Injectable()\nexport class ThumbnailService {\n public getBinaryFile(img: HTMLImageElement) {\n return new Promise(resolve => {\n const getOrientation = this.getOrientation.bind(this);\n\n let http: XMLHttpRequest | null = new XMLHttpRequest();\n http.addEventListener(\"load\", () => {\n if (http?.readyState === 4 && (http.status == 200 || http.status === 0)) {\n const orientation = getOrientation(http.response);\n http = null;\n resolve(orientation);\n }\n });\n\n http.addEventListener(\"error\", () => {\n http = null;\n throw new Error(\"Não foi possível carregar a imagem\");\n });\n\n http.open(\"GET\", img.src, true);\n http.responseType = \"arraybuffer\";\n http.send(null);\n });\n }\n\n /**\n * Retorna a tag da orientação EXIF {-1} Não definido, {-2} Não é formato JPEG, {1, 2, 3, 4, 5, 6, 7, 8} valores da orientação.\n */\n private getOrientation(file: ArrayBuffer): number {\n const view = new DataView(file);\n\n if (view.getUint16(0, false) != 0xffd8) return -2; // not jpeg\n\n const length = view.byteLength;\n let offset = 2;\n\n while (offset < length) {\n const marker = view.getUint16(offset, false);\n offset += 2;\n\n if (marker == 0xffe1) {\n if (view.getUint32((offset += 2), false) != 0x45786966) {\n return -1; // not defined\n }\n const little = view.getUint16((offset += 6), false) == 0x4949;\n offset += view.getUint32(offset + 4, little);\n const tags = view.getUint16(offset, little);\n offset += 2;\n\n for (let i = 0; i < tags; i++)\n if (view.getUint16(offset + i * 12, little) == 0x0112) return view.getUint16(offset + i * 12 + 8, little);\n // tslint:disable-next-line: no-bitwise\n } else if ((marker & 0xff00) != 0xff00) break;\n else offset += view.getUint16(offset, false);\n }\n return -1; // not defined\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';\n\nimport { from, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { ThumbnailSize } from './thumbnail-size';\nimport { ThumbnailService } from './thumbnail.service';\n\n/**\n * @description Componente de miniatura de imagem com suporte a imagem de fallback,\n * ícone de ação sobrepôsto, orientação automática e diferentes tamanhos predefinidos.\n *\n * @example\n * ```html\n * <s-thumbnail\n * [imageSource]=\"urlDaImagem\"\n * size=\"large\"\n * iconClass=\"fas fa-user\" />\n * ```\n *\n * @category Data\n */\n@Component({\n selector: 's-thumbnail',\n templateUrl: './thumbnail.component.html',\n styleUrls: ['./thumbnail.component.scss'],\n})\nexport class ThumbnailComponent implements AfterViewInit, OnDestroy {\n public static nextId = 0;\n public fallback = false;\n public orientation = 0;\n\n @ViewChild('img', { static: false })\n public imgEl: ElementRef | null = null;\n\n /** @description Identificador único do componente no DOM. Gerado automaticamente se não informado. */\n @Input()\n public id = `s-thumbnail-${ThumbnailComponent.nextId++}`;\n\n /** @description Tamanho da miniatura: `'small'`, `'medium'`, `'large'`, etc. @default 'medium' */\n @Input()\n public size: ThumbnailSize = 'medium';\n\n /** @description URL da imagem principal. */\n @Input()\n public imageSource?: string;\n\n /** @description URL da imagem de fallback exibida quando a principal falha ao carregar. */\n @Input()\n public imageFallback?: string;\n\n /** @description Texto alternativo (atributo `alt`) da imagem. */\n @Input()\n public imageAlt?: string;\n\n /** @description Classe do ícone exibido quando não há imagem disponível. @default 'far fa-image' */\n @Input()\n public iconClass = 'far fa-image';\n\n /** @description Habilita a exibição de um botão de ação sobrepôsto. @default false */\n @Input()\n public hasAction = false;\n\n /** @description Classe do ícone do botão de ação. @default 'fas fa-camera' */\n @Input()\n public actionIconClass = 'fas fa-camera';\n\n /** @description Aplica estilo de tile ao thumbnail. @default false */\n @Input()\n public isTile = false;\n\n /** @description Aplica estilo de marca ao thumbnail. @default false */\n @Input()\n public isBrand = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(private readonly thumbnailService: ThumbnailService) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public ngAfterViewInit(): void {\n if (this.imgEl) {\n this.imgEl.nativeElement.addEventListener('load', () => {\n from(this.thumbnailService.getBinaryFile(this.imgEl?.nativeElement))\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: unknown) => {\n if (typeof value === 'number') {\n this.orientation = value;\n } else {\n console.error('Valor retornado não é um número:', value);\n }\n });\n });\n }\n }\n}\n\n","<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{ size }}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand,\n }\"\n>\n @if (imageSource || imageFallback) {\n <div\n [id]=\"id + '-image-container'\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand,\n }\"\n >\n @if (!fallback) {\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && imageFallback) {\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && !imageFallback) {\n <i class=\"fallback-img-color far fa-image\"> </i>\n }\n </div>\n }\n\n @if (hasAction) {\n <div\n [id]=\"id + '-action-icon-container'\"\n class=\"action-icon-container action-icon-container--{{ size }}\"\n >\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n @if (!imageSource && !imageFallback) {\n <div\n [id]=\"id + '-icon-container'\"\n class=\"icon-container icon-container--{{ size }}\"\n [ngClass]=\"{ 'image-container--rounded': !isBrand }\"\n >\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\n\nimport { ThumbnailComponent } from \"./thumbnail.component\";\nimport { ThumbnailService } from \"./thumbnail.service\";\n\n@NgModule({\n imports: [CommonModule],\n declarations: [ThumbnailComponent],\n exports: [ThumbnailComponent],\n providers: [ThumbnailService],\n})\nexport class ThumbnailModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ThumbnailService"],"mappings":";;;;;;;MAGa,gBAAgB,CAAA;AAClB,IAAA,aAAa,CAAC,GAAqB,EAAA;AACtC,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;YACzB,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEtD,YAAA,IAAI,IAAI,GAA0B,IAAI,cAAc,EAAE,CAAC;AACvD,YAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE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KC,OAAO,EAAA,CAAA;sBADb,KAAK;;;ME5DG,eAAe,CAAA;wGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAJT,YAAA,EAAA,CAAA,kBAAkB,CADvB,EAAA,OAAA,EAAA,CAAA,YAAY,aAEZ,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAGnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAFb,SAAA,EAAA,CAAC,gBAAgB,CAAC,YAHnB,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAKb,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,SAAS,EAAE,CAAC,gBAAgB,CAAC;AAChC,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"seniorsistemas-angular-components-thumbnail.mjs","sources":["../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.service.ts","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.component.ts","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.component.html","../../projects/angular-components/thumbnail/src/lib/thumbnail/thumbnail.module.ts","../../projects/angular-components/thumbnail/src/seniorsistemas-angular-components-thumbnail.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\n\n@Injectable()\nexport class ThumbnailService {\n public getBinaryFile(img: HTMLImageElement) {\n return new Promise(resolve => {\n const getOrientation = this.getOrientation.bind(this);\n\n let http: XMLHttpRequest | null = new XMLHttpRequest();\n http.addEventListener(\"load\", () => {\n if (http?.readyState === 4 && (http.status == 200 || http.status === 0)) {\n const orientation = getOrientation(http.response);\n http = null;\n resolve(orientation);\n }\n });\n\n http.addEventListener(\"error\", () => {\n http = null;\n throw new Error(\"Não foi possível carregar a imagem\");\n });\n\n http.open(\"GET\", img.src, true);\n http.responseType = \"arraybuffer\";\n http.send(null);\n });\n }\n\n /**\n * Retorna a tag da orientação EXIF {-1} Não definido, {-2} Não é formato JPEG, {1, 2, 3, 4, 5, 6, 7, 8} valores da orientação.\n */\n private getOrientation(file: ArrayBuffer): number {\n const view = new DataView(file);\n\n if (view.getUint16(0, false) != 0xffd8) return -2; // not jpeg\n\n const length = view.byteLength;\n let offset = 2;\n\n while (offset < length) {\n const marker = view.getUint16(offset, false);\n offset += 2;\n\n if (marker == 0xffe1) {\n if (view.getUint32((offset += 2), false) != 0x45786966) {\n return -1; // not defined\n }\n const little = view.getUint16((offset += 6), false) == 0x4949;\n offset += view.getUint32(offset + 4, little);\n const tags = view.getUint16(offset, little);\n offset += 2;\n\n for (let i = 0; i < tags; i++)\n if (view.getUint16(offset + i * 12, little) == 0x0112) return view.getUint16(offset + i * 12 + 8, little);\n // tslint:disable-next-line: no-bitwise\n } else if ((marker & 0xff00) != 0xff00) break;\n else offset += view.getUint16(offset, false);\n }\n return -1; // not defined\n }\n}\n","import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild, inject } from '@angular/core';\n\nimport { from, Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { ThumbnailSize } from './thumbnail-size';\nimport { ThumbnailService } from './thumbnail.service';\n\n/**\n * @description Componente de miniatura de imagem com suporte a imagem de fallback,\n * ícone de ação sobrepôsto, orientação automática e diferentes tamanhos predefinidos.\n *\n * @example\n * ```html\n * <s-thumbnail\n * [imageSource]=\"urlDaImagem\"\n * size=\"large\"\n * iconClass=\"fas fa-user\" />\n * ```\n *\n * @category Data\n */\n@Component({\n selector: 's-thumbnail',\n templateUrl: './thumbnail.component.html',\n styleUrls: ['./thumbnail.component.scss'],\n})\nexport class ThumbnailComponent implements AfterViewInit, OnDestroy {\n private readonly thumbnailService = inject(ThumbnailService);\n\n public static nextId = 0;\n public fallback = false;\n public orientation = 0;\n\n @ViewChild('img', { static: false })\n public imgEl: ElementRef | null = null;\n\n /** @description Identificador único do componente no DOM. Gerado automaticamente se não informado. */\n @Input()\n public id = `s-thumbnail-${ThumbnailComponent.nextId++}`;\n\n /** @description Tamanho da miniatura: `'small'`, `'medium'`, `'large'`, etc. @default 'medium' */\n @Input()\n public size: ThumbnailSize = 'medium';\n\n /** @description URL da imagem principal. */\n @Input()\n public imageSource?: string;\n\n /** @description URL da imagem de fallback exibida quando a principal falha ao carregar. */\n @Input()\n public imageFallback?: string;\n\n /** @description Texto alternativo (atributo `alt`) da imagem. */\n @Input()\n public imageAlt?: string;\n\n /** @description Classe do ícone exibido quando não há imagem disponível. @default 'far fa-image' */\n @Input()\n public iconClass = 'far fa-image';\n\n /** @description Habilita a exibição de um botão de ação sobrepôsto. @default false */\n @Input()\n public hasAction = false;\n\n /** @description Classe do ícone do botão de ação. @default 'fas fa-camera' */\n @Input()\n public actionIconClass = 'fas fa-camera';\n\n /** @description Aplica estilo de tile ao thumbnail. @default false */\n @Input()\n public isTile = false;\n\n /** @description Aplica estilo de marca ao thumbnail. @default false */\n @Input()\n public isBrand = false;\n\n private ngUnsubscribe = new Subject<void>();\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public ngAfterViewInit(): void {\n if (this.imgEl) {\n this.imgEl.nativeElement.addEventListener('load', () => {\n from(this.thumbnailService.getBinaryFile(this.imgEl?.nativeElement))\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: unknown) => {\n if (typeof value === 'number') {\n this.orientation = value;\n } else {\n console.error('Valor retornado não é um número:', value);\n }\n });\n });\n }\n }\n}\n\n","<div\n [id]=\"id\"\n class=\"thumbnail-container thumbnail-container--{{ size }}\"\n [ngClass]=\"{\n 'thumbnail-container--with-action': hasAction,\n 'thumbnail-container--brand': isBrand,\n }\"\n>\n @if (imageSource || imageFallback) {\n <div\n [id]=\"id + '-image-container'\"\n class=\"image-container\"\n [ngClass]=\"{\n 'image-container--rounded': !isBrand,\n }\"\n >\n @if (!fallback) {\n <img\n #img\n [id]=\"id + '-image'\"\n (error)=\"fallback = true\"\n [src]=\"imageSource\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && imageFallback) {\n <img\n #img\n [id]=\"id + '-image-fallback'\"\n (error)=\"imageFallback = undefined\"\n [src]=\"imageFallback\"\n [alt]=\"imageAlt\"\n [ngClass]=\"{\n smallThumbnail: isTile,\n 'exif-orientation-2': orientation === 2,\n 'exif-orientation-3': orientation === 3,\n 'exif-orientation-4': orientation === 4,\n 'exif-orientation-5': orientation === 5,\n 'exif-orientation-6': orientation === 6,\n 'exif-orientation-7': orientation === 7,\n 'exif-orientation-8': orientation === 8,\n }\"\n />\n }\n\n @if (fallback && !imageFallback) {\n <i class=\"fallback-img-color far fa-image\"> </i>\n }\n </div>\n }\n\n @if (hasAction) {\n <div\n [id]=\"id + '-action-icon-container'\"\n class=\"action-icon-container action-icon-container--{{ size }}\"\n >\n <span\n [id]=\"id + '-action-icon'\"\n [class]=\"actionIconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n @if (!imageSource && !imageFallback) {\n <div\n [id]=\"id + '-icon-container'\"\n class=\"icon-container icon-container--{{ size }}\"\n [ngClass]=\"{ 'image-container--rounded': !isBrand }\"\n >\n <span\n [id]=\"id + '-icon'\"\n [class]=\"iconClass\"\n aria-hidden=\"true\"\n >\n </span>\n </div>\n }\n\n <ng-content></ng-content>\n</div>\n","import { CommonModule } from \"@angular/common\";\nimport { NgModule } from \"@angular/core\";\n\nimport { ThumbnailComponent } from \"./thumbnail.component\";\nimport { ThumbnailService } from \"./thumbnail.service\";\n\n@NgModule({\n imports: [CommonModule],\n declarations: [ThumbnailComponent],\n exports: [ThumbnailComponent],\n providers: [ThumbnailService],\n})\nexport class ThumbnailModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAGa,gBAAgB,CAAA;AAClB,IAAA,aAAa,CAAC,GAAqB,EAAA;AACtC,QAAA,OAAO,IAAI,OAAO,CAAC,OAAO,IAAG;YACzB,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEtD,YAAA,IAAI,IAAI,GAA0B,IAAI,cAAc,EAAE,CAAC;AACvD,YAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAK;gBAC/B,IAAI,IAAI,EAAE,UAAU,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;oBACrE,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAClD,IAAI,GAAG,IAAI,CAAC;oBACZ,OAAO,CAAC,WAAW,CAAC,CAAC;iBACxB;AACL,aAAC,CAAC,CAAC;AAEH,YAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAK;gBAChC,IAAI,GAAG,IAAI,CAAC;AACZ,gBAAA,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC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AAA,EAAA,eAAe,EAFb,SAAA,EAAA,CAAC,gBAAgB,CAAC,YAHnB,YAAY,CAAA,EAAA,CAAA,CAAA;;4FAKb,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;oBAC7B,SAAS,EAAE,CAAC,gBAAgB,CAAC;AAChC,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, Input, HostListener, Output, Directive, NgModule } from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, inject, Component, Input, HostListener, ApplicationRef, ComponentFactoryResolver, Injector, ChangeDetectorRef, Output, ElementRef, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { takeUntil } from 'rxjs/operators';
|
|
5
5
|
import { disableScroll, enableScroll } from '@seniorsistemas/angular-components/utils';
|
|
6
|
-
import * as
|
|
6
|
+
import * as i1 from '@angular/common';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
9
9
|
class TieredMenuService {
|
|
@@ -83,16 +83,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
83
83
|
}] });
|
|
84
84
|
|
|
85
85
|
class TieredMenuItemComponent {
|
|
86
|
-
_tieredMenuEventService;
|
|
86
|
+
_tieredMenuEventService = inject(TieredMenuEventService);
|
|
87
87
|
item;
|
|
88
88
|
focused = false;
|
|
89
89
|
highlight = false;
|
|
90
90
|
triggerEvent = 'click';
|
|
91
91
|
closeOnClick = false;
|
|
92
92
|
_showTimeout;
|
|
93
|
-
constructor(_tieredMenuEventService) {
|
|
94
|
-
this._tieredMenuEventService = _tieredMenuEventService;
|
|
95
|
-
}
|
|
96
93
|
onClick() {
|
|
97
94
|
if (this.item.disabled)
|
|
98
95
|
return;
|
|
@@ -120,13 +117,13 @@ class TieredMenuItemComponent {
|
|
|
120
117
|
onMouseLeave() {
|
|
121
118
|
window.clearTimeout(this._showTimeout);
|
|
122
119
|
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuItemComponent, deps: [
|
|
124
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuItemComponent, selector: "s-tiered-menu-item", inputs: { item: "item", focused: "focused", highlight: "highlight", triggerEvent: "triggerEvent", closeOnClick: "closeOnClick" }, host: { listeners: { "click": "onClick()", "touchend": "onClick()", "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "<div\n [id]=\"item.id\"\n class=\"tiered-menu-item\"\n role=\"menuitem\"\n [tabindex]=\"focused && !item.disabled ? 0 : -1\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.submenu ? 'menu' : null\"\n [attr.aria-expanded]=\"item.submenu ? item.isOpen : null\"\n [attr.data-key]=\"item.dataKey\"\n [ngClass]=\"{\n 'tiered-menu-item--open': item.isOpen,\n 'tiered-menu-item--focused': focused,\n 'tiered-menu-item--disabled': item.disabled,\n }\"\n>\n <div class=\"tiered-menu-item-content\">\n <span\n class=\"icon\"\n [ngClass]=\"item.iconClass\"\n ></span>\n <span class=\"label\">{{ item.label }}</span>\n </div>\n @if (item.submenu) {\n <span\n class=\"submenu-icon fas\"\n [class.fa-chevron-left]=\"item.isOpen\"\n [class.fa-chevron-right]=\"!item.isOpen\"\n >\n </span>\n }\n</div>\n", styles: [".tiered-menu-item{align-items:center;display:flex;justify-content:space-between;padding:8px 16px;-webkit-user-select:none;user-select:none;cursor:pointer}.tiered-menu-item .tiered-menu-item-content .label{margin:0 12px}.tiered-menu-item:hover{background-color:#e9e6e6}.tiered-menu-item--focused{background-color:#ccc!important}.tiered-menu-item--open{background-color:#e4e2e2}.tiered-menu-item--disabled{opacity:50%;cursor:default}\n"], dependencies: [{ kind: "directive", type:
|
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuItemComponent, selector: "s-tiered-menu-item", inputs: { item: "item", focused: "focused", highlight: "highlight", triggerEvent: "triggerEvent", closeOnClick: "closeOnClick" }, host: { listeners: { "click": "onClick()", "touchend": "onClick()", "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: "<div\n [id]=\"item.id\"\n class=\"tiered-menu-item\"\n role=\"menuitem\"\n [tabindex]=\"focused && !item.disabled ? 0 : -1\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.submenu ? 'menu' : null\"\n [attr.aria-expanded]=\"item.submenu ? item.isOpen : null\"\n [attr.data-key]=\"item.dataKey\"\n [ngClass]=\"{\n 'tiered-menu-item--open': item.isOpen,\n 'tiered-menu-item--focused': focused,\n 'tiered-menu-item--disabled': item.disabled,\n }\"\n>\n <div class=\"tiered-menu-item-content\">\n <span\n class=\"icon\"\n [ngClass]=\"item.iconClass\"\n ></span>\n <span class=\"label\">{{ item.label }}</span>\n </div>\n @if (item.submenu) {\n <span\n class=\"submenu-icon fas\"\n [class.fa-chevron-left]=\"item.isOpen\"\n [class.fa-chevron-right]=\"!item.isOpen\"\n >\n </span>\n }\n</div>\n", styles: [".tiered-menu-item{align-items:center;display:flex;justify-content:space-between;padding:8px 16px;-webkit-user-select:none;user-select:none;cursor:pointer}.tiered-menu-item .tiered-menu-item-content .label{margin:0 12px}.tiered-menu-item:hover{background-color:#e9e6e6}.tiered-menu-item--focused{background-color:#ccc!important}.tiered-menu-item--open{background-color:#e4e2e2}.tiered-menu-item--disabled{opacity:50%;cursor:default}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
125
122
|
}
|
|
126
123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuItemComponent, decorators: [{
|
|
127
124
|
type: Component,
|
|
128
125
|
args: [{ selector: 's-tiered-menu-item', template: "<div\n [id]=\"item.id\"\n class=\"tiered-menu-item\"\n role=\"menuitem\"\n [tabindex]=\"focused && !item.disabled ? 0 : -1\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.submenu ? 'menu' : null\"\n [attr.aria-expanded]=\"item.submenu ? item.isOpen : null\"\n [attr.data-key]=\"item.dataKey\"\n [ngClass]=\"{\n 'tiered-menu-item--open': item.isOpen,\n 'tiered-menu-item--focused': focused,\n 'tiered-menu-item--disabled': item.disabled,\n }\"\n>\n <div class=\"tiered-menu-item-content\">\n <span\n class=\"icon\"\n [ngClass]=\"item.iconClass\"\n ></span>\n <span class=\"label\">{{ item.label }}</span>\n </div>\n @if (item.submenu) {\n <span\n class=\"submenu-icon fas\"\n [class.fa-chevron-left]=\"item.isOpen\"\n [class.fa-chevron-right]=\"!item.isOpen\"\n >\n </span>\n }\n</div>\n", styles: [".tiered-menu-item{align-items:center;display:flex;justify-content:space-between;padding:8px 16px;-webkit-user-select:none;user-select:none;cursor:pointer}.tiered-menu-item .tiered-menu-item-content .label{margin:0 12px}.tiered-menu-item:hover{background-color:#e9e6e6}.tiered-menu-item--focused{background-color:#ccc!important}.tiered-menu-item--open{background-color:#e4e2e2}.tiered-menu-item--disabled{opacity:50%;cursor:default}\n"] }]
|
|
129
|
-
}],
|
|
126
|
+
}], propDecorators: { item: [{
|
|
130
127
|
type: Input,
|
|
131
128
|
args: [{ required: true }]
|
|
132
129
|
}], focused: [{
|
|
@@ -161,8 +158,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
161
158
|
}] });
|
|
162
159
|
|
|
163
160
|
class TieredMenuNestedComponent {
|
|
164
|
-
tieredMenuService;
|
|
165
|
-
_tieredMenuEventService;
|
|
161
|
+
tieredMenuService = inject(TieredMenuService);
|
|
162
|
+
_tieredMenuEventService = inject(TieredMenuEventService);
|
|
166
163
|
items;
|
|
167
164
|
top = 0;
|
|
168
165
|
left = 0;
|
|
@@ -205,10 +202,6 @@ class TieredMenuNestedComponent {
|
|
|
205
202
|
break;
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
|
-
constructor(tieredMenuService, _tieredMenuEventService) {
|
|
209
|
-
this.tieredMenuService = tieredMenuService;
|
|
210
|
-
this._tieredMenuEventService = _tieredMenuEventService;
|
|
211
|
-
}
|
|
212
205
|
ngOnInit() {
|
|
213
206
|
this.tieredMenuService.currentItems = this.items;
|
|
214
207
|
this._subscribeEvents();
|
|
@@ -312,13 +305,13 @@ class TieredMenuNestedComponent {
|
|
|
312
305
|
}
|
|
313
306
|
});
|
|
314
307
|
}
|
|
315
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuNestedComponent, deps: [
|
|
316
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuNestedComponent, selector: "ng-component", host: { listeners: { "window:resize": "onResize()", "document:click": "onDocumentClick($event)", "document:keydown": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n top: top + 'px',\n left: left + 'px',\n }\"\n>\n <ng-container\n *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: items }\"\n ></ng-container>\n</div>\n\n<ng-template\n #itemsTemplate\n let-items\n>\n @for (item of items; track item.id) {\n <div>\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [closeOnClick]=\"true\"\n >\n </s-tiered-menu-item>\n }\n @if (item.divider) {\n <s-tiered-menu-divider></s-tiered-menu-divider>\n }\n @if (item.submenu && item.isOpen) {\n <div>\n <div class=\"submenu\">\n <ng-container\n *ngTemplateOutlet=\"\n itemsTemplate;\n context: { $implicit: item.submenu }\n \"\n ></ng-container>\n </div>\n </div>\n }\n </div>\n }\n</ng-template>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;min-width:176px;padding:4px 0;position:absolute;z-index:9999;overflow:auto;width:calc(100vw - 8px)}.menu .submenu{margin-left:24px}\n"], dependencies: [{ kind: "directive", type:
|
|
308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuNestedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
309
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuNestedComponent, selector: "ng-component", host: { listeners: { "window:resize": "onResize()", "document:click": "onDocumentClick($event)", "document:keydown": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n top: top + 'px',\n left: left + 'px',\n }\"\n>\n <ng-container\n *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: items }\"\n ></ng-container>\n</div>\n\n<ng-template\n #itemsTemplate\n let-items\n>\n @for (item of items; track item.id) {\n <div>\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [closeOnClick]=\"true\"\n >\n </s-tiered-menu-item>\n }\n @if (item.divider) {\n <s-tiered-menu-divider></s-tiered-menu-divider>\n }\n @if (item.submenu && item.isOpen) {\n <div>\n <div class=\"submenu\">\n <ng-container\n *ngTemplateOutlet=\"\n itemsTemplate;\n context: { $implicit: item.submenu }\n \"\n ></ng-container>\n </div>\n </div>\n }\n </div>\n }\n</ng-template>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;min-width:176px;padding:4px 0;position:absolute;z-index:9999;overflow:auto;width:calc(100vw - 8px)}.menu .submenu{margin-left:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TieredMenuItemComponent, selector: "s-tiered-menu-item", inputs: ["item", "focused", "highlight", "triggerEvent", "closeOnClick"] }, { kind: "component", type: TieredMenuDividerComponent, selector: "s-tiered-menu-divider" }] });
|
|
317
310
|
}
|
|
318
311
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuNestedComponent, decorators: [{
|
|
319
312
|
type: Component,
|
|
320
313
|
args: [{ template: "<div\n class=\"menu menu--nested\"\n [ngStyle]=\"{\n top: top + 'px',\n left: left + 'px',\n }\"\n>\n <ng-container\n *ngTemplateOutlet=\"itemsTemplate; context: { $implicit: items }\"\n ></ng-container>\n</div>\n\n<ng-template\n #itemsTemplate\n let-items\n>\n @for (item of items; track item.id) {\n <div>\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [closeOnClick]=\"true\"\n >\n </s-tiered-menu-item>\n }\n @if (item.divider) {\n <s-tiered-menu-divider></s-tiered-menu-divider>\n }\n @if (item.submenu && item.isOpen) {\n <div>\n <div class=\"submenu\">\n <ng-container\n *ngTemplateOutlet=\"\n itemsTemplate;\n context: { $implicit: item.submenu }\n \"\n ></ng-container>\n </div>\n </div>\n }\n </div>\n }\n</ng-template>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;min-width:176px;padding:4px 0;position:absolute;z-index:9999;overflow:auto;width:calc(100vw - 8px)}.menu .submenu{margin-left:24px}\n"] }]
|
|
321
|
-
}],
|
|
314
|
+
}], propDecorators: { onResize: [{
|
|
322
315
|
type: HostListener,
|
|
323
316
|
args: ['window:resize']
|
|
324
317
|
}], onDocumentClick: [{
|
|
@@ -330,12 +323,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
330
323
|
}] } });
|
|
331
324
|
|
|
332
325
|
class TieredMenuComponent {
|
|
333
|
-
_appRef;
|
|
334
|
-
_componentFactoryResolver;
|
|
335
|
-
_injector;
|
|
336
|
-
_changeDetectorRef;
|
|
337
|
-
tieredMenuService;
|
|
338
|
-
_tieredMenuEventService;
|
|
326
|
+
_appRef = inject(ApplicationRef);
|
|
327
|
+
_componentFactoryResolver = inject(ComponentFactoryResolver);
|
|
328
|
+
_injector = inject(Injector);
|
|
329
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
330
|
+
tieredMenuService = inject(TieredMenuService);
|
|
331
|
+
_tieredMenuEventService = inject(TieredMenuEventService);
|
|
339
332
|
ariaLabel;
|
|
340
333
|
items = [];
|
|
341
334
|
top = 0;
|
|
@@ -346,14 +339,6 @@ class TieredMenuComponent {
|
|
|
346
339
|
_menuDivElement = null;
|
|
347
340
|
_unsubscribe$ = new Subject();
|
|
348
341
|
destroyRequest = new EventEmitter();
|
|
349
|
-
constructor(_appRef, _componentFactoryResolver, _injector, _changeDetectorRef, tieredMenuService, _tieredMenuEventService) {
|
|
350
|
-
this._appRef = _appRef;
|
|
351
|
-
this._componentFactoryResolver = _componentFactoryResolver;
|
|
352
|
-
this._injector = _injector;
|
|
353
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
354
|
-
this.tieredMenuService = tieredMenuService;
|
|
355
|
-
this._tieredMenuEventService = _tieredMenuEventService;
|
|
356
|
-
}
|
|
357
342
|
onResize() {
|
|
358
343
|
this._tieredMenuEventService.closeAllMenusEvent.emit();
|
|
359
344
|
}
|
|
@@ -630,13 +615,13 @@ class TieredMenuComponent {
|
|
|
630
615
|
}
|
|
631
616
|
});
|
|
632
617
|
}
|
|
633
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuComponent, deps: [
|
|
634
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuComponent, selector: "s-tiered-menu", inputs: { ariaLabel: "ariaLabel" }, outputs: { destroyRequest: "destroyRequest" }, host: { listeners: { "window:resize": "onResize()", "document:click": "onDocumentClick($event)", "document:keydown": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div\n class=\"menu\"\n role=\"application\"\n [attr.aria-label]=\"ariaLabel\"\n [ngStyle]=\"{\n left: left + 'px',\n top: top + 'px',\n }\"\n>\n <!-- <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"item.visible && !item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n >\n </s-tiered-menu-item>\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n </div> -->\n @for (item of items; track $index) {\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n />\n }\n @if (item.divider) {\n <s-tiered-menu-divider />\n }\n }\n</div>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;max-height:100vh;min-width:176px;padding:4px 0;overflow-y:auto;position:absolute;z-index:9999}\n"], dependencies: [{ kind: "directive", type:
|
|
618
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
619
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TieredMenuComponent, selector: "s-tiered-menu", inputs: { ariaLabel: "ariaLabel" }, outputs: { destroyRequest: "destroyRequest" }, host: { listeners: { "window:resize": "onResize()", "document:click": "onDocumentClick($event)", "document:keydown": "onKeydownHandler($event)" } }, ngImport: i0, template: "<div\n class=\"menu\"\n role=\"application\"\n [attr.aria-label]=\"ariaLabel\"\n [ngStyle]=\"{\n left: left + 'px',\n top: top + 'px',\n }\"\n>\n <!-- <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"item.visible && !item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n >\n </s-tiered-menu-item>\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n </div> -->\n @for (item of items; track $index) {\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n />\n }\n @if (item.divider) {\n <s-tiered-menu-divider />\n }\n }\n</div>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;max-height:100vh;min-width:176px;padding:4px 0;overflow-y:auto;position:absolute;z-index:9999}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: TieredMenuItemComponent, selector: "s-tiered-menu-item", inputs: ["item", "focused", "highlight", "triggerEvent", "closeOnClick"] }, { kind: "component", type: TieredMenuDividerComponent, selector: "s-tiered-menu-divider" }] });
|
|
635
620
|
}
|
|
636
621
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuComponent, decorators: [{
|
|
637
622
|
type: Component,
|
|
638
623
|
args: [{ selector: 's-tiered-menu', template: "<div\n class=\"menu\"\n role=\"application\"\n [attr.aria-label]=\"ariaLabel\"\n [ngStyle]=\"{\n left: left + 'px',\n top: top + 'px',\n }\"\n>\n <!-- <div *ngFor=\"let item of items\">\n <s-tiered-menu-item\n *ngIf=\"item.visible && !item.divider\"\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n >\n </s-tiered-menu-item>\n <s-tiered-menu-divider *ngIf=\"item.divider\"></s-tiered-menu-divider>\n </div> -->\n @for (item of items; track $index) {\n @if (item.visible && !item.divider) {\n <s-tiered-menu-item\n [item]=\"item\"\n [focused]=\"item === tieredMenuService.currentItem\"\n [highlight]=\"item.isOpen\"\n fieldUtils.triggerEvent=\"hover\"\n [closeOnClick]=\"false\"\n />\n }\n @if (item.divider) {\n <s-tiered-menu-divider />\n }\n }\n</div>\n", styles: [".menu{background-color:#fff;border:1px solid #ccc;border-radius:6px;box-shadow:0 2px 12px #0000001a;display:inline-flex;flex-direction:column;max-height:100vh;min-width:176px;padding:4px 0;overflow-y:auto;position:absolute;z-index:9999}\n"] }]
|
|
639
|
-
}],
|
|
624
|
+
}], propDecorators: { ariaLabel: [{
|
|
640
625
|
type: Input
|
|
641
626
|
}], destroyRequest: [{
|
|
642
627
|
type: Output
|
|
@@ -665,14 +650,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
665
650
|
* @category Navegação
|
|
666
651
|
*/
|
|
667
652
|
class TieredMenuDirective {
|
|
668
|
-
_elementRef;
|
|
669
|
-
_appRef;
|
|
670
|
-
_componentFactoryResolver;
|
|
671
|
-
_injector;
|
|
672
|
-
_tieredMenuEventService;
|
|
673
|
-
_tieredMenuService;
|
|
674
|
-
_tieredMenuGlobalService;
|
|
675
|
-
_changeDetectorRef;
|
|
653
|
+
_elementRef = inject(ElementRef);
|
|
654
|
+
_appRef = inject(ApplicationRef);
|
|
655
|
+
_componentFactoryResolver = inject(ComponentFactoryResolver);
|
|
656
|
+
_injector = inject(Injector);
|
|
657
|
+
_tieredMenuEventService = inject(TieredMenuEventService);
|
|
658
|
+
_tieredMenuService = inject(TieredMenuService);
|
|
659
|
+
_tieredMenuGlobalService = inject(TieredMenuGlobalService);
|
|
660
|
+
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
676
661
|
/**
|
|
677
662
|
* @description Lista de itens exibidos no menu. Cada item pode conter um array de `children`
|
|
678
663
|
* para criar submenus aninhados, além de propriedades como `label`, `icon`,
|
|
@@ -707,16 +692,6 @@ class TieredMenuDirective {
|
|
|
707
692
|
this._setMenuPosition();
|
|
708
693
|
this._componentRef?.hostView.detectChanges();
|
|
709
694
|
});
|
|
710
|
-
constructor(_elementRef, _appRef, _componentFactoryResolver, _injector, _tieredMenuEventService, _tieredMenuService, _tieredMenuGlobalService, _changeDetectorRef) {
|
|
711
|
-
this._elementRef = _elementRef;
|
|
712
|
-
this._appRef = _appRef;
|
|
713
|
-
this._componentFactoryResolver = _componentFactoryResolver;
|
|
714
|
-
this._injector = _injector;
|
|
715
|
-
this._tieredMenuEventService = _tieredMenuEventService;
|
|
716
|
-
this._tieredMenuService = _tieredMenuService;
|
|
717
|
-
this._tieredMenuGlobalService = _tieredMenuGlobalService;
|
|
718
|
-
this._changeDetectorRef = _changeDetectorRef;
|
|
719
|
-
}
|
|
720
695
|
ngOnInit() {
|
|
721
696
|
this._itemsAreValid = !!this.items?.length;
|
|
722
697
|
if (!this._itemsAreValid)
|
|
@@ -888,7 +863,7 @@ class TieredMenuDirective {
|
|
|
888
863
|
this._tieredMenuService.items.find((i) => i.label === this.focusedItem?.label) ??
|
|
889
864
|
this._tieredMenuService.items[0];
|
|
890
865
|
}
|
|
891
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuDirective, deps: [
|
|
866
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
892
867
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TieredMenuDirective, selector: "[sTieredMenu]", inputs: { items: "items", focusedItem: "focusedItem", triggerEvent: "triggerEvent", ariaLabel: "ariaLabel" }, outputs: { tieredMenuOpened: "tieredMenuOpened", tieredMenuClosed: "tieredMenuClosed" }, host: { listeners: { "click": "onClick($event)" } }, providers: [TieredMenuEventService, TieredMenuService], usesOnChanges: true, ngImport: i0 });
|
|
893
868
|
}
|
|
894
869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TieredMenuDirective, decorators: [{
|
|
@@ -897,7 +872,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
897
872
|
selector: '[sTieredMenu]',
|
|
898
873
|
providers: [TieredMenuEventService, TieredMenuService],
|
|
899
874
|
}]
|
|
900
|
-
}],
|
|
875
|
+
}], propDecorators: { items: [{
|
|
901
876
|
type: Input
|
|
902
877
|
}], focusedItem: [{
|
|
903
878
|
type: Input
|