// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Property } from '../../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../../Abstracts/CustomElement';
// #endregion
/**
 * The `{@link ItemsElement}` element.
 *
 * @public
 * @abstract
 */
export class ItemsElement extends CustomElement {
    // #region Fields
    _source;
    // #endregion
    // #region Ctor
    /**
     * @protected
     */
    constructor() {
        super();
        this._source = [];
    }
    // #endregion
    // #region Properties
    /**
     * Gets or sets the `source` property.
     *
     * @public
     */
    get source() {
        return this._source;
    }
    set source(value) {
        this.onSourceChanged(this._source, value);
        this.requestUpdate('source');
    }
    // #endregion
    // #region Methods
    /**
     * This method is invoked when the `source` property is changed.
     *
     * @protected
     * @virtual
     * @param prev - The old value of the `source` property.
     * @param next - The new value of the `source` property.
     */
    onSourceChanged(prev, next) {
        this._source = next;
        this.requestUpdate('source');
    }
}
__decorate([
    Property({ type: Array }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], ItemsElement.prototype, "source", null);
//# sourceMappingURL=ItemsElement.js.map