@stratusjs/angular 0.9.3 → 0.10.0
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 +237 -222
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +3 -3
- package/src/selector/selector.component.html +15 -15
- package/src/selector/selector.component.js +27 -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 +41 -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratusjs/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "This is the angular package for StratusJS.",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"repository": {
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@mat-datetimepicker/core": "6.0.3",
|
|
29
29
|
"@mat-datetimepicker/moment": "6.0.3",
|
|
30
|
-
|
|
31
30
|
"core-js": "^3.19.0",
|
|
32
31
|
"quill": "^1.3.7",
|
|
33
32
|
"quill-autoformat": "^0.1.2",
|
|
@@ -55,8 +54,9 @@
|
|
|
55
54
|
"@angular/platform-browser-dynamic": "^12.2.16",
|
|
56
55
|
"@angular/router": "^12.2.16",
|
|
57
56
|
"@codemirror/lang-html": "^6.4.0",
|
|
57
|
+
"@stratusjs/angularjs": "^0.10.0",
|
|
58
58
|
"@stratusjs/boot": "^1.2.0",
|
|
59
|
-
"@stratusjs/core": "^0.
|
|
59
|
+
"@stratusjs/core": "^0.8.0",
|
|
60
60
|
"@stratusjs/map": "^0.6.5",
|
|
61
61
|
"@stratusjs/runtime": "^0.12.1",
|
|
62
62
|
"@stratusjs/stripe": "^1.9.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
<mat-form-field class="full-width">
|
|
3
|
-
<input matInput [placeholder]="'Add ' + (
|
|
3
|
+
<input matInput [placeholder]="'Add ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ': Not Connected Yet!'" aria-label="Selector AutoComplete" [matAutocomplete]="auto" [formControl]="selectCtrl">
|
|
4
4
|
<mat-autocomplete #auto="matAutocomplete">
|
|
5
5
|
<mat-option *ngFor="let selectModel of filteredModels | async" [value]="selectModel">
|
|
6
6
|
{{ selectModel.version.title }}
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
<div cdkDropList (cdkDropListDropped)="drop($event)">
|
|
35
35
|
<!--<span class="selectedModels" style="display: none" [textContent]="dataSub | async | json"></span>-->
|
|
36
36
|
<!--<span class="selectedModels" style="display: none" *ngIf="log('selector.ngIf:', dataSub | async)"></span>-->
|
|
37
|
-
<!-- [cdkDragDisabled]="
|
|
37
|
+
<!-- [cdkDragDisabled]="get(selectedModel, 'status') < 1" -->
|
|
38
38
|
<div cdkDrag class="selected-list-row selected-box"
|
|
39
|
-
[ngClass]="{'active':
|
|
39
|
+
[ngClass]="{'active': get(selectedModel, 'status') === 1, 'inactive' : get(selectedModel, 'status') !== 1, 'published': get(selectedModel, 'version.published') === 1, 'unpublished': get(selectedModel, 'version.published') !== 1}"
|
|
40
40
|
*ngFor="let selectedModel of dataSub | async">
|
|
41
41
|
<div class="custom-ghost-placeholder" *cdkDragPlaceholder></div>
|
|
42
42
|
<div class="selected-list-container">
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
<!-- This adds stratus-src lazy loading if bestImage isn't a third party service without image sizes, e.g. Video -->
|
|
52
52
|
<div class="image position-all"
|
|
53
53
|
*ngIf="has(selectedModel, 'version.bestImage._thumbnailUrl')"
|
|
54
|
-
[attr.data-stratus-src]="!
|
|
55
|
-
[ngStyle]="{'background': 'url(' +
|
|
54
|
+
[attr.data-stratus-src]="!get(selectedModel, 'version.bestImage.service') ? true : false"
|
|
55
|
+
[ngStyle]="{'background': 'url(' + get(selectedModel, 'version.bestImage._thumbnailUrl') + ') no-repeat center center', 'background-size': 'cover'}">
|
|
56
56
|
</div>
|
|
57
57
|
|
|
58
58
|
<!-- Icon for items with no image -->
|
|
59
59
|
<div class="no-image-icon position-all"
|
|
60
60
|
*ngIf="!has(selectedModel, 'version.bestImage._thumbnailUrl')"
|
|
61
|
-
[ngClass]="
|
|
61
|
+
[ngClass]="get(selectedModel, 'contentType.class') + '-background-color'">
|
|
62
62
|
|
|
63
63
|
<mat-icon class="content-type-icon position-center"
|
|
64
|
-
[svgIcon]="getSvg(Stratus.BaseUrl + (
|
|
64
|
+
[svgIcon]="getSvg(Stratus.BaseUrl + (get(selectedModel, 'contentType.iconResourcePath') || get(selectedModel, 'iconResourcePath'))) | async">
|
|
65
65
|
Icon
|
|
66
66
|
</mat-icon>
|
|
67
67
|
</div>
|
|
@@ -78,32 +78,32 @@
|
|
|
78
78
|
to break away from the div and float to the top of the selector container
|
|
79
79
|
-->
|
|
80
80
|
<mat-icon class="content-type-icon"
|
|
81
|
-
[svgIcon]="getSvg(Stratus.BaseUrl +
|
|
81
|
+
[svgIcon]="getSvg(Stratus.BaseUrl + get(selectedModel, 'contentType.iconResourcePath')) | async">
|
|
82
82
|
ContentType Icon
|
|
83
83
|
</mat-icon>
|
|
84
84
|
<span class="comment content-type-name font-body"
|
|
85
|
-
[ngClass]="((
|
|
86
|
-
[textContent]="(
|
|
85
|
+
[ngClass]="((get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) | lowercase) + '-color'"
|
|
86
|
+
[textContent]="(get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ((get(selectedModel, 'status') !== 1) ? ' (hidden)' : '') + ((get(selectedModel, 'version.published') !== 1) ? ' (unpublished)' : '')">
|
|
87
87
|
</span>
|
|
88
88
|
</div>
|
|
89
89
|
|
|
90
90
|
<!-- This include fallbacks in case a version is not present -->
|
|
91
|
-
<h3 [innerHTML]="
|
|
91
|
+
<h3 [innerHTML]="get(selectedModel, 'version.bestIdentifier') || get(selectedModel, 'name') || (get(selectedModel, 'contentType.controller') === 'Content\\Module' ? get(selectedModel, 'version.internalIdentifier') : 'Untitled ' + get(selectedModel, 'contentType.name') + ' (' + get(selectedModel, 'id') + ')')"></h3>
|
|
92
92
|
<!-- TODO: make this clickable in new window -->
|
|
93
93
|
<span class="routing"
|
|
94
|
-
[textContent]="(has(selectedModel, 'routing') ? '/' +
|
|
94
|
+
[textContent]="(has(selectedModel, 'routing') ? '/' + get(selectedModel, 'routing[0].url') : null) || get(selectedModel, 'description') || ''">
|
|
95
95
|
</span>
|
|
96
96
|
</div>
|
|
97
97
|
<div class="column-action">
|
|
98
98
|
<a mat-button
|
|
99
|
-
[matTooltip]="'Delete ' + (
|
|
99
|
+
[matTooltip]="'Delete ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ' [THIS COLLECTION ONLY]'"
|
|
100
100
|
aria-label="Delete Item"
|
|
101
101
|
class="btn btn-delete"
|
|
102
102
|
(click)="remove(selectedModel)">
|
|
103
103
|
<mat-icon svgIcon="selector_delete" aria-hidden="false" aria-label="Delete Item">Delete</mat-icon>
|
|
104
104
|
</a>
|
|
105
105
|
<a mat-button
|
|
106
|
-
[matTooltip]="'Toggle ' + (
|
|
106
|
+
[matTooltip]="'Toggle ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ' Status ' + (get(selectedModel, 'status') ? 'Off' : 'On') + ' [ALL CONTEXTS]'"
|
|
107
107
|
aria-label="Toggle Status"
|
|
108
108
|
class="btn btn-status"
|
|
109
109
|
(click)="toggleStatus(selectedModel)">
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
</a>
|
|
112
112
|
<a mat-button
|
|
113
113
|
*ngIf="has(selectedModel, 'contentType.editUrl')"
|
|
114
|
-
[matTooltip]="'Edit ' + (
|
|
114
|
+
[matTooltip]="'Edit ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name'))"
|
|
115
115
|
aria-label="Edit Item in New Window"
|
|
116
116
|
class="btn btn-edit"
|
|
117
117
|
(click)="goToUrl(selectedModel, '_blank');">
|
|
@@ -9,7 +9,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
9
9
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
10
10
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
11
11
|
};
|
|
12
|
-
var core_1, forms_1, drag_drop_1, rxjs_1, platform_browser_1, icon_1, stratus_1, lodash_1, environment_1, root_component_1, registry_1, eventManager_1, xhr_1, systemDir, moduleName, min, localDir,
|
|
12
|
+
var core_1, forms_1, drag_drop_1, rxjs_1, platform_browser_1, icon_1, stratus_1, lodash_1, environment_1, root_component_1, registry_1, eventManager_1, xhr_1, systemDir, moduleName, min, localDir, hasNotEmpty, SelectorComponent;
|
|
13
13
|
var __moduleName = context_1 && context_1.id;
|
|
14
14
|
return {
|
|
15
15
|
setters: [
|
|
@@ -58,7 +58,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
58
58
|
moduleName = 'selector';
|
|
59
59
|
min = !environment_1.cookie('env') ? '.min' : '';
|
|
60
60
|
localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
61
|
-
|
|
61
|
+
hasNotEmpty = (object, path) => lodash_1.has(object, path) && !lodash_1.isEmpty(lodash_1.get(object, path));
|
|
62
62
|
SelectorComponent = class SelectorComponent extends root_component_1.RootComponent {
|
|
63
63
|
constructor(iconRegistry, sanitizer, ref, elementRef) {
|
|
64
64
|
super();
|
|
@@ -67,8 +67,8 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
67
67
|
this.ref = ref;
|
|
68
68
|
this.elementRef = elementRef;
|
|
69
69
|
this.title = moduleName + '_component';
|
|
70
|
-
this.
|
|
71
|
-
this.has =
|
|
70
|
+
this.get = lodash_1.get;
|
|
71
|
+
this.has = hasNotEmpty;
|
|
72
72
|
this.log = console.log;
|
|
73
73
|
this.Stratus = stratus_1.Stratus;
|
|
74
74
|
this.selectCtrl = new forms_1.FormControl();
|
|
@@ -77,10 +77,10 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
77
77
|
this.svgIcons = {};
|
|
78
78
|
this.styled = false;
|
|
79
79
|
this.empty = false;
|
|
80
|
-
this.uid = lodash_1.
|
|
80
|
+
this.uid = lodash_1.uniqueId(`sa_${lodash_1.snakeCase(moduleName)}_component_`);
|
|
81
81
|
stratus_1.Stratus.Instances[this.uid] = this;
|
|
82
82
|
this.dataSub = new rxjs_1.Observable(subscriber => this.dataDefer(subscriber));
|
|
83
|
-
lodash_1.
|
|
83
|
+
lodash_1.forEach({
|
|
84
84
|
selector_delete: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
|
|
85
85
|
selector_status: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,
|
|
86
86
|
selector_edit: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`
|
|
@@ -88,15 +88,15 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
88
88
|
stratus_1.Stratus.Internals.CssLoader(`${localDir}${moduleName}/${moduleName}.component${min}.css`)
|
|
89
89
|
.then(() => {
|
|
90
90
|
this.styled = true;
|
|
91
|
-
this.refresh();
|
|
91
|
+
this.refresh().then();
|
|
92
92
|
})
|
|
93
93
|
.catch((err) => {
|
|
94
94
|
console.warn('Issue detected in CSS Loader for Component:', this);
|
|
95
95
|
console.error(err);
|
|
96
96
|
this.styled = true;
|
|
97
|
-
this.refresh();
|
|
97
|
+
this.refresh().then();
|
|
98
98
|
});
|
|
99
|
-
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "ignorePriority", "
|
|
99
|
+
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "ignorePriority", "get", "has", "log", "Stratus", "selectCtrl", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "styled", "empty", "iconRegistry", "sanitizer", "ref", "elementRef", "drop", "goToUrl", "toggleStatus", "remove", "fetchData", "dataDefer", "dataRef", "onDataChange", "prioritize", "getSvg", "addSvgIcon", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
100
100
|
this.fetchData()
|
|
101
101
|
.then(data => {
|
|
102
102
|
if (!data || !(data instanceof eventManager_1.EventManager)) {
|
|
@@ -109,7 +109,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
109
109
|
}
|
|
110
110
|
this.dataDefer(this.subscriber);
|
|
111
111
|
this.prioritize();
|
|
112
|
-
this.refresh();
|
|
112
|
+
this.refresh().then();
|
|
113
113
|
};
|
|
114
114
|
data.on('change', onDataChange);
|
|
115
115
|
onDataChange();
|
|
@@ -123,7 +123,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
123
123
|
drag_drop_1.moveItemInArray(models, event.previousIndex, event.currentIndex);
|
|
124
124
|
if (!this.ignorePriority) {
|
|
125
125
|
let priority = 0;
|
|
126
|
-
lodash_1.
|
|
126
|
+
lodash_1.forEach(models, (model) => model.priority = priority++);
|
|
127
127
|
}
|
|
128
128
|
this.model.trigger('change');
|
|
129
129
|
}
|
|
@@ -135,6 +135,10 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
135
135
|
window.open(model.contentType.editUrl + '?id=' + model.id, '_blank');
|
|
136
136
|
}
|
|
137
137
|
toggleStatus(model) {
|
|
138
|
+
let meta = {};
|
|
139
|
+
if (!lodash_1.isUndefined(this.data)) {
|
|
140
|
+
meta = lodash_1.get(this.data, 'meta.data.api');
|
|
141
|
+
}
|
|
138
142
|
const statusOriginal = model.status;
|
|
139
143
|
model.status = statusOriginal === 1 ? 0 : 1;
|
|
140
144
|
const xhr = new xhr_1.XHR({
|
|
@@ -142,7 +146,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
142
146
|
url: '/Api/Content/' + model.id,
|
|
143
147
|
data: {
|
|
144
148
|
route: {},
|
|
145
|
-
meta
|
|
149
|
+
meta,
|
|
146
150
|
payload: {
|
|
147
151
|
status: model.status
|
|
148
152
|
}
|
|
@@ -151,18 +155,17 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
151
155
|
});
|
|
152
156
|
xhr.send()
|
|
153
157
|
.then((response) => {
|
|
154
|
-
if (!lodash_1.
|
|
158
|
+
if (!lodash_1.isObject(response) || lodash_1.get(response, 'meta.status[0].code') !== 'SUCCESS') {
|
|
155
159
|
console.error('error[toggleStatus]:', response);
|
|
156
160
|
model.status = statusOriginal;
|
|
157
|
-
this.refresh();
|
|
161
|
+
this.refresh().then();
|
|
158
162
|
return;
|
|
159
163
|
}
|
|
160
|
-
console.log('success[toggleStatus]:', response);
|
|
161
164
|
})
|
|
162
165
|
.catch((error) => {
|
|
163
166
|
console.error('error[toggleStatus]:', error);
|
|
164
167
|
model.status = statusOriginal;
|
|
165
|
-
this.refresh();
|
|
168
|
+
this.refresh().then();
|
|
166
169
|
});
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
@@ -170,7 +173,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
170
173
|
const models = this.dataRef();
|
|
171
174
|
if (!models || !models.length) {
|
|
172
175
|
console.error('unable to remove model from selection:', models);
|
|
173
|
-
this.refresh();
|
|
176
|
+
this.refresh().then();
|
|
174
177
|
return;
|
|
175
178
|
}
|
|
176
179
|
let index = models.indexOf(model);
|
|
@@ -178,8 +181,8 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
178
181
|
const mirrorModels = models
|
|
179
182
|
.map((m) => model.id === m.id ? m : null)
|
|
180
183
|
.filter((m) => m);
|
|
181
|
-
if (lodash_1.
|
|
182
|
-
index = models.indexOf(lodash_1.
|
|
184
|
+
if (lodash_1.isArray(mirrorModels) && mirrorModels.length) {
|
|
185
|
+
index = models.indexOf(lodash_1.head(mirrorModels));
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
188
|
if (index === -1) {
|
|
@@ -206,14 +209,14 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
206
209
|
const models = this.dataRef();
|
|
207
210
|
this.empty = !models.length;
|
|
208
211
|
this.subscriber.next(models);
|
|
209
|
-
this.refresh();
|
|
212
|
+
this.refresh().then();
|
|
210
213
|
}
|
|
211
214
|
dataRef() {
|
|
212
215
|
if (!this.model) {
|
|
213
216
|
return [];
|
|
214
217
|
}
|
|
215
218
|
const models = this.model.get(this.property);
|
|
216
|
-
if (!models || !lodash_1.
|
|
219
|
+
if (!models || !lodash_1.isArray(models)) {
|
|
217
220
|
return [];
|
|
218
221
|
}
|
|
219
222
|
return models;
|
|
@@ -221,7 +224,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
221
224
|
onDataChange() {
|
|
222
225
|
this.prioritize();
|
|
223
226
|
this.dataDefer(this.subscriber);
|
|
224
|
-
this.refresh();
|
|
227
|
+
this.refresh().then();
|
|
225
228
|
}
|
|
226
229
|
prioritize() {
|
|
227
230
|
const models = this.dataRef();
|
|
@@ -230,7 +233,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
230
233
|
}
|
|
231
234
|
if (!this.ignorePriority) {
|
|
232
235
|
let priority = 0;
|
|
233
|
-
lodash_1.
|
|
236
|
+
lodash_1.forEach(models, (model) => model.priority = priority++);
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
getSvg(url, options) {
|
|
@@ -255,7 +258,7 @@ System.register(["@angular/core", "@angular/forms", "@angular/cdk/drag-drop", "r
|
|
|
255
258
|
if (!options) {
|
|
256
259
|
options = {};
|
|
257
260
|
}
|
|
258
|
-
const uid = this.svgIcons[url] = lodash_1.
|
|
261
|
+
const uid = this.svgIcons[url] = lodash_1.uniqueId('selector_svg');
|
|
259
262
|
this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options);
|
|
260
263
|
return uid;
|
|
261
264
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["selector.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["selector.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAgEM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,UAAU,CAAA;YAGvB,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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zD,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAA;oBAC9F,OAAO,GAAG,CAAA;gBACd,CAAC;aAcJ,CAAA;YAhZG;gBAAC,YAAK,EAAE;;6DAAe;YACvB;gBAAC,YAAK,EAAE;;mEAAqB;YAC7B;gBAAC,YAAK,EAAE;;yDAAW;YACnB;gBAAC,YAAK,EAAE;;+DAAkB;YAC1B;gBAAC,YAAK,EAAE;;+DAAkB;YAC1B;gBAAC,YAAK,EAAE;;6DAAgB;YACxB;gBAAC,YAAK,EAAE;;0DAAY;YACpB;gBAAC,YAAK,EAAE;;8DAAgB;YAGxB;gBAAC,YAAK,EAAE;;2DAAa;YACrB;gBAAC,YAAK,EAAE;;+DAAiB;YACzB;gBAAC,YAAK,EAAE;;+DAAiB;YACzB;gBAAC,YAAK,EAAE;;qEAAwB;YApBvB,iBAAiB;gBAZ7B,gBAAS,CAAC;oBAEP,QAAQ,EAAE,MAAM,UAAU,EAAE;oBAC5B,WAAW,EAAE,GAAG,QAAQ,IAAI,UAAU,IAAI,UAAU,aAAa,GAAG,OAAO;iBAO9E,CAAC;iDA6D4B,sBAAe;oBAClB,+BAAY;oBAChB,wBAAiB;oBACZ,iBAAU;eA9DzB,iBAAiB,CAuZ7B;;QACD,CAAC","file":"selector.component.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<mat-progress-bar mode="indeterminate" *ngIf="!styled"></mat-progress-bar><ng-template #emptyList><div class="selected-list-header border-default border-default-bottom"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3></div><div class="selected-message-box">Nothing has been selected.</div></ng-template><div class="selected-list" *ngIf="styled"><div class="selected-list-header border-default border-default-bottom" *ngIf="!empty; else emptyList"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3><p class="note">Drag to reorder</p></div><div cdkDropList (cdkDropListDropped)="drop($event)"><div cdkDrag class="selected-list-row selected-box" [ngClass]="{'active':
|
|
1
|
+
<mat-progress-bar mode="indeterminate" *ngIf="!styled"></mat-progress-bar><ng-template #emptyList><div class="selected-list-header border-default border-default-bottom"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3></div><div class="selected-message-box">Nothing has been selected.</div></ng-template><div class="selected-list" *ngIf="styled"><div class="selected-list-header border-default border-default-bottom" *ngIf="!empty; else emptyList"><h3 [textContent]="'Selected ' + (type || 'Items')"></h3><p class="note">Drag to reorder</p></div><div cdkDropList (cdkDropListDropped)="drop($event)"><div cdkDrag class="selected-list-row selected-box" [ngClass]="{'active': get(selectedModel, 'status') === 1, 'inactive' : get(selectedModel, 'status') !== 1, 'published': get(selectedModel, 'version.published') === 1, 'unpublished': get(selectedModel, 'version.published') !== 1}" *ngFor="let selectedModel of dataSub | async"><div class="custom-ghost-placeholder" *cdkDragPlaceholder></div><div class="selected-list-container"><div class="column-image position-anchor"><div class="image position-all" *ngIf="has(selectedModel, 'version.bestImage._thumbnailUrl')" [attr.data-stratus-src]="!get(selectedModel, 'version.bestImage.service') ? true : false" [ngStyle]="{'background': 'url(' + get(selectedModel, 'version.bestImage._thumbnailUrl') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="no-image-icon position-all" *ngIf="!has(selectedModel, 'version.bestImage._thumbnailUrl')" [ngClass]="get(selectedModel, 'contentType.class') + '-background-color'"><mat-icon class="content-type-icon position-center" [svgIcon]="getSvg(Stratus.BaseUrl + (get(selectedModel, 'contentType.iconResourcePath') || get(selectedModel, 'iconResourcePath'))) | async">Icon</mat-icon></div><img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'"></div><div class="column-title"><div class="content-type" *ngIf="has(selectedModel, 'contentType.iconResourcePath')"><mat-icon class="content-type-icon" [svgIcon]="getSvg(Stratus.BaseUrl + get(selectedModel, 'contentType.iconResourcePath')) | async">ContentType Icon</mat-icon><span class="comment content-type-name font-body" [ngClass]="((get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) | lowercase) + '-color'" [textContent]="(get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ((get(selectedModel, 'status') !== 1) ? ' (hidden)' : '') + ((get(selectedModel, 'version.published') !== 1) ? ' (unpublished)' : '')"></span></div><h3 [innerHTML]="get(selectedModel, 'version.bestIdentifier') || get(selectedModel, 'name') || (get(selectedModel, 'contentType.controller') === 'Content\\Module' ? get(selectedModel, 'version.internalIdentifier') : 'Untitled ' + get(selectedModel, 'contentType.name') + ' (' + get(selectedModel, 'id') + ')')"></h3><span class="routing" [textContent]="(has(selectedModel, 'routing') ? '/' + get(selectedModel, 'routing[0].url') : null) || get(selectedModel, 'description') || ''"></span></div><div class="column-action"><a mat-button [matTooltip]="'Delete ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ' [THIS COLLECTION ONLY]'" aria-label="Delete Item" class="btn btn-delete" (click)="remove(selectedModel)"><mat-icon svgIcon="selector_delete" aria-hidden="false" aria-label="Delete Item">Delete</mat-icon></a><a mat-button [matTooltip]="'Toggle ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name')) + ' Status ' + (get(selectedModel, 'status') ? 'Off' : 'On') + ' [ALL CONTEXTS]'" aria-label="Toggle Status" class="btn btn-status" (click)="toggleStatus(selectedModel)"><mat-icon svgIcon="selector_status" aria-hidden="false" aria-label="Toggle Status">Toggle Status</mat-icon></a><a mat-button *ngIf="has(selectedModel, 'contentType.editUrl')" [matTooltip]="'Edit ' + (get(selectedModel, 'contentType.name') || get(selectedModel, 'name'))" aria-label="Edit Item in New Window" class="btn btn-edit" (click)="goToUrl(selectedModel, '_blank');"><mat-icon svgIcon="selector_edit" aria-hidden="false" aria-label="Edit">Edit</mat-icon></a></div></div></div></div></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@stratusjs/core/datastore/xhr"],function(t,e){"use strict";var r,s,o,i,n,a,c,d,u,l,
|
|
1
|
+
System.register(["@angular/core","@angular/forms","@angular/cdk/drag-drop","rxjs","@angular/platform-browser","@angular/material/icon","@stratusjs/runtime/stratus","lodash","@stratusjs/core/environment","../core/root.component","@stratusjs/angularjs/services/registry","@stratusjs/core/events/eventManager","@stratusjs/core/datastore/xhr"],function(t,e){"use strict";var r,s,o,i,n,a,c,d,h,u,l,g,p,f,y,m,v,S,b=this&&this.__decorate||function(t,e,r,s){var o,i=arguments.length,n=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,r,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(i<3?o(n):i>3?o(e,r,n):o(e,r))||n);return i>3&&n&&Object.defineProperty(e,r,n),n},I=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};e&&e.id;return{setters:[function(t){r=t},function(t){s=t},function(t){o=t},function(t){i=t},function(t){n=t},function(t){a=t},function(t){c=t},function(t){d=t},function(t){h=t},function(t){u=t},function(t){l=t},function(t){g=t},function(t){p=t}],execute:function(){"@stratusjs/angular",f="selector",y=h.cookie("env")?"":".min",m=`${c.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"").replace(/\/dist\/$/,"/src/")}`,v=(t,e)=>d.has(t,e)&&!d.isEmpty(d.get(t,e)),S=class extends u.RootComponent{constructor(t,e,r,o){super(),this.iconRegistry=t,this.sanitizer=e,this.ref=r,this.elementRef=o,this.title=f+"_component",this.get=d.get,this.has=v,this.log=console.log,this.Stratus=c.Stratus,this.selectCtrl=new s.FormControl,this.registry=new l.Registry,this.onChange=new i.Subject,this.svgIcons={},this.styled=!1,this.empty=!1,this.uid=d.uniqueId(`sa_${d.snakeCase(f)}_component_`),c.Stratus.Instances[this.uid]=this,this.dataSub=new i.Observable(t=>this.dataDefer(t)),d.forEach({selector_delete:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,selector_status:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/visibility.svg`,selector_edit:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`},(r,s)=>t.addSvgIcon(s,e.bypassSecurityTrustResourceUrl(r)).getNamedSvgIcon(s)),c.Stratus.Internals.CssLoader(`${m}${f}/${f}.component${y}.css`).then(()=>{this.styled=!0,this.refresh().then()}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.styled=!0,this.refresh().then()}),this.hydrate(o,e,["title","uid","target","targetSuffix","id","manifest","decouple","direct","api","urlRoot","type","property","endpoint","ignorePriority","get","has","log","Stratus","selectCtrl","registry","fetched","data","collection","model","dataSub","onChange","subscriber","svgIcons","styled","empty","iconRegistry","sanitizer","ref","elementRef","drop","goToUrl","toggleStatus","remove","fetchData","dataDefer","dataRef","onDataChange","prioritize","getSvg","addSvgIcon","hydrate","disableRefresh","stagger","reloading","refresh","ngOnDestroy"]),this.fetchData().then(t=>{if(!(t&&t instanceof g.EventManager))return void console.warn("Unable to bind data from Registry!");const e=()=>{t.completed&&(this.dataDefer(this.subscriber),this.prioritize(),this.refresh().then())};t.on("change",e),e()})}drop(t){const e=this.dataRef();if(e&&e.length){if(o.moveItemInArray(e,t.previousIndex,t.currentIndex),!this.ignorePriority){let t=0;d.forEach(e,e=>e.priority=t++)}this.model.trigger("change")}}goToUrl(t){t&&t.contentType?window.open(t.contentType.editUrl+"?id="+t.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}toggleStatus(t){let e={};d.isUndefined(this.data)||(e=d.get(this.data,"meta.data.api"));const r=t.status;t.status=1===r?0:1;new p.XHR({method:"PUT",url:"/Api/Content/"+t.id,data:{route:{},meta:e,payload:{status:t.status}},type:"application/json"}).send().then(e=>{if(!d.isObject(e)||"SUCCESS"!==d.get(e,"meta.status[0].code"))return console.error("error[toggleStatus]:",e),t.status=r,void this.refresh().then()}).catch(e=>{console.error("error[toggleStatus]:",e),t.status=r,this.refresh().then()})}remove(t){const e=this.dataRef();if(!e||!e.length)return console.error("unable to remove model from selection:",e),void this.refresh().then();let r=e.indexOf(t);if(-1===r){const s=e.map(e=>t.id===e.id?e:null).filter(t=>t);d.isArray(s)&&s.length&&(r=e.indexOf(d.head(s)))}-1!==r?(e.splice(r,1),this.model.trigger("change")):console.error("unable to find model:",t,"in selection:",e)}fetchData(){return this.fetched?this.fetched:this.fetched=this.registry.fetch(c.Stratus.Select(this.elementRef.nativeElement),this)}dataDefer(t){if(this.subscriber=this.subscriber||t,!this.subscriber||!this.model||!this.model.completed)return void setTimeout(()=>{this.dataDefer(t)},500);const e=this.dataRef();this.empty=!e.length,this.subscriber.next(e),this.refresh().then()}dataRef(){if(!this.model)return[];const t=this.model.get(this.property);return t&&d.isArray(t)?t:[]}onDataChange(){this.prioritize(),this.dataDefer(this.subscriber),this.refresh().then()}prioritize(){const t=this.dataRef();if(t&&t.length&&!this.ignorePriority){let e=0;d.forEach(t,t=>t.priority=e++)}}getSvg(t,e){const r=this.addSvgIcon(t,e);return new i.Observable(e=>{this.iconRegistry.getNamedSvgIcon(r).subscribe({error(e){console.error(`getSvg(${t}): ${e}`)},complete(){e.next(r)}})})}addSvgIcon(t,e){if(t in this.svgIcons)return this.svgIcons[t];e||(e={});const r=this.svgIcons[t]=d.uniqueId("selector_svg");return this.iconRegistry.addSvgIcon(r,this.sanitizer.bypassSecurityTrustResourceUrl(t),e),r}},b([r.Input(),I("design:type",String)],S.prototype,"target",void 0),b([r.Input(),I("design:type",String)],S.prototype,"targetSuffix",void 0),b([r.Input(),I("design:type",Number)],S.prototype,"id",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"manifest",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"decouple",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"direct",void 0),b([r.Input(),I("design:type",Object)],S.prototype,"api",void 0),b([r.Input(),I("design:type",String)],S.prototype,"urlRoot",void 0),b([r.Input(),I("design:type",String)],S.prototype,"type",void 0),b([r.Input(),I("design:type",String)],S.prototype,"property",void 0),b([r.Input(),I("design:type",String)],S.prototype,"endpoint",void 0),b([r.Input(),I("design:type",Boolean)],S.prototype,"ignorePriority",void 0),S=b([r.Component({selector:`sa-${f}`,templateUrl:`${m}/${f}/${f}.component${y}.html`}),I("design:paramtypes",[a.MatIconRegistry,n.DomSanitizer,r.ChangeDetectorRef,r.ElementRef])],S),t("SelectorComponent",S)}}});
|