diff --git a/angular.json b/angular.json index 0b61087f97..fad4fbe671 100644 --- a/angular.json +++ b/angular.json @@ -273,7 +273,7 @@ }, "common": { "root": "packages/common", - "sourceRoot": "packages/common/src", + "sourceRoot": "packages/common", "projectType": "library", "prefix": "igo", "schematics": { diff --git a/package-lock.json b/package-lock.json index 98b5b12287..bae61da94a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23522,7 +23522,7 @@ }, "packages/auth": { "name": "@igo2/auth", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "jwt-decode": "^4.0.0", @@ -23550,7 +23550,7 @@ }, "packages/common": { "name": "@igo2/common", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "tslib": "^2.6.0" @@ -23579,7 +23579,7 @@ }, "packages/context": { "name": "@igo2/context", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "tslib": "^2.6.0" @@ -23605,7 +23605,7 @@ }, "packages/core": { "name": "@igo2/core", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "@ngx-translate/core": "^15.0.0", @@ -23625,6 +23625,8 @@ "@angular/platform-browser": "^17.0.6", "@angular/router": "^17.0.6", "@igo2/utils": "*", + "@ngx-translate/core": "^15.0.0", + "@ngx-translate/http-loader": "^8.0.0", "@sentry/angular-ivy": "^7.87.0", "ngx-indexed-db": "^11.0.2", "ngx-toastr": "^18.0.0", @@ -23633,7 +23635,7 @@ }, "packages/geo": { "name": "@igo2/geo", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "@turf/helpers": "^6.5.0", @@ -23683,7 +23685,7 @@ }, "packages/integration": { "name": "@igo2/integration", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "tslib": "^2.6.0" @@ -23704,7 +23706,7 @@ }, "packages/utils": { "name": "@igo2/utils", - "version": "17.0.0-next.5", + "version": "17.0.0-next.6", "license": "MIT", "dependencies": { "bowser": "^2.10.0", @@ -23736,13 +23738,13 @@ "@angular/platform-browser-dynamic": "^17.0.7", "@angular/router": "^17.0.7", "@angular/service-worker": "^17.0.7", - "@igo2/auth": "^17.0.0-next.5", - "@igo2/common": "^17.0.0-next.5", - "@igo2/context": "^17.0.0-next.5", - "@igo2/core": "^17.0.0-next.5", - "@igo2/geo": "^17.0.0-next.5", - "@igo2/integration": "^17.0.0-next.5", - "@igo2/utils": "^17.0.0-next.5", + "@igo2/auth": "^17.0.0-next.3", + "@igo2/common": "^17.0.0-next.3", + "@igo2/context": "^17.0.0-next.3", + "@igo2/core": "^17.0.0-next.3", + "@igo2/geo": "^17.0.0-next.3", + "@igo2/integration": "^17.0.0-next.3", + "@igo2/utils": "^17.0.0-next.3", "core-js": "^3.32.2", "hammerjs": "^2.0.8", "ol": "^7.5.2", diff --git a/packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts b/packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts index 5b42c2cf97..b8d4b9afcb 100644 --- a/packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts +++ b/packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts @@ -9,7 +9,7 @@ import { import { MatButtonModule } from '@angular/material/button'; import { AuthService } from '@igo2/auth'; -import { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common'; +import { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts b/packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts index 77a7b75089..cdcc054002 100644 --- a/packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts +++ b/packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts @@ -9,7 +9,7 @@ import { import { MatButtonModule } from '@angular/material/button'; import { AuthService } from '@igo2/auth'; -import { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common'; +import { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/common/action/index.ts b/packages/common/action/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/action/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/action/ng-package.json b/packages/common/action/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/action/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/action/action.module.ts b/packages/common/action/src/action.module.ts similarity index 100% rename from packages/common/src/lib/action/action.module.ts rename to packages/common/action/src/action.module.ts diff --git a/packages/common/src/lib/action/action.theming.scss b/packages/common/action/src/action.theming.scss similarity index 100% rename from packages/common/src/lib/action/action.theming.scss rename to packages/common/action/src/action.theming.scss diff --git a/packages/common/src/lib/action/actionbar/actionbar-item.component.html b/packages/common/action/src/actionbar/actionbar-item.component.html similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar-item.component.html rename to packages/common/action/src/actionbar/actionbar-item.component.html diff --git a/packages/common/src/lib/action/actionbar/actionbar-item.component.scss b/packages/common/action/src/actionbar/actionbar-item.component.scss similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar-item.component.scss rename to packages/common/action/src/actionbar/actionbar-item.component.scss diff --git a/packages/common/src/lib/action/actionbar/actionbar-item.component.ts b/packages/common/action/src/actionbar/actionbar-item.component.ts similarity index 99% rename from packages/common/src/lib/action/actionbar/actionbar-item.component.ts rename to packages/common/action/src/actionbar/actionbar-item.component.ts index a5f5222531..bec89d58c4 100644 --- a/packages/common/src/lib/action/actionbar/actionbar-item.component.ts +++ b/packages/common/action/src/actionbar/actionbar-item.component.ts @@ -14,11 +14,11 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { IgoIconComponent } from '@igo2/common/icon'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject, Subscription, isObservable } from 'rxjs'; -import { IgoIconComponent } from '../../icons'; import { Action } from '../shared/action.interfaces'; /** diff --git a/packages/common/src/lib/action/actionbar/actionbar-item.theming.scss b/packages/common/action/src/actionbar/actionbar-item.theming.scss similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar-item.theming.scss rename to packages/common/action/src/actionbar/actionbar-item.theming.scss diff --git a/packages/common/src/lib/action/actionbar/actionbar.component.html b/packages/common/action/src/actionbar/actionbar.component.html similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar.component.html rename to packages/common/action/src/actionbar/actionbar.component.html diff --git a/packages/common/src/lib/action/actionbar/actionbar.component.scss b/packages/common/action/src/actionbar/actionbar.component.scss similarity index 96% rename from packages/common/src/lib/action/actionbar/actionbar.component.scss rename to packages/common/action/src/actionbar/actionbar.component.scss index 3740f7e993..236418d285 100644 --- a/packages/common/src/lib/action/actionbar/actionbar.component.scss +++ b/packages/common/action/src/actionbar/actionbar.component.scss @@ -1,4 +1,4 @@ -@import '../../../../../core/src/style/partial/media'; +@import '../../../../core/src/style/partial/media'; $igo-actionbar-item-height: 46px; $igo-actionbar-item-padding: 3px; diff --git a/packages/common/src/lib/action/actionbar/actionbar.component.ts b/packages/common/action/src/actionbar/actionbar.component.ts similarity index 99% rename from packages/common/src/lib/action/actionbar/actionbar.component.ts rename to packages/common/action/src/actionbar/actionbar.component.ts index cd1905bf85..b38112ef3b 100644 --- a/packages/common/src/lib/action/actionbar/actionbar.component.ts +++ b/packages/common/action/src/actionbar/actionbar.component.ts @@ -22,12 +22,12 @@ import { } from '@angular/material/menu'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { EntityStoreWatcher } from '@igo2/common/entity'; import { IgoLanguageModule } from '@igo2/core/language'; import { Media, MediaService } from '@igo2/core/media'; 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'; diff --git a/packages/common/src/lib/action/actionbar/actionbar.module.ts b/packages/common/action/src/actionbar/actionbar.module.ts similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar.module.ts rename to packages/common/action/src/actionbar/actionbar.module.ts diff --git a/packages/common/src/lib/action/actionbar/actionbar.theming.scss b/packages/common/action/src/actionbar/actionbar.theming.scss similarity index 100% rename from packages/common/src/lib/action/actionbar/actionbar.theming.scss rename to packages/common/action/src/actionbar/actionbar.theming.scss diff --git a/packages/common/action/src/public_api.ts b/packages/common/action/src/public_api.ts new file mode 100644 index 0000000000..b19ae9511a --- /dev/null +++ b/packages/common/action/src/public_api.ts @@ -0,0 +1,4 @@ +export * from './shared'; +export * from './action.module'; +export * from './actionbar/actionbar.module'; +export * from './actionbar/actionbar.component'; diff --git a/packages/common/src/lib/action/shared/action.enums.ts b/packages/common/action/src/shared/action.enums.ts similarity index 100% rename from packages/common/src/lib/action/shared/action.enums.ts rename to packages/common/action/src/shared/action.enums.ts diff --git a/packages/common/src/lib/action/shared/action.interfaces.ts b/packages/common/action/src/shared/action.interfaces.ts similarity index 92% rename from packages/common/src/lib/action/shared/action.interfaces.ts rename to packages/common/action/src/shared/action.interfaces.ts index 3625f7edbb..416dce9011 100644 --- a/packages/common/src/lib/action/shared/action.interfaces.ts +++ b/packages/common/action/src/shared/action.interfaces.ts @@ -1,6 +1,6 @@ -import { Observable } from 'rxjs'; +import { IconSvg } from '@igo2/common/icon'; -import { IconSvg } from '../../icons'; +import { Observable } from 'rxjs'; export interface Action { id: string; diff --git a/packages/common/src/lib/action/shared/index.ts b/packages/common/action/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/action/shared/index.ts rename to packages/common/action/src/shared/index.ts diff --git a/packages/common/src/lib/action/shared/store.ts b/packages/common/action/src/shared/store.ts similarity index 78% rename from packages/common/src/lib/action/shared/store.ts rename to packages/common/action/src/shared/store.ts index c19c19dc43..f0cc16edfd 100644 --- a/packages/common/src/lib/action/shared/store.ts +++ b/packages/common/action/src/shared/store.ts @@ -1,4 +1,5 @@ -import { EntityStore } from '../../entity'; +import { EntityStore } from '@igo2/common/entity'; + import { Action } from './action.interfaces'; /** diff --git a/packages/common/backdrop/index.ts b/packages/common/backdrop/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/backdrop/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/backdrop/ng-package.json b/packages/common/backdrop/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/backdrop/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/backdrop/backdrop.component.html b/packages/common/backdrop/src/backdrop.component.html similarity index 100% rename from packages/common/src/lib/backdrop/backdrop.component.html rename to packages/common/backdrop/src/backdrop.component.html diff --git a/packages/common/src/lib/backdrop/backdrop.component.scss b/packages/common/backdrop/src/backdrop.component.scss similarity index 80% rename from packages/common/src/lib/backdrop/backdrop.component.scss rename to packages/common/backdrop/src/backdrop.component.scss index 9e818aa66e..a72be6ae23 100644 --- a/packages/common/src/lib/backdrop/backdrop.component.scss +++ b/packages/common/backdrop/src/backdrop.component.scss @@ -1,4 +1,4 @@ -@import '../../../../core/src/style/partial/media'; +@import '../../../core/src/style/partial/media'; :host > div { position: absolute; diff --git a/packages/common/src/lib/backdrop/backdrop.component.spec.ts b/packages/common/backdrop/src/backdrop.component.spec.ts similarity index 100% rename from packages/common/src/lib/backdrop/backdrop.component.spec.ts rename to packages/common/backdrop/src/backdrop.component.spec.ts diff --git a/packages/common/src/lib/backdrop/backdrop.component.ts b/packages/common/backdrop/src/backdrop.component.ts similarity index 100% rename from packages/common/src/lib/backdrop/backdrop.component.ts rename to packages/common/backdrop/src/backdrop.component.ts diff --git a/packages/common/src/lib/backdrop/backdrop.module.ts b/packages/common/backdrop/src/backdrop.module.ts similarity index 100% rename from packages/common/src/lib/backdrop/backdrop.module.ts rename to packages/common/backdrop/src/backdrop.module.ts diff --git a/packages/common/src/lib/backdrop/index.ts b/packages/common/backdrop/src/public_api.ts similarity index 52% rename from packages/common/src/lib/backdrop/index.ts rename to packages/common/backdrop/src/public_api.ts index d96ee19646..034d906caa 100644 --- a/packages/common/src/lib/backdrop/index.ts +++ b/packages/common/backdrop/src/public_api.ts @@ -1 +1,2 @@ +export * from './backdrop.module'; export * from './backdrop.component'; diff --git a/packages/common/badge/index.ts b/packages/common/badge/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/badge/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/badge/ng-package.json b/packages/common/badge/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/badge/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/badge-icon/badge-icon.directive.ts b/packages/common/badge/src/badge-icon.directive.ts similarity index 100% rename from packages/common/src/lib/badge-icon/badge-icon.directive.ts rename to packages/common/badge/src/badge-icon.directive.ts diff --git a/packages/common/src/lib/badge-icon/badge-icon.module.ts b/packages/common/badge/src/badge-icon.module.ts similarity index 100% rename from packages/common/src/lib/badge-icon/badge-icon.module.ts rename to packages/common/badge/src/badge-icon.module.ts diff --git a/packages/common/src/lib/badge-icon/index.ts b/packages/common/badge/src/public_api.ts similarity index 51% rename from packages/common/src/lib/badge-icon/index.ts rename to packages/common/badge/src/public_api.ts index 0a553e9f0c..9d49e4ca4e 100644 --- a/packages/common/src/lib/badge-icon/index.ts +++ b/packages/common/badge/src/public_api.ts @@ -1 +1,2 @@ export * from './badge-icon.directive'; +export * from './badge-icon.module'; diff --git a/packages/common/clickout/index.ts b/packages/common/clickout/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/clickout/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/clickout/ng-package.json b/packages/common/clickout/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/clickout/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/clickout/clickout.directive.spec.ts b/packages/common/clickout/src/clickout.directive.spec.ts similarity index 100% rename from packages/common/src/lib/clickout/clickout.directive.spec.ts rename to packages/common/clickout/src/clickout.directive.spec.ts diff --git a/packages/common/src/lib/clickout/clickout.directive.ts b/packages/common/clickout/src/clickout.directive.ts similarity index 100% rename from packages/common/src/lib/clickout/clickout.directive.ts rename to packages/common/clickout/src/clickout.directive.ts diff --git a/packages/common/src/lib/clickout/clickout.module.ts b/packages/common/clickout/src/clickout.module.ts similarity index 100% rename from packages/common/src/lib/clickout/clickout.module.ts rename to packages/common/clickout/src/clickout.module.ts diff --git a/packages/common/src/lib/clickout/index.ts b/packages/common/clickout/src/public_api.ts similarity index 52% rename from packages/common/src/lib/clickout/index.ts rename to packages/common/clickout/src/public_api.ts index 4c5283d2a2..c9a90ebc10 100644 --- a/packages/common/src/lib/clickout/index.ts +++ b/packages/common/clickout/src/public_api.ts @@ -1 +1,2 @@ export * from './clickout.directive'; +export * from './clickout.module'; diff --git a/packages/common/clone/index.ts b/packages/common/clone/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/clone/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/clone/ng-package.json b/packages/common/clone/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/clone/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/clone/clone.module.ts b/packages/common/clone/src/clone.module.ts similarity index 100% rename from packages/common/src/lib/clone/clone.module.ts rename to packages/common/clone/src/clone.module.ts diff --git a/packages/common/src/lib/clone/clone.pipe.spec.ts b/packages/common/clone/src/clone.pipe.spec.ts similarity index 100% rename from packages/common/src/lib/clone/clone.pipe.spec.ts rename to packages/common/clone/src/clone.pipe.spec.ts diff --git a/packages/common/src/lib/clone/clone.pipe.ts b/packages/common/clone/src/clone.pipe.ts similarity index 100% rename from packages/common/src/lib/clone/clone.pipe.ts rename to packages/common/clone/src/clone.pipe.ts diff --git a/packages/common/clone/src/public_api.ts b/packages/common/clone/src/public_api.ts new file mode 100644 index 0000000000..15051a44bd --- /dev/null +++ b/packages/common/clone/src/public_api.ts @@ -0,0 +1,2 @@ +export * from './clone.pipe'; +export * from './clone.module'; diff --git a/packages/common/collapsible/index.ts b/packages/common/collapsible/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/collapsible/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/collapsible/ng-package.json b/packages/common/collapsible/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/collapsible/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/collapsible/collapse.directive.spec.ts b/packages/common/collapsible/src/collapse.directive.spec.ts similarity index 100% rename from packages/common/src/lib/collapsible/collapse.directive.spec.ts rename to packages/common/collapsible/src/collapse.directive.spec.ts diff --git a/packages/common/src/lib/collapsible/collapse.directive.ts b/packages/common/collapsible/src/collapse.directive.ts similarity index 100% rename from packages/common/src/lib/collapsible/collapse.directive.ts rename to packages/common/collapsible/src/collapse.directive.ts diff --git a/packages/common/src/lib/collapsible/collapsible.component.html b/packages/common/collapsible/src/collapsible.component.html similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.component.html rename to packages/common/collapsible/src/collapsible.component.html diff --git a/packages/common/src/lib/collapsible/collapsible.component.scss b/packages/common/collapsible/src/collapsible.component.scss similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.component.scss rename to packages/common/collapsible/src/collapsible.component.scss diff --git a/packages/common/src/lib/collapsible/collapsible.component.spec.ts b/packages/common/collapsible/src/collapsible.component.spec.ts similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.component.spec.ts rename to packages/common/collapsible/src/collapsible.component.spec.ts diff --git a/packages/common/src/lib/collapsible/collapsible.component.ts b/packages/common/collapsible/src/collapsible.component.ts similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.component.ts rename to packages/common/collapsible/src/collapsible.component.ts diff --git a/packages/common/src/lib/collapsible/collapsible.module.ts b/packages/common/collapsible/src/collapsible.module.ts similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.module.ts rename to packages/common/collapsible/src/collapsible.module.ts diff --git a/packages/common/src/lib/collapsible/collapsible.theming.scss b/packages/common/collapsible/src/collapsible.theming.scss similarity index 100% rename from packages/common/src/lib/collapsible/collapsible.theming.scss rename to packages/common/collapsible/src/collapsible.theming.scss diff --git a/packages/common/src/lib/collapsible/index.ts b/packages/common/collapsible/src/public_api.ts similarity index 88% rename from packages/common/src/lib/collapsible/index.ts rename to packages/common/collapsible/src/public_api.ts index 44459decfe..c8989f889c 100644 --- a/packages/common/src/lib/collapsible/index.ts +++ b/packages/common/collapsible/src/public_api.ts @@ -2,6 +2,7 @@ import { CollapseDirective } from './collapse.directive'; import { CollapsibleComponent } from './collapsible.component'; export * from './collapsible.component'; +export * from './collapsible.module'; export * from './collapse.directive'; export const COLLAPSIBLE_DIRECTIVES = [ diff --git a/packages/common/color/index.ts b/packages/common/color/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/color/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/color/ng-package.json b/packages/common/color/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/color/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.html b/packages/common/color/src/color-picker-form-field/color-picker-form-field.component.html similarity index 100% rename from packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.html rename to packages/common/color/src/color-picker-form-field/color-picker-form-field.component.html diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.scss b/packages/common/color/src/color-picker-form-field/color-picker-form-field.component.scss similarity index 100% rename from packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.scss rename to packages/common/color/src/color-picker-form-field/color-picker-form-field.component.scss diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts b/packages/common/color/src/color-picker-form-field/color-picker-form-field.component.ts similarity index 100% rename from packages/common/src/lib/color-picker-form-field/color-picker-form-field.component.ts rename to packages/common/color/src/color-picker-form-field/color-picker-form-field.component.ts diff --git a/packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts b/packages/common/color/src/color-picker-form-field/color-picker-form-field.module.ts similarity index 100% rename from packages/common/src/lib/color-picker-form-field/color-picker-form-field.module.ts rename to packages/common/color/src/color-picker-form-field/color-picker-form-field.module.ts diff --git a/packages/common/src/lib/color-picker-form-field/index.ts b/packages/common/color/src/color-picker-form-field/index.ts similarity index 51% rename from packages/common/src/lib/color-picker-form-field/index.ts rename to packages/common/color/src/color-picker-form-field/index.ts index d37a560852..020ac6ce3a 100644 --- a/packages/common/src/lib/color-picker-form-field/index.ts +++ b/packages/common/color/src/color-picker-form-field/index.ts @@ -1 +1,2 @@ export * from './color-picker-form-field.component'; +export * from './color-picker-form-field.module'; diff --git a/packages/common/color/src/public_api.ts b/packages/common/color/src/public_api.ts new file mode 100644 index 0000000000..e59ed319f3 --- /dev/null +++ b/packages/common/color/src/public_api.ts @@ -0,0 +1 @@ +export * from './color-picker-form-field'; diff --git a/packages/common/confirm-dialog/index.ts b/packages/common/confirm-dialog/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/confirm-dialog/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/confirm-dialog/ng-package.json b/packages/common/confirm-dialog/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/confirm-dialog/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.component.html b/packages/common/confirm-dialog/src/confirm-dialog.component.html similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.component.html rename to packages/common/confirm-dialog/src/confirm-dialog.component.html diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.component.scss b/packages/common/confirm-dialog/src/confirm-dialog.component.scss similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.component.scss rename to packages/common/confirm-dialog/src/confirm-dialog.component.scss diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts b/packages/common/confirm-dialog/src/confirm-dialog.component.ts similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.component.ts rename to packages/common/confirm-dialog/src/confirm-dialog.component.ts diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.interface.ts b/packages/common/confirm-dialog/src/confirm-dialog.interface.ts similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.interface.ts rename to packages/common/confirm-dialog/src/confirm-dialog.interface.ts diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts b/packages/common/confirm-dialog/src/confirm-dialog.module.ts similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.module.ts rename to packages/common/confirm-dialog/src/confirm-dialog.module.ts diff --git a/packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts b/packages/common/confirm-dialog/src/confirm-dialog.service.ts similarity index 100% rename from packages/common/src/lib/confirm-dialog/confirm-dialog.service.ts rename to packages/common/confirm-dialog/src/confirm-dialog.service.ts diff --git a/packages/common/src/lib/confirm-dialog/index.ts b/packages/common/confirm-dialog/src/public_api.ts similarity index 76% rename from packages/common/src/lib/confirm-dialog/index.ts rename to packages/common/confirm-dialog/src/public_api.ts index 2cddef43ca..e5a17791cf 100644 --- a/packages/common/src/lib/confirm-dialog/index.ts +++ b/packages/common/confirm-dialog/src/public_api.ts @@ -1,3 +1,4 @@ +export * from './confirm-dialog.module'; export * from './confirm-dialog.component'; export * from './confirm-dialog.interface'; export * from './confirm-dialog.service'; diff --git a/packages/common/context-menu/index.ts b/packages/common/context-menu/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/context-menu/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/context-menu/ng-package.json b/packages/common/context-menu/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/context-menu/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/context-menu/context-menu.directive.ts b/packages/common/context-menu/src/context-menu.directive.ts similarity index 100% rename from packages/common/src/lib/context-menu/context-menu.directive.ts rename to packages/common/context-menu/src/context-menu.directive.ts diff --git a/packages/common/src/lib/context-menu/context-menu.module.ts b/packages/common/context-menu/src/context-menu.module.ts similarity index 100% rename from packages/common/src/lib/context-menu/context-menu.module.ts rename to packages/common/context-menu/src/context-menu.module.ts diff --git a/packages/common/src/lib/context-menu/long-press.directive.ts b/packages/common/context-menu/src/long-press.directive.ts similarity index 100% rename from packages/common/src/lib/context-menu/long-press.directive.ts rename to packages/common/context-menu/src/long-press.directive.ts diff --git a/packages/common/src/lib/context-menu/index.ts b/packages/common/context-menu/src/public_api.ts similarity index 88% rename from packages/common/src/lib/context-menu/index.ts rename to packages/common/context-menu/src/public_api.ts index d1758efc50..9f0637599c 100644 --- a/packages/common/src/lib/context-menu/index.ts +++ b/packages/common/context-menu/src/public_api.ts @@ -1,6 +1,7 @@ import { ContextMenuDirective } from './context-menu.directive'; import { LongPressDirective } from './long-press.directive'; +export * from './context-menu.module'; export * from './context-menu.directive'; export * from './long-press.directive'; diff --git a/packages/common/custom-html/index.ts b/packages/common/custom-html/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/custom-html/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/custom-html/ng-package.json b/packages/common/custom-html/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/custom-html/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/custom-html/custom-html.component.html b/packages/common/custom-html/src/custom-html.component.html similarity index 100% rename from packages/common/src/lib/custom-html/custom-html.component.html rename to packages/common/custom-html/src/custom-html.component.html diff --git a/packages/common/src/lib/custom-html/custom-html.component.scss b/packages/common/custom-html/src/custom-html.component.scss similarity index 100% rename from packages/common/src/lib/custom-html/custom-html.component.scss rename to packages/common/custom-html/src/custom-html.component.scss diff --git a/packages/common/src/lib/custom-html/custom-html.component.ts b/packages/common/custom-html/src/custom-html.component.ts similarity index 100% rename from packages/common/src/lib/custom-html/custom-html.component.ts rename to packages/common/custom-html/src/custom-html.component.ts diff --git a/packages/common/src/lib/custom-html/custom-html.module.ts b/packages/common/custom-html/src/custom-html.module.ts similarity index 100% rename from packages/common/src/lib/custom-html/custom-html.module.ts rename to packages/common/custom-html/src/custom-html.module.ts diff --git a/packages/common/src/lib/custom-html/custom-html.pipe.ts b/packages/common/custom-html/src/custom-html.pipe.ts similarity index 100% rename from packages/common/src/lib/custom-html/custom-html.pipe.ts rename to packages/common/custom-html/src/custom-html.pipe.ts diff --git a/packages/common/src/lib/custom-html/index.ts b/packages/common/custom-html/src/public_api.ts similarity index 88% rename from packages/common/src/lib/custom-html/index.ts rename to packages/common/custom-html/src/public_api.ts index 434777eb4a..d82cafbea1 100644 --- a/packages/common/src/lib/custom-html/index.ts +++ b/packages/common/custom-html/src/public_api.ts @@ -1,6 +1,7 @@ import { CustomHtmlComponent } from './custom-html.component'; import { SanitizeHtmlPipe } from './custom-html.pipe'; +export * from './custom-html.module'; export * from './custom-html.component'; export * from './custom-html.pipe'; diff --git a/packages/common/dom/index.ts b/packages/common/dom/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/dom/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/dom/ng-package.json b/packages/common/dom/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/dom/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/dom/dom.interfaces.ts b/packages/common/dom/src/dom.interfaces.ts similarity index 100% rename from packages/common/src/lib/dom/dom.interfaces.ts rename to packages/common/dom/src/dom.interfaces.ts diff --git a/packages/common/src/lib/dom/dom.module.ts b/packages/common/dom/src/dom.module.ts similarity index 100% rename from packages/common/src/lib/dom/dom.module.ts rename to packages/common/dom/src/dom.module.ts diff --git a/packages/common/src/lib/dom/dom.service.ts b/packages/common/dom/src/dom.service.ts similarity index 100% rename from packages/common/src/lib/dom/dom.service.ts rename to packages/common/dom/src/dom.service.ts diff --git a/packages/common/src/lib/dom/index.ts b/packages/common/dom/src/public_api.ts similarity index 68% rename from packages/common/src/lib/dom/index.ts rename to packages/common/dom/src/public_api.ts index 2387dbb5cb..0f7520cb16 100644 --- a/packages/common/src/lib/dom/index.ts +++ b/packages/common/dom/src/public_api.ts @@ -1,2 +1,3 @@ +export * from './dom.module'; export * from './dom.service'; export * from './dom.interfaces'; diff --git a/packages/common/drag-drop/index.ts b/packages/common/drag-drop/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/drag-drop/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/drag-drop/ng-package.json b/packages/common/drag-drop/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/drag-drop/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/drag-drop/drag-drop.directive.ts b/packages/common/drag-drop/src/drag-drop.directive.ts similarity index 100% rename from packages/common/src/lib/drag-drop/drag-drop.directive.ts rename to packages/common/drag-drop/src/drag-drop.directive.ts diff --git a/packages/common/src/lib/drag-drop/drag-drop.module.ts b/packages/common/drag-drop/src/drag-drop.module.ts similarity index 100% rename from packages/common/src/lib/drag-drop/drag-drop.module.ts rename to packages/common/drag-drop/src/drag-drop.module.ts diff --git a/packages/common/src/lib/drag-drop/index.ts b/packages/common/drag-drop/src/public_api.ts similarity index 52% rename from packages/common/src/lib/drag-drop/index.ts rename to packages/common/drag-drop/src/public_api.ts index a8908e1b75..cc48ad5a0e 100644 --- a/packages/common/src/lib/drag-drop/index.ts +++ b/packages/common/drag-drop/src/public_api.ts @@ -1 +1,2 @@ +export * from './drag-drop.module'; export * from './drag-drop.directive'; diff --git a/packages/common/dynamic-component/index.ts b/packages/common/dynamic-component/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/dynamic-component/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/dynamic-component/ng-package.json b/packages/common/dynamic-component/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/dynamic-component/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/dynamic-component/dynamic-component.module.ts b/packages/common/dynamic-component/src/dynamic-component.module.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/dynamic-component.module.ts rename to packages/common/dynamic-component/src/dynamic-component.module.ts diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.html b/packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.html similarity index 100% rename from packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.html rename to packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.html diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.scss b/packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.scss similarity index 100% rename from packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.scss rename to packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.scss diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts b/packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.component.ts rename to packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.component.ts diff --git a/packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts b/packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.module.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/dynamic-outlet/dynamic-outlet.module.ts rename to packages/common/dynamic-component/src/dynamic-outlet/dynamic-outlet.module.ts diff --git a/packages/common/dynamic-component/src/public_api.ts b/packages/common/dynamic-component/src/public_api.ts new file mode 100644 index 0000000000..40d5dca4ee --- /dev/null +++ b/packages/common/dynamic-component/src/public_api.ts @@ -0,0 +1,4 @@ +export * from './shared'; +export * from './dynamic-component.module'; +export * from './dynamic-outlet/dynamic-outlet.component'; +export * from './dynamic-outlet/dynamic-outlet.module'; diff --git a/packages/common/src/lib/dynamic-component/shared/dynamic-component.interfaces.ts b/packages/common/dynamic-component/src/shared/dynamic-component.interfaces.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/shared/dynamic-component.interfaces.ts rename to packages/common/dynamic-component/src/shared/dynamic-component.interfaces.ts diff --git a/packages/common/src/lib/dynamic-component/shared/dynamic-component.service.ts b/packages/common/dynamic-component/src/shared/dynamic-component.service.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/shared/dynamic-component.service.ts rename to packages/common/dynamic-component/src/shared/dynamic-component.service.ts diff --git a/packages/common/src/lib/dynamic-component/shared/dynamic-component.ts b/packages/common/dynamic-component/src/shared/dynamic-component.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/shared/dynamic-component.ts rename to packages/common/dynamic-component/src/shared/dynamic-component.ts diff --git a/packages/common/src/lib/dynamic-component/shared/index.ts b/packages/common/dynamic-component/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/dynamic-component/shared/index.ts rename to packages/common/dynamic-component/src/shared/index.ts diff --git a/packages/common/entity/index.ts b/packages/common/entity/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/entity/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/entity/ng-package.json b/packages/common/entity/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/entity/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.component.html b/packages/common/entity/src/entity-selector/entity-selector.component.html similarity index 100% rename from packages/common/src/lib/entity/entity-selector/entity-selector.component.html rename to packages/common/entity/src/entity-selector/entity-selector.component.html diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.component.scss b/packages/common/entity/src/entity-selector/entity-selector.component.scss similarity index 100% rename from packages/common/src/lib/entity/entity-selector/entity-selector.component.scss rename to packages/common/entity/src/entity-selector/entity-selector.component.scss diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.component.ts b/packages/common/entity/src/entity-selector/entity-selector.component.ts similarity index 100% rename from packages/common/src/lib/entity/entity-selector/entity-selector.component.ts rename to packages/common/entity/src/entity-selector/entity-selector.component.ts diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.module.ts b/packages/common/entity/src/entity-selector/entity-selector.module.ts similarity index 100% rename from packages/common/src/lib/entity/entity-selector/entity-selector.module.ts rename to packages/common/entity/src/entity-selector/entity-selector.module.ts diff --git a/packages/common/src/lib/entity/entity-selector/entity-selector.theming.scss b/packages/common/entity/src/entity-selector/entity-selector.theming.scss similarity index 100% rename from packages/common/src/lib/entity/entity-selector/entity-selector.theming.scss rename to packages/common/entity/src/entity-selector/entity-selector.theming.scss diff --git a/packages/common/entity/src/entity-selector/index.ts b/packages/common/entity/src/entity-selector/index.ts new file mode 100644 index 0000000000..6fde127033 --- /dev/null +++ b/packages/common/entity/src/entity-selector/index.ts @@ -0,0 +1,2 @@ +export * from './entity-selector.module'; +export * from './entity-selector.component'; diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.html b/packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.html similarity index 100% rename from packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.html rename to packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.html diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.scss b/packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.scss similarity index 100% rename from packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.scss rename to packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.scss diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts b/packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.ts similarity index 100% rename from packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.component.ts rename to packages/common/entity/src/entity-table-paginator/entity-table-paginator.component.ts diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.interface.ts b/packages/common/entity/src/entity-table-paginator/entity-table-paginator.interface.ts similarity index 100% rename from packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.interface.ts rename to packages/common/entity/src/entity-table-paginator/entity-table-paginator.interface.ts diff --git a/packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts b/packages/common/entity/src/entity-table-paginator/entity-table-paginator.module.ts similarity index 100% rename from packages/common/src/lib/entity/entity-table-paginator/entity-table-paginator.module.ts rename to packages/common/entity/src/entity-table-paginator/entity-table-paginator.module.ts diff --git a/packages/common/src/lib/entity/entity-table-paginator/index.ts b/packages/common/entity/src/entity-table-paginator/index.ts similarity index 67% rename from packages/common/src/lib/entity/entity-table-paginator/index.ts rename to packages/common/entity/src/entity-table-paginator/index.ts index 25df1f591d..b4bb3d2a46 100644 --- a/packages/common/src/lib/entity/entity-table-paginator/index.ts +++ b/packages/common/entity/src/entity-table-paginator/index.ts @@ -1,2 +1,3 @@ +export * from './entity-table-paginator.module'; export * from './entity-table-paginator.component'; export * from './entity-table-paginator.interface'; diff --git a/packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts b/packages/common/entity/src/entity-table/entity-table-row.directive.ts similarity index 100% rename from packages/common/src/lib/entity/entity-table/entity-table-row.directive.ts rename to packages/common/entity/src/entity-table/entity-table-row.directive.ts diff --git a/packages/common/src/lib/entity/entity-table/entity-table.component.html b/packages/common/entity/src/entity-table/entity-table.component.html similarity index 100% rename from packages/common/src/lib/entity/entity-table/entity-table.component.html rename to packages/common/entity/src/entity-table/entity-table.component.html diff --git a/packages/common/src/lib/entity/entity-table/entity-table.component.scss b/packages/common/entity/src/entity-table/entity-table.component.scss similarity index 100% rename from packages/common/src/lib/entity/entity-table/entity-table.component.scss rename to packages/common/entity/src/entity-table/entity-table.component.scss diff --git a/packages/common/src/lib/entity/entity-table/entity-table.component.ts b/packages/common/entity/src/entity-table/entity-table.component.ts similarity index 98% rename from packages/common/src/lib/entity/entity-table/entity-table.component.ts rename to packages/common/entity/src/entity-table/entity-table.component.ts index 6bb952f3f6..4867871dd0 100644 --- a/packages/common/src/lib/entity/entity-table/entity-table.component.ts +++ b/packages/common/entity/src/entity-table/entity-table.component.ts @@ -48,6 +48,9 @@ import { MatSortModule } from '@angular/material/sort'; import { MatTableDataSource, MatTableModule } from '@angular/material/table'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { SanitizeHtmlPipe } from '@igo2/common/custom-html'; +import { ImageErrorDirective, SecureImagePipe } from '@igo2/common/image'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import { IgoLanguageModule } from '@igo2/core/language'; import { StringUtils } from '@igo2/utils'; @@ -55,10 +58,6 @@ 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 { diff --git a/packages/common/src/lib/entity/entity-table/entity-table.module.ts b/packages/common/entity/src/entity-table/entity-table.module.ts similarity index 100% rename from packages/common/src/lib/entity/entity-table/entity-table.module.ts rename to packages/common/entity/src/entity-table/entity-table.module.ts diff --git a/packages/common/src/lib/entity/entity-table/entity-table.theming.scss b/packages/common/entity/src/entity-table/entity-table.theming.scss similarity index 100% rename from packages/common/src/lib/entity/entity-table/entity-table.theming.scss rename to packages/common/entity/src/entity-table/entity-table.theming.scss diff --git a/packages/common/entity/src/entity-table/index.ts b/packages/common/entity/src/entity-table/index.ts new file mode 100644 index 0000000000..e350079ecf --- /dev/null +++ b/packages/common/entity/src/entity-table/index.ts @@ -0,0 +1,2 @@ +export * from './entity-table.module'; +export * from './entity-table.component'; diff --git a/packages/common/entity/src/entity.module.ts b/packages/common/entity/src/entity.module.ts new file mode 100644 index 0000000000..98f8bf7b1f --- /dev/null +++ b/packages/common/entity/src/entity.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; + +import { EntitySelectorComponent } from './entity-selector'; +import { EntityTableComponent } from './entity-table'; +import { EntityTablePaginatorComponent } from './entity-table-paginator'; + +export const ENTITY_DIRECTIVES = [ + EntitySelectorComponent, + EntityTableComponent, + EntityTablePaginatorComponent +] as const; + +/** + * @deprecated import the components directly or ENTITY_DIRECTIVES for every components/directives + */ +@NgModule({ + imports: [...ENTITY_DIRECTIVES], + exports: [...ENTITY_DIRECTIVES] +}) +export class IgoEntityModule {} diff --git a/packages/common/src/lib/entity/entity.theming.scss b/packages/common/entity/src/entity.theming.scss similarity index 100% rename from packages/common/src/lib/entity/entity.theming.scss rename to packages/common/entity/src/entity.theming.scss diff --git a/packages/common/entity/src/public_api.ts b/packages/common/entity/src/public_api.ts new file mode 100644 index 0000000000..e84bd2bda3 --- /dev/null +++ b/packages/common/entity/src/public_api.ts @@ -0,0 +1,5 @@ +export * from './shared'; +export * from './entity.module'; +export * from './entity-selector'; +export * from './entity-table'; +export * from './entity-table-paginator'; diff --git a/packages/common/src/lib/entity/shared/entity.enums.ts b/packages/common/entity/src/shared/entity.enums.ts similarity index 100% rename from packages/common/src/lib/entity/shared/entity.enums.ts rename to packages/common/entity/src/shared/entity.enums.ts diff --git a/packages/common/src/lib/entity/shared/entity.interfaces.ts b/packages/common/entity/src/shared/entity.interfaces.ts similarity index 100% rename from packages/common/src/lib/entity/shared/entity.interfaces.ts rename to packages/common/entity/src/shared/entity.interfaces.ts diff --git a/packages/common/src/lib/entity/shared/entity.utils.ts b/packages/common/entity/src/shared/entity.utils.ts similarity index 100% rename from packages/common/src/lib/entity/shared/entity.utils.ts rename to packages/common/entity/src/shared/entity.utils.ts diff --git a/packages/common/src/lib/entity/shared/index.ts b/packages/common/entity/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/entity/shared/index.ts rename to packages/common/entity/src/shared/index.ts diff --git a/packages/common/src/lib/entity/shared/state.ts b/packages/common/entity/src/shared/state.ts similarity index 100% rename from packages/common/src/lib/entity/shared/state.ts rename to packages/common/entity/src/shared/state.ts diff --git a/packages/common/src/lib/entity/shared/store.md b/packages/common/entity/src/shared/store.md similarity index 100% rename from packages/common/src/lib/entity/shared/store.md rename to packages/common/entity/src/shared/store.md diff --git a/packages/common/src/lib/entity/shared/store.ts b/packages/common/entity/src/shared/store.ts similarity index 100% rename from packages/common/src/lib/entity/shared/store.ts rename to packages/common/entity/src/shared/store.ts diff --git a/packages/common/src/lib/entity/shared/strategies/filter-custom-function.ts b/packages/common/entity/src/shared/strategies/filter-custom-function.ts similarity index 100% rename from packages/common/src/lib/entity/shared/strategies/filter-custom-function.ts rename to packages/common/entity/src/shared/strategies/filter-custom-function.ts diff --git a/packages/common/src/lib/entity/shared/strategies/filter-selection.ts b/packages/common/entity/src/shared/strategies/filter-selection.ts similarity index 100% rename from packages/common/src/lib/entity/shared/strategies/filter-selection.ts rename to packages/common/entity/src/shared/strategies/filter-selection.ts diff --git a/packages/common/src/lib/entity/shared/strategies/index.ts b/packages/common/entity/src/shared/strategies/index.ts similarity index 100% rename from packages/common/src/lib/entity/shared/strategies/index.ts rename to packages/common/entity/src/shared/strategies/index.ts diff --git a/packages/common/src/lib/entity/shared/strategies/strategy.ts b/packages/common/entity/src/shared/strategies/strategy.ts similarity index 100% rename from packages/common/src/lib/entity/shared/strategies/strategy.ts rename to packages/common/entity/src/shared/strategies/strategy.ts diff --git a/packages/common/src/lib/entity/shared/transaction.ts b/packages/common/entity/src/shared/transaction.ts similarity index 100% rename from packages/common/src/lib/entity/shared/transaction.ts rename to packages/common/entity/src/shared/transaction.ts diff --git a/packages/common/src/lib/entity/shared/view.ts b/packages/common/entity/src/shared/view.ts similarity index 100% rename from packages/common/src/lib/entity/shared/view.ts rename to packages/common/entity/src/shared/view.ts diff --git a/packages/common/src/lib/entity/shared/watcher.ts b/packages/common/entity/src/shared/watcher.ts similarity index 100% rename from packages/common/src/lib/entity/shared/watcher.ts rename to packages/common/entity/src/shared/watcher.ts diff --git a/packages/common/environment/index.ts b/packages/common/environment/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/environment/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/environment/ng-package.json b/packages/common/environment/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/environment/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/environment/environment.interface.ts b/packages/common/environment/src/environment.interface.ts similarity index 100% rename from packages/common/src/lib/environment/environment.interface.ts rename to packages/common/environment/src/environment.interface.ts diff --git a/packages/common/src/lib/environment/index.ts b/packages/common/environment/src/public_api.ts similarity index 100% rename from packages/common/src/lib/environment/index.ts rename to packages/common/environment/src/public_api.ts diff --git a/packages/common/flexible/index.ts b/packages/common/flexible/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/flexible/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/flexible/ng-package.json b/packages/common/flexible/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/flexible/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/flexible/flexible.component.html b/packages/common/flexible/src/flexible.component.html similarity index 100% rename from packages/common/src/lib/flexible/flexible.component.html rename to packages/common/flexible/src/flexible.component.html diff --git a/packages/common/src/lib/flexible/flexible.component.scss b/packages/common/flexible/src/flexible.component.scss similarity index 92% rename from packages/common/src/lib/flexible/flexible.component.scss rename to packages/common/flexible/src/flexible.component.scss index 10bbda1478..0061d9e727 100644 --- a/packages/common/src/lib/flexible/flexible.component.scss +++ b/packages/common/flexible/src/flexible.component.scss @@ -1,4 +1,4 @@ -@import '../../../../core/src/style/partial/core.variables'; +@import '../../../core/src/style/partial/core.variables'; :host { display: flex; diff --git a/packages/common/src/lib/flexible/flexible.component.spec.ts b/packages/common/flexible/src/flexible.component.spec.ts similarity index 100% rename from packages/common/src/lib/flexible/flexible.component.spec.ts rename to packages/common/flexible/src/flexible.component.spec.ts diff --git a/packages/common/src/lib/flexible/flexible.component.ts b/packages/common/flexible/src/flexible.component.ts similarity index 100% rename from packages/common/src/lib/flexible/flexible.component.ts rename to packages/common/flexible/src/flexible.component.ts diff --git a/packages/common/src/lib/flexible/flexible.module.ts b/packages/common/flexible/src/flexible.module.ts similarity index 100% rename from packages/common/src/lib/flexible/flexible.module.ts rename to packages/common/flexible/src/flexible.module.ts diff --git a/packages/common/src/lib/flexible/flexible.type.ts b/packages/common/flexible/src/flexible.type.ts similarity index 100% rename from packages/common/src/lib/flexible/flexible.type.ts rename to packages/common/flexible/src/flexible.type.ts diff --git a/packages/common/src/lib/flexible/index.ts b/packages/common/flexible/src/public_api.ts similarity index 66% rename from packages/common/src/lib/flexible/index.ts rename to packages/common/flexible/src/public_api.ts index 8ad8cbb28c..0a8290073d 100644 --- a/packages/common/src/lib/flexible/index.ts +++ b/packages/common/flexible/src/public_api.ts @@ -1,2 +1,3 @@ +export * from './flexible.module'; export * from './flexible.type'; export * from './flexible.component'; diff --git a/packages/common/form/index.ts b/packages/common/form/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/form/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/form/ng-package.json b/packages/common/form/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/form/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/form-dialog/form-dialog.component.html b/packages/common/form/src/form-dialog/form-dialog.component.html similarity index 100% rename from packages/common/src/lib/form-dialog/form-dialog.component.html rename to packages/common/form/src/form-dialog/form-dialog.component.html diff --git a/packages/common/src/lib/form-dialog/form-dialog.component.scss b/packages/common/form/src/form-dialog/form-dialog.component.scss similarity index 100% rename from packages/common/src/lib/form-dialog/form-dialog.component.scss rename to packages/common/form/src/form-dialog/form-dialog.component.scss diff --git a/packages/common/src/lib/form-dialog/form-dialog.component.ts b/packages/common/form/src/form-dialog/form-dialog.component.ts similarity index 87% rename from packages/common/src/lib/form-dialog/form-dialog.component.ts rename to packages/common/form/src/form-dialog/form-dialog.component.ts index 4b4c6ed2f1..a57ea6e5ba 100644 --- a/packages/common/src/lib/form-dialog/form-dialog.component.ts +++ b/packages/common/form/src/form-dialog/form-dialog.component.ts @@ -8,22 +8,22 @@ import { MatDialogTitle } from '@angular/material/dialog'; +import { CustomHtmlComponent } from '@igo2/common/custom-html'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; 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 { FormComponent } from '../form'; +import { FormFieldComponent } from '../form-field'; +import { FormGroupComponent } from '../form-group'; import { Form, FormField, FormFieldGroup, - FormFieldInputs -} from '../form/shared/form.interfaces'; -import { FormService } from '../form/shared/form.service'; + FormFieldInputs, + FormService +} from '../shared'; import { FormDialogData } from './form-dialog.interface'; @Component({ diff --git a/packages/common/src/lib/form-dialog/form-dialog.interface.ts b/packages/common/form/src/form-dialog/form-dialog.interface.ts similarity index 85% rename from packages/common/src/lib/form-dialog/form-dialog.interface.ts rename to packages/common/form/src/form-dialog/form-dialog.interface.ts index cbdbb1e099..bf510d4e46 100644 --- a/packages/common/src/lib/form-dialog/form-dialog.interface.ts +++ b/packages/common/form/src/form-dialog/form-dialog.interface.ts @@ -2,10 +2,7 @@ import { MatDialogConfig } from '@angular/material/dialog'; import { BehaviorSubject } from 'rxjs'; -import { - FormFieldConfig, - FormGroupsConfig -} from '../form/shared/form.interfaces'; +import { FormFieldConfig, FormGroupsConfig } from '../shared/form.interfaces'; export interface FormDialogFormConfig { formFieldConfigs?: FormFieldConfig[]; diff --git a/packages/common/src/lib/form-dialog/form-dialog.module.ts b/packages/common/form/src/form-dialog/form-dialog.module.ts similarity index 100% rename from packages/common/src/lib/form-dialog/form-dialog.module.ts rename to packages/common/form/src/form-dialog/form-dialog.module.ts diff --git a/packages/common/src/lib/form-dialog/form-dialog.service.ts b/packages/common/form/src/form-dialog/form-dialog.service.ts similarity index 100% rename from packages/common/src/lib/form-dialog/form-dialog.service.ts rename to packages/common/form/src/form-dialog/form-dialog.service.ts diff --git a/packages/common/src/lib/form-dialog/index.ts b/packages/common/form/src/form-dialog/index.ts similarity index 76% rename from packages/common/src/lib/form-dialog/index.ts rename to packages/common/form/src/form-dialog/index.ts index d6a7b6daa2..a7eed13031 100644 --- a/packages/common/src/lib/form-dialog/index.ts +++ b/packages/common/form/src/form-dialog/index.ts @@ -1,3 +1,4 @@ +export * from './form-dialog.module'; export * from './form-dialog.component'; export * from './form-dialog.interface'; export * from './form-dialog.service'; diff --git a/packages/common/src/lib/form/form-field/form-field-select.component.html b/packages/common/form/src/form-field/form-field-select.component.html similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-select.component.html rename to packages/common/form/src/form-field/form-field-select.component.html diff --git a/packages/common/src/lib/form/form-field/form-field-select.component.ts b/packages/common/form/src/form-field/form-field-select.component.ts similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-select.component.ts rename to packages/common/form/src/form-field/form-field-select.component.ts diff --git a/packages/common/src/lib/form/form-field/form-field-text.component.html b/packages/common/form/src/form-field/form-field-text.component.html similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-text.component.html rename to packages/common/form/src/form-field/form-field-text.component.html diff --git a/packages/common/src/lib/form/form-field/form-field-text.component.ts b/packages/common/form/src/form-field/form-field-text.component.ts similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-text.component.ts rename to packages/common/form/src/form-field/form-field-text.component.ts diff --git a/packages/common/src/lib/form/form-field/form-field-textarea.component.html b/packages/common/form/src/form-field/form-field-textarea.component.html similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-textarea.component.html rename to packages/common/form/src/form-field/form-field-textarea.component.html diff --git a/packages/common/src/lib/form/form-field/form-field-textarea.component.ts b/packages/common/form/src/form-field/form-field-textarea.component.ts similarity index 100% rename from packages/common/src/lib/form/form-field/form-field-textarea.component.ts rename to packages/common/form/src/form-field/form-field-textarea.component.ts diff --git a/packages/common/src/lib/form/form-field/form-field.component.html b/packages/common/form/src/form-field/form-field.component.html similarity index 100% rename from packages/common/src/lib/form/form-field/form-field.component.html rename to packages/common/form/src/form-field/form-field.component.html diff --git a/packages/common/src/lib/form/form-field/form-field.component.scss b/packages/common/form/src/form-field/form-field.component.scss similarity index 100% rename from packages/common/src/lib/form/form-field/form-field.component.scss rename to packages/common/form/src/form-field/form-field.component.scss diff --git a/packages/common/src/lib/form/form-field/form-field.component.ts b/packages/common/form/src/form-field/form-field.component.ts similarity index 95% rename from packages/common/src/lib/form/form-field/form-field.component.ts rename to packages/common/form/src/form-field/form-field.component.ts index cf340ea577..10023d9380 100644 --- a/packages/common/src/lib/form/form-field/form-field.component.ts +++ b/packages/common/form/src/form-field/form-field.component.ts @@ -1,7 +1,8 @@ import { NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { DynamicOutletComponent } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.component'; +import { DynamicOutletComponent } from '@igo2/common/dynamic-component'; + import { getDefaultErrorMessages } from '../shared'; import { FormFieldService } from '../shared/form-field.service'; import { diff --git a/packages/common/src/lib/form/form-field/index.ts b/packages/common/form/src/form-field/form-field.directive.ts similarity index 70% rename from packages/common/src/lib/form/form-field/index.ts rename to packages/common/form/src/form-field/form-field.directive.ts index 335b995feb..efb131f787 100644 --- a/packages/common/src/lib/form/form-field/index.ts +++ b/packages/common/form/src/form-field/form-field.directive.ts @@ -3,11 +3,6 @@ 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, diff --git a/packages/common/src/lib/form/form-field/form-field.module.ts b/packages/common/form/src/form-field/form-field.module.ts similarity index 81% rename from packages/common/src/lib/form/form-field/form-field.module.ts rename to packages/common/form/src/form-field/form-field.module.ts index d875b1c736..ac197643a2 100644 --- a/packages/common/src/lib/form/form-field/form-field.module.ts +++ b/packages/common/form/src/form-field/form-field.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; -import { FORM_FIELD_DIRECTIVES } from '.'; +import { FORM_FIELD_DIRECTIVES } from './form-field.directive'; /** * @deprecated import the components directly or FORM_FIELD_DIRECTIVES for every components/directives diff --git a/packages/common/form/src/form-field/index.ts b/packages/common/form/src/form-field/index.ts new file mode 100644 index 0000000000..51b207c96d --- /dev/null +++ b/packages/common/form/src/form-field/index.ts @@ -0,0 +1,6 @@ +export * from './form-field.module'; +export * from './form-field.component'; +export * from './form-field-text.component'; +export * from './form-field-select.component'; +export * from './form-field-textarea.component'; +export * from './form-field.directive'; diff --git a/packages/common/src/lib/form/form-group/form-group.component.html b/packages/common/form/src/form-group/form-group.component.html similarity index 100% rename from packages/common/src/lib/form/form-group/form-group.component.html rename to packages/common/form/src/form-group/form-group.component.html diff --git a/packages/common/src/lib/form/form-group/form-group.component.scss b/packages/common/form/src/form-group/form-group.component.scss similarity index 100% rename from packages/common/src/lib/form/form-group/form-group.component.scss rename to packages/common/form/src/form-group/form-group.component.scss diff --git a/packages/common/src/lib/form/form-group/form-group.component.ts b/packages/common/form/src/form-group/form-group.component.ts similarity index 100% rename from packages/common/src/lib/form/form-group/form-group.component.ts rename to packages/common/form/src/form-group/form-group.component.ts diff --git a/packages/common/src/lib/form/form-group/form-group.module.ts b/packages/common/form/src/form-group/form-group.module.ts similarity index 100% rename from packages/common/src/lib/form/form-group/form-group.module.ts rename to packages/common/form/src/form-group/form-group.module.ts diff --git a/packages/common/form/src/form-group/index.ts b/packages/common/form/src/form-group/index.ts new file mode 100644 index 0000000000..3b5ef78eeb --- /dev/null +++ b/packages/common/form/src/form-group/index.ts @@ -0,0 +1,2 @@ +export * from './form-group.module'; +export * from './form-group.component'; diff --git a/packages/common/src/lib/form/form.module.ts b/packages/common/form/src/form.module.ts similarity index 50% rename from packages/common/src/lib/form/form.module.ts rename to packages/common/form/src/form.module.ts index 45a75d7c10..21f9af80f2 100644 --- a/packages/common/src/lib/form/form.module.ts +++ b/packages/common/form/src/form.module.ts @@ -1,6 +1,14 @@ import { NgModule } from '@angular/core'; -import { FORM_DIRECTIVES } from '.'; +import { FormComponent } from './form'; +import { FORM_FIELD_DIRECTIVES } from './form-field'; +import { FormGroupComponent } from './form-group'; + +export const FORM_DIRECTIVES = [ + ...FORM_FIELD_DIRECTIVES, + FormGroupComponent, + FormComponent +] as const; /** * @deprecated import the components directly or FORM_DIRECTIVES for every components/directives diff --git a/packages/common/src/lib/form/form/form.component.html b/packages/common/form/src/form/form.component.html similarity index 100% rename from packages/common/src/lib/form/form/form.component.html rename to packages/common/form/src/form/form.component.html diff --git a/packages/common/src/lib/form/form/form.component.scss b/packages/common/form/src/form/form.component.scss similarity index 100% rename from packages/common/src/lib/form/form/form.component.scss rename to packages/common/form/src/form/form.component.scss diff --git a/packages/common/src/lib/form/form/form.component.ts b/packages/common/form/src/form/form.component.ts similarity index 100% rename from packages/common/src/lib/form/form/form.component.ts rename to packages/common/form/src/form/form.component.ts diff --git a/packages/common/src/lib/form/form/form.module.ts b/packages/common/form/src/form/form.module.ts similarity index 100% rename from packages/common/src/lib/form/form/form.module.ts rename to packages/common/form/src/form/form.module.ts diff --git a/packages/common/form/src/form/index.ts b/packages/common/form/src/form/index.ts new file mode 100644 index 0000000000..bdec1a73d6 --- /dev/null +++ b/packages/common/form/src/form/index.ts @@ -0,0 +1,2 @@ +export * from './form.module'; +export * from './form.component'; diff --git a/packages/common/form/src/index.ts b/packages/common/form/src/index.ts new file mode 100644 index 0000000000..4aaf8f92ed --- /dev/null +++ b/packages/common/form/src/index.ts @@ -0,0 +1 @@ +export * from './public_api'; diff --git a/packages/common/form/src/public_api.ts b/packages/common/form/src/public_api.ts new file mode 100644 index 0000000000..86e27be42b --- /dev/null +++ b/packages/common/form/src/public_api.ts @@ -0,0 +1,6 @@ +export * from './form.module'; +export * from './shared'; +export * from './form-group'; +export * from './form-field'; +export * from './form'; +export * from './form-dialog'; diff --git a/packages/common/src/lib/form/shared/form-field-component.ts b/packages/common/form/src/shared/form-field-component.ts similarity index 100% rename from packages/common/src/lib/form/shared/form-field-component.ts rename to packages/common/form/src/shared/form-field-component.ts diff --git a/packages/common/src/lib/form/shared/form-field.service.ts b/packages/common/form/src/shared/form-field.service.ts similarity index 100% rename from packages/common/src/lib/form/shared/form-field.service.ts rename to packages/common/form/src/shared/form-field.service.ts diff --git a/packages/common/src/lib/form/shared/form.interfaces.ts b/packages/common/form/src/shared/form.interfaces.ts similarity index 100% rename from packages/common/src/lib/form/shared/form.interfaces.ts rename to packages/common/form/src/shared/form.interfaces.ts diff --git a/packages/common/src/lib/form/shared/form.service.ts b/packages/common/form/src/shared/form.service.ts similarity index 100% rename from packages/common/src/lib/form/shared/form.service.ts rename to packages/common/form/src/shared/form.service.ts diff --git a/packages/common/src/lib/form/shared/form.utils.ts b/packages/common/form/src/shared/form.utils.ts similarity index 100% rename from packages/common/src/lib/form/shared/form.utils.ts rename to packages/common/form/src/shared/form.utils.ts diff --git a/packages/common/src/lib/form/shared/index.ts b/packages/common/form/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/form/shared/index.ts rename to packages/common/form/src/shared/index.ts diff --git a/packages/common/home-button/index.ts b/packages/common/home-button/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/home-button/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/home-button/ng-package.json b/packages/common/home-button/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/home-button/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/home-button/home-button.component.html b/packages/common/home-button/src/home-button.component.html similarity index 100% rename from packages/common/src/lib/home-button/home-button.component.html rename to packages/common/home-button/src/home-button.component.html diff --git a/packages/common/src/lib/home-button/home-button.component.scss b/packages/common/home-button/src/home-button.component.scss similarity index 100% rename from packages/common/src/lib/home-button/home-button.component.scss rename to packages/common/home-button/src/home-button.component.scss diff --git a/packages/common/src/lib/home-button/home-button.component.ts b/packages/common/home-button/src/home-button.component.ts similarity index 100% rename from packages/common/src/lib/home-button/home-button.component.ts rename to packages/common/home-button/src/home-button.component.ts diff --git a/packages/common/src/lib/home-button/home-button.module.ts b/packages/common/home-button/src/home-button.module.ts similarity index 100% rename from packages/common/src/lib/home-button/home-button.module.ts rename to packages/common/home-button/src/home-button.module.ts diff --git a/packages/common/src/lib/home-button/home-button.theming.scss b/packages/common/home-button/src/home-button.theming.scss similarity index 100% rename from packages/common/src/lib/home-button/home-button.theming.scss rename to packages/common/home-button/src/home-button.theming.scss diff --git a/packages/common/src/lib/home-button/index.ts b/packages/common/home-button/src/public_api.ts similarity index 51% rename from packages/common/src/lib/home-button/index.ts rename to packages/common/home-button/src/public_api.ts index 2c0a11ffdb..aa5042da4a 100644 --- a/packages/common/src/lib/home-button/index.ts +++ b/packages/common/home-button/src/public_api.ts @@ -1 +1,2 @@ +export * from './home-button.module'; export * from './home-button.component'; diff --git a/packages/common/icon/index.ts b/packages/common/icon/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/icon/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/icon/ng-package.json b/packages/common/icon/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/icon/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/icons/icon.provider.ts b/packages/common/icon/src/icon.provider.ts similarity index 100% rename from packages/common/src/lib/icons/icon.provider.ts rename to packages/common/icon/src/icon.provider.ts diff --git a/packages/common/src/lib/icons/icon/icon.component.html b/packages/common/icon/src/icon/icon.component.html similarity index 100% rename from packages/common/src/lib/icons/icon/icon.component.html rename to packages/common/icon/src/icon/icon.component.html diff --git a/packages/common/src/lib/icons/icon/icon.component.spec.ts b/packages/common/icon/src/icon/icon.component.spec.ts similarity index 100% rename from packages/common/src/lib/icons/icon/icon.component.spec.ts rename to packages/common/icon/src/icon/icon.component.spec.ts diff --git a/packages/common/src/lib/icons/icon/icon.component.ts b/packages/common/icon/src/icon/icon.component.ts similarity index 100% rename from packages/common/src/lib/icons/icon/icon.component.ts rename to packages/common/icon/src/icon/icon.component.ts diff --git a/packages/common/src/lib/icons/index.ts b/packages/common/icon/src/public_api.ts similarity index 100% rename from packages/common/src/lib/icons/index.ts rename to packages/common/icon/src/public_api.ts diff --git a/packages/common/src/lib/icons/shared/icon.interface.ts b/packages/common/icon/src/shared/icon.interface.ts similarity index 100% rename from packages/common/src/lib/icons/shared/icon.interface.ts rename to packages/common/icon/src/shared/icon.interface.ts diff --git a/packages/common/src/lib/icons/shared/icon.service.spec.ts b/packages/common/icon/src/shared/icon.service.spec.ts similarity index 100% rename from packages/common/src/lib/icons/shared/icon.service.spec.ts rename to packages/common/icon/src/shared/icon.service.spec.ts diff --git a/packages/common/src/lib/icons/shared/icon.service.ts b/packages/common/icon/src/shared/icon.service.ts similarity index 100% rename from packages/common/src/lib/icons/shared/icon.service.ts rename to packages/common/icon/src/shared/icon.service.ts diff --git a/packages/common/src/lib/icons/shared/icons.ts b/packages/common/icon/src/shared/icons.ts similarity index 100% rename from packages/common/src/lib/icons/shared/icons.ts rename to packages/common/icon/src/shared/icons.ts diff --git a/packages/common/src/lib/icons/shared/index.ts b/packages/common/icon/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/icons/shared/index.ts rename to packages/common/icon/src/shared/index.ts diff --git a/packages/common/image/index.ts b/packages/common/image/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/image/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/image/ng-package.json b/packages/common/image/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/image/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/image/image-error.directive.ts b/packages/common/image/src/image-error.directive.ts similarity index 100% rename from packages/common/src/lib/image/image-error.directive.ts rename to packages/common/image/src/image-error.directive.ts diff --git a/packages/common/src/lib/image/image.module.ts b/packages/common/image/src/image.module.ts similarity index 100% rename from packages/common/src/lib/image/image.module.ts rename to packages/common/image/src/image.module.ts diff --git a/packages/common/src/lib/image/index.ts b/packages/common/image/src/public_api.ts similarity index 89% rename from packages/common/src/lib/image/index.ts rename to packages/common/image/src/public_api.ts index 893c15263e..e1f0e274be 100644 --- a/packages/common/src/lib/image/index.ts +++ b/packages/common/image/src/public_api.ts @@ -1,6 +1,7 @@ import { ImageErrorDirective } from './image-error.directive'; import { SecureImagePipe } from './secure-image.pipe'; +export * from './image.module'; export * from './image-error.directive'; export * from './secure-image.pipe'; diff --git a/packages/common/src/lib/image/secure-image.pipe.ts b/packages/common/image/src/secure-image.pipe.ts similarity index 100% rename from packages/common/src/lib/image/secure-image.pipe.ts rename to packages/common/image/src/secure-image.pipe.ts diff --git a/packages/common/interactive-tour/index.ts b/packages/common/interactive-tour/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/interactive-tour/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/interactive-tour/ng-package.json b/packages/common/interactive-tour/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/interactive-tour/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.component.html b/packages/common/interactive-tour/src/interactive-tour.component.html similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.component.html rename to packages/common/interactive-tour/src/interactive-tour.component.html diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.component.scss b/packages/common/interactive-tour/src/interactive-tour.component.scss similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.component.scss rename to packages/common/interactive-tour/src/interactive-tour.component.scss diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.component.ts b/packages/common/interactive-tour/src/interactive-tour.component.ts similarity index 97% rename from packages/common/src/lib/interactive-tour/interactive-tour.component.ts rename to packages/common/interactive-tour/src/interactive-tour.component.ts index 0ace72ce86..07e611d965 100644 --- a/packages/common/src/lib/interactive-tour/interactive-tour.component.ts +++ b/packages/common/interactive-tour/src/interactive-tour.component.ts @@ -4,16 +4,16 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoLanguageModule } from '@igo2/core/language'; - -import { Observable, of } from 'rxjs'; - import { IconService, IgoIconComponent, PRESENTATION_PLAY_ICON -} from '../icons'; -import { ToolService } from '../tool/shared/tool.service'; +} from '@igo2/common/icon'; +import { ToolService } from '@igo2/common/tool'; +import { IgoLanguageModule } from '@igo2/core/language'; + +import { Observable, of } from 'rxjs'; + import { InteractiveTourService } from './interactive-tour.service'; @Component({ diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.interface.ts b/packages/common/interactive-tour/src/interactive-tour.interface.ts similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.interface.ts rename to packages/common/interactive-tour/src/interactive-tour.interface.ts diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.loader.ts b/packages/common/interactive-tour/src/interactive-tour.loader.ts similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.loader.ts rename to packages/common/interactive-tour/src/interactive-tour.loader.ts diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.module.ts b/packages/common/interactive-tour/src/interactive-tour.module.ts similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.module.ts rename to packages/common/interactive-tour/src/interactive-tour.module.ts diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.service.ts b/packages/common/interactive-tour/src/interactive-tour.service.ts similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.service.ts rename to packages/common/interactive-tour/src/interactive-tour.service.ts diff --git a/packages/common/src/lib/interactive-tour/interactive-tour.theming.scss b/packages/common/interactive-tour/src/interactive-tour.theming.scss similarity index 100% rename from packages/common/src/lib/interactive-tour/interactive-tour.theming.scss rename to packages/common/interactive-tour/src/interactive-tour.theming.scss diff --git a/packages/common/src/lib/interactive-tour/index.ts b/packages/common/interactive-tour/src/public_api.ts similarity index 80% rename from packages/common/src/lib/interactive-tour/index.ts rename to packages/common/interactive-tour/src/public_api.ts index f9d40dbbe1..3c89e8f924 100644 --- a/packages/common/src/lib/interactive-tour/index.ts +++ b/packages/common/interactive-tour/src/public_api.ts @@ -1,4 +1,5 @@ -export * from './interactive-tour.service'; +export * from './interactive-tour.module'; export * from './interactive-tour.component'; +export * from './interactive-tour.service'; export * from './interactive-tour.loader'; export * from './interactive-tour.interface'; diff --git a/packages/common/json-dialog/index.ts b/packages/common/json-dialog/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/json-dialog/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/json-dialog/ng-package.json b/packages/common/json-dialog/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/json-dialog/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/json-dialog/json-dialog.component.html b/packages/common/json-dialog/src/json-dialog.component.html similarity index 100% rename from packages/common/src/lib/json-dialog/json-dialog.component.html rename to packages/common/json-dialog/src/json-dialog.component.html diff --git a/packages/common/src/lib/json-dialog/json-dialog.component.ts b/packages/common/json-dialog/src/json-dialog.component.ts similarity index 100% rename from packages/common/src/lib/json-dialog/json-dialog.component.ts rename to packages/common/json-dialog/src/json-dialog.component.ts diff --git a/packages/common/src/lib/json-dialog/json-dialog.module.ts b/packages/common/json-dialog/src/json-dialog.module.ts similarity index 100% rename from packages/common/src/lib/json-dialog/json-dialog.module.ts rename to packages/common/json-dialog/src/json-dialog.module.ts diff --git a/packages/common/src/lib/json-dialog/json-dialog.service.ts b/packages/common/json-dialog/src/json-dialog.service.ts similarity index 100% rename from packages/common/src/lib/json-dialog/json-dialog.service.ts rename to packages/common/json-dialog/src/json-dialog.service.ts diff --git a/packages/common/src/lib/json-dialog/index.ts b/packages/common/json-dialog/src/public_api.ts similarity index 67% rename from packages/common/src/lib/json-dialog/index.ts rename to packages/common/json-dialog/src/public_api.ts index 0c71787613..016e90dba3 100644 --- a/packages/common/src/lib/json-dialog/index.ts +++ b/packages/common/json-dialog/src/public_api.ts @@ -1,2 +1,3 @@ +export * from './json-dialog.module'; export * from './json-dialog.component'; export * from './json-dialog.service'; diff --git a/packages/common/keyvalue/index.ts b/packages/common/keyvalue/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/keyvalue/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/keyvalue/ng-package.json b/packages/common/keyvalue/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/keyvalue/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/keyvalue/keyvalue.module.ts b/packages/common/keyvalue/src/keyvalue.module.ts similarity index 100% rename from packages/common/src/lib/keyvalue/keyvalue.module.ts rename to packages/common/keyvalue/src/keyvalue.module.ts diff --git a/packages/common/src/lib/keyvalue/keyvalue.pipe.spec.ts b/packages/common/keyvalue/src/keyvalue.pipe.spec.ts similarity index 100% rename from packages/common/src/lib/keyvalue/keyvalue.pipe.spec.ts rename to packages/common/keyvalue/src/keyvalue.pipe.spec.ts diff --git a/packages/common/src/lib/keyvalue/keyvalue.pipe.ts b/packages/common/keyvalue/src/keyvalue.pipe.ts similarity index 100% rename from packages/common/src/lib/keyvalue/keyvalue.pipe.ts rename to packages/common/keyvalue/src/keyvalue.pipe.ts diff --git a/packages/common/keyvalue/src/public_api.ts b/packages/common/keyvalue/src/public_api.ts new file mode 100644 index 0000000000..4f2941faf4 --- /dev/null +++ b/packages/common/keyvalue/src/public_api.ts @@ -0,0 +1,2 @@ +export * from './keyvalue.module'; +export * from './keyvalue.pipe'; diff --git a/packages/common/list/index.ts b/packages/common/list/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/list/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/list/ng-package.json b/packages/common/list/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/list/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/list/list-item.directive.spec.ts b/packages/common/list/src/list-item.directive.spec.ts similarity index 100% rename from packages/common/src/lib/list/list-item.directive.spec.ts rename to packages/common/list/src/list-item.directive.spec.ts diff --git a/packages/common/src/lib/list/list-item.directive.ts b/packages/common/list/src/list-item.directive.ts similarity index 100% rename from packages/common/src/lib/list/list-item.directive.ts rename to packages/common/list/src/list-item.directive.ts diff --git a/packages/common/src/lib/list/list.component.html b/packages/common/list/src/list.component.html similarity index 100% rename from packages/common/src/lib/list/list.component.html rename to packages/common/list/src/list.component.html diff --git a/packages/common/src/lib/list/list.component.scss b/packages/common/list/src/list.component.scss similarity index 94% rename from packages/common/src/lib/list/list.component.scss rename to packages/common/list/src/list.component.scss index 1916b4ba5b..04ed968437 100644 --- a/packages/common/src/lib/list/list.component.scss +++ b/packages/common/list/src/list.component.scss @@ -1,4 +1,4 @@ -@import '../../style/partial/common.variables'; +@import '../../src/style/partial/common.variables'; // This is to make the list scrollable :host { diff --git a/packages/common/src/lib/list/list.component.spec.ts b/packages/common/list/src/list.component.spec.ts similarity index 100% rename from packages/common/src/lib/list/list.component.spec.ts rename to packages/common/list/src/list.component.spec.ts diff --git a/packages/common/src/lib/list/list.component.ts b/packages/common/list/src/list.component.ts similarity index 99% rename from packages/common/src/lib/list/list.component.ts rename to packages/common/list/src/list.component.ts index c747664455..b2fca458b2 100644 --- a/packages/common/src/lib/list/list.component.ts +++ b/packages/common/list/src/list.component.ts @@ -12,9 +12,10 @@ import { import type { QueryList } from '@angular/core'; import { MatListModule } from '@angular/material/list'; +import { ClickoutDirective } from '@igo2/common/clickout'; + import { Subscription } from 'rxjs'; -import { ClickoutDirective } from '../clickout/clickout.directive'; import { ListItemDirective } from './list-item.directive'; @Component({ diff --git a/packages/common/src/lib/list/list.module.ts b/packages/common/list/src/list.module.ts similarity index 100% rename from packages/common/src/lib/list/list.module.ts rename to packages/common/list/src/list.module.ts diff --git a/packages/common/src/lib/list/list.theming.scss b/packages/common/list/src/list.theming.scss similarity index 100% rename from packages/common/src/lib/list/list.theming.scss rename to packages/common/list/src/list.theming.scss diff --git a/packages/common/src/lib/list/index.ts b/packages/common/list/src/public_api.ts similarity index 89% rename from packages/common/src/lib/list/index.ts rename to packages/common/list/src/public_api.ts index 608555f905..a7d283c36b 100644 --- a/packages/common/src/lib/list/index.ts +++ b/packages/common/list/src/public_api.ts @@ -1,6 +1,7 @@ import { ListItemDirective } from './list-item.directive'; import { ListComponent } from './list.component'; +export * from './list.module'; export * from './list.component'; export * from './list-item.directive'; diff --git a/packages/common/package.json b/packages/common/package.json index 14a18f28e5..be6f7f66fa 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -37,6 +37,105 @@ }, "./partial/*": { "sass": "./src/style/partial/*.scss" + }, + "./environment": { + "import": "./environment/src/public_api.ts" + }, + "./action": { + "import": "./action/src/public_api.ts" + }, + "./backdrop": { + "import": "./backdrop/src/public_api.ts" + }, + "./badge": { + "import": "./badge/src/public_api.ts" + }, + "./clickout": { + "import": "./clickout/src/public_api.ts" + }, + "./clone": { + "import": "./clone/src/public_api.ts" + }, + "./collapsible": { + "import": "./collapsible/src/public_api.ts" + }, + "./color": { + "import": "./color/src/public_api.ts" + }, + "./confirm-dialog": { + "import": "./confirm-dialog/src/public_api.ts" + }, + "./context-menu": { + "import": "./context-menu/src/public_api.ts" + }, + "./custom-html": { + "import": "./custom-html/src/public_api.ts" + }, + "./dom": { + "import": "./dom/src/public_api.ts" + }, + "./drag-drop": { + "import": "./drag-drop/src/public_api.ts" + }, + "./dynamic-component": { + "import": "./dynamic-component/src/public_api.ts" + }, + "./entity": { + "import": "./entity/src/public_api.ts" + }, + "./flexible": { + "import": "./flexible/src/public_api.ts" + }, + "./form": { + "import": "./form/src/public_api.ts" + }, + "./home-button": { + "import": "./home-button/src/public_api.ts" + }, + "./icon": { + "import": "./icon/src/public_api.ts" + }, + "./image": { + "import": "./image/src/public_api.ts" + }, + "./interactive-tour": { + "import": "./interactive-tour/src/public_api.ts" + }, + "./json-dialog": { + "import": "./json-dialog/src/public_api.ts" + }, + "./keyvalue": { + "import": "./keyvalue/src/public_api.ts" + }, + "./list": { + "import": "./list/src/public_api.ts" + }, + "./panel": { + "import": "./panel/src/public_api.ts" + }, + "./select-value-dialog": { + "import": "./select-value-dialog/src/public_api.ts" + }, + "./sidenav": { + "import": "./sidenav/src/public_api.ts" + }, + "./spinner": { + "import": "./spinner/src/public_api.ts" + }, + "./stop-propagation": { + "import": "./stop-propagation/src/public_api.ts" + }, + "./table": { + "import": "./table/src/public_api.ts" + }, + "./tool": { + "import": "./tool/src/public_api.ts" + }, + "./widget": { + "import": "./widget/src/public_api.ts" + }, + "./workspace": { + "import": "./workspace/src/public_api.ts" } }, "dependencies": { diff --git a/packages/common/panel/index.ts b/packages/common/panel/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/panel/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/panel/ng-package.json b/packages/common/panel/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/panel/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/panel/panel.component.html b/packages/common/panel/src/panel.component.html similarity index 100% rename from packages/common/src/lib/panel/panel.component.html rename to packages/common/panel/src/panel.component.html diff --git a/packages/common/src/lib/panel/panel.component.scss b/packages/common/panel/src/panel.component.scss similarity index 87% rename from packages/common/src/lib/panel/panel.component.scss rename to packages/common/panel/src/panel.component.scss index de89345b06..92e54b594f 100644 --- a/packages/common/src/lib/panel/panel.component.scss +++ b/packages/common/panel/src/panel.component.scss @@ -1,5 +1,5 @@ -@import '../../../../core/src/style/partial/core.variables'; -@import '../../style/partial/common.variables'; +@import '../../../core/src/style/partial/core.variables'; +@import '../../src/style/partial/common.variables'; :host { display: flex; diff --git a/packages/common/src/lib/panel/panel.component.spec.ts b/packages/common/panel/src/panel.component.spec.ts similarity index 100% rename from packages/common/src/lib/panel/panel.component.spec.ts rename to packages/common/panel/src/panel.component.spec.ts diff --git a/packages/common/src/lib/panel/panel.component.ts b/packages/common/panel/src/panel.component.ts similarity index 100% rename from packages/common/src/lib/panel/panel.component.ts rename to packages/common/panel/src/panel.component.ts diff --git a/packages/common/src/lib/panel/panel.module.ts b/packages/common/panel/src/panel.module.ts similarity index 100% rename from packages/common/src/lib/panel/panel.module.ts rename to packages/common/panel/src/panel.module.ts diff --git a/packages/common/src/lib/panel/panel.theming.scss b/packages/common/panel/src/panel.theming.scss similarity index 100% rename from packages/common/src/lib/panel/panel.theming.scss rename to packages/common/panel/src/panel.theming.scss diff --git a/packages/common/src/lib/panel/index.ts b/packages/common/panel/src/public_api.ts similarity index 52% rename from packages/common/src/lib/panel/index.ts rename to packages/common/panel/src/public_api.ts index e68a7642b4..bae4982fab 100644 --- a/packages/common/src/lib/panel/index.ts +++ b/packages/common/panel/src/public_api.ts @@ -1 +1,2 @@ +export * from './panel.module'; export * from './panel.component'; diff --git a/packages/common/select-value-dialog/index.ts b/packages/common/select-value-dialog/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/select-value-dialog/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/select-value-dialog/ng-package.json b/packages/common/select-value-dialog/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/select-value-dialog/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/select-value-dialog/index.ts b/packages/common/select-value-dialog/src/public_api.ts similarity index 81% rename from packages/common/src/lib/select-value-dialog/index.ts rename to packages/common/select-value-dialog/src/public_api.ts index 8d0d5a247d..44bbddd027 100644 --- a/packages/common/src/lib/select-value-dialog/index.ts +++ b/packages/common/select-value-dialog/src/public_api.ts @@ -1,4 +1,5 @@ export * from './select-value-check-radio-dialog.component'; +export * from './select-value-dialog.module'; export * from './select-value-dialog.enums'; export * from './select-value-dialog.interface'; export * from './select-value-dialog.service'; diff --git a/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.html b/packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.html similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.html rename to packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.html diff --git a/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.scss b/packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.scss similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.scss rename to packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.scss diff --git a/packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts b/packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.ts similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-check-radio-dialog.component.ts rename to packages/common/select-value-dialog/src/select-value-check-radio-dialog.component.ts diff --git a/packages/common/src/lib/select-value-dialog/select-value-dialog.enums.ts b/packages/common/select-value-dialog/src/select-value-dialog.enums.ts similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-dialog.enums.ts rename to packages/common/select-value-dialog/src/select-value-dialog.enums.ts diff --git a/packages/common/src/lib/select-value-dialog/select-value-dialog.interface.ts b/packages/common/select-value-dialog/src/select-value-dialog.interface.ts similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-dialog.interface.ts rename to packages/common/select-value-dialog/src/select-value-dialog.interface.ts diff --git a/packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts b/packages/common/select-value-dialog/src/select-value-dialog.module.ts similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-dialog.module.ts rename to packages/common/select-value-dialog/src/select-value-dialog.module.ts diff --git a/packages/common/src/lib/select-value-dialog/select-value-dialog.service.ts b/packages/common/select-value-dialog/src/select-value-dialog.service.ts similarity index 100% rename from packages/common/src/lib/select-value-dialog/select-value-dialog.service.ts rename to packages/common/select-value-dialog/src/select-value-dialog.service.ts diff --git a/packages/common/sidenav/index.ts b/packages/common/sidenav/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/sidenav/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/sidenav/ng-package.json b/packages/common/sidenav/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/sidenav/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/sidenav/index.ts b/packages/common/sidenav/src/public_api.ts similarity index 55% rename from packages/common/src/lib/sidenav/index.ts rename to packages/common/sidenav/src/public_api.ts index 6dd7d1d2ef..579267acc7 100644 --- a/packages/common/src/lib/sidenav/index.ts +++ b/packages/common/sidenav/src/public_api.ts @@ -1 +1,2 @@ +export * from './sidenav.module'; export * from './sidenav-shim.directive'; diff --git a/packages/common/src/lib/sidenav/sidenav-shim.directive.spec.ts b/packages/common/sidenav/src/sidenav-shim.directive.spec.ts similarity index 100% rename from packages/common/src/lib/sidenav/sidenav-shim.directive.spec.ts rename to packages/common/sidenav/src/sidenav-shim.directive.spec.ts diff --git a/packages/common/src/lib/sidenav/sidenav-shim.directive.ts b/packages/common/sidenav/src/sidenav-shim.directive.ts similarity index 100% rename from packages/common/src/lib/sidenav/sidenav-shim.directive.ts rename to packages/common/sidenav/src/sidenav-shim.directive.ts diff --git a/packages/common/src/lib/sidenav/sidenav.module.ts b/packages/common/sidenav/src/sidenav.module.ts similarity index 100% rename from packages/common/src/lib/sidenav/sidenav.module.ts rename to packages/common/sidenav/src/sidenav.module.ts diff --git a/packages/common/spinner/index.ts b/packages/common/spinner/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/spinner/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/spinner/ng-package.json b/packages/common/spinner/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/spinner/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/spinner/src/public_api.ts b/packages/common/spinner/src/public_api.ts new file mode 100644 index 0000000000..deb8fb7777 --- /dev/null +++ b/packages/common/spinner/src/public_api.ts @@ -0,0 +1,3 @@ +export * from './spinner.module'; +export * from './spinner.component'; +export * from './spinner-activity.directive'; diff --git a/packages/common/src/lib/spinner/spinner-activity.directive.ts b/packages/common/spinner/src/spinner-activity.directive.ts similarity index 100% rename from packages/common/src/lib/spinner/spinner-activity.directive.ts rename to packages/common/spinner/src/spinner-activity.directive.ts diff --git a/packages/common/src/lib/spinner/spinner.component.html b/packages/common/spinner/src/spinner.component.html similarity index 100% rename from packages/common/src/lib/spinner/spinner.component.html rename to packages/common/spinner/src/spinner.component.html diff --git a/packages/common/src/lib/spinner/spinner.component.scss b/packages/common/spinner/src/spinner.component.scss similarity index 100% rename from packages/common/src/lib/spinner/spinner.component.scss rename to packages/common/spinner/src/spinner.component.scss diff --git a/packages/common/src/lib/spinner/spinner.component.spec.ts b/packages/common/spinner/src/spinner.component.spec.ts similarity index 100% rename from packages/common/src/lib/spinner/spinner.component.spec.ts rename to packages/common/spinner/src/spinner.component.spec.ts diff --git a/packages/common/src/lib/spinner/spinner.component.ts b/packages/common/spinner/src/spinner.component.ts similarity index 100% rename from packages/common/src/lib/spinner/spinner.component.ts rename to packages/common/spinner/src/spinner.component.ts diff --git a/packages/common/src/lib/spinner/spinner.module.ts b/packages/common/spinner/src/spinner.module.ts similarity index 55% rename from packages/common/src/lib/spinner/spinner.module.ts rename to packages/common/spinner/src/spinner.module.ts index d72df64c12..8f175ef06f 100644 --- a/packages/common/src/lib/spinner/spinner.module.ts +++ b/packages/common/spinner/src/spinner.module.ts @@ -1,6 +1,12 @@ import { NgModule } from '@angular/core'; -import { SPINNER_DIRECTIVES } from '.'; +import { SpinnerActivityDirective } from './spinner-activity.directive'; +import { SpinnerComponent } from './spinner.component'; + +export const SPINNER_DIRECTIVES = [ + SpinnerActivityDirective, + SpinnerComponent +] as const; /** * @deprecated import the components/directives directly or SPINNER_DIRECTIVES for every components/directives diff --git a/packages/common/src/common-theme.scss b/packages/common/src/common-theme.scss index 83a37bf145..035bdad397 100644 --- a/packages/common/src/common-theme.scss +++ b/packages/common/src/common-theme.scss @@ -1,11 +1,11 @@ -@use './lib/action/action.theming.scss' as action; -@use './lib/collapsible/collapsible.theming.scss' as collapsible; -@use './lib/entity/entity.theming.scss' as entity; -@use './lib/list/list.theming.scss' as list; -@use './lib/panel/panel.theming.scss' as panel; -@use './lib/tool/tool.theming.scss' as tool; -@use './lib/interactive-tour/interactive-tour.theming.scss' as interactive-tour; -@use './lib/home-button/home-button.theming.scss' as home-button; +@use '../action/src/action.theming.scss' as action; +@use '../collapsible/src/collapsible.theming.scss' as collapsible; +@use '../entity/src/entity.theming.scss' as entity; +@use '../list/src/list.theming.scss' as list; +@use '../panel/src/panel.theming.scss' as panel; +@use '../tool/src/tool.theming.scss' as tool; +@use '../interactive-tour/src/interactive-tour.theming.scss' as interactive-tour; +@use '../home-button/src/home-button.theming.scss' as home-button; @mixin common-component-themes($theme) { @include action.igo-action-theming($theme); diff --git a/packages/common/src/lib/action/index.ts b/packages/common/src/lib/action/index.ts deleted file mode 100644 index e86db7b0b5..0000000000 --- a/packages/common/src/lib/action/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './shared'; -export * from './actionbar/actionbar.component'; diff --git a/packages/common/src/lib/clone/index.ts b/packages/common/src/lib/clone/index.ts deleted file mode 100644 index b3b3309732..0000000000 --- a/packages/common/src/lib/clone/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './clone.pipe'; diff --git a/packages/common/src/lib/dynamic-component/index.ts b/packages/common/src/lib/dynamic-component/index.ts deleted file mode 100644 index 58d6694dcb..0000000000 --- a/packages/common/src/lib/dynamic-component/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './shared'; -export * from './dynamic-outlet/dynamic-outlet.component'; diff --git a/packages/common/src/lib/entity/entity.module.ts b/packages/common/src/lib/entity/entity.module.ts deleted file mode 100644 index 706da2512e..0000000000 --- a/packages/common/src/lib/entity/entity.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NgModule } from '@angular/core'; - -import { ENTITY_DIRECTIVES } from '.'; - -/** - * @deprecated import the components directly or ENTITY_DIRECTIVES for every components/directives - */ -@NgModule({ - 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 deleted file mode 100644 index 8e79a24ed4..0000000000 --- a/packages/common/src/lib/entity/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/form/index.ts b/packages/common/src/lib/form/index.ts deleted file mode 100644 index 8fae354d35..0000000000 --- a/packages/common/src/lib/form/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/keyvalue/index.ts b/packages/common/src/lib/keyvalue/index.ts deleted file mode 100644 index 88b8bfcb6a..0000000000 --- a/packages/common/src/lib/keyvalue/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './keyvalue.pipe'; diff --git a/packages/common/src/lib/spinner/index.ts b/packages/common/src/lib/spinner/index.ts deleted file mode 100644 index cab52296d3..0000000000 --- a/packages/common/src/lib/spinner/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/tool/index.ts b/packages/common/src/lib/tool/index.ts deleted file mode 100644 index 30935b8746..0000000000 --- a/packages/common/src/lib/tool/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './shared'; -export * from './toolbox/toolbox.component'; diff --git a/packages/common/src/lib/widget/index.ts b/packages/common/src/lib/widget/index.ts deleted file mode 100644 index d0f8169015..0000000000 --- a/packages/common/src/lib/widget/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './shared'; -export * from './widget-outlet/widget-outlet.component'; diff --git a/packages/common/src/lib/workspace/index.ts b/packages/common/src/lib/workspace/index.ts deleted file mode 100644 index a9fe6b7db9..0000000000 --- a/packages/common/src/lib/workspace/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -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/public_api.ts b/packages/common/src/public_api.ts index 678e69af18..cec1352727 100644 --- a/packages/common/src/public_api.ts +++ b/packages/common/src/public_api.ts @@ -2,83 +2,29 @@ * Public API Surface of common */ -export * from './lib/action/action.module'; -export * from './lib/action/actionbar/actionbar.module'; -export * from './lib/backdrop/backdrop.module'; -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/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/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-outlet/widget-outlet.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/workspace/workspace.module'; - -export * from './lib/action'; -export * from './lib/backdrop'; -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/context-menu'; -export * from './lib/custom-html'; -export * from './lib/dom'; -export * from './lib/drag-drop'; -export * from './lib/dynamic-component'; -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/icons'; -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'; -export * from './lib/table'; -export * from './lib/tool'; -export * from './lib/widget'; -export * from './lib/workspace'; +export { IgoHomeButtonModule } from '@igo2/common/home-button'; +export { IgoImageModule } from '@igo2/common/image'; +export { IgoInteractiveTourModule } from '@igo2/common/interactive-tour'; +export { IgoJsonDialogModule } from '@igo2/common/json-dialog'; +export { IgoKeyValueModule } from '@igo2/common/keyvalue'; +export { + IgoFormDialogModule, + IgoFormFormModule, + IgoFormFieldModule, + IgoFormGroupModule, + IgoFormModule +} from '@igo2/common/form'; +export { IgoListModule } from '@igo2/common/list'; +export { IgoPanelModule } from '@igo2/common/panel'; +export { IgoSelectValueDialogModule } from '@igo2/common/select-value-dialog'; +export { IgoSidenavModule } from '@igo2/common/sidenav'; +export { IgoSpinnerModule } from '@igo2/common/spinner'; +export { IgoStopPropagationModule } from '@igo2/common/stop-propagation'; +export { IgoTableModule } from '@igo2/common/table'; +export { IgoToolModule, IgoToolboxModule } from '@igo2/common/tool'; +export { IgoWidgetModule, IgoWidgetOutletModule } from '@igo2/common/widget'; +export { + IgoWorkspaceModule, + IgoWorkspaceSelectorModule, + IgoWorkspaceWidgetOutletModule +} from '@igo2/common/workspace'; diff --git a/packages/common/stop-propagation/index.ts b/packages/common/stop-propagation/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/stop-propagation/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/stop-propagation/ng-package.json b/packages/common/stop-propagation/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/stop-propagation/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/stop-propagation/index.ts b/packages/common/stop-propagation/src/public_api.ts similarity index 89% rename from packages/common/src/lib/stop-propagation/index.ts rename to packages/common/stop-propagation/src/public_api.ts index 6028a1f89b..448c9b5c55 100644 --- a/packages/common/src/lib/stop-propagation/index.ts +++ b/packages/common/stop-propagation/src/public_api.ts @@ -1,6 +1,7 @@ import { StopDropPropagationDirective } from './stop-drop-propagation.directive'; import { StopPropagationDirective } from './stop-propagation.directive'; +export * from './stop-propagation.module'; export * from './stop-propagation.directive'; export * from './stop-drop-propagation.directive'; diff --git a/packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts b/packages/common/stop-propagation/src/stop-drop-propagation.directive.ts similarity index 100% rename from packages/common/src/lib/stop-propagation/stop-drop-propagation.directive.ts rename to packages/common/stop-propagation/src/stop-drop-propagation.directive.ts diff --git a/packages/common/src/lib/stop-propagation/stop-propagation.directive.spec.ts b/packages/common/stop-propagation/src/stop-propagation.directive.spec.ts similarity index 100% rename from packages/common/src/lib/stop-propagation/stop-propagation.directive.spec.ts rename to packages/common/stop-propagation/src/stop-propagation.directive.spec.ts diff --git a/packages/common/src/lib/stop-propagation/stop-propagation.directive.ts b/packages/common/stop-propagation/src/stop-propagation.directive.ts similarity index 100% rename from packages/common/src/lib/stop-propagation/stop-propagation.directive.ts rename to packages/common/stop-propagation/src/stop-propagation.directive.ts diff --git a/packages/common/src/lib/stop-propagation/stop-propagation.module.ts b/packages/common/stop-propagation/src/stop-propagation.module.ts similarity index 100% rename from packages/common/src/lib/stop-propagation/stop-propagation.module.ts rename to packages/common/stop-propagation/src/stop-propagation.module.ts diff --git a/packages/common/table/index.ts b/packages/common/table/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/table/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/table/ng-package.json b/packages/common/table/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/table/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/src/lib/table/index.ts b/packages/common/table/src/public_api.ts similarity index 85% rename from packages/common/src/lib/table/index.ts rename to packages/common/table/src/public_api.ts index ed25a50009..affe05e4d1 100644 --- a/packages/common/src/lib/table/index.ts +++ b/packages/common/table/src/public_api.ts @@ -1,3 +1,4 @@ +export * from './table.module'; export * from './table.component'; export * from './table-database'; export * from './table-datasource'; diff --git a/packages/common/src/lib/table/table-action-color.enum.ts b/packages/common/table/src/table-action-color.enum.ts similarity index 100% rename from packages/common/src/lib/table/table-action-color.enum.ts rename to packages/common/table/src/table-action-color.enum.ts diff --git a/packages/common/src/lib/table/table-database.ts b/packages/common/table/src/table-database.ts similarity index 100% rename from packages/common/src/lib/table/table-database.ts rename to packages/common/table/src/table-database.ts diff --git a/packages/common/src/lib/table/table-datasource.ts b/packages/common/table/src/table-datasource.ts similarity index 100% rename from packages/common/src/lib/table/table-datasource.ts rename to packages/common/table/src/table-datasource.ts diff --git a/packages/common/src/lib/table/table-model.interface.ts b/packages/common/table/src/table-model.interface.ts similarity index 100% rename from packages/common/src/lib/table/table-model.interface.ts rename to packages/common/table/src/table-model.interface.ts diff --git a/packages/common/src/lib/table/table.component.html b/packages/common/table/src/table.component.html similarity index 100% rename from packages/common/src/lib/table/table.component.html rename to packages/common/table/src/table.component.html diff --git a/packages/common/src/lib/table/table.component.scss b/packages/common/table/src/table.component.scss similarity index 100% rename from packages/common/src/lib/table/table.component.scss rename to packages/common/table/src/table.component.scss diff --git a/packages/common/src/lib/table/table.component.ts b/packages/common/table/src/table.component.ts similarity index 100% rename from packages/common/src/lib/table/table.component.ts rename to packages/common/table/src/table.component.ts diff --git a/packages/common/src/lib/table/table.module.ts b/packages/common/table/src/table.module.ts similarity index 100% rename from packages/common/src/lib/table/table.module.ts rename to packages/common/table/src/table.module.ts diff --git a/packages/common/tool/index.ts b/packages/common/tool/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/tool/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/tool/ng-package.json b/packages/common/tool/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/tool/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/tool/src/public_api.ts b/packages/common/tool/src/public_api.ts new file mode 100644 index 0000000000..43ca5ef708 --- /dev/null +++ b/packages/common/tool/src/public_api.ts @@ -0,0 +1,3 @@ +export * from './shared'; +export * from './tool.module'; +export * from './toolbox'; diff --git a/packages/common/src/lib/tool/shared/index.ts b/packages/common/tool/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/tool/shared/index.ts rename to packages/common/tool/src/shared/index.ts diff --git a/packages/common/src/lib/tool/shared/tool-component.ts b/packages/common/tool/src/shared/tool-component.ts similarity index 100% rename from packages/common/src/lib/tool/shared/tool-component.ts rename to packages/common/tool/src/shared/tool-component.ts diff --git a/packages/common/src/lib/tool/shared/tool.interface.ts b/packages/common/tool/src/shared/tool.interface.ts similarity index 89% rename from packages/common/src/lib/tool/shared/tool.interface.ts rename to packages/common/tool/src/shared/tool.interface.ts index d8a14a485d..d5da010d18 100644 --- a/packages/common/src/lib/tool/shared/tool.interface.ts +++ b/packages/common/tool/src/shared/tool.interface.ts @@ -1,4 +1,4 @@ -import { IconSvg } from '../../icons'; +import { IconSvg } from '@igo2/common/icon'; export interface Tool { name: string; diff --git a/packages/common/src/lib/tool/shared/tool.service.spec.ts b/packages/common/tool/src/shared/tool.service.spec.ts similarity index 100% rename from packages/common/src/lib/tool/shared/tool.service.spec.ts rename to packages/common/tool/src/shared/tool.service.spec.ts diff --git a/packages/common/src/lib/tool/shared/tool.service.ts b/packages/common/tool/src/shared/tool.service.ts similarity index 100% rename from packages/common/src/lib/tool/shared/tool.service.ts rename to packages/common/tool/src/shared/tool.service.ts diff --git a/packages/common/src/lib/tool/shared/toolbox.enums.ts b/packages/common/tool/src/shared/toolbox.enums.ts similarity index 100% rename from packages/common/src/lib/tool/shared/toolbox.enums.ts rename to packages/common/tool/src/shared/toolbox.enums.ts diff --git a/packages/common/src/lib/tool/shared/toolbox.ts b/packages/common/tool/src/shared/toolbox.ts similarity index 92% rename from packages/common/src/lib/tool/shared/toolbox.ts rename to packages/common/tool/src/shared/toolbox.ts index 276fb717be..edcde48361 100644 --- a/packages/common/src/lib/tool/shared/toolbox.ts +++ b/packages/common/tool/src/shared/toolbox.ts @@ -1,6 +1,7 @@ +import { EntityRecord, EntityStore } from '@igo2/common/entity'; + import { BehaviorSubject, Subscription } from 'rxjs'; -import { EntityRecord, EntityStore } from '../../entity'; import { Tool, ToolboxOptions } from './tool.interface'; /** @@ -26,6 +27,8 @@ export class Toolbox { * Active tool history. Useful for activating the previous tool. */ private activeToolHistory: string[] = []; + private previousToolName: string; + private currentToolName: string; /** * Tool store @@ -118,6 +121,10 @@ export class Toolbox { this.activateTool(previous); } + getCurrentPreviousToolName(): [string, string] { + return [this.previousToolName, this.currentToolName]; + } + /** * Activate the tool below, if any */ @@ -198,6 +205,10 @@ export class Toolbox { this.activeToolHistory = this.activeToolHistory .filter((name: string) => name !== tool.name) .concat([tool.name]); + + this.previousToolName = this.currentToolName; + this.currentToolName = + this.activeToolHistory[this.activeToolHistory.length - 1]; } } diff --git a/packages/common/src/lib/tool/tool.module.ts b/packages/common/tool/src/tool.module.ts similarity index 100% rename from packages/common/src/lib/tool/tool.module.ts rename to packages/common/tool/src/tool.module.ts diff --git a/packages/common/src/lib/tool/tool.theming.scss b/packages/common/tool/src/tool.theming.scss similarity index 100% rename from packages/common/src/lib/tool/tool.theming.scss rename to packages/common/tool/src/tool.theming.scss diff --git a/packages/common/tool/src/toolbox/index.ts b/packages/common/tool/src/toolbox/index.ts new file mode 100644 index 0000000000..0a3be60c73 --- /dev/null +++ b/packages/common/tool/src/toolbox/index.ts @@ -0,0 +1,2 @@ +export * from './toolbox.module'; +export * from './toolbox.component'; diff --git a/packages/common/src/lib/tool/toolbox/toolbox.animation.ts b/packages/common/tool/src/toolbox/toolbox.animation.ts similarity index 100% rename from packages/common/src/lib/tool/toolbox/toolbox.animation.ts rename to packages/common/tool/src/toolbox/toolbox.animation.ts diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.html b/packages/common/tool/src/toolbox/toolbox.component.html similarity index 100% rename from packages/common/src/lib/tool/toolbox/toolbox.component.html rename to packages/common/tool/src/toolbox/toolbox.component.html diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.scss b/packages/common/tool/src/toolbox/toolbox.component.scss similarity index 94% rename from packages/common/src/lib/tool/toolbox/toolbox.component.scss rename to packages/common/tool/src/toolbox/toolbox.component.scss index 161b355a5e..b905eb3f17 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.component.scss +++ b/packages/common/tool/src/toolbox/toolbox.component.scss @@ -1,4 +1,4 @@ -@import '../../../../../core/src/style/partial/media'; +@import '../../../../core/src/style/partial/media'; :host { display: block; diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.ts b/packages/common/tool/src/toolbox/toolbox.component.ts similarity index 96% rename from packages/common/src/lib/tool/toolbox/toolbox.component.ts rename to packages/common/tool/src/toolbox/toolbox.component.ts index 018ffcd804..068a589558 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.component.ts +++ b/packages/common/tool/src/toolbox/toolbox.component.ts @@ -8,12 +8,12 @@ import { OnInit } from '@angular/core'; +import { Action, ActionStore, ActionbarComponent } from '@igo2/common/action'; +import { DynamicOutletComponent } from '@igo2/common/dynamic-component'; + 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'; diff --git a/packages/common/src/lib/tool/toolbox/toolbox.module.ts b/packages/common/tool/src/toolbox/toolbox.module.ts similarity index 100% rename from packages/common/src/lib/tool/toolbox/toolbox.module.ts rename to packages/common/tool/src/toolbox/toolbox.module.ts diff --git a/packages/common/src/lib/tool/toolbox/toolbox.theming.scss b/packages/common/tool/src/toolbox/toolbox.theming.scss similarity index 100% rename from packages/common/src/lib/tool/toolbox/toolbox.theming.scss rename to packages/common/tool/src/toolbox/toolbox.theming.scss diff --git a/packages/common/widget/index.ts b/packages/common/widget/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/widget/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/widget/ng-package.json b/packages/common/widget/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/widget/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/widget/src/public_api.ts b/packages/common/widget/src/public_api.ts new file mode 100644 index 0000000000..bebb7c51d5 --- /dev/null +++ b/packages/common/widget/src/public_api.ts @@ -0,0 +1,3 @@ +export * from './shared'; +export * from './widget-outlet'; +export * from './widget.module'; diff --git a/packages/common/src/lib/widget/shared/index.ts b/packages/common/widget/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/widget/shared/index.ts rename to packages/common/widget/src/shared/index.ts diff --git a/packages/common/src/lib/widget/shared/widget.interfaces.ts b/packages/common/widget/src/shared/widget.interfaces.ts similarity index 100% rename from packages/common/src/lib/widget/shared/widget.interfaces.ts rename to packages/common/widget/src/shared/widget.interfaces.ts diff --git a/packages/common/src/lib/widget/shared/widget.service.ts b/packages/common/widget/src/shared/widget.service.ts similarity index 79% rename from packages/common/src/lib/widget/shared/widget.service.ts rename to packages/common/widget/src/shared/widget.service.ts index c91a5242bc..04268149e4 100644 --- a/packages/common/src/lib/widget/shared/widget.service.ts +++ b/packages/common/widget/src/shared/widget.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; -import { DynamicComponentService } from '../../dynamic-component/shared/dynamic-component.service'; +import { DynamicComponentService } from '@igo2/common/dynamic-component'; + import { Widget } from './widget'; import { WidgetComponent } from './widget.interfaces'; diff --git a/packages/common/src/lib/widget/shared/widget.ts b/packages/common/widget/src/shared/widget.ts similarity index 58% rename from packages/common/src/lib/widget/shared/widget.ts rename to packages/common/widget/src/shared/widget.ts index d2376f64c9..4b6a90c8e5 100644 --- a/packages/common/src/lib/widget/shared/widget.ts +++ b/packages/common/widget/src/shared/widget.ts @@ -1,4 +1,5 @@ -import { DynamicComponent } from '../../dynamic-component/shared/dynamic-component'; +import { DynamicComponent } from '@igo2/common/dynamic-component'; + import { WidgetComponent } from './widget.interfaces'; export class Widget extends DynamicComponent {} diff --git a/packages/common/widget/src/widget-outlet/index.ts b/packages/common/widget/src/widget-outlet/index.ts new file mode 100644 index 0000000000..ffb150dc79 --- /dev/null +++ b/packages/common/widget/src/widget-outlet/index.ts @@ -0,0 +1,2 @@ +export * from './widget-outlet.module'; +export * from './widget-outlet.component'; diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.html b/packages/common/widget/src/widget-outlet/widget-outlet.component.html similarity index 100% rename from packages/common/src/lib/widget/widget-outlet/widget-outlet.component.html rename to packages/common/widget/src/widget-outlet/widget-outlet.component.html diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.scss b/packages/common/widget/src/widget-outlet/widget-outlet.component.scss similarity index 100% rename from packages/common/src/lib/widget/widget-outlet/widget-outlet.component.scss rename to packages/common/widget/src/widget-outlet/widget-outlet.component.scss diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts b/packages/common/widget/src/widget-outlet/widget-outlet.component.ts similarity index 94% rename from packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts rename to packages/common/widget/src/widget-outlet/widget-outlet.component.ts index cef2c7b87c..24c678ff42 100644 --- a/packages/common/src/lib/widget/widget-outlet/widget-outlet.component.ts +++ b/packages/common/widget/src/widget-outlet/widget-outlet.component.ts @@ -8,8 +8,11 @@ import { Output } from '@angular/core'; -import { DynamicComponent } from '../../dynamic-component'; -import { DynamicOutletComponent } from '../../dynamic-component/dynamic-outlet/dynamic-outlet.component'; +import { + DynamicComponent, + DynamicOutletComponent +} from '@igo2/common/dynamic-component'; + import { WidgetComponent } from '../shared/widget.interfaces'; /** diff --git a/packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts b/packages/common/widget/src/widget-outlet/widget-outlet.module.ts similarity index 100% rename from packages/common/src/lib/widget/widget-outlet/widget-outlet.module.ts rename to packages/common/widget/src/widget-outlet/widget-outlet.module.ts diff --git a/packages/common/src/lib/widget/widget.module.ts b/packages/common/widget/src/widget.module.ts similarity index 100% rename from packages/common/src/lib/widget/widget.module.ts rename to packages/common/widget/src/widget.module.ts diff --git a/packages/common/workspace/index.ts b/packages/common/workspace/index.ts new file mode 100644 index 0000000000..decc72d85b --- /dev/null +++ b/packages/common/workspace/index.ts @@ -0,0 +1 @@ +export * from './src/public_api'; diff --git a/packages/common/workspace/ng-package.json b/packages/common/workspace/ng-package.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/common/workspace/ng-package.json @@ -0,0 +1 @@ +{} diff --git a/packages/common/workspace/src/public_api.ts b/packages/common/workspace/src/public_api.ts new file mode 100644 index 0000000000..ca57d5a8e2 --- /dev/null +++ b/packages/common/workspace/src/public_api.ts @@ -0,0 +1,4 @@ +export * from './shared'; +export * from './workspace.module'; +export * from './workspace-selector'; +export * from './workspace-widget-outlet'; diff --git a/packages/common/src/lib/workspace/shared/index.ts b/packages/common/workspace/src/shared/index.ts similarity index 100% rename from packages/common/src/lib/workspace/shared/index.ts rename to packages/common/workspace/src/shared/index.ts diff --git a/packages/common/src/lib/workspace/shared/store.ts b/packages/common/workspace/src/shared/store.ts similarity index 95% rename from packages/common/src/lib/workspace/shared/store.ts rename to packages/common/workspace/src/shared/store.ts index 1d827e87fd..5db990316a 100644 --- a/packages/common/src/lib/workspace/shared/store.ts +++ b/packages/common/workspace/src/shared/store.ts @@ -1,6 +1,7 @@ +import { EntityStore } from '@igo2/common/entity'; + import { BehaviorSubject } from 'rxjs'; -import { EntityStore } from '../../entity'; import { Workspace } from './workspace'; /** diff --git a/packages/common/src/lib/workspace/shared/workspace.interfaces.ts b/packages/common/workspace/src/shared/workspace.interfaces.ts similarity index 62% rename from packages/common/src/lib/workspace/shared/workspace.interfaces.ts rename to packages/common/workspace/src/shared/workspace.interfaces.ts index 6b1a031d01..12c405ad96 100644 --- a/packages/common/src/lib/workspace/shared/workspace.interfaces.ts +++ b/packages/common/workspace/src/shared/workspace.interfaces.ts @@ -1,5 +1,5 @@ -import { ActionStore } from '../../action'; -import { EntityStore } from '../../entity'; +import { ActionStore } from '@igo2/common/action'; +import { EntityStore } from '@igo2/common/entity'; export interface WorkspaceOptions { id: string; diff --git a/packages/common/src/lib/workspace/shared/workspace.ts b/packages/common/workspace/src/shared/workspace.ts similarity index 96% rename from packages/common/src/lib/workspace/shared/workspace.ts rename to packages/common/workspace/src/shared/workspace.ts index d67ac1f51c..c57df40736 100644 --- a/packages/common/src/lib/workspace/shared/workspace.ts +++ b/packages/common/workspace/src/shared/workspace.ts @@ -1,8 +1,9 @@ +import { ActionStore } from '@igo2/common/action'; +import { EntityStore } from '@igo2/common/entity'; +import { Widget } from '@igo2/common/widget'; + import { BehaviorSubject, Subject, Subscription } from 'rxjs'; -import { ActionStore } from '../../action'; -import { EntityStore } from '../../entity'; -import { Widget } from '../../widget'; import { WorkspaceOptions } from './workspace.interfaces'; /** diff --git a/packages/common/workspace/src/workspace-selector/index.ts b/packages/common/workspace/src/workspace-selector/index.ts new file mode 100644 index 0000000000..ebee02f827 --- /dev/null +++ b/packages/common/workspace/src/workspace-selector/index.ts @@ -0,0 +1,2 @@ +export * from './workspace-selector.module'; +export * from './workspace-selector.component'; diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.html b/packages/common/workspace/src/workspace-selector/workspace-selector.component.html similarity index 100% rename from packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.html rename to packages/common/workspace/src/workspace-selector/workspace-selector.component.html diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss b/packages/common/workspace/src/workspace-selector/workspace-selector.component.scss similarity index 100% rename from packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.scss rename to packages/common/workspace/src/workspace-selector/workspace-selector.component.scss diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts b/packages/common/workspace/src/workspace-selector/workspace-selector.component.ts similarity index 91% rename from packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts rename to packages/common/workspace/src/workspace-selector/workspace-selector.component.ts index 0a288024e8..2f6f24355e 100644 --- a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.component.ts +++ b/packages/common/workspace/src/workspace-selector/workspace-selector.component.ts @@ -6,11 +6,12 @@ import { Output } from '@angular/core'; -import { getEntityTitle } from '../../entity'; import { EntitySelectorChange, - EntitySelectorComponent -} from '../../entity/entity-selector/entity-selector.component'; + EntitySelectorComponent, + getEntityTitle +} from '@igo2/common/entity'; + import { WorkspaceStore } from '../shared/store'; import { Workspace } from '../shared/workspace'; diff --git a/packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts b/packages/common/workspace/src/workspace-selector/workspace-selector.module.ts similarity index 100% rename from packages/common/src/lib/workspace/workspace-selector/workspace-selector.module.ts rename to packages/common/workspace/src/workspace-selector/workspace-selector.module.ts diff --git a/packages/common/workspace/src/workspace-widget-outlet/index.ts b/packages/common/workspace/src/workspace-widget-outlet/index.ts new file mode 100644 index 0000000000..283849ec60 --- /dev/null +++ b/packages/common/workspace/src/workspace-widget-outlet/index.ts @@ -0,0 +1,2 @@ +export * from './workspace-widget-outlet.module'; +export * from './workspace-widget-outlet.component'; diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.html b/packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.html similarity index 100% rename from packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.html rename to packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.html diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.scss b/packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.scss similarity index 100% rename from packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.scss rename to packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.scss diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts b/packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.ts similarity index 94% rename from packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts rename to packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.ts index 66a12284fa..389ce3076b 100644 --- a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.component.ts +++ b/packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.component.ts @@ -7,10 +7,10 @@ import { Output } from '@angular/core'; +import { Widget, WidgetOutletComponent } from '@igo2/common/widget'; + import { BehaviorSubject } from 'rxjs'; -import { Widget } from '../../widget'; -import { WidgetOutletComponent } from '../../widget/widget-outlet/widget-outlet.component'; import { Workspace } from '../shared/workspace'; /** diff --git a/packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts b/packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.module.ts similarity index 100% rename from packages/common/src/lib/workspace/workspace-widget-outlet/workspace-widget-outlet.module.ts rename to packages/common/workspace/src/workspace-widget-outlet/workspace-widget-outlet.module.ts diff --git a/packages/common/src/lib/workspace/workspace.module.ts b/packages/common/workspace/src/workspace.module.ts similarity index 53% rename from packages/common/src/lib/workspace/workspace.module.ts rename to packages/common/workspace/src/workspace.module.ts index 257bbd33db..e6c5746e2c 100644 --- a/packages/common/src/lib/workspace/workspace.module.ts +++ b/packages/common/workspace/src/workspace.module.ts @@ -1,6 +1,12 @@ import { NgModule } from '@angular/core'; -import { WORKSPACE_DIRECTIVES } from '.'; +import { WorkspaceSelectorComponent } from './workspace-selector'; +import { WorkspaceWidgetOutletComponent } from './workspace-widget-outlet'; + +export const WORKSPACE_DIRECTIVES = [ + WorkspaceSelectorComponent, + WorkspaceWidgetOutletComponent +] as const; /** * @deprecated import the components directly or WORKSPACE_DIRECTIVES for every components/directives 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 d1c5b108b8..8fdb632da8 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 @@ -15,7 +15,7 @@ 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 { SpinnerComponent } from '@igo2/common/spinner'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; 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 66a36e820a..608ce7c31a 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 @@ -12,7 +12,8 @@ import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; -import { CollapseDirective, StopPropagationDirective } from '@igo2/common'; +import { CollapseDirective } from '@igo2/common/collapsible'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import { IgoLanguageModule } from '@igo2/core/language'; import { StorageService } from '@igo2/core/storage'; 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 286b5ecacb..6a31d61bef 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 @@ -8,7 +8,7 @@ import { } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { ConfirmDialogService } from '@igo2/common'; +import { ConfirmDialogService } from '@igo2/common/confirm-dialog'; import { LanguageService } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/context/src/lib/context-manager/context-list/context-list.component.ts b/packages/context/src/lib/context-manager/context-list/context-list.component.ts index ad66793c97..b089b7db0f 100644 --- a/packages/context/src/lib/context-manager/context-list/context-list.component.ts +++ b/packages/context/src/lib/context-manager/context-list/context-list.component.ts @@ -23,11 +23,10 @@ import { AuthService } from '@igo2/auth'; import { ActionStore, ActionbarComponent, - ActionbarMode, - CollapsibleComponent, - ListComponent, - ListItemDirective -} from '@igo2/common'; + ActionbarMode +} from '@igo2/common/action'; +import { CollapsibleComponent } from '@igo2/common/collapsible'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/context/src/lib/context-manager/context-manager.directive.ts b/packages/context/src/lib/context-manager/context-manager.directive.ts new file mode 100644 index 0000000000..ca62cc65e7 --- /dev/null +++ b/packages/context/src/lib/context-manager/context-manager.directive.ts @@ -0,0 +1,28 @@ +import { + ContextEditBindingDirective, + ContextEditComponent +} from './context-edit'; +import { ContextFormComponent } from './context-form'; +import { ContextItemComponent } from './context-item'; +import { + ContextListBindingDirective, + ContextListComponent +} from './context-list'; +import { + ContextPermissionsBindingDirective, + ContextPermissionsComponent +} from './context-permissions'; +import { LayerContextDirective, MapContextDirective } from './shared'; + +export const CONTEXT_MANAGER_DIRECTIVES = [ + ContextListComponent, + ContextListBindingDirective, + ContextItemComponent, + ContextFormComponent, + ContextEditComponent, + ContextEditBindingDirective, + ContextPermissionsComponent, + ContextPermissionsBindingDirective, + MapContextDirective, + LayerContextDirective +] as const; diff --git a/packages/context/src/lib/context-manager/context-permissions/context-permissions.component.ts b/packages/context/src/lib/context-manager/context-permissions/context-permissions.component.ts index 6e37425ba9..c58a98e79f 100644 --- a/packages/context/src/lib/context-manager/context-permissions/context-permissions.component.ts +++ b/packages/context/src/lib/context-manager/context-permissions/context-permissions.component.ts @@ -26,11 +26,9 @@ import { MatRadioModule } from '@angular/material/radio'; import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; -import { - CollapsibleComponent, - ListComponent, - StopPropagationDirective -} from '@igo2/common'; +import { CollapsibleComponent } from '@igo2/common/collapsible'; +import { ListComponent } from '@igo2/common/list'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/context/src/lib/context-manager/index.ts b/packages/context/src/lib/context-manager/index.ts index 808cb0951f..16ebafd6a7 100644 --- a/packages/context/src/lib/context-manager/index.ts +++ b/packages/context/src/lib/context-manager/index.ts @@ -1,35 +1,7 @@ -import { - ContextEditBindingDirective, - ContextEditComponent -} from './context-edit'; -import { ContextFormComponent } from './context-form'; -import { ContextItemComponent } from './context-item'; -import { - ContextListBindingDirective, - ContextListComponent -} from './context-list'; -import { - ContextPermissionsBindingDirective, - ContextPermissionsComponent -} from './context-permissions'; -import { LayerContextDirective, MapContextDirective } from './shared'; - export * from './shared'; export * from './context-list'; export * from './context-item'; export * from './context-form'; export * from './context-edit'; export * from './context-permissions'; - -export const CONTEXT_MANAGER_DIRECTIVES = [ - ContextListComponent, - ContextListBindingDirective, - ContextItemComponent, - ContextFormComponent, - ContextEditComponent, - ContextEditBindingDirective, - ContextPermissionsComponent, - ContextPermissionsBindingDirective, - MapContextDirective, - LayerContextDirective -] as const; +export * from './context-manager.directive'; diff --git a/packages/context/src/lib/context-manager/shared/context.interface.ts b/packages/context/src/lib/context-manager/shared/context.interface.ts index 57757e38b2..50c9759351 100644 --- a/packages/context/src/lib/context-manager/shared/context.interface.ts +++ b/packages/context/src/lib/context-manager/shared/context.interface.ts @@ -1,4 +1,4 @@ -import { Tool } from '@igo2/common'; +import { Tool } from '@igo2/common/tool'; import { Message } from '@igo2/core/message'; import { LayerOptions, diff --git a/packages/context/src/lib/context-manager/shared/context.service.ts b/packages/context/src/lib/context-manager/shared/context.service.ts index 4a004762ab..1e93989850 100644 --- a/packages/context/src/lib/context-manager/shared/context.service.ts +++ b/packages/context/src/lib/context-manager/shared/context.service.ts @@ -2,7 +2,7 @@ import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { Injectable, Optional } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { Tool } from '@igo2/common'; +import { Tool } from '@igo2/common/tool'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { Message, MessageService } from '@igo2/core/message'; @@ -576,19 +576,14 @@ export class ContextService { delete layerFound.sourceOptions[`source`]; delete layerFound.sourceOptions[`format`]; } - const opts = { - baseLayer: layerFound.baseLayer, + delete layerFound.source; + const opts: AnyLayerOptions = { + ...layerFound, title: layer.options.title, zIndex: layer.zIndex, - igoStyle: { - styleByAttribute: layerFoundAs.igoStyle?.styleByAttribute, - clusterBaseStyle: layerFoundAs.igoStyle?.clusterBaseStyle - }, style: layerStyle, - clusterParam: layerFound[`clusterParam`], visible: layer.visible, - opacity: layer.opacity, - sourceOptions: layerFound.sourceOptions + opacity: layer.opacity }; context.layers.push(opts); } else { diff --git a/packages/context/src/lib/context-map-button/context-map-button.directive.ts b/packages/context/src/lib/context-map-button/context-map-button.directive.ts new file mode 100644 index 0000000000..e344d91779 --- /dev/null +++ b/packages/context/src/lib/context-map-button/context-map-button.directive.ts @@ -0,0 +1,13 @@ +import { + BookmarkButtonComponent, + BookmarkDialogComponent +} from './bookmark-button'; +import { PoiButtonComponent } from './poi-button'; +import { UserButtonComponent } from './user-button'; + +export const CONTEXT_MAP_BUTTON_DIRECTIVES = [ + BookmarkButtonComponent, + BookmarkDialogComponent, + PoiButtonComponent, + UserButtonComponent +] as const; diff --git a/packages/context/src/lib/context-map-button/index.ts b/packages/context/src/lib/context-map-button/index.ts index 48e62c34da..e8a6ada13f 100644 --- a/packages/context/src/lib/context-map-button/index.ts +++ b/packages/context/src/lib/context-map-button/index.ts @@ -1,17 +1,4 @@ -import { - BookmarkButtonComponent, - BookmarkDialogComponent -} from './bookmark-button'; -import { PoiButtonComponent } from './poi-button'; -import { UserButtonComponent } from './user-button'; - export * from './bookmark-button'; export * from './poi-button'; export * from './user-button'; - -export const CONTEXT_MAP_BUTTON_DIRECTIVES = [ - BookmarkButtonComponent, - BookmarkDialogComponent, - PoiButtonComponent, - UserButtonComponent -] as const; +export * from './context-map-button.directive'; diff --git a/packages/context/src/lib/context-map-button/poi-button/poi-button.component.ts b/packages/context/src/lib/context-map-button/poi-button/poi-button.component.ts index 00a27b8d6e..1011823844 100644 --- a/packages/context/src/lib/context-map-button/poi-button/poi-button.component.ts +++ b/packages/context/src/lib/context-map-button/poi-button/poi-button.component.ts @@ -8,7 +8,8 @@ import { MatIconModule } from '@angular/material/icon'; import { MatSelectModule } from '@angular/material/select'; import { AuthService } from '@igo2/auth'; -import { ConfirmDialogService, StopPropagationDirective } from '@igo2/common'; +import { ConfirmDialogService } from '@igo2/common/confirm-dialog'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; diff --git a/packages/context/src/lib/context.directive.ts b/packages/context/src/lib/context.directive.ts new file mode 100644 index 0000000000..5dbc73ef81 --- /dev/null +++ b/packages/context/src/lib/context.directive.ts @@ -0,0 +1,13 @@ +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 const CONTEXT_DIRECTIVES = [ + ContextImportExportComponent, + SidenavComponent, + ...CONTEXT_MANAGER_DIRECTIVES, + ...CONTEXT_MAP_BUTTON_DIRECTIVES, + ...SHARE_MAP_DIRECTIVES +] as const; diff --git a/packages/context/src/lib/index.ts b/packages/context/src/lib/index.ts index a9d964cd6a..5f602ee12c 100644 --- a/packages/context/src/lib/index.ts +++ b/packages/context/src/lib/index.ts @@ -1,20 +1,7 @@ -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; +export * from './context.directive'; diff --git a/packages/context/src/lib/share-map/index.ts b/packages/context/src/lib/share-map/index.ts index c9ea9106a4..3aef67808c 100644 --- a/packages/context/src/lib/share-map/index.ts +++ b/packages/context/src/lib/share-map/index.ts @@ -1,14 +1,5 @@ -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.module'; 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 d312ed11f2..9a61a3c6d4 100644 --- a/packages/context/src/lib/share-map/share-map.module.ts +++ b/packages/context/src/lib/share-map/share-map.module.ts @@ -4,6 +4,12 @@ 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 const SHARE_MAP_DIRECTIVES = [ + ShareMapComponent, + ShareMapUrlComponent, + ShareMapApiComponent +] as const; + /** * @deprecated import the components/directives directly or SHARE_MAP_DIRECTIVES for the set */ 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 aa45b1cfd0..31f0c1425a 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 @@ -12,7 +12,7 @@ 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 { CustomHtmlComponent } from '@igo2/common/custom-html'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import type { IgoMap } from '@igo2/geo'; diff --git a/packages/context/src/lib/sidenav/sidenav.component.ts b/packages/context/src/lib/sidenav/sidenav.component.ts index c40435c88e..b93e33de23 100644 --- a/packages/context/src/lib/sidenav/sidenav.component.ts +++ b/packages/context/src/lib/sidenav/sidenav.component.ts @@ -6,13 +6,10 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTooltipModule } from '@angular/material/tooltip'; import { Title } from '@angular/platform-browser'; -import { - FlexibleComponent, - FlexibleState, - PanelComponent, - Tool, - getEntityTitle -} from '@igo2/common'; +import { getEntityTitle } from '@igo2/common/entity'; +import { FlexibleComponent, FlexibleState } from '@igo2/common/flexible'; +import { PanelComponent } from '@igo2/common/panel'; +import { Tool } from '@igo2/common/tool'; import { IgoLanguageModule } from '@igo2/core/language'; import type { Media } from '@igo2/core/media'; import { diff --git a/packages/core/message/src/message.module.ts b/packages/core/message/src/message.module.ts index e743b555ed..ee1bbbff83 100644 --- a/packages/core/message/src/message.module.ts +++ b/packages/core/message/src/message.module.ts @@ -1,27 +1,13 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { GlobalConfig, ToastrModule } from 'ngx-toastr'; +import { provideMessage } from './shared/message.provider'; +/** + * @deprecated import the provideMessage directly + */ @NgModule({ - imports: [ - ToastrModule.forRoot({ - positionClass: 'toast-bottom-right', - timeOut: 10000, - extendedTimeOut: 10000, - titleClass: 'mat-subtitle-2', - messageClass: 'toast-message', - closeButton: true, - progressBar: true, - enableHtml: true, - tapToDismiss: true, - maxOpened: 4, - preventDuplicates: true, - resetTimeoutOnDuplicate: true, - countDuplicates: false, - includeTitleDuplicates: true - } as GlobalConfig) - ], - declarations: [], + imports: [], + providers: [provideMessage()], exports: [] }) export class IgoMessageModule { diff --git a/packages/core/message/src/shared/index.ts b/packages/core/message/src/shared/index.ts index 9d580e874f..67923fa4c3 100644 --- a/packages/core/message/src/shared/index.ts +++ b/packages/core/message/src/shared/index.ts @@ -1,3 +1,4 @@ export * from './message.enum'; export * from './message.interface'; +export * from './message.provider'; export * from './message.service'; diff --git a/packages/core/message/src/shared/message.provider.ts b/packages/core/message/src/shared/message.provider.ts new file mode 100644 index 0000000000..38301362e9 --- /dev/null +++ b/packages/core/message/src/shared/message.provider.ts @@ -0,0 +1,24 @@ +import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; + +import { GlobalConfig, provideToastr } from 'ngx-toastr'; + +const TOASTR_CONFIG: Partial = { + positionClass: 'toast-bottom-right', + timeOut: 10000, + extendedTimeOut: 10000, + titleClass: 'mat-subtitle-2', + messageClass: 'toast-message', + closeButton: true, + progressBar: true, + enableHtml: true, + tapToDismiss: true, + maxOpened: 4, + preventDuplicates: true, + resetTimeoutOnDuplicate: true, + countDuplicates: false, + includeTitleDuplicates: true +}; + +export function provideMessage(): EnvironmentProviders { + return makeEnvironmentProviders([provideToastr(TOASTR_CONFIG)]); +} diff --git a/packages/core/src/lib/core.module.ts b/packages/core/src/lib/core.module.ts index ac653f9b90..6f0786debb 100644 --- a/packages/core/src/lib/core.module.ts +++ b/packages/core/src/lib/core.module.ts @@ -5,7 +5,7 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; import { IgoActivityModule } from '@igo2/core/activity'; import { ConfigOptions, provideConfig } from '@igo2/core/config'; import { IgoLanguageModule, provideTranslation } from '@igo2/core/language'; -import { IgoMessageModule } from '@igo2/core/message'; +import { provideMessage } from '@igo2/core/message'; import { IgoErrorModule } from '@igo2/core/request'; import { DBConfig, NgxIndexedDBModule } from 'ngx-indexed-db'; @@ -45,17 +45,11 @@ const dbConfig: DBConfig = { HttpClientModule, IgoActivityModule.forRoot(), IgoErrorModule.forRoot(), - IgoMessageModule, NgxIndexedDBModule.forRoot(dbConfig) ], - providers: [], + providers: [provideMessage()], declarations: [], - exports: [ - IgoActivityModule, - IgoErrorModule, - IgoLanguageModule, - IgoMessageModule - ] + exports: [IgoActivityModule, IgoErrorModule, IgoLanguageModule] }) export class IgoCoreModule { static forRoot( 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 54d4b831fe..895e63d880 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 @@ -13,12 +13,10 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - CollapseDirective, - EntityStore, - ListItemDirective -} from '@igo2/common'; -import type { EntityStateManager } from '@igo2/common'; +import { CollapseDirective } from '@igo2/common/collapsible'; +import type { EntityStateManager } from '@igo2/common/entity'; +import { EntityStore } from '@igo2/common/entity'; +import { ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject } from 'rxjs'; 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 8f54d725a3..666d2441c8 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 @@ -14,11 +14,8 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - IgoBadgeIconDirective, - getEntityIcon, - getEntityTitle -} from '@igo2/common'; +import { IgoBadgeIconDirective } from '@igo2/common/badge'; +import { getEntityIcon, getEntityTitle } from '@igo2/common/entity'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject, Subscription } from 'rxjs'; 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 7613376f36..462df3b330 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 @@ -8,12 +8,8 @@ import { OnInit } from '@angular/core'; -import { - EntityStore, - EntityStoreWatcher, - ListComponent, - ListItemDirective -} from '@igo2/common'; +import { EntityStore, EntityStoreWatcher } from '@igo2/common/entity'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { BehaviorSubject, zip } from 'rxjs'; 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 c0c31597bf..594985a85b 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 @@ -23,7 +23,7 @@ import { MatListModule } from '@angular/material/list'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; 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 a1349d5c84..dc62f74bc7 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 @@ -11,7 +11,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { getEntityTitle } from '@igo2/common'; +import { getEntityTitle } from '@igo2/common/entity'; import { IgoLanguageModule } from '@igo2/core/language'; import { IgoMap } from '../../map/shared/map'; 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 7bcfeb59ee..773b4ab156 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 @@ -13,16 +13,12 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - EntityStore, - IconService, - LAYER_PLUS_ICON, - ListComponent, - ListItemDirective -} from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; +import { IconService, LAYER_PLUS_ICON } from '@igo2/common/icon'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; -import { StorageService } from '@igo2/core/storage'; +import { StorageScope, StorageService } from '@igo2/core/storage'; import { ObjectUtils } from '@igo2/utils'; import { Observable, Subscription } from 'rxjs'; @@ -100,6 +96,13 @@ export class CatalogLibaryComponent implements OnInit, OnDestroy { this.storageService.set('addedCatalogs', catalogs); } + get selectedCatalogId() { + return this.storageService.get('selectedCatalogId', StorageScope.SESSION); + } + set selectedCatalogId(id) { + this.storageService.set('selectedCatalogId', id, StorageScope.SESSION); + } + constructor( private capabilitiesService: CapabilitiesService, private messageService: MessageService, @@ -116,6 +119,14 @@ export class CatalogLibaryComponent implements OnInit, OnDestroy { ngOnInit() { this.store.state.clear(); + if (this.selectedCatalogId) { + const selectedCatalog = this.store + .all() + .find((item) => item.id === this.selectedCatalogId); + if (selectedCatalog) { + this.onCatalogSelect(selectedCatalog); + } + } this.predefinedCatalogs = this.predefinedCatalogs.map((c) => { c.id = Md5.hashStr((c.type || 'wms') + standardizeUrl(c.url)) as string; c.title = c.title === '' || !c.title ? c.url : c.title; @@ -141,6 +152,7 @@ export class CatalogLibaryComponent implements OnInit, OnDestroy { }, true ); + this.selectedCatalogId = catalog.id; this.catalogSelectChange.emit({ selected: true, catalog }); } 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 4256816157..b0c37558f1 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 @@ -3,6 +3,11 @@ import { NgModule } from '@angular/core'; import { AddCatalogDialogComponent } from './add-catalog-dialog.component'; import { CatalogLibaryComponent } from './catalog-library.component'; +export const CATALOG_LIBRARY_DIRECTIVES = [ + CatalogLibaryComponent, + AddCatalogDialogComponent +] as const; + /** * @deprecated import the CatalogLibaryComponent, AddCatalogDialogComponent directly */ diff --git a/packages/geo/src/lib/catalog/catalog-library/index.ts b/packages/geo/src/lib/catalog/catalog-library/index.ts index d7c00a91b2..4e175b4466 100644 --- a/packages/geo/src/lib/catalog/catalog-library/index.ts +++ b/packages/geo/src/lib/catalog/catalog-library/index.ts @@ -1,10 +1,3 @@ -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; +export * from './catalog-library.module'; diff --git a/packages/geo/src/lib/catalog/catalog.module.ts b/packages/geo/src/lib/catalog/catalog.module.ts index 0f435caf99..0ad5a0a740 100644 --- a/packages/geo/src/lib/catalog/catalog.module.ts +++ b/packages/geo/src/lib/catalog/catalog.module.ts @@ -1,12 +1,18 @@ import { NgModule } from '@angular/core'; -import { IgoCatalogBrowserModule } from './catalog-browser/catalog-browser.module'; -import { IgoCatalogLibraryModule } from './catalog-library/catalog-library.module'; +import { CatalogBrowserComponent } from './catalog-browser/catalog-browser.component'; +import { CATALOG_LIBRARY_DIRECTIVES } from './catalog-library'; + +export const CATALOG_DIRECTIVES = [ + CatalogBrowserComponent, + ...CATALOG_LIBRARY_DIRECTIVES +] as const; /** * @deprecated import the components directly or the CATALOG_DIRECTIVES */ @NgModule({ - exports: [IgoCatalogBrowserModule, IgoCatalogLibraryModule] + imports: [...CATALOG_DIRECTIVES], + exports: [...CATALOG_DIRECTIVES] }) export class IgoCatalogModule {} diff --git a/packages/geo/src/lib/catalog/index.ts b/packages/geo/src/lib/catalog/index.ts index 70ea993c38..3faa6b8ce2 100644 --- a/packages/geo/src/lib/catalog/index.ts +++ b/packages/geo/src/lib/catalog/index.ts @@ -1,12 +1,5 @@ -import { CatalogBrowserComponent } from './catalog-browser/catalog-browser.component'; -import { CATALOG_LIBRARY_DIRECTIVES } from './catalog-library'; - export * from './shared'; +export * from './catalog.module'; 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/catalog/shared/catalog.interface.ts b/packages/geo/src/lib/catalog/shared/catalog.interface.ts index 6e40a5e0ca..9f5c30999c 100644 --- a/packages/geo/src/lib/catalog/shared/catalog.interface.ts +++ b/packages/geo/src/lib/catalog/shared/catalog.interface.ts @@ -1,4 +1,4 @@ -import { EntityState } from '@igo2/common'; +import { EntityState } from '@igo2/common/entity'; import { TooltipType } from '../../layer/shared/layers/layer.interface'; import { QueryFormat } from '../../query/shared/query.enums'; diff --git a/packages/geo/src/lib/directions/directions-sources/directions-source.interface.ts b/packages/geo/src/lib/directions/directions-sources/directions-source.interface.ts index e491016f19..086f2b1c9f 100644 --- a/packages/geo/src/lib/directions/directions-sources/directions-source.interface.ts +++ b/packages/geo/src/lib/directions/directions-sources/directions-source.interface.ts @@ -1,3 +1,5 @@ +import { Provider } from '@angular/core'; + export interface DirectionsSourceOptions extends BaseDirectionsSourceOptions { osrm?: OsrmDirectionsSourceOptions; logo?: string; @@ -6,11 +8,27 @@ export interface DirectionsSourceOptions extends BaseDirectionsSourceOptions { export type OsrmDirectionsSourceOptions = BaseDirectionsSourceOptions; interface BaseDirectionsSourceOptions { - distance?: number; + name?: string; + baseUrl?: string; + profiles?: BaseDirectionsSourceOptionsProfile[]; +} + +export interface BaseDirectionsSourceOptionsProfile { enabled?: boolean; - limit?: number; - logo?: string; - reverseUrl?: string; - type?: string; - url?: string; + name: string; + authorization?: BaseDirectionsSourceOptionsProfileAuthorization; +} + +export interface BaseDirectionsSourceOptionsProfileAuthorization { + url: string; + property: string; +} + +export interface DirectionSourceFeature { + kind: KindT; + providers: Provider[]; +} + +export enum DirectionSourceKind { + OSRM = 0 } diff --git a/packages/geo/src/lib/directions/directions-sources/directions-source.provider.ts b/packages/geo/src/lib/directions/directions-sources/directions-source.provider.ts index 903aaf10a8..fb1dfaa1b0 100644 --- a/packages/geo/src/lib/directions/directions-sources/directions-source.provider.ts +++ b/packages/geo/src/lib/directions/directions-sources/directions-source.provider.ts @@ -3,6 +3,10 @@ import { HttpClient } from '@angular/common/http'; import { ConfigService } from '@igo2/core/config'; import { DirectionsSource } from './directions-source'; +import { + DirectionSourceFeature, + DirectionSourceKind +} from './directions-source.interface'; import { OsrmDirectionsSource } from './osrm-directions-source'; export function osrmDirectionsSourcesFactory( @@ -20,3 +24,10 @@ export function provideOsrmDirectionsSource() { deps: [HttpClient, ConfigService] }; } + +export function withOsrmSource(): DirectionSourceFeature { + return { + kind: DirectionSourceKind.OSRM, + providers: [provideOsrmDirectionsSource()] + }; +} diff --git a/packages/geo/src/lib/directions/directions-sources/directions-source.ts b/packages/geo/src/lib/directions/directions-sources/directions-source.ts index 1d50bb5ad8..36cc177103 100644 --- a/packages/geo/src/lib/directions/directions-sources/directions-source.ts +++ b/packages/geo/src/lib/directions/directions-sources/directions-source.ts @@ -1,12 +1,16 @@ +import { Position } from 'geojson'; import { Observable } from 'rxjs'; import { Direction, DirectionOptions } from '../shared/directions.interface'; +import { BaseDirectionsSourceOptionsProfile } from './directions-source.interface'; export abstract class DirectionsSource { - abstract enabled: boolean; - abstract getName(): string; + abstract profiles: BaseDirectionsSourceOptionsProfile[]; + abstract getSourceName(): string; + abstract getEnabledProfile(): BaseDirectionsSourceOptionsProfile; + abstract getProfileWithAuthorization(): BaseDirectionsSourceOptionsProfile; abstract route( - coordinates: [number, number][], + coordinates: Position[], directionsOptions: DirectionOptions ): Observable; } diff --git a/packages/geo/src/lib/directions/directions-sources/osrm-directions-source.ts b/packages/geo/src/lib/directions/directions-sources/osrm-directions-source.ts index 1601a932c5..ebbfae415b 100644 --- a/packages/geo/src/lib/directions/directions-sources/osrm-directions-source.ts +++ b/packages/geo/src/lib/directions/directions-sources/osrm-directions-source.ts @@ -2,11 +2,11 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { ConfigService } from '@igo2/core/config'; -import { customCacheHasher, uuid } from '@igo2/utils'; +import { uuid } from '@igo2/utils'; +import { Position } from 'geojson'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Cacheable } from 'ts-cacheable'; import { DirectionsFormat, @@ -14,52 +14,105 @@ import { } from '../shared/directions.enum'; import { Direction, DirectionOptions } from '../shared/directions.interface'; import { DirectionsSource } from './directions-source'; -import { OsrmDirectionsSourceOptions } from './directions-source.interface'; +import { + BaseDirectionsSourceOptionsProfile, + OsrmDirectionsSourceOptions +} from './directions-source.interface'; @Injectable() export class OsrmDirectionsSource extends DirectionsSource { - get enabled(): boolean { - return this.options.enabled !== false; + get options(): OsrmDirectionsSourceOptions { + return this._options; + } + + set options(value: OsrmDirectionsSourceOptions) { + this._options = value; + } + + get sourceName(): string { + return this._options.name; + } + + set sourceName(value: string) { + this._options.name = value; + } + + get baseUrl(): string { + return this._options.baseUrl; + } + + set baseUrl(value: string) { + this._options.baseUrl = value; + } + + get url(): string { + return `${this.baseUrl}${this.getEnabledProfile().name}/`; + } + + get profiles(): BaseDirectionsSourceOptionsProfile[] { + return this._options.profiles; } - set enabled(value: boolean) { - this.options.enabled = value; + + set profiles(value: BaseDirectionsSourceOptionsProfile[]) { + this._options.profiles = value; } - static _name = 'OSRM Québec'; - private directionsUrl = - 'https://geoegl.msp.gouv.qc.ca/services/itineraire/route/v1/driving/'; - private options: OsrmDirectionsSourceOptions; + + private _options: OsrmDirectionsSourceOptions; constructor( - private http: HttpClient, - private config: ConfigService + private _http: HttpClient, + private _config: ConfigService ) { super(); - this.options = this.config.getConfig('directionsSources.osrm') || {}; - this.directionsUrl = this.options.url || this.directionsUrl; + this._options = this._config.getConfig('directionsSources.osrm'); + if (!this.baseUrl) { + this.baseUrl = '/apis/itineraire/route/v1/'; + } + + if (!this.sourceName) { + this.sourceName = 'OSRM Québec'; + } + + if (!this.profiles) { + const profile: BaseDirectionsSourceOptionsProfile = { + enabled: true, + name: 'driving' + }; + this.profiles = [profile]; + } else { + if (!this.profiles.find((profile) => profile.enabled)) { + this.profiles[0].enabled = true; + } + } + } + + getSourceName(): string { + return this.sourceName; + } + + getEnabledProfile(): BaseDirectionsSourceOptionsProfile { + return this.profiles.find((profile) => profile.enabled); } - getName(): string { - return OsrmDirectionsSource._name; + getProfileWithAuthorization(): BaseDirectionsSourceOptionsProfile { + return this.profiles.find((profile) => profile.authorization); } route( - coordinates: [number, number][], + coordinates: Position[], directionsOptions: DirectionOptions = {} ): Observable { const directionsParams = this.getRouteParams(directionsOptions); return this.getRoute(coordinates, directionsParams); } - @Cacheable({ - maxCacheCount: 20, - cacheHasher: customCacheHasher - }) private getRoute( - coordinates: [number, number][], + coordinates: Position[], params: HttpParams ): Observable { - return this.http - .get(this.directionsUrl + coordinates.join(';'), { + const url: string = this.url; + return this._http + .get(url + coordinates.join(';'), { params }) .pipe(map((res) => this.extractRoutesData(res))); @@ -118,7 +171,7 @@ export class OsrmDirectionsSource extends DirectionsSource { return { id: uuid(), title: roadNetworkRoute.legs[0].summary, - source: OsrmDirectionsSource._name, + source: this.url, sourceType: SourceDirectionsType.Route, order: 1, format: DirectionsFormat.GeoJSON, diff --git a/packages/geo/src/lib/directions/directions.component.html b/packages/geo/src/lib/directions/directions.component.html index d5d311ee16..6adee688c9 100644 --- a/packages/geo/src/lib/directions/directions.component.html +++ b/packages/geo/src/lib/directions/directions.component.html @@ -6,6 +6,14 @@ > {{ 'igo.geo.directionsForm.toggleActive' | translate }} + + {{ 'igo.geo.directionsForm.toggleType' | translate }} + ; public projection: string = 'EPSG:4326'; + public hasOsrmPrivateAccess: boolean = false; + public twoSourcesAvailable: boolean = false; private zoomRoute$$: Subscription; private storeEmpty$$: Subscription; @@ -86,6 +94,7 @@ export class DirectionsComponent implements OnInit, OnDestroy { public previousStops: Stop[] = []; private searchs$$: Subscription[] = []; + private authenticated$$: Subscription; @Input() contextUri: string; @Input() stopsStore: StopsStore; @@ -96,6 +105,7 @@ export class DirectionsComponent implements OnInit, OnDestroy { @Input() length: number = 2; @Input() coordRoundedDecimals: number = 6; @Input() zoomToActiveRoute$: Subject = new Subject(); + @Input() authenticated$: BehaviorSubject; /** * Wheter one of the direction control is active @@ -109,15 +119,43 @@ export class DirectionsComponent implements OnInit, OnDestroy { return [this.selectStopInteraction, this.translateStop, this.selectedRoute]; } + get enabledProfileHasAuthorization() { + return this.directionsSourceService.sources[0].getEnabledProfile() + .authorization; + } + constructor( private cdRef: ChangeDetectorRef, + private http: HttpClient, private languageService: LanguageService, private directionsService: DirectionsService, + private directionsSourceService: DirectionsSourceService, private searchService: SearchService, - private queryService: QueryService + private queryService: QueryService, + private messageService: MessageService ) {} ngOnInit(): void { + this.authenticated$$ = this.authenticated$.subscribe( + (authenticated: boolean) => { + if (authenticated) { + const profileWithAuth: BaseDirectionsSourceOptionsProfile = + this.directionsSourceService.sources[0].getProfileWithAuthorization(); + if (profileWithAuth) { + this.http + .get(profileWithAuth.authorization.url) + .subscribe((user) => { + this.hasOsrmPrivateAccess = + user[profileWithAuth.authorization.property]; + }); + } + } + } + ); + this.twoSourcesAvailable = + this.directionsSourceService.sources[0].profiles.length === 2 + ? true + : false; this.queryService.queryEnabled = false; this.initEntityStores(); setTimeout(() => { @@ -134,6 +172,7 @@ export class DirectionsComponent implements OnInit, OnDestroy { this.storeChange$$.unsubscribe(); this.routesQueries$$.map((u) => u.unsubscribe()); this.zoomRoute$$.unsubscribe(); + this.authenticated$$.unsubscribe(); this.freezeStores(); } @@ -429,20 +468,18 @@ export class DirectionsComponent implements OnInit, OnDestroy { isOverview ? overviewDirectionsOptions : undefined ); if (routeResponse) { - routeResponse.map((res) => - this.routesQueries$$.push( - res.subscribe((directions) => { - this.routesFeatureStore.deleteMany(this.routesFeatureStore.all()); - directions.map((direction) => - addDirectionToRoutesFeatureStore( - this.routesFeatureStore, - direction, - this.projection, - direction === directions[0] ? true : false - ) - ); - }) - ) + this.routesQueries$$.push( + routeResponse.subscribe((directions) => { + this.routesFeatureStore.deleteMany(this.routesFeatureStore.all()); + directions.map((direction) => + addDirectionToRoutesFeatureStore( + this.routesFeatureStore, + direction, + this.projection, + direction === directions[0] ? true : false + ) + ); + }) ); } } @@ -466,4 +503,28 @@ export class DirectionsComponent implements OnInit, OnDestroy { : ol.removeInteraction(interaction) ); } + + onTogglePrivateModeControl(isActive: boolean) { + this.directionsSourceService.sources[0].profiles.forEach( + (profile) => (profile.enabled = false) + ); + if (isActive) { + this.directionsSourceService.sources[0].profiles.find( + (profile) => profile.authorization + ).enabled = true; + this.messageService.alert( + this.languageService.translate.instant( + 'igo.geo.directionsForm.forestRoadsWarning.text' + ), + this.languageService.translate.instant( + 'igo.geo.directionsForm.forestRoadsWarning.title' + ) + ); + } else { + this.directionsSourceService.sources[0].profiles.find( + (profile) => !profile.authorization + ).enabled = true; + } + this.getRoutes(); + } } diff --git a/packages/geo/src/lib/directions/directions.module.ts b/packages/geo/src/lib/directions/directions.module.ts index 292603ddab..baa7aba7d8 100644 --- a/packages/geo/src/lib/directions/directions.module.ts +++ b/packages/geo/src/lib/directions/directions.module.ts @@ -1,15 +1,12 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; -import { IgoSearchModule } from '../search/search.module'; 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 { DirectionsComponent } from './directions.component'; -import { provideDirectionsSourceService } from './shared/directions-source.service'; @NgModule({ imports: [ - IgoSearchModule.forRoot(), DirectionsComponent, DirectionsInputsComponent, DirectionsButtonsComponent, @@ -20,8 +17,7 @@ import { provideDirectionsSourceService } from './shared/directions-source.servi DirectionsInputsComponent, DirectionsButtonsComponent, DirectionsResultsComponent - ], - providers: [provideDirectionsSourceService()] + ] }) export class IgoDirectionsModule { /** diff --git a/packages/geo/src/lib/directions/directions.provider.ts b/packages/geo/src/lib/directions/directions.provider.ts new file mode 100644 index 0000000000..a793d6d739 --- /dev/null +++ b/packages/geo/src/lib/directions/directions.provider.ts @@ -0,0 +1,26 @@ +import { Provider } from '@angular/core'; + +import { + DirectionSourceFeature, + DirectionSourceKind +} from './directions-sources'; +import { DirectionsService } from './shared'; +import { provideDirectionsSourceService } from './shared/directions-source.service'; + +export function provideDirection( + ...sources: DirectionSourceFeature[] +): Provider[] { + const providers: Provider[] = [ + { + provide: DirectionsService, + useClass: DirectionsService + }, + provideDirectionsSourceService() + ]; + + for (const source of sources) { + providers.push(...source.providers); + } + + return providers; +} diff --git a/packages/geo/src/lib/directions/index.ts b/packages/geo/src/lib/directions/index.ts index 32e01b4571..4b17db929c 100644 --- a/packages/geo/src/lib/directions/index.ts +++ b/packages/geo/src/lib/directions/index.ts @@ -1,5 +1,6 @@ export * from './shared'; export * from './directions.component'; +export * from './directions.provider'; export * from './directions-sources'; export * from './directions-inputs'; export * from './directions-buttons'; diff --git a/packages/geo/src/lib/directions/shared/directions.service.ts b/packages/geo/src/lib/directions/shared/directions.service.ts index 749934954b..cf24d3d2c1 100644 --- a/packages/geo/src/lib/directions/shared/directions.service.ts +++ b/packages/geo/src/lib/directions/shared/directions.service.ts @@ -6,6 +6,7 @@ import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { SubjectStatus } from '@igo2/utils'; +import { Position } from 'geojson'; import html2canvas from 'html2canvas'; import jsPDF from 'jspdf'; import 'jspdf-autotable'; @@ -25,9 +26,7 @@ import { formatInstruction } from './directions.utils'; -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class DirectionsService { constructor( private directionsSourceService: DirectionsSourceService, @@ -39,22 +38,22 @@ export class DirectionsService { ) {} route( - coordinates: [number, number][], + coordinates: Position[], directionsOptions: DirectionOptions = {} - ): Observable[] { + ): Observable { if (coordinates.length === 0) { return; } - return this.directionsSourceService.sources - .filter((source: DirectionsSource) => source.enabled) - .map((source: DirectionsSource) => - this.routeSource(source, coordinates, directionsOptions) - ); + return this.routeSource( + this.directionsSourceService.sources[0], + coordinates, + directionsOptions + ); } routeSource( source: DirectionsSource, - coordinates: [number, number][], + coordinates: Position[], directionsOptions: DirectionOptions = {} ): Observable { const request = source.route(coordinates, directionsOptions); @@ -73,14 +72,14 @@ export class DirectionsService { format: 'Letter', unit: 'mm' // default }); - const dimensions = [ - doc.internal.pageSize.width, - doc.internal.pageSize.height - ]; - const margins = [10, 10, 10, 10]; - const width = dimensions[0]; - const height = dimensions[1] - margins[0] - margins[2]; - const size: [number, number] = [width, height]; + + const { width: pageWidth, height: pageHeight } = doc.internal.pageSize; + + /** top | right | bottom | left */ + const margins: [number, number, number, number] = [20, 10, 20, 10]; + const width = pageWidth - margins[3] - margins[1]; + const height = pageHeight - margins[0] - margins[2]; + const imageDimensions: [number, number] = [width, height]; const title = `${direction.title} (${formatDistance( direction.distance @@ -91,10 +90,16 @@ export class DirectionsService { align: 'center' }); - margins[0] += 20; const resolution = 96; // Default is 96 this.printService - .addMap(doc, map, resolution, size, margins, PrintLegendPosition.none) + .addMap( + doc, + map, + resolution, + imageDimensions, + margins, + PrintLegendPosition.none + ) .subscribe(async (status: SubjectStatus) => { if (status === SubjectStatus.Done) { await this.addInstructions(doc, direction, title); diff --git a/packages/geo/src/lib/directions/shared/directions.utils.ts b/packages/geo/src/lib/directions/shared/directions.utils.ts index 182f9bf5c9..879d3b4f76 100644 --- a/packages/geo/src/lib/directions/shared/directions.utils.ts +++ b/packages/geo/src/lib/directions/shared/directions.utils.ts @@ -425,7 +425,7 @@ export function formatDuration(duration: number): string { export function formatInstruction( type, modifier, - route, + route: string = 'Voie', direction, stepPosition, exit, diff --git a/packages/geo/src/lib/directions/shared/store.ts b/packages/geo/src/lib/directions/shared/store.ts index bd8b64f5bf..f6afb0d04c 100644 --- a/packages/geo/src/lib/directions/shared/store.ts +++ b/packages/geo/src/lib/directions/shared/store.ts @@ -1,4 +1,4 @@ -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { BehaviorSubject } from 'rxjs'; 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 e6965827ed..6433d0d90e 100644 --- a/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts +++ b/packages/geo/src/lib/draw/draw/draw-shorcuts.component.ts @@ -7,7 +7,11 @@ import { } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; -import { IconSvg, IgoIconComponent, KEYBOARD_ESC_ICON } from '@igo2/common'; +import { + IconSvg, + IgoIconComponent, + KEYBOARD_ESC_ICON +} from '@igo2/common/icon'; import { IgoLanguageModule } from '@igo2/core/language'; @Component({ diff --git a/packages/geo/src/lib/draw/draw/draw.component.ts b/packages/geo/src/lib/draw/draw/draw.component.ts index f1b6f86c36..b706668cb2 100644 --- a/packages/geo/src/lib/draw/draw/draw.component.ts +++ b/packages/geo/src/lib/draw/draw/draw.component.ts @@ -42,7 +42,7 @@ import { EntityTableColumnRenderer, EntityTableComponent, EntityTableTemplate -} from '@igo2/common'; +} from '@igo2/common/entity'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/geo/src/lib/environment/environment.interface.ts b/packages/geo/src/lib/environment/environment.interface.ts index c2abc41cc8..e350a31002 100644 --- a/packages/geo/src/lib/environment/environment.interface.ts +++ b/packages/geo/src/lib/environment/environment.interface.ts @@ -1,4 +1,5 @@ -import { DOMOptions, DepotOptions } from '@igo2/common'; +import { DOMOptions } from '@igo2/common/dom'; +import { DepotOptions } from '@igo2/common/environment'; import { CatalogServiceOptions } from '../catalog/shared/catalog.interface'; import { OptionsApiOptions } from '../datasource/shared/options/options-api.interface'; 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 6785b422f0..a84859a381 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 @@ -20,13 +20,9 @@ import { import { MatIconModule } from '@angular/material/icon'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; -import { - ImageErrorDirective, - SecureImagePipe, - getEntityIcon, - getEntityTitle -} from '@igo2/common'; -import type { Toolbox } from '@igo2/common'; +import { getEntityIcon, getEntityTitle } from '@igo2/common/entity'; +import { ImageErrorDirective, SecureImagePipe } from '@igo2/common/image'; +import type { Toolbox } from '@igo2/common/tool'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; 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 2f1f2bfcc5..7c3de93e04 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 @@ -3,11 +3,16 @@ import { NgModule } from '@angular/core'; import { FeatureDetailsComponent } from './feature-details.component'; import { FeatureDetailsDirective } from './feature-details.directive'; +export const FEATURE_DETAILS_DIRECTIVES = [ + FeatureDetailsComponent, + FeatureDetailsDirective +] as const; + /** * @deprecated import the FeatureDetailsComponent, FeatureDetailsDirective directly or the FEATURE_DETAILS_DIRECTIVES for all */ @NgModule({ - imports: [FeatureDetailsComponent, FeatureDetailsDirective], - exports: [FeatureDetailsComponent, FeatureDetailsDirective] + imports: [...FEATURE_DETAILS_DIRECTIVES], + exports: [...FEATURE_DETAILS_DIRECTIVES] }) 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 index 90834e59ef..6e81d66fd1 100644 --- a/packages/geo/src/lib/feature/feature-details/index.ts +++ b/packages/geo/src/lib/feature/feature-details/index.ts @@ -1,10 +1,3 @@ -import { FeatureDetailsComponent } from './feature-details.component'; -import { FeatureDetailsDirective } from './feature-details.directive'; - +export * from './feature-details.module'; 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 83d082a7a2..aafe267ca8 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 @@ -8,8 +8,8 @@ import { ViewChild } from '@angular/core'; -import { Form, getEntityRevision } from '@igo2/common'; -import { FormComponent } from '@igo2/common'; +import { getEntityRevision } from '@igo2/common/entity'; +import { Form, FormComponent } from '@igo2/common/form'; import { uuid } from '@igo2/utils'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/geo/src/lib/feature/feature.module.ts b/packages/geo/src/lib/feature/feature.module.ts index e3b6a7f673..3e62b927ec 100644 --- a/packages/geo/src/lib/feature/feature.module.ts +++ b/packages/geo/src/lib/feature/feature.module.ts @@ -1,12 +1,18 @@ import { NgModule } from '@angular/core'; -import { IgoFeatureDetailsModule } from './feature-details/feature-details.module'; -import { IgoFeatureFormModule } from './feature-form/feature-form.module'; +import { FEATURE_DETAILS_DIRECTIVES } from './feature-details'; +import { FeatureFormComponent } from './feature-form/feature-form.component'; + +export const FEATURE_DIRECTIVES = [ + ...FEATURE_DETAILS_DIRECTIVES, + FeatureFormComponent +] as const; /** * @deprecated import the components directly or the FEATURE_DIRECTIVES for the set */ @NgModule({ - exports: [IgoFeatureDetailsModule, IgoFeatureFormModule] + imports: [...FEATURE_DIRECTIVES], + exports: [...FEATURE_DIRECTIVES] }) export class IgoFeatureModule {} diff --git a/packages/geo/src/lib/feature/index.ts b/packages/geo/src/lib/feature/index.ts index b76439c793..a1f0f52c24 100644 --- a/packages/geo/src/lib/feature/index.ts +++ b/packages/geo/src/lib/feature/index.ts @@ -1,11 +1,4 @@ -import { FEATURE_DETAILS_DIRECTIVES } from './feature-details'; -import { FeatureFormComponent } from './feature-form/feature-form.component'; - export * from './shared'; +export * from './feature.module'; 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.interfaces.ts b/packages/geo/src/lib/feature/shared/feature.interfaces.ts index 981ac2a1a4..4f5fb930a4 100644 --- a/packages/geo/src/lib/feature/shared/feature.interfaces.ts +++ b/packages/geo/src/lib/feature/shared/feature.interfaces.ts @@ -4,7 +4,7 @@ import { EntityKey, EntityStoreOptions, EntityStoreStrategyOptions -} from '@igo2/common'; +} from '@igo2/common/entity'; import OlFeature from 'ol/Feature'; import type { default as OlGeometry } from 'ol/geom/Geometry'; diff --git a/packages/geo/src/lib/feature/shared/feature.utils.ts b/packages/geo/src/lib/feature/shared/feature.utils.ts index 6eb96d70a0..1a1c2b6e0a 100644 --- a/packages/geo/src/lib/feature/shared/feature.utils.ts +++ b/packages/geo/src/lib/feature/shared/feature.utils.ts @@ -5,7 +5,7 @@ import { getEntityProperty, getEntityRevision, getEntityTitle -} from '@igo2/common'; +} from '@igo2/common/entity'; import { uuid } from '@igo2/utils'; import OlFeature from 'ol/Feature'; diff --git a/packages/geo/src/lib/feature/shared/store.ts b/packages/geo/src/lib/feature/shared/store.ts index 66ec051da4..52365e6d48 100644 --- a/packages/geo/src/lib/feature/shared/store.ts +++ b/packages/geo/src/lib/feature/shared/store.ts @@ -1,4 +1,4 @@ -import { EntityKey, EntityStore, getEntityId } from '@igo2/common'; +import { EntityKey, EntityStore, getEntityId } from '@igo2/common/entity'; import OlFeature from 'ol/Feature'; import * as olextent from 'ol/extent'; diff --git a/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts b/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts index 3ac0dfa635..0f84d6276e 100644 --- a/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts +++ b/packages/geo/src/lib/feature/shared/strategies/geo-properties.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import { ObjectUtils } from '@igo2/utils'; import { Subscription, debounceTime, pairwise } from 'rxjs'; diff --git a/packages/geo/src/lib/feature/shared/strategies/in-map-extent.ts b/packages/geo/src/lib/feature/shared/strategies/in-map-extent.ts index 37ea3efa51..f569fb66ef 100644 --- a/packages/geo/src/lib/feature/shared/strategies/in-map-extent.ts +++ b/packages/geo/src/lib/feature/shared/strategies/in-map-extent.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import * as olextent from 'ol/extent'; diff --git a/packages/geo/src/lib/feature/shared/strategies/in-map-resolution.ts b/packages/geo/src/lib/feature/shared/strategies/in-map-resolution.ts index 3b1835215d..c8ff2487ff 100644 --- a/packages/geo/src/lib/feature/shared/strategies/in-map-resolution.ts +++ b/packages/geo/src/lib/feature/shared/strategies/in-map-resolution.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import { Subscription, debounceTime } from 'rxjs'; diff --git a/packages/geo/src/lib/feature/shared/strategies/loading-layer.ts b/packages/geo/src/lib/feature/shared/strategies/loading-layer.ts index e1368cc078..3fa5bf3990 100644 --- a/packages/geo/src/lib/feature/shared/strategies/loading-layer.ts +++ b/packages/geo/src/lib/feature/shared/strategies/loading-layer.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import OlEvent from 'ol/events/Event'; diff --git a/packages/geo/src/lib/feature/shared/strategies/loading.ts b/packages/geo/src/lib/feature/shared/strategies/loading.ts index 1e1bc44959..e016ec7b0c 100644 --- a/packages/geo/src/lib/feature/shared/strategies/loading.ts +++ b/packages/geo/src/lib/feature/shared/strategies/loading.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import { Subscription } from 'rxjs'; diff --git a/packages/geo/src/lib/feature/shared/strategies/search.ts b/packages/geo/src/lib/feature/shared/strategies/search.ts index 7a82deb4b1..b6723fce0a 100644 --- a/packages/geo/src/lib/feature/shared/strategies/search.ts +++ b/packages/geo/src/lib/feature/shared/strategies/search.ts @@ -1,4 +1,4 @@ -import { EntityStoreStrategy } from '@igo2/common'; +import { EntityStoreStrategy } from '@igo2/common/entity'; import { DocumentOptions, Document as FlexSearchDocument } from 'flexsearch'; import { skipWhile } from 'rxjs/operators'; diff --git a/packages/geo/src/lib/feature/shared/strategies/selection.ts b/packages/geo/src/lib/feature/shared/strategies/selection.ts index 602c47d8e2..3d3bb8de8a 100644 --- a/packages/geo/src/lib/feature/shared/strategies/selection.ts +++ b/packages/geo/src/lib/feature/shared/strategies/selection.ts @@ -1,4 +1,8 @@ -import { EntityKey, EntityRecord, EntityStoreStrategy } from '@igo2/common'; +import { + EntityKey, + EntityRecord, + EntityStoreStrategy +} from '@igo2/common/entity'; import OlFeature from 'ol/Feature'; import MapBrowserPointerEvent from 'ol/MapBrowserEvent'; diff --git a/packages/geo/src/lib/filter/filter.module.ts b/packages/geo/src/lib/filter/filter.module.ts index 515d3ee365..8a711bd938 100644 --- a/packages/geo/src/lib/filter/filter.module.ts +++ b/packages/geo/src/lib/filter/filter.module.ts @@ -24,7 +24,7 @@ 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 = [ +export const FILTER_DIRECTIVES = [ FilterableDataSourcePipe, TimeFilterButtonComponent, TimeFilterFormComponent, @@ -43,13 +43,14 @@ const DIRECTIVES = [ SpatialFilterItemComponent, OgcFilterTimeComponent, OgcFilterTimeSliderComponent -]; +] as const; + /** * @deprecated import the components directly or the FILTER_DIRECTIVES for the set */ @NgModule({ - imports: DIRECTIVES, - exports: DIRECTIVES, + imports: [...FILTER_DIRECTIVES], + exports: [...FILTER_DIRECTIVES], providers: [ TimeFilterService, OGCFilterService, diff --git a/packages/geo/src/lib/filter/index.ts b/packages/geo/src/lib/filter/index.ts index f6226426e9..cc4f11e102 100644 --- a/packages/geo/src/lib/filter/index.ts +++ b/packages/geo/src/lib/filter/index.ts @@ -1,29 +1,5 @@ -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 './filter.module'; export * from './time-filter-form'; export * from './time-filter-item'; export * from './time-filter-list'; @@ -38,24 +14,3 @@ 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 498a3c62d1..b40190a5e9 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 @@ -10,7 +10,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { ListItemDirective } from '@igo2/common'; +import { ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { Layer } from '../../layer/shared/layers/layer'; 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 2218a9addc..a00637704d 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 @@ -25,7 +25,7 @@ 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 { DOMOptions, DOMService, DOMValue } from '@igo2/common/dom'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; 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 9f8532ec00..3e1a86862f 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 @@ -101,6 +101,8 @@ export class OgcFilterTimeComponent implements OnInit { @ViewChild('beginTime') beginTime: HTMLInputElement; @ViewChild('endTime') endTime: HTMLInputElement; + private filterOriginConfig: OgcFilterDuringOptions; + get step(): string { return this.datasource.options.stepDate ? this.datasource.options.stepDate @@ -152,6 +154,8 @@ export class OgcFilterTimeComponent implements OnInit { constructor(public ogcFilterTimeService: OGCFilterTimeService) {} ngOnInit() { + this.filterOriginConfig = this.datasource.options.ogcFilters + .filters as OgcFilterDuringOptions; if (this.currentFilter.sliderOptions) { this.currentFilter.sliderOptions.enabled = this.currentFilter.sliderOptions.enabled !== undefined @@ -180,14 +184,14 @@ export class OgcFilterTimeComponent implements OnInit { const interval = filter.match(/years|months|weeks|days|hours|seconds/); if (filter.match(/\+/)) { const intervalInt = parseInt( - filter.substring(filter.search('+') + 1, interval.index), + filter.substring(filter.indexOf('+') + 1, interval.index), 10 ); return moment().add(intervalInt, interval[0]).toDate(); } if (filter.match(/\-/)) { const intervalInt = parseInt( - filter.substring(filter.search('-') + 1, interval.index), + filter.substring(filter.indexOf('-') + 1, interval.index), 10 ); return moment().subtract(intervalInt, interval[0]).toDate(); @@ -199,14 +203,14 @@ export class OgcFilterTimeComponent implements OnInit { const interval = filter.match(/years|months|weeks|days|hours|seconds/); if (filter.match(/\+/)) { const intervalInt = parseInt( - filter.substring(filter.search('+') + 1, interval.index), + filter.substring(filter.indexOf('+') + 1, interval.index), 10 ); return moment(_now).add(intervalInt, interval[0]).toDate(); } if (filter.match(/\-/)) { const intervalInt = parseInt( - filter.substring(filter.search('-') + 1, interval.index), + filter.substring(filter.indexOf('-') + 1, interval.index), 10 ); return moment(_now).subtract(intervalInt, interval[0]).toDate(); @@ -223,9 +227,13 @@ export class OgcFilterTimeComponent implements OnInit { } } - changeTemporalProperty(value, position?, refreshFilter = true) { - if (!this.isValidDate(value)) { - return; + changeTemporalProperty( + value: string | Date, + position?, + refreshFilter = true + ) { + if (typeof value === 'string') { + value = new Date(value); } let valueTmp = this.getDateTime(value, position); if (this.isCalendarYearMode()) { @@ -739,27 +747,24 @@ export class OgcFilterTimeComponent implements OnInit { } resetFilter() { - let filterOriginConfig = this.datasource.options.ogcFilters - .filters as OgcFilterDuringOptions; - let minDefaultDate; let maxDefaultDate; let minDefaultISOString; let maxDefaultISOString; if (this.calendarTypeYear) { - if (filterOriginConfig.end === 'today') { + if (this.filterOriginConfig.end === 'today') { let todayDateStringNoTime = new Date().toLocaleDateString('en-CA'); // '2022-02-13' maxDefaultISOString = `${todayDateStringNoTime.substring(0, 4)}-01-01`; } else { - maxDefaultISOString = `${filterOriginConfig.end.substring(0, 4)}-01-01`; + maxDefaultISOString = `${this.filterOriginConfig.end.substring(0, 4)}-01-01`; } - minDefaultISOString = `${filterOriginConfig.begin.substring(0, 4)}-01-01`; + minDefaultISOString = `${this.filterOriginConfig.begin.substring(0, 4)}-01-01`; minDefaultDate = this.getDateFromStringWithoutTime(minDefaultISOString); maxDefaultDate = this.getDateFromStringWithoutTime(maxDefaultISOString); } else { - minDefaultDate = this.parseFilter(filterOriginConfig.begin); - maxDefaultDate = this.parseFilter(filterOriginConfig.end); + minDefaultDate = this.parseFilter(this.filterOriginConfig.begin); + maxDefaultDate = this.parseFilter(this.filterOriginConfig.end); minDefaultISOString = minDefaultDate.toISOString(); maxDefaultISOString = maxDefaultDate.toISOString(); } @@ -783,8 +788,4 @@ export class OgcFilterTimeComponent implements OnInit { this.setFilterStateDisable(); this.updateValues(); } - - private isValidDate(date: Date) { - return date instanceof Date && !isNaN(date.getTime()); - } } 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 65862a1d0f..ee6c64ecbb 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 @@ -3,7 +3,7 @@ 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 { ListItemDirective } from '@igo2/common/list'; import { MapBase } from '../../map'; import { OgcFilterFormComponent } from '../ogc-filter-form/ogc-filter-form.component'; 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 a0a74f5bdb..bed850ca09 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 @@ -8,7 +8,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { CollapseDirective } from '@igo2/common'; +import { CollapseDirective } from '@igo2/common/collapsible'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject, Subscription } from 'rxjs'; 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 57f8c164ba..3d1fd740e5 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,7 +1,7 @@ import { NgFor, NgIf } from '@angular/common'; import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; -import { ListComponent, ListItemDirective } from '@igo2/common'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { Layer } from '../../layer/shared/layers/layer'; diff --git a/packages/geo/src/lib/filter/shared/ogc-filter.interface.ts b/packages/geo/src/lib/filter/shared/ogc-filter.interface.ts index 78ce159d46..e59ebe12cc 100644 --- a/packages/geo/src/lib/filter/shared/ogc-filter.interface.ts +++ b/packages/geo/src/lib/filter/shared/ogc-filter.interface.ts @@ -1,4 +1,4 @@ -import { DOMValue } from '@igo2/common'; +import { DOMValue } from '@igo2/common/dom'; import olFormatFilter from 'ol/format/filter/Filter'; import olGeometry from 'ol/geom/Geometry'; diff --git a/packages/geo/src/lib/filter/shared/ogc-filter.ts b/packages/geo/src/lib/filter/shared/ogc-filter.ts index 75d116674d..18a6feb278 100644 --- a/packages/geo/src/lib/filter/shared/ogc-filter.ts +++ b/packages/geo/src/lib/filter/shared/ogc-filter.ts @@ -913,12 +913,62 @@ export class OgcFilterWriter { public parseFilterOptionDate(value: string, defaultValue?: string): string { if (!value) { return defaultValue; - } else if (value === 'today') { - return undefined; + } else if ( + value.toLowerCase().includes('now') || + value.toLowerCase().includes('today') + ) { + return this.parseDateOperation(value); } else if (moment(value).isValid()) { return value; } else { return undefined; } } + /** + * this function to parse date with specific format + * exemple 'today + 1 days' or 'now + 1 years' + * @param value string date + * @returns date + */ + private parseDateOperation(value: string): string { + const operationSplitted = value.toLowerCase().split(' '); + const leftOperand = operationSplitted[0]; + const operator = ['+', '-'].includes(operationSplitted[1]) + ? operationSplitted[1] + : undefined; + const rightOperand = /^[0-9]*$/.test(operationSplitted[2]) + ? operationSplitted[2] + : undefined; + const rightUnitOperand = ( + ['years', 'months', 'weeks', 'days', 'hours', 'seconds'].includes( + operationSplitted[3] + ) + ? operationSplitted[3] + : undefined + ) as moment.DurationInputArg2; + + if (!operator || !rightUnitOperand || !rightOperand) { + return leftOperand === 'now' + ? moment().format() + : moment().endOf('day').format(); + } + + if (operator === '+') { + return leftOperand === 'now' + ? moment().add(parseInt(rightOperand, 10), rightUnitOperand).format() + : moment() + .endOf('day') + .add(parseInt(rightOperand, 10), rightUnitOperand) + .format(); + } else { + return leftOperand === 'now' + ? moment() + .subtract(parseInt(rightOperand, 10), rightUnitOperand) + .format() + : moment() + .endOf('day') + .subtract(parseInt(rightOperand, 10), rightUnitOperand) + .format(); + } + } } 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 84fd9a715d..01a4bf3307 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 @@ -35,7 +35,7 @@ import { EntityTableColumnRenderer, EntityTableComponent, EntityTableTemplate -} from '@igo2/common'; +} from '@igo2/common/entity'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; 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 fb79da8824..b29180ab0f 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 @@ -19,7 +19,7 @@ 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 { EntityStore } from '@igo2/common/entity'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; 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 32f4e9b167..ea76a55c71 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 @@ -16,7 +16,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatTabsModule } from '@angular/material/tabs'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { IgoLanguageModule } from '@igo2/core/language'; import { Feature } from '../../../feature'; 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 d5badba042..c914fdd79f 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 @@ -10,7 +10,7 @@ import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { ListItemDirective } from '@igo2/common'; +import { ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { TimeFilterableDataSourceOptions } from '../../datasource/shared/datasources/wms-datasource.interface'; 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 69074288bf..cac90ccf82 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 @@ -5,7 +5,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { CollapseDirective } from '@igo2/common'; +import { CollapseDirective } from '@igo2/common/collapsible'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject, Subscription } from 'rxjs'; 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 c1115abccf..4850592154 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 @@ -6,7 +6,7 @@ import { Input } from '@angular/core'; -import { ListComponent, ListItemDirective } from '@igo2/common'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { Layer } from '../../layer/shared/layers/layer'; import { FilterableDataSourcePipe } from '../shared/filterable-datasource.pipe'; 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 8948ae7570..586a508785 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 @@ -17,7 +17,7 @@ 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 { IgoFormFieldComponent } from '@igo2/common/form'; import { IgoLanguageModule } from '@igo2/core/language'; import type { Type } from 'ol/geom/Geometry'; 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 73654539af..84cbf9e69a 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 @@ -3,6 +3,11 @@ import { NgModule } from '@angular/core'; import { GeometryFormFieldInputComponent } from './geometry-form-field-input.component'; import { GeometryFormFieldComponent } from './geometry-form-field.component'; +export const GEOMETRY_FORM_FIELD_DIRECTIVES = [ + GeometryFormFieldComponent, + GeometryFormFieldInputComponent +] as const; + /** * @deprecated import the components directly or the GEOMETRY_FORM_FIELD_DIRECTIVES for the set */ diff --git a/packages/geo/src/lib/geometry/geometry-form-field/index.ts b/packages/geo/src/lib/geometry/geometry-form-field/index.ts index b437a7effb..c5462c5b47 100644 --- a/packages/geo/src/lib/geometry/geometry-form-field/index.ts +++ b/packages/geo/src/lib/geometry/geometry-form-field/index.ts @@ -1,10 +1,3 @@ -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.module'; export * from './geometry-form-field.component'; - -export const GEOMETRY_FORM_FIELD_DIRECTIVES = [ - GeometryFormFieldComponent, - GeometryFormFieldInputComponent -] as const; +export * from './geometry-form-field-input.component'; diff --git a/packages/geo/src/lib/geometry/shared/geometry.interfaces.ts b/packages/geo/src/lib/geometry/shared/geometry.interfaces.ts index 52519f834c..1331efa3b8 100644 --- a/packages/geo/src/lib/geometry/shared/geometry.interfaces.ts +++ b/packages/geo/src/lib/geometry/shared/geometry.interfaces.ts @@ -1,4 +1,4 @@ -import { FormFieldInputs } from '@igo2/common'; +import { FormFieldInputs } from '@igo2/common/form'; import type { Type } from 'ol/geom/Geometry'; 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 a63d9ab2db..24cf3403b2 100644 --- a/packages/geo/src/lib/import-export/import-export.module.ts +++ b/packages/geo/src/lib/import-export/import-export.module.ts @@ -4,6 +4,12 @@ import { ExportButtonComponent } from './export-button/export-button.component'; import { ImportExportComponent } from './import-export/import-export.component'; import { DropGeoFileDirective } from './shared/drop-geo-file.directive'; +export const IMPORT_EXPORT_DIRECTIVES = [ + ImportExportComponent, + DropGeoFileDirective, + ExportButtonComponent +] as const; + /** * @deprecated import the components directly or IMPORT_EXPORT_DIRECTIVES for the set */ 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 021e3b48a3..3f9c4013a5 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 @@ -27,14 +27,12 @@ import { } from '@angular/material/slide-toggle'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - ConfirmDialogService, - CustomHtmlComponent, - EntityRecord, - SpinnerComponent, - Workspace -} from '@igo2/common'; -import type { WorkspaceStore } from '@igo2/common'; +import { ConfirmDialogService } from '@igo2/common/confirm-dialog'; +import { CustomHtmlComponent } from '@igo2/common/custom-html'; +import { EntityRecord } from '@igo2/common/entity'; +import { SpinnerComponent } from '@igo2/common/spinner'; +import type { WorkspaceStore } from '@igo2/common/workspace'; +import { Workspace } from '@igo2/common/workspace'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/geo/src/lib/import-export/index.ts b/packages/geo/src/lib/import-export/index.ts index 7e2910f3d5..ffeb5f583c 100644 --- a/packages/geo/src/lib/import-export/index.ts +++ b/packages/geo/src/lib/import-export/index.ts @@ -1,13 +1,4 @@ -import { ExportButtonComponent } from './export-button'; -import { ImportExportComponent } from './import-export'; -import { DropGeoFileDirective } from './shared'; - export * from './shared'; +export * from './import-export.module'; 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 152dd5f332..881b95528d 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 @@ -7,7 +7,8 @@ import { OnInit } from '@angular/core'; -import { ConfirmDialogService, DragAndDropDirective } from '@igo2/common'; +import { ConfirmDialogService } from '@igo2/common/confirm-dialog'; +import { DragAndDropDirective } from '@igo2/common/drag-drop'; import { ConfigService } from '@igo2/core/config'; import { MessageService } from '@igo2/core/message'; diff --git a/packages/geo/src/lib/import-export/shared/export.service.ts b/packages/geo/src/lib/import-export/shared/export.service.ts index d81e70f975..5089a4f04b 100644 --- a/packages/geo/src/lib/import-export/shared/export.service.ts +++ b/packages/geo/src/lib/import-export/shared/export.service.ts @@ -16,6 +16,8 @@ import { } from './export.errors'; import { EncodingFormat, ExportFormat } from './export.type'; +const SHAPEFILE_FIELD_MAX_LENGHT = 255; + @Injectable({ providedIn: 'root' }) @@ -78,9 +80,16 @@ export class ExportService { } return olFeatures.map((olFeature: OlFeature) => { - const keys = olFeature + let keys = olFeature .getKeys() .filter((key: string) => !key.startsWith(excludePrefix)); + + if (format === ExportFormat.Shapefile && olFeature.get('_style')) { + const style = JSON.stringify(olFeature.get('_style')); + if (style.length > SHAPEFILE_FIELD_MAX_LENGHT) + keys = keys.filter((key) => key !== '_style'); + } + const properties = keys.reduce( (acc: object, key: string) => { acc[key] = olFeature.get(key); diff --git a/packages/geo/src/lib/import-export/shared/export.utils.ts b/packages/geo/src/lib/import-export/shared/export.utils.ts index f7dfc6323b..23cc8e6b49 100644 --- a/packages/geo/src/lib/import-export/shared/export.utils.ts +++ b/packages/geo/src/lib/import-export/shared/export.utils.ts @@ -2,7 +2,7 @@ import { EntityTableColumn, EntityTableColumnRenderer, getEntityProperty -} from '@igo2/common'; +} from '@igo2/common/entity'; import { MessageService } from '@igo2/core/message'; import { downloadContent } from '@igo2/utils'; diff --git a/packages/geo/src/lib/import-export/shared/import.utils.ts b/packages/geo/src/lib/import-export/shared/import.utils.ts index 7099bd2b32..5f04f9bb50 100644 --- a/packages/geo/src/lib/import-export/shared/import.utils.ts +++ b/packages/geo/src/lib/import-export/shared/import.utils.ts @@ -1,4 +1,4 @@ -import { ConfirmDialogService } from '@igo2/common'; +import { ConfirmDialogService } from '@igo2/common/confirm-dialog'; import { MessageService } from '@igo2/core/message'; import { uuid } from '@igo2/utils'; diff --git a/packages/geo/src/lib/layer/index.ts b/packages/geo/src/lib/layer/index.ts index 171cc17cba..69f89edba3 100644 --- a/packages/geo/src/lib/layer/index.ts +++ b/packages/geo/src/lib/layer/index.ts @@ -1,15 +1,5 @@ -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.module'; export * from './layer-item'; export * from './layer-legend'; export * from './layer-legend-item'; @@ -18,15 +8,3 @@ 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-legend-list/layer-legend-list.component.ts b/packages/geo/src/lib/layer/layer-legend-list/layer-legend-list.component.ts index 851a394d4c..756063a9fb 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 @@ -12,7 +12,7 @@ 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 { ListComponent, ListItemDirective } from '@igo2/common/list'; import { IgoLanguageModule } from '@igo2/core/language'; import { 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 be3ca40727..049f89ec96 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 @@ -19,12 +19,9 @@ import { MatListModule } from '@angular/material/list'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - CollapseDirective, - ImageErrorDirective, - SanitizeHtmlPipe, - SecureImagePipe -} from '@igo2/common'; +import { CollapseDirective } from '@igo2/common/collapsible'; +import { SanitizeHtmlPipe } from '@igo2/common/custom-html'; +import { ImageErrorDirective, SecureImagePipe } from '@igo2/common/image'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; 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 0564dd1f7f..8c47f3d0a8 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 @@ -19,7 +19,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { IgoBadgeIconDirective } from '@igo2/common'; +import { IgoBadgeIconDirective } from '@igo2/common/badge'; import { IgoLanguageModule } from '@igo2/core/language'; import { BehaviorSubject, Subscription } from 'rxjs'; 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 2f554fcbf7..d89ade37d4 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 @@ -22,14 +22,9 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSliderChange, MatSliderModule } from '@angular/material/slider'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - IconService, - IconSvg, - ListComponent, - ListItemDirective, - MAGNIFY_SCAN_ICON, - PanelComponent -} from '@igo2/common'; +import { IconService, IconSvg, MAGNIFY_SCAN_ICON } from '@igo2/common/icon'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; +import { PanelComponent } from '@igo2/common/panel'; import { IgoLanguageModule } from '@igo2/core/language'; import * as olextent from 'ol/extent'; diff --git a/packages/geo/src/lib/layer/layer.module.ts b/packages/geo/src/lib/layer/layer.module.ts index 5b8c2e7cfc..55bdb3231c 100644 --- a/packages/geo/src/lib/layer/layer.module.ts +++ b/packages/geo/src/lib/layer/layer.module.ts @@ -13,6 +13,18 @@ import { LayerListComponent } from './layer-list/layer-list.component'; import { LayerService } from './shared/layer.service'; import { TrackFeatureButtonComponent } from './track-feature-button/track-feature-button.component'; +export const LAYER_DIRECTIVES = [ + LayerItemComponent, + LayerLegendItemComponent, + LayerLegendComponent, + LayerListComponent, + LayerListToolComponent, + LayerLegendListComponent, + LayerListBindingDirective, + LayerLegendListBindingDirective, + TrackFeatureButtonComponent +] as const; + /** * @deprecated import the components/directives directly or LAYER_DIRECTIVES for the set */ diff --git a/packages/geo/src/lib/map/index.ts b/packages/geo/src/lib/map/index.ts index 2339a8f058..73c93a0de0 100644 --- a/packages/geo/src/lib/map/index.ts +++ b/packages/geo/src/lib/map/index.ts @@ -1,24 +1,3 @@ -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'; @@ -33,22 +12,3 @@ 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/map.module.ts b/packages/geo/src/lib/map/map.module.ts index d9798c2eba..a2e19d8caf 100644 --- a/packages/geo/src/lib/map/map.module.ts +++ b/packages/geo/src/lib/map/map.module.ts @@ -17,30 +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, +export const MAP_DIRECTIVES = [ + BaseLayersSwitcherComponent, GeolocateButtonComponent, HomeExtentButtonComponent, - RotationButtonComponent, + HoverFeatureDirective, InfoSectionComponent, - BaseLayersSwitcherComponent, - MiniBaseMapComponent, + MapBrowserComponent, + MapCenterComponent, MapOfflineDirective, + MenuButtonComponent, + MiniBaseMapComponent, OfflineButtonComponent, - WakeLockButtonComponent, PointerPositionDirective, - HoverFeatureDirective, + RotationButtonComponent, SwipeControlComponent, - MapCenterComponent, - MenuButtonComponent -]; + WakeLockButtonComponent, + ZoomButtonComponent +] as const; /** * @deprecated import the components directly or the MAP_DIRECTIVES for the set */ @NgModule({ - imports: DIRECTIVES, - exports: DIRECTIVES + imports: [...MAP_DIRECTIVES], + exports: [...MAP_DIRECTIVES] }) export class IgoMapModule {} 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 01076e8552..883bf4f2e3 100644 --- a/packages/geo/src/lib/map/shared/hover-feature.directive.ts +++ b/packages/geo/src/lib/map/shared/hover-feature.directive.ts @@ -7,7 +7,7 @@ import { Self } from '@angular/core'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { MediaService } from '@igo2/core/media'; import { SubjectStatus } from '@igo2/utils'; diff --git a/packages/geo/src/lib/measure/measurer/measurer.component.ts b/packages/geo/src/lib/measure/measurer/measurer.component.ts index 11779560d4..c8ef61974c 100644 --- a/packages/geo/src/lib/measure/measurer/measurer.component.ts +++ b/packages/geo/src/lib/measure/measurer/measurer.component.ts @@ -20,7 +20,7 @@ import { EntityRecord, EntityTableComponent, EntityTableTemplate -} from '@igo2/common'; +} from '@igo2/common/entity'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; import { StorageScope, StorageService } from '@igo2/core/storage'; diff --git a/packages/geo/src/lib/metadata/index.ts b/packages/geo/src/lib/metadata/index.ts index 500fab0821..39b4f558af 100644 --- a/packages/geo/src/lib/metadata/index.ts +++ b/packages/geo/src/lib/metadata/index.ts @@ -1,12 +1,3 @@ -import { - MetadataAbstractComponent, - MetadataButtonComponent -} from './metadata-button'; - export * from './shared'; +export * from './metadata.module'; export * from './metadata-button'; - -export const METADATA_DIRECTIVES = [ - MetadataButtonComponent, - MetadataAbstractComponent -] as const; diff --git a/packages/geo/src/lib/metadata/metadata.module.ts b/packages/geo/src/lib/metadata/metadata.module.ts index 86e2411299..8182ce3bb5 100644 --- a/packages/geo/src/lib/metadata/metadata.module.ts +++ b/packages/geo/src/lib/metadata/metadata.module.ts @@ -5,6 +5,11 @@ import { MetadataButtonComponent } from './metadata-button/metadata-button.component'; +export const METADATA_DIRECTIVES = [ + MetadataButtonComponent, + MetadataAbstractComponent +] as const; + /** * @deprecated import the components/directives directly or METADATA_DIRECTIVES for the set */ diff --git a/packages/geo/src/lib/print/shared/print.service.ts b/packages/geo/src/lib/print/shared/print.service.ts index 10d497bfa7..de6df7c067 100644 --- a/packages/geo/src/lib/print/shared/print.service.ts +++ b/packages/geo/src/lib/print/shared/print.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { SecureImagePipe } from '@igo2/common'; +import { SecureImagePipe } from '@igo2/common/image'; import { ActivityService } from '@igo2/core/activity'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; @@ -40,15 +40,15 @@ export class PrintService { zipFile: JSZip; nbFileToProcess: number; activityId: string; - imgSizeAdded: Array; mapPrintExtent: Array; + imgSizeAdded: Array; TEXTPDFFONT = { - titleFont: 'Sans Serif', + titleFont: 'times', titleFontStyle: 'bold', - subtitleFont: 'Sans Serif', + subtitleFont: 'times', subtitleFontStyle: 'bold', - commentFont: 'Sans Serif', + commentFont: 'times', commentFontStyle: 'normal', commentFontSize: 12 }; @@ -77,15 +77,11 @@ export class PrintService { unit: 'mm' // default }); - const dimensions = [ - doc.internal.pageSize.width, - doc.internal.pageSize.height - ]; + const { width: pageWidth, height: pageHeight } = doc.internal.pageSize; + + /** top | right | bottom | left */ + const baseMargins: [number, number, number, number] = [10, 10, 10, 10]; - const margins = [10, 10, 10, 10]; - const width = dimensions[0] - margins[3] - margins[1]; - const height = dimensions[1] - margins[0] - margins[2]; - const size: [number, number] = [width, height]; let titleSizes: TextPdfSizeAndMargin; let subtitleSizes: TextPdfSizeAndMargin; @@ -95,14 +91,14 @@ export class PrintService { (paperFormat === PrintPaperFormat.A1 || paperFormat === PrintPaperFormat.A0) ) { - margins[0] += 10; + baseMargins[0] += 10; } // PDF title - const fontSizeInPt = Math.round(2 * (height + 145) * 0.05) / 2; //calculate the fontSize title from the page height. + const fontSizeInPt = Math.round(2 * (pageHeight + 145) * 0.05) / 2; //calculate the fontSize title from the page height. if (options.title !== undefined && options.title !== '') { titleSizes = this.getTextPdfObjectSizeAndMarg( options.title, - margins, + baseMargins, this.TEXTPDFFONT.titleFont, fontSizeInPt, this.TEXTPDFFONT.titleFontStyle, @@ -115,18 +111,18 @@ export class PrintService { this.TEXTPDFFONT.titleFont, this.TEXTPDFFONT.titleFontStyle, titleSizes.fontSize, - titleSizes.marginLeft + margins[3], - margins[0] + titleSizes.marginLeft + baseMargins[3], + baseMargins[0] ); - margins[0] = titleSizes.height + margins[0]; // cumulative margin top for next elem to place in pdf doc + baseMargins[0] = titleSizes.height + baseMargins[0]; // cumulative margin top for next elem to place in pdf doc } // PDF subtitle if (options.subtitle !== undefined && options.subtitle !== '') { subtitleSizes = this.getTextPdfObjectSizeAndMarg( options.subtitle, - margins, + baseMargins, this.TEXTPDFFONT.subtitleFont, options.title !== '' ? titleSizes.fontSize * 0.7 : fontSizeInPt * 0.7, // 70% size of title this.TEXTPDFFONT.subtitleFontStyle, @@ -139,11 +135,16 @@ export class PrintService { this.TEXTPDFFONT.subtitleFont, this.TEXTPDFFONT.subtitleFontStyle, subtitleSizes.fontSize, - subtitleSizes.marginLeft + margins[3], - margins[0] + subtitleSizes.marginLeft + baseMargins[3], + baseMargins[0] ); - margins[0] += 5; // cumulative marg top for next elem to place in pdf doc. 5 is a fix it could be adjust + baseMargins[0] += 5; // cumulative marg top for next elem to place in pdf doc. 5 is a fix it could be adjust + } + + const verticalSpacing: number = 5; + if (options.comment !== undefined && options.comment !== '') { + this.addComment(doc, options.comment, baseMargins, verticalSpacing); } if (options.showProjection === true || options.showScale === true) { @@ -152,61 +153,73 @@ export class PrintService { map, resolution, options.showProjection, - options.showScale + options.showScale, + baseMargins, + verticalSpacing ); } - if (options.comment !== undefined && options.comment !== '') { - this.addComment(doc, options.comment); - } - this.addMap(doc, map, resolution, size, margins, legendPostion).subscribe( - async (status: SubjectStatus) => { - if (status === SubjectStatus.Done) { - await this.handleMeasureLayer(doc, map, margins); - - const width = this.imgSizeAdded[0]; - const height = this.imgSizeAdded[1]; - - this.addGeoRef(doc, width, height, margins); - - if (options.legendPosition !== 'none') { - if ( - ['topleft', 'topright', 'bottomleft', 'bottomright'].indexOf( - options.legendPosition - ) > -1 - ) { - await this.addLegendSamePage( - doc, - map, - margins, - resolution, - options.legendPosition - ); - } else if (options.legendPosition === 'newpage') { - await this.addLegend(doc, map, margins, resolution); - } - } else { - await this.saveDoc(doc); + const width = pageWidth - baseMargins[3] - baseMargins[1]; + const height = pageHeight - baseMargins[0] - baseMargins[2]; + const size: [number, number] = [width, height]; + + this.addMap( + doc, + map, + resolution, + size, + baseMargins, + legendPostion + ).subscribe(async (status: SubjectStatus) => { + if (status === SubjectStatus.Done) { + await this.handleMeasureLayer(doc, map, baseMargins); + const width = this.imgSizeAdded[0]; + const height = this.imgSizeAdded[1]; + this.addGeoRef(doc, map, width, height, baseMargins); + + if (options.legendPosition !== 'none') { + if ( + ['topleft', 'topright', 'bottomleft', 'bottomright'].indexOf( + options.legendPosition + ) > -1 + ) { + await this.addLegendSamePage( + doc, + map, + baseMargins, + resolution, + options.legendPosition + ); + } else if (options.legendPosition === 'newpage') { + await this.addLegend(doc, map, baseMargins, resolution); } + } else { + await this.saveDoc(doc); } + } - if (status === SubjectStatus.Done || status === SubjectStatus.Error) { - this.activityService.unregister(this.activityId); - status$.next(SubjectStatus.Done); - } + if (status === SubjectStatus.Done || status === SubjectStatus.Error) { + this.activityService.unregister(this.activityId); + status$.next(SubjectStatus.Done); } - ); + }); return status$; } // ref GeoMoose https://github.com/geomoose/gm3/tree/main/src/gm3/components/print - addGeoRef(doc, width, height, margins) { + addGeoRef( + doc, + map: IgoMap, + width: number, + height: number, + baseMargins: [number, number, number, number] + ) { const unit = 'mm'; const docHeight = doc.internal.pageSize.getHeight(); // x,y = margin left-bottom corner for img in pdf doc - const x = margins[3]; - const y = docHeight - margins[0] - height; + const x = baseMargins[3]; + const y = docHeight - baseMargins[0] - height; let pdf_extents = [x, y, x + width, y + height]; for (let i = 0; i < pdf_extents.length; i++) { @@ -219,12 +232,12 @@ export class PrintService { * Add measure overlay on the map on the document when the measure layer is present * @param doc - Pdf document where measure tooltip will be added * @param map - Map of the app - * @param margins - Page margins + * @param baseMargins - Page margins */ private async handleMeasureLayer( doc: jsPDF, map: IgoMap, - margins: Array + baseMargins: [number, number, number, number] ) { if ( map.layers.find( @@ -239,7 +252,7 @@ export class PrintService { }).then((e) => { canvasOverlayHTMLMeasures = e; }); - this.addCanvas(doc, canvasOverlayHTMLMeasures, margins); // this adds measure overlays + this.addCanvas(doc, canvasOverlayHTMLMeasures, baseMargins); // this adds measure overlays } } @@ -416,21 +429,34 @@ export class PrintService { /** * Add comment to the document - * * @param doc - pdf document - * * @param comment - Comment to add in the document + * @param doc - pdf document + * @param comment - Comment to add in the document + * @param baseMargins - top | right | bottom | left + * @param verticalSpacing - calculate text position and map height */ - private addComment(doc: jsPDF, comment: string) { - const commentMarginLeft = 10; //margin left and bottom is fix - const commentMarginBottom = 10; - const marginTop = doc.internal.pageSize.height - commentMarginBottom; + private addComment( + doc: jsPDF, + comment: string, + baseMargins: [number, number, number, number], + verticalSpacing: number + ) { + // calculate map image height + baseMargins[2] += verticalSpacing; + + const xPosition = baseMargins[3]; //margin left and bottom is fix + const marginBottom = baseMargins[2]; + // calculate text position Y + const yPosition = + doc.internal.pageSize.height - marginBottom + verticalSpacing; + this.addTextInPdfDoc( doc, comment, this.TEXTPDFFONT.commentFont, this.TEXTPDFFONT.commentFontStyle, this.TEXTPDFFONT.commentFontSize, - commentMarginLeft, - marginTop, + xPosition, + yPosition, true ); } @@ -464,19 +490,27 @@ export class PrintService { * @param dpi - DPI resolution of the document * @param projection - Bool to indicate if projection need to be added * @param scale - Bool to indicate if scale need to be added + * @param baseMargins - top | right | bottom | left + * @param verticalSpacing - calculate text position and map height */ private addProjScale( doc: jsPDF, map: IgoMap, dpi: number, projection: boolean, - scale: boolean + scale: boolean, + baseMargins: [number, number, number, number], + verticalSpacing: number ) { + // calculate map image height + baseMargins[2] += verticalSpacing; const translate = this.languageService.translate; const projScaleSize = 12; - const projScaleMarginLeft = 10; - const marginBottom = 15; - const heightPixels = doc.internal.pageSize.height - marginBottom; + const xPosition = baseMargins[3]; + const marginBottom = baseMargins[2]; + // calculate text position Y + const yPosition = + doc.internal.pageSize.height - marginBottom + verticalSpacing; let textProjScale: string = ''; if (projection === true) { @@ -493,7 +527,7 @@ export class PrintService { } doc.setFont(this.TEXTPDFFONT.commentFont); doc.setFontSize(projScaleSize); - doc.text(textProjScale, projScaleMarginLeft, heightPixels); + doc.text(textProjScale, xPosition, yPosition); } /** @@ -554,12 +588,12 @@ export class PrintService { * Add the legend to the document * @param doc - Pdf document where legend will be added * @param map - Map of the app - * @param margins - Page margins + * @param baseMargins - Page margins */ private async addLegendSamePage( doc: jsPDF, map: IgoMap, - margins: Array, + baseMargins: [number, number, number, number], resolution: number, legendPosition: string ) { @@ -598,32 +632,32 @@ export class PrintService { // Move the legend to the correct position on the page if (legendPosition === 'bottomright') { marginsLegend = [ - doc.internal.pageSize.height - margins[2] - imageSize[1], - margins[1], - margins[2], - doc.internal.pageSize.width - margins[1] - imageSize[0] + doc.internal.pageSize.height - baseMargins[2] - imageSize[1], + baseMargins[1], + baseMargins[2], + doc.internal.pageSize.width - baseMargins[1] - imageSize[0] ]; } else if (legendPosition === 'topright') { marginsLegend = [ - margins[0], - margins[1], - doc.internal.pageSize.height - margins[0] - imageSize[1], - doc.internal.pageSize.width - margins[1] - imageSize[0] + baseMargins[0], + baseMargins[1], + doc.internal.pageSize.height - baseMargins[0] - imageSize[1], + doc.internal.pageSize.width - baseMargins[1] - imageSize[0] ]; } else if (legendPosition === 'bottomleft') { // When the legend is in the bottom left, raise the legend slightly upward so that attributions are visible marginsLegend = [ - doc.internal.pageSize.height - margins[2] - imageSize[1] - 15, - doc.internal.pageSize.width - margins[3] - imageSize[0], - margins[2] + 15, - margins[3] + doc.internal.pageSize.height - baseMargins[2] - imageSize[1], + doc.internal.pageSize.width - baseMargins[3] - imageSize[0], + baseMargins[2], + baseMargins[3] ]; } else if (legendPosition === 'topleft') { marginsLegend = [ - margins[0], - doc.internal.pageSize.width - margins[3] - imageSize[0], - doc.internal.pageSize.height - margins[0] - imageSize[1], - margins[3] + baseMargins[0], + doc.internal.pageSize.width - baseMargins[3] - imageSize[0], + doc.internal.pageSize.height - baseMargins[0] - imageSize[1], + baseMargins[3] ]; } this.addCanvas(doc, canvas, marginsLegend); // this adds the legend @@ -642,7 +676,7 @@ export class PrintService { private addCanvas( doc: jsPDF, canvas: HTMLCanvasElement, - margins: Array + baseMargins: [number, number, number, number] ) { let image; if (canvas) { @@ -654,18 +688,16 @@ export class PrintService { console.log('Warning: An image cannot be print in pdf file'); return; } - const imageSize = this.getImageSizeToFitPdf(doc, canvas, margins); + const imageSize = this.getImageSizeToFitPdf(doc, canvas, baseMargins); doc.addImage( image, 'PNG', - margins[3], - margins[0], + baseMargins[3], + baseMargins[0], imageSize[0], imageSize[1] ); - - doc.rect(margins[3], margins[0], imageSize[0], imageSize[1]); - + doc.rect(baseMargins[3], baseMargins[0], imageSize[0], imageSize[1]); this.imgSizeAdded = imageSize; // keep img size for georef later } } @@ -675,15 +707,15 @@ export class PrintService { doc: jsPDF, map: IgoMap, resolution: number, - docSize: [number, number], - margins: Array, + imageDimensions: [number, number], + baseMargins: [number, number, number, number], legendPostion: PrintLegendPosition ) { const mapSize = map.ol.getSize() as [number, number]; const viewResolution = map.ol.getView().getResolution(); const dimensionPixels = this.setMapResolution( map, - docSize, + imageDimensions, resolution, viewResolution ); @@ -694,7 +726,9 @@ export class PrintService { const mapCanvas = event.target .getViewport() .getElementsByTagName('canvas') as HTMLCollectionOf; + const mapResultCanvas = await this.drawMap(dimensionPixels, mapCanvas); + this.mapPrintExtent = map.viewController.getExtent('EPSG:3857'); this.resetOriginalMapSize(map, mapSize, viewResolution); @@ -710,7 +744,7 @@ export class PrintService { let status = SubjectStatus.Done; try { if (mapResultCanvas.width !== 0) { - this.addCanvas(doc, mapResultCanvas, margins); + this.addCanvas(doc, mapResultCanvas, baseMargins); } } catch (err) { status = SubjectStatus.Error; @@ -730,7 +764,7 @@ export class PrintService { let status = SubjectStatus.Done; try { if (mapResultCanvas.width !== 0) { - this.addCanvas(doc, mapResultCanvas, margins); + this.addCanvas(doc, mapResultCanvas, baseMargins); } } catch (err) { status = SubjectStatus.Error; @@ -1287,7 +1321,7 @@ export class PrintService { getImageSizeToFitPdf(doc, canvas, margins) { // Define variable to calculate best size to fit in one page const pageHeight = - doc.internal.pageSize.getHeight() - (margins[0] + margins[2] + 10); + doc.internal.pageSize.getHeight() - (margins[0] + margins[2]); const pageWidth = doc.internal.pageSize.getWidth() - (margins[1] + margins[3]); const canHeight = this.pdf_units2points(canvas.height, 'mm'); diff --git a/packages/geo/src/lib/query/shared/index.ts b/packages/geo/src/lib/query/shared/index.ts index 2dbb3b534c..829dbbf8a2 100644 --- a/packages/geo/src/lib/query/shared/index.ts +++ b/packages/geo/src/lib/query/shared/index.ts @@ -4,3 +4,4 @@ export * from './query.enums'; export * from './query.interfaces'; export * from './query.utils'; export * from './query-search-source'; +export * from './query-search-source.providers'; diff --git a/packages/geo/src/lib/search/index.ts b/packages/geo/src/lib/search/index.ts index d725af8bed..edec2a39ba 100644 --- a/packages/geo/src/lib/search/index.ts +++ b/packages/geo/src/lib/search/index.ts @@ -1,10 +1,5 @@ -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.module'; export * from './search-selector/search-selector.component'; export * from './search-selector/search-selector.module'; export * from './search-settings/search-settings.component'; @@ -12,11 +7,3 @@ 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'; - -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.ts b/packages/geo/src/lib/search/search-bar/search-bar.component.ts index 7ad3a92786..18867eb3ed 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 @@ -21,7 +21,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/geo/src/lib/search/search-results/index.ts b/packages/geo/src/lib/search/search-results/index.ts index faca079f45..6a086cc2b1 100644 --- a/packages/geo/src/lib/search/search-results/index.ts +++ b/packages/geo/src/lib/search/search-results/index.ts @@ -1,11 +1,4 @@ -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; +export * from './search-results.directive'; 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 e3f63a7242..86989b4b01 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 @@ -21,7 +21,7 @@ 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 { ListComponent, ListItemDirective } from '@igo2/common/list'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; 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 b5d4964811..611415053a 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 @@ -12,11 +12,9 @@ import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { - EntityStore, - IgoBadgeIconDirective, - StopPropagationDirective -} from '@igo2/common'; +import { IgoBadgeIconDirective } from '@igo2/common/badge'; +import { EntityStore } from '@igo2/common/entity'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import { IgoLanguageModule } from '@igo2/core/language'; import { Media, MediaService } from '@igo2/core/media'; 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 a397f25ecb..96201ff073 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 @@ -12,11 +12,11 @@ import { MatListModule } from '@angular/material/list'; import { MatTooltipModule } from '@angular/material/tooltip'; import { - StopPropagationDirective, getEntityIcon, getEntityTitle, getEntityTitleHtml -} from '@igo2/common'; +} from '@igo2/common/entity'; +import { StopPropagationDirective } from '@igo2/common/stop-propagation'; import olFormatGeoJSON from 'ol/format/GeoJSON'; 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 79fc848d44..bf6c6dcd91 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 @@ -13,15 +13,14 @@ import { import type { TemplateRef } from '@angular/core'; import { MatTabsModule } from '@angular/material/tabs'; +import { CollapsibleComponent } from '@igo2/common/collapsible'; import { - CollapsibleComponent, EntityState, EntityStore, EntityStoreFilterCustomFuncStrategy, - EntityStoreWatcher, - ListComponent, - ListItemDirective -} from '@igo2/common'; + EntityStoreWatcher +} from '@igo2/common/entity'; +import { ListComponent, ListItemDirective } from '@igo2/common/list'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/geo/src/lib/search/search-results/search-results.directive.ts b/packages/geo/src/lib/search/search-results/search-results.directive.ts new file mode 100644 index 0000000000..51d371c277 --- /dev/null +++ b/packages/geo/src/lib/search/search-results/search-results.directive.ts @@ -0,0 +1,7 @@ +import { SearchResultAddButtonComponent } from './search-results-add-button.component'; +import { SearchResultsComponent } from './search-results.component'; + +export const SEARCH_RESULTS_DIRECTIVES = [ + SearchResultsComponent, + SearchResultAddButtonComponent +] as const; diff --git a/packages/geo/src/lib/search/search.module.ts b/packages/geo/src/lib/search/search.module.ts index b28fd31e6b..6e3c6d7558 100644 --- a/packages/geo/src/lib/search/search.module.ts +++ b/packages/geo/src/lib/search/search.module.ts @@ -1,8 +1,12 @@ import { ModuleWithProviders, NgModule } from '@angular/core'; +import { SearchBarComponent } from './search-bar/search-bar.component'; import { IgoSearchBarModule } from './search-bar/search-bar.module'; +import { SEARCH_RESULTS_DIRECTIVES } from './search-results'; import { IgoSearchResultsModule } from './search-results/search-results.module'; +import { SearchSelectorComponent } from './search-selector/search-selector.component'; import { IgoSearchSelectorModule } from './search-selector/search-selector.module'; +import { SearchSettingsComponent } from './search-settings/search-settings.component'; import { IgoSearchSettingsModule } from './search-settings/search-settings.module'; import { SearchPointerSummaryDirective } from './shared/search-pointer-summary.directive'; import { provideSearchSourceService } from './shared/search-source-service.providers'; @@ -11,6 +15,14 @@ import { provideDefaultCoordinatesSearchResultFormatter } from './shared/sources import { provideDefaultIChercheSearchResultFormatter } from './shared/sources/icherche.providers'; import { provideILayerSearchResultFormatter } from './shared/sources/ilayer.providers'; +export const SEARCH_DIRECTIVES = [ + SearchBarComponent, + SearchSelectorComponent, + ...SEARCH_RESULTS_DIRECTIVES, + SearchSettingsComponent, + SearchPointerSummaryDirective +] as const; + @NgModule({ imports: [ IgoSearchBarModule, @@ -28,6 +40,9 @@ import { provideILayerSearchResultFormatter } from './shared/sources/ilayer.prov ] }) export class IgoSearchModule { + /** + * @deprecated import the provideSearch() directly and add the source in the provider property + */ static forRoot(): ModuleWithProviders { return { ngModule: IgoSearchModule, diff --git a/packages/geo/src/lib/search/shared/index.ts b/packages/geo/src/lib/search/shared/index.ts index 0a4a692c83..16404f0d9d 100644 --- a/packages/geo/src/lib/search/shared/index.ts +++ b/packages/geo/src/lib/search/shared/index.ts @@ -1,4 +1,5 @@ export * from './search.enums'; +export * from './search.provider'; export * from './search.interfaces'; export * from './search-pointer-summary.directive'; export * from './search.service'; 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 9068ba1e1c..f7fd2925c8 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 @@ -8,7 +8,7 @@ import { Self } from '@angular/core'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { MediaService } from '@igo2/core/media'; import { SubjectStatus } from '@igo2/utils'; diff --git a/packages/geo/src/lib/search/shared/search-source.service.ts b/packages/geo/src/lib/search/shared/search-source.service.ts index 0622eedd99..e4f2b53a26 100644 --- a/packages/geo/src/lib/search/shared/search-source.service.ts +++ b/packages/geo/src/lib/search/shared/search-source.service.ts @@ -1,4 +1,4 @@ -import { Workspace } from '@igo2/common'; +import { Workspace } from '@igo2/common/workspace'; import { SearchSource } from './sources/source'; import { SearchSourceSettings } from './sources/source.interfaces'; diff --git a/packages/geo/src/lib/search/shared/search.interfaces.ts b/packages/geo/src/lib/search/shared/search.interfaces.ts index a2b2b3eda6..51251ee6e2 100644 --- a/packages/geo/src/lib/search/shared/search.interfaces.ts +++ b/packages/geo/src/lib/search/shared/search.interfaces.ts @@ -1,4 +1,4 @@ -import { IconSvg } from '@igo2/common'; +import { IconSvg } from '@igo2/common/icon'; import { Observable } from 'rxjs'; diff --git a/packages/geo/src/lib/search/shared/search.provider.ts b/packages/geo/src/lib/search/shared/search.provider.ts new file mode 100644 index 0000000000..2f017229b1 --- /dev/null +++ b/packages/geo/src/lib/search/shared/search.provider.ts @@ -0,0 +1,36 @@ +import { Provider } from '@angular/core'; + +import { provideSearchSourceService } from './search-source-service.providers'; +import { SearchService } from './search.service'; +import { + SearchSourceFeature, + SearchSourceKind +} from './sources/source.interfaces'; + +interface ISearchProviderOptions { + /** Share the search term with analytics tracking */ + analytics?: boolean; +} + +export function provideSearch( + sources: SearchSourceFeature[], + options?: ISearchProviderOptions +): Provider[] { + const providers: Provider[] = [ + options?.analytics && { + provide: 'searchAnalytics', + useValue: options.analytics + }, + { + provide: SearchService, + useClass: SearchService + }, + provideSearchSourceService() + ].filter(Boolean); + + for (const source of sources) { + providers.push(...source.providers); + } + + return providers; +} diff --git a/packages/geo/src/lib/search/shared/search.service.ts b/packages/geo/src/lib/search/shared/search.service.ts index 4d06f49277..67760265db 100644 --- a/packages/geo/src/lib/search/shared/search.service.ts +++ b/packages/geo/src/lib/search/shared/search.service.ts @@ -1,5 +1,13 @@ -import { Injectable } from '@angular/core'; +import { + Inject, + Injectable, + Optional, + WritableSignal, + effect, + signal +} from '@angular/core'; +import { AnalyticsService } from '@igo2/core/analytics'; import { StorageService } from '@igo2/core/storage'; import { MapService } from '../../map/shared/map.service'; @@ -24,15 +32,32 @@ import { * keeps internal state of the researches it performed * and the results they yielded. */ -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class SearchService { + searchTerm: WritableSignal = signal(null); + constructor( private searchSourceService: SearchSourceService, private mapService: MapService, - private storageService: StorageService - ) {} + private storageService: StorageService, + private analyticsService: AnalyticsService, + @Inject('searchAnalytics') + @Optional() + analytics: boolean + ) { + if (analytics) { + this.handleAnalytics(); + } + } + + private handleAnalytics(): void { + effect(() => { + const term = this.searchTerm(); + if (term != null) { + this.analyticsService.trackSearch(term, null); + } + }); + } /** * Perform a research by text @@ -44,6 +69,8 @@ export class SearchService { return []; } + this.searchTerm.set(term); + const proj = this.mapService.getMap()?.projection || 'EPSG:3857'; const response = stringToLonLat(term, proj, { forceNA: options.forceNA diff --git a/packages/geo/src/lib/search/shared/sources/cadastre.providers.ts b/packages/geo/src/lib/search/shared/sources/cadastre.providers.ts index b64f602b0e..91b06ddd89 100644 --- a/packages/geo/src/lib/search/shared/sources/cadastre.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/cadastre.providers.ts @@ -6,6 +6,7 @@ import { StorageService } from '@igo2/core/storage'; import { CadastreSearchSource } from './cadastre'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; /** * Cadastre search source factory @@ -36,3 +37,10 @@ export function provideCadastreSearchSource() { deps: [HttpClient, LanguageService, StorageService, ConfigService] }; } + +export function withCadastreSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.Cadastre, + providers: [provideCadastreSearchSource()] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/coordinates.providers.ts b/packages/geo/src/lib/search/shared/sources/coordinates.providers.ts index b031868f07..2852fd795f 100644 --- a/packages/geo/src/lib/search/shared/sources/coordinates.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/coordinates.providers.ts @@ -9,6 +9,7 @@ import { CoordinatesSearchResultFormatter } from './coordinates'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; /** * Coordinate search result formatter factory @@ -60,3 +61,13 @@ export function provideCoordinatesReverseSearchSource() { deps: [ConfigService, LanguageService, StorageService, ProjectionService] }; } + +export function withCoordinatesReverseSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.CoordinatesReverse, + providers: [ + provideCoordinatesReverseSearchSource(), + provideDefaultCoordinatesSearchResultFormatter() + ] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/icherche-icons.ts b/packages/geo/src/lib/search/shared/sources/icherche-icons.ts index caec906298..9e7b587a7c 100644 --- a/packages/geo/src/lib/search/shared/sources/icherche-icons.ts +++ b/packages/geo/src/lib/search/shared/sources/icherche-icons.ts @@ -1,4 +1,4 @@ -import { ENGINE_ICON, IconSvg } from '@igo2/common'; +import { ENGINE_ICON, IconSvg } from '@igo2/common/icon'; /** * Icons mappings to be retrocompatible with iCherche diff --git a/packages/geo/src/lib/search/shared/sources/icherche.providers.ts b/packages/geo/src/lib/search/shared/sources/icherche.providers.ts index 2ab2805e2f..7fe9eed82a 100644 --- a/packages/geo/src/lib/search/shared/sources/icherche.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/icherche.providers.ts @@ -1,5 +1,5 @@ import { HttpClient } from '@angular/common/http'; -import { Injector } from '@angular/core'; +import { Injector, Provider } from '@angular/core'; import { ConfigService } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; @@ -11,6 +11,7 @@ import { IChercheSearchSource } from './icherche'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; /** * ICherche search result formatter factory @@ -25,7 +26,7 @@ export function defaultIChercheSearchResultFormatterFactory( /** * Function that returns a provider for the ICherche search result formatter */ -export function provideDefaultIChercheSearchResultFormatter() { +export function provideDefaultIChercheSearchResultFormatter(): Provider { return { provide: IChercheSearchResultFormatter, useFactory: defaultIChercheSearchResultFormatterFactory, @@ -58,7 +59,7 @@ export function ichercheSearchSourceFactory( /** * Function that returns a provider for the ICherche search source */ -export function provideIChercheSearchSource() { +export function provideIChercheSearchSource(): Provider { return { provide: SearchSource, useFactory: ichercheSearchSourceFactory, @@ -74,6 +75,16 @@ export function provideIChercheSearchSource() { }; } +export function withIChercheSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.ICherche, + providers: [ + provideIChercheSearchSource(), + provideDefaultIChercheSearchResultFormatter() + ] + }; +} + /** * IChercheReverse search source factory * @ignore @@ -105,3 +116,13 @@ export function provideIChercheReverseSearchSource() { deps: [HttpClient, LanguageService, StorageService, ConfigService, Injector] }; } + +export function withIChercheReverseSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.IChercheReverse, + providers: [ + provideIChercheReverseSearchSource(), + provideDefaultIChercheSearchResultFormatter() + ] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/icherche.ts b/packages/geo/src/lib/search/shared/sources/icherche.ts index 12113cbbee..6c9d830fe4 100644 --- a/packages/geo/src/lib/search/shared/sources/icherche.ts +++ b/packages/geo/src/lib/search/shared/sources/icherche.ts @@ -6,7 +6,7 @@ import { import { Inject, Injectable, Injector } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { IconSvg } from '@igo2/common'; +import { IconSvg } from '@igo2/common/icon'; import { LanguageService } from '@igo2/core/language'; import { StorageService } from '@igo2/core/storage'; import { ObjectUtils, customCacheHasher } from '@igo2/utils'; @@ -629,7 +629,7 @@ export class IChercheSearchSource extends SearchSource implements TextSearch { const hashtags = term.match(/(#[A-Za-z]+)/g) || []; let keep = false; keep = hashtags.some((hashtag) => { - const hashtagKey = hashtag.substring(1); + const hashtagKey = String(hashtag).substring(1); return this.hashtagsLieuxToKeep.some( (h) => h diff --git a/packages/geo/src/lib/search/shared/sources/ilayer.providers.ts b/packages/geo/src/lib/search/shared/sources/ilayer.providers.ts index 863699a3f7..87ad082ba4 100644 --- a/packages/geo/src/lib/search/shared/sources/ilayer.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/ilayer.providers.ts @@ -6,6 +6,7 @@ import { StorageService } from '@igo2/core/storage'; import { ILayerSearchResultFormatter, ILayerSearchSource } from './ilayer'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; /** * ILayer search result formatter factory @@ -65,3 +66,13 @@ export function provideILayerSearchSource() { ] }; } + +export function withILayerSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.ILayer, + providers: [ + provideILayerSearchSource(), + provideILayerSearchResultFormatter() + ] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/nominatim.providers.ts b/packages/geo/src/lib/search/shared/sources/nominatim.providers.ts index 947c9acfb1..9466a53fd7 100644 --- a/packages/geo/src/lib/search/shared/sources/nominatim.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/nominatim.providers.ts @@ -5,6 +5,7 @@ import { StorageService } from '@igo2/core/storage'; import { NominatimSearchSource } from './nominatim'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; /** * Nominatim search source factory @@ -33,3 +34,10 @@ export function provideNominatimSearchSource() { deps: [HttpClient, ConfigService, StorageService] }; } + +export function withNominatimSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.Nominatim, + providers: [provideNominatimSearchSource()] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/source.interfaces.ts b/packages/geo/src/lib/search/shared/sources/source.interfaces.ts index c818707b4c..df52c243b6 100644 --- a/packages/geo/src/lib/search/shared/sources/source.interfaces.ts +++ b/packages/geo/src/lib/search/shared/sources/source.interfaces.ts @@ -1,3 +1,5 @@ +import { Provider } from '@angular/core'; + export interface SearchSourceOptions { title?: string; searchUrl?: string; @@ -52,3 +54,20 @@ export interface ReverseSearchOptions { zoom?: number; params?: { [key: string]: string }; } + +export interface SearchSourceFeature { + kind: KindT; + providers: Provider[]; +} + +export enum SearchSourceKind { + ICherche = 0, + IChercheReverse = 1, + Cadastre = 2, + CoordinatesReverse = 3, + ILayer = 4, + Nominatim = 5, + StoredQueries = 6, + StoredQueriesReverse = 7, + Workspace = 8 +} diff --git a/packages/geo/src/lib/search/shared/sources/source.ts b/packages/geo/src/lib/search/shared/sources/source.ts index 38d62e1e9d..d15d069d44 100644 --- a/packages/geo/src/lib/search/shared/sources/source.ts +++ b/packages/geo/src/lib/search/shared/sources/source.ts @@ -1,4 +1,4 @@ -import { Workspace } from '@igo2/common'; +import { Workspace } from '@igo2/common/workspace'; import { StorageService } from '@igo2/core/storage'; import { ObjectUtils } from '@igo2/utils'; diff --git a/packages/geo/src/lib/search/shared/sources/storedqueries.providers.ts b/packages/geo/src/lib/search/shared/sources/storedqueries.providers.ts index 44755a90f3..5a15403313 100644 --- a/packages/geo/src/lib/search/shared/sources/storedqueries.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/storedqueries.providers.ts @@ -5,6 +5,7 @@ import { LanguageService } from '@igo2/core/language'; import { StorageService } from '@igo2/core/storage'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; import { StoredQueriesReverseSearchSource, StoredQueriesSearchSource @@ -40,6 +41,13 @@ export function provideStoredQueriesSearchSource() { }; } +export function withStoredQueriesSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.StoredQueries, + providers: [provideStoredQueriesSearchSource()] + }; +} + /** * StoredQueriesReverse search source factory * @ignore @@ -70,3 +78,10 @@ export function provideStoredQueriesReverseSearchSource() { deps: [HttpClient, LanguageService, StorageService, ConfigService] }; } + +export function withStoredQueriesReverseSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.StoredQueriesReverse, + providers: [provideStoredQueriesReverseSearchSource()] + }; +} diff --git a/packages/geo/src/lib/search/shared/sources/workspace.providers.ts b/packages/geo/src/lib/search/shared/sources/workspace.providers.ts index 066f55a8f1..ad4cf92b30 100644 --- a/packages/geo/src/lib/search/shared/sources/workspace.providers.ts +++ b/packages/geo/src/lib/search/shared/sources/workspace.providers.ts @@ -3,6 +3,7 @@ import { LanguageService } from '@igo2/core/language'; import { StorageService } from '@igo2/core/storage'; import { SearchSource } from './source'; +import { SearchSourceFeature, SearchSourceKind } from './source.interfaces'; import { WorkspaceSearchSource } from './workspace'; /** @@ -32,3 +33,10 @@ export function provideWorkspaceSearchSource() { deps: [LanguageService, StorageService, ConfigService] }; } + +export function withWorkspaceSource(): SearchSourceFeature { + return { + kind: SearchSourceKind.Workspace, + providers: [provideWorkspaceSearchSource()] + }; +} diff --git a/packages/geo/src/lib/style/shared/feature/feature-style.ts b/packages/geo/src/lib/style/shared/feature/feature-style.ts index 01c27c1e74..78479b3d90 100644 --- a/packages/geo/src/lib/style/shared/feature/feature-style.ts +++ b/packages/geo/src/lib/style/shared/feature/feature-style.ts @@ -1,3 +1,5 @@ +import { isValidJSON } from '@igo2/utils'; + import olFeature from 'ol/Feature'; import * as olGeom from 'ol/geom'; import type { default as OlGeometry } from 'ol/geom/Geometry'; @@ -21,7 +23,7 @@ export function featureRandomStyleFunction(): ( }); return (olFeature: olFeature, resolution: number) => { const customStyle = olFeature.get('_style'); - if (customStyle) { + if (customStyle && isValidJSON(customStyle)) { if ( customStyle.circle && olFeature.get('rad') && 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 0573b77305..0b1411a84c 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 @@ -20,7 +20,7 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import { ColorPickerFormFieldComponent } from '@igo2/common'; +import { ColorPickerFormFieldComponent } from '@igo2/common/color'; import { IgoLanguageModule } from '@igo2/core/language'; import { FontType } from '../../shared/font.enum'; 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 dae61400e4..41d10a8513 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 @@ -16,7 +16,7 @@ import { } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; -import { ColorPickerFormFieldComponent } from '@igo2/common'; +import { ColorPickerFormFieldComponent } from '@igo2/common/color'; import { IgoLanguageModule } from '@igo2/core/language'; import { asArray as ColorAsArray } from 'ol/color'; diff --git a/packages/geo/src/lib/toast/toast.component.ts b/packages/geo/src/lib/toast/toast.component.ts index 97550bd9c7..75ef0f26b3 100644 --- a/packages/geo/src/lib/toast/toast.component.ts +++ b/packages/geo/src/lib/toast/toast.component.ts @@ -3,12 +3,9 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { - FlexibleComponent, - FlexibleState, - PanelComponent, - getEntityTitle -} from '@igo2/common'; +import { getEntityTitle } from '@igo2/common/entity'; +import { FlexibleComponent, FlexibleState } from '@igo2/common/flexible'; +import { PanelComponent } from '@igo2/common/panel'; import olFormatGeoJSON from 'ol/format/GeoJSON'; diff --git a/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts b/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts index b5ec2bf998..f9acab3b6e 100644 --- a/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/edition-workspace.service.ts @@ -7,13 +7,13 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { AuthInterceptor } from '@igo2/auth'; +import { ActionStore } from '@igo2/common/action'; import { - ActionStore, EntityStoreFilterSelectionStrategy, EntityTableButton, EntityTableColumnRenderer, EntityTableTemplate -} from '@igo2/common'; +} from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { MessageService } from '@igo2/core/message'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/geo/src/lib/workspace/shared/edition-workspace.ts b/packages/geo/src/lib/workspace/shared/edition-workspace.ts index bb7b3f45c6..5d33c30f30 100644 --- a/packages/geo/src/lib/workspace/shared/edition-workspace.ts +++ b/packages/geo/src/lib/workspace/shared/edition-workspace.ts @@ -1,6 +1,7 @@ import { MatDialog } from '@angular/material/dialog'; -import { EntityRecord, Workspace, WorkspaceOptions } from '@igo2/common'; +import { EntityRecord } from '@igo2/common/entity'; +import { Workspace, WorkspaceOptions } from '@igo2/common/workspace'; import { ConfigService } from '@igo2/core/config'; import Collection from 'ol/Collection'; diff --git a/packages/geo/src/lib/workspace/shared/feature-workspace.service.ts b/packages/geo/src/lib/workspace/shared/feature-workspace.service.ts index 642e45b43e..d1e0da387c 100644 --- a/packages/geo/src/lib/workspace/shared/feature-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/feature-workspace.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; -import { ActionStore, EntityStoreFilterSelectionStrategy } from '@igo2/common'; +import { ActionStore } from '@igo2/common/action'; +import { EntityStoreFilterSelectionStrategy } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/geo/src/lib/workspace/shared/feature-workspace.ts b/packages/geo/src/lib/workspace/shared/feature-workspace.ts index d9a87be0c7..aa61613c99 100644 --- a/packages/geo/src/lib/workspace/shared/feature-workspace.ts +++ b/packages/geo/src/lib/workspace/shared/feature-workspace.ts @@ -1,4 +1,4 @@ -import { Workspace, WorkspaceOptions } from '@igo2/common'; +import { Workspace, WorkspaceOptions } from '@igo2/common/workspace'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts b/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts index 605e7cb0c9..fb194b323d 100644 --- a/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/wfs-workspace.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; -import { ActionStore, EntityStoreFilterSelectionStrategy } from '@igo2/common'; +import { ActionStore } from '@igo2/common/action'; +import { EntityStoreFilterSelectionStrategy } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/geo/src/lib/workspace/shared/wfs-workspace.ts b/packages/geo/src/lib/workspace/shared/wfs-workspace.ts index 0c6c1aeca6..d320621477 100644 --- a/packages/geo/src/lib/workspace/shared/wfs-workspace.ts +++ b/packages/geo/src/lib/workspace/shared/wfs-workspace.ts @@ -1,4 +1,4 @@ -import { Workspace, WorkspaceOptions } from '@igo2/common'; +import { Workspace, WorkspaceOptions } from '@igo2/common/workspace'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts b/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts index da78cc7db9..903ecaff9a 100644 --- a/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts +++ b/packages/geo/src/lib/workspace/shared/wms-workspace.service.ts @@ -1,6 +1,7 @@ import { Injectable } from '@angular/core'; -import { ActionStore, EntityStoreFilterSelectionStrategy } from '@igo2/common'; +import { ActionStore } from '@igo2/common/action'; +import { EntityStoreFilterSelectionStrategy } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/geo/src/lib/workspace/shared/wms-workspace.ts b/packages/geo/src/lib/workspace/shared/wms-workspace.ts index af6e550678..8d1050fca7 100644 --- a/packages/geo/src/lib/workspace/shared/wms-workspace.ts +++ b/packages/geo/src/lib/workspace/shared/wms-workspace.ts @@ -1,4 +1,4 @@ -import { Workspace, WorkspaceOptions } from '@igo2/common'; +import { Workspace, WorkspaceOptions } from '@igo2/common/workspace'; import { ImageLayer } from '../../layer/shared'; import { IgoMap } from '../../map/shared/map'; diff --git a/packages/geo/src/lib/workspace/shared/workspace.utils.ts b/packages/geo/src/lib/workspace/shared/workspace.utils.ts index c41c410be2..ec5f6051c0 100644 --- a/packages/geo/src/lib/workspace/shared/workspace.utils.ts +++ b/packages/geo/src/lib/workspace/shared/workspace.utils.ts @@ -3,11 +3,11 @@ import { EntityStoreFilterCustomFuncStrategy, EntityStoreStrategyFuncOptions, EntityTableButton, + EntityTableColumn, EntityTableColumnRenderer, - EntityTableTemplate, - Workspace -} from '@igo2/common'; -import { EntityTableColumn } from '@igo2/common'; + EntityTableTemplate +} from '@igo2/common/entity'; +import { Workspace } from '@igo2/common/workspace'; import { StorageScope } from '@igo2/core/storage'; import { ObjectUtils } from '@igo2/utils'; 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 5964023abf..c8f8852cdc 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,7 +9,8 @@ import { import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { OnUpdateInputs, WidgetComponent } from '@igo2/common'; +import { OnUpdateInputs } from '@igo2/common/dynamic-component'; +import { WidgetComponent } from '@igo2/common/widget'; import { OgcFilterableItemComponent } from '../../../filter/ogc-filterable-item/ogc-filterable-item.component'; import { Layer } from '../../../layer/shared/layers/layer'; diff --git a/packages/geo/src/lib/workspace/widgets/widgets.ts b/packages/geo/src/lib/workspace/widgets/widgets.ts index 283ce2cf85..0680bb2d48 100644 --- a/packages/geo/src/lib/workspace/widgets/widgets.ts +++ b/packages/geo/src/lib/workspace/widgets/widgets.ts @@ -1,6 +1,6 @@ import { InjectionToken } from '@angular/core'; -import { Widget, WidgetService } from '@igo2/common'; +import { Widget, WidgetService } from '@igo2/common/widget'; import { InteractiveSelectionFormComponent } from './interactive-selection/interactive-selection.component'; import { OgcFilterComponent } from './ogc-filter/ogc-filter.component'; 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 7b42559af5..cdb0bcf076 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 @@ -11,7 +11,7 @@ import { Workspace, WorkspaceSelectorComponent, WorkspaceStore -} from '@igo2/common'; +} from '@igo2/common/workspace'; import { Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; 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 5aa3f17e12..48774500f7 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 @@ -1,7 +1,7 @@ import { Directive, Input, OnDestroy, OnInit } from '@angular/core'; -import { Workspace } from '@igo2/common'; -import type { WorkspaceStore } from '@igo2/common'; +import { Workspace } from '@igo2/common/workspace'; +import type { WorkspaceStore } from '@igo2/common/workspace'; import { Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; diff --git a/packages/geo/src/lib/workspace/workspace.module.ts b/packages/geo/src/lib/workspace/workspace.module.ts index 5e6d093dfc..6c86531cf7 100644 --- a/packages/geo/src/lib/workspace/workspace.module.ts +++ b/packages/geo/src/lib/workspace/workspace.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { MatDialogModule } from '@angular/material/dialog'; -import { IgoWidgetModule } from '@igo2/common'; +import { IgoWidgetModule } from '@igo2/common/widget'; import { IgoOgcFilterModule } from './widgets/ogc-filter/ogc-filter.module'; import { diff --git a/packages/geo/src/locale/en.geo.json b/packages/geo/src/locale/en.geo.json index 9a11412b36..709e22fde0 100644 --- a/packages/geo/src/locale/en.geo.json +++ b/packages/geo/src/locale/en.geo.json @@ -378,7 +378,12 @@ "copyMsgLink": "Link for directions copied to clipboard", "copyTitle": "Directions" }, - "toggleActive": "Activate direction control" + "toggleActive": "Activate direction control", + "toggleType": "Include forest roads", + "forestRoadsWarning": { + "title": "Warning", + "text": "Some forest roads may be impassable or not suitable for vehicles." + } }, "directions": { "uturn": "u-turn", diff --git a/packages/geo/src/locale/fr.geo.json b/packages/geo/src/locale/fr.geo.json index a57681c4a2..566b9287ed 100644 --- a/packages/geo/src/locale/fr.geo.json +++ b/packages/geo/src/locale/fr.geo.json @@ -378,7 +378,12 @@ "copyMsgLink": "Le lien de l'itinéraire est copié dans le presse-papier", "copyTitle": "Itinéraire" }, - "toggleActive": "Activer le contrôle d'itinéraire" + "toggleActive": "Activer le contrôle d'itinéraire", + "toggleType": "Inclure les chemins forestiers", + "forestRoadsWarning": { + "title": "Avertissement", + "text": "Certains chemins forestiers peuvent être impraticables ou non carrossables." + } }, "directions": { "uturn": "demi-tour", diff --git a/packages/integration/src/lib/about/about-tool/about-tool.component.spec.ts b/packages/integration/src/lib/about/about-tool/about-tool.component.spec.ts index 791400bee8..c88be1fbee 100644 --- a/packages/integration/src/lib/about/about-tool/about-tool.component.spec.ts +++ b/packages/integration/src/lib/about/about-tool/about-tool.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { IgoCustomHtmlModule } from '@igo2/common'; +import { IgoCustomHtmlModule } from '@igo2/common/custom-html'; import { IgoLanguageModule } from '@igo2/core/language'; import { AboutToolComponent } from './about-tool.component'; 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 a209b49f1b..026f7e55cb 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 @@ -7,11 +7,9 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatTooltipModule } from '@angular/material/tooltip'; import { AuthService } from '@igo2/auth'; -import { - CustomHtmlComponent, - InteractiveTourComponent, - ToolComponent -} from '@igo2/common'; +import { CustomHtmlComponent } from '@igo2/common/custom-html'; +import { InteractiveTourComponent } from '@igo2/common/interactive-tour'; +import { ToolComponent } from '@igo2/common/tool'; import { ConfigService, version } from '@igo2/core/config'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; diff --git a/packages/integration/src/lib/analytics/analytics-listener.service.ts b/packages/integration/src/lib/analytics/analytics-listener.service.ts index 6608fb6ce6..3303911ccb 100644 --- a/packages/integration/src/lib/analytics/analytics-listener.service.ts +++ b/packages/integration/src/lib/analytics/analytics-listener.service.ts @@ -15,7 +15,6 @@ import { skip } from 'rxjs/operators'; import { ContextState } from '../context/context.state'; import { MapState } from '../map/map.state'; -import { SearchState } from '../search/search.state'; import { ToolState } from '../tool/tool.state'; /** @@ -33,7 +32,6 @@ export class AnalyticsListenerService { private analyticsService: AnalyticsService, private authService: AuthService, private contextState: ContextState, - private searchState: SearchState, private toolState: ToolState, private mapState: MapState ) {} @@ -42,7 +40,6 @@ export class AnalyticsListenerService { this.listenUser(); this.listenContext(); this.listenTool(); - this.listenSearch(); this.listenLayer(); } @@ -81,19 +78,6 @@ export class AnalyticsListenerService { }); } - listenSearch() { - this.searchState.searchTerm$ - .pipe(skip(1)) - .subscribe((searchTerm: string) => { - if (searchTerm !== undefined && searchTerm !== null) { - this.analyticsService.trackSearch( - searchTerm, - this.searchState.store.count - ); - } - }); - } - /** * Listener for adding layers to the map */ 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 5821707c50..dc33a3a445 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 @@ -8,7 +8,8 @@ import { } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { EntityRecord, EntityStore, ToolComponent } from '@igo2/common'; +import { EntityRecord, EntityStore } from '@igo2/common/entity'; +import { ToolComponent } from '@igo2/common/tool'; import { Catalog, CatalogBrowserComponent, 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 079e8db449..890b37e634 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 @@ -5,9 +5,10 @@ import { OnInit } from '@angular/core'; -import { LAYER_PLUS_ICON, ToolComponent } from '@igo2/common'; -import { EntityStore } from '@igo2/common'; -import { StorageService } from '@igo2/core/storage'; +import { EntityStore } from '@igo2/common/entity'; +import { LAYER_PLUS_ICON } from '@igo2/common/icon'; +import { ToolComponent } from '@igo2/common/tool'; +import { StorageScope, StorageService } from '@igo2/core/storage'; import { Catalog, CatalogLibaryComponent, CatalogService } from '@igo2/geo'; import { take } from 'rxjs/operators'; @@ -49,6 +50,18 @@ export class CatalogLibraryToolComponent implements OnInit { */ @Input() predefinedCatalogs: Catalog[] = []; + set selectedCatalogId(id) { + this.storageService.set('selectedCatalogId', id, StorageScope.SESSION); + } + + get currentTool() { + return this.toolState.toolbox.getCurrentPreviousToolName()[1]; + } + + get lastTool() { + return this.toolState.toolbox.getCurrentPreviousToolName()[0]; + } + constructor( private catalogService: CatalogService, private catalogState: CatalogState, @@ -60,6 +73,10 @@ export class CatalogLibraryToolComponent implements OnInit { * @internal */ ngOnInit() { + if (this.lastTool === 'catalogBrowser' && this.currentTool === 'catalog') { + this.selectedCatalogId = null; + } + if (this.store.count === 0) { this.loadCatalogs(); } diff --git a/packages/integration/src/lib/catalog/catalog.state.ts b/packages/integration/src/lib/catalog/catalog.state.ts index aad6702665..0a6d096369 100644 --- a/packages/integration/src/lib/catalog/catalog.state.ts +++ b/packages/integration/src/lib/catalog/catalog.state.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { Catalog, CatalogItem } from '@igo2/geo'; /** 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 3b5a552dea..92a8d6e24d 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,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { ContextEditBindingDirective, ContextEditComponent 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 e8ed3d5782..3b0ce7da38 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,6 @@ import { Component, Input } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { ContextListBindingDirective, ContextListComponent 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 dde6896475..93862759c7 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,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { ContextPermissionsBindingDirective, ContextPermissionsComponent 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 57ec7fbc7e..6ae83f5a95 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,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { ShareMapComponent } from '@igo2/context'; import { IgoMap, LayerListControlsOptions } from '@igo2/geo'; diff --git a/packages/integration/src/lib/context/context.directive.ts b/packages/integration/src/lib/context/context.directive.ts new file mode 100644 index 0000000000..e1eaed008a --- /dev/null +++ b/packages/integration/src/lib/context/context.directive.ts @@ -0,0 +1,11 @@ +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 const INTEGRATION_CONTEXT_DIRECTIVES = [ + ContextEditorToolComponent, + ContextManagerToolComponent, + ContextPermissionManagerToolComponent, + ContextShareToolComponent +] as const; diff --git a/packages/integration/src/lib/context/context.module.ts b/packages/integration/src/lib/context/context.module.ts index 37ea24e4e3..fe16c5ccee 100644 --- a/packages/integration/src/lib/context/context.module.ts +++ b/packages/integration/src/lib/context/context.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; -import { INTEGRATION_CONTEXT_DIRECTIVES } from '.'; +import { INTEGRATION_CONTEXT_DIRECTIVES } from './context.directive'; /** * @deprecated import the components/directive directly or INTEGRATION_CONTEXT_DIRECTIVES for the set diff --git a/packages/integration/src/lib/context/context.state.ts b/packages/integration/src/lib/context/context.state.ts index a1cfde32d2..e98a65154b 100644 --- a/packages/integration/src/lib/context/context.state.ts +++ b/packages/integration/src/lib/context/context.state.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { Tool, ToolService } from '@igo2/common'; +import { Tool, ToolService } from '@igo2/common/tool'; import { ContextService, DetailedContext } from '@igo2/context'; import { LanguageService } from '@igo2/core/language'; diff --git a/packages/integration/src/lib/context/index.ts b/packages/integration/src/lib/context/index.ts index 5fa5399e77..fe93c4846b 100644 --- a/packages/integration/src/lib/context/index.ts +++ b/packages/integration/src/lib/context/index.ts @@ -1,17 +1,6 @@ -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; +export * from './context.directive'; 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 2905dd7290..30d12351db 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 @@ -6,5 +6,6 @@ [stepFeatureStore]="stepFeatureStore" [routesFeatureStore]="routesFeatureStore" [zoomToActiveRoute$]="zoomToActiveRoute$" + [authenticated$]="authenticated$" > diff --git a/packages/integration/src/lib/directions/directions-tool/directions-tool.component.ts b/packages/integration/src/lib/directions/directions-tool/directions-tool.component.ts index a82928865b..68f53099c1 100644 --- a/packages/integration/src/lib/directions/directions-tool/directions-tool.component.ts +++ b/packages/integration/src/lib/directions/directions-tool/directions-tool.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { AuthService } from '@igo2/auth'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { LanguageService } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import { StorageScope, StorageService } from '@igo2/core/storage'; @@ -14,7 +14,7 @@ import { StopsStore } from '@igo2/geo'; -import { Subject } from 'rxjs'; +import { BehaviorSubject, Subject } from 'rxjs'; import { ContextState } from '../../context/context.state'; import { MapState } from '../../map/map.state'; @@ -77,6 +77,10 @@ export class DirectionsToolComponent implements OnInit { return this.directionState.zoomToActiveRoute$; } + get authenticated$(): BehaviorSubject { + return this.authService.authenticate$; + } + /** * Map to measure on * @internal 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 8d2e782154..6272134bf6 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 @@ -1,6 +1,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { DrawComponent, DrawControl, diff --git a/packages/integration/src/lib/environment/environment.interface.ts b/packages/integration/src/lib/environment/environment.interface.ts index bf8567af62..7b271a2f91 100644 --- a/packages/integration/src/lib/environment/environment.interface.ts +++ b/packages/integration/src/lib/environment/environment.interface.ts @@ -1,5 +1,5 @@ import { AuthEnvironmentOptions } from '@igo2/auth/environment'; -import { EnvironmentOptions as CommonEnvironmentOptions } from '@igo2/common'; +import { EnvironmentOptions as CommonEnvironmentOptions } from '@igo2/common/environment'; import { EnvironmentOptions as ContextEnvironmentOptions } from '@igo2/context'; import { BaseEnvironmentOptions, 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 9631df34c8..65052a3e77 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { IgoMap, Layer, OgcFilterableItemComponent } from '@igo2/geo'; import { MapState } from '../../map/map.state'; diff --git a/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.ts b/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.ts index a9a69d142d..ef44a80ff7 100644 --- a/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.ts +++ b/packages/integration/src/lib/filter/active-time-filter-tool/active-time-filter-tool.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { IgoMap, Layer, TimeFilterItemComponent } from '@igo2/geo'; import { MapState } from '../../map/map.state'; 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 854d1da120..7aed844396 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,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { OgcFilterableListBindingDirective, OgcFilterableListComponent 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 b01534ad36..d39e77c566 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 @@ -9,12 +9,10 @@ import { } from '@angular/core'; import { MatIconRegistry } from '@angular/material/icon'; -import { - EntityStore, - PanelComponent, - SELECTION_MARKER_ICON, - ToolComponent -} from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; +import { SELECTION_MARKER_ICON } from '@igo2/common/icon'; +import { PanelComponent } from '@igo2/common/panel'; +import { ToolComponent } from '@igo2/common/tool'; import { LanguageService } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import { 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 a529c31386..d15c3201b4 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,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { TimeFilterListBindingDirective, TimeFilterListComponent diff --git a/packages/integration/src/lib/geometry-form/data-issue-reporter-tool/data-issue-reporter-tool.component.ts b/packages/integration/src/lib/geometry-form/data-issue-reporter-tool/data-issue-reporter-tool.component.ts index 2f18b6cd74..fa6f27df39 100644 --- a/packages/integration/src/lib/geometry-form/data-issue-reporter-tool/data-issue-reporter-tool.component.ts +++ b/packages/integration/src/lib/geometry-form/data-issue-reporter-tool/data-issue-reporter-tool.component.ts @@ -2,7 +2,8 @@ import { HttpClient } from '@angular/common/http'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Validators } from '@angular/forms'; -import { Form, FormService, ToolComponent } from '@igo2/common'; +import { Form, FormService } from '@igo2/common/form'; +import { ToolComponent } from '@igo2/common/tool'; import { LanguageService } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import { IgoMap } from '@igo2/geo'; diff --git a/packages/integration/src/lib/geometry-form/geometry-form.module.ts b/packages/integration/src/lib/geometry-form/geometry-form.module.ts index af598da55e..c7e3155c59 100644 --- a/packages/integration/src/lib/geometry-form/geometry-form.module.ts +++ b/packages/integration/src/lib/geometry-form/geometry-form.module.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { IgoFormModule } from '@igo2/common'; +import { IgoFormModule } from '@igo2/common/form'; import { IgoLanguageModule } from '@igo2/core/language'; import { IgoMessageModule } from '@igo2/core/message'; 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 173969d067..17589f81f3 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 @@ -7,8 +7,8 @@ import { } from '@angular/core'; import { MatTabsModule } from '@angular/material/tabs'; -import { ToolComponent } from '@igo2/common'; -import type { WorkspaceStore } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; +import type { WorkspaceStore } from '@igo2/common/workspace'; import { ContextImportExportComponent } from '@igo2/context'; import { IgoLanguageModule } from '@igo2/core/language'; import { 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 4cc9a840d2..7cc4034696 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 @@ -78,6 +78,7 @@ export class AdvancedCoordinatesComponent implements OnInit, OnDestroy { private inMtmZone: boolean = true; private inLambert2 = { 32198: true, 3798: true }; private mapState$$: Subscription; + private formStatus$$: Subscription; private _projectionsLimitations: ProjectionsLimitationsOptions = {}; private projectionsConstraints: ProjectionsLimitationsOptions; private defaultProj: InputProjections; @@ -136,40 +137,22 @@ export class AdvancedCoordinatesComponent implements OnInit, OnDestroy { .pipe(debounceTime(50)) .subscribe(() => { this.setScaleValue(this.map); - this.currentCenterDefaultProj = this.map.viewController.getCenter( - this.defaultProj.code - ); - const currentMtmZone = zoneMtm(this.currentCenterDefaultProj[0]); - const currentUtmZone = zoneUtm(this.currentCenterDefaultProj[0]); - if (!this.inMtmZone && currentMtmZone !== this.currentZones.mtm) { - this.back2quebec(); - } - let zoneChange = false; - if (currentMtmZone !== this.currentZones.mtm) { - this.currentZones.mtm = currentMtmZone; - zoneChange = true; - } - if (currentUtmZone !== this.currentZones.utm) { - this.currentZones.utm = currentUtmZone; - zoneChange = true; - } - if (zoneChange) { - this.updateProjectionsZoneChange(); - } - this.checkLambert(this.currentCenterDefaultProj); - this.coordinates = this.getCoordinates(); - this.cdRef.detectChanges(); - this.storageService.set( - 'currentProjection', - this.inputProj, - StorageScope.SESSION - ); + this.updateCoordinates(); }); + this.formStatus$$ = this.form.valueChanges.subscribe(() => { + this.updateCoordinates(); + }); + const tempInputProj = this.storageService.get( 'currentProjection' ) as InputProjections; - this.inputProj = this.projections$.value[0]; + + this.inputProj = + this.projections$.value.find( + (val) => val.code === this.defaultProj.code + ) ?? this.projections$.value[0]; + if (tempInputProj !== null) { const pos = this.positionInList(tempInputProj); this.inputProj = this.projections$.value[pos]; @@ -185,6 +168,7 @@ export class AdvancedCoordinatesComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.map.mapCenter$.next(false); this.mapState$$.unsubscribe(); + this.formStatus$$.unsubscribe(); } setScaleValue(map: IgoMap) { @@ -212,6 +196,37 @@ export class AdvancedCoordinatesComponent implements OnInit, OnDestroy { return coord; } + updateCoordinates() { + this.currentCenterDefaultProj = this.map.viewController.getCenter( + this.defaultProj.code + ); + const currentMtmZone = zoneMtm(this.currentCenterDefaultProj[0]); + const currentUtmZone = zoneUtm(this.currentCenterDefaultProj[0]); + if (!this.inMtmZone && currentMtmZone !== this.currentZones.mtm) { + this.back2quebec(); + } + let zoneChange = false; + if (currentMtmZone !== this.currentZones.mtm) { + this.currentZones.mtm = currentMtmZone; + zoneChange = true; + } + if (currentUtmZone !== this.currentZones.utm) { + this.currentZones.utm = currentUtmZone; + zoneChange = true; + } + if (zoneChange) { + this.updateProjectionsZoneChange(); + } + this.checkLambert(this.currentCenterDefaultProj); + this.coordinates = this.getCoordinates(); + + this.storageService.set( + 'currentProjection', + this.inputProj, + StorageScope.SESSION + ); + } + /** * Copy the coordinates to a clipboard */ 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 203b1ddeb4..0cb65ed9af 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 @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; import { MatDividerModule } from '@angular/material/divider'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { IgoLanguageModule } from '@igo2/core/language'; import { MapState } from '../map.state'; 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 79cc2349d2..7f73df8db4 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 @@ -15,7 +15,7 @@ import { MatListModule } from '@angular/material/list'; import { MatSelectModule } from '@angular/material/select'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { IgoIconComponent, LAYER_PLUS_ICON } from '@igo2/common'; +import { IgoIconComponent, LAYER_PLUS_ICON } from '@igo2/common/icon'; import { ContextService, DetailedContext } from '@igo2/context'; import { IgoLanguageModule } from '@igo2/core/language'; import { IgoMap, Layer, VectorLayer } from '@igo2/geo'; diff --git a/packages/integration/src/lib/map/index.ts b/packages/integration/src/lib/map/index.ts index d0568b996c..1d379b5572 100644 --- a/packages/integration/src/lib/map/index.ts +++ b/packages/integration/src/lib/map/index.ts @@ -1,10 +1,3 @@ -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'; @@ -13,12 +6,4 @@ 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; +export * from './map.directive'; 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 be494652ae..1478945f92 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 @@ -3,7 +3,7 @@ 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 { ToolComponent } from '@igo2/common/tool'; import { IgoLanguageModule } from '@igo2/core/language'; import { ExportButtonComponent, 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 8474880f8b..feaa1a2a47 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 @@ -9,7 +9,7 @@ import { import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { IgoLanguageModule } from '@igo2/core/language'; import { IgoMap, 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 9e104f7706..521b925fd7 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 @@ -7,11 +7,8 @@ import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatRadioChange, MatRadioModule } from '@angular/material/radio'; -import { - EntityTableComponent, - EntityTableTemplate, - ToolComponent -} from '@igo2/common'; +import { EntityTableComponent, EntityTableTemplate } from '@igo2/common/entity'; +import { ToolComponent } from '@igo2/common/tool'; import { LanguageService } from '@igo2/core/language'; import { IgoLanguageModule } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; 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 afd3d4613d..b7dea0895d 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,7 +1,7 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { MatTabsModule } from '@angular/material/tabs'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { ContextListBindingDirective, ContextListComponent 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 353f938ec0..ac1e8e8a89 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 @@ -11,7 +11,7 @@ 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 { ToolComponent } from '@igo2/common/tool'; import { IgoLanguageModule } from '@igo2/core/language'; import { ExportButtonComponent, diff --git a/packages/integration/src/lib/map/map.directive.ts b/packages/integration/src/lib/map/map.directive.ts new file mode 100644 index 0000000000..da66092c46 --- /dev/null +++ b/packages/integration/src/lib/map/map.directive.ts @@ -0,0 +1,15 @@ +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 const INTEGRATION_MAP_DIRECTIVES = [ + AdvancedMapToolComponent, + MapProximityToolComponent, + MapToolComponent, + MapToolsComponent, + MapDetailsToolComponent, + MapLegendToolComponent +] as const; 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 a54dc2364b..20645ac668 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,6 +1,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { FeatureStore, FeatureWithMeasure, 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 9e0455cb58..2db43d45f6 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,6 +1,6 @@ import { Component } from '@angular/core'; -import { ToolComponent } from '@igo2/common'; +import { ToolComponent } from '@igo2/common/tool'; import { IgoMap, PrintComponent } from '@igo2/geo'; import { MapState } from '../../map/map.state'; diff --git a/packages/integration/src/lib/search/index.ts b/packages/integration/src/lib/search/index.ts index e7b4c0143f..2f031b3f13 100644 --- a/packages/integration/src/lib/search/index.ts +++ b/packages/integration/src/lib/search/index.ts @@ -1,14 +1,6 @@ -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/query.state.ts b/packages/integration/src/lib/search/query.state.ts index 2fdfd426b9..fefb2d86ef 100644 --- a/packages/integration/src/lib/search/query.state.ts +++ b/packages/integration/src/lib/search/query.state.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { EntityStore } from '@igo2/common'; +import { EntityStore } from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { CapabilitiesService, 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 1605569ec4..b4f4fe0dae 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 @@ -12,16 +12,11 @@ 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'; +import { SanitizeHtmlPipe } from '@igo2/common/custom-html'; +import { EntityState, EntityStore, getEntityTitle } from '@igo2/common/entity'; +import { FlexibleComponent, FlexibleState } from '@igo2/common/flexible'; +import { PanelComponent } from '@igo2/common/panel'; +import { ToolComponent } from '@igo2/common/tool'; import { ConfigService } from '@igo2/core/config'; import { IgoLanguageModule } from '@igo2/core/language'; import { diff --git a/packages/integration/src/lib/search/search.directive.ts b/packages/integration/src/lib/search/search.directive.ts new file mode 100644 index 0000000000..6a3512ad7b --- /dev/null +++ b/packages/integration/src/lib/search/search.directive.ts @@ -0,0 +1,7 @@ +import { SearchBarBindingDirective } from './search-bar/search-bar-binding.directive'; +import { SearchResultsToolComponent } from './search-results-tool/search-results-tool.component'; + +export const INTEGRATION_SEARCH_DIRECTIVES = [ + SearchBarBindingDirective, + SearchResultsToolComponent +] as const; diff --git a/packages/integration/src/lib/search/search.state.ts b/packages/integration/src/lib/search/search.state.ts index 0c1722dee2..894a22d045 100644 --- a/packages/integration/src/lib/search/search.state.ts +++ b/packages/integration/src/lib/search/search.state.ts @@ -5,7 +5,7 @@ import { EntityStore, EntityStoreFilterCustomFuncStrategy, EntityStoreStrategyFuncOptions -} from '@igo2/common'; +} from '@igo2/common/entity'; import { ConfigService } from '@igo2/core/config'; import { StorageService } from '@igo2/core/storage'; import { @@ -36,9 +36,7 @@ export interface SearchFeatureMotion { /** * Service that holds the state of the search module */ -@Injectable({ - providedIn: 'root' -}) +@Injectable() export class SearchState { public searchLayerStores: FeatureStore[] = []; public searchOverlayStyle: CommonVectorStyleOptions = {}; diff --git a/packages/integration/src/lib/tool/tool.state.ts b/packages/integration/src/lib/tool/tool.state.ts index bf1e7713c9..78c494a77d 100644 --- a/packages/integration/src/lib/tool/tool.state.ts +++ b/packages/integration/src/lib/tool/tool.state.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import { ToolService, Toolbox } from '@igo2/common'; +import { ToolService, Toolbox } from '@igo2/common/tool'; import { ExportOptions } from '@igo2/geo'; import { BehaviorSubject } from 'rxjs'; 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 cd81b03ff8..6873cb226a 100644 --- a/packages/integration/src/lib/workspace/shared/edition-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/edition-actions.service.ts @@ -1,6 +1,7 @@ -import { Inject, Injectable, OnDestroy } from '@angular/core'; +import { Inject, Injectable, OnDestroy, Optional } from '@angular/core'; -import { Action, Widget } from '@igo2/common'; +import { Action } from '@igo2/common/action'; +import { Widget } from '@igo2/common/widget'; import { LanguageService } from '@igo2/core/language'; import { MediaService } from '@igo2/core/media'; import { @@ -35,7 +36,9 @@ export class EditionActionsService implements OnDestroy { } constructor( - @Inject(OgcFilterWidget) private ogcFilterWidget: Widget, + @Optional() + @Inject(OgcFilterWidget) + private ogcFilterWidget: Widget, private storageState: StorageState, public languageService: LanguageService, private mediaService: MediaService, 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 4fb73eb33e..51acf1e2c5 100644 --- a/packages/integration/src/lib/workspace/shared/feature-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/feature-actions.service.ts @@ -1,6 +1,7 @@ import { Inject, Injectable, OnDestroy } from '@angular/core'; -import { Action, Widget } from '@igo2/common'; +import { Action } from '@igo2/common/action'; +import { Widget } from '@igo2/common/widget'; import { LanguageService } from '@igo2/core/language'; import { MediaService } from '@igo2/core/media'; import { 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 d0f66c3cf4..1df94842e3 100644 --- a/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts +++ b/packages/integration/src/lib/workspace/shared/wfs-actions.service.ts @@ -1,6 +1,7 @@ -import { Inject, Injectable, OnDestroy } from '@angular/core'; +import { Inject, Injectable, OnDestroy, Optional } from '@angular/core'; -import { Action, Widget } from '@igo2/common'; +import { Action } from '@igo2/common/action'; +import { Widget } from '@igo2/common/widget'; import { LanguageService } from '@igo2/core/language'; import { MediaService } from '@igo2/core/media'; import { @@ -43,9 +44,12 @@ export class WfsActionsService implements OnDestroy { } constructor( + @Optional() @Inject(InteractiveSelectionFormWidget) private interactiveSelectionFormWidget: Widget, - @Inject(OgcFilterWidget) private ogcFilterWidget: Widget, + @Optional() + @Inject(OgcFilterWidget) + private ogcFilterWidget: Widget, private storageState: StorageState, public languageService: LanguageService, private mediaService: MediaService, diff --git a/packages/integration/src/lib/workspace/shared/workspace.utils.ts b/packages/integration/src/lib/workspace/shared/workspace.utils.ts index 0809f7e838..321a9b0064 100644 --- a/packages/integration/src/lib/workspace/shared/workspace.utils.ts +++ b/packages/integration/src/lib/workspace/shared/workspace.utils.ts @@ -1,9 +1,9 @@ +import { Action } from '@igo2/common/action'; import { - Action, EntityStoreFilterCustomFuncStrategy, - EntityStoreFilterSelectionStrategy, - Widget -} from '@igo2/common'; + EntityStoreFilterSelectionStrategy +} from '@igo2/common/entity'; +import { Widget } from '@igo2/common/widget'; import { LanguageService } from '@igo2/core/language'; import { MediaService } from '@igo2/core/media'; import { StorageService } from '@igo2/core/storage'; diff --git a/packages/integration/src/lib/workspace/workspace.state.ts b/packages/integration/src/lib/workspace/workspace.state.ts index 78ad7fffcc..c730e5717b 100644 --- a/packages/integration/src/lib/workspace/workspace.state.ts +++ b/packages/integration/src/lib/workspace/workspace.state.ts @@ -4,11 +4,10 @@ import { EntityRecord, EntityState, EntityStoreFilterCustomFuncStrategy, - EntityStoreFilterSelectionStrategy, - Widget, - Workspace, - WorkspaceStore -} from '@igo2/common'; + EntityStoreFilterSelectionStrategy +} from '@igo2/common/entity'; +import { Widget } from '@igo2/common/widget'; +import { Workspace, WorkspaceStore } from '@igo2/common/workspace'; import { StorageService } from '@igo2/core/storage'; import { EditionWorkspace, FeatureWorkspace, WfsWorkspace } from '@igo2/geo'; diff --git a/packages/utils/src/lib/file.ts b/packages/utils/src/lib/file.ts index 8d170f3cd9..a727c7e428 100644 --- a/packages/utils/src/lib/file.ts +++ b/packages/utils/src/lib/file.ts @@ -32,3 +32,16 @@ export function downloadFromUri(uri: string, fileName: string) { document.body.removeChild(element); } + +/** + * Validate if string is valid json object + * @param jsonString + * @return boolean + */ +export function isValidJSON(jsonString: string): boolean { + try { + return JSON.parse(jsonString) && !!jsonString; + } catch (e) { + return false; + } +} diff --git a/projects/demo/proxy.conf.json b/projects/demo/proxy.conf.json index b823e6c77e..1c9672a339 100644 --- a/projects/demo/proxy.conf.json +++ b/projects/demo/proxy.conf.json @@ -14,6 +14,11 @@ "secure": false, "changeOrigin": true }, + "/services/": { + "target": "https://geoegl.msp.gouv.qc.ca", + "secure": false, + "changeOrigin": true + }, "/swtq": { "target": "https://ws.mapserver.transports.gouv.qc.ca", "changeOrigin": true, diff --git a/projects/demo/src/app/auth/auth-form/auth-form.component.html b/projects/demo/src/app/auth/auth-form/auth-form.component.html index dea92f1ef7..b336290dd7 100644 --- a/projects/demo/src/app/auth/auth-form/auth-form.component.html +++ b/projects/demo/src/app/auth/auth-form/auth-form.component.html @@ -5,6 +5,15 @@ > The dialog opens automatically if you are not logged in +
+
diff --git a/projects/demo/src/app/auth/auth-form/auth-form.component.ts b/projects/demo/src/app/auth/auth-form/auth-form.component.ts index 3420552ac8..aba3b7f8fa 100644 --- a/projects/demo/src/app/auth/auth-form/auth-form.component.ts +++ b/projects/demo/src/app/auth/auth-form/auth-form.component.ts @@ -1,6 +1,10 @@ -import { Component } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; -import { IgoAuthFormModule } from '@igo2/auth/form'; +import { AuthService } from '@igo2/auth'; +import { AuthFormComponent } from '@igo2/auth/form'; + +import { Subscription } from 'rxjs'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; @@ -10,8 +14,29 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ templateUrl: './auth-form.component.html', styleUrls: ['./auth-form.component.scss'], standalone: true, - imports: [DocViewerComponent, ExampleViewerComponent, IgoAuthFormModule] + imports: [ + DocViewerComponent, + ExampleViewerComponent, + AuthFormComponent, + MatButtonModule + ] }) -export class AppAuthFormComponent { - constructor() {} +export class AppAuthFormComponent implements OnInit, OnDestroy { + public logged: boolean = false; + public logged$$: Subscription; + constructor(private _authService: AuthService) {} + + ngOnInit() { + this.logged$$ = this._authService.logged$.subscribe((logged: boolean) => { + this.logged = logged; + }); + } + + logout() { + this._authService.logout(); + } + + ngOnDestroy() { + this.logged$$.unsubscribe(); + } } diff --git a/projects/demo/src/app/common/action/action.component.ts b/projects/demo/src/app/common/action/action.component.ts index 3a48a8053c..e43a799a7d 100644 --- a/projects/demo/src/app/common/action/action.component.ts +++ b/projects/demo/src/app/common/action/action.component.ts @@ -1,7 +1,11 @@ import { Overlay } from '@angular/cdk/overlay'; import { Component, OnDestroy, OnInit } from '@angular/core'; -import { ActionStore, ActionbarComponent, ActionbarMode } from '@igo2/common'; +import { + ActionStore, + ActionbarComponent, + ActionbarMode +} from '@igo2/common/action'; import { Media, MediaOrientation, MediaService } from '@igo2/core/media'; import { BehaviorSubject } from 'rxjs'; diff --git a/projects/demo/src/app/common/dialog/dialog.component.ts b/projects/demo/src/app/common/dialog/dialog.component.ts index 72d951aedc..94ddfff192 100644 --- a/projects/demo/src/app/common/dialog/dialog.component.ts +++ b/projects/demo/src/app/common/dialog/dialog.component.ts @@ -4,20 +4,25 @@ import { MatButtonModule } from '@angular/material/button'; import { MatDividerModule } from '@angular/material/divider'; import { - Choice, ConfirmDialogService, + IgoConfirmDialogModule +} from '@igo2/common/confirm-dialog'; +import { FormDialogService, FormFieldConfig, FormGroupsConfig, - IgoConfirmDialogModule, - IgoFormDialogModule, + IgoFormDialogModule +} from '@igo2/common/form'; +import { IgoJsonDialogModule, + JsonDialogService +} from '@igo2/common/json-dialog'; +import { + Choice, IgoSelectValueDialogModule, - JsonDialogService, - SelectValueDialogService -} from '@igo2/common'; - -import { SelectValueDialogType } from 'packages/common/src/lib/select-value-dialog/select-value-dialog.enums'; + SelectValueDialogService, + SelectValueDialogType +} from '@igo2/common/select-value-dialog'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; 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 2df895daca..e492b96665 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,10 @@ import { } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { DynamicOutletComponent, OnUpdateInputs } from '@igo2/common'; +import { + DynamicOutletComponent, + OnUpdateInputs +} from '@igo2/common/dynamic-component'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; 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 8ac3022f82..633ce6be12 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 { EntitySelectorComponent, EntityStore } from '@igo2/common'; +import { EntitySelectorComponent, EntityStore } from '@igo2/common/entity'; import { BehaviorSubject } from 'rxjs'; 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 709744c06f..e048330d69 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 @@ -9,7 +9,7 @@ import { EntityTablePaginatorOptions, EntityTableTemplate, getEntityProperty -} from '@igo2/common'; +} from '@igo2/common/entity'; import { BehaviorSubject } from 'rxjs'; diff --git a/projects/demo/src/app/common/form/form.component.ts b/projects/demo/src/app/common/form/form.component.ts index cbcb67b030..742f41132a 100644 --- a/projects/demo/src/app/common/form/form.component.ts +++ b/projects/demo/src/app/common/form/form.component.ts @@ -10,7 +10,7 @@ import { FormFieldConfig, FormGroupComponent, FormService -} from '@igo2/common'; +} from '@igo2/common/form'; import { BehaviorSubject, Subscription } from 'rxjs'; diff --git a/projects/demo/src/app/common/icon/icon.component.ts b/projects/demo/src/app/common/icon/icon.component.ts index 5d67bef16a..9a641b43cb 100644 --- a/projects/demo/src/app/common/icon/icon.component.ts +++ b/projects/demo/src/app/common/icon/icon.component.ts @@ -3,7 +3,7 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; -import { IgoIconComponent } from '@igo2/common'; +import { IgoIconComponent } from '@igo2/common/icon'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; @@ -40,7 +40,7 @@ const EXAMPLE_STYLE_VARIABLE = `.material-symbols-outlined { 'opsz' 24 }`; -const EXAMPLE_PROVIDER = `import { provideIcon } from '@igo2/common'; +const EXAMPLE_PROVIDER = `import { provideIcon } from '@igo2/common/icon'; bootstrapApplication(AppComponent, { providers: [ diff --git a/projects/demo/src/app/common/table/table.component.ts b/projects/demo/src/app/common/table/table.component.ts index 1a9d7fda82..daf556ab7a 100644 --- a/projects/demo/src/app/common/table/table.component.ts +++ b/projects/demo/src/app/common/table/table.component.ts @@ -5,7 +5,7 @@ import { TableComponent, TableDatabase, TableModel -} from '@igo2/common'; +} from '@igo2/common/table'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; diff --git a/projects/demo/src/app/common/table/table.module.ts b/projects/demo/src/app/common/table/table.module.ts index c84ada93d1..46f11cb18d 100644 --- a/projects/demo/src/app/common/table/table.module.ts +++ b/projects/demo/src/app/common/table/table.module.ts @@ -1,6 +1,6 @@ import { NgModule } from '@angular/core'; -import { IgoTableModule } from '@igo2/common'; +import { IgoTableModule } from '@igo2/common/table'; import { AppTableRoutingModule } from './table-routing.module'; import { AppTableComponent } from './table.component'; diff --git a/projects/demo/src/app/common/tool/tool.component.ts b/projects/demo/src/app/common/tool/tool.component.ts index 6e8aa5e485..8de1cb5c57 100644 --- a/projects/demo/src/app/common/tool/tool.component.ts +++ b/projects/demo/src/app/common/tool/tool.component.ts @@ -10,15 +10,15 @@ import { import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; +import { OnUpdateInputs } from '@igo2/common/dynamic-component'; +import { PanelComponent } from '@igo2/common/panel'; import { - OnUpdateInputs, - PanelComponent, Tool, ToolComponent, ToolService, Toolbox, ToolboxComponent -} from '@igo2/common'; +} from '@igo2/common/tool'; import { BehaviorSubject } from 'rxjs'; diff --git a/projects/demo/src/app/common/widget/widget.component.ts b/projects/demo/src/app/common/widget/widget.component.ts index c99ed8e98f..0997e6a3da 100644 --- a/projects/demo/src/app/common/widget/widget.component.ts +++ b/projects/demo/src/app/common/widget/widget.component.ts @@ -10,11 +10,13 @@ import { MatButtonModule } from '@angular/material/button'; import { DynamicComponent, + OnUpdateInputs +} from '@igo2/common/dynamic-component'; +import { IgoWidgetOutletModule, - OnUpdateInputs, WidgetComponent, WidgetService -} from '@igo2/common'; +} from '@igo2/common/widget'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; diff --git a/projects/demo/src/app/context/context/context.component.ts b/projects/demo/src/app/context/context/context.component.ts index d66dd7f249..c3d41e9511 100644 --- a/projects/demo/src/app/context/context/context.component.ts +++ b/projects/demo/src/app/context/context/context.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { PanelComponent } from '@igo2/common'; +import { PanelComponent } from '@igo2/common/panel'; import { CONTEXT_MANAGER_DIRECTIVES, ContextImportExportComponent, diff --git a/projects/demo/src/app/context/context/context.module.ts b/projects/demo/src/app/context/context/context.module.ts index 1e90700ff0..7625b44d0c 100644 --- a/projects/demo/src/app/context/context/context.module.ts +++ b/projects/demo/src/app/context/context/context.module.ts @@ -1,7 +1,7 @@ import { HttpClientJsonpModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; -import { IgoPanelModule } from '@igo2/common'; +import { IgoPanelModule } from '@igo2/common/panel'; import { IgoContextModule } from '@igo2/context'; import { IgoFeatureModule, diff --git a/projects/demo/src/app/core/activity/activity.component.ts b/projects/demo/src/app/core/activity/activity.component.ts index f77f99ed05..0c15d7408d 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 { SpinnerComponent } from '@igo2/common'; +import { SpinnerComponent } from '@igo2/common/spinner'; import { ActivityService } from '@igo2/core/activity'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; diff --git a/projects/demo/src/app/geo/catalog/catalog.component.ts b/projects/demo/src/app/geo/catalog/catalog.component.ts index 3de1c23af4..b3229b4219 100644 --- a/projects/demo/src/app/geo/catalog/catalog.component.ts +++ b/projects/demo/src/app/geo/catalog/catalog.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { EntityRecord, EntityStore, PanelComponent } from '@igo2/common'; +import { EntityRecord, EntityStore } from '@igo2/common/entity'; +import { PanelComponent } from '@igo2/common/panel'; import { StorageService } from '@igo2/core/storage'; import { Catalog, diff --git a/projects/demo/src/app/geo/directions/directions.component.html b/projects/demo/src/app/geo/directions/directions.component.html index 9d99724b29..ebfa07b772 100644 --- a/projects/demo/src/app/geo/directions/directions.component.html +++ b/projects/demo/src/app/geo/directions/directions.component.html @@ -41,6 +41,7 @@ [stepFeatureStore]="stepFeatureStore" [routesFeatureStore]="routesFeatureStore" [zoomToActiveRoute$]="zoomToActiveRoute$" + [authenticated$]="authenticated$" > diff --git a/projects/demo/src/app/geo/directions/directions.component.ts b/projects/demo/src/app/geo/directions/directions.component.ts index 33df618054..93b2ff0ac8 100644 --- a/projects/demo/src/app/geo/directions/directions.component.ts +++ b/projects/demo/src/app/geo/directions/directions.component.ts @@ -1,11 +1,11 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; +import { AuthService } from '@igo2/auth'; import { IgoDirectionsModule, IgoMap, IgoSearchModule, - LayerOptions, LayerService, MAP_DIRECTIVES, MapService, @@ -14,10 +14,13 @@ import { StepFeatureStore, StopsFeatureStore, StopsStore, - TileLayer + TileLayer, + TileLayerOptions, + provideDirection, + withOsrmSource } from '@igo2/geo'; -import { Subject } from 'rxjs'; +import { BehaviorSubject, Subject } from 'rxjs'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; import { ExampleViewerComponent } from '../../components/example/example-viewer/example-viewer.component'; @@ -34,7 +37,8 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ MAP_DIRECTIVES, IgoDirectionsModule, IgoSearchModule - ] + ], + providers: [provideDirection(withOsrmSource())] }) export class AppDirectionsComponent { public map: IgoMap = new IgoMap({ @@ -63,20 +67,26 @@ export class AppDirectionsComponent { }); public zoomToActiveRoute$: Subject = new Subject(); + public authenticated$: BehaviorSubject; + constructor( private layerService: LayerService, - private mapService: MapService + private mapService: MapService, + private authService: AuthService ) { + this.authenticated$ = this.authService.authenticate$; this.mapService.setMap(this.map); this.layerService .createAsyncLayer({ - title: 'OSM', + title: 'Quebec Base Map', baseLayer: true, visible: true, sourceOptions: { - type: 'osm' + type: 'xyz', + url: '/carto/tms/1.0.0/carte_gouv_qc_public@EPSG_3857/{z}/{x}/{-y}.png', + crossOrigin: 'anonymous' } - } satisfies LayerOptions) + } satisfies TileLayerOptions) .subscribe((layer: TileLayer) => this.map.addLayer(layer)); } } diff --git a/projects/demo/src/app/geo/feature/feature.component.ts b/projects/demo/src/app/geo/feature/feature.component.ts index 43a3620a8c..7013130789 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 { EntityTableComponent, EntityTableTemplate } from '@igo2/common'; +import { EntityTableComponent, EntityTableTemplate } from '@igo2/common/entity'; import { DataSourceService, FeatureDataSource, diff --git a/projects/demo/src/app/geo/geometry/geometry.component.ts b/projects/demo/src/app/geo/geometry/geometry.component.ts index bf3116e158..7ce056dc79 100644 --- a/projects/demo/src/app/geo/geometry/geometry.component.ts +++ b/projects/demo/src/app/geo/geometry/geometry.component.ts @@ -10,7 +10,7 @@ import { FormFieldConfig, FormGroupComponent, FormService -} from '@igo2/common'; +} from '@igo2/common/form'; import { DataSourceService, IgoMap, 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 ffc0849ddf..9850a5fbda 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 @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { WorkspaceStore } from '@igo2/common'; +import { WorkspaceStore } from '@igo2/common/workspace'; import { IMPORT_EXPORT_DIRECTIVES, IgoMap, diff --git a/projects/demo/src/app/geo/layer/layer.component.ts b/projects/demo/src/app/geo/layer/layer.component.ts index 635e676225..14badb94a3 100644 --- a/projects/demo/src/app/geo/layer/layer.component.ts +++ b/projects/demo/src/app/geo/layer/layer.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { PanelComponent } from '@igo2/common'; +import { PanelComponent } from '@igo2/common/panel'; import { DataSourceService, DownloadButtonComponent, diff --git a/projects/demo/src/app/geo/legend/legend.component.ts b/projects/demo/src/app/geo/legend/legend.component.ts index 247dc33328..97dd1b49e3 100644 --- a/projects/demo/src/app/geo/legend/legend.component.ts +++ b/projects/demo/src/app/geo/legend/legend.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import { PanelComponent } from '@igo2/common'; +import { PanelComponent } from '@igo2/common/panel'; import { DataSourceService, IgoMap, 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 68b47b9fa0..a0f152ad5f 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,7 +1,7 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { PanelComponent } from '@igo2/common'; +import { PanelComponent } from '@igo2/common/panel'; import { AnyBaseOgcFilterOptions, DataSourceService, diff --git a/projects/demo/src/app/geo/query/query.component.ts b/projects/demo/src/app/geo/query/query.component.ts index df33139688..964b9a120b 100644 --- a/projects/demo/src/app/geo/query/query.component.ts +++ b/projects/demo/src/app/geo/query/query.component.ts @@ -1,7 +1,8 @@ import { AsyncPipe, NgFor, NgIf } from '@angular/common'; import { Component } from '@angular/core'; -import { PanelComponent, getEntityTitle } from '@igo2/common'; +import { getEntityTitle } from '@igo2/common/entity'; +import { PanelComponent } from '@igo2/common/panel'; import { DataSource, DataSourceService, diff --git a/projects/demo/src/app/geo/search/search.component.ts b/projects/demo/src/app/geo/search/search.component.ts index 5e72824b7c..29e0eae37e 100644 --- a/projects/demo/src/app/geo/search/search.component.ts +++ b/projects/demo/src/app/geo/search/search.component.ts @@ -10,11 +10,11 @@ import { import { ActionStore, ActionbarComponent, - ActionbarMode, - CONTEXT_MENU_DIRECTIVES, - EntityStore, - PanelComponent -} from '@igo2/common'; + ActionbarMode +} from '@igo2/common/action'; +import { CONTEXT_MENU_DIRECTIVES } from '@igo2/common/context-menu'; +import { EntityStore } from '@igo2/common/entity'; +import { PanelComponent } from '@igo2/common/panel'; import { MediaService } from '@igo2/core/media'; import { StorageService } from '@igo2/core/storage'; import { @@ -33,12 +33,10 @@ import { Research, SEARCH_RESULTS_DIRECTIVES, SearchResult, - SearchService, ZoomButtonComponent, - provideDefaultCoordinatesSearchResultFormatter, - provideDefaultIChercheSearchResultFormatter, - provideILayerSearchResultFormatter, - provideSearchSourceService + provideSearch, + withIChercheSource, + withWorkspaceSource } from '@igo2/geo'; import { SearchState } from '@igo2/integration'; @@ -70,11 +68,10 @@ import { ExampleViewerComponent } from '../../components/example/example-viewer/ FeatureDetailsComponent ], providers: [ - SearchService, - provideSearchSourceService(), - provideDefaultIChercheSearchResultFormatter(), - provideDefaultCoordinatesSearchResultFormatter(), - provideILayerSearchResultFormatter() + provideSearch([withIChercheSource(), withWorkspaceSource()], { + analytics: true + }), + SearchState ] }) export class AppSearchComponent implements OnInit, OnDestroy { 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 4470408f74..c5002717e4 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 @@ -10,7 +10,8 @@ import { import { MatGridListModule } from '@angular/material/grid-list'; import { MatIconRegistry } from '@angular/material/icon'; -import { EntityKey, EntityStore, PanelComponent } from '@igo2/common'; +import { EntityKey, EntityStore } from '@igo2/common/entity'; +import { PanelComponent } from '@igo2/common/panel'; import { LanguageService } from '@igo2/core/language'; import { MessageService } from '@igo2/core/message'; import { 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 2190ad1063..3d07d03009 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,7 +1,7 @@ import { Component } from '@angular/core'; import { MatGridListModule } from '@angular/material/grid-list'; -import { PanelComponent } from '@igo2/common'; +import { PanelComponent } from '@igo2/common/panel'; import { DataSourceService, FILTER_DIRECTIVES, diff --git a/projects/demo/src/app/geo/workspace/workspace.component.ts b/projects/demo/src/app/geo/workspace/workspace.component.ts index a5d1582b1c..9318270a88 100644 --- a/projects/demo/src/app/geo/workspace/workspace.component.ts +++ b/projects/demo/src/app/geo/workspace/workspace.component.ts @@ -3,20 +3,20 @@ import { Component, OnInit } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { MatPaginator } from '@angular/material/paginator'; +import { Action, ActionbarComponent, ActionbarMode } from '@igo2/common/action'; import { - Action, - ActionbarComponent, - ActionbarMode, EntityRecord, EntityTableComponent, EntityTablePaginatorComponent, EntityTablePaginatorOptions, - EntityTableScrollBehavior, + EntityTableScrollBehavior +} from '@igo2/common/entity'; +import { Workspace, WorkspaceSelectorComponent, WorkspaceStore, WorkspaceWidgetOutletComponent -} from '@igo2/common'; +} from '@igo2/common/workspace'; import { DataSourceService, IgoGeoWorkspaceModule, diff --git a/projects/demo/src/app/pages/home/home.component.ts b/projects/demo/src/app/pages/home/home.component.ts index 724879eee5..cb9afe402a 100644 --- a/projects/demo/src/app/pages/home/home.component.ts +++ b/projects/demo/src/app/pages/home/home.component.ts @@ -1,6 +1,9 @@ import { Component } from '@angular/core'; -import { IgoInteractiveTourModule, InteractiveTourService } from '@igo2/common'; +import { + IgoInteractiveTourModule, + InteractiveTourService +} from '@igo2/common/interactive-tour'; import { DocViewerComponent } from '../../components/doc-viewer/doc-viewer.component'; diff --git a/projects/demo/src/environments/environment.prod.ts b/projects/demo/src/environments/environment.prod.ts index 9d609dcf46..6864773e61 100644 --- a/projects/demo/src/environments/environment.prod.ts +++ b/projects/demo/src/environments/environment.prod.ts @@ -4,6 +4,24 @@ import { EnvironmentOptions } from '@igo2/integration'; export const environment: EnvironmentOptions = { production: true, igo: { + directionsSources: { + osrm: { + name: 'OSRM Québec', + baseUrl: '/apis/itineraire/route/v1/', + profiles: [ + { + name: 'driving' + }, + { + name: 'forestier', + authorization: { + url: '/apis/igo2/user/igo', + property: 'hasOsrmPrivateAccess' + } + } + ] + } + }, projections: [ { code: 'EPSG:32198', diff --git a/projects/demo/src/environments/environment.ts b/projects/demo/src/environments/environment.ts index a5154f7303..703ea98645 100644 --- a/projects/demo/src/environments/environment.ts +++ b/projects/demo/src/environments/environment.ts @@ -4,6 +4,24 @@ import { EnvironmentOptions } from '@igo2/integration'; export const environment: EnvironmentOptions = { production: false, igo: { + directionsSources: { + osrm: { + name: 'OSRM Québec', + baseUrl: '/apis/itineraire/route/v1/', + profiles: [ + { + name: 'driving' + }, + { + name: 'forestier', + authorization: { + url: '/apis/igo2/user/igo', + property: 'hasOsrmPrivateAccess' + } + } + ] + } + }, importWithStyle: true, projections: [ { diff --git a/projects/demo/src/main.ts b/projects/demo/src/main.ts index bcd0fc1fff..cd7ad2320f 100644 --- a/projects/demo/src/main.ts +++ b/projects/demo/src/main.ts @@ -23,17 +23,10 @@ import { } from '@angular/router'; import { provideAuthentification } from '@igo2/auth'; -import { provideIcon } from '@igo2/common'; +import { provideIcon } from '@igo2/common/icon'; import { IgoCoreModule } from '@igo2/core'; import { provideConfig } from '@igo2/core/config'; import { provideTranslation } from '@igo2/core/language'; -import { - IgoDirectionsModule, - IgoGeoWorkspaceModule, - provideIChercheSearchSource, - provideOsrmDirectionsSource, - provideWorkspaceSearchSource -} from '@igo2/geo'; import { AppComponent } from './app/app.component'; import { routes } from './app/app.routing'; @@ -60,9 +53,7 @@ bootstrapApplication(AppComponent, { MatIconModule, MatListModule, MatSidenavModule, - MatToolbarModule, - IgoGeoWorkspaceModule, - IgoDirectionsModule + MatToolbarModule ), provideHttpClient(withJsonpSupport()), provideRouter(routes, withPreloading(PreloadAllModules)), @@ -72,9 +63,6 @@ bootstrapApplication(AppComponent, { }), provideTranslation(), provideAuthentification(), - provideOsrmDirectionsSource(), - provideIChercheSearchSource(), - provideWorkspaceSearchSource(), provideIcon(), { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, diff --git a/tsconfig.json b/tsconfig.json index e77a1e0043..81847c7d69 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,10 +17,11 @@ "lib": ["ES2022", "dom"], "paths": { "@igo2/core": ["packages/core/src/public_api"], - "@igo2/core/*": ["packages/core/*"], - "@igo2/auth": ["packages/auth/src"], - "@igo2/auth/*": ["packages/auth/*"], + "@igo2/core/*": ["packages/core/*/src/public_api"], + "@igo2/auth": ["packages/auth/src/public_api"], + "@igo2/auth/*": ["packages/auth/*/src/public_api"], "@igo2/common": ["packages/common/src/public_api"], + "@igo2/common/*": ["packages/common/*/src/public_api"], "@igo2/context": ["packages/context/src/public_api"], "@igo2/geo": ["packages/geo/src/public_api"], "@igo2/integration": ["packages/integration/src/public_api"],