@indigina/ui-kit 1.1.396 → 1.1.398
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.
|
@@ -5,7 +5,7 @@ import { Input, ChangeDetectionStrategy, Component, input, EventEmitter, Output,
|
|
|
5
5
|
import * as i1 from '@progress/kendo-angular-buttons';
|
|
6
6
|
import { ButtonModule, ButtonGroupModule, KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
|
|
7
7
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
8
|
-
import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, take, switchMap, of } from 'rxjs';
|
|
8
|
+
import { map, catchError, EMPTY, forkJoin, BehaviorSubject, filter, Subject, startWith, pairwise, takeUntil, combineLatest, tap, debounceTime, distinctUntilChanged, take, switchMap, of, finalize } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@progress/kendo-angular-label';
|
|
10
10
|
import { LabelModule, KENDO_LABELS } from '@progress/kendo-angular-label';
|
|
11
11
|
import { TooltipDirective, TooltipSettings } from '@progress/kendo-angular-tooltip';
|
|
@@ -7372,7 +7372,7 @@ const kitBuildSortString = (sort, columns) => {
|
|
|
7372
7372
|
}).join(', ');
|
|
7373
7373
|
return sortString !== '' && sortString || undefined;
|
|
7374
7374
|
};
|
|
7375
|
-
const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFromIndexAction, hasArchiveToggle, }) => {
|
|
7375
|
+
const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFromIndexAction, hasArchiveToggle, error, }) => {
|
|
7376
7376
|
isLoading.set(true);
|
|
7377
7377
|
const { skip, take, sort, filter, search, archive } = store.selectSnapshot(KIT_GRID_STATE_TOKEN);
|
|
7378
7378
|
const gridState = {
|
|
@@ -7385,7 +7385,7 @@ const kitFetchGridData = ({ store, destroyRef, isLoading, fetchAction, fetchFrom
|
|
|
7385
7385
|
const isSearchMode = hasArchiveToggle && !isArchive || !!search;
|
|
7386
7386
|
const searchTerm = search && kitFormatStringForSearch(search) || undefined;
|
|
7387
7387
|
const action = isSearchMode && fetchFromIndexAction({ ...gridState, searchTerm }) || fetchAction(gridState);
|
|
7388
|
-
store.dispatch(action).pipe(takeUntilDestroyed(destroyRef)
|
|
7388
|
+
store.dispatch(action).pipe(takeUntilDestroyed(destroyRef), finalize(() => isLoading.set(false))).subscribe({ error });
|
|
7389
7389
|
};
|
|
7390
7390
|
const kitFetchExportGridData = ({ fetchAction, fetchIndexAction, sort, filter, search, columns, total, hasArchiveToggle = false, archiveModeEnabled = false, }) => {
|
|
7391
7391
|
const isArchive = hasArchiveToggle && archiveModeEnabled || false;
|
|
@@ -10080,10 +10080,14 @@ class KitSchedulerToolbarComponent {
|
|
|
10080
10080
|
}, ...(ngDevMode ? [{ debugName: "viewSettingsMap" }] : []));
|
|
10081
10081
|
}
|
|
10082
10082
|
onDateChange(date) {
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10083
|
+
const today = new Date();
|
|
10084
|
+
if (!date) {
|
|
10085
|
+
this.navigateToDate(today);
|
|
10086
|
+
return;
|
|
10087
|
+
}
|
|
10088
|
+
if (this.isDateWithinRange(new Date(date), today)) {
|
|
10089
|
+
this.navigateToDate(new Date(date));
|
|
10090
|
+
}
|
|
10087
10091
|
}
|
|
10088
10092
|
next() {
|
|
10089
10093
|
this.navigate({ type: 'next' });
|
|
@@ -10107,6 +10111,20 @@ class KitSchedulerToolbarComponent {
|
|
|
10107
10111
|
navigate(action) {
|
|
10108
10112
|
this.toolbarService.navigate(action);
|
|
10109
10113
|
}
|
|
10114
|
+
navigateToDate(date) {
|
|
10115
|
+
this.navigate({
|
|
10116
|
+
type: 'select-date',
|
|
10117
|
+
date,
|
|
10118
|
+
});
|
|
10119
|
+
}
|
|
10120
|
+
isDateWithinRange(date, referenceDate) {
|
|
10121
|
+
const yearsRange = 20;
|
|
10122
|
+
const minDate = new Date(referenceDate);
|
|
10123
|
+
minDate.setFullYear(referenceDate.getFullYear() - yearsRange);
|
|
10124
|
+
const maxDate = new Date(referenceDate);
|
|
10125
|
+
maxDate.setFullYear(referenceDate.getFullYear() + yearsRange);
|
|
10126
|
+
return date >= minDate && date <= maxDate;
|
|
10127
|
+
}
|
|
10110
10128
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: KitSchedulerToolbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10111
10129
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: KitSchedulerToolbarComponent, isStandalone: true, selector: "kit-scheduler-toolbar", inputs: { selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, selectedView: { classPropertyName: "selectedView", publicName: "selectedView", isSignal: true, isRequired: false, transformFunction: null }, showTimePill: { classPropertyName: "showTimePill", publicName: "showTimePill", isSignal: true, isRequired: false, transformFunction: null }, views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, viewModes: { classPropertyName: "viewModes", publicName: "viewModes", isSignal: true, isRequired: true, transformFunction: null }, selectedViewIndex: { classPropertyName: "selectedViewIndex", publicName: "selectedViewIndex", isSignal: true, isRequired: false, transformFunction: null }, showExportButton: { classPropertyName: "showExportButton", publicName: "showExportButton", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exportPDF: "exportPDF" }, ngImport: i0, template: "<div class=\"kit-scheduler-toolbar\">\n <div class=\"kit-scheduler-toolbar-nav\">\n <kit-button [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.CHEVRON_LEFT\"\n (clicked)=\"prev()\"\n ></kit-button>\n <kit-button label=\"Today\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n (clicked)=\"today()\"></kit-button>\n <kit-button [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n [icon]=\"kitSvgIcon.CHEVRON_RIGHT\"\n (clicked)=\"next()\">\n </kit-button>\n </div>\n\n <div class=\"kit-scheduler-toolbar-views\">\n @for (view of views(); track $index) {\n <kit-button [type]=\"selectedViewIndex() === $index ? kitButtonType.PRIMARY : kitButtonType.TEXT\"\n [label]=\"viewSettingsMap()[$index].title\"\n [kind]=\"kitButtonKind.MEDIUM\"\n (clicked)=\"onViewChange(view)\"\n ></kit-button>\n }\n </div>\n\n <kit-datepicker class=\"kit-scheduler-toolbar-datepicker\"\n [defaultDate]=\"selectedDate()\"\n [size]=\"kitDatepickerSize.SMALL\"\n [format]=\"getDatepickerFormat()\"\n (changed)=\"onDateChange($event)\"\n ></kit-datepicker>\n @if (showTimePill()) {\n <kit-pill class=\"kit-scheduler-toolbar-time-pill\">\n GMT standard time\n </kit-pill>\n }\n\n @if (showExportButton()) {\n <kit-button kitTooltip\n kitTooltipFilter=\"kit-button\"\n [title]=\"'kit.export.title' | translate\"\n [disabled]=\"isLoading()\"\n [icon]=\"kitSvgIcon.DOWNLOAD\"\n [type]=\"kitButtonType.GHOST\"\n [kind]=\"kitButtonKind.MEDIUM\"\n (clicked)=\"exportPDF.emit()\" />\n }\n</div>\n", styles: [".kit-scheduler-toolbar{display:flex;align-items:center;gap:20px;width:100%}.kit-scheduler-toolbar-nav{display:flex;align-items:center;gap:1px;padding-right:20px;border-right:1px solid var(--ui-kit-color-grey-11)}.kit-scheduler-toolbar-views{display:flex;align-items:center}.kit-scheduler-toolbar-datepicker{margin-left:auto;width:235px}.kit-scheduler-toolbar ::ng-deep .kit-scheduler-toolbar-time-pill .kit-pill{border-color:var(--ui-kit-color-grey-11)}\n"], dependencies: [{ kind: "component", type: KitButtonComponent, selector: "kit-button", inputs: ["disabled", "label", "type", "icon", "iconType", "kind", "state", "iconPosition", "buttonClass", "active"], outputs: ["clicked"] }, { kind: "component", type: KitDatepickerComponent, selector: "kit-datepicker", inputs: ["placeholder", "label", "labelTooltip", "defaultDate", "disabled", "format", "min", "max", "messageIcon", "messageText", "size", "readonly"], outputs: ["defaultDateChange", "disabledChange", "changed"] }, { kind: "component", type: KitPillComponent, selector: "kit-pill", inputs: ["removable", "selectable", "selected", "type", "theme", "icon", "iconType"], outputs: ["clicked", "removed"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
10112
10130
|
}
|