@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
25 lines • 1.15 kB
JavaScript
import { BaseItemsCommand } from "./BaseItemsCommand";
import { NotImplementedException } from "@aurigma/design-atoms-model/Exception";
export class EditItemsCommand extends BaseItemsCommand {
constructor(_itemsDataApplier, productHandler, historyArgs, args) {
super(productHandler, historyArgs, args);
this._itemsDataApplier = _itemsDataApplier;
}
async _executeCommandBody() {
var _a;
var items = (_a = this._getTargetItems(this._args.items, this._args.query, this._args.queryOptions)) !== null && _a !== void 0 ? _a : this._productHandler.selectedItems;
const filteredItems = items.filter(i => i instanceof (this._args.type || Object));
for (let i = 0; i < filteredItems.length; i++) {
const item = filteredItems[i];
await this._itemsDataApplier.applyToItem(item, this._args.itemData, this._args.applyParams);
}
this._productHandler.redraw();
}
redo() {
throw new NotImplementedException();
}
undo() {
throw new NotImplementedException();
}
}
//# sourceMappingURL=EditItemsCommand.js.map