mat-table-ext 0.0.0
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.
- package/.editorconfig +16 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +27 -0
- package/angular.json +150 -0
- package/package.json +45 -0
- package/projects/mat-table-ext/.browserslistrc +16 -0
- package/projects/mat-table-ext/README.md +24 -0
- package/projects/mat-table-ext/assets/pinIcon.svg +1 -0
- package/projects/mat-table-ext/assets/pinLeft.svg +11 -0
- package/projects/mat-table-ext/assets/pinNone.svg +5 -0
- package/projects/mat-table-ext/assets/pinRight.svg +11 -0
- package/projects/mat-table-ext/assets/pinned.svg +2 -0
- package/projects/mat-table-ext/karma.conf.js +44 -0
- package/projects/mat-table-ext/ng-package.json +9 -0
- package/projects/mat-table-ext/package.json +34 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html +7 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.scss +9 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.ts +48 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.html +55 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.scss +19 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.ts +110 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.html +26 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.scss +0 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.ts +54 -0
- package/projects/mat-table-ext/src/lib/directives/resize-column.directive.ts +103 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.html +285 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.spec.ts +25 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.ts +985 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.module.ts +127 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.scss +189 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.service.spec.ts +16 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.service.ts +12 -0
- package/projects/mat-table-ext/src/lib/models/tableExtModels.ts +85 -0
- package/projects/mat-table-ext/src/public-api.ts +11 -0
- package/projects/mat-table-ext/src/test.ts +27 -0
- package/projects/mat-table-ext/tsconfig.lib.json +15 -0
- package/projects/mat-table-ext/tsconfig.lib.prod.json +10 -0
- package/projects/mat-table-ext/tsconfig.spec.json +17 -0
- package/projects/mat-table-ext-example/.browserslistrc +16 -0
- package/projects/mat-table-ext-example/karma.conf.js +44 -0
- package/projects/mat-table-ext-example/src/app/app.component.html +577 -0
- package/projects/mat-table-ext-example/src/app/app.component.scss +0 -0
- package/projects/mat-table-ext-example/src/app/app.component.spec.ts +31 -0
- package/projects/mat-table-ext-example/src/app/app.component.ts +173 -0
- package/projects/mat-table-ext-example/src/app/app.module.ts +40 -0
- package/projects/mat-table-ext-example/src/app/service/custom-table.service.spec.ts +16 -0
- package/projects/mat-table-ext-example/src/app/service/custom-table.service.ts +18 -0
- package/projects/mat-table-ext-example/src/assets/.gitkeep +0 -0
- package/projects/mat-table-ext-example/src/assets/data.json +100003 -0
- package/projects/mat-table-ext-example/src/environments/environment.prod.ts +3 -0
- package/projects/mat-table-ext-example/src/environments/environment.ts +16 -0
- package/projects/mat-table-ext-example/src/favicon.ico +0 -0
- package/projects/mat-table-ext-example/src/index.html +14 -0
- package/projects/mat-table-ext-example/src/main.ts +12 -0
- package/projects/mat-table-ext-example/src/polyfills.ts +53 -0
- package/projects/mat-table-ext-example/src/styles.scss +1 -0
- package/projects/mat-table-ext-example/src/test.ts +26 -0
- package/projects/mat-table-ext-example/tsconfig.app.json +15 -0
- package/projects/mat-table-ext-example/tsconfig.spec.json +18 -0
- package/tsconfig.json +38 -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,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/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# MatTableExt
|
|
2
|
+
|
|
3
|
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.2.5.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
|
8
|
+
|
|
9
|
+
## Code scaffolding
|
|
10
|
+
|
|
11
|
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
16
|
+
|
|
17
|
+
## Running unit tests
|
|
18
|
+
|
|
19
|
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
|
+
|
|
21
|
+
## Running end-to-end tests
|
|
22
|
+
|
|
23
|
+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
|
24
|
+
|
|
25
|
+
## Further help
|
|
26
|
+
|
|
27
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
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
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mat-table-ext",
|
|
3
|
+
"version": "0.0.0",
|
|
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
|
+
"ngx-translate": "^0.0.1-security",
|
|
24
|
+
"rxjs": "~7.5.0",
|
|
25
|
+
"xlsx": "^0.18.5",
|
|
26
|
+
"zone.js": "~0.11.4"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@angular-devkit/build-angular": "^14.2.10",
|
|
30
|
+
"@angular/cli": "^14.2.10",
|
|
31
|
+
"@angular/compiler-cli": "^14.2.12",
|
|
32
|
+
"@types/file-saver": "^2.0.5",
|
|
33
|
+
"@types/jasmine": "~3.10.0",
|
|
34
|
+
"@types/node": "^12.11.1",
|
|
35
|
+
"jasmine-core": "~4.0.0",
|
|
36
|
+
"karma": "~6.3.0",
|
|
37
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
38
|
+
"karma-coverage": "~2.1.0",
|
|
39
|
+
"karma-jasmine": "~4.0.0",
|
|
40
|
+
"karma-jasmine-html-reporter": "~1.7.0",
|
|
41
|
+
"ng-packagr": "^14.2.2",
|
|
42
|
+
"tslib": "^2.4.1",
|
|
43
|
+
"typescript": "~4.8.4"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -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,24 @@
|
|
|
1
|
+
# MatTableExt
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.2.10.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project mat-table-ext` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project mat-table-ext`.
|
|
8
|
+
> Note: Don't forget to add `--project mat-table-ext` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build mat-table-ext` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build mat-table-ext`, go to the dist folder `cd dist/mat-table-ext` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test mat-table-ext` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="122.879px" height="122.867px" viewBox="0 0 122.879 122.867" enable-background="new 0 0 122.879 122.867" xml:space="preserve"><g><path fill-rule="evenodd" clip-rule="evenodd" d="M83.88,0.451L122.427,39c0.603,0.601,0.603,1.585,0,2.188l-13.128,13.125 c-0.602,0.604-1.586,0.604-2.187,0l-3.732-3.73l-17.303,17.3c3.882,14.621,0.095,30.857-11.37,42.32 c-0.266,0.268-0.535,0.529-0.808,0.787c-1.004,0.955-0.843,0.949-1.813-0.021L47.597,86.48L0,122.867l36.399-47.584L11.874,50.76 c-0.978-0.98-0.896-0.826,0.066-1.837c0.24-0.251,0.485-0.503,0.734-0.753C24.137,36.707,40.376,32.917,54.996,36.8l17.301-17.3 l-3.733-3.732c-0.601-0.601-0.601-1.585,0-2.188L81.691,0.451C82.295-0.15,83.279-0.15,83.88,0.451L83.88,0.451z"/></g></svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_4_286)">
|
|
3
|
+
<rect width="24" height="24" transform="translate(0.380142)" fill="white"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.954 3.4573C13.7197 3.22299 13.3398 3.22299 13.1055 3.4573C12.8715 3.69133 12.8712 4.07058 13.1046 4.30496L4.79663 10.3308L4.78896 10.3231C4.55464 10.0888 4.17474 10.0888 3.94043 10.3231C3.70611 10.5575 3.70611 10.9374 3.94043 11.1717L8.12586 15.3571L3.1986 20.2844L3.23319 21.1766L4.12545 21.2112L9.05271 16.2839L13.2085 20.4397C13.4428 20.674 13.8227 20.674 14.057 20.4397C14.2913 20.2054 14.2913 19.8255 14.057 19.5912L14.0567 19.5909L20.0752 11.2755C20.3096 11.509 20.6888 11.5087 20.9228 11.2747C21.1572 11.0403 21.1572 10.6604 20.9228 10.4261L13.954 3.4573Z" fill="black"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_4_286">
|
|
8
|
+
<rect width="24" height="24" fill="white" transform="translate(0.380142)"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="24" height="24" transform="translate(0.380142)" fill="white"/>
|
|
3
|
+
<path d="M17.819 1.82727C18.9664 1.82727 18.6781 3.26539 17.819 3.17225L19.3836 11.9539C19.4541 12.3501 19.5725 12.8388 19.2602 13.0926C19.169 13.1666 19.0589 13.2025 18.9443 13.2131C18.5579 13.2488 18.2393 12.958 17.9746 12.6742C14.986 9.47047 9.59492 3.6323 9.12197 2.88175C8.62711 2.09642 9.22058 1.85155 9.57918 1.82727H17.819Z" fill="black"/>
|
|
4
|
+
<path d="M19.3054 15.6543L7.7861 3.07306L7.78306 3.06975C7.47521 2.73351 7.10289 2.32686 6.65801 2.42349C6.48523 2.46102 6.35964 2.57044 6.2748 2.71196C6.05558 3.07764 6.28533 3.51939 6.56097 3.84465L7.48139 4.93074L5.98874 13.2546C4.78545 13.4558 5.31219 14.6417 5.98874 14.6417H12.161V21.2852L12.8738 22.1727L13.5671 21.2852V14.6417H16.3404L18.217 16.5055C19.2879 16.9154 19.3888 16.1088 19.3054 15.6543Z" fill="black"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_5_313)">
|
|
3
|
+
<rect width="24" height="24" transform="matrix(-1 0 0 1 24 0)" fill="white"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.4573 10.4261C3.22298 10.6604 3.22298 11.0403 3.4573 11.2747C3.69132 11.5087 4.07057 11.509 4.30496 11.2755L10.3308 19.5835L10.3231 19.5912C10.0888 19.8255 10.0888 20.2054 10.3231 20.4397C10.5575 20.674 10.9373 20.674 11.1717 20.4397L15.3571 16.2543L20.2844 21.1815L21.1766 21.147L21.2112 20.2547L16.2839 15.3274L20.4397 11.1717C20.674 10.9374 20.674 10.5575 20.4397 10.3231C20.2054 10.0888 19.8255 10.0888 19.5912 10.3231L19.5909 10.3235L11.2755 4.30494C11.509 4.07056 11.5087 3.69132 11.2746 3.4573C11.0403 3.22299 10.6604 3.22299 10.4261 3.4573L3.4573 10.4261Z" fill="black"/>
|
|
5
|
+
</g>
|
|
6
|
+
<defs>
|
|
7
|
+
<clipPath id="clip0_5_313">
|
|
8
|
+
<rect width="24" height="24" fill="white" transform="matrix(-1 0 0 1 24 0)"/>
|
|
9
|
+
</clipPath>
|
|
10
|
+
</defs>
|
|
11
|
+
</svg>
|
|
@@ -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,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mat-table-sample",
|
|
3
|
+
"version": "0.0.63",
|
|
4
|
+
"description": "this is a sample table of material.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Hamza"
|
|
7
|
+
],
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Samples Contribute",
|
|
10
|
+
"email": "abc@gmail.com",
|
|
11
|
+
"url": "http://blog.sample.me/"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/sample/tableSample"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@angular/animations": "^14.2.0",
|
|
19
|
+
"@angular/cdk": "^14.2.4",
|
|
20
|
+
"@angular/common": "^14.2.0",
|
|
21
|
+
"@angular/compiler": "^14.2.0",
|
|
22
|
+
"@angular/core": "^14.2.0",
|
|
23
|
+
"@angular/forms": "^14.2.0",
|
|
24
|
+
"@angular/material": "^14.2.4",
|
|
25
|
+
"@angular/platform-browser": "^14.2.0",
|
|
26
|
+
"@angular/platform-browser-dynamic": "^14.2.0",
|
|
27
|
+
"@angular/router": "^14.2.0",
|
|
28
|
+
"@ngx-translate/core": "^14.0.0",
|
|
29
|
+
"xlsx": "^0.18.5"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"tslib": "^2.3.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html
ADDED
|
@@ -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>
|
package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts
ADDED
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<div *ngIf="!templateRef" style="height: 100%;" class="main-dialog-container">
|
|
2
|
+
<div mat-dialog-title class="dialog-title-container">
|
|
3
|
+
<h2 style="margin: 0;">Edit Row</h2>
|
|
4
|
+
<span class="example-spacer"></span>
|
|
5
|
+
<button mat-icon-button aria-label="Example icon button with a vertical three dot icon">
|
|
6
|
+
<mat-icon mat-dialog-close style="cursor: pointer;" fxFlex="5">close</mat-icon>
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
<mat-dialog-content style="margin-right: 20px;">
|
|
10
|
+
<div style="display: flex; flex-direction: column;">
|
|
11
|
+
<ng-container *ngFor="let key of keys">
|
|
12
|
+
<!-- Number Type -->
|
|
13
|
+
<mat-form-field *ngIf="types[key] == 'number'" appearance="outline" class="inline-editing-field">
|
|
14
|
+
<mat-label>{{key | titlecase}}</mat-label>
|
|
15
|
+
<input matInput type="number" [(ngModel)]="dialogData['row'][key]" [ngModelOptions]="{standalone: true}">
|
|
16
|
+
</mat-form-field>
|
|
17
|
+
|
|
18
|
+
<!-- String Type -->
|
|
19
|
+
|
|
20
|
+
<mat-form-field *ngIf="types[key] == 'string'" appearance="outline" class="inline-editing-field">
|
|
21
|
+
<mat-label>{{key | titlecase}}</mat-label>
|
|
22
|
+
<input matInput type="text" [(ngModel)]="dialogData['row'][key]" [ngModelOptions]="{standalone: true}">
|
|
23
|
+
</mat-form-field>
|
|
24
|
+
<mat-form-field *ngIf="types[key] == 'date'" appearance="outline" class="inline-editing-field">
|
|
25
|
+
<mat-label>{{key | titlecase}}</mat-label>
|
|
26
|
+
<input matInput type="text" [(ngModel)]="dialogData['row'][key]" [ngModelOptions]="{standalone: true}">
|
|
27
|
+
</mat-form-field>
|
|
28
|
+
<!-- Selection Type -->
|
|
29
|
+
|
|
30
|
+
<mat-form-field *ngIf="types[key] == 'selection'" appearance="outline" class="inline-editing-field">
|
|
31
|
+
<mat-label>{{key | titlecase}}</mat-label>
|
|
32
|
+
<mat-select [value]="dialogData['row'][key].value" [(ngModel)]="dialogData['row'][key].value">
|
|
33
|
+
<mat-option *ngFor="let option of dialogData['row'][key].options" [value]="option">
|
|
34
|
+
{{option}}
|
|
35
|
+
</mat-option>
|
|
36
|
+
</mat-select>
|
|
37
|
+
</mat-form-field>
|
|
38
|
+
<!-- Boolean Type -->
|
|
39
|
+
<p>
|
|
40
|
+
<mat-checkbox *ngIf="types[key] == 'boolean'" color="primary" [(ngModel)]="dialogData['row'][key]">
|
|
41
|
+
<mat-label>{{key | titlecase}}</mat-label>
|
|
42
|
+
</mat-checkbox>
|
|
43
|
+
</p>
|
|
44
|
+
</ng-container>
|
|
45
|
+
</div>
|
|
46
|
+
</mat-dialog-content>
|
|
47
|
+
<div class="spacer"></div>
|
|
48
|
+
<mat-dialog-actions style="margin-top: 20px;" align="end">
|
|
49
|
+
<button mat-raised-button color="warn" mat-dialog-close>
|
|
50
|
+
Cancel
|
|
51
|
+
</button>
|
|
52
|
+
<button mat-raised-button color="primary" (click)="closeDialog()">Save</button>
|
|
53
|
+
</mat-dialog-actions>
|
|
54
|
+
</div>
|
|
55
|
+
<ng-container *ngIf="templateRef" [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="{data:{row:templateRow,columns:columns,columnKeys:templateKeys,columnTypes:templateTypes,closeDialog:closeTemplateDialog}}"></ng-container>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.main-dialog-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.main-dialog-container mat-dialog-content {
|
|
7
|
+
overflow-y: auto;
|
|
8
|
+
margin: 0px;
|
|
9
|
+
padding: 0 0 0 20px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.dialog-title-container {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.spacer {
|
|
18
|
+
flex-grow: 1;
|
|
19
|
+
}
|