@mosa-ng/material 17.0.0 → 17.0.1

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 (71) hide show
  1. package/esm2022/lib/mosa-material.module.mjs +30 -0
  2. package/esm2022/mosa-ng-material.mjs +5 -0
  3. package/esm2022/public-api.mjs +2 -0
  4. package/fesm2022/mosa-ng-material.mjs +37 -0
  5. package/fesm2022/mosa-ng-material.mjs.map +1 -0
  6. package/index.d.ts +5 -0
  7. package/lib/mosa-material.module.d.ts +11 -0
  8. package/package.json +23 -10
  9. package/public-api.d.ts +1 -0
  10. package/.eslintrc.json +0 -31
  11. package/ng-package.json +0 -10
  12. package/src/lib/components/alert-widget/alert-widget.module.ts +0 -17
  13. package/src/lib/components/alert-widget/alert.widget.html +0 -7
  14. package/src/lib/components/alert-widget/alert.widget.scss +0 -50
  15. package/src/lib/components/alert-widget/alert.widget.ts +0 -61
  16. package/src/lib/components/base/base.module.ts +0 -14
  17. package/src/lib/components/base/cell-editor.base.component.ts +0 -79
  18. package/src/lib/components/cell-editor/cell-editor.component.html +0 -6
  19. package/src/lib/components/cell-editor/cell-editor.component.scss +0 -53
  20. package/src/lib/components/cell-editor/cell-editor.component.ts +0 -115
  21. package/src/lib/components/cell-editor/cell-editor.module.ts +0 -15
  22. package/src/lib/components/confirm-dialog/confirm-dialog.module.ts +0 -19
  23. package/src/lib/components/confirm-dialog/confirm.dialog.html +0 -15
  24. package/src/lib/components/confirm-dialog/confirm.dialog.scss +0 -3
  25. package/src/lib/components/confirm-dialog/confirm.dialog.ts +0 -60
  26. package/src/lib/components/loading-button/loading-button.component.html +0 -42
  27. package/src/lib/components/loading-button/loading-button.component.scss +0 -40
  28. package/src/lib/components/loading-button/loading-button.component.ts +0 -42
  29. package/src/lib/components/loading-button/loading-button.module.ts +0 -21
  30. package/src/lib/components/logger/README.md +0 -83
  31. package/src/lib/components/logger/logger.component.html +0 -32
  32. package/src/lib/components/logger/logger.component.scss +0 -120
  33. package/src/lib/components/logger/logger.component.ts +0 -116
  34. package/src/lib/components/logger/logger.module.ts +0 -23
  35. package/src/lib/components/skeleton-loader/base.skeleton-loader.ts +0 -14
  36. package/src/lib/components/skeleton-loader/list-skeleton-loader/list-skeleton-loader.module.ts +0 -17
  37. package/src/lib/components/skeleton-loader/list-skeleton-loader/list.skeleton-loader.html +0 -5
  38. package/src/lib/components/skeleton-loader/list-skeleton-loader/list.skeleton-loader.scss +0 -0
  39. package/src/lib/components/skeleton-loader/list-skeleton-loader/list.skeleton-loader.ts +0 -26
  40. package/src/lib/components/skeleton-loader/skeleton/skeleton.component.html +0 -0
  41. package/src/lib/components/skeleton-loader/skeleton/skeleton.component.scss +0 -15
  42. package/src/lib/components/skeleton-loader/skeleton/skeleton.component.ts +0 -64
  43. package/src/lib/components/skeleton-loader/skeleton-loader.module.ts +0 -17
  44. package/src/lib/components/skeleton-loader/table-skeleton-loader/table-skeleton-loader.module.ts +0 -19
  45. package/src/lib/components/skeleton-loader/table-skeleton-loader/table.skeleton-loader.html +0 -12
  46. package/src/lib/components/skeleton-loader/table-skeleton-loader/table.skeleton-loader.scss +0 -3
  47. package/src/lib/components/skeleton-loader/table-skeleton-loader/table.skeleton-loader.ts +0 -44
  48. package/src/lib/components/update-dialog/mat-update-dialog/mat-update.dialog.html +0 -17
  49. package/src/lib/components/update-dialog/mat-update-dialog/mat-update.dialog.scss +0 -3
  50. package/src/lib/components/update-dialog/mat-update-dialog/mat-update.dialog.ts +0 -28
  51. package/src/lib/components/update-dialog/update-dialog.module.ts +0 -22
  52. package/src/lib/components/update-dialog/update.dialog.ts +0 -124
  53. package/src/lib/directives/cell-editor/cell-editor.directive.module.ts +0 -15
  54. package/src/lib/directives/cell-editor/cell-editor.directive.ts +0 -163
  55. package/src/lib/directives/click-outside/click-outside.directive.module.ts +0 -15
  56. package/src/lib/directives/click-outside/click-outside.directive.ts +0 -48
  57. package/src/lib/models/confirm-dialog.model.ts +0 -33
  58. package/src/lib/models/skeleton.model.ts +0 -19
  59. package/src/lib/models/states/cell-editor-base-state.model.ts +0 -3
  60. package/src/lib/models/states/logger-state.model.ts +0 -5
  61. package/src/lib/models/table-item.model.ts +0 -6
  62. package/src/lib/models/update-config.model.ts +0 -20
  63. package/src/lib/mosa-material.module.ts +0 -26
  64. package/src/lib/services/cell-editor.service.ts +0 -46
  65. package/src/lib/services/facades/logger.facade.ts +0 -37
  66. package/src/lib/services/logger.service.ts +0 -49
  67. package/src/lib/styles/_vars.scss +0 -71
  68. package/src/public-api.ts +0 -1
  69. package/tsconfig.lib.json +0 -14
  70. package/tsconfig.lib.prod.json +0 -10
  71. package/tsconfig.spec.json +0 -14
@@ -0,0 +1,30 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { APP_INITIALIZER, NgModule } from '@angular/core';
3
+ import { AssetsI18nLoaderService } from '@mosa-ng/core';
4
+ import * as i0 from "@angular/core";
5
+ export function initI18n(i18n) {
6
+ return () => i18n.init(null, 'mosa');
7
+ }
8
+ export class MosaMaterialModule {
9
+ static forRoot() {
10
+ return {
11
+ ngModule: MosaMaterialModule,
12
+ providers: [
13
+ { provide: APP_INITIALIZER, useFactory: initI18n, deps: [AssetsI18nLoaderService], multi: true },
14
+ ],
15
+ };
16
+ }
17
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
18
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, imports: [CommonModule] }); }
19
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, imports: [CommonModule] }); }
20
+ }
21
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, decorators: [{
22
+ type: NgModule,
23
+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AgICAgICAgfTtcbiAgICB9XG5cbn1cbiJdfQ==
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9zYS1uZy1tYXRlcmlhbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21hdGVyaWFsL3NyYy9tb3NhLW5nLW1hdGVyaWFsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=
@@ -0,0 +1,2 @@
1
+ export * from './lib/mosa-material.module';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL21hdGVyaWFsL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNEJBQTRCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9tb3NhLW1hdGVyaWFsLm1vZHVsZSc7XG4iXX0=
@@ -0,0 +1,37 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { APP_INITIALIZER, NgModule } from '@angular/core';
4
+ import { AssetsI18nLoaderService } from '@mosa-ng/core';
5
+
6
+ function initI18n(i18n) {
7
+ return () => i18n.init(null, 'mosa');
8
+ }
9
+ class MosaMaterialModule {
10
+ static forRoot() {
11
+ return {
12
+ ngModule: MosaMaterialModule,
13
+ providers: [
14
+ { provide: APP_INITIALIZER, useFactory: initI18n, deps: [AssetsI18nLoaderService], multi: true },
15
+ ],
16
+ };
17
+ }
18
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
19
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, imports: [CommonModule] }); }
20
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, imports: [CommonModule] }); }
21
+ }
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: MosaMaterialModule, decorators: [{
23
+ type: NgModule,
24
+ args: [{
25
+ declarations: [],
26
+ imports: [
27
+ CommonModule,
28
+ ],
29
+ }]
30
+ }] });
31
+
32
+ /**
33
+ * Generated bundle index. Do not edit.
34
+ */
35
+
36
+ export { MosaMaterialModule, initI18n };
37
+ //# sourceMappingURL=mosa-ng-material.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mosa-ng-material.mjs","sources":["../../../../projects/material/src/lib/mosa-material.module.ts","../../../../projects/material/src/mosa-ng-material.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';\nimport { AssetsI18nLoaderService } from '@mosa-ng/core';\n\nexport function initI18n(i18n: AssetsI18nLoaderService): () => Promise<void> {\n return () => i18n.init(null, 'mosa');\n}\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule,\n ],\n})\nexport class MosaMaterialModule {\n\n public static forRoot(): ModuleWithProviders<MosaMaterialModule> {\n return {\n ngModule: MosaMaterialModule,\n providers: [\n { provide: APP_INITIALIZER, useFactory: initI18n, deps: [ AssetsI18nLoaderService ], multi: true },\n ],\n };\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAIM,SAAU,QAAQ,CAAC,IAA6B,EAAA;IAClD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;MAQY,kBAAkB,CAAA;AAEpB,IAAA,OAAO,OAAO,GAAA;QACjB,OAAO;AACH,YAAA,QAAQ,EAAE,kBAAkB;AAC5B,YAAA,SAAS,EAAE;AACP,gBAAA,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE,uBAAuB,CAAE,EAAE,KAAK,EAAE,IAAI,EAAE;AACrG,aAAA;SACJ,CAAC;KACL;8GATQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHvB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAGP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHvB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAN9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACL,YAAY;AACf,qBAAA;AACJ,iBAAA,CAAA;;;ACbD;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@mosa-ng/material" />
5
+ export * from './public-api';
@@ -0,0 +1,11 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { AssetsI18nLoaderService } from '@mosa-ng/core';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@angular/common";
5
+ export declare function initI18n(i18n: AssetsI18nLoaderService): () => Promise<void>;
6
+ export declare class MosaMaterialModule {
7
+ static forRoot(): ModuleWithProviders<MosaMaterialModule>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<MosaMaterialModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MosaMaterialModule, never, [typeof i1.CommonModule], never>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<MosaMaterialModule>;
11
+ }
package/package.json CHANGED
@@ -1,12 +1,25 @@
1
1
  {
2
- "name": "@mosa-ng/material",
3
- "version": "17.0.0",
4
- "peerDependencies": {
5
- "@angular/common": ">=17.0.0 < 18.0.0",
6
- "@angular/core": ">=17.0.0 < 18.0.0"
2
+ "name": "@mosa-ng/material",
3
+ "version": "17.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": ">=17.0.0 < 18.0.0",
6
+ "@angular/core": ">=17.0.0 < 18.0.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2022/mosa-ng-material.mjs",
13
+ "typings": "index.d.ts",
14
+ "exports": {
15
+ "./package.json": {
16
+ "default": "./package.json"
7
17
  },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "sideEffects": false
12
- }
18
+ ".": {
19
+ "types": "./index.d.ts",
20
+ "esm2022": "./esm2022/mosa-ng-material.mjs",
21
+ "esm": "./esm2022/mosa-ng-material.mjs",
22
+ "default": "./fesm2022/mosa-ng-material.mjs"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/mosa-material.module';
package/.eslintrc.json DELETED
@@ -1,31 +0,0 @@
1
- {
2
- "extends": "../../.eslintrc.json",
3
- "parserOptions": {
4
- "project": "**/tsconfig.json"
5
- },
6
- "overrides": [
7
- {
8
- "files": [
9
- "*.ts"
10
- ],
11
- "rules": {
12
- "@angular-eslint/component-selector": [
13
- "error",
14
- {
15
- "type": "element",
16
- "prefix": "mosa",
17
- "style": "kebab-case"
18
- }
19
- ],
20
- "@angular-eslint/directive-selector": [
21
- "error",
22
- {
23
- "type": "attribute",
24
- "prefix": "mosa",
25
- "style": "camelCase"
26
- }
27
- ]
28
- }
29
- }
30
- ]
31
- }
package/ng-package.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/@mosa-ng/material",
4
- "lib": {
5
- "entryFile": "src/public-api.ts"
6
- },
7
- "assets": [
8
- "src/assets"
9
- ]
10
- }
@@ -1,17 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { MatIconModule } from '@angular/material/icon';
4
- import { AlertWidget } from './alert.widget';
5
-
6
- @NgModule({
7
- declarations: [ AlertWidget ],
8
- exports: [
9
- AlertWidget,
10
- ],
11
- imports: [
12
- CommonModule,
13
- MatIconModule,
14
- ],
15
- })
16
- export class AlertWidgetModule {
17
- }
@@ -1,7 +0,0 @@
1
- <div [class]="'alert-' + type" class="alert">
2
- <div class="icon">
3
- <mat-icon>icon</mat-icon>
4
- {{ title }}
5
- </div>
6
- <div>{{ message }}</div>
7
- </div>
@@ -1,50 +0,0 @@
1
- @import "../../styles/vars";
2
-
3
- :host {
4
- display: block;
5
- }
6
-
7
- .alert {
8
- position: relative;
9
- padding: 15px;
10
- border-radius: 4px;
11
- width: 100%;
12
- display: table;
13
- color: #222222;
14
- border: 1px solid #222222;
15
- border-left-width: 5px;
16
-
17
- .icon {
18
- @include flex(false, false, true);
19
- margin-bottom: 10px;
20
-
21
- mat-icon {
22
- margin-right: 10px;
23
- }
24
- }
25
-
26
- &-danger {
27
- background: rgba($danger, .1);
28
- border-color: $danger;
29
- }
30
-
31
- &-warning {
32
- background: rgba($warning, .1);
33
- border-color: $warning;
34
- }
35
-
36
- &-info {
37
- background: rgba($info, .1);
38
- border-color: $info;
39
- }
40
-
41
- &-primary {
42
- background: rgba($primary, .1);
43
- border-color: $primary;
44
- }
45
-
46
- &-success {
47
- background: rgba($success, .1);
48
- border-color: $success;
49
- }
50
- }
@@ -1,61 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'mosa-alert-widget',
5
- templateUrl: './alert.widget.html',
6
- styleUrls: [ './alert.widget.scss' ],
7
- changeDetection: ChangeDetectionStrategy.OnPush,
8
- })
9
- export class AlertWidget implements OnInit, OnChanges {
10
-
11
- @Input()
12
- public icon: string;
13
-
14
- @Input()
15
- public title: string;
16
-
17
- @Input()
18
- public message: string;
19
-
20
- @Input()
21
- public type: 'warning' | 'error' | 'info' | 'success';
22
-
23
- constructor() {
24
- }
25
-
26
- public ngOnInit(): void {
27
- this.updateData();
28
- }
29
-
30
- public ngOnChanges(_changes: SimpleChanges): void {
31
- this.updateData();
32
- }
33
-
34
- private updateData(): void {
35
- if (!this.title || !this.icon) {
36
- switch (this.type) {
37
- case 'error':
38
- this.icon ||= 'alert-circle-outline';
39
- this.title ||= 'Error';
40
- break;
41
- case 'info':
42
- this.icon ||= 'information-outline';
43
- this.title ||= 'Information';
44
- break;
45
- case 'success':
46
- this.icon ||= 'check';
47
- this.title ||= 'Success';
48
- break;
49
- case 'warning':
50
- this.icon ||= 'alert-outline';
51
- this.title ||= 'Warning';
52
- break;
53
- default:
54
- this.icon ||= 'information-outline';
55
- this.title ||= 'Alert';
56
- break;
57
- }
58
- }
59
- }
60
-
61
- }
@@ -1,14 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { CellEditorBaseComponent } from './cell-editor.base.component';
4
-
5
- @NgModule({
6
- declarations: [
7
- CellEditorBaseComponent,
8
- ],
9
- imports: [
10
- CommonModule,
11
- ],
12
- })
13
- export class BaseModule {
14
- }
@@ -1,79 +0,0 @@
1
- import { ChangeDetectionStrategy, Component, OnInit, Optional } from '@angular/core';
2
- import { MatDialog } from '@angular/material/dialog';
3
- import { MatTableDataSource } from '@angular/material/table';
4
- import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot, UrlTree } from '@angular/router';
5
- import { PromiseReject, PromiseResolve } from '@mosa-ng/core';
6
- import { Observable } from 'rxjs';
7
- import { ConfirmDialogData, ConfirmDialogResult } from '../../models/confirm-dialog.model';
8
- import { TableItem } from '../../models/table-item.model';
9
- import { ConfirmDialog } from '../confirm-dialog/confirm.dialog';
10
-
11
- @Component({
12
- selector: 'mosa-cell-editor-base',
13
- template: '',
14
- changeDetection: ChangeDetectionStrategy.OnPush,
15
- })
16
- export class CellEditorBaseComponent<Model> implements OnInit, CanDeactivate<CellEditorBaseComponent<Model>> {
17
-
18
- public dataSource: MatTableDataSource<TableItem<Model>>;
19
- public displayedColumns: (keyof Model | string)[] = [];
20
-
21
- constructor(
22
- @Optional()
23
- protected readonly myMatDialog: MatDialog,
24
- ) {
25
- }
26
-
27
- public ngOnInit(): void {
28
- this.dataSource = new MatTableDataSource<TableItem<Model>>();
29
- }
30
-
31
- public get changedRows(): TableItem<Model>[] {
32
- return this.dataSource?.data?.filter((c: TableItem<Model>): boolean => c.changedRowKeys?.length > 0);
33
- }
34
-
35
- /**
36
- * Remove table item data
37
- * @param data
38
- */
39
- public serializeData(data: TableItem<Model>[]): Model[] {
40
- return data.map((val: TableItem<Model>): Model => {
41
- delete val.changedRowKeys;
42
- delete val.rowOriginalData;
43
- return val;
44
- });
45
- }
46
-
47
- public toTableItems(data: Model[]): TableItem<Model>[] {
48
- return data.map((val: Model): TableItem<Model> => ({
49
- ...val,
50
- rowOriginalData: val,
51
- changedRowKeys: [],
52
- }));
53
- }
54
-
55
- public canDeactivate(_component: CellEditorBaseComponent<Model>, _currentRoute: ActivatedRouteSnapshot, _currentState: RouterStateSnapshot,
56
- _nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
57
- if (!this.changedRows.length) {
58
- return true;
59
- }
60
-
61
- return new Promise((resolve: PromiseResolve<boolean>, _reject: PromiseReject): void => {
62
- this.myMatDialog
63
- .open(ConfirmDialog, {
64
- width: '600px',
65
- data: new ConfirmDialogData('mosa.components.cellEditorBase.discardChanges.label',
66
- 'mosa.components.cellEditorBase.discardChanges.message'),
67
- })
68
- .afterClosed()
69
- .subscribe((result: ConfirmDialogResult): void => {
70
- if (result === ConfirmDialogResult.confirmed) {
71
- resolve(true);
72
- } else {
73
- resolve(false);
74
- }
75
- });
76
- });
77
- }
78
-
79
- }
@@ -1,6 +0,0 @@
1
- <div *ngIf="mode === 'input'" class="input-wrapper">
2
- <ng-content select=".cell-input"></ng-content>
3
- </div>
4
- <div *ngIf="mode === 'output'" class="output-wrapper">
5
- <ng-content select=".cell-output"></ng-content>
6
- </div>
@@ -1,53 +0,0 @@
1
- @import "../../styles/vars";
2
-
3
- :host {
4
- display: flex;
5
- align-items: center;
6
- position: absolute;
7
- width: 100%;
8
- height: 100%;
9
- top: 0;
10
- left: 0;
11
- z-index: 1;
12
-
13
- &.focused .input-wrapper {
14
- height: calc(100% - 6px);
15
- width: 100%;
16
- box-shadow: 0 0 0 3px rgba(#1387DF, .8);
17
- outline: 0;
18
- display: flex;
19
- flex-direction: column;
20
- }
21
-
22
- &.edited {
23
- color: #1387DF;
24
- font-weight: 500;
25
- }
26
- }
27
-
28
- ::ng-deep .editable-cell {
29
- position: relative;
30
-
31
- &:first-child mosa-cell-editor:not(.focused) {
32
- padding-left: 24px;
33
- }
34
- }
35
-
36
- ::ng-deep .cell-input {
37
- padding: 10px;
38
- }
39
-
40
- ::ng-deep .cell-output {
41
- text-overflow: ellipsis;
42
- overflow: hidden;
43
- white-space: nowrap;
44
- }
45
-
46
- ::ng-deep input.cell-input {
47
- font-size: 14px;
48
- font-family: $fontRoboto;
49
- background: none;
50
- flex-grow: 1;
51
- outline: 0;
52
- border: none;
53
- }
@@ -1,115 +0,0 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- ChangeDetectorRef,
4
- Component,
5
- ContentChild,
6
- ElementRef,
7
- EventEmitter,
8
- Input,
9
- OnInit,
10
- Output,
11
- } from '@angular/core';
12
- import { MatSelect } from '@angular/material/select';
13
- import { TableItem } from '../../models/table-item.model';
14
- import { BaseComponent } from '../base/base.component';
15
-
16
- @Component({
17
- selector: 'mosa-cell-editor',
18
- templateUrl: './cell-editor.component.html',
19
- styleUrls: [ './cell-editor.component.scss' ],
20
- changeDetection: ChangeDetectionStrategy.OnPush,
21
- })
22
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
- export class CellEditorComponent<T = any> extends BaseComponent implements OnInit {
24
-
25
- @Input()
26
- public key: string;
27
-
28
- @Input()
29
- public rowItem: TableItem<T>;
30
-
31
- @Input()
32
- public value: T;
33
-
34
- @Output()
35
- public valueChange: EventEmitter<T> = new EventEmitter<T>();
36
-
37
- @Output()
38
- public cellClick: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();
39
-
40
- @Output()
41
- private readonly cellChange: EventEmitter<void> = new EventEmitter<void>();
42
-
43
- @Output()
44
- private readonly cellCancel: EventEmitter<void> = new EventEmitter<void>();
45
-
46
- @ContentChild(MatSelect)
47
- private readonly select: MatSelect;
48
-
49
- public mode: 'input' | 'output' = 'output';
50
-
51
- private oldValue: T;
52
-
53
- constructor(
54
- private readonly myChangeDetectorRef: ChangeDetectorRef,
55
- private readonly myElementRef: ElementRef<HTMLElement>,
56
- ) {
57
- super();
58
- }
59
-
60
- public get element(): HTMLElement {
61
- return this.myElementRef.nativeElement;
62
- }
63
-
64
- public override ngOnInit(): void {
65
- this.oldValue = this.value;
66
- this.rowItem.rowOriginalData = this.rowItem;
67
- }
68
-
69
- public toOutput(save?: boolean): void {
70
- if (this.mode !== 'output') {
71
- this.mode = 'output';
72
- this.myChangeDetectorRef.markForCheck();
73
- this.element.classList.remove('focused');
74
-
75
- if (save) {
76
- if (!this.rowItem.changedRowKeys) {
77
- this.rowItem.changedRowKeys = [];
78
- }
79
- const index: number = this.rowItem.changedRowKeys.indexOf(this.key);
80
- if (this.value !== this.oldValue) {
81
- if (index === -1) {
82
- this.rowItem.changedRowKeys.push(this.key);
83
- this.element.classList.add('edited');
84
- }
85
- this.cellChange.emit();
86
- } else {
87
- if (index !== -1) {
88
- this.rowItem.changedRowKeys.splice(index, 1);
89
- this.element.classList.remove('edited');
90
- }
91
- }
92
- } else {
93
- this.value = this.oldValue;
94
- this.cellCancel.emit();
95
- }
96
- this.valueChange.next(this.value);
97
- }
98
- }
99
-
100
- public toInput(): void {
101
- this.mode = 'input';
102
- this.myChangeDetectorRef.markForCheck();
103
- this.element.classList.add('focused');
104
- setTimeout((): void => {
105
- const comp: HTMLElement = this.element.querySelector('.cell-input');
106
-
107
- if (comp instanceof HTMLInputElement) {
108
- comp.focus();
109
- } else if (this.select) {
110
- this.select.open();
111
- }
112
- });
113
- }
114
-
115
- }
@@ -1,15 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { CellEditorComponent } from './cell-editor.component';
4
-
5
- @NgModule({
6
- declarations: [ CellEditorComponent ],
7
- imports: [
8
- CommonModule,
9
- ],
10
- exports: [
11
- CellEditorComponent,
12
- ],
13
- })
14
- export class CellEditorModule {
15
- }
@@ -1,19 +0,0 @@
1
- import { CommonModule } from '@angular/common';
2
- import { NgModule } from '@angular/core';
3
- import { MatButtonModule } from '@angular/material/button';
4
- import { MatDialogModule } from '@angular/material/dialog';
5
- import { TranslateModule } from '@ngx-translate/core';
6
- import { ConfirmDialog } from './confirm.dialog';
7
-
8
- @NgModule({
9
- declarations: [ ConfirmDialog ],
10
- imports: [
11
- CommonModule,
12
- MatDialogModule,
13
- MatButtonModule,
14
- TranslateModule,
15
- ],
16
- exports: [ ConfirmDialog ],
17
- })
18
- export class ConfirmDialogModule {
19
- }
@@ -1,15 +0,0 @@
1
- <h1 class="active" mat-dialog-title>{{ dialogData.title | translate }}</h1>
2
- <div mat-dialog-content>
3
- {{ dialogData.message | translate }}
4
- </div>
5
- <div mat-dialog-actions>
6
- <button (click)="confirm(result.cancelled)" *ngIf="dialogData.cancel" color="primary" mat-stroked-button>
7
- {{ 'mosa.commons.buttons.cancel' | translate | uppercase }}
8
- </button>
9
- <button (click)="confirm(result.denied)" *ngIf="dialogData.deny.visible" color="primary" mat-stroked-button>
10
- {{ dialogData.deny.label | translate | uppercase }}
11
- </button>
12
- <button (click)="confirm(result.confirmed)" *ngIf="dialogData.confirm.visible" color="primary" mat-flat-button>
13
- {{ dialogData.confirm.label | translate | uppercase }}
14
- </button>
15
- </div>
@@ -1,3 +0,0 @@
1
- .mat-dialog-actions {
2
- margin-top: 20px;
3
- }