@scuticode/shop-sdk
Version:
ScutiCode shop sdk
131 lines (129 loc) • 9.86 kB
JavaScript
;
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IconsComponent = void 0;
const lit_1 = require("lit");
const decorators_js_1 = require("lit/decorators.js");
let IconsComponent = (() => {
var _IconsComponent_type_accessor_storage, _IconsComponent_width_accessor_storage, _IconsComponent_height_accessor_storage;
let _classDecorators = [(0, decorators_js_1.customElement)('svg-icon')];
let _classDescriptor;
let _classExtraInitializers = [];
let _classThis;
let _classSuper = lit_1.LitElement;
let _instanceExtraInitializers = [];
let _type_decorators;
let _type_initializers = [];
let _width_decorators;
let _width_initializers = [];
let _height_decorators;
let _height_initializers = [];
var IconsComponent = _classThis = class extends _classSuper {
constructor() {
super(...arguments);
_IconsComponent_type_accessor_storage.set(this, (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _type_initializers, 'close')));
_IconsComponent_width_accessor_storage.set(this, __runInitializers(this, _width_initializers, '25px'));
_IconsComponent_height_accessor_storage.set(this, __runInitializers(this, _height_initializers, '25px'));
}
get type() { return __classPrivateFieldGet(this, _IconsComponent_type_accessor_storage, "f"); }
set type(value) { __classPrivateFieldSet(this, _IconsComponent_type_accessor_storage, value, "f"); }
get width() { return __classPrivateFieldGet(this, _IconsComponent_width_accessor_storage, "f"); }
set width(value) { __classPrivateFieldSet(this, _IconsComponent_width_accessor_storage, value, "f"); }
get height() { return __classPrivateFieldGet(this, _IconsComponent_height_accessor_storage, "f"); }
set height(value) { __classPrivateFieldSet(this, _IconsComponent_height_accessor_storage, value, "f"); }
render() {
let output = (0, lit_1.html) ``;
if (this.type == 'send-right') {
output = (0, lit_1.html) `
<svg width="${this.width}" height="${this.height}"><path d="M2,21L23,12L2,3V10L17,12L2,14V21Z" /></svg>
`;
}
else if (this.type == 'close') {
output = (0, lit_1.html) `
<svg class="card-btn-close" width="${this.width}" height="${this.height}" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 30 30">
<path d="M 7 4 C 6.744125 4 6.4879687 4.0974687 6.2929688 4.2929688 L 4.2929688 6.2929688 C 3.9019687 6.6839688 3.9019687 7.3170313 4.2929688 7.7070312 L 11.585938 15 L 4.2929688 22.292969 C 3.9019687 22.683969 3.9019687 23.317031 4.2929688 23.707031 L 6.2929688 25.707031 C 6.6839688 26.098031 7.3170313 26.098031 7.7070312 25.707031 L 15 18.414062 L 22.292969 25.707031 C 22.682969 26.098031 23.317031 26.098031 23.707031 25.707031 L 25.707031 23.707031 C 26.098031 23.316031 26.098031 22.682969 25.707031 22.292969 L 18.414062 15 L 25.707031 7.7070312 C 26.098031 7.3170312 26.098031 6.6829688 25.707031 6.2929688 L 23.707031 4.2929688 C 23.316031 3.9019687 22.682969 3.9019687 22.292969 4.2929688 L 15 11.585938 L 7.7070312 4.2929688 C 7.5115312 4.0974687 7.255875 4 7 4 z"></path>
</svg>
`;
}
else if (this.type == 'robot') {
output = (0, lit_1.html) `
<svg viewBox="0 0 640 512" title="robot" width="${this.width}" height="${this.height}">
<path fill="currentColor" d="M32,224H64V416H32A31.96166,31.96166,0,0,1,0,384V256A31.96166,31.96166,0,0,1,32,224Zm512-48V448a64.06328,64.06328,0,0,1-64,64H160a64.06328,64.06328,0,0,1-64-64V176a79.974,79.974,0,0,1,80-80H288V32a32,32,0,0,1,64,0V96H464A79.974,79.974,0,0,1,544,176ZM264,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,264,256Zm-8,128H192v32h64Zm96,0H288v32h64ZM456,256a40,40,0,1,0-40,40A39.997,39.997,0,0,0,456,256Zm-8,128H384v32h64ZM640,256V384a31.96166,31.96166,0,0,1-32,32H576V224h32A31.96166,31.96166,0,0,1,640,256Z" />
</svg>
`;
}
return output;
}
};
_IconsComponent_type_accessor_storage = new WeakMap();
_IconsComponent_width_accessor_storage = new WeakMap();
_IconsComponent_height_accessor_storage = new WeakMap();
__setFunctionName(_classThis, "IconsComponent");
(() => {
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
_type_decorators = [(0, decorators_js_1.property)()];
_width_decorators = [(0, decorators_js_1.property)()];
_height_decorators = [(0, decorators_js_1.property)()];
__esDecorate(_classThis, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _instanceExtraInitializers);
__esDecorate(_classThis, null, _width_decorators, { kind: "accessor", name: "width", static: false, private: false, access: { has: obj => "width" in obj, get: obj => obj.width, set: (obj, value) => { obj.width = value; } }, metadata: _metadata }, _width_initializers, _instanceExtraInitializers);
__esDecorate(_classThis, null, _height_decorators, { kind: "accessor", name: "height", static: false, private: false, access: { has: obj => "height" in obj, get: obj => obj.height, set: (obj, value) => { obj.height = value; } }, metadata: _metadata }, _height_initializers, _instanceExtraInitializers);
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
IconsComponent = _classThis = _classDescriptor.value;
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
})();
_classThis.styles = [(0, lit_1.css) `
`];
(() => {
__runInitializers(_classThis, _classExtraInitializers);
})();
return IconsComponent = _classThis;
})();
exports.IconsComponent = IconsComponent;