mat-table-ext 0.0.7 → 0.0.9

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 (89) hide show
  1. package/.editorconfig +16 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/LICENSE +21 -0
  6. package/angular.json +150 -0
  7. package/package.json +46 -58
  8. package/projects/mat-table-ext/.browserslistrc +16 -0
  9. package/projects/mat-table-ext/README.md +57 -0
  10. package/projects/mat-table-ext/karma.conf.js +44 -0
  11. package/projects/mat-table-ext/ng-package.json +9 -0
  12. package/projects/mat-table-ext/package.json +38 -0
  13. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html +7 -0
  14. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.scss +9 -0
  15. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts +23 -0
  16. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.ts +48 -0
  17. package/projects/mat-table-ext/src/lib/components/editing/editing.component.html +55 -0
  18. package/projects/mat-table-ext/src/lib/components/editing/editing.component.scss +19 -0
  19. package/projects/mat-table-ext/src/lib/components/editing/editing.component.spec.ts +23 -0
  20. package/projects/mat-table-ext/src/lib/components/editing/editing.component.ts +110 -0
  21. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.html +26 -0
  22. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.scss +0 -0
  23. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.spec.ts +23 -0
  24. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.ts +54 -0
  25. package/projects/mat-table-ext/src/lib/directives/resize-column.directive.ts +103 -0
  26. package/projects/mat-table-ext/src/lib/mat-table-ext.component.html +285 -0
  27. package/projects/mat-table-ext/src/lib/mat-table-ext.component.spec.ts +25 -0
  28. package/projects/mat-table-ext/src/lib/mat-table-ext.component.ts +985 -0
  29. package/projects/mat-table-ext/src/lib/mat-table-ext.module.ts +127 -0
  30. package/projects/mat-table-ext/src/lib/mat-table-ext.scss +181 -0
  31. package/projects/mat-table-ext/src/lib/mat-table-ext.service.spec.ts +16 -0
  32. package/projects/mat-table-ext/src/lib/mat-table-ext.service.ts +12 -0
  33. package/projects/mat-table-ext/src/lib/models/tableExtModels.ts +85 -0
  34. package/{public-api.d.ts → projects/mat-table-ext/src/public-api.ts} +5 -1
  35. package/projects/mat-table-ext/src/test.ts +27 -0
  36. package/projects/mat-table-ext/tsconfig.lib.json +15 -0
  37. package/projects/mat-table-ext/tsconfig.lib.prod.json +10 -0
  38. package/projects/mat-table-ext/tsconfig.spec.json +17 -0
  39. package/projects/mat-table-ext-example/.browserslistrc +16 -0
  40. package/projects/mat-table-ext-example/karma.conf.js +44 -0
  41. package/projects/mat-table-ext-example/src/app/app.component.html +576 -0
  42. package/projects/mat-table-ext-example/src/app/app.component.scss +0 -0
  43. package/projects/mat-table-ext-example/src/app/app.component.spec.ts +31 -0
  44. package/projects/mat-table-ext-example/src/app/app.component.ts +173 -0
  45. package/projects/mat-table-ext-example/src/app/app.module.ts +40 -0
  46. package/projects/mat-table-ext-example/src/app/service/custom-table.service.spec.ts +16 -0
  47. package/projects/mat-table-ext-example/src/app/service/custom-table.service.ts +18 -0
  48. package/projects/mat-table-ext-example/src/assets/.gitkeep +0 -0
  49. package/projects/mat-table-ext-example/src/assets/data.json +100003 -0
  50. package/projects/mat-table-ext-example/src/environments/environment.prod.ts +3 -0
  51. package/projects/mat-table-ext-example/src/environments/environment.ts +16 -0
  52. package/projects/mat-table-ext-example/src/favicon.ico +0 -0
  53. package/projects/mat-table-ext-example/src/index.html +14 -0
  54. package/projects/mat-table-ext-example/src/main.ts +12 -0
  55. package/projects/mat-table-ext-example/src/polyfills.ts +53 -0
  56. package/projects/mat-table-ext-example/src/styles.scss +23 -0
  57. package/projects/mat-table-ext-example/src/test.ts +26 -0
  58. package/projects/mat-table-ext-example/tsconfig.app.json +15 -0
  59. package/projects/mat-table-ext-example/tsconfig.spec.json +18 -0
  60. package/tsconfig.json +38 -0
  61. package/esm2020/lib/components/column-pinning/column-pinning.component.mjs +0 -58
  62. package/esm2020/lib/components/editing/editing.component.mjs +0 -122
  63. package/esm2020/lib/components/filter-columns-component/filter-columns-component.component.mjs +0 -68
  64. package/esm2020/lib/directives/resize-column.directive.mjs +0 -99
  65. package/esm2020/lib/mat-table-ext.component.mjs +0 -1021
  66. package/esm2020/lib/mat-table-ext.module.mjs +0 -237
  67. package/esm2020/lib/mat-table-ext.service.mjs +0 -20
  68. package/esm2020/lib/models/tableExtModels.mjs +0 -2
  69. package/esm2020/mat-table-ext.mjs +0 -5
  70. package/esm2020/public-api.mjs +0 -11
  71. package/fesm2015/mat-table-ext.mjs +0 -1585
  72. package/fesm2015/mat-table-ext.mjs.map +0 -1
  73. package/fesm2020/mat-table-ext.mjs +0 -1582
  74. package/fesm2020/mat-table-ext.mjs.map +0 -1
  75. package/index.d.ts +0 -5
  76. package/lib/components/column-pinning/column-pinning.component.d.ts +0 -27
  77. package/lib/components/editing/editing.component.d.ts +0 -42
  78. package/lib/components/filter-columns-component/filter-columns-component.component.d.ts +0 -26
  79. package/lib/directives/resize-column.directive.d.ts +0 -27
  80. package/lib/mat-table-ext.component.d.ts +0 -348
  81. package/lib/mat-table-ext.module.d.ts +0 -58
  82. package/lib/mat-table-ext.service.d.ts +0 -11
  83. package/lib/models/tableExtModels.d.ts +0 -76
  84. /package/{assets → projects/mat-table-ext/assets}/_theming.scss +0 -0
  85. /package/{assets → projects/mat-table-ext/assets}/pinIcon.svg +0 -0
  86. /package/{assets → projects/mat-table-ext/assets}/pinLeft.svg +0 -0
  87. /package/{assets → projects/mat-table-ext/assets}/pinNone.svg +0 -0
  88. /package/{assets → projects/mat-table-ext/assets}/pinRight.svg +0 -0
  89. /package/{assets → projects/mat-table-ext/assets}/pinned.svg +0 -0
package/.editorconfig ADDED
@@ -0,0 +1,16 @@
1
+ # Editor configuration, see https://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ indent_style = space
7
+ indent_size = 2
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.ts]
12
+ quote_type = single
13
+
14
+ [*.md]
15
+ max_line_length = off
16
+ trim_trailing_whitespace = false
@@ -0,0 +1,4 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3
+ "recommendations": ["angular.ng-template"]
4
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3
+ "version": "0.2.0",
4
+ "configurations": [
5
+ {
6
+ "name": "ng serve",
7
+ "type": "pwa-chrome",
8
+ "request": "launch",
9
+ "preLaunchTask": "npm: start",
10
+ "url": "http://localhost:4200/"
11
+ },
12
+ {
13
+ "name": "ng test",
14
+ "type": "chrome",
15
+ "request": "launch",
16
+ "preLaunchTask": "npm: test",
17
+ "url": "http://localhost:9876/debug.html"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3
+ "version": "2.0.0",
4
+ "tasks": [
5
+ {
6
+ "type": "npm",
7
+ "script": "start",
8
+ "isBackground": true,
9
+ "problemMatcher": {
10
+ "owner": "typescript",
11
+ "pattern": "$tsc",
12
+ "background": {
13
+ "activeOnStart": true,
14
+ "beginsPattern": {
15
+ "regexp": "(.*?)"
16
+ },
17
+ "endsPattern": {
18
+ "regexp": "bundle generation complete"
19
+ }
20
+ }
21
+ }
22
+ },
23
+ {
24
+ "type": "npm",
25
+ "script": "test",
26
+ "isBackground": true,
27
+ "problemMatcher": {
28
+ "owner": "typescript",
29
+ "pattern": "$tsc",
30
+ "background": {
31
+ "activeOnStart": true,
32
+ "beginsPattern": {
33
+ "regexp": "(.*?)"
34
+ },
35
+ "endsPattern": {
36
+ "regexp": "bundle generation complete"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ]
42
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/angular.json ADDED
@@ -0,0 +1,150 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "mat-table-ext": {
7
+ "projectType": "library",
8
+ "root": "projects/mat-table-ext",
9
+ "sourceRoot": "projects/mat-table-ext/src",
10
+ "prefix": "lib",
11
+ "architect": {
12
+ "build": {
13
+ "builder": "@angular-devkit/build-angular:ng-packagr",
14
+ "options": {
15
+ "project": "projects/mat-table-ext/ng-package.json"
16
+ },
17
+ "configurations": {
18
+ "production": {
19
+ "tsConfig": "projects/mat-table-ext/tsconfig.lib.prod.json"
20
+ },
21
+ "development": {
22
+ "tsConfig": "projects/mat-table-ext/tsconfig.lib.json"
23
+ }
24
+ },
25
+ "defaultConfiguration": "production"
26
+ },
27
+ "test": {
28
+ "builder": "@angular-devkit/build-angular:karma",
29
+ "options": {
30
+ "main": "projects/mat-table-ext/src/test.ts",
31
+ "tsConfig": "projects/mat-table-ext/tsconfig.spec.json",
32
+ "karmaConfig": "projects/mat-table-ext/karma.conf.js"
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "mat-table-ext-example": {
38
+ "projectType": "application",
39
+ "schematics": {
40
+ "@schematics/angular:component": {
41
+ "style": "scss"
42
+ },
43
+ "@schematics/angular:application": {
44
+ "strict": true
45
+ }
46
+ },
47
+ "root": "projects/mat-table-ext-example",
48
+ "sourceRoot": "projects/mat-table-ext-example/src",
49
+ "prefix": "app",
50
+ "architect": {
51
+ "build": {
52
+ "builder": "@angular-devkit/build-angular:browser",
53
+ "options": {
54
+ "outputPath": "dist/mat-table-ext-example",
55
+ "index": "projects/mat-table-ext-example/src/index.html",
56
+ "main": "projects/mat-table-ext-example/src/main.ts",
57
+ "polyfills": "projects/mat-table-ext-example/src/polyfills.ts",
58
+ "tsConfig": "projects/mat-table-ext-example/tsconfig.app.json",
59
+ "inlineStyleLanguage": "scss",
60
+ "assets": [
61
+ "projects/mat-table-ext-example/src/favicon.ico",
62
+ "projects/mat-table-ext-example/src/assets",
63
+ {
64
+ "glob": "**/*",
65
+ "input": "projects/mat-table-ext/assets",
66
+ "output": "/assets/"
67
+ }
68
+ ],
69
+ "styles": [
70
+ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
71
+ "projects/mat-table-ext-example/src/styles.scss"
72
+ ],
73
+ "scripts": []
74
+ },
75
+ "configurations": {
76
+ "production": {
77
+ "budgets": [
78
+ {
79
+ "type": "initial",
80
+ "maximumWarning": "500kb",
81
+ "maximumError": "1mb"
82
+ },
83
+ {
84
+ "type": "anyComponentStyle",
85
+ "maximumWarning": "2kb",
86
+ "maximumError": "4kb"
87
+ }
88
+ ],
89
+ "fileReplacements": [
90
+ {
91
+ "replace": "projects/mat-table-ext-example/src/environments/environment.ts",
92
+ "with": "projects/mat-table-ext-example/src/environments/environment.prod.ts"
93
+ }
94
+ ],
95
+ "outputHashing": "all"
96
+ },
97
+ "development": {
98
+ "buildOptimizer": false,
99
+ "optimization": false,
100
+ "vendorChunk": true,
101
+ "extractLicenses": false,
102
+ "sourceMap": true,
103
+ "namedChunks": true
104
+ }
105
+ },
106
+ "defaultConfiguration": "production"
107
+ },
108
+ "serve": {
109
+ "builder": "@angular-devkit/build-angular:dev-server",
110
+ "configurations": {
111
+ "production": {
112
+ "browserTarget": "mat-table-ext-example:build:production"
113
+ },
114
+ "development": {
115
+ "browserTarget": "mat-table-ext-example:build:development"
116
+ }
117
+ },
118
+ "defaultConfiguration": "development"
119
+ },
120
+ "extract-i18n": {
121
+ "builder": "@angular-devkit/build-angular:extract-i18n",
122
+ "options": {
123
+ "browserTarget": "mat-table-ext-example:build"
124
+ }
125
+ },
126
+ "test": {
127
+ "builder": "@angular-devkit/build-angular:karma",
128
+ "options": {
129
+ "main": "projects/mat-table-ext-example/src/test.ts",
130
+ "polyfills": "projects/mat-table-ext-example/src/polyfills.ts",
131
+ "tsConfig": "projects/mat-table-ext-example/tsconfig.spec.json",
132
+ "karmaConfig": "projects/mat-table-ext-example/karma.conf.js",
133
+ "inlineStyleLanguage": "scss",
134
+ "assets": [
135
+ "projects/mat-table-ext-example/src/favicon.ico",
136
+ "projects/mat-table-ext-example/src/assets"
137
+ ],
138
+ "styles": [
139
+ "projects/mat-table-ext-example/src/styles.scss"
140
+ ],
141
+ "scripts": []
142
+ }
143
+ }
144
+ }
145
+ }
146
+ },
147
+ "cli": {
148
+ "analytics": false
149
+ }
150
+ }
package/package.json CHANGED
@@ -1,58 +1,46 @@
1
- {
2
- "name": "mat-table-ext",
3
- "version": "0.0.7",
4
- "description": "The mat-table-ext is a powerful material table extension component used to display tabular data with extra features.",
5
- "homepage": "https://fastcode-inc.github.io/custom-table-doc",
6
- "keywords": [
7
- "mat-table",
8
- "mat-table-ext",
9
- "material table extension",
10
- "angular material",
11
- "data grid",
12
- "angular",
13
- "material data table",
14
- "angular-material",
15
- "angular-component"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/fastcode-inc/custom-table"
20
- },
21
- "peerDependencies": {
22
- "@angular/animations": "^14.2.0",
23
- "@angular/cdk": "^14.2.4",
24
- "@angular/common": "^14.2.0",
25
- "@angular/compiler": "^14.2.0",
26
- "@angular/core": "^14.2.0",
27
- "@angular/forms": "^14.2.0",
28
- "@angular/material": "^14.2.4",
29
- "@angular/platform-browser": "^14.2.0",
30
- "@angular/platform-browser-dynamic": "^14.2.0",
31
- "@angular/router": "^14.2.0",
32
- "@ngx-translate/core": "^14.0.0",
33
- "xlsx": "^0.18.5"
34
- },
35
- "dependencies": {
36
- "tslib": "^2.3.0"
37
- },
38
- "module": "fesm2015/mat-table-ext.mjs",
39
- "es2020": "fesm2020/mat-table-ext.mjs",
40
- "esm2020": "esm2020/mat-table-ext.mjs",
41
- "fesm2020": "fesm2020/mat-table-ext.mjs",
42
- "fesm2015": "fesm2015/mat-table-ext.mjs",
43
- "typings": "index.d.ts",
44
- "exports": {
45
- "./package.json": {
46
- "default": "./package.json"
47
- },
48
- ".": {
49
- "types": "./index.d.ts",
50
- "esm2020": "./esm2020/mat-table-ext.mjs",
51
- "es2020": "./fesm2020/mat-table-ext.mjs",
52
- "es2015": "./fesm2015/mat-table-ext.mjs",
53
- "node": "./fesm2015/mat-table-ext.mjs",
54
- "default": "./fesm2020/mat-table-ext.mjs"
55
- }
56
- },
57
- "sideEffects": false
58
- }
1
+ {
2
+ "name": "mat-table-ext",
3
+ "version": "0.0.9",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "start": "ng serve",
7
+ "build": "ng build",
8
+ "watch": "ng build --watch --configuration development",
9
+ "test": "ng test"
10
+ },
11
+ "dependencies": {
12
+ "@angular/animations": "^14.2.12",
13
+ "@angular/cdk": "^14.2.7",
14
+ "@angular/common": "^14.2.12",
15
+ "@angular/compiler": "^14.2.12",
16
+ "@angular/core": "^14.2.12",
17
+ "@angular/forms": "^14.2.12",
18
+ "@angular/material": "^14.2.7",
19
+ "@angular/platform-browser": "^14.2.12",
20
+ "@angular/platform-browser-dynamic": "^14.2.12",
21
+ "@angular/router": "^14.2.12",
22
+ "@ngx-translate/core": "^14.0.0",
23
+ "mat-table-ext-sammmm": "^0.0.3",
24
+ "ngx-translate": "^0.0.1-security",
25
+ "rxjs": "~7.5.0",
26
+ "xlsx": "^0.18.5",
27
+ "zone.js": "~0.11.4"
28
+ },
29
+ "devDependencies": {
30
+ "@angular-devkit/build-angular": "^14.2.10",
31
+ "@angular/cli": "^14.2.10",
32
+ "@angular/compiler-cli": "^14.2.12",
33
+ "@types/file-saver": "^2.0.5",
34
+ "@types/jasmine": "~3.10.0",
35
+ "@types/node": "^12.11.1",
36
+ "jasmine-core": "~4.0.0",
37
+ "karma": "~6.3.0",
38
+ "karma-chrome-launcher": "~3.1.0",
39
+ "karma-coverage": "~2.1.0",
40
+ "karma-jasmine": "~4.0.0",
41
+ "karma-jasmine-html-reporter": "~1.7.0",
42
+ "ng-packagr": "^14.2.2",
43
+ "tslib": "^2.4.1",
44
+ "typescript": "~4.8.4"
45
+ }
46
+ }
@@ -0,0 +1,16 @@
1
+ # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+
5
+ # For the full list of supported browsers by the Angular framework, please see:
6
+ # https://angular.io/guide/browser-support
7
+
8
+ # You can see what browsers were selected by your queries by running:
9
+ # npx browserslist
10
+
11
+ last 1 Chrome version
12
+ last 1 Firefox version
13
+ last 2 Edge major versions
14
+ last 2 Safari major versions
15
+ last 2 iOS major versions
16
+ Firefox ESR
@@ -0,0 +1,57 @@
1
+ # Mat Table Extension
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.10.
4
+ ## Documentation
5
+
6
+ Check out the [demos and API](https://fastcode-inc.github.io/custom-table-doc).
7
+ ## Installation
8
+
9
+ First, you should install and set up Angular Material. [Learn more about the setup](https://material.angular.io/guide/getting-started).
10
+
11
+ Install the Extension library:
12
+
13
+ ```bash
14
+ $ npm i mat-table-ext
15
+ ```
16
+
17
+ ## Setup
18
+
19
+ Import the MatTableExtModule into imports array.
20
+
21
+ ```ts
22
+ import { MatTableExtModule } from 'mat-table-ext';
23
+
24
+ @NgModule({
25
+ ...
26
+ imports: [MatTableExtModule,...],
27
+ ...
28
+ })
29
+ export class YourAppModule {
30
+ }
31
+ ```
32
+ ```
33
+ After adding the MatTableExtModule to your application, add the path of assets of table to your application.
34
+ Add the following to your angular.json file under build and test (if required).
35
+ {
36
+ "assets": [
37
+ {
38
+ "glob": "**/*",
39
+ "input": "./node_modules/mat-table-ext/assets",
40
+ "output": "/assets/"
41
+ }
42
+ ]
43
+ }
44
+ ```
45
+ ## Theming
46
+
47
+ After importing the module, you can pass your application theme to the mat-table-ext library by adding the following content to your theme file. [More details about theming.](https://material.angular.io/guide/theming).
48
+
49
+
50
+ ```ts
51
+ @use '../node_modules/mat-table-ext/assets/theming' as matext;
52
+
53
+ @include matext.mat-table-ext-theme($your-theme);
54
+ ```
55
+ ## License
56
+
57
+ MIT
@@ -0,0 +1,44 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function (config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ jasmine: {
17
+ // you can add configuration options for Jasmine here
18
+ // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
+ // for example, you can disable the random execution with `random: false`
20
+ // or set a specific seed with `seed: 4321`
21
+ },
22
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
23
+ },
24
+ jasmineHtmlReporter: {
25
+ suppressAll: true // removes the duplicated traces
26
+ },
27
+ coverageReporter: {
28
+ dir: require('path').join(__dirname, '../../coverage/mat-table-ext'),
29
+ subdir: '.',
30
+ reporters: [
31
+ { type: 'html' },
32
+ { type: 'text-summary' }
33
+ ]
34
+ },
35
+ reporters: ['progress', 'kjhtml'],
36
+ port: 9876,
37
+ colors: true,
38
+ logLevel: config.LOG_INFO,
39
+ autoWatch: true,
40
+ browsers: ['Chrome'],
41
+ singleRun: false,
42
+ restartOnFileChange: true
43
+ });
44
+ };
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/mat-table-ext",
4
+ "assets": ["assets"],
5
+ "lib": {
6
+ "entryFile": "src/public-api.ts",
7
+ "cssUrl": "inline"
8
+ }
9
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "mat-table-ext",
3
+ "version": "0.0.9",
4
+ "description": "The mat-table-ext is a powerful material table extension component used to display tabular data with extra features.",
5
+ "homepage": "https://fastcode-inc.github.io/custom-table-doc",
6
+ "keywords": [
7
+ "mat-table",
8
+ "mat-table-ext",
9
+ "material table extension",
10
+ "angular material",
11
+ "data grid",
12
+ "angular",
13
+ "material data table",
14
+ "angular-material",
15
+ "angular-component"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/fastcode-inc/custom-table"
20
+ },
21
+ "peerDependencies": {
22
+ "@angular/animations": "^14.2.0",
23
+ "@angular/cdk": "^14.2.4",
24
+ "@angular/common": "^14.2.0",
25
+ "@angular/compiler": "^14.2.0",
26
+ "@angular/core": "^14.2.0",
27
+ "@angular/forms": "^14.2.0",
28
+ "@angular/material": "^14.2.4",
29
+ "@angular/platform-browser": "^14.2.0",
30
+ "@angular/platform-browser-dynamic": "^14.2.0",
31
+ "@angular/router": "^14.2.0",
32
+ "@ngx-translate/core": "^14.0.0",
33
+ "xlsx": "^0.18.5"
34
+ },
35
+ "dependencies": {
36
+ "tslib": "^2.3.0"
37
+ }
38
+ }
@@ -0,0 +1,7 @@
1
+ <div class="pinning-list-item" *ngFor="let column of columns" style="display: flex; ">
2
+ <button mat-icon-button >
3
+ <mat-icon (click)="changeValue(column)" matTooltip="{{column['pinned'] ? (column['pinned'] | titlecase):'None'}}"
4
+ svgIcon="{{column['pinned'] =='left'|| column['pinned'] =='right' ? icons[column['pinned']]:'pinNone'}}" class="pinning-icon"></mat-icon>
5
+ </button>
6
+ <span class="column-headers">{{column.header}}</span>
7
+ </div>
@@ -0,0 +1,9 @@
1
+ .pinning-list-item {
2
+ display: flex;
3
+ justify-content: flex-start;
4
+ align-items: baseline;
5
+ height: 3em;
6
+ }
7
+ .column-headers {
8
+ font-family: Roboto, "Helvetica Neue", sans-serif;
9
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ColumnPinningComponent } from './column-pinning.component';
4
+
5
+ describe('ColumnPinningComponent', () => {
6
+ let component: ColumnPinningComponent;
7
+ let fixture: ComponentFixture<ColumnPinningComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ ColumnPinningComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ColumnPinningComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,48 @@
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { MTExColumn } from '../../models/tableExtModels';
3
+
4
+ @Component({
5
+ selector: 'app-column-pinning',
6
+ templateUrl: './column-pinning.component.html',
7
+ styleUrls: ['./column-pinning.component.scss'],
8
+ })
9
+ export class ColumnPinningComponent implements OnInit {
10
+ @Input() columns!: MTExColumn[];
11
+ @Output() columnsChanged: EventEmitter<MTExColumn[]> = new EventEmitter();
12
+ public icons = {
13
+ left: 'pinLeft',
14
+ right: 'pinRight',
15
+ none: 'pinNone',
16
+ };
17
+
18
+ constructor() {}
19
+ ngOnInit(): void {}
20
+ /**
21
+ * @description This method is called when pin value changes for a column.
22
+ * @param column column of which to set the pin value
23
+ */
24
+ changeValue(column: MTExColumn) {
25
+ if (column.pinned) {
26
+ if (column.pinned == 'left') {
27
+ this.setColumnPinValue(column, 'right');
28
+ } else if (column.pinned == 'right') {
29
+ this.setColumnPinValue(column, undefined);
30
+ }
31
+ } else {
32
+ this.setColumnPinValue(column, 'left');
33
+ }
34
+ this.columnsChanged.emit(this.columns);
35
+ }
36
+ /**
37
+ * @description This method is used to set the column pin value.
38
+ * @param column column of which to set the pin value
39
+ * @param value pin value to set
40
+ */
41
+ setColumnPinValue(column: MTExColumn, value: 'left' | 'right' | undefined) {
42
+ this.columns.forEach((col) => {
43
+ if (column?.header == col.header) {
44
+ col.pinned = value;
45
+ }
46
+ });
47
+ }
48
+ }