@colijnit/corecomponents_v12 12.2.4 → 12.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +501 -134
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.d.ts +0 -2
  4. package/colijnit-corecomponents_v12.metadata.json +1 -1
  5. package/esm2015/colijnit-corecomponents_v12.js +1 -3
  6. package/esm2015/lib/components/base/base-input.component.js +52 -43
  7. package/esm2015/lib/components/button/button.component.js +27 -20
  8. package/esm2015/lib/components/filter-item/filter-item.component.js +10 -5
  9. package/esm2015/lib/components/input-date-picker/input-date-picker.component.js +3 -1
  10. package/esm2015/lib/components/list-of-values/list-of-values.component.js +14 -6
  11. package/esm2015/lib/directives/screen-configuration/screen-configuration.directive.js +123 -33
  12. package/esm2015/lib/directives/screen-configuration/screen-configuration.module.js +4 -6
  13. package/esm2015/lib/service/base-module-screen-config.service.js +205 -0
  14. package/esm2015/lib/service/base-module.service.js +42 -0
  15. package/esm2015/public-api.js +4 -1
  16. package/fesm2015/colijnit-corecomponents_v12.js +453 -125
  17. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  18. package/lib/components/base/base-input.component.d.ts +5 -3
  19. package/lib/components/button/button.component.d.ts +11 -3
  20. package/lib/directives/screen-configuration/screen-configuration.directive.d.ts +25 -9
  21. package/lib/service/base-module-screen-config.service.d.ts +47 -0
  22. package/lib/service/base-module.service.d.ts +22 -0
  23. package/package.json +5 -4
  24. package/public-api.d.ts +3 -0
  25. package/esm2015/lib/directives/screen-configuration/screen-config-component-wrapper.component.js +0 -30
  26. package/lib/directives/screen-configuration/screen-config-component-wrapper.component.d.ts +0 -11
@@ -57,7 +57,7 @@ export declare abstract class BaseInputComponent<T> implements OnInit, OnDestroy
57
57
  redErrorBackground: boolean;
58
58
  set myFormInputInstance(value: BaseInputComponent<T>);
59
59
  get myFormInputInstance(): BaseInputComponent<T>;
60
- private _myFormInputInstance;
60
+ commitOnBlur: boolean;
61
61
  readonly nativeBlur: EventEmitter<any>;
62
62
  readonly blur: EventEmitter<any>;
63
63
  readonly enter: EventEmitter<any>;
@@ -105,8 +105,10 @@ export declare abstract class BaseInputComponent<T> implements OnInit, OnDestroy
105
105
  protected _destroyed: boolean;
106
106
  protected _hasOnPushCdStrategy: boolean;
107
107
  protected _model: T;
108
+ protected _modelDirtyForCommit: boolean;
108
109
  protected _initialModel: T;
109
110
  protected _initialModelSet: boolean;
111
+ private _myFormInputInstance;
110
112
  private _errorValidationComponent;
111
113
  private _decimals;
112
114
  private _hidden;
@@ -130,7 +132,6 @@ export declare abstract class BaseInputComponent<T> implements OnInit, OnDestroy
130
132
  ngAfterViewInit(): void;
131
133
  ngOnDestroy(): void;
132
134
  commit: (model: any) => Promise<boolean>;
133
- commitClick(event?: MouseEvent): Promise<boolean>;
134
135
  cancelClick(event?: MouseEvent): void;
135
136
  showValidationError(error: string): void;
136
137
  /**
@@ -140,7 +141,7 @@ export declare abstract class BaseInputComponent<T> implements OnInit, OnDestroy
140
141
  setModel(value: any): void;
141
142
  requestFocus(): void;
142
143
  doFocus(event?: any): any;
143
- doBlur(event?: any): any;
144
+ doBlur(event?: any, handleCommit?: boolean): Promise<any>;
144
145
  detectChanges(): void;
145
146
  markForCheck(): void;
146
147
  detectChangesAfterAngular(): void;
@@ -158,6 +159,7 @@ export declare abstract class BaseInputComponent<T> implements OnInit, OnDestroy
158
159
  protected _markAsOnPush(): void;
159
160
  protected _checkState(): boolean;
160
161
  protected _updateControlValidatorsAndOwnFlags(): void;
162
+ private _handleCommit;
161
163
  private _commitFinished;
162
164
  private _clearErrorComponent;
163
165
  private _controlExists;
@@ -1,6 +1,7 @@
1
- import { ElementRef, EventEmitter, OnDestroy } from "@angular/core";
2
- import { SafeHtml } from "@angular/platform-browser";
3
- export declare class ButtonComponent implements OnDestroy {
1
+ import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
2
+ import { SafeHtml } from '@angular/platform-browser';
3
+ import { ScreenConfigAdapterComponent } from '../../interfaces/screen-config-adapter.component.interface';
4
+ export declare class ButtonComponent implements ScreenConfigAdapterComponent, OnDestroy {
4
5
  private _elementRef;
5
6
  label: string;
6
7
  iconData: SafeHtml | undefined;
@@ -15,6 +16,13 @@ export declare class ButtonComponent implements OnDestroy {
15
16
  readonly isToggledChange: EventEmitter<boolean>;
16
17
  get hasIcon(): boolean;
17
18
  onHostClick(event: MouseEvent): void;
19
+ objectConfigName: string;
20
+ required: boolean;
21
+ forceReadonly: boolean;
22
+ readonly: boolean;
23
+ maxLength: number;
24
+ decimals: number;
25
+ redErrorBackground: boolean;
18
26
  constructor(_elementRef: ElementRef);
19
27
  ngOnDestroy(): void;
20
28
  focus(): void;
@@ -1,16 +1,32 @@
1
- import { ComponentFactoryResolver, OnDestroy, ViewContainerRef } from "@angular/core";
2
- import { ScreenConfigAdapterComponent } from "../../interfaces/screen-config-adapter.component.interface";
1
+ import { ElementRef, OnDestroy, Renderer2 } from '@angular/core';
2
+ import { ScreenConfigAdapterComponent } from '../../interfaces/screen-config-adapter.component.interface';
3
+ import { BaseModuleScreenConfigService } from '../../service/base-module-screen-config.service';
4
+ import { BaseModuleService } from '../../service/base-module.service';
3
5
  export declare class ScreenConfigurationDirective implements OnDestroy {
4
6
  hostComponent: ScreenConfigAdapterComponent;
5
- private _viewContainerRef;
6
- private _componentFactoryResolver;
7
- set screenConfigurationObject(screenConfigurationObject: any);
8
- get screenConfigurationObject(): any;
7
+ private _element;
8
+ private _configService;
9
+ private _renderer;
10
+ private _moduleService?;
11
+ set screenConfigurationObject(value: string);
12
+ get screenConfigurationObject(): string;
13
+ dataName: string;
14
+ screenConfigNativeElement: boolean;
9
15
  noModuleService: boolean;
16
+ private _isHeader;
10
17
  private _screenConfigurationObject;
11
- private _wrapperComponentInstance;
12
- constructor(hostComponent: ScreenConfigAdapterComponent, _viewContainerRef: ViewContainerRef, _componentFactoryResolver: ComponentFactoryResolver);
18
+ private _isTurnedOff;
19
+ private _subs;
20
+ constructor(hostComponent: ScreenConfigAdapterComponent, _element: ElementRef, _configService: BaseModuleScreenConfigService, _renderer: Renderer2, _moduleService?: BaseModuleService);
21
+ ngOnInit(): void;
13
22
  ngOnDestroy(): void;
14
- private _initWrapperComponent;
15
23
  private _updateHost;
24
+ /**
25
+ * Spawn error message tooltip onto our host comp, if any error was meant for the host (found by screenConfigurationObject);
26
+ * @param errorValidation A top-level full validation result, either from the backend or from some client-side validation error.
27
+ */
28
+ private _setErrorRedBackgroundAfterScrCfgValidate;
29
+ private _moduleInReadonlyMode;
30
+ private _mayUpdateHost;
31
+ private _setHostVisible;
16
32
  }
@@ -0,0 +1,47 @@
1
+ import { BehaviorSubject } from 'rxjs';
2
+ import { BusinessObject } from '@colijnit/ioneconnector/build/model/business-object';
3
+ import { ValidationResult } from '@colijnit/ioneconnector/build/model/validation-result';
4
+ import { ObjectConfigurationDefaultValueType } from '@colijnit/ioneconnector/build/type/object-configuration-default-value-type';
5
+ import { ObjectConfigKind } from '@colijnit/ioneconnector/build/enum/object-config-kind';
6
+ import { ObjectConfiguration } from '@colijnit/ioneconnector/build/model/object-configuration';
7
+ export declare abstract class BaseModuleScreenConfigService {
8
+ abstract screenModuleName: string;
9
+ readonly configSet: BehaviorSubject<string[]>;
10
+ get configObjects(): ObjectConfiguration[];
11
+ controlValidityByBoMap: {
12
+ bo: BusinessObject;
13
+ controlKey: string;
14
+ valid: boolean;
15
+ }[];
16
+ private _configObjects;
17
+ private _objectConfigsMap;
18
+ loadConfig(params?: string[], insertRights?: boolean): Promise<ObjectConfiguration[]>;
19
+ lazyLoadConfig(): Promise<void>;
20
+ isActiveFieldValidationObject(configObject: ObjectConfiguration): boolean;
21
+ isBoValid(bo: BusinessObject): boolean;
22
+ getObjectConfigurationFor(configName: string): ObjectConfiguration;
23
+ setObjectConfigurationFor(configName: string, configObject: ObjectConfiguration): void;
24
+ mayRead(configName: string): boolean;
25
+ isReadonly(configName: string): boolean;
26
+ mayWrite(configName: string): boolean;
27
+ immediatelyVisible(configName: string): boolean;
28
+ immediatelyHidden(configName: string): boolean;
29
+ noRights(configName: string): boolean;
30
+ isHidden(configName: string): boolean;
31
+ isRequired(configName: string): boolean;
32
+ getDefaultValue(configName: string): ObjectConfigurationDefaultValueType;
33
+ getDefaultStringValue(configName: string): string;
34
+ getDefaultNumberValue(configName: string): number;
35
+ getMaxLength(configName: string): number;
36
+ getDecimals(configName: string): number;
37
+ hasConfigObjects(): boolean;
38
+ isKind(configName: string, kind: ObjectConfigKind): boolean;
39
+ isDataNameHiddenByItselfOrAnyOfItsParentRubrics(dataName: string): boolean;
40
+ protected abstract loadConfigForModule(params: string[], insertRights?: boolean): Promise<ObjectConfiguration[]>;
41
+ private isDataNameHiddenByAnyOfItsParentRubrics;
42
+ private _getConfigNameByDataName;
43
+ private _getConfigObjectByDataName;
44
+ private _buildScreenConfigMap;
45
+ setScreenConfigurationObjectsReadOnly(value: boolean): void;
46
+ setScreenConfigurationObjectsRedErrorBackground(errorValidation: ValidationResult, setAllFalse?: boolean): void;
47
+ }
@@ -0,0 +1,22 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Subject } from 'rxjs';
3
+ import { ValidationResult } from '@colijnit/ioneconnector/build/model/validation-result';
4
+ import { BaseModuleScreenConfigService } from './base-module-screen-config.service';
5
+ /**
6
+ * Base class for top-level services of CRUD-style iOne modules (the Relation, Article and Transaction modules).
7
+ * What sets these modules apart, is the concept of a relatively bulky, 'single businessobject' being manipulated throughout all the tabs.
8
+ *
9
+ * Many other (smaller?) iOne modules work with multiple LISTS of different business object types instead.
10
+ */
11
+ export declare abstract class BaseModuleService implements OnDestroy {
12
+ protected screenConfigService: BaseModuleScreenConfigService;
13
+ readonly readonlyChange: Subject<boolean>;
14
+ readonly errorValidationReceived: Subject<ValidationResult>;
15
+ readonly successfulUpdate: Subject<void>;
16
+ get readonly(): boolean;
17
+ set readonly(readonly: boolean);
18
+ protected _readonly: boolean;
19
+ private _subscriptions;
20
+ constructor(screenConfigService: BaseModuleScreenConfigService);
21
+ ngOnDestroy(): void;
22
+ }
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@colijnit/corecomponents_v12",
3
- "version": "12.2.4",
3
+ "version": "12.2.6",
4
4
  "description": "Colijn IT core components for Angular 12",
5
5
  "private": false,
6
6
  "peerDependencies": {
7
- "@angular/common": "^12.2.0",
8
- "@angular/core": "^12.2.0",
7
+ "@angular/common": ">=12.2.0",
8
+ "@angular/core": ">=12.2.0",
9
+ "@colijnit/ioneconnector": ">=3.1.8",
9
10
  "@types/hammerjs": "2.0.35",
10
11
  "@types/three": ">=0.125.0",
11
12
  "@tweenjs/tween.js": ">=17.2.0",
12
- "hammerjs": "^2.0.8",
13
+ "hammerjs": ">=2.0.8",
13
14
  "three": ">=0.125.0"
14
15
  },
15
16
  "dependencies": {
package/public-api.d.ts CHANGED
@@ -100,11 +100,14 @@ export * from './lib/components/pagination-bar/pagination-bar.component';
100
100
  export * from './lib/components/pagination-bar/pagination-bar.module';
101
101
  export * from './lib/components/checkmark-overlay/checkmark-overlay.module';
102
102
  export * from './lib/directives/screen-configuration/screen-configuration.module';
103
+ export * from './lib/directives/screen-configuration/screen-configuration.directive';
103
104
  export * from './lib/interfaces/screen-config-adapter-component-interface-name';
104
105
  export * from './lib/interfaces/screen-config-adapter.component.interface';
105
106
  export * from './lib/components/filter-item/filter-item-viewmodel';
106
107
  export * from './lib/components/filter-item/filter-viewmodel';
107
108
  export * from './lib/service/color-sequence.service';
108
109
  export * from './lib/service/overlay.service';
110
+ export * from './lib/service/base-module-screen-config.service';
111
+ export * from './lib/service/base-module.service';
109
112
  export * from './lib/translation/core-components-translation.module';
110
113
  export * from './lib/translation/core-components-translation.service';
@@ -1,30 +0,0 @@
1
- import { Component, ElementRef, ViewChild } from "@angular/core";
2
- export class ScreenConfigComponentWrapper {
3
- constructor(_elementRef) {
4
- this._elementRef = _elementRef;
5
- this._visibleOnViewInit = true;
6
- }
7
- setWrapperContent(element, visibleOnViewInit) {
8
- this._contentNativeElement = element;
9
- this._visibleOnViewInit = visibleOnViewInit;
10
- }
11
- ngAfterViewInit() {
12
- if (this.screenConfigComponentWrapper) {
13
- this.screenConfigComponentWrapper.nativeElement.appendChild(this._contentNativeElement);
14
- this.hidden = !this._visibleOnViewInit;
15
- }
16
- }
17
- }
18
- ScreenConfigComponentWrapper.decorators = [
19
- { type: Component, args: [{
20
- selector: "screen-config-component-wrapper",
21
- template: `<div *ngIf="!hidden" #screenConfigComponentWrapper></div>`
22
- },] }
23
- ];
24
- ScreenConfigComponentWrapper.ctorParameters = () => [
25
- { type: ElementRef }
26
- ];
27
- ScreenConfigComponentWrapper.propDecorators = {
28
- screenConfigComponentWrapper: [{ type: ViewChild, args: ['screenConfigComponentWrapper',] }]
29
- };
30
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyZWVuLWNvbmZpZy1jb21wb25lbnQtd3JhcHBlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb3JlY29tcG9uZW50cy9zcmMvbGliL2RpcmVjdGl2ZXMvc2NyZWVuLWNvbmZpZ3VyYXRpb24vc2NyZWVuLWNvbmZpZy1jb21wb25lbnQtd3JhcHBlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFnQixTQUFTLEVBQUUsVUFBVSxFQUFFLFNBQVMsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQU05RSxNQUFNLE9BQU8sNEJBQTRCO0lBU3ZDLFlBQ1UsV0FBdUI7UUFBdkIsZ0JBQVcsR0FBWCxXQUFXLENBQVk7UUFIekIsdUJBQWtCLEdBQVksSUFBSSxDQUFDO0lBSXhDLENBQUM7SUFFRyxpQkFB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2NyZWVuQ29uZmlnQ29tcG9uZW50V3JhcHBlcjogYW55O1xyXG5cclxuICBwdWJsaWMgaGlkZGVuOiBib29sZWFuO1xyXG5cclxuICBwcml2YXRlIF9jb250ZW50TmF0aXZlRWxlbWVudDogRWxlbWVudFJlZjtcclxuICBwcml2YXRlIF92aXNpYmxlT25WaWV3SW5pdDogYm9vbGVhbiA9IHRydWU7XHJcblxyXG4gIGNvbnN0cnVjdG9yKFxyXG4gICAgcHJpdmF0ZSBfZWxlbWVudFJlZjogRWxlbWVudFJlZlxyXG4gICkge31cclxuXHJcbiAgcHVibGljIHNldFdyYXBwZXJDb250ZW50KGVsZW1lbnQ6IEVsZW1lbnRSZWYsIHZpc2libGVPblZpZXdJbml0OiBib29sZWFuKTogdm9pZCB7XHJcbiAgICB0aGlzLl9jb250ZW50TmF0aXZlRWxlbWVudCA9IGVsZW1lbnQ7XHJcbiAgICB0aGlzLl92aXNpYmxlT25WaWV3SW5pdCA9IHZpc2libGVPblZpZXdJbml0O1xyXG4gIH1cclxuXHJcbiAgcHVibGljIG5nQWZ0ZXJWaWV3SW5pdCgpOiB2b2lkIHtcclxuICAgIGlmICh0aGlzLnNjcmVlbkNvbmZpZ0NvbXBvbmVudFdyYXBwZXIpIHtcclxuICAgICAgdGhpcy5zY3JlZW5Db25maWdDb21wb25lbnRXcmFwcGVyLm5hdGl2ZUVsZW1lbnQuYXBwZW5kQ2hpbGQodGhpcy5fY29udGVudE5hdGl2ZUVsZW1lbnQpO1xyXG4gICAgICB0aGlzLmhpZGRlbiA9ICF0aGlzLl92aXNpYmxlT25WaWV3SW5pdDtcclxuICAgIH1cclxuICB9XHJcblxyXG59XHJcbiJdfQ==
@@ -1,11 +0,0 @@
1
- import { AfterViewInit, ElementRef } from "@angular/core";
2
- export declare class ScreenConfigComponentWrapper implements AfterViewInit {
3
- private _elementRef;
4
- screenConfigComponentWrapper: any;
5
- hidden: boolean;
6
- private _contentNativeElement;
7
- private _visibleOnViewInit;
8
- constructor(_elementRef: ElementRef);
9
- setWrapperContent(element: ElementRef, visibleOnViewInit: boolean): void;
10
- ngAfterViewInit(): void;
11
- }