From 5ad989faf8d139894b1f8850444f1d9c1b183f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Wed, 30 Oct 2019 09:27:40 -0400 Subject: [PATCH 01/11] feat(toolbox): the color of the toolbox can be chosen --- packages/common/src/lib/tool/shared/index.ts | 1 + .../src/lib/tool/shared/toolbox.enums.ts | 5 ++ .../lib/tool/toolbox/toolbox.component.scss | 2 +- .../src/lib/tool/toolbox/toolbox.component.ts | 31 ++++++++++-- .../src/lib/tool/toolbox/toolbox.theming.scss | 47 +++++++++++++++++-- 5 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 packages/common/src/lib/tool/shared/toolbox.enums.ts diff --git a/packages/common/src/lib/tool/shared/index.ts b/packages/common/src/lib/tool/shared/index.ts index 19607f55c6..14c3e0e2b3 100644 --- a/packages/common/src/lib/tool/shared/index.ts +++ b/packages/common/src/lib/tool/shared/index.ts @@ -1,4 +1,5 @@ export * from './tool.interface'; export * from './tool.service'; export * from './tool-component'; +export * from './toolbox.enums'; export * from './toolbox'; diff --git a/packages/common/src/lib/tool/shared/toolbox.enums.ts b/packages/common/src/lib/tool/shared/toolbox.enums.ts new file mode 100644 index 0000000000..bd5bbe854b --- /dev/null +++ b/packages/common/src/lib/tool/shared/toolbox.enums.ts @@ -0,0 +1,5 @@ +export enum ToolboxColor { + White = 'white', + Grey = 'grey', + Primary = 'primary' +} diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.scss b/packages/common/src/lib/tool/toolbox/toolbox.component.scss index 6ef904c4b8..f767f16326 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.component.scss +++ b/packages/common/src/lib/tool/toolbox/toolbox.component.scss @@ -23,7 +23,7 @@ } .igo-tool-container-with-toolbar { - left: 51px; + left: 50px; } igo-actionbar { diff --git a/packages/common/src/lib/tool/toolbox/toolbox.component.ts b/packages/common/src/lib/tool/toolbox/toolbox.component.ts index 9527a3dc21..fcb675d5ab 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.component.ts +++ b/packages/common/src/lib/tool/toolbox/toolbox.component.ts @@ -3,6 +3,7 @@ import { Input, OnDestroy, OnInit, + HostBinding, ChangeDetectionStrategy } from '@angular/core'; @@ -11,6 +12,7 @@ import { map } from 'rxjs/operators'; import { Action, ActionStore } from '../../action'; import { Tool } from '../shared/tool.interface'; +import { ToolboxColor } from '../shared/toolbox.enums'; import { Toolbox } from '../shared/toolbox'; import { toolSlideInOut } from './toolbox.animation'; @@ -22,7 +24,6 @@ import { toolSlideInOut } from './toolbox.animation'; changeDetection: ChangeDetectionStrategy.OnPush }) export class ToolboxComponent implements OnInit, OnDestroy { - /** * Observable of the active tool */ @@ -82,6 +83,27 @@ export class ToolboxComponent implements OnInit, OnDestroy { */ @Input() animate: boolean = false; + /** + * Color of Toolbox + */ + @Input() color: ToolboxColor = ToolboxColor.White; + + /** + * @ignore + */ + @HostBinding('class.color-grey') + get classColorGrey() { + return this.color === ToolboxColor.Grey; + } + + /** + * @ignore + */ + @HostBinding('class.color-primary') + get classColorPrimary() { + return this.color === ToolboxColor.Primary; + } + /** * Initialize the toolbar and subscribe to the active tool * @internal @@ -200,8 +222,11 @@ export class ToolboxComponent implements OnInit, OnDestroy { } let childrenToolActivated = false; - if (activeTool !== undefined && _tool.name === activeTool.parent) { - childrenToolActivated = true; + if ( + activeTool !== undefined && + _tool.name === activeTool.parent + ) { + childrenToolActivated = true; } return { diff --git a/packages/common/src/lib/tool/toolbox/toolbox.theming.scss b/packages/common/src/lib/tool/toolbox/toolbox.theming.scss index 2dd9435e87..5263ca1aa6 100644 --- a/packages/common/src/lib/tool/toolbox/toolbox.theming.scss +++ b/packages/common/src/lib/tool/toolbox/toolbox.theming.scss @@ -1,13 +1,50 @@ @mixin igo-toolbox-theming($theme) { + $primary: map-get($theme, primary); $accent: map-get($theme, accent); - igo-toolbox > igo-actionbar igo-actionbar-item mat-list-item.tool-activated { - background-color: mat-color($accent); + igo-toolbox > igo-actionbar mat-list.mat-list-base igo-actionbar-item mat-list-item { + &:hover { + background-color: mat-color($accent, lighter); + } + + &.tool-activated, + &.children-tool-activated { + background-color: mat-color($accent); + cursor: default; + button { + cursor: default; + } + } + } + + + igo-toolbox.color-primary > igo-actionbar:not(.with-title) { + box-shadow: unset; + background-color: mat-color($primary) } - igo-toolbox > igo-actionbar igo-actionbar-item mat-list-item.children-tool-activated { - background-color: mat-color($accent); + igo-toolbox.color-grey > igo-actionbar:not(.with-title) { + box-shadow: unset; + background-color: #737475; } - + + igo-toolbox.color-primary, + igo-toolbox.color-grey { + & > igo-actionbar:not(.with-title) mat-list.mat-list-base { + .mat-list-item.mat-list-item-with-avatar { + color: white; + &:hover { + color: black; + } + + &.tool-activated, + &.children-tool-activated { + background-color: white; + color: black; + } + } + } + } + } From adad9b1ed568aa676a89ae29f859f87da61dea3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Wed, 30 Oct 2019 10:49:46 -0400 Subject: [PATCH 02/11] fix(user-button): show buttons only if api --- .../context-map-button/user-button/user-button.component.html | 4 ++-- .../context-map-button/user-button/user-button.component.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/context/src/lib/context-map-button/user-button/user-button.component.html b/packages/context/src/lib/context-map-button/user-button/user-button.component.html index 5aa10bf87b..f03f7f6b74 100644 --- a/packages/context/src/lib/context-map-button/user-button/user-button.component.html +++ b/packages/context/src/lib/context-map-button/user-button/user-button.component.html @@ -1,8 +1,8 @@
- - + +
diff --git a/packages/context/src/lib/share-map/share-map/share-map.component.scss b/packages/context/src/lib/share-map/share-map/share-map.component.scss index e69a176ca3..79c92263a5 100644 --- a/packages/context/src/lib/share-map/share-map/share-map.component.scss +++ b/packages/context/src/lib/share-map/share-map/share-map.component.scss @@ -16,7 +16,7 @@ mat-form-field { padding: 25px 5px 5px; textarea { resize: none; - width: calc(100% - 60px); + width: 100%; line-height: 1.3; height: 40px; overflow-y: hidden; From 24f76e20674f3269d6cdab324d682fb99a00e7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 31 Oct 2019 10:51:59 -0400 Subject: [PATCH 07/11] polyfills(queryService): Matchall polyfill (#491) * polyfills(queryService) Matchall polyfill * readme update --- README.md | 8 +++++--- demo/src/polyfills.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72e9a59fcd..c9b7bb51e3 100644 --- a/README.md +++ b/README.md @@ -51,14 +51,16 @@ If you want to develop in IGO2 Library, it can be installed by: ### Development server Run `npm start` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the demo's source files. -If you modify files from the lib (../project/*) you must run: +If you modify files from the lib (../packages/*) you must run: 1. npm run build.libs to rebuild all the libs 2. OR -3. npm run build.geo if you have only modifyed the geo project or whatever part of the lib... +3. npm run build.geo if you have only modifyed the geo package or whatever part of the lib... +4. OR +5. npm run start.watch to be aware of any modifications done to the lib. ### Build -Run `npm run build.libs` to build the project. The build artifacts will be stored in the `dist/` directory. +Run `npm run build.libs` to build the whole project. The build artifacts will be stored in the `dist/` directory. ### Running tests diff --git a/demo/src/polyfills.ts b/demo/src/polyfills.ts index 33ec57ee81..92c48eb547 100644 --- a/demo/src/polyfills.ts +++ b/demo/src/polyfills.ts @@ -28,7 +28,7 @@ import 'unorm/lib/unorm.js'; /** IE10 and IE11 requires the following for some object management */ import 'core-js/es7/object'; - +import 'core-js/es7/string'; /** * Web Animations `@angular/platform-browser/animations` * Only required if AnimationBuilder is used within the application and From be882e2d9553b4f95d28c0e4d7d53176b8e3fba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Barbeau?= Date: Thu, 31 Oct 2019 10:23:34 -0400 Subject: [PATCH 08/11] fix(shareMap): remove options (hasShareMapButton, hasCopyLinkButton) --- .../share-map/share-map.component.html | 14 ++++++++++++-- .../share-map/share-map.component.scss | 3 +++ .../share-map/share-map/share-map.component.ts | 18 ------------------ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/packages/context/src/lib/share-map/share-map/share-map.component.html b/packages/context/src/lib/share-map/share-map/share-map.component.html index 84e99cda5c..db35c8ea6a 100644 --- a/packages/context/src/lib/share-map/share-map/share-map.component.html +++ b/packages/context/src/lib/share-map/share-map/share-map.component.html @@ -27,7 +27,7 @@
-
+
-
+