ngx-techlify-core 11.2.5 → 11.2.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngx-techlify-core.umd.js +40 -26
- package/bundles/ngx-techlify-core.umd.js.map +1 -1
- package/bundles/ngx-techlify-core.umd.min.js +2 -2
- package/bundles/ngx-techlify-core.umd.min.js.map +1 -1
- package/esm2015/lib/note/note-form/note-form.component.js +4 -3
- package/esm2015/lib/note/note-list/note-list.component.js +12 -11
- package/esm2015/lib/searchable-selector/searchable-selector.component.js +7 -2
- package/esm2015/lib/techlify-update/update-notifier/update-notifier-snack/update-notifier-snack.component.js +3 -3
- package/esm2015/lib/timeline-filter/calculate-timeline.js +3 -3
- package/esm2015/lib/timeline-filter/timeline-filter.component.js +10 -4
- package/fesm2015/ngx-techlify-core.js +33 -19
- package/fesm2015/ngx-techlify-core.js.map +1 -1
- package/lib/note/note-list/note-list.component.d.ts +2 -3
- package/lib/searchable-selector/searchable-selector.component.d.ts +1 -0
- package/lib/timeline-filter/timeline-filter.component.d.ts +3 -0
- package/ngx-techlify-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1937,10 +1937,11 @@
|
|
|
1937
1937
|
};
|
|
1938
1938
|
//Method to trigger login
|
|
1939
1939
|
NoteFormComponent.prototype.submit = function () {
|
|
1940
|
+
var _a;
|
|
1940
1941
|
return __awaiter(this, void 0, void 0, function () {
|
|
1941
|
-
var model, result,
|
|
1942
|
-
return __generator(this, function (
|
|
1943
|
-
switch (
|
|
1942
|
+
var model, result, _b;
|
|
1943
|
+
return __generator(this, function (_c) {
|
|
1944
|
+
switch (_c.label) {
|
|
1944
1945
|
case 0:
|
|
1945
1946
|
this.noteFormFirstAttempt = true;
|
|
1946
1947
|
if (!this.noteFormGroup.valid) return [3 /*break*/, 5];
|
|
@@ -1948,17 +1949,17 @@
|
|
|
1948
1949
|
if (!this.updateMode) return [3 /*break*/, 2];
|
|
1949
1950
|
return [4 /*yield*/, this.noteService.editNote(model)];
|
|
1950
1951
|
case 1:
|
|
1951
|
-
|
|
1952
|
+
_b = _c.sent();
|
|
1952
1953
|
return [3 /*break*/, 4];
|
|
1953
1954
|
case 2: return [4 /*yield*/, this.noteService.addNote(model)];
|
|
1954
1955
|
case 3:
|
|
1955
|
-
|
|
1956
|
-
|
|
1956
|
+
_b = _c.sent();
|
|
1957
|
+
_c.label = 4;
|
|
1957
1958
|
case 4:
|
|
1958
|
-
result =
|
|
1959
|
-
this.alertService.addAlert("
|
|
1959
|
+
result = _b;
|
|
1960
|
+
this.alertService.addAlert(((_a = this.data) === null || _a === void 0 ? void 0 : _a.labelText) + " saved successfully", "success");
|
|
1960
1961
|
this.dialogRef.close(result);
|
|
1961
|
-
|
|
1962
|
+
_c.label = 5;
|
|
1962
1963
|
case 5: return [2 /*return*/];
|
|
1963
1964
|
}
|
|
1964
1965
|
});
|
|
@@ -1980,7 +1981,7 @@
|
|
|
1980
1981
|
NoteFormComponent.decorators = [
|
|
1981
1982
|
{ type: i0.Component, args: [{
|
|
1982
1983
|
selector: 'app-note-form',
|
|
1983
|
-
template: "<form [formGroup]=\"noteFormGroup\" (ngSubmit)=\"submit()\">\n <div fxLayout=\"column\" class=\"mat-typography\">\n <div mat-dialog-title class=\"text-center\">\n <div>
|
|
1984
|
+
template: "<form [formGroup]=\"noteFormGroup\" (ngSubmit)=\"submit()\">\n <div fxLayout=\"column\" class=\"mat-typography\">\n <div mat-dialog-title class=\"text-center\">\n <div>{{data?.labelText}}</div>\n </div>\n\n <div mat-dialog-content fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between\">\n <mat-form-field fxFlex=\"100%\">\n <textarea matInput formControlName=\"note\" placeholder=\"{{data?.labelText}}\" autocomplete=\"off\"\n required></textarea>\n <mat-error *ngIf=\"isFieldValid('note')\">{{\n getErrorMessage(\"note\")\n }}</mat-error>\n </mat-form-field>\n\n <div class=\"my-2\" fxLayout=\"row\" fxLayoutGap=\"30px\" fxLayoutAlign=\"end\" fxFlex=\"100%\">\n <button mat-raised-button type=\"button\" (click)=\"cancel()\">\n Cancel\n </button>\n <button mat-raised-button type=\"submit\" color=\"primary\">Save</button>\n </div>\n </div>\n </div>\n </div>\n</form>",
|
|
1984
1985
|
styles: [""]
|
|
1985
1986
|
},] }
|
|
1986
1987
|
];
|
|
@@ -1994,11 +1995,11 @@
|
|
|
1994
1995
|
]; };
|
|
1995
1996
|
|
|
1996
1997
|
var NoteListComponent = /** @class */ (function () {
|
|
1997
|
-
function NoteListComponent(noteService,
|
|
1998
|
+
function NoteListComponent(noteService, dialog) {
|
|
1998
1999
|
this.noteService = noteService;
|
|
1999
|
-
this.alertService = alertService;
|
|
2000
2000
|
this.dialog = dialog;
|
|
2001
2001
|
this.readonly = false;
|
|
2002
|
+
this.labelText = 'Note';
|
|
2002
2003
|
this.notes = [];
|
|
2003
2004
|
this.displayedColumns = [
|
|
2004
2005
|
'index',
|
|
@@ -2039,7 +2040,8 @@
|
|
|
2039
2040
|
var dialogRef = this.dialog.open(NoteFormComponent, {
|
|
2040
2041
|
width: "400px",
|
|
2041
2042
|
data: {
|
|
2042
|
-
note: { related_model_id: this.relatedModelId, model_type: this.modelType }
|
|
2043
|
+
note: { related_model_id: this.relatedModelId, model_type: this.modelType },
|
|
2044
|
+
labelText: this.labelText,
|
|
2043
2045
|
},
|
|
2044
2046
|
autoFocus: false
|
|
2045
2047
|
});
|
|
@@ -2056,7 +2058,8 @@
|
|
|
2056
2058
|
width: "400px",
|
|
2057
2059
|
data: {
|
|
2058
2060
|
note: note,
|
|
2059
|
-
update: true
|
|
2061
|
+
update: true,
|
|
2062
|
+
labelText: this.labelText
|
|
2060
2063
|
},
|
|
2061
2064
|
autoFocus: false
|
|
2062
2065
|
});
|
|
@@ -2075,8 +2078,8 @@
|
|
|
2075
2078
|
dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
2076
2079
|
width: "400px",
|
|
2077
2080
|
data: {
|
|
2078
|
-
title: "Delete
|
|
2079
|
-
message: "Are you sure to delete
|
|
2081
|
+
title: "Delete " + this.labelText,
|
|
2082
|
+
message: "Are you sure to delete?"
|
|
2080
2083
|
},
|
|
2081
2084
|
autoFocus: false
|
|
2082
2085
|
});
|
|
@@ -2115,19 +2118,19 @@
|
|
|
2115
2118
|
NoteListComponent.decorators = [
|
|
2116
2119
|
{ type: i0.Component, args: [{
|
|
2117
2120
|
selector: 'app-note-list',
|
|
2118
|
-
template: "<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" class=\"m-4\">\n\n <div fxLayout fxLayoutAlign=\"
|
|
2121
|
+
template: "<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" class=\"m-4\">\n\n <div fxLayout fxLayoutAlign=\"center center\" fxLayoutGap=\"1rem\">\n <h3 class=\"m-0 font-weight-bold mr-3\">{{labelText}}s</h3>\n <button class=\"d-print-none\" *ngIf=\"!readonly\" mat-raised-button color=\"primary\" type=\"button\"\n (click)=\"addNote()\">+ Add</button>\n </div>\n\n <div class=\"w-00 scroll-container\" infiniteScroll [infiniteScrollDistance]=\"1\" [infiniteScrollThrottle]=\"50\"\n (scrolled)=\"onScroll()\" [scrollWindow]=\"false\">\n <table mat-table [dataSource]=\"notes\" class=\"w-100\" multiTemplateDataRows>\n\n <!-- Index Column -->\n <ng-container matColumnDef=\"index\">\n <th mat-header-cell *matHeaderCellDef> # </th>\n <td mat-cell *matCellDef=\"let note; let i = dataIndex\"> {{ i+1 }} </td>\n </ng-container>\n\n\n <ng-container matColumnDef=\"note\">\n <th mat-header-cell *matHeaderCellDef> {{labelText}} </th>\n <td mat-cell *matCellDef=\"let note\">\n {{note?.note}}\n </td>\n </ng-container>\n\n <ng-container matColumnDef=\"actions\">\n <th mat-header-cell *matHeaderCellDef class=\"d-print-none\"> Actions </th>\n <td mat-cell *matCellDef=\"let note\" class=\"d-print-none\">\n <button type=\"button\" mat-icon-button (click)=\"editNote(note)\">\n <mat-icon>edit</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"deleteNote(note)\">\n <mat-icon>delete</mat-icon>\n </button>\n </td>\n </ng-container>\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n </table>\n </div>\n\n</div>",
|
|
2119
2122
|
styles: [".scroll-container{max-height:400px;overflow-y:auto}"]
|
|
2120
2123
|
},] }
|
|
2121
2124
|
];
|
|
2122
2125
|
NoteListComponent.ctorParameters = function () { return [
|
|
2123
2126
|
{ type: NoteService },
|
|
2124
|
-
{ type: AlertService },
|
|
2125
2127
|
{ type: dialog.MatDialog }
|
|
2126
2128
|
]; };
|
|
2127
2129
|
NoteListComponent.propDecorators = {
|
|
2128
2130
|
relatedModelId: [{ type: i0.Input }],
|
|
2129
2131
|
modelType: [{ type: i0.Input }],
|
|
2130
|
-
readonly: [{ type: i0.Input }]
|
|
2132
|
+
readonly: [{ type: i0.Input }],
|
|
2133
|
+
labelText: [{ type: i0.Input }]
|
|
2131
2134
|
};
|
|
2132
2135
|
|
|
2133
2136
|
var SearchableSelectorComponent_1;
|
|
@@ -2148,6 +2151,7 @@
|
|
|
2148
2151
|
this.edit = false;
|
|
2149
2152
|
this.sort = true;
|
|
2150
2153
|
this.selectionChange = new i0.EventEmitter();
|
|
2154
|
+
this.itemsChange = new i0.EventEmitter();
|
|
2151
2155
|
this.isLoading = false;
|
|
2152
2156
|
this.onChange = function () { };
|
|
2153
2157
|
this.onTouched = function () { };
|
|
@@ -2236,7 +2240,10 @@
|
|
|
2236
2240
|
items = __spread([this.selectedValue], this.items);
|
|
2237
2241
|
else
|
|
2238
2242
|
items = this.items;
|
|
2239
|
-
|
|
2243
|
+
items = items.filter(function (v, i, a) { return a.findIndex(function (v) { return v[_this.valueField] === a[i][_this.valueField]; }) === i; });
|
|
2244
|
+
//Emit the items to any child component
|
|
2245
|
+
this.itemsChange.emit(items);
|
|
2246
|
+
return items;
|
|
2240
2247
|
},
|
|
2241
2248
|
enumerable: false,
|
|
2242
2249
|
configurable: true
|
|
@@ -2413,6 +2420,7 @@
|
|
|
2413
2420
|
searchField: [{ type: i0.Input }],
|
|
2414
2421
|
itemComponent: [{ type: i0.Input }],
|
|
2415
2422
|
selectionChange: [{ type: i0.Output }],
|
|
2423
|
+
itemsChange: [{ type: i0.Output }],
|
|
2416
2424
|
required: [{ type: i0.Input }],
|
|
2417
2425
|
disabled: [{ type: i0.Input }],
|
|
2418
2426
|
value: [{ type: i0.Input }]
|
|
@@ -2620,12 +2628,12 @@
|
|
|
2620
2628
|
};
|
|
2621
2629
|
|
|
2622
2630
|
function calculateTimeline(value) {
|
|
2631
|
+
var date = new Date();
|
|
2623
2632
|
var data = {
|
|
2624
2633
|
'date_from': date,
|
|
2625
2634
|
'date_to': date,
|
|
2626
2635
|
'show_custom_field': false
|
|
2627
2636
|
};
|
|
2628
|
-
var date = new Date();
|
|
2629
2637
|
switch (value) {
|
|
2630
2638
|
case 1: { //Custom
|
|
2631
2639
|
data.show_custom_field = true;
|
|
@@ -2743,6 +2751,9 @@
|
|
|
2743
2751
|
{ value: 11, viewValue: 'Last Year' },
|
|
2744
2752
|
{ value: 12, viewValue: 'All dates' },
|
|
2745
2753
|
];
|
|
2754
|
+
this.labelText = 'Select Timeline';
|
|
2755
|
+
this.dateFrom = 'date_from';
|
|
2756
|
+
this.dateTo = 'date_to';
|
|
2746
2757
|
this.showCustomDateFields = false;
|
|
2747
2758
|
}
|
|
2748
2759
|
Object.defineProperty(TimelineFilterComponent.prototype, "defaultValue", {
|
|
@@ -2767,8 +2778,8 @@
|
|
|
2767
2778
|
TimelineFilterComponent.prototype.changeTimeline = function (value) {
|
|
2768
2779
|
var timeline = calculateTimeline(value);
|
|
2769
2780
|
if (timeline) {
|
|
2770
|
-
this.setFieldValue(
|
|
2771
|
-
this.setFieldValue(
|
|
2781
|
+
this.setFieldValue(this.dateFrom, timeline.date_from);
|
|
2782
|
+
this.setFieldValue(this.dateTo, timeline.date_to);
|
|
2772
2783
|
this.showCustomDateFields = timeline.show_custom_field;
|
|
2773
2784
|
}
|
|
2774
2785
|
};
|
|
@@ -2777,13 +2788,16 @@
|
|
|
2777
2788
|
TimelineFilterComponent.decorators = [
|
|
2778
2789
|
{ type: i0.Component, args: [{
|
|
2779
2790
|
selector: 'app-timeline-filter',
|
|
2780
|
-
template: "<ng-container [formGroup]=\"form\">\n <mat-form-field>\n <mat-label>
|
|
2791
|
+
template: "<ng-container [formGroup]=\"form\">\n <mat-form-field>\n <mat-label>{{labelText}}</mat-label>\n <mat-select (selectionChange)=\"changeTimeline($event.value)\" [value]=\"timelineValue\">\n <mat-option *ngFor=\"let timeline of timelines\" [value]=\"timeline.value\">\n {{timeline.viewValue}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <ng-container *ngIf=\"showCustomDateFields\">\n <mat-form-field>\n <input matInput formControlName=\"{{dateFrom}}\" [matDatepicker]=\"fromPicker\" (click)=\"fromPicker.open()\"\n placeholder=\"From Date\" readonly />\n <mat-datepicker-toggle matSuffix [for]=\"fromPicker\"></mat-datepicker-toggle>\n <mat-datepicker #fromPicker></mat-datepicker>\n <button mat-button *ngIf=\"getFieldValue(dateFrom)\" matSuffix mat-icon-button\n (click)=\"resetFieldValue(dateFrom)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n <mat-form-field>\n <input matInput formControlName=\"{{dateTo}}\" [matDatepicker]=\"toPicker\" (click)=\"toPicker.open()\"\n placeholder=\"To Date\" readonly />\n <mat-datepicker-toggle matSuffix [for]=\"\"></mat-datepicker-toggle>\n <mat-datepicker #toPicker></mat-datepicker>\n <button mat-button *ngIf=\"getFieldValue(dateTo)\" matSuffix mat-icon-button\n (click)=\"resetFieldValue(dateTo)\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n\n </ng-container>\n</ng-container>",
|
|
2781
2792
|
styles: [""]
|
|
2782
2793
|
},] }
|
|
2783
2794
|
];
|
|
2784
2795
|
TimelineFilterComponent.ctorParameters = function () { return []; };
|
|
2785
2796
|
TimelineFilterComponent.propDecorators = {
|
|
2786
2797
|
timelines: [{ type: i0.Input }],
|
|
2798
|
+
labelText: [{ type: i0.Input }],
|
|
2799
|
+
dateFrom: [{ type: i0.Input }],
|
|
2800
|
+
dateTo: [{ type: i0.Input }],
|
|
2787
2801
|
form: [{ type: i0.Input }],
|
|
2788
2802
|
defaultValue: [{ type: i0.Input }]
|
|
2789
2803
|
};
|
|
@@ -5148,8 +5162,8 @@
|
|
|
5148
5162
|
UpdateNotifierSnackComponent.decorators = [
|
|
5149
5163
|
{ type: i0.Component, args: [{
|
|
5150
5164
|
selector: 'app-update-notifier-snack',
|
|
5151
|
-
template: "<div fxLayout=\"column\">\n
|
|
5152
|
-
styles: [".large-icon{transform:scale(
|
|
5165
|
+
template: "<div fxLayout=\"column\">\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between\">\n <div fxLayout=\"row wrap\" fxLayoutGap=\"1rem\">\n <span fxLayoutAlign=\"center center\">\n <mat-icon class=\"large-icon primary-color\">\n <span class=\"material-icons-outlined\">\n grading\n </span>\n </mat-icon>\n </span>\n <div fxLayout=\"column\">\n <h5 class=\"primary-color text-truncate\" matTooltip=\"{{techlifyUpdate?.title}}\" matTooltipPosition=\"below\">\n App Update: {{techlifyUpdate?.title}}\n </h5>\n <small class=\"text-muted\">\n Version : {{techlifyUpdate?.version}}\n </small>\n </div>\n </div>\n <div fxLayoutAlign=\"end center\" class=\"text-muted\">\n <button mat-icon-button type=\"button\" (click)=\"close()\">\n <mat-icon>clear</mat-icon>\n </button>\n </div>\n </div>\n <div fxLayout=\"row\" class=\"text-muted\" style=\"margin-top: 1rem;\" [innerHtml]=\"descriptionText\">\n </div>\n <div fxLayout=\"row\" fxLayoutAlign=\"space-between\">\n <button type=\"button\" mat-button class=\"primary-color\" (click)=\"openUpdateHistory()\">\n <mat-icon>\n history\n </mat-icon>\n Update History\n </button>\n <button type=\"button\" mat-raised-button class=\"primary-bg text-white\" (click)=\"openUpdateView()\">\n View\n </button>\n </div>\n</div>\n",
|
|
5166
|
+
styles: [".large-icon{transform:scale(1.5)}.primary-color{color:#009fdd!important}.primary-bg{background-color:#009fdd!important}.text-muted,.text-white{color:#d3d3d3}.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:400px}@media screen and (max-width:1440px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:350px}}@media screen and (max-width:1024px){.text-truncate{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:220px;width:190px}}"]
|
|
5153
5167
|
},] }
|
|
5154
5168
|
];
|
|
5155
5169
|
UpdateNotifierSnackComponent.ctorParameters = function () { return [
|