@stratusjs/angular 0.8.5 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.bundle.js +4884 -5856
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/app.module.js +8 -2
- package/src/app.module.js.map +1 -1
- package/src/app.module.min.js +1 -1
- package/src/app.module.ts +4 -0
- package/src/base/base.component.min.js +1 -1
- package/src/confirm-dialog/confirm-dialog.component.min.js +1 -1
- package/src/core/root.component.min.js +1 -1
- package/src/editor/citation-dialog.component.min.js +1 -1
- package/src/editor/code-view-dialog.component.min.js +1 -1
- package/src/editor/editor.component.min.js +1 -1
- package/src/editor/link-dialog.component.min.js +1 -1
- package/src/editor/media-dialog.component.min.js +1 -1
- package/src/editor/quill-break-blot.plugin.js +38 -0
- package/src/editor/quill-break-blot.plugin.js.map +1 -0
- package/src/editor/quill-break-blot.plugin.min.js +1 -0
- package/src/editor/quill-html-edit.plugin.js +164 -0
- package/src/editor/quill-html-edit.plugin.js.map +1 -0
- package/src/editor/quill-html-edit.plugin.min.js +1 -0
- package/src/editor/quill-image-format.plugin.js +50 -0
- package/src/editor/quill-image-format.plugin.js.map +1 -0
- package/src/editor/quill-image-format.plugin.min.js +1 -0
- package/src/editor/quill-input-button.plugin.js +98 -0
- package/src/editor/quill-input-button.plugin.js.map +1 -0
- package/src/editor/quill-input-button.plugin.min.js +1 -0
- package/src/froala/editor/froala-editor.directive.js +328 -0
- package/src/froala/editor/froala-editor.directive.js.map +1 -0
- package/src/froala/editor/froala-editor.directive.min.js +1 -0
- package/src/froala/editor/froala-editor.module.js +37 -0
- package/src/froala/editor/froala-editor.module.js.map +1 -0
- package/src/froala/editor/froala-editor.module.min.js +1 -0
- package/src/froala/editor/index.js +22 -0
- package/src/froala/editor/index.js.map +1 -0
- package/src/froala/editor/index.min.js +1 -0
- package/src/froala/plugins/citationManager.min.js +1 -1
- package/src/froala/plugins/image_manager.js +364 -0
- package/src/froala/plugins/image_manager.js.map +1 -0
- package/src/froala/plugins/image_manager.min.js +1 -0
- package/src/froala/plugins/inputButton.min.js +1 -1
- package/src/froala/plugins/mediaManager.min.js +1 -1
- package/src/froala/plugins/menuButton.min.js +1 -1
- package/src/froala/view/froala-view.directive.js +49 -0
- package/src/froala/view/froala-view.directive.js.map +1 -0
- package/src/froala/view/froala-view.directive.min.js +1 -0
- package/src/froala/view/froala-view.module.js +37 -0
- package/src/froala/view/froala-view.module.js.map +1 -0
- package/src/froala/view/froala-view.module.min.js +1 -0
- package/src/froala/view/index.js +22 -0
- package/src/froala/view/index.js.map +1 -0
- package/src/froala/view/index.min.js +1 -0
- package/src/media-selector/media-selector.component.min.js +1 -1
- package/src/quill-plugins/quill-html-edit.plugin.min.js +1 -1
- package/src/quill-plugins/quill-image-format.plugin.min.js +1 -1
- package/src/root/root.component.js +43 -0
- package/src/root/root.component.js.map +1 -0
- package/src/root/root.component.min.js +1 -0
- package/src/selector/selector.component.min.js +1 -1
- package/src/test/test.directive.min.js +1 -1
- package/src/timezone-selector/timezone-selector.component.html +11 -0
- package/src/timezone-selector/timezone-selector.component.js +240 -0
- package/src/timezone-selector/timezone-selector.component.js.map +1 -0
- package/src/timezone-selector/timezone-selector.component.min.html +1 -0
- package/src/timezone-selector/timezone-selector.component.min.js +1 -0
- package/src/timezone-selector/timezone-selector.component.ts +271 -0
- package/src/tree/tree-dialog.component.min.js +1 -1
- package/src/tree/tree-node.component.min.js +1 -1
- package/src/tree/tree.component.min.js +1 -1
- package/src/core/dialog.interface.js.map +0 -1
- package/src/json/json.component.css +0 -2
- package/src/json/json.component.css.map +0 -1
- package/src/json/json.component.js +0 -257
- package/src/json/json.component.js.map +0 -1
- package/src/json/json.component.min.css +0 -0
- package/src/json/json.component.min.js +0 -1
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
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;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { ChangeDetectorRef, Component, ElementRef, Input } from '@angular/core';
|
|
11
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
12
|
-
import { Stratus } from '@stratusjs/runtime/stratus';
|
|
13
|
-
import _, { has } from 'lodash';
|
|
14
|
-
import { cookie } from '@stratusjs/core/environment';
|
|
15
|
-
import { RootComponent } from '../core/root.component';
|
|
16
|
-
import { Observable, Subject, timer } from 'rxjs';
|
|
17
|
-
import { FormBuilder, FormControl } from '@angular/forms';
|
|
18
|
-
import { MatDialog } from '@angular/material/dialog';
|
|
19
|
-
import { EventManager } from '@stratusjs/core/events/eventManager';
|
|
20
|
-
import { catchError, debounce } from 'rxjs/operators';
|
|
21
|
-
import { Registry } from '@stratusjs/angularjs/services/registry';
|
|
22
|
-
const systemDir = '@stratusjs/angular';
|
|
23
|
-
const moduleName = 'json';
|
|
24
|
-
const min = !cookie('env') ? '.min' : '';
|
|
25
|
-
const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
26
|
-
let JsonComponent = class JsonComponent extends RootComponent {
|
|
27
|
-
constructor(sanitizer, ref, elementRef, fb, dialog) {
|
|
28
|
-
super();
|
|
29
|
-
this.sanitizer = sanitizer;
|
|
30
|
-
this.ref = ref;
|
|
31
|
-
this.elementRef = elementRef;
|
|
32
|
-
this.fb = fb;
|
|
33
|
-
this.dialog = dialog;
|
|
34
|
-
this.title = `${moduleName}_component`;
|
|
35
|
-
this.dev = !!cookie('env');
|
|
36
|
-
this.debug = !!cookie(`debug_${moduleName}`);
|
|
37
|
-
this._ = _;
|
|
38
|
-
this.has = has;
|
|
39
|
-
this.log = console.log;
|
|
40
|
-
this.Stratus = Stratus;
|
|
41
|
-
this.registry = new Registry();
|
|
42
|
-
this.onChange = new Subject();
|
|
43
|
-
this.svgIcons = {};
|
|
44
|
-
this.initialized = false;
|
|
45
|
-
this.styled = false;
|
|
46
|
-
this.blurred = false;
|
|
47
|
-
this.focused = false;
|
|
48
|
-
this.form = this.fb.group({
|
|
49
|
-
dataString: new FormControl(),
|
|
50
|
-
});
|
|
51
|
-
this.dataChangeLog = [];
|
|
52
|
-
this.incomingData = '';
|
|
53
|
-
this.outgoingData = '';
|
|
54
|
-
this.debounceSave = true;
|
|
55
|
-
this.debounceTime = 5000;
|
|
56
|
-
this.forceSave = false;
|
|
57
|
-
this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName)}_component_`);
|
|
58
|
-
Stratus.Instances[this.uid] = this;
|
|
59
|
-
Stratus.Internals.LoadCss([
|
|
60
|
-
`${localDir}${moduleName}/${moduleName}.component${min}.css`,
|
|
61
|
-
]).then(() => {
|
|
62
|
-
this.styled = true;
|
|
63
|
-
this.refresh();
|
|
64
|
-
}).catch((e) => {
|
|
65
|
-
console.error(e);
|
|
66
|
-
console.warn('Issue detected in CSS Loader for Component:', this.uid);
|
|
67
|
-
this.styled = true;
|
|
68
|
-
this.refresh();
|
|
69
|
-
});
|
|
70
|
-
this.hydrate(elementRef, sanitizer, ["title", "uid", "dev", "debug", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "initialized", "styled", "blurred", "focused", "codeViewIsOpen", "form", "dataChangeLog", "incomingData", "outgoingData", "debounceSave", "debounceTime", "forceSave", "sanitizer", "ref", "elementRef", "fb", "dialog", "ngOnInit", "handleError", "fetchData", "dataDefer", "dataRef", "onDataChange", "modelSave", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
71
|
-
this.fetchData()
|
|
72
|
-
.then(data => {
|
|
73
|
-
if (!data || !(data instanceof EventManager)) {
|
|
74
|
-
console.warn('Unable to bind data from Registry!');
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const onDataChange = () => {
|
|
78
|
-
if (!data.completed) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
this.dataDefer(this.subscriber);
|
|
82
|
-
};
|
|
83
|
-
data.on('change', onDataChange);
|
|
84
|
-
onDataChange();
|
|
85
|
-
});
|
|
86
|
-
this.dataSub = new Observable(subscriber => {
|
|
87
|
-
if (this.dev) {
|
|
88
|
-
console.warn(`[observable] creating subscriber on ${this.uid}`, subscriber);
|
|
89
|
-
}
|
|
90
|
-
return this.dataDefer(subscriber);
|
|
91
|
-
});
|
|
92
|
-
this.dataSub.pipe(debounce(() => timer(250)), catchError(this.handleError)).subscribe(evt => {
|
|
93
|
-
if (this.focused) {
|
|
94
|
-
if (this.dev) {
|
|
95
|
-
console.warn(`[subscriber] waiting on updates due to focus on ${this.uid}`);
|
|
96
|
-
}
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const dataControl = this.form.get('dataString');
|
|
100
|
-
if (dataControl.value === evt) {
|
|
101
|
-
if (this.initialized) {
|
|
102
|
-
this.refresh();
|
|
103
|
-
}
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
dataControl.patchValue(evt);
|
|
107
|
-
this.refresh();
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
ngOnInit() {
|
|
111
|
-
this.initialized = true;
|
|
112
|
-
const dataControl = this.form.get('dataString');
|
|
113
|
-
if (this.debounceSave) {
|
|
114
|
-
dataControl.valueChanges.pipe(debounce(() => timer(this.debounceTime)), catchError(this.handleError)).subscribe((evt) => this.modelSave(evt));
|
|
115
|
-
dataControl.valueChanges.pipe(debounce(() => timer(250)), catchError(this.handleError)).subscribe((evt) => {
|
|
116
|
-
if (this.model.changedExternal) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.model.changedExternal = true;
|
|
120
|
-
this.model.trigger('change');
|
|
121
|
-
});
|
|
122
|
-
dataControl.valueChanges.forEach((value) => this.outgoingData = value);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
dataControl.valueChanges.forEach((value) => this.modelSave(value));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
handleError(err) {
|
|
129
|
-
console.error(err);
|
|
130
|
-
return err;
|
|
131
|
-
}
|
|
132
|
-
fetchData() {
|
|
133
|
-
if (this.fetched) {
|
|
134
|
-
return this.fetched;
|
|
135
|
-
}
|
|
136
|
-
return this.fetched = this.registry.fetch(Stratus.Select(this.elementRef.nativeElement), this);
|
|
137
|
-
}
|
|
138
|
-
dataDefer(subscriber) {
|
|
139
|
-
this.subscriber = this.subscriber || subscriber;
|
|
140
|
-
if (!this.subscriber) {
|
|
141
|
-
if (this.dev) {
|
|
142
|
-
console.warn(`[defer] debouncing due to empty subscriber on ${this.uid}`);
|
|
143
|
-
}
|
|
144
|
-
setTimeout(() => {
|
|
145
|
-
if (this.dev) {
|
|
146
|
-
console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
|
|
147
|
-
}
|
|
148
|
-
this.dataDefer(subscriber);
|
|
149
|
-
}, 250);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const prevString = _.clone(this.incomingData);
|
|
153
|
-
const dataString = this.dataRef();
|
|
154
|
-
if (prevString === dataString) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (!dataString && (!this.data || !this.data.completed)) {
|
|
158
|
-
if (this.dev) {
|
|
159
|
-
console.warn(`[defer] debouncing subscriber due to unavailable data on ${this.uid}`, this.data);
|
|
160
|
-
}
|
|
161
|
-
setTimeout(() => {
|
|
162
|
-
if (this.dev) {
|
|
163
|
-
console.warn(`[defer] debounced subscriber returned on ${this.uid}`);
|
|
164
|
-
}
|
|
165
|
-
this.dataDefer(subscriber);
|
|
166
|
-
}, 250);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
if (prevString === dataString) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (this.dev) {
|
|
173
|
-
console.warn(`[subscriber] new value submitted on ${this.uid}:`, dataString);
|
|
174
|
-
}
|
|
175
|
-
this.subscriber.next(dataString);
|
|
176
|
-
}
|
|
177
|
-
dataRef() {
|
|
178
|
-
if (!this.model) {
|
|
179
|
-
return '';
|
|
180
|
-
}
|
|
181
|
-
return this.incomingData = this.model.get(this.property);
|
|
182
|
-
}
|
|
183
|
-
onDataChange() {
|
|
184
|
-
this.dataDefer(this.subscriber);
|
|
185
|
-
this.refresh();
|
|
186
|
-
}
|
|
187
|
-
modelSave(value) {
|
|
188
|
-
if (!this.model.completed) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
this.model.set(this.property, value);
|
|
192
|
-
if (this.debounceSave) {
|
|
193
|
-
this.model.changedExternal = false;
|
|
194
|
-
}
|
|
195
|
-
if (this.forceSave && !_.isEmpty(this.model.getIdentifier())) {
|
|
196
|
-
this.model.save();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
__decorate([
|
|
201
|
-
Input(),
|
|
202
|
-
__metadata("design:type", String)
|
|
203
|
-
], JsonComponent.prototype, "target", void 0);
|
|
204
|
-
__decorate([
|
|
205
|
-
Input(),
|
|
206
|
-
__metadata("design:type", String)
|
|
207
|
-
], JsonComponent.prototype, "targetSuffix", void 0);
|
|
208
|
-
__decorate([
|
|
209
|
-
Input(),
|
|
210
|
-
__metadata("design:type", Number)
|
|
211
|
-
], JsonComponent.prototype, "id", void 0);
|
|
212
|
-
__decorate([
|
|
213
|
-
Input(),
|
|
214
|
-
__metadata("design:type", Boolean)
|
|
215
|
-
], JsonComponent.prototype, "manifest", void 0);
|
|
216
|
-
__decorate([
|
|
217
|
-
Input(),
|
|
218
|
-
__metadata("design:type", Boolean)
|
|
219
|
-
], JsonComponent.prototype, "decouple", void 0);
|
|
220
|
-
__decorate([
|
|
221
|
-
Input(),
|
|
222
|
-
__metadata("design:type", Boolean)
|
|
223
|
-
], JsonComponent.prototype, "direct", void 0);
|
|
224
|
-
__decorate([
|
|
225
|
-
Input(),
|
|
226
|
-
__metadata("design:type", Object)
|
|
227
|
-
], JsonComponent.prototype, "api", void 0);
|
|
228
|
-
__decorate([
|
|
229
|
-
Input(),
|
|
230
|
-
__metadata("design:type", String)
|
|
231
|
-
], JsonComponent.prototype, "urlRoot", void 0);
|
|
232
|
-
__decorate([
|
|
233
|
-
Input(),
|
|
234
|
-
__metadata("design:type", String)
|
|
235
|
-
], JsonComponent.prototype, "type", void 0);
|
|
236
|
-
__decorate([
|
|
237
|
-
Input(),
|
|
238
|
-
__metadata("design:type", String)
|
|
239
|
-
], JsonComponent.prototype, "property", void 0);
|
|
240
|
-
__decorate([
|
|
241
|
-
Input(),
|
|
242
|
-
__metadata("design:type", String)
|
|
243
|
-
], JsonComponent.prototype, "endpoint", void 0);
|
|
244
|
-
JsonComponent = __decorate([
|
|
245
|
-
Component({
|
|
246
|
-
selector: 'sa-json',
|
|
247
|
-
templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
|
|
248
|
-
}),
|
|
249
|
-
__metadata("design:paramtypes", [DomSanitizer,
|
|
250
|
-
ChangeDetectorRef,
|
|
251
|
-
ElementRef,
|
|
252
|
-
FormBuilder,
|
|
253
|
-
MatDialog])
|
|
254
|
-
], JsonComponent);
|
|
255
|
-
export { JsonComponent };
|
|
256
|
-
|
|
257
|
-
//# sourceMappingURL=json.component.js.map
|
|
@@ -1 +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AAE;;+CAAiB;AArBhB,aAAa;IATzB,SAAS,CAAC;QACP,QAAQ,EAAE,SAAS;QAEnB,WAAW,EAAE,GAAG,QAAQ,IAAI,UAAU,IAAI,UAAU,aAAa,GAAG,OAAO;KAI9E,CAAC;qCA2EyB,YAAY;QAChB,iBAAiB;QACZ,UAAU;QAClB,WAAW;QACR,SAAS;GA7EnB,aAAa,CA4UzB;SA5UY,aAAa","file":"json.component.js"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __decorate=this&&this.__decorate||function(e,t,o,r){var i,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(n=(s<3?i(n):s>3?i(t,o,n):i(t,o))||n);return s>3&&n&&Object.defineProperty(t,o,n),n},__metadata=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};import{ChangeDetectorRef,Component,ElementRef,Input}from"@angular/core";import{DomSanitizer}from"@angular/platform-browser";import{Stratus}from"@stratusjs/runtime/stratus";import _,{has}from"lodash";import{cookie}from"@stratusjs/core/environment";import{RootComponent}from"../core/root.component";import{Observable,Subject,timer}from"rxjs";import{FormBuilder,FormControl}from"@angular/forms";import{MatDialog}from"@angular/material/dialog";import{EventManager}from"@stratusjs/core/events/eventManager";import{catchError,debounce}from"rxjs/operators";import{Registry}from"@stratusjs/angularjs/services/registry";const systemDir="@stratusjs/angular",moduleName="json",min=cookie("env")?"":".min",localDir=`${Stratus.BaseUrl}${boot.configuration.paths[systemDir+"/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`;let JsonComponent=class extends RootComponent{constructor(e,t,o,r,i){super(),this.sanitizer=e,this.ref=t,this.elementRef=o,this.fb=r,this.dialog=i,this.title="json_component",this.dev=!!cookie("env"),this.debug=!!cookie("debug_json"),this._=_,this.has=has,this.log=console.log,this.Stratus=Stratus,this.registry=new Registry,this.onChange=new Subject,this.svgIcons={},this.initialized=!1,this.styled=!1,this.blurred=!1,this.focused=!1,this.form=this.fb.group({dataString:new FormControl}),this.dataChangeLog=[],this.incomingData="",this.outgoingData="",this.debounceSave=!0,this.debounceTime=5e3,this.forceSave=!1,this.uid=_.uniqueId(`sa_${_.snakeCase("json")}_component_`),Stratus.Instances[this.uid]=this,Stratus.Internals.LoadCss([`${localDir}json/json.component${min}.css`]).then(()=>{this.styled=!0,this.refresh()}).catch(e=>{console.error(e),console.warn("Issue detected in CSS Loader for Component:",this.uid),this.styled=!0,this.refresh()}),this.hydrate(o,e,["title","uid","dev","debug","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","_","has","log","Stratus","registry","fetched","data","collection","model","dataSub","onChange","subscriber","svgIcons","initialized","styled","blurred","focused","codeViewIsOpen","form","dataChangeLog","incomingData","outgoingData","debounceSave","debounceTime","forceSave","sanitizer","ref","elementRef","fb","dialog","ngOnInit","handleError","fetchData","dataDefer","dataRef","onDataChange","modelSave","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.fetchData().then(e=>{if(!(e&&e instanceof EventManager))return void console.warn("Unable to bind data from Registry!");const t=()=>{e.completed&&this.dataDefer(this.subscriber)};e.on("change",t),t()}),this.dataSub=new Observable(e=>(this.dev&&console.warn("[observable] creating subscriber on "+this.uid,e),this.dataDefer(e))),this.dataSub.pipe(debounce(()=>timer(250)),catchError(this.handleError)).subscribe(e=>{if(this.focused)return void(this.dev&&console.warn("[subscriber] waiting on updates due to focus on "+this.uid));const t=this.form.get("dataString");t.value!==e?(t.patchValue(e),this.refresh()):this.initialized&&this.refresh()})}ngOnInit(){this.initialized=!0;const e=this.form.get("dataString");this.debounceSave?(e.valueChanges.pipe(debounce(()=>timer(this.debounceTime)),catchError(this.handleError)).subscribe(e=>this.modelSave(e)),e.valueChanges.pipe(debounce(()=>timer(250)),catchError(this.handleError)).subscribe(e=>{this.model.changedExternal||(this.model.changedExternal=!0,this.model.trigger("change"))}),e.valueChanges.forEach(e=>this.outgoingData=e)):e.valueChanges.forEach(e=>this.modelSave(e))}handleError(e){return console.error(e),e}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(e){if(this.subscriber=this.subscriber||e,!this.subscriber)return this.dev&&console.warn("[defer] debouncing due to empty subscriber on "+this.uid),void setTimeout(()=>{this.dev&&console.warn("[defer] debounced subscriber returned on "+this.uid),this.dataDefer(e)},250);const t=_.clone(this.incomingData),o=this.dataRef();return t!==o?o||this.data&&this.data.completed?void(t!==o&&(this.dev&&console.warn(`[subscriber] new value submitted on ${this.uid}:`,o),this.subscriber.next(o))):(this.dev&&console.warn("[defer] debouncing subscriber due to unavailable data on "+this.uid,this.data),void setTimeout(()=>{this.dev&&console.warn("[defer] debounced subscriber returned on "+this.uid),this.dataDefer(e)},250)):void 0}dataRef(){return this.model?this.incomingData=this.model.get(this.property):""}onDataChange(){this.dataDefer(this.subscriber),this.refresh()}modelSave(e){this.model.completed&&(this.model.set(this.property,e),this.debounceSave&&(this.model.changedExternal=!1),this.forceSave&&!_.isEmpty(this.model.getIdentifier())&&this.model.save())}};__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"target",void 0),__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"targetSuffix",void 0),__decorate([Input(),__metadata("design:type",Number)],JsonComponent.prototype,"id",void 0),__decorate([Input(),__metadata("design:type",Boolean)],JsonComponent.prototype,"manifest",void 0),__decorate([Input(),__metadata("design:type",Boolean)],JsonComponent.prototype,"decouple",void 0),__decorate([Input(),__metadata("design:type",Boolean)],JsonComponent.prototype,"direct",void 0),__decorate([Input(),__metadata("design:type",Object)],JsonComponent.prototype,"api",void 0),__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"urlRoot",void 0),__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"type",void 0),__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"property",void 0),__decorate([Input(),__metadata("design:type",String)],JsonComponent.prototype,"endpoint",void 0),JsonComponent=__decorate([Component({selector:"sa-json",templateUrl:`${localDir}/json/json.component${min}.html`}),__metadata("design:paramtypes",[DomSanitizer,ChangeDetectorRef,ElementRef,FormBuilder,MatDialog])],JsonComponent);export{JsonComponent};
|