From b7e31e4f60962810e17d6b4a17adf457a26dc473 Mon Sep 17 00:00:00 2001 From: alecarn <133774929+alecarn@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:17:27 -0500 Subject: [PATCH] feat: migrate to angular standalone components (#1556) BREAKING CHANGE: IgoLanguageModule don't import TranslateModule.forRoot defaultLanguageLoader is not exported anymore BREAKING CHANGE: 'provideDefaultLanguageLoader' and 'provideLanguageLoader' are replaced by 'DEFAULT_LANGUAGE_LOADER' and set directly inside the TranslationConfig --- package-lock.json | 32 +++- packages/auth/package.json | 2 + .../lib/auth-form/auth-facebook.component.ts | 3 +- .../src/lib/auth-form/auth-form.component.ts | 21 ++- .../lib/auth-form/auth-google.component.ts | 3 +- .../lib/auth-form/auth-intern.component.ts | 20 ++- .../lib/auth-form/auth-microsoft.component.ts | 7 +- .../auth-form/auth-microsoftb2c.component.ts | 7 +- packages/auth/src/lib/auth-form/index.ts | 16 ++ packages/auth/src/lib/auth.module.ts | 4 +- .../src/lib/shared/auth-storage.service.ts | 2 +- .../src/lib/shared/protected.directive.ts | 3 +- packages/common/package.json | 2 + .../common/src/lib/action/action.module.ts | 12 +- .../actionbar/actionbar-item.component.ts | 21 ++- .../action/actionbar/actionbar.component.ts | 25 +++- .../lib/action/actionbar/actionbar.module.ts | 28 +--- .../lib/backdrop/backdrop.component.spec.ts | 2 +- .../src/lib/backdrop/backdrop.component.ts | 5 +- .../src/lib/backdrop/backdrop.module.ts | 7 +- .../lib/badge-icon/badge-icon.directive.ts | 6 +- .../src/lib/badge-icon/badge-icon.module.ts | 10 +- .../src/lib/clickout/clickout.directive.ts | 3 +- .../src/lib/clickout/clickout.module.ts | 6 +- packages/common/src/lib/clone/clone.module.ts | 6 +- packages/common/src/lib/clone/clone.pipe.ts | 3 +- .../src/lib/collapsible/collapse.directive.ts | 3 +- .../collapsible/collapsible.component.spec.ts | 9 +- .../lib/collapsible/collapsible.component.ts | 8 +- .../src/lib/collapsible/collapsible.module.ts | 8 +- packages/common/src/lib/collapsible/index.ts | 8 + .../color-picker-form-field.component.ts | 16 ++ .../color-picker-form-field.module.ts | 26 +--- .../confirm-dialog.component.ts | 20 ++- .../confirm-dialog/confirm-dialog.module.ts | 10 +- .../confirm-dialog/confirm-dialog.service.ts | 2 +- .../context-menu/context-menu.directive.ts | 3 +- .../lib/context-menu/context-menu.module.ts | 6 +- packages/common/src/lib/context-menu/index.ts | 8 + .../lib/context-menu/long-press.directive.ts | 3 +- .../lib/custom-html/custom-html.component.ts | 6 +- .../src/lib/custom-html/custom-html.module.ts | 22 +-- .../src/lib/custom-html/custom-html.pipe.ts | 5 +- packages/common/src/lib/custom-html/index.ts | 8 + packages/common/src/lib/dom/dom.module.ts | 7 + .../src/lib/drag-drop/drag-drop.directive.ts | 3 +- .../src/lib/drag-drop/drag-drop.module.ts | 6 +- .../dynamic-component.module.ts | 12 +- .../dynamic-outlet.component.ts | 3 +- .../dynamic-outlet/dynamic-outlet.module.ts | 8 +- .../entity-selector.component.ts | 15 +- .../entity-selector/entity-selector.module.ts | 10 +- .../entity-table-paginator.component.ts | 10 +- .../entity-table-paginator.module.ts | 8 +- .../entity-table-row.directive.ts | 3 +- .../entity-table/entity-table.component.ts | 67 ++++++++- .../entity-table/entity-table.module.ts | 49 +----- .../common/src/lib/entity/entity.module.ts | 17 +-- packages/common/src/lib/entity/index.ts | 10 ++ .../lib/flexible/flexible.component.spec.ts | 2 +- .../src/lib/flexible/flexible.component.ts | 3 +- .../src/lib/flexible/flexible.module.ts | 6 +- .../lib/form-dialog/form-dialog.component.ts | 30 +++- .../src/lib/form-dialog/form-dialog.module.ts | 24 +-- .../form-field/form-field-select.component.ts | 22 ++- .../form-field/form-field-text.component.ts | 21 ++- .../form-field-textarea.component.ts | 19 ++- .../form/form-field/form-field.component.ts | 6 +- .../lib/form/form-field/form-field.module.ts | 43 +----- .../common/src/lib/form/form-field/index.ts | 12 ++ .../form/form-group/form-group.component.ts | 16 +- .../lib/form/form-group/form-group.module.ts | 17 +-- packages/common/src/lib/form/form.module.ts | 15 +- .../src/lib/form/form/form.component.ts | 6 +- .../common/src/lib/form/form/form.module.ts | 9 +- packages/common/src/lib/form/index.ts | 10 ++ .../lib/home-button/home-button.component.ts | 9 +- .../src/lib/home-button/home-button.module.ts | 20 +-- .../src/lib/image/image-error.directive.ts | 3 +- packages/common/src/lib/image/image.module.ts | 6 +- packages/common/src/lib/image/index.ts | 5 + .../common/src/lib/image/secure-image.pipe.ts | 3 +- .../interactive-tour.component.ts | 17 ++- .../interactive-tour.module.ts | 19 +-- .../lib/json-dialog/json-dialog.component.ts | 22 ++- .../src/lib/json-dialog/json-dialog.module.ts | 10 +- .../src/lib/keyvalue/keyvalue.module.ts | 6 +- .../common/src/lib/keyvalue/keyvalue.pipe.ts | 3 +- packages/common/src/lib/list/index.ts | 5 + .../src/lib/list/list-item.directive.ts | 3 +- .../src/lib/list/list.component.spec.ts | 3 +- .../common/src/lib/list/list.component.ts | 7 +- packages/common/src/lib/list/list.module.ts | 10 +- .../src/lib/panel/panel.component.spec.ts | 2 +- .../common/src/lib/panel/panel.component.ts | 5 +- packages/common/src/lib/panel/panel.module.ts | 9 +- ...lect-value-check-radio-dialog.component.ts | 36 ++++- .../select-value-dialog.module.ts | 25 +--- .../src/lib/sidenav/sidenav-shim.directive.ts | 3 +- .../common/src/lib/sidenav/sidenav.module.ts | 6 +- packages/common/src/lib/spinner/index.ts | 8 + .../lib/spinner/spinner-activity.directive.ts | 3 +- .../src/lib/spinner/spinner.component.spec.ts | 4 +- .../src/lib/spinner/spinner.component.ts | 6 +- .../common/src/lib/spinner/spinner.module.ts | 13 +- .../common/src/lib/stop-propagation/index.ts | 8 + .../stop-drop-propagation.directive.ts | 3 +- .../stop-propagation.directive.ts | 3 +- .../stop-propagation.module.ts | 6 +- .../common/src/lib/table/table.component.ts | 26 +++- packages/common/src/lib/table/table.module.ts | 30 +--- packages/common/src/lib/tool/tool.module.ts | 11 +- .../src/lib/tool/toolbox/toolbox.component.ts | 13 +- .../src/lib/tool/toolbox/toolbox.module.ts | 10 +- .../widget-outlet/widget-outlet.component.ts | 6 +- .../widget-outlet/widget-outlet.module.ts | 9 +- .../common/src/lib/widget/widget.module.ts | 6 +- packages/common/src/lib/workspace/index.ts | 8 + .../workspace-selector.component.scss | 5 - .../workspace-selector.component.ts | 5 +- .../workspace-selector.module.ts | 9 +- .../workspace-widget-outlet.component.ts | 6 +- .../workspace-widget-outlet.module.ts | 9 +- .../src/lib/workspace/workspace.module.ts | 11 +- packages/common/src/public_api.ts | 35 ++--- packages/context/package.json | 2 + .../context-import-export.module.ts | 39 +---- .../context-import-export.component.ts | 33 +++- .../context-edit-binding.directive.ts | 3 +- .../context-edit/context-edit.component.ts | 8 +- .../context-form/context-form.component.ts | 29 +++- .../context-item/context-item.component.html | 4 +- .../context-item/context-item.component.ts | 22 ++- .../context-list-binding.directive.ts | 4 +- .../context-list/context-list.component.html | 6 +- .../context-list/context-list.component.ts | 43 +++++- .../context-manager/context-manager.module.ts | 67 +-------- .../context-permissions-binding.directive.ts | 3 +- .../context-permissions.component.ts | 41 ++++- .../context/src/lib/context-manager/index.ts | 29 ++++ .../shared/layer-context.directive.ts | 5 +- .../shared/map-context.directive.ts | 3 +- .../bookmark-button.component.ts | 8 +- .../bookmark-dialog.component.ts | 26 +++- .../context-map-button.module.ts | 47 +----- .../src/lib/context-map-button/index.ts | 14 ++ .../poi-button/poi-button.component.ts | 22 ++- .../poi-button/poi-dialog.component.ts | 26 +++- .../user-button/user-button.component.ts | 18 ++- .../user-button/user-dialog.component.ts | 20 ++- packages/context/src/lib/context.module.ts | 10 +- packages/context/src/lib/index.ts | 20 +++ packages/context/src/lib/share-map/index.ts | 10 ++ .../src/lib/share-map/share-map.module.ts | 31 +--- .../share-map/share-map-api.component.ts | 29 +++- .../share-map/share-map-url.component.ts | 19 ++- .../share-map/share-map.component.ts | 17 ++- .../src/lib/sidenav/sidenav.component.ts | 36 ++++- .../context/src/lib/sidenav/sidenav.module.ts | 29 +--- packages/core/package.json | 2 + packages/core/src/lib/core.module.ts | 2 +- .../lib/language/shared/language.provider.ts | 21 ++- .../src/lib/message/shared/message.service.ts | 5 +- .../lib/monitoring/sentry/sentry.interface.ts | 1 + .../monitoring/sentry/sentry.utils.spec.ts | 4 +- .../src/lib/monitoring/sentry/sentry.utils.ts | 7 +- .../shared/any-monitoring.interface.ts | 2 +- packages/geo/package.json | 5 +- .../catalog-browser-group.component.ts | 29 +++- .../catalog-browser-layer.component.ts | 32 +++- .../catalog-browser.component.ts | 22 ++- .../catalog-browser/catalog-browser.module.ts | 41 +---- .../add-catalog-dialog.component.ts | 42 +++++- .../catalog-library-item.component.ts | 18 ++- .../catalog-library.component.ts | 23 ++- .../catalog-library/catalog-library.module.ts | 42 +----- .../src/lib/catalog/catalog-library/index.ts | 10 ++ .../geo/src/lib/catalog/catalog.module.ts | 27 +--- packages/geo/src/lib/catalog/index.ts | 8 + .../src/lib/datasource/datasource.module.ts | 15 -- .../shared/datasources/wms-wfs.utils.ts | 8 +- .../directions-buttons.component.ts | 16 +- .../directions-inputs.component.ts | 44 +++++- .../directions-results.component.ts | 25 +++- .../lib/directions/directions.component.ts | 15 +- .../src/lib/directions/directions.module.ts | 41 +---- .../download-button.component.ts | 16 +- .../geo/src/lib/download/download.module.ts | 20 +-- .../draw/draw/draw-layer-popup.component.ts | 22 ++- .../src/lib/draw/draw/draw-popup.component.ts | 38 ++++- .../lib/draw/draw/draw-shorcuts.component.ts | 20 ++- .../geo/src/lib/draw/draw/draw.component.ts | 39 ++++- packages/geo/src/lib/draw/draw/draw.module.ts | 53 +------ .../geo/src/lib/draw/drawingTool.module.ts | 5 +- .../feature-details.component.ts | 32 +++- .../feature-details.directive.ts | 3 +- .../feature-details/feature-details.module.ts | 18 +-- .../src/lib/feature/feature-details/index.ts | 10 ++ .../feature-form/feature-form.component.ts | 7 +- .../feature-form/feature-form.module.ts | 10 +- .../geo/src/lib/feature/feature.module.ts | 9 +- packages/geo/src/lib/feature/index.ts | 10 +- .../src/lib/feature/shared/feature.utils.ts | 4 +- packages/geo/src/lib/filter/filter.module.ts | 141 ++++-------------- packages/geo/src/lib/filter/index.ts | 46 ++++++ .../ogc-filter-button.component.ts | 23 ++- .../ogc-filter-form.component.ts | 51 +++++-- .../ogc-filter-selection.component.ts | 50 ++++++- .../ogc-filter-time-slider.component.ts | 10 +- .../ogc-filter-time.component.ts | 50 ++++++- .../ogc-filterable-form.component.ts | 13 ++ .../ogc-filterable-item.component.ts | 34 ++++- .../ogc-filterable-list-binding.directive.ts | 3 +- .../ogc-filterable-list.component.ts | 19 ++- .../shared/filterable-datasource.pipe.ts | 3 +- .../geo/src/lib/filter/shared/ogc-filter.ts | 4 +- .../spatial-filter-item.component.ts | 48 +++++- .../spatial-filter-list.component.ts | 28 +++- .../spatial-filter-type.component.ts | 26 +++- .../time-filter-button.component.ts | 23 ++- .../time-filter-form.component.ts | 39 ++++- .../time-filter-item.component.ts | 28 +++- .../time-filter-list-binding.directive.ts | 3 +- .../time-filter-list.component.ts | 15 +- packages/geo/src/lib/geo.module.ts | 27 +--- .../geometry-form-field-input.component.ts | 3 +- .../geometry-form-field.component.ts | 28 +++- .../geometry-form-field.module.ts | 26 +--- .../lib/geometry/geometry-form-field/index.ts | 10 ++ .../geo/src/lib/geometry/geometry.module.ts | 9 +- packages/geo/src/lib/geometry/index.ts | 3 +- .../export-button/export-button.component.ts | 16 +- .../lib/import-export/import-export.module.ts | 51 +------ .../import-export.component.html | 4 +- .../import-export/import-export.component.ts | 48 +++++- packages/geo/src/lib/import-export/index.ts | 10 ++ .../shared/drop-geo-file.directive.ts | 3 +- packages/geo/src/lib/layer/index.ts | 23 +++ .../layer/layer-item/layer-item.component.ts | 25 +++- .../layer-legend-item.component.ts | 7 +- .../layer-legend-list-binding.directive.ts | 3 +- .../layer-legend-list.component.ts | 23 ++- .../layer-legend/layer-legend.component.ts | 37 ++++- .../layer-list-tool.component.ts | 30 +++- .../layer-list-binding.directive.ts | 3 +- .../layer/layer-list/layer-list.component.ts | 40 ++++- packages/geo/src/lib/layer/layer.module.ts | 55 +------ .../track-feature-button.component.ts | 16 +- .../baselayers-switcher.component.ts | 19 ++- .../mini-basemap.component.ts | 6 +- .../geolocate-button.component.ts | 16 +- .../home-extent-button.component.ts | 9 +- packages/geo/src/lib/map/index.ts | 40 +++++ .../info-section/info-section.component.ts | 5 +- .../map/map-browser/map-browser.component.ts | 3 +- .../map/map-center/map-center.component.ts | 3 +- packages/geo/src/lib/map/map.module.ts | 75 +++------- .../map/menu-button/menu-button.component.ts | 16 +- .../offline-button.component.ts | 16 +- .../rotation-button.component.ts | 17 ++- .../lib/map/shared/hover-feature.directive.ts | 3 +- .../shared/map-pointer-position.directive.ts | 3 +- packages/geo/src/lib/map/shared/map.ts | 4 +- .../lib/map/shared/mapOffline.directive.ts | 3 +- .../swipe-control/swipe-control.component.ts | 3 +- .../wake-lock-button.component.ts | 15 +- .../map/zoom-button/zoom-button.component.ts | 9 +- packages/geo/src/lib/measure/index.ts | 3 +- .../geo/src/lib/measure/measure.module.ts | 3 + .../geo/src/lib/measure/measurer/index.ts | 7 + .../measure/measurer/measure-format.pipe.ts | 3 +- .../measurer/measurer-dialog.component.ts | 21 ++- .../measurer/measurer-item.component.ts | 20 ++- .../measure/measurer/measurer.component.ts | 33 +++- .../lib/measure/measurer/measurer.module.ts | 40 +---- packages/geo/src/lib/metadata/index.ts | 10 ++ .../metadata-button.component.ts | 36 ++++- .../geo/src/lib/metadata/metadata.module.ts | 22 +-- .../geo/src/lib/overlay/overlay.module.ts | 8 +- .../lib/overlay/shared/overlay.directive.ts | 3 +- .../print/print-form/print-form.component.ts | 28 +++- packages/geo/src/lib/print/print.module.ts | 33 +--- .../src/lib/print/print/print.component.ts | 5 +- packages/geo/src/lib/query/query.module.ts | 5 +- .../src/lib/query/shared/query.directive.ts | 3 +- .../geo/src/lib/query/shared/query.service.ts | 5 +- packages/geo/src/lib/search/index.ts | 19 ++- .../search-bar/search-bar.component.html | 4 +- .../search/search-bar/search-bar.component.ts | 29 +++- .../search/search-bar/search-bar.module.ts | 36 +---- .../search-bar/search-url-param.directive.ts | 3 +- .../src/lib/search/search-results/index.ts | 11 ++ .../save-feature-dialog.component.ts | 42 +++++- .../search-results-add-button.component.ts | 26 +++- .../search-results-item.component.ts | 17 ++- .../search-results.component.ts | 24 ++- .../search-results/search-results.module.ts | 56 +------ .../search-selector.component.ts | 20 ++- .../search-selector/search-selector.module.ts | 27 +--- .../search-settings.component.spec.ts | 4 +- .../search-settings.component.ts | 34 ++++- .../search-settings/search-settings.module.ts | 27 +--- packages/geo/src/lib/search/search.module.ts | 8 +- .../search-pointer-summary.directive.ts | 3 +- .../search/shared/sources/storedqueries.ts | 6 +- .../drawing/style-modal-drawing.component.ts | 46 +++++- .../style-modal-layer-button.component.ts | 9 +- .../layer/style-modal-layer.component.ts | 37 ++++- packages/geo/src/lib/style/style.module.ts | 32 +--- packages/geo/src/lib/toast/toast.component.ts | 22 ++- packages/geo/src/lib/toast/toast.module.ts | 21 +-- packages/geo/src/lib/wkt/wkt.module.ts | 3 + .../confirmation-popup.component.ts | 12 +- .../confirmation-popup.module.ts | 16 +- .../ogc-filter/ogc-filter.component.ts | 5 +- .../widgets/ogc-filter/ogc-filter.module.ts | 12 +- .../workspace-selector.directive.ts | 3 +- .../workspace-selector.module.ts | 8 +- .../workspace-updator.directive.ts | 3 +- .../workspace-updator.module.ts | 8 +- .../geo/src/lib/workspace/workspace.module.ts | 17 +-- packages/geo/src/locale/en.geo.json | 6 +- packages/geo/src/locale/fr.geo.json | 6 +- packages/geo/src/public_api.ts | 23 ++- packages/integration/package.json | 2 + .../about-tool/about-tool.component.scss | 2 +- .../about/about-tool/about-tool.component.ts | 26 +++- .../integration/src/lib/about/about.module.ts | 23 +-- .../src/lib/analytics/analytics.module.ts | 8 - .../catalog-browser-tool.component.ts | 6 +- .../catalog-browser-tool.module.ts | 13 +- .../catalog-library-tool.component.ts | 6 +- .../catalog-library-tool.module.ts | 13 +- .../src/lib/catalog/catalog.module.ts | 7 +- .../context-editor-tool.component.ts | 8 +- .../context-manager-tool.component.ts | 8 +- ...ntext-permission-manager-tool.component.ts | 8 +- .../context-share-tool.component.ts | 5 +- .../src/lib/context/context.module.ts | 28 +--- packages/integration/src/lib/context/index.ts | 12 ++ .../directions-tool.component.html | 2 +- .../directions-tool.component.ts | 5 +- .../src/lib/directions/directions.module.ts | 17 +-- .../integration/src/lib/draw/draw.module.ts | 6 +- .../drawing-tool/drawing-tool.component.ts | 5 +- .../draw/drawing-tool/drawing-tool.module.ts | 12 +- .../active-ogc-filter-tool.component.ts | 6 +- .../active-time-filter-tool.component.html | 1 - .../active-time-filter-tool.component.ts | 6 +- .../src/lib/filter/filter.module.ts | 18 +-- packages/integration/src/lib/filter/index.ts | 14 ++ .../ogc-filter-tool.component.ts | 8 +- .../spatial-filter-tool.component.html | 89 ++++++----- .../spatial-filter-tool.component.ts | 16 +- .../time-filter-tool.component.ts | 8 +- .../import-export-tool.component.ts | 17 ++- .../lib/import-export/import-export.module.ts | 30 +--- .../integration/src/lib/integration.module.ts | 7 +- .../advanced-coordinates.component.ts | 30 +++- .../advanced-map-tool.component.ts | 18 ++- .../advanced-swipe.component.ts | 29 +++- packages/integration/src/lib/map/index.ts | 16 ++ .../map-details-tool.component.ts | 30 +++- .../map-legend/map-legend-tool.component.ts | 18 ++- .../map-proximity-tool.component.ts | 24 ++- .../lib/map/map-tool/map-tool.component.ts | 34 ++++- .../lib/map/map-tools/map-tools.component.ts | 39 ++++- .../integration/src/lib/map/map.module.ts | 79 +--------- .../src/lib/measure/measure.module.ts | 5 +- .../measurer-tool/measurer-tool.component.ts | 11 +- .../measurer-tool/measurer-tool.module.ts | 12 +- .../print/print-tool/print-tool.component.ts | 6 +- .../integration/src/lib/print/print.module.ts | 17 +-- packages/integration/src/lib/search/index.ts | 8 + .../search-bar-binding.directive.ts | 3 +- .../search/search-bar/search-bar.module.ts | 7 +- .../search-results-tool.component.ts | 29 +++- .../search-results-tool.module.ts | 40 +---- .../src/lib/search/search.module.ts | 12 +- .../src/lib/storage/storage.module.ts | 8 - .../integration/src/lib/tool/tool.module.ts | 8 - .../shared/edition-actions.service.ts | 7 +- .../shared/feature-actions.service.ts | 7 +- .../workspace/shared/wfs-actions.service.ts | 7 +- .../lib/workspace/shared/workspace.utils.ts | 12 +- .../workspace-button.component.ts | 16 +- .../src/lib/workspace/workspace.module.ts | 21 +-- packages/integration/src/public_api.ts | 3 - packages/utils/package.json | 2 + packages/utils/src/lib/datetime.utils.ts | 5 + packages/utils/src/lib/index.ts | 1 + packages/utils/src/lib/object-utils.ts | 20 +-- packages/utils/src/lib/string-utils.ts | 4 +- projects/demo/src/app/app.component.html | 3 + projects/demo/src/app/app.component.scss | 4 + projects/demo/src/app/app.component.spec.ts | 6 +- projects/demo/src/app/app.component.ts | 2 + projects/demo/src/app/app.routing.ts | 2 +- projects/demo/src/app/app.theme.scss | 20 +++ .../src/app/common/action/action.component.ts | 4 +- .../dynamic-component.component.ts | 4 +- .../entity-selector.component.ts | 4 +- .../entity-table/entity-table.component.ts | 11 +- .../src/app/common/form/form.component.ts | 10 +- .../src/app/common/table/table.component.ts | 4 +- .../demo/src/app/common/table/table.module.ts | 7 +- .../src/app/common/tool/tool.component.ts | 14 +- .../context/context/context.component.html | 2 +- .../app/context/context/context.component.ts | 26 ++-- .../src/app/context/context/context.module.ts | 3 +- .../app/core/activity/activity.component.ts | 6 +- .../src/app/geo/catalog/catalog.component.ts | 16 +- .../geo/directions/directions.component.ts | 4 +- .../demo/src/app/geo/draw/draw.component.ts | 12 +- projects/demo/src/app/geo/draw/draw.module.ts | 24 --- .../src/app/geo/feature/feature.component.ts | 8 +- projects/demo/src/app/geo/geo.routing.ts | 4 +- .../app/geo/geometry/geometry.component.ts | 14 +- .../import-export/import-export.component.ts | 8 +- .../demo/src/app/geo/layer/layer.component.ts | 24 +-- .../src/app/geo/legend/legend.component.ts | 12 +- .../src/app/geo/measure/measure.component.ts | 12 +- .../geo/ogc-filter/ogc-filter.component.ts | 12 +- .../src/app/geo/overlay/overlay.component.ts | 4 +- .../demo/src/app/geo/print/print.component.ts | 8 +- .../demo/src/app/geo/query/query.component.ts | 16 +- .../src/app/geo/search/search.component.ts | 31 ++-- .../geo/simple-map/simple-map.component.ts | 4 +- .../spatial-filter.component.ts | 16 +- .../geo/time-filter/time-filter.component.ts | 12 +- .../app/geo/workspace/workspace.component.ts | 30 ++-- projects/demo/src/main.ts | 4 +- scripts/src/utils/log.ts | 1 + scripts/src/utils/style.utils.ts | 2 +- 434 files changed, 4320 insertions(+), 2467 deletions(-) create mode 100644 packages/context/src/lib/index.ts create mode 100644 packages/geo/src/lib/catalog/catalog-library/index.ts delete mode 100644 packages/geo/src/lib/datasource/datasource.module.ts create mode 100644 packages/geo/src/lib/feature/feature-details/index.ts create mode 100644 packages/geo/src/lib/geometry/geometry-form-field/index.ts create mode 100644 packages/geo/src/lib/measure/measurer/index.ts create mode 100644 packages/geo/src/lib/search/search-results/index.ts delete mode 100644 packages/integration/src/lib/analytics/analytics.module.ts delete mode 100644 packages/integration/src/lib/storage/storage.module.ts delete mode 100644 packages/integration/src/lib/tool/tool.module.ts create mode 100644 packages/utils/src/lib/datetime.utils.ts delete mode 100644 projects/demo/src/app/geo/draw/draw.module.ts diff --git a/package-lock.json b/package-lock.json index dfe35dcc2b..888f91403c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -932,6 +932,20 @@ "rxjs": "^6.5.3 || ^7.4.0" } }, + "node_modules/@angular/material-moment-adapter": { + "version": "17.1.0", + "resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-17.1.0.tgz", + "integrity": "sha512-KdiJ/qXQanQItCC16MJj50s8f8gO4uLdT+CFqZetzgpjQXSiuNDZxdbHoB9U3IBv44gqKNdf+0Y4ckIIJ7EpZA==", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/core": "^17.0.0 || ^18.0.0", + "@angular/material": "17.1.0", + "moment": "^2.18.1" + } + }, "node_modules/@angular/platform-browser": { "version": "17.1.0", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-17.1.0.tgz", @@ -18850,9 +18864,9 @@ } }, "node_modules/postcss-modules-scope": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.1.0.tgz", - "integrity": "sha512-SaIbK8XW+MZbd0xHPf7kdfA/3eOt7vxJ72IRecn3EzuZVLr1r0orzf0MX/pN8m+NMDoo6X/SQd8oeKqGZd8PXg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.1.1.tgz", + "integrity": "sha512-uZgqzdTleelWjzJY+Fhti6F3C9iF1JR/dODLs/JDefozYcKTBCdD8BIl6nNPbTbcLnGrk56hzwZC2DaGNvYjzA==", "dev": true, "dependencies": { "postcss-selector-parser": "^6.0.4" @@ -23627,6 +23641,7 @@ "integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==" }, "packages/auth": { + "name": "@igo2/auth", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23653,6 +23668,7 @@ } }, "packages/common": { + "name": "@igo2/common", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23681,6 +23697,7 @@ } }, "packages/context": { + "name": "@igo2/context", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23706,6 +23723,7 @@ } }, "packages/core": { + "name": "@igo2/core", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23733,6 +23751,7 @@ } }, "packages/geo": { + "name": "@igo2/geo", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23758,6 +23777,7 @@ "@angular/core": "^17.0.6", "@angular/forms": "^17.0.6", "@angular/material": "^17.0.3", + "@angular/material-moment-adapter": "^17.1.0", "@angular/platform-browser": "^17.0.6", "@igo2/common": "*", "@igo2/core": "*", @@ -23780,6 +23800,7 @@ } }, "packages/integration": { + "name": "@igo2/integration", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23799,6 +23820,7 @@ } }, "packages/utils": { + "name": "@igo2/utils", "version": "16.1.1", "license": "MIT", "dependencies": { @@ -23816,6 +23838,7 @@ }, "projects/demo": {}, "projects/igo2": { + "name": "igo", "version": "16.1.0", "license": "LiLiQ-R", "dependencies": { @@ -23885,9 +23908,8 @@ }, "projects/igo2/node_modules/typescript": { "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/packages/auth/package.json b/packages/auth/package.json index fbd2980160..ba04857b5a 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build auth --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint auth", + "lint.fix": "ng lint auth --fix", "test": "ng test auth --watch=false", "test.watch": "ng test auth", "watch": "ng build auth --watch" diff --git a/packages/auth/src/lib/auth-form/auth-facebook.component.ts b/packages/auth/src/lib/auth-form/auth-facebook.component.ts index 22e4602c02..f3e0177279 100644 --- a/packages/auth/src/lib/auth-form/auth-facebook.component.ts +++ b/packages/auth/src/lib/auth-form/auth-facebook.component.ts @@ -15,7 +15,8 @@ import { AuthService } from '../shared/auth.service'; selector: 'igo-auth-facebook', templateUrl: './auth-facebook.component.html', styleUrls: ['./auth-facebook.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true }) export class AuthFacebookComponent { private options?: AuthFacebookOptions; diff --git a/packages/auth/src/lib/auth-form/auth-form.component.ts b/packages/auth/src/lib/auth-form/auth-form.component.ts index 6012c0106f..a4f745f304 100644 --- a/packages/auth/src/lib/auth-form/auth-form.component.ts +++ b/packages/auth/src/lib/auth-form/auth-form.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,20 +8,38 @@ import { Optional, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; import { NavigationStart, Router } from '@angular/router'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { filter } from 'rxjs/operators'; import { AuthOptions } from '../shared/auth.interface'; import { AuthService } from '../shared/auth.service'; +import { AuthFacebookComponent } from './auth-facebook.component'; +import { AuthGoogleComponent } from './auth-google.component'; +import { AuthInternComponent } from './auth-intern.component'; +import { AuthMicrosoftComponent } from './auth-microsoft.component'; +import { AuthMicrosoftb2cComponent } from './auth-microsoftb2c.component'; @Component({ selector: 'igo-auth-form', templateUrl: './auth-form.component.html', styleUrls: ['./auth-form.component.scss'], - changeDetection: ChangeDetectionStrategy.Default + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [ + NgIf, + AuthGoogleComponent, + AuthMicrosoftComponent, + AuthMicrosoftb2cComponent, + AuthFacebookComponent, + AuthInternComponent, + MatButtonModule, + TranslateModule + ] }) export class AuthFormComponent implements OnInit { @Input() diff --git a/packages/auth/src/lib/auth-form/auth-google.component.ts b/packages/auth/src/lib/auth-form/auth-google.component.ts index b3d62bf8a3..9db7f12b00 100644 --- a/packages/auth/src/lib/auth-form/auth-google.component.ts +++ b/packages/auth/src/lib/auth-form/auth-google.component.ts @@ -15,7 +15,8 @@ import { AuthService } from '../shared/auth.service'; selector: 'igo-auth-google', templateUrl: './auth-google.component.html', styleUrls: ['./auth-google.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true }) export class AuthGoogleComponent { private options?: AuthGoogleOptions; diff --git a/packages/auth/src/lib/auth-form/auth-intern.component.ts b/packages/auth/src/lib/auth-form/auth-intern.component.ts index 52e291d321..5fe36249ea 100644 --- a/packages/auth/src/lib/auth-form/auth-intern.component.ts +++ b/packages/auth/src/lib/auth-form/auth-intern.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -6,20 +7,37 @@ import { Output } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; import { LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { AuthService } from '../shared/auth.service'; @Component({ selector: 'igo-auth-intern', templateUrl: './auth-intern.component.html', styleUrls: ['./auth-intern.component.scss'], - changeDetection: ChangeDetectionStrategy.Default + changeDetection: ChangeDetectionStrategy.Default, + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatButtonModule, + NgIf, + TranslateModule + ] }) export class AuthInternComponent { @Input() diff --git a/packages/auth/src/lib/auth-form/auth-microsoft.component.ts b/packages/auth/src/lib/auth-form/auth-microsoft.component.ts index 71095d7aba..7f053d84c7 100644 --- a/packages/auth/src/lib/auth-form/auth-microsoft.component.ts +++ b/packages/auth/src/lib/auth-form/auth-microsoft.component.ts @@ -6,6 +6,8 @@ import { Inject, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; import { ConfigService } from '@igo2/core'; @@ -22,6 +24,7 @@ import { PublicClientApplication, SilentRequest } from '@azure/msal-browser'; +import { TranslateModule } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { filter, takeUntil } from 'rxjs/operators'; @@ -35,7 +38,9 @@ import { AuthService } from '../shared/auth.service'; selector: 'igo-auth-microsoft', templateUrl: './auth-microsoft.component.html', styleUrls: ['./auth-microsoft.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MatButtonModule, MatIconModule, TranslateModule] }) export class AuthMicrosoftComponent { private options?: AuthMicrosoftOptions; diff --git a/packages/auth/src/lib/auth-form/auth-microsoftb2c.component.ts b/packages/auth/src/lib/auth-form/auth-microsoftb2c.component.ts index 8c14c42666..2bebc28609 100644 --- a/packages/auth/src/lib/auth-form/auth-microsoftb2c.component.ts +++ b/packages/auth/src/lib/auth-form/auth-microsoftb2c.component.ts @@ -6,6 +6,8 @@ import { Inject, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; import { ConfigService } from '@igo2/core'; @@ -18,6 +20,7 @@ import { PublicClientApplication, SilentRequest } from '@azure/msal-browser'; +import { TranslateModule } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { filter, takeUntil } from 'rxjs/operators'; @@ -33,7 +36,9 @@ import { AuthService } from '../shared/auth.service'; selector: 'igo-auth-microsoftb2c', templateUrl: './auth-microsoftb2c.component.html', styleUrls: ['./auth-microsoftb2c.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MatButtonModule, MatIconModule, TranslateModule] }) export class AuthMicrosoftb2cComponent { private options: AuthMicrosoftb2cOptions; diff --git a/packages/auth/src/lib/auth-form/index.ts b/packages/auth/src/lib/auth-form/index.ts index f1b41154d7..bc1e2a30d7 100644 --- a/packages/auth/src/lib/auth-form/index.ts +++ b/packages/auth/src/lib/auth-form/index.ts @@ -1,4 +1,20 @@ +import { AuthFacebookComponent } from './auth-facebook.component'; +import { AuthFormComponent } from './auth-form.component'; +import { AuthGoogleComponent } from './auth-google.component'; +import { AuthInternComponent } from './auth-intern.component'; +import { AuthMicrosoftComponent } from './auth-microsoft.component'; +import { AuthMicrosoftb2cComponent } from './auth-microsoftb2c.component'; + export * from './auth-form.component'; export * from './auth-intern.component'; export * from './auth-facebook.component'; export * from './auth-google.component'; + +export const AUTH_FORM_DIRECTIVES = [ + AuthFormComponent, + AuthGoogleComponent, + AuthInternComponent, + AuthFacebookComponent, + AuthMicrosoftComponent, + AuthMicrosoftb2cComponent +] as const; diff --git a/packages/auth/src/lib/auth.module.ts b/packages/auth/src/lib/auth.module.ts index eb5903dafc..347a9b2087 100644 --- a/packages/auth/src/lib/auth.module.ts +++ b/packages/auth/src/lib/auth.module.ts @@ -31,9 +31,7 @@ import { ProtectedDirective } from './shared/protected.directive'; MatIconModule, MatButtonModule, IgoLanguageModule, - MsalModule - ], - declarations: [ + MsalModule, AuthFormComponent, AuthGoogleComponent, AuthInternComponent, diff --git a/packages/auth/src/lib/shared/auth-storage.service.ts b/packages/auth/src/lib/shared/auth-storage.service.ts index 90cc3da662..208a598db2 100644 --- a/packages/auth/src/lib/shared/auth-storage.service.ts +++ b/packages/auth/src/lib/shared/auth-storage.service.ts @@ -3,8 +3,8 @@ import { Injectable } from '@angular/core'; import { BaseStorage, ConfigService, StorageScope } from '@igo2/core'; -import { AuthService } from './auth.service'; import { AuthStorageOptions } from './auth-storage.interface'; +import { AuthService } from './auth.service'; import { TokenService } from './token.service'; @Injectable({ diff --git a/packages/auth/src/lib/shared/protected.directive.ts b/packages/auth/src/lib/shared/protected.directive.ts index 79cdbf09b8..19d73dc16c 100644 --- a/packages/auth/src/lib/shared/protected.directive.ts +++ b/packages/auth/src/lib/shared/protected.directive.ts @@ -3,7 +3,8 @@ import { Directive, ElementRef } from '@angular/core'; import { AuthService } from './auth.service'; @Directive({ - selector: '[igoProtected]' + selector: '[igoProtected]', + standalone: true }) export class ProtectedDirective { constructor(authentication: AuthService, el: ElementRef) { diff --git a/packages/common/package.json b/packages/common/package.json index 6b7fa031e1..f9a5796b4f 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build common --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint common", + "lint.fix": "ng lint common --fix", "postbuild": "ts-node ../../scripts/src/common/postbuild-common.ts", "test": "ng test common --watch=false", "watch": "ng build common --watch" diff --git a/packages/common/src/lib/action/action.module.ts b/packages/common/src/lib/action/action.module.ts index 2bbf2083bf..b7540e8aa0 100644 --- a/packages/common/src/lib/action/action.module.ts +++ b/packages/common/src/lib/action/action.module.ts @@ -1,12 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoActionbarModule } from './actionbar/actionbar.module'; +import { ActionbarComponent } from './actionbar/actionbar.component'; +/** + * @deprecated import the ActionbarComponent directly + */ @NgModule({ - imports: [CommonModule, IgoActionbarModule], - exports: [IgoActionbarModule], - declarations: [], - providers: [] + imports: [ActionbarComponent], + exports: [ActionbarComponent] }) export class IgoActionModule {} diff --git a/packages/common/src/lib/action/actionbar/actionbar-item.component.ts b/packages/common/src/lib/action/actionbar/actionbar-item.component.ts index 99395a4712..888efc142c 100644 --- a/packages/common/src/lib/action/actionbar/actionbar-item.component.ts +++ b/packages/common/src/lib/action/actionbar/actionbar-item.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,7 +8,13 @@ import { OnInit, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, isObservable } from 'rxjs'; import { Action } from '../shared/action.interfaces'; @@ -19,7 +26,19 @@ import { Action } from '../shared/action.interfaces'; selector: 'igo-actionbar-item', templateUrl: './actionbar-item.component.html', styleUrls: ['./actionbar-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatListModule, + MatTooltipModule, + NgClass, + MatButtonModule, + MatIconModule, + MatCheckboxModule, + AsyncPipe, + TranslateModule + ] }) export class ActionbarItemComponent implements OnInit, OnDestroy { readonly disabled$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/common/src/lib/action/actionbar/actionbar.component.ts b/packages/common/src/lib/action/actionbar/actionbar.component.ts index c091b53031..c778bf77d3 100644 --- a/packages/common/src/lib/action/actionbar/actionbar.component.ts +++ b/packages/common/src/lib/action/actionbar/actionbar.component.ts @@ -1,4 +1,5 @@ import { Overlay } from '@angular/cdk/overlay'; +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -10,15 +11,23 @@ import { OnDestroy, SimpleChanges } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { Media, MediaService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { EntityStoreWatcher } from '../../entity'; import { ActionbarMode } from '../shared/action.enums'; import { Action } from '../shared/action.interfaces'; import { ActionStore } from '../shared/store'; +import { ActionbarItemComponent } from './actionbar-item.component'; /** * A list of action buttons. @@ -28,7 +37,21 @@ import { ActionStore } from '../shared/store'; selector: 'igo-actionbar', templateUrl: './actionbar.component.html', styleUrls: ['./actionbar.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatListModule, + ActionbarItemComponent, + NgFor, + MatMenuModule, + MatCardModule, + AsyncPipe, + TranslateModule + ] }) export class ActionbarComponent implements OnDestroy, OnChanges { /** diff --git a/packages/common/src/lib/action/actionbar/actionbar.module.ts b/packages/common/src/lib/action/actionbar/actionbar.module.ts index e4265e860d..f1bfe15d89 100644 --- a/packages/common/src/lib/action/actionbar/actionbar.module.ts +++ b/packages/common/src/lib/action/actionbar/actionbar.module.ts @@ -1,34 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core'; - -import { ActionbarItemComponent } from './actionbar-item.component'; import { ActionbarComponent } from './actionbar.component'; /** - * @ignore + * @deprecated import the ActionbarComponent directly */ @NgModule({ - imports: [ - CommonModule, - IgoLanguageModule, - MatButtonModule, - MatIconModule, - MatTooltipModule, - MatMenuModule, - MatListModule, - MatCardModule, - MatCheckboxModule - ], - exports: [ActionbarComponent], - declarations: [ActionbarComponent, ActionbarItemComponent] + imports: [ActionbarComponent], + exports: [ActionbarComponent] }) export class IgoActionbarModule {} diff --git a/packages/common/src/lib/backdrop/backdrop.component.spec.ts b/packages/common/src/lib/backdrop/backdrop.component.spec.ts index 64d1e5af5c..2a524c4d81 100644 --- a/packages/common/src/lib/backdrop/backdrop.component.spec.ts +++ b/packages/common/src/lib/backdrop/backdrop.component.spec.ts @@ -8,7 +8,7 @@ describe('BackdropComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [BackdropComponent] + imports: [BackdropComponent] }).compileComponents(); })); diff --git a/packages/common/src/lib/backdrop/backdrop.component.ts b/packages/common/src/lib/backdrop/backdrop.component.ts index 9a572f20b6..68b3a2f487 100644 --- a/packages/common/src/lib/backdrop/backdrop.component.ts +++ b/packages/common/src/lib/backdrop/backdrop.component.ts @@ -1,9 +1,12 @@ +import { NgClass } from '@angular/common'; import { Component, Input } from '@angular/core'; @Component({ selector: 'igo-backdrop', templateUrl: './backdrop.component.html', - styleUrls: ['./backdrop.component.scss'] + styleUrls: ['./backdrop.component.scss'], + standalone: true, + imports: [NgClass] }) export class BackdropComponent { @Input() diff --git a/packages/common/src/lib/backdrop/backdrop.module.ts b/packages/common/src/lib/backdrop/backdrop.module.ts index 118c89bb03..08f470d03e 100644 --- a/packages/common/src/lib/backdrop/backdrop.module.ts +++ b/packages/common/src/lib/backdrop/backdrop.module.ts @@ -1,11 +1,12 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { BackdropComponent } from './backdrop.component'; +/** + * @deprecated import the BackdropComponent directly + */ @NgModule({ - imports: [CommonModule], - declarations: [BackdropComponent], + imports: [BackdropComponent], exports: [BackdropComponent] }) export class IgoBackdropModule { diff --git a/packages/common/src/lib/badge-icon/badge-icon.directive.ts b/packages/common/src/lib/badge-icon/badge-icon.directive.ts index 13c7a16736..7af41dfd8b 100644 --- a/packages/common/src/lib/badge-icon/badge-icon.directive.ts +++ b/packages/common/src/lib/badge-icon/badge-icon.directive.ts @@ -1,5 +1,5 @@ import { Directive, ElementRef, Input, OnInit } from '@angular/core'; -import { MatIconRegistry } from '@angular/material/icon'; +import { MatIconModule, MatIconRegistry } from '@angular/material/icon'; /** * This directive allow to add an icon inside a matBadge. @@ -7,7 +7,9 @@ import { MatIconRegistry } from '@angular/material/icon'; * The badge content will be overrided by this current directive. */ @Directive({ - selector: '[igoMatBadgeIcon]' + selector: '[igoMatBadgeIcon]', + standalone: true, + providers: [MatIconModule] }) export class IgoBadgeIconDirective implements OnInit { @Input() diff --git a/packages/common/src/lib/badge-icon/badge-icon.module.ts b/packages/common/src/lib/badge-icon/badge-icon.module.ts index ee9d197f2c..3e52731c22 100644 --- a/packages/common/src/lib/badge-icon/badge-icon.module.ts +++ b/packages/common/src/lib/badge-icon/badge-icon.module.ts @@ -1,13 +1,13 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatIconModule } from '@angular/material/icon'; import { IgoBadgeIconDirective } from './badge-icon.directive'; +/** + * @deprecated import the IgoBadgeIconDirective directly + */ @NgModule({ - imports: [MatBadgeModule, MatIconModule], - declarations: [IgoBadgeIconDirective], - exports: [MatBadgeModule, IgoBadgeIconDirective] + imports: [IgoBadgeIconDirective], + exports: [IgoBadgeIconDirective] }) export class IgoMatBadgeIconModule { static forRoot(): ModuleWithProviders { diff --git a/packages/common/src/lib/clickout/clickout.directive.ts b/packages/common/src/lib/clickout/clickout.directive.ts index bbb45316a0..fd767cdbbc 100644 --- a/packages/common/src/lib/clickout/clickout.directive.ts +++ b/packages/common/src/lib/clickout/clickout.directive.ts @@ -7,7 +7,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[igoClickout]' + selector: '[igoClickout]', + standalone: true }) export class ClickoutDirective { @Output() clickout = new EventEmitter(); diff --git a/packages/common/src/lib/clickout/clickout.module.ts b/packages/common/src/lib/clickout/clickout.module.ts index 93c2bee2c9..70bb9b1b9d 100644 --- a/packages/common/src/lib/clickout/clickout.module.ts +++ b/packages/common/src/lib/clickout/clickout.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { ClickoutDirective } from './clickout.directive'; +/** + * @deprecated import the ClickoutDirective directly + */ @NgModule({ - imports: [], - declarations: [ClickoutDirective], + imports: [ClickoutDirective], exports: [ClickoutDirective] }) export class IgoClickoutModule { diff --git a/packages/common/src/lib/clone/clone.module.ts b/packages/common/src/lib/clone/clone.module.ts index 01b48538f5..1571bb3af2 100644 --- a/packages/common/src/lib/clone/clone.module.ts +++ b/packages/common/src/lib/clone/clone.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { ClonePipe } from './clone.pipe'; +/** + * @deprecated import the ClonePipe directly + */ @NgModule({ - imports: [], - declarations: [ClonePipe], + imports: [ClonePipe], exports: [ClonePipe] }) export class IgoCloneModule { diff --git a/packages/common/src/lib/clone/clone.pipe.ts b/packages/common/src/lib/clone/clone.pipe.ts index 83df1e28f9..6c379dab95 100644 --- a/packages/common/src/lib/clone/clone.pipe.ts +++ b/packages/common/src/lib/clone/clone.pipe.ts @@ -1,7 +1,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'clone' + name: 'clone', + standalone: true }) export class ClonePipe implements PipeTransform { transform(value: any, args?: any): any { diff --git a/packages/common/src/lib/collapsible/collapse.directive.ts b/packages/common/src/lib/collapsible/collapse.directive.ts index 54f38796cc..a940c90e75 100644 --- a/packages/common/src/lib/collapsible/collapse.directive.ts +++ b/packages/common/src/lib/collapsible/collapse.directive.ts @@ -9,7 +9,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[igoCollapse]' + selector: '[igoCollapse]', + standalone: true }) export class CollapseDirective { @Input() diff --git a/packages/common/src/lib/collapsible/collapsible.component.spec.ts b/packages/common/src/lib/collapsible/collapsible.component.spec.ts index cf931fa1d9..5d6fd60a72 100644 --- a/packages/common/src/lib/collapsible/collapsible.component.spec.ts +++ b/packages/common/src/lib/collapsible/collapsible.component.spec.ts @@ -12,8 +12,13 @@ describe('CollapsibleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [MatListModule, MatIconModule, MatIconTestingModule], - declarations: [CollapsibleComponent, CollapseDirective] + imports: [ + MatListModule, + MatIconModule, + MatIconTestingModule, + CollapsibleComponent, + CollapseDirective + ] }).compileComponents(); })); diff --git a/packages/common/src/lib/collapsible/collapsible.component.ts b/packages/common/src/lib/collapsible/collapsible.component.ts index c0805a364f..68f87dfb68 100644 --- a/packages/common/src/lib/collapsible/collapsible.component.ts +++ b/packages/common/src/lib/collapsible/collapsible.component.ts @@ -1,9 +1,15 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; + +import { CollapseDirective } from './collapse.directive'; @Component({ selector: 'igo-collapsible', templateUrl: './collapsible.component.html', - styleUrls: ['./collapsible.component.scss'] + styleUrls: ['./collapsible.component.scss'], + standalone: true, + imports: [MatListModule, MatIconModule, CollapseDirective] }) export class CollapsibleComponent { @Input() diff --git a/packages/common/src/lib/collapsible/collapsible.module.ts b/packages/common/src/lib/collapsible/collapsible.module.ts index ef08d9e9e2..3f608b0768 100644 --- a/packages/common/src/lib/collapsible/collapsible.module.ts +++ b/packages/common/src/lib/collapsible/collapsible.module.ts @@ -1,13 +1,13 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; import { CollapseDirective } from './collapse.directive'; import { CollapsibleComponent } from './collapsible.component'; +/** + * @deprecated import the components/directives directly or COLLAPSIBLE_DIRECTIVES for the set + */ @NgModule({ - imports: [MatIconModule, MatListModule], - declarations: [CollapsibleComponent, CollapseDirective], + imports: [CollapsibleComponent, CollapseDirective], exports: [CollapsibleComponent, CollapseDirective] }) export class IgoCollapsibleModule { diff --git a/packages/common/src/lib/collapsible/index.ts b/packages/common/src/lib/collapsible/index.ts index edcc6dc577..44459decfe 100644 --- a/packages/common/src/lib/collapsible/index.ts +++ b/packages/common/src/lib/collapsible/index.ts @@ -1,2 +1,10 @@ +import { CollapseDirective } from './collapse.directive'; +import { CollapsibleComponent } from './collapsible.component'; + export * from './collapsible.component'; export * from './collapse.directive'; + +export const COLLAPSIBLE_DIRECTIVES = [ + CollapsibleComponent, + CollapseDirective +] as const; diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts b/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts index 1c3a089e91..8419a3e602 100644 --- a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts +++ b/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts @@ -1,3 +1,4 @@ +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { Component, EventEmitter, @@ -6,8 +7,13 @@ import { forwardRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { TranslateModule } from '@ngx-translate/core'; import { ColorEvent } from 'ngx-color'; +import { ColorChromeModule } from 'ngx-color/chrome'; import tinycolor, { ColorInput } from 'tinycolor2'; type ColorFormat = 'hex' | 'rgba' | 'hsla'; @@ -22,6 +28,16 @@ type ColorFormat = 'hex' | 'rgba' | 'hsla'; useExisting: forwardRef(() => ColorPickerFormFieldComponent), multi: true } + ], + standalone: true, + imports: [ + MatFormFieldModule, + CdkOverlayOrigin, + MatInputModule, + CdkConnectedOverlay, + ColorChromeModule, + MatButtonModule, + TranslateModule ] }) export class ColorPickerFormFieldComponent implements ControlValueAccessor { diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts b/packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts index b3c369de1f..0055747543 100644 --- a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts +++ b/packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts @@ -1,30 +1,12 @@ -import { OverlayModule } from '@angular/cdk/overlay'; -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; - -import { IgoLanguageModule } from '@igo2/core'; - -import { ColorChromeModule } from 'ngx-color/chrome'; import { ColorPickerFormFieldComponent } from './color-picker-form-field.component'; +/** + * @deprecated import the ColorPickerFormFieldComponent directly + */ @NgModule({ - imports: [ - FormsModule, - MatButtonModule, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule, - CommonModule, - OverlayModule, - ColorChromeModule, - IgoLanguageModule - ], - declarations: [ColorPickerFormFieldComponent], + imports: [ColorPickerFormFieldComponent], exports: [ColorPickerFormFieldComponent] }) export class ColorPickerFormFieldModule {} diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts b/packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts index 709d1f00d2..6737e58578 100644 --- a/packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts +++ b/packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts @@ -1,10 +1,26 @@ import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; + +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'igo-confirm-dialog', templateUrl: './confirm-dialog.component.html', - styleUrls: ['./confirm-dialog.component.scss'] + styleUrls: ['./confirm-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + MatDialogActions, + MatButtonModule, + TranslateModule + ] }) export class ConfirmDialogComponent { public confirmMessage: string; diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts b/packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts index c753c28779..b9847578a7 100644 --- a/packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts +++ b/packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts @@ -1,19 +1,17 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; - -import { IgoLanguageModule } from '@igo2/core'; import { ConfirmDialogComponent } from './confirm-dialog.component'; import { ConfirmDialogService } from './confirm-dialog.service'; @NgModule({ - imports: [MatButtonModule, MatDialogModule, IgoLanguageModule], - declarations: [ConfirmDialogComponent], + imports: [ConfirmDialogComponent], exports: [ConfirmDialogComponent], providers: [ConfirmDialogService] }) export class IgoConfirmDialogModule { + /** + * @deprecated this has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoConfirmDialogModule, diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts b/packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts index e2276eff30..25c08517f3 100644 --- a/packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts +++ b/packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts @@ -6,7 +6,7 @@ import { Observable } from 'rxjs'; import { ConfirmDialogComponent } from './confirm-dialog.component'; import { ConfirmDialogOptions } from './confirm-dialog.interface'; -@Injectable() +@Injectable({ providedIn: 'root' }) export class ConfirmDialogService { constructor(private dialog: MatDialog) {} diff --git a/packages/common/src/lib/context-menu/context-menu.directive.ts b/packages/common/src/lib/context-menu/context-menu.directive.ts index eaca75e382..7ef5d1f874 100644 --- a/packages/common/src/lib/context-menu/context-menu.directive.ts +++ b/packages/common/src/lib/context-menu/context-menu.directive.ts @@ -15,7 +15,8 @@ import { Subscription, fromEvent } from 'rxjs'; import { filter, take } from 'rxjs/operators'; @Directive({ - selector: '[igoContextMenu]' + selector: '[igoContextMenu]', + standalone: true }) export class ContextMenuDirective { private overlayRef: OverlayRef | null; diff --git a/packages/common/src/lib/context-menu/context-menu.module.ts b/packages/common/src/lib/context-menu/context-menu.module.ts index ad4a929960..3cd6a601ec 100644 --- a/packages/common/src/lib/context-menu/context-menu.module.ts +++ b/packages/common/src/lib/context-menu/context-menu.module.ts @@ -3,9 +3,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { ContextMenuDirective } from './context-menu.directive'; import { LongPressDirective } from './long-press.directive'; +/** + * @deprecated import the components/directives directly or CONTEXT_MENU_DIRECTIVES for the set + */ @NgModule({ - imports: [], - declarations: [ContextMenuDirective, LongPressDirective], + imports: [ContextMenuDirective, LongPressDirective], exports: [ContextMenuDirective, LongPressDirective] }) export class IgoContextMenuModule { diff --git a/packages/common/src/lib/context-menu/index.ts b/packages/common/src/lib/context-menu/index.ts index 63e10b9f8a..d1758efc50 100644 --- a/packages/common/src/lib/context-menu/index.ts +++ b/packages/common/src/lib/context-menu/index.ts @@ -1,2 +1,10 @@ +import { ContextMenuDirective } from './context-menu.directive'; +import { LongPressDirective } from './long-press.directive'; + export * from './context-menu.directive'; export * from './long-press.directive'; + +export const CONTEXT_MENU_DIRECTIVES = [ + ContextMenuDirective, + LongPressDirective +] as const; diff --git a/packages/common/src/lib/context-menu/long-press.directive.ts b/packages/common/src/lib/context-menu/long-press.directive.ts index 2691b38e5c..841912b067 100644 --- a/packages/common/src/lib/context-menu/long-press.directive.ts +++ b/packages/common/src/lib/context-menu/long-press.directive.ts @@ -15,7 +15,8 @@ import { userAgent } from '@igo2/utils'; * @param iOSOnly define if longpress is triggered only for iOS, default value = true */ @Directive({ - selector: '[igoLongPress]' + selector: '[igoLongPress]', + standalone: true }) export class LongPressDirective { private touchTimeout: any; diff --git a/packages/common/src/lib/custom-html/custom-html.component.ts b/packages/common/src/lib/custom-html/custom-html.component.ts index b6655ae022..6b2a3ac197 100644 --- a/packages/common/src/lib/custom-html/custom-html.component.ts +++ b/packages/common/src/lib/custom-html/custom-html.component.ts @@ -1,9 +1,13 @@ import { Component, Input } from '@angular/core'; +import { SanitizeHtmlPipe } from './custom-html.pipe'; + @Component({ selector: 'igo-custom-html', templateUrl: './custom-html.component.html', - styleUrls: ['./custom-html.component.scss'] + styleUrls: ['./custom-html.component.scss'], + standalone: true, + imports: [SanitizeHtmlPipe] }) export class CustomHtmlComponent { @Input() diff --git a/packages/common/src/lib/custom-html/custom-html.module.ts b/packages/common/src/lib/custom-html/custom-html.module.ts index 49daa4cb41..744d68e8b4 100644 --- a/packages/common/src/lib/custom-html/custom-html.module.ts +++ b/packages/common/src/lib/custom-html/custom-html.module.ts @@ -1,26 +1,14 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { CustomHtmlComponent } from './custom-html.component'; import { SanitizeHtmlPipe } from './custom-html.pipe'; +/** + * @deprecated import the components/directives directly or CUSTOM_HTML_DIRECTIVES for the set + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatTooltipModule, - MatInputModule, - MatButtonModule, - IgoLanguageModule - ], - exports: [SanitizeHtmlPipe, CustomHtmlComponent], - declarations: [SanitizeHtmlPipe, CustomHtmlComponent] + imports: [SanitizeHtmlPipe, CustomHtmlComponent], + exports: [SanitizeHtmlPipe, CustomHtmlComponent] }) export class IgoCustomHtmlModule { static forRoot(): ModuleWithProviders { diff --git a/packages/common/src/lib/custom-html/custom-html.pipe.ts b/packages/common/src/lib/custom-html/custom-html.pipe.ts index 21d25a2faf..49ba71d112 100644 --- a/packages/common/src/lib/custom-html/custom-html.pipe.ts +++ b/packages/common/src/lib/custom-html/custom-html.pipe.ts @@ -1,7 +1,10 @@ import { Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; -@Pipe({ name: 'sanitizeHtml' }) +@Pipe({ + name: 'sanitizeHtml', + standalone: true +}) export class SanitizeHtmlPipe implements PipeTransform { constructor(private _sanitizer: DomSanitizer) {} transform(v: string): SafeHtml { diff --git a/packages/common/src/lib/custom-html/index.ts b/packages/common/src/lib/custom-html/index.ts index 3f70b5c048..434777eb4a 100644 --- a/packages/common/src/lib/custom-html/index.ts +++ b/packages/common/src/lib/custom-html/index.ts @@ -1,2 +1,10 @@ +import { CustomHtmlComponent } from './custom-html.component'; +import { SanitizeHtmlPipe } from './custom-html.pipe'; + export * from './custom-html.component'; export * from './custom-html.pipe'; + +export const CUSTOM_HTML_DIRECTIVES = [ + SanitizeHtmlPipe, + CustomHtmlComponent +] as const; diff --git a/packages/common/src/lib/dom/dom.module.ts b/packages/common/src/lib/dom/dom.module.ts index 7824e2df6a..27094ca588 100644 --- a/packages/common/src/lib/dom/dom.module.ts +++ b/packages/common/src/lib/dom/dom.module.ts @@ -2,10 +2,17 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { DOMService } from './dom.service'; +/** + * @deprecated it has no effect + */ + @NgModule({ providers: [DOMService] }) export class IgoDOMModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoDOMModule, diff --git a/packages/common/src/lib/drag-drop/drag-drop.directive.ts b/packages/common/src/lib/drag-drop/drag-drop.directive.ts index 19a9736fa6..7be4361881 100644 --- a/packages/common/src/lib/drag-drop/drag-drop.directive.ts +++ b/packages/common/src/lib/drag-drop/drag-drop.directive.ts @@ -8,7 +8,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[igoDragAndDrop]' + selector: '[igoDragAndDrop]', + standalone: true }) export class DragAndDropDirective { @Input() allowedExtensions: Array = []; diff --git a/packages/common/src/lib/drag-drop/drag-drop.module.ts b/packages/common/src/lib/drag-drop/drag-drop.module.ts index ebe0691323..1cf7c6ba9c 100644 --- a/packages/common/src/lib/drag-drop/drag-drop.module.ts +++ b/packages/common/src/lib/drag-drop/drag-drop.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { DragAndDropDirective } from './drag-drop.directive'; +/** + * @deprecated import the DragAndDropDirective directly + */ @NgModule({ - imports: [], - declarations: [DragAndDropDirective], + imports: [DragAndDropDirective], exports: [DragAndDropDirective] }) export class IgoDrapDropModule { diff --git a/packages/common/src/lib/dynamic-component/dynamic-component.module.ts b/packages/common/src/lib/dynamic-component/dynamic-component.module.ts index 52e3517f25..86b8910f5b 100644 --- a/packages/common/src/lib/dynamic-component/dynamic-component.module.ts +++ b/packages/common/src/lib/dynamic-component/dynamic-component.module.ts @@ -1,12 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoDynamicOutletModule } from './dynamic-outlet/dynamic-outlet.module'; -import { DynamicComponentService } from './shared/dynamic-component.service'; +import { DynamicOutletComponent } from './dynamic-outlet/dynamic-outlet.component'; +/** + * @deprecated import the DynamicOutletComponent directly + */ @NgModule({ - imports: [CommonModule, IgoDynamicOutletModule], - exports: [IgoDynamicOutletModule], - providers: [DynamicComponentService] + imports: [DynamicOutletComponent], + exports: [DynamicOutletComponent] }) export class IgoDynamicComponentModule {} diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts b/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts index 86265d6606..cf01352f3d 100644 --- a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts +++ b/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts @@ -19,7 +19,8 @@ import { DynamicComponentService } from '../shared/dynamic-component.service'; selector: 'igo-dynamic-outlet', templateUrl: 'dynamic-outlet.component.html', styleUrls: ['dynamic-outlet.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true }) export class DynamicOutletComponent implements OnChanges, OnDestroy { /** diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts b/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts index e3601a1a55..e0d50923d5 100644 --- a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts +++ b/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts @@ -1,14 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { DynamicOutletComponent } from './dynamic-outlet.component'; /** - * @ignore + * @deprecated import the DynamicOutletComponent directly */ @NgModule({ - imports: [CommonModule], - exports: [DynamicOutletComponent], - declarations: [DynamicOutletComponent] + imports: [DynamicOutletComponent], + exports: [DynamicOutletComponent] }) export class IgoDynamicOutletModule {} diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.component.ts b/packages/common/src/lib/entity/entity-selector/entity-selector.component.ts index 3263d92219..8edf4811fa 100644 --- a/packages/common/src/lib/entity/entity-selector/entity-selector.component.ts +++ b/packages/common/src/lib/entity/entity-selector/entity-selector.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -8,6 +9,9 @@ import { OnInit, Output } from '@angular/core'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; import { BehaviorSubject, Subscription } from 'rxjs'; @@ -20,7 +24,16 @@ import { EntityStoreWatcher } from '../shared/watcher'; selector: 'igo-entity-selector', templateUrl: './entity-selector.component.html', styleUrls: ['./entity-selector.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatSelectModule, + NgIf, + MatOptionModule, + NgFor, + AsyncPipe + ] }) export class EntitySelectorComponent implements OnInit, OnDestroy { /** diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.module.ts b/packages/common/src/lib/entity/entity-selector/entity-selector.module.ts index d4f1d8f79c..198e109d5e 100644 --- a/packages/common/src/lib/entity/entity-selector/entity-selector.module.ts +++ b/packages/common/src/lib/entity/entity-selector/entity-selector.module.ts @@ -1,16 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatSelectModule } from '@angular/material/select'; import { EntitySelectorComponent } from './entity-selector.component'; /** - * @ignore + * @deprecated import the EntitySelectorComponent directly */ @NgModule({ - imports: [CommonModule, FormsModule, MatSelectModule], - exports: [EntitySelectorComponent], - declarations: [EntitySelectorComponent] + imports: [EntitySelectorComponent], + exports: [EntitySelectorComponent] }) export class IgoEntitySelectorModule {} diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts b/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts index f5eacdd712..90e431a1cb 100644 --- a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts +++ b/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts @@ -8,7 +8,11 @@ import { Output, ViewChild } from '@angular/core'; -import { MatPaginator, PageEvent } from '@angular/material/paginator'; +import { + MatPaginator, + MatPaginatorModule, + PageEvent +} from '@angular/material/paginator'; import { LanguageService, MediaService } from '@igo2/core'; @@ -21,7 +25,9 @@ import { EntityTablePaginatorOptions } from './entity-table-paginator.interface' selector: 'igo-entity-table-paginator', templateUrl: './entity-table-paginator.component.html', styleUrls: ['./entity-table-paginator.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MatPaginatorModule] }) export class EntityTablePaginatorComponent implements OnChanges, OnDestroy { public disabled: boolean = false; diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts b/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts index 96f00d4f46..754cbac74f 100644 --- a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts +++ b/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts @@ -1,14 +1,12 @@ import { NgModule } from '@angular/core'; -import { MatPaginatorModule } from '@angular/material/paginator'; import { EntityTablePaginatorComponent } from './entity-table-paginator.component'; /** - * @ignore + * @deprecated import the EntityTablePaginatorComponent directly */ @NgModule({ - imports: [MatPaginatorModule], - exports: [EntityTablePaginatorComponent], - declarations: [EntityTablePaginatorComponent] + imports: [EntityTablePaginatorComponent], + exports: [EntityTablePaginatorComponent] }) export class IgoEntityTablePaginatorModule {} diff --git a/packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts b/packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts index fb830af19b..011acfdb8f 100644 --- a/packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts +++ b/packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts @@ -16,7 +16,8 @@ import { EntityTableScrollBehavior } from '../shared/entity.enums'; * Directive that handles an entity table row click and selection. */ @Directive({ - selector: '[igoEntityTableRow]' + selector: '[igoEntityTableRow]', + standalone: true }) export class EntityTableRowDirective { /** diff --git a/packages/common/src/lib/entity/entity-table/entity-table.component.ts b/packages/common/src/lib/entity/entity-table/entity-table.component.ts index 221b7d50d8..d9c70b21de 100644 --- a/packages/common/src/lib/entity/entity-table/entity-table.component.ts +++ b/packages/common/src/lib/entity/entity-table/entity-table.component.ts @@ -1,4 +1,5 @@ import { FocusMonitor } from '@angular/cdk/a11y'; +import { AsyncPipe, NgClass, NgFor, NgIf, NgStyle } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -17,22 +18,48 @@ import { } from '@angular/core'; import { FormControlName, + FormsModule, NgControl, NgForm, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { DateAdapter, ErrorStateMatcher } from '@angular/material/core'; -import { MatFormFieldControl } from '@angular/material/form-field'; +import { provideMomentDateAdapter } from '@angular/material-moment-adapter'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { + DateAdapter, + ErrorStateMatcher, + MatNativeDateModule, + MatOptionModule +} from '@angular/material/core'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { + MatFormFieldControl, + MatFormFieldModule +} from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; import { MatPaginator } from '@angular/material/paginator'; -import { MatTableDataSource } from '@angular/material/table'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSortModule } from '@angular/material/sort'; +import { MatTableDataSource, MatTableModule } from '@angular/material/table'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { StringUtils } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { default as moment } from 'moment'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { debounceTime, map } from 'rxjs/operators'; +import { SanitizeHtmlPipe } from '../../custom-html/custom-html.pipe'; +import { ImageErrorDirective } from '../../image/image-error.directive'; +import { SecureImagePipe } from '../../image/secure-image.pipe'; +import { StopPropagationDirective } from '../../stop-propagation/stop-propagation.directive'; +import { EntityTablePaginatorComponent } from '../entity-table-paginator/entity-table-paginator.component'; import { EntityTablePaginatorOptions } from '../entity-table-paginator/entity-table-paginator.interface'; import { EntityKey, @@ -45,6 +72,7 @@ import { EntityTableSelectionState, EntityTableTemplate } from '../shared'; +import { EntityTableRowDirective } from './entity-table-row.directive'; interface CellData { [key: string]: { @@ -66,7 +94,38 @@ interface RowData { styleUrls: ['./entity-table.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ - { provide: MatFormFieldControl, useExisting: EntityTableComponent } + { provide: MatFormFieldControl, useExisting: EntityTableComponent }, + provideMomentDateAdapter() + ], + standalone: true, + imports: [ + AsyncPipe, + EntityTablePaginatorComponent, + EntityTableRowDirective, + FormsModule, + ImageErrorDirective, + MatAutocompleteModule, + MatButtonModule, + MatCheckboxModule, + MatDatepickerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatNativeDateModule, // For the DateAdapter provider + MatOptionModule, + MatSelectModule, + MatSortModule, + MatTableModule, + MatTooltipModule, + NgClass, + NgFor, + NgIf, + NgStyle, + ReactiveFormsModule, + SanitizeHtmlPipe, + SecureImagePipe, + StopPropagationDirective, + TranslateModule ] }) export class EntityTableComponent implements OnInit, OnChanges, OnDestroy { diff --git a/packages/common/src/lib/entity/entity-table/entity-table.module.ts b/packages/common/src/lib/entity/entity-table/entity-table.module.ts index 40bb9cc304..81606ed140 100644 --- a/packages/common/src/lib/entity/entity-table/entity-table.module.ts +++ b/packages/common/src/lib/entity/entity-table/entity-table.module.ts @@ -1,55 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatNativeDateModule } from '@angular/material/core'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatPaginatorModule } from '@angular/material/paginator'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSortModule } from '@angular/material/sort'; -import { MatTableModule } from '@angular/material/table'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoCustomHtmlModule } from '../../custom-html/custom-html.module'; -import { IgoImageModule } from '../../image/image.module'; -import { IgoStopPropagationModule } from '../../stop-propagation/stop-propagation.module'; -import { IgoEntityTablePaginatorModule } from '../entity-table-paginator/entity-table-paginator.module'; -import { EntityTableRowDirective } from './entity-table-row.directive'; import { EntityTableComponent } from './entity-table.component'; /** - * @ignore + * @deprecated import the EntityTableComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatTableModule, - MatAutocompleteModule, - MatSortModule, - MatIconModule, - MatButtonModule, - MatCheckboxModule, - MatPaginatorModule, - MatSelectModule, - IgoStopPropagationModule, - IgoCustomHtmlModule, - IgoEntityTablePaginatorModule, - IgoImageModule, - IgoLanguageModule, - FormsModule, - ReactiveFormsModule, - MatInputModule, - MatDatepickerModule, - MatTooltipModule, - MatNativeDateModule - ], - exports: [EntityTableComponent], - declarations: [EntityTableComponent, EntityTableRowDirective] + imports: [EntityTableComponent], + exports: [EntityTableComponent] }) export class IgoEntityTableModule {} diff --git a/packages/common/src/lib/entity/entity.module.ts b/packages/common/src/lib/entity/entity.module.ts index 1bbb47956b..706da2512e 100644 --- a/packages/common/src/lib/entity/entity.module.ts +++ b/packages/common/src/lib/entity/entity.module.ts @@ -1,17 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoEntitySelectorModule } from './entity-selector/entity-selector.module'; -import { IgoEntityTablePaginatorModule } from './entity-table-paginator/entity-table-paginator.module'; -import { IgoEntityTableModule } from './entity-table/entity-table.module'; +import { ENTITY_DIRECTIVES } from '.'; +/** + * @deprecated import the components directly or ENTITY_DIRECTIVES for every components/directives + */ @NgModule({ - imports: [CommonModule], - exports: [ - IgoEntitySelectorModule, - IgoEntityTableModule, - IgoEntityTablePaginatorModule - ], - declarations: [] + imports: [...ENTITY_DIRECTIVES], + exports: [...ENTITY_DIRECTIVES] }) export class IgoEntityModule {} diff --git a/packages/common/src/lib/entity/index.ts b/packages/common/src/lib/entity/index.ts index e8c8a0e01d..8e79a24ed4 100644 --- a/packages/common/src/lib/entity/index.ts +++ b/packages/common/src/lib/entity/index.ts @@ -1,5 +1,15 @@ +import { EntitySelectorComponent } from './entity-selector/entity-selector.component'; +import { EntityTablePaginatorComponent } from './entity-table-paginator'; +import { EntityTableComponent } from './entity-table/entity-table.component'; + export * from './shared'; export * from './entity-selector/entity-selector.component'; export * from './entity-table/entity-table.component'; export * from './entity-table-paginator/entity-table-paginator.component'; export * from './entity-table-paginator/entity-table-paginator.interface'; + +export const ENTITY_DIRECTIVES = [ + EntitySelectorComponent, + EntityTableComponent, + EntityTablePaginatorComponent +] as const; diff --git a/packages/common/src/lib/flexible/flexible.component.spec.ts b/packages/common/src/lib/flexible/flexible.component.spec.ts index 2ff4394c55..9f4b1e02ce 100644 --- a/packages/common/src/lib/flexible/flexible.component.spec.ts +++ b/packages/common/src/lib/flexible/flexible.component.spec.ts @@ -10,7 +10,7 @@ describe('FlexibleComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [FlexibleComponent], + imports: [FlexibleComponent], providers: [MediaService] }).compileComponents(); })); diff --git a/packages/common/src/lib/flexible/flexible.component.ts b/packages/common/src/lib/flexible/flexible.component.ts index 01dbd728bf..a987469a98 100644 --- a/packages/common/src/lib/flexible/flexible.component.ts +++ b/packages/common/src/lib/flexible/flexible.component.ts @@ -16,7 +16,8 @@ import { FlexibleDirection, FlexibleState } from './flexible.type'; @Component({ selector: 'igo-flexible', templateUrl: './flexible.component.html', - styleUrls: ['./flexible.component.scss'] + styleUrls: ['./flexible.component.scss'], + standalone: true }) export class FlexibleComponent implements OnInit, OnDestroy { static transitionTime = 250; diff --git a/packages/common/src/lib/flexible/flexible.module.ts b/packages/common/src/lib/flexible/flexible.module.ts index de09742e4a..1064c6a9ed 100644 --- a/packages/common/src/lib/flexible/flexible.module.ts +++ b/packages/common/src/lib/flexible/flexible.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { FlexibleComponent } from './flexible.component'; +/** + * @deprecated import the FlexibleComponent directly + */ @NgModule({ - imports: [], - declarations: [FlexibleComponent], + imports: [FlexibleComponent], exports: [FlexibleComponent] }) export class IgoFlexibleModule { diff --git a/packages/common/src/lib/form-dialog/form-dialog.component.ts b/packages/common/src/lib/form-dialog/form-dialog.component.ts index c6dacb518a..ee32b893e2 100644 --- a/packages/common/src/lib/form-dialog/form-dialog.component.ts +++ b/packages/common/src/lib/form-dialog/form-dialog.component.ts @@ -1,10 +1,22 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component, Inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; import { LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; +import { CustomHtmlComponent } from '../custom-html/custom-html.component'; +import { FormFieldComponent } from '../form/form-field/form-field.component'; +import { FormGroupComponent } from '../form/form-group/form-group.component'; +import { FormComponent } from '../form/form/form.component'; import { Form, FormField, @@ -17,7 +29,21 @@ import { FormDialogData } from './form-dialog.interface'; @Component({ selector: 'igo-form-dialog', templateUrl: './form-dialog.component.html', - styleUrls: ['./form-dialog.component.scss'] + styleUrls: ['./form-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + NgIf, + FormComponent, + NgFor, + FormFieldComponent, + FormGroupComponent, + MatDialogActions, + MatButtonModule, + CustomHtmlComponent, + AsyncPipe, + TranslateModule + ] }) export class FormDialogComponent { form$ = new BehaviorSubject
(undefined); diff --git a/packages/common/src/lib/form-dialog/form-dialog.module.ts b/packages/common/src/lib/form-dialog/form-dialog.module.ts index 94196eea29..e33ca9772c 100644 --- a/packages/common/src/lib/form-dialog/form-dialog.module.ts +++ b/packages/common/src/lib/form-dialog/form-dialog.module.ts @@ -1,31 +1,21 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoCustomHtmlModule } from '../custom-html/custom-html.module'; -import { IgoFormModule } from '../form/form.module'; import { FormDialogComponent } from './form-dialog.component'; import { FormDialogService } from './form-dialog.service'; +/** + * @deprecated import the FlexibleComponent directly + */ @NgModule({ - imports: [ - CommonModule, - MatButtonModule, - MatDialogModule, - IgoCustomHtmlModule, - IgoLanguageModule, - IgoFormModule, - MatDividerModule - ], - declarations: [FormDialogComponent], + imports: [MatDialogModule, FormDialogComponent], exports: [FormDialogComponent], providers: [FormDialogService] }) export class IgoFormDialogModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoFormDialogModule, diff --git a/packages/common/src/lib/form/form-field/form-field-select.component.ts b/packages/common/src/lib/form/form-field/form-field-select.component.ts index b7deb91c35..0279f3a99a 100644 --- a/packages/common/src/lib/form/form-field/form-field-select.component.ts +++ b/packages/common/src/lib/form/form-field/form-field-select.component.ts @@ -1,11 +1,18 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import type { UntypedFormControl } from '@angular/forms'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSelectModule } from '@angular/material/select'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { IgoFormFieldComponent } from '../shared/form-field-component'; @@ -22,7 +29,20 @@ import { @Component({ selector: 'igo-form-field-select', templateUrl: './form-field-select.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatSelectModule, + FormsModule, + ReactiveFormsModule, + NgFor, + MatOptionModule, + NgIf, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class FormFieldSelectComponent implements OnInit { readonly disabled$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/common/src/lib/form/form-field/form-field-text.component.ts b/packages/common/src/lib/form/form-field/form-field-text.component.ts index 52729bcd0a..f0af385764 100644 --- a/packages/common/src/lib/form/form-field/form-field-text.component.ts +++ b/packages/common/src/lib/form/form-field/form-field-text.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -5,8 +6,14 @@ import { Input, OnInit } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import type { UntypedFormControl } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { IgoFormFieldComponent } from '../shared/form-field-component'; @@ -22,7 +29,19 @@ import { @Component({ selector: 'igo-form-field-text', templateUrl: './form-field-text.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + FormsModule, + ReactiveFormsModule, + NgIf, + MatIconModule, + MatButtonModule, + AsyncPipe, + TranslateModule + ] }) export class FormFieldTextComponent implements OnInit { disabled$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/common/src/lib/form/form-field/form-field-textarea.component.ts b/packages/common/src/lib/form/form-field/form-field-textarea.component.ts index c174d4514a..9cc9729797 100644 --- a/packages/common/src/lib/form/form-field/form-field-textarea.component.ts +++ b/packages/common/src/lib/form/form-field/form-field-textarea.component.ts @@ -1,11 +1,17 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import type { UntypedFormControl } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { IgoFormFieldComponent } from '../shared/form-field-component'; @@ -21,7 +27,18 @@ import { @Component({ selector: 'igo-form-field-textarea', templateUrl: './form-field-textarea.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + FormsModule, + ReactiveFormsModule, + NgIf, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class FormFieldTextareaComponent implements OnInit { disabled$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/common/src/lib/form/form-field/form-field.component.ts b/packages/common/src/lib/form/form-field/form-field.component.ts index b1612a7a4a..cf340ea577 100644 --- a/packages/common/src/lib/form/form-field/form-field.component.ts +++ b/packages/common/src/lib/form/form-field/form-field.component.ts @@ -1,5 +1,7 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { DynamicOutletComponent } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.component'; import { getDefaultErrorMessages } from '../shared'; import { FormFieldService } from '../shared/form-field.service'; import { @@ -17,7 +19,9 @@ import { selector: 'igo-form-field', templateUrl: './form-field.component.html', styleUrls: ['./form-field.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, DynamicOutletComponent] }) export class FormFieldComponent { /** diff --git a/packages/common/src/lib/form/form-field/form-field.module.ts b/packages/common/src/lib/form/form-field/form-field.module.ts index 26c454bb4e..d875b1c736 100644 --- a/packages/common/src/lib/form/form-field/form-field.module.ts +++ b/packages/common/src/lib/form/form-field/form-field.module.ts @@ -1,47 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoDynamicOutletModule } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.module'; -import { FormFieldSelectComponent } from './form-field-select.component'; -import { FormFieldTextComponent } from './form-field-text.component'; -import { FormFieldTextareaComponent } from './form-field-textarea.component'; -import { FormFieldComponent } from './form-field.component'; +import { FORM_FIELD_DIRECTIVES } from '.'; /** - * @ignore + * @deprecated import the components directly or FORM_FIELD_DIRECTIVES for every components/directives */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MatIconModule, - MatFormFieldModule, - MatInputModule, - MatSelectModule, - IgoLanguageModule, - IgoDynamicOutletModule, - MatButtonModule - ], - exports: [ - FormFieldComponent, - FormFieldSelectComponent, - FormFieldTextComponent, - FormFieldTextareaComponent - ], - declarations: [ - FormFieldComponent, - FormFieldSelectComponent, - FormFieldTextComponent, - FormFieldTextareaComponent - ] + imports: [...FORM_FIELD_DIRECTIVES], + exports: [...FORM_FIELD_DIRECTIVES] }) export class IgoFormFieldModule {} diff --git a/packages/common/src/lib/form/form-field/index.ts b/packages/common/src/lib/form/form-field/index.ts index 44f0dfefd4..335b995feb 100644 --- a/packages/common/src/lib/form/form-field/index.ts +++ b/packages/common/src/lib/form/form-field/index.ts @@ -1,4 +1,16 @@ +import { FormFieldSelectComponent } from './form-field-select.component'; +import { FormFieldTextComponent } from './form-field-text.component'; +import { FormFieldTextareaComponent } from './form-field-textarea.component'; +import { FormFieldComponent } from './form-field.component'; + export * from './form-field.component'; export * from './form-field-text.component'; export * from './form-field-select.component'; export * from './form-field-textarea.component'; + +export const FORM_FIELD_DIRECTIVES = [ + FormFieldComponent, + FormFieldSelectComponent, + FormFieldTextComponent, + FormFieldTextareaComponent +] as const; diff --git a/packages/common/src/lib/form/form-group/form-group.component.ts b/packages/common/src/lib/form/form-group/form-group.component.ts index dfb44c2d3d..eab892a07b 100644 --- a/packages/common/src/lib/form/form-group/form-group.component.ts +++ b/packages/common/src/lib/form/form-group/form-group.component.ts @@ -1,6 +1,11 @@ +import { NgClass, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { TranslateModule } from '@ngx-translate/core'; + +import { FormFieldComponent } from '../form-field/form-field.component'; import { FormField, FormFieldGroup } from '../shared/form.interfaces'; import { getControlErrorMessage } from '../shared/form.utils'; @@ -13,7 +18,16 @@ import { getControlErrorMessage } from '../shared/form.utils'; selector: 'igo-form-group', templateUrl: './form-group.component.html', styleUrls: ['./form-group.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + NgFor, + NgClass, + FormFieldComponent, + MatFormFieldModule, + TranslateModule + ] }) export class FormGroupComponent { /** diff --git a/packages/common/src/lib/form/form-group/form-group.module.ts b/packages/common/src/lib/form/form-group/form-group.module.ts index 2baaa6e8e3..9351d3753e 100644 --- a/packages/common/src/lib/form/form-group/form-group.module.ts +++ b/packages/common/src/lib/form/form-group/form-group.module.ts @@ -1,23 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoFormFieldModule } from '../form-field/form-field.module'; import { FormGroupComponent } from './form-group.component'; /** - * @ignore + * @deprecated import the FormGroupComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatFormFieldModule, - IgoLanguageModule, - IgoFormFieldModule - ], - exports: [FormGroupComponent], - declarations: [FormGroupComponent] + imports: [FormGroupComponent], + exports: [FormGroupComponent] }) export class IgoFormGroupModule {} diff --git a/packages/common/src/lib/form/form.module.ts b/packages/common/src/lib/form/form.module.ts index b1722f2b97..45a75d7c10 100644 --- a/packages/common/src/lib/form/form.module.ts +++ b/packages/common/src/lib/form/form.module.ts @@ -1,19 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoFormFieldModule } from './form-field/form-field.module'; -import { IgoFormGroupModule } from './form-group/form-group.module'; -import { IgoFormFormModule } from './form/form.module'; -import { FormFieldService } from './shared/form-field.service'; -import { FormService } from './shared/form.service'; +import { FORM_DIRECTIVES } from '.'; /** - * @ignore + * @deprecated import the components directly or FORM_DIRECTIVES for every components/directives */ @NgModule({ - imports: [CommonModule, IgoFormGroupModule, IgoFormFieldModule], - exports: [IgoFormFormModule, IgoFormGroupModule, IgoFormFieldModule], - declarations: [], - providers: [FormService, FormFieldService] + imports: [...FORM_DIRECTIVES], + exports: [...FORM_DIRECTIVES] }) export class IgoFormModule {} diff --git a/packages/common/src/lib/form/form/form.component.ts b/packages/common/src/lib/form/form/form.component.ts index ede00759c8..dbb8152c5b 100644 --- a/packages/common/src/lib/form/form/form.component.ts +++ b/packages/common/src/lib/form/form/form.component.ts @@ -1,3 +1,4 @@ +import { NgClass } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -9,6 +10,7 @@ import { SimpleChanges, ViewChild } from '@angular/core'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { t } from 'typy'; @@ -22,7 +24,9 @@ import { getAllFormFields } from '../shared/form.utils'; selector: 'igo-form', templateUrl: './form.component.html', styleUrls: ['./form.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [FormsModule, ReactiveFormsModule, NgClass] }) export class FormComponent implements OnChanges { /** diff --git a/packages/common/src/lib/form/form/form.module.ts b/packages/common/src/lib/form/form/form.module.ts index 2b97def395..331aaf98b6 100644 --- a/packages/common/src/lib/form/form/form.module.ts +++ b/packages/common/src/lib/form/form/form.module.ts @@ -1,15 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormComponent } from './form.component'; /** - * @ignore + * @deprecated import the FormComponent directly */ @NgModule({ - imports: [CommonModule, FormsModule, ReactiveFormsModule], - exports: [FormComponent, FormsModule, ReactiveFormsModule], - declarations: [FormComponent] + imports: [FormComponent], + exports: [FormComponent] }) export class IgoFormFormModule {} diff --git a/packages/common/src/lib/form/index.ts b/packages/common/src/lib/form/index.ts index 1af27c3c14..8fae354d35 100644 --- a/packages/common/src/lib/form/index.ts +++ b/packages/common/src/lib/form/index.ts @@ -1,4 +1,14 @@ +import { FORM_FIELD_DIRECTIVES } from './form-field'; +import { FormGroupComponent } from './form-group/form-group.component'; +import { FormComponent } from './form/form.component'; + export * from './shared'; export * from './form-group/form-group.component'; export * from './form-field'; export * from './form/form.component'; + +export const FORM_DIRECTIVES = [ + ...FORM_FIELD_DIRECTIVES, + FormGroupComponent, + FormComponent +] as const; diff --git a/packages/common/src/lib/home-button/home-button.component.ts b/packages/common/src/lib/home-button/home-button.component.ts index 62e93d1c52..a6a128ba66 100644 --- a/packages/common/src/lib/home-button/home-button.component.ts +++ b/packages/common/src/lib/home-button/home-button.component.ts @@ -1,9 +1,16 @@ import { Component, EventEmitter, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'igo-home-button', templateUrl: './home-button.component.html', - styleUrls: ['./home-button.component.scss'] + styleUrls: ['./home-button.component.scss'], + standalone: true, + imports: [MatButtonModule, MatTooltipModule, MatIconModule, TranslateModule] }) export class HomeButtonComponent { @Output() unselectButton = new EventEmitter(); diff --git a/packages/common/src/lib/home-button/home-button.module.ts b/packages/common/src/lib/home-button/home-button.module.ts index d4f86e107d..c602f30bdc 100644 --- a/packages/common/src/lib/home-button/home-button.module.ts +++ b/packages/common/src/lib/home-button/home-button.module.ts @@ -1,26 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { HomeButtonComponent } from './home-button.component'; /** - * @ignore + * @deprecated import the HomeButtonComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - IgoLanguageModule - ], - exports: [HomeButtonComponent], - declarations: [HomeButtonComponent], - providers: [] + imports: [HomeButtonComponent], + exports: [HomeButtonComponent] }) export class IgoHomeButtonModule {} diff --git a/packages/common/src/lib/image/image-error.directive.ts b/packages/common/src/lib/image/image-error.directive.ts index 52b25320da..8ab184e40f 100644 --- a/packages/common/src/lib/image/image-error.directive.ts +++ b/packages/common/src/lib/image/image-error.directive.ts @@ -1,7 +1,8 @@ import { Directive, ElementRef, HostListener, Input } from '@angular/core'; @Directive({ - selector: '[igoImageError]' + selector: '[igoImageError]', + standalone: true }) export class ImageErrorDirective { @Input() errorImageUrl: string = './assets/igo2/common/images/na.png'; diff --git a/packages/common/src/lib/image/image.module.ts b/packages/common/src/lib/image/image.module.ts index da4dd2b4f3..64e65df7c6 100644 --- a/packages/common/src/lib/image/image.module.ts +++ b/packages/common/src/lib/image/image.module.ts @@ -3,9 +3,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { ImageErrorDirective } from './image-error.directive'; import { SecureImagePipe } from './secure-image.pipe'; +/** + * @deprecated import the components/directives directly or IMAGE_DIRECTIVES for the set + */ @NgModule({ - imports: [], - declarations: [SecureImagePipe, ImageErrorDirective], + imports: [SecureImagePipe, ImageErrorDirective], exports: [SecureImagePipe, ImageErrorDirective] }) export class IgoImageModule { diff --git a/packages/common/src/lib/image/index.ts b/packages/common/src/lib/image/index.ts index 097cfc3bdf..893c15263e 100644 --- a/packages/common/src/lib/image/index.ts +++ b/packages/common/src/lib/image/index.ts @@ -1,2 +1,7 @@ +import { ImageErrorDirective } from './image-error.directive'; +import { SecureImagePipe } from './secure-image.pipe'; + export * from './image-error.directive'; export * from './secure-image.pipe'; + +export const IMAGE_DIRECTIVES = [SecureImagePipe, ImageErrorDirective] as const; diff --git a/packages/common/src/lib/image/secure-image.pipe.ts b/packages/common/src/lib/image/secure-image.pipe.ts index cab1dce082..5dd4290879 100644 --- a/packages/common/src/lib/image/secure-image.pipe.ts +++ b/packages/common/src/lib/image/secure-image.pipe.ts @@ -8,7 +8,8 @@ import { catchError, switchMap } from 'rxjs/operators'; import { Cacheable } from 'ts-cacheable'; @Pipe({ - name: 'secureImage' + name: 'secureImage', + standalone: true }) export class SecureImagePipe implements PipeTransform { constructor( diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.component.ts b/packages/common/src/lib/interactive-tour/interactive-tour.component.ts index 33d8ac63d3..a4364f96c6 100644 --- a/packages/common/src/lib/interactive-tour/interactive-tour.component.ts +++ b/packages/common/src/lib/interactive-tour/interactive-tour.component.ts @@ -1,5 +1,10 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { Component, Input, ViewEncapsulation } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; import { ToolService } from '../tool/shared/tool.service'; @@ -9,7 +14,17 @@ import { InteractiveTourService } from './interactive-tour.service'; selector: 'igo-interactive-tour', templateUrl: './interactive-tour.component.html', styleUrls: ['./interactive-tour.component.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + NgClass, + MatTooltipModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class InteractiveTourComponent { /** diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.module.ts b/packages/common/src/lib/interactive-tour/interactive-tour.module.ts index 95ba2ac9a1..359d96f7fe 100644 --- a/packages/common/src/lib/interactive-tour/interactive-tour.module.ts +++ b/packages/common/src/lib/interactive-tour/interactive-tour.module.ts @@ -1,25 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { InteractiveTourComponent } from './interactive-tour.component'; import { InteractiveTourLoader } from './interactive-tour.loader'; import { InteractiveTourService } from './interactive-tour.service'; @NgModule({ - declarations: [InteractiveTourComponent], - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - IgoLanguageModule - ], - providers: [InteractiveTourService, InteractiveTourLoader], - exports: [InteractiveTourComponent] + imports: [InteractiveTourComponent], + exports: [InteractiveTourComponent], + providers: [InteractiveTourService, InteractiveTourLoader] }) export class IgoInteractiveTourModule {} diff --git a/packages/common/src/lib/json-dialog/json-dialog.component.ts b/packages/common/src/lib/json-dialog/json-dialog.component.ts index bcddd7feb0..eb67d1e09a 100644 --- a/packages/common/src/lib/json-dialog/json-dialog.component.ts +++ b/packages/common/src/lib/json-dialog/json-dialog.component.ts @@ -1,9 +1,27 @@ +import { KeyValuePipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; @Component({ selector: 'igo-json-dialog', - templateUrl: './json-dialog.component.html' + templateUrl: './json-dialog.component.html', + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + NgTemplateOutlet, + NgFor, + NgIf, + MatDialogActions, + MatButtonModule, + KeyValuePipe + ] }) export class JsonDialogComponent { public title: string; diff --git a/packages/common/src/lib/json-dialog/json-dialog.module.ts b/packages/common/src/lib/json-dialog/json-dialog.module.ts index f41288cb6f..724b7ec6d9 100644 --- a/packages/common/src/lib/json-dialog/json-dialog.module.ts +++ b/packages/common/src/lib/json-dialog/json-dialog.module.ts @@ -1,19 +1,17 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { IgoKeyValueModule } from '../keyvalue/keyvalue.module'; import { JsonDialogComponent } from './json-dialog.component'; import { JsonDialogService } from './json-dialog.service'; @NgModule({ - imports: [CommonModule, MatButtonModule, MatDialogModule, IgoKeyValueModule], + imports: [JsonDialogComponent], exports: [JsonDialogComponent], - declarations: [JsonDialogComponent], providers: [JsonDialogService] }) export class IgoJsonDialogModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoJsonDialogModule diff --git a/packages/common/src/lib/keyvalue/keyvalue.module.ts b/packages/common/src/lib/keyvalue/keyvalue.module.ts index b114cbdbfc..8904175a90 100644 --- a/packages/common/src/lib/keyvalue/keyvalue.module.ts +++ b/packages/common/src/lib/keyvalue/keyvalue.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { KeyValuePipe } from './keyvalue.pipe'; +/** + * @deprecated import the KeyValuePipe directly + */ @NgModule({ - imports: [], - declarations: [KeyValuePipe], + imports: [KeyValuePipe], exports: [KeyValuePipe] }) export class IgoKeyValueModule { diff --git a/packages/common/src/lib/keyvalue/keyvalue.pipe.ts b/packages/common/src/lib/keyvalue/keyvalue.pipe.ts index d436858c83..66dc1b3b3f 100644 --- a/packages/common/src/lib/keyvalue/keyvalue.pipe.ts +++ b/packages/common/src/lib/keyvalue/keyvalue.pipe.ts @@ -1,7 +1,8 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ - name: 'keyvalue' + name: 'keyvalue', + standalone: true }) export class KeyValuePipe implements PipeTransform { transform(value: any, args?: any): any { diff --git a/packages/common/src/lib/list/index.ts b/packages/common/src/lib/list/index.ts index 62bc865853..608555f905 100644 --- a/packages/common/src/lib/list/index.ts +++ b/packages/common/src/lib/list/index.ts @@ -1,2 +1,7 @@ +import { ListItemDirective } from './list-item.directive'; +import { ListComponent } from './list.component'; + export * from './list.component'; export * from './list-item.directive'; + +export const LIST_DIRECTIVES = [ListItemDirective, ListComponent] as const; diff --git a/packages/common/src/lib/list/list-item.directive.ts b/packages/common/src/lib/list/list-item.directive.ts index 1f1fc3f3b0..4130cc773f 100644 --- a/packages/common/src/lib/list/list-item.directive.ts +++ b/packages/common/src/lib/list/list-item.directive.ts @@ -9,7 +9,8 @@ import { } from '@angular/core'; @Directive({ - selector: '[igoListItem]' + selector: '[igoListItem]', + standalone: true }) export class ListItemDirective { static focusedCls = 'igo-list-item-focused'; diff --git a/packages/common/src/lib/list/list.component.spec.ts b/packages/common/src/lib/list/list.component.spec.ts index 17cd51542c..3eaa5d2e4d 100644 --- a/packages/common/src/lib/list/list.component.spec.ts +++ b/packages/common/src/lib/list/list.component.spec.ts @@ -9,8 +9,7 @@ describe('ListComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [MatListModule], - declarations: [ListComponent] + imports: [MatListModule, ListComponent] }).compileComponents(); })); diff --git a/packages/common/src/lib/list/list.component.ts b/packages/common/src/lib/list/list.component.ts index 4ba66d9e48..c747664455 100644 --- a/packages/common/src/lib/list/list.component.ts +++ b/packages/common/src/lib/list/list.component.ts @@ -1,3 +1,4 @@ +import { NgClass } from '@angular/common'; import { AfterViewInit, Component, @@ -9,15 +10,19 @@ import { OnInit } from '@angular/core'; import type { QueryList } from '@angular/core'; +import { MatListModule } from '@angular/material/list'; import { Subscription } from 'rxjs'; +import { ClickoutDirective } from '../clickout/clickout.directive'; import { ListItemDirective } from './list-item.directive'; @Component({ selector: 'igo-list', templateUrl: './list.component.html', - styleUrls: ['./list.component.scss'] + styleUrls: ['./list.component.scss'], + standalone: true, + imports: [MatListModule, ClickoutDirective, NgClass] }) export class ListComponent implements AfterViewInit, OnInit, OnDestroy { @Input() diff --git a/packages/common/src/lib/list/list.module.ts b/packages/common/src/lib/list/list.module.ts index 84425ed80b..578fd30ac0 100644 --- a/packages/common/src/lib/list/list.module.ts +++ b/packages/common/src/lib/list/list.module.ts @@ -1,15 +1,13 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { IgoClickoutModule } from '../clickout/clickout.module'; import { ListItemDirective } from './list-item.directive'; import { ListComponent } from './list.component'; +/** + * @deprecated import the components/directives directly or LIST_DIRECTIVES for the set + */ @NgModule({ - imports: [CommonModule, MatIconModule, MatListModule, IgoClickoutModule], - declarations: [ListItemDirective, ListComponent], + imports: [ListItemDirective, ListComponent], exports: [ListItemDirective, ListComponent] }) export class IgoListModule { diff --git a/packages/common/src/lib/panel/panel.component.spec.ts b/packages/common/src/lib/panel/panel.component.spec.ts index b052aaf13a..26d5bf4377 100644 --- a/packages/common/src/lib/panel/panel.component.spec.ts +++ b/packages/common/src/lib/panel/panel.component.spec.ts @@ -8,7 +8,7 @@ describe('PanelComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [PanelComponent] + imports: [PanelComponent] }).compileComponents(); })); diff --git a/packages/common/src/lib/panel/panel.component.ts b/packages/common/src/lib/panel/panel.component.ts index 48acfdaa12..e7d1db7c3a 100644 --- a/packages/common/src/lib/panel/panel.component.ts +++ b/packages/common/src/lib/panel/panel.component.ts @@ -1,3 +1,4 @@ +import { NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -9,7 +10,9 @@ import { selector: 'igo-panel', templateUrl: './panel.component.html', styleUrls: ['./panel.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, NgClass] }) export class PanelComponent { @Input() title: string; diff --git a/packages/common/src/lib/panel/panel.module.ts b/packages/common/src/lib/panel/panel.module.ts index b9c2a6a64b..d1f07cf62d 100644 --- a/packages/common/src/lib/panel/panel.module.ts +++ b/packages/common/src/lib/panel/panel.module.ts @@ -1,11 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { PanelComponent } from './panel.component'; +/** + * @deprecated import the PanelComponent directly + */ @NgModule({ - imports: [CommonModule], - exports: [PanelComponent], - declarations: [PanelComponent] + imports: [PanelComponent], + exports: [PanelComponent] }) export class IgoPanelModule {} diff --git a/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts b/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts index 4a9dc77826..0242b8bbb7 100644 --- a/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts +++ b/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts @@ -1,10 +1,24 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component, Inject, OnInit, Optional } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { MatRadioChange } from '@angular/material/radio'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatRadioChange, MatRadioModule } from '@angular/material/radio'; import { LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { SelectValueDialogType } from './select-value-dialog.enums'; @@ -13,7 +27,21 @@ import { SelectValueData } from './select-value-dialog.interface'; @Component({ selector: 'igo-select-value-check-radio-dialog', templateUrl: './select-value-check-radio-dialog.component.html', - styleUrls: ['./select-value-check-radio-dialog.component.scss'] + styleUrls: ['./select-value-check-radio-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + FormsModule, + ReactiveFormsModule, + NgIf, + NgFor, + MatCheckboxModule, + MatRadioModule, + MatDialogActions, + MatButtonModule, + AsyncPipe, + TranslateModule + ] }) export class SelectValueCheckRadioDialogComponent implements OnInit { public formGroup: UntypedFormGroup; diff --git a/packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts b/packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts index 32c80ed226..0a6c0aa0dc 100644 --- a/packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts +++ b/packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts @@ -1,34 +1,17 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatRadioModule } from '@angular/material/radio'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoFormModule } from '../form/form.module'; import { SelectValueCheckRadioDialogComponent } from './select-value-check-radio-dialog.component'; import { SelectValueDialogService } from './select-value-dialog.service'; @NgModule({ - imports: [ - CommonModule, - MatCheckboxModule, - MatButtonModule, - MatRadioModule, - FormsModule, - MatDialogModule, - ReactiveFormsModule, - IgoLanguageModule, - IgoFormModule - ], - declarations: [SelectValueCheckRadioDialogComponent], + imports: [SelectValueCheckRadioDialogComponent], exports: [SelectValueCheckRadioDialogComponent], providers: [SelectValueDialogService] }) export class IgoSelectValueDialogModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoSelectValueDialogModule, diff --git a/packages/common/src/lib/sidenav/sidenav-shim.directive.ts b/packages/common/src/lib/sidenav/sidenav-shim.directive.ts index d1e011f39a..808eb2f68c 100644 --- a/packages/common/src/lib/sidenav/sidenav-shim.directive.ts +++ b/packages/common/src/lib/sidenav/sidenav-shim.directive.ts @@ -8,7 +8,8 @@ import { MatSidenav } from '@angular/material/sidenav'; * from focusing an element after it's closed */ @Directive({ - selector: '[igoSidenavShim]' + selector: '[igoSidenavShim]', + standalone: true }) export class SidenavShimDirective { private focusedElement: HTMLElement; diff --git a/packages/common/src/lib/sidenav/sidenav.module.ts b/packages/common/src/lib/sidenav/sidenav.module.ts index 6f52288a24..8bdc47feb1 100644 --- a/packages/common/src/lib/sidenav/sidenav.module.ts +++ b/packages/common/src/lib/sidenav/sidenav.module.ts @@ -2,9 +2,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { SidenavShimDirective } from './sidenav-shim.directive'; +/** + * @deprecated import the SidenavShimDirective directly + */ @NgModule({ - imports: [], - declarations: [SidenavShimDirective], + imports: [SidenavShimDirective], exports: [SidenavShimDirective] }) export class IgoSidenavModule { diff --git a/packages/common/src/lib/spinner/index.ts b/packages/common/src/lib/spinner/index.ts index ab2107d0a5..cab52296d3 100644 --- a/packages/common/src/lib/spinner/index.ts +++ b/packages/common/src/lib/spinner/index.ts @@ -1,2 +1,10 @@ +import { SpinnerActivityDirective } from './spinner-activity.directive'; +import { SpinnerComponent } from './spinner.component'; + export * from './spinner.component'; export * from './spinner-activity.directive'; + +export const SPINNER_DIRECTIVES = [ + SpinnerActivityDirective, + SpinnerComponent +] as const; diff --git a/packages/common/src/lib/spinner/spinner-activity.directive.ts b/packages/common/src/lib/spinner/spinner-activity.directive.ts index 41cc4e20d5..79c0ecbb56 100644 --- a/packages/common/src/lib/spinner/spinner-activity.directive.ts +++ b/packages/common/src/lib/spinner/spinner-activity.directive.ts @@ -14,7 +14,8 @@ import { SpinnerComponent } from './spinner.component'; * is greater than 0. */ @Directive({ - selector: '[igoSpinnerActivity]' + selector: '[igoSpinnerActivity]', + standalone: true }) export class SpinnerActivityDirective implements OnInit, OnDestroy { /** diff --git a/packages/common/src/lib/spinner/spinner.component.spec.ts b/packages/common/src/lib/spinner/spinner.component.spec.ts index a8539be89e..ccdc8c2bcf 100644 --- a/packages/common/src/lib/spinner/spinner.component.spec.ts +++ b/packages/common/src/lib/spinner/spinner.component.spec.ts @@ -1,5 +1,4 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { SpinnerComponent } from './spinner.component'; @@ -9,8 +8,7 @@ describe('SpinnerComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [MatProgressSpinner], - declarations: [SpinnerComponent] + imports: [SpinnerComponent] }).compileComponents(); })); diff --git a/packages/common/src/lib/spinner/spinner.component.ts b/packages/common/src/lib/spinner/spinner.component.ts index 8db965258c..74bde4ce8f 100644 --- a/packages/common/src/lib/spinner/spinner.component.ts +++ b/packages/common/src/lib/spinner/spinner.component.ts @@ -1,11 +1,15 @@ +import { AsyncPipe, NgClass } from '@angular/common'; import { Component, Input } from '@angular/core'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { BehaviorSubject } from 'rxjs'; @Component({ selector: 'igo-spinner', templateUrl: './spinner.component.html', - styleUrls: ['./spinner.component.scss'] + styleUrls: ['./spinner.component.scss'], + standalone: true, + imports: [NgClass, MatProgressSpinner, AsyncPipe] }) export class SpinnerComponent { public shown$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/common/src/lib/spinner/spinner.module.ts b/packages/common/src/lib/spinner/spinner.module.ts index 08eaf499cd..d72df64c12 100644 --- a/packages/common/src/lib/spinner/spinner.module.ts +++ b/packages/common/src/lib/spinner/spinner.module.ts @@ -1,13 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { SpinnerActivityDirective } from './spinner-activity.directive'; -import { SpinnerComponent } from './spinner.component'; +import { SPINNER_DIRECTIVES } from '.'; +/** + * @deprecated import the components/directives directly or SPINNER_DIRECTIVES for every components/directives + */ @NgModule({ - imports: [CommonModule, MatProgressSpinnerModule], - declarations: [SpinnerActivityDirective, SpinnerComponent], - exports: [SpinnerActivityDirective, SpinnerComponent] + imports: [...SPINNER_DIRECTIVES], + exports: [...SPINNER_DIRECTIVES] }) export class IgoSpinnerModule {} diff --git a/packages/common/src/lib/stop-propagation/index.ts b/packages/common/src/lib/stop-propagation/index.ts index 0537c6687c..6028a1f89b 100644 --- a/packages/common/src/lib/stop-propagation/index.ts +++ b/packages/common/src/lib/stop-propagation/index.ts @@ -1,2 +1,10 @@ +import { StopDropPropagationDirective } from './stop-drop-propagation.directive'; +import { StopPropagationDirective } from './stop-propagation.directive'; + export * from './stop-propagation.directive'; export * from './stop-drop-propagation.directive'; + +export const STOP_PROPAGATION_DIRECTIVES = [ + StopDropPropagationDirective, + StopPropagationDirective +] as const; diff --git a/packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts b/packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts index 11830326b4..92785fbf2b 100644 --- a/packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts +++ b/packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts @@ -1,7 +1,8 @@ import { Directive, HostListener } from '@angular/core'; @Directive({ - selector: '[igoStopDropPropagation]' + selector: '[igoStopDropPropagation]', + standalone: true }) export class StopDropPropagationDirective { @HostListener('drop', ['$event']) diff --git a/packages/common/src/lib/stop-propagation/stop-propagation.directive.ts b/packages/common/src/lib/stop-propagation/stop-propagation.directive.ts index f363192787..98a75f564d 100644 --- a/packages/common/src/lib/stop-propagation/stop-propagation.directive.ts +++ b/packages/common/src/lib/stop-propagation/stop-propagation.directive.ts @@ -1,7 +1,8 @@ import { Directive, HostListener } from '@angular/core'; @Directive({ - selector: '[igoStopPropagation]' + selector: '[igoStopPropagation]', + standalone: true }) export class StopPropagationDirective { @HostListener('click', ['$event']) diff --git a/packages/common/src/lib/stop-propagation/stop-propagation.module.ts b/packages/common/src/lib/stop-propagation/stop-propagation.module.ts index 73ce4fdff8..6633b17e9d 100644 --- a/packages/common/src/lib/stop-propagation/stop-propagation.module.ts +++ b/packages/common/src/lib/stop-propagation/stop-propagation.module.ts @@ -3,9 +3,11 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { StopDropPropagationDirective } from './stop-drop-propagation.directive'; import { StopPropagationDirective } from './stop-propagation.directive'; +/** + * @deprecated import the components/directives directly or STOP_PROPAGATION_DIRECTIVES for the set + */ @NgModule({ - imports: [], - declarations: [StopDropPropagationDirective, StopPropagationDirective], + imports: [StopDropPropagationDirective, StopPropagationDirective], exports: [StopDropPropagationDirective, StopPropagationDirective] }) export class IgoStopPropagationModule { diff --git a/packages/common/src/lib/table/table.component.ts b/packages/common/src/lib/table/table.component.ts index 75a21e83ae..8d4e3c7caa 100644 --- a/packages/common/src/lib/table/table.component.ts +++ b/packages/common/src/lib/table/table.component.ts @@ -1,4 +1,5 @@ import { SelectionModel } from '@angular/cdk/collections'; +import { NgClass, NgFor, NgIf } from '@angular/common'; import { AfterViewInit, Component, @@ -10,10 +11,17 @@ import { Output, ViewChild } from '@angular/core'; -import { MatSort } from '@angular/material/sort'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSort, MatSortModule } from '@angular/material/sort'; +import { MatTableModule } from '@angular/material/table'; import { ObjectUtils } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { fromEvent } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; @@ -25,7 +33,21 @@ import { TableModel } from './table-model.interface'; @Component({ selector: 'igo-table', templateUrl: './table.component.html', - styleUrls: ['./table.component.scss'] + styleUrls: ['./table.component.scss'], + standalone: true, + imports: [ + NgIf, + MatFormFieldModule, + MatInputModule, + MatTableModule, + MatSortModule, + MatCheckboxModule, + NgFor, + NgClass, + MatButtonModule, + MatIconModule, + TranslateModule + ] }) export class TableComponent implements OnChanges, OnInit, AfterViewInit { @Input() diff --git a/packages/common/src/lib/table/table.module.ts b/packages/common/src/lib/table/table.module.ts index 6dacc6be9d..45849c3360 100644 --- a/packages/common/src/lib/table/table.module.ts +++ b/packages/common/src/lib/table/table.module.ts @@ -1,34 +1,12 @@ -import { CdkTableModule } from '@angular/cdk/table'; -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSortModule } from '@angular/material/sort'; -import { MatTableModule } from '@angular/material/table'; - -import { IgoLanguageModule } from '@igo2/core'; import { TableComponent } from './table.component'; +/** + * @deprecated import the TableComponent directly + */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - CdkTableModule, - MatIconModule, - MatButtonModule, - MatTableModule, - MatFormFieldModule, - MatInputModule, - MatSortModule, - MatCheckboxModule, - IgoLanguageModule - ], - declarations: [TableComponent], + imports: [TableComponent], exports: [TableComponent] }) export class IgoTableModule { diff --git a/packages/common/src/lib/tool/tool.module.ts b/packages/common/src/lib/tool/tool.module.ts index 4fba97a4b0..ed7e3859d6 100644 --- a/packages/common/src/lib/tool/tool.module.ts +++ b/packages/common/src/lib/tool/tool.module.ts @@ -1,15 +1,18 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { ToolService } from './shared/tool.service'; import { IgoToolboxModule } from './toolbox/toolbox.module'; +/** + * @deprecated import the ToolboxComponent directly + */ @NgModule({ - imports: [CommonModule], - exports: [IgoToolboxModule], - declarations: [] + exports: [IgoToolboxModule] }) export class IgoToolModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoToolModule, diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.ts b/packages/common/src/lib/tool/toolbox/toolbox.component.ts index af862e0c98..42f39e87fa 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.component.ts +++ b/packages/common/src/lib/tool/toolbox/toolbox.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -11,6 +12,8 @@ import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { map } from 'rxjs/operators'; import { Action, ActionStore } from '../../action'; +import { ActionbarComponent } from '../../action/actionbar/actionbar.component'; +import { DynamicOutletComponent } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.component'; import { Tool } from '../shared/tool.interface'; import { Toolbox } from '../shared/toolbox'; import { ToolboxColor } from '../shared/toolbox.enums'; @@ -21,7 +24,15 @@ import { toolSlideInOut } from './toolbox.animation'; templateUrl: 'toolbox.component.html', styleUrls: ['toolbox.component.scss'], animations: [toolSlideInOut()], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + ActionbarComponent, + NgClass, + DynamicOutletComponent, + AsyncPipe + ] }) export class ToolboxComponent implements OnInit, OnDestroy { /** diff --git a/packages/common/src/lib/tool/toolbox/toolbox.module.ts b/packages/common/src/lib/tool/toolbox/toolbox.module.ts index f81b446159..bf78cb6642 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.module.ts +++ b/packages/common/src/lib/tool/toolbox/toolbox.module.ts @@ -1,16 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoActionModule } from '../../action/action.module'; -import { IgoDynamicComponentModule } from '../../dynamic-component/dynamic-component.module'; import { ToolboxComponent } from './toolbox.component'; /** - * @ignore + * @deprecated import the ToolboxComponent directly */ @NgModule({ - imports: [CommonModule, IgoActionModule, IgoDynamicComponentModule], - exports: [ToolboxComponent], - declarations: [ToolboxComponent] + imports: [ToolboxComponent], + exports: [ToolboxComponent] }) export class IgoToolboxModule {} diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts b/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts index e4628f3f52..cef2c7b87c 100644 --- a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts +++ b/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -8,6 +9,7 @@ import { } from '@angular/core'; import { DynamicComponent } from '../../dynamic-component'; +import { DynamicOutletComponent } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.component'; import { WidgetComponent } from '../shared/widget.interfaces'; /** @@ -19,7 +21,9 @@ import { WidgetComponent } from '../shared/widget.interfaces'; selector: 'igo-widget-outlet', templateUrl: './widget-outlet.component.html', styleUrls: ['./widget-outlet.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, DynamicOutletComponent] }) export class WidgetOutletComponent implements OnDestroy { /** diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts b/packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts index 5b29800f50..414ba3e501 100644 --- a/packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts +++ b/packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts @@ -1,15 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoDynamicComponentModule } from '../../dynamic-component/dynamic-component.module'; import { WidgetOutletComponent } from './widget-outlet.component'; /** - * @ignore + * @deprecated import the WidgetOutletComponent directly */ @NgModule({ - imports: [CommonModule, IgoDynamicComponentModule], - exports: [WidgetOutletComponent], - declarations: [WidgetOutletComponent] + imports: [WidgetOutletComponent], + exports: [WidgetOutletComponent] }) export class IgoWidgetOutletModule {} diff --git a/packages/common/src/lib/widget/widget.module.ts b/packages/common/src/lib/widget/widget.module.ts index b911b08fe1..6945e0326e 100644 --- a/packages/common/src/lib/widget/widget.module.ts +++ b/packages/common/src/lib/widget/widget.module.ts @@ -1,11 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { WidgetService } from './shared/widget.service'; import { IgoWidgetOutletModule } from './widget-outlet/widget-outlet.module'; +/** + * @deprecated import the WidgetOutletComponent directly + */ @NgModule({ - imports: [CommonModule, IgoWidgetOutletModule], + imports: [IgoWidgetOutletModule], exports: [IgoWidgetOutletModule], declarations: [], providers: [WidgetService] diff --git a/packages/common/src/lib/workspace/index.ts b/packages/common/src/lib/workspace/index.ts index 084f3d097e..a9fe6b7db9 100644 --- a/packages/common/src/lib/workspace/index.ts +++ b/packages/common/src/lib/workspace/index.ts @@ -1,3 +1,11 @@ +import { WorkspaceSelectorComponent } from './workspace-selector/workspace-selector.component'; +import { WorkspaceWidgetOutletComponent } from './workspace-widget-outlet/workspace-widget-outlet.component'; + export * from './shared'; export * from './workspace-selector/workspace-selector.component'; export * from './workspace-widget-outlet/workspace-widget-outlet.component'; + +export const WORKSPACE_DIRECTIVES = [ + WorkspaceSelectorComponent, + WorkspaceWidgetOutletComponent +] as const; diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss index ff24e5679d..e69de29bb2 100644 --- a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss +++ b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss @@ -1,5 +0,0 @@ -igo-entity-selector ::ng-deep mat-form-field { - .mat-mdc-form-field-infix { - padding: 0; - } -} diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts index 79f7faa3a3..4c97e69c33 100644 --- a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts +++ b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts @@ -7,6 +7,7 @@ import { } from '@angular/core'; import { getEntityTitle } from '../../entity'; +import { EntitySelectorComponent } from '../../entity/entity-selector/entity-selector.component'; import { WorkspaceStore } from '../shared/store'; import { Workspace } from '../shared/workspace'; @@ -17,7 +18,9 @@ import { Workspace } from '../shared/workspace'; selector: 'igo-workspace-selector', templateUrl: './workspace-selector.component.html', styleUrls: ['./workspace-selector.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [EntitySelectorComponent] }) export class WorkspaceSelectorComponent { /** diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts index 054d3f4909..82b70a1408 100644 --- a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts +++ b/packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts @@ -1,15 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoEntitySelectorModule } from '../../entity/entity-selector/entity-selector.module'; import { WorkspaceSelectorComponent } from './workspace-selector.component'; /** - * @ignore + * @deprecated import the WorkspaceSelectorComponent directly */ @NgModule({ - imports: [CommonModule, IgoEntitySelectorModule], - exports: [WorkspaceSelectorComponent], - declarations: [WorkspaceSelectorComponent] + imports: [WorkspaceSelectorComponent], + exports: [WorkspaceSelectorComponent] }) export class IgoWorkspaceSelectorModule {} diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts b/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts index ff99eff666..66a12284fa 100644 --- a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts +++ b/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -9,6 +10,7 @@ import { import { BehaviorSubject } from 'rxjs'; import { Widget } from '../../widget'; +import { WidgetOutletComponent } from '../../widget/widget-outlet/widget-outlet.component'; import { Workspace } from '../shared/workspace'; /** @@ -20,7 +22,9 @@ import { Workspace } from '../shared/workspace'; selector: 'igo-workspace-widget-outlet', templateUrl: './workspace-widget-outlet.component.html', styleUrls: ['./workspace-widget-outlet.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, WidgetOutletComponent, AsyncPipe] }) export class WorkspaceWidgetOutletComponent { /** diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts b/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts index 0abbe72be9..7abf5005c4 100644 --- a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts +++ b/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts @@ -1,15 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoWidgetOutletModule } from '../../widget/widget-outlet/widget-outlet.module'; import { WorkspaceWidgetOutletComponent } from './workspace-widget-outlet.component'; /** - * @ignore + * @deprecated import the WorkspaceWidgetOutletComponent directly */ @NgModule({ - imports: [CommonModule, IgoWidgetOutletModule], - exports: [WorkspaceWidgetOutletComponent], - declarations: [WorkspaceWidgetOutletComponent] + imports: [WorkspaceWidgetOutletComponent], + exports: [WorkspaceWidgetOutletComponent] }) export class IgoWorkspaceWidgetOutletModule {} diff --git a/packages/common/src/lib/workspace/workspace.module.ts b/packages/common/src/lib/workspace/workspace.module.ts index d06b9e9024..257bbd33db 100644 --- a/packages/common/src/lib/workspace/workspace.module.ts +++ b/packages/common/src/lib/workspace/workspace.module.ts @@ -1,12 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoWorkspaceSelectorModule } from './workspace-selector/workspace-selector.module'; -import { IgoWorkspaceWidgetOutletModule } from './workspace-widget-outlet/workspace-widget-outlet.module'; +import { WORKSPACE_DIRECTIVES } from '.'; +/** + * @deprecated import the components directly or WORKSPACE_DIRECTIVES for every components/directives + */ @NgModule({ - imports: [CommonModule], - exports: [IgoWorkspaceSelectorModule, IgoWorkspaceWidgetOutletModule], + imports: [...WORKSPACE_DIRECTIVES], + exports: [...WORKSPACE_DIRECTIVES], declarations: [] }) export class IgoWorkspaceModule {} diff --git a/packages/common/src/public_api.ts b/packages/common/src/public_api.ts index 13425a3d54..83a88b7883 100644 --- a/packages/common/src/public_api.ts +++ b/packages/common/src/public_api.ts @@ -9,44 +9,45 @@ export * from './lib/badge-icon/badge-icon.module'; export * from './lib/clickout/clickout.module'; export * from './lib/clone/clone.module'; export * from './lib/collapsible/collapsible.module'; +export * from './lib/color-picker-form-field/color-picker-form-field.module'; export * from './lib/confirm-dialog/confirm-dialog.module'; -export * from './lib/select-value-dialog/select-value-dialog.module'; -export * from './lib/form-dialog/form-dialog.module'; export * from './lib/context-menu/context-menu.module'; export * from './lib/custom-html/custom-html.module'; export * from './lib/dom/dom.module'; export * from './lib/drag-drop/drag-drop.module'; export * from './lib/dynamic-component/dynamic-component.module'; export * from './lib/dynamic-component/dynamic-outlet/dynamic-outlet.module'; +export * from './lib/entity/entity-selector/entity-selector.module'; +export * from './lib/entity/entity-table-paginator/entity-table-paginator.module'; +export * from './lib/entity/entity-table/entity-table.module'; +export * from './lib/entity/entity.module'; export * from './lib/environment'; export * from './lib/flexible/flexible.module'; +export * from './lib/form-dialog/form-dialog.module'; +export * from './lib/form/form-field/form-field.module'; +export * from './lib/form/form-group/form-group.module'; export * from './lib/form/form.module'; export * from './lib/form/form/form.module'; + export * from './lib/home-button/home-button.module'; -export * from './lib/form/form-field/form-field.module'; -export * from './lib/form/form-group/form-group.module'; -export * from './lib/entity/entity.module'; -export * from './lib/entity/entity-selector/entity-selector.module'; -export * from './lib/entity/entity-table/entity-table.module'; -export * from './lib/entity/entity-table-paginator/entity-table-paginator.module'; export * from './lib/image/image.module'; export * from './lib/interactive-tour/interactive-tour.module'; export * from './lib/json-dialog/json-dialog.module'; export * from './lib/keyvalue/keyvalue.module'; export * from './lib/list/list.module'; export * from './lib/panel/panel.module'; +export * from './lib/select-value-dialog/select-value-dialog.module'; export * from './lib/sidenav/sidenav.module'; export * from './lib/spinner/spinner.module'; export * from './lib/stop-propagation/stop-propagation.module'; export * from './lib/table/table.module'; export * from './lib/tool/tool.module'; export * from './lib/tool/toolbox/toolbox.module'; -export * from './lib/widget/widget.module'; export * from './lib/widget/widget-outlet/widget-outlet.module'; -export * from './lib/workspace/workspace.module'; +export * from './lib/widget/widget.module'; export * from './lib/workspace/workspace-selector/workspace-selector.module'; export * from './lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module'; -export * from './lib/color-picker-form-field/color-picker-form-field.module'; +export * from './lib/workspace/workspace.module'; export * from './lib/action'; export * from './lib/backdrop'; @@ -54,24 +55,25 @@ export * from './lib/badge-icon'; export * from './lib/clickout'; export * from './lib/clone'; export * from './lib/collapsible'; +export * from './lib/color-picker-form-field'; export * from './lib/confirm-dialog'; -export * from './lib/select-value-dialog'; -export * from './lib/form-dialog'; export * from './lib/context-menu'; export * from './lib/custom-html'; -export * from './lib/drag-drop'; export * from './lib/dom'; +export * from './lib/drag-drop'; export * from './lib/dynamic-component'; -export * from './lib/form'; -export * from './lib/home-button'; export * from './lib/entity'; export * from './lib/flexible'; +export * from './lib/form-dialog'; +export * from './lib/form'; +export * from './lib/home-button'; export * from './lib/image'; export * from './lib/interactive-tour'; export * from './lib/json-dialog'; export * from './lib/keyvalue'; export * from './lib/list'; export * from './lib/panel'; +export * from './lib/select-value-dialog'; export * from './lib/sidenav'; export * from './lib/spinner'; export * from './lib/stop-propagation'; @@ -79,4 +81,3 @@ export * from './lib/table'; export * from './lib/tool'; export * from './lib/widget'; export * from './lib/workspace'; -export * from './lib/color-picker-form-field'; diff --git a/packages/context/package.json b/packages/context/package.json index 9f93649cc9..410490c234 100644 --- a/packages/context/package.json +++ b/packages/context/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build context --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint context", + "lint.fix": "ng lint context --fix", "test": "ng test context --watch=false", "watch": "ng build context --watch" }, diff --git a/packages/context/src/lib/context-import-export/context-import-export.module.ts b/packages/context/src/lib/context-import-export/context-import-export.module.ts index 1f4527b069..233b42d956 100644 --- a/packages/context/src/lib/context-import-export/context-import-export.module.ts +++ b/packages/context/src/lib/context-import-export/context-import-export.module.ts @@ -1,42 +1,13 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoSpinnerModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { ContextImportExportComponent } from './context-import-export/context-import-export.component'; +/** + * @deprecated import the ContextImportExportComponent directly + */ @NgModule({ - imports: [ - FormsModule, - ReactiveFormsModule, - CommonModule, - MatButtonModule, - MatButtonToggleModule, - MatDividerModule, - MatTabsModule, - MatSelectModule, - MatOptionModule, - MatFormFieldModule, - MatInputModule, - MatCheckboxModule, - IgoLanguageModule, - IgoSpinnerModule, - MatTooltipModule - ], - exports: [ContextImportExportComponent], - declarations: [ContextImportExportComponent] + imports: [ContextImportExportComponent], + exports: [ContextImportExportComponent] }) export class IgoContextImportExportModule { static forRoot(): ModuleWithProviders { diff --git a/packages/context/src/lib/context-import-export/context-import-export/context-import-export.component.ts b/packages/context/src/lib/context-import-export/context-import-export/context-import-export.component.ts index cf2bf69e6d..40bf1ebc12 100644 --- a/packages/context/src/lib/context-import-export/context-import-export/context-import-export.component.ts +++ b/packages/context/src/lib/context-import-export/context-import-export/context-import-export.component.ts @@ -1,14 +1,26 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; - +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; + +import { SpinnerComponent } from '@igo2/common'; import { ConfigService, MessageService } from '@igo2/core'; import { Layer, VectorLayer } from '@igo2/geo'; import type { IgoMap } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { take } from 'rxjs/operators'; @@ -26,7 +38,24 @@ import { @Component({ selector: 'igo-context-import-export', templateUrl: './context-import-export.component.html', - styleUrls: ['./context-import-export.component.scss'] + styleUrls: ['./context-import-export.component.scss'], + standalone: true, + imports: [ + MatButtonToggleModule, + NgIf, + FormsModule, + MatButtonModule, + SpinnerComponent, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + MatOptionModule, + MatDividerModule, + NgFor, + AsyncPipe, + TranslateModule + ] }) export class ContextImportExportComponent implements OnInit, OnDestroy { public form: UntypedFormGroup; diff --git a/packages/context/src/lib/context-manager/context-edit/context-edit-binding.directive.ts b/packages/context/src/lib/context-manager/context-edit/context-edit-binding.directive.ts index 51763fe998..7dc7f915dc 100644 --- a/packages/context/src/lib/context-manager/context-edit/context-edit-binding.directive.ts +++ b/packages/context/src/lib/context-manager/context-edit/context-edit-binding.directive.ts @@ -17,7 +17,8 @@ import { ContextService } from '../shared/context.service'; import { ContextEditComponent } from './context-edit.component'; @Directive({ - selector: '[igoContextEditBinding]' + selector: '[igoContextEditBinding]', + standalone: true }) export class ContextEditBindingDirective implements OnInit, OnDestroy { private component: ContextEditComponent; diff --git a/packages/context/src/lib/context-manager/context-edit/context-edit.component.ts b/packages/context/src/lib/context-manager/context-edit/context-edit.component.ts index 042a272765..1526f6b31b 100644 --- a/packages/context/src/lib/context-manager/context-edit/context-edit.component.ts +++ b/packages/context/src/lib/context-manager/context-edit/context-edit.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -6,11 +7,16 @@ import { Output } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ContextFormComponent } from '../context-form/context-form.component'; import { Context } from '../shared/context.interface'; @Component({ selector: 'igo-context-edit', - templateUrl: './context-edit.component.html' + templateUrl: './context-edit.component.html', + standalone: true, + imports: [NgIf, ContextFormComponent, TranslateModule] }) export class ContextEditComponent { @Input() diff --git a/packages/context/src/lib/context-manager/context-form/context-form.component.ts b/packages/context/src/lib/context-manager/context-form/context-form.component.ts index e6c203c656..e2c1f012fd 100644 --- a/packages/context/src/lib/context-manager/context-form/context-form.component.ts +++ b/packages/context/src/lib/context-manager/context-form/context-form.component.ts @@ -1,15 +1,40 @@ +import { NgIf } from '@angular/common'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { MessageService } from '@igo2/core'; import { Clipboard, ObjectUtils } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; + import { Context } from '../shared/context.interface'; @Component({ selector: 'igo-context-form', templateUrl: './context-form.component.html', - styleUrls: ['./context-form.component.scss'] + styleUrls: ['./context-form.component.scss'], + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class ContextFormComponent implements OnInit { public form: UntypedFormGroup; diff --git a/packages/context/src/lib/context-manager/context-item/context-item.component.html b/packages/context/src/lib/context-manager/context-item/context-item.component.html index 6d0c065274..46e99a06a3 100644 --- a/packages/context/src/lib/context-manager/context-item/context-item.component.html +++ b/packages/context/src/lib/context-manager/context-item/context-item.component.html @@ -22,8 +22,8 @@ context.icon ? context.icon : context.scope === 'public' - ? 'earth' - : 'star' + ? 'earth' + : 'star' }}" > diff --git a/packages/context/src/lib/context-manager/context-item/context-item.component.ts b/packages/context/src/lib/context-manager/context-item/context-item.component.ts index 154f32f49e..9ef8399656 100644 --- a/packages/context/src/lib/context-manager/context-item/context-item.component.ts +++ b/packages/context/src/lib/context-manager/context-item/context-item.component.ts @@ -1,3 +1,4 @@ +import { NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,10 +6,17 @@ import { Input, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; +import { CollapseDirective, StopPropagationDirective } from '@igo2/common'; import { StorageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { TypePermission } from '../shared/context.enum'; import { DetailedContext } from '../shared/context.interface'; @@ -16,7 +24,19 @@ import { DetailedContext } from '../shared/context.interface'; selector: 'igo-context-item', templateUrl: './context-item.component.html', styleUrls: ['./context-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + NgClass, + NgIf, + MatButtonModule, + StopPropagationDirective, + MatTooltipModule, + MatIconModule, + CollapseDirective, + TranslateModule + ] }) export class ContextItemComponent { public typePermission = TypePermission; diff --git a/packages/context/src/lib/context-manager/context-list/context-list-binding.directive.ts b/packages/context/src/lib/context-manager/context-list/context-list-binding.directive.ts index 482bc4381e..19274dc0b4 100644 --- a/packages/context/src/lib/context-manager/context-list/context-list-binding.directive.ts +++ b/packages/context/src/lib/context-manager/context-list/context-list-binding.directive.ts @@ -25,7 +25,9 @@ import { ContextService } from '../shared/context.service'; import { ContextListComponent } from './context-list.component'; @Directive({ - selector: '[igoContextListBinding]' + selector: '[igoContextListBinding]', + standalone: true, + providers: [ConfirmDialogService] }) export class ContextListBindingDirective implements OnInit, OnDestroy { private component: ContextListComponent; diff --git a/packages/context/src/lib/context-manager/context-list/context-list.component.html b/packages/context/src/lib/context-manager/context-list/context-list.component.html index 6361732ea2..4935f54d07 100644 --- a/packages/context/src/lib/context-manager/context-list/context-list.component.html +++ b/packages/context/src/lib/context-manager/context-list/context-list.component.html @@ -140,7 +140,11 @@ - + { return { - ngModule: IgoContextModule, - providers: [] + ngModule: IgoContextModule }; } } diff --git a/packages/context/src/lib/index.ts b/packages/context/src/lib/index.ts new file mode 100644 index 0000000000..a9d964cd6a --- /dev/null +++ b/packages/context/src/lib/index.ts @@ -0,0 +1,20 @@ +import { ContextImportExportComponent } from './context-import-export'; +import { CONTEXT_MANAGER_DIRECTIVES } from './context-manager'; +import { CONTEXT_MAP_BUTTON_DIRECTIVES } from './context-map-button'; +import { SHARE_MAP_DIRECTIVES } from './share-map'; +import { SidenavComponent } from './sidenav'; + +export * from './context-import-export'; +export * from './context-manager'; +export * from './context-map-button'; +export * from './share-map'; +export * from './sidenav'; +export * from './environment'; + +export const CONTEXT_DIRECTIVES = [ + ContextImportExportComponent, + SidenavComponent, + ...CONTEXT_MANAGER_DIRECTIVES, + ...CONTEXT_MAP_BUTTON_DIRECTIVES, + ...SHARE_MAP_DIRECTIVES +] as const; diff --git a/packages/context/src/lib/share-map/index.ts b/packages/context/src/lib/share-map/index.ts index 9e322b0e8f..c9ea9106a4 100644 --- a/packages/context/src/lib/share-map/index.ts +++ b/packages/context/src/lib/share-map/index.ts @@ -1,4 +1,14 @@ +import { ShareMapApiComponent } from './share-map/share-map-api.component'; +import { ShareMapUrlComponent } from './share-map/share-map-url.component'; +import { ShareMapComponent } from './share-map/share-map.component'; + export * from './shared'; export * from './share-map/share-map.component'; export * from './share-map/share-map-url.component'; export * from './share-map/share-map-api.component'; + +export const SHARE_MAP_DIRECTIVES = [ + ShareMapComponent, + ShareMapUrlComponent, + ShareMapApiComponent +] as const; diff --git a/packages/context/src/lib/share-map/share-map.module.ts b/packages/context/src/lib/share-map/share-map.module.ts index 2c25a4523a..d312ed11f2 100644 --- a/packages/context/src/lib/share-map/share-map.module.ts +++ b/packages/context/src/lib/share-map/share-map.module.ts @@ -1,36 +1,15 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoCustomHtmlModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { ShareMapApiComponent } from './share-map/share-map-api.component'; import { ShareMapUrlComponent } from './share-map/share-map-url.component'; import { ShareMapComponent } from './share-map/share-map.component'; +/** + * @deprecated import the components/directives directly or SHARE_MAP_DIRECTIVES for the set + */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MatIconModule, - MatTooltipModule, - MatTabsModule, - MatFormFieldModule, - MatInputModule, - MatButtonModule, - IgoLanguageModule, - IgoCustomHtmlModule - ], - exports: [ShareMapComponent, ShareMapUrlComponent, ShareMapApiComponent], - declarations: [ShareMapComponent, ShareMapUrlComponent, ShareMapApiComponent] + imports: [ShareMapComponent, ShareMapUrlComponent, ShareMapApiComponent], + exports: [ShareMapComponent, ShareMapUrlComponent, ShareMapApiComponent] }) export class IgoShareMapModule { static forRoot(): ModuleWithProviders { diff --git a/packages/context/src/lib/share-map/share-map/share-map-api.component.ts b/packages/context/src/lib/share-map/share-map/share-map-api.component.ts index 6c96c59b97..e01524424a 100644 --- a/packages/context/src/lib/share-map/share-map/share-map-api.component.ts +++ b/packages/context/src/lib/share-map/share-map/share-map-api.component.ts @@ -1,17 +1,42 @@ +import { NgIf } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; import { LanguageService, MessageService } from '@igo2/core'; import type { IgoMap } from '@igo2/geo'; import { Clipboard, uuid } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; + import { ShareMapService } from '../shared/share-map.service'; @Component({ selector: 'igo-share-map-api', templateUrl: './share-map-api.component.html', - styleUrls: ['./share-map-api.component.scss'] + styleUrls: ['./share-map-api.component.scss'], + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class ShareMapApiComponent implements OnInit { public form: UntypedFormGroup; diff --git a/packages/context/src/lib/share-map/share-map/share-map-url.component.ts b/packages/context/src/lib/share-map/share-map/share-map-url.component.ts index 1f939af1f9..c87bc5514b 100644 --- a/packages/context/src/lib/share-map/share-map/share-map-url.component.ts +++ b/packages/context/src/lib/share-map/share-map/share-map-url.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { AfterViewInit, ChangeDetectorRef, @@ -6,11 +7,17 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { CustomHtmlComponent } from '@igo2/common'; import { MessageService } from '@igo2/core'; import type { IgoMap } from '@igo2/geo'; import { Clipboard } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription, combineLatest } from 'rxjs'; import { ShareMapService } from '../shared/share-map.service'; @@ -18,7 +25,17 @@ import { ShareMapService } from '../shared/share-map.service'; @Component({ selector: 'igo-share-map-url', templateUrl: './share-map-url.component.html', - styleUrls: ['./share-map-url.component.scss'] + styleUrls: ['./share-map-url.component.scss'], + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + MatButtonModule, + MatIconModule, + NgIf, + CustomHtmlComponent, + TranslateModule + ] }) export class ShareMapUrlComponent implements AfterViewInit, OnInit, OnDestroy { private mapState$$: Subscription; diff --git a/packages/context/src/lib/share-map/share-map/share-map.component.ts b/packages/context/src/lib/share-map/share-map/share-map.component.ts index c0af278c63..c5f434b1bc 100644 --- a/packages/context/src/lib/share-map/share-map/share-map.component.ts +++ b/packages/context/src/lib/share-map/share-map/share-map.component.ts @@ -1,12 +1,27 @@ +import { NgIf } from '@angular/common'; import { Component, Input } from '@angular/core'; +import { MatTabsModule } from '@angular/material/tabs'; import { ConfigService } from '@igo2/core'; import type { IgoMap } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; + +import { ShareMapApiComponent } from './share-map-api.component'; +import { ShareMapUrlComponent } from './share-map-url.component'; + @Component({ selector: 'igo-share-map', templateUrl: './share-map.component.html', - styleUrls: ['./share-map.component.scss'] + styleUrls: ['./share-map.component.scss'], + standalone: true, + imports: [ + NgIf, + MatTabsModule, + ShareMapApiComponent, + ShareMapUrlComponent, + TranslateModule + ] }) export class ShareMapComponent { @Input() map: IgoMap; diff --git a/packages/context/src/lib/sidenav/sidenav.component.ts b/packages/context/src/lib/sidenav/sidenav.component.ts index c7b4151f16..08b020c9b4 100644 --- a/packages/context/src/lib/sidenav/sidenav.component.ts +++ b/packages/context/src/lib/sidenav/sidenav.component.ts @@ -1,17 +1,47 @@ +import { NgIf } from '@angular/common'; import { Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { Title } from '@angular/platform-browser'; -import { FlexibleState, Tool, getEntityTitle } from '@igo2/common'; +import { + FlexibleComponent, + FlexibleState, + PanelComponent, + Tool, + getEntityTitle +} from '@igo2/common'; import type { Media } from '@igo2/core'; -import { Feature, FeatureMotion, moveToOlFeatures } from '@igo2/geo'; +import { + Feature, + FeatureDetailsComponent, + FeatureMotion, + moveToOlFeatures +} from '@igo2/geo'; import type { IgoMap } from '@igo2/geo'; import olFormatGeoJSON from 'ol/format/GeoJSON'; +import { TranslateModule } from '@ngx-translate/core'; + @Component({ selector: 'igo-sidenav', templateUrl: './sidenav.component.html', - styleUrls: ['./sidenav.component.scss'] + styleUrls: ['./sidenav.component.scss'], + standalone: true, + imports: [ + MatSidenavModule, + FlexibleComponent, + PanelComponent, + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + FeatureDetailsComponent, + TranslateModule + ] }) export class SidenavComponent { private format = new olFormatGeoJSON(); diff --git a/packages/context/src/lib/sidenav/sidenav.module.ts b/packages/context/src/lib/sidenav/sidenav.module.ts index 2ad31f21f4..3d06ebae18 100644 --- a/packages/context/src/lib/sidenav/sidenav.module.ts +++ b/packages/context/src/lib/sidenav/sidenav.module.ts @@ -1,32 +1,13 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoFlexibleModule, IgoPanelModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; -import { IgoFeatureModule } from '@igo2/geo'; - -import { IgoContextManagerModule } from '../context-manager/context-manager.module'; import { SidenavComponent } from './sidenav.component'; +/** + * @deprecated import the SidenavComponent directly + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatSidenavModule, - MatTooltipModule, - IgoLanguageModule, - IgoPanelModule, - IgoFlexibleModule, - IgoFeatureModule, - IgoContextManagerModule - ], - exports: [SidenavComponent], - declarations: [SidenavComponent] + imports: [SidenavComponent], + exports: [SidenavComponent] }) export class IgoSidenavModule { static forRoot(): ModuleWithProviders { diff --git a/packages/core/package.json b/packages/core/package.json index 13217646ed..3981cec93a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -19,6 +19,8 @@ "prestart": "npm run postbuild", "build": "ng build core --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint core", + "lint.fix": "ng lint core --fix", "postbuild": "ts-node ../../scripts/src/core/postbuild-core.ts", "test": "ng test core --watch=false", "watch": "ng build core --watch && npm run postbuild" diff --git a/packages/core/src/lib/core.module.ts b/packages/core/src/lib/core.module.ts index 152e92109b..eee5e4d381 100644 --- a/packages/core/src/lib/core.module.ts +++ b/packages/core/src/lib/core.module.ts @@ -49,10 +49,10 @@ const dbConfig: DBConfig = { IgoActivityModule.forRoot(), IgoConfigModule.forRoot(), IgoErrorModule.forRoot(), - provideRootTranslation(), IgoMessageModule, NgxIndexedDBModule.forRoot(dbConfig) ], + providers: [provideRootTranslation()], declarations: [], exports: [ IgoActivityModule, diff --git a/packages/core/src/lib/language/shared/language.provider.ts b/packages/core/src/lib/language/shared/language.provider.ts index 5ba6a7001a..4206bb2b54 100644 --- a/packages/core/src/lib/language/shared/language.provider.ts +++ b/packages/core/src/lib/language/shared/language.provider.ts @@ -1,5 +1,11 @@ import { HttpBackend } from '@angular/common/http'; -import { ImportProvidersSource, Provider } from '@angular/core'; +import { + APP_INITIALIZER, + EnvironmentProviders, + Provider, + importProvidersFrom, + makeEnvironmentProviders +} from '@angular/core'; import { MissingTranslationHandler, @@ -10,6 +16,7 @@ import { import { ConfigService } from '../../config'; import { LanguageLoader } from './language.loader'; +import { LanguageService } from './language.service'; import { IgoMissingTranslationHandler } from './missing-translation.guard'; /** @@ -17,8 +24,16 @@ import { IgoMissingTranslationHandler } from './missing-translation.guard'; */ export function provideRootTranslation( loader?: Provider -): ImportProvidersSource { - return TranslateModule.forRoot(setTranslationConfig(loader)); +): EnvironmentProviders { + return makeEnvironmentProviders([ + importProvidersFrom(TranslateModule.forRoot(setTranslationConfig(loader))), + { + provide: APP_INITIALIZER, + useFactory: () => () => {}, + deps: [LanguageService], + multi: true + } + ]); } export const setTranslationConfig = ( diff --git a/packages/core/src/lib/message/shared/message.service.ts b/packages/core/src/lib/message/shared/message.service.ts index 862828f5bb..fe77e2659d 100644 --- a/packages/core/src/lib/message/shared/message.service.ts +++ b/packages/core/src/lib/message/shared/message.service.ts @@ -131,9 +131,8 @@ export class MessageService { currentDate < message.options.to ) { if (message.showIcon === false) { - this.toastr.toastrConfig.iconClasses[ - messageType - ] = `toast-${messageType} toast-no-icon`; + this.toastr.toastrConfig.iconClasses[messageType] = + `toast-${messageType} toast-no-icon`; } message = this.handleTemplate(message); diff --git a/packages/core/src/lib/monitoring/sentry/sentry.interface.ts b/packages/core/src/lib/monitoring/sentry/sentry.interface.ts index e843352066..749c4923b4 100644 --- a/packages/core/src/lib/monitoring/sentry/sentry.interface.ts +++ b/packages/core/src/lib/monitoring/sentry/sentry.interface.ts @@ -1,4 +1,5 @@ import { BrowserOptions, ErrorHandlerOptions } from '@sentry/angular-ivy'; + import { MonitoringOptions } from '../shared/monitoring.interface'; export type SentryMonitoringOptions = BrowserOptions & diff --git a/packages/core/src/lib/monitoring/sentry/sentry.utils.spec.ts b/packages/core/src/lib/monitoring/sentry/sentry.utils.spec.ts index 2e4b6e0aae..3c13f219f1 100644 --- a/packages/core/src/lib/monitoring/sentry/sentry.utils.spec.ts +++ b/packages/core/src/lib/monitoring/sentry/sentry.utils.spec.ts @@ -1,6 +1,6 @@ -import { isTracingEnabled } from './sentry.utils'; -import { SentryMonitoringOptions } from './sentry.interface'; import { MOCK_SENTRY_OPTIONS } from '../__mocks__/monitoring-mock'; +import { SentryMonitoringOptions } from './sentry.interface'; +import { isTracingEnabled } from './sentry.utils'; const getOptions = ( options?: Partial diff --git a/packages/core/src/lib/monitoring/sentry/sentry.utils.ts b/packages/core/src/lib/monitoring/sentry/sentry.utils.ts index 632ea1351a..d511b7000f 100644 --- a/packages/core/src/lib/monitoring/sentry/sentry.utils.ts +++ b/packages/core/src/lib/monitoring/sentry/sentry.utils.ts @@ -1,9 +1,12 @@ import { setUser } from '@sentry/angular-ivy'; -import { SentryMonitoringOptions } from './sentry.interface'; + import { BaseUser } from '../../user'; +import { SentryMonitoringOptions } from './sentry.interface'; export const isTracingEnabled = (options: SentryMonitoringOptions): boolean => - options.enableTracing || !!options.tracesSampleRate || !!options.tracesSampler; + options.enableTracing || + !!options.tracesSampleRate || + !!options.tracesSampler; export const identifySentryUser = (user: BaseUser | null): void => { setUser( diff --git a/packages/core/src/lib/monitoring/shared/any-monitoring.interface.ts b/packages/core/src/lib/monitoring/shared/any-monitoring.interface.ts index 1560f689aa..4d2daa0a9f 100644 --- a/packages/core/src/lib/monitoring/shared/any-monitoring.interface.ts +++ b/packages/core/src/lib/monitoring/shared/any-monitoring.interface.ts @@ -1,3 +1,3 @@ -import { SentryMonitoringOptions } from "../sentry/sentry.interface"; +import { SentryMonitoringOptions } from '../sentry/sentry.interface'; export type AnyMonitoringOptions = SentryMonitoringOptions; diff --git a/packages/geo/package.json b/packages/geo/package.json index 20142433ba..f9904375f1 100644 --- a/packages/geo/package.json +++ b/packages/geo/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build geo --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint geo", + "lint.fix": "ng lint geo --fix", "postbuild": "ts-node ../../scripts/src/geo/postbuild-geo.ts", "test": "ng test geo --watch=false", "watch": "ng build geo --watch" @@ -50,6 +52,7 @@ "@angular/core": "^17.0.6", "@angular/forms": "^17.0.6", "@angular/material": "^17.0.3", + "@angular/material-moment-adapter": "^17.1.0", "@angular/platform-browser": "^17.0.6", "@igo2/common": "*", "@igo2/core": "*", @@ -64,8 +67,8 @@ "moment": "^2.29.4", "ngx-color-picker": "^14.0.0", "ngx-indexed-db": "^11.0.2", - "ol-mapbox-style": "^12.0.0", "ol": "^7.5.2", + "ol-mapbox-style": "^12.0.0", "proj4": "^2.9.0", "rxjs": "^7.8.0", "striptags": "^3.2.0" diff --git a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-group.component.ts b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-group.component.ts index b8331c3b71..021d6ca468 100644 --- a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-group.component.ts +++ b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-group.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,10 +8,19 @@ import { OnInit, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { + CollapseDirective, + EntityStore, + ListItemDirective +} from '@igo2/common'; import type { EntityStateManager } from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { IgoMap } from '../../map/shared/map'; @@ -23,6 +33,7 @@ import { CatalogItemState, CatalogItemType } from '../shared'; +import { CatalogBrowserLayerComponent } from './catalog-browser-layer.component'; /** * Catalog browser group item @@ -31,7 +42,21 @@ import { selector: 'igo-catalog-browser-group', templateUrl: './catalog-browser-group.component.html', styleUrls: ['./catalog-browser-group.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + MatIconModule, + CollapseDirective, + MatTooltipModule, + NgIf, + MatButtonModule, + NgFor, + CatalogBrowserLayerComponent, + ListItemDirective, + AsyncPipe, + TranslateModule + ] }) export class CatalogBrowserGroupComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-layer.component.ts b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-layer.component.ts index ceca0ee609..9e6b3fb15b 100644 --- a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-layer.component.ts +++ b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser-layer.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,15 +8,27 @@ import { OnInit, Output } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { getEntityIcon, getEntityTitle } from '@igo2/common'; +import { + IgoBadgeIconDirective, + getEntityIcon, + getEntityTitle +} from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { first } from 'rxjs/operators'; +import { LayerLegendComponent } from '../../layer/layer-legend/layer-legend.component'; import { LayerService } from '../../layer/shared/layer.service'; import { Layer, TooltipType } from '../../layer/shared/layers'; import { IgoMap } from '../../map/shared/map'; +import { MetadataButtonComponent } from '../../metadata/metadata-button/metadata-button.component'; import { MetadataLayerOptions } from '../../metadata/shared/metadata.interface'; import { AddedChangeEmitter, CatalogItemLayer } from '../shared'; @@ -26,7 +39,22 @@ import { AddedChangeEmitter, CatalogItemLayer } from '../shared'; selector: 'igo-catalog-browser-layer', templateUrl: './catalog-browser-layer.component.html', styleUrls: ['./catalog-browser-layer.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + NgIf, + MatIconModule, + NgClass, + MatTooltipModule, + MatButtonModule, + MetadataButtonComponent, + MatBadgeModule, + IgoBadgeIconDirective, + LayerLegendComponent, + AsyncPipe, + TranslateModule + ] }) export class CatalogBrowserLayerComponent implements OnInit, OnDestroy { public inRange$: BehaviorSubject = new BehaviorSubject(true); diff --git a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts index f4d6280c9a..7613376f36 100644 --- a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts +++ b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -7,7 +8,12 @@ import { OnInit } from '@angular/core'; -import { EntityStore, EntityStoreWatcher } from '@igo2/common'; +import { + EntityStore, + EntityStoreWatcher, + ListComponent, + ListItemDirective +} from '@igo2/common'; import { BehaviorSubject, zip } from 'rxjs'; @@ -24,6 +30,8 @@ import { CatalogItemState, CatalogItemType } from '../shared'; +import { CatalogBrowserGroupComponent } from './catalog-browser-group.component'; +import { CatalogBrowserLayerComponent } from './catalog-browser-layer.component'; /** * Component to browse a catalog's groups and layers and display them on a map. @@ -31,7 +39,17 @@ import { @Component({ selector: 'igo-catalog-browser', templateUrl: './catalog-browser.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + ListComponent, + NgFor, + NgIf, + CatalogBrowserGroupComponent, + CatalogBrowserLayerComponent, + ListItemDirective, + AsyncPipe + ] }) export class CatalogBrowserComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.module.ts b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.module.ts index 477cc5b758..d4d14d095c 100644 --- a/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.module.ts +++ b/packages/geo/src/lib/catalog/catalog-browser/catalog-browser.module.ts @@ -1,47 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { - IgoCollapsibleModule, - IgoListModule, - IgoMatBadgeIconModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoLayerModule } from '../../layer/layer.module'; -import { IgoMetadataModule } from './../../metadata/metadata.module'; -import { CatalogBrowserGroupComponent } from './catalog-browser-group.component'; -import { CatalogBrowserLayerComponent } from './catalog-browser-layer.component'; import { CatalogBrowserComponent } from './catalog-browser.component'; /** - * @ignore + * @deprecated import the CatalogBrowserComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatBadgeModule, - MatButtonModule, - MatIconModule, - MatListModule, - MatTooltipModule, - IgoMatBadgeIconModule, - IgoLanguageModule, - IgoListModule, - IgoCollapsibleModule, - IgoMetadataModule, - IgoLayerModule - ], - exports: [CatalogBrowserComponent], - declarations: [ - CatalogBrowserComponent, - CatalogBrowserGroupComponent, - CatalogBrowserLayerComponent - ] + imports: [CatalogBrowserComponent], + exports: [CatalogBrowserComponent] }) export class IgoCatalogBrowserModule {} diff --git a/packages/geo/src/lib/catalog/catalog-library/add-catalog-dialog.component.ts b/packages/geo/src/lib/catalog/catalog-library/add-catalog-dialog.component.ts index 6edfe666e2..e01189dc9b 100644 --- a/packages/geo/src/lib/catalog/catalog-library/add-catalog-dialog.component.ts +++ b/packages/geo/src/lib/catalog/catalog-library/add-catalog-dialog.component.ts @@ -1,14 +1,32 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component, Inject, OnDestroy, OnInit, Optional } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { EntityStore } from '@igo2/common'; import { ConfigService, LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { TypeCapabilities } from '../../datasource/shared/capabilities.interface'; @@ -17,7 +35,27 @@ import { Catalog } from '../shared/catalog.abstract'; @Component({ selector: 'igo-add-catalog-dialog', templateUrl: './add-catalog-dialog.component.html', - styleUrls: ['./add-catalog-dialog.component.scss'] + styleUrls: ['./add-catalog-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatAutocompleteModule, + NgFor, + MatOptionModule, + MatTooltipModule, + MatSelectModule, + MatListModule, + NgIf, + MatDialogActions, + MatButtonModule, + AsyncPipe, + TranslateModule + ] }) export class AddCatalogDialogComponent implements OnInit, OnDestroy { public form: UntypedFormGroup; diff --git a/packages/geo/src/lib/catalog/catalog-library/catalog-library-item.component.ts b/packages/geo/src/lib/catalog/catalog-library/catalog-library-item.component.ts index f289d1d689..16935f4628 100644 --- a/packages/geo/src/lib/catalog/catalog-library/catalog-library-item.component.ts +++ b/packages/geo/src/lib/catalog/catalog-library/catalog-library-item.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,9 +6,15 @@ import { Input, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { getEntityTitle } from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; + import { IgoMap } from '../../map/shared/map'; import { Catalog } from '../shared/catalog.abstract'; @@ -18,7 +25,16 @@ import { Catalog } from '../shared/catalog.abstract'; selector: 'igo-catalog-library-item', templateUrl: './catalog-library-item.component.html', styleUrls: ['./catalog-library-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + NgIf, + MatIconModule, + MatTooltipModule, + MatButtonModule, + TranslateModule + ] }) export class CatalogLibaryItemComponent { /** diff --git a/packages/geo/src/lib/catalog/catalog-library/catalog-library.component.ts b/packages/geo/src/lib/catalog/catalog-library/catalog-library.component.ts index 8d284e659c..29ac1a8ce4 100644 --- a/packages/geo/src/lib/catalog/catalog-library/catalog-library.component.ts +++ b/packages/geo/src/lib/catalog/catalog-library/catalog-library.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,12 +8,16 @@ import { OnInit, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { EntityStore, ListComponent, ListItemDirective } from '@igo2/common'; import { MessageService, StorageService } from '@igo2/core'; import { ObjectUtils } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable, Subscription } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { Md5 } from 'ts-md5'; @@ -22,6 +27,7 @@ import { IgoMap } from '../../map/shared/map'; import { standardizeUrl } from '../../utils/id-generator'; import { Catalog } from '../shared/catalog.abstract'; import { AddCatalogDialogComponent } from './add-catalog-dialog.component'; +import { CatalogLibaryItemComponent } from './catalog-library-item.component'; /** * Component to browse a list of available catalogs @@ -30,7 +36,20 @@ import { AddCatalogDialogComponent } from './add-catalog-dialog.component'; selector: 'igo-catalog-library', templateUrl: './catalog-library.component.html', styleUrls: ['./catalog-library.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + ListComponent, + NgFor, + CatalogLibaryItemComponent, + ListItemDirective, + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class CatalogLibaryComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/catalog/catalog-library/catalog-library.module.ts b/packages/geo/src/lib/catalog/catalog-library/catalog-library.module.ts index 7e9d2c7a44..4256816157 100644 --- a/packages/geo/src/lib/catalog/catalog-library/catalog-library.module.ts +++ b/packages/geo/src/lib/catalog/catalog-library/catalog-library.module.ts @@ -1,49 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoListModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { AddCatalogDialogComponent } from './add-catalog-dialog.component'; -import { CatalogLibaryItemComponent } from './catalog-library-item.component'; import { CatalogLibaryComponent } from './catalog-library.component'; /** - * @ignore + * @deprecated import the CatalogLibaryComponent, AddCatalogDialogComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatBadgeModule, - MatListModule, - MatTooltipModule, - IgoListModule, - IgoLanguageModule, - MatButtonModule, - MatFormFieldModule, - ReactiveFormsModule, - MatInputModule, - MatSelectModule, - MatAutocompleteModule, - MatDialogModule - ], - exports: [CatalogLibaryComponent, AddCatalogDialogComponent], - declarations: [ - CatalogLibaryComponent, - CatalogLibaryItemComponent, - AddCatalogDialogComponent - ] + imports: [CatalogLibaryComponent, AddCatalogDialogComponent], + exports: [CatalogLibaryComponent, AddCatalogDialogComponent] }) export class IgoCatalogLibraryModule {} diff --git a/packages/geo/src/lib/catalog/catalog-library/index.ts b/packages/geo/src/lib/catalog/catalog-library/index.ts new file mode 100644 index 0000000000..d7c00a91b2 --- /dev/null +++ b/packages/geo/src/lib/catalog/catalog-library/index.ts @@ -0,0 +1,10 @@ +import { AddCatalogDialogComponent } from './add-catalog-dialog.component'; +import { CatalogLibaryComponent } from './catalog-library.component'; + +export * from './add-catalog-dialog.component'; +export * from './catalog-library.component'; + +export const CATALOG_LIBRARY_DIRECTIVES = [ + CatalogLibaryComponent, + AddCatalogDialogComponent +] as const; diff --git a/packages/geo/src/lib/catalog/catalog.module.ts b/packages/geo/src/lib/catalog/catalog.module.ts index 4203d7b6f5..0f435caf99 100644 --- a/packages/geo/src/lib/catalog/catalog.module.ts +++ b/packages/geo/src/lib/catalog/catalog.module.ts @@ -1,31 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatIconModule } from '@angular/material/icon'; -import { MatListModule } from '@angular/material/list'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { - IgoCollapsibleModule, - IgoListModule, - IgoMatBadgeIconModule -} from '@igo2/common'; import { IgoCatalogBrowserModule } from './catalog-browser/catalog-browser.module'; import { IgoCatalogLibraryModule } from './catalog-library/catalog-library.module'; +/** + * @deprecated import the components directly or the CATALOG_DIRECTIVES + */ @NgModule({ - imports: [ - CommonModule, - MatBadgeModule, - MatIconModule, - MatListModule, - MatTooltipModule, - IgoMatBadgeIconModule, - IgoListModule, - IgoCollapsibleModule - ], - exports: [IgoCatalogBrowserModule, IgoCatalogLibraryModule], - declarations: [] + exports: [IgoCatalogBrowserModule, IgoCatalogLibraryModule] }) export class IgoCatalogModule {} diff --git a/packages/geo/src/lib/catalog/index.ts b/packages/geo/src/lib/catalog/index.ts index a1b53a6af3..70ea993c38 100644 --- a/packages/geo/src/lib/catalog/index.ts +++ b/packages/geo/src/lib/catalog/index.ts @@ -1,4 +1,12 @@ +import { CatalogBrowserComponent } from './catalog-browser/catalog-browser.component'; +import { CATALOG_LIBRARY_DIRECTIVES } from './catalog-library'; + export * from './shared'; export * from './catalog-browser/catalog-browser.component'; export * from './catalog-library/catalog-library.component'; export * from './catalog-library/add-catalog-dialog.component'; + +export const CATALOG_DIRECTIVES = [ + ...CATALOG_LIBRARY_DIRECTIVES, + CatalogBrowserComponent +] as const; diff --git a/packages/geo/src/lib/datasource/datasource.module.ts b/packages/geo/src/lib/datasource/datasource.module.ts deleted file mode 100644 index e19501b1ec..0000000000 --- a/packages/geo/src/lib/datasource/datasource.module.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ModuleWithProviders, NgModule } from '@angular/core'; - -@NgModule({ - imports: [], - exports: [], - declarations: [] -}) -export class IgoDataSourceModule { - static forRoot(): ModuleWithProviders { - return { - ngModule: IgoDataSourceModule, - providers: [] - }; - } -} diff --git a/packages/geo/src/lib/datasource/shared/datasources/wms-wfs.utils.ts b/packages/geo/src/lib/datasource/shared/datasources/wms-wfs.utils.ts index 827e60fcf3..c4c531a806 100644 --- a/packages/geo/src/lib/datasource/shared/datasources/wms-wfs.utils.ts +++ b/packages/geo/src/lib/datasource/shared/datasources/wms-wfs.utils.ts @@ -118,8 +118,8 @@ export function formatWFSQueryString( let cnt = count ? `${paramMaxFeatures}=${effectiveCount}` : paramsWFS.maxFeatures - ? `${paramMaxFeatures}=${paramsWFS.maxFeatures}` - : `${paramMaxFeatures}=${effectiveCount}`; + ? `${paramMaxFeatures}=${paramsWFS.maxFeatures}` + : `${paramMaxFeatures}=${effectiveCount}`; if (forceDefaultOutputFormat) { outputFormat = ''; version = 'version=1.1.0'; @@ -129,8 +129,8 @@ export function formatWFSQueryString( const srs = epsg ? `srsname=${epsgCode}` : paramsWFS.srsName - ? 'srsname=' + paramsWFS.srsName - : `srsname=${epsgCode}`; + ? 'srsname=' + paramsWFS.srsName + : `srsname=${epsgCode}`; let propertyName = ''; let valueReference = ''; diff --git a/packages/geo/src/lib/directions/directions-buttons/directions-buttons.component.ts b/packages/geo/src/lib/directions/directions-buttons/directions-buttons.component.ts index a0371a317f..02385d8bc9 100644 --- a/packages/geo/src/lib/directions/directions-buttons/directions-buttons.component.ts +++ b/packages/geo/src/lib/directions/directions-buttons/directions-buttons.component.ts @@ -1,8 +1,13 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { Component, Input, Optional } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { LanguageService, MessageService, RouteService } from '@igo2/core'; import { Clipboard } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subject } from 'rxjs'; import { roundCoordTo } from '../../map/shared/map.utils'; @@ -23,7 +28,16 @@ import { @Component({ selector: 'igo-directions-buttons', templateUrl: './directions-buttons.component.html', - styleUrls: ['./directions-buttons.component.scss'] + styleUrls: ['./directions-buttons.component.scss'], + standalone: true, + imports: [ + MatButtonModule, + MatTooltipModule, + MatIconModule, + NgIf, + AsyncPipe, + TranslateModule + ] }) export class DirectionsButtonsComponent { get activeRoute() { diff --git a/packages/geo/src/lib/directions/directions-inputs/directions-inputs.component.ts b/packages/geo/src/lib/directions/directions-inputs/directions-inputs.component.ts index 32e3c94843..0419139327 100644 --- a/packages/geo/src/lib/directions/directions-inputs/directions-inputs.component.ts +++ b/packages/geo/src/lib/directions/directions-inputs/directions-inputs.component.ts @@ -1,4 +1,11 @@ -import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; +import { + CdkDrag, + CdkDragDrop, + CdkDragHandle, + CdkDropList, + moveItemInArray +} from '@angular/cdk/drag-drop'; +import { AsyncPipe, NgClass, NgFor, NgIf } from '@angular/common'; import { Component, EventEmitter, @@ -6,14 +13,24 @@ import { OnDestroy, Output } from '@angular/core'; -import { MatAutocomplete } from '@angular/material/autocomplete'; -import { MatOption } from '@angular/material/core'; +import { FormsModule } from '@angular/forms'; +import { + MatAutocomplete, + MatAutocompleteModule +} from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOption, MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { LanguageService } from '@igo2/core'; import * as olObservable from 'ol/Observable'; import * as olProj from 'ol/proj'; +import { TranslateModule } from '@ngx-translate/core'; import pointOnFeature from '@turf/point-on-feature'; import { Feature } from '../../feature/shared/feature.interfaces'; @@ -30,7 +47,26 @@ import { StopsFeatureStore, StopsStore } from '../shared/store'; @Component({ selector: 'igo-directions-inputs', templateUrl: './directions-inputs.component.html', - styleUrls: ['./directions-inputs.component.scss'] + styleUrls: ['./directions-inputs.component.scss'], + standalone: true, + imports: [ + CdkDropList, + NgFor, + CdkDrag, + NgClass, + MatFormFieldModule, + MatInputModule, + FormsModule, + MatAutocompleteModule, + MatTooltipModule, + NgIf, + MatButtonModule, + MatIconModule, + MatOptionModule, + CdkDragHandle, + AsyncPipe, + TranslateModule + ] }) export class DirectionsInputsComponent implements OnDestroy { private readonly invalidKeys = ['Control', 'Shift', 'Alt']; diff --git a/packages/geo/src/lib/directions/directions-results/directions-results.component.ts b/packages/geo/src/lib/directions/directions-results/directions-results.component.ts index 3afb82bc91..e52ad98ceb 100644 --- a/packages/geo/src/lib/directions/directions-results/directions-results.component.ts +++ b/packages/geo/src/lib/directions/directions-results/directions-results.component.ts @@ -1,3 +1,4 @@ +import { NgClass, NgFor, NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -5,6 +6,13 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; import { LanguageService } from '@igo2/core'; @@ -12,6 +20,7 @@ import olFeature from 'ol/Feature'; import OlGeoJSON from 'ol/format/GeoJSON'; import * as olGeom from 'ol/geom'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; @@ -33,7 +42,21 @@ import { RoutesFeatureStore, StepFeatureStore } from '../shared/store'; @Component({ selector: 'igo-directions-results', templateUrl: './directions-results.component.html', - styleUrls: ['./directions-results.component.scss'] + styleUrls: ['./directions-results.component.scss'], + standalone: true, + imports: [ + NgIf, + MatFormFieldModule, + MatSelectModule, + FormsModule, + NgFor, + MatOptionModule, + MatDividerModule, + MatListModule, + MatIconModule, + NgClass, + TranslateModule + ] }) export class DirectionsResultsComponent implements OnInit, OnDestroy { public activeDirection: Direction; diff --git a/packages/geo/src/lib/directions/directions.component.ts b/packages/geo/src/lib/directions/directions.component.ts index 5840774a4b..f051917302 100644 --- a/packages/geo/src/lib/directions/directions.component.ts +++ b/packages/geo/src/lib/directions/directions.component.ts @@ -5,6 +5,7 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { EntityStoreWatcher } from '@igo2/common'; import { LanguageService } from '@igo2/core'; @@ -17,6 +18,7 @@ import { SelectEvent } from 'ol/interaction/Select'; import { TranslateEvent } from 'ol/interaction/Translate'; import * as olProj from 'ol/proj'; +import { TranslateModule } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, map } from 'rxjs/operators'; @@ -26,6 +28,9 @@ import { roundCoordTo, stringToLonLat } from '../map'; import { QueryService } from '../query/shared/query.service'; import { Research, SearchResult } from '../search/shared/search.interfaces'; import { SearchService } from '../search/shared/search.service'; +import { DirectionsButtonsComponent } from './directions-buttons/directions-buttons.component'; +import { DirectionsInputsComponent } from './directions-inputs/directions-inputs.component'; +import { DirectionsResultsComponent } from './directions-results/directions-results.component'; import { DirectionType, ProposalType } from './shared/directions.enum'; import { DirectionOptions, @@ -52,7 +57,15 @@ import { @Component({ selector: 'igo-directions', templateUrl: './directions.component.html', - styleUrls: ['./directions.component.scss'] + styleUrls: ['./directions.component.scss'], + standalone: true, + imports: [ + MatSlideToggleModule, + DirectionsButtonsComponent, + DirectionsInputsComponent, + DirectionsResultsComponent, + TranslateModule + ] }) export class DirectionsComponent implements OnInit, OnDestroy { private watcher: EntityStoreWatcher; diff --git a/packages/geo/src/lib/directions/directions.module.ts b/packages/geo/src/lib/directions/directions.module.ts index f9999364e3..292603ddab 100644 --- a/packages/geo/src/lib/directions/directions.module.ts +++ b/packages/geo/src/lib/directions/directions.module.ts @@ -1,20 +1,4 @@ -import { DragDropModule } from '@angular/cdk/drag-drop'; -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatButtonModule } from '@angular/material/button'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { IgoSearchModule } from '../search/search.module'; import { DirectionsButtonsComponent } from './directions-buttons/directions-buttons.component'; @@ -25,31 +9,13 @@ import { provideDirectionsSourceService } from './shared/directions-source.servi @NgModule({ imports: [ - CommonModule, - DragDropModule, - FormsModule, - ReactiveFormsModule, - MatIconModule, - MatButtonModule, - MatListModule, - MatDividerModule, - MatFormFieldModule, - MatInputModule, - MatOptionModule, - MatSelectModule, - MatSlideToggleModule, - MatTooltipModule, - MatAutocompleteModule, - IgoLanguageModule, - IgoSearchModule.forRoot() - ], - exports: [ + IgoSearchModule.forRoot(), DirectionsComponent, DirectionsInputsComponent, DirectionsButtonsComponent, DirectionsResultsComponent ], - declarations: [ + exports: [ DirectionsComponent, DirectionsInputsComponent, DirectionsButtonsComponent, @@ -58,6 +24,9 @@ import { provideDirectionsSourceService } from './shared/directions-source.servi providers: [provideDirectionsSourceService()] }) export class IgoDirectionsModule { + /** + * @deprecated it has no effect + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoDirectionsModule diff --git a/packages/geo/src/lib/download/download-button/download-button.component.ts b/packages/geo/src/lib/download/download-button/download-button.component.ts index e42f297a34..22f7e9ab4c 100644 --- a/packages/geo/src/lib/download/download-button/download-button.component.ts +++ b/packages/geo/src/lib/download/download-button/download-button.component.ts @@ -1,4 +1,10 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { Layer } from '../../layer/shared/layers/layer'; import { DownloadDataSourceOptions } from '../shared/download.interface'; @@ -8,7 +14,15 @@ import { DownloadService } from '../shared/download.service'; selector: 'igo-download-button', templateUrl: './download-button.component.html', styleUrls: ['./download-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class DownloadButtonComponent { @Input() diff --git a/packages/geo/src/lib/download/download.module.ts b/packages/geo/src/lib/download/download.module.ts index d5bffb01fd..eb40d88b16 100644 --- a/packages/geo/src/lib/download/download.module.ts +++ b/packages/geo/src/lib/download/download.module.ts @@ -1,23 +1,13 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { DownloadButtonComponent } from './download-button/download-button.component'; +/** + * @deprecated import the DownloadButtonComponent directly + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - IgoLanguageModule - ], - exports: [DownloadButtonComponent], - declarations: [DownloadButtonComponent] + imports: [DownloadButtonComponent], + exports: [DownloadButtonComponent] }) export class IgoDownloadModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/draw/draw/draw-layer-popup.component.ts b/packages/geo/src/lib/draw/draw/draw-layer-popup.component.ts index db0b216ceb..1b1d77e468 100644 --- a/packages/geo/src/lib/draw/draw/draw-layer-popup.component.ts +++ b/packages/geo/src/lib/draw/draw/draw-layer-popup.component.ts @@ -1,5 +1,14 @@ import { Component, Input } from '@angular/core'; -import { MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MatDialogActions, + MatDialogContent, + MatDialogRef +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; + +import { TranslateModule } from '@ngx-translate/core'; export interface DialogData { label: string; @@ -8,7 +17,16 @@ export interface DialogData { @Component({ selector: 'igo-draw-popup-component', templateUrl: './draw-layer-popup.component.html', - styleUrls: ['./draw-layer-popup.component.scss'] + styleUrls: ['./draw-layer-popup.component.scss'], + standalone: true, + imports: [ + MatDialogContent, + MatFormFieldModule, + MatInputModule, + MatDialogActions, + MatButtonModule, + TranslateModule + ] }) export class DrawLayerPopupComponent { @Input() confirmFlag: boolean = false; diff --git a/packages/geo/src/lib/draw/draw/draw-popup.component.ts b/packages/geo/src/lib/draw/draw/draw-popup.component.ts index a874328046..ac7d470f8a 100644 --- a/packages/geo/src/lib/draw/draw/draw-popup.component.ts +++ b/packages/geo/src/lib/draw/draw/draw-popup.component.ts @@ -1,5 +1,20 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, Inject, Input } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOptionModule } from '@angular/material/core'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelectModule } from '@angular/material/select'; import { LanguageService } from '@igo2/core'; @@ -9,6 +24,8 @@ import { fromCircle } from 'ol/geom/Polygon'; import { transform } from 'ol/proj'; import { getLength } from 'ol/sphere'; +import { TranslateModule } from '@ngx-translate/core'; + import { IgoMap, roundCoordTo } from '../../map/shared'; import { MeasureAreaUnit, @@ -28,7 +45,24 @@ import { DDtoDMS } from '../shared/draw.utils'; @Component({ selector: 'igo-draw-popup-component', templateUrl: './draw-popup.component.html', - styleUrls: ['./draw-popup.component.scss'] + styleUrls: ['./draw-popup.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + NgIf, + MatDialogContent, + MatButtonToggleModule, + MatRadioModule, + NgFor, + MatCheckboxModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + MatOptionModule, + MatDialogActions, + MatButtonModule, + TranslateModule + ] }) export class DrawPopupComponent { @Input() confirmFlag: boolean = false; diff --git a/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts b/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts index 52f70c1741..9f199b6380 100644 --- a/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts +++ b/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts @@ -1,8 +1,26 @@ import { Component } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { + MatDialogActions, + MatDialogClose, + MatDialogContent +} from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; + +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'igo-draw-shorcuts', templateUrl: './draw-shorcuts.component.html', - styleUrls: ['./draw-shorcuts.component.scss'] + styleUrls: ['./draw-shorcuts.component.scss'], + standalone: true, + imports: [ + MatDialogContent, + MatIconModule, + MatDialogActions, + MatButtonModule, + MatDialogClose, + TranslateModule + ] }) export class DrawShorcutsComponent {} diff --git a/packages/geo/src/lib/draw/draw/draw.component.ts b/packages/geo/src/lib/draw/draw/draw.component.ts index c56328f50b..780ac19c26 100644 --- a/packages/geo/src/lib/draw/draw/draw.component.ts +++ b/packages/geo/src/lib/draw/draw/draw.component.ts @@ -5,6 +5,7 @@ import { transition, trigger } from '@angular/animations'; +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -16,16 +17,30 @@ import { ViewChild } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { EntityRecord, EntityTableButton, EntityTableColumnRenderer, + EntityTableComponent, EntityTableTemplate } from '@igo2/common'; import { LanguageService } from '@igo2/core'; @@ -45,6 +60,7 @@ import OlVectorSource from 'ol/source/Vector'; import { getDistance, getLength } from 'ol/sphere'; import * as OlStyle from 'ol/style'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { first, skip } from 'rxjs/operators'; @@ -110,7 +126,28 @@ import { DrawShorcutsComponent } from './draw-shorcuts.component'; ], templateUrl: './draw.component.html', styleUrls: ['./draw.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatButtonToggleModule, + MatSlideToggleModule, + NgIf, + MatFormFieldModule, + MatInputModule, + FormsModule, + ReactiveFormsModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatDividerModule, + MatButtonModule, + MatTooltipModule, + MatIconModule, + EntityTableComponent, + MatBadgeModule, + AsyncPipe, + TranslateModule + ] }) export class DrawComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/draw/draw/draw.module.ts b/packages/geo/src/lib/draw/draw/draw.module.ts index 97fa765db0..f596ecb95a 100644 --- a/packages/geo/src/lib/draw/draw/draw.module.ts +++ b/packages/geo/src/lib/draw/draw/draw.module.ts @@ -1,61 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoEntityTableModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; - -import { DrawLayerPopupComponent } from './draw-layer-popup.component'; -import { DrawPopupComponent } from './draw-popup.component'; -import { DrawShorcutsComponent } from './draw-shorcuts.component'; import { DrawComponent } from './draw.component'; /** - * @ignore + * @deprecated import the DrawComponent directly */ @NgModule({ - imports: [ - FormsModule, - ReactiveFormsModule, - CommonModule, - MatButtonModule, - MatButtonToggleModule, - MatDividerModule, - MatFormFieldModule, - MatIconModule, - MatBadgeModule, - MatTooltipModule, - MatFormFieldModule, - MatInputModule, - MatListModule, - MatSelectModule, - MatSlideToggleModule, - MatDialogModule, - IgoLanguageModule, - IgoEntityTableModule, - MatRadioModule, - MatCheckboxModule - ], - declarations: [ - DrawComponent, - DrawPopupComponent, - DrawLayerPopupComponent, - DrawShorcutsComponent - ], + imports: [DrawComponent], exports: [DrawComponent] }) export class IgoDrawModule {} diff --git a/packages/geo/src/lib/draw/drawingTool.module.ts b/packages/geo/src/lib/draw/drawingTool.module.ts index 302e472eea..f03612092c 100644 --- a/packages/geo/src/lib/draw/drawingTool.module.ts +++ b/packages/geo/src/lib/draw/drawingTool.module.ts @@ -2,9 +2,10 @@ import { NgModule } from '@angular/core'; import { IgoDrawModule } from './draw/draw.module'; +/** + * @deprecated import the DrawComponent directly + */ @NgModule({ - imports: [], - declarations: [], exports: [IgoDrawModule] }) export class IgoDrawingToolModule {} diff --git a/packages/geo/src/lib/feature/feature-details/feature-details.component.ts b/packages/geo/src/lib/feature/feature-details/feature-details.component.ts index 301bec0312..641b9222ef 100644 --- a/packages/geo/src/lib/feature/feature-details/feature-details.component.ts +++ b/packages/geo/src/lib/feature/feature-details/feature-details.component.ts @@ -1,3 +1,11 @@ +import { + AsyncPipe, + JsonPipe, + KeyValuePipe, + NgFor, + NgIf, + NgStyle +} from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { ChangeDetectionStrategy, @@ -9,14 +17,21 @@ import { OnInit, Output } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; -import { getEntityIcon, getEntityTitle } from '@igo2/common'; +import { + ImageErrorDirective, + SecureImagePipe, + getEntityIcon, + getEntityTitle +} from '@igo2/common'; import type { Toolbox } from '@igo2/common'; import { ConnectionState, MessageService, NetworkService } from '@igo2/core'; import { ConfigService } from '@igo2/core'; import { Clipboard } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -28,7 +43,20 @@ import { Feature } from '../shared'; selector: 'igo-feature-details', templateUrl: './feature-details.component.html', styleUrls: ['./feature-details.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + NgFor, + MatIconModule, + NgStyle, + ImageErrorDirective, + AsyncPipe, + JsonPipe, + KeyValuePipe, + TranslateModule, + SecureImagePipe + ] }) export class FeatureDetailsComponent implements OnInit, OnDestroy { private state: ConnectionState; diff --git a/packages/geo/src/lib/feature/feature-details/feature-details.directive.ts b/packages/geo/src/lib/feature/feature-details/feature-details.directive.ts index 30905ee5b0..37c7777f8a 100644 --- a/packages/geo/src/lib/feature/feature-details/feature-details.directive.ts +++ b/packages/geo/src/lib/feature/feature-details/feature-details.directive.ts @@ -14,7 +14,8 @@ import { FeatureDetailsComponent } from './feature-details.component'; @Directive({ // This directive allow to view the route between the user coordinates and the feature - selector: '[igoFeatureDetailsDirective]' + selector: '[igoFeatureDetailsDirective]', + standalone: true }) export class FeatureDetailsDirective implements OnInit { private component: FeatureDetailsComponent; diff --git a/packages/geo/src/lib/feature/feature-details/feature-details.module.ts b/packages/geo/src/lib/feature/feature-details/feature-details.module.ts index 1d05c8493b..2f1f2bfcc5 100644 --- a/packages/geo/src/lib/feature/feature-details/feature-details.module.ts +++ b/packages/geo/src/lib/feature/feature-details/feature-details.module.ts @@ -1,25 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatIconModule } from '@angular/material/icon'; - -import { IgoImageModule, IgoKeyValueModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { FeatureDetailsComponent } from './feature-details.component'; import { FeatureDetailsDirective } from './feature-details.directive'; /** - * @ignore + * @deprecated import the FeatureDetailsComponent, FeatureDetailsDirective directly or the FEATURE_DETAILS_DIRECTIVES for all */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - IgoLanguageModule, - IgoKeyValueModule, - IgoImageModule - ], - exports: [FeatureDetailsComponent, FeatureDetailsDirective], - declarations: [FeatureDetailsComponent, FeatureDetailsDirective] + imports: [FeatureDetailsComponent, FeatureDetailsDirective], + exports: [FeatureDetailsComponent, FeatureDetailsDirective] }) export class IgoFeatureDetailsModule {} diff --git a/packages/geo/src/lib/feature/feature-details/index.ts b/packages/geo/src/lib/feature/feature-details/index.ts new file mode 100644 index 0000000000..90834e59ef --- /dev/null +++ b/packages/geo/src/lib/feature/feature-details/index.ts @@ -0,0 +1,10 @@ +import { FeatureDetailsComponent } from './feature-details.component'; +import { FeatureDetailsDirective } from './feature-details.directive'; + +export * from './feature-details.component'; +export * from './feature-details.directive'; + +export const FEATURE_DETAILS_DIRECTIVES = [ + FeatureDetailsComponent, + FeatureDetailsDirective +] as const; diff --git a/packages/geo/src/lib/feature/feature-form/feature-form.component.ts b/packages/geo/src/lib/feature/feature-form/feature-form.component.ts index 767c7e5647..83d082a7a2 100644 --- a/packages/geo/src/lib/feature/feature-form/feature-form.component.ts +++ b/packages/geo/src/lib/feature/feature-form/feature-form.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -8,7 +9,7 @@ import { } from '@angular/core'; import { Form, getEntityRevision } from '@igo2/common'; -import type { FormComponent } from '@igo2/common'; +import { FormComponent } from '@igo2/common'; import { uuid } from '@igo2/utils'; import { BehaviorSubject } from 'rxjs'; @@ -27,7 +28,9 @@ import { Feature, FeatureMeta } from '../shared/feature.interfaces'; selector: 'igo-feature-form', templateUrl: './feature-form.component.html', styleUrls: ['./feature-form.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [FormComponent, AsyncPipe] }) export class FeatureFormComponent { /** diff --git a/packages/geo/src/lib/feature/feature-form/feature-form.module.ts b/packages/geo/src/lib/feature/feature-form/feature-form.module.ts index a01e2f6e3e..9219aeb47b 100644 --- a/packages/geo/src/lib/feature/feature-form/feature-form.module.ts +++ b/packages/geo/src/lib/feature/feature-form/feature-form.module.ts @@ -1,16 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { IgoFormModule } from '@igo2/common'; - import { FeatureFormComponent } from './feature-form.component'; /** - * @ignore + * @deprecated import the FeatureFormComponent directly */ @NgModule({ - imports: [CommonModule, IgoFormModule], - exports: [IgoFormModule, FeatureFormComponent], - declarations: [FeatureFormComponent] + imports: [FeatureFormComponent], + exports: [FeatureFormComponent] }) export class IgoFeatureFormModule {} diff --git a/packages/geo/src/lib/feature/feature.module.ts b/packages/geo/src/lib/feature/feature.module.ts index b05b45ad09..e3b6a7f673 100644 --- a/packages/geo/src/lib/feature/feature.module.ts +++ b/packages/geo/src/lib/feature/feature.module.ts @@ -1,13 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { IgoFeatureDetailsModule } from './feature-details/feature-details.module'; import { IgoFeatureFormModule } from './feature-form/feature-form.module'; +/** + * @deprecated import the components directly or the FEATURE_DIRECTIVES for the set + */ @NgModule({ - imports: [CommonModule], - exports: [IgoFeatureDetailsModule, IgoFeatureFormModule], - declarations: [], - providers: [] + exports: [IgoFeatureDetailsModule, IgoFeatureFormModule] }) export class IgoFeatureModule {} diff --git a/packages/geo/src/lib/feature/index.ts b/packages/geo/src/lib/feature/index.ts index c25ff1e5cd..b76439c793 100644 --- a/packages/geo/src/lib/feature/index.ts +++ b/packages/geo/src/lib/feature/index.ts @@ -1,3 +1,11 @@ +import { FEATURE_DETAILS_DIRECTIVES } from './feature-details'; +import { FeatureFormComponent } from './feature-form/feature-form.component'; + export * from './shared'; -export * from './feature-details/feature-details.component'; +export * from './feature-details'; export * from './feature-form/feature-form.component'; + +export const FEATURE_DIRECTIVES = [ + ...FEATURE_DETAILS_DIRECTIVES, + FeatureFormComponent +] as const; diff --git a/packages/geo/src/lib/feature/shared/feature.utils.ts b/packages/geo/src/lib/feature/shared/feature.utils.ts index 59a6e106a6..6eb96d70a0 100644 --- a/packages/geo/src/lib/feature/shared/feature.utils.ts +++ b/packages/geo/src/lib/feature/shared/feature.utils.ts @@ -211,8 +211,8 @@ export function featureFromOl( const id = olFeature.getId() ? olFeature.getId() : olFeature.get(idColumn) - ? olFeature.get(idColumn) - : uuid(); + ? olFeature.get(idColumn) + : uuid(); const newFeature = olFeature.get('_newFeature'); return { diff --git a/packages/geo/src/lib/filter/filter.module.ts b/packages/geo/src/lib/filter/filter.module.ts index 736afa4036..515d3ee365 100644 --- a/packages/geo/src/lib/filter/filter.module.ts +++ b/packages/geo/src/lib/filter/filter.module.ts @@ -1,44 +1,6 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatTableModule } from '@angular/material/table'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { MatTreeModule } from '@angular/material/tree'; +import { MAT_DATE_LOCALE } from '@angular/material/core'; -import { - IgoCollapsibleModule, - IgoDOMModule, - IgoEntityModule, - IgoKeyValueModule, - IgoListModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; - -import { - MatDatetimepickerModule, - MatNativeDatetimeModule -} from '@mat-datetimepicker/core'; - -import { IgoLayerModule } from '../layer/layer.module'; -import { IgoGeometryModule } from './../geometry/geometry.module'; import { OgcFilterButtonComponent } from './ogc-filter-button/ogc-filter-button.component'; import { OgcFilterFormComponent } from './ogc-filter-form/ogc-filter-form.component'; import { OgcFilterSelectionComponent } from './ogc-filter-selection/ogc-filter-selection.component'; @@ -62,83 +24,32 @@ import { TimeFilterItemComponent } from './time-filter-item/time-filter-item.com import { TimeFilterListBindingDirective } from './time-filter-list/time-filter-list-binding.directive'; import { TimeFilterListComponent } from './time-filter-list/time-filter-list.component'; +const DIRECTIVES = [ + FilterableDataSourcePipe, + TimeFilterButtonComponent, + TimeFilterFormComponent, + TimeFilterItemComponent, + TimeFilterListComponent, + TimeFilterListBindingDirective, + OgcFilterFormComponent, + OgcFilterButtonComponent, + OgcFilterSelectionComponent, + OgcFilterableFormComponent, + OgcFilterableItemComponent, + OgcFilterableListComponent, + OgcFilterableListBindingDirective, + SpatialFilterTypeComponent, + SpatialFilterListComponent, + SpatialFilterItemComponent, + OgcFilterTimeComponent, + OgcFilterTimeSliderComponent +]; +/** + * @deprecated import the components directly or the FILTER_DIRECTIVES for the set + */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MatAutocompleteModule, - MatIconModule, - MatButtonModule, - MatTabsModule, - MatRadioModule, - MatMenuModule, - MatTableModule, - MatTreeModule, - MatButtonToggleModule, - MatCheckboxModule, - MatSliderModule, - MatSlideToggleModule, - MatFormFieldModule, - MatInputModule, - MatOptionModule, - MatSelectModule, - MatListModule, - MatTooltipModule, - MatDatepickerModule, - MatNativeDateModule, - MatDatetimepickerModule, - MatNativeDatetimeModule, - IgoLanguageModule, - IgoLayerModule, - IgoCollapsibleModule, - IgoListModule, - IgoEntityModule, - IgoDOMModule, - IgoKeyValueModule, - IgoGeometryModule, - MatBadgeModule - ], - exports: [ - FilterableDataSourcePipe, - TimeFilterButtonComponent, - TimeFilterFormComponent, - TimeFilterItemComponent, - TimeFilterListComponent, - TimeFilterListBindingDirective, - OgcFilterFormComponent, - OgcFilterButtonComponent, - OgcFilterSelectionComponent, - OgcFilterableFormComponent, - OgcFilterableItemComponent, - OgcFilterableListComponent, - OgcFilterableListBindingDirective, - SpatialFilterTypeComponent, - SpatialFilterListComponent, - SpatialFilterItemComponent, - OgcFilterTimeComponent, - OgcFilterTimeSliderComponent - ], - declarations: [ - FilterableDataSourcePipe, - TimeFilterButtonComponent, - TimeFilterFormComponent, - TimeFilterItemComponent, - TimeFilterListComponent, - TimeFilterListBindingDirective, - OgcFilterFormComponent, - OgcFilterButtonComponent, - OgcFilterSelectionComponent, - OgcFilterableFormComponent, - OgcFilterableItemComponent, - OgcFilterableListComponent, - OgcFilterableListBindingDirective, - SpatialFilterTypeComponent, - SpatialFilterListComponent, - SpatialFilterItemComponent, - OgcFilterTimeComponent, - OgcFilterTimeSliderComponent - ], + imports: DIRECTIVES, + exports: DIRECTIVES, providers: [ TimeFilterService, OGCFilterService, diff --git a/packages/geo/src/lib/filter/index.ts b/packages/geo/src/lib/filter/index.ts index 8a98d9b57e..f6226426e9 100644 --- a/packages/geo/src/lib/filter/index.ts +++ b/packages/geo/src/lib/filter/index.ts @@ -1,3 +1,28 @@ +import { OgcFilterButtonComponent } from './ogc-filter-button'; +import { OgcFilterFormComponent } from './ogc-filter-form'; +import { OgcFilterSelectionComponent } from './ogc-filter-selection'; +import { + OgcFilterTimeComponent, + OgcFilterTimeSliderComponent +} from './ogc-filter-time'; +import { OgcFilterableFormComponent } from './ogc-filterable-form'; +import { OgcFilterableItemComponent } from './ogc-filterable-item'; +import { + OgcFilterableListBindingDirective, + OgcFilterableListComponent +} from './ogc-filterable-list'; +import { FilterableDataSourcePipe } from './shared'; +import { SpatialFilterItemComponent } from './spatial-filter/spatial-filter-item'; +import { SpatialFilterListComponent } from './spatial-filter/spatial-filter-list'; +import { SpatialFilterTypeComponent } from './spatial-filter/spatial-filter-type'; +import { TimeFilterButtonComponent } from './time-filter-button'; +import { TimeFilterFormComponent } from './time-filter-form'; +import { TimeFilterItemComponent } from './time-filter-item'; +import { + TimeFilterListBindingDirective, + TimeFilterListComponent +} from './time-filter-list'; + export * from './shared'; export * from './time-filter-form'; export * from './time-filter-item'; @@ -13,3 +38,24 @@ export * from './time-filter-button'; export * from './spatial-filter/spatial-filter-type'; export * from './spatial-filter/spatial-filter-list'; export * from './spatial-filter/spatial-filter-item'; + +export const FILTER_DIRECTIVES = [ + FilterableDataSourcePipe, + TimeFilterButtonComponent, + TimeFilterFormComponent, + TimeFilterItemComponent, + TimeFilterListComponent, + TimeFilterListBindingDirective, + OgcFilterFormComponent, + OgcFilterButtonComponent, + OgcFilterSelectionComponent, + OgcFilterableFormComponent, + OgcFilterableItemComponent, + OgcFilterableListComponent, + OgcFilterableListBindingDirective, + SpatialFilterTypeComponent, + SpatialFilterListComponent, + SpatialFilterItemComponent, + OgcFilterTimeComponent, + OgcFilterTimeSliderComponent +] as const; diff --git a/packages/geo/src/lib/filter/ogc-filter-button/ogc-filter-button.component.ts b/packages/geo/src/lib/filter/ogc-filter-button/ogc-filter-button.component.ts index 8a18186e8b..62abcbe7d0 100644 --- a/packages/geo/src/lib/filter/ogc-filter-button/ogc-filter-button.component.ts +++ b/packages/geo/src/lib/filter/ogc-filter-button/ogc-filter-button.component.ts @@ -1,12 +1,22 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { ListItemDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { Layer } from '../../layer/shared/layers/layer'; import { IgoMap } from '../../map/shared/map'; +import { OgcFilterableItemComponent } from '../ogc-filterable-item/ogc-filterable-item.component'; import { IgoOgcSelector, OgcFilterableDataSourceOptions @@ -16,7 +26,18 @@ import { selector: 'igo-ogc-filter-button', templateUrl: './ogc-filter-button.component.html', styleUrls: ['./ogc-filter-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatBadgeModule, + OgcFilterableItemComponent, + ListItemDirective, + TranslateModule + ] }) export class OgcFilterButtonComponent implements OnInit { public options: OgcFilterableDataSourceOptions; diff --git a/packages/geo/src/lib/filter/ogc-filter-form/ogc-filter-form.component.ts b/packages/geo/src/lib/filter/ogc-filter-form/ogc-filter-form.component.ts index ded0764fab..d711fe489e 100644 --- a/packages/geo/src/lib/filter/ogc-filter-form/ogc-filter-form.component.ts +++ b/packages/geo/src/lib/filter/ogc-filter-form/ogc-filter-form.component.ts @@ -1,6 +1,19 @@ +import { AsyncPipe, KeyValuePipe, NgClass, NgFor, NgIf } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; -import { FloatLabelType } from '@angular/material/form-field'; - +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOptionModule } from '@angular/material/core'; +import { + FloatLabelType, + MatFormFieldModule +} from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, of } from 'rxjs'; import { SourceFieldsOptionsParams } from '../../datasource/shared/datasources/datasource.interface'; @@ -12,11 +25,31 @@ import { } from '../../filter/shared/ogc-filter.interface'; import { IgoMap } from '../../map/shared/map'; import { WktService } from '../../wkt/shared/wkt.service'; +import { OgcFilterTimeComponent } from '../ogc-filter-time/ogc-filter-time.component'; @Component({ selector: 'igo-ogc-filter-form', templateUrl: './ogc-filter-form.component.html', - styleUrls: ['./ogc-filter-form.component.scss'] + styleUrls: ['./ogc-filter-form.component.scss'], + standalone: true, + imports: [ + MatCheckboxModule, + MatTooltipModule, + MatFormFieldModule, + NgClass, + MatSelectModule, + MatOptionModule, + NgIf, + MatInputModule, + MatAutocompleteModule, + NgFor, + MatButtonModule, + MatIconModule, + OgcFilterTimeComponent, + AsyncPipe, + KeyValuePipe, + TranslateModule + ] }) export class OgcFilterFormComponent implements OnInit { ogcFilterOperator = OgcFilterOperator; @@ -148,8 +181,8 @@ export class OgcFilterFormComponent implements OnInit { value && value.length > 0 ? of(this._filterValues(value)) : this.selectedField$.value - ? of(this.selectedField$.value.values) - : of([]); + ? of(this.selectedField$.value.values) + : of([]); if (value && value.length >= 1) { this.changeProperty(value, pos); } @@ -343,14 +376,14 @@ export class OgcFilterFormComponent implements OnInit { return pos && pos === 1 ? 'lowerBoundary' : pos && pos === 2 - ? 'upperBoundary' - : undefined; + ? 'upperBoundary' + : undefined; case OgcFilterOperator.During: return pos && pos === 1 ? 'begin' : pos && pos === 2 - ? 'end' - : undefined; + ? 'end' + : undefined; default: return; } diff --git a/packages/geo/src/lib/filter/ogc-filter-selection/ogc-filter-selection.component.ts b/packages/geo/src/lib/filter/ogc-filter-selection/ogc-filter-selection.component.ts index c0a3141661..aa0be3b673 100644 --- a/packages/geo/src/lib/filter/ogc-filter-selection/ogc-filter-selection.component.ts +++ b/packages/geo/src/lib/filter/ogc-filter-selection/ogc-filter-selection.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf, NgStyle } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -6,16 +7,28 @@ import { ViewChild } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { MatOption } from '@angular/material/core'; -import { MatSelect } from '@angular/material/select'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOption, MatOptionModule } from '@angular/material/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelect, MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { DOMOptions, DOMService, DOMValue } from '@igo2/common'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable } from 'rxjs'; import { debounceTime, map } from 'rxjs/operators'; @@ -29,6 +42,7 @@ import { SelectorGroup } from '../../filter/shared/ogc-filter.interface'; import { IgoMap } from '../../map/shared/map'; +import { OgcFilterTimeComponent } from '../ogc-filter-time/ogc-filter-time.component'; import { OgcFilterOperator } from '../shared/ogc-filter.enum'; import { OGCFilterService } from '../shared/ogc-filter.service'; @@ -36,7 +50,29 @@ import { OGCFilterService } from '../shared/ogc-filter.service'; selector: 'igo-ogc-filter-selection', templateUrl: './ogc-filter-selection.component.html', styleUrls: ['./ogc-filter-selection.component.scss'], - providers: [DOMService] + providers: [DOMService], + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + NgFor, + NgIf, + MatDividerModule, + MatFormFieldModule, + MatSelectModule, + MatTooltipModule, + MatOptionModule, + MatButtonToggleModule, + NgStyle, + MatCheckboxModule, + MatRadioModule, + MatIconModule, + MatInputModule, + MatAutocompleteModule, + OgcFilterTimeComponent, + AsyncPipe, + TranslateModule + ] }) export class OgcFilterSelectionComponent implements OnInit { @ViewChild('selection') sel: MatSelect; @@ -843,14 +879,14 @@ export class OgcFilterSelectionComponent implements OnInit { return pos && pos === 1 ? 'lowerBoundary' : pos && pos === 2 - ? 'upperBoundary' - : undefined; + ? 'upperBoundary' + : undefined; case OgcFilterOperator.During: return pos && pos === 1 ? 'begin' : pos && pos === 2 - ? 'end' - : undefined; + ? 'end' + : undefined; default: return; } diff --git a/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time-slider.component.ts b/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time-slider.component.ts index 96e2e52735..7c5db0f96b 100644 --- a/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time-slider.component.ts +++ b/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time-slider.component.ts @@ -6,7 +6,10 @@ import { Output, ViewChild } from '@angular/core'; -import { MatSlider } from '@angular/material/slider'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSlider, MatSliderModule } from '@angular/material/slider'; import { default as moment } from 'moment'; @@ -15,7 +18,10 @@ import { OGCFilterTimeService } from '../shared/ogc-filter-time.service'; @Component({ selector: 'igo-ogc-filter-time-slider', templateUrl: './ogc-filter-time-slider.component.html', - styleUrls: ['./ogc-filter-time-slider.component.scss'] + styleUrls: ['./ogc-filter-time-slider.component.scss'], + standalone: true, + imports: [MatSliderModule, FormsModule, MatButtonModule, MatIconModule], + providers: [OGCFilterTimeService] }) export class OgcFilterTimeSliderComponent implements OnInit { @Input() currentFilter: any; diff --git a/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time.component.ts b/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time.component.ts index 2b7888990e..7f625386f9 100644 --- a/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time.component.ts +++ b/packages/geo/src/lib/filter/ogc-filter-time/ogc-filter-time.component.ts @@ -1,3 +1,4 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, ElementRef, @@ -7,8 +8,23 @@ import { Output, ViewChild } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; - +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl +} from '@angular/forms'; +import { provideMomentDateAdapter } from '@angular/material-moment-adapter'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { default as moment } from 'moment'; import { OgcFilterOperator } from '../../filter/shared/ogc-filter.enum'; @@ -18,11 +34,31 @@ import { OgcFilterableDataSource, OgcFilterableDataSourceOptions } from '../shared/ogc-filter.interface'; +import { OgcFilterTimeSliderComponent } from './ogc-filter-time-slider.component'; @Component({ selector: 'igo-ogc-filter-time', templateUrl: './ogc-filter-time.component.html', - styleUrls: ['./ogc-filter-time.component.scss'] + styleUrls: ['./ogc-filter-time.component.scss'], + standalone: true, + imports: [ + NgIf, + MatSlideToggleModule, + FormsModule, + OgcFilterTimeSliderComponent, + MatFormFieldModule, + MatInputModule, + MatDatepickerModule, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatSelectModule, + ReactiveFormsModule, + NgFor, + MatOptionModule, + TranslateModule + ], + providers: [OGCFilterTimeService, provideMomentDateAdapter()] }) export class OgcFilterTimeComponent implements OnInit { @Input() datasource: OgcFilterableDataSource; @@ -631,16 +667,16 @@ export class OgcFilterTimeComponent implements OnInit { return this.currentFilter.begin ? this.currentFilter.begin : this.datasource.options.minDate - ? this.datasource.options.minDate - : this._defaultMin; + ? this.datasource.options.minDate + : this._defaultMin; } public handleMax() { return this.currentFilter.end ? this.currentFilter.end : this.datasource.options.maxDate - ? this.datasource.options.maxDate - : this._defaultMax; + ? this.datasource.options.maxDate + : this._defaultMax; } changePropertyByPass(event) { diff --git a/packages/geo/src/lib/filter/ogc-filterable-form/ogc-filterable-form.component.ts b/packages/geo/src/lib/filter/ogc-filterable-form/ogc-filterable-form.component.ts index 4e5e1c35ac..53b9af1cb6 100644 --- a/packages/geo/src/lib/filter/ogc-filterable-form/ogc-filterable-form.component.ts +++ b/packages/geo/src/lib/filter/ogc-filterable-form/ogc-filterable-form.component.ts @@ -1,8 +1,13 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, Input } from '@angular/core'; import { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete'; import { MAT_SELECT_CONFIG } from '@angular/material/select'; +import { ListItemDirective } from '@igo2/common'; + import { IgoMap } from '../../map/shared/map'; +import { OgcFilterFormComponent } from '../ogc-filter-form/ogc-filter-form.component'; +import { OgcFilterSelectionComponent } from '../ogc-filter-selection/ogc-filter-selection.component'; import { OgcFilterableDataSource } from '../shared/ogc-filter.interface'; @Component({ @@ -18,6 +23,14 @@ import { OgcFilterableDataSource } from '../shared/ogc-filter.interface'; provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: 'igo-overlay-panel-width' } } + ], + standalone: true, + imports: [ + NgIf, + OgcFilterSelectionComponent, + ListItemDirective, + NgFor, + OgcFilterFormComponent ] }) export class OgcFilterableFormComponent { diff --git a/packages/geo/src/lib/filter/ogc-filterable-item/ogc-filterable-item.component.ts b/packages/geo/src/lib/filter/ogc-filterable-item/ogc-filterable-item.component.ts index c366722a01..5d3648650e 100644 --- a/packages/geo/src/lib/filter/ogc-filterable-item/ogc-filterable-item.component.ts +++ b/packages/geo/src/lib/filter/ogc-filterable-item/ogc-filterable-item.component.ts @@ -1,12 +1,25 @@ +import { AsyncPipe, NgClass, NgIf, NgStyle } from '@angular/common'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { CollapseDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { WFSDataSourceOptionsParams } from '../../datasource/shared/datasources/wfs-datasource.interface'; import { WMSDataSource } from '../../datasource/shared/datasources/wms-datasource'; import { OgcFilterOperator } from '../../filter/shared/ogc-filter.enum'; +import { LayerLegendComponent } from '../../layer/layer-legend/layer-legend.component'; import { Layer } from '../../layer/shared/layers/layer'; import { IgoMap } from '../../map/shared/map'; +import { OgcFilterableFormComponent } from '../ogc-filterable-form/ogc-filterable-form.component'; import { OgcFilterWriter } from '../shared/ogc-filter'; import { OgcFilterableDataSource, @@ -18,7 +31,26 @@ import { OGCFilterService } from '../shared/ogc-filter.service'; @Component({ selector: 'igo-ogc-filterable-item', templateUrl: './ogc-filterable-item.component.html', - styleUrls: ['./ogc-filterable-item.component.scss'] + styleUrls: ['./ogc-filterable-item.component.scss'], + standalone: true, + imports: [ + NgClass, + MatListModule, + NgIf, + MatIconModule, + CollapseDirective, + NgStyle, + MatTooltipModule, + MatButtonModule, + LayerLegendComponent, + OgcFilterableFormComponent, + MatDividerModule, + MatCheckboxModule, + FormsModule, + AsyncPipe, + TranslateModule + ], + providers: [OGCFilterService] }) export class OgcFilterableItemComponent implements OnInit, OnDestroy { public color = 'primary'; diff --git a/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list-binding.directive.ts b/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list-binding.directive.ts index 2fb8b6b242..d5a9213a50 100644 --- a/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list-binding.directive.ts +++ b/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list-binding.directive.ts @@ -6,7 +6,8 @@ import { MapService } from '../../map/shared/map.service'; import { OgcFilterableListComponent } from './ogc-filterable-list.component'; @Directive({ - selector: '[igoOgcFilterableListBinding]' + selector: '[igoOgcFilterableListBinding]', + standalone: true }) export class OgcFilterableListBindingDirective implements OnInit, OnDestroy { private component: OgcFilterableListComponent; diff --git a/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list.component.ts b/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list.component.ts index 27e8f3ec76..a71b43e5a9 100644 --- a/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list.component.ts +++ b/packages/geo/src/lib/filter/ogc-filterable-list/ogc-filterable-list.component.ts @@ -1,13 +1,30 @@ +import { NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ListComponent, ListItemDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; + import { Layer } from '../../layer/shared/layers/layer'; import { IgoMap } from '../../map/shared/map'; +import { OgcFilterableItemComponent } from '../ogc-filterable-item/ogc-filterable-item.component'; +import { FilterableDataSourcePipe } from '../shared/filterable-datasource.pipe'; @Component({ selector: 'igo-ogc-filterable-list', templateUrl: './ogc-filterable-list.component.html', styleUrls: ['./ogc-filterable-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + ListComponent, + NgIf, + NgFor, + OgcFilterableItemComponent, + ListItemDirective, + TranslateModule, + FilterableDataSourcePipe + ] }) export class OgcFilterableListComponent { @Input() layers: Layer[]; diff --git a/packages/geo/src/lib/filter/shared/filterable-datasource.pipe.ts b/packages/geo/src/lib/filter/shared/filterable-datasource.pipe.ts index 9dfe155c89..7ad49a009b 100644 --- a/packages/geo/src/lib/filter/shared/filterable-datasource.pipe.ts +++ b/packages/geo/src/lib/filter/shared/filterable-datasource.pipe.ts @@ -5,7 +5,8 @@ import { Layer } from '../../layer/shared/layers/layer'; import { OgcFilterableDataSource } from './ogc-filter.interface'; @Pipe({ - name: 'filterableDataSource' + name: 'filterableDataSource', + standalone: true }) export class FilterableDataSourcePipe implements PipeTransform { transform(value: Layer[], arg: string): Layer[] { diff --git a/packages/geo/src/lib/filter/shared/ogc-filter.ts b/packages/geo/src/lib/filter/shared/ogc-filter.ts index 9167855706..75d116674d 100644 --- a/packages/geo/src/lib/filter/shared/ogc-filter.ts +++ b/packages/geo/src/lib/filter/shared/ogc-filter.ts @@ -594,8 +594,8 @@ export class OgcFilterWriter { const srsName = igoOgcFilterObject.hasOwnProperty('srsName') ? igoOgcFilterObject.srsName : proj - ? proj.getCode() - : 'EPSG:3857'; + ? proj.getCode() + : 'EPSG:3857'; return Object.assign( {}, diff --git a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.ts b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.ts index 5874a7da0a..0195a7c657 100644 --- a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.ts +++ b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-item/spatial-filter-item.component.ts @@ -1,5 +1,6 @@ import { SelectionModel } from '@angular/cdk/collections'; import { NestedTreeControl } from '@angular/cdk/tree'; +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -10,13 +11,29 @@ import { OnInit, Output } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTableModule } from '@angular/material/table'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatTreeModule, MatTreeNestedDataSource } from '@angular/material/tree'; import { EntityStoreFilterSelectionStrategy, EntityStoreWithStrategy, EntityTableColumnRenderer, + EntityTableComponent, EntityTableTemplate } from '@igo2/common'; import { LanguageService, MessageService } from '@igo2/core'; @@ -28,11 +45,13 @@ import OlPoint from 'ol/geom/Point'; import * as olproj from 'ol/proj'; import * as olStyle from 'ol/style'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { FeatureDataSource } from '../../../datasource/shared'; import { FeatureMotion, FeatureStoreSelectionStrategy } from '../../../feature'; +import { GeometryFormFieldInputComponent } from '../../../geometry/geometry-form-field/geometry-form-field-input.component'; import { GeoJSONGeometry } from '../../../geometry/shared/geometry.interfaces'; import { Layer, VectorLayer } from '../../../layer/shared'; import { IgoMap } from '../../../map/shared/map'; @@ -53,7 +72,30 @@ import { SpatialFilterThematic } from './../../shared/spatial-filter.interface'; selector: 'igo-spatial-filter-item', templateUrl: './spatial-filter-item.component.html', styleUrls: ['./spatial-filter-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + GeometryFormFieldInputComponent, + FormsModule, + ReactiveFormsModule, + NgIf, + MatSlideToggleModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatRadioModule, + MatTableModule, + MatCheckboxModule, + MatTreeModule, + MatButtonModule, + MatIconModule, + MatTooltipModule, + EntityTableComponent, + AsyncPipe, + TranslateModule + ] }) export class SpatialFilterItemComponent implements OnDestroy, OnInit { @Input() map: IgoMap; diff --git a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-list/spatial-filter-list.component.ts b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-list/spatial-filter-list.component.ts index ab92ed251e..a8d61f8566 100644 --- a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-list/spatial-filter-list.component.ts +++ b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-list/spatial-filter-list.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,11 +8,21 @@ import { OnInit, Output } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl +} from '@angular/forms'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; import { EntityStore } from '@igo2/common'; import { MessageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; @@ -28,7 +39,20 @@ import { SpatialFilterService } from './../../shared/spatial-filter.service'; selector: 'igo-spatial-filter-list', templateUrl: './spatial-filter-list.component.html', styleUrls: ['./spatial-filter-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + FormsModule, + MatAutocompleteModule, + ReactiveFormsModule, + NgFor, + MatOptionModule, + MatSelectModule, + AsyncPipe, + TranslateModule + ] }) export class SpatialFilterListComponent implements OnInit, OnDestroy { @Input() diff --git a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-type/spatial-filter-type.component.ts b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-type/spatial-filter-type.component.ts index 1eba711b17..115624c27f 100644 --- a/packages/geo/src/lib/filter/spatial-filter/spatial-filter-type/spatial-filter-type.component.ts +++ b/packages/geo/src/lib/filter/spatial-filter/spatial-filter-type/spatial-filter-type.component.ts @@ -1,3 +1,4 @@ +import { NgFor } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,9 +8,18 @@ import { Output } from '@angular/core'; import { UntypedFormControl } from '@angular/forms'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { EntityStore } from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; + import { Feature } from '../../../feature'; import { Layer } from '../../../layer'; import { MeasureLengthUnit } from '../../../measure'; @@ -17,6 +27,7 @@ import { SpatialFilterQueryType, SpatialFilterType } from '../../shared/spatial-filter.enum'; +import { SpatialFilterListComponent } from '../spatial-filter-list/spatial-filter-list.component'; /** * Spatial Filter Type @@ -25,7 +36,20 @@ import { selector: 'igo-spatial-filter-type', templateUrl: './spatial-filter-type.component.html', styleUrls: ['./spatial-filter-type.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatTabsModule, + MatFormFieldModule, + MatSelectModule, + NgFor, + MatOptionModule, + SpatialFilterListComponent, + MatButtonToggleModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class SpatialFilterTypeComponent implements OnInit { @Input() diff --git a/packages/geo/src/lib/filter/time-filter-button/time-filter-button.component.ts b/packages/geo/src/lib/filter/time-filter-button/time-filter-button.component.ts index 48cd193cd5..d47f8f9d2c 100644 --- a/packages/geo/src/lib/filter/time-filter-button/time-filter-button.component.ts +++ b/packages/geo/src/lib/filter/time-filter-button/time-filter-button.component.ts @@ -1,20 +1,41 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { ListItemDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { TimeFilterableDataSourceOptions } from '../../datasource/shared/datasources/wms-datasource.interface'; import { WMSDataSourceOptions } from '../../datasource/shared/datasources/wms-datasource.interface'; import { Layer } from '../../layer/shared/layers/layer'; import { IgoMap } from '../../map/shared/map'; +import { TimeFilterItemComponent } from '../time-filter-item/time-filter-item.component'; @Component({ selector: 'igo-time-filter-button', templateUrl: './time-filter-button.component.html', styleUrls: ['./time-filter-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatBadgeModule, + TimeFilterItemComponent, + ListItemDirective, + TranslateModule + ] }) export class TimeFilterButtonComponent implements OnInit { public options: TimeFilterableDataSourceOptions; diff --git a/packages/geo/src/lib/filter/time-filter-form/time-filter-form.component.ts b/packages/geo/src/lib/filter/time-filter-form/time-filter-form.component.ts index 59d609cc91..71f426f3d0 100644 --- a/packages/geo/src/lib/filter/time-filter-form/time-filter-form.component.ts +++ b/packages/geo/src/lib/filter/time-filter-form/time-filter-form.component.ts @@ -1,3 +1,4 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, EventEmitter, @@ -6,11 +7,25 @@ import { Output, ViewChild } from '@angular/core'; -import { DateAdapter } from '@angular/material/core'; -import { MatSlider } from '@angular/material/slider'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { + DateAdapter, + MatNativeDateModule, + MatOptionModule +} from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSlider, MatSliderModule } from '@angular/material/slider'; +import { MatTooltipModule } from '@angular/material/tooltip'; import olSourceImageWMS from 'ol/source/ImageWMS'; +import { MatDatetimepickerModule } from '@mat-datetimepicker/core'; +import { TranslateModule } from '@ngx-translate/core'; import { default as moment } from 'moment'; import { Layer } from '../../layer/shared/layers/layer'; @@ -20,7 +35,25 @@ import { TimeFilterOptions } from '../shared/time-filter.interface'; @Component({ selector: 'igo-time-filter-form', templateUrl: './time-filter-form.component.html', - styleUrls: ['./time-filter-form.component.scss'] + styleUrls: ['./time-filter-form.component.scss'], + standalone: true, + imports: [ + NgIf, + MatFormFieldModule, + MatDatetimepickerModule, + MatNativeDateModule, // For the DateAdapter provider + MatInputModule, + FormsModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatSliderModule, + MatSlideToggleModule, + MatTooltipModule, + MatButtonModule, + MatIconModule, + TranslateModule + ] }) export class TimeFilterFormComponent implements OnInit { @Input() layer: Layer; diff --git a/packages/geo/src/lib/filter/time-filter-item/time-filter-item.component.ts b/packages/geo/src/lib/filter/time-filter-item/time-filter-item.component.ts index dbf146d583..443f1119c2 100644 --- a/packages/geo/src/lib/filter/time-filter-item/time-filter-item.component.ts +++ b/packages/geo/src/lib/filter/time-filter-item/time-filter-item.component.ts @@ -1,15 +1,41 @@ +import { AsyncPipe, NgClass, NgIf, NgStyle } from '@angular/common'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { CollapseDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { TimeFilterableDataSource } from '../../datasource/shared/datasources/wms-datasource'; +import { LayerLegendComponent } from '../../layer/layer-legend/layer-legend.component'; import { Layer } from '../../layer/shared/layers/layer'; import { TimeFilterService } from '../shared/time-filter.service'; +import { TimeFilterFormComponent } from '../time-filter-form/time-filter-form.component'; @Component({ selector: 'igo-time-filter-item', templateUrl: './time-filter-item.component.html', - styleUrls: ['./time-filter-item.component.scss'] + styleUrls: ['./time-filter-item.component.scss'], + standalone: true, + imports: [ + NgIf, + MatListModule, + MatIconModule, + CollapseDirective, + NgStyle, + MatButtonModule, + MatTooltipModule, + NgClass, + LayerLegendComponent, + TimeFilterFormComponent, + AsyncPipe, + TranslateModule + ], + providers: [TimeFilterService] }) export class TimeFilterItemComponent implements OnInit, OnDestroy { public color = 'primary'; diff --git a/packages/geo/src/lib/filter/time-filter-list/time-filter-list-binding.directive.ts b/packages/geo/src/lib/filter/time-filter-list/time-filter-list-binding.directive.ts index c1ab62a94b..c1b0a1e649 100644 --- a/packages/geo/src/lib/filter/time-filter-list/time-filter-list-binding.directive.ts +++ b/packages/geo/src/lib/filter/time-filter-list/time-filter-list-binding.directive.ts @@ -6,7 +6,8 @@ import { MapService } from '../../map/shared/map.service'; import { TimeFilterListComponent } from './time-filter-list.component'; @Directive({ - selector: '[igoTimeFilterListBinding]' + selector: '[igoTimeFilterListBinding]', + standalone: true }) export class TimeFilterListBindingDirective implements OnInit, OnDestroy { private component: TimeFilterListComponent; diff --git a/packages/geo/src/lib/filter/time-filter-list/time-filter-list.component.ts b/packages/geo/src/lib/filter/time-filter-list/time-filter-list.component.ts index 27e916b89c..c1115abccf 100644 --- a/packages/geo/src/lib/filter/time-filter-list/time-filter-list.component.ts +++ b/packages/geo/src/lib/filter/time-filter-list/time-filter-list.component.ts @@ -1,3 +1,4 @@ +import { NgFor } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -5,12 +6,24 @@ import { Input } from '@angular/core'; +import { ListComponent, ListItemDirective } from '@igo2/common'; + import { Layer } from '../../layer/shared/layers/layer'; +import { FilterableDataSourcePipe } from '../shared/filterable-datasource.pipe'; +import { TimeFilterItemComponent } from '../time-filter-item/time-filter-item.component'; @Component({ selector: 'igo-time-filter-list', templateUrl: './time-filter-list.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + ListComponent, + NgFor, + TimeFilterItemComponent, + ListItemDirective, + FilterableDataSourcePipe + ] }) export class TimeFilterListComponent { @Input() diff --git a/packages/geo/src/lib/geo.module.ts b/packages/geo/src/lib/geo.module.ts index 35246d2ecb..18b6066eef 100644 --- a/packages/geo/src/lib/geo.module.ts +++ b/packages/geo/src/lib/geo.module.ts @@ -1,20 +1,12 @@ -import { ModuleWithProviders, NgModule } from '@angular/core'; +import { NgModule } from '@angular/core'; -import { IgoCatalogModule } from './catalog/catalog.module'; -import { IgoDataSourceModule } from './datasource/datasource.module'; import { IgoDirectionsModule } from './directions/directions.module'; import { IgoDownloadModule } from './download/download.module'; -import { IgoDrawingToolModule } from './draw/drawingTool.module'; -import { IgoFeatureModule } from './feature/feature.module'; import { IgoFilterModule } from './filter/filter.module'; -import { IgoGeometryModule } from './geometry/geometry.module'; import { IgoImportExportModule } from './import-export/import-export.module'; import { IgoLayerModule } from './layer/layer.module'; -import { IgoMapModule } from './map/map.module'; -import { IgoMeasureModule } from './measure/measure.module'; import { IgoMetadataModule } from './metadata/metadata.module'; import { IgoOverlayModule } from './overlay/overlay.module'; -import { IgoPrintModule } from './print/print.module'; import { IgoQueryModule } from './query/query.module'; import { IgoSearchModule } from './search/search.module'; import { IgoStyleModule } from './style/style.module'; @@ -26,20 +18,12 @@ import { IgoGeoWorkspaceModule } from './workspace/workspace.module'; imports: [], declarations: [], exports: [ - IgoCatalogModule, - IgoDataSourceModule, IgoDownloadModule, - IgoDrawingToolModule, - IgoFeatureModule, IgoFilterModule, - IgoGeometryModule, IgoImportExportModule, IgoLayerModule, - IgoMapModule, - IgoMeasureModule, IgoMetadataModule, IgoOverlayModule, - IgoPrintModule, IgoQueryModule, IgoDirectionsModule, IgoSearchModule, @@ -49,11 +33,4 @@ import { IgoGeoWorkspaceModule } from './workspace/workspace.module'; IgoWktModule ] }) -export class IgoGeoModule { - static forRoot(): ModuleWithProviders { - return { - ngModule: IgoGeoModule, - providers: [] - }; - } -} +export class IgoGeoModule {} diff --git a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field-input.component.ts b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field-input.component.ts index 5b9cf09608..035883f283 100644 --- a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field-input.component.ts +++ b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field-input.component.ts @@ -58,7 +58,8 @@ interface HasRadius { @Component({ selector: 'igo-geometry-form-field-input', templateUrl: './geometry-form-field-input.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true }) export class GeometryFormFieldInputComponent implements OnInit, OnDestroy, ControlValueAccessor diff --git a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.component.ts b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.component.ts index 0508f92091..e1acacc9c9 100644 --- a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.component.ts +++ b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -6,17 +7,27 @@ import { OnDestroy, OnInit } from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormControl +} from '@angular/forms'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; import { IgoFormFieldComponent } from '@igo2/common'; import type { Type } from 'ol/geom/Geometry'; import { StyleLike as OlStyleLike } from 'ol/style/Style'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { IgoMap } from '../../map/shared/map'; import { GeoJSONGeometry } from '../shared/geometry.interfaces'; +import { GeometryFormFieldInputComponent } from './geometry-form-field-input.component'; /** * This input allows a user to draw a new geometry or to edit @@ -27,7 +38,20 @@ import { GeoJSONGeometry } from '../shared/geometry.interfaces'; selector: 'igo-geometry-form-field', templateUrl: './geometry-form-field.component.html', styleUrls: ['./geometry-form-field.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + GeometryFormFieldInputComponent, + FormsModule, + ReactiveFormsModule, + NgIf, + MatButtonToggleModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class GeometryFormFieldComponent implements OnInit, OnDestroy { readonly value$: BehaviorSubject = new BehaviorSubject( diff --git a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.module.ts b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.module.ts index 0a1b201fa5..73654539af 100644 --- a/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.module.ts +++ b/packages/geo/src/lib/geometry/geometry-form-field/geometry-form-field.module.ts @@ -1,33 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; - -import { IgoLanguageModule } from '@igo2/core'; import { GeometryFormFieldInputComponent } from './geometry-form-field-input.component'; import { GeometryFormFieldComponent } from './geometry-form-field.component'; /** - * @ignore + * @deprecated import the components directly or the GEOMETRY_FORM_FIELD_DIRECTIVES for the set */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MatIconModule, - MatFormFieldModule, - MatInputModule, - MatButtonModule, - MatButtonToggleModule, - IgoLanguageModule - ], - exports: [GeometryFormFieldComponent, GeometryFormFieldInputComponent], - declarations: [GeometryFormFieldComponent, GeometryFormFieldInputComponent] + imports: [GeometryFormFieldComponent, GeometryFormFieldInputComponent], + exports: [GeometryFormFieldComponent, GeometryFormFieldInputComponent] }) export class IgoGeometryFormFieldModule {} diff --git a/packages/geo/src/lib/geometry/geometry-form-field/index.ts b/packages/geo/src/lib/geometry/geometry-form-field/index.ts new file mode 100644 index 0000000000..b437a7effb --- /dev/null +++ b/packages/geo/src/lib/geometry/geometry-form-field/index.ts @@ -0,0 +1,10 @@ +import { GeometryFormFieldInputComponent } from './geometry-form-field-input.component'; +import { GeometryFormFieldComponent } from './geometry-form-field.component'; + +export * from './geometry-form-field-input.component'; +export * from './geometry-form-field.component'; + +export const GEOMETRY_FORM_FIELD_DIRECTIVES = [ + GeometryFormFieldComponent, + GeometryFormFieldInputComponent +] as const; diff --git a/packages/geo/src/lib/geometry/geometry.module.ts b/packages/geo/src/lib/geometry/geometry.module.ts index 4c1bcb045f..11372cd329 100644 --- a/packages/geo/src/lib/geometry/geometry.module.ts +++ b/packages/geo/src/lib/geometry/geometry.module.ts @@ -1,12 +1,11 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { IgoGeometryFormFieldModule } from './geometry-form-field/geometry-form-field.module'; +/** + * @deprecated import the components directly or the GEOMETRY_FORM_FIELD_DIRECTIVES for the set + */ @NgModule({ - imports: [CommonModule, IgoGeometryFormFieldModule], - exports: [IgoGeometryFormFieldModule], - declarations: [], - providers: [] + exports: [IgoGeometryFormFieldModule] }) export class IgoGeometryModule {} diff --git a/packages/geo/src/lib/geometry/index.ts b/packages/geo/src/lib/geometry/index.ts index ddee62b067..77cd155546 100644 --- a/packages/geo/src/lib/geometry/index.ts +++ b/packages/geo/src/lib/geometry/index.ts @@ -1,3 +1,2 @@ export * from './shared'; -export * from './geometry-form-field/geometry-form-field.component'; -export * from './geometry-form-field/geometry-form-field-input.component'; +export * from './geometry-form-field'; diff --git a/packages/geo/src/lib/import-export/export-button/export-button.component.ts b/packages/geo/src/lib/import-export/export-button/export-button.component.ts index d579f4fc75..20f076eb57 100644 --- a/packages/geo/src/lib/import-export/export-button/export-button.component.ts +++ b/packages/geo/src/lib/import-export/export-button/export-button.component.ts @@ -1,4 +1,10 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { DataSourceOptions } from '../../datasource/shared/datasources'; import { VectorLayer } from '../../layer/shared'; @@ -8,7 +14,15 @@ import { Layer } from '../../layer/shared/layers/layer'; selector: 'igo-export-button', templateUrl: './export-button.component.html', styleUrls: ['./export-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class ExportButtonComponent { @Input() diff --git a/packages/geo/src/lib/import-export/import-export.module.ts b/packages/geo/src/lib/import-export/import-export.module.ts index 4b5645645a..a63d9ab2db 100644 --- a/packages/geo/src/lib/import-export/import-export.module.ts +++ b/packages/geo/src/lib/import-export/import-export.module.ts @@ -1,56 +1,15 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { - IgoCustomHtmlModule, - IgoDrapDropModule, - IgoKeyValueModule, - IgoSpinnerModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { ExportButtonComponent } from './export-button/export-button.component'; import { ImportExportComponent } from './import-export/import-export.component'; import { DropGeoFileDirective } from './shared/drop-geo-file.directive'; +/** + * @deprecated import the components directly or IMPORT_EXPORT_DIRECTIVES for the set + */ @NgModule({ - imports: [ - MatIconModule, - MatTooltipModule, - FormsModule, - ReactiveFormsModule, - CommonModule, - MatButtonModule, - MatButtonToggleModule, - MatTabsModule, - MatSelectModule, - MatOptionModule, - MatFormFieldModule, - MatInputModule, - MatSlideToggleModule, - IgoLanguageModule, - IgoSpinnerModule, - IgoKeyValueModule, - IgoDrapDropModule, - IgoCustomHtmlModule - ], - exports: [ImportExportComponent, DropGeoFileDirective, ExportButtonComponent], - declarations: [ - ImportExportComponent, - DropGeoFileDirective, - ExportButtonComponent - ] + imports: [ImportExportComponent, DropGeoFileDirective, ExportButtonComponent], + exports: [ImportExportComponent, DropGeoFileDirective, ExportButtonComponent] }) export class IgoImportExportModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/import-export/import-export/import-export.component.html b/packages/geo/src/lib/import-export/import-export/import-export.component.html index 233378ca22..1b4535ce99 100644 --- a/packages/geo/src/lib/import-export/import-export/import-export.component.html +++ b/packages/geo/src/lib/import-export/import-export/import-export.component.html @@ -262,8 +262,8 @@

{{ 'igo.geo.importExportForm.exportNoLayersExportable' | translate }}

form.value.format !== 'URL' ? ('igo.geo.importExportForm.exportButton' | translate) : form.value.layers.length > 1 - ? ('igo.geo.importExportForm.exportButtonLinks' | translate) - : ('igo.geo.importExportForm.exportButtonLink' | translate) + ? ('igo.geo.importExportForm.exportButtonLinks' | translate) + : ('igo.geo.importExportForm.exportButtonLink' | translate) }} diff --git a/packages/geo/src/lib/import-export/import-export/import-export.component.ts b/packages/geo/src/lib/import-export/import-export/import-export.component.ts index 83c812fd4f..b64adf7783 100644 --- a/packages/geo/src/lib/import-export/import-export/import-export.component.ts +++ b/packages/geo/src/lib/import-export/import-export/import-export.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, KeyValuePipe, NgClass, NgFor, NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -8,13 +9,31 @@ import { Output } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { + MatSlideToggleChange, + MatSlideToggleModule +} from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { ConfirmDialogService, EntityRecord, Workspace } from '@igo2/common'; +import { + ConfirmDialogService, + CustomHtmlComponent, + EntityRecord, + SpinnerComponent, + Workspace +} from '@igo2/common'; import type { WorkspaceStore } from '@igo2/common'; import { ConfigService, @@ -30,6 +49,7 @@ import { circular } from 'ol/geom/Polygon'; import olClusterSource from 'ol/source/Cluster'; import olVectorSource from 'ol/source/Vector'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { skipWhile } from 'rxjs/operators'; @@ -66,7 +86,29 @@ import { @Component({ selector: 'igo-import-export', templateUrl: './import-export.component.html', - styleUrls: ['./import-export.component.scss'] + styleUrls: ['./import-export.component.scss'], + standalone: true, + imports: [ + MatButtonToggleModule, + NgIf, + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatTooltipModule, + MatButtonModule, + SpinnerComponent, + CustomHtmlComponent, + NgClass, + MatSlideToggleModule, + MatInputModule, + AsyncPipe, + KeyValuePipe, + TranslateModule + ], + providers: [ConfirmDialogService] }) export class ImportExportComponent implements OnDestroy, OnInit { public form: UntypedFormGroup; diff --git a/packages/geo/src/lib/import-export/index.ts b/packages/geo/src/lib/import-export/index.ts index 6181a6b654..7e2910f3d5 100644 --- a/packages/geo/src/lib/import-export/index.ts +++ b/packages/geo/src/lib/import-export/index.ts @@ -1,3 +1,13 @@ +import { ExportButtonComponent } from './export-button'; +import { ImportExportComponent } from './import-export'; +import { DropGeoFileDirective } from './shared'; + export * from './shared'; export * from './import-export'; export * from './export-button'; + +export const IMPORT_EXPORT_DIRECTIVES = [ + ImportExportComponent, + DropGeoFileDirective, + ExportButtonComponent +] as const; diff --git a/packages/geo/src/lib/import-export/shared/drop-geo-file.directive.ts b/packages/geo/src/lib/import-export/shared/drop-geo-file.directive.ts index a093bc8fb6..9ca7f53877 100644 --- a/packages/geo/src/lib/import-export/shared/drop-geo-file.directive.ts +++ b/packages/geo/src/lib/import-export/shared/drop-geo-file.directive.ts @@ -27,7 +27,8 @@ import { ImportExportServiceOptions } from './import.interface'; import { ImportService } from './import.service'; @Directive({ - selector: '[igoDropGeoFile]' + selector: '[igoDropGeoFile]', + standalone: true }) export class DropGeoFileDirective extends DragAndDropDirective diff --git a/packages/geo/src/lib/layer/index.ts b/packages/geo/src/lib/layer/index.ts index 623bcb77c4..171cc17cba 100644 --- a/packages/geo/src/lib/layer/index.ts +++ b/packages/geo/src/lib/layer/index.ts @@ -1,3 +1,14 @@ +import { LayerItemComponent } from './layer-item'; +import { LayerLegendComponent } from './layer-legend'; +import { LayerLegendItemComponent } from './layer-legend-item'; +import { + LayerLegendListBindingDirective, + LayerLegendListComponent +} from './layer-legend-list'; +import { LayerListBindingDirective, LayerListComponent } from './layer-list'; +import { LayerListToolComponent } from './layer-list-tool'; +import { TrackFeatureButtonComponent } from './track-feature-button'; + export * from './shared'; export * from './layer-item'; export * from './layer-legend'; @@ -7,3 +18,15 @@ export * from './layer-list'; export * from './layer-list-tool'; export * from './track-feature-button'; export * from './utils'; + +export const LAYER_DIRECTIVES = [ + LayerItemComponent, + LayerLegendItemComponent, + LayerLegendComponent, + LayerListComponent, + LayerListToolComponent, + LayerLegendListComponent, + LayerListBindingDirective, + LayerLegendListBindingDirective, + TrackFeatureButtonComponent +] as const; diff --git a/packages/geo/src/lib/layer/layer-item/layer-item.component.ts b/packages/geo/src/lib/layer/layer-item/layer-item.component.ts index 1d97fc3c74..9d217b8254 100644 --- a/packages/geo/src/lib/layer/layer-item/layer-item.component.ts +++ b/packages/geo/src/lib/layer/layer-item/layer-item.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -10,13 +11,21 @@ import { Output, Renderer2 } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ConnectionState, NetworkService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { MetadataLayerOptions } from '../../metadata/shared/metadata.interface'; import { layerIsQueryable } from '../../query/shared/query.utils'; +import { LayerLegendComponent } from '../layer-legend/layer-legend.component'; import { Layer } from '../shared/layers/layer'; import { TooltipType } from '../shared/layers/layer.interface'; @@ -24,7 +33,21 @@ import { TooltipType } from '../shared/layers/layer.interface'; selector: 'igo-layer-item', templateUrl: './layer-item.component.html', styleUrls: ['./layer-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + NgIf, + MatCheckboxModule, + MatTooltipModule, + MatButtonModule, + MatIconModule, + MatBadgeModule, + NgClass, + LayerLegendComponent, + AsyncPipe, + TranslateModule + ] }) export class LayerItemComponent implements OnInit, OnDestroy { public focusedCls = 'igo-layer-item-focused'; diff --git a/packages/geo/src/lib/layer/layer-legend-item/layer-legend-item.component.ts b/packages/geo/src/lib/layer/layer-legend-item/layer-legend-item.component.ts index 523b5d7542..e089543719 100644 --- a/packages/geo/src/lib/layer/layer-legend-item/layer-legend-item.component.ts +++ b/packages/geo/src/lib/layer/layer-legend-item/layer-legend-item.component.ts @@ -5,12 +5,15 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ConnectionState, NetworkService } from '@igo2/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { MetadataLayerOptions } from '../../metadata/shared/metadata.interface'; +import { LayerLegendComponent } from '../layer-legend/layer-legend.component'; import { Layer } from '../shared/layers/layer'; import { TooltipType } from '../shared/layers/layer.interface'; @@ -18,7 +21,9 @@ import { TooltipType } from '../shared/layers/layer.interface'; selector: 'igo-layer-legend-item', templateUrl: './layer-legend-item.component.html', styleUrls: ['./layer-legend-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MatListModule, MatTooltipModule, LayerLegendComponent] }) export class LayerLegendItemComponent implements OnInit, OnDestroy { inResolutionRange$: BehaviorSubject = new BehaviorSubject(true); diff --git a/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list-binding.directive.ts b/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list-binding.directive.ts index 243a71cf01..ef26fef200 100644 --- a/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list-binding.directive.ts +++ b/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list-binding.directive.ts @@ -8,7 +8,8 @@ import { Layer } from '../shared/layers/layer'; import { LayerLegendListComponent } from './layer-legend-list.component'; @Directive({ - selector: '[igoLayerLegendListBinding]' + selector: '[igoLayerLegendListBinding]', + standalone: true }) export class LayerLegendListBindingDirective implements OnInit, OnDestroy { private component: LayerLegendListComponent; diff --git a/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list.component.ts b/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list.component.ts index 30be41ae2c..23e6d42ebe 100644 --- a/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list.component.ts +++ b/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,7 +8,13 @@ import { OnInit, Output } from '@angular/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { ListComponent, ListItemDirective } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, EMPTY, @@ -17,13 +24,27 @@ import { } from 'rxjs'; import { debounce } from 'rxjs/operators'; +import { LayerLegendItemComponent } from '../layer-legend-item/layer-legend-item.component'; import { Layer } from '../shared/layers/layer'; @Component({ selector: 'igo-layer-legend-list', templateUrl: './layer-legend-list.component.html', styleUrls: ['./layer-legend-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatSlideToggleModule, + MatTooltipModule, + MatDividerModule, + ListComponent, + NgFor, + LayerLegendItemComponent, + ListItemDirective, + AsyncPipe, + TranslateModule + ] }) export class LayerLegendListComponent implements OnInit, OnDestroy { orderable = true; diff --git a/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts b/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts index ef05ae8c10..74f5289974 100644 --- a/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts +++ b/packages/geo/src/lib/layer/layer-legend/layer-legend.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgFor, NgIf, NgStyle } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { ChangeDetectionStrategy, @@ -10,10 +11,23 @@ import { ViewChildren } from '@angular/core'; import type { QueryList } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { SecureImagePipe } from '@igo2/common'; +import { + CollapseDirective, + ImageErrorDirective, + SanitizeHtmlPipe, + SecureImagePipe +} from '@igo2/common'; import { ConfigService, LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, Subscription, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; @@ -31,7 +45,26 @@ import { selector: 'igo-layer-legend', templateUrl: './layer-legend.component.html', styleUrls: ['./layer-legend.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + NgFor, + MatListModule, + MatIconModule, + CollapseDirective, + NgClass, + MatFormFieldModule, + MatSelectModule, + MatTooltipModule, + FormsModule, + MatOptionModule, + ImageErrorDirective, + NgStyle, + AsyncPipe, + TranslateModule, + SanitizeHtmlPipe + ] }) export class LayerLegendComponent implements OnInit, OnDestroy { @Input() updateLegendOnResolutionChange: boolean = false; diff --git a/packages/geo/src/lib/layer/layer-list-tool/layer-list-tool.component.ts b/packages/geo/src/lib/layer/layer-list-tool/layer-list-tool.component.ts index 925b7e203b..45695183ae 100644 --- a/packages/geo/src/lib/layer/layer-list-tool/layer-list-tool.component.ts +++ b/packages/geo/src/lib/layer/layer-list-tool/layer-list-tool.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,8 +8,20 @@ import { OnInit, Output } from '@angular/core'; -import { FloatLabelType } from '@angular/material/form-field'; +import { FormsModule } from '@angular/forms'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { + FloatLabelType, + MatFormFieldModule +} from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { IgoBadgeIconDirective } from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { LayerListControlsOptions } from './layer-list-tool.interface'; @@ -17,7 +30,20 @@ import { LayerListControlsOptions } from './layer-list-tool.interface'; selector: 'igo-layer-list-tool', templateUrl: './layer-list-tool.component.html', styleUrls: ['./layer-list-tool.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + FormsModule, + MatTooltipModule, + NgIf, + MatButtonModule, + MatIconModule, + MatBadgeModule, + IgoBadgeIconDirective, + TranslateModule + ] }) export class LayerListToolComponent implements OnInit, OnDestroy { public onlyVisible$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/geo/src/lib/layer/layer-list/layer-list-binding.directive.ts b/packages/geo/src/lib/layer/layer-list/layer-list-binding.directive.ts index cec52488d4..f8b33c3365 100644 --- a/packages/geo/src/lib/layer/layer-list/layer-list-binding.directive.ts +++ b/packages/geo/src/lib/layer/layer-list/layer-list-binding.directive.ts @@ -10,7 +10,8 @@ import { Layer } from '../shared/layers/layer'; import { LayerListComponent } from './layer-list.component'; @Directive({ - selector: '[igoLayerListBinding]' + selector: '[igoLayerListBinding]', + standalone: true }) export class LayerListBindingDirective implements OnInit, OnDestroy { private component: LayerListComponent; diff --git a/packages/geo/src/lib/layer/layer-list/layer-list.component.ts b/packages/geo/src/lib/layer/layer-list/layer-list.component.ts index 285c765280..ed950eb1a9 100644 --- a/packages/geo/src/lib/layer/layer-list/layer-list.component.ts +++ b/packages/geo/src/lib/layer/layer-list/layer-list.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -10,11 +11,22 @@ import { Output } from '@angular/core'; import type { TemplateRef } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDividerModule } from '@angular/material/divider'; import { FloatLabelType } from '@angular/material/form-field'; -import { MatSliderChange } from '@angular/material/slider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatSliderChange, MatSliderModule } from '@angular/material/slider'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { ListComponent, ListItemDirective, PanelComponent } from '@igo2/common'; import * as olextent from 'ol/extent'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, EMPTY, @@ -34,6 +46,8 @@ import { MetadataLayerOptions, MetadataOptions } from '../../metadata/shared/metadata.interface'; +import { LayerItemComponent } from '../layer-item/layer-item.component'; +import { LayerListToolComponent } from '../layer-list-tool/layer-list-tool.component'; import { LayerListControlsOptions } from '../layer-list-tool/layer-list-tool.interface'; import { Layer } from '../shared/layers/layer'; import { LinkedProperties } from '../shared/layers/layer.interface'; @@ -48,7 +62,29 @@ import { LayerListSelectVisibleEnum } from './layer-list.enum'; selector: 'igo-layer-list', templateUrl: './layer-list.component.html', styleUrls: ['./layer-list.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + LayerListToolComponent, + MatCheckboxModule, + MatDividerModule, + ListComponent, + NgFor, + LayerItemComponent, + ListItemDirective, + PanelComponent, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatBadgeModule, + MatMenuModule, + MatSliderModule, + NgTemplateOutlet, + FormsModule, + AsyncPipe, + TranslateModule + ] }) export class LayerListComponent implements OnInit, OnDestroy { orderable = true; diff --git a/packages/geo/src/lib/layer/layer.module.ts b/packages/geo/src/lib/layer/layer.module.ts index 0b249b0115..5b8c2e7cfc 100644 --- a/packages/geo/src/lib/layer/layer.module.ts +++ b/packages/geo/src/lib/layer/layer.module.ts @@ -1,29 +1,4 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { - IgoCollapsibleModule, - IgoCustomHtmlModule, - IgoImageModule, - IgoListModule, - IgoMatBadgeIconModule, - IgoPanelModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { StyleService } from '../style/style-service/style.service'; import { LayerItemComponent } from './layer-item/layer-item.component'; @@ -38,33 +13,11 @@ import { LayerListComponent } from './layer-list/layer-list.component'; import { LayerService } from './shared/layer.service'; import { TrackFeatureButtonComponent } from './track-feature-button/track-feature-button.component'; +/** + * @deprecated import the components/directives directly or LAYER_DIRECTIVES for the set + */ @NgModule({ imports: [ - MatInputModule, - ReactiveFormsModule, - MatFormFieldModule, - CommonModule, - FormsModule, - MatDividerModule, - MatMenuModule, - MatIconModule, - MatButtonModule, - MatSlideToggleModule, - MatSelectModule, - MatTooltipModule, - MatListModule, - MatSliderModule, - MatBadgeModule, - MatCheckboxModule, - IgoLanguageModule, - IgoListModule, - IgoCollapsibleModule, - IgoImageModule, - IgoPanelModule, - IgoMatBadgeIconModule, - IgoCustomHtmlModule - ], - exports: [ LayerItemComponent, LayerLegendItemComponent, LayerLegendComponent, @@ -75,7 +28,7 @@ import { TrackFeatureButtonComponent } from './track-feature-button/track-featur LayerLegendListBindingDirective, TrackFeatureButtonComponent ], - declarations: [ + exports: [ LayerItemComponent, LayerLegendItemComponent, LayerLegendComponent, diff --git a/packages/geo/src/lib/layer/track-feature-button/track-feature-button.component.ts b/packages/geo/src/lib/layer/track-feature-button/track-feature-button.component.ts index 2db046ec9c..25b17ac196 100644 --- a/packages/geo/src/lib/layer/track-feature-button/track-feature-button.component.ts +++ b/packages/geo/src/lib/layer/track-feature-button/track-feature-button.component.ts @@ -1,9 +1,15 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { VectorLayer } from '../shared/layers/vector-layer'; import { VectorLayerOptions } from '../shared/layers/vector-layer.interface'; @@ -12,7 +18,15 @@ import { VectorLayerOptions } from '../shared/layers/vector-layer.interface'; selector: 'igo-track-feature-button', templateUrl: './track-feature-button.component.html', styleUrls: ['./track-feature-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class TrackFeatureButtonComponent implements OnInit { @Input() layer: VectorLayer; diff --git a/packages/geo/src/lib/map/baselayers-switcher/baselayers-switcher.component.ts b/packages/geo/src/lib/map/baselayers-switcher/baselayers-switcher.component.ts index 25c011a9be..93c12698fd 100644 --- a/packages/geo/src/lib/map/baselayers-switcher/baselayers-switcher.component.ts +++ b/packages/geo/src/lib/map/baselayers-switcher/baselayers-switcher.component.ts @@ -1,18 +1,35 @@ +import { NgClass, NgFor, NgIf } from '@angular/common'; import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { Media, MediaService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { Layer } from '../../layer/shared'; import { IgoMap } from '../shared/map'; import { baseLayersSwitcherSlideInOut } from './baselayers-switcher.animation'; +import { MiniBaseMapComponent } from './mini-basemap.component'; @Component({ selector: 'igo-baselayers-switcher', templateUrl: './baselayers-switcher.component.html', styleUrls: ['./baselayers-switcher.component.scss'], - animations: [baseLayersSwitcherSlideInOut()] + animations: [baseLayersSwitcherSlideInOut()], + standalone: true, + imports: [ + NgIf, + NgClass, + MatButtonModule, + MatTooltipModule, + MatIconModule, + NgFor, + MiniBaseMapComponent, + TranslateModule + ] }) export class BaseLayersSwitcherComponent implements AfterViewInit, OnDestroy { @Input() map: IgoMap; diff --git a/packages/geo/src/lib/map/baselayers-switcher/mini-basemap.component.ts b/packages/geo/src/lib/map/baselayers-switcher/mini-basemap.component.ts index 33361d6472..ae2fee3bf4 100644 --- a/packages/geo/src/lib/map/baselayers-switcher/mini-basemap.component.ts +++ b/packages/geo/src/lib/map/baselayers-switcher/mini-basemap.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { AfterViewInit, ApplicationRef, @@ -17,13 +18,16 @@ import { LayersLinkProperties } from '../../layer/shared'; import { LayerService } from '../../layer/shared/layer.service'; +import { MapBrowserComponent } from '../map-browser/map-browser.component'; import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-mini-basemap', templateUrl: './mini-basemap.component.html', styleUrls: ['./mini-basemap.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, MapBrowserComponent] }) export class MiniBaseMapComponent implements AfterViewInit, OnDestroy { @Input() map: IgoMap; diff --git a/packages/geo/src/lib/map/geolocate-button/geolocate-button.component.ts b/packages/geo/src/lib/map/geolocate-button/geolocate-button.component.ts index 95c008b814..8460901974 100644 --- a/packages/geo/src/lib/map/geolocate-button/geolocate-button.component.ts +++ b/packages/geo/src/lib/map/geolocate-button/geolocate-button.component.ts @@ -1,7 +1,12 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { AfterContentInit, Component, Input, OnDestroy } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { IgoMap } from '../shared/map'; @@ -9,7 +14,16 @@ import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-geolocate-button', templateUrl: './geolocate-button.component.html', - styleUrls: ['./geolocate-button.component.scss'] + styleUrls: ['./geolocate-button.component.scss'], + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class GeolocateButtonComponent implements AfterContentInit, OnDestroy { private tracking$$: Subscription; diff --git a/packages/geo/src/lib/map/home-extent-button/home-extent-button.component.ts b/packages/geo/src/lib/map/home-extent-button/home-extent-button.component.ts index 499f9bce8c..231e816349 100644 --- a/packages/geo/src/lib/map/home-extent-button/home-extent-button.component.ts +++ b/packages/geo/src/lib/map/home-extent-button/home-extent-button.component.ts @@ -1,9 +1,14 @@ import { Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ConfigService } from '@igo2/core'; import * as olproj from 'ol/proj'; +import { TranslateModule } from '@ngx-translate/core'; + import { IgoMap } from '../shared/map'; import { MapExtent } from '../shared/map.interface'; import { HomeExtentButtonOptions } from './home-extent-button.interface'; @@ -14,7 +19,9 @@ Button to center the map to the home extent @Component({ selector: 'igo-home-extent-button', templateUrl: './home-extent-button.component.html', - styleUrls: ['./home-extent-button.component.scss'] + styleUrls: ['./home-extent-button.component.scss'], + standalone: true, + imports: [MatButtonModule, MatTooltipModule, MatIconModule, TranslateModule] }) export class HomeExtentButtonComponent { @Input() map: IgoMap; diff --git a/packages/geo/src/lib/map/index.ts b/packages/geo/src/lib/map/index.ts index 73c93a0de0..2339a8f058 100644 --- a/packages/geo/src/lib/map/index.ts +++ b/packages/geo/src/lib/map/index.ts @@ -1,3 +1,24 @@ +import { + BaseLayersSwitcherComponent, + MiniBaseMapComponent +} from './baselayers-switcher'; +import { GeolocateButtonComponent } from './geolocate-button'; +import { HomeExtentButtonComponent } from './home-extent-button'; +import { InfoSectionComponent } from './info-section'; +import { MapBrowserComponent } from './map-browser'; +import { MapCenterComponent } from './map-center'; +import { MenuButtonComponent } from './menu-button'; +import { OfflineButtonComponent } from './offline-button'; +import { RotationButtonComponent } from './rotation-button'; +import { + HoverFeatureDirective, + MapOfflineDirective, + PointerPositionDirective +} from './shared'; +import { SwipeControlComponent } from './swipe-control'; +import { WakeLockButtonComponent } from './wake-lock-button'; +import { ZoomButtonComponent } from './zoom-button'; + export * from './shared'; export * from './map-browser'; @@ -12,3 +33,22 @@ export * from './rotation-button'; export * from './swipe-control'; export * from './map-center'; export * from './info-section'; + +export const MAP_DIRECTIVES = [ + BaseLayersSwitcherComponent, + GeolocateButtonComponent, + HomeExtentButtonComponent, + HoverFeatureDirective, + InfoSectionComponent, + MapBrowserComponent, + MapCenterComponent, + MapOfflineDirective, + MenuButtonComponent, + MiniBaseMapComponent, + OfflineButtonComponent, + PointerPositionDirective, + RotationButtonComponent, + SwipeControlComponent, + WakeLockButtonComponent, + ZoomButtonComponent +] as const; diff --git a/packages/geo/src/lib/map/info-section/info-section.component.ts b/packages/geo/src/lib/map/info-section/info-section.component.ts index 2815587267..e4b5efea6b 100644 --- a/packages/geo/src/lib/map/info-section/info-section.component.ts +++ b/packages/geo/src/lib/map/info-section/info-section.component.ts @@ -1,9 +1,12 @@ +import { NgIf } from '@angular/common'; import { Component, Input } from '@angular/core'; @Component({ selector: 'igo-info-section', templateUrl: './info-section.component.html', - styleUrls: ['./info-section.component.scss'] + styleUrls: ['./info-section.component.scss'], + standalone: true, + imports: [NgIf] }) export class InfoSectionComponent { @Input() infoContent: string = ''; diff --git a/packages/geo/src/lib/map/map-browser/map-browser.component.ts b/packages/geo/src/lib/map/map-browser/map-browser.component.ts index 86f28aaf9e..e19fbc38f9 100644 --- a/packages/geo/src/lib/map/map-browser/map-browser.component.ts +++ b/packages/geo/src/lib/map/map-browser/map-browser.component.ts @@ -17,7 +17,8 @@ import { MapControlsOptions, MapViewOptions } from '../shared/map.interface'; @Component({ selector: 'igo-map-browser', templateUrl: './map-browser.component.html', - styleUrls: ['./map-browser.component.scss'] + styleUrls: ['./map-browser.component.scss'], + standalone: true }) export class MapBrowserComponent implements OnInit, AfterViewInit, OnDestroy { private activityId: string; diff --git a/packages/geo/src/lib/map/map-center/map-center.component.ts b/packages/geo/src/lib/map/map-center/map-center.component.ts index 3c3e9a3656..912f61808e 100644 --- a/packages/geo/src/lib/map/map-center/map-center.component.ts +++ b/packages/geo/src/lib/map/map-center/map-center.component.ts @@ -10,7 +10,8 @@ import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-map-center', templateUrl: './map-center.component.html', - styleUrls: ['./map-center.component.scss'] + styleUrls: ['./map-center.component.scss'], + standalone: true }) export class MapCenterComponent implements AfterViewInit, OnDestroy { /** diff --git a/packages/geo/src/lib/map/map.module.ts b/packages/geo/src/lib/map/map.module.ts index 9a88ad4d25..d9798c2eba 100644 --- a/packages/geo/src/lib/map/map.module.ts +++ b/packages/geo/src/lib/map/map.module.ts @@ -1,11 +1,4 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoConfirmDialogModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { BaseLayersSwitcherComponent } from './baselayers-switcher/baselayers-switcher.component'; import { MiniBaseMapComponent } from './baselayers-switcher/mini-basemap.component'; @@ -24,50 +17,30 @@ import { SwipeControlComponent } from './swipe-control/swipe-control.component'; import { WakeLockButtonComponent } from './wake-lock-button/wake-lock-button.component'; import { ZoomButtonComponent } from './zoom-button/zoom-button.component'; +const DIRECTIVES = [ + MapBrowserComponent, + ZoomButtonComponent, + GeolocateButtonComponent, + HomeExtentButtonComponent, + RotationButtonComponent, + InfoSectionComponent, + BaseLayersSwitcherComponent, + MiniBaseMapComponent, + MapOfflineDirective, + OfflineButtonComponent, + WakeLockButtonComponent, + PointerPositionDirective, + HoverFeatureDirective, + SwipeControlComponent, + MapCenterComponent, + MenuButtonComponent +]; + +/** + * @deprecated import the components directly or the MAP_DIRECTIVES for the set + */ @NgModule({ - imports: [ - CommonModule, - IgoLanguageModule, - IgoConfirmDialogModule, - MatIconModule, - MatButtonModule, - MatTooltipModule - ], - exports: [ - MapBrowserComponent, - ZoomButtonComponent, - GeolocateButtonComponent, - HomeExtentButtonComponent, - RotationButtonComponent, - InfoSectionComponent, - BaseLayersSwitcherComponent, - MiniBaseMapComponent, - MapOfflineDirective, - OfflineButtonComponent, - WakeLockButtonComponent, - PointerPositionDirective, - HoverFeatureDirective, - SwipeControlComponent, - MapCenterComponent, - MenuButtonComponent - ], - declarations: [ - MapBrowserComponent, - ZoomButtonComponent, - GeolocateButtonComponent, - HomeExtentButtonComponent, - RotationButtonComponent, - InfoSectionComponent, - BaseLayersSwitcherComponent, - MiniBaseMapComponent, - MapOfflineDirective, - OfflineButtonComponent, - WakeLockButtonComponent, - PointerPositionDirective, - HoverFeatureDirective, - SwipeControlComponent, - MapCenterComponent, - MenuButtonComponent - ] + imports: DIRECTIVES, + exports: DIRECTIVES }) export class IgoMapModule {} diff --git a/packages/geo/src/lib/map/menu-button/menu-button.component.ts b/packages/geo/src/lib/map/menu-button/menu-button.component.ts index 92d9912f67..dacb821f18 100644 --- a/packages/geo/src/lib/map/menu-button/menu-button.component.ts +++ b/packages/geo/src/lib/map/menu-button/menu-button.component.ts @@ -1,11 +1,25 @@ +import { NgClass } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; + @Component({ selector: 'igo-menu-button', templateUrl: './menu-button.component.html', - styleUrls: ['./menu-button.component.scss'] + styleUrls: ['./menu-button.component.scss'], + standalone: true, + imports: [ + MatButtonModule, + NgClass, + MatTooltipModule, + MatIconModule, + TranslateModule + ] }) export class MenuButtonComponent { @Input() diff --git a/packages/geo/src/lib/map/offline-button/offline-button.component.ts b/packages/geo/src/lib/map/offline-button/offline-button.component.ts index 6d928103bb..70553dfd74 100644 --- a/packages/geo/src/lib/map/offline-button/offline-button.component.ts +++ b/packages/geo/src/lib/map/offline-button/offline-button.component.ts @@ -1,11 +1,25 @@ +import { NgClass } from '@angular/common'; import { Component, Input, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-offline-button', templateUrl: './offline-button.component.html', - styleUrls: ['./offline-button.component.scss'] + styleUrls: ['./offline-button.component.scss'], + standalone: true, + imports: [ + MatButtonModule, + MatTooltipModule, + NgClass, + MatIconModule, + TranslateModule + ] }) export class OfflineButtonComponent implements OnInit { btnStyle: string = 'onlineStyle'; diff --git a/packages/geo/src/lib/map/rotation-button/rotation-button.component.ts b/packages/geo/src/lib/map/rotation-button/rotation-button.component.ts index afd150c378..6f022c187a 100644 --- a/packages/geo/src/lib/map/rotation-button/rotation-button.component.ts +++ b/packages/geo/src/lib/map/rotation-button/rotation-button.component.ts @@ -1,5 +1,10 @@ +import { AsyncPipe, NgIf, NgStyle } from '@angular/common'; import { AfterContentInit, Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { bearingToAzimuth } from '@turf/helpers'; import { BehaviorSubject } from 'rxjs'; @@ -8,7 +13,17 @@ import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-rotation-button', templateUrl: './rotation-button.component.html', - styleUrls: ['./rotation-button.component.scss'] + styleUrls: ['./rotation-button.component.scss'], + standalone: true, + imports: [ + NgIf, + MatTooltipModule, + MatButtonModule, + MatIconModule, + NgStyle, + AsyncPipe, + TranslateModule + ] }) export class RotationButtonComponent implements AfterContentInit { readonly rotated$ = new BehaviorSubject(false); diff --git a/packages/geo/src/lib/map/shared/hover-feature.directive.ts b/packages/geo/src/lib/map/shared/hover-feature.directive.ts index 29a5f5b838..39d9d5c664 100644 --- a/packages/geo/src/lib/map/shared/hover-feature.directive.ts +++ b/packages/geo/src/lib/map/shared/hover-feature.directive.ts @@ -43,7 +43,8 @@ import { StyleService } from '../../style/style-service/style.service'; * the layer level. */ @Directive({ - selector: '[igoHoverFeature]' + selector: '[igoHoverFeature]', + standalone: true }) export class HoverFeatureDirective implements OnInit, OnDestroy { public store: FeatureStore; diff --git a/packages/geo/src/lib/map/shared/map-pointer-position.directive.ts b/packages/geo/src/lib/map/shared/map-pointer-position.directive.ts index d3e2f78e67..d7b6001994 100644 --- a/packages/geo/src/lib/map/shared/map-pointer-position.directive.ts +++ b/packages/geo/src/lib/map/shared/map-pointer-position.directive.ts @@ -23,7 +23,8 @@ import { IgoMap } from '../../map/shared/map'; * to avoid too many emitted values. */ @Directive({ - selector: '[igoPointerPosition]' + selector: '[igoPointerPosition]', + standalone: true }) export class PointerPositionDirective implements OnInit, OnDestroy { private lastTimeoutRequest; diff --git a/packages/geo/src/lib/map/shared/map.ts b/packages/geo/src/lib/map/shared/map.ts index 35a2c7b12e..d97fbd6e3b 100644 --- a/packages/geo/src/lib/map/shared/map.ts +++ b/packages/geo/src/lib/map/shared/map.ts @@ -353,8 +353,8 @@ export class IgoMap implements MapBase { const offset = layer.zIndex ? 0 : layer.baseLayer - ? offsetBaseLayerZIndex++ - : offsetZIndex++; + ? offsetBaseLayerZIndex++ + : offsetZIndex++; return this.doAddLayer(layer, offset); }) .filter((layer: Layer | undefined) => layer !== undefined); diff --git a/packages/geo/src/lib/map/shared/mapOffline.directive.ts b/packages/geo/src/lib/map/shared/mapOffline.directive.ts index e1f4605fcf..1c41b08db9 100644 --- a/packages/geo/src/lib/map/shared/mapOffline.directive.ts +++ b/packages/geo/src/lib/map/shared/mapOffline.directive.ts @@ -14,7 +14,8 @@ interface OfflinableSourceOptions extends DataSourceOptions { } @Directive({ - selector: '[igoMapOffline]' + selector: '[igoMapOffline]', + standalone: true }) export class MapOfflineDirective implements AfterViewInit { private component: MapBrowserComponent; diff --git a/packages/geo/src/lib/map/swipe-control/swipe-control.component.ts b/packages/geo/src/lib/map/swipe-control/swipe-control.component.ts index a63916353a..e1edc375df 100644 --- a/packages/geo/src/lib/map/swipe-control/swipe-control.component.ts +++ b/packages/geo/src/lib/map/swipe-control/swipe-control.component.ts @@ -13,7 +13,8 @@ import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-swipe-control', templateUrl: './swipe-control.component.html', - styleUrls: ['./swipe-control.component.scss'] + styleUrls: ['./swipe-control.component.scss'], + standalone: true }) export class SwipeControlComponent implements AfterViewInit, OnDestroy { /** diff --git a/packages/geo/src/lib/map/wake-lock-button/wake-lock-button.component.ts b/packages/geo/src/lib/map/wake-lock-button/wake-lock-button.component.ts index 936981785c..33e52ebad4 100644 --- a/packages/geo/src/lib/map/wake-lock-button/wake-lock-button.component.ts +++ b/packages/geo/src/lib/map/wake-lock-button/wake-lock-button.component.ts @@ -1,15 +1,28 @@ +import { AsyncPipe } from '@angular/common'; import { Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { StorageService } from '@igo2/core'; import { userAgent } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import NoSleep from 'nosleep.js'; import { BehaviorSubject } from 'rxjs'; @Component({ selector: 'igo-wake-lock-button', templateUrl: './wake-lock-button.component.html', - styleUrls: ['./wake-lock-button.component.scss'] + styleUrls: ['./wake-lock-button.component.scss'], + standalone: true, + imports: [ + MatButtonModule, + MatTooltipModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) /** diff --git a/packages/geo/src/lib/map/zoom-button/zoom-button.component.ts b/packages/geo/src/lib/map/zoom-button/zoom-button.component.ts index 1dc0ab05a2..6a6591be80 100644 --- a/packages/geo/src/lib/map/zoom-button/zoom-button.component.ts +++ b/packages/geo/src/lib/map/zoom-button/zoom-button.component.ts @@ -1,11 +1,18 @@ import { Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { IgoMap } from '../shared/map'; @Component({ selector: 'igo-zoom-button', templateUrl: './zoom-button.component.html', - styleUrls: ['./zoom-button.component.scss'] + styleUrls: ['./zoom-button.component.scss'], + standalone: true, + imports: [MatButtonModule, MatTooltipModule, MatIconModule, TranslateModule] }) export class ZoomButtonComponent { @Input() map: IgoMap; diff --git a/packages/geo/src/lib/measure/index.ts b/packages/geo/src/lib/measure/index.ts index cc6bb51e9f..d91f3460dd 100644 --- a/packages/geo/src/lib/measure/index.ts +++ b/packages/geo/src/lib/measure/index.ts @@ -1,3 +1,2 @@ export * from './shared'; -export * from './measurer/measurer.component'; -export * from './measurer/measure-format.pipe'; +export * from './measurer'; diff --git a/packages/geo/src/lib/measure/measure.module.ts b/packages/geo/src/lib/measure/measure.module.ts index 44ab9607b9..fa78513e84 100644 --- a/packages/geo/src/lib/measure/measure.module.ts +++ b/packages/geo/src/lib/measure/measure.module.ts @@ -2,6 +2,9 @@ import { NgModule } from '@angular/core'; import { IgoMeasurerModule } from './measurer/measurer.module'; +/** + * @deprecated import the components directly or the MEASURER_DIRECTIVES for the set + */ @NgModule({ imports: [], declarations: [], diff --git a/packages/geo/src/lib/measure/measurer/index.ts b/packages/geo/src/lib/measure/measurer/index.ts new file mode 100644 index 0000000000..0a724b9a42 --- /dev/null +++ b/packages/geo/src/lib/measure/measurer/index.ts @@ -0,0 +1,7 @@ +import { MeasureFormatPipe } from './measure-format.pipe'; +import { MeasurerComponent } from './measurer.component'; + +export * from './measure-format.pipe'; +export * from './measurer.component'; + +export const MEASURER_DIRECTIVES = [MeasureFormatPipe, MeasurerComponent]; diff --git a/packages/geo/src/lib/measure/measurer/measure-format.pipe.ts b/packages/geo/src/lib/measure/measurer/measure-format.pipe.ts index c4979d8539..058afbc946 100644 --- a/packages/geo/src/lib/measure/measurer/measure-format.pipe.ts +++ b/packages/geo/src/lib/measure/measurer/measure-format.pipe.ts @@ -12,7 +12,8 @@ import { * to the specified unit. It also keeps a certain number of decimals. */ @Pipe({ - name: 'measureFormat' + name: 'measureFormat', + standalone: true }) export class MeasureFormatPipe implements PipeTransform { /** diff --git a/packages/geo/src/lib/measure/measurer/measurer-dialog.component.ts b/packages/geo/src/lib/measure/measurer/measurer-dialog.component.ts index 31076b713f..3bfdfbc89a 100644 --- a/packages/geo/src/lib/measure/measurer/measurer-dialog.component.ts +++ b/packages/geo/src/lib/measure/measurer/measurer-dialog.component.ts @@ -1,13 +1,30 @@ +import { NgIf } from '@angular/common'; import { Component, Inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { + MAT_DIALOG_DATA, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; + +import { TranslateModule } from '@ngx-translate/core'; import { MeasureAreaUnit, MeasureLengthUnit } from '../shared/measure.enum'; import { MeasurerDialogData } from '../shared/measure.interfaces'; +import { MeasureFormatPipe } from './measure-format.pipe'; @Component({ selector: 'igo-measurer-dialog', templateUrl: 'measurer-dialog.component.html', - styleUrls: ['./measurer-dialog.component.scss'] + styleUrls: ['./measurer-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + NgIf, + TranslateModule, + MeasureFormatPipe + ] }) export class MeasurerDialogComponent { measureAreaUnit = MeasureAreaUnit; diff --git a/packages/geo/src/lib/measure/measurer/measurer-item.component.ts b/packages/geo/src/lib/measure/measurer/measurer-item.component.ts index 3c0527b243..d2c025b36f 100644 --- a/packages/geo/src/lib/measure/measurer/measurer-item.component.ts +++ b/packages/geo/src/lib/measure/measurer/measurer-item.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -6,7 +7,12 @@ import { OnDestroy, Output } from '@angular/core'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { @@ -18,6 +24,7 @@ import { computeBestAreaUnit, computeBestLengthUnit } from '../shared/measure.utils'; +import { MeasureFormatPipe } from './measure-format.pipe'; /** * Measurer item @@ -26,7 +33,18 @@ import { selector: 'igo-measurer-item', templateUrl: './measurer-item.component.html', styleUrls: ['./measurer-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatFormFieldModule, + MatInputModule, + MatSelectModule, + NgFor, + MatOptionModule, + AsyncPipe, + TranslateModule, + MeasureFormatPipe + ] }) export class MeasurerItemComponent implements OnDestroy { /** diff --git a/packages/geo/src/lib/measure/measurer/measurer.component.ts b/packages/geo/src/lib/measure/measurer/measurer.component.ts index 5ac4aa6e02..358f7e3ba1 100644 --- a/packages/geo/src/lib/measure/measurer/measurer.component.ts +++ b/packages/geo/src/lib/measure/measurer/measurer.component.ts @@ -1,4 +1,4 @@ -import { DOCUMENT } from '@angular/common'; +import { AsyncPipe, DOCUMENT, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -8,10 +8,19 @@ import { OnInit, ViewChild } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatDialog } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityRecord, EntityTableTemplate } from '@igo2/common'; -import type { EntityTableComponent } from '@igo2/common'; +import { + EntityRecord, + EntityTableComponent, + EntityTableTemplate +} from '@igo2/common'; import { LanguageService, StorageScope, StorageService } from '@igo2/core'; import { uuid } from '@igo2/utils'; @@ -26,6 +35,7 @@ import OlVectorSource from 'ol/source/Vector'; import { VectorSourceEvent as OlVectorSourceEvent } from 'ol/source/Vector'; import OlStyle from 'ol/style/Style'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { skip } from 'rxjs/operators'; @@ -64,6 +74,7 @@ import { updateOlTooltipsAtMidpoints } from '../shared/measure.utils'; import { MeasurerDialogComponent } from './measurer-dialog.component'; +import { MeasurerItemComponent } from './measurer-item.component'; /** * Tool to measure lengths and areas @@ -72,7 +83,21 @@ import { MeasurerDialogComponent } from './measurer-dialog.component'; selector: 'igo-measurer', templateUrl: './measurer.component.html', styleUrls: ['./measurer.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatButtonToggleModule, + MatSlideToggleModule, + NgIf, + MatDividerModule, + MeasurerItemComponent, + MatButtonModule, + MatTooltipModule, + MatIconModule, + EntityTableComponent, + AsyncPipe, + TranslateModule + ] }) export class MeasurerComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/measure/measurer/measurer.module.ts b/packages/geo/src/lib/measure/measurer/measurer.module.ts index 549bd3a85e..e564fce048 100644 --- a/packages/geo/src/lib/measure/measurer/measurer.module.ts +++ b/packages/geo/src/lib/measure/measurer/measurer.module.ts @@ -1,49 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoEntityTableModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { MeasureFormatPipe } from './measure-format.pipe'; -import { MeasurerDialogComponent } from './measurer-dialog.component'; -import { MeasurerItemComponent } from './measurer-item.component'; import { MeasurerComponent } from './measurer.component'; /** - * @ignore + * @deprecated import the components directly or the MEASURER_DIRECTIVES for the set */ @NgModule({ - imports: [ - CommonModule, - MatButtonModule, - MatButtonToggleModule, - MatDialogModule, - MatIconModule, - MatTooltipModule, - MatFormFieldModule, - MatInputModule, - MatSelectModule, - MatSlideToggleModule, - MatDividerModule, - IgoLanguageModule, - IgoEntityTableModule - ], - declarations: [ - MeasureFormatPipe, - MeasurerItemComponent, - MeasurerComponent, - MeasurerDialogComponent - ], + imports: [MeasureFormatPipe, MeasurerComponent], exports: [MeasureFormatPipe, MeasurerComponent] }) export class IgoMeasurerModule {} diff --git a/packages/geo/src/lib/metadata/index.ts b/packages/geo/src/lib/metadata/index.ts index 11f833f33d..500fab0821 100644 --- a/packages/geo/src/lib/metadata/index.ts +++ b/packages/geo/src/lib/metadata/index.ts @@ -1,2 +1,12 @@ +import { + MetadataAbstractComponent, + MetadataButtonComponent +} from './metadata-button'; + export * from './shared'; export * from './metadata-button'; + +export const METADATA_DIRECTIVES = [ + MetadataButtonComponent, + MetadataAbstractComponent +] as const; diff --git a/packages/geo/src/lib/metadata/metadata-button/metadata-button.component.ts b/packages/geo/src/lib/metadata/metadata-button/metadata-button.component.ts index 0933d8e2dc..f804a19bb8 100644 --- a/packages/geo/src/lib/metadata/metadata-button/metadata-button.component.ts +++ b/packages/geo/src/lib/metadata/metadata-button/metadata-button.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,7 +6,19 @@ import { Input, ViewEncapsulation } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialog, + MatDialogClose, + MatDialogContent, + MatDialogModule, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { Layer } from '../../layer/shared/layers/layer'; import { @@ -18,7 +31,16 @@ import { MetadataService } from '../shared/metadata.service'; selector: 'igo-metadata-button', templateUrl: './metadata-button.component.html', styleUrls: ['./metadata-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + TranslateModule, + MatDialogModule + ] }) export class MetadataButtonComponent { @Input() @@ -80,7 +102,15 @@ export class MetadataButtonComponent { selector: 'igo-metadata-abstract', templateUrl: './metadata-abstract.component.html', styleUrls: ['./metadata-abstract.component.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [ + MatDialogTitle, + MatButtonModule, + MatDialogClose, + NgIf, + MatDialogContent + ] }) export class MetadataAbstractComponent { constructor(@Inject(MAT_DIALOG_DATA) public data: MetadataOptions) {} diff --git a/packages/geo/src/lib/metadata/metadata.module.ts b/packages/geo/src/lib/metadata/metadata.module.ts index 131e359c2c..86e2411299 100644 --- a/packages/geo/src/lib/metadata/metadata.module.ts +++ b/packages/geo/src/lib/metadata/metadata.module.ts @@ -1,28 +1,16 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { MetadataAbstractComponent, MetadataButtonComponent } from './metadata-button/metadata-button.component'; +/** + * @deprecated import the components/directives directly or METADATA_DIRECTIVES for the set + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - IgoLanguageModule, - MatDialogModule - ], - exports: [MetadataButtonComponent, MetadataAbstractComponent], - declarations: [MetadataButtonComponent, MetadataAbstractComponent] + imports: [MetadataButtonComponent, MetadataAbstractComponent], + exports: [MetadataButtonComponent, MetadataAbstractComponent] }) export class IgoMetadataModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/overlay/overlay.module.ts b/packages/geo/src/lib/overlay/overlay.module.ts index 77b49af5a8..088596eaa4 100644 --- a/packages/geo/src/lib/overlay/overlay.module.ts +++ b/packages/geo/src/lib/overlay/overlay.module.ts @@ -2,10 +2,12 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { OverlayDirective } from './shared/overlay.directive'; +/** + * @deprecated import the OverlayDirective directly + */ @NgModule({ - imports: [], - exports: [OverlayDirective], - declarations: [OverlayDirective] + imports: [OverlayDirective], + exports: [OverlayDirective] }) export class IgoOverlayModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/overlay/shared/overlay.directive.ts b/packages/geo/src/lib/overlay/shared/overlay.directive.ts index bd3748f661..6594eaf3a4 100644 --- a/packages/geo/src/lib/overlay/shared/overlay.directive.ts +++ b/packages/geo/src/lib/overlay/shared/overlay.directive.ts @@ -11,7 +11,8 @@ import { OverlayAction } from '../shared/overlay.enum'; import { OverlayService } from '../shared/overlay.service'; @Directive({ - selector: '[igoOverlay]' + selector: '[igoOverlay]', + standalone: true }) export class OverlayDirective implements OnInit, OnDestroy { private features$$: Subscription; diff --git a/packages/geo/src/lib/print/print-form/print-form.component.ts b/packages/geo/src/lib/print/print-form/print-form.component.ts index e37477248d..78b183ee34 100644 --- a/packages/geo/src/lib/print/print-form/print-form.component.ts +++ b/packages/geo/src/lib/print/print-form/print-form.component.ts @@ -1,13 +1,23 @@ +import { AsyncPipe, KeyValuePipe, NgFor, NgIf } from '@angular/common'; import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { MediaService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject } from 'rxjs'; import { PrintOptions } from '../shared/print.interface'; @@ -23,7 +33,23 @@ import { @Component({ selector: 'igo-print-form', templateUrl: './print-form.component.html', - styleUrls: ['./print-form.component.scss'] + styleUrls: ['./print-form.component.scss'], + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + NgIf, + MatSlideToggleModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatButtonModule, + AsyncPipe, + KeyValuePipe, + TranslateModule + ] }) export class PrintFormComponent implements OnInit { public form: UntypedFormGroup; diff --git a/packages/geo/src/lib/print/print.module.ts b/packages/geo/src/lib/print/print.module.ts index 042bf6415b..2530baca37 100644 --- a/packages/geo/src/lib/print/print.module.ts +++ b/packages/geo/src/lib/print/print.module.ts @@ -1,36 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatOptionModule } from '@angular/material/core'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; - -import { IgoKeyValueModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { PrintFormComponent } from './print-form/print-form.component'; import { PrintComponent } from './print/print.component'; +/** + * @deprecated import the PrintComponent, PrintFormComponent directly + */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - MatIconModule, - MatButtonModule, - MatSelectModule, - MatOptionModule, - MatInputModule, - MatFormFieldModule, - MatSlideToggleModule, - IgoLanguageModule, - IgoKeyValueModule - ], - exports: [PrintComponent, PrintFormComponent], - declarations: [PrintComponent, PrintFormComponent] + imports: [PrintComponent, PrintFormComponent], + exports: [PrintComponent, PrintFormComponent] }) export class IgoPrintModule {} diff --git a/packages/geo/src/lib/print/print/print.component.ts b/packages/geo/src/lib/print/print/print.component.ts index 6704799fc2..d0b3f45559 100644 --- a/packages/geo/src/lib/print/print/print.component.ts +++ b/packages/geo/src/lib/print/print/print.component.ts @@ -4,6 +4,7 @@ import { BehaviorSubject } from 'rxjs'; import { take } from 'rxjs/operators'; import { IgoMap } from '../../map/shared/map'; +import { PrintFormComponent } from '../print-form/print-form.component'; import { PrintOptions } from '../shared/print.interface'; import { PrintService } from '../shared/print.service'; import { @@ -17,7 +18,9 @@ import { @Component({ selector: 'igo-print', - templateUrl: './print.component.html' + templateUrl: './print.component.html', + standalone: true, + imports: [PrintFormComponent] }) export class PrintComponent { public disabled$ = new BehaviorSubject(false); diff --git a/packages/geo/src/lib/query/query.module.ts b/packages/geo/src/lib/query/query.module.ts index 75dd244704..55f77d031a 100644 --- a/packages/geo/src/lib/query/query.module.ts +++ b/packages/geo/src/lib/query/query.module.ts @@ -1,16 +1,15 @@ import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { IgoLanguageModule, IgoMessageModule } from '@igo2/core'; +import { IgoMessageModule } from '@igo2/core'; import { provideQuerySearchSource } from './shared/query-search-source.providers'; import { QueryDirective } from './shared/query.directive'; import { QueryService } from './shared/query.service'; @NgModule({ - imports: [CommonModule, IgoLanguageModule, IgoMessageModule], + imports: [CommonModule, IgoMessageModule, QueryDirective], exports: [QueryDirective], - declarations: [QueryDirective], providers: [QueryService] }) export class IgoQueryModule { diff --git a/packages/geo/src/lib/query/shared/query.directive.ts b/packages/geo/src/lib/query/shared/query.directive.ts index 90a58b4fe0..bf5ab742ee 100644 --- a/packages/geo/src/lib/query/shared/query.directive.ts +++ b/packages/geo/src/lib/query/shared/query.directive.ts @@ -38,7 +38,8 @@ import { layerIsQueryable, olLayerFeatureIsQueryable } from './query.utils'; * the layer level. */ @Directive({ - selector: '[igoQuery]' + selector: '[igoQuery]', + standalone: true }) export class QueryDirective implements AfterViewInit, OnDestroy { /** diff --git a/packages/geo/src/lib/query/shared/query.service.ts b/packages/geo/src/lib/query/shared/query.service.ts index 74d803a001..07aff65a40 100644 --- a/packages/geo/src/lib/query/shared/query.service.ts +++ b/packages/geo/src/lib/query/shared/query.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { LanguageService, MessageService } from '@igo2/core'; +import { MessageService } from '@igo2/core'; import { uuid } from '@igo2/utils'; import olFeature from 'ol/Feature'; @@ -54,8 +54,7 @@ export class QueryService { constructor( private http: HttpClient, - private messageService: MessageService, - private languageService: LanguageService + private messageService: MessageService ) {} query(layers: Layer[], options: QueryOptions): Observable[] { diff --git a/packages/geo/src/lib/search/index.ts b/packages/geo/src/lib/search/index.ts index 943148e451..d725af8bed 100644 --- a/packages/geo/src/lib/search/index.ts +++ b/packages/geo/src/lib/search/index.ts @@ -1,3 +1,9 @@ +import { SearchBarComponent } from './search-bar/search-bar.component'; +import { SEARCH_RESULTS_DIRECTIVES } from './search-results'; +import { SearchSelectorComponent } from './search-selector/search-selector.component'; +import { SearchSettingsComponent } from './search-settings/search-settings.component'; +import { SearchPointerSummaryDirective } from './shared'; + export * from './shared'; export * from './search-selector/search-selector.component'; export * from './search-selector/search-selector.module'; @@ -5,7 +11,12 @@ export * from './search-settings/search-settings.component'; export * from './search-settings/search-settings.module'; export * from './search-bar/search-bar.component'; export * from './search-bar/search-bar.module'; -export * from './search-results/search-results-add-button.component'; -export * from './search-results/search-results-item.component'; -export * from './search-results/search-results.component'; -export * from './search-results/search-results.module'; +export * from './search-results'; + +export const SEARCH_DIRECTIVES = [ + SearchBarComponent, + SearchSelectorComponent, + ...SEARCH_RESULTS_DIRECTIVES, + SearchSettingsComponent, + SearchPointerSummaryDirective +] as const; diff --git a/packages/geo/src/lib/search/search-bar/search-bar.component.html b/packages/geo/src/lib/search/search-bar/search-bar.component.html index 035abee2dc..69b09e4550 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.component.html +++ b/packages/geo/src/lib/search/search-bar/search-bar.component.html @@ -11,8 +11,8 @@ placeholder ? placeholder : (placeholder$ | async) - ? (placeholder$.value | translate) - : undefined + ? (placeholder$.value | translate) + : undefined " [value]="term$ | async" (keyup)="onKeyup($event)" diff --git a/packages/geo/src/lib/search/search-bar/search-bar.component.ts b/packages/geo/src/lib/search/search-bar/search-bar.component.ts index ac9082d620..da3773f788 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.component.ts +++ b/packages/geo/src/lib/search/search-bar/search-bar.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgClass, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -9,17 +10,26 @@ import { Output, ViewChild } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDividerModule } from '@angular/material/divider'; import { FloatLabelType, - MatFormFieldAppearance + MatFormFieldAppearance, + MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { EntityStore } from '@igo2/common'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, timer } from 'rxjs'; import { debounce, distinctUntilChanged } from 'rxjs/operators'; +import { SearchSelectorComponent } from '../search-selector/search-selector.component'; +import { SearchSettingsComponent } from '../search-settings/search-settings.component'; import { SearchSourceService } from '../shared/search-source.service'; import { SEARCH_TYPES } from '../shared/search.enums'; import { Research, SearchResult } from '../shared/search.interfaces'; @@ -34,7 +44,22 @@ import { SearchService } from '../shared/search.service'; selector: 'igo-search-bar', templateUrl: './search-bar.component.html', styleUrls: ['./search-bar.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgClass, + MatFormFieldModule, + NgIf, + MatInputModule, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatDividerModule, + SearchSelectorComponent, + SearchSettingsComponent, + AsyncPipe, + TranslateModule + ] }) export class SearchBarComponent implements OnInit, OnDestroy { /** diff --git a/packages/geo/src/lib/search/search-bar/search-bar.module.ts b/packages/geo/src/lib/search/search-bar/search-bar.module.ts index d3d9ca45b9..fdbbaa401d 100644 --- a/packages/geo/src/lib/search/search-bar/search-bar.module.ts +++ b/packages/geo/src/lib/search/search-bar/search-bar.module.ts @@ -1,42 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoSearchSelectorModule } from '../search-selector/search-selector.module'; -import { IgoSearchSettingsModule } from '../search-settings/search-settings.module'; import { SearchBarComponent } from './search-bar.component'; -import { SearchUrlParamDirective } from './search-url-param.directive'; /** - * @ignore + * @deprecated import the SearchBarComponent directly */ @NgModule({ - imports: [ - CommonModule, - FormsModule, - MatTooltipModule, - MatIconModule, - MatButtonModule, - MatDividerModule, - MatMenuModule, - MatRadioModule, - MatFormFieldModule, - MatInputModule, - IgoLanguageModule, - IgoSearchSelectorModule, - IgoSearchSettingsModule - ], - exports: [SearchBarComponent], - declarations: [SearchBarComponent, SearchUrlParamDirective] + imports: [SearchBarComponent], + exports: [SearchBarComponent] }) export class IgoSearchBarModule {} diff --git a/packages/geo/src/lib/search/search-bar/search-url-param.directive.ts b/packages/geo/src/lib/search/search-bar/search-url-param.directive.ts index 75d41a61e8..6c9d6182bc 100644 --- a/packages/geo/src/lib/search/search-bar/search-url-param.directive.ts +++ b/packages/geo/src/lib/search/search-bar/search-url-param.directive.ts @@ -11,7 +11,8 @@ import { RouteService } from '@igo2/core'; import { SearchBarComponent } from './search-bar.component'; @Directive({ - selector: '[igoSearchUrlParam]' + selector: '[igoSearchUrlParam]', + standalone: true }) export class SearchUrlParamDirective implements OnInit { constructor( diff --git a/packages/geo/src/lib/search/search-results/index.ts b/packages/geo/src/lib/search/search-results/index.ts new file mode 100644 index 0000000000..faca079f45 --- /dev/null +++ b/packages/geo/src/lib/search/search-results/index.ts @@ -0,0 +1,11 @@ +import { SearchResultAddButtonComponent } from './search-results-add-button.component'; +import { SearchResultsComponent } from './search-results.component'; + +export * from './search-results-add-button.component'; +export * from './search-results.component'; +export * from './search-results.module'; + +export const SEARCH_RESULTS_DIRECTIVES = [ + SearchResultsComponent, + SearchResultAddButtonComponent +] as const; diff --git a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts index 713b2002fe..fdf55a9427 100644 --- a/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts +++ b/packages/geo/src/lib/search/search-results/save-feature-dialog.component.ts @@ -1,23 +1,61 @@ +import { AsyncPipe, NgFor } from '@angular/common'; import { Component, Inject, OnInit, Optional } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { ListComponent, ListItemDirective } from '@igo2/common'; import { LanguageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map, startWith } from 'rxjs/operators'; import { Layer } from '../../layer/shared'; import { SearchResult } from '../shared'; +import { SearchResultsItemComponent } from './search-results-item.component'; @Component({ selector: 'igo-save-feature-dialog', templateUrl: './save-feature-dialog.component.html', - styleUrls: ['./save-feature-dialog.component.scss'] + styleUrls: ['./save-feature-dialog.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + ListComponent, + SearchResultsItemComponent, + ListItemDirective, + MatFormFieldModule, + MatInputModule, + MatAutocompleteModule, + NgFor, + MatOptionModule, + MatListModule, + MatDialogActions, + MatButtonModule, + AsyncPipe, + TranslateModule + ] }) export class SaveFeatureDialogComponent implements OnInit { public form: UntypedFormGroup; diff --git a/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts b/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts index 6dac018005..0248751a05 100644 --- a/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts +++ b/packages/geo/src/lib/search/search-results/search-results-add-button.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,9 +6,17 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { + EntityStore, + IgoBadgeIconDirective, + StopPropagationDirective +} from '@igo2/common'; import { Media, MediaService } from '@igo2/core'; import OlOverlay from 'ol/Overlay'; @@ -18,6 +27,7 @@ import Fill from 'ol/style/Fill'; import Stroke from 'ol/style/Stroke'; import Style from 'ol/style/Style'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, take } from 'rxjs'; import { DataSourceService } from '../../datasource/shared/datasource.service'; @@ -46,7 +56,19 @@ import { SaveFeatureDialogComponent } from './save-feature-dialog.component'; selector: 'igo-search-add-button', templateUrl: './search-results-add-button.component.html', styleUrls: ['./search-results-add-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + StopPropagationDirective, + MatTooltipModule, + MatIconModule, + MatBadgeModule, + IgoBadgeIconDirective, + AsyncPipe, + TranslateModule + ] }) export class SearchResultAddButtonComponent implements OnInit, OnDestroy { public tooltip$: BehaviorSubject = new BehaviorSubject( diff --git a/packages/geo/src/lib/search/search-results/search-results-item.component.ts b/packages/geo/src/lib/search/search-results/search-results-item.component.ts index 7035b37cbf..a397f25ecb 100644 --- a/packages/geo/src/lib/search/search-results/search-results-item.component.ts +++ b/packages/geo/src/lib/search/search-results/search-results-item.component.ts @@ -1,3 +1,4 @@ +import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,8 +6,13 @@ import { Input, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { + StopPropagationDirective, getEntityIcon, getEntityTitle, getEntityTitleHtml @@ -25,7 +31,16 @@ import { SearchResult } from '../shared/search.interfaces'; selector: 'igo-search-results-item', templateUrl: './search-results-item.component.html', styleUrls: ['./search-results-item.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatListModule, + NgIf, + MatIconModule, + MatTooltipModule, + MatButtonModule, + StopPropagationDirective + ] }) export class SearchResultsItemComponent { /** diff --git a/packages/geo/src/lib/search/search-results/search-results.component.ts b/packages/geo/src/lib/search/search-results/search-results.component.ts index bd33a25f71..c36a41c847 100644 --- a/packages/geo/src/lib/search/search-results/search-results.component.ts +++ b/packages/geo/src/lib/search/search-results/search-results.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor, NgIf, NgTemplateOutlet } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -10,15 +11,20 @@ import { Output } from '@angular/core'; import type { TemplateRef } from '@angular/core'; +import { MatTabsModule } from '@angular/material/tabs'; import { + CollapsibleComponent, EntityState, EntityStoreFilterCustomFuncStrategy, EntityStoreWatcher, - EntityStoreWithStrategy + EntityStoreWithStrategy, + ListComponent, + ListItemDirective } from '@igo2/common'; import { ConfigService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, EMPTY, Observable, Subscription, timer } from 'rxjs'; import { debounce, map } from 'rxjs/operators'; @@ -27,6 +33,7 @@ import { Research, SearchResult } from '../shared/search.interfaces'; import { SearchService } from '../shared/search.service'; import { SearchSource } from '../shared/sources/source'; import { TextSearchOptions } from '../shared/sources/source.interfaces'; +import { SearchResultsItemComponent } from './search-results-item.component'; export enum SearchResultMode { Grouped = 'grouped', @@ -41,7 +48,20 @@ export enum SearchResultMode { selector: 'igo-search-results', templateUrl: './search-results.component.html', styleUrls: ['./search-results.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + ListComponent, + NgFor, + CollapsibleComponent, + NgTemplateOutlet, + SearchResultsItemComponent, + ListItemDirective, + MatTabsModule, + AsyncPipe, + TranslateModule + ] }) export class SearchResultsComponent implements OnInit, OnDestroy { private showResultsCount: boolean = true; diff --git a/packages/geo/src/lib/search/search-results/search-results.module.ts b/packages/geo/src/lib/search/search-results/search-results.module.ts index e10d57e7cf..3411dbc29c 100644 --- a/packages/geo/src/lib/search/search-results/search-results.module.ts +++ b/packages/geo/src/lib/search/search-results/search-results.module.ts @@ -1,63 +1,13 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatAutocompleteModule } from '@angular/material/autocomplete'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { - IgoCollapsibleModule, - IgoListModule, - IgoMatBadgeIconModule, - IgoStopPropagationModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoMetadataModule } from './../../metadata/metadata.module'; -import { SaveFeatureDialogComponent } from './save-feature-dialog.component'; import { SearchResultAddButtonComponent } from './search-results-add-button.component'; -import { SearchResultsItemComponent } from './search-results-item.component'; import { SearchResultsComponent } from './search-results.component'; /** - * @ignore + * @deprecated import the components directly or the SEARCH_RESULTS_DIRECTIVES */ @NgModule({ - imports: [ - CommonModule, - IgoCollapsibleModule, - IgoLanguageModule, - IgoListModule, - IgoMatBadgeIconModule, - IgoMetadataModule, - IgoStopPropagationModule, - MatAutocompleteModule, - MatBadgeModule, - MatButtonModule, - MatDialogModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - MatListModule, - MatSelectModule, - MatTabsModule, - MatTooltipModule, - ReactiveFormsModule - ], - exports: [SearchResultsComponent, SearchResultAddButtonComponent], - declarations: [ - SearchResultsComponent, - SearchResultsItemComponent, - SearchResultAddButtonComponent, - SaveFeatureDialogComponent - ] + imports: [SearchResultsComponent, SearchResultAddButtonComponent], + exports: [SearchResultsComponent, SearchResultAddButtonComponent] }) export class IgoSearchResultsModule {} diff --git a/packages/geo/src/lib/search/search-selector/search-selector.component.ts b/packages/geo/src/lib/search/search-selector/search-selector.component.ts index ebdde65cf8..ba5b608b76 100644 --- a/packages/geo/src/lib/search/search-selector/search-selector.component.ts +++ b/packages/geo/src/lib/search/search-selector/search-selector.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgFor } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,7 +8,13 @@ import { OnInit, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { distinctUntilChanged } from 'rxjs/operators'; @@ -26,7 +33,18 @@ import { SEARCH_TYPES } from '../shared/search.enums'; selector: 'igo-search-selector', templateUrl: './search-selector.component.html', styleUrls: ['./search-selector.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatButtonModule, + MatTooltipModule, + MatMenuModule, + MatIconModule, + MatRadioModule, + NgFor, + AsyncPipe, + TranslateModule + ] }) export class SearchSelectorComponent implements OnInit, OnDestroy { readonly searchType$: BehaviorSubject = new BehaviorSubject( diff --git a/packages/geo/src/lib/search/search-selector/search-selector.module.ts b/packages/geo/src/lib/search/search-selector/search-selector.module.ts index 5e165e10c7..83bef56948 100644 --- a/packages/geo/src/lib/search/search-selector/search-selector.module.ts +++ b/packages/geo/src/lib/search/search-selector/search-selector.module.ts @@ -1,33 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatIconModule } from '@angular/material/icon'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { SearchSelectorComponent } from './search-selector.component'; /** - * @ignore + * @deprecated import the SearchSelectorComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatTooltipModule, - MatIconModule, - MatButtonModule, - MatMenuModule, - MatRadioModule, - MatTabsModule, - MatCheckboxModule, - IgoLanguageModule - ], - exports: [SearchSelectorComponent], - declarations: [SearchSelectorComponent] + imports: [SearchSelectorComponent], + exports: [SearchSelectorComponent] }) export class IgoSearchSelectorModule {} diff --git a/packages/geo/src/lib/search/search-settings/search-settings.component.spec.ts b/packages/geo/src/lib/search/search-settings/search-settings.component.spec.ts index fb5dc137e5..28ae2824cc 100644 --- a/packages/geo/src/lib/search/search-settings/search-settings.component.spec.ts +++ b/packages/geo/src/lib/search/search-settings/search-settings.component.spec.ts @@ -60,9 +60,9 @@ describe('SearchSettingsComponent', () => { MatCheckboxModule, MatDividerModule, MatSlideToggleModule, - MatIconTestingModule + MatIconTestingModule, + SearchSettingsComponent ], - declarations: [SearchSettingsComponent], providers: [ { provide: SearchSourceService, useValue: spy }, provideDefaultIChercheSearchResultFormatter(), diff --git a/packages/geo/src/lib/search/search-settings/search-settings.component.ts b/packages/geo/src/lib/search/search-settings/search-settings.component.ts index a0fd400d34..8791ef774a 100644 --- a/packages/geo/src/lib/search/search-settings/search-settings.component.ts +++ b/packages/geo/src/lib/search/search-settings/search-settings.component.ts @@ -1,3 +1,4 @@ +import { NgFor, NgIf, NgSwitch, NgSwitchCase } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -7,11 +8,22 @@ import { OnInit, Output } from '@angular/core'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MatRadioChange } from '@angular/material/radio'; +import { MatButtonModule } from '@angular/material/button'; +import { + MatCheckboxChange, + MatCheckboxModule +} from '@angular/material/checkbox'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatRadioChange, MatRadioModule } from '@angular/material/radio'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { MediaService, StorageService } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; + import { SearchSourceService } from '../shared/search-source.service'; import { sourceCanReverseSearch, @@ -36,7 +48,23 @@ import { selector: 'igo-search-settings', templateUrl: './search-settings.component.html', styleUrls: ['./search-settings.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatButtonModule, + MatTooltipModule, + MatMenuModule, + MatIconModule, + NgIf, + NgFor, + MatCheckboxModule, + NgSwitch, + NgSwitchCase, + MatRadioModule, + MatDividerModule, + MatSlideToggleModule, + TranslateModule + ] }) export class SearchSettingsComponent implements OnInit { public hasPointerReverseSearchSource: boolean = false; diff --git a/packages/geo/src/lib/search/search-settings/search-settings.module.ts b/packages/geo/src/lib/search/search-settings/search-settings.module.ts index 7a7143ad28..ed9f7de8a1 100644 --- a/packages/geo/src/lib/search/search-settings/search-settings.module.ts +++ b/packages/geo/src/lib/search/search-settings/search-settings.module.ts @@ -1,35 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatIconModule } from '@angular/material/icon'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { SearchSettingsComponent } from './search-settings.component'; /** - * @ignore + * @deprecated import the SearchSettingsComponent directly */ @NgModule({ - declarations: [SearchSettingsComponent], - imports: [ - CommonModule, - MatTooltipModule, - MatIconModule, - MatButtonModule, - MatMenuModule, - MatRadioModule, - MatCheckboxModule, - MatDividerModule, - MatSlideToggleModule, - IgoLanguageModule - ], + imports: [SearchSettingsComponent], exports: [SearchSettingsComponent] }) export class IgoSearchSettingsModule {} diff --git a/packages/geo/src/lib/search/search.module.ts b/packages/geo/src/lib/search/search.module.ts index 1f62dea7c2..b28fd31e6b 100644 --- a/packages/geo/src/lib/search/search.module.ts +++ b/packages/geo/src/lib/search/search.module.ts @@ -1,4 +1,3 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { IgoSearchBarModule } from './search-bar/search-bar.module'; @@ -14,11 +13,11 @@ import { provideILayerSearchResultFormatter } from './shared/sources/ilayer.prov @NgModule({ imports: [ - CommonModule, IgoSearchBarModule, IgoSearchSelectorModule, IgoSearchResultsModule, - IgoSearchSettingsModule + IgoSearchSettingsModule, + SearchPointerSummaryDirective ], exports: [ IgoSearchBarModule, @@ -26,8 +25,7 @@ import { provideILayerSearchResultFormatter } from './shared/sources/ilayer.prov IgoSearchResultsModule, IgoSearchSettingsModule, SearchPointerSummaryDirective - ], - declarations: [SearchPointerSummaryDirective] + ] }) export class IgoSearchModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/search/shared/search-pointer-summary.directive.ts b/packages/geo/src/lib/search/shared/search-pointer-summary.directive.ts index 278332b5fe..f3831e4a77 100644 --- a/packages/geo/src/lib/search/shared/search-pointer-summary.directive.ts +++ b/packages/geo/src/lib/search/shared/search-pointer-summary.directive.ts @@ -43,7 +43,8 @@ import { sourceCanReverseSearchAsSummary } from './search.utils'; * the layer level. */ @Directive({ - selector: '[igoSearchPointerSummary]' + selector: '[igoSearchPointerSummary]', + standalone: true }) export class SearchPointerSummaryDirective implements OnInit, OnDestroy, AfterContentChecked diff --git a/packages/geo/src/lib/search/shared/sources/storedqueries.ts b/packages/geo/src/lib/search/shared/sources/storedqueries.ts index 2be2e6524b..81769e0189 100644 --- a/packages/geo/src/lib/search/shared/sources/storedqueries.ts +++ b/packages/geo/src/lib/search/shared/sources/storedqueries.ts @@ -207,10 +207,10 @@ export class StoredQueriesSearchSource a.meta.score > b.meta.score ? 1 : a.meta.score === b.meta.score - ? a.meta.titleHtml < b.meta.titleHtml - ? 1 + ? a.meta.titleHtml < b.meta.titleHtml + ? 1 + : -1 : -1 - : -1 ); resultArray.reverse(); if (resultArray.length > Number(this.options.params.limit)) { diff --git a/packages/geo/src/lib/style/style-modal/drawing/style-modal-drawing.component.ts b/packages/geo/src/lib/style/style-modal/drawing/style-modal-drawing.component.ts index 727a1685cc..463019d753 100644 --- a/packages/geo/src/lib/style/style-modal/drawing/style-modal-drawing.component.ts +++ b/packages/geo/src/lib/style/style-modal/drawing/style-modal-drawing.component.ts @@ -1,6 +1,28 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, Inject, Input, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; + +import { ColorPickerFormFieldComponent } from '@igo2/common'; + +import { TranslateModule } from '@ngx-translate/core'; import { FontType } from '../../shared/font.enum'; import { DrawStyleService } from '../../style-service/draw-style.service'; @@ -12,7 +34,25 @@ import { @Component({ selector: 'igo-style-modal-drawing', templateUrl: './style-modal-drawing.component.html', - styleUrls: ['./style-modal-drawing.component.scss'] + styleUrls: ['./style-modal-drawing.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + NgIf, + MatIconModule, + ColorPickerFormFieldComponent, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatDialogActions, + MatButtonModule, + TranslateModule + ] }) export class StyleModalDrawingComponent implements OnInit { @Input() confirmFlag: boolean = false; diff --git a/packages/geo/src/lib/style/style-modal/layer-button/style-modal-layer-button.component.ts b/packages/geo/src/lib/style/style-modal/layer-button/style-modal-layer-button.component.ts index 4e841ef5ad..fe2524d5b6 100644 --- a/packages/geo/src/lib/style/style-modal/layer-button/style-modal-layer-button.component.ts +++ b/packages/geo/src/lib/style/style-modal/layer-button/style-modal-layer-button.component.ts @@ -1,5 +1,10 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; import { MatDialog } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; + +import { TranslateModule } from '@ngx-translate/core'; import { VectorLayer } from '../../../layer/shared/layers/vector-layer'; import { StyleModalLayerComponent } from '../layer/style-modal-layer.component'; @@ -9,7 +14,9 @@ import { LayerMatDialogData } from '../shared/style-modal.interface'; selector: 'igo-style-modal-layer-button', templateUrl: './style-modal-layer-button.component.html', styleUrls: ['./style-modal-layer-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MatButtonModule, MatTooltipModule, MatIconModule, TranslateModule] }) export class StyleModalLayerButtonComponent { @Input() layer: VectorLayer; diff --git a/packages/geo/src/lib/style/style-modal/layer/style-modal-layer.component.ts b/packages/geo/src/lib/style/style-modal/layer/style-modal-layer.component.ts index f441bc78ed..49f97cc281 100644 --- a/packages/geo/src/lib/style/style-modal/layer/style-modal-layer.component.ts +++ b/packages/geo/src/lib/style/style-modal/layer/style-modal-layer.component.ts @@ -1,10 +1,28 @@ +import { NgIf } from '@angular/common'; import { Component, Inject, Input, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { + FormsModule, + ReactiveFormsModule, + UntypedFormBuilder, + UntypedFormGroup +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef, + MatDialogTitle +} from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; + +import { ColorPickerFormFieldComponent } from '@igo2/common'; import { asArray as ColorAsArray } from 'ol/color'; import olStyle from 'ol/style/Style'; +import { TranslateModule } from '@ngx-translate/core'; + import { LayerMatDialogData, StyleModalData @@ -13,7 +31,20 @@ import { @Component({ selector: 'igo-style-modal-layer', templateUrl: './style-modal-layer.component.html', - styleUrls: ['./style-modal-layer.component.scss'] + styleUrls: ['./style-modal-layer.component.scss'], + standalone: true, + imports: [ + MatDialogTitle, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + NgIf, + MatIconModule, + ColorPickerFormFieldComponent, + MatDialogActions, + MatButtonModule, + TranslateModule + ] }) export class StyleModalLayerComponent implements OnInit { @Input() confirmFlag: boolean = false; diff --git a/packages/geo/src/lib/style/style.module.ts b/packages/geo/src/lib/style/style.module.ts index 4680fe7ff7..526cf7b678 100644 --- a/packages/geo/src/lib/style/style.module.ts +++ b/packages/geo/src/lib/style/style.module.ts @@ -1,16 +1,4 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { ColorPickerFormFieldModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { IgoStyleListModule } from './style-list/style-list.module'; import { StyleModalDrawingComponent } from './style-modal/drawing/style-modal-drawing.component'; @@ -21,27 +9,13 @@ import { StyleService } from './style-service/style.service'; @NgModule({ imports: [ - CommonModule, - FormsModule, - IgoLanguageModule, - MatFormFieldModule, - MatIconModule, - MatButtonModule, - MatDialogModule, - MatInputModule, - MatSelectModule, - MatTooltipModule, - ReactiveFormsModule, - ColorPickerFormFieldModule, - IgoStyleListModule.forRoot() - ], - exports: [ - IgoStyleListModule, + IgoStyleListModule.forRoot(), StyleModalDrawingComponent, StyleModalLayerComponent, StyleModalLayerButtonComponent ], - declarations: [ + exports: [ + IgoStyleListModule, StyleModalDrawingComponent, StyleModalLayerComponent, StyleModalLayerButtonComponent diff --git a/packages/geo/src/lib/toast/toast.component.ts b/packages/geo/src/lib/toast/toast.component.ts index ac8550566f..97550bd9c7 100644 --- a/packages/geo/src/lib/toast/toast.component.ts +++ b/packages/geo/src/lib/toast/toast.component.ts @@ -1,9 +1,18 @@ +import { NgIf } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; -import { FlexibleState, getEntityTitle } from '@igo2/common'; +import { + FlexibleComponent, + FlexibleState, + PanelComponent, + getEntityTitle +} from '@igo2/common'; import olFormatGeoJSON from 'ol/format/GeoJSON'; +import { FeatureDetailsComponent } from '../feature/feature-details/feature-details.component'; import { FeatureMotion } from '../feature/shared/feature.enums'; import { Feature } from '../feature/shared/feature.interfaces'; import { moveToOlFeatures } from '../feature/shared/feature.utils'; @@ -12,7 +21,16 @@ import { IgoMap } from '../map/shared/map'; @Component({ selector: 'igo-toast', templateUrl: './toast.component.html', - styleUrls: ['./toast.component.scss'] + styleUrls: ['./toast.component.scss'], + standalone: true, + imports: [ + FlexibleComponent, + PanelComponent, + MatButtonModule, + MatIconModule, + NgIf, + FeatureDetailsComponent + ] }) export class ToastComponent { static SWIPE_ACTION = { diff --git a/packages/geo/src/lib/toast/toast.module.ts b/packages/geo/src/lib/toast/toast.module.ts index cf59bcac20..bfe04572a5 100644 --- a/packages/geo/src/lib/toast/toast.module.ts +++ b/packages/geo/src/lib/toast/toast.module.ts @@ -1,24 +1,13 @@ -import { CommonModule } from '@angular/common'; import { ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { IgoFlexibleModule, IgoPanelModule } from '@igo2/common'; - -import { IgoFeatureModule } from '../feature/feature.module'; import { ToastComponent } from './toast.component'; +/** + * @deprecated import the ToastComponent directly + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - IgoPanelModule, - IgoFlexibleModule, - IgoFeatureModule - ], - exports: [ToastComponent], - declarations: [ToastComponent] + imports: [ToastComponent], + exports: [ToastComponent] }) export class IgoToastModule { static forRoot(): ModuleWithProviders { diff --git a/packages/geo/src/lib/wkt/wkt.module.ts b/packages/geo/src/lib/wkt/wkt.module.ts index 48785abbfc..70a2bfa7dd 100644 --- a/packages/geo/src/lib/wkt/wkt.module.ts +++ b/packages/geo/src/lib/wkt/wkt.module.ts @@ -1,5 +1,8 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; +/** + * @deprecated UNUSED + */ @NgModule({ imports: [], exports: [], diff --git a/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.component.ts b/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.component.ts index 59acb37e1f..2475c7d6a7 100644 --- a/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.component.ts +++ b/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.component.ts @@ -1,5 +1,11 @@ import { Component, Inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MatButtonModule } from '@angular/material/button'; +import { + MAT_DIALOG_DATA, + MatDialogActions, + MatDialogContent, + MatDialogRef +} from '@angular/material/dialog'; import { LanguageService } from '@igo2/core'; @@ -11,7 +17,9 @@ export interface DialogData { @Component({ selector: 'igo-confirmation-popup-component', templateUrl: './confirmation-popup.component.html', - styleUrls: ['./confirmation-popup.component.scss'] + styleUrls: ['./confirmation-popup.component.scss'], + standalone: true, + imports: [MatDialogContent, MatDialogActions, MatButtonModule] }) export class ConfirmationPopupComponent { constructor( diff --git a/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.module.ts b/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.module.ts index 3fc24c8ec5..6e20ee3935 100644 --- a/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.module.ts +++ b/packages/geo/src/lib/workspace/confirmation-popup/confirmation-popup.module.ts @@ -1,22 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; import { ConfirmationPopupComponent } from './confirmation-popup.component'; /** - * @ignore + * @deprecated import the ConfirmationPopupComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatButtonModule, - MatDialogModule, - MatButtonToggleModule - ], - exports: [ConfirmationPopupComponent], - declarations: [ConfirmationPopupComponent] + imports: [ConfirmationPopupComponent], + exports: [ConfirmationPopupComponent] }) export class IgoConfirmationPopupModule {} diff --git a/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.component.ts b/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.component.ts index 34987f43f7..35e0daff53 100644 --- a/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.component.ts +++ b/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.component.ts @@ -9,6 +9,7 @@ import { import { OnUpdateInputs, WidgetComponent } from '@igo2/common'; +import { OgcFilterableItemComponent } from '../../../filter/ogc-filterable-item/ogc-filterable-item.component'; import { Layer } from '../../../layer/shared/layers/layer'; import { IgoMap } from '../../../map/shared/map'; @@ -16,7 +17,9 @@ import { IgoMap } from '../../../map/shared/map'; selector: 'igo-ogc-filter', templateUrl: './ogc-filter.component.html', styleUrls: ['./ogc-filter.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [OgcFilterableItemComponent] }) export class OgcFilterComponent implements OnUpdateInputs, WidgetComponent { @Input() layer: Layer; diff --git a/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.module.ts b/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.module.ts index c17d1397fc..03bb3c0595 100644 --- a/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.module.ts +++ b/packages/geo/src/lib/workspace/widgets/ogc-filter/ogc-filter.module.ts @@ -1,18 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { IgoLanguageModule } from '@igo2/core'; - -import { IgoFilterModule } from '../../../filter/filter.module'; import { OgcFilterComponent } from './ogc-filter.component'; /** - * @ignore + * @deprecated import the OgcFilterComponent directly */ @NgModule({ - imports: [CommonModule, MatButtonModule, IgoLanguageModule, IgoFilterModule], - exports: [OgcFilterComponent], - declarations: [OgcFilterComponent] + imports: [OgcFilterComponent], + exports: [OgcFilterComponent] }) export class IgoOgcFilterModule {} diff --git a/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.directive.ts b/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.directive.ts index 566da16834..7b42559af5 100644 --- a/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.directive.ts +++ b/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.directive.ts @@ -32,7 +32,8 @@ import { WfsWorkspaceService } from '../shared/wfs-workspace.service'; import { WmsWorkspaceService } from '../shared/wms-workspace.service'; @Directive({ - selector: '[igoWorkspaceSelector]' + selector: '[igoWorkspaceSelector]', + standalone: true }) export class WorkspaceSelectorDirective implements OnInit, OnDestroy { private layers$$: Subscription; diff --git a/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.module.ts b/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.module.ts index 0a50af99d3..9635465dd1 100644 --- a/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.module.ts +++ b/packages/geo/src/lib/workspace/workspace-selector/workspace-selector.module.ts @@ -1,14 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { WorkspaceSelectorDirective } from './workspace-selector.directive'; /** - * @ignore + * @deprecated import the WorkspaceSelectorDirective directly */ @NgModule({ - imports: [CommonModule], - exports: [WorkspaceSelectorDirective], - declarations: [WorkspaceSelectorDirective] + imports: [WorkspaceSelectorDirective], + exports: [WorkspaceSelectorDirective] }) export class IgoWorkspaceSelectorModule {} diff --git a/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.directive.ts b/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.directive.ts index 17e94068cc..5aa3f17e12 100644 --- a/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.directive.ts +++ b/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.directive.ts @@ -22,7 +22,8 @@ import { WfsWorkspaceService } from '../shared/wfs-workspace.service'; import { WmsWorkspaceService } from '../shared/wms-workspace.service'; @Directive({ - selector: '[igoWorkspaceUpdator]' + selector: '[igoWorkspaceUpdator]', + standalone: true }) export class WorkspaceUpdatorDirective implements OnInit, OnDestroy { private layers$$: Subscription; diff --git a/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.module.ts b/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.module.ts index d185498b65..a4ad606ca0 100644 --- a/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.module.ts +++ b/packages/geo/src/lib/workspace/workspace-updator/workspace-updator.module.ts @@ -1,14 +1,12 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { WorkspaceUpdatorDirective } from './workspace-updator.directive'; /** - * @ignore + * @deprecated import the WorkspaceUpdatorDirective directly */ @NgModule({ - imports: [CommonModule], - exports: [WorkspaceUpdatorDirective], - declarations: [WorkspaceUpdatorDirective] + imports: [WorkspaceUpdatorDirective], + exports: [WorkspaceUpdatorDirective] }) export class IgoWorkspaceUpdatorModule {} diff --git a/packages/geo/src/lib/workspace/workspace.module.ts b/packages/geo/src/lib/workspace/workspace.module.ts index 5e260a7eb2..dc5b86e909 100644 --- a/packages/geo/src/lib/workspace/workspace.module.ts +++ b/packages/geo/src/lib/workspace/workspace.module.ts @@ -1,33 +1,20 @@ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { MatDialogModule } from '@angular/material/dialog'; import { IgoWidgetModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; -import { IgoConfirmationPopupModule } from './confirmation-popup/confirmation-popup.module'; import { IgoOgcFilterModule } from './widgets/ogc-filter/ogc-filter.module'; import { provideOgcFilterWidget } from './widgets/widgets'; import { IgoWorkspaceSelectorModule } from './workspace-selector/workspace-selector.module'; -import { IgoWorkspaceUpdatorModule } from './workspace-updator/workspace-updator.module'; @NgModule({ imports: [ - CommonModule, - IgoLanguageModule, IgoWidgetModule, - IgoWorkspaceSelectorModule, - IgoWorkspaceUpdatorModule, IgoOgcFilterModule, - MatDialogModule - ], - exports: [ IgoWorkspaceSelectorModule, - IgoWorkspaceUpdatorModule, - IgoOgcFilterModule, - IgoConfirmationPopupModule + MatDialogModule ], - declarations: [], + exports: [IgoOgcFilterModule], providers: [provideOgcFilterWidget()] }) export class IgoGeoWorkspaceModule {} diff --git a/packages/geo/src/locale/en.geo.json b/packages/geo/src/locale/en.geo.json index 8b377f6ab6..c1de87f131 100644 --- a/packages/geo/src/locale/en.geo.json +++ b/packages/geo/src/locale/en.geo.json @@ -511,7 +511,7 @@ "restArea": "Rest area", "cycleStop": "Cycle stop", "cultpatri": "Culture and heritage", - "unites":"Unit number" + "unites": "Unit number" }, "restrictExtent": { "map": "Map extent", @@ -675,7 +675,7 @@ "penitencier-fed": "Federal penitentiaries", "penitencier-prov": "Provincial penitentiaries", "polices": "Police station", - "unites":"Unit number" + "unites": "Unit number" }, "measure": { "dialog": { @@ -815,4 +815,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/geo/src/locale/fr.geo.json b/packages/geo/src/locale/fr.geo.json index 550d16e77b..20732cf4a9 100644 --- a/packages/geo/src/locale/fr.geo.json +++ b/packages/geo/src/locale/fr.geo.json @@ -511,7 +511,7 @@ "restArea": "Halte routière", "cycleStop": "Halte cyclable", "cultpatri": "Culture et patrimoine", - "unites":"Numéro d'unite" + "unites": "Numéro d'unite" }, "restrictExtent": { "map": "Étendue de la carte", @@ -676,7 +676,7 @@ "penitencier-fed": "Pénitenciers fédéraux", "penitencier-prov": "Pénitenciers provinciaux", "polices": "Poste de police", - "unites":"Numéro d'unite" + "unites": "Numéro d'unite" }, "measure": { "dialog": { @@ -816,4 +816,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/geo/src/public_api.ts b/packages/geo/src/public_api.ts index 535d6229f1..03520cd725 100644 --- a/packages/geo/src/public_api.ts +++ b/packages/geo/src/public_api.ts @@ -3,23 +3,21 @@ */ export * from './lib/geo.module'; -export * from './lib/catalog/catalog.module'; + export * from './lib/catalog/catalog-browser/catalog-browser.module'; export * from './lib/catalog/catalog-library/catalog-library.module'; -export * from './lib/datasource/datasource.module'; +export * from './lib/catalog/catalog.module'; export * from './lib/directions/directions.module'; export * from './lib/download/download.module'; -export * from './lib/draw/drawingTool.module'; export * from './lib/draw/draw/draw.module'; -export * from './lib/workspace/workspace.module'; - -export * from './lib/feature/feature.module'; -export * from './lib/feature/feature-form/feature-form.module'; -export * from './lib/feature/feature-details/feature-details.module'; +export * from './lib/draw/drawingTool.module'; export * from './lib/feature/feature-details/feature-details.directive'; +export * from './lib/feature/feature-details/feature-details.module'; +export * from './lib/feature/feature-form/feature-form.module'; +export * from './lib/feature/feature.module'; export * from './lib/filter/filter.module'; -export * from './lib/geometry/geometry.module'; export * from './lib/geometry/geometry-form-field/geometry-form-field.module'; +export * from './lib/geometry/geometry.module'; export * from './lib/import-export/import-export.module'; export * from './lib/layer/layer.module'; export * from './lib/map/map.module'; @@ -33,9 +31,11 @@ export * from './lib/search/search.module'; export * from './lib/style/style.module'; export * from './lib/toast/toast.module'; export * from './lib/wkt/wkt.module'; +export * from './lib/workspace/workspace.module'; export * from './lib/catalog'; export * from './lib/datasource'; +export * from './lib/directions'; export * from './lib/download'; export * from './lib/draw'; export * from './lib/environment'; @@ -47,14 +47,13 @@ export * from './lib/layer'; export * from './lib/map'; export * from './lib/measure'; export * from './lib/metadata'; +export * from './lib/offline'; export * from './lib/overlay'; export * from './lib/print'; export * from './lib/query'; -export * from './lib/directions'; export * from './lib/search'; +export * from './lib/style'; export * from './lib/toast'; export * from './lib/utils'; export * from './lib/wkt'; export * from './lib/workspace'; -export * from './lib/style'; -export * from './lib/offline'; diff --git a/packages/integration/package.json b/packages/integration/package.json index 62223c157d..ac0d682f76 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build integration --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint integration", + "lint.fix": "ng lint integration --fix", "test": "", "watch": "ng build integration --watch" }, diff --git a/packages/integration/src/lib/about/about-tool/about-tool.component.scss b/packages/integration/src/lib/about/about-tool/about-tool.component.scss index a263afcdb2..88cb9e4de1 100644 --- a/packages/integration/src/lib/about/about-tool/about-tool.component.scss +++ b/packages/integration/src/lib/about/about-tool/about-tool.component.scss @@ -1,4 +1,4 @@ -igo-interactive-tour { +igo-interactive-tour button { margin-left: 20px; } diff --git a/packages/integration/src/lib/about/about-tool/about-tool.component.ts b/packages/integration/src/lib/about/about-tool/about-tool.component.ts index ef86833144..651ff7290d 100644 --- a/packages/integration/src/lib/about/about-tool/about-tool.component.ts +++ b/packages/integration/src/lib/about/about-tool/about-tool.component.ts @@ -1,10 +1,20 @@ +import { NgFor, NgIf } from '@angular/common'; import { HttpClient } from '@angular/common/http'; import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; -import { ToolComponent } from '@igo2/common'; +import { + CustomHtmlComponent, + InteractiveTourComponent, + ToolComponent +} from '@igo2/common'; import { ConfigService, LanguageService, version } from '@igo2/core'; +import { TranslateModule } from '@ngx-translate/core'; import { of } from 'rxjs'; import type { Observable } from 'rxjs'; @@ -18,7 +28,19 @@ import { AllEnvironmentOptions } from '../../environment'; @Component({ selector: 'igo-about-tool', templateUrl: './about-tool.component.html', - styleUrls: ['./about-tool.component.scss'] + styleUrls: ['./about-tool.component.scss'], + standalone: true, + imports: [ + InteractiveTourComponent, + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + MatMenuModule, + NgFor, + CustomHtmlComponent, + TranslateModule + ] }) export class AboutToolComponent implements OnInit { private configOptions: AllEnvironmentOptions; diff --git a/packages/integration/src/lib/about/about.module.ts b/packages/integration/src/lib/about/about.module.ts index 7dec86504b..d1844db6f5 100644 --- a/packages/integration/src/lib/about/about.module.ts +++ b/packages/integration/src/lib/about/about.module.ts @@ -1,31 +1,16 @@ -import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, ModuleWithProviders, NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoCustomHtmlModule, IgoInteractiveTourModule } from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; import { AboutToolComponent } from './about-tool/about-tool.component'; +/** + * @deprecated import the AboutToolComponent directly + */ @NgModule({ - imports: [ - IgoLanguageModule, - IgoCustomHtmlModule, - MatButtonModule, - MatTooltipModule, - MatIconModule, - MatMenuModule, - IgoInteractiveTourModule, - CommonModule - ], - declarations: [AboutToolComponent], + imports: [AboutToolComponent], exports: [AboutToolComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) diff --git a/packages/integration/src/lib/analytics/analytics.module.ts b/packages/integration/src/lib/analytics/analytics.module.ts deleted file mode 100644 index d10a0bea85..0000000000 --- a/packages/integration/src/lib/analytics/analytics.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; - -@NgModule({ - imports: [], - declarations: [], - exports: [] -}) -export class IgoAppAnalyticsModule {} diff --git a/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.component.ts b/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.component.ts index 30a4aaa93a..75dd4a97bf 100644 --- a/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.component.ts +++ b/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -10,6 +11,7 @@ import { AuthService } from '@igo2/auth'; import { EntityRecord, EntityStore, ToolComponent } from '@igo2/common'; import { Catalog, + CatalogBrowserComponent, CatalogItem, CatalogItemState, CatalogService, @@ -34,7 +36,9 @@ import { CatalogState } from '../catalog.state'; @Component({ selector: 'igo-catalog-browser-tool', templateUrl: './catalog-browser-tool.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [NgIf, CatalogBrowserComponent, AsyncPipe] }) export class CatalogBrowserToolComponent implements OnInit, OnDestroy { catalog: Catalog; diff --git a/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.module.ts b/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.module.ts index b64f11ca0c..beab35bb5a 100644 --- a/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.module.ts +++ b/packages/integration/src/lib/catalog/catalog-browser-tool/catalog-browser-tool.module.ts @@ -1,17 +1,12 @@ -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; - -import { IgoCatalogBrowserModule } from '@igo2/geo'; +import { NgModule } from '@angular/core'; import { CatalogBrowserToolComponent } from './catalog-browser-tool.component'; /** - * @ignore + * @deprecated import the CatalogBrowserToolComponent directly */ @NgModule({ - imports: [CommonModule, IgoCatalogBrowserModule], - declarations: [CatalogBrowserToolComponent], - exports: [CatalogBrowserToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [CatalogBrowserToolComponent], + exports: [CatalogBrowserToolComponent] }) export class IgoAppCatalogBrowserToolModule {} diff --git a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts index 89822260fb..175e1705cb 100644 --- a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts +++ b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.component.ts @@ -8,7 +8,7 @@ import { import { ToolComponent } from '@igo2/common'; import { EntityStore } from '@igo2/common'; import { StorageService } from '@igo2/core'; -import { Catalog, CatalogService } from '@igo2/geo'; +import { Catalog, CatalogLibaryComponent, CatalogService } from '@igo2/geo'; import { take } from 'rxjs/operators'; @@ -26,7 +26,9 @@ import { CatalogState } from '../catalog.state'; @Component({ selector: 'igo-catalog-library-tool', templateUrl: './catalog-library-tool.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [CatalogLibaryComponent] }) export class CatalogLibraryToolComponent implements OnInit { /** diff --git a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.module.ts b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.module.ts index d259fda8a7..c8e7ce86fc 100644 --- a/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.module.ts +++ b/packages/integration/src/lib/catalog/catalog-library-tool/catalog-library-tool.module.ts @@ -1,17 +1,12 @@ -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; - -import { IgoCatalogLibraryModule } from '@igo2/geo'; +import { NgModule } from '@angular/core'; import { CatalogLibraryToolComponent } from './catalog-library-tool.component'; /** - * @ignore + * @deprecated import the CatalogLibraryToolComponent directly */ @NgModule({ - imports: [CommonModule, IgoCatalogLibraryModule], - declarations: [CatalogLibraryToolComponent], - exports: [CatalogLibraryToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [CatalogLibraryToolComponent], + exports: [CatalogLibraryToolComponent] }) export class IgoAppCatalogLibraryToolModule {} diff --git a/packages/integration/src/lib/catalog/catalog.module.ts b/packages/integration/src/lib/catalog/catalog.module.ts index b5671a17b4..380f7fd7a4 100644 --- a/packages/integration/src/lib/catalog/catalog.module.ts +++ b/packages/integration/src/lib/catalog/catalog.module.ts @@ -3,9 +3,10 @@ import { NgModule } from '@angular/core'; import { IgoAppCatalogBrowserToolModule } from './catalog-browser-tool/catalog-browser-tool.module'; import { IgoAppCatalogLibraryToolModule } from './catalog-library-tool/catalog-library-tool.module'; +/** + * @deprecated import the components directly + */ @NgModule({ - imports: [], - exports: [IgoAppCatalogLibraryToolModule, IgoAppCatalogBrowserToolModule], - declarations: [] + exports: [IgoAppCatalogLibraryToolModule, IgoAppCatalogBrowserToolModule] }) export class IgoAppCatalogModule {} diff --git a/packages/integration/src/lib/context/context-editor-tool/context-editor-tool.component.ts b/packages/integration/src/lib/context/context-editor-tool/context-editor-tool.component.ts index cdb2fe625f..3b5a552dea 100644 --- a/packages/integration/src/lib/context/context-editor-tool/context-editor-tool.component.ts +++ b/packages/integration/src/lib/context/context-editor-tool/context-editor-tool.component.ts @@ -1,6 +1,10 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { + ContextEditBindingDirective, + ContextEditComponent +} from '@igo2/context'; import { ToolState } from '../../tool/tool.state'; @@ -12,7 +16,9 @@ import { ToolState } from '../../tool/tool.state'; }) @Component({ selector: 'igo-context-editor-tool', - templateUrl: './context-editor-tool.component.html' + templateUrl: './context-editor-tool.component.html', + standalone: true, + imports: [ContextEditComponent, ContextEditBindingDirective] }) export class ContextEditorToolComponent { constructor(private toolState: ToolState) {} diff --git a/packages/integration/src/lib/context/context-manager-tool/context-manager-tool.component.ts b/packages/integration/src/lib/context/context-manager-tool/context-manager-tool.component.ts index bf469a26b9..e8ed3d5782 100644 --- a/packages/integration/src/lib/context/context-manager-tool/context-manager-tool.component.ts +++ b/packages/integration/src/lib/context/context-manager-tool/context-manager-tool.component.ts @@ -1,6 +1,10 @@ import { Component, Input } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { + ContextListBindingDirective, + ContextListComponent +} from '@igo2/context'; import { IgoMap } from '@igo2/geo'; import { MapState } from '../../map/map.state'; @@ -13,7 +17,9 @@ import { ToolState } from '../../tool/tool.state'; }) @Component({ selector: 'igo-context-manager-tool', - templateUrl: './context-manager-tool.component.html' + templateUrl: './context-manager-tool.component.html', + standalone: true, + imports: [ContextListComponent, ContextListBindingDirective] }) export class ContextManagerToolComponent { @Input() toolToOpenOnContextChange: string = 'mapTools'; diff --git a/packages/integration/src/lib/context/context-permission-manager-tool/context-permission-manager-tool.component.ts b/packages/integration/src/lib/context/context-permission-manager-tool/context-permission-manager-tool.component.ts index 3880404a32..dde6896475 100644 --- a/packages/integration/src/lib/context/context-permission-manager-tool/context-permission-manager-tool.component.ts +++ b/packages/integration/src/lib/context/context-permission-manager-tool/context-permission-manager-tool.component.ts @@ -1,6 +1,10 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { + ContextPermissionsBindingDirective, + ContextPermissionsComponent +} from '@igo2/context'; @ToolComponent({ name: 'contextPermissionManager', @@ -10,6 +14,8 @@ import { ToolComponent } from '@igo2/common'; }) @Component({ selector: 'igo-context-permission-manager-tool', - templateUrl: './context-permission-manager-tool.component.html' + templateUrl: './context-permission-manager-tool.component.html', + standalone: true, + imports: [ContextPermissionsComponent, ContextPermissionsBindingDirective] }) export class ContextPermissionManagerToolComponent {} diff --git a/packages/integration/src/lib/context/context-share-tool/context-share-tool.component.ts b/packages/integration/src/lib/context/context-share-tool/context-share-tool.component.ts index 00f69c0ce0..a81740f818 100644 --- a/packages/integration/src/lib/context/context-share-tool/context-share-tool.component.ts +++ b/packages/integration/src/lib/context/context-share-tool/context-share-tool.component.ts @@ -1,6 +1,7 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { ShareMapComponent } from '@igo2/context'; import { IgoMap, LayerListControlsOptions } from '@igo2/geo'; import { LayerListToolState } from '../../map/layer-list-tool.state'; @@ -13,7 +14,9 @@ import { MapState } from '../../map/map.state'; }) @Component({ selector: 'igo-context-share-tool', - templateUrl: './context-share-tool.component.html' + templateUrl: './context-share-tool.component.html', + standalone: true, + imports: [ShareMapComponent] }) export class ContextShareToolComponent { get map(): IgoMap { diff --git a/packages/integration/src/lib/context/context.module.ts b/packages/integration/src/lib/context/context.module.ts index 4f9c284df2..37ea24e4e3 100644 --- a/packages/integration/src/lib/context/context.module.ts +++ b/packages/integration/src/lib/context/context.module.ts @@ -1,26 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; +import { NgModule } from '@angular/core'; -import { IgoContextModule } from '@igo2/context'; - -import { ContextEditorToolComponent } from './context-editor-tool/context-editor-tool.component'; -import { ContextManagerToolComponent } from './context-manager-tool/context-manager-tool.component'; -import { ContextPermissionManagerToolComponent } from './context-permission-manager-tool/context-permission-manager-tool.component'; -import { ContextShareToolComponent } from './context-share-tool/context-share-tool.component'; +import { INTEGRATION_CONTEXT_DIRECTIVES } from '.'; +/** + * @deprecated import the components/directive directly or INTEGRATION_CONTEXT_DIRECTIVES for the set + */ @NgModule({ - imports: [IgoContextModule], - declarations: [ - ContextEditorToolComponent, - ContextManagerToolComponent, - ContextPermissionManagerToolComponent, - ContextShareToolComponent - ], - exports: [ - ContextEditorToolComponent, - ContextManagerToolComponent, - ContextPermissionManagerToolComponent, - ContextShareToolComponent - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [...INTEGRATION_CONTEXT_DIRECTIVES], + exports: [...INTEGRATION_CONTEXT_DIRECTIVES] }) export class IgoAppContextModule {} diff --git a/packages/integration/src/lib/context/index.ts b/packages/integration/src/lib/context/index.ts index e1e43b7b61..5fa5399e77 100644 --- a/packages/integration/src/lib/context/index.ts +++ b/packages/integration/src/lib/context/index.ts @@ -1,5 +1,17 @@ +import { ContextEditorToolComponent } from './context-editor-tool/context-editor-tool.component'; +import { ContextManagerToolComponent } from './context-manager-tool/context-manager-tool.component'; +import { ContextPermissionManagerToolComponent } from './context-permission-manager-tool/context-permission-manager-tool.component'; +import { ContextShareToolComponent } from './context-share-tool/context-share-tool.component'; + export * from './context-manager-tool/context-manager-tool.component'; export * from './context-editor-tool/context-editor-tool.component'; export * from './context-permission-manager-tool/context-permission-manager-tool.component'; export * from './context-share-tool/context-share-tool.component'; export * from './context.state'; + +export const INTEGRATION_CONTEXT_DIRECTIVES = [ + ContextEditorToolComponent, + ContextManagerToolComponent, + ContextPermissionManagerToolComponent, + ContextShareToolComponent +] as const; diff --git a/packages/integration/src/lib/directions/directions-tool/directions-tool.component.html b/packages/integration/src/lib/directions/directions-tool/directions-tool.component.html index bf686871ae..2905dd7290 100644 --- a/packages/integration/src/lib/directions/directions-tool/directions-tool.component.html +++ b/packages/integration/src/lib/directions/directions-tool/directions-tool.component.html @@ -1,6 +1,6 @@ { diff --git a/packages/integration/src/lib/draw/draw.module.ts b/packages/integration/src/lib/draw/draw.module.ts index 57ff8105db..5a4457b0a1 100644 --- a/packages/integration/src/lib/draw/draw.module.ts +++ b/packages/integration/src/lib/draw/draw.module.ts @@ -1,11 +1,11 @@ import { NgModule } from '@angular/core'; -import { IgoDrawingToolModule } from '@igo2/geo'; - import { IgoAppDrawingToolModule } from './drawing-tool/drawing-tool.module'; +/** + * @deprecated import the DrawingToolComponent directly + */ @NgModule({ - imports: [IgoDrawingToolModule], exports: [IgoAppDrawingToolModule] }) export class IgoAppDrawModule {} diff --git a/packages/integration/src/lib/draw/drawing-tool/drawing-tool.component.ts b/packages/integration/src/lib/draw/drawing-tool/drawing-tool.component.ts index 28e7910078..b76d00c4af 100644 --- a/packages/integration/src/lib/draw/drawing-tool/drawing-tool.component.ts +++ b/packages/integration/src/lib/draw/drawing-tool/drawing-tool.component.ts @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; import { + DrawComponent, DrawControl, FeatureStore, FeatureWithDraw, @@ -23,7 +24,9 @@ import { DrawState } from '../draw.state'; @Component({ selector: 'igo-drawing-tool', templateUrl: './drawing-tool.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [DrawComponent] }) export class DrawingToolComponent { /** diff --git a/packages/integration/src/lib/draw/drawing-tool/drawing-tool.module.ts b/packages/integration/src/lib/draw/drawing-tool/drawing-tool.module.ts index 3c496ce928..6acdac6f5b 100644 --- a/packages/integration/src/lib/draw/drawing-tool/drawing-tool.module.ts +++ b/packages/integration/src/lib/draw/drawing-tool/drawing-tool.module.ts @@ -1,16 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; - -import { IgoDrawingToolModule } from '@igo2/geo'; +import { NgModule } from '@angular/core'; import { DrawingToolComponent } from './drawing-tool.component'; /** - * @ignore + * @deprecated import the DrawingToolComponent directly */ @NgModule({ - imports: [IgoDrawingToolModule], - declarations: [DrawingToolComponent], - exports: [DrawingToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [DrawingToolComponent], + exports: [DrawingToolComponent] }) export class IgoAppDrawingToolModule {} diff --git a/packages/integration/src/lib/filter/active-ogc-filter-tool/active-ogc-filter-tool.component.ts b/packages/integration/src/lib/filter/active-ogc-filter-tool/active-ogc-filter-tool.component.ts index fd0c973913..9631df34c8 100644 --- a/packages/integration/src/lib/filter/active-ogc-filter-tool/active-ogc-filter-tool.component.ts +++ b/packages/integration/src/lib/filter/active-ogc-filter-tool/active-ogc-filter-tool.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; -import { IgoMap, Layer } from '@igo2/geo'; +import { IgoMap, Layer, OgcFilterableItemComponent } from '@igo2/geo'; import { MapState } from '../../map/map.state'; import { toolSlideInOut } from './active-ogc-filter-tool.animation'; @@ -15,7 +15,9 @@ import { toolSlideInOut } from './active-ogc-filter-tool.animation'; @Component({ selector: 'igo-active-ogc-filter-tool', templateUrl: './active-ogc-filter-tool.component.html', - animations: [toolSlideInOut()] + animations: [toolSlideInOut()], + standalone: true, + imports: [OgcFilterableItemComponent] }) export class ActiveOgcFilterToolComponent { get map(): IgoMap { diff --git a/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.html b/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.html index 098add0dae..275e110efa 100644 --- a/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.html +++ b/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.html @@ -1,5 +1,4 @@ { diff --git a/packages/integration/src/lib/filter/index.ts b/packages/integration/src/lib/filter/index.ts index 03cf57d3f3..8948837cc2 100644 --- a/packages/integration/src/lib/filter/index.ts +++ b/packages/integration/src/lib/filter/index.ts @@ -1,5 +1,19 @@ +import { ActiveOgcFilterToolComponent } from './active-ogc-filter-tool'; +import { ActiveTimeFilterToolComponent } from './active-time-filter-tool'; +import { OgcFilterToolComponent } from './ogc-filter-tool'; +import { SpatialFilterToolComponent } from './spatial-filter-tool'; +import { TimeFilterToolComponent } from './time-filter-tool'; + export * from './ogc-filter-tool'; export * from './active-ogc-filter-tool'; export * from './spatial-filter-tool'; export * from './time-filter-tool'; export * from './active-time-filter-tool'; + +export const INTEGRATION_FILTER_DIRECTIVES = [ + OgcFilterToolComponent, + ActiveOgcFilterToolComponent, + TimeFilterToolComponent, + ActiveTimeFilterToolComponent, + SpatialFilterToolComponent +]; diff --git a/packages/integration/src/lib/filter/ogc-filter-tool/ogc-filter-tool.component.ts b/packages/integration/src/lib/filter/ogc-filter-tool/ogc-filter-tool.component.ts index 3b88dbba6b..854d1da120 100644 --- a/packages/integration/src/lib/filter/ogc-filter-tool/ogc-filter-tool.component.ts +++ b/packages/integration/src/lib/filter/ogc-filter-tool/ogc-filter-tool.component.ts @@ -1,6 +1,10 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { + OgcFilterableListBindingDirective, + OgcFilterableListComponent +} from '@igo2/geo'; @ToolComponent({ name: 'ogcFilter', @@ -9,7 +13,9 @@ import { ToolComponent } from '@igo2/common'; }) @Component({ selector: 'igo-ogc-filter-tool', - templateUrl: './ogc-filter-tool.component.html' + templateUrl: './ogc-filter-tool.component.html', + standalone: true, + imports: [OgcFilterableListComponent, OgcFilterableListBindingDirective] }) export class OgcFilterToolComponent { constructor() {} diff --git a/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.html b/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.html index 4ea5c54067..729521f5b9 100644 --- a/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.html +++ b/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.html @@ -1,48 +1,43 @@ - - - + + - - - - - - - - - + + + + + diff --git a/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.ts b/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.ts index 98066ca974..cbeac3ed36 100644 --- a/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.ts +++ b/packages/integration/src/lib/filter/spatial-filter-tool/spatial-filter-tool.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -11,6 +12,7 @@ import { MatIconRegistry } from '@angular/material/icon'; import { EntityStore, EntityStoreWithStrategy, + PanelComponent, ToolComponent } from '@igo2/common'; import { LanguageService, MessageService } from '@igo2/core'; @@ -20,17 +22,20 @@ import { DataSourceService, ExportOptions, Feature, + FeatureDetailsComponent, FeatureMotion, IgoMap, Layer, LayerService, MeasureLengthUnit, QueryableDataSourceOptions, + SpatialFilterItemComponent, SpatialFilterItemType, SpatialFilterQueryType, SpatialFilterService, SpatialFilterThematic, SpatialFilterType, + SpatialFilterTypeComponent, VectorLayer, createOverlayMarkerStyle, featureToOl, @@ -71,7 +76,16 @@ import { selector: 'igo-spatial-filter-tool', templateUrl: './spatial-filter-tool.component.html', styleUrls: ['./spatial-filter-tool.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + SpatialFilterTypeComponent, + SpatialFilterItemComponent, + PanelComponent, + FeatureDetailsComponent, + NgIf, + AsyncPipe + ] }) export class SpatialFilterToolComponent implements OnInit, OnDestroy { get map(): IgoMap { diff --git a/packages/integration/src/lib/filter/time-filter-tool/time-filter-tool.component.ts b/packages/integration/src/lib/filter/time-filter-tool/time-filter-tool.component.ts index 8f52e72f8a..a529c31386 100644 --- a/packages/integration/src/lib/filter/time-filter-tool/time-filter-tool.component.ts +++ b/packages/integration/src/lib/filter/time-filter-tool/time-filter-tool.component.ts @@ -1,6 +1,10 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; +import { + TimeFilterListBindingDirective, + TimeFilterListComponent +} from '@igo2/geo'; @ToolComponent({ name: 'timeFilter', @@ -9,7 +13,9 @@ import { ToolComponent } from '@igo2/common'; }) @Component({ selector: 'igo-time-filter-tool', - templateUrl: './time-filter-tool.component.html' + templateUrl: './time-filter-tool.component.html', + standalone: true, + imports: [TimeFilterListComponent, TimeFilterListBindingDirective] }) export class TimeFilterToolComponent { constructor() {} diff --git a/packages/integration/src/lib/import-export/import-export-tool/import-export-tool.component.ts b/packages/integration/src/lib/import-export/import-export-tool/import-export-tool.component.ts index c365ec6ac8..32822d67f4 100644 --- a/packages/integration/src/lib/import-export/import-export-tool/import-export-tool.component.ts +++ b/packages/integration/src/lib/import-export/import-export-tool/import-export-tool.component.ts @@ -1,18 +1,24 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; +import { MatTabsModule } from '@angular/material/tabs'; import { ToolComponent } from '@igo2/common'; import type { WorkspaceStore } from '@igo2/common'; +import { ContextImportExportComponent } from '@igo2/context'; import { ExportOptions, IgoMap, + ImportExportComponent, ProjectionsLimitationsOptions } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; + import { ContextState } from '../../context/context.state'; import { MapState } from '../../map/map.state'; import { WorkspaceState } from '../../workspace/workspace.state'; @@ -31,7 +37,16 @@ import { selector: 'igo-import-export-tool', templateUrl: './import-export-tool.component.html', styleUrls: ['./import-export-tool.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatTabsModule, + ImportExportComponent, + ContextImportExportComponent, + AsyncPipe, + TranslateModule + ] }) export class ImportExportToolComponent implements OnInit { @Input() projectionsLimitations: ProjectionsLimitationsOptions; diff --git a/packages/integration/src/lib/import-export/import-export.module.ts b/packages/integration/src/lib/import-export/import-export.module.ts index 33c85fd7f3..24b9c6f858 100644 --- a/packages/integration/src/lib/import-export/import-export.module.ts +++ b/packages/integration/src/lib/import-export/import-export.module.ts @@ -1,31 +1,13 @@ -import { CommonModule } from '@angular/common'; -import { - CUSTOM_ELEMENTS_SCHEMA, - ModuleWithProviders, - NgModule -} from '@angular/core'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatTabsModule } from '@angular/material/tabs'; - -import { IgoContextImportExportModule } from '@igo2/context'; -import { IgoLanguageModule } from '@igo2/core'; -import { IgoImportExportModule, IgoStyleModule } from '@igo2/geo'; +import { ModuleWithProviders, NgModule } from '@angular/core'; import { ImportExportToolComponent } from './import-export-tool/import-export-tool.component'; +/** + * @deprecated import the ImportExportToolComponent directly + */ @NgModule({ - imports: [ - IgoImportExportModule, - IgoContextImportExportModule, - CommonModule, - IgoLanguageModule, - MatButtonToggleModule, - MatTabsModule, - IgoStyleModule - ], - declarations: [ImportExportToolComponent], - exports: [ImportExportToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [ImportExportToolComponent], + exports: [ImportExportToolComponent] }) export class IgoAppImportExportModule { static forRoot(): ModuleWithProviders { diff --git a/packages/integration/src/lib/integration.module.ts b/packages/integration/src/lib/integration.module.ts index f185b14b9d..799fa5fa8a 100644 --- a/packages/integration/src/lib/integration.module.ts +++ b/packages/integration/src/lib/integration.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { IgoAppAboutModule } from './about/about.module'; -import { IgoAppAnalyticsModule } from './analytics/analytics.module'; import { IgoAppCatalogModule } from './catalog/catalog.module'; import { IgoAppContextModule } from './context/context.module'; import { IgoAppDirectionsModule } from './directions/directions.module'; @@ -12,15 +11,15 @@ import { IgoAppMapModule } from './map/map.module'; import { IgoAppMeasureModule } from './measure/measure.module'; import { IgoAppPrintModule } from './print/print.module'; import { IgoAppSearchModule } from './search/search.module'; -import { IgoAppStorageModule } from './storage/storage.module'; import { IgoAppWorkspaceModule } from './workspace/workspace.module'; +/** + * @deprecated import the components directly + */ @NgModule({ imports: [], declarations: [], exports: [ - IgoAppStorageModule, - IgoAppAnalyticsModule, IgoAppContextModule, IgoAppCatalogModule, IgoAppDirectionsModule, diff --git a/packages/integration/src/lib/map/advanced-map-tool/advanced-coordinates/advanced-coordinates.component.ts b/packages/integration/src/lib/map/advanced-map-tool/advanced-coordinates/advanced-coordinates.component.ts index b8a65e5d93..dc03370c21 100644 --- a/packages/integration/src/lib/map/advanced-map-tool/advanced-coordinates/advanced-coordinates.component.ts +++ b/packages/integration/src/lib/map/advanced-map-tool/advanced-coordinates/advanced-coordinates.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, DecimalPipe, NgFor, NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -6,10 +7,19 @@ import { OnInit } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatOptionModule } from '@angular/material/core'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { ConfigService, @@ -29,6 +39,7 @@ import { Clipboard } from '@igo2/utils'; import * as olproj from 'ol/proj'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, combineLatest } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; @@ -40,7 +51,24 @@ import { MapState } from '../../map.state'; @Component({ selector: 'igo-advanced-coordinates', templateUrl: './advanced-coordinates.component.html', - styleUrls: ['./advanced-coordinates.component.scss'] + styleUrls: ['./advanced-coordinates.component.scss'], + standalone: true, + imports: [ + NgIf, + MatFormFieldModule, + MatInputModule, + MatButtonModule, + MatIconModule, + FormsModule, + ReactiveFormsModule, + MatSelectModule, + NgFor, + MatOptionModule, + MatSlideToggleModule, + AsyncPipe, + DecimalPipe, + TranslateModule + ] }) export class AdvancedCoordinatesComponent implements OnInit, OnDestroy { public formattedScale$: BehaviorSubject = new BehaviorSubject(''); diff --git a/packages/integration/src/lib/map/advanced-map-tool/advanced-map-tool.component.ts b/packages/integration/src/lib/map/advanced-map-tool/advanced-map-tool.component.ts index 88e8653b5f..caa1cec2ac 100644 --- a/packages/integration/src/lib/map/advanced-map-tool/advanced-map-tool.component.ts +++ b/packages/integration/src/lib/map/advanced-map-tool/advanced-map-tool.component.ts @@ -1,8 +1,15 @@ +import { AsyncPipe } from '@angular/common'; import { Component } from '@angular/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { ToolComponent } from '@igo2/common'; +import { TranslateModule } from '@ngx-translate/core'; + import { MapState } from '../map.state'; +import { AdvancedCoordinatesComponent } from './advanced-coordinates/advanced-coordinates.component'; +import { AdvancedSwipeComponent } from './advanced-swipe/advanced-swipe.component'; @ToolComponent({ name: 'advancedMap', @@ -15,7 +22,16 @@ import { MapState } from '../map.state'; @Component({ selector: 'igo-advanced-map-tool', templateUrl: './advanced-map-tool.component.html', - styleUrls: ['./advanced-map-tool.component.scss'] + styleUrls: ['./advanced-map-tool.component.scss'], + standalone: true, + imports: [ + AdvancedSwipeComponent, + MatDividerModule, + AdvancedCoordinatesComponent, + MatSlideToggleModule, + AsyncPipe, + TranslateModule + ] }) export class AdvancedMapToolComponent { get tracking$() { diff --git a/packages/integration/src/lib/map/advanced-map-tool/advanced-swipe/advanced-swipe.component.ts b/packages/integration/src/lib/map/advanced-map-tool/advanced-swipe/advanced-swipe.component.ts index d9995e7765..c7708fcb4f 100644 --- a/packages/integration/src/lib/map/advanced-map-tool/advanced-swipe/advanced-swipe.component.ts +++ b/packages/integration/src/lib/map/advanced-map-tool/advanced-swipe/advanced-swipe.component.ts @@ -1,20 +1,47 @@ +import { NgFor, NgIf } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { + FormsModule, + ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; +import { MatOptionModule } from '@angular/material/core'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { ContextService, DetailedContext } from '@igo2/context'; import { IgoMap, Layer, VectorLayer } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; + import { ToolState } from '../../../tool/tool.state'; import { MapState } from '../../map.state'; @Component({ selector: 'igo-advanced-swipe', templateUrl: './advanced-swipe.component.html', - styleUrls: ['./advanced-swipe.component.scss'] + styleUrls: ['./advanced-swipe.component.scss'], + standalone: true, + imports: [ + NgIf, + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatOptionModule, + MatDividerModule, + NgFor, + MatSlideToggleModule, + MatListModule, + MatIconModule, + TranslateModule + ] }) export class AdvancedSwipeComponent implements OnInit, OnDestroy { public swipe: boolean = false; diff --git a/packages/integration/src/lib/map/index.ts b/packages/integration/src/lib/map/index.ts index 85d81fd7aa..d0568b996c 100644 --- a/packages/integration/src/lib/map/index.ts +++ b/packages/integration/src/lib/map/index.ts @@ -1,3 +1,10 @@ +import { AdvancedMapToolComponent } from './advanced-map-tool'; +import { MapDetailsToolComponent } from './map-details-tool'; +import { MapLegendToolComponent } from './map-legend'; +import { MapProximityToolComponent } from './map-proximity-tool'; +import { MapToolComponent } from './map-tool'; +import { MapToolsComponent } from './map-tools'; + export * from './advanced-map-tool'; export * from './map-proximity-tool'; export * from './map-details-tool'; @@ -6,3 +13,12 @@ export * from './map-tool'; export * from './map-tools'; export * from './map.state'; export * from './map-proximity.state'; + +export const INTEGRATION_MAP_DIRECTIVES = [ + AdvancedMapToolComponent, + MapProximityToolComponent, + MapToolComponent, + MapToolsComponent, + MapDetailsToolComponent, + MapLegendToolComponent +] as const; diff --git a/packages/integration/src/lib/map/map-details-tool/map-details-tool.component.ts b/packages/integration/src/lib/map/map-details-tool/map-details-tool.component.ts index e6dd150f3f..e2d688bd3d 100644 --- a/packages/integration/src/lib/map/map-details-tool/map-details-tool.component.ts +++ b/packages/integration/src/lib/map/map-details-tool/map-details-tool.component.ts @@ -1,16 +1,27 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; import { ToolComponent } from '@igo2/common'; import { + ExportButtonComponent, ExportOptions, IgoMap, Layer, + LayerListBindingDirective, + LayerListComponent, LayerListControlsEnum, LayerListControlsOptions, + MetadataButtonComponent, + OgcFilterButtonComponent, SearchSourceService, + TimeFilterButtonComponent, + TrackFeatureButtonComponent, sourceCanSearch } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -18,6 +29,7 @@ import { ImportExportMode, ImportExportState } from '../../import-export/import-export.state'; +import { WorkspaceButtonComponent } from '../../workspace'; import { ToolState } from './../../tool/tool.state'; import { MapState } from './../map.state'; @@ -29,7 +41,23 @@ import { MapState } from './../map.state'; @Component({ selector: 'igo-map-details-tool', templateUrl: './map-details-tool.component.html', - styleUrls: ['./map-details-tool.component.scss'] + styleUrls: ['./map-details-tool.component.scss'], + standalone: true, + imports: [ + NgIf, + LayerListComponent, + LayerListBindingDirective, + WorkspaceButtonComponent, + ExportButtonComponent, + OgcFilterButtonComponent, + TimeFilterButtonComponent, + TrackFeatureButtonComponent, + MetadataButtonComponent, + MatListModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class MapDetailsToolComponent implements OnInit { public delayedShowEmptyMapContent: boolean = false; diff --git a/packages/integration/src/lib/map/map-legend/map-legend-tool.component.ts b/packages/integration/src/lib/map/map-legend/map-legend-tool.component.ts index ba5eeeb376..74b767289c 100644 --- a/packages/integration/src/lib/map/map-legend/map-legend-tool.component.ts +++ b/packages/integration/src/lib/map/map-legend/map-legend-tool.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectorRef, Component, @@ -5,16 +6,21 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; import { ToolComponent } from '@igo2/common'; import { IgoMap, Layer, + LayerLegendListBindingDirective, + LayerLegendListComponent, LayerListControlsOptions, SearchSourceService, sourceCanSearch } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, @@ -35,7 +41,17 @@ import { MapState } from './../map.state'; @Component({ selector: 'igo-map-legend-tool', templateUrl: './map-legend-tool.component.html', - styleUrls: ['./map-legend-tool.component.scss'] + styleUrls: ['./map-legend-tool.component.scss'], + standalone: true, + imports: [ + NgIf, + LayerLegendListComponent, + LayerLegendListBindingDirective, + MatListModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class MapLegendToolComponent implements OnInit, OnDestroy { public delayedShowEmptyMapContent: boolean = false; diff --git a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.ts b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.ts index 18895a9b6e..672a44ac60 100644 --- a/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.ts +++ b/packages/integration/src/lib/map/map-proximity-tool/map-proximity-tool.component.ts @@ -1,5 +1,11 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { MatRadioChange } from '@angular/material/radio'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatRadioChange, MatRadioModule } from '@angular/material/radio'; import { EntityTableComponent, @@ -10,6 +16,7 @@ import { LanguageService, MessageService } from '@igo2/core'; import { Feature, IgoMap } from '@igo2/geo'; import { Clipboard, NumberUtils } from '@igo2/utils'; +import { TranslateModule } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { MapProximityState } from '../map-proximity.state'; @@ -26,7 +33,20 @@ import { MapState } from '../map.state'; @Component({ selector: 'igo-map-proximity-tool', templateUrl: './map-proximity-tool.component.html', - styleUrls: ['./map-proximity-tool.component.scss'] + styleUrls: ['./map-proximity-tool.component.scss'], + standalone: true, + imports: [ + EntityTableComponent, + NgIf, + MatFormFieldModule, + MatInputModule, + MatButtonModule, + MatIconModule, + MatRadioModule, + FormsModule, + AsyncPipe, + TranslateModule + ] }) export class MapProximityToolComponent implements OnInit, OnDestroy { private subs$$: Subscription[] = []; diff --git a/packages/integration/src/lib/map/map-tool/map-tool.component.ts b/packages/integration/src/lib/map/map-tool/map-tool.component.ts index 30f127d0f2..6d5d6694ea 100644 --- a/packages/integration/src/lib/map/map-tool/map-tool.component.ts +++ b/packages/integration/src/lib/map/map-tool/map-tool.component.ts @@ -1,19 +1,34 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { MatTabsModule } from '@angular/material/tabs'; import { ToolComponent } from '@igo2/common'; import { + ContextListBindingDirective, + ContextListComponent +} from '@igo2/context'; +import { + ExportButtonComponent, ExportOptions, IgoMap, Layer, + LayerListBindingDirective, + LayerListComponent, LayerListControlsEnum, - LayerListControlsOptions + LayerListControlsOptions, + MetadataButtonComponent, + OgcFilterButtonComponent, + TimeFilterButtonComponent, + TrackFeatureButtonComponent } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; + import { ImportExportMode, ImportExportState } from '../../import-export/import-export.state'; import { ToolState } from '../../tool/tool.state'; +import { WorkspaceButtonComponent } from '../../workspace/workspace-button/workspace-button.component'; import { MapState } from './../map.state'; /** @@ -28,7 +43,22 @@ import { MapState } from './../map.state'; selector: 'igo-map-tool', templateUrl: './map-tool.component.html', styleUrls: ['./map-tool.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatTabsModule, + LayerListComponent, + LayerListBindingDirective, + WorkspaceButtonComponent, + ExportButtonComponent, + OgcFilterButtonComponent, + TimeFilterButtonComponent, + TrackFeatureButtonComponent, + MetadataButtonComponent, + ContextListComponent, + ContextListBindingDirective, + TranslateModule + ] }) export class MapToolComponent { @Input() toggleLegendOnVisibilityChange: boolean = false; diff --git a/packages/integration/src/lib/map/map-tools/map-tools.component.ts b/packages/integration/src/lib/map/map-tools/map-tools.component.ts index eced5db068..95cd2360e5 100644 --- a/packages/integration/src/lib/map/map-tools/map-tools.component.ts +++ b/packages/integration/src/lib/map/map-tools/map-tools.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -6,20 +7,33 @@ import { OnInit, ViewChild } from '@angular/core'; -import { MatTabChangeEvent } from '@angular/material/tabs'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs'; import { ToolComponent } from '@igo2/common'; import { + ExportButtonComponent, ExportOptions, IgoMap, Layer, + LayerLegendListBindingDirective, + LayerLegendListComponent, + LayerListBindingDirective, + LayerListComponent, LayerListControlsEnum, LayerListControlsOptions, + MetadataButtonComponent, + OgcFilterButtonComponent, SearchSourceService, + StyleModalLayerButtonComponent, + TimeFilterButtonComponent, + TrackFeatureButtonComponent, VectorLayer, sourceCanSearch } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Observable, Subscription, combineLatest } from 'rxjs'; import { debounceTime, map } from 'rxjs/operators'; @@ -28,6 +42,7 @@ import { ImportExportState } from '../../import-export/import-export.state'; import { ToolState } from '../../tool/tool.state'; +import { WorkspaceButtonComponent } from '../../workspace/workspace-button/workspace-button.component'; import { LayerListToolState } from '../layer-list-tool.state'; import { MapState } from '../map.state'; @@ -43,7 +58,27 @@ import { MapState } from '../map.state'; selector: 'igo-map-tools', templateUrl: './map-tools.component.html', styleUrls: ['./map-tools.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + MatTabsModule, + NgIf, + LayerListComponent, + LayerListBindingDirective, + StyleModalLayerButtonComponent, + MetadataButtonComponent, + TrackFeatureButtonComponent, + TimeFilterButtonComponent, + OgcFilterButtonComponent, + ExportButtonComponent, + WorkspaceButtonComponent, + LayerLegendListComponent, + LayerLegendListBindingDirective, + MatListModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class MapToolsComponent implements OnInit, OnDestroy { layers$: BehaviorSubject = new BehaviorSubject([]); diff --git a/packages/integration/src/lib/map/map.module.ts b/packages/integration/src/lib/map/map.module.ts index 2fa4b748c3..2734df3e15 100644 --- a/packages/integration/src/lib/map/map.module.ts +++ b/packages/integration/src/lib/map/map.module.ts @@ -1,89 +1,23 @@ -import { CommonModule } from '@angular/common'; -import { - CUSTOM_ELEMENTS_SCHEMA, - ModuleWithProviders, - NgModule -} from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTooltipModule } from '@angular/material/tooltip'; +import { ModuleWithProviders, NgModule } from '@angular/core'; -import { IgoEntityTableModule, IgoSpinnerModule } from '@igo2/common'; -import { IgoContextModule } from '@igo2/context'; -import { IgoLanguageModule } from '@igo2/core'; -import { - IgoDownloadModule, - IgoFilterModule, - IgoImportExportModule, - IgoLayerModule, - IgoMetadataModule, - IgoStyleModule -} from '@igo2/geo'; - -import { IgoAppWorkspaceModule } from '../workspace/workspace.module'; -import { AdvancedCoordinatesComponent } from './advanced-map-tool/advanced-coordinates/advanced-coordinates.component'; import { AdvancedMapToolComponent } from './advanced-map-tool/advanced-map-tool.component'; -import { AdvancedSwipeComponent } from './advanced-map-tool/advanced-swipe/advanced-swipe.component'; import { MapDetailsToolComponent } from './map-details-tool/map-details-tool.component'; import { MapLegendToolComponent } from './map-legend/map-legend-tool.component'; import { MapProximityToolComponent } from './map-proximity-tool/map-proximity-tool.component'; import { MapToolComponent } from './map-tool/map-tool.component'; import { MapToolsComponent } from './map-tools/map-tools.component'; +/** + * @deprecated import the ImportExportToolComponent directly or INTEGRATION_MAP_DIRECTIVES for the set + */ @NgModule({ imports: [ - FormsModule, - ReactiveFormsModule, - MatButtonToggleModule, - MatDividerModule, - MatSelectModule, - MatOptionModule, - MatFormFieldModule, - MatInputModule, - MatCheckboxModule, - IgoSpinnerModule, - CommonModule, - MatTabsModule, - MatListModule, - MatIconModule, - IgoLanguageModule, - IgoLayerModule, - IgoMetadataModule, - IgoDownloadModule, - IgoImportExportModule, - IgoStyleModule, - IgoFilterModule, - MatRadioModule, - IgoContextModule, - IgoAppWorkspaceModule, - MatSlideToggleModule, - MatMenuModule, - MatButtonModule, - MatTooltipModule, - IgoEntityTableModule - ], - declarations: [ AdvancedMapToolComponent, MapProximityToolComponent, MapToolComponent, MapToolsComponent, MapDetailsToolComponent, - MapLegendToolComponent, - AdvancedSwipeComponent, - AdvancedCoordinatesComponent + MapLegendToolComponent ], exports: [ AdvancedMapToolComponent, @@ -92,8 +26,7 @@ import { MapToolsComponent } from './map-tools/map-tools.component'; MapToolsComponent, MapDetailsToolComponent, MapLegendToolComponent - ], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + ] }) export class IgoAppMapModule { static forRoot(): ModuleWithProviders { diff --git a/packages/integration/src/lib/measure/measure.module.ts b/packages/integration/src/lib/measure/measure.module.ts index e0c847f70a..8c4496315c 100644 --- a/packages/integration/src/lib/measure/measure.module.ts +++ b/packages/integration/src/lib/measure/measure.module.ts @@ -2,9 +2,10 @@ import { NgModule } from '@angular/core'; import { IgoAppMeasurerToolModule } from './measurer-tool/measurer-tool.module'; +/** + * @deprecated import the MeasurerToolComponent directly + */ @NgModule({ - imports: [], - declarations: [], exports: [IgoAppMeasurerToolModule] }) export class IgoAppMeasureModule {} diff --git a/packages/integration/src/lib/measure/measurer-tool/measurer-tool.component.ts b/packages/integration/src/lib/measure/measurer-tool/measurer-tool.component.ts index f3cfb32109..1c2ce1d854 100644 --- a/packages/integration/src/lib/measure/measurer-tool/measurer-tool.component.ts +++ b/packages/integration/src/lib/measure/measurer-tool/measurer-tool.component.ts @@ -1,7 +1,12 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; -import { FeatureStore, FeatureWithMeasure, IgoMap } from '@igo2/geo'; +import { + FeatureStore, + FeatureWithMeasure, + IgoMap, + MeasurerComponent +} from '@igo2/geo'; import { MapState } from '../../map/map.state'; import { MeasureState } from '../measure.state'; @@ -17,7 +22,9 @@ import { MeasureState } from '../measure.state'; @Component({ selector: 'igo-measurer-tool', templateUrl: './measurer-tool.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [MeasurerComponent] }) export class MeasurerToolComponent { /** diff --git a/packages/integration/src/lib/measure/measurer-tool/measurer-tool.module.ts b/packages/integration/src/lib/measure/measurer-tool/measurer-tool.module.ts index 6c7afa2c9f..d5b878d068 100644 --- a/packages/integration/src/lib/measure/measurer-tool/measurer-tool.module.ts +++ b/packages/integration/src/lib/measure/measurer-tool/measurer-tool.module.ts @@ -1,16 +1,12 @@ -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; - -import { IgoMeasurerModule } from '@igo2/geo'; +import { NgModule } from '@angular/core'; import { MeasurerToolComponent } from './measurer-tool.component'; /** - * @ignore + * @deprecated import the MeasurerToolComponent directly */ @NgModule({ - imports: [IgoMeasurerModule], - declarations: [MeasurerToolComponent], - exports: [MeasurerToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [MeasurerToolComponent], + exports: [MeasurerToolComponent] }) export class IgoAppMeasurerToolModule {} diff --git a/packages/integration/src/lib/print/print-tool/print-tool.component.ts b/packages/integration/src/lib/print/print-tool/print-tool.component.ts index 26e651cb61..1995ec6c51 100644 --- a/packages/integration/src/lib/print/print-tool/print-tool.component.ts +++ b/packages/integration/src/lib/print/print-tool/print-tool.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { ToolComponent } from '@igo2/common'; -import { IgoMap } from '@igo2/geo'; +import { IgoMap, PrintComponent } from '@igo2/geo'; import { MapState } from '../../map/map.state'; @@ -12,7 +12,9 @@ import { MapState } from '../../map/map.state'; }) @Component({ selector: 'igo-print-tool', - templateUrl: './print-tool.component.html' + templateUrl: './print-tool.component.html', + standalone: true, + imports: [PrintComponent] }) export class PrintToolComponent { get map(): IgoMap { diff --git a/packages/integration/src/lib/print/print.module.ts b/packages/integration/src/lib/print/print.module.ts index 0b2d181084..b3341b1af1 100644 --- a/packages/integration/src/lib/print/print.module.ts +++ b/packages/integration/src/lib/print/print.module.ts @@ -1,18 +1,13 @@ -import { - CUSTOM_ELEMENTS_SCHEMA, - ModuleWithProviders, - NgModule -} from '@angular/core'; - -import { IgoPrintModule } from '@igo2/geo'; +import { ModuleWithProviders, NgModule } from '@angular/core'; import { PrintToolComponent } from './print-tool/print-tool.component'; +/** + * @deprecated import the PrintToolComponent directly + */ @NgModule({ - imports: [IgoPrintModule], - declarations: [PrintToolComponent], - exports: [PrintToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [PrintToolComponent], + exports: [PrintToolComponent] }) export class IgoAppPrintModule { static forRoot(): ModuleWithProviders { diff --git a/packages/integration/src/lib/search/index.ts b/packages/integration/src/lib/search/index.ts index 2f031b3f13..e7b4c0143f 100644 --- a/packages/integration/src/lib/search/index.ts +++ b/packages/integration/src/lib/search/index.ts @@ -1,6 +1,14 @@ +import { SearchBarBindingDirective } from './search-bar/search-bar-binding.directive'; +import { SearchResultsToolComponent } from './search-results-tool/search-results-tool.component'; + export * from './query.state'; export * from './search.state'; export * from './search-results-tool/search-results-tool.module'; export * from './search-results-tool/search-results-tool.component'; export * from './search-bar/search-bar.module'; export * from './search-bar/search-bar-binding.directive'; + +export const INTEGRATION_SEARCH_DIRECTIVES = [ + SearchBarBindingDirective, + SearchResultsToolComponent +] as const; diff --git a/packages/integration/src/lib/search/search-bar/search-bar-binding.directive.ts b/packages/integration/src/lib/search/search-bar/search-bar-binding.directive.ts index fdda64254b..102fb2ce9d 100644 --- a/packages/integration/src/lib/search/search-bar/search-bar-binding.directive.ts +++ b/packages/integration/src/lib/search/search-bar/search-bar-binding.directive.ts @@ -13,7 +13,8 @@ import { Subscription } from 'rxjs'; import { SearchState } from '../search.state'; @Directive({ - selector: '[igoSearchBarBinding]' + selector: '[igoSearchBarBinding]', + standalone: true }) export class SearchBarBindingDirective implements OnInit, OnDestroy { get searchTerm(): string { diff --git a/packages/integration/src/lib/search/search-bar/search-bar.module.ts b/packages/integration/src/lib/search/search-bar/search-bar.module.ts index 245427f56c..0d7e14bbef 100644 --- a/packages/integration/src/lib/search/search-bar/search-bar.module.ts +++ b/packages/integration/src/lib/search/search-bar/search-bar.module.ts @@ -1,15 +1,12 @@ import { NgModule } from '@angular/core'; -import { IgoSearchModule } from '@igo2/geo'; - import { SearchBarBindingDirective } from './search-bar-binding.directive'; /** - * @ignore + * @deprecated import the SearchBarBindingDirective directly */ @NgModule({ - imports: [IgoSearchModule], - declarations: [SearchBarBindingDirective], + imports: [SearchBarBindingDirective], exports: [SearchBarBindingDirective] }) export class IgoAppSearchBarModule {} diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts index a457241269..e336d689a5 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -6,12 +7,18 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { EntityState, EntityStore, FlexibleComponent, FlexibleState, + PanelComponent, + SanitizeHtmlPipe, ToolComponent, getEntityTitle } from '@igo2/common'; @@ -19,11 +26,14 @@ import { ConfigService } from '@igo2/core'; import { FEATURE, Feature, + FeatureDetailsComponent, FeatureMotion, FeatureStore, IgoMap, Research, SearchResult, + SearchResultAddButtonComponent, + SearchResultsComponent, computeOlFeaturesExtent, featureFromOl, featureToOl, @@ -41,6 +51,7 @@ import type { default as OlGeometry } from 'ol/geom/Geometry'; import olPoint from 'ol/geom/Point'; import * as olProj from 'ol/proj'; +import { TranslateModule } from '@ngx-translate/core'; import pointOnFeature from '@turf/point-on-feature'; import { BehaviorSubject, Observable, Subscription, combineLatest } from 'rxjs'; import { debounceTime, map } from 'rxjs/operators'; @@ -61,7 +72,23 @@ import { SearchState } from '../search.state'; @Component({ selector: 'igo-search-results-tool', templateUrl: './search-results-tool.component.html', - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + FlexibleComponent, + SearchResultsComponent, + SearchResultAddButtonComponent, + PanelComponent, + MatButtonModule, + MatIconModule, + MatTooltipModule, + MatBadgeModule, + FeatureDetailsComponent, + AsyncPipe, + TranslateModule, + SanitizeHtmlPipe + ] }) export class SearchResultsToolComponent implements OnInit, OnDestroy { /** diff --git a/packages/integration/src/lib/search/search-results-tool/search-results-tool.module.ts b/packages/integration/src/lib/search/search-results-tool/search-results-tool.module.ts index 84860f17d9..4b24bdc6d5 100644 --- a/packages/integration/src/lib/search/search-results-tool/search-results-tool.module.ts +++ b/packages/integration/src/lib/search/search-results-tool/search-results-tool.module.ts @@ -1,44 +1,12 @@ -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { MatBadgeModule } from '@angular/material/badge'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { - IgoCustomHtmlModule, - IgoFlexibleModule, - IgoPanelModule -} from '@igo2/common'; -import { IgoLanguageModule } from '@igo2/core'; -import { - IgoFeatureDetailsModule, - IgoFeatureModule, - IgoSearchModule -} from '@igo2/geo'; +import { NgModule } from '@angular/core'; import { SearchResultsToolComponent } from './search-results-tool.component'; /** - * @ignore + * @deprecated import the SearchResultsToolComponent directly */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatBadgeModule, - MatTooltipModule, - MatButtonModule, - IgoLanguageModule, - IgoFeatureModule, - IgoSearchModule, - IgoFlexibleModule, - IgoPanelModule, - IgoFeatureDetailsModule, - IgoCustomHtmlModule - ], - declarations: [SearchResultsToolComponent], - exports: [SearchResultsToolComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA] + imports: [SearchResultsToolComponent], + exports: [SearchResultsToolComponent] }) export class IgoAppSearchResultsToolModule {} diff --git a/packages/integration/src/lib/search/search.module.ts b/packages/integration/src/lib/search/search.module.ts index e5a66153f4..d44cf18c98 100644 --- a/packages/integration/src/lib/search/search.module.ts +++ b/packages/integration/src/lib/search/search.module.ts @@ -1,11 +1,13 @@ import { NgModule } from '@angular/core'; -import { IgoAppSearchBarModule } from './search-bar/search-bar.module'; -import { IgoAppSearchResultsToolModule } from './search-results-tool/search-results-tool.module'; +import { SearchBarBindingDirective } from './search-bar/search-bar-binding.directive'; +import { SearchResultsToolComponent } from './search-results-tool/search-results-tool.component'; +/** + * @deprecated import the components/directive directly or INTEGRATION_SEARCH_DIRECTIVES for the set + */ @NgModule({ - imports: [], - declarations: [], - exports: [IgoAppSearchBarModule, IgoAppSearchResultsToolModule] + imports: [SearchBarBindingDirective, SearchResultsToolComponent], + exports: [SearchBarBindingDirective, SearchResultsToolComponent] }) export class IgoAppSearchModule {} diff --git a/packages/integration/src/lib/storage/storage.module.ts b/packages/integration/src/lib/storage/storage.module.ts deleted file mode 100644 index 38d4bcb7d0..0000000000 --- a/packages/integration/src/lib/storage/storage.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; - -@NgModule({ - imports: [], - declarations: [], - exports: [] -}) -export class IgoAppStorageModule {} diff --git a/packages/integration/src/lib/tool/tool.module.ts b/packages/integration/src/lib/tool/tool.module.ts deleted file mode 100644 index 41d6d76f8c..0000000000 --- a/packages/integration/src/lib/tool/tool.module.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NgModule } from '@angular/core'; - -@NgModule({ - imports: [], - declarations: [], - exports: [] -}) -export class IgoAppToolModule {} diff --git a/packages/integration/src/lib/workspace/shared/edition-actions.service.ts b/packages/integration/src/lib/workspace/shared/edition-actions.service.ts index f2159ffedb..b4eb5133c9 100644 --- a/packages/integration/src/lib/workspace/shared/edition-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/edition-actions.service.ts @@ -1,4 +1,3 @@ -import { DatePipe } from '@angular/common'; import { Inject, Injectable, OnDestroy } from '@angular/core'; import { Action, Widget } from '@igo2/common'; @@ -40,8 +39,7 @@ export class EditionActionsService implements OnDestroy { private storageState: StorageState, public languageService: LanguageService, private mediaService: MediaService, - private toolState: ToolState, - private datePipe: DatePipe + private toolState: ToolState ) { this.maximize$ = new BehaviorSubject( this.storageService.get('workspaceMaximize') as boolean @@ -95,8 +93,7 @@ export class EditionActionsService implements OnDestroy { this.storageService, this.languageService, this.mediaService, - this.toolState, - this.datePipe + this.toolState ); } } diff --git a/packages/integration/src/lib/workspace/shared/feature-actions.service.ts b/packages/integration/src/lib/workspace/shared/feature-actions.service.ts index bfe22b8cd9..27d1bb670b 100644 --- a/packages/integration/src/lib/workspace/shared/feature-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/feature-actions.service.ts @@ -1,4 +1,3 @@ -import { DatePipe } from '@angular/common'; import { Injectable, OnDestroy } from '@angular/core'; import { Action } from '@igo2/common'; @@ -39,8 +38,7 @@ export class FeatureActionsService implements OnDestroy { private storageState: StorageState, public languageService: LanguageService, private toolState: ToolState, - private mediaService: MediaService, - private datePipe: DatePipe + private mediaService: MediaService ) { this.maximize$ = new BehaviorSubject( this.storageService.get('workspaceMaximize') as boolean @@ -94,8 +92,7 @@ export class FeatureActionsService implements OnDestroy { this.storageService, this.languageService, this.mediaService, - this.toolState, - this.datePipe + this.toolState ); } } diff --git a/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts b/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts index a68d548529..f5a3f587c6 100644 --- a/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts @@ -1,4 +1,3 @@ -import { DatePipe } from '@angular/common'; import { Inject, Injectable, OnDestroy } from '@angular/core'; import { Action, Widget } from '@igo2/common'; @@ -44,8 +43,7 @@ export class WfsActionsService implements OnDestroy { private storageState: StorageState, public languageService: LanguageService, private mediaService: MediaService, - private toolState: ToolState, - private datePipe: DatePipe + private toolState: ToolState ) { this.maximize$ = new BehaviorSubject( this.storageService.get('workspaceMaximize') as boolean @@ -99,8 +97,7 @@ export class WfsActionsService implements OnDestroy { this.storageService, this.languageService, this.mediaService, - this.toolState, - this.datePipe + this.toolState ); } } diff --git a/packages/integration/src/lib/workspace/shared/workspace.utils.ts b/packages/integration/src/lib/workspace/shared/workspace.utils.ts index 0f04f0560c..3a4c9e508d 100644 --- a/packages/integration/src/lib/workspace/shared/workspace.utils.ts +++ b/packages/integration/src/lib/workspace/shared/workspace.utils.ts @@ -1,5 +1,3 @@ -import { DatePipe } from '@angular/common'; - import { Action, EntityStoreFilterCustomFuncStrategy, @@ -18,6 +16,7 @@ import { mapExtentStrategyActiveToolTip, noElementSelected } from '@igo2/geo'; +import { dateTransform } from '@igo2/utils'; import * as jsPDF from 'jspdf'; import 'jspdf-autotable'; @@ -49,8 +48,7 @@ export function getWorkspaceActions( storageService: StorageService, languageService: LanguageService, mediaService: MediaService, - toolState: ToolState, - datePipe: DatePipe + toolState: ToolState ): Action[] { const actions = [ { @@ -183,9 +181,9 @@ export function getWorkspaceActions( title: 'igo.integration.workspace.print.title', tooltip: 'igo.integration.workspace.print.tooltip', handler: (ws: FeatureWorkspace | WfsWorkspace | EditionWorkspace) => { - const title = `${ws.layer.title} (${datePipe.transform( - Date.now(), - 'YYYY-MM-dd-H_mm' + const title = `${ws.layer.title} (${dateTransform( + new Date(), + 'YYYY-MM-DD-HH_mm' )})`; const doc: any = new jsPDF.default('landscape'); const totalPagesExp = '{total_pages_count_string}'; diff --git a/packages/integration/src/lib/workspace/workspace-button/workspace-button.component.ts b/packages/integration/src/lib/workspace/workspace-button/workspace-button.component.ts index 0406c81aff..08e5cbfcdc 100644 --- a/packages/integration/src/lib/workspace/workspace-button/workspace-button.component.ts +++ b/packages/integration/src/lib/workspace/workspace-button/workspace-button.component.ts @@ -1,3 +1,4 @@ +import { AsyncPipe, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, @@ -5,9 +6,13 @@ import { OnDestroy, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; import type { Layer } from '@igo2/geo'; +import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subscription, combineLatest } from 'rxjs'; import { WorkspaceState } from '../workspace.state'; @@ -16,7 +21,16 @@ import { WorkspaceState } from '../workspace.state'; selector: 'igo-workspace-button', templateUrl: './workspace-button.component.html', styleUrls: ['./workspace-button.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush + changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + NgIf, + MatButtonModule, + MatTooltipModule, + MatIconModule, + AsyncPipe, + TranslateModule + ] }) export class WorkspaceButtonComponent implements OnInit, OnDestroy { public hasWorkspace$: BehaviorSubject = new BehaviorSubject(false); diff --git a/packages/integration/src/lib/workspace/workspace.module.ts b/packages/integration/src/lib/workspace/workspace.module.ts index 89b8ff2af6..eaf69b2f2b 100644 --- a/packages/integration/src/lib/workspace/workspace.module.ts +++ b/packages/integration/src/lib/workspace/workspace.module.ts @@ -1,23 +1,12 @@ -import { CommonModule, DatePipe } from '@angular/common'; import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatTooltipModule } from '@angular/material/tooltip'; - -import { IgoLanguageModule } from '@igo2/core'; import { WorkspaceButtonComponent } from './workspace-button/workspace-button.component'; +/** + * @deprecated import the WorkspaceButtonComponent directly + */ @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatButtonModule, - MatTooltipModule, - IgoLanguageModule - ], - declarations: [WorkspaceButtonComponent], - exports: [WorkspaceButtonComponent], - providers: [DatePipe] + imports: [WorkspaceButtonComponent], + exports: [WorkspaceButtonComponent] }) export class IgoAppWorkspaceModule {} diff --git a/packages/integration/src/public_api.ts b/packages/integration/src/public_api.ts index 625b20b81d..acc30eb1b6 100644 --- a/packages/integration/src/public_api.ts +++ b/packages/integration/src/public_api.ts @@ -4,8 +4,6 @@ export * from './lib/integration.module'; export * from './lib/about/about.module'; -export * from './lib/analytics/analytics.module'; -export * from './lib/storage/storage.module'; export * from './lib/context/context.module'; export * from './lib/catalog/catalog.module'; @@ -18,7 +16,6 @@ export * from './lib/map/map.module'; export * from './lib/measure/measure.module'; export * from './lib/print/print.module'; export * from './lib/search/search.module'; -export * from './lib/tool/tool.module'; export * from './lib/about'; export * from './lib/analytics'; diff --git a/packages/utils/package.json b/packages/utils/package.json index 3ec6443e07..9f1cad05a6 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,6 +18,8 @@ "scripts": { "build": "ng build utils --configuration production", "format": "prettier --write ./src/**/*.{ts,js,html,scss,css,json}", + "lint": "ng lint utils", + "lint.fix": "ng lint utils --fix", "publish": "npm publish ../../dist/utils", "test": "ng test utils --watch=false", "watch": "ng build utils --watch" diff --git a/packages/utils/src/lib/datetime.utils.ts b/packages/utils/src/lib/datetime.utils.ts new file mode 100644 index 0000000000..e8988a72fd --- /dev/null +++ b/packages/utils/src/lib/datetime.utils.ts @@ -0,0 +1,5 @@ +import moment from 'moment'; + +export function dateTransform(date: Date, format: string): string { + return moment(date).format(format); +} diff --git a/packages/utils/src/lib/index.ts b/packages/utils/src/lib/index.ts index 89b5943b3e..9244e069a1 100644 --- a/packages/utils/src/lib/index.ts +++ b/packages/utils/src/lib/index.ts @@ -3,6 +3,7 @@ export * from './cache.utils'; export * from './clipboard'; export * from './change'; export * from './change.interface'; +export * from './datetime.utils'; export * from './dom.utils'; export * from './file'; export * from './object-utils'; diff --git a/packages/utils/src/lib/object-utils.ts b/packages/utils/src/lib/object-utils.ts index 1ce0be15ed..b5d8f71078 100644 --- a/packages/utils/src/lib/object-utils.ts +++ b/packages/utils/src/lib/object-utils.ts @@ -193,16 +193,16 @@ export class ObjectUtils { a === b ? 0 : a === undefined - ? 3 - : b === undefined - ? -3 - : a === null - ? 2 - : b === null - ? -2 - : a === '' - ? 1 - : -1; + ? 3 + : b === undefined + ? -3 + : a === null + ? 2 + : b === null + ? -2 + : a === '' + ? 1 + : -1; if (direction === 'desc') { return nullsFirst !== false ? nullScore : nullScore * -1; } diff --git a/packages/utils/src/lib/string-utils.ts b/packages/utils/src/lib/string-utils.ts index cf84552734..a90aeb7a57 100644 --- a/packages/utils/src/lib/string-utils.ts +++ b/packages/utils/src/lib/string-utils.ts @@ -46,8 +46,8 @@ export class StringUtils { ? (o.sbs += s[i]) // o.sbs holds the matching substring itsef : ((match = true), (o.fis = i), (o.sbs = s[i])) : match - ? (i = slen) // stop after the first found substring - : (i = i); + ? (i = slen) // stop after the first found substring + : (i = i); ++i; } return o; diff --git a/projects/demo/src/app/app.component.html b/projects/demo/src/app/app.component.html index 3598475dfe..a2fe073692 100644 --- a/projects/demo/src/app/app.component.html +++ b/projects/demo/src/app/app.component.html @@ -25,6 +25,8 @@
{{ version.lib }}
{{ routeConfig.title }} @@ -41,6 +43,7 @@
{{ version.lib }}
*ngFor="let route of routeConfig.children" mat-list-item [routerLink]="routeConfig.path + '/' + route.path" + routerLinkActive="active-link" >{{ route.title }} diff --git a/projects/demo/src/app/app.component.scss b/projects/demo/src/app/app.component.scss index c112cc73b1..d5d1e65868 100644 --- a/projects/demo/src/app/app.component.scss +++ b/projects/demo/src/app/app.component.scss @@ -35,6 +35,10 @@ mat-expansion-panel { } } +.active-link ::ng-deep span { + font-weight: bold; +} + .example-is-mobile .example-toolbar { position: fixed; z-index: 2; diff --git a/projects/demo/src/app/app.component.spec.ts b/projects/demo/src/app/app.component.spec.ts index 1bf5a3c416..c916f30f43 100644 --- a/projects/demo/src/app/app.component.spec.ts +++ b/projects/demo/src/app/app.component.spec.ts @@ -16,7 +16,7 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ + imports: [ RouterTestingModule, NoopAnimationsModule, MatCardModule, @@ -28,8 +28,8 @@ describe('AppComponent', () => { MatIconTestingModule, IgoAuthModule, AppComponent - ] -}).compileComponents(); + ] + }).compileComponents(); })); it('should create the app', waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); diff --git a/projects/demo/src/app/app.component.ts b/projects/demo/src/app/app.component.ts index f05183f00d..bdfc8105eb 100644 --- a/projects/demo/src/app/app.component.ts +++ b/projects/demo/src/app/app.component.ts @@ -17,6 +17,7 @@ import { NavigationEnd, Router, RouterLink, + RouterLinkActive, RouterOutlet } from '@angular/router'; @@ -42,6 +43,7 @@ import { ROUTES_CONFIG } from './app.routing'; MatSidenavModule, MatListModule, RouterLink, + RouterLinkActive, RouterOutlet ] }) diff --git a/projects/demo/src/app/app.routing.ts b/projects/demo/src/app/app.routing.ts index ab9c82965c..3656f1c04f 100644 --- a/projects/demo/src/app/app.routing.ts +++ b/projects/demo/src/app/app.routing.ts @@ -39,7 +39,7 @@ export const routes: Routes = [ ]; export const ROUTES_CONFIG: Routes = [ - { title: 'Home', path: '', redirectTo: '/home', pathMatch: 'full' }, + { title: 'Home', path: 'home', redirectTo: '/home', pathMatch: 'full' }, { title: 'Core', path: 'core', diff --git a/projects/demo/src/app/app.theme.scss b/projects/demo/src/app/app.theme.scss index ae19be7392..8ffdf6598d 100644 --- a/projects/demo/src/app/app.theme.scss +++ b/projects/demo/src/app/app.theme.scss @@ -1,9 +1,29 @@ +@use 'sass:map'; +@use '@angular/material' as mat; + @use './components/components.theme' as components; @mixin themes($theme) { @include components.themes($theme); + + @include theme($theme); } @mixin colors($theme) { @include components.colors($theme); + @include color($theme); +} + +@mixin theme($theme) { + @include color($theme); +} + +@mixin color($theme) { + $accent: map.get($theme, accent); + + app-root { + .active-link span { + color: mat.get-color-from-palette($accent, 800); + } + } } diff --git a/projects/demo/src/app/common/action/action.component.ts b/projects/demo/src/app/common/action/action.component.ts index 5df37efc96..30165df8a4 100644 --- a/projects/demo/src/app/common/action/action.component.ts +++ b/projects/demo/src/app/common/action/action.component.ts @@ -1,7 +1,7 @@ import { Overlay } from '@angular/cdk/overlay'; import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActionStore, ActionbarMode, IgoActionbarModule } from '@igo2/common'; +import { ActionStore, ActionbarComponent, ActionbarMode } from '@igo2/common'; import { Media, MediaOrientation, MediaService } from '@igo2/core'; import { BehaviorSubject } from 'rxjs'; @@ -14,7 +14,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './action.component.html', styleUrls: ['./action.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoActionbarModule] + imports: [DocViewerComponent, ExampleViewerComponent, ActionbarComponent] }) export class AppActionComponent implements OnInit, OnDestroy { public store: ActionStore = new ActionStore([]); diff --git a/projects/demo/src/app/common/dynamic-component/dynamic-component.component.ts b/projects/demo/src/app/common/dynamic-component/dynamic-component.component.ts index 43efc151fc..2df895daca 100644 --- a/projects/demo/src/app/common/dynamic-component/dynamic-component.component.ts +++ b/projects/demo/src/app/common/dynamic-component/dynamic-component.component.ts @@ -6,7 +6,7 @@ import { } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { IgoDynamicOutletModule, OnUpdateInputs } from '@igo2/common'; +import { DynamicOutletComponent, OnUpdateInputs } from '@igo2/common'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; @@ -50,7 +50,7 @@ export class AppExplanationComponent implements OnUpdateInputs { imports: [ DocViewerComponent, ExampleViewerComponent, - IgoDynamicOutletModule, + DynamicOutletComponent, MatButtonModule ] }) diff --git a/projects/demo/src/app/common/entity-selector/entity-selector.component.ts b/projects/demo/src/app/common/entity-selector/entity-selector.component.ts index e34e1581c3..8ac3022f82 100644 --- a/projects/demo/src/app/common/entity-selector/entity-selector.component.ts +++ b/projects/demo/src/app/common/entity-selector/entity-selector.component.ts @@ -1,7 +1,7 @@ import { AsyncPipe, NgIf } from '@angular/common'; import { Component, OnDestroy, OnInit } from '@angular/core'; -import { EntityStore, IgoEntitySelectorModule } from '@igo2/common'; +import { EntitySelectorComponent, EntityStore } from '@igo2/common'; import { BehaviorSubject } from 'rxjs'; @@ -22,7 +22,7 @@ interface DemoEntity { imports: [ DocViewerComponent, ExampleViewerComponent, - IgoEntitySelectorModule, + EntitySelectorComponent, NgIf, AsyncPipe ] diff --git a/projects/demo/src/app/common/entity-table/entity-table.component.ts b/projects/demo/src/app/common/entity-table/entity-table.component.ts index 9e8d68b635..bb857e2826 100644 --- a/projects/demo/src/app/common/entity-table/entity-table.component.ts +++ b/projects/demo/src/app/common/entity-table/entity-table.component.ts @@ -5,9 +5,9 @@ import { EntityStore, EntityTableButton, EntityTableColumnRenderer, + EntityTableComponent, EntityTablePaginatorOptions, EntityTableTemplate, - IgoEntityTableModule, getEntityProperty } from '@igo2/common'; @@ -21,7 +21,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './entity-table.component.html', styleUrls: ['./entity-table.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoEntityTableModule] + imports: [DocViewerComponent, ExampleViewerComponent, EntityTableComponent] }) export class AppEntityTableComponent implements OnInit, OnDestroy { public store: EntityStore = new EntityStore([]); @@ -62,6 +62,11 @@ export class AppEntityTableComponent implements OnInit, OnDestroy { title: 'Description', renderer: EntityTableColumnRenderer.HTML }, + { + name: 'date', + title: 'Date', + type: 'date' + }, { name: 'url', title: 'Hyperlink' @@ -100,6 +105,7 @@ export class AppEntityTableComponent implements OnInit, OnDestroy { id, name: `Name ${id}`, description: `Description ${id}`, + date: new Date(), url: 'https://igouverte.org', image: 'https://www.igouverte.org/assets/img/NONEXISTINGIMAGE.png' }; @@ -108,6 +114,7 @@ export class AppEntityTableComponent implements OnInit, OnDestroy { id, name: `Name ${id}`, description: `Description ${id}`, + date: new Date(), url: 'https://igouverte.org', image: 'https://www.igouverte.org/assets/img/Igo_logoavec.png' }; diff --git a/projects/demo/src/app/common/form/form.component.ts b/projects/demo/src/app/common/form/form.component.ts index e4baaaa023..cbcb67b030 100644 --- a/projects/demo/src/app/common/form/form.component.ts +++ b/projects/demo/src/app/common/form/form.component.ts @@ -5,11 +5,11 @@ import { MatButtonModule } from '@angular/material/button'; import { Form, + FormComponent, FormField, FormFieldConfig, - FormService, - IgoFormFormModule, - IgoFormGroupModule + FormGroupComponent, + FormService } from '@igo2/common'; import { BehaviorSubject, Subscription } from 'rxjs'; @@ -26,8 +26,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, NgIf, - IgoFormFormModule, - IgoFormGroupModule, + FormComponent, + FormGroupComponent, MatButtonModule, AsyncPipe ] diff --git a/projects/demo/src/app/common/table/table.component.ts b/projects/demo/src/app/common/table/table.component.ts index 10fcf0b3cb..c9a1f2608d 100644 --- a/projects/demo/src/app/common/table/table.component.ts +++ b/projects/demo/src/app/common/table/table.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { - IgoTableModule, TableActionColor, + TableComponent, TableDatabase, TableModel } from '@igo2/common'; @@ -15,7 +15,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './table.component.html', styleUrls: ['./table.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoTableModule] + imports: [DocViewerComponent, ExampleViewerComponent, TableComponent] }) export class AppTableComponent implements OnInit { public database: TableDatabase; diff --git a/projects/demo/src/app/common/table/table.module.ts b/projects/demo/src/app/common/table/table.module.ts index 8080293d7d..c84ada93d1 100644 --- a/projects/demo/src/app/common/table/table.module.ts +++ b/projects/demo/src/app/common/table/table.module.ts @@ -2,16 +2,11 @@ import { NgModule } from '@angular/core'; import { IgoTableModule } from '@igo2/common'; - import { AppTableRoutingModule } from './table-routing.module'; import { AppTableComponent } from './table.component'; @NgModule({ - imports: [ - AppTableRoutingModule, - IgoTableModule, - AppTableComponent -], + imports: [AppTableRoutingModule, IgoTableModule, AppTableComponent], exports: [AppTableComponent] }) export class AppTableModule {} diff --git a/projects/demo/src/app/common/tool/tool.component.ts b/projects/demo/src/app/common/tool/tool.component.ts index 360c647c75..f3f5117f2f 100644 --- a/projects/demo/src/app/common/tool/tool.component.ts +++ b/projects/demo/src/app/common/tool/tool.component.ts @@ -11,13 +11,13 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { - IgoPanelModule, - IgoToolboxModule, OnUpdateInputs, + PanelComponent, Tool, ToolComponent, ToolService, - Toolbox + Toolbox, + ToolboxComponent } from '@igo2/common'; import { BehaviorSubject } from 'rxjs'; @@ -68,11 +68,11 @@ export class AppAboutToolComponent {} imports: [ DocViewerComponent, ExampleViewerComponent, - IgoPanelModule, + PanelComponent, NgIf, MatButtonModule, MatIconModule, - IgoToolboxModule, + ToolboxComponent, AsyncPipe ] }) @@ -87,9 +87,7 @@ export class AppToolComponent implements OnInit, OnDestroy { return this.activeTool$.value ? this.activeTool$.value.title : 'Toolbox'; } - constructor( - private toolService: ToolService - ) {} + constructor(private toolService: ToolService) {} ngOnInit(): void { this.toolbox.setToolbar(['demo-salutation', 'demo-about']); diff --git a/projects/demo/src/app/context/context/context.component.html b/projects/demo/src/app/context/context/context.component.html index dc62ad9022..b3662cd601 100644 --- a/projects/demo/src/app/context/context/context.component.html +++ b/projects/demo/src/app/context/context/context.component.html @@ -1,7 +1,7 @@ diff --git a/projects/demo/src/app/context/context/context.component.ts b/projects/demo/src/app/context/context/context.component.ts index 922895cea0..d66dd7f249 100644 --- a/projects/demo/src/app/context/context/context.component.ts +++ b/projects/demo/src/app/context/context/context.component.ts @@ -1,17 +1,17 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { IgoPanelModule } from '@igo2/common'; +import { PanelComponent } from '@igo2/common'; import { - ContextService, - IgoContextImportExportModule, - IgoContextManagerModule + CONTEXT_MANAGER_DIRECTIVES, + ContextImportExportComponent, + ContextService } from '@igo2/context'; import { - IgoLayerModule, IgoMap, - IgoMapModule, - IgoMetadataModule, + LAYER_DIRECTIVES, + MAP_DIRECTIVES, + METADATA_DIRECTIVES, MapService, MapViewOptions } from '@igo2/geo'; @@ -28,12 +28,12 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoContextManagerModule, - IgoPanelModule, - IgoLayerModule, - IgoMetadataModule, - IgoContextImportExportModule + MAP_DIRECTIVES, + CONTEXT_MANAGER_DIRECTIVES, + PanelComponent, + LAYER_DIRECTIVES, + METADATA_DIRECTIVES, + ContextImportExportComponent ] }) export class AppContextComponent { diff --git a/projects/demo/src/app/context/context/context.module.ts b/projects/demo/src/app/context/context/context.module.ts index b4ce74b17f..1e90700ff0 100644 --- a/projects/demo/src/app/context/context/context.module.ts +++ b/projects/demo/src/app/context/context/context.module.ts @@ -12,7 +12,6 @@ import { IgoQueryModule } from '@igo2/geo'; - import { AppContextRoutingModule } from './context-routing.module'; import { AppContextComponent } from './context.component'; @@ -29,7 +28,7 @@ import { AppContextComponent } from './context.component'; IgoFeatureModule, IgoContextModule, AppContextComponent -], + ], exports: [AppContextComponent] }) export class AppContextModule {} diff --git a/projects/demo/src/app/core/activity/activity.component.ts b/projects/demo/src/app/core/activity/activity.component.ts index 114912613a..32e5eb42eb 100644 --- a/projects/demo/src/app/core/activity/activity.component.ts +++ b/projects/demo/src/app/core/activity/activity.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { IgoSpinnerModule } from '@igo2/common'; +import { SpinnerComponent } from '@igo2/common'; import { ActivityService } from '@igo2/core'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; @@ -15,8 +15,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - MatButtonModule, - IgoSpinnerModule + SpinnerComponent, + MatButtonModule ] }) export class AppActivityComponent { diff --git a/projects/demo/src/app/geo/catalog/catalog.component.ts b/projects/demo/src/app/geo/catalog/catalog.component.ts index 22c9f595a9..16428e0da8 100644 --- a/projects/demo/src/app/geo/catalog/catalog.component.ts +++ b/projects/demo/src/app/geo/catalog/catalog.component.ts @@ -1,17 +1,17 @@ import { Component, OnInit } from '@angular/core'; -import { EntityRecord, EntityStore, IgoPanelModule } from '@igo2/common'; +import { EntityRecord, EntityStore, PanelComponent } from '@igo2/common'; import { StorageService } from '@igo2/core'; import { Catalog, + CatalogBrowserComponent, CatalogItem, + CatalogLibaryComponent, CatalogService, - IgoCatalogBrowserModule, - IgoCatalogLibraryModule, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapService, MapViewOptions, TileLayer @@ -28,10 +28,10 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, - IgoPanelModule, - IgoCatalogLibraryModule, - IgoCatalogBrowserModule + MAP_DIRECTIVES, + PanelComponent, + CatalogLibaryComponent, + CatalogBrowserComponent ] }) export class AppCatalogComponent implements OnInit { diff --git a/projects/demo/src/app/geo/directions/directions.component.ts b/projects/demo/src/app/geo/directions/directions.component.ts index ea3ccb972f..33df618054 100644 --- a/projects/demo/src/app/geo/directions/directions.component.ts +++ b/projects/demo/src/app/geo/directions/directions.component.ts @@ -4,10 +4,10 @@ import { MatGridListModule } from '@angular/material/grid-list'; import { IgoDirectionsModule, IgoMap, - IgoMapModule, IgoSearchModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapService, MapViewOptions, RoutesFeatureStore, @@ -31,7 +31,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, + MAP_DIRECTIVES, IgoDirectionsModule, IgoSearchModule ] diff --git a/projects/demo/src/app/geo/draw/draw.component.ts b/projects/demo/src/app/geo/draw/draw.component.ts index bf2b637ffb..0891bfa32b 100644 --- a/projects/demo/src/app/geo/draw/draw.component.ts +++ b/projects/demo/src/app/geo/draw/draw.component.ts @@ -2,17 +2,18 @@ import { Component } from '@angular/core'; import { DataSourceService, + DrawComponent, FeatureStore, FeatureWithDraw, - IgoDrawModule, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MapBrowserComponent, MapService, MapViewOptions, OSMDataSource, - OSMDataSourceOptions + OSMDataSourceOptions, + ZoomButtonComponent } from '@igo2/geo'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; @@ -24,8 +25,9 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ styleUrls: ['./draw.component.scss'], standalone: true, imports: [ - IgoMapModule, - IgoDrawModule, + MapBrowserComponent, + ZoomButtonComponent, + DrawComponent, DocViewerComponent, ExampleViewerComponent ] diff --git a/projects/demo/src/app/geo/draw/draw.module.ts b/projects/demo/src/app/geo/draw/draw.module.ts deleted file mode 100644 index b2109b6dae..0000000000 --- a/projects/demo/src/app/geo/draw/draw.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import { IgoDrawModule, IgoMapModule } from '@igo2/geo'; - -import { AppDrawComponent } from './draw.component'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { - path: '', - component: AppDrawComponent - } - ]) - ], - exports: [RouterModule] -}) -class RoutingModule {} - -@NgModule({ - imports: [IgoMapModule, IgoDrawModule, AppDrawComponent, RoutingModule] -}) -export class AppDrawModule {} diff --git a/projects/demo/src/app/geo/feature/feature.component.ts b/projects/demo/src/app/geo/feature/feature.component.ts index b27682f5fd..43a3620a8c 100644 --- a/projects/demo/src/app/geo/feature/feature.component.ts +++ b/projects/demo/src/app/geo/feature/feature.component.ts @@ -1,6 +1,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { EntityTableTemplate, IgoEntityTableModule } from '@igo2/common'; +import { EntityTableComponent, EntityTableTemplate } from '@igo2/common'; import { DataSourceService, FeatureDataSource, @@ -10,9 +10,9 @@ import { FeatureStoreLoadingStrategy, FeatureStoreSelectionStrategy, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions, @@ -30,8 +30,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, - IgoEntityTableModule + MAP_DIRECTIVES, + EntityTableComponent ] }) export class AppFeatureComponent implements OnInit, OnDestroy { diff --git a/projects/demo/src/app/geo/geo.routing.ts b/projects/demo/src/app/geo/geo.routing.ts index 134e6b798d..3b98e8dbef 100644 --- a/projects/demo/src/app/geo/geo.routing.ts +++ b/projects/demo/src/app/geo/geo.routing.ts @@ -2,6 +2,7 @@ import { Routes } from '@angular/router'; import { AppCatalogComponent } from './catalog/catalog.component'; import { AppDirectionsComponent } from './directions/directions.component'; +import { AppDrawComponent } from './draw/draw.component'; import { AppFeatureComponent } from './feature/feature.component'; import { AppGeometryComponent } from './geometry/geometry.component'; import { AppHoverComponent } from './hover/hover.component'; @@ -64,8 +65,7 @@ export const routes: Routes = [ { title: 'Draw', path: 'draw', - loadChildren: () => - import('./draw/draw.module').then((m) => m.AppDrawModule) + component: AppDrawComponent }, { title: 'Query', diff --git a/projects/demo/src/app/geo/geometry/geometry.component.ts b/projects/demo/src/app/geo/geometry/geometry.component.ts index 85f9310dad..bf3116e158 100644 --- a/projects/demo/src/app/geo/geometry/geometry.component.ts +++ b/projects/demo/src/app/geo/geometry/geometry.component.ts @@ -5,18 +5,18 @@ import { MatButtonModule } from '@angular/material/button'; import { Form, + FormComponent, FormField, FormFieldConfig, - FormService, - IgoFormFormModule, - IgoFormGroupModule + FormGroupComponent, + FormService } from '@igo2/common'; import { DataSourceService, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions @@ -37,10 +37,10 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, + MAP_DIRECTIVES, NgIf, - IgoFormFormModule, - IgoFormGroupModule, + FormComponent, + FormGroupComponent, MatButtonModule, AsyncPipe ] diff --git a/projects/demo/src/app/geo/import-export/import-export.component.ts b/projects/demo/src/app/geo/import-export/import-export.component.ts index 8d012aff0a..ffc0849ddf 100644 --- a/projects/demo/src/app/geo/import-export/import-export.component.ts +++ b/projects/demo/src/app/geo/import-export/import-export.component.ts @@ -3,11 +3,11 @@ import { MatGridListModule } from '@angular/material/grid-list'; import { WorkspaceStore } from '@igo2/common'; import { - IgoImportExportModule, + IMPORT_EXPORT_DIRECTIVES, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, TileLayer } from '@igo2/geo'; @@ -24,8 +24,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoImportExportModule + MAP_DIRECTIVES, + IMPORT_EXPORT_DIRECTIVES ] }) export class AppImportExportComponent { diff --git a/projects/demo/src/app/geo/layer/layer.component.ts b/projects/demo/src/app/geo/layer/layer.component.ts index d1f6578d5a..e9d66ea346 100644 --- a/projects/demo/src/app/geo/layer/layer.component.ts +++ b/projects/demo/src/app/geo/layer/layer.component.ts @@ -1,20 +1,20 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { IgoPanelModule } from '@igo2/common'; +import { PanelComponent } from '@igo2/common'; import { DataSourceService, + DownloadButtonComponent, + FILTER_DIRECTIVES, FeatureDataSource, - IgoDownloadModule, - IgoFilterModule, - IgoLayerModule, IgoMap, - IgoMapModule, - IgoMetadataModule, ImageLayer, ImageLayerOptions, + LAYER_DIRECTIVES, LayerOptions, LayerService, + MAP_DIRECTIVES, + METADATA_DIRECTIVES, MapViewOptions, MetadataLayerOptions, OSMDataSource, @@ -38,12 +38,12 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoPanelModule, - IgoLayerModule, - IgoMetadataModule, - IgoDownloadModule, - IgoFilterModule + MAP_DIRECTIVES, + PanelComponent, + LAYER_DIRECTIVES, + METADATA_DIRECTIVES, + DownloadButtonComponent, + FILTER_DIRECTIVES ] }) export class AppLayerComponent { diff --git a/projects/demo/src/app/geo/legend/legend.component.ts b/projects/demo/src/app/geo/legend/legend.component.ts index e464fd382b..247dc33328 100644 --- a/projects/demo/src/app/geo/legend/legend.component.ts +++ b/projects/demo/src/app/geo/legend/legend.component.ts @@ -1,15 +1,15 @@ import { Component } from '@angular/core'; -import { IgoPanelModule } from '@igo2/common'; +import { PanelComponent } from '@igo2/common'; import { DataSourceService, - IgoLayerModule, IgoMap, - IgoMapModule, ImageLayer, ImageLayerOptions, + LAYER_DIRECTIVES, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, MetadataLayerOptions, OSMDataSource, @@ -29,9 +29,9 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, - IgoPanelModule, - IgoLayerModule + MAP_DIRECTIVES, + PanelComponent, + LAYER_DIRECTIVES ] }) export class AppLegendComponent { diff --git a/projects/demo/src/app/geo/measure/measure.component.ts b/projects/demo/src/app/geo/measure/measure.component.ts index 4425de9b40..5eedb995a3 100644 --- a/projects/demo/src/app/geo/measure/measure.component.ts +++ b/projects/demo/src/app/geo/measure/measure.component.ts @@ -5,13 +5,14 @@ import { FeatureStore, FeatureWithMeasure, IgoMap, - IgoMapModule, - IgoMeasurerModule, LayerOptions, LayerService, + MapBrowserComponent, MapViewOptions, + MeasurerComponent, OSMDataSource, - OSMDataSourceOptions + OSMDataSourceOptions, + ZoomButtonComponent } from '@igo2/geo'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; @@ -25,8 +26,9 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, - IgoMeasurerModule + MapBrowserComponent, + ZoomButtonComponent, + MeasurerComponent ] }) export class AppMeasureComponent { diff --git a/projects/demo/src/app/geo/ogc-filter/ogc-filter.component.ts b/projects/demo/src/app/geo/ogc-filter/ogc-filter.component.ts index 1649a59712..68b47b9fa0 100644 --- a/projects/demo/src/app/geo/ogc-filter/ogc-filter.component.ts +++ b/projects/demo/src/app/geo/ogc-filter/ogc-filter.component.ts @@ -1,16 +1,16 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { IgoPanelModule } from '@igo2/common'; +import { PanelComponent } from '@igo2/common'; import { AnyBaseOgcFilterOptions, DataSourceService, - IgoFilterModule, + FILTER_DIRECTIVES, IgoMap, - IgoMapModule, ImageLayerOptions, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions, @@ -41,9 +41,9 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoPanelModule, - IgoFilterModule + MAP_DIRECTIVES, + PanelComponent, + FILTER_DIRECTIVES ] }) export class AppOgcFilterComponent { diff --git a/projects/demo/src/app/geo/overlay/overlay.component.ts b/projects/demo/src/app/geo/overlay/overlay.component.ts index f84a2548b6..e52a82c4ec 100644 --- a/projects/demo/src/app/geo/overlay/overlay.component.ts +++ b/projects/demo/src/app/geo/overlay/overlay.component.ts @@ -6,9 +6,9 @@ import { Feature, FeatureMotion, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions @@ -22,7 +22,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './overlay.component.html', styleUrls: ['./overlay.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoMapModule] + imports: [DocViewerComponent, ExampleViewerComponent, MAP_DIRECTIVES] }) export class AppOverlayComponent implements OnInit, AfterViewInit { public map: IgoMap = new IgoMap({ diff --git a/projects/demo/src/app/geo/print/print.component.ts b/projects/demo/src/app/geo/print/print.component.ts index 172e6debbb..355960de07 100644 --- a/projects/demo/src/app/geo/print/print.component.ts +++ b/projects/demo/src/app/geo/print/print.component.ts @@ -3,12 +3,12 @@ import { MatGridListModule } from '@angular/material/grid-list'; import { IgoMap, - IgoMapModule, - IgoPrintModule, ImageLayer, ImageLayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, + PrintComponent, TileLayer, TileLayerOptions } from '@igo2/geo'; @@ -25,8 +25,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoPrintModule + MAP_DIRECTIVES, + PrintComponent ] }) export class AppPrintComponent { diff --git a/projects/demo/src/app/geo/query/query.component.ts b/projects/demo/src/app/geo/query/query.component.ts index 2de601540c..df33139688 100644 --- a/projects/demo/src/app/geo/query/query.component.ts +++ b/projects/demo/src/app/geo/query/query.component.ts @@ -1,26 +1,26 @@ import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component } from '@angular/core'; -import { IgoPanelModule, getEntityTitle } from '@igo2/common'; +import { PanelComponent, getEntityTitle } from '@igo2/common'; import { DataSource, DataSourceService, + FEATURE_DETAILS_DIRECTIVES, Feature, FeatureDataSource, FeatureDataSourceOptions, FeatureMotion, - IgoFeatureDetailsModule, IgoMap, - IgoMapModule, - IgoOverlayModule, IgoQueryModule, ImageLayer, ImageLayerOptions, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions, + OverlayDirective, QueryFormat, QueryHtmlTarget, QueryableDataSourceOptions, @@ -49,13 +49,13 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ imports: [ DocViewerComponent, ExampleViewerComponent, - IgoMapModule, - IgoOverlayModule, + MAP_DIRECTIVES, + OverlayDirective, IgoQueryModule, - IgoPanelModule, + PanelComponent, NgIf, NgFor, - IgoFeatureDetailsModule, + FEATURE_DETAILS_DIRECTIVES, AsyncPipe ] }) diff --git a/projects/demo/src/app/geo/search/search.component.ts b/projects/demo/src/app/geo/search/search.component.ts index d94b4e4ec4..568750c8b9 100644 --- a/projects/demo/src/app/geo/search/search.component.ts +++ b/projects/demo/src/app/geo/search/search.component.ts @@ -7,31 +7,32 @@ import { ViewChild } from '@angular/core'; -import { ActionStore, EntityStore } from '@igo2/common'; import { - IgoActionbarModule, - IgoContextMenuModule, - IgoPanelModule + ActionStore, + ActionbarComponent, + CONTEXT_MENU_DIRECTIVES, + EntityStore, + PanelComponent } from '@igo2/common'; import { MediaService, StorageService } from '@igo2/core'; import { FEATURE, Feature, + FeatureDetailsComponent, FeatureMotion, GoogleLinks, - IgoFeatureDetailsModule, IgoMap, - IgoMapModule, - IgoSearchBarModule, IgoSearchModule, - IgoSearchResultsModule, LayerOptions, LayerService, + MapBrowserComponent, MapService, MapViewOptions, Research, + SEARCH_RESULTS_DIRECTIVES, SearchResult, SearchService, + ZoomButtonComponent, provideDefaultCoordinatesSearchResultFormatter, provideDefaultIChercheSearchResultFormatter, provideILayerSearchResultFormatter, @@ -57,14 +58,14 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, NgIf, - IgoMapModule, - IgoContextMenuModule, + MapBrowserComponent, + ZoomButtonComponent, + CONTEXT_MENU_DIRECTIVES, IgoSearchModule, - IgoPanelModule, - IgoSearchBarModule, - IgoSearchResultsModule, - IgoFeatureDetailsModule, - IgoActionbarModule + PanelComponent, + SEARCH_RESULTS_DIRECTIVES, + ActionbarComponent, + FeatureDetailsComponent ], providers: [ SearchService, diff --git a/projects/demo/src/app/geo/simple-map/simple-map.component.ts b/projects/demo/src/app/geo/simple-map/simple-map.component.ts index f41ae2a52b..14050326c0 100644 --- a/projects/demo/src/app/geo/simple-map/simple-map.component.ts +++ b/projects/demo/src/app/geo/simple-map/simple-map.component.ts @@ -5,9 +5,9 @@ import { Media, MediaService } from '@igo2/core'; import { DataSourceService, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions @@ -21,7 +21,7 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './simple-map.component.html', styleUrls: ['./simple-map.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoMapModule, NgIf] + imports: [DocViewerComponent, ExampleViewerComponent, MAP_DIRECTIVES, NgIf] }) export class AppSimpleMapComponent { public pointerCoord: string; diff --git a/projects/demo/src/app/geo/spatial-filter/spatial-filter.component.ts b/projects/demo/src/app/geo/spatial-filter/spatial-filter.component.ts index 02d02eb350..5baa14e1cf 100644 --- a/projects/demo/src/app/geo/spatial-filter/spatial-filter.component.ts +++ b/projects/demo/src/app/geo/spatial-filter/spatial-filter.component.ts @@ -14,22 +14,22 @@ import { EntityKey, EntityStore, EntityStoreWithStrategy, - IgoPanelModule + PanelComponent } from '@igo2/common'; import { LanguageService, MessageService } from '@igo2/core'; import { ClusterDataSource, DataSourceService, + FEATURE_DETAILS_DIRECTIVES, + FILTER_DIRECTIVES, Feature, FeatureMotion, - IgoFeatureDetailsModule, - IgoFilterModule, IgoMap, - IgoMapModule, IgoQueryModule, Layer, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, MeasureLengthUnit, OSMDataSource, @@ -74,12 +74,12 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, + MAP_DIRECTIVES, IgoQueryModule, - IgoPanelModule, - IgoFilterModule, + PanelComponent, + FILTER_DIRECTIVES, NgIf, - IgoFeatureDetailsModule, + FEATURE_DETAILS_DIRECTIVES, AsyncPipe ] }) diff --git a/projects/demo/src/app/geo/time-filter/time-filter.component.ts b/projects/demo/src/app/geo/time-filter/time-filter.component.ts index c00a584969..2190ad1063 100644 --- a/projects/demo/src/app/geo/time-filter/time-filter.component.ts +++ b/projects/demo/src/app/geo/time-filter/time-filter.component.ts @@ -1,14 +1,14 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { IgoPanelModule } from '@igo2/common'; +import { PanelComponent } from '@igo2/common'; import { DataSourceService, - IgoFilterModule, + FILTER_DIRECTIVES, IgoMap, - IgoMapModule, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions, @@ -30,9 +30,9 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ DocViewerComponent, ExampleViewerComponent, MatGridListModule, - IgoMapModule, - IgoPanelModule, - IgoFilterModule + MAP_DIRECTIVES, + PanelComponent, + FILTER_DIRECTIVES ] }) export class AppTimeFilterComponent { diff --git a/projects/demo/src/app/geo/workspace/workspace.component.ts b/projects/demo/src/app/geo/workspace/workspace.component.ts index 139fb07a28..a5d1582b1c 100644 --- a/projects/demo/src/app/geo/workspace/workspace.component.ts +++ b/projects/demo/src/app/geo/workspace/workspace.component.ts @@ -5,17 +5,17 @@ import { MatPaginator } from '@angular/material/paginator'; import { Action, + ActionbarComponent, ActionbarMode, EntityRecord, + EntityTableComponent, + EntityTablePaginatorComponent, EntityTablePaginatorOptions, EntityTableScrollBehavior, - IgoActionbarModule, - IgoEntityTableModule, - IgoEntityTablePaginatorModule, - IgoWorkspaceSelectorModule, - IgoWorkspaceWidgetOutletModule, Workspace, - WorkspaceStore + WorkspaceSelectorComponent, + WorkspaceStore, + WorkspaceWidgetOutletComponent } from '@igo2/common'; import { DataSourceService, @@ -23,14 +23,15 @@ import { IgoMap, LayerOptions, LayerService, + MAP_DIRECTIVES, MapViewOptions, OSMDataSource, OSMDataSourceOptions, VectorLayerOptions, WFSDataSource, - WFSDataSourceOptions + WFSDataSourceOptions, + WorkspaceSelectorDirective } from '@igo2/geo'; -import { IgoMapModule } from '@igo2/geo'; import { WorkspaceState } from '@igo2/integration'; import { BehaviorSubject, Observable } from 'rxjs'; @@ -48,13 +49,14 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ AsyncPipe, DocViewerComponent, ExampleViewerComponent, - IgoActionbarModule, - IgoEntityTableModule, - IgoEntityTablePaginatorModule, + EntityTableComponent, + ActionbarComponent, + EntityTablePaginatorComponent, IgoGeoWorkspaceModule, - IgoMapModule, - IgoWorkspaceSelectorModule, - IgoWorkspaceWidgetOutletModule, + MAP_DIRECTIVES, + WorkspaceSelectorComponent, + WorkspaceSelectorDirective, + WorkspaceWidgetOutletComponent, MatCardModule, NgIf ] diff --git a/projects/demo/src/main.ts b/projects/demo/src/main.ts index 203fd510e2..dd83f08cf5 100644 --- a/projects/demo/src/main.ts +++ b/projects/demo/src/main.ts @@ -1,4 +1,4 @@ -import { DatePipe } from '@angular/common'; +import { provideHttpClient, withJsonpSupport } from '@angular/common/http'; import { APP_INITIALIZER, ApplicationRef, @@ -71,6 +71,7 @@ bootstrapApplication(AppComponent, { IgoGeoWorkspaceModule, IgoDirectionsModule ), + provideHttpClient(withJsonpSupport()), provideConfigOptions({ default: environment.igo }), @@ -86,7 +87,6 @@ bootstrapApplication(AppComponent, { multi: true }, { provide: MAT_TOOLTIP_DEFAULT_OPTIONS, useValue: defaultTooltipOptions }, - DatePipe, provideAnimations(), provideOsrmDirectionsSource(), provideIChercheSearchSource(), diff --git a/scripts/src/utils/log.ts b/scripts/src/utils/log.ts index 34e666acb2..eb6310206e 100644 --- a/scripts/src/utils/log.ts +++ b/scripts/src/utils/log.ts @@ -1,6 +1,7 @@ /** * Source: https://github.com/ng-packagr/ng-packagr/blob/ee4fd635a626e1ee2266b05cb572002bb09b4849/src/lib/utils/log.ts */ + /* eslint-disable no-console */ import { colors } from './color'; diff --git a/scripts/src/utils/style.utils.ts b/scripts/src/utils/style.utils.ts index 72b97fdb78..628893b069 100644 --- a/scripts/src/utils/style.utils.ts +++ b/scripts/src/utils/style.utils.ts @@ -1,7 +1,7 @@ import { compile } from 'sass'; -import { createFile } from './file-system.utils'; import { PATHS } from '../config/paths'; +import { createFile } from './file-system.utils'; export async function compileStyle( input: string,