@skyux/grids 4.0.6 → 5.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.
- package/LICENSE +21 -0
- package/bundles/skyux-grids.umd.js +864 -744
- package/bundles/skyux-grids.umd.js.map +1 -1
- package/documentation.json +4089 -0
- package/esm2015/modules/grid/grid-adapter.service.js +22 -24
- package/esm2015/modules/grid/grid-cell.component.js +30 -32
- package/esm2015/modules/grid/grid-column.component.js +54 -63
- package/esm2015/modules/grid/grid-column.model.js +1 -1
- package/esm2015/modules/grid/grid.component.js +216 -210
- package/esm2015/modules/grid/grid.module.js +51 -30
- package/esm2015/modules/grid/types/grid-column-alignment.js +2 -1
- package/esm2015/modules/grid/types/grid-column-description-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-heading-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-inline-help-popover-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-column-width-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-message-type.js +1 -1
- package/esm2015/modules/grid/types/grid-message.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-cancel-args.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-config.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-confirm-args.js +2 -1
- package/esm2015/modules/grid/types/grid-row-delete-contents.js +2 -1
- package/esm2015/modules/grid/types/grid-selected-rows-model-change.js +2 -1
- package/esm2015/modules/grid/types/grid-selected-rows-source.js +1 -1
- package/esm2015/modules/grid/types/grid-ui-config.js +2 -1
- package/esm2015/modules/shared/skyux-grids-resources.module.js +45 -0
- package/esm2015/public-api.js +20 -0
- package/esm2015/skyux-grids.js +2 -6
- package/fesm2015/skyux-grids.js +486 -482
- package/fesm2015/skyux-grids.js.map +1 -1
- package/modules/grid/grid-adapter.service.d.ts +3 -0
- package/modules/grid/grid-cell.component.d.ts +3 -0
- package/modules/grid/grid-column.component.d.ts +5 -1
- package/modules/grid/grid.component.d.ts +6 -4
- package/modules/grid/grid.module.d.ts +16 -0
- package/modules/shared/skyux-grids-resources.module.d.ts +14 -0
- package/package.json +15 -30
- package/{public_api.d.ts → public-api.d.ts} +0 -0
- package/skyux-grids.d.ts +2 -5
- package/CHANGELOG.md +0 -188
- package/bundles/skyux-grids.umd.min.js +0 -16
- package/bundles/skyux-grids.umd.min.js.map +0 -1
- package/esm2015/modules/shared/grids-resources.module.js +0 -20
- package/esm2015/plugin-resources/grids-resources-provider.js +0 -16
- package/esm2015/polyfills.js +0 -29
- package/esm2015/public_api.js +0 -9
- package/esm5/modules/grid/grid-adapter.service.js +0 -106
- package/esm5/modules/grid/grid-cell.component.js +0 -59
- package/esm5/modules/grid/grid-column.component.js +0 -129
- package/esm5/modules/grid/grid-column.model.js +0 -27
- package/esm5/modules/grid/grid.component.js +0 -1016
- package/esm5/modules/grid/grid.module.js +0 -53
- package/esm5/modules/grid/types/grid-column-alignment.js +0 -1
- package/esm5/modules/grid/types/grid-column-description-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-heading-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-inline-help-popover-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-column-width-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-message-type.js +0 -20
- package/esm5/modules/grid/types/grid-message.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-cancel-args.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-config.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-confirm-args.js +0 -1
- package/esm5/modules/grid/types/grid-row-delete-contents.js +0 -1
- package/esm5/modules/grid/types/grid-selected-rows-model-change.js +0 -1
- package/esm5/modules/grid/types/grid-selected-rows-source.js +0 -12
- package/esm5/modules/grid/types/grid-ui-config.js +0 -1
- package/esm5/modules/shared/grids-resources.module.js +0 -23
- package/esm5/plugin-resources/grids-resources-provider.js +0 -17
- package/esm5/polyfills.js +0 -29
- package/esm5/public_api.js +0 -9
- package/esm5/skyux-grids.js +0 -9
- package/fesm5/skyux-grids.js +0 -1463
- package/fesm5/skyux-grids.js.map +0 -1
- package/modules/shared/grids-resources.module.d.ts +0 -2
- package/plugin-resources/grids-resources-provider.d.ts +0 -5
- package/polyfills.d.ts +0 -0
- package/skyux-grids.metadata.json +0 -1
- package/src/assets/locales/resources_en_US.json +0 -6
package/package.json
CHANGED
|
@@ -1,43 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/grids",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "SKY UX Grids",
|
|
5
|
-
"keywords": [],
|
|
6
|
-
"author": "Blackbaud",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/blackbaud/skyux-grids.git"
|
|
11
|
-
},
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/blackbaud/skyux-grids/issues"
|
|
14
|
-
},
|
|
15
|
-
"homepage": "https://github.com/blackbaud/skyux-grids#readme",
|
|
3
|
+
"version": "5.0.1",
|
|
16
4
|
"peerDependencies": {
|
|
17
|
-
"@angular/common": "^
|
|
18
|
-
"@angular/core": "^
|
|
19
|
-
"@angular/forms": "^
|
|
20
|
-
"@skyux/core": "^
|
|
21
|
-
"@skyux/forms": "^
|
|
22
|
-
"@skyux/i18n": "^
|
|
23
|
-
"@skyux/indicators": "^
|
|
24
|
-
"@skyux/layout": "^
|
|
25
|
-
"@skyux/list-builder-common": "^
|
|
26
|
-
"@skyux/popovers": "^
|
|
5
|
+
"@angular/common": "^12.2.13",
|
|
6
|
+
"@angular/core": "^12.2.13",
|
|
7
|
+
"@angular/forms": "^12.2.13",
|
|
8
|
+
"@skyux/core": "^5.1.1",
|
|
9
|
+
"@skyux/forms": "^5.0.1",
|
|
10
|
+
"@skyux/i18n": "^5.0.1",
|
|
11
|
+
"@skyux/indicators": "^5.0.2",
|
|
12
|
+
"@skyux/layout": "^5.0.0",
|
|
13
|
+
"@skyux/list-builder-common": "^5.0.1",
|
|
14
|
+
"@skyux/popovers": "^5.0.1"
|
|
27
15
|
},
|
|
28
16
|
"dependencies": {
|
|
29
|
-
"dragula": "3.7.
|
|
17
|
+
"dragula": "3.7.3",
|
|
30
18
|
"ng2-dragula": "1.5.0",
|
|
31
|
-
"tslib": "^
|
|
19
|
+
"tslib": "^2.3.1"
|
|
32
20
|
},
|
|
33
21
|
"main": "bundles/skyux-grids.umd.js",
|
|
34
|
-
"module": "
|
|
22
|
+
"module": "fesm2015/skyux-grids.js",
|
|
35
23
|
"es2015": "fesm2015/skyux-grids.js",
|
|
36
|
-
"esm5": "esm5/skyux-grids.js",
|
|
37
24
|
"esm2015": "esm2015/skyux-grids.js",
|
|
38
|
-
"fesm5": "fesm5/skyux-grids.js",
|
|
39
25
|
"fesm2015": "fesm2015/skyux-grids.js",
|
|
40
26
|
"typings": "skyux-grids.d.ts",
|
|
41
|
-
"metadata": "skyux-grids.metadata.json",
|
|
42
27
|
"sideEffects": false
|
|
43
|
-
}
|
|
28
|
+
}
|
|
File without changes
|
package/skyux-grids.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export { SkyGridCellComponent as ɵb } from './modules/grid/grid-cell.component';
|
|
7
|
-
export { SkyGridsResourcesModule as ɵc } from './modules/shared/grids-resources.module';
|
|
8
|
-
export { SkyGridsResourcesProvider as ɵd } from './plugin-resources/grids-resources-provider';
|
|
4
|
+
/// <amd-module name="@skyux/grids" />
|
|
5
|
+
export * from './public-api';
|
package/CHANGELOG.md
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
# 4.0.6 (2020-09-11)
|
|
2
|
-
|
|
3
|
-
- Fixed the grid component's resize handle to have a proper accessibility role. [#158](https://github.com/blackbaud/skyux-grids/pull/158)
|
|
4
|
-
- Fixed the grid component's row delete functionality to not add an extra grid column when all columns have a specified width. [#157](https://github.com/blackbaud/skyux-grids/pull/157)
|
|
5
|
-
|
|
6
|
-
# 4.0.5 (2020-08-19)
|
|
7
|
-
|
|
8
|
-
- Fixed the grid component to render grid column components which utilize an inline template. [#154](https://github.com/blackbaud/skyux-grids/pull/154)
|
|
9
|
-
|
|
10
|
-
# 4.0.4 (2020-08-18)
|
|
11
|
-
|
|
12
|
-
- Fixed the grid component to support moving columns by dragging the header text. [#150](https://github.com/blackbaud/skyux-grids/pull/150)
|
|
13
|
-
- Fixed the grid component to suport dynamically changing the available columns after the `selectedColumnIds` input is set. [#151](https://github.com/blackbaud/skyux-grids/pull/151)
|
|
14
|
-
|
|
15
|
-
# 4.0.3 (2020-08-11)
|
|
16
|
-
|
|
17
|
-
- Fixed the grid component to prevent columns from hiding header text at small column widths. [#147](https://github.com/blackbaud/skyux-grids/pull/147)
|
|
18
|
-
|
|
19
|
-
# 4.0.2 (2020-08-03)
|
|
20
|
-
|
|
21
|
-
- Fixed the grid component to emit the `selectedColumnIdsChange` event the first time columns are reordered. [#142](https://github.com/blackbaud/skyux-grids/pull/142)
|
|
22
|
-
|
|
23
|
-
# 4.0.1 (2020-05-20)
|
|
24
|
-
|
|
25
|
-
- Fixed the grid component to support columns with no headers. [#125](https://github.com/blackbaud/skyux-grids/pull/125)
|
|
26
|
-
- Fixed the grid component to prevent rows from vertically collapsing when there is no content. [#124](https://github.com/blackbaud/skyux-grids/pull/124)
|
|
27
|
-
|
|
28
|
-
# 3.8.1 (2020-05-20)
|
|
29
|
-
|
|
30
|
-
- Fixed the grid component to support columns with no headers. [#125](https://github.com/blackbaud/skyux-grids/pull/125)
|
|
31
|
-
- Fixed the grid component to prevent rows from vertically collapsing when there is no content. [#124](https://github.com/blackbaud/skyux-grids/pull/124)
|
|
32
|
-
|
|
33
|
-
# 4.0.0 (2020-05-15)
|
|
34
|
-
|
|
35
|
-
### New features
|
|
36
|
-
|
|
37
|
-
- Updated the pipeline to transpile to the [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview). [#109](https://github.com/blackbaud/skyux-grids/pull/109)
|
|
38
|
-
|
|
39
|
-
### Breaking changes
|
|
40
|
-
|
|
41
|
-
- Dropped support for `rxjs@5`. Consumers can install `rxjs-compat@^6` to support older versions of `rxjs`. [#109](https://github.com/blackbaud/skyux-grids/pull/109)
|
|
42
|
-
|
|
43
|
-
# 3.8.0 (2020-05-11)
|
|
44
|
-
|
|
45
|
-
- Added the ability to align the contents and header of a grid column. [#114](https://github.com/blackbaud/skyux-grids/pull/114)
|
|
46
|
-
|
|
47
|
-
# 4.0.0-rc.3 (2020-05-06)
|
|
48
|
-
|
|
49
|
-
- Added bug fixes and features from the `master` branch. [#118](https://github.com/blackbaud/skyux-grids/pull/118)
|
|
50
|
-
|
|
51
|
-
# 3.7.0 (2020-05-01)
|
|
52
|
-
|
|
53
|
-
- Updated the visual styles of the column resize indicator. [#116](https://github.com/blackbaud/skyux-grids/pull/116)
|
|
54
|
-
- Removed the dependency `moment`. [#116](https://github.com/blackbaud/skyux-grids/pull/116)
|
|
55
|
-
|
|
56
|
-
# 4.0.0-rc.2 (2020-04-15)
|
|
57
|
-
|
|
58
|
-
- Added `SkyGridColumnComponent` and `SkyGridComponent` to exports API (for internal use only).
|
|
59
|
-
|
|
60
|
-
# 4.0.0-rc.1 (2020-04-15)
|
|
61
|
-
|
|
62
|
-
- Added `SkyGridColumnModel` to the exports API.
|
|
63
|
-
|
|
64
|
-
# 4.0.0-rc.0 (2020-04-10)
|
|
65
|
-
|
|
66
|
-
### New features
|
|
67
|
-
|
|
68
|
-
- Updated the pipeline to transpile to the [Angular Package Format](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview). [#109](https://github.com/blackbaud/skyux-grids/pull/109)
|
|
69
|
-
|
|
70
|
-
### Breaking changes
|
|
71
|
-
|
|
72
|
-
- Dropped support for `rxjs@5`. Consumers can install `rxjs-compat@^6` to support older versions of `rxjs`. [#109](https://github.com/blackbaud/skyux-grids/pull/109)
|
|
73
|
-
|
|
74
|
-
# 3.6.0 (2020-03-23)
|
|
75
|
-
|
|
76
|
-
- Added the ability to delete rows in the grid component. [#98](https://github.com/blackbaud/skyux-grids/pull/98)
|
|
77
|
-
|
|
78
|
-
# 3.5.3 (2020-03-11)
|
|
79
|
-
|
|
80
|
-
- Fixed the grid component to properly display the top scroll bar when the grid's columns or data changes. [#105](https://github.com/blackbaud/skyux-grids/pull/105)
|
|
81
|
-
|
|
82
|
-
# 3.5.2 (2020-02-13)
|
|
83
|
-
|
|
84
|
-
- Fixed the grid component to handle scroll events when the top scroll bar fails to render. [#100](https://github.com/blackbaud/skyux-grids/pull/100)
|
|
85
|
-
- Fixed the grid component to properly display the top scroll bar as needed when windows are resized. [#101](https://github.com/blackbaud/skyux-grids/pull/101)
|
|
86
|
-
|
|
87
|
-
# 3.5.1 (2020-02-10)
|
|
88
|
-
|
|
89
|
-
- Fixed the grid component to properly watch for undefined columns when getting a column's visual styles. [#96](https://github.com/blackbaud/skyux-grids/pull/96)
|
|
90
|
-
|
|
91
|
-
# 3.5.0 (2020-02-03)
|
|
92
|
-
|
|
93
|
-
- Added a horizontal scroll bar to the top of the grid component. [#87](https://github.com/blackbaud/skyux-grids/pull/87)
|
|
94
|
-
|
|
95
|
-
# 3.4.0 (2019-12-18)
|
|
96
|
-
|
|
97
|
-
- Added the `inlineHelpPopover` property to the grid column component. [#83](https://github.com/blackbaud/skyux-grids/pull/83) (Thanks, [@Blackbaud-DustinLunsford](https://github.com/Blackbaud-DustinLunsford)!)
|
|
98
|
-
|
|
99
|
-
# 3.3.0 (2019-12-11)
|
|
100
|
-
|
|
101
|
-
- Added the `source` property to `SkyGridSelectedRowsModelChange`, which defines the source of the change. [#80](https://github.com/blackbaud/skyux-grids/pull/80)
|
|
102
|
-
- Fixed the grid component to allow selecting rows on init by using the `selectedRowIds` property. [#78](https://github.com/blackbaud/skyux-grids/pull/78)
|
|
103
|
-
|
|
104
|
-
# 3.2.1 (2019-09-27)
|
|
105
|
-
|
|
106
|
-
- Fixed the grid component to restrict how users reorder the columns beside locked columns. You can no longer reorder the columns on the left side of a locked column, and you can no longer move columns from the right side of a locked column to the left side.
|
|
107
|
-
[#72](https://github.com/blackbaud/skyux-grids/pull/72)
|
|
108
|
-
- Fixed the grid component to prevent users from reordering locked columns with the sort indicator. [#71](https://github.com/blackbaud/skyux-grids/pull/71)
|
|
109
|
-
- Fixed the grid component to prevent scrolling when users reorder columns on mobile devices. [#70](https://github.com/blackbaud/skyux-grids/pull/70)
|
|
110
|
-
|
|
111
|
-
# 3.2.0 (2019-07-19)
|
|
112
|
-
|
|
113
|
-
- Added the `selectedRowIds` input property to programmatically select rows on the grid component. [#39](https://github.com/blackbaud/skyux-grids/pull/39)
|
|
114
|
-
|
|
115
|
-
# 3.1.7 (2019-06-14)
|
|
116
|
-
|
|
117
|
-
- Fixed the grid component to gracefully ignore columns that no longer exist when the UI Config Service returns them. [#61](https://github.com/blackbaud/skyux-grids/pull/61)
|
|
118
|
-
|
|
119
|
-
# 3.1.6 (2019-05-28)
|
|
120
|
-
|
|
121
|
-
- Fixed the grid column component to properly support resizing on touch devices. [#57](https://github.com/blackbaud/skyux-grids/pull/57)
|
|
122
|
-
|
|
123
|
-
# 3.1.5 (2019-05-09)
|
|
124
|
-
|
|
125
|
-
- Fixed the grid component to no longer resize the table width when `selectedColumnIds` changes. [#54](https://github.com/blackbaud/skyux-grids/pull/54)
|
|
126
|
-
|
|
127
|
-
# 3.1.4 (2019-04-18)
|
|
128
|
-
|
|
129
|
-
- Fixed the grid module to properly provide `SkyAppWindowRef`. [#52](https://github.com/blackbaud/skyux-grids/pull/52)
|
|
130
|
-
|
|
131
|
-
# 3.1.3 (2019-03-07)
|
|
132
|
-
|
|
133
|
-
- Fixed the grid component to no longer emit extra `selectedColumnIdsChange` events. [#36](https://github.com/blackbaud/skyux-grids/pull/36)
|
|
134
|
-
|
|
135
|
-
# 3.1.2 (2019-02-28)
|
|
136
|
-
|
|
137
|
-
- Fixed the grid component to load properly when using RxJS version 6 or above. [#47](https://github.com/blackbaud/skyux-grids/pull/47)
|
|
138
|
-
|
|
139
|
-
# 3.1.1 (2019-02-22)
|
|
140
|
-
|
|
141
|
-
- Fixed the grid component to no longer truncate text when a table cell is stretched wider than its original width. [#38](https://github.com/blackbaud/skyux-grids/pull/38)
|
|
142
|
-
|
|
143
|
-
# 3.1.0 (2019-01-16)
|
|
144
|
-
|
|
145
|
-
- Added UI Config Service hooks to the grid component. [#31](https://github.com/blackbaud/skyux-grids/pull/31)
|
|
146
|
-
|
|
147
|
-
# 3.0.0 (2019-01-11)
|
|
148
|
-
|
|
149
|
-
- Major version release.
|
|
150
|
-
|
|
151
|
-
# 3.0.0-rc.6 (2019-01-04)
|
|
152
|
-
|
|
153
|
-
- Added the `rowHighlightedId` input to the grid component. [#28](https://github.com/blackbaud/skyux-grids/pull/28)
|
|
154
|
-
|
|
155
|
-
# 3.0.0-rc.5 (2018-12-21)
|
|
156
|
-
|
|
157
|
-
- Fixed the grid component to only listen to `mousemove` and `mouseup` events while resizing columns. [#25](https://github.com/blackbaud/skyux-grids/pull/25)
|
|
158
|
-
|
|
159
|
-
# 3.0.0-rc.4 (2018-12-13)
|
|
160
|
-
|
|
161
|
-
- Fixed the grid component to properly import polyfills. [#23](https://github.com/blackbaud/skyux-grids/pull/23)
|
|
162
|
-
|
|
163
|
-
# 3.0.0-rc.3 (2018-12-12)
|
|
164
|
-
|
|
165
|
-
- Added the multiselect feature to display a column of checkboxes on the grid component. [#6](https://github.com/blackbaud/skyux-grids/pull/6)
|
|
166
|
-
|
|
167
|
-
# 3.0.0-rc.2 (2018-11-20)
|
|
168
|
-
|
|
169
|
-
- Added support for `@skyux/list-builder-common@3.0.0-rc.1`. [#14](https://github.com/blackbaud/skyux-grids/pull/14)
|
|
170
|
-
- Fixed the grid component's column resize drag handle to not inadvertently trigger a column sort. [#17](https://github.com/blackbaud/skyux-grids/pull/17)
|
|
171
|
-
- Fixed grid cells to properly handle text overflow when column widths are fixed. [#13](https://github.com/blackbaud/skyux-grids/pull/13)
|
|
172
|
-
|
|
173
|
-
# 3.0.0-rc.1 (2018-11-12)
|
|
174
|
-
|
|
175
|
-
- Added async column descriptions. [#6](https://github.com/blackbaud/skyux-grids/pull/6)
|
|
176
|
-
- Fixed column resizing to recalculate the table width when columns are hidden or shown. [#8](https://github.com/blackbaud/skyux-grids/pull/8)
|
|
177
|
-
|
|
178
|
-
# 3.0.0-rc.0 (2018-10-23)
|
|
179
|
-
|
|
180
|
-
- Initial release candidate.
|
|
181
|
-
|
|
182
|
-
# 3.0.0-alpha.1 (2018-10-22)
|
|
183
|
-
|
|
184
|
-
- Fixed column headers to no longer shift in size when sorting. [#4](https://github.com/blackbaud/skyux-grids/pull/4)
|
|
185
|
-
|
|
186
|
-
# 3.0.0-alpha.0 (2018-10-10)
|
|
187
|
-
|
|
188
|
-
- Initial alpha release.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("ng2-dragula"),require("@skyux/core"),require("@skyux/forms"),require("@skyux/indicators"),require("@skyux/layout"),require("@skyux/popovers"),require("rxjs"),require("rxjs/operators"),require("@skyux/list-builder-common"),require("@skyux/i18n")):"function"==typeof define&&define.amd?define("@skyux/grids",["exports","@angular/core","@angular/common","@angular/forms","ng2-dragula","@skyux/core","@skyux/forms","@skyux/indicators","@skyux/layout","@skyux/popovers","rxjs","rxjs/operators","@skyux/list-builder-common","@skyux/i18n"],t):t(((e=e||self).skyux=e.skyux||{},e.skyux.grids={}),e.ng.core,e.ng.common,e.ng.forms,e.ng2Dragula,e.core$1,e.forms$1,e.indicators,e.layout,e.popovers,e.rxjs,e.rxjs.operators,e.listBuilderCommon,e.i18n)}(this,(function(e,t,i,n,o,r,s,l,d,a,c,h,u,p){"use strict";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var g,m;function y(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,o,r=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return s}(g=e.SkyGridMessageType||(e.SkyGridMessageType={}))[g.SelectAll=0]="SelectAll",g[g.ClearAll=1]="ClearAll",g[g.PromptDeleteRow=2]="PromptDeleteRow",g[g.AbortDeleteRow=3]="AbortDeleteRow",(m=e.SkyGridSelectedRowsSource||(e.SkyGridSelectedRowsSource={}))[m.CheckboxChange=0]="CheckboxChange",m[m.ClearAll=1]="ClearAll",m[m.RowClick=2]="RowClick",m[m.SelectAll=3]="SelectAll",m[m.SelectedRowIdsChange=4]="SelectedRowIdsChange";var C=function(){function e(){this.alignment="left",this.isSortable=!0,this.searchFunction=this.search,this.descriptionChanges=new t.EventEmitter,this.descriptionModelChanges=new t.EventEmitter,this.headingChanges=new t.EventEmitter,this.headingModelChanges=new t.EventEmitter,this.inlineHelpPopoverModelChanges=new t.EventEmitter}return e.prototype.ngOnChanges=function(e){e.heading&&!1===e.heading.firstChange&&(this.headingChanges.emit(this.heading),this.headingModelChanges.emit({value:this.heading,id:this.id,field:this.field})),e.description&&!1===e.description.firstChange&&(this.descriptionChanges.emit(this.description),this.descriptionModelChanges.emit({value:this.description,id:this.id,field:this.field})),e.inlineHelpPopover&&!1===e.inlineHelpPopover.firstChange&&this.inlineHelpPopoverModelChanges.emit({value:this.inlineHelpPopover,id:this.id,field:this.field})},Object.defineProperty(e.prototype,"template",{get:function(){return this.templates.length>0?this.templates.first:this.templateInput},enumerable:!0,configurable:!0}),e.prototype.search=function(e,t){return null!=e&&-1!==e.toString().toLowerCase().indexOf(t)},y([t.Input()],e.prototype,"alignment",void 0),y([t.Input()],e.prototype,"description",void 0),y([t.Input()],e.prototype,"excludeFromHighlighting",void 0),y([t.Input()],e.prototype,"field",void 0),y([t.Input()],e.prototype,"heading",void 0),y([t.Input()],e.prototype,"hidden",void 0),y([t.Input()],e.prototype,"id",void 0),y([t.Input()],e.prototype,"inlineHelpPopover",void 0),y([t.Input()],e.prototype,"isSortable",void 0),y([t.Input()],e.prototype,"locked",void 0),y([t.Input("search")],e.prototype,"searchFunction",void 0),y([t.Input()],e.prototype,"type",void 0),y([t.Input("template")],e.prototype,"templateInput",void 0),y([t.Input()],e.prototype,"width",void 0),y([t.ContentChildren(t.TemplateRef)],e.prototype,"templates",void 0),e=y([t.Component({selector:"sky-grid-column",template:"<ng-content></ng-content>",changeDetection:t.ChangeDetectionStrategy.OnPush})],e)}(),k=function(e,t){this.isSortable=!0,this.template=e,t&&(this.id=t.id||t.field,this.type=t.type,this.field=t.field,this.heading=t.heading,this.inlineHelpPopover=t.inlineHelpPopover,this.width=t.width?Number(t.width):void 0,this.hidden=t.hidden,this.locked=t.locked,this.description=t.description,this.searchFunction=t.searchFunction,this.isSortable=t.isSortable,this.excludeFromHighlighting=t.excludeFromHighlighting,this.alignment=t.alignment)},w=function(){function e(e){this.rendererFactory=e,this.renderer=this.rendererFactory.createRenderer(void 0,void 0)}return e.prototype.initializeDragAndDrop=function(e,t){var i=this;e.drag.subscribe((function(e){return v(e,2)[1].classList.add("sky-grid-header-dragging")})),e.dragend.subscribe((function(e){return v(e,2)[1].classList.remove("sky-grid-header-dragging")})),e.drop.subscribe((function(e){for(var i=[],n=v(e,3)[2].querySelectorAll("th:not(.sky-grid-multiselect-cell):not(.sky-grid-row-delete-heading)"),o=0;o<n.length;o++){var r=n[o].getAttribute("sky-cmp-id");i.push(r)}t(i)})),e.setOptions("sky-grid-heading",{moves:function(e,t,n){var o=t.querySelectorAll("th div"),r=i.isLeftOfLocked(n,o);return!(e.querySelector(".sky-grid-header-locked")||void 0===n||n.matches(".sky-grid-resize-handle")||n.matches(".sky-grid-multiselect-cell")||n.matches(".sky-grid-row-delete-heading")||r)},accepts:function(e,t,n,o){if(void 0===o||!o)return!0;var r=n.querySelectorAll("th div"),s=o.querySelector("div"),l=i.isLeftOfLocked(s,r);return!o.matches(".sky-grid-header-locked")&&!o.matches(".sky-grid-resize-handle")&&!l}})},e.prototype.getRowHeight=function(e,t){return e.nativeElement.querySelectorAll("tbody tr")[t].scrollHeight+"px"},e.prototype.setStyle=function(e,t,i){e&&this.renderer.setStyle(e.nativeElement,t,i)},e.prototype.isLeftOfLocked=function(e,t){var i,n,o=e;try{for(var r=f(Array.from(t)),s=r.next();!s.done;s=r.next()){var l=s.value;l.contains(e)&&(o=l)}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}for(var d=t.length-1;d>=0;d--){if(t[d].classList.contains("sky-grid-header-locked"))return!0;if(t[d]===o)break}return!1},e.ctorParameters=function(){return[{type:t.RendererFactory2}]},e=y([t.Injectable()],e)}();Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var b=0,S=function(){function i(e,i,n,o,r,s,l){this.affixService=e,this.changeDetector=i,this.dragulaService=n,this.gridAdapter=o,this.overlayService=r,this.skyWindow=s,this.uiConfigService=l,this.enableMultiselect=!1,this.fit="width",this.hasToolbar=!1,this.messageStream=new c.Subject,this.columnWidthChange=new t.EventEmitter,this.multiselectSelectionChange=new t.EventEmitter,this.rowDeleteCancel=new t.EventEmitter,this.rowDeleteConfirm=new t.EventEmitter,this.selectedColumnIdsChange=new t.EventEmitter,this.sortFieldChange=new t.EventEmitter,this.columnResizeStep=10,this.gridId=++b,this.rowDeleteConfigs=[],this.maxColWidth=9999,this.minColWidth=50,this.showResizeBar=!1,this.showTopScroll=!1,this.isDraggingResizeHandle=!1,this.isResized=!1,this.ngUnsubscribe=new c.Subject,this.rowDeleteContents={},this.subscriptions=[],this.scrollTriggered=!1,this.selectedColumnIdsSet=!1,this.displayedColumns=new Array,this.items=new Array,this.currentSortField=new c.BehaviorSubject({fieldSelector:"",descending:!1})}return Object.defineProperty(i.prototype,"selectedColumnIds",{get:function(){return this._selectedColumnIds},set:function(e){var t=this._selectedColumnIds;this._selectedColumnIds=e,this.columns&&this.setDisplayedColumns(),t&&e&&this.arraysEqual(e,t)||this.selectedColumnIdsSet&&(this.setUserConfig({selectedColumnIds:e}),this.selectedColumnIdsChange.emit(this._selectedColumnIds),this.isResized&&this.resetTableWidth()),this.selectedColumnIdsSet=!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedRowIds",{get:function(){return this._selectedRowIds},set:function(t){t&&(this._selectedRowIds=t,this.applySelectedRows(),this.emitSelectedRows(e.SkyGridSelectedRowsSource.SelectedRowIdsChange))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"tableWidth",{get:function(){return this.tableElementRef.nativeElement.offsetWidth},enumerable:!0,configurable:!0}),i.prototype.ngOnInit=function(){var e=this;this.messageStream.pipe(h.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.handleIncomingMessages(t)}))},i.prototype.ngAfterContentInit=function(){var e=this;this.settingsKey?this.applyUserConfig().then((function(){e.initColumns()})):this.initColumns(),this.gridAdapter.initializeDragAndDrop(this.dragulaService,(function(t){e.onHeaderDrop(t)})),this.applySelectedRows()},i.prototype.ngAfterViewInit=function(){this.checkUserColumnWidthsForScroll()},i.prototype.ngOnChanges=function(e){var t=this;e.columns&&this.columns&&(this.selectedColumnIds&&(this.selectedColumnIds=this.selectedColumnIds.filter((function(e){return t.columns.find((function(t){return t.id===e}))}))),this.setDisplayedColumns(!0)),e.data&&this.data&&(this.transformData(),setTimeout((function(){Object.keys(t.rowDeleteContents).forEach((function(e){if(t.data.find((function(t){return t.id===e}))){var i=t.tableElementRef.nativeElement.querySelector('[sky-cmp-id="'+e+'"]');t.rowDeleteContents[e].affixer.affixTo(i,{autoFitContext:r.SkyAffixAutoFitContext.Viewport,isSticky:!0,placement:"above",verticalAlignment:"top",horizontalAlignment:"left",enableAutoFit:!1})}else t.destroyRowDelete(e)})),t.checkUserColumnWidthsForScroll()}))),e.sortField&&this.setSortHeaders()},i.prototype.ngOnDestroy=function(){var e=this;this.subscriptions.forEach((function(e){e.unsubscribe()})),this.multiselectSelectionChange.complete(),this.ngUnsubscribe.next(),this.ngUnsubscribe.complete(),Object.keys(this.rowDeleteContents).forEach((function(t){e.destroyRowDelete(t)}))},i.prototype.onWindowResize=function(){this.checkUserColumnWidthsForScroll()},i.prototype.getTopScrollWidth=function(){return this.tableElementRef.nativeElement.scrollWidth},i.prototype.getTableClassNames=function(){var e=[];return"scroll"!==this.fit&&e.push("sky-grid-fit"),this.hasToolbar&&e.push("sky-grid-has-toolbar"),this.addDelimeter(e," ")},i.prototype.getTableHeaderClassNames=function(e){var t=[];return e&&e.locked&&t.push("sky-grid-header-locked"),this.addDelimeter(t," ")},i.prototype.getCaretIconNames=function(e){var t=[];return this.getSortDirection(e.field).subscribe((function(e){"asc"===e&&t.push("caret-up"),"desc"===e&&t.push("caret-down")})),this.addDelimeter(t," ")},i.prototype.onKeydown=function(e,t){var i=e.key.toLowerCase();"enter"!==i&&" "!==i||this.sortByColumn(t)},i.prototype.sortByColumn=function(e){var t=this;!this.isDraggingResizeHandle&&e.isSortable&&this.currentSortField.pipe(h.take(1),h.map((function(i){var n={fieldSelector:e.field,descending:!0};i&&i.fieldSelector===e.field&&i.descending&&(n={fieldSelector:e.field,descending:!1}),t.sortFieldChange.emit(n),t.currentSortField.next(n)}))).subscribe()},i.prototype.getSortDirection=function(e){return this.currentSortField.pipe(h.distinctUntilChanged(),h.map((function(t){return t.fieldSelector===e?t.descending?"desc":"asc":void 0})))},i.prototype.getAriaSortDirection=function(e){return this.currentSortField.pipe(h.distinctUntilChanged(),h.map((function(t){return t.fieldSelector===e.field?t.descending?"descending":"ascending":e.isSortable?"none":void 0})))},i.prototype.getCaretVisibility=function(e){return this.currentSortField.pipe(h.distinctUntilChanged(),h.map((function(t){return t.fieldSelector===e?"visible":"hidden"})))},i.prototype.getHelpInlineClass=function(e){return this.getCaretVisibility(e).pipe(h.map((function(e){return"hidden"===e})))},i.prototype.onMultiselectCheckboxChange=function(){this.emitSelectedRows(e.SkyGridSelectedRowsSource.CheckboxChange)},i.prototype.updateColumnHeading=function(e){var t=this.columns.find((function(t){return void 0!==e.id&&e.id===t.id||void 0!==e.field&&e.field===t.field}));t&&(t.heading=e.value,this.changeDetector.markForCheck())},i.prototype.updateInlineHelpPopover=function(e){var t=this.columns.find((function(t){return void 0!==e.id&&e.id===t.id||void 0!==e.field&&e.field===t.field}));t&&(t.inlineHelpPopover=e.value,this.changeDetector.markForCheck())},i.prototype.updateColumnDescription=function(e){var t=this.columns.find((function(t){return void 0!==e.id&&e.id===t.id||void 0!==e.field&&e.field===t.field}));t&&(t.description=e.value,this.changeDetector.markForCheck())},i.prototype.onResizeColumnStart=function(e){var t=this;this.isResized||(this.initColumnWidths(),this.isResized=!0),this.initializeResizeColumn(e),this.isDraggingResizeHandle=!0,this.xPosStart=e.pageX,this.showResizeBar=!0,this.changeDetector.detectChanges(),this.setResizeBarPosition(e.pageX),e.preventDefault(),e.stopPropagation();var i=c.fromEvent(document,"mousemove"),n=c.fromEvent(document,"touchmove");c.merge(i,n).pipe(h.takeWhile((function(){return t.isDraggingResizeHandle}))).subscribe((function(e){t.onResizeHandleMove(e)}));var o=c.fromEvent(document,"mouseup"),r=c.fromEvent(document,"touchend");c.merge(o,r).pipe(h.takeWhile((function(){return t.isDraggingResizeHandle}))).subscribe((function(e){t.onResizeHandleRelease(e)}))},i.prototype.onKeydownResizeCol=function(e){this.isResized||(this.initColumnWidths(),this.isResized=!0),this.initializeResizeColumn(e)},i.prototype.onInputChangeResizeCol=function(e){var t=e.target,i=Number(t.value),n=i-this.startColumnWidth;this.resizeColumnByIndex(this.activeResizeColumnIndex,i,n);var o=t.getBoundingClientRect().left;this.setResizeBarPosition(o)},i.prototype.onResizeHandleMove=function(e){var t=e.pageX-this.xPosStart,i=this.startColumnWidth+t;if(i<=this.minColWidth)e.stopPropagation();else{var n=this.getMaxRangeByIndex(this.activeResizeColumnIndex);"width"===this.fit&&i>n?e.stopPropagation():this.setResizeBarPosition(e.pageX)}},i.prototype.onResizeHandleBlur=function(e){this.showResizeBar=!1},i.prototype.onResizeHandleFocus=function(e){this.showResizeBar=!0,this.changeDetector.detectChanges();var t=e.target.getBoundingClientRect().left;this.setResizeBarPosition(t)},i.prototype.onResizeHandleRelease=function(e){this.showResizeBar=!1;var t=e.pageX-this.xPosStart,i=this.startColumnWidth+t;this.resizeColumnByIndex(this.activeResizeColumnIndex,i,t),this.isDraggingResizeHandle=!1,this.activeResizeColumnIndex=void 0,e.stopPropagation(),this.changeDetector.markForCheck()},i.prototype.onRowClick=function(t,i){this.enableMultiselect&&(t.target!==t.currentTarget&&this.isInteractiveElement(t)||(i.isSelected=!i.isSelected,this.changeDetector.markForCheck(),this.emitSelectedRows(e.SkyGridSelectedRowsSource.RowClick)))},i.prototype.isRowHighlighted=function(e){return!!this.rowHighlightedId&&e===this.rowHighlightedId},i.prototype.getRowHeight=function(e){return this.gridAdapter.getRowHeight(this.tableElementRef,e)},i.prototype.cancelRowDelete=function(e){this.rowDeleteConfigs=this.rowDeleteConfigs.filter((function(t){return t.id!==e})),this.rowDeleteCancel.emit({id:e}),this.destroyRowDelete(e)},i.prototype.confirmRowDelete=function(e){this.rowDeleteConfigs.find((function(t){return t.id===e})).pending=!0,this.rowDeleteConfirm.emit({id:e})},i.prototype.getRowDeleteItem=function(e){return this.rowDeleteConfigs.find((function(t){return t.id===e}))},i.prototype.onTouchMove=function(e){e.preventDefault()},i.prototype.onTopScroll=function(e){this.tableContainerElementRef&&(this.scrollTriggered?(this.scrollTriggered=!1,this.tableContainerElementRef.nativeElement.scrollLeft=this.topScrollContainerElementRef.nativeElement.scrollLeft):this.scrollTriggered=!0)},i.prototype.onGridScroll=function(e){this.topScrollContainerElementRef&&(this.scrollTriggered?(this.scrollTriggered=!1,this.topScrollContainerElementRef.nativeElement.scrollLeft=this.tableContainerElementRef.nativeElement.scrollLeft):this.scrollTriggered=!0)},i.prototype.checkUserColumnWidthsForScroll=function(){var e=this;if(!this.showTopScroll&&this.columnElementRefs&&this.columnElementRefs.length>0){var t=0,i=this.skyWindow.nativeWindow.innerWidth;this.columnElementRefs.forEach((function(n){if(!e.showTopScroll){var o=parseFloat(window.getComputedStyle(n.nativeElement).width),r=n.nativeElement.offsetWidth,s=Math.max(o||r,e.minColWidth);(t+=s)>i&&(e.showTopScroll=!0,setTimeout((function(){e.changeDetector.markForCheck()})))}}))}},i.prototype.multiselectSelectAll=function(){for(var t=0;t<this.items.length;t++)this.items[t].isSelected=!0;this.changeDetector.markForCheck(),this.emitSelectedRows(e.SkyGridSelectedRowsSource.SelectAll)},i.prototype.multiselectClearAll=function(){for(var t=0;t<this.items.length;t++)this.items[t].isSelected=!1;this.changeDetector.markForCheck(),this.emitSelectedRows(e.SkyGridSelectedRowsSource.ClearAll)},i.prototype.handleIncomingMessages=function(t){var i=this;switch(t.type){case e.SkyGridMessageType.SelectAll:this.multiselectSelectAll();break;case e.SkyGridMessageType.ClearAll:this.multiselectClearAll();break;case e.SkyGridMessageType.PromptDeleteRow:if(t.data&&t.data.promptDeleteRow){var n=this.rowDeleteConfigs.find((function(e){return e.id===t.data.promptDeleteRow.id}));if(n)n.pending=!1;else{this.rowDeleteConfigs.push({id:t.data.promptDeleteRow.id,pending:!1});var o=this.overlayService.create({enableScroll:!0,showBackdrop:!1,closeOnNavigation:!0,enableClose:!1,enablePointerEvents:!0});o.attachTemplate(this.inlineDeleteTemplateRef,{$implicit:this.data.find((function(e){return e.id===t.data.promptDeleteRow.id}))}),o.componentRef.instance.zIndex="999",setTimeout((function(){var e=i.inlineDeleteRefs.toArray().find((function(e){return e.nativeElement.id==="row-delete-ref-"+t.data.promptDeleteRow.id})),n=i.affixService.createAffixer(e),s=i.tableElementRef.nativeElement.querySelector('[sky-cmp-id="'+t.data.promptDeleteRow.id+'"]');n.affixTo(s,{autoFitContext:r.SkyAffixAutoFitContext.Viewport,isSticky:!0,placement:"above",verticalAlignment:"top",horizontalAlignment:"left",enableAutoFit:!1}),i.rowDeleteContents[t.data.promptDeleteRow.id]={affixer:n,overlay:o}}))}}break;case e.SkyGridMessageType.AbortDeleteRow:t.data&&t.data.abortDeleteRow&&(this.rowDeleteConfigs=this.rowDeleteConfigs.filter((function(e){return e.id!==t.data.abortDeleteRow.id})),this.destroyRowDelete(t.data.abortDeleteRow.id))}this.changeDetector.markForCheck()},i.prototype.onHeaderDrop=function(e){this.selectedColumnIdsSet=!0,this.selectedColumnIds=e,this.changeDetector.markForCheck()},i.prototype.setDisplayedColumns=function(e){var t=this;void 0===e&&(e=!1),void 0!==this.selectedColumnIds?this.displayedColumns=this.selectedColumnIds.filter((function(e){return t.columns.find((function(t){return t.id===e}))})).map((function(e){return t.columns.filter((function(t){return t.id===e}))[0]})):this.displayedColumns=e?this.columns.filter((function(e){return!e.hidden})):this.columns},i.prototype.transformData=function(){this.data&&this.data.length>0&&this.data[0].id&&!this.data[0].data?this.multiselectRowId?this.items=this.getGridDataWithSelectedRows():this.items=this.data.map((function(e){return new u.ListItemModel(e.id,e)})):this.items=this.data},i.prototype.getGridDataWithSelectedRows=function(){var e=this,t=this.getSelectedRows();return this.data.map((function(i){var n;return n=i.hasOwnProperty(e.multiselectRowId)?t.indexOf(i[e.multiselectRowId])>-1:t.indexOf(i.id)>-1,new u.ListItemModel(i.id,i,n)}))},i.prototype.applySelectedRows=function(){if(this.items&&this.items.length>0&&this.selectedRowIds){for(var e=0;e<this.items.length;e++)this.items[e].isSelected=this.selectedRowIds.indexOf(this.items[e].id)>-1;this.changeDetector.markForCheck()}},i.prototype.setSortHeaders=function(){this.currentSortField.next(this.sortField||{fieldSelector:"",descending:!1})},i.prototype.getColumnsFromComponent=function(){this.columns=this.columnComponents.map((function(e){return new k(e.template,e)}))},i.prototype.updateColumns=function(){var e=this;this.getColumnsFromComponent(),this.setDisplayedColumns(!0),this.changeDetector.markForCheck(),setTimeout((function(){e.checkUserColumnWidthsForScroll()}))},i.prototype.resizeColumnByIndex=function(e,t,i){var n=this.getColumnModelByIndex(e);if(t<=this.minColWidth&&(i=i+this.minColWidth-t,t=this.minColWidth),"width"===this.fit){var o=this.getLastDisplayedColumn(),r=this.getMaxRangeByIndex(e);t>r&&(t=r,i=r-this.startColumnWidth),n.width=t,o.width=o.width-i,this.updateMaxRange()}else this.gridAdapter.setStyle(this.tableElementRef,"width",this.tableWidth+i+"px"),n.width=t;this.changeDetector.detectChanges(),this.columnWidthChange.emit(this.getColumnWidthModelChange())},i.prototype.initColumnWidths=function(){var e=this;this.showTopScroll=!0,this.columnElementRefs.forEach((function(t,i){var n=parseFloat(window.getComputedStyle(t.nativeElement).width),o=t.nativeElement.offsetWidth,r=Math.max(n||o,e.minColWidth);e.getColumnModelByIndex(i).width=r})),"scroll"===this.fit&&this.gridAdapter.setStyle(this.tableElementRef,"min-width","auto"),"width"===this.fit&&this.updateMaxRange(),this.changeDetector.detectChanges()},i.prototype.getColumnWidthModelChange=function(){var e=new Array;return this.columns.forEach((function(t){e.push({id:t.id,field:t.field,width:t.width})})),e},i.prototype.updateMaxRange=function(){var e=this,t=this.getLastDisplayedColumn().width-this.minColWidth;this.displayedColumns.forEach((function(i,n){var o=i.width+t,r=e.getRangeInputByIndex(n);r.nativeElement.max=o,r.nativeElement.setAttribute("aria-valuemax",o)}))},i.prototype.initializeResizeColumn=function(e){var t=e.target;this.activeResizeColumnIndex=t.getAttribute("sky-cmp-index");var i=this.getColumnModelByIndex(this.activeResizeColumnIndex);this.startColumnWidth=i.width},i.prototype.resetTableWidth=function(){var e=this;this.skyWindow.nativeWindow.setTimeout((function(){e.gridAdapter.setStyle(e.tableElementRef,"width","auto"),e.changeDetector.detectChanges(),e.gridAdapter.setStyle(e.tableElementRef,"width",e.tableWidth+"px"),e.changeDetector.detectChanges()}))},i.prototype.getRangeInputByIndex=function(e){return this.columnRangeInputElementRefs.find((function(t){return t.nativeElement.getAttribute("sky-cmp-index")===e.toString()}))},i.prototype.getColumnModelByIndex=function(e){return this.displayedColumns[Number(e)]},i.prototype.getMaxRangeByIndex=function(e){var t=this.columnElementRefs.find((function(t){return t.nativeElement.getAttribute("sky-cmp-index")===e})).nativeElement.querySelector(".sky-grid-column-input-aria-only");return Number(t.max)},i.prototype.getLastDisplayedColumn=function(){return this.getColumnModelByIndex(this.displayedColumns.length-1)},i.prototype.addDelimeter=function(e,t){return e.filter((function(e){return e})).join(t)},i.prototype.destroyRowDelete=function(e){var t=this.rowDeleteContents[e];t&&(t.affixer.destroy(),this.overlayService.close(t.overlay),delete this.rowDeleteContents[e])},i.prototype.emitSelectedRows=function(e){var t={selectedRowIds:this.getSelectedRows(),source:e};this.multiselectSelectionChange.emit(t)},i.prototype.getSelectedRows=function(){var e=this;return this.items.filter((function(e){return e.isSelected})).map((function(t){return t.data.hasOwnProperty(e.multiselectRowId)?t.data[e.multiselectRowId]:t.id}))},i.prototype.isInteractiveElement=function(e){return e.target.closest("\n a,\n button,\n input,\n label,\n option,\n select,\n textarea,\n details,\n dialog,\n menu,\n menuitem,\n summary")},i.prototype.setResizeBarPosition=function(e){var t=this.tableContainerElementRef.nativeElement.scrollLeft,i=e-this.tableElementRef.nativeElement.getBoundingClientRect().left-t;this.gridAdapter.setStyle(this.resizeBar,"left",i+"px")},i.prototype.applyUserConfig=function(){var e=this;return new Promise((function(t){e.uiConfigService.getConfig(e.settingsKey).pipe(h.take(1)).subscribe((function(i){if(i&&i.selectedColumnIds){var n=i.selectedColumnIds.filter((function(t){return e.columns.find((function(e){return e.id===t}))}));e.selectedColumnIds=n,e.changeDetector.markForCheck()}t()}),(function(){t()}))}))},i.prototype.setUserConfig=function(e){this.settingsKey&&this.uiConfigService.setConfig(this.settingsKey,e).pipe(h.takeUntil(this.ngUnsubscribe)).subscribe((function(){}),(function(e){console.warn("Could not save grid settings."),console.warn(e)}))},i.prototype.initColumns=function(){var e=this;0===this.columnComponents.length&&void 0===this.columns||(this.columnComponents.length>0&&this.getColumnsFromComponent(),this.transformData(),this.setDisplayedColumns(!0),this.changeDetector.markForCheck()),this.subscriptions.push(this.columnComponents.changes.subscribe((function(){return e.updateColumns()}))),this.columnComponents.forEach((function(t){e.subscriptions.push(t.headingModelChanges.subscribe((function(t){e.updateColumnHeading(t)}))),e.subscriptions.push(t.descriptionModelChanges.subscribe((function(t){e.updateColumnDescription(t)}))),e.subscriptions.push(t.inlineHelpPopoverModelChanges.subscribe((function(t){e.updateInlineHelpPopover(t)})))}))},i.prototype.arraysEqual=function(e,t){return e.length===t.length&&e.every((function(e,i){return e===t[i]}))},i.ctorParameters=function(){return[{type:r.SkyAffixService},{type:t.ChangeDetectorRef},{type:o.DragulaService},{type:w},{type:r.SkyOverlayService},{type:r.SkyAppWindowRef},{type:r.SkyUIConfigService}]},y([t.Input()],i.prototype,"columns",void 0),y([t.Input()],i.prototype,"data",void 0),y([t.Input()],i.prototype,"enableMultiselect",void 0),y([t.Input()],i.prototype,"fit",void 0),y([t.Input()],i.prototype,"hasToolbar",void 0),y([t.Input()],i.prototype,"height",void 0),y([t.Input()],i.prototype,"highlightText",void 0),y([t.Input()],i.prototype,"messageStream",void 0),y([t.Input()],i.prototype,"multiselectRowId",void 0),y([t.Input()],i.prototype,"rowHighlightedId",void 0),y([t.Input()],i.prototype,"selectedColumnIds",null),y([t.Input()],i.prototype,"selectedRowIds",null),y([t.Input()],i.prototype,"settingsKey",void 0),y([t.Input()],i.prototype,"sortField",void 0),y([t.Input()],i.prototype,"width",void 0),y([t.Output()],i.prototype,"columnWidthChange",void 0),y([t.Output()],i.prototype,"multiselectSelectionChange",void 0),y([t.Output()],i.prototype,"rowDeleteCancel",void 0),y([t.Output()],i.prototype,"rowDeleteConfirm",void 0),y([t.Output()],i.prototype,"selectedColumnIdsChange",void 0),y([t.Output()],i.prototype,"sortFieldChange",void 0),y([t.ContentChildren(C)],i.prototype,"columnComponents",void 0),y([t.ViewChildren("gridCol")],i.prototype,"columnElementRefs",void 0),y([t.ViewChildren("colSizeRange")],i.prototype,"columnRangeInputElementRefs",void 0),y([t.ViewChildren("inlineDeleteRef")],i.prototype,"inlineDeleteRefs",void 0),y([t.ViewChild("inlineDeleteTemplateRef",{read:t.TemplateRef})],i.prototype,"inlineDeleteTemplateRef",void 0),y([t.ViewChild("gridContainer")],i.prototype,"tableContainerElementRef",void 0),y([t.ViewChild("gridTable")],i.prototype,"tableElementRef",void 0),y([t.ViewChild("topScrollContainer")],i.prototype,"topScrollContainerElementRef",void 0),y([t.ViewChild("resizeBar")],i.prototype,"resizeBar",void 0),y([t.HostListener("window:resize")],i.prototype,"onWindowResize",null),i=y([t.Component({selector:"sky-grid",template:'<div class="sky-grid">\n <div *ngIf="showTopScroll"\n class="sky-grid-top-scroll-container"\n (scroll)="onTopScroll($event)"\n #topScrollContainer\n >\n <div\n class="sky-grid-top-scroll"\n [style.width.px]="getTopScrollWidth()"\n ></div>\n </div>\n <div\n class="sky-grid-table-container"\n [style.height.px]="height"\n [style.width.px]="width"\n (scroll)="onGridScroll($event)"\n #gridContainer\n >\n <table\n class="sky-grid-table"\n [ngClass]="getTableClassNames()"\n #gridTable>\n <thead>\n <tr dragula="sky-grid-heading">\n <th *ngIf="enableMultiselect"\n class="sky-grid-heading sky-grid-multiselect-cell sky-grid-header-locked"\n scope="col"\n [style.max-width.px]="minColWidth"\n [style.width.px]="minColWidth"\n >\n <span class="screen-reader-only">\n {{ \'skyux_grid_multiselect_select_row\' | skyLibResources }}\n </span>\n </th>\n <th *ngFor="let column of displayedColumns; let last = last, let i = index"\n class="sky-grid-heading sky-field-label"\n scope="col"\n [attr.sky-cmp-index]="i"\n [attr.sky-cmp-id]="column.id || column.field"\n [attr.aria-sort]="getAriaSortDirection(column) | async"\n [id]="\'sky-grid-\' + gridId + \'-column-\' + i"\n [ngClass]="\'sky-grid-column-alignment-\' + column.alignment"\n [style.max-width.px]="column.width"\n [style.width.px]="column.width"\n [tabIndex]="column.isSortable ? 0 : -1"\n (mouseup)="sortByColumn(column)"\n (keydown)="onKeydown($event, column)"\n (touchmove)="onTouchMove($event)"\n #gridCol\n >\n <div\n class="overflow"\n [ngClass]="getTableHeaderClassNames(column)"\n [style.max-width.px]="column.width - 1"\n [style.width.px]="column.width - 1"\n >\n <span *ngIf="(getCaretVisibility(column.field) | async) === \'hidden\'"\n class="sky-grid-header-caret-hidden-spacing"\n ></span>\n \x3c!-- The no spacing here is intentional to avoid extra spaces due to these being inline elements --\x3e\n <span\n class="sky-grid-header-text"\n >{{column.heading?.trim()}}</span>\n <sky-icon\n class="sky-grid-heading-sort"\n [ngClass]="\'sky-grid-heading-sort-\' + (getCaretVisibility(column.field) | async)"\n [icon]="getCaretIconNames(column)"\n >\n </sky-icon>\n <sky-help-inline *ngIf="column.inlineHelpPopover"\n [ngClass]="{\n \'sky-grid-help-inline-sort-hidden\' : getHelpInlineClass(column.field) | async\n }"\n [skyPopover]="column.inlineHelpPopover"\n (keydown.enter)="$event.stopPropagation()"\n (keydown.space)="$event.stopPropagation()"\n (mousedown)="$event.stopPropagation()"\n (mouseup)="$event.stopPropagation()"\n >\n </sky-help-inline>\n </div>\n <span\n *ngIf="(fit===\'width\' && !last) || (fit===\'scroll\')"\n aria-hidden="true"\n class="sky-grid-resize-handle"\n tabindex="-1"\n [attr.sky-cmp-index]="i"\n (mousedown)="onResizeColumnStart($event)"\n (touchstart)="onResizeColumnStart($event)"\n >\n </span>\n <input\n aria-label="Width of column"\n class="sky-grid-column-input-aria-only"\n role="slider"\n type="range"\n [attr.aria-controls]="\'sky-grid-\' + gridId + \'-column-\' + i"\n [attr.aria-valuemin]="minColWidth"\n [attr.aria-valuemax]="maxColWidth"\n [attr.aria-valuenow]="column.width"\n [attr.sky-cmp-index]="i"\n [min]="minColWidth"\n [max]="maxColWidth"\n [step]="columnResizeStep"\n [(ngModel)]="column.width"\n (blur)="onResizeHandleBlur($event)"\n (focus)="onResizeHandleFocus($event)"\n (keydown)="onKeydownResizeCol($event)"\n (change)="onInputChangeResizeCol($event)"\n #colSizeRange />\n </th>\n </tr>\n </thead>\n <tbody class="sky-grid-tbody">\n <tr\n class="sky-grid-row"\n *ngFor="let item of items; let i = index"\n [attr.aria-current]="isRowHighlighted(item.id) ? true : null"\n [attr.aria-selected]="item.isSelected"\n [attr.sky-cmp-id]="item.id"\n [ngClass]="{\n \'sky-grid-multiselect-selected-row\' : item.isSelected,\n \'sky-grid-multiselect-row\' : enableMultiselect,\n \'sky-grid-row-highlight\' : isRowHighlighted(item.id)\n }"\n (click)="onRowClick($event, item)"\n >\n <td *ngIf="enableMultiselect"\n class="sky-grid-multiselect-cell sky-grid-header-locked"\n >\n <div\n [style.max-width.px]="minColWidth"\n [style.width.px]="minColWidth"\n >\n <sky-checkbox\n [label]="\'skyux_grid_multiselect_select_row\' | skyLibResources"\n (change)="onMultiselectCheckboxChange()"\n [(ngModel)]="item.isSelected"\n >\n </sky-checkbox>\n </div>\n </td>\n <td *ngFor="let column of displayedColumns; let last = last; let i = index"\n class="sky-grid-cell"\n [ngClass]="\'sky-grid-column-alignment-\' + column.alignment"\n [style.max-width.px]="column.width"\n [style.width.px]="column.width"\n >\n <sky-grid-cell\n [skyHighlight]="!column.excludeFromHighlighting ? highlightText : undefined"\n [template]="column.template || defaultCellTemplate"\n [fieldSelector]="column.field"\n [item]="item"\n [columnId]="column.id"\n [attr.sky-cmp-id]="column.id || column.field">\n </sky-grid-cell>\n </td>\n </tr>\n </tbody>\n </table>\n <div *ngIf="showResizeBar"\n aria-hidden="true"\n id="sky-grid-resize-bar"\n tabindex="-1"\n #resizeBar\n >\n </div>\n </div>\n</div>\n\n<ng-template #defaultCellTemplate let-row="row" let-value="value">{{value}}</ng-template>\n\n<ng-template\n let-item\n #inlineDeleteTemplateRef\n>\n <div\n [id]="\'row-delete-ref-\' + item.id"\n [ngStyle]=\'{\n "height": getRowHeight(0),\n "position": "fixed",\n "width": tableWidth + "px"\n }\'\n #inlineDeleteRef\n >\n <sky-inline-delete\n [pending]="getRowDeleteItem(item.id).pending"\n (cancelTriggered)="cancelRowDelete(item.id)"\n (deleteTriggered)="confirmRowDelete(item.id)"\n ></sky-inline-delete>\n </div>\n</ng-template>\n',viewProviders:[o.DragulaService],providers:[w],changeDetection:t.ChangeDetectionStrategy.OnPush,styles:['.sky-grid{position:relative;display:block}.sky-grid-table-container{overflow:auto}.sky-grid-table{position:relative;table-layout:fixed;border-collapse:collapse;margin:0;font-size:15px;min-width:100%}.sky-grid-table.sky-grid-fit{max-width:100%;width:100%}.sky-grid-tbody{background-color:#fff}.sky-grid-row{border-bottom:1px dotted #cdcfd2}.sky-grid-row:nth-child(odd){background-color:#fbfbfb}.sky-grid-row.sky-grid-row-highlight{border-top:1px solid #0974a1;box-shadow:0 0 0 3px inset #0974a1}.sky-grid-row .sky-grid-cell{padding:0;min-width:10px}.sky-grid-heading{position:relative;border-top:1px solid #cdcfd2;border-bottom:1px solid #cdcfd2;border-left:1px solid #cdcfd2;border-right:0 solid #cdcfd2;padding:0;cursor:pointer;background-color:#fff;overflow:visible;background-clip:padding-box;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;-moz-user-select:none;-ms-user-select:none;user-select:none}.sky-grid-heading:first-child{border-left:1px solid transparent}.sky-grid-heading.sky-grid-header-dragging{background-color:#eeeeef}.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-heading-sort,.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-heading-sort{width:14px}.sky-grid-heading.sky-grid-column-alignment-center .sky-grid-help-inline-sort-hidden,.sky-grid-heading.sky-grid-column-alignment-left .sky-grid-help-inline-sort-hidden{margin-left:-14px;margin-right:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-header-caret-hidden-spacing{padding-left:14px}.sky-grid-heading.sky-grid-column-alignment-right .sky-grid-heading-sort-visible{width:14px}.sky-grid-heading div{padding:8px}.sky-grid-heading .overflow{text-overflow:ellipsis;white-space:nowrap;position:relative;z-index:1;overflow:hidden;min-width:100%}.sky-grid-heading .sky-grid-column-input-aria-only{-webkit-appearance:none;-moz-appearance:none;height:100%;width:5px;position:absolute;display:block;top:0;bottom:0;right:0}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-track{background:0 0}.sky-grid-heading .sky-grid-column-input-aria-only::-moz-range-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-ms-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only::-webkit-slider-thumb{-webkit-appearance:none;-moz-appearance:none;width:0;height:0;border-radius:0;border:0;background:0 0;display:none}.sky-grid-heading .sky-grid-column-input-aria-only:focus{background-color:#00b4f1}.sky-grid-column-alignment-left{text-align:left}.sky-grid-column-alignment-center{text-align:center}.sky-grid-column-alignment-right{text-align:right}.sky-grid-multiselect-cell{padding:0;text-align:center}.sky-grid-multiselect-cell ::ng-deep.sky-switch-control{margin:0 auto}th.sky-grid-multiselect-cell{cursor:default}th.sky-grid-multiselect-cell .screen-reader-only{width:0;height:0;padding:0;opacity:0;position:absolute;margin:-1px;border:0;overflow:hidden;clip:rect(0,0,0,0);outline:0;white-space:nowrap}@-moz-document url-prefix(){.sky-grid-multiselect-row td{border-left:0 solid transparent;border-right:0 solid transparent}}.sky-grid-multiselect-row:hover{background-color:#e9e4f1}.sky-grid-multiselect-row:hover:nth-child(odd){background:#e9e4f1}.sky-grid-multiselect-selected-row{background:#f1eef6;border-top:1px solid #dadbf6;border-bottom:1px solid #dadbf6}.sky-grid-multiselect-selected-row:nth-child(odd){background:#f1eef6}.sky-grid-has-toolbar .sky-grid-heading{border-top-width:0}.sky-grid-heading-sort.sky-grid-heading-sort-hidden{visibility:hidden}.sky-grid-heading-sort.sky-grid-heading-sort-visible{visibility:visible;padding-left:5px}.sky-grid-resize-handle{position:absolute;right:0;top:0;bottom:0;width:30px;z-index:2;min-height:20px;height:100%!important;vertical-align:middle;cursor:col-resize}.sky-grid-resize-handle:hover::after{background-color:#00b4f1}.sky-grid-resize-handle:after{position:absolute;right:0;top:0;bottom:0;width:5px;height:100%;content:""}#sky-grid-resize-bar{position:absolute;top:0;left:0;z-index:99;height:100%;width:5px;background:#00b4f1;opacity:.6}tr{position:relative}.sky-grid-top-scroll-container{overflow:auto}.sky-grid-top-scroll{height:1px}']})],i)}(),R=function(){function e(){}return e.prototype.ngOnInit=function(){this.container.createEmbeddedView(this.template,this)},Object.defineProperty(e.prototype,"row",{get:function(){return this.item.data},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){if(this.item.data&&(this.fieldSelector||this.columnId))return u.getData(this.item.data,this.fieldSelector||this.columnId)},enumerable:!0,configurable:!0}),y([t.Input()],e.prototype,"item",void 0),y([t.Input()],e.prototype,"columnId",void 0),y([t.Input()],e.prototype,"template",void 0),y([t.Input()],e.prototype,"fieldSelector",void 0),y([t.ViewChild("cell",{read:t.ViewContainerRef,static:!0})],e.prototype,"container",void 0),e=y([t.Component({selector:"sky-grid-cell",template:"<ng-template #cell></ng-template>",changeDetection:t.ChangeDetectionStrategy.OnPush,styles:[":host{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:8px;min-height:35px}"]})],e)}(),x=function(){function e(){this.resources={"EN-US":{skyux_grid_multiselect_select_row:"Select row"}}}return e.prototype.getString=function(e,t){return p.getStringForLocale(this.resources,e.locale,t)},e=y([t.Injectable()],e)}(),I=function(){function e(){}return e=y([t.NgModule({exports:[p.SkyI18nModule],providers:[{provide:p.SKY_LIB_RESOURCES_PROVIDERS,useClass:x,multi:!0}]})],e)}(),D=function(){function e(){}return e=y([t.NgModule({declarations:[S,C,R],imports:[i.CommonModule,o.DragulaModule,n.FormsModule,r.SkyAffixModule,s.SkyCheckboxModule,I,l.SkyHelpInlineModule,l.SkyIconModule,d.SkyInlineDeleteModule,r.SkyOverlayModule,a.SkyPopoverModule,l.SkyTextHighlightModule],exports:[S,C,R],providers:[r.SkyAppWindowRef,r.SkyUIConfigService]})],e)}();e.SkyGridColumnComponent=C,e.SkyGridColumnModel=k,e.SkyGridComponent=S,e.SkyGridModule=D,e.ɵa=w,e.ɵb=R,e.ɵc=I,e.ɵd=x,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
|
-
//# sourceMappingURL=skyux-grids.umd.min.js.map
|