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
|
@@ -1552,6 +1552,7 @@ class NoteFormComponent {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
//Method to trigger login
|
|
1554
1554
|
submit() {
|
|
1555
|
+
var _a;
|
|
1555
1556
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1556
1557
|
this.noteFormFirstAttempt = true;
|
|
1557
1558
|
if (this.noteFormGroup.valid) {
|
|
@@ -1559,7 +1560,7 @@ class NoteFormComponent {
|
|
|
1559
1560
|
const result = this.updateMode
|
|
1560
1561
|
? yield this.noteService.editNote(model)
|
|
1561
1562
|
: yield this.noteService.addNote(model);
|
|
1562
|
-
this.alertService.addAlert(
|
|
1563
|
+
this.alertService.addAlert(`${(_a = this.data) === null || _a === void 0 ? void 0 : _a.labelText} saved successfully`, "success");
|
|
1563
1564
|
this.dialogRef.close(result);
|
|
1564
1565
|
}
|
|
1565
1566
|
});
|
|
@@ -1579,7 +1580,7 @@ class NoteFormComponent {
|
|
|
1579
1580
|
NoteFormComponent.decorators = [
|
|
1580
1581
|
{ type: Component, args: [{
|
|
1581
1582
|
selector: 'app-note-form',
|
|
1582
|
-
template: "<form [formGroup]=\"noteFormGroup\" (ngSubmit)=\"submit()\">\n <div fxLayout=\"column\" class=\"mat-typography\">\n <div mat-dialog-title class=\"text-center\">\n <div>
|
|
1583
|
+
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>",
|
|
1583
1584
|
styles: [""]
|
|
1584
1585
|
},] }
|
|
1585
1586
|
];
|
|
@@ -1593,11 +1594,11 @@ NoteFormComponent.ctorParameters = () => [
|
|
|
1593
1594
|
];
|
|
1594
1595
|
|
|
1595
1596
|
class NoteListComponent {
|
|
1596
|
-
constructor(noteService,
|
|
1597
|
+
constructor(noteService, dialog) {
|
|
1597
1598
|
this.noteService = noteService;
|
|
1598
|
-
this.alertService = alertService;
|
|
1599
1599
|
this.dialog = dialog;
|
|
1600
1600
|
this.readonly = false;
|
|
1601
|
+
this.labelText = 'Note';
|
|
1601
1602
|
this.notes = [];
|
|
1602
1603
|
this.displayedColumns = [
|
|
1603
1604
|
'index',
|
|
@@ -1629,7 +1630,8 @@ class NoteListComponent {
|
|
|
1629
1630
|
const dialogRef = this.dialog.open(NoteFormComponent, {
|
|
1630
1631
|
width: "400px",
|
|
1631
1632
|
data: {
|
|
1632
|
-
note: { related_model_id: this.relatedModelId, model_type: this.modelType }
|
|
1633
|
+
note: { related_model_id: this.relatedModelId, model_type: this.modelType },
|
|
1634
|
+
labelText: this.labelText,
|
|
1633
1635
|
},
|
|
1634
1636
|
autoFocus: false
|
|
1635
1637
|
});
|
|
@@ -1645,7 +1647,8 @@ class NoteListComponent {
|
|
|
1645
1647
|
width: "400px",
|
|
1646
1648
|
data: {
|
|
1647
1649
|
note: note,
|
|
1648
|
-
update: true
|
|
1650
|
+
update: true,
|
|
1651
|
+
labelText: this.labelText
|
|
1649
1652
|
},
|
|
1650
1653
|
autoFocus: false
|
|
1651
1654
|
});
|
|
@@ -1661,8 +1664,8 @@ class NoteListComponent {
|
|
|
1661
1664
|
const dialogRef = this.dialog.open(ActionPopupComponent, {
|
|
1662
1665
|
width: "400px",
|
|
1663
1666
|
data: {
|
|
1664
|
-
title:
|
|
1665
|
-
message: `Are you sure to delete
|
|
1667
|
+
title: `Delete ${this.labelText}`,
|
|
1668
|
+
message: `Are you sure to delete?`
|
|
1666
1669
|
},
|
|
1667
1670
|
autoFocus: false
|
|
1668
1671
|
});
|
|
@@ -1690,19 +1693,19 @@ class NoteListComponent {
|
|
|
1690
1693
|
NoteListComponent.decorators = [
|
|
1691
1694
|
{ type: Component, args: [{
|
|
1692
1695
|
selector: 'app-note-list',
|
|
1693
|
-
template: "<div fxLayout=\"column\" fxLayoutGap=\"1.5rem\" class=\"m-4\">\n\n <div fxLayout fxLayoutAlign=\"
|
|
1696
|
+
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>",
|
|
1694
1697
|
styles: [".scroll-container{max-height:400px;overflow-y:auto}"]
|
|
1695
1698
|
},] }
|
|
1696
1699
|
];
|
|
1697
1700
|
NoteListComponent.ctorParameters = () => [
|
|
1698
1701
|
{ type: NoteService },
|
|
1699
|
-
{ type: AlertService },
|
|
1700
1702
|
{ type: MatDialog }
|
|
1701
1703
|
];
|
|
1702
1704
|
NoteListComponent.propDecorators = {
|
|
1703
1705
|
relatedModelId: [{ type: Input }],
|
|
1704
1706
|
modelType: [{ type: Input }],
|
|
1705
|
-
readonly: [{ type: Input }]
|
|
1707
|
+
readonly: [{ type: Input }],
|
|
1708
|
+
labelText: [{ type: Input }]
|
|
1706
1709
|
};
|
|
1707
1710
|
|
|
1708
1711
|
var SearchableSelectorComponent_1;
|
|
@@ -1722,6 +1725,7 @@ let SearchableSelectorComponent = SearchableSelectorComponent_1 = class Searchab
|
|
|
1722
1725
|
this.edit = false;
|
|
1723
1726
|
this.sort = true;
|
|
1724
1727
|
this.selectionChange = new EventEmitter();
|
|
1728
|
+
this.itemsChange = new EventEmitter();
|
|
1725
1729
|
this.isLoading = false;
|
|
1726
1730
|
this.onChange = () => { };
|
|
1727
1731
|
this.onTouched = () => { };
|
|
@@ -1788,7 +1792,10 @@ let SearchableSelectorComponent = SearchableSelectorComponent_1 = class Searchab
|
|
|
1788
1792
|
items = [this.selectedValue, ...this.items];
|
|
1789
1793
|
else
|
|
1790
1794
|
items = this.items;
|
|
1791
|
-
|
|
1795
|
+
items = items.filter((v, i, a) => a.findIndex(v => v[this.valueField] === a[i][this.valueField]) === i);
|
|
1796
|
+
//Emit the items to any child component
|
|
1797
|
+
this.itemsChange.emit(items);
|
|
1798
|
+
return items;
|
|
1792
1799
|
}
|
|
1793
1800
|
ngOnInit() {
|
|
1794
1801
|
this.selectorForm.get('search').valueChanges
|
|
@@ -1952,6 +1959,7 @@ SearchableSelectorComponent.propDecorators = {
|
|
|
1952
1959
|
searchField: [{ type: Input }],
|
|
1953
1960
|
itemComponent: [{ type: Input }],
|
|
1954
1961
|
selectionChange: [{ type: Output }],
|
|
1962
|
+
itemsChange: [{ type: Output }],
|
|
1955
1963
|
required: [{ type: Input }],
|
|
1956
1964
|
disabled: [{ type: Input }],
|
|
1957
1965
|
value: [{ type: Input }]
|
|
@@ -2150,12 +2158,12 @@ NumberSelector.propDecorators = {
|
|
|
2150
2158
|
};
|
|
2151
2159
|
|
|
2152
2160
|
function calculateTimeline(value) {
|
|
2153
|
-
|
|
2161
|
+
const date = new Date();
|
|
2162
|
+
const data = {
|
|
2154
2163
|
'date_from': date,
|
|
2155
2164
|
'date_to': date,
|
|
2156
2165
|
'show_custom_field': false
|
|
2157
2166
|
};
|
|
2158
|
-
var date = new Date();
|
|
2159
2167
|
switch (value) {
|
|
2160
2168
|
case 1: { //Custom
|
|
2161
2169
|
data.show_custom_field = true;
|
|
@@ -2270,6 +2278,9 @@ class TimelineFilterComponent {
|
|
|
2270
2278
|
{ value: 11, viewValue: 'Last Year' },
|
|
2271
2279
|
{ value: 12, viewValue: 'All dates' },
|
|
2272
2280
|
];
|
|
2281
|
+
this.labelText = 'Select Timeline';
|
|
2282
|
+
this.dateFrom = 'date_from';
|
|
2283
|
+
this.dateTo = 'date_to';
|
|
2273
2284
|
this.showCustomDateFields = false;
|
|
2274
2285
|
}
|
|
2275
2286
|
set defaultValue(value) {
|
|
@@ -2290,8 +2301,8 @@ class TimelineFilterComponent {
|
|
|
2290
2301
|
changeTimeline(value) {
|
|
2291
2302
|
const timeline = calculateTimeline(value);
|
|
2292
2303
|
if (timeline) {
|
|
2293
|
-
this.setFieldValue(
|
|
2294
|
-
this.setFieldValue(
|
|
2304
|
+
this.setFieldValue(this.dateFrom, timeline.date_from);
|
|
2305
|
+
this.setFieldValue(this.dateTo, timeline.date_to);
|
|
2295
2306
|
this.showCustomDateFields = timeline.show_custom_field;
|
|
2296
2307
|
}
|
|
2297
2308
|
}
|
|
@@ -2299,13 +2310,16 @@ class TimelineFilterComponent {
|
|
|
2299
2310
|
TimelineFilterComponent.decorators = [
|
|
2300
2311
|
{ type: Component, args: [{
|
|
2301
2312
|
selector: 'app-timeline-filter',
|
|
2302
|
-
template: "<ng-container [formGroup]=\"form\">\n <mat-form-field>\n <mat-label>
|
|
2313
|
+
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>",
|
|
2303
2314
|
styles: [""]
|
|
2304
2315
|
},] }
|
|
2305
2316
|
];
|
|
2306
2317
|
TimelineFilterComponent.ctorParameters = () => [];
|
|
2307
2318
|
TimelineFilterComponent.propDecorators = {
|
|
2308
2319
|
timelines: [{ type: Input }],
|
|
2320
|
+
labelText: [{ type: Input }],
|
|
2321
|
+
dateFrom: [{ type: Input }],
|
|
2322
|
+
dateTo: [{ type: Input }],
|
|
2309
2323
|
form: [{ type: Input }],
|
|
2310
2324
|
defaultValue: [{ type: Input }]
|
|
2311
2325
|
};
|
|
@@ -4422,8 +4436,8 @@ class UpdateNotifierSnackComponent {
|
|
|
4422
4436
|
UpdateNotifierSnackComponent.decorators = [
|
|
4423
4437
|
{ type: Component, args: [{
|
|
4424
4438
|
selector: 'app-update-notifier-snack',
|
|
4425
|
-
template: "<div fxLayout=\"column\">\n
|
|
4426
|
-
styles: [".large-icon{transform:scale(
|
|
4439
|
+
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",
|
|
4440
|
+
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}}"]
|
|
4427
4441
|
},] }
|
|
4428
4442
|
];
|
|
4429
4443
|
UpdateNotifierSnackComponent.ctorParameters = () => [
|