angular-slickgrid 4.2.0 → 4.2.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/{dist/angular-slickgrid.d.ts → angular-slickgrid.d.ts} +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/constants.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/extensions/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/global-grid-options.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/angularComponentOutput.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/angularGridInstance.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/externalTestingDependencies.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/gridOption.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/rowDetailView.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/models/slickGrid.interface.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/modules/angular-slickgrid.module.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/angularUtil.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/bsDropdown.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/container.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/index.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/translater.service.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/services/utilities.d.ts +0 -0
- package/{dist/app → app}/modules/angular-slickgrid/slickgrid-config.d.ts +0 -0
- package/docs/assets/lib/multiple-select/README.md +17 -0
- package/{dist/esm2020 → esm2020}/angular-slickgrid.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/constants.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/global-grid-options.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/gridOption.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/angularUtil.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/container.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/index.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/translater.service.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/services/utilities.mjs +0 -0
- package/{dist/esm2020 → esm2020}/app/modules/angular-slickgrid/slickgrid-config.mjs +0 -0
- package/{dist/esm2020 → esm2020}/public_api.mjs +0 -0
- package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs +0 -0
- package/{dist/fesm2015 → fesm2015}/angular-slickgrid.mjs.map +0 -0
- package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs +0 -0
- package/{dist/fesm2020 → fesm2020}/angular-slickgrid.mjs.map +0 -0
- package/{dist/i18n → i18n}/en.json +0 -0
- package/{dist/i18n → i18n}/fr.json +0 -0
- package/package.json +25 -110
- package/{dist/public_api.d.ts → public_api.d.ts} +0 -0
- package/.browserslistrc +0 -12
- package/.codecov.yml +0 -17
- package/.editorconfig +0 -18
- package/.eslintrc.json +0 -50
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/FUNDING.yml +0 -8
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -54
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -44
- package/.github/renovate.json5 +0 -26
- package/.github/stale.yml +0 -7
- package/.github/workflows/main.yml +0 -83
- package/.vscode/extensions.json +0 -9
- package/.vscode/launch.json +0 -72
- package/.vscode/settings.json +0 -7
- package/.vscode/tasks.json +0 -77
- package/CHANGELOG.md +0 -1172
- package/angular.json +0 -148
- package/dist/LICENSE +0 -20
- package/dist/README.md +0 -182
- package/dist/package.json +0 -79
- package/global.d.ts +0 -1
- package/ngcc.config.js +0 -13
- package/screenshots/column-picker.png +0 -0
- package/screenshots/composite-editor.png +0 -0
- package/screenshots/draggable-grouping.png +0 -0
- package/screenshots/editors.png +0 -0
- package/screenshots/export-to-file.png +0 -0
- package/screenshots/filter_and_sort.png +0 -0
- package/screenshots/formatters.png +0 -0
- package/screenshots/frozen.png +0 -0
- package/screenshots/multipleSelectFilter.png +0 -0
- package/screenshots/pagination.png +0 -0
- package/screenshots/selectFilter.png +0 -0
- package/screenshots/singleFilter.png +0 -0
- package/src/app/app-routing.module.ts +0 -83
- package/src/app/app.component.html +0 -160
- package/src/app/app.component.scss +0 -65
- package/src/app/app.component.ts +0 -10
- package/src/app/app.module.ts +0 -175
- package/src/app/examples/custom-angularComponentEditor.ts +0 -184
- package/src/app/examples/custom-angularComponentFilter.ts +0 -126
- package/src/app/examples/custom-inputEditor.ts +0 -124
- package/src/app/examples/custom-inputFilter.ts +0 -142
- package/src/app/examples/custom-titleFormatter.component.ts +0 -8
- package/src/app/examples/editor-ng-select.component.ts +0 -37
- package/src/app/examples/filter-ng-select.component.ts +0 -32
- package/src/app/examples/grid-additem.component.html +0 -48
- package/src/app/examples/grid-additem.component.ts +0 -272
- package/src/app/examples/grid-angular.component.html +0 -79
- package/src/app/examples/grid-angular.component.scss +0 -28
- package/src/app/examples/grid-angular.component.ts +0 -370
- package/src/app/examples/grid-autoheight.component.html +0 -52
- package/src/app/examples/grid-autoheight.component.ts +0 -147
- package/src/app/examples/grid-basic.component.html +0 -29
- package/src/app/examples/grid-basic.component.ts +0 -82
- package/src/app/examples/grid-clientside.component.html +0 -51
- package/src/app/examples/grid-clientside.component.ts +0 -293
- package/src/app/examples/grid-colspan.component.html +0 -39
- package/src/app/examples/grid-colspan.component.scss +0 -11
- package/src/app/examples/grid-colspan.component.ts +0 -155
- package/src/app/examples/grid-composite-editor.component.html +0 -79
- package/src/app/examples/grid-composite-editor.component.scss +0 -19
- package/src/app/examples/grid-composite-editor.component.ts +0 -948
- package/src/app/examples/grid-contextmenu.component.html +0 -62
- package/src/app/examples/grid-contextmenu.component.scss +0 -44
- package/src/app/examples/grid-contextmenu.component.ts +0 -473
- package/src/app/examples/grid-custom-tooltip.component.html +0 -25
- package/src/app/examples/grid-custom-tooltip.component.scss +0 -77
- package/src/app/examples/grid-custom-tooltip.component.ts +0 -483
- package/src/app/examples/grid-draggrouping.component.html +0 -93
- package/src/app/examples/grid-draggrouping.component.ts +0 -397
- package/src/app/examples/grid-editor.component.html +0 -88
- package/src/app/examples/grid-editor.component.ts +0 -699
- package/src/app/examples/grid-formatter.component.html +0 -26
- package/src/app/examples/grid-formatter.component.ts +0 -162
- package/src/app/examples/grid-frozen.component.html +0 -65
- package/src/app/examples/grid-frozen.component.scss +0 -11
- package/src/app/examples/grid-frozen.component.ts +0 -303
- package/src/app/examples/grid-graphql-nopage.component.html +0 -33
- package/src/app/examples/grid-graphql-nopage.component.scss +0 -9
- package/src/app/examples/grid-graphql-nopage.component.ts +0 -242
- package/src/app/examples/grid-graphql.component.html +0 -87
- package/src/app/examples/grid-graphql.component.ts +0 -304
- package/src/app/examples/grid-grouping.component.html +0 -80
- package/src/app/examples/grid-grouping.component.ts +0 -313
- package/src/app/examples/grid-headerbutton.component.html +0 -31
- package/src/app/examples/grid-headerbutton.component.scss +0 -10
- package/src/app/examples/grid-headerbutton.component.ts +0 -233
- package/src/app/examples/grid-headermenu.component.html +0 -31
- package/src/app/examples/grid-headermenu.component.scss +0 -25
- package/src/app/examples/grid-headermenu.component.ts +0 -159
- package/src/app/examples/grid-localization.component.html +0 -54
- package/src/app/examples/grid-localization.component.ts +0 -293
- package/src/app/examples/grid-menu.component.html +0 -37
- package/src/app/examples/grid-menu.component.scss +0 -28
- package/src/app/examples/grid-menu.component.ts +0 -229
- package/src/app/examples/grid-odata.component.html +0 -116
- package/src/app/examples/grid-odata.component.ts +0 -441
- package/src/app/examples/grid-range.component.html +0 -74
- package/src/app/examples/grid-range.component.ts +0 -291
- package/src/app/examples/grid-remote.component.html +0 -37
- package/src/app/examples/grid-remote.component.ts +0 -153
- package/src/app/examples/grid-resize-by-content.component.html +0 -62
- package/src/app/examples/grid-resize-by-content.component.scss +0 -19
- package/src/app/examples/grid-resize-by-content.component.ts +0 -780
- package/src/app/examples/grid-rowdetail.component.html +0 -35
- package/src/app/examples/grid-rowdetail.component.ts +0 -205
- package/src/app/examples/grid-rowmove.component.html +0 -49
- package/src/app/examples/grid-rowmove.component.ts +0 -234
- package/src/app/examples/grid-rowselection.component.html +0 -76
- package/src/app/examples/grid-rowselection.component.ts +0 -267
- package/src/app/examples/grid-state.component.html +0 -36
- package/src/app/examples/grid-state.component.ts +0 -259
- package/src/app/examples/grid-tabs.component.html +0 -35
- package/src/app/examples/grid-tabs.component.ts +0 -115
- package/src/app/examples/grid-trading.component.html +0 -58
- package/src/app/examples/grid-trading.component.scss +0 -49
- package/src/app/examples/grid-trading.component.ts +0 -319
- package/src/app/examples/grid-tree-data-hierarchical.component.html +0 -79
- package/src/app/examples/grid-tree-data-hierarchical.component.scss +0 -47
- package/src/app/examples/grid-tree-data-hierarchical.component.ts +0 -311
- package/src/app/examples/grid-tree-data-parent-child.component.html +0 -108
- package/src/app/examples/grid-tree-data-parent-child.component.scss +0 -10
- package/src/app/examples/grid-tree-data-parent-child.component.ts +0 -351
- package/src/app/examples/home.component.html +0 -41
- package/src/app/examples/home.component.ts +0 -9
- package/src/app/examples/rowdetail-preload.component.ts +0 -10
- package/src/app/examples/rowdetail-view.component.html +0 -36
- package/src/app/examples/rowdetail-view.component.ts +0 -54
- package/src/app/examples/swt-common-grid-pagination.component.ts +0 -156
- package/src/app/examples/swt-common-grid-test.component.html +0 -30
- package/src/app/examples/swt-common-grid-test.component.ts +0 -219
- package/src/app/examples/swt-common-grid.component.ts +0 -436
- package/src/app/examples/swt-logger.service.ts +0 -165
- package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.html +0 -4
- package/src/app/modules/angular-slickgrid/components/angular-slickgrid.component.ts +0 -1395
- package/src/app/modules/angular-slickgrid/constants.ts +0 -97
- package/src/app/modules/angular-slickgrid/extensions/index.ts +0 -1
- package/src/app/modules/angular-slickgrid/extensions/slickRowDetailView.ts +0 -375
- package/src/app/modules/angular-slickgrid/global-grid-options.ts +0 -245
- package/src/app/modules/angular-slickgrid/index.ts +0 -11
- package/src/app/modules/angular-slickgrid/models/angularComponentOutput.interface.ts +0 -6
- package/src/app/modules/angular-slickgrid/models/angularGridInstance.interface.ts +0 -68
- package/src/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.ts +0 -37
- package/src/app/modules/angular-slickgrid/models/gridOption.interface.ts +0 -12
- package/src/app/modules/angular-slickgrid/models/index.ts +0 -6
- package/src/app/modules/angular-slickgrid/models/rowDetailView.interface.ts +0 -33
- package/src/app/modules/angular-slickgrid/models/slickGrid.interface.ts +0 -7
- package/src/app/modules/angular-slickgrid/modules/angular-slickgrid.module.ts +0 -37
- package/src/app/modules/angular-slickgrid/services/angularUtil.service.ts +0 -48
- package/src/app/modules/angular-slickgrid/services/bsDropdown.service.ts +0 -142
- package/src/app/modules/angular-slickgrid/services/container.service.ts +0 -24
- package/src/app/modules/angular-slickgrid/services/index.ts +0 -5
- package/src/app/modules/angular-slickgrid/services/translater.service.ts +0 -38
- package/src/app/modules/angular-slickgrid/services/utilities.ts +0 -19
- package/src/app/modules/angular-slickgrid/slickgrid-config.ts +0 -10
- package/src/app/slickgrid-custom-variables.scss +0 -10
- package/src/assets/.gitkeep +0 -0
- package/src/assets/data/collection_100_numbers.json +0 -12
- package/src/assets/data/collection_500_numbers.json +0 -52
- package/src/assets/data/countries.json +0 -245
- package/src/assets/data/country_names.json +0 -245
- package/src/assets/data/customers_100.json +0 -102
- package/src/assets/i18n/en.json +0 -90
- package/src/assets/i18n/fr.json +0 -91
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -8
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -18
- package/src/main.ts +0 -13
- package/src/polyfills.ts +0 -52
- package/src/public_api.ts +0 -1
- package/src/styles.scss +0 -66
- package/src/typings.d.ts +0 -10
- package/tsconfig.app.json +0 -25
- package/tsconfig.json +0 -40
- package/tsconfig.spec.json +0 -23
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { Column, DelimiterType, EventNamingStyle, FileType, Filters, GridAutosizeColsMode, OperatorType, TreeDataOption } from '@slickgrid-universal/common';
|
|
2
|
-
import { GridOption, RowDetailView } from './models/index';
|
|
3
|
-
|
|
4
|
-
/** Global Grid Options Defaults */
|
|
5
|
-
export const GlobalGridOptions: Partial<GridOption> = {
|
|
6
|
-
alwaysShowVerticalScroll: true,
|
|
7
|
-
autoEdit: false,
|
|
8
|
-
asyncEditorLoading: false,
|
|
9
|
-
autoFitColumnsOnFirstLoad: true,
|
|
10
|
-
autoResize: {
|
|
11
|
-
applyResizeToContainer: true,
|
|
12
|
-
calculateAvailableSizeBy: 'window',
|
|
13
|
-
bottomPadding: 20,
|
|
14
|
-
minHeight: 180,
|
|
15
|
-
minWidth: 300,
|
|
16
|
-
rightPadding: 0
|
|
17
|
-
},
|
|
18
|
-
cellHighlightCssClass: 'slick-cell-modified',
|
|
19
|
-
checkboxSelector: {
|
|
20
|
-
cssClass: 'slick-cell-checkboxsel'
|
|
21
|
-
},
|
|
22
|
-
columnPicker: {
|
|
23
|
-
fadeSpeed: 0,
|
|
24
|
-
hideForceFitButton: false,
|
|
25
|
-
hideSyncResizeButton: true,
|
|
26
|
-
headerColumnValueExtractor: pickerHeaderColumnValueExtractor
|
|
27
|
-
},
|
|
28
|
-
cellMenu: {
|
|
29
|
-
autoAdjustDrop: true,
|
|
30
|
-
autoAlignSide: true,
|
|
31
|
-
hideCloseButton: true,
|
|
32
|
-
hideCommandSection: false,
|
|
33
|
-
hideOptionSection: false,
|
|
34
|
-
},
|
|
35
|
-
contextMenu: {
|
|
36
|
-
autoAdjustDrop: true,
|
|
37
|
-
autoAlignSide: true,
|
|
38
|
-
hideCloseButton: true,
|
|
39
|
-
hideClearAllGrouping: false,
|
|
40
|
-
hideCollapseAllGroups: false,
|
|
41
|
-
hideCommandSection: false,
|
|
42
|
-
hideCopyCellValueCommand: false,
|
|
43
|
-
hideExpandAllGroups: false,
|
|
44
|
-
hideExportCsvCommand: false,
|
|
45
|
-
hideExportExcelCommand: false,
|
|
46
|
-
hideExportTextDelimitedCommand: true,
|
|
47
|
-
hideMenuOnScroll: true,
|
|
48
|
-
hideOptionSection: false,
|
|
49
|
-
iconCopyCellValueCommand: 'fa fa-clone',
|
|
50
|
-
iconExportCsvCommand: 'fa fa-download',
|
|
51
|
-
iconExportExcelCommand: 'fa fa-file-excel-o text-success',
|
|
52
|
-
iconExportTextDelimitedCommand: 'fa fa-download',
|
|
53
|
-
},
|
|
54
|
-
customFooterOptions: {
|
|
55
|
-
dateFormat: 'YYYY-MM-DD, hh:mm a',
|
|
56
|
-
hideRowSelectionCount: false,
|
|
57
|
-
hideTotalItemCount: false,
|
|
58
|
-
hideLastUpdateTimestamp: true,
|
|
59
|
-
footerHeight: 25,
|
|
60
|
-
leftContainerClass: 'col-xs-12 col-sm-5',
|
|
61
|
-
rightContainerClass: 'col-xs-6 col-sm-7',
|
|
62
|
-
metricSeparator: '|',
|
|
63
|
-
metricTexts: {
|
|
64
|
-
items: 'items',
|
|
65
|
-
itemsKey: 'ITEMS',
|
|
66
|
-
itemsSelected: 'items selected',
|
|
67
|
-
itemsSelectedKey: 'ITEMS_SELECTED',
|
|
68
|
-
of: 'of',
|
|
69
|
-
ofKey: 'OF',
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
dataView: {
|
|
73
|
-
syncGridSelection: true, // when enabled, this will preserve the row selection even after filtering/sorting/grouping
|
|
74
|
-
syncGridSelectionWithBackendService: false, // but disable it when using backend services
|
|
75
|
-
},
|
|
76
|
-
datasetIdPropertyName: 'id',
|
|
77
|
-
defaultFilter: Filters.input,
|
|
78
|
-
defaultBackendServiceFilterTypingDebounce: 500,
|
|
79
|
-
defaultColumnSortFieldId: 'id',
|
|
80
|
-
defaultFilterPlaceholder: '🔎︎',
|
|
81
|
-
defaultFilterRangeOperator: OperatorType.rangeInclusive,
|
|
82
|
-
editable: false,
|
|
83
|
-
enableAutoResize: true,
|
|
84
|
-
enableAutoSizeColumns: true,
|
|
85
|
-
enableCellNavigation: false,
|
|
86
|
-
enableColumnPicker: true,
|
|
87
|
-
enableColumnReorder: true,
|
|
88
|
-
enableColumnResizeOnDoubleClick: true,
|
|
89
|
-
enableContextMenu: true,
|
|
90
|
-
enableExcelExport: true, // Excel Export is the new default,
|
|
91
|
-
enableExport: false, // CSV/Text with Tab Delimited
|
|
92
|
-
enableFilterTrimWhiteSpace: false, // do we want to trim white spaces on all Filters?
|
|
93
|
-
enableGridMenu: true,
|
|
94
|
-
enableHeaderMenu: true,
|
|
95
|
-
enableEmptyDataWarningMessage: true,
|
|
96
|
-
emptyDataWarning: {
|
|
97
|
-
className: 'slick-empty-data-warning',
|
|
98
|
-
message: 'No data to display.',
|
|
99
|
-
messageKey: 'EMPTY_DATA_WARNING_MESSAGE',
|
|
100
|
-
hideFrozenLeftWarning: false,
|
|
101
|
-
hideFrozenRightWarning: false,
|
|
102
|
-
leftViewportMarginLeft: '40%',
|
|
103
|
-
rightViewportMarginLeft: '40%',
|
|
104
|
-
frozenLeftViewportMarginLeft: '0px',
|
|
105
|
-
frozenRightViewportMarginLeft: '40%',
|
|
106
|
-
},
|
|
107
|
-
enableMouseHoverHighlightRow: true,
|
|
108
|
-
enableSorting: true,
|
|
109
|
-
enableTextSelectionOnCells: true,
|
|
110
|
-
eventNamingStyle: EventNamingStyle.camelCase,
|
|
111
|
-
explicitInitialization: true,
|
|
112
|
-
excelExportOptions: {
|
|
113
|
-
addGroupIndentation: true,
|
|
114
|
-
exportWithFormatter: false,
|
|
115
|
-
filename: 'export',
|
|
116
|
-
format: FileType.xlsx,
|
|
117
|
-
groupingColumnHeaderTitle: 'Group By',
|
|
118
|
-
groupCollapsedSymbol: '⮞',
|
|
119
|
-
groupExpandedSymbol: '⮟',
|
|
120
|
-
groupingAggregatorRowText: '',
|
|
121
|
-
sanitizeDataExport: false,
|
|
122
|
-
},
|
|
123
|
-
exportOptions: {
|
|
124
|
-
delimiter: DelimiterType.comma,
|
|
125
|
-
exportWithFormatter: false,
|
|
126
|
-
filename: 'export',
|
|
127
|
-
format: FileType.csv,
|
|
128
|
-
groupingColumnHeaderTitle: 'Group By',
|
|
129
|
-
groupingAggregatorRowText: '',
|
|
130
|
-
sanitizeDataExport: false,
|
|
131
|
-
useUtf8WithBom: true
|
|
132
|
-
},
|
|
133
|
-
filterTypingDebounce: 0,
|
|
134
|
-
forceFitColumns: false,
|
|
135
|
-
frozenHeaderWidthCalcDifferential: 0,
|
|
136
|
-
gridMenu: {
|
|
137
|
-
dropSide: 'left',
|
|
138
|
-
commandLabels: {
|
|
139
|
-
clearAllFiltersCommandKey: 'CLEAR_ALL_FILTERS',
|
|
140
|
-
clearAllSortingCommandKey: 'CLEAR_ALL_SORTING',
|
|
141
|
-
clearFrozenColumnsCommandKey: 'CLEAR_PINNING',
|
|
142
|
-
exportCsvCommandKey: 'EXPORT_TO_CSV',
|
|
143
|
-
exportExcelCommandKey: 'EXPORT_TO_EXCEL',
|
|
144
|
-
exportTextDelimitedCommandKey: 'EXPORT_TO_TAB_DELIMITED',
|
|
145
|
-
refreshDatasetCommandKey: 'REFRESH_DATASET',
|
|
146
|
-
toggleFilterCommandKey: 'TOGGLE_FILTER_ROW',
|
|
147
|
-
togglePreHeaderCommandKey: 'TOGGLE_PRE_HEADER_ROW',
|
|
148
|
-
},
|
|
149
|
-
hideClearAllFiltersCommand: false,
|
|
150
|
-
hideClearAllSortingCommand: false,
|
|
151
|
-
hideClearFrozenColumnsCommand: true, // opt-in command
|
|
152
|
-
hideExportCsvCommand: false,
|
|
153
|
-
hideExportExcelCommand: false,
|
|
154
|
-
hideExportTextDelimitedCommand: true,
|
|
155
|
-
hideForceFitButton: false,
|
|
156
|
-
hideRefreshDatasetCommand: false,
|
|
157
|
-
hideSyncResizeButton: true,
|
|
158
|
-
hideToggleFilterCommand: false,
|
|
159
|
-
hideTogglePreHeaderCommand: false,
|
|
160
|
-
iconCssClass: 'fa fa-bars',
|
|
161
|
-
iconClearAllFiltersCommand: 'fa fa-filter text-danger',
|
|
162
|
-
iconClearAllSortingCommand: 'fa fa-unsorted text-danger',
|
|
163
|
-
iconClearFrozenColumnsCommand: 'fa fa-times',
|
|
164
|
-
iconExportCsvCommand: 'fa fa-download',
|
|
165
|
-
iconExportExcelCommand: 'fa fa-file-excel-o text-success',
|
|
166
|
-
iconExportTextDelimitedCommand: 'fa fa-download',
|
|
167
|
-
iconRefreshDatasetCommand: 'fa fa-refresh',
|
|
168
|
-
iconToggleFilterCommand: 'fa fa-random',
|
|
169
|
-
iconTogglePreHeaderCommand: 'fa fa-random',
|
|
170
|
-
menuWidth: 16,
|
|
171
|
-
resizeOnShowHeaderRow: true,
|
|
172
|
-
headerColumnValueExtractor: pickerHeaderColumnValueExtractor
|
|
173
|
-
},
|
|
174
|
-
headerMenu: {
|
|
175
|
-
autoAlign: true,
|
|
176
|
-
autoAlignOffset: 12,
|
|
177
|
-
minWidth: 140,
|
|
178
|
-
iconClearFilterCommand: 'fa fa-filter text-danger',
|
|
179
|
-
iconClearSortCommand: 'fa fa-unsorted',
|
|
180
|
-
iconFreezeColumns: 'fa fa-thumb-tack',
|
|
181
|
-
iconSortAscCommand: 'fa fa-sort-amount-asc',
|
|
182
|
-
iconSortDescCommand: 'fa fa-sort-amount-desc',
|
|
183
|
-
iconColumnHideCommand: 'fa fa-times',
|
|
184
|
-
iconColumnResizeByContentCommand: 'fa fa-arrows-h',
|
|
185
|
-
hideColumnResizeByContentCommand: false,
|
|
186
|
-
hideColumnHideCommand: false,
|
|
187
|
-
hideClearFilterCommand: false,
|
|
188
|
-
hideClearSortCommand: false,
|
|
189
|
-
hideFreezeColumnsCommand: true, // opt-in command
|
|
190
|
-
hideSortCommands: false
|
|
191
|
-
},
|
|
192
|
-
headerRowHeight: 35,
|
|
193
|
-
multiColumnSort: true,
|
|
194
|
-
numberedMultiColumnSort: true,
|
|
195
|
-
tristateMultiColumnSort: false,
|
|
196
|
-
sortColNumberInSeparateSpan: true,
|
|
197
|
-
suppressActiveCellChangeOnEdit: true,
|
|
198
|
-
pagination: {
|
|
199
|
-
pageSizes: [10, 15, 20, 25, 30, 40, 50, 75, 100],
|
|
200
|
-
pageSize: 25,
|
|
201
|
-
totalItems: 0
|
|
202
|
-
},
|
|
203
|
-
// technically speaking the Row Detail requires the process & viewComponent but we'll ignore it just to set certain options
|
|
204
|
-
rowDetailView: {
|
|
205
|
-
collapseAllOnSort: true,
|
|
206
|
-
cssClass: 'detail-view-toggle',
|
|
207
|
-
panelRows: 1,
|
|
208
|
-
keyPrefix: '__',
|
|
209
|
-
useRowClick: false,
|
|
210
|
-
useSimpleViewportCalc: true,
|
|
211
|
-
saveDetailViewOnScroll: false,
|
|
212
|
-
} as RowDetailView,
|
|
213
|
-
rowHeight: 35,
|
|
214
|
-
topPanelHeight: 35,
|
|
215
|
-
translationNamespaceSeparator: ':',
|
|
216
|
-
resetFilterSearchValueAfterOnBeforeCancellation: true,
|
|
217
|
-
resizeByContentOnlyOnFirstLoad: true,
|
|
218
|
-
resizeByContentOptions: {
|
|
219
|
-
alwaysRecalculateColumnWidth: false,
|
|
220
|
-
cellCharWidthInPx: 7.8,
|
|
221
|
-
cellPaddingWidthInPx: 14,
|
|
222
|
-
defaultRatioForStringType: 0.88,
|
|
223
|
-
formatterPaddingWidthInPx: 0,
|
|
224
|
-
maxItemToInspectCellContentWidth: 1000,
|
|
225
|
-
maxItemToInspectSingleColumnWidthByContent: 5000,
|
|
226
|
-
widthToRemoveFromExceededWidthReadjustment: 50,
|
|
227
|
-
},
|
|
228
|
-
treeDataOptions: {
|
|
229
|
-
exportIndentMarginLeft: 5,
|
|
230
|
-
exportIndentationLeadingChar: '͏͏͏͏͏͏͏͏͏·',
|
|
231
|
-
} as unknown as TreeDataOption
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Value Extractor for both ColumnPicker & GridMenu Picker
|
|
236
|
-
* when using Column Header Grouping, we'll prefix the column group title
|
|
237
|
-
* else we'll simply return the column name title
|
|
238
|
-
*/
|
|
239
|
-
function pickerHeaderColumnValueExtractor(column: Column) {
|
|
240
|
-
const headerGroup = column && column.columnGroup || '';
|
|
241
|
-
if (headerGroup) {
|
|
242
|
-
return headerGroup + ' - ' + column.name;
|
|
243
|
-
}
|
|
244
|
-
return column && column.name || '';
|
|
245
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from '@slickgrid-universal/common';
|
|
2
|
-
|
|
3
|
-
// Public classes.
|
|
4
|
-
export { AngularComponentOutput, AngularGridInstance, GridOption, SlickGrid, RowDetailView } from './models/index';
|
|
5
|
-
export { AngularUtilService, BsDropDownService, unsubscribeAllObservables } from './services/index';
|
|
6
|
-
export { SlickRowDetailView } from './extensions/index';
|
|
7
|
-
|
|
8
|
-
// components & module
|
|
9
|
-
export { SlickgridConfig } from './slickgrid-config';
|
|
10
|
-
export { AngularSlickgridComponent } from './components/angular-slickgrid.component';
|
|
11
|
-
export { AngularSlickgridModule } from './modules/angular-slickgrid.module';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BackendService,
|
|
3
|
-
ExtensionList,
|
|
4
|
-
ExtensionService,
|
|
5
|
-
FilterService,
|
|
6
|
-
GridEventService,
|
|
7
|
-
GridService,
|
|
8
|
-
GridStateService,
|
|
9
|
-
GroupingAndColspanService,
|
|
10
|
-
PaginationService,
|
|
11
|
-
ResizerService,
|
|
12
|
-
SlickDataView,
|
|
13
|
-
SlickGrid,
|
|
14
|
-
SortService,
|
|
15
|
-
TreeDataService
|
|
16
|
-
} from '@slickgrid-universal/common';
|
|
17
|
-
|
|
18
|
-
export interface AngularGridInstance {
|
|
19
|
-
/** Slick DataView object */
|
|
20
|
-
dataView: SlickDataView;
|
|
21
|
-
|
|
22
|
-
/** Slick Grid object */
|
|
23
|
-
slickGrid: SlickGrid;
|
|
24
|
-
|
|
25
|
-
/** SlickGrid extensions (external controls/plugins) */
|
|
26
|
-
extensions: ExtensionList<any>;
|
|
27
|
-
|
|
28
|
-
// --
|
|
29
|
-
// Methods
|
|
30
|
-
/** Dispose of the grid and optionally empty the DOM element grid container as well */
|
|
31
|
-
destroy: (emptyDomElementContainer?: boolean) => void;
|
|
32
|
-
|
|
33
|
-
// --
|
|
34
|
-
// Services
|
|
35
|
-
|
|
36
|
-
/** Backend Service, when available */
|
|
37
|
-
backendService?: BackendService;
|
|
38
|
-
|
|
39
|
-
/** Extension (Plugins & Controls) Service */
|
|
40
|
-
extensionService: ExtensionService;
|
|
41
|
-
|
|
42
|
-
/** Filter Service */
|
|
43
|
-
filterService: FilterService;
|
|
44
|
-
|
|
45
|
-
/** Grid Service (grid extra functionalities) */
|
|
46
|
-
gridService: GridService;
|
|
47
|
-
|
|
48
|
-
/** Grid Events Service */
|
|
49
|
-
gridEventService: GridEventService;
|
|
50
|
-
|
|
51
|
-
/** Grid State Service */
|
|
52
|
-
gridStateService: GridStateService;
|
|
53
|
-
|
|
54
|
-
/** Grouping (and colspan) Service */
|
|
55
|
-
groupingService: GroupingAndColspanService;
|
|
56
|
-
|
|
57
|
-
/** Pagination Service (allows you to programmatically go to first/last page, etc...) */
|
|
58
|
-
paginationService?: PaginationService;
|
|
59
|
-
|
|
60
|
-
/** Resizer Service (including auto-resize) */
|
|
61
|
-
resizerService: ResizerService;
|
|
62
|
-
|
|
63
|
-
/** Sort Service */
|
|
64
|
-
sortService: SortService;
|
|
65
|
-
|
|
66
|
-
/** Tree Data View Service */
|
|
67
|
-
treeDataService: TreeDataService;
|
|
68
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BackendUtilityService,
|
|
3
|
-
CollectionService,
|
|
4
|
-
ExtensionService,
|
|
5
|
-
ExtensionUtility,
|
|
6
|
-
FilterService,
|
|
7
|
-
GridEventService,
|
|
8
|
-
GridService,
|
|
9
|
-
GridStateService,
|
|
10
|
-
GroupingAndColspanService,
|
|
11
|
-
PaginationService,
|
|
12
|
-
ResizerService,
|
|
13
|
-
RxJsFacade,
|
|
14
|
-
SharedService,
|
|
15
|
-
SortService,
|
|
16
|
-
TreeDataService
|
|
17
|
-
} from '@slickgrid-universal/common';
|
|
18
|
-
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
19
|
-
|
|
20
|
-
export interface ExternalTestingDependencies {
|
|
21
|
-
backendUtilityService?: BackendUtilityService;
|
|
22
|
-
collectionService?: CollectionService;
|
|
23
|
-
eventPubSubService?: EventPubSubService;
|
|
24
|
-
extensionService?: ExtensionService;
|
|
25
|
-
extensionUtility?: ExtensionUtility;
|
|
26
|
-
filterService?: FilterService;
|
|
27
|
-
gridEventService?: GridEventService;
|
|
28
|
-
gridService?: GridService;
|
|
29
|
-
gridStateService?: GridStateService;
|
|
30
|
-
groupingAndColspanService?: GroupingAndColspanService;
|
|
31
|
-
paginationService?: PaginationService;
|
|
32
|
-
resizerService?: ResizerService;
|
|
33
|
-
rxjs?: RxJsFacade;
|
|
34
|
-
sharedService?: SharedService;
|
|
35
|
-
sortService?: SortService;
|
|
36
|
-
treeDataService?: TreeDataService;
|
|
37
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TranslateService } from '@ngx-translate/core';
|
|
2
|
-
import { GridOption as UniversalGridOption } from '@slickgrid-universal/common';
|
|
3
|
-
|
|
4
|
-
import { RowDetailView } from './index';
|
|
5
|
-
|
|
6
|
-
export interface GridOption extends UniversalGridOption {
|
|
7
|
-
/** ngx-translate i18n translation service instance */
|
|
8
|
-
i18n?: TranslateService;
|
|
9
|
-
|
|
10
|
-
/** Row Detail View Plugin options & events (columnId, cssClass, toolTip, width) */
|
|
11
|
-
rowDetailView?: RowDetailView;
|
|
12
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './angularComponentOutput.interface';
|
|
2
|
-
export * from './angularGridInstance.interface';
|
|
3
|
-
export * from './externalTestingDependencies.interface';
|
|
4
|
-
export * from './gridOption.interface';
|
|
5
|
-
export * from './rowDetailView.interface';
|
|
6
|
-
export * from './slickGrid.interface';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Type } from '@angular/core';
|
|
2
|
-
import { RowDetailView as UniversalRowDetailView } from '@slickgrid-universal/common';
|
|
3
|
-
|
|
4
|
-
export interface RowDetailView extends UniversalRowDetailView {
|
|
5
|
-
/**
|
|
6
|
-
* Optionally pass your Parent Component reference to your Child Component (row detail component).
|
|
7
|
-
* note:: If anyone finds a better way of passing the parent to the row detail extension, please reach out and/or create a PR
|
|
8
|
-
*/
|
|
9
|
-
parent?: any;
|
|
10
|
-
|
|
11
|
-
/** View Component of the preload template (typically a spinner) which shows after opening on the row detail but before the row detail is ready */
|
|
12
|
-
preloadComponent?: Type<object>;
|
|
13
|
-
|
|
14
|
-
/** View Component that will be loaded in the row detail after the async function completed */
|
|
15
|
-
viewComponent: Type<object>;
|
|
16
|
-
|
|
17
|
-
// --
|
|
18
|
-
// Callback Methods
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* HTML Preload Template that will be used before the async process (typically used to show a spinner/loading)
|
|
22
|
-
* It's preferable to use the "preloadView" property to use an Angular View instead of plain HTML.
|
|
23
|
-
* If you still wish to use these methods, we strongly suggest you to sanitize your HTML, e.g. "DOMPurify.sanitize()"
|
|
24
|
-
*/
|
|
25
|
-
preTemplate?: () => string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* HTML Post Template (when Row Detail data is available) that will be loaded once the async function finishes
|
|
29
|
-
* It's preferable to use the "preloadView" property to use an Angular View instead of plain HTML
|
|
30
|
-
* If you still wish to use these methods, we strongly suggest you to sanitize your HTML, e.g. "DOMPurify.sanitize()"
|
|
31
|
-
*/
|
|
32
|
-
postTemplate?: (item: any) => string;
|
|
33
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SlickGrid as UniversalSlickGrid } from '@slickgrid-universal/common';
|
|
2
|
-
import { GridOption } from './gridOption.interface';
|
|
3
|
-
|
|
4
|
-
export interface SlickGrid extends UniversalSlickGrid {
|
|
5
|
-
/** Returns an object containing all of the Grid options set on the grid. See a list of Grid Options here. */
|
|
6
|
-
getOptions(): GridOption;
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ModuleWithProviders, NgModule } from '@angular/core';
|
|
3
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
-
|
|
5
|
-
import { AngularSlickgridComponent } from './../components/angular-slickgrid.component';
|
|
6
|
-
import { GridOption } from './../models/gridOption.interface';
|
|
7
|
-
import { AngularUtilService } from '../services/angularUtil.service';
|
|
8
|
-
import { BsDropDownService } from '../services/bsDropdown.service';
|
|
9
|
-
import { ContainerService } from '../services/container.service';
|
|
10
|
-
|
|
11
|
-
@NgModule({
|
|
12
|
-
imports: [
|
|
13
|
-
CommonModule,
|
|
14
|
-
TranslateModule
|
|
15
|
-
],
|
|
16
|
-
declarations: [
|
|
17
|
-
AngularSlickgridComponent,
|
|
18
|
-
],
|
|
19
|
-
exports: [
|
|
20
|
-
AngularSlickgridComponent,
|
|
21
|
-
],
|
|
22
|
-
entryComponents: [AngularSlickgridComponent]
|
|
23
|
-
})
|
|
24
|
-
export class AngularSlickgridModule {
|
|
25
|
-
static forRoot(config: GridOption = {}): ModuleWithProviders<AngularSlickgridModule> {
|
|
26
|
-
return {
|
|
27
|
-
ngModule: AngularSlickgridModule,
|
|
28
|
-
providers: [
|
|
29
|
-
{ provide: 'config', useValue: config },
|
|
30
|
-
{ provide: 'externalService', useValue: null },
|
|
31
|
-
AngularUtilService,
|
|
32
|
-
BsDropDownService,
|
|
33
|
-
ContainerService,
|
|
34
|
-
]
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AngularComponentOutput } from '../models/angularComponentOutput.interface';
|
|
2
|
-
import { ApplicationRef, ComponentFactoryResolver, EmbeddedViewRef, Injectable, Injector } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
@Injectable()
|
|
5
|
-
export class AngularUtilService {
|
|
6
|
-
constructor(
|
|
7
|
-
private compFactoryResolver: ComponentFactoryResolver,
|
|
8
|
-
private appRef: ApplicationRef,
|
|
9
|
-
private injector: Injector,
|
|
10
|
-
) { }
|
|
11
|
-
|
|
12
|
-
// ref https://hackernoon.com/angular-pro-tip-how-to-dynamically-create-components-in-body-ba200cc289e6
|
|
13
|
-
createAngularComponent(component: any): AngularComponentOutput {
|
|
14
|
-
// Create a component reference from the component
|
|
15
|
-
const componentRef = this.compFactoryResolver
|
|
16
|
-
.resolveComponentFactory(component)
|
|
17
|
-
.create(this.injector);
|
|
18
|
-
|
|
19
|
-
// Attach component to the appRef so that it's inside the ng component tree
|
|
20
|
-
this.appRef.attachView(componentRef.hostView);
|
|
21
|
-
|
|
22
|
-
// Get DOM element from component
|
|
23
|
-
let domElem;
|
|
24
|
-
const viewRef = (componentRef.hostView as EmbeddedViewRef<any>);
|
|
25
|
-
if (viewRef && Array.isArray(viewRef.rootNodes) && viewRef.rootNodes[0]) {
|
|
26
|
-
domElem = viewRef.rootNodes[0] as HTMLElement;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return { componentRef, domElement: domElem as HTMLElement };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ref https://hackernoon.com/angular-pro-tip-how-to-dynamically-create-components-in-body-ba200cc289e6
|
|
33
|
-
createAngularComponentAppendToDom(component: any, targetElement?: HTMLElement | Element, clearTargetContent = false): AngularComponentOutput {
|
|
34
|
-
const componentOutput = this.createAngularComponent(component);
|
|
35
|
-
|
|
36
|
-
// Append DOM element to the HTML element specified
|
|
37
|
-
if (targetElement && targetElement.appendChild) {
|
|
38
|
-
if (clearTargetContent && targetElement.innerHTML) {
|
|
39
|
-
targetElement.innerHTML = '';
|
|
40
|
-
}
|
|
41
|
-
targetElement.appendChild(componentOutput.domElement);
|
|
42
|
-
} else {
|
|
43
|
-
document.body.appendChild(componentOutput.domElement); // when no target provided, we'll simply add it to the HTML Body
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return componentOutput;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { AngularUtilService } from './angularUtil.service';
|
|
4
|
-
|
|
5
|
-
interface DropDownServiceParams {
|
|
6
|
-
/** the custom action formatter component that contains the dropdown */
|
|
7
|
-
component: any;
|
|
8
|
-
|
|
9
|
-
/** help to get the data context */
|
|
10
|
-
args: any;
|
|
11
|
-
|
|
12
|
-
/** parent container */
|
|
13
|
-
parent: any;
|
|
14
|
-
|
|
15
|
-
/** Offset bottom when using a Drop Up, if we need to reposition the dropdown component */
|
|
16
|
-
offsetDropupBottom?: number;
|
|
17
|
-
|
|
18
|
-
/** Offset left if we need to reposition the dropdown component */
|
|
19
|
-
offsetLeft?: number;
|
|
20
|
-
|
|
21
|
-
/** Offset top if we need to reposition the dropdown component */
|
|
22
|
-
offsetTop?: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// using external non-typed js libraries
|
|
26
|
-
declare const $: any;
|
|
27
|
-
|
|
28
|
-
// Boostrap dropdown service
|
|
29
|
-
@Injectable()
|
|
30
|
-
export class BsDropDownService {
|
|
31
|
-
private _domContainerElement: any;
|
|
32
|
-
private _domElement: any;
|
|
33
|
-
|
|
34
|
-
constructor(private angularUtilService: AngularUtilService) { }
|
|
35
|
-
|
|
36
|
-
get domElement() {
|
|
37
|
-
return this._domElement;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get domContainerElement() {
|
|
41
|
-
return this._domContainerElement;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get gridViewport() {
|
|
45
|
-
return $('.slick-viewport');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
dispose() {
|
|
49
|
-
if (this._domElement && this._domElement.remove) {
|
|
50
|
-
this._domElement.remove();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
dropContainerShow() {
|
|
55
|
-
if (this._domContainerElement && this._domContainerElement.show) {
|
|
56
|
-
this._domContainerElement.show();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
render(dropdownParams: DropDownServiceParams) {
|
|
61
|
-
return new Promise((resolve) => {
|
|
62
|
-
const { component, args, parent, offsetTop, offsetLeft, offsetDropupBottom } = dropdownParams;
|
|
63
|
-
|
|
64
|
-
const cell = args.cell;
|
|
65
|
-
const row = args.row;
|
|
66
|
-
|
|
67
|
-
this._domContainerElement = $(`#myDrop-r${row}-c${cell}`);
|
|
68
|
-
|
|
69
|
-
if (this._domContainerElement) {
|
|
70
|
-
// hide the dropdown we created as a formatter Component, we'll redisplay it later
|
|
71
|
-
const cellPos = this._domContainerElement.offset();
|
|
72
|
-
|
|
73
|
-
const componentOutput = this.angularUtilService.createAngularComponent(component);
|
|
74
|
-
const componentInstance = componentOutput && componentOutput.componentRef && componentOutput.componentRef.instance;
|
|
75
|
-
|
|
76
|
-
if (componentInstance) {
|
|
77
|
-
const myDropId = componentInstance.dropdownId || 'myDrop';
|
|
78
|
-
const dropDownToggleId = componentInstance.dropDownToggleId || 'dropdownMenu1';
|
|
79
|
-
this._domElement = $(`#${myDropId}`);
|
|
80
|
-
|
|
81
|
-
if (this._domElement) {
|
|
82
|
-
// make sure to remove any previous Action dropdown elements, to avoid having multiple element of the same on top of each other
|
|
83
|
-
this.dispose();
|
|
84
|
-
|
|
85
|
-
// assign the row data to the dropdown component instance
|
|
86
|
-
Object.assign(componentInstance, { parent, row: args.row, dataContext: args.grid.getDataItem(args.row) });
|
|
87
|
-
|
|
88
|
-
// use a delay to make sure Angular ran at least a full cycle and make sure it finished rendering the Component before using it
|
|
89
|
-
setTimeout(() => {
|
|
90
|
-
// create a new dropdown element
|
|
91
|
-
this._domElement = $(componentOutput.domElement);
|
|
92
|
-
const topPos = (cellPos && cellPos.top || 0) + 30 + (offsetTop || 0);
|
|
93
|
-
const leftPos = (cellPos && cellPos.left || 0) + (offsetLeft || 0);
|
|
94
|
-
this._domElement.appendTo('body');
|
|
95
|
-
this._domElement.css('position', 'absolute');
|
|
96
|
-
this._domElement.css('top', topPos);
|
|
97
|
-
this._domElement.css('left', leftPos);
|
|
98
|
-
$(`#${myDropId}`).addClass('open');
|
|
99
|
-
$(`#${dropDownToggleId}`).hide();
|
|
100
|
-
|
|
101
|
-
// check if it should drop Up or Down
|
|
102
|
-
const offset = 35;
|
|
103
|
-
const iElement = $('.dropdown-menu');
|
|
104
|
-
const iElementWrapper = iElement.parent();
|
|
105
|
-
const iElementWrapperOffset = iElementWrapper.offset() || {};
|
|
106
|
-
const iElementWrapperOffsetTop = iElementWrapperOffset.top || iElementWrapper && iElementWrapper.length > 0 && iElementWrapper[0].offsetTop;
|
|
107
|
-
const iElementHeight = iElement.height();
|
|
108
|
-
const windowHeight = window.innerHeight;
|
|
109
|
-
const shouldDropUp = (windowHeight - iElementHeight - offset) < iElementWrapperOffsetTop;
|
|
110
|
-
let menuMarginTop = '0px';
|
|
111
|
-
if (shouldDropUp) {
|
|
112
|
-
const offsetBottom = offsetDropupBottom || 0;
|
|
113
|
-
menuMarginTop = '-'.concat(`${iElementHeight + offset + offsetBottom + 5}`, 'px');
|
|
114
|
-
}
|
|
115
|
-
this._domElement.css({ 'margin-top': menuMarginTop });
|
|
116
|
-
|
|
117
|
-
// set dropdown margin left according to the document width
|
|
118
|
-
const parentOffset = iElementWrapperOffset.left;
|
|
119
|
-
const leftMargin = parentOffset - $(document).width();
|
|
120
|
-
this._domElement.css({ 'margin-left': (this._domElement.width() + leftMargin + 60) + 'px' });
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
this._domElement.dropdown('show'); // required for Bootstrap 4 only
|
|
124
|
-
} catch (e) {
|
|
125
|
-
// Bootstrap 3 wil throw an error since that method doesn't exist, we can safely disregard it
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
this._domElement.on('hidden.bs.dropdown', () => this.dropContainerShow());
|
|
129
|
-
|
|
130
|
-
// hide dropdown menu on grid scroll
|
|
131
|
-
this.gridViewport.on('scroll', () => this.dispose());
|
|
132
|
-
|
|
133
|
-
// hide on dropdown click
|
|
134
|
-
this._domElement.on('click', () => this.dispose());
|
|
135
|
-
resolve(true);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}
|