@awhere/api
Version:
The awesome aWhere API for JavaScript.
175 lines • 6.15 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WidgetEvent = void 0;
var WidgetBase_1 = __importDefault(require("../WidgetBase"));
var WidgetEvent;
(function (WidgetEvent) {
WidgetEvent["Cancel"] = "cancel";
WidgetEvent["Select"] = "select";
})(WidgetEvent || (exports.WidgetEvent = WidgetEvent = {}));
var ItemPicker = /** @class */ (function (_super) {
__extends(ItemPicker, _super);
function ItemPicker(props) {
var _this = _super.call(this, props) || this;
_this._types = [];
_this._subtypes = [];
_this._selectableTypes = [];
_this._selectableSubtypes = [];
_this._disabledItems = [];
if (props.singleSelect !== undefined) {
_this._singleSelect = props.singleSelect;
}
if (props.types !== undefined) {
_this._types = props.types;
}
if (props.subtypes !== undefined) {
_this._subtypes = props.subtypes;
}
if (props.selectableTypes !== undefined) {
_this._selectableTypes = props.selectableTypes;
}
if (props.selectableSubtypes !== undefined) {
_this._selectableSubtypes = props.selectableSubtypes;
}
if (props.disabledItems !== undefined) {
_this._disabledItems = props.disabledItems;
}
if (props.defaultParent !== undefined) {
_this._defaultParent = props.defaultParent;
}
if (props.pathNavigation !== undefined) {
_this._pathNavigation = props.pathNavigation;
}
if (props.importable !== undefined) {
_this._importable = props.importable;
}
return _this;
}
Object.defineProperty(ItemPicker.prototype, "singleSelect", {
get: function () {
return this._singleSelect;
},
set: function (v) {
this._singleSelect = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "types", {
get: function () {
return this._types;
},
set: function (v) {
this._types = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "subtypes", {
get: function () {
return this._subtypes;
},
set: function (v) {
this._subtypes = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "selectableTypes", {
get: function () {
return this._selectableTypes;
},
set: function (v) {
this._selectableTypes = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "selectableSubtypes", {
get: function () {
return this._selectableSubtypes;
},
set: function (v) {
this._selectableSubtypes = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "disabledItems", {
get: function () {
return this._disabledItems;
},
set: function (v) {
this._disabledItems = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "defaultParent", {
get: function () {
return this._defaultParent;
},
set: function (v) {
this._defaultParent = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "pathNavigation", {
get: function () {
return this._pathNavigation;
},
set: function (v) {
this._pathNavigation = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ItemPicker.prototype, "importable", {
get: function () {
return this._importable;
},
set: function (v) {
this._importable = v;
},
enumerable: false,
configurable: true
});
ItemPicker.prototype.build = function (target) {
_super.prototype._build.call(this, 'item-picker', target, {
single_select: typeof this._singleSelect === "boolean" ? this._singleSelect : undefined,
types: this._types.join(','),
subtypes: this._subtypes.join(','),
selectable_types: this._selectableTypes.join(','),
selectable_subtypes: this._selectableSubtypes.join(','),
disabled_items: this._disabledItems.join(','),
default_parent: this._defaultParent || '',
path_navigation: typeof this._pathNavigation === "boolean" ? this._pathNavigation : undefined,
importable: typeof this._importable === "boolean" ? this._importable : undefined
});
};
ItemPicker.prototype.destroy = function () {
_super.prototype._destroy.call(this);
};
return ItemPicker;
}(WidgetBase_1.default));
exports.default = ItemPicker;
//# sourceMappingURL=ItemPicker.js.map