@progress/kendo-angular-scheduler
Version:
Kendo UI Scheduler Angular - Outlook or Google-style angular scheduler calendar. Full-featured and customizable embedded scheduling from the creator developers trust for professional UI components.
50 lines (49 loc) • 2.11 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Pipe } from '@angular/core';
import { iterator } from '../../common/util';
import * as i0 from "@angular/core";
class ResourceIterator {
resources;
lastIndex;
*[iterator]() {
let resources = this.resources;
const lastIndex = Math.max(0, this.lastIndex);
if (!(resources && resources.length)) {
resources = [{}];
}
const lastData = resources[lastIndex].data || [];
const length = lastData.length;
let count = 1;
for (let idx = 0; idx <= lastIndex; idx++) {
count *= (resources[idx].data || []).length || 1;
}
for (let idx = 0; idx < count; idx++) {
yield lastData[idx % length];
}
}
constructor(resources, lastIndex = resources.length - 1) {
this.resources = resources;
this.lastIndex = lastIndex;
}
}
/**
* @hidden
*/
export class ResourceIteratorPipe {
transform(resources = [], lastIndex) {
return new ResourceIterator(resources, lastIndex);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResourceIteratorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ResourceIteratorPipe, isStandalone: true, name: "resourceIterator" });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ResourceIteratorPipe, decorators: [{
type: Pipe,
args: [{
// eslint-disable-next-line @angular-eslint/pipe-prefix
name: 'resourceIterator',
standalone: true
}]
}] });