@ngageoint/mage.web-core-lib 6.2.2
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/README.md +24 -0
- package/bundles/ngageoint-mage.web-core-lib-common.umd.js +146 -0
- package/bundles/ngageoint-mage.web-core-lib-common.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-common.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib-common.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-event.umd.js +14 -0
- package/bundles/ngageoint-mage.web-core-lib-event.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-event.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib-event.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-feed.umd.js +114 -0
- package/bundles/ngageoint-mage.web-core-lib-feed.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-feed.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib-feed.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-paging.umd.js +313 -0
- package/bundles/ngageoint-mage.web-core-lib-paging.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-paging.umd.min.js +16 -0
- package/bundles/ngageoint-mage.web-core-lib-paging.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-plugin.umd.js +11 -0
- package/bundles/ngageoint-mage.web-core-lib-plugin.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-plugin.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib-plugin.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-static-icon.umd.js +391 -0
- package/bundles/ngageoint-mage.web-core-lib-static-icon.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-static-icon.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib-static-icon.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-user.umd.js +492 -0
- package/bundles/ngageoint-mage.web-core-lib-user.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib-user.umd.min.js +16 -0
- package/bundles/ngageoint-mage.web-core-lib-user.umd.min.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib.umd.js +32 -0
- package/bundles/ngageoint-mage.web-core-lib.umd.js.map +1 -0
- package/bundles/ngageoint-mage.web-core-lib.umd.min.js +2 -0
- package/bundles/ngageoint-mage.web-core-lib.umd.min.js.map +1 -0
- package/common/mage-common.module.d.ts +7 -0
- package/common/ngageoint-mage.web-core-lib-common.d.ts +5 -0
- package/common/package.json +12 -0
- package/common/public-api.d.ts +2 -0
- package/common/xhr-img.component.d.ts +58 -0
- package/esm2015/common/mage-common.module.js +26 -0
- package/esm2015/common/ngageoint-mage.web-core-lib-common.js +5 -0
- package/esm2015/common/public-api.js +3 -0
- package/esm2015/common/xhr-img.component.js +109 -0
- package/esm2015/event/event-read.service.js +3 -0
- package/esm2015/event/event.model.js +1 -0
- package/esm2015/event/ngageoint-mage.web-core-lib-event.js +5 -0
- package/esm2015/event/public-api.js +2 -0
- package/esm2015/feed/feed.model.js +1 -0
- package/esm2015/feed/feed.service.js +105 -0
- package/esm2015/feed/ngageoint-mage.web-core-lib-feed.js +5 -0
- package/esm2015/feed/public-api.js +2 -0
- package/esm2015/mage-core-lib.module.js +20 -0
- package/esm2015/ngageoint-mage.web-core-lib.js +5 -0
- package/esm2015/paging/ngageoint-mage.web-core-lib-paging.js +5 -0
- package/esm2015/paging/paging.cdk-data-source.adapter.js +52 -0
- package/esm2015/paging/paging.model.js +25 -0
- package/esm2015/paging/public-api.js +3 -0
- package/esm2015/plugin/ngageoint-mage.web-core-lib-plugin.js +4 -0
- package/esm2015/plugin/plugin.model.js +1 -0
- package/esm2015/plugin/public-api.js +1 -0
- package/esm2015/public-api.js +5 -0
- package/esm2015/static-icon/ngageoint-mage.web-core-lib-static-icon.js +5 -0
- package/esm2015/static-icon/public-api.js +7 -0
- package/esm2015/static-icon/static-icon-form-field/static-icon-form-field.component.js +152 -0
- package/esm2015/static-icon/static-icon-img/static-icon-img.component.js +35 -0
- package/esm2015/static-icon/static-icon-select/static-icon-select.component.js +61 -0
- package/esm2015/static-icon/static-icon.model.js +10 -0
- package/esm2015/static-icon/static-icon.module.js +55 -0
- package/esm2015/static-icon/static-icon.service.js +82 -0
- package/esm2015/user/ngageoint-mage.web-core-lib-user.js +5 -0
- package/esm2015/user/public-api.js +4 -0
- package/esm2015/user/user-read.service.js +40 -0
- package/esm2015/user/user-select/user-select.component.js +165 -0
- package/esm2015/user/user.model.js +1 -0
- package/esm2015/user/user.module.js +65 -0
- package/esm5/common/mage-common.module.js +30 -0
- package/esm5/common/ngageoint-mage.web-core-lib-common.js +5 -0
- package/esm5/common/public-api.js +3 -0
- package/esm5/common/xhr-img.component.js +112 -0
- package/esm5/event/event-read.service.js +3 -0
- package/esm5/event/event.model.js +1 -0
- package/esm5/event/ngageoint-mage.web-core-lib-event.js +5 -0
- package/esm5/event/public-api.js +2 -0
- package/esm5/feed/feed.model.js +1 -0
- package/esm5/feed/feed.service.js +108 -0
- package/esm5/feed/ngageoint-mage.web-core-lib-feed.js +5 -0
- package/esm5/feed/public-api.js +2 -0
- package/esm5/mage-core-lib.module.js +24 -0
- package/esm5/ngageoint-mage.web-core-lib.js +5 -0
- package/esm5/paging/ngageoint-mage.web-core-lib-paging.js +5 -0
- package/esm5/paging/paging.cdk-data-source.adapter.js +60 -0
- package/esm5/paging/paging.model.js +25 -0
- package/esm5/paging/public-api.js +3 -0
- package/esm5/plugin/ngageoint-mage.web-core-lib-plugin.js +4 -0
- package/esm5/plugin/plugin.model.js +1 -0
- package/esm5/plugin/public-api.js +1 -0
- package/esm5/public-api.js +5 -0
- package/esm5/static-icon/ngageoint-mage.web-core-lib-static-icon.js +5 -0
- package/esm5/static-icon/public-api.js +7 -0
- package/esm5/static-icon/static-icon-form-field/static-icon-form-field.component.js +157 -0
- package/esm5/static-icon/static-icon-img/static-icon-img.component.js +38 -0
- package/esm5/static-icon/static-icon-select/static-icon-select.component.js +65 -0
- package/esm5/static-icon/static-icon.model.js +10 -0
- package/esm5/static-icon/static-icon.module.js +59 -0
- package/esm5/static-icon/static-icon.service.js +84 -0
- package/esm5/user/ngageoint-mage.web-core-lib-user.js +5 -0
- package/esm5/user/public-api.js +4 -0
- package/esm5/user/user-read.service.js +42 -0
- package/esm5/user/user-select/user-select.component.js +175 -0
- package/esm5/user/user.model.js +1 -0
- package/esm5/user/user.module.js +69 -0
- package/event/event-read.service.d.ts +11 -0
- package/event/event.model.d.ts +6 -0
- package/event/ngageoint-mage.web-core-lib-event.d.ts +5 -0
- package/event/package.json +12 -0
- package/event/public-api.d.ts +2 -0
- package/feed/feed.model.d.ts +83 -0
- package/feed/feed.service.d.ts +40 -0
- package/feed/ngageoint-mage.web-core-lib-feed.d.ts +5 -0
- package/feed/package.json +12 -0
- package/feed/public-api.d.ts +2 -0
- package/fesm2015/ngageoint-mage.web-core-lib-common.js +137 -0
- package/fesm2015/ngageoint-mage.web-core-lib-common.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-event.js +10 -0
- package/fesm2015/ngageoint-mage.web-core-lib-event.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-feed.js +111 -0
- package/fesm2015/ngageoint-mage.web-core-lib-feed.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-paging.js +83 -0
- package/fesm2015/ngageoint-mage.web-core-lib-paging.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-plugin.js +4 -0
- package/fesm2015/ngageoint-mage.web-core-lib-plugin.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-static-icon.js +379 -0
- package/fesm2015/ngageoint-mage.web-core-lib-static-icon.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib-user.js +267 -0
- package/fesm2015/ngageoint-mage.web-core-lib-user.js.map +1 -0
- package/fesm2015/ngageoint-mage.web-core-lib.js +30 -0
- package/fesm2015/ngageoint-mage.web-core-lib.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-common.js +142 -0
- package/fesm5/ngageoint-mage.web-core-lib-common.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-event.js +10 -0
- package/fesm5/ngageoint-mage.web-core-lib-event.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-feed.js +113 -0
- package/fesm5/ngageoint-mage.web-core-lib-feed.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-paging.js +90 -0
- package/fesm5/ngageoint-mage.web-core-lib-paging.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-plugin.js +4 -0
- package/fesm5/ngageoint-mage.web-core-lib-plugin.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-static-icon.js +392 -0
- package/fesm5/ngageoint-mage.web-core-lib-static-icon.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib-user.js +280 -0
- package/fesm5/ngageoint-mage.web-core-lib-user.js.map +1 -0
- package/fesm5/ngageoint-mage.web-core-lib.js +33 -0
- package/fesm5/ngageoint-mage.web-core-lib.js.map +1 -0
- package/mage-core-lib.module.d.ts +6 -0
- package/ngageoint-mage.web-core-lib.d.ts +5 -0
- package/package.json +35 -0
- package/paging/ngageoint-mage.web-core-lib-paging.d.ts +5 -0
- package/paging/package.json +12 -0
- package/paging/paging.cdk-data-source.adapter.d.ts +20 -0
- package/paging/paging.model.d.ts +27 -0
- package/paging/public-api.d.ts +2 -0
- package/plugin/ngageoint-mage.web-core-lib-plugin.d.ts +5 -0
- package/plugin/package.json +12 -0
- package/plugin/plugin.model.d.ts +13 -0
- package/plugin/public-api.d.ts +1 -0
- package/public-api.d.ts +1 -0
- package/static-icon/ngageoint-mage.web-core-lib-static-icon.d.ts +5 -0
- package/static-icon/package.json +12 -0
- package/static-icon/public-api.d.ts +6 -0
- package/static-icon/static-icon-form-field/static-icon-form-field.component.d.ts +31 -0
- package/static-icon/static-icon-img/static-icon-img.component.d.ts +12 -0
- package/static-icon/static-icon-select/static-icon-select.component.d.ts +21 -0
- package/static-icon/static-icon.model.d.ts +19 -0
- package/static-icon/static-icon.module.d.ts +13 -0
- package/static-icon/static-icon.service.d.ts +20 -0
- package/user/ngageoint-mage.web-core-lib-user.d.ts +5 -0
- package/user/package.json +12 -0
- package/user/public-api.d.ts +4 -0
- package/user/user-read.service.d.ts +24 -0
- package/user/user-select/user-select.component.d.ts +38 -0
- package/user/user.model.d.ts +85 -0
- package/user/user.module.d.ts +16 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { ɵɵinject, ɵɵdefineInjectable, ɵsetClassMetadata, Injectable, InjectionToken, ɵɵelementStart, ɵɵtext, ɵɵelementEnd, ɵɵnextContext, ɵɵadvance, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate, ɵɵdirectiveInject, ɵɵdefineComponent, ɵɵstaticViewQuery, ɵɵqueryRefresh, ɵɵloadQuery, ɵɵProvidersFeature, forwardRef, ɵɵNgOnChangesFeature, ɵɵlistener, ɵɵtemplate, ɵɵproperty, Component, ViewChild, ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, NgModule } from '@angular/core';
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
7
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
8
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
import { MatListModule } from '@angular/material/list';
|
|
11
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
12
|
+
import { __assign } from 'tslib';
|
|
13
|
+
import { NgSelectComponent, ɵj, ɵf, NgSelectModule } from '@ng-select/ng-select';
|
|
14
|
+
import { pageForItemIndex } from '@ngageoint/mage.web-core-lib/paging';
|
|
15
|
+
import { Subject } from 'rxjs';
|
|
16
|
+
import { distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
17
|
+
|
|
18
|
+
var USER_READ_BASE_URL = '/api/next-users';
|
|
19
|
+
var reqKeys = {
|
|
20
|
+
term: 'term',
|
|
21
|
+
pageSize: 'page_size',
|
|
22
|
+
pageIndex: 'page',
|
|
23
|
+
includeTotalCount: 'total',
|
|
24
|
+
};
|
|
25
|
+
var UserReadService = /** @class */ (function () {
|
|
26
|
+
function UserReadService(http) {
|
|
27
|
+
this.http = http;
|
|
28
|
+
}
|
|
29
|
+
UserReadService.prototype.search = function (which) {
|
|
30
|
+
var queryParams = {
|
|
31
|
+
page_size: String(which.pageSize),
|
|
32
|
+
page: String(which.pageIndex),
|
|
33
|
+
};
|
|
34
|
+
if (typeof which.term === 'string') {
|
|
35
|
+
queryParams.term = which.term;
|
|
36
|
+
}
|
|
37
|
+
if (typeof which.includeTotalCount === 'boolean') {
|
|
38
|
+
queryParams.total = which.includeTotalCount ? 'true' : 'false';
|
|
39
|
+
}
|
|
40
|
+
return this.http.get(USER_READ_BASE_URL + "/search", {
|
|
41
|
+
params: queryParams
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
UserReadService.ɵfac = function UserReadService_Factory(t) { return new (t || UserReadService)(ɵɵinject(HttpClient)); };
|
|
45
|
+
UserReadService.ɵprov = ɵɵdefineInjectable({ token: UserReadService, factory: UserReadService.ɵfac, providedIn: 'root' });
|
|
46
|
+
return UserReadService;
|
|
47
|
+
}());
|
|
48
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(UserReadService, [{
|
|
49
|
+
type: Injectable,
|
|
50
|
+
args: [{
|
|
51
|
+
providedIn: 'root'
|
|
52
|
+
}]
|
|
53
|
+
}], function () { return [{ type: HttpClient }]; }, null); })();
|
|
54
|
+
var USER_READ_SERVICE = new InjectionToken('UserReadService');
|
|
55
|
+
|
|
56
|
+
function UserSelectComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
ɵɵelementStart(0, "small", 3);
|
|
58
|
+
ɵɵtext(1);
|
|
59
|
+
ɵɵelementEnd();
|
|
60
|
+
} if (rf & 2) {
|
|
61
|
+
var ctx_r0 = ɵɵnextContext();
|
|
62
|
+
ɵɵadvance(1);
|
|
63
|
+
ɵɵtextInterpolate1("", ctx_r0.totalCount, " matching users");
|
|
64
|
+
} }
|
|
65
|
+
function UserSelectComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
|
|
66
|
+
ɵɵelementStart(0, "div", 4);
|
|
67
|
+
ɵɵelementStart(1, "p", 5);
|
|
68
|
+
ɵɵtext(2);
|
|
69
|
+
ɵɵelementEnd();
|
|
70
|
+
ɵɵelementStart(3, "p", 6);
|
|
71
|
+
ɵɵtext(4);
|
|
72
|
+
ɵɵelementEnd();
|
|
73
|
+
ɵɵelementStart(5, "p", 6);
|
|
74
|
+
ɵɵtext(6);
|
|
75
|
+
ɵɵelementEnd();
|
|
76
|
+
ɵɵelementEnd();
|
|
77
|
+
} if (rf & 2) {
|
|
78
|
+
var user_r2 = ctx.item;
|
|
79
|
+
ɵɵadvance(2);
|
|
80
|
+
ɵɵtextInterpolate2("", user_r2.displayName, " (", user_r2.username, ")");
|
|
81
|
+
ɵɵadvance(2);
|
|
82
|
+
ɵɵtextInterpolate(user_r2.email || "[no email]");
|
|
83
|
+
ɵɵadvance(2);
|
|
84
|
+
ɵɵtextInterpolate(user_r2.allPhones || "[no phone]");
|
|
85
|
+
} }
|
|
86
|
+
var UserSelectComponent = /** @class */ (function () {
|
|
87
|
+
function UserSelectComponent(userService) {
|
|
88
|
+
this.userService = userService;
|
|
89
|
+
this.baseFindParams = Object.freeze({
|
|
90
|
+
pageSize: 100,
|
|
91
|
+
pageIndex: 0,
|
|
92
|
+
term: null
|
|
93
|
+
});
|
|
94
|
+
this.nextPageScrollThreshold = 15;
|
|
95
|
+
this.searchTermDebounceTime = 500;
|
|
96
|
+
this.trackByUserId = function (x) { return x.id; };
|
|
97
|
+
this.users = [];
|
|
98
|
+
this.totalCount = 0;
|
|
99
|
+
this.searchTerm$ = new Subject();
|
|
100
|
+
this.currentSearchTerm = null;
|
|
101
|
+
this.currentFetch = null;
|
|
102
|
+
}
|
|
103
|
+
Object.defineProperty(UserSelectComponent.prototype, "loading", {
|
|
104
|
+
get: function () {
|
|
105
|
+
return !!this.currentFetch && !this.currentFetch.closed;
|
|
106
|
+
},
|
|
107
|
+
enumerable: true,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
UserSelectComponent.prototype.ngOnInit = function () {
|
|
111
|
+
var _this = this;
|
|
112
|
+
this.searchTerm$.pipe(distinctUntilChanged(), debounceTime(this.searchTermDebounceTime))
|
|
113
|
+
.subscribe(function (x) {
|
|
114
|
+
_this.currentSearchTerm = x;
|
|
115
|
+
_this.users = [];
|
|
116
|
+
_this.totalCount = 0;
|
|
117
|
+
if (_this.currentFetch) {
|
|
118
|
+
_this.currentFetch.unsubscribe();
|
|
119
|
+
_this.currentFetch = null;
|
|
120
|
+
}
|
|
121
|
+
_this.fetchNextPage();
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
UserSelectComponent.prototype.ngOnChanges = function (changes) {
|
|
125
|
+
};
|
|
126
|
+
UserSelectComponent.prototype.ngAfterViewInit = function () {
|
|
127
|
+
};
|
|
128
|
+
UserSelectComponent.prototype.writeValue = function (x) {
|
|
129
|
+
this.userSelect.writeValue(x);
|
|
130
|
+
};
|
|
131
|
+
UserSelectComponent.prototype.registerOnChange = function (fn) {
|
|
132
|
+
this.userSelect.registerOnChange(fn);
|
|
133
|
+
};
|
|
134
|
+
UserSelectComponent.prototype.registerOnTouched = function (fn) {
|
|
135
|
+
this.userSelect.registerOnTouched(fn);
|
|
136
|
+
};
|
|
137
|
+
UserSelectComponent.prototype.setDisabledState = function (isDisabled) {
|
|
138
|
+
this.userSelect.setDisabledState(isDisabled);
|
|
139
|
+
};
|
|
140
|
+
UserSelectComponent.prototype.onOpen = function () {
|
|
141
|
+
if (this.users.length === 0) {
|
|
142
|
+
this.fetchNextPage();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
UserSelectComponent.prototype.onScroll = function (_a) {
|
|
146
|
+
var end = _a.end;
|
|
147
|
+
if (end < this.users.length - this.nextPageScrollThreshold || this.users.length === this.totalCount) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
this.fetchNextPage();
|
|
151
|
+
};
|
|
152
|
+
UserSelectComponent.prototype.onScrollToEnd = function () {
|
|
153
|
+
};
|
|
154
|
+
UserSelectComponent.prototype.fetchNextPage = function () {
|
|
155
|
+
var _this = this;
|
|
156
|
+
if (this.currentFetch) {
|
|
157
|
+
if (this.currentFetch.closed) {
|
|
158
|
+
this.currentFetch = null;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
var nextPage = pageForItemIndex(this.users.length, this.baseFindParams.pageSize);
|
|
165
|
+
var findParams = __assign(__assign({}, this.baseFindParams), { pageIndex: nextPage });
|
|
166
|
+
if (this.currentSearchTerm) {
|
|
167
|
+
findParams.term = this.currentSearchTerm;
|
|
168
|
+
}
|
|
169
|
+
this.currentFetch = this.userService.search(findParams).subscribe(function (page) {
|
|
170
|
+
_this.users = _this.users.concat(page.items);
|
|
171
|
+
if (typeof page.totalCount === 'number') {
|
|
172
|
+
_this.totalCount = page.totalCount;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
UserSelectComponent.ɵfac = function UserSelectComponent_Factory(t) { return new (t || UserSelectComponent)(ɵɵdirectiveInject(UserReadService)); };
|
|
177
|
+
UserSelectComponent.ɵcmp = ɵɵdefineComponent({ type: UserSelectComponent, selectors: [["mage-user-select"]], viewQuery: function UserSelectComponent_Query(rf, ctx) { if (rf & 1) {
|
|
178
|
+
ɵɵstaticViewQuery(NgSelectComponent, true);
|
|
179
|
+
} if (rf & 2) {
|
|
180
|
+
var _t;
|
|
181
|
+
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.userSelect = _t.first);
|
|
182
|
+
} }, features: [ɵɵProvidersFeature([
|
|
183
|
+
{
|
|
184
|
+
provide: NG_VALUE_ACCESSOR,
|
|
185
|
+
multi: true,
|
|
186
|
+
useExisting: forwardRef(function () { return UserSelectComponent; })
|
|
187
|
+
}
|
|
188
|
+
]), ɵɵNgOnChangesFeature], decls: 3, vars: 5, consts: [["appendTo", "body", "placeholder", "Choose a user", "bindLabel", "displayName", 3, "items", "typeahead", "virtualScroll", "loading", "trackByFn", "open", "scroll", "scrollToEnd"], ["ng-header-tmp", ""], ["class", "user-option", "ng-option-tmp", ""], [1, "form-text", "text-muted"], [1, "user-option"], [1, "user-option__line", "primary"], [1, "user-option__line", "detail"]], template: function UserSelectComponent_Template(rf, ctx) { if (rf & 1) {
|
|
189
|
+
ɵɵelementStart(0, "ng-select", 0);
|
|
190
|
+
ɵɵlistener("open", function UserSelectComponent_Template_ng_select_open_0_listener() { return ctx.onOpen(); })("scroll", function UserSelectComponent_Template_ng_select_scroll_0_listener($event) { return ctx.onScroll($event); })("scrollToEnd", function UserSelectComponent_Template_ng_select_scrollToEnd_0_listener() { return ctx.onScrollToEnd(); });
|
|
191
|
+
ɵɵtemplate(1, UserSelectComponent_ng_template_1_Template, 2, 1, "ng-template", 1);
|
|
192
|
+
ɵɵtemplate(2, UserSelectComponent_ng_template_2_Template, 7, 4, "ng-template", 2);
|
|
193
|
+
ɵɵelementEnd();
|
|
194
|
+
} if (rf & 2) {
|
|
195
|
+
ɵɵproperty("items", ctx.users)("typeahead", ctx.searchTerm$)("virtualScroll", true)("loading", ctx.loading)("trackByFn", ctx.trackByUserId);
|
|
196
|
+
} }, directives: [NgSelectComponent, ɵj, ɵf], styles: [".user-option[_ngcontent-%COMP%]{margin:.85em 0}.user-option[_ngcontent-%COMP%] > .user-option__line[_ngcontent-%COMP%]{margin:0 0 .6em;padding:0;line-height:1em;overflow:hidden;text-overflow:ellipsis}.user-option[_ngcontent-%COMP%] > .user-option__line.primary[_ngcontent-%COMP%]{font-size:1em}.user-option[_ngcontent-%COMP%] > .user-option__line.detail[_ngcontent-%COMP%]{font-size:.85em;opacity:.75}"] });
|
|
197
|
+
return UserSelectComponent;
|
|
198
|
+
}());
|
|
199
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(UserSelectComponent, [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: 'mage-user-select',
|
|
203
|
+
templateUrl: './user-select.component.html',
|
|
204
|
+
styleUrls: [
|
|
205
|
+
'./user-select.component.scss'
|
|
206
|
+
],
|
|
207
|
+
providers: [
|
|
208
|
+
{
|
|
209
|
+
provide: NG_VALUE_ACCESSOR,
|
|
210
|
+
multi: true,
|
|
211
|
+
useExisting: forwardRef(function () { return UserSelectComponent; })
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
}]
|
|
215
|
+
}], function () { return [{ type: UserReadService }]; }, { userSelect: [{
|
|
216
|
+
type: ViewChild,
|
|
217
|
+
args: [NgSelectComponent, { static: true }]
|
|
218
|
+
}] }); })();
|
|
219
|
+
|
|
220
|
+
var MageUserModule = /** @class */ (function () {
|
|
221
|
+
function MageUserModule() {
|
|
222
|
+
}
|
|
223
|
+
MageUserModule.ɵmod = ɵɵdefineNgModule({ type: MageUserModule });
|
|
224
|
+
MageUserModule.ɵinj = ɵɵdefineInjector({ factory: function MageUserModule_Factory(t) { return new (t || MageUserModule)(); }, imports: [[
|
|
225
|
+
CommonModule,
|
|
226
|
+
FormsModule,
|
|
227
|
+
ReactiveFormsModule,
|
|
228
|
+
ScrollingModule,
|
|
229
|
+
MatAutocompleteModule,
|
|
230
|
+
MatDialogModule,
|
|
231
|
+
MatFormFieldModule,
|
|
232
|
+
MatInputModule,
|
|
233
|
+
MatListModule,
|
|
234
|
+
MatSelectModule,
|
|
235
|
+
NgSelectModule,
|
|
236
|
+
]] });
|
|
237
|
+
return MageUserModule;
|
|
238
|
+
}());
|
|
239
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(MageUserModule, { declarations: [UserSelectComponent], imports: [CommonModule,
|
|
240
|
+
FormsModule,
|
|
241
|
+
ReactiveFormsModule,
|
|
242
|
+
ScrollingModule,
|
|
243
|
+
MatAutocompleteModule,
|
|
244
|
+
MatDialogModule,
|
|
245
|
+
MatFormFieldModule,
|
|
246
|
+
MatInputModule,
|
|
247
|
+
MatListModule,
|
|
248
|
+
MatSelectModule,
|
|
249
|
+
NgSelectModule], exports: [UserSelectComponent] }); })();
|
|
250
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(MageUserModule, [{
|
|
251
|
+
type: NgModule,
|
|
252
|
+
args: [{
|
|
253
|
+
imports: [
|
|
254
|
+
CommonModule,
|
|
255
|
+
FormsModule,
|
|
256
|
+
ReactiveFormsModule,
|
|
257
|
+
ScrollingModule,
|
|
258
|
+
MatAutocompleteModule,
|
|
259
|
+
MatDialogModule,
|
|
260
|
+
MatFormFieldModule,
|
|
261
|
+
MatInputModule,
|
|
262
|
+
MatListModule,
|
|
263
|
+
MatSelectModule,
|
|
264
|
+
NgSelectModule,
|
|
265
|
+
],
|
|
266
|
+
declarations: [
|
|
267
|
+
UserSelectComponent
|
|
268
|
+
],
|
|
269
|
+
exports: [
|
|
270
|
+
UserSelectComponent
|
|
271
|
+
]
|
|
272
|
+
}]
|
|
273
|
+
}], null, null); })();
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Generated bundle index. Do not edit.
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
export { MageUserModule, USER_READ_BASE_URL, USER_READ_SERVICE, UserReadService, UserSelectComponent };
|
|
280
|
+
//# sourceMappingURL=ngageoint-mage.web-core-lib-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngageoint-mage.web-core-lib-user.js","sources":["ng://@ngageoint/mage.web-core-lib/user/user-read.service.ts","ng://@ngageoint/mage.web-core-lib/user/user-select/user-select.component.html","ng://@ngageoint/mage.web-core-lib/user/user-select/user-select.component.ts","ng://@ngageoint/mage.web-core-lib/user/user.module.ts","ng://@ngageoint/mage.web-core-lib/user/ngageoint-mage.web-core-lib-user.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http'\nimport { InjectionToken, Injectable } from '@angular/core'\nimport { PageOf, PagingParameters } from '@ngageoint/mage.web-core-lib/paging'\nimport { Observable } from 'rxjs'\nimport { User } from './user.model'\n\nexport const USER_READ_BASE_URL = '/api/next-users'\n\ntype SearchQueryParams = {\n page_size: string,\n page: string,\n term?: string,\n total?: 'true' | 'false'\n}\n\nconst reqKeys: { [SearchParamKey in keyof UserSearchParams]: string } = {\n term: 'term',\n pageSize: 'page_size',\n pageIndex: 'page',\n includeTotalCount: 'total',\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserReadService {\n\n constructor(private http: HttpClient) { }\n\n search(which: UserSearchParams): Observable<PageOf<UserSearchResult>> {\n const queryParams: SearchQueryParams = {\n page_size: String(which.pageSize),\n page: String(which.pageIndex),\n }\n if (typeof which.term === 'string') {\n queryParams.term = which.term\n }\n if (typeof which.includeTotalCount === 'boolean') {\n queryParams.total = which.includeTotalCount ? 'true' : 'false'\n }\n return this.http.get<PageOf<UserSearchResult>>(`${USER_READ_BASE_URL}/search`, {\n params: queryParams\n })\n }\n}\n\nexport interface UserSearchParams extends PagingParameters {\n term?: string | null | undefined\n}\n\nexport type UserSearchResult = Pick<User, 'id' | 'username' | 'displayName' | 'email' | 'active' | 'enabled'> & {\n /**\n * A reduction of all the phone numbers to a single string\n */\n allPhones?: string | null | undefined\n}\n\nexport const USER_READ_SERVICE = new InjectionToken<UserReadService>('UserReadService')","<ng-select [items]=\"users\"\n [typeahead]=\"searchTerm$\"\n [virtualScroll]=\"true\"\n [loading]=\"loading\"\n [trackByFn]=\"trackByUserId\"\n appendTo=\"body\"\n placeholder=\"Choose a user\"\n bindLabel=\"displayName\"\n (open)=\"onOpen()\"\n (scroll)=\"onScroll($event)\"\n (scrollToEnd)=\"onScrollToEnd()\"\n >\n <ng-template ng-header-tmp>\n <small class=\"form-text text-muted\">{{totalCount}} matching users</small>\n </ng-template>\n <ng-template class=\"user-option\" ng-option-tmp let-user=\"item\" let-index=\"index\">\n <div class=\"user-option\">\n <p class=\"user-option__line primary\">{{user.displayName}} ({{user.username}})</p>\n <p class=\"user-option__line detail\">{{user.email || '[no email]'}}</p>\n <p class=\"user-option__line detail\">{{user.allPhones || '[no phone]'}}</p>\n </div>\n </ng-template>\n</ng-select>\n","import { AfterViewInit, Component, Input, OnChanges, SimpleChanges, ViewChild, forwardRef, OnInit } from '@angular/core'\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'\nimport { NgSelectComponent } from '@ng-select/ng-select'\nimport { User } from '../user.model'\nimport { UserReadService, UserSearchParams, UserSearchResult } from '../user-read.service'\nimport { pageForItemIndex, itemRangeOfPage } from '@ngageoint/mage.web-core-lib/paging'\nimport { Subject, BehaviorSubject, SubscriptionLike, Unsubscribable } from 'rxjs'\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators'\nimport { X } from '@angular/cdk/keycodes'\n\n@Component({\n selector: 'mage-user-select',\n templateUrl: './user-select.component.html',\n styleUrls: [\n './user-select.component.scss'\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n multi: true,\n useExisting: forwardRef(() => UserSelectComponent)\n }\n ]\n})\nexport class UserSelectComponent implements OnInit, OnChanges, AfterViewInit, ControlValueAccessor {\n\n readonly baseFindParams: Readonly<UserSearchParams> = Object.freeze({\n pageSize: 100,\n pageIndex: 0,\n term: null\n })\n readonly nextPageScrollThreshold = 15\n readonly searchTermDebounceTime = 500\n readonly trackByUserId: (x: User) => User['id'] = x => x.id\n get loading(): boolean {\n return !!this.currentFetch && !this.currentFetch.closed\n }\n\n users: UserSearchResult[] = []\n totalCount = 0\n searchTerm$ = new Subject<string | null>()\n currentSearchTerm: string | null = null\n @ViewChild(NgSelectComponent, { static: true })\n userSelect: NgSelectComponent\n\n private currentFetch: SubscriptionLike | null = null\n\n constructor(private userService: UserReadService) { }\n\n ngOnInit() {\n this.searchTerm$.pipe(\n distinctUntilChanged(),\n debounceTime(this.searchTermDebounceTime),\n )\n .subscribe(x => {\n this.currentSearchTerm = x\n this.users = []\n this.totalCount = 0\n if (this.currentFetch) {\n this.currentFetch.unsubscribe()\n this.currentFetch = null\n }\n this.fetchNextPage()\n })\n }\n\n ngOnChanges(changes: SimpleChanges) {\n }\n\n ngAfterViewInit() {\n }\n\n writeValue(x: User | null): void {\n this.userSelect.writeValue(x)\n }\n\n registerOnChange(fn: (...args: any[]) => any): void {\n this.userSelect.registerOnChange(fn)\n }\n\n registerOnTouched(fn: (...args: any[]) => any): void {\n this.userSelect.registerOnTouched(fn)\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.userSelect.setDisabledState(isDisabled)\n }\n\n onOpen() {\n if (this.users.length === 0) {\n this.fetchNextPage()\n }\n }\n\n onScroll({ end }: { start: number, end: number }) {\n if (end < this.users.length - this.nextPageScrollThreshold || this.users.length === this.totalCount) {\n return\n }\n this.fetchNextPage()\n }\n\n onScrollToEnd() {\n\n }\n\n fetchNextPage() {\n if (this.currentFetch) {\n if (this.currentFetch.closed) {\n this.currentFetch = null\n }\n else {\n return\n }\n }\n const nextPage = pageForItemIndex(this.users.length, this.baseFindParams.pageSize)\n const findParams: UserSearchParams = {\n ...this.baseFindParams,\n pageIndex: nextPage\n }\n if (this.currentSearchTerm) {\n findParams.term = this.currentSearchTerm\n }\n this.currentFetch = this.userService.search(findParams).subscribe(page => {\n this.users = this.users.concat(page.items)\n if (typeof page.totalCount === 'number') {\n this.totalCount = page.totalCount\n }\n })\n }\n}","import { ScrollingModule } from '@angular/cdk/scrolling'\nimport { CommonModule } from '@angular/common'\nimport { NgModule } from '@angular/core'\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms'\nimport { MatAutocompleteModule } from '@angular/material/autocomplete'\nimport { MatDialogModule } from '@angular/material/dialog'\nimport { MatFormFieldModule } from '@angular/material/form-field'\nimport { MatInputModule } from '@angular/material/input'\nimport { MatListModule } from '@angular/material/list'\nimport { MatSelectModule } from '@angular/material/select'\nimport { UserSelectComponent } from './user-select/user-select.component'\nimport { NgSelectModule } from '@ng-select/ng-select'\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n ScrollingModule,\n MatAutocompleteModule,\n MatDialogModule,\n MatFormFieldModule,\n MatInputModule,\n MatListModule,\n MatSelectModule,\n NgSelectModule,\n ],\n declarations: [\n UserSelectComponent\n ],\n exports: [\n UserSelectComponent\n ]\n})\nexport class MageUserModule {\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i0.ɵɵelementStart","i0.ɵɵtext","i0.ɵɵelementEnd","i0.ɵɵadvance","i0.ɵɵtextInterpolate1","i0.ɵɵtextInterpolate2","i0.ɵɵtextInterpolate","i0.ɵɵlistener","i0.ɵɵtemplate","i0.ɵɵproperty"],"mappings":";;;;;;;;;;;;;;;;;IAMa,kBAAkB,GAAG,kBAAiB;AASnD,IAAM,OAAO,GAA2D;IACtE,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,MAAM;IACjB,iBAAiB,EAAE,OAAO;CAC3B,CAAA;;IAOC,yBAAoB,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;KAAK;IAEzC,gCAAM,GAAN,UAAO,KAAuB;QAC5B,IAAM,WAAW,GAAsB;YACrC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;YACjC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC;SAC9B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cAAc;cArB1B,QAAQ;eAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,eAAe;oBACf,qBAAqB;oBACrB,eAAe;oBACf,kBAAkB;oBAClB,cAAc;oBACd,aAAa;oBACb,eAAe;oBACf,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,mBAAmB;iBACpB;aACF;;;ACjCD;;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ɵɵdefineNgModule, ɵɵdefineInjector, ɵɵsetNgModuleScope, ɵsetClassMetadata, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
var MageCoreLibModule = /** @class */ (function () {
|
|
5
|
+
function MageCoreLibModule() {
|
|
6
|
+
}
|
|
7
|
+
MageCoreLibModule.ɵmod = ɵɵdefineNgModule({ type: MageCoreLibModule });
|
|
8
|
+
MageCoreLibModule.ɵinj = ɵɵdefineInjector({ factory: function MageCoreLibModule_Factory(t) { return new (t || MageCoreLibModule)(); }, imports: [[
|
|
9
|
+
CommonModule
|
|
10
|
+
]] });
|
|
11
|
+
return MageCoreLibModule;
|
|
12
|
+
}());
|
|
13
|
+
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(MageCoreLibModule, { imports: [CommonModule] }); })();
|
|
14
|
+
/*@__PURE__*/ (function () { ɵsetClassMetadata(MageCoreLibModule, [{
|
|
15
|
+
type: NgModule,
|
|
16
|
+
args: [{
|
|
17
|
+
declarations: [],
|
|
18
|
+
imports: [
|
|
19
|
+
CommonModule
|
|
20
|
+
]
|
|
21
|
+
}]
|
|
22
|
+
}], null, null); })();
|
|
23
|
+
|
|
24
|
+
/*
|
|
25
|
+
* Public API Surface of core-lib
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Generated bundle index. Do not edit.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export { MageCoreLibModule };
|
|
33
|
+
//# sourceMappingURL=ngageoint-mage.web-core-lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngageoint-mage.web-core-lib.js","sources":["ng://@ngageoint/mage.web-core-lib/mage-core-lib.module.ts","ng://@ngageoint/mage.web-core-lib/public-api.ts","ng://@ngageoint/mage.web-core-lib/ngageoint-mage.web-core-lib.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n\n\n@NgModule({\n declarations: [],\n imports: [\n CommonModule\n ]\n})\nexport class MageCoreLibModule { }\n","/*\n * Public API Surface of core-lib\n */\n\nexport * from './mage-core-lib.module'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;IAKA;KAMkC;sDAArB,iBAAiB;kHAAjB,iBAAiB,kBAJnB;gBACP,YAAY;aACb;4BATH;CAKA,IAMkC;qFAArB,iBAAiB,cAH1B,YAAY;+CAGH,iBAAiB;cAN7B,QAAQ;eAAC;gBACR,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE;oBACP,YAAY;iBACb;aACF;;;ACVD;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
export declare class MageCoreLibModule {
|
|
4
|
+
static ɵmod: i0.ɵɵNgModuleDefWithMeta<MageCoreLibModule, never, [typeof i1.CommonModule], never>;
|
|
5
|
+
static ɵinj: i0.ɵɵInjectorDef<MageCoreLibModule>;
|
|
6
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ngageoint/mage.web-core-lib",
|
|
3
|
+
"version": "6.2.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/ngageoint/mage-server.git"
|
|
7
|
+
},
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@angular/animations": "~9.1.13",
|
|
10
|
+
"@angular/cdk": "^9.2.4",
|
|
11
|
+
"@angular/common": "^9.1.13",
|
|
12
|
+
"@angular/core": "^9.1.13",
|
|
13
|
+
"@angular/forms": "~9.1.13",
|
|
14
|
+
"@angular/material": "~9.2.4",
|
|
15
|
+
"@angular/platform-browser": "~9.1.13",
|
|
16
|
+
"@ng-select/ng-select": "4.0.4",
|
|
17
|
+
"rxjs": "~6.6.7"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@types/geojson": "^7946.0.7",
|
|
21
|
+
"tslib": "^1.10.0"
|
|
22
|
+
},
|
|
23
|
+
"main": "bundles/ngageoint-mage.web-core-lib.umd.js",
|
|
24
|
+
"module": "fesm5/ngageoint-mage.web-core-lib.js",
|
|
25
|
+
"es2015": "fesm2015/ngageoint-mage.web-core-lib.js",
|
|
26
|
+
"esm5": "esm5/ngageoint-mage.web-core-lib.js",
|
|
27
|
+
"esm2015": "esm2015/ngageoint-mage.web-core-lib.js",
|
|
28
|
+
"fesm5": "fesm5/ngageoint-mage.web-core-lib.js",
|
|
29
|
+
"fesm2015": "fesm2015/ngageoint-mage.web-core-lib.js",
|
|
30
|
+
"typings": "ngageoint-mage.web-core-lib.d.ts",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"scripts": {
|
|
33
|
+
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy. This is not allowed.\\nPlease delete and rebuild the package, without compiling with Ivy, before attempting to publish.\\n')\" && exit 1"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/ngageoint-mage.web-core-lib-paging.umd.js",
|
|
3
|
+
"module": "../fesm5/ngageoint-mage.web-core-lib-paging.js",
|
|
4
|
+
"es2015": "../fesm2015/ngageoint-mage.web-core-lib-paging.js",
|
|
5
|
+
"esm5": "../esm5/paging/ngageoint-mage.web-core-lib-paging.js",
|
|
6
|
+
"esm2015": "../esm2015/paging/ngageoint-mage.web-core-lib-paging.js",
|
|
7
|
+
"fesm5": "../fesm5/ngageoint-mage.web-core-lib-paging.js",
|
|
8
|
+
"fesm2015": "../fesm2015/ngageoint-mage.web-core-lib-paging.js",
|
|
9
|
+
"typings": "ngageoint-mage.web-core-lib-paging.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"name": "@ngageoint/mage.web-core-lib/paging"
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CollectionViewer, DataSource } from '@angular/cdk/collections';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { PageOf, PagingParameters } from './paging.model';
|
|
4
|
+
/**
|
|
5
|
+
* This class is an adaptation from the [Angular Material Guide](https://v8.material.angular.io/cdk/scrolling/overview), _"Specifying data" example_, also
|
|
6
|
+
* available on [StackBlitz](https://stackblitz.com/angular/mrbkjagnnra?file=src%2Fapp%2Fcdk-virtual-scroll-data-source-example.ts).
|
|
7
|
+
*/
|
|
8
|
+
export declare class PagingDataSource<T> extends DataSource<T> {
|
|
9
|
+
private pageSize;
|
|
10
|
+
private fetchPage;
|
|
11
|
+
private data;
|
|
12
|
+
private data$;
|
|
13
|
+
private fetchedPages;
|
|
14
|
+
private subscription;
|
|
15
|
+
constructor(pageSize: number, fetchPage: (paging: PagingParameters) => Observable<PageOf<T>>);
|
|
16
|
+
connect(collectionViewer: CollectionViewer): Observable<T[]>;
|
|
17
|
+
disconnect(): void;
|
|
18
|
+
private pageForItemIndex;
|
|
19
|
+
private fetch;
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface PagingParameters {
|
|
2
|
+
pageSize: number;
|
|
3
|
+
pageIndex: number;
|
|
4
|
+
includeTotalCount?: boolean | null;
|
|
5
|
+
}
|
|
6
|
+
export interface PageOf<T> {
|
|
7
|
+
pageSize: number;
|
|
8
|
+
pageIndex: number;
|
|
9
|
+
totalCount?: number | null;
|
|
10
|
+
next?: PagingParameters | null;
|
|
11
|
+
prev?: PagingParameters | null;
|
|
12
|
+
items: T[];
|
|
13
|
+
}
|
|
14
|
+
export declare const pageForItemIndex: (itemIndex: number, pageSize: number | PagingParameters) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Return the range of item indexes for the given page and page size. The last
|
|
17
|
+
* end portion of the range is exclusive, so when indexing an array the last
|
|
18
|
+
* item of the page would have position `end - 1`. This allows one to pass the
|
|
19
|
+
* values to `Array.slice()`.
|
|
20
|
+
* @param pageIndex
|
|
21
|
+
* @param pageSize
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const itemRangeOfPage: {
|
|
25
|
+
(pageIndex: number, pageSize: number): [number, number];
|
|
26
|
+
(paging: PagingParameters): any;
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/ngageoint-mage.web-core-lib-plugin.umd.js",
|
|
3
|
+
"module": "../fesm5/ngageoint-mage.web-core-lib-plugin.js",
|
|
4
|
+
"es2015": "../fesm2015/ngageoint-mage.web-core-lib-plugin.js",
|
|
5
|
+
"esm5": "../esm5/plugin/ngageoint-mage.web-core-lib-plugin.js",
|
|
6
|
+
"esm2015": "../esm2015/plugin/ngageoint-mage.web-core-lib-plugin.js",
|
|
7
|
+
"fesm5": "../fesm5/ngageoint-mage.web-core-lib-plugin.js",
|
|
8
|
+
"fesm2015": "../fesm2015/ngageoint-mage.web-core-lib-plugin.js",
|
|
9
|
+
"typings": "ngageoint-mage.web-core-lib-plugin.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"name": "@ngageoint/mage.web-core-lib/plugin"
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
export interface PluginHooks {
|
|
3
|
+
module: Type<unknown>;
|
|
4
|
+
adminTab?: {
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: {
|
|
7
|
+
path: string;
|
|
8
|
+
} | {
|
|
9
|
+
className: string;
|
|
10
|
+
} | null | undefined;
|
|
11
|
+
tabContentComponent: Type<unknown>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './plugin.model';
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mage-core-lib.module';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/ngageoint-mage.web-core-lib-static-icon.umd.js",
|
|
3
|
+
"module": "../fesm5/ngageoint-mage.web-core-lib-static-icon.js",
|
|
4
|
+
"es2015": "../fesm2015/ngageoint-mage.web-core-lib-static-icon.js",
|
|
5
|
+
"esm5": "../esm5/static-icon/ngageoint-mage.web-core-lib-static-icon.js",
|
|
6
|
+
"esm2015": "../esm2015/static-icon/ngageoint-mage.web-core-lib-static-icon.js",
|
|
7
|
+
"fesm5": "../fesm5/ngageoint-mage.web-core-lib-static-icon.js",
|
|
8
|
+
"fesm2015": "../fesm2015/ngageoint-mage.web-core-lib-static-icon.js",
|
|
9
|
+
"typings": "ngageoint-mage.web-core-lib-static-icon.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"name": "@ngageoint/mage.web-core-lib/static-icon"
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './static-icon.model';
|
|
2
|
+
export * from './static-icon.module';
|
|
3
|
+
export * from './static-icon.service';
|
|
4
|
+
export * from './static-icon-img/static-icon-img.component';
|
|
5
|
+
export * from './static-icon-form-field/static-icon-form-field.component';
|
|
6
|
+
export * from './static-icon-select/static-icon-select.component';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
3
|
+
import { AbstractControl, ControlValueAccessor, FormGroup, ValidationErrors, Validator } from '@angular/forms';
|
|
4
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
|
+
import { StaticIcon, StaticIconReference } from '../static-icon.model';
|
|
6
|
+
import { StaticIconService } from '../static-icon.service';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class StaticIconFormFieldComponent implements OnChanges, OnDestroy, ControlValueAccessor, Validator {
|
|
9
|
+
private iconService;
|
|
10
|
+
private httpClient;
|
|
11
|
+
private sanitizer;
|
|
12
|
+
iconRef: StaticIconReference;
|
|
13
|
+
form: FormGroup;
|
|
14
|
+
icon: StaticIcon | null;
|
|
15
|
+
private onChange;
|
|
16
|
+
private onValidatorChange;
|
|
17
|
+
private onTouched;
|
|
18
|
+
constructor(iconService: StaticIconService, httpClient: HttpClient, sanitizer: DomSanitizer);
|
|
19
|
+
registerOnValidatorChange?(fn: () => void): void;
|
|
20
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
onSelectIcon(): void;
|
|
23
|
+
writeValue(iconRef: StaticIconReference): void;
|
|
24
|
+
registerOnChange(fn: (x: StaticIconReference | null) => void): void;
|
|
25
|
+
registerOnTouched(fn: () => void): void;
|
|
26
|
+
setDisabledState?(isDisabled: boolean): void;
|
|
27
|
+
validate(control: AbstractControl): ValidationErrors;
|
|
28
|
+
private resolveIconRef;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDef<StaticIconFormFieldComponent, never>;
|
|
30
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<StaticIconFormFieldComponent, "mage-static-icon-form-field", never, {}, {}, never, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { RegisteredStaticIconReference } from '../static-icon.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class StaticIconImgComponent implements OnInit, OnChanges {
|
|
5
|
+
iconRef: RegisteredStaticIconReference | string | null;
|
|
6
|
+
iconPath: string | null;
|
|
7
|
+
constructor();
|
|
8
|
+
ngOnInit(): void;
|
|
9
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDef<StaticIconImgComponent, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<StaticIconImgComponent, "mage-static-icon-img", never, { "iconRef": "iconRef"; }, {}, never, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { PagingDataSource } from '@ngageoint/mage.web-core-lib/paging';
|
|
3
|
+
import { StaticIcon } from '../static-icon.model';
|
|
4
|
+
import { StaticIconService } from '../static-icon.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export interface StaticIconSelectItem {
|
|
7
|
+
id: string;
|
|
8
|
+
path: string;
|
|
9
|
+
title: string;
|
|
10
|
+
fileName: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class StaticIconSelectComponent implements OnInit {
|
|
13
|
+
private iconService;
|
|
14
|
+
icons: StaticIcon[] | null;
|
|
15
|
+
dataSource: PagingDataSource<StaticIcon>;
|
|
16
|
+
constructor(iconService: StaticIconService);
|
|
17
|
+
ngOnInit(): void;
|
|
18
|
+
onBrowseForUploadIcon(): void;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDef<StaticIconSelectComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<StaticIconSelectComponent, "static-icon-select", never, {}, {}, never, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface StaticIcon {
|
|
2
|
+
id: string;
|
|
3
|
+
sourceUrl: string;
|
|
4
|
+
contentPath: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
summary?: string;
|
|
7
|
+
fileName?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface RegisteredStaticIconReference {
|
|
11
|
+
id: string;
|
|
12
|
+
sourceUrl?: never;
|
|
13
|
+
}
|
|
14
|
+
export interface SourceUrlStaticIconReference {
|
|
15
|
+
sourceUrl: string;
|
|
16
|
+
id?: never;
|
|
17
|
+
}
|
|
18
|
+
export declare const contentPathOfIcon: (icon?: string | StaticIcon | RegisteredStaticIconReference) => string;
|
|
19
|
+
export declare type StaticIconReference = RegisteredStaticIconReference | SourceUrlStaticIconReference;
|