@stratusjs/angular 0.5.2 → 0.5.3

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.
Files changed (81) hide show
  1. package/dist/angular.bundle.min.js +1 -1
  2. package/package.json +1 -1
  3. package/src/angular.modules.js +33 -18
  4. package/src/angular.modules.js.map +1 -1
  5. package/src/app.module.js +254 -181
  6. package/src/app.module.js.map +1 -1
  7. package/src/backend.service.js +87 -66
  8. package/src/backend.service.js.map +1 -1
  9. package/src/base/base.component.js +124 -101
  10. package/src/base/base.component.js.map +1 -1
  11. package/src/boot.js +55 -42
  12. package/src/boot.js.map +1 -1
  13. package/src/confirm-dialog/confirm-dialog.component.js +60 -41
  14. package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
  15. package/src/core/base.interface.js +9 -1
  16. package/src/core/base.interface.js.map +1 -1
  17. package/src/core/refresh.interface.js +9 -1
  18. package/src/core/refresh.interface.js.map +1 -1
  19. package/src/core/responsive.component.js +58 -40
  20. package/src/core/responsive.component.js.map +1 -1
  21. package/src/core/responsive.interface.js +9 -1
  22. package/src/core/responsive.interface.js.map +1 -1
  23. package/src/core/root.component.js +43 -24
  24. package/src/core/root.component.js.map +1 -1
  25. package/src/core/trigger.interface.js +9 -1
  26. package/src/core/trigger.interface.js.map +1 -1
  27. package/src/data/contact-meta.interface.js +9 -1
  28. package/src/data/contact-meta.interface.js.map +1 -1
  29. package/src/data/content.interface.js +9 -1
  30. package/src/data/content.interface.js.map +1 -1
  31. package/src/data/convoy.interface.js +9 -1
  32. package/src/data/convoy.interface.js.map +1 -1
  33. package/src/editor/citation-dialog.component.js +207 -174
  34. package/src/editor/citation-dialog.component.js.map +1 -1
  35. package/src/editor/code-mirror-bridge.js +74 -60
  36. package/src/editor/code-mirror-bridge.js.map +1 -1
  37. package/src/editor/code-mirror-bridge.min.js +1 -1
  38. package/src/editor/code-view-dialog.component.js +116 -87
  39. package/src/editor/code-view-dialog.component.js.map +1 -1
  40. package/src/editor/editor.component.js +961 -903
  41. package/src/editor/editor.component.js.map +1 -1
  42. package/src/editor/link-dialog.component.js +395 -356
  43. package/src/editor/link-dialog.component.js.map +1 -1
  44. package/src/editor/media-dialog.component.js +303 -270
  45. package/src/editor/media-dialog.component.js.map +1 -1
  46. package/src/froala/plugins/citationManager.js +191 -170
  47. package/src/froala/plugins/citationManager.js.map +1 -1
  48. package/src/froala/plugins/inputButton.js +138 -122
  49. package/src/froala/plugins/inputButton.js.map +1 -1
  50. package/src/froala/plugins/linkManager.js +104 -89
  51. package/src/froala/plugins/linkManager.js.map +1 -1
  52. package/src/froala/plugins/mediaManager.js +87 -72
  53. package/src/froala/plugins/mediaManager.js.map +1 -1
  54. package/src/froala/plugins/menuButton.js +86 -71
  55. package/src/froala/plugins/menuButton.js.map +1 -1
  56. package/src/main.js +33 -13
  57. package/src/main.js.map +1 -1
  58. package/src/material.js +194 -99
  59. package/src/material.js.map +1 -1
  60. package/src/media-selector/media-selector.component.js +441 -406
  61. package/src/media-selector/media-selector.component.js.map +1 -1
  62. package/src/polyfills.js +16 -3
  63. package/src/polyfills.js.map +1 -1
  64. package/src/quill-plugins/quill-break-blot.plugin.js +35 -19
  65. package/src/quill-plugins/quill-break-blot.plugin.js.map +1 -1
  66. package/src/quill-plugins/quill-html-edit.plugin.js +153 -140
  67. package/src/quill-plugins/quill-html-edit.plugin.js.map +1 -1
  68. package/src/quill-plugins/quill-image-format.plugin.js +47 -33
  69. package/src/quill-plugins/quill-image-format.plugin.js.map +1 -1
  70. package/src/quill-plugins/quill-input-button.plugin.js +95 -77
  71. package/src/quill-plugins/quill-input-button.plugin.js.map +1 -1
  72. package/src/selector/selector.component.js +276 -241
  73. package/src/selector/selector.component.js.map +1 -1
  74. package/src/test/test.directive.js +66 -49
  75. package/src/test/test.directive.js.map +1 -1
  76. package/src/tree/tree-dialog.component.js +231 -202
  77. package/src/tree/tree-dialog.component.js.map +1 -1
  78. package/src/tree/tree-node.component.js +282 -253
  79. package/src/tree/tree-node.component.js.map +1 -1
  80. package/src/tree/tree.component.js +561 -531
  81. package/src/tree/tree.component.js.map +1 -1
@@ -1,552 +1,582 @@
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
- var __param = (this && this.__param) || function (paramIndex, decorator) {
11
- return function (target, key) { decorator(target, key, paramIndex); }
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- import { ChangeDetectorRef, Component, ElementRef, Input, Inject, } from '@angular/core';
23
- import { moveItemInArray, } from '@angular/cdk/drag-drop';
24
- import { NestedTreeControl } from '@angular/cdk/tree';
25
- import { DomSanitizer } from '@angular/platform-browser';
26
- import { MatIconRegistry } from '@angular/material/icon';
27
- import { Observable, Subject } from 'rxjs';
28
- import { Stratus } from '@stratusjs/runtime/stratus';
29
- import _ from 'lodash';
30
- import { debounce } from '@agentepsilon/decko';
31
- import { RootComponent } from '../core/root.component';
32
- import { BackendService } from '../backend.service';
33
- import { Registry } from '@stratusjs/angularjs/services/registry';
34
- import { cookie } from '@stratusjs/core/environment';
35
- import { EventManager } from '@stratusjs/core/events/eventManager';
36
- import { DOCUMENT } from '@angular/common';
37
- const systemDir = '@stratusjs/angular';
38
- const moduleName = 'tree';
39
- const min = !cookie('env') ? '.min' : '';
40
- const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
41
- let TreeComponent = class TreeComponent extends RootComponent {
42
- constructor(iconRegistry, sanitizer, backend, ref, elementRef, document) {
43
- super();
44
- this.iconRegistry = iconRegistry;
45
- this.sanitizer = sanitizer;
46
- this.backend = backend;
47
- this.ref = ref;
48
- this.elementRef = elementRef;
49
- this.document = document;
50
- this.title = moduleName + '_component';
51
- this.isInitialized = false;
52
- this.isDestroyed = false;
53
- this.isStyled = false;
54
- this._ = _;
55
- this.Stratus = Stratus;
56
- this.registry = new Registry();
57
- this.onChange = new Subject();
58
- this.unsettled = false;
59
- this.svgIcons = {};
60
- this.dblClickWait = 500;
61
- this.dropLists = [];
62
- this.dropListIdMap = {};
63
- this.dropListMap = {};
64
- this.expandedNodeSet = new Set();
65
- this.dragging = false;
66
- this.expandDelay = 1000;
67
- this.dropData = null;
68
- this.cdkDropListSortingDisabled = true;
69
- this.dropDebug = false;
70
- this.treeControl = new NestedTreeControl((node) => node.children || []);
71
- }
72
- ngOnInit() {
73
- this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName)}_component_`);
74
- Stratus.Instances[this.uid] = this;
75
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "isInitialized", "isDestroyed", "isStyled", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "_", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "unsettled", "svgIcons", "isSingleClick", "dblClickWait", "dropLists", "dropListIdMap", "dropListMap", "expandedNodeSet", "dragging", "expandTimeout", "expandDelay", "dropData", "cdkDropListSortingDisabled", "dropDebug", "tree", "treeMap", "metaMap", "dataSource", "treeControl", "iconRegistry", "sanitizer", "backend", "ref", "elementRef", "document", "ngOnInit", "ngOnDestroy", "refresh", "remove", "removeNode", "nodeIsEqual", "fetchData", "dataDefer", "dataRef", "trackDropLists", "setExpanded", "setExpandedClick", "setExpandedDblClick", "onDragDrop", "onDragMove", "showDragData", "clearDragData", "buildNodePatch", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading"]);
76
- Stratus.Internals.CssLoader(`${localDir}/${moduleName}/${moduleName}.component${min}.css`)
77
- .then(() => {
78
- this.isStyled = true;
79
- this.refresh();
80
- })
81
- .catch((err) => {
82
- console.warn('Issue detected in CSS Loader for Component:', this);
83
- console.error(err);
84
- this.isStyled = true;
85
- this.refresh();
86
- });
87
- _.forEach({
88
- tree_check: `${Stratus.BaseUrl}sitetheorycore/images/icons/check.svg`,
89
- tree_add: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/add.svg`,
90
- tree_delete: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
91
- tree_edit: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`,
92
- tree_visibility: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,
93
- }, (value, key) => this.iconRegistry.addSvgIcon(key, this.sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
94
- this.fetchData()
95
- .then(data => {
96
- if (!data || !(data instanceof EventManager)) {
97
- console.warn('Unable to bind data from Registry!');
98
- return;
1
+ System.register(["@angular/core", "@angular/cdk/drag-drop", "@angular/cdk/tree", "@angular/platform-browser", "@angular/material/icon", "rxjs", "@stratusjs/runtime/stratus", "lodash", "@agentepsilon/decko", "../core/root.component", "../backend.service", "@stratusjs/angularjs/services/registry", "@stratusjs/core/environment", "@stratusjs/core/events/eventManager", "@angular/common"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ 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;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
+ return function (target, key) { decorator(target, key, paramIndex); }
14
+ };
15
+ var core_1, drag_drop_1, tree_1, platform_browser_1, icon_1, rxjs_1, stratus_1, lodash_1, decko_1, root_component_1, backend_service_1, registry_1, environment_1, eventManager_1, common_1, systemDir, moduleName, min, localDir, TreeComponent;
16
+ var __moduleName = context_1 && context_1.id;
17
+ return {
18
+ setters: [
19
+ function (core_1_1) {
20
+ core_1 = core_1_1;
21
+ },
22
+ function (drag_drop_1_1) {
23
+ drag_drop_1 = drag_drop_1_1;
24
+ },
25
+ function (tree_1_1) {
26
+ tree_1 = tree_1_1;
27
+ },
28
+ function (platform_browser_1_1) {
29
+ platform_browser_1 = platform_browser_1_1;
30
+ },
31
+ function (icon_1_1) {
32
+ icon_1 = icon_1_1;
33
+ },
34
+ function (rxjs_1_1) {
35
+ rxjs_1 = rxjs_1_1;
36
+ },
37
+ function (stratus_1_1) {
38
+ stratus_1 = stratus_1_1;
39
+ },
40
+ function (lodash_1_1) {
41
+ lodash_1 = lodash_1_1;
42
+ },
43
+ function (decko_1_1) {
44
+ decko_1 = decko_1_1;
45
+ },
46
+ function (root_component_1_1) {
47
+ root_component_1 = root_component_1_1;
48
+ },
49
+ function (backend_service_1_1) {
50
+ backend_service_1 = backend_service_1_1;
51
+ },
52
+ function (registry_1_1) {
53
+ registry_1 = registry_1_1;
54
+ },
55
+ function (environment_1_1) {
56
+ environment_1 = environment_1_1;
57
+ },
58
+ function (eventManager_1_1) {
59
+ eventManager_1 = eventManager_1_1;
60
+ },
61
+ function (common_1_1) {
62
+ common_1 = common_1_1;
99
63
  }
100
- const onDataChange = () => {
101
- if (this.unsettled || !data.completed) {
102
- return;
64
+ ],
65
+ execute: function () {
66
+ systemDir = '@stratusjs/angular';
67
+ moduleName = 'tree';
68
+ min = !environment_1.cookie('env') ? '.min' : '';
69
+ localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
70
+ TreeComponent = class TreeComponent extends root_component_1.RootComponent {
71
+ constructor(iconRegistry, sanitizer, backend, ref, elementRef, document) {
72
+ super();
73
+ this.iconRegistry = iconRegistry;
74
+ this.sanitizer = sanitizer;
75
+ this.backend = backend;
76
+ this.ref = ref;
77
+ this.elementRef = elementRef;
78
+ this.document = document;
79
+ this.title = moduleName + '_component';
80
+ this.isInitialized = false;
81
+ this.isDestroyed = false;
82
+ this.isStyled = false;
83
+ this._ = lodash_1.default;
84
+ this.Stratus = stratus_1.Stratus;
85
+ this.registry = new registry_1.Registry();
86
+ this.onChange = new rxjs_1.Subject();
87
+ this.unsettled = false;
88
+ this.svgIcons = {};
89
+ this.dblClickWait = 500;
90
+ this.dropLists = [];
91
+ this.dropListIdMap = {};
92
+ this.dropListMap = {};
93
+ this.expandedNodeSet = new Set();
94
+ this.dragging = false;
95
+ this.expandDelay = 1000;
96
+ this.dropData = null;
97
+ this.cdkDropListSortingDisabled = true;
98
+ this.dropDebug = false;
99
+ this.treeControl = new tree_1.NestedTreeControl((node) => node.children || []);
103
100
  }
104
- this.dataDefer(this.subscriber);
105
- this.refresh();
106
- };
107
- data.on('change', onDataChange);
108
- onDataChange();
109
- data.on('add', (event, model) => {
110
- let modelCompleted = false;
111
- const onModelChange = () => {
112
- if (!model.completed) {
101
+ ngOnInit() {
102
+ this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
103
+ stratus_1.Stratus.Instances[this.uid] = this;
104
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "isInitialized", "isDestroyed", "isStyled", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "_", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "unsettled", "svgIcons", "isSingleClick", "dblClickWait", "dropLists", "dropListIdMap", "dropListMap", "expandedNodeSet", "dragging", "expandTimeout", "expandDelay", "dropData", "cdkDropListSortingDisabled", "dropDebug", "tree", "treeMap", "metaMap", "dataSource", "treeControl", "iconRegistry", "sanitizer", "backend", "ref", "elementRef", "document", "ngOnInit", "ngOnDestroy", "refresh", "remove", "removeNode", "nodeIsEqual", "fetchData", "dataDefer", "dataRef", "trackDropLists", "setExpanded", "setExpandedClick", "setExpandedDblClick", "onDragDrop", "onDragMove", "showDragData", "clearDragData", "buildNodePatch", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading"]);
105
+ stratus_1.Stratus.Internals.CssLoader(`${localDir}/${moduleName}/${moduleName}.component${min}.css`)
106
+ .then(() => {
107
+ this.isStyled = true;
108
+ this.refresh();
109
+ })
110
+ .catch((err) => {
111
+ console.warn('Issue detected in CSS Loader for Component:', this);
112
+ console.error(err);
113
+ this.isStyled = true;
114
+ this.refresh();
115
+ });
116
+ lodash_1.default.forEach({
117
+ tree_check: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/check.svg`,
118
+ tree_add: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/add.svg`,
119
+ tree_delete: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
120
+ tree_edit: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`,
121
+ tree_visibility: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,
122
+ }, (value, key) => this.iconRegistry.addSvgIcon(key, this.sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
123
+ this.fetchData()
124
+ .then(data => {
125
+ if (!data || !(data instanceof eventManager_1.EventManager)) {
126
+ console.warn('Unable to bind data from Registry!');
127
+ return;
128
+ }
129
+ const onDataChange = () => {
130
+ if (this.unsettled || !data.completed) {
131
+ return;
132
+ }
133
+ this.dataDefer(this.subscriber);
134
+ this.refresh();
135
+ };
136
+ data.on('change', onDataChange);
137
+ onDataChange();
138
+ data.on('add', (event, model) => {
139
+ let modelCompleted = false;
140
+ const onModelChange = () => {
141
+ if (!model.completed) {
142
+ return;
143
+ }
144
+ if (modelCompleted) {
145
+ return;
146
+ }
147
+ modelCompleted = true;
148
+ if (!(model.getIdentifier() in this.treeMap)) {
149
+ model.meta.set('postPersist', true);
150
+ return;
151
+ }
152
+ const node = this.treeMap[model.getIdentifier()];
153
+ if (!node.meta.component || !('openDialog' in node.meta.component)) {
154
+ model.meta.set('postPersist', true);
155
+ return;
156
+ }
157
+ node.meta.component.openDialog();
158
+ };
159
+ model.on('change', onModelChange);
160
+ onModelChange();
161
+ });
162
+ });
163
+ this.dataSub = new rxjs_1.Observable((subscriber) => this.dataDefer(subscriber));
164
+ this.dropListIdMap[`${this.uid}_parent_drop_list`] = true;
165
+ this.trackDropLists();
166
+ this.isInitialized = true;
167
+ this.refresh();
168
+ }
169
+ ngOnDestroy() {
170
+ this.isDestroyed = true;
171
+ }
172
+ refresh() {
173
+ if (this.isDestroyed) {
174
+ return new Promise(resolve => resolve());
175
+ }
176
+ lodash_1.default.forEach(this.metaMap, (meta) => {
177
+ if (!meta.component || !('refresh' in meta.component)) {
178
+ return;
179
+ }
180
+ meta.component.refresh();
181
+ });
182
+ return super.refresh();
183
+ }
184
+ remove(model) {
185
+ }
186
+ removeNode(list, node) {
187
+ const index = list.indexOf(node);
188
+ if (index === -1) {
189
+ return false;
190
+ }
191
+ list.splice(index, 1);
192
+ return true;
193
+ }
194
+ nodeIsEqual(node, other) {
195
+ if (!node || !other) {
196
+ return node === other;
197
+ }
198
+ return node.id === other.id;
199
+ }
200
+ async fetchData() {
201
+ if (this.fetched) {
202
+ return this.fetched;
203
+ }
204
+ return this.fetched = this.registry.fetch(stratus_1.Stratus.Select(this.elementRef.nativeElement), this);
205
+ }
206
+ dataDefer(subscriber) {
207
+ this.subscriber = this.subscriber || subscriber;
208
+ if (!this.subscriber || !this.collection || !this.collection.completed) {
209
+ setTimeout(() => {
210
+ this.dataDefer(subscriber);
211
+ }, 500);
212
+ return;
213
+ }
214
+ const tree = this.dataRef(true);
215
+ if (tree && tree.length) {
216
+ subscriber.next(tree);
217
+ return;
218
+ }
219
+ setTimeout(() => this.dataDefer(subscriber), 200);
220
+ }
221
+ dataRef(force = false) {
222
+ if (!this.collection) {
223
+ return [];
224
+ }
225
+ if (!force && this.tree && this.tree.length > 0) {
226
+ return this.tree;
227
+ }
228
+ let models = this.collection.models;
229
+ if (!models || !lodash_1.default.isArray(models) || !models.length) {
230
+ return [];
231
+ }
232
+ models = lodash_1.default.sortBy(models, ['data.priority']);
233
+ this.metaMap = this.metaMap || {};
234
+ this.treeMap = {};
235
+ this.tree = [];
236
+ lodash_1.default.forEach(models, (model) => {
237
+ const modelId = lodash_1.default.get(model, 'data.id');
238
+ const parentId = lodash_1.default.get(model, 'data.nestParent.id');
239
+ this.dropListIdMap[`${this.uid}_node_${modelId}_drop_list`] = true;
240
+ if (!lodash_1.default.has(this.metaMap, modelId)) {
241
+ this.metaMap[modelId] = {
242
+ id: modelId,
243
+ expanded: true
244
+ };
245
+ }
246
+ if (!lodash_1.default.has(this.treeMap, modelId)) {
247
+ this.treeMap[modelId] = {
248
+ id: modelId,
249
+ model,
250
+ children: [],
251
+ meta: this.metaMap[modelId]
252
+ };
253
+ }
254
+ this.treeMap[modelId].model = model;
255
+ this.treeMap[modelId].meta = this.metaMap[modelId];
256
+ if (parentId) {
257
+ if (!lodash_1.default.has(this.treeMap, parentId)) {
258
+ this.treeMap[parentId] = {
259
+ id: parentId,
260
+ model: null,
261
+ children: [],
262
+ meta: null
263
+ };
264
+ }
265
+ this.treeMap[parentId].children.push(this.treeMap[modelId]);
266
+ }
267
+ else {
268
+ this.tree.push(this.treeMap[modelId]);
269
+ }
270
+ });
271
+ this.trackDropLists();
272
+ return this.tree;
273
+ }
274
+ trackDropLists() {
275
+ this.dropLists = [];
276
+ lodash_1.default.forEach(this.dropListIdMap, (value, key) => {
277
+ if (!value) {
278
+ return;
279
+ }
280
+ const cached = key in this.dropListMap;
281
+ const element = cached ? this.dropListMap[key] : document.getElementById(key);
282
+ if (!element) {
283
+ return;
284
+ }
285
+ this.dropLists.push(key);
286
+ if (cached) {
287
+ return;
288
+ }
289
+ this.dropListMap[key] = element;
290
+ });
291
+ }
292
+ setExpanded(expanded) {
293
+ if (!this.metaMap || !lodash_1.default.size(this.metaMap)) {
113
294
  return;
114
295
  }
115
- if (modelCompleted) {
296
+ lodash_1.default.forEach(this.metaMap, (nodeMeta) => {
297
+ nodeMeta.expanded = expanded;
298
+ });
299
+ this.refresh();
300
+ }
301
+ setExpandedClick(expanded) {
302
+ this.isSingleClick = true;
303
+ setTimeout(() => {
304
+ if (!this.isSingleClick) {
305
+ return;
306
+ }
307
+ this.setExpanded(expanded);
308
+ }, this.dblClickWait);
309
+ }
310
+ setExpandedDblClick(expanded) {
311
+ this.isSingleClick = false;
312
+ this.setExpanded(expanded);
313
+ }
314
+ onDragDrop(event) {
315
+ if (!event.isPointerOverContainer) {
116
316
  return;
117
317
  }
118
- modelCompleted = true;
119
- if (!(model.getIdentifier() in this.treeMap)) {
120
- model.meta.set('postPersist', true);
318
+ const targetNode = event.item.data;
319
+ if (!targetNode) {
121
320
  return;
122
321
  }
123
- const node = this.treeMap[model.getIdentifier()];
124
- if (!node.meta.component || !('openDialog' in node.meta.component)) {
125
- model.meta.set('postPersist', true);
322
+ let parentNode = event.container.data;
323
+ const pastParentNode = event.previousContainer.data;
324
+ const tree = parentNode ? parentNode.children : this.dataRef();
325
+ if (!tree) {
126
326
  return;
127
327
  }
128
- node.meta.component.openDialog();
129
- };
130
- model.on('change', onModelChange);
131
- onModelChange();
132
- });
133
- });
134
- this.dataSub = new Observable((subscriber) => this.dataDefer(subscriber));
135
- this.dropListIdMap[`${this.uid}_parent_drop_list`] = true;
136
- this.trackDropLists();
137
- this.isInitialized = true;
138
- this.refresh();
139
- }
140
- ngOnDestroy() {
141
- this.isDestroyed = true;
142
- }
143
- refresh() {
144
- if (this.isDestroyed) {
145
- return new Promise(resolve => resolve());
146
- }
147
- _.forEach(this.metaMap, (meta) => {
148
- if (!meta.component || !('refresh' in meta.component)) {
149
- return;
150
- }
151
- meta.component.refresh();
152
- });
153
- return super.refresh();
154
- }
155
- remove(model) {
156
- }
157
- removeNode(list, node) {
158
- const index = list.indexOf(node);
159
- if (index === -1) {
160
- return false;
161
- }
162
- list.splice(index, 1);
163
- return true;
164
- }
165
- nodeIsEqual(node, other) {
166
- if (!node || !other) {
167
- return node === other;
168
- }
169
- return node.id === other.id;
170
- }
171
- fetchData() {
172
- return __awaiter(this, void 0, void 0, function* () {
173
- if (this.fetched) {
174
- return this.fetched;
175
- }
176
- return this.fetched = this.registry.fetch(Stratus.Select(this.elementRef.nativeElement), this);
177
- });
178
- }
179
- dataDefer(subscriber) {
180
- this.subscriber = this.subscriber || subscriber;
181
- if (!this.subscriber || !this.collection || !this.collection.completed) {
182
- setTimeout(() => {
183
- this.dataDefer(subscriber);
184
- }, 500);
185
- return;
186
- }
187
- const tree = this.dataRef(true);
188
- if (tree && tree.length) {
189
- subscriber.next(tree);
190
- return;
191
- }
192
- setTimeout(() => this.dataDefer(subscriber), 200);
193
- }
194
- dataRef(force = false) {
195
- if (!this.collection) {
196
- return [];
197
- }
198
- if (!force && this.tree && this.tree.length > 0) {
199
- return this.tree;
200
- }
201
- let models = this.collection.models;
202
- if (!models || !_.isArray(models) || !models.length) {
203
- return [];
204
- }
205
- models = _.sortBy(models, ['data.priority']);
206
- this.metaMap = this.metaMap || {};
207
- this.treeMap = {};
208
- this.tree = [];
209
- _.forEach(models, (model) => {
210
- const modelId = _.get(model, 'data.id');
211
- const parentId = _.get(model, 'data.nestParent.id');
212
- this.dropListIdMap[`${this.uid}_node_${modelId}_drop_list`] = true;
213
- if (!_.has(this.metaMap, modelId)) {
214
- this.metaMap[modelId] = {
215
- id: modelId,
216
- expanded: true
217
- };
218
- }
219
- if (!_.has(this.treeMap, modelId)) {
220
- this.treeMap[modelId] = {
221
- id: modelId,
222
- model,
223
- children: [],
224
- meta: this.metaMap[modelId]
225
- };
226
- }
227
- this.treeMap[modelId].model = model;
228
- this.treeMap[modelId].meta = this.metaMap[modelId];
229
- if (parentId) {
230
- if (!_.has(this.treeMap, parentId)) {
231
- this.treeMap[parentId] = {
232
- id: parentId,
233
- model: null,
234
- children: [],
235
- meta: null
328
+ this.unsettled = true;
329
+ const targetDropNode = (this.dropData.targetId && this.dropData.targetId in this.treeMap) ?
330
+ this.treeMap[lodash_1.default.toNumber(this.dropData.targetId)] : null;
331
+ if (environment_1.cookie('env') && this.dropDebug) {
332
+ console.group('onDragDrop()');
333
+ lodash_1.default.forEach([
334
+ `model drop: ${targetNode.model.get('name')}`,
335
+ `list shift: ${event.container.element.nativeElement.id} -> ${event.previousContainer.element.nativeElement.id}`,
336
+ `index change (event): ${event.previousIndex} -> ${event.currentIndex}`,
337
+ `current priority: ${targetNode.model.get('priority')}`,
338
+ `target drop action: ${this.dropData.action}`,
339
+ ], (message) => console.log(message));
340
+ }
341
+ if (targetDropNode && !this.nodeIsEqual(parentNode, targetDropNode)) {
342
+ if (environment_1.cookie('env') && this.dropDebug) {
343
+ console.log(`target drop node differs: ${targetDropNode.id} -> ${targetDropNode.model.get('name')}`);
344
+ console.log('target drop node is the same as target node:', targetNode.id === targetDropNode.id);
345
+ }
346
+ if (targetNode.id !== targetDropNode.id) {
347
+ switch (this.dropData.action) {
348
+ case 'before':
349
+ case 'after':
350
+ const nestParentId = targetDropNode.model.get('nestParent.id');
351
+ const nestParent = (nestParentId && nestParentId in this.treeMap) ? this.treeMap[nestParentId] : null;
352
+ parentNode = nestParent;
353
+ break;
354
+ case 'inside':
355
+ parentNode = targetDropNode;
356
+ break;
357
+ }
358
+ }
359
+ if (environment_1.cookie('env') && this.dropDebug) {
360
+ console.log('target drop node selected:', parentNode ? `${parentNode.id} -> ${parentNode.model.get('name')}` : 'none');
361
+ }
362
+ }
363
+ if (!this.nodeIsEqual(parentNode, pastParentNode)) {
364
+ if (parentNode) {
365
+ switch (this.dropData.action) {
366
+ case 'before':
367
+ case 'after':
368
+ let targetIndex = parentNode.children.findIndex((n) => n.id === targetNode.id);
369
+ if (this.dropData.action === 'after') {
370
+ targetIndex++;
371
+ }
372
+ parentNode.children.splice(targetIndex, 0, targetNode);
373
+ break;
374
+ case 'inside':
375
+ parentNode.children.push(targetNode);
376
+ break;
377
+ }
378
+ parentNode.meta.expanded = true;
379
+ }
380
+ if (pastParentNode) {
381
+ this.removeNode(pastParentNode.children, targetNode);
382
+ }
383
+ targetNode.model.set('nestParent', this.buildNodePatch(parentNode));
384
+ if (environment_1.cookie('env') && this.dropDebug) {
385
+ console.log(`new parent: ${targetNode.model.get('nestParent.name') || null}`);
386
+ }
387
+ }
388
+ const branch = parentNode ? parentNode.children : tree;
389
+ let targetDropIndex = event.currentIndex;
390
+ if (this.cdkDropListSortingDisabled) {
391
+ targetDropIndex = null;
392
+ switch (this.dropData.action) {
393
+ case 'before':
394
+ case 'after':
395
+ targetDropIndex = branch.findIndex((n) => n.id === targetDropNode.id);
396
+ if (this.dropData.action === 'after') {
397
+ targetDropIndex++;
398
+ }
399
+ if (environment_1.cookie('env') && this.dropDebug) {
400
+ console.log('index change (drop node):', `${event.previousIndex} -> ${targetDropIndex}`);
401
+ }
402
+ break;
403
+ }
404
+ }
405
+ if (lodash_1.default.isNumber(targetDropIndex)) {
406
+ drag_drop_1.moveItemInArray(branch, event.previousIndex, targetDropIndex);
407
+ let priority = 0;
408
+ lodash_1.default.forEach(branch, (node) => {
409
+ if (!node.model || !node.model.set) {
410
+ return;
411
+ }
412
+ node.model.set('priority', priority++);
413
+ });
414
+ if (environment_1.cookie('env') && this.dropDebug) {
415
+ console.log('new priority:', targetNode.model.get('priority'));
416
+ }
417
+ }
418
+ if (environment_1.cookie('env') && this.dropDebug) {
419
+ console.log(`new parent: ${targetNode.model.get('nestParent.name') || null}`);
420
+ console.groupEnd();
421
+ }
422
+ targetNode.model.save();
423
+ this.unsettled = false;
424
+ }
425
+ onDragMove(event) {
426
+ const e = this.document.elementFromPoint(event.pointerPosition.x, event.pointerPosition.y);
427
+ if (!e) {
428
+ this.clearDragData();
429
+ return;
430
+ }
431
+ const containerClass = 'tree-node-content';
432
+ const container = e.classList.contains(containerClass) ? e : e.closest(`.${containerClass}`);
433
+ if (!container) {
434
+ this.clearDragData();
435
+ return;
436
+ }
437
+ this.dropData = {
438
+ targetId: container.getAttribute('data-id')
236
439
  };
440
+ const targetRect = container.getBoundingClientRect();
441
+ const oneThird = targetRect.height / 3;
442
+ if (event.pointerPosition.y - targetRect.top < oneThird) {
443
+ this.dropData.action = 'before';
444
+ }
445
+ else if (event.pointerPosition.y - targetRect.top > 2 * oneThird) {
446
+ this.dropData.action = 'after';
447
+ }
448
+ else {
449
+ this.dropData.action = 'inside';
450
+ }
451
+ this.showDragData();
237
452
  }
238
- this.treeMap[parentId].children.push(this.treeMap[modelId]);
239
- }
240
- else {
241
- this.tree.push(this.treeMap[modelId]);
242
- }
243
- });
244
- this.trackDropLists();
245
- return this.tree;
246
- }
247
- trackDropLists() {
248
- this.dropLists = [];
249
- _.forEach(this.dropListIdMap, (value, key) => {
250
- if (!value) {
251
- return;
252
- }
253
- const cached = key in this.dropListMap;
254
- const element = cached ? this.dropListMap[key] : document.getElementById(key);
255
- if (!element) {
256
- return;
257
- }
258
- this.dropLists.push(key);
259
- if (cached) {
260
- return;
261
- }
262
- this.dropListMap[key] = element;
263
- });
264
- }
265
- setExpanded(expanded) {
266
- if (!this.metaMap || !_.size(this.metaMap)) {
267
- return;
268
- }
269
- _.forEach(this.metaMap, (nodeMeta) => {
270
- nodeMeta.expanded = expanded;
271
- });
272
- this.refresh();
273
- }
274
- setExpandedClick(expanded) {
275
- this.isSingleClick = true;
276
- setTimeout(() => {
277
- if (!this.isSingleClick) {
278
- return;
279
- }
280
- this.setExpanded(expanded);
281
- }, this.dblClickWait);
282
- }
283
- setExpandedDblClick(expanded) {
284
- this.isSingleClick = false;
285
- this.setExpanded(expanded);
286
- }
287
- onDragDrop(event) {
288
- if (!event.isPointerOverContainer) {
289
- return;
290
- }
291
- const targetNode = event.item.data;
292
- if (!targetNode) {
293
- return;
294
- }
295
- let parentNode = event.container.data;
296
- const pastParentNode = event.previousContainer.data;
297
- const tree = parentNode ? parentNode.children : this.dataRef();
298
- if (!tree) {
299
- return;
300
- }
301
- this.unsettled = true;
302
- const targetDropNode = (this.dropData.targetId && this.dropData.targetId in this.treeMap) ?
303
- this.treeMap[_.toNumber(this.dropData.targetId)] : null;
304
- if (cookie('env') && this.dropDebug) {
305
- console.group('onDragDrop()');
306
- _.forEach([
307
- `model drop: ${targetNode.model.get('name')}`,
308
- `list shift: ${event.container.element.nativeElement.id} -> ${event.previousContainer.element.nativeElement.id}`,
309
- `index change (event): ${event.previousIndex} -> ${event.currentIndex}`,
310
- `current priority: ${targetNode.model.get('priority')}`,
311
- `target drop action: ${this.dropData.action}`,
312
- ], (message) => console.log(message));
313
- }
314
- if (targetDropNode && !this.nodeIsEqual(parentNode, targetDropNode)) {
315
- if (cookie('env') && this.dropDebug) {
316
- console.log(`target drop node differs: ${targetDropNode.id} -> ${targetDropNode.model.get('name')}`);
317
- console.log('target drop node is the same as target node:', targetNode.id === targetDropNode.id);
318
- }
319
- if (targetNode.id !== targetDropNode.id) {
320
- switch (this.dropData.action) {
321
- case 'before':
322
- case 'after':
323
- const nestParentId = targetDropNode.model.get('nestParent.id');
324
- const nestParent = (nestParentId && nestParentId in this.treeMap) ? this.treeMap[nestParentId] : null;
325
- parentNode = nestParent;
326
- break;
327
- case 'inside':
328
- parentNode = targetDropNode;
329
- break;
453
+ showDragData() {
454
+ this.clearDragData();
455
+ if (!this.dropData) {
456
+ return;
457
+ }
458
+ this.document.getElementById(`node-${this.dropData.targetId}`).classList.add(`drop-${this.dropData.action}`);
330
459
  }
331
- }
332
- if (cookie('env') && this.dropDebug) {
333
- console.log('target drop node selected:', parentNode ? `${parentNode.id} -> ${parentNode.model.get('name')}` : 'none');
334
- }
335
- }
336
- if (!this.nodeIsEqual(parentNode, pastParentNode)) {
337
- if (parentNode) {
338
- switch (this.dropData.action) {
339
- case 'before':
340
- case 'after':
341
- let targetIndex = parentNode.children.findIndex((n) => n.id === targetNode.id);
342
- if (this.dropData.action === 'after') {
343
- targetIndex++;
460
+ clearDragData(dropped = false) {
461
+ if (dropped) {
462
+ this.dropData = null;
463
+ }
464
+ this.document
465
+ .querySelectorAll('.drop-before')
466
+ .forEach(element => element.classList.remove('drop-before'));
467
+ this.document
468
+ .querySelectorAll('.drop-after')
469
+ .forEach(element => element.classList.remove('drop-after'));
470
+ this.document
471
+ .querySelectorAll('.drop-inside')
472
+ .forEach(element => element.classList.remove('drop-inside'));
473
+ }
474
+ buildNodePatch(node = null) {
475
+ if (!node || !node.model) {
476
+ return null;
477
+ }
478
+ const nodePatch = {};
479
+ lodash_1.default.forEach([
480
+ 'id',
481
+ 'name'
482
+ ], (key) => {
483
+ const value = node.model.get(key);
484
+ if (!value) {
485
+ return;
344
486
  }
345
- parentNode.children.splice(targetIndex, 0, targetNode);
346
- break;
347
- case 'inside':
348
- parentNode.children.push(targetNode);
349
- break;
487
+ lodash_1.default.set(nodePatch, key, value);
488
+ });
489
+ return nodePatch;
350
490
  }
351
- parentNode.meta.expanded = true;
352
- }
353
- if (pastParentNode) {
354
- this.removeNode(pastParentNode.children, targetNode);
355
- }
356
- targetNode.model.set('nestParent', this.buildNodePatch(parentNode));
357
- if (cookie('env') && this.dropDebug) {
358
- console.log(`new parent: ${targetNode.model.get('nestParent.name') || null}`);
359
- }
360
- }
361
- const branch = parentNode ? parentNode.children : tree;
362
- let targetDropIndex = event.currentIndex;
363
- if (this.cdkDropListSortingDisabled) {
364
- targetDropIndex = null;
365
- switch (this.dropData.action) {
366
- case 'before':
367
- case 'after':
368
- targetDropIndex = branch.findIndex((n) => n.id === targetDropNode.id);
369
- if (this.dropData.action === 'after') {
370
- targetDropIndex++;
491
+ getSvg(url, options) {
492
+ const uid = this.addSvgIcon(url, options);
493
+ return new rxjs_1.Observable((subscriber) => {
494
+ this.iconRegistry
495
+ .getNamedSvgIcon(uid)
496
+ .subscribe({
497
+ error(err) {
498
+ console.error(`getSvg(${url}): ${err}`);
499
+ },
500
+ complete() {
501
+ subscriber.next(uid);
502
+ }
503
+ });
504
+ });
505
+ }
506
+ addSvgIcon(url, options) {
507
+ if (url in this.svgIcons) {
508
+ return this.svgIcons[url];
371
509
  }
372
- if (cookie('env') && this.dropDebug) {
373
- console.log('index change (drop node):', `${event.previousIndex} -> ${targetDropIndex}`);
510
+ if (!options) {
511
+ options = {};
374
512
  }
375
- break;
376
- }
377
- }
378
- if (_.isNumber(targetDropIndex)) {
379
- moveItemInArray(branch, event.previousIndex, targetDropIndex);
380
- let priority = 0;
381
- _.forEach(branch, (node) => {
382
- if (!node.model || !node.model.set) {
383
- return;
513
+ const uid = this.svgIcons[url] = lodash_1.default.uniqueId('selector_svg');
514
+ this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options);
515
+ return uid;
384
516
  }
385
- node.model.set('priority', priority++);
386
- });
387
- if (cookie('env') && this.dropDebug) {
388
- console.log('new priority:', targetNode.model.get('priority'));
389
- }
390
- }
391
- if (cookie('env') && this.dropDebug) {
392
- console.log(`new parent: ${targetNode.model.get('nestParent.name') || null}`);
393
- console.groupEnd();
394
- }
395
- targetNode.model.save();
396
- this.unsettled = false;
397
- }
398
- onDragMove(event) {
399
- const e = this.document.elementFromPoint(event.pointerPosition.x, event.pointerPosition.y);
400
- if (!e) {
401
- this.clearDragData();
402
- return;
403
- }
404
- const containerClass = 'tree-node-content';
405
- const container = e.classList.contains(containerClass) ? e : e.closest(`.${containerClass}`);
406
- if (!container) {
407
- this.clearDragData();
408
- return;
409
- }
410
- this.dropData = {
411
- targetId: container.getAttribute('data-id')
412
- };
413
- const targetRect = container.getBoundingClientRect();
414
- const oneThird = targetRect.height / 3;
415
- if (event.pointerPosition.y - targetRect.top < oneThird) {
416
- this.dropData.action = 'before';
417
- }
418
- else if (event.pointerPosition.y - targetRect.top > 2 * oneThird) {
419
- this.dropData.action = 'after';
420
- }
421
- else {
422
- this.dropData.action = 'inside';
423
- }
424
- this.showDragData();
425
- }
426
- showDragData() {
427
- this.clearDragData();
428
- if (!this.dropData) {
429
- return;
430
- }
431
- this.document.getElementById(`node-${this.dropData.targetId}`).classList.add(`drop-${this.dropData.action}`);
432
- }
433
- clearDragData(dropped = false) {
434
- if (dropped) {
435
- this.dropData = null;
436
- }
437
- this.document
438
- .querySelectorAll('.drop-before')
439
- .forEach(element => element.classList.remove('drop-before'));
440
- this.document
441
- .querySelectorAll('.drop-after')
442
- .forEach(element => element.classList.remove('drop-after'));
443
- this.document
444
- .querySelectorAll('.drop-inside')
445
- .forEach(element => element.classList.remove('drop-inside'));
446
- }
447
- buildNodePatch(node = null) {
448
- if (!node || !node.model) {
449
- return null;
450
- }
451
- const nodePatch = {};
452
- _.forEach([
453
- 'id',
454
- 'name'
455
- ], (key) => {
456
- const value = node.model.get(key);
457
- if (!value) {
458
- return;
459
- }
460
- _.set(nodePatch, key, value);
461
- });
462
- return nodePatch;
463
- }
464
- getSvg(url, options) {
465
- const uid = this.addSvgIcon(url, options);
466
- return new Observable((subscriber) => {
467
- this.iconRegistry
468
- .getNamedSvgIcon(uid)
469
- .subscribe({
470
- error(err) {
471
- console.error(`getSvg(${url}): ${err}`);
472
- },
473
- complete() {
474
- subscriber.next(uid);
475
- }
476
- });
477
- });
478
- }
479
- addSvgIcon(url, options) {
480
- if (url in this.svgIcons) {
481
- return this.svgIcons[url];
482
- }
483
- if (!options) {
484
- options = {};
517
+ };
518
+ __decorate([
519
+ core_1.Input(),
520
+ __metadata("design:type", String)
521
+ ], TreeComponent.prototype, "target", void 0);
522
+ __decorate([
523
+ core_1.Input(),
524
+ __metadata("design:type", String)
525
+ ], TreeComponent.prototype, "targetSuffix", void 0);
526
+ __decorate([
527
+ core_1.Input(),
528
+ __metadata("design:type", Number)
529
+ ], TreeComponent.prototype, "id", void 0);
530
+ __decorate([
531
+ core_1.Input(),
532
+ __metadata("design:type", Boolean)
533
+ ], TreeComponent.prototype, "manifest", void 0);
534
+ __decorate([
535
+ core_1.Input(),
536
+ __metadata("design:type", Boolean)
537
+ ], TreeComponent.prototype, "decouple", void 0);
538
+ __decorate([
539
+ core_1.Input(),
540
+ __metadata("design:type", Boolean)
541
+ ], TreeComponent.prototype, "direct", void 0);
542
+ __decorate([
543
+ core_1.Input(),
544
+ __metadata("design:type", Object)
545
+ ], TreeComponent.prototype, "api", void 0);
546
+ __decorate([
547
+ core_1.Input(),
548
+ __metadata("design:type", String)
549
+ ], TreeComponent.prototype, "urlRoot", void 0);
550
+ __decorate([
551
+ core_1.Input(),
552
+ __metadata("design:type", String)
553
+ ], TreeComponent.prototype, "type", void 0);
554
+ __decorate([
555
+ core_1.Input(),
556
+ __metadata("design:type", String)
557
+ ], TreeComponent.prototype, "property", void 0);
558
+ __decorate([
559
+ decko_1.debounce(50),
560
+ __metadata("design:type", Function),
561
+ __metadata("design:paramtypes", [Object]),
562
+ __metadata("design:returntype", void 0)
563
+ ], TreeComponent.prototype, "onDragMove", null);
564
+ TreeComponent = __decorate([
565
+ core_1.Component({
566
+ selector: `sa-${moduleName}`,
567
+ templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
568
+ }),
569
+ __param(5, core_1.Inject(common_1.DOCUMENT)),
570
+ __metadata("design:paramtypes", [icon_1.MatIconRegistry,
571
+ platform_browser_1.DomSanitizer,
572
+ backend_service_1.BackendService,
573
+ core_1.ChangeDetectorRef,
574
+ core_1.ElementRef,
575
+ Document])
576
+ ], TreeComponent);
577
+ exports_1("TreeComponent", TreeComponent);
485
578
  }
486
- const uid = this.svgIcons[url] = _.uniqueId('selector_svg');
487
- this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options);
488
- return uid;
489
- }
490
- };
491
- __decorate([
492
- Input(),
493
- __metadata("design:type", String)
494
- ], TreeComponent.prototype, "target", void 0);
495
- __decorate([
496
- Input(),
497
- __metadata("design:type", String)
498
- ], TreeComponent.prototype, "targetSuffix", void 0);
499
- __decorate([
500
- Input(),
501
- __metadata("design:type", Number)
502
- ], TreeComponent.prototype, "id", void 0);
503
- __decorate([
504
- Input(),
505
- __metadata("design:type", Boolean)
506
- ], TreeComponent.prototype, "manifest", void 0);
507
- __decorate([
508
- Input(),
509
- __metadata("design:type", Boolean)
510
- ], TreeComponent.prototype, "decouple", void 0);
511
- __decorate([
512
- Input(),
513
- __metadata("design:type", Boolean)
514
- ], TreeComponent.prototype, "direct", void 0);
515
- __decorate([
516
- Input(),
517
- __metadata("design:type", Object)
518
- ], TreeComponent.prototype, "api", void 0);
519
- __decorate([
520
- Input(),
521
- __metadata("design:type", String)
522
- ], TreeComponent.prototype, "urlRoot", void 0);
523
- __decorate([
524
- Input(),
525
- __metadata("design:type", String)
526
- ], TreeComponent.prototype, "type", void 0);
527
- __decorate([
528
- Input(),
529
- __metadata("design:type", String)
530
- ], TreeComponent.prototype, "property", void 0);
531
- __decorate([
532
- debounce(50),
533
- __metadata("design:type", Function),
534
- __metadata("design:paramtypes", [Object]),
535
- __metadata("design:returntype", void 0)
536
- ], TreeComponent.prototype, "onDragMove", null);
537
- TreeComponent = __decorate([
538
- Component({
539
- selector: `sa-${moduleName}`,
540
- templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
541
- }),
542
- __param(5, Inject(DOCUMENT)),
543
- __metadata("design:paramtypes", [MatIconRegistry,
544
- DomSanitizer,
545
- BackendService,
546
- ChangeDetectorRef,
547
- ElementRef,
548
- Document])
549
- ], TreeComponent);
550
- export { TreeComponent };
579
+ };
580
+ });
551
581
 
552
582
  //# sourceMappingURL=tree.component.js.map