@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.
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/angular.modules.js +33 -18
- package/src/angular.modules.js.map +1 -1
- package/src/app.module.js +254 -181
- package/src/app.module.js.map +1 -1
- package/src/backend.service.js +87 -66
- package/src/backend.service.js.map +1 -1
- package/src/base/base.component.js +124 -101
- package/src/base/base.component.js.map +1 -1
- package/src/boot.js +55 -42
- package/src/boot.js.map +1 -1
- package/src/confirm-dialog/confirm-dialog.component.js +60 -41
- package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
- package/src/core/base.interface.js +9 -1
- package/src/core/base.interface.js.map +1 -1
- package/src/core/refresh.interface.js +9 -1
- package/src/core/refresh.interface.js.map +1 -1
- package/src/core/responsive.component.js +58 -40
- package/src/core/responsive.component.js.map +1 -1
- package/src/core/responsive.interface.js +9 -1
- package/src/core/responsive.interface.js.map +1 -1
- package/src/core/root.component.js +43 -24
- package/src/core/root.component.js.map +1 -1
- package/src/core/trigger.interface.js +9 -1
- package/src/core/trigger.interface.js.map +1 -1
- package/src/data/contact-meta.interface.js +9 -1
- package/src/data/contact-meta.interface.js.map +1 -1
- package/src/data/content.interface.js +9 -1
- package/src/data/content.interface.js.map +1 -1
- package/src/data/convoy.interface.js +9 -1
- package/src/data/convoy.interface.js.map +1 -1
- package/src/editor/citation-dialog.component.js +207 -174
- package/src/editor/citation-dialog.component.js.map +1 -1
- package/src/editor/code-mirror-bridge.js +74 -60
- package/src/editor/code-mirror-bridge.js.map +1 -1
- package/src/editor/code-mirror-bridge.min.js +1 -1
- package/src/editor/code-view-dialog.component.js +116 -87
- package/src/editor/code-view-dialog.component.js.map +1 -1
- package/src/editor/editor.component.js +961 -903
- package/src/editor/editor.component.js.map +1 -1
- package/src/editor/link-dialog.component.js +395 -356
- package/src/editor/link-dialog.component.js.map +1 -1
- package/src/editor/media-dialog.component.js +303 -270
- package/src/editor/media-dialog.component.js.map +1 -1
- package/src/froala/plugins/citationManager.js +191 -170
- package/src/froala/plugins/citationManager.js.map +1 -1
- package/src/froala/plugins/inputButton.js +138 -122
- package/src/froala/plugins/inputButton.js.map +1 -1
- package/src/froala/plugins/linkManager.js +104 -89
- package/src/froala/plugins/linkManager.js.map +1 -1
- package/src/froala/plugins/mediaManager.js +87 -72
- package/src/froala/plugins/mediaManager.js.map +1 -1
- package/src/froala/plugins/menuButton.js +86 -71
- package/src/froala/plugins/menuButton.js.map +1 -1
- package/src/main.js +33 -13
- package/src/main.js.map +1 -1
- package/src/material.js +194 -99
- package/src/material.js.map +1 -1
- package/src/media-selector/media-selector.component.js +441 -406
- package/src/media-selector/media-selector.component.js.map +1 -1
- package/src/polyfills.js +16 -3
- package/src/polyfills.js.map +1 -1
- package/src/quill-plugins/quill-break-blot.plugin.js +35 -19
- package/src/quill-plugins/quill-break-blot.plugin.js.map +1 -1
- package/src/quill-plugins/quill-html-edit.plugin.js +153 -140
- package/src/quill-plugins/quill-html-edit.plugin.js.map +1 -1
- package/src/quill-plugins/quill-image-format.plugin.js +47 -33
- package/src/quill-plugins/quill-image-format.plugin.js.map +1 -1
- package/src/quill-plugins/quill-input-button.plugin.js +95 -77
- package/src/quill-plugins/quill-input-button.plugin.js.map +1 -1
- package/src/selector/selector.component.js +276 -241
- package/src/selector/selector.component.js.map +1 -1
- package/src/test/test.directive.js +66 -49
- package/src/test/test.directive.js.map +1 -1
- package/src/tree/tree-dialog.component.js +231 -202
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-node.component.js +282 -253
- package/src/tree/tree-node.component.js.map +1 -1
- package/src/tree/tree.component.js +561 -531
- package/src/tree/tree.component.js.map +1 -1
|
@@ -1,259 +1,288 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.then(() => {
|
|
43
|
-
this.isStyled = true;
|
|
44
|
-
this.refresh();
|
|
45
|
-
})
|
|
46
|
-
.catch((err) => {
|
|
47
|
-
console.warn('Issue detected in CSS Loader for Component:', this);
|
|
48
|
-
console.error(err);
|
|
49
|
-
this.isStyled = true;
|
|
50
|
-
this.refresh();
|
|
51
|
-
});
|
|
52
|
-
this.node.meta.component = this;
|
|
53
|
-
this.isInitialized = true;
|
|
54
|
-
this.refresh();
|
|
55
|
-
this.onPostPersist();
|
|
56
|
-
}
|
|
57
|
-
ngOnDestroy() {
|
|
58
|
-
this.node.meta.component = null;
|
|
59
|
-
this.isDestroyed = true;
|
|
60
|
-
}
|
|
61
|
-
refresh() {
|
|
62
|
-
if (this.isDestroyed) {
|
|
63
|
-
return new Promise(resolve => resolve());
|
|
64
|
-
}
|
|
65
|
-
return super.refresh();
|
|
66
|
-
}
|
|
67
|
-
onPostPersist() {
|
|
68
|
-
if (!this.node) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (!this.node.model) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
if (!this.node.model.meta.get('postPersist')) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this.node.model.meta.set('postPersist', false);
|
|
78
|
-
this.openDialog();
|
|
79
|
-
}
|
|
80
|
-
destroy() {
|
|
81
|
-
const dialog = this.dialog
|
|
82
|
-
.open(ConfirmDialogComponent, {
|
|
83
|
-
maxWidth: '400px',
|
|
84
|
-
data: {
|
|
85
|
-
title: 'Delete MenuLink',
|
|
86
|
-
message: 'Are you sure you want to do this?'
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
dialog
|
|
90
|
-
.afterClosed()
|
|
91
|
-
.subscribe((dialogResult) => {
|
|
92
|
-
if (!dialogResult) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (!this.node || !this.node.model) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
this.node.model.destroy();
|
|
99
|
-
});
|
|
100
|
-
return dialog;
|
|
101
|
-
}
|
|
102
|
-
getName() {
|
|
103
|
-
if (!this.node.model || !this.node.model.get || !this.node.model.get('name')) {
|
|
104
|
-
return 'Untitled';
|
|
105
|
-
}
|
|
106
|
-
return this.node.model.get('name');
|
|
107
|
-
}
|
|
108
|
-
getDragPreview() {
|
|
109
|
-
return `name: ${this.getName()}<br>children: ${this.node.children ? this.node.children.length : 0}`;
|
|
110
|
-
}
|
|
111
|
-
toggleExpanded() {
|
|
112
|
-
if (!this.node.meta) {
|
|
113
|
-
console.error('node meta not found:', this.node);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this.node.meta.expanded = !this.node.meta.expanded;
|
|
117
|
-
this.refresh();
|
|
118
|
-
}
|
|
119
|
-
toggleExpandedClick() {
|
|
120
|
-
this.isSingleClick = true;
|
|
121
|
-
setTimeout(() => {
|
|
122
|
-
if (!this.isSingleClick) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
this.toggleExpanded();
|
|
126
|
-
}, this.tree.dblClickWait);
|
|
127
|
-
}
|
|
128
|
-
toggleExpandedDblClick() {
|
|
129
|
-
this.isSingleClick = false;
|
|
130
|
-
this.toggleExpanded();
|
|
131
|
-
}
|
|
132
|
-
openDialog() {
|
|
133
|
-
if (!this.node.model || !_.has(this.node.model, 'data')) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const dialogRef = this.dialog.open(TreeDialogComponent, {
|
|
137
|
-
width: '400px',
|
|
138
|
-
autoFocus: true,
|
|
139
|
-
disableClose: true,
|
|
140
|
-
restoreFocus: false,
|
|
141
|
-
data: {
|
|
142
|
-
tree: this.tree,
|
|
143
|
-
treeNode: this,
|
|
144
|
-
backend: this.tree.backend,
|
|
145
|
-
iconRegistry: this.tree.iconRegistry,
|
|
146
|
-
id: this.node.model.data.id || null,
|
|
147
|
-
name: this.node.model.data.name || '',
|
|
148
|
-
target: this.node.model.data.url ? 'url' : 'content',
|
|
149
|
-
content: this.node.model.data.content || null,
|
|
150
|
-
url: this.node.model.data.url || null,
|
|
151
|
-
browserTarget: this.node.model.data.browserTarget || null,
|
|
152
|
-
model: this.node.model || null,
|
|
153
|
-
collection: this.tree.collection || null,
|
|
154
|
-
parent: this.node.model.data.parent || null,
|
|
155
|
-
nestParent: this.node.model.data.nestParent || null,
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
this.refresh();
|
|
159
|
-
const that = this;
|
|
160
|
-
dialogRef.afterClosed().subscribe((result) => {
|
|
161
|
-
if (!result || _.isEmpty(result)) {
|
|
162
|
-
return;
|
|
1
|
+
System.register(["@angular/core", "@angular/material/dialog", "./tree.component", "./tree-dialog.component", "../confirm-dialog/confirm-dialog.component", "lodash", "@stratusjs/runtime/stratus", "@stratusjs/core/environment", "../core/responsive.component"], 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 core_1, dialog_1, tree_component_1, tree_dialog_component_1, confirm_dialog_component_1, lodash_1, stratus_1, environment_1, responsive_component_1, systemDir, moduleName, parentModuleName, min, localDir, TreeNodeComponent;
|
|
13
|
+
var __moduleName = context_1 && context_1.id;
|
|
14
|
+
return {
|
|
15
|
+
setters: [
|
|
16
|
+
function (core_1_1) {
|
|
17
|
+
core_1 = core_1_1;
|
|
18
|
+
},
|
|
19
|
+
function (dialog_1_1) {
|
|
20
|
+
dialog_1 = dialog_1_1;
|
|
21
|
+
},
|
|
22
|
+
function (tree_component_1_1) {
|
|
23
|
+
tree_component_1 = tree_component_1_1;
|
|
24
|
+
},
|
|
25
|
+
function (tree_dialog_component_1_1) {
|
|
26
|
+
tree_dialog_component_1 = tree_dialog_component_1_1;
|
|
27
|
+
},
|
|
28
|
+
function (confirm_dialog_component_1_1) {
|
|
29
|
+
confirm_dialog_component_1 = confirm_dialog_component_1_1;
|
|
30
|
+
},
|
|
31
|
+
function (lodash_1_1) {
|
|
32
|
+
lodash_1 = lodash_1_1;
|
|
33
|
+
},
|
|
34
|
+
function (stratus_1_1) {
|
|
35
|
+
stratus_1 = stratus_1_1;
|
|
36
|
+
},
|
|
37
|
+
function (environment_1_1) {
|
|
38
|
+
environment_1 = environment_1_1;
|
|
39
|
+
},
|
|
40
|
+
function (responsive_component_1_1) {
|
|
41
|
+
responsive_component_1 = responsive_component_1_1;
|
|
163
42
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
43
|
+
],
|
|
44
|
+
execute: function () {
|
|
45
|
+
systemDir = '@stratusjs/angular';
|
|
46
|
+
moduleName = 'tree-node';
|
|
47
|
+
parentModuleName = 'tree';
|
|
48
|
+
min = !environment_1.cookie('env') ? '.min' : '';
|
|
49
|
+
localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
50
|
+
TreeNodeComponent = class TreeNodeComponent extends responsive_component_1.ResponsiveComponent {
|
|
51
|
+
constructor(dialog, ref) {
|
|
52
|
+
super();
|
|
53
|
+
this.dialog = dialog;
|
|
54
|
+
this.ref = ref;
|
|
55
|
+
this.title = moduleName + '_component';
|
|
56
|
+
this.isInitialized = false;
|
|
57
|
+
this.isDestroyed = false;
|
|
58
|
+
this.isStyled = false;
|
|
59
|
+
this._ = lodash_1.default;
|
|
60
|
+
this.Stratus = stratus_1.Stratus;
|
|
61
|
+
this.hasChild = (node) => node.children && node.children.length > 0;
|
|
62
|
+
this.isExpanded = (node) => node.meta ? node.meta.expanded : true;
|
|
175
63
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
64
|
+
ngOnInit() {
|
|
65
|
+
this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
|
|
66
|
+
stratus_1.Stratus.Instances[this.uid] = this;
|
|
67
|
+
stratus_1.Stratus.Internals.CssLoader(`${localDir}/${parentModuleName}/${moduleName}.component${min}.css`)
|
|
68
|
+
.then(() => {
|
|
69
|
+
this.isStyled = true;
|
|
70
|
+
this.refresh();
|
|
71
|
+
})
|
|
72
|
+
.catch((err) => {
|
|
73
|
+
console.warn('Issue detected in CSS Loader for Component:', this);
|
|
74
|
+
console.error(err);
|
|
75
|
+
this.isStyled = true;
|
|
76
|
+
this.refresh();
|
|
77
|
+
});
|
|
78
|
+
this.node.meta.component = this;
|
|
79
|
+
this.isInitialized = true;
|
|
80
|
+
this.refresh();
|
|
81
|
+
this.onPostPersist();
|
|
180
82
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
83
|
+
ngOnDestroy() {
|
|
84
|
+
this.node.meta.component = null;
|
|
85
|
+
this.isDestroyed = true;
|
|
86
|
+
}
|
|
87
|
+
refresh() {
|
|
88
|
+
if (this.isDestroyed) {
|
|
89
|
+
return new Promise(resolve => resolve());
|
|
90
|
+
}
|
|
91
|
+
return super.refresh();
|
|
92
|
+
}
|
|
93
|
+
onPostPersist() {
|
|
94
|
+
if (!this.node) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (!this.node.model) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (!this.node.model.meta.get('postPersist')) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.node.model.meta.set('postPersist', false);
|
|
104
|
+
this.openDialog();
|
|
105
|
+
}
|
|
106
|
+
destroy() {
|
|
107
|
+
const dialog = this.dialog
|
|
108
|
+
.open(confirm_dialog_component_1.ConfirmDialogComponent, {
|
|
109
|
+
maxWidth: '400px',
|
|
110
|
+
data: {
|
|
111
|
+
title: 'Delete MenuLink',
|
|
112
|
+
message: 'Are you sure you want to do this?'
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
dialog
|
|
116
|
+
.afterClosed()
|
|
117
|
+
.subscribe((dialogResult) => {
|
|
118
|
+
if (!dialogResult) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (!this.node || !this.node.model) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
this.node.model.destroy();
|
|
125
|
+
});
|
|
126
|
+
return dialog;
|
|
127
|
+
}
|
|
128
|
+
getName() {
|
|
129
|
+
if (!this.node.model || !this.node.model.get || !this.node.model.get('name')) {
|
|
130
|
+
return 'Untitled';
|
|
131
|
+
}
|
|
132
|
+
return this.node.model.get('name');
|
|
133
|
+
}
|
|
134
|
+
getDragPreview() {
|
|
135
|
+
return `name: ${this.getName()}<br>children: ${this.node.children ? this.node.children.length : 0}`;
|
|
136
|
+
}
|
|
137
|
+
toggleExpanded() {
|
|
138
|
+
if (!this.node.meta) {
|
|
139
|
+
console.error('node meta not found:', this.node);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
this.node.meta.expanded = !this.node.meta.expanded;
|
|
143
|
+
this.refresh();
|
|
144
|
+
}
|
|
145
|
+
toggleExpandedClick() {
|
|
146
|
+
this.isSingleClick = true;
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
if (!this.isSingleClick) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.toggleExpanded();
|
|
152
|
+
}, this.tree.dblClickWait);
|
|
153
|
+
}
|
|
154
|
+
toggleExpandedDblClick() {
|
|
155
|
+
this.isSingleClick = false;
|
|
156
|
+
this.toggleExpanded();
|
|
157
|
+
}
|
|
158
|
+
openDialog() {
|
|
159
|
+
if (!this.node.model || !lodash_1.default.has(this.node.model, 'data')) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const dialogRef = this.dialog.open(tree_dialog_component_1.TreeDialogComponent, {
|
|
163
|
+
width: '400px',
|
|
164
|
+
autoFocus: true,
|
|
165
|
+
disableClose: true,
|
|
166
|
+
restoreFocus: false,
|
|
167
|
+
data: {
|
|
168
|
+
tree: this.tree,
|
|
169
|
+
treeNode: this,
|
|
170
|
+
backend: this.tree.backend,
|
|
171
|
+
iconRegistry: this.tree.iconRegistry,
|
|
172
|
+
id: this.node.model.data.id || null,
|
|
173
|
+
name: this.node.model.data.name || '',
|
|
174
|
+
target: this.node.model.data.url ? 'url' : 'content',
|
|
175
|
+
content: this.node.model.data.content || null,
|
|
176
|
+
url: this.node.model.data.url || null,
|
|
177
|
+
browserTarget: this.node.model.data.browserTarget || null,
|
|
178
|
+
model: this.node.model || null,
|
|
179
|
+
collection: this.tree.collection || null,
|
|
180
|
+
parent: this.node.model.data.parent || null,
|
|
181
|
+
nestParent: this.node.model.data.nestParent || null,
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
this.refresh();
|
|
185
|
+
const that = this;
|
|
186
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
187
|
+
if (!result || lodash_1.default.isEmpty(result)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.tree.unsettled = true;
|
|
191
|
+
const attrs = [
|
|
192
|
+
'name',
|
|
193
|
+
'content',
|
|
194
|
+
'url',
|
|
195
|
+
'priority',
|
|
196
|
+
'browserTarget'
|
|
197
|
+
];
|
|
198
|
+
attrs.forEach(attr => {
|
|
199
|
+
if (!lodash_1.default.has(result, attr)) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if ('content' === attr) {
|
|
203
|
+
const value = lodash_1.default.get(result, attr);
|
|
204
|
+
this.node.model.set(attr, !value ? null : { id: lodash_1.default.get(value, 'id') });
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this.node.model.set(attr, lodash_1.default.get(result, attr));
|
|
208
|
+
});
|
|
209
|
+
that.refresh();
|
|
210
|
+
that.tree.refresh();
|
|
211
|
+
this.node.model.save();
|
|
212
|
+
this.tree.unsettled = false;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
openDialogClick() {
|
|
216
|
+
this.isSingleClick = true;
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
if (!this.isSingleClick) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
this.openDialog();
|
|
222
|
+
}, this.tree.dblClickWait);
|
|
223
|
+
}
|
|
224
|
+
openDialogDblClick() {
|
|
225
|
+
this.isSingleClick = false;
|
|
226
|
+
this.openDialog();
|
|
227
|
+
}
|
|
228
|
+
getSvg(url, options) {
|
|
229
|
+
return this.tree.getSvg(url, options);
|
|
230
|
+
}
|
|
231
|
+
toggleStatus() {
|
|
232
|
+
if (!this.node || !this.node.model) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const model = this.node.model;
|
|
236
|
+
model.set('status', model.get('status') ? 0 : 1);
|
|
237
|
+
model.save();
|
|
238
|
+
}
|
|
239
|
+
addChild() {
|
|
240
|
+
let priority = lodash_1.default.max(this.tree.collection.models.filter((model) => {
|
|
241
|
+
const nestParent = model.get('nestParent');
|
|
242
|
+
if (!nestParent) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
return nestParent.id === this.node.id;
|
|
246
|
+
}).map((model) => model.get('priority'))) || -1;
|
|
247
|
+
if (typeof priority === 'number') {
|
|
248
|
+
priority++;
|
|
249
|
+
}
|
|
250
|
+
this.tree.collection.add({
|
|
251
|
+
name: 'Untitled Child',
|
|
252
|
+
parent: this.node.model.data.parent,
|
|
253
|
+
nestParent: {
|
|
254
|
+
id: this.node.model.data.id
|
|
255
|
+
},
|
|
256
|
+
priority
|
|
257
|
+
}, {
|
|
258
|
+
save: true,
|
|
259
|
+
trigger: true
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
__decorate([
|
|
264
|
+
core_1.Input(),
|
|
265
|
+
__metadata("design:type", tree_component_1.TreeComponent)
|
|
266
|
+
], TreeNodeComponent.prototype, "tree", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
core_1.Input(),
|
|
269
|
+
__metadata("design:type", Object)
|
|
270
|
+
], TreeNodeComponent.prototype, "parent", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
core_1.Input(),
|
|
273
|
+
__metadata("design:type", Object)
|
|
274
|
+
], TreeNodeComponent.prototype, "node", void 0);
|
|
275
|
+
TreeNodeComponent = __decorate([
|
|
276
|
+
core_1.Component({
|
|
277
|
+
selector: `sa-${moduleName}`,
|
|
278
|
+
templateUrl: `${localDir}/${parentModuleName}/${moduleName}.component${min}.html`,
|
|
279
|
+
}),
|
|
280
|
+
__metadata("design:paramtypes", [dialog_1.MatDialog,
|
|
281
|
+
core_1.ChangeDetectorRef])
|
|
282
|
+
], TreeNodeComponent);
|
|
283
|
+
exports_1("TreeNodeComponent", TreeNodeComponent);
|
|
223
284
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
parent: this.node.model.data.parent,
|
|
227
|
-
nestParent: {
|
|
228
|
-
id: this.node.model.data.id
|
|
229
|
-
},
|
|
230
|
-
priority
|
|
231
|
-
}, {
|
|
232
|
-
save: true,
|
|
233
|
-
trigger: true
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
__decorate([
|
|
238
|
-
Input(),
|
|
239
|
-
__metadata("design:type", TreeComponent)
|
|
240
|
-
], TreeNodeComponent.prototype, "tree", void 0);
|
|
241
|
-
__decorate([
|
|
242
|
-
Input(),
|
|
243
|
-
__metadata("design:type", Object)
|
|
244
|
-
], TreeNodeComponent.prototype, "parent", void 0);
|
|
245
|
-
__decorate([
|
|
246
|
-
Input(),
|
|
247
|
-
__metadata("design:type", Object)
|
|
248
|
-
], TreeNodeComponent.prototype, "node", void 0);
|
|
249
|
-
TreeNodeComponent = __decorate([
|
|
250
|
-
Component({
|
|
251
|
-
selector: `sa-${moduleName}`,
|
|
252
|
-
templateUrl: `${localDir}/${parentModuleName}/${moduleName}.component${min}.html`,
|
|
253
|
-
}),
|
|
254
|
-
__metadata("design:paramtypes", [MatDialog,
|
|
255
|
-
ChangeDetectorRef])
|
|
256
|
-
], TreeNodeComponent);
|
|
257
|
-
export { TreeNodeComponent };
|
|
285
|
+
};
|
|
286
|
+
});
|
|
258
287
|
|
|
259
288
|
//# sourceMappingURL=tree-node.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tree-node.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["tree-node.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAgDM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,WAAW,CAAA;YACxB,gBAAgB,GAAG,MAAM,CAAA;YAGzB,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAClC,QAAQ,GAAG,GAAG,iBAAO,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAA;YAUzH,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,0CAAmB;gBA2BtD,YACW,MAAiB,EACd,GAAsB;oBAGhC,KAAK,EAAE,CAAA;oBAJA,WAAM,GAAN,MAAM,CAAW;oBACd,QAAG,GAAH,GAAG,CAAmB;oBA1BpC,UAAK,GAAG,UAAU,GAAG,YAAY,CAAA;oBAIjC,kBAAa,GAAG,KAAK,CAAA;oBACrB,gBAAW,GAAG,KAAK,CAAA;oBACnB,aAAQ,GAAG,KAAK,CAAA;oBAGhB,MAAC,GAAG,gBAAC,CAAA;oBACL,YAAO,GAAG,iBAAO,CAAA;oBAWjB,aAAQ,GAAG,CAAC,IAAU,EAAE,EAAE,CAA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