ion-oui
Version:
The client library of oui builder for ionic
193 lines (192 loc) • 10.7 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 __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;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OUIIonOButtonParser = exports.OUIIonOButtonComponent = exports.OUIIonOutlinedParser = exports.OUIIonOutlinedComponent = exports.OUIIonElevatedParser = exports.OUIIonElevatedComponent = exports.OUIIonTextButtonParser = exports.OUIIonTextButtonComponent = exports.OUIIonRaisedButtonParser = exports.OUIIonRaisedButtonComponent = void 0;
var core_1 = require("@angular/core");
var oui_element_1 = require("../oui-element");
var oui_parser_1 = require("../oui-parser");
var OUIIonRaisedButtonComponent = /** @class */ (function (_super) {
__extends(OUIIonRaisedButtonComponent, _super);
function OUIIonRaisedButtonComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(OUIIonRaisedButtonComponent.prototype, "padding", {
get: function () {
return this.data.padding ? this.data.padding.split(',').map(function (e) { return e + 'px'; }).join(' ') : '';
},
enumerable: false,
configurable: true
});
OUIIonRaisedButtonComponent = __decorate([
(0, core_1.Component)({
selector: 'app-ion-oui-raised-button',
template: "\n <ion-button [mode]=\"mode\" [style.padding]=\"padding\" [style.backgroundColor]=\"data.color\" [style.color]=\"data.textColor\" (click)=\"ownClick($event)\" expand=\"block\" fill=\"outline\">\n <app-ion-oui [mode]=\"mode\" *ngIf=\"data.child\" [data]=\"data.child\" [onClick]=\"click\"></app-ion-oui>\n </ion-button>\n ",
styleUrls: ['./o-ui.scss'],
})
], OUIIonRaisedButtonComponent);
return OUIIonRaisedButtonComponent;
}(oui_element_1.OUIIonElement));
exports.OUIIonRaisedButtonComponent = OUIIonRaisedButtonComponent;
var OUIIonRaisedButtonParser = /** @class */ (function (_super) {
__extends(OUIIonRaisedButtonParser, _super);
function OUIIonRaisedButtonParser() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'RaisedButton';
_this.componentType = OUIIonRaisedButtonComponent;
return _this;
}
return OUIIonRaisedButtonParser;
}(oui_parser_1.OUIAbstractIonParser));
exports.OUIIonRaisedButtonParser = OUIIonRaisedButtonParser;
var OUIIonTextButtonComponent = /** @class */ (function (_super) {
__extends(OUIIonTextButtonComponent, _super);
function OUIIonTextButtonComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(OUIIonTextButtonComponent.prototype, "padding", {
get: function () {
return this.data.padding ? this.data.padding.split(',').map(function (e) { return e + 'px'; }).join(' ') : '';
},
enumerable: false,
configurable: true
});
OUIIonTextButtonComponent = __decorate([
(0, core_1.Component)({
selector: 'app-ion-oui-text-button',
template: "\n <ion-button [mode]=\"mode\" [style.padding]=\"padding\" [style.backgroundColor]=\"data.backgroundColor\" [style.color]=\"data.foregroundColor\" (click)=\"ownClick($event)\" expand=\"block\" fill=\"clear\">\n <app-ion-oui [mode]=\"mode\" *ngIf=\"data.child\" [data]=\"data.child\" [onClick]=\"click\"></app-ion-oui>\n </ion-button>\n ",
styleUrls: ['./o-ui.scss'],
})
], OUIIonTextButtonComponent);
return OUIIonTextButtonComponent;
}(oui_element_1.OUIIonElement));
exports.OUIIonTextButtonComponent = OUIIonTextButtonComponent;
var OUIIonTextButtonParser = /** @class */ (function (_super) {
__extends(OUIIonTextButtonParser, _super);
function OUIIonTextButtonParser() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'TextButton';
_this.componentType = OUIIonTextButtonComponent;
return _this;
}
return OUIIonTextButtonParser;
}(oui_parser_1.OUIAbstractIonParser));
exports.OUIIonTextButtonParser = OUIIonTextButtonParser;
var OUIIonElevatedComponent = /** @class */ (function (_super) {
__extends(OUIIonElevatedComponent, _super);
function OUIIonElevatedComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(OUIIonElevatedComponent.prototype, "padding", {
get: function () {
return this.data.padding ? this.data.padding.split(',').map(function (e) { return e + 'px'; }).join(' ') : '';
},
enumerable: false,
configurable: true
});
OUIIonElevatedComponent = __decorate([
(0, core_1.Component)({
selector: 'app-ion-oui-elevated-button',
template: "\n <ion-button [mode]=\"mode\" [style.padding]=\"padding\" [style.backgroundColor]=\"data.backgroundColor\" [style.color]=\"data.foregroundColor\" (click)=\"ownClick($event)\" expand=\"block\" fill=\"solid\">\n <app-ion-oui [mode]=\"mode\" *ngIf=\"data.child\" [data]=\"data.child\" [onClick]=\"click\"></app-ion-oui>\n </ion-button>\n ",
styleUrls: ['./o-ui.scss'],
})
], OUIIonElevatedComponent);
return OUIIonElevatedComponent;
}(oui_element_1.OUIIonElement));
exports.OUIIonElevatedComponent = OUIIonElevatedComponent;
var OUIIonElevatedParser = /** @class */ (function (_super) {
__extends(OUIIonElevatedParser, _super);
function OUIIonElevatedParser() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'ElevatedButton';
_this.componentType = OUIIonElevatedComponent;
return _this;
}
return OUIIonElevatedParser;
}(oui_parser_1.OUIAbstractIonParser));
exports.OUIIonElevatedParser = OUIIonElevatedParser;
var OUIIonOutlinedComponent = /** @class */ (function (_super) {
__extends(OUIIonOutlinedComponent, _super);
function OUIIonOutlinedComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(OUIIonOutlinedComponent.prototype, "padding", {
get: function () {
return this.data.padding ? this.data.padding.split(',').map(function (e) { return e + 'px'; }).join(' ') : '';
},
enumerable: false,
configurable: true
});
OUIIonOutlinedComponent = __decorate([
(0, core_1.Component)({
selector: 'app-ion-oui-outlined-button',
template: "\n <ion-button [mode]=\"mode\" [style.padding]=\"padding\" [style.backgroundColor]=\"data.backgroundColor\" [style.color]=\"data.foregroundColor\" (click)=\"ownClick($event)\" expand=\"block\" fill=\"outline\">\n <app-ion-oui [mode]=\"mode\" *ngIf=\"data.child\" [data]=\"data.child\" [onClick]=\"click\"></app-ion-oui>\n </ion-button>\n ",
styleUrls: ['./o-ui.scss'],
})
], OUIIonOutlinedComponent);
return OUIIonOutlinedComponent;
}(oui_element_1.OUIIonElement));
exports.OUIIonOutlinedComponent = OUIIonOutlinedComponent;
var OUIIonOutlinedParser = /** @class */ (function (_super) {
__extends(OUIIonOutlinedParser, _super);
function OUIIonOutlinedParser() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'OutlinedButton';
_this.componentType = OUIIonOutlinedComponent;
return _this;
}
return OUIIonOutlinedParser;
}(oui_parser_1.OUIAbstractIonParser));
exports.OUIIonOutlinedParser = OUIIonOutlinedParser;
var OUIIonOButtonComponent = /** @class */ (function (_super) {
__extends(OUIIonOButtonComponent, _super);
function OUIIonOButtonComponent() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(OUIIonOButtonComponent.prototype, "padding", {
get: function () {
return this.data.padding ? this.data.padding.split(',').map(function (e) { return e + 'px'; }).join(' ') : '';
},
enumerable: false,
configurable: true
});
OUIIonOButtonComponent = __decorate([
(0, core_1.Component)({
selector: 'app-ion-oui-o-button',
template: "\n <ion-button [mode]=\"mode\" (click)=\"ownClick($event)\" [shape]=\"data.shape > 0 ? 'round' : undefined\" [style.--border-color]=\"data.fill==='outline' ? data.foregroundColor: 'default'\" [style.--border-radius]=\"data.shape > 0 ? data.shape + 'px' : '0px'\" [style.--color]=\"data.foregroundColor\" [style.--background]=\"data.backgroundColor\" expand=\"block\" [fill]=\"data.fill\">\n {{data.text}}\n </ion-button>\n ",
styleUrls: ['./o-ui.scss'],
})
], OUIIonOButtonComponent);
return OUIIonOButtonComponent;
}(oui_element_1.OUIIonElement));
exports.OUIIonOButtonComponent = OUIIonOButtonComponent;
var OUIIonOButtonParser = /** @class */ (function (_super) {
__extends(OUIIonOButtonParser, _super);
function OUIIonOButtonParser() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = 'OButton';
_this.componentType = OUIIonOButtonComponent;
return _this;
}
return OUIIonOButtonParser;
}(oui_parser_1.OUIAbstractIonParser));
exports.OUIIonOButtonParser = OUIIonOButtonParser;