@acorex/layout 6.5.70 → 6.5.72
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -2
- package/esm2022/acorex-layout.mjs +5 -0
- package/esm2022/index.mjs +7 -0
- package/esm2022/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +49 -0
- package/esm2022/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +21 -0
- package/esm2022/lib/widget-board/widget-board.component.mjs +452 -0
- package/esm2022/lib/widget-board/widget-board.module.mjs +109 -0
- package/esm2022/lib/widget-board/widget-config.component.mjs +85 -0
- package/esm2022/lib/widget-board/widget-host.component.mjs +311 -0
- package/esm2022/lib/widget-board/widget-save.component.mjs +79 -0
- package/esm2022/lib/widget-board/widget.class.mjs +130 -0
- package/{fesm2020 → fesm2022}/acorex-layout.mjs +158 -127
- package/fesm2022/acorex-layout.mjs.map +1 -0
- package/lib/widget-board/editors/widget-size-editor/widget-size.editor.d.ts +1 -1
- package/lib/widget-board/widget-board.component.d.ts +1 -1
- package/lib/widget-board/widget-config.component.d.ts +1 -1
- package/lib/widget-board/widget-host.component.d.ts +1 -1
- package/lib/widget-board/widget-save.component.d.ts +1 -1
- package/package.json +12 -18
- package/acorex-layout.d.ts +0 -5
- package/esm2020/acorex-layout.mjs +0 -5
- package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.editor.mjs +0 -46
- package/esm2020/lib/widget-board/editors/widget-size-editor/widget-size.module.mjs +0 -21
- package/esm2020/lib/widget-board/widget-board.component.mjs +0 -444
- package/esm2020/lib/widget-board/widget-board.module.mjs +0 -111
- package/esm2020/lib/widget-board/widget-config.component.mjs +0 -82
- package/esm2020/lib/widget-board/widget-host.component.mjs +0 -295
- package/esm2020/lib/widget-board/widget-save.component.mjs +0 -79
- package/esm2020/lib/widget-board/widget.class.mjs +0 -127
- package/esm2020/public-api.mjs +0 -7
- package/fesm2015/acorex-layout.mjs +0 -1175
- package/fesm2015/acorex-layout.mjs.map +0 -1
- package/fesm2020/acorex-layout.mjs.map +0 -1
- /package/{public-api.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core';
|
2
|
+
import { AXHtmlUtil, AXObjectUtil, AXTranslator } from '@acorex/core';
|
3
|
+
import { AXBasePopupPageComponent } from '@acorex/components';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
import * as i1 from "@angular/common";
|
6
|
+
import * as i2 from "@acorex/components";
|
7
|
+
import * as i3 from "@acorex/core";
|
8
|
+
export class AXWidgetSaveComponent extends AXBasePopupPageComponent {
|
9
|
+
config;
|
10
|
+
props = [];
|
11
|
+
displayProps;
|
12
|
+
data;
|
13
|
+
getFooterButtons() {
|
14
|
+
return [
|
15
|
+
{
|
16
|
+
name: 'okay',
|
17
|
+
submitBehavior: true,
|
18
|
+
text: AXTranslator.get('common.confirm'),
|
19
|
+
style: 'ax success'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'cancel',
|
23
|
+
cancelBehavior: true,
|
24
|
+
text: AXTranslator.get('common.cancel'),
|
25
|
+
style: 'ax light'
|
26
|
+
}
|
27
|
+
];
|
28
|
+
}
|
29
|
+
ngOnInit() {
|
30
|
+
const titleProp = this.props.find(c => c.property.name === 'title' || c.property.name === 'name');
|
31
|
+
const title = titleProp?.value || this.config.title;
|
32
|
+
const pp = {};
|
33
|
+
this.props?.forEach(c => {
|
34
|
+
pp[c.property.name] = c.property;
|
35
|
+
});
|
36
|
+
this.data = {
|
37
|
+
component: this.config.component,
|
38
|
+
title,
|
39
|
+
uniqueName: `${this.config.uniqueName}-${AXHtmlUtil.getUID()}`,
|
40
|
+
options: AXObjectUtil.deepJSONClone(this.config.options),
|
41
|
+
props: AXObjectUtil.deepJSONClone(pp)
|
42
|
+
};
|
43
|
+
this.displayProps = this.props
|
44
|
+
.filter(c => c.property.visible !== false)
|
45
|
+
.sort((a, b) => a.property.order - b.property.order)
|
46
|
+
.map(c => ({
|
47
|
+
name: c.property.name,
|
48
|
+
title: c.property.title,
|
49
|
+
allow: true
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
onFooterButtonClick(e) {
|
53
|
+
if (e.name === 'cancel') {
|
54
|
+
this.close();
|
55
|
+
}
|
56
|
+
if (e.name === 'okay') {
|
57
|
+
this.props.forEach(p => {
|
58
|
+
const pp = this.displayProps.find(c => c.name === p.property.name);
|
59
|
+
if (pp == null || !pp.allow) {
|
60
|
+
let ppp = this.data.props[p.property.name];
|
61
|
+
if (ppp) {
|
62
|
+
ppp.visible = false;
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
ppp = { visible: false };
|
66
|
+
}
|
67
|
+
}
|
68
|
+
});
|
69
|
+
this.close(this.data);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXWidgetSaveComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
73
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AXWidgetSaveComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.title' | trans}}</ax-label>\n <ax-text-box [(value)]=\"data.title\"></ax-text-box>\n </ax-form-group>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.description' | trans}}</ax-label>\n <ax-text-area [(value)]=\"data.description\"></ax-text-area>\n </ax-form-group>\n </div>\n </div>\n <!-- <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.uniquename' | trans}}</ax-label>\n <ax-text-box></ax-text-box>\n </ax-form-group>\n </div>\n </div> -->\n <div class=\"row\" style=\"margin-block-end: var(--ax-size-md);margin-block-start: var(--ax-size-md);\">\n <div class=\"col-12\">\n <ax-fieldset caption=\"{{'widget-board.configurable-props' | trans}}\">\n <div class=\"row\" *ngFor=\"let prop of displayProps\">\n <div class=\"col-12\" style=\"margin-block-end: var(--ax-size-sm)\">\n <ax-check-box [(value)]=\"prop.allow\" label=\"{{ prop.title | trans }}\">\n\n </ax-check-box>\n </div>\n </div>\n </ax-fieldset>\n </div>\n </div>\n </div>\n </ax-page-content>\n</ax-page>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.AXPageContentComponent, selector: "ax-page-content" }, { kind: "component", type: i2.AXPageComponent, selector: "ax-page" }, { kind: "component", type: i2.AXLabelComponent, selector: "ax-label", inputs: ["size"] }, { kind: "component", type: i2.AXTextAreaComponent, selector: "ax-text-area", inputs: ["rows", "cols", "maxLength"] }, { kind: "component", type: i2.AXFieldsetComponent, selector: "ax-fieldset", inputs: ["size", "caption", "allowCollapse"] }, { kind: "component", type: i2.AXTextBoxComponent, selector: "ax-text-box", inputs: ["mask", "showMask", "type", "maxLength", "maskGuid", "maskPlaceholder", "maskKeepCharPositions"] }, { kind: "component", type: i2.AXFormGroupComponent, selector: "ax-form-group", inputs: ["size"] }, { kind: "component", type: i2.AXCheckBoxComponent, selector: "ax-check-box", inputs: ["readonly", "disabled", "size", "label", "tabIndex", "indeterminate", "value"], outputs: ["onValueChanged", "valueChange", "onClick"] }, { kind: "pipe", type: i3.AXTranslatorPipe, name: "trans" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
74
|
+
}
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXWidgetSaveComponent, decorators: [{
|
76
|
+
type: Component,
|
77
|
+
args: [{ encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-page>\n <ax-page-content>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.title' | trans}}</ax-label>\n <ax-text-box [(value)]=\"data.title\"></ax-text-box>\n </ax-form-group>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.description' | trans}}</ax-label>\n <ax-text-area [(value)]=\"data.description\"></ax-text-area>\n </ax-form-group>\n </div>\n </div>\n <!-- <div class=\"row\">\n <div class=\"col-12\">\n <ax-form-group>\n <ax-label>{{'common.uniquename' | trans}}</ax-label>\n <ax-text-box></ax-text-box>\n </ax-form-group>\n </div>\n </div> -->\n <div class=\"row\" style=\"margin-block-end: var(--ax-size-md);margin-block-start: var(--ax-size-md);\">\n <div class=\"col-12\">\n <ax-fieldset caption=\"{{'widget-board.configurable-props' | trans}}\">\n <div class=\"row\" *ngFor=\"let prop of displayProps\">\n <div class=\"col-12\" style=\"margin-block-end: var(--ax-size-sm)\">\n <ax-check-box [(value)]=\"prop.allow\" label=\"{{ prop.title | trans }}\">\n\n </ax-check-box>\n </div>\n </div>\n </ax-fieldset>\n </div>\n </div>\n </div>\n </ax-page-content>\n</ax-page>" }]
|
78
|
+
}] });
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LXNhdmUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9sYXlvdXQvc3JjL2xpYi93aWRnZXQtYm9hcmQvd2lkZ2V0LXNhdmUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9sYXlvdXQvc3JjL2xpYi93aWRnZXQtYm9hcmQvd2lkZ2V0LXNhdmUuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNILFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsdUJBQXVCLEdBRTFCLE1BQU0sZUFBZSx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hbGxvdzogYm9vbGVhbiB9W107XG5cbiAgICBkYXRhOiBBWFdpZGdldFNhdmVBc0RhdGE7XG5cbiAgICBnZXRGb290ZXJCdXR0b25zKCk6IEFYQnV0dG9uSXRlbVtdIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBuYW1lOiAnb2theScsXG4gICAgICAgICAgICAgICAgc3VibWl0QmVoYXZpb3I6IHRydWUsXG4gICAgICAgICAgICAgICAgdGV4dDogQVhUcmFuc2xhdG9yLmdldCgnY29tbW9uLmNvbmZpcm0nKSxcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IHN1Y2Nlc3MnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG5hbWU6ICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgIGNhbmNlbEJlaGF2aW9yOiB0cnVlLFxuICAgICAgICAgICAgICAgIHRleHQ6IEFYVHJhbnNsYXRvci5nZXQoJ2NvbW1vbi5jYW5jZWwnKSxcbiAgICAgICAgICAgICAgICBzdHlsZTogJ2F4IGxpZ2h0J1xuICAgICAgICAgICAgfVxuICAgICAgICBdO1xuICAgIH1cblxuICAgIG5nT25Jbml0KCkge1xuICAgICAgICBjb25zdCB0aXRsZVByb3AgPSB0aGlzLnByb3BzLmZpbmQoYyA9PiBjLnByb3BlcnR5Lm5hbWUgPT09ICd0aXRsZScgfHwgYy5wcm9wZXJ0eS5uYW1lID09PSAnbmFtZScpO1xuICAgICAgICBjb25zdCB0aXRsZSA9IHRpdGxlUHJvcD8udmFsdWUgfHwgdGhpcy5jb25maWcudGl0bGU7XG4gICAgICAgIGNvbnN0IHBwOiBhbnkgPSB7fTtcbiAgICAgICAgdGhpcy5wcm9wcz8uZm9yRWFjaChjID0+IHtcbiAgICAgICAgICAgIHBwW2MucHJvcGVydHkubmFtZV0gPSBjLnByb3BlcnR5O1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy5kYXRhID0ge1xuICAgICAgICAgICAgY29tcG9uZW50OiB0aGlzLmNvbmZpZy5jb21wb25lbnQsXG4gICAgICAgICAgICB0aXRsZSxcbiAgICAgICAgICAgIHVuaXF1ZU5hbWU6IGAke3RoaXMuY29uZmlnLnVuaXF1ZU5hbWV9LSR7QVhIdG1sVXRpbC5nZXRVSUQoKX1gLFxuICAgICAgICAgICAgb3B0aW9uczogQVhPYmplY3RVdGlsLmRlZXBKU09OQ2xvbmUodGhpcy5jb25maWcub3B0aW9ucyksXG4gICAgICAgICAgICBwcm9wczogQVhPYmplY3RVdGlsLmRlZXBKU09OQ2xvbmUocHApXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuZGlzcGxheVByb3BzID0gdGhpcy5wcm9wc1xuICAgICAgICAgICAgLmZpbHRlcihjID0+IGMucHJvcGVydHkudmlzaWJsZSAhPT0gZmFsc2UpXG4gICAgICAgICAgICAuc29ydCgoYSwgYikgPT4gYS5wcm9wZXJ0eS5vcmRlciAtIGIucHJvcGVydHkub3JkZXIpXG4gICAgICAgICAgICAubWFwKGMgPT4gKHtcbiAgICAgICAgICAgICAgICBuYW1lOiBjLnByb3BlcnR5Lm5hbWUsXG4gICAgICAgICAgICAgICAgdGl0bGU6IGMucHJvcGVydHkudGl0bGUsXG4gICAgICAgICAgICAgICAgYWxsb3c6IHRydWVcbiAgICAgICAgICAgIH0pKTtcbiAgICB9XG5cblxuXG4gICAgb25Gb290ZXJCdXR0b25DbGljayhlOiBBWE1lbnVJdGVtQ2xpY2tFdmVudCkge1xuICAgICAgICBpZiAoZS5uYW1lID09PSAnY2FuY2VsJykge1xuICAgICAgICAgICAgdGhpcy5jbG9zZSgpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChlLm5hbWUgPT09ICdva2F5Jykge1xuICAgICAgICAgICAgdGhpcy5wcm9wcy5mb3JFYWNoKHAgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHBwID0gdGhpcy5kaXNwbGF5UHJvcHMuZmluZChjID0+IGMubmFtZSA9PT0gcC5wcm9wZXJ0eS5uYW1lKTtcbiAgICAgICAgICAgICAgICBpZiAocHAgPT0gbnVsbCB8fCAhcHAuYWxsb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBwcCA9IHRoaXMuZGF0YS5wcm9wc1twLnByb3BlcnR5Lm5hbWVdO1xuICAgICAgICAgICAgICAgICAgICBpZiAocHBwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcHAudmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcHBwID0geyB2aXNpYmxlOiBmYWxzZSB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKHRoaXMuZGF0YSk7XG4gICAgICAgIH1cbiAgICB9XG59IiwiPGF4LXBhZ2U+XG4gICAgPGF4LXBhZ2UtY29udGVudD5cbiAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRhaW5lclwiPlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtMTJcIj5cbiAgICAgICAgICAgICAgICAgICAgPGF4LWZvcm0tZ3JvdXA+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YXgtbGFiZWw+e3snY29tbW9uLnRpdGxlJyB8IHRyYW5zfX08L2F4LWxhYmVsPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGF4LXRleHQtYm94IFsodmFsdWUpXT1cImRhdGEudGl0bGVcIj48L2F4LXRleHQtYm94PlxuICAgICAgICAgICAgICAgICAgICA8L2F4LWZvcm0tZ3JvdXA+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLTEyXCI+XG4gICAgICAgICAgICAgICAgICAgIDxheC1mb3JtLWdyb3VwPlxuICAgICAgICAgICAgICAgICAgICAgICAgPGF4LWxhYmVsPnt7J2NvbW1vbi5kZXNjcmlwdGlvbicgfCB0cmFuc319PC9heC1sYWJlbD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxheC10ZXh0LWFyZWEgWyh2YWx1ZSldPVwiZGF0YS5kZXNjcmlwdGlvblwiPjwvYXgtdGV4dC1hcmVhPlxuICAgICAgICAgICAgICAgICAgICA8L2F4LWZvcm0tZ3JvdXA+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDwhLS0gPGRpdiBjbGFzcz1cInJvd1wiPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtMTJcIj5cbiAgICAgICAgICAgICAgICAgICAgPGF4LWZvcm0tZ3JvdXA+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YXgtbGFiZWw+e3snY29tbW9uLnVuaXF1ZW5hbWUnIHwgdHJhbnN9fTwvYXgtbGFiZWw+XG4gICAgICAgICAgICAgICAgICAgICAgICA8YXgtdGV4dC1ib3g+PC9heC10ZXh0LWJveD5cbiAgICAgICAgICAgICAgICAgICAgPC9heC1mb3JtLWdyb3VwPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+IC0tPlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiIHN0eWxlPVwibWFyZ2luLWJsb2NrLWVuZDogdmFyKC0tYXgtc2l6ZS1tZCk7bWFyZ2luLWJsb2NrLXN0YXJ0OiB2YXIoLS1heC1zaXplLW1kKTtcIj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLTEyXCI+XG4gICAgICAgICAgICAgICAgICAgIDxheC1maWVsZHNldCBjYXB0aW9uPVwie3snd2lkZ2V0LWJvYXJkLmNvbmZpZ3VyYWJsZS1wcm9wcycgfCB0cmFuc319XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicm93XCIgKm5nRm9yPVwibGV0IHByb3Agb2YgZGlzcGxheVByb3BzXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC0xMlwiIHN0eWxlPVwibWFyZ2luLWJsb2NrLWVuZDogdmFyKC0tYXgtc2l6ZS1zbSlcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGF4LWNoZWNrLWJveCBbKHZhbHVlKV09XCJwcm9wLmFsbG93XCIgbGFiZWw9XCJ7eyBwcm9wLnRpdGxlIHwgdHJhbnMgfX1cIj5cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2F4LWNoZWNrLWJveD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2F4LWZpZWxkc2V0PlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuICAgIDwvYXgtcGFnZS1jb250ZW50PlxuPC9heC1wYWdlPiJdfQ==
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
2
|
+
import { EventEmitter, Injectable } from '@angular/core';
|
3
|
+
import { propertyEditor } from '@acorex/components';
|
4
|
+
import { AXHtmlUtil, AXTranslator } from '@acorex/core';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
// @dynamic
|
7
|
+
// TODO: Add Angular decorator.
|
8
|
+
export class AXWidgetComponent {
|
9
|
+
uid = AXHtmlUtil.getUID();
|
10
|
+
provideValue;
|
11
|
+
onBusyChanged = new EventEmitter();
|
12
|
+
_isBusy = true;
|
13
|
+
get isBusy() {
|
14
|
+
return this._isBusy;
|
15
|
+
}
|
16
|
+
set isBusy(v) {
|
17
|
+
if (v !== this._isBusy) {
|
18
|
+
const eventData = {
|
19
|
+
component: this,
|
20
|
+
oldValue: this._isBusy,
|
21
|
+
value: v
|
22
|
+
};
|
23
|
+
this._isBusy = v;
|
24
|
+
this.onBusyChanged.emit(eventData);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
widgetSize;
|
28
|
+
refreshRate = [{
|
29
|
+
id: 60000 * 5,
|
30
|
+
text: AXTranslator.get('dateTime.duration.format_minute').replace('{0}', '5')
|
31
|
+
}];
|
32
|
+
// ???
|
33
|
+
getRefreshRate() {
|
34
|
+
return Array.isArray(this.refreshRate) && this.refreshRate.length ? this.refreshRate[0].id : this.refreshRate;
|
35
|
+
}
|
36
|
+
intervalId;
|
37
|
+
constructor() {
|
38
|
+
this.onConfiguredChanged.subscribe(() => {
|
39
|
+
if (this.isConfigured === true && this.getRefreshRate()) {
|
40
|
+
this.restartRefreshTimer();
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
this.stopRefreshTimer();
|
44
|
+
}
|
45
|
+
});
|
46
|
+
}
|
47
|
+
startRefreshTimer() {
|
48
|
+
this.intervalId = window.setInterval(this.refresh.bind(this), this.getRefreshRate());
|
49
|
+
}
|
50
|
+
stopRefreshTimer() {
|
51
|
+
window.clearInterval(this.intervalId);
|
52
|
+
}
|
53
|
+
restartRefreshTimer() {
|
54
|
+
this.stopRefreshTimer();
|
55
|
+
this.startRefreshTimer();
|
56
|
+
}
|
57
|
+
ngOnDestroy() {
|
58
|
+
this.stopRefreshTimer();
|
59
|
+
}
|
60
|
+
redraw() {
|
61
|
+
}
|
62
|
+
refresh() {
|
63
|
+
this.restartRefreshTimer();
|
64
|
+
}
|
65
|
+
onConfiguredChanged = new EventEmitter();
|
66
|
+
get isConfigured() {
|
67
|
+
return true;
|
68
|
+
}
|
69
|
+
setValue(name, value) {
|
70
|
+
this[name] = value;
|
71
|
+
this.onConfiguredChanged.emit();
|
72
|
+
}
|
73
|
+
getValue(name) {
|
74
|
+
const val = this[name];
|
75
|
+
const config = this['__meta__'].config;
|
76
|
+
const runtime = config.props[name]?.runtime;
|
77
|
+
if (runtime && this.provideValue) {
|
78
|
+
const res = this.provideValue({
|
79
|
+
name,
|
80
|
+
value: val,
|
81
|
+
uniqueName: config.uniqueName,
|
82
|
+
options: config.options,
|
83
|
+
});
|
84
|
+
if (this.provideValue instanceof Promise) {
|
85
|
+
return res;
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
return Promise.resolve(res);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
return Promise.resolve(val);
|
92
|
+
}
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
94
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXWidgetComponent });
|
95
|
+
}
|
96
|
+
__decorate([
|
97
|
+
propertyEditor({
|
98
|
+
editorClass: 'ax/editors/widget-size',
|
99
|
+
title: 'common.size',
|
100
|
+
visible: false,
|
101
|
+
order: -99,
|
102
|
+
}),
|
103
|
+
__metadata("design:type", Array)
|
104
|
+
], AXWidgetComponent.prototype, "widgetSize", void 0);
|
105
|
+
__decorate([
|
106
|
+
propertyEditor({
|
107
|
+
editorClass: 'ax/editors/select',
|
108
|
+
title: 'common.refresh-rate',
|
109
|
+
visible: true,
|
110
|
+
order: -98,
|
111
|
+
editorOptions: {
|
112
|
+
items: () => {
|
113
|
+
return [1, 2, 3, 5, 10, 20, 30, 60].map(c => ({
|
114
|
+
id: 60000 * c,
|
115
|
+
text: AXTranslator.get('dateTime.duration.format_minute').replace('{0}', c.toString())
|
116
|
+
}));
|
117
|
+
},
|
118
|
+
allowNull: false,
|
119
|
+
allowSearch: false,
|
120
|
+
selectionDataMode: 'value',
|
121
|
+
selectionMode: 'single',
|
122
|
+
valueField: 'id',
|
123
|
+
}
|
124
|
+
}),
|
125
|
+
__metadata("design:type", Object)
|
126
|
+
], AXWidgetComponent.prototype, "refreshRate", void 0);
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AXWidgetComponent, decorators: [{
|
128
|
+
type: Injectable
|
129
|
+
}], ctorParameters: function () { return []; }, propDecorators: { widgetSize: [], refreshRate: [] } });
|
130
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2lkZ2V0LmNsYXNzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9sYXlvdXQvc3JjL2xpYi93aWRnZXQtYm9hcmQvd2lkZ2V0LmNsYXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6RCxPQUFPLEVBQTZCLGNBQWMsRUFBZSxNQUFNLG9CQUFvQixDQUFDO0FBQzVGLE9BQU8sRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLE1BQU0sY0FBYyxDQUFDOztBQTBDeEQsV0FBVztBQUNYLCtCQUErQjtBQUUvQixNQUFNLE9BQWdCLGlCQUFpQjtJQUUxQixHQUFHLEdBQVcsVUFBVSxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQzNDLFlBQVksQ0FBa0I7SUFFOUIsYUFBYSxHQUF3QyxJQUFJLFlBQVksRUFBeUIsQ0FBQztJQUV2RixPQUFPLEdBQVksSUFBSSxDQUFDO0lBQ2hDLElBQVcsTUFBTTtRQUNiLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN4QixDQUFDO0lBQ0QsSUFBVyxNQUFNLENBQUMsQ0FBVTtRQUN4Q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ICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0aGlzLnByb3ZpZGVWYWx1ZSBpbnN0YW5jZW9mIFByb21pc2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodmFsKTtcbiAgICB9XG5cbn0iXX0=
|