@stratusjs/angular 0.9.3 → 0.10.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 +655 -630
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +3 -3
- package/src/selector/selector-autocomplete.component.html +4 -4
- package/src/selector/selector-autocomplete.component.min.html +1 -1
- package/src/selector/selector.component.html +15 -15
- package/src/selector/selector.component.js +37 -24
- package/src/selector/selector.component.js.map +1 -1
- package/src/selector/selector.component.min.html +1 -1
- package/src/selector/selector.component.min.js +1 -1
- package/src/selector/selector.component.ts +53 -28
- package/src/tree/tree-dialog.component.html +2 -2
- package/src/tree/tree-dialog.component.js +31 -22
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-dialog.component.min.html +1 -1
- package/src/tree/tree-dialog.component.min.js +1 -1
- package/src/tree/tree-dialog.component.ts +48 -25
- package/src/tree/tree-node.component.js +19 -19
- package/src/tree/tree-node.component.js.map +1 -1
- package/src/tree/tree-node.component.min.js +1 -1
- package/src/tree/tree-node.component.ts +28 -20
- package/src/tree/tree.component.js +27 -28
- package/src/tree/tree.component.js.map +1 -1
- package/src/tree/tree.component.min.js +1 -1
- package/src/tree/tree.component.ts +45 -33
|
@@ -27,11 +27,21 @@ import {
|
|
|
27
27
|
import {DomSanitizer} from '@angular/platform-browser'
|
|
28
28
|
import {IconOptions, MatIconRegistry} from '@angular/material/icon'
|
|
29
29
|
|
|
30
|
-
// RXJS
|
|
31
|
-
|
|
32
30
|
// External Dependencies
|
|
33
31
|
import {Stratus} from '@stratusjs/runtime/stratus'
|
|
34
|
-
import
|
|
32
|
+
import {
|
|
33
|
+
forEach,
|
|
34
|
+
get,
|
|
35
|
+
has,
|
|
36
|
+
head,
|
|
37
|
+
isArray,
|
|
38
|
+
isEmpty,
|
|
39
|
+
isObject,
|
|
40
|
+
isString,
|
|
41
|
+
isUndefined,
|
|
42
|
+
snakeCase,
|
|
43
|
+
uniqueId
|
|
44
|
+
} from 'lodash'
|
|
35
45
|
import {keys} from 'ts-transformer-keys'
|
|
36
46
|
import {cookie} from '@stratusjs/core/environment'
|
|
37
47
|
|
|
@@ -61,7 +71,7 @@ const min = !cookie('env') ? '.min' : ''
|
|
|
61
71
|
const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`
|
|
62
72
|
|
|
63
73
|
// Utility Functions
|
|
64
|
-
const
|
|
74
|
+
const hasNotEmpty = (object: object, path: string) => has(object, path) && !isEmpty(get(object, path))
|
|
65
75
|
|
|
66
76
|
// export interface Model {
|
|
67
77
|
// completed: boolean;
|
|
@@ -106,8 +116,8 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
106
116
|
@Input() ignorePriority: boolean
|
|
107
117
|
|
|
108
118
|
// Dependencies
|
|
109
|
-
|
|
110
|
-
has =
|
|
119
|
+
get = get
|
|
120
|
+
has = hasNotEmpty
|
|
111
121
|
log = console.log
|
|
112
122
|
Stratus = Stratus
|
|
113
123
|
|
|
@@ -151,14 +161,14 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
151
161
|
super()
|
|
152
162
|
|
|
153
163
|
// Initialization
|
|
154
|
-
this.uid =
|
|
164
|
+
this.uid = uniqueId(`sa_${snakeCase(moduleName)}_component_`)
|
|
155
165
|
Stratus.Instances[this.uid] = this
|
|
156
166
|
|
|
157
167
|
// Declare Observable with Subscriber (Only Happens Once)
|
|
158
168
|
this.dataSub = new Observable(subscriber => this.dataDefer(subscriber))
|
|
159
169
|
|
|
160
170
|
// SVG Icons
|
|
161
|
-
|
|
171
|
+
forEach({
|
|
162
172
|
selector_delete: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
|
|
163
173
|
selector_status: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,
|
|
164
174
|
selector_edit: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`
|
|
@@ -169,13 +179,13 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
169
179
|
Stratus.Internals.CssLoader(`${localDir}${moduleName}/${moduleName}.component${min}.css`)
|
|
170
180
|
.then(() => {
|
|
171
181
|
this.styled = true
|
|
172
|
-
this.refresh()
|
|
182
|
+
this.refresh().then()
|
|
173
183
|
})
|
|
174
184
|
.catch((err: any) => {
|
|
175
185
|
console.warn('Issue detected in CSS Loader for Component:', this)
|
|
176
186
|
console.error(err)
|
|
177
187
|
this.styled = true
|
|
178
|
-
this.refresh()
|
|
188
|
+
this.refresh().then()
|
|
179
189
|
})
|
|
180
190
|
|
|
181
191
|
// Hydrate Root App Inputs
|
|
@@ -197,7 +207,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
197
207
|
// this.onDataChange();
|
|
198
208
|
this.dataDefer(this.subscriber)
|
|
199
209
|
this.prioritize()
|
|
200
|
-
this.refresh()
|
|
210
|
+
this.refresh().then()
|
|
201
211
|
}
|
|
202
212
|
data.on('change', onDataChange)
|
|
203
213
|
onDataChange()
|
|
@@ -246,7 +256,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
246
256
|
moveItemInArray(models, event.previousIndex, event.currentIndex)
|
|
247
257
|
if (!this.ignorePriority) {
|
|
248
258
|
let priority = 0
|
|
249
|
-
|
|
259
|
+
forEach(models, (model: any) => model.priority = priority++)
|
|
250
260
|
}
|
|
251
261
|
this.model.trigger('change')
|
|
252
262
|
}
|
|
@@ -263,6 +273,10 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
263
273
|
// model is not directly a model, but just a sub entity of content.version.modules
|
|
264
274
|
// so we have to create a special API call to update just this one model
|
|
265
275
|
// 'Content/' + model.id
|
|
276
|
+
let meta = {}
|
|
277
|
+
if (!isUndefined(this.data)) {
|
|
278
|
+
meta = get(this.data, 'meta.data.api')
|
|
279
|
+
}
|
|
266
280
|
const statusOriginal = model.status
|
|
267
281
|
model.status = statusOriginal === 1 ? 0 : 1
|
|
268
282
|
// Create a direct XHR
|
|
@@ -271,7 +285,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
271
285
|
url: '/Api/Content/' + model.id,
|
|
272
286
|
data: {
|
|
273
287
|
route: {},
|
|
274
|
-
meta
|
|
288
|
+
meta,
|
|
275
289
|
payload: {
|
|
276
290
|
status: model.status
|
|
277
291
|
}
|
|
@@ -280,18 +294,18 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
280
294
|
})
|
|
281
295
|
xhr.send()
|
|
282
296
|
.then((response: LooseObject | Array<LooseObject> | string) => {
|
|
283
|
-
if (!
|
|
297
|
+
if (!isObject(response) || get(response, 'meta.status[0].code') !== 'SUCCESS') {
|
|
284
298
|
console.error('error[toggleStatus]:', response)
|
|
285
299
|
model.status = statusOriginal
|
|
286
|
-
this.refresh()
|
|
300
|
+
this.refresh().then()
|
|
287
301
|
return
|
|
288
302
|
}
|
|
289
|
-
console.log('success[toggleStatus]:', response)
|
|
303
|
+
// console.log('success[toggleStatus]:', response)
|
|
290
304
|
})
|
|
291
305
|
.catch((error: any) => {
|
|
292
306
|
console.error('error[toggleStatus]:', error)
|
|
293
307
|
model.status = statusOriginal
|
|
294
|
-
this.refresh()
|
|
308
|
+
this.refresh().then()
|
|
295
309
|
})
|
|
296
310
|
return
|
|
297
311
|
}
|
|
@@ -301,7 +315,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
301
315
|
if (!models || !models.length) {
|
|
302
316
|
console.error('unable to remove model from selection:', models)
|
|
303
317
|
// Still refresh if empty
|
|
304
|
-
this.refresh()
|
|
318
|
+
this.refresh().then()
|
|
305
319
|
return
|
|
306
320
|
}
|
|
307
321
|
let index: number = models.indexOf(model)
|
|
@@ -310,9 +324,9 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
310
324
|
const mirrorModels = models
|
|
311
325
|
.map((m: any) => model.id === m.id ? m : null)
|
|
312
326
|
.filter((m: any) => m)
|
|
313
|
-
if (
|
|
327
|
+
if (isArray(mirrorModels) && mirrorModels.length) {
|
|
314
328
|
index = models.indexOf(
|
|
315
|
-
|
|
329
|
+
head(mirrorModels)
|
|
316
330
|
)
|
|
317
331
|
}
|
|
318
332
|
}
|
|
@@ -365,7 +379,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
365
379
|
console.log('pushed models to subscriber:', models)
|
|
366
380
|
}
|
|
367
381
|
/* */
|
|
368
|
-
this.refresh()
|
|
382
|
+
this.refresh().then()
|
|
369
383
|
// TODO: Add a returned Promise to ensure async/await can use this defer directly.
|
|
370
384
|
}
|
|
371
385
|
|
|
@@ -374,12 +388,23 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
374
388
|
return []
|
|
375
389
|
}
|
|
376
390
|
const models = this.model.get(this.property)
|
|
377
|
-
if (!models || !
|
|
391
|
+
if (!models || !isArray(models)) {
|
|
378
392
|
return []
|
|
379
393
|
}
|
|
380
394
|
return models
|
|
381
395
|
}
|
|
382
396
|
|
|
397
|
+
getString(object: unknown, property: string): string|null {
|
|
398
|
+
if (!isObject(object)) {
|
|
399
|
+
return null
|
|
400
|
+
}
|
|
401
|
+
const variable = get(object, property)
|
|
402
|
+
if (!isString(variable)) {
|
|
403
|
+
return null
|
|
404
|
+
}
|
|
405
|
+
return variable
|
|
406
|
+
}
|
|
407
|
+
|
|
383
408
|
// selectedModel (observer: any) : any {
|
|
384
409
|
// if (!this.data) {
|
|
385
410
|
// this.fetchData().then(function (data: any) {
|
|
@@ -422,7 +447,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
422
447
|
// FIXME: This is not in use due to contextual issues.
|
|
423
448
|
this.prioritize()
|
|
424
449
|
this.dataDefer(this.subscriber)
|
|
425
|
-
this.refresh()
|
|
450
|
+
this.refresh().then()
|
|
426
451
|
}
|
|
427
452
|
|
|
428
453
|
prioritize() {
|
|
@@ -432,7 +457,7 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
432
457
|
}
|
|
433
458
|
if (!this.ignorePriority) {
|
|
434
459
|
let priority = 0
|
|
435
|
-
|
|
460
|
+
forEach(models, (model) => model.priority = priority++)
|
|
436
461
|
}
|
|
437
462
|
}
|
|
438
463
|
|
|
@@ -469,20 +494,20 @@ export class SelectorComponent extends RootComponent { // implements OnInit, OnC
|
|
|
469
494
|
if (!options) {
|
|
470
495
|
options = {}
|
|
471
496
|
}
|
|
472
|
-
const uid = this.svgIcons[url] =
|
|
497
|
+
const uid = this.svgIcons[url] = uniqueId('selector_svg')
|
|
473
498
|
this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options)
|
|
474
499
|
return uid
|
|
475
500
|
}
|
|
476
501
|
|
|
477
502
|
// findImage(model: any): string {
|
|
478
|
-
// const mime =
|
|
503
|
+
// const mime = get(model, 'version.images[0].mime');
|
|
479
504
|
// if (mime === undefined) {
|
|
480
505
|
// return '';
|
|
481
506
|
// }
|
|
482
507
|
// if (mime.indexOf('image') !== -1) {
|
|
483
|
-
// return
|
|
508
|
+
// return get(model, 'version.images[0].src') || get(model, 'version.shellImages[0].src') || '';
|
|
484
509
|
// } else if (mime.indexOf('video') !== -1) {
|
|
485
|
-
// return
|
|
510
|
+
// return get(model, 'version.images[0].meta.thumbnail_small') || '';
|
|
486
511
|
// }
|
|
487
512
|
// return '';
|
|
488
513
|
// }
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
|
|
95
95
|
<!-- Content Type Icon -->
|
|
96
96
|
<mat-icon aria-hidden="true"
|
|
97
|
-
*ngIf="
|
|
98
|
-
[svgIcon]="getSvg(Stratus.BaseUrl +
|
|
97
|
+
*ngIf="get(model, 'contentType.iconResourcePath')"
|
|
98
|
+
[svgIcon]="getSvg(Stratus.BaseUrl + get(model, 'contentType.iconResourcePath')) | async">
|
|
99
99
|
Icon
|
|
100
100
|
</mat-icon>
|
|
101
101
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@angular/material/dialog", "rxjs/operators", "lodash", "@stratusjs/runtime/stratus", "@stratusjs/core/environment", "../core/responsive.component"], function (exports_1, context_1) {
|
|
1
|
+
System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@angular/material/dialog", "rxjs/operators", "lodash", "@stratusjs/runtime/stratus", "@stratusjs/core/environment", "../core/responsive.component", "@stratusjs/core/misc"], function (exports_1, context_1) {
|
|
2
2
|
"use strict";
|
|
3
3
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
4
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -12,7 +12,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
12
12
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
13
13
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
14
14
|
};
|
|
15
|
-
var core_1, forms_1, drag_drop_1, dialog_1, operators_1, lodash_1, stratus_1, environment_1, responsive_component_1, systemDir, moduleName, parentModuleName, min, localDir, TreeDialogComponent;
|
|
15
|
+
var core_1, forms_1, drag_drop_1, dialog_1, operators_1, lodash_1, stratus_1, environment_1, responsive_component_1, misc_1, systemDir, moduleName, parentModuleName, min, localDir, TreeDialogComponent;
|
|
16
16
|
var __moduleName = context_1 && context_1.id;
|
|
17
17
|
return {
|
|
18
18
|
setters: [
|
|
@@ -42,6 +42,9 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
42
42
|
},
|
|
43
43
|
function (responsive_component_1_1) {
|
|
44
44
|
responsive_component_1 = responsive_component_1_1;
|
|
45
|
+
},
|
|
46
|
+
function (misc_1_1) {
|
|
47
|
+
misc_1 = misc_1_1;
|
|
45
48
|
}
|
|
46
49
|
],
|
|
47
50
|
execute: function () {
|
|
@@ -61,17 +64,22 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
61
64
|
this.isInitialized = false;
|
|
62
65
|
this.isDestroyed = false;
|
|
63
66
|
this.isStyled = false;
|
|
64
|
-
this.
|
|
67
|
+
this.get = lodash_1.get;
|
|
65
68
|
this.Stratus = stratus_1.Stratus;
|
|
66
69
|
this.apiBase = '/Api/Content';
|
|
67
70
|
this.isSingleContentLoading = false;
|
|
68
71
|
this.limit = 20;
|
|
69
72
|
this.isContentLoading = false;
|
|
70
73
|
this.isContentLoaded = false;
|
|
71
|
-
this.
|
|
74
|
+
this.basicContentQueryAttributesObject = {
|
|
75
|
+
isContent: true,
|
|
76
|
+
isCollection: null,
|
|
77
|
+
showRoutable: true,
|
|
78
|
+
showRouting: true
|
|
79
|
+
};
|
|
72
80
|
}
|
|
73
81
|
ngOnInit() {
|
|
74
|
-
this.uid = lodash_1.
|
|
82
|
+
this.uid = lodash_1.uniqueId(`sa_${lodash_1.snakeCase(moduleName)}_component_`);
|
|
75
83
|
stratus_1.Stratus.Instances[this.uid] = this;
|
|
76
84
|
stratus_1.Stratus.Internals.CssLoader(`${localDir}/${parentModuleName}/${moduleName}.component${min}.css`)
|
|
77
85
|
.then(() => {
|
|
@@ -94,7 +102,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
94
102
|
.get('contentSelectorInput')
|
|
95
103
|
.valueChanges
|
|
96
104
|
.pipe(operators_1.debounceTime(300), operators_1.tap(() => this.isContentLoading = true), operators_1.switchMap((value) => {
|
|
97
|
-
if (lodash_1.
|
|
105
|
+
if (lodash_1.isString(value)) {
|
|
98
106
|
this.lastContentSelectorQuery = this.getQueryUrl(value);
|
|
99
107
|
}
|
|
100
108
|
else {
|
|
@@ -118,11 +126,11 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
118
126
|
.get(this.getQueryUrl(null, this.data.content.id))
|
|
119
127
|
.pipe(operators_1.finalize(() => this.isSingleContentLoading = false))
|
|
120
128
|
.subscribe((response) => {
|
|
121
|
-
if (!response.ok || response.status !== 200 || lodash_1.
|
|
129
|
+
if (!response.ok || response.status !== 200 || lodash_1.isEmpty(response.body)) {
|
|
122
130
|
return null;
|
|
123
131
|
}
|
|
124
|
-
const payload = lodash_1.
|
|
125
|
-
if (lodash_1.
|
|
132
|
+
const payload = lodash_1.get(response.body, 'payload') || response.body;
|
|
133
|
+
if (lodash_1.isEmpty(payload) || Array.isArray(payload) || !lodash_1.isObject(payload)) {
|
|
126
134
|
return null;
|
|
127
135
|
}
|
|
128
136
|
this.contentEntity = payload;
|
|
@@ -130,7 +138,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
130
138
|
this.dialogContentForm
|
|
131
139
|
.get('contentSelectorInput')
|
|
132
140
|
.patchValue(this.contentEntity);
|
|
133
|
-
this.refresh();
|
|
141
|
+
this.refresh().then();
|
|
134
142
|
return this.contentEntity;
|
|
135
143
|
});
|
|
136
144
|
}
|
|
@@ -155,19 +163,19 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
155
163
|
if (!content) {
|
|
156
164
|
return;
|
|
157
165
|
}
|
|
158
|
-
const routing = lodash_1.
|
|
159
|
-
const routingText = !lodash_1.
|
|
160
|
-
const contentId = lodash_1.
|
|
161
|
-
const contentIdText = !lodash_1.
|
|
162
|
-
return (lodash_1.
|
|
166
|
+
const routing = lodash_1.get(content, 'routing[0].url');
|
|
167
|
+
const routingText = !lodash_1.isUndefined(routing) ? ` (/${routing})` : ' (No route!)';
|
|
168
|
+
const contentId = lodash_1.get(content, 'id');
|
|
169
|
+
const contentIdText = !lodash_1.isUndefined(contentId) ? `Content: ${contentId}` : null;
|
|
170
|
+
return (lodash_1.get(content, 'version.title') || contentIdText) + routingText;
|
|
163
171
|
}
|
|
164
172
|
handleContent(response) {
|
|
165
|
-
if (!response.ok || response.status !== 200 || lodash_1.
|
|
173
|
+
if (!response.ok || response.status !== 200 || lodash_1.isEmpty(response.body)) {
|
|
166
174
|
this.filteredContent = [];
|
|
167
175
|
return this.filteredContent;
|
|
168
176
|
}
|
|
169
|
-
const payload = lodash_1.
|
|
170
|
-
if (lodash_1.
|
|
177
|
+
const payload = lodash_1.get(response.body, 'payload') || response.body;
|
|
178
|
+
if (lodash_1.isEmpty(payload) || !Array.isArray(payload)) {
|
|
171
179
|
this.filteredContent = [];
|
|
172
180
|
return this.filteredContent;
|
|
173
181
|
}
|
|
@@ -200,9 +208,10 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
200
208
|
return this.tree.getSvg(url, options);
|
|
201
209
|
}
|
|
202
210
|
getQueryUrl(query, id) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
211
|
+
const fullApiOptions = { options: lodash_1.assignIn(this.basicContentQueryAttributesObject, this.data.api) };
|
|
212
|
+
query = (!lodash_1.isString(query) || lodash_1.isEmpty(query)) ? '' : query;
|
|
213
|
+
id = !lodash_1.isString(id) && !lodash_1.isNumber(id) ? '' : `/${id}`;
|
|
214
|
+
return `${this.apiBase}${id}?limit=${this.limit}&${misc_1.serializeUrlParams(fullApiOptions)}&q=${query}`;
|
|
206
215
|
}
|
|
207
216
|
selectedOnTop(list, selected) {
|
|
208
217
|
if (!list || !list.length) {
|
|
@@ -211,7 +220,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "@
|
|
|
211
220
|
if (!selected || !selected.id) {
|
|
212
221
|
return list;
|
|
213
222
|
}
|
|
214
|
-
const orderedList = lodash_1.
|
|
223
|
+
const orderedList = lodash_1.clone(list);
|
|
215
224
|
const index = list.findIndex((v) => v.id === selected.id);
|
|
216
225
|
if (index === -1) {
|
|
217
226
|
orderedList.unshift(selected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"s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U,EAAE;oBAC5B,WAAW,EAAE,GAAG,QAAQ,IAAI,gBAAgB,IAAI,UAAU,aAAa,GAAG,OAAO;iBAEpF,CAAC;gBA6DO,WAAA,aAAM,CAAC,wBAAe,CAAC,CAAA;iDADN,qBAAY,UAElB,mBAAW;oBAER,wBAAiB;eA/D3B,mBAAmB,CA+V/B;;QACD,CAAC","file":"tree-dialog.component.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<h1 mat-dialog-title>Menu Link Editor</h1><div class="tree-dialog-content" *ngIf="isInitialized" mat-dialog-content><mat-form-field class="form-field"><input #nameInput matInput type="text" placeholder="Name" [(ngModel)]="data.name"></mat-form-field><h4><label id="link-type-label">Link Type:</label></h4><mat-radio-group class="radio-group" aria-labelledby="link-type-label" [(ngModel)]="data.target"><mat-radio-button class="radio-button" value="content">Website Page</mat-radio-button><mat-radio-button class="radio-button" value="url">Custom Link</mat-radio-button></mat-radio-group><form class="dialog-form" [formGroup]="dialogContentForm"><ng-container *ngIf="data.target == 'content'"><mat-form-field class="form-field"><input matInput placeholder="Link Content" aria-label="Link Content" [matAutocomplete]="auto" formControlName="contentSelectorInput"></mat-form-field><mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" [displayWith]="displayContentText"><mat-option *ngIf="isContentLoading" class="is-loading"><mat-progress-bar mode="indeterminate"></mat-progress-bar></mat-option><ng-container *ngIf="!isContentLoading"><mat-option *ngFor="let model of filteredContent" [value]="model"><mat-icon aria-hidden="true" *ngIf="
|
|
1
|
+
<h1 mat-dialog-title>Menu Link Editor</h1><div class="tree-dialog-content" *ngIf="isInitialized" mat-dialog-content><mat-form-field class="form-field"><input #nameInput matInput type="text" placeholder="Name" [(ngModel)]="data.name"></mat-form-field><h4><label id="link-type-label">Link Type:</label></h4><mat-radio-group class="radio-group" aria-labelledby="link-type-label" [(ngModel)]="data.target"><mat-radio-button class="radio-button" value="content">Website Page</mat-radio-button><mat-radio-button class="radio-button" value="url">Custom Link</mat-radio-button></mat-radio-group><form class="dialog-form" [formGroup]="dialogContentForm"><ng-container *ngIf="data.target == 'content'"><mat-form-field class="form-field"><input matInput placeholder="Link Content" aria-label="Link Content" [matAutocomplete]="auto" formControlName="contentSelectorInput"></mat-form-field><mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" [displayWith]="displayContentText"><mat-option *ngIf="isContentLoading" class="is-loading"><mat-progress-bar mode="indeterminate"></mat-progress-bar></mat-option><ng-container *ngIf="!isContentLoading"><mat-option *ngFor="let model of filteredContent" [value]="model"><mat-icon aria-hidden="true" *ngIf="get(model, 'contentType.iconResourcePath')" [svgIcon]="getSvg(Stratus.BaseUrl + get(model, 'contentType.iconResourcePath')) | async">Icon</mat-icon>{{(model && model.version) ? model.version.title : 'Untitled'}} <small *ngIf="model.routing && model.routing.length">{{'/' + model.routing[0].url}}</small></mat-option></ng-container></mat-autocomplete></ng-container></form><mat-form-field class="form-field" [style.width.px]="320" *ngIf="data.target == 'url'"><input matInput type="text" placeholder="URL" [(ngModel)]="data.url"> <a mat-button *ngIf="data.url" matSuffix mat-icon-button aria-label="Clear" (click)="data.url=''"><mat-icon>close</mat-icon></a></mat-form-field><mat-checkbox [(ngModel)]="browserTarget" (change)="onBrowserTargetChange($event)">Open in new window</mat-checkbox><h4>Actions:</h4><a mat-button class="svg-grey" (click)="destroy()"><mat-icon svgIcon="tree_delete" aria-hidden="false" aria-label="Delete Item">Delete</mat-icon></a><a mat-button class="svg-grey" [class.visibility-off]="data.model.get('status') === 0" (click)="toggleStatus()"><mat-icon svgIcon="tree_visibility" aria-hidden="false" aria-label="Toggle Visibility">Visibility</mat-icon></a><a mat-button class="svg-grey" [disabled]="!data.id" (click)="addChild()"><mat-icon svgIcon="tree_add" aria-hidden="false" aria-label="Add Child">Add Child</mat-icon></a><mat-divider></mat-divider></div><div mat-dialog-actions><a mat-button (click)="onCancelClick()">Cancel </a><a mat-button [mat-dialog-close]="data" cdkFocusInitial>Ok</a></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","@angular/material/dialog","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","../core/responsive.component"],function(t,e){"use strict";var n,i,s,o,r,a,l,d,
|
|
1
|
+
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","@angular/material/dialog","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","../core/responsive.component","@stratusjs/core/misc"],function(t,e){"use strict";var n,i,s,o,r,a,l,d,h,c,u,g,f,p,y,C=this&&this.__decorate||function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},b=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},m=this&&this.__param||function(t,e){return function(n,i){e(n,i,t)}};e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t},function(t){o=t},function(t){r=t},function(t){a=t},function(t){l=t},function(t){d=t},function(t){h=t},function(t){c=t}],execute:function(){"@stratusjs/angular",u="tree-dialog",g="tree",f=d.cookie("env")?"":".min",p=`${l.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,y=class extends h.ResponsiveComponent{constructor(t,e,n,i){super(),this.dialogRef=t,this.data=e,this.fb=n,this.ref=i,this.title=u+"_component",this.isInitialized=!1,this.isDestroyed=!1,this.isStyled=!1,this.get=a.get,this.Stratus=l.Stratus,this.apiBase="/Api/Content",this.isSingleContentLoading=!1,this.limit=20,this.isContentLoading=!1,this.isContentLoaded=!1,this.basicContentQueryAttributesObject={isContent:!0,isCollection:null,showRoutable:!0,showRouting:!0}}ngOnInit(){this.uid=a.uniqueId(`sa_${a.snakeCase(u)}_component_`),l.Stratus.Instances[this.uid]=this,l.Stratus.Internals.CssLoader(`${p}/${g}/${u}.component${f}.css`).then(()=>{this.isStyled=!0}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.isStyled=!0}),this.tree=this.data.tree,this.treeNode=this.data.treeNode,this.browserTarget=null!==this.data.browserTarget,this.backend=this.data.backend,this.iconRegistry=this.data.iconRegistry,this.dialogContentForm=this.fb.group({contentSelectorInput:this.data.content||null}),this.dialogContentForm.get("contentSelectorInput").valueChanges.pipe(r.debounceTime(300),r.tap(()=>this.isContentLoading=!0),r.switchMap(t=>(a.isString(t)?this.lastContentSelectorQuery=this.getQueryUrl(t):(this.data.content=t,this.data.url=null),this.backend.get(this.lastContentSelectorQuery||this.getQueryUrl()).pipe(r.finalize(()=>{this.isContentLoading=!1,this.isContentLoaded=!0}))))).subscribe(t=>this.handleContent(t)),this.backend.get(this.getQueryUrl()).pipe(r.finalize(()=>this.isContentLoading=!1)).subscribe(t=>this.handleContent(t)),this.data.content&&this.data.content.id&&(this.isSingleContentLoading=!0,this.backend.get(this.getQueryUrl(null,this.data.content.id)).pipe(r.finalize(()=>this.isSingleContentLoading=!1)).subscribe(t=>{if(!t.ok||200!==t.status||a.isEmpty(t.body))return null;const e=a.get(t.body,"payload")||t.body;return a.isEmpty(e)||Array.isArray(e)||!a.isObject(e)?null:(this.contentEntity=e,this.isSingleContentLoading=!1,this.dialogContentForm.get("contentSelectorInput").patchValue(this.contentEntity),this.refresh().then(),this.contentEntity)})),this.isInitialized=!0}ngOnDestroy(){this.isDestroyed=!0}refresh(){return this.isDestroyed?new Promise(t=>t()):super.refresh()}onCancelClick(){this.dialogRef.close()}onBrowserTargetChange(t){this.data.browserTarget=t.checked?"_blank":null}displayContentText(t){if(!t)return;const e=a.get(t,"routing[0].url"),n=a.isUndefined(e)?" (No route!)":` (/${e})`,i=a.get(t,"id"),s=a.isUndefined(i)?null:`Content: ${i}`;return(a.get(t,"version.title")||s)+n}handleContent(t){if(!t.ok||200!==t.status||a.isEmpty(t.body))return this.filteredContent=[],this.filteredContent;const e=a.get(t.body,"payload")||t.body;return a.isEmpty(e)||!Array.isArray(e)?(this.filteredContent=[],this.filteredContent):(this.filteredContent=e,this.filteredContent)}destroy(){this.treeNode.destroy().afterClosed().subscribe(t=>{t&&this.onCancelClick()})}toggleStatus(){this.treeNode.toggleStatus()}addChild(){this.treeNode.addChild()}isSelected(t){return!!this.data.content&&this.data.content.id===t.id}getSvg(t,e){return this.tree.getSvg(t,e)}getQueryUrl(t,e){const n={options:a.assignIn(this.basicContentQueryAttributesObject,this.data.api)};return t=!a.isString(t)||a.isEmpty(t)?"":t,e=a.isString(e)||a.isNumber(e)?`/${e}`:"",`${this.apiBase}${e}?limit=${this.limit}&${c.serializeUrlParams(n)}&q=${t}`}selectedOnTop(t,e){if(!t||!t.length)return t;if(!e||!e.id)return t;const n=a.clone(t),i=t.findIndex(t=>t.id===e.id);return-1===i?(n.unshift(e),n):(s.moveItemInArray(n,i,0),n)}},y=C([n.Component({selector:`sa-${u}`,templateUrl:`${p}/${g}/${u}.component${f}.html`}),m(1,n.Inject(o.MAT_DIALOG_DATA)),b("design:paramtypes",[o.MatDialogRef,Object,i.FormBuilder,n.ChangeDetectorRef])],y),t("TreeDialogComponent",y)}}});
|