@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,414 +1,449 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import _ from 'lodash';
|
|
17
|
-
import { cookie } from '@stratusjs/core/environment';
|
|
18
|
-
import { RootComponent } from '../core/root.component';
|
|
19
|
-
import { Registry } from '@stratusjs/angularjs/services/registry';
|
|
20
|
-
import { EventManager } from '@stratusjs/core/events/eventManager';
|
|
21
|
-
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
22
|
-
const systemDir = '@stratusjs/angular';
|
|
23
|
-
const moduleName = 'media-selector';
|
|
24
|
-
const min = !cookie('env') ? '.min' : '';
|
|
25
|
-
const localDir = `${Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
26
|
-
const has = (object, path) => _.has(object, path) && !_.isEmpty(_.get(object, path));
|
|
27
|
-
let MediaSelectorComponent = class MediaSelectorComponent extends RootComponent {
|
|
28
|
-
constructor(iconRegistry, sanitizer, ref, elementRef, viewportRuler) {
|
|
29
|
-
super();
|
|
30
|
-
this.iconRegistry = iconRegistry;
|
|
31
|
-
this.sanitizer = sanitizer;
|
|
32
|
-
this.ref = ref;
|
|
33
|
-
this.elementRef = elementRef;
|
|
34
|
-
this.viewportRuler = viewportRuler;
|
|
35
|
-
this.title = moduleName + '_component';
|
|
36
|
-
this._ = _;
|
|
37
|
-
this.has = has;
|
|
38
|
-
this.log = console.log;
|
|
39
|
-
this.Stratus = Stratus;
|
|
40
|
-
this.registry = new Registry();
|
|
41
|
-
this.onChange = new Subject();
|
|
42
|
-
this.svgIcons = {};
|
|
43
|
-
this.styled = false;
|
|
44
|
-
this.empty = false;
|
|
45
|
-
this.libraryDisplay = false;
|
|
46
|
-
this.isSelector = true;
|
|
47
|
-
this.isGrid = true;
|
|
48
|
-
this.enterPredicate = (drag, drop) => {
|
|
49
|
-
if (drop === this.placeholder) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if (cookie('env')) {
|
|
53
|
-
console.log('entering predicate...');
|
|
54
|
-
}
|
|
55
|
-
if (drop !== this.activeContainer) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
const placeholderElement = this.placeholder.element.nativeElement;
|
|
59
|
-
const sourceElement = drag.dropContainer.element.nativeElement;
|
|
60
|
-
const dropElement = drop.element.nativeElement;
|
|
61
|
-
const dragIndex = __indexOf(dropElement.parentElement.children, (this.sourceList ? placeholderElement : sourceElement));
|
|
62
|
-
const dropIndex = __indexOf(dropElement.parentElement.children, dropElement);
|
|
63
|
-
if (!this.sourceList) {
|
|
64
|
-
this.sourceIndex = dragIndex;
|
|
65
|
-
this.sourceList = drag.dropContainer;
|
|
66
|
-
placeholderElement.style.width = `${sourceElement.clientWidth}px`;
|
|
67
|
-
placeholderElement.style.height = `${sourceElement.clientHeight}px`;
|
|
68
|
-
sourceElement.parentElement.removeChild(sourceElement);
|
|
69
|
-
}
|
|
70
|
-
this.targetIndex = dropIndex;
|
|
71
|
-
this.targetList = drop;
|
|
72
|
-
if (cookie('env')) {
|
|
73
|
-
console.log('predicate:', this.sourceIndex, '->', this.targetIndex);
|
|
74
|
-
}
|
|
75
|
-
placeholderElement.style.display = '';
|
|
76
|
-
dropElement.parentElement.insertBefore(placeholderElement, dropIndex > dragIndex ? dropElement.nextSibling : dropElement);
|
|
77
|
-
this.placeholder._dropListRef.enter(drag._dragRef, drag.element.nativeElement.offsetLeft, drag.element.nativeElement.offsetTop);
|
|
78
|
-
return false;
|
|
79
|
-
};
|
|
80
|
-
this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName)}_component_`);
|
|
81
|
-
Stratus.Instances[this.uid] = this;
|
|
82
|
-
this.dataSub = new Observable(subscriber => this.dataDefer(subscriber));
|
|
83
|
-
this.targetList = null;
|
|
84
|
-
this.sourceList = null;
|
|
85
|
-
_.forEach({
|
|
86
|
-
media_selector_add: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/add.svg`,
|
|
87
|
-
media_selector_clear: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/clear.svg`,
|
|
88
|
-
media_selector_delete: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
|
|
89
|
-
media_selector_edit: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`,
|
|
90
|
-
media_selector_info: `${Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/info.svg`,
|
|
91
|
-
media_selector_image: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-image.svg`,
|
|
92
|
-
media_selector_video: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-video.svg`,
|
|
93
|
-
media_selector_audio: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-audio.svg`,
|
|
94
|
-
media_selector_document: `${Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-document.svg`
|
|
95
|
-
}, (value, key) => iconRegistry.addSvgIcon(key, sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
|
|
96
|
-
Stratus.Internals.CssLoader(`${localDir}${moduleName}/${moduleName}.component${min}.css`)
|
|
97
|
-
.then(() => {
|
|
98
|
-
this.styled = true;
|
|
99
|
-
this.refresh();
|
|
100
|
-
})
|
|
101
|
-
.catch((err) => {
|
|
102
|
-
console.warn('Issue detected in CSS Loader for Component:', this);
|
|
103
|
-
console.error(err);
|
|
104
|
-
this.styled = true;
|
|
105
|
-
this.refresh();
|
|
106
|
-
});
|
|
107
|
-
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "eventID", "svgIcons", "styled", "empty", "libraryDisplay", "isSelector", "isGrid", "listGroup", "placeholder", "targetList", "targetIndex", "sourceList", "sourceIndex", "activeContainer", "iconRegistry", "sanitizer", "ref", "elementRef", "viewportRuler", "drop", "moveModel", "goToUrl", "remove", "fetchData", "dataDefer", "dataRef", "onDataChange", "prioritize", "getSvg", "addSvgIcon", "toggleLibrary", "showDetails", "deleteMedia", "removeFromSelected", "dragEntered", "move", "moveItemInGrid", "enterPredicate", "getPointerPositionOnPage", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
108
|
-
this.eventID = `${this.target}:${this.id}:${this.property}`;
|
|
109
|
-
this.fetchData()
|
|
110
|
-
.then(data => {
|
|
111
|
-
if (!data || !(data instanceof EventManager)) {
|
|
112
|
-
console.warn('Unable to bind data from Registry!');
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const onDataChange = () => {
|
|
116
|
-
if (!data.completed) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this.dataDefer(this.subscriber);
|
|
120
|
-
this.prioritize();
|
|
121
|
-
this.refresh();
|
|
122
|
-
};
|
|
123
|
-
data.on('change', onDataChange);
|
|
124
|
-
onDataChange();
|
|
125
|
-
});
|
|
1
|
+
System.register(["@angular/core", "@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", "@angular/cdk/scrolling"], 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, drag_drop_1, rxjs_1, platform_browser_1, icon_1, stratus_1, lodash_1, environment_1, root_component_1, registry_1, eventManager_1, scrolling_1, systemDir, moduleName, min, localDir, has, MediaSelectorComponent;
|
|
13
|
+
var __moduleName = context_1 && context_1.id;
|
|
14
|
+
function __indexOf(collection, node) {
|
|
15
|
+
return Array.prototype.indexOf.call(collection, node);
|
|
126
16
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (!models || !models.length) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
if (cookie('env')) {
|
|
133
|
-
console.log('drop:', event.previousContainer.id, event.container.id);
|
|
134
|
-
}
|
|
135
|
-
if (!this.isGrid || !this.moveItemInGrid(models)) {
|
|
136
|
-
if (this.isGrid && cookie('env')) {
|
|
137
|
-
console.warn('moving item in grid failed. attempting fallback.');
|
|
138
|
-
}
|
|
139
|
-
moveItemInArray(models, event.previousIndex, event.currentIndex);
|
|
140
|
-
}
|
|
141
|
-
let priority = 0;
|
|
142
|
-
_.forEach(models, (model) => model.priority = priority++);
|
|
143
|
-
this.model.trigger('change');
|
|
144
|
-
}
|
|
145
|
-
moveModel(previousIndex, currentIndex) {
|
|
146
|
-
const models = this.dataRef();
|
|
147
|
-
if (!models || !models.length) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
moveItemInArray(models, previousIndex, currentIndex);
|
|
151
|
-
let priority = 0;
|
|
152
|
-
_.forEach(models, (model) => model.priority = priority++);
|
|
153
|
-
this.model.trigger('change');
|
|
17
|
+
function __isTouchEvent(event) {
|
|
18
|
+
return event.type.startsWith('touch');
|
|
154
19
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
window.open(model.contentType.editUrl + '?id=' + model.id, '_blank');
|
|
20
|
+
function __isInsideDropListClientRect(dropList, x, y) {
|
|
21
|
+
const { top, bottom, left, right } = dropList.element.nativeElement.getBoundingClientRect();
|
|
22
|
+
return y >= top && y <= bottom && x >= left && x <= right;
|
|
161
23
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
24
|
+
return {
|
|
25
|
+
setters: [
|
|
26
|
+
function (core_1_1) {
|
|
27
|
+
core_1 = core_1_1;
|
|
28
|
+
},
|
|
29
|
+
function (drag_drop_1_1) {
|
|
30
|
+
drag_drop_1 = drag_drop_1_1;
|
|
31
|
+
},
|
|
32
|
+
function (rxjs_1_1) {
|
|
33
|
+
rxjs_1 = rxjs_1_1;
|
|
34
|
+
},
|
|
35
|
+
function (platform_browser_1_1) {
|
|
36
|
+
platform_browser_1 = platform_browser_1_1;
|
|
37
|
+
},
|
|
38
|
+
function (icon_1_1) {
|
|
39
|
+
icon_1 = icon_1_1;
|
|
40
|
+
},
|
|
41
|
+
function (stratus_1_1) {
|
|
42
|
+
stratus_1 = stratus_1_1;
|
|
43
|
+
},
|
|
44
|
+
function (lodash_1_1) {
|
|
45
|
+
lodash_1 = lodash_1_1;
|
|
46
|
+
},
|
|
47
|
+
function (environment_1_1) {
|
|
48
|
+
environment_1 = environment_1_1;
|
|
49
|
+
},
|
|
50
|
+
function (root_component_1_1) {
|
|
51
|
+
root_component_1 = root_component_1_1;
|
|
52
|
+
},
|
|
53
|
+
function (registry_1_1) {
|
|
54
|
+
registry_1 = registry_1_1;
|
|
55
|
+
},
|
|
56
|
+
function (eventManager_1_1) {
|
|
57
|
+
eventManager_1 = eventManager_1_1;
|
|
58
|
+
},
|
|
59
|
+
function (scrolling_1_1) {
|
|
60
|
+
scrolling_1 = scrolling_1_1;
|
|
176
61
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
62
|
+
],
|
|
63
|
+
execute: function () {
|
|
64
|
+
systemDir = '@stratusjs/angular';
|
|
65
|
+
moduleName = 'media-selector';
|
|
66
|
+
min = !environment_1.cookie('env') ? '.min' : '';
|
|
67
|
+
localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '').replace(/\/dist\/$/, '/src/')}`;
|
|
68
|
+
has = (object, path) => lodash_1.default.has(object, path) && !lodash_1.default.isEmpty(lodash_1.default.get(object, path));
|
|
69
|
+
MediaSelectorComponent = class MediaSelectorComponent extends root_component_1.RootComponent {
|
|
70
|
+
constructor(iconRegistry, sanitizer, ref, elementRef, viewportRuler) {
|
|
71
|
+
super();
|
|
72
|
+
this.iconRegistry = iconRegistry;
|
|
73
|
+
this.sanitizer = sanitizer;
|
|
74
|
+
this.ref = ref;
|
|
75
|
+
this.elementRef = elementRef;
|
|
76
|
+
this.viewportRuler = viewportRuler;
|
|
77
|
+
this.title = moduleName + '_component';
|
|
78
|
+
this._ = lodash_1.default;
|
|
79
|
+
this.has = has;
|
|
80
|
+
this.log = console.log;
|
|
81
|
+
this.Stratus = stratus_1.Stratus;
|
|
82
|
+
this.registry = new registry_1.Registry();
|
|
83
|
+
this.onChange = new rxjs_1.Subject();
|
|
84
|
+
this.svgIcons = {};
|
|
85
|
+
this.styled = false;
|
|
86
|
+
this.empty = false;
|
|
87
|
+
this.libraryDisplay = false;
|
|
88
|
+
this.isSelector = true;
|
|
89
|
+
this.isGrid = true;
|
|
90
|
+
this.enterPredicate = (drag, drop) => {
|
|
91
|
+
if (drop === this.placeholder) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (environment_1.cookie('env')) {
|
|
95
|
+
console.log('entering predicate...');
|
|
96
|
+
}
|
|
97
|
+
if (drop !== this.activeContainer) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const placeholderElement = this.placeholder.element.nativeElement;
|
|
101
|
+
const sourceElement = drag.dropContainer.element.nativeElement;
|
|
102
|
+
const dropElement = drop.element.nativeElement;
|
|
103
|
+
const dragIndex = __indexOf(dropElement.parentElement.children, (this.sourceList ? placeholderElement : sourceElement));
|
|
104
|
+
const dropIndex = __indexOf(dropElement.parentElement.children, dropElement);
|
|
105
|
+
if (!this.sourceList) {
|
|
106
|
+
this.sourceIndex = dragIndex;
|
|
107
|
+
this.sourceList = drag.dropContainer;
|
|
108
|
+
placeholderElement.style.width = `${sourceElement.clientWidth}px`;
|
|
109
|
+
placeholderElement.style.height = `${sourceElement.clientHeight}px`;
|
|
110
|
+
sourceElement.parentElement.removeChild(sourceElement);
|
|
111
|
+
}
|
|
112
|
+
this.targetIndex = dropIndex;
|
|
113
|
+
this.targetList = drop;
|
|
114
|
+
if (environment_1.cookie('env')) {
|
|
115
|
+
console.log('predicate:', this.sourceIndex, '->', this.targetIndex);
|
|
116
|
+
}
|
|
117
|
+
placeholderElement.style.display = '';
|
|
118
|
+
dropElement.parentElement.insertBefore(placeholderElement, dropIndex > dragIndex ? dropElement.nextSibling : dropElement);
|
|
119
|
+
this.placeholder._dropListRef.enter(drag._dragRef, drag.element.nativeElement.offsetLeft, drag.element.nativeElement.offsetTop);
|
|
120
|
+
return false;
|
|
121
|
+
};
|
|
122
|
+
this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
|
|
123
|
+
stratus_1.Stratus.Instances[this.uid] = this;
|
|
124
|
+
this.dataSub = new rxjs_1.Observable(subscriber => this.dataDefer(subscriber));
|
|
125
|
+
this.targetList = null;
|
|
126
|
+
this.sourceList = null;
|
|
127
|
+
lodash_1.default.forEach({
|
|
128
|
+
media_selector_add: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/add.svg`,
|
|
129
|
+
media_selector_clear: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/clear.svg`,
|
|
130
|
+
media_selector_delete: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
|
|
131
|
+
media_selector_edit: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`,
|
|
132
|
+
media_selector_info: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/info.svg`,
|
|
133
|
+
media_selector_image: `${stratus_1.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-image.svg`,
|
|
134
|
+
media_selector_video: `${stratus_1.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-video.svg`,
|
|
135
|
+
media_selector_audio: `${stratus_1.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-audio.svg`,
|
|
136
|
+
media_selector_document: `${stratus_1.Stratus.BaseUrl}sitetheorymedia/images/mediaTypeIcons/media-icon-document.svg`
|
|
137
|
+
}, (value, key) => iconRegistry.addSvgIcon(key, sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
|
|
138
|
+
stratus_1.Stratus.Internals.CssLoader(`${localDir}${moduleName}/${moduleName}.component${min}.css`)
|
|
139
|
+
.then(() => {
|
|
140
|
+
this.styled = true;
|
|
141
|
+
this.refresh();
|
|
142
|
+
})
|
|
143
|
+
.catch((err) => {
|
|
144
|
+
console.warn('Issue detected in CSS Loader for Component:', this);
|
|
145
|
+
console.error(err);
|
|
146
|
+
this.styled = true;
|
|
147
|
+
this.refresh();
|
|
148
|
+
});
|
|
149
|
+
this.hydrate(elementRef, sanitizer, ["title", "uid", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "type", "property", "endpoint", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "eventID", "svgIcons", "styled", "empty", "libraryDisplay", "isSelector", "isGrid", "listGroup", "placeholder", "targetList", "targetIndex", "sourceList", "sourceIndex", "activeContainer", "iconRegistry", "sanitizer", "ref", "elementRef", "viewportRuler", "drop", "moveModel", "goToUrl", "remove", "fetchData", "dataDefer", "dataRef", "onDataChange", "prioritize", "getSvg", "addSvgIcon", "toggleLibrary", "showDetails", "deleteMedia", "removeFromSelected", "dragEntered", "move", "moveItemInGrid", "enterPredicate", "getPointerPositionOnPage", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
|
|
150
|
+
this.eventID = `${this.target}:${this.id}:${this.property}`;
|
|
151
|
+
this.fetchData()
|
|
152
|
+
.then(data => {
|
|
153
|
+
if (!data || !(data instanceof eventManager_1.EventManager)) {
|
|
154
|
+
console.warn('Unable to bind data from Registry!');
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const onDataChange = () => {
|
|
158
|
+
if (!data.completed) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
this.dataDefer(this.subscriber);
|
|
162
|
+
this.prioritize();
|
|
163
|
+
this.refresh();
|
|
164
|
+
};
|
|
165
|
+
data.on('change', onDataChange);
|
|
166
|
+
onDataChange();
|
|
167
|
+
});
|
|
239
168
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
169
|
+
drop(event) {
|
|
170
|
+
const models = this.dataRef();
|
|
171
|
+
if (!models || !models.length) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (environment_1.cookie('env')) {
|
|
175
|
+
console.log('drop:', event.previousContainer.id, event.container.id);
|
|
176
|
+
}
|
|
177
|
+
if (!this.isGrid || !this.moveItemInGrid(models)) {
|
|
178
|
+
if (this.isGrid && environment_1.cookie('env')) {
|
|
179
|
+
console.warn('moving item in grid failed. attempting fallback.');
|
|
180
|
+
}
|
|
181
|
+
drag_drop_1.moveItemInArray(models, event.previousIndex, event.currentIndex);
|
|
182
|
+
}
|
|
183
|
+
let priority = 0;
|
|
184
|
+
lodash_1.default.forEach(models, (model) => model.priority = priority++);
|
|
185
|
+
this.model.trigger('change');
|
|
186
|
+
}
|
|
187
|
+
moveModel(previousIndex, currentIndex) {
|
|
188
|
+
const models = this.dataRef();
|
|
189
|
+
if (!models || !models.length) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
drag_drop_1.moveItemInArray(models, previousIndex, currentIndex);
|
|
193
|
+
let priority = 0;
|
|
194
|
+
lodash_1.default.forEach(models, (model) => model.priority = priority++);
|
|
195
|
+
this.model.trigger('change');
|
|
196
|
+
}
|
|
197
|
+
goToUrl(model) {
|
|
198
|
+
if (!model || !model.contentType) {
|
|
199
|
+
console.error('unable to execute goToUrl() because a valid model content was not provided.');
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
window.open(model.contentType.editUrl + '?id=' + model.id, '_blank');
|
|
203
|
+
}
|
|
204
|
+
remove(model) {
|
|
205
|
+
const models = this.dataRef();
|
|
206
|
+
if (!models || !models.length) {
|
|
207
|
+
console.error('unable to remove model from selection:', models);
|
|
208
|
+
this.refresh();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
let index = models.indexOf(model);
|
|
212
|
+
if (index === -1) {
|
|
213
|
+
const mirrorModels = models
|
|
214
|
+
.map((m) => model.id === m.id ? m : null)
|
|
215
|
+
.filter((m) => m);
|
|
216
|
+
if (lodash_1.default.isArray(mirrorModels) && mirrorModels.length) {
|
|
217
|
+
index = models.indexOf(lodash_1.default.first(mirrorModels));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (index === -1) {
|
|
221
|
+
console.error('unable to find model:', model, 'in selection:', models);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
models.splice(index, 1);
|
|
225
|
+
this.model.trigger('change');
|
|
226
|
+
this.removeFromSelected(model.id);
|
|
227
|
+
}
|
|
228
|
+
fetchData() {
|
|
229
|
+
if (this.fetched) {
|
|
230
|
+
return this.fetched;
|
|
231
|
+
}
|
|
232
|
+
return this.fetched = this.registry.fetch(stratus_1.Stratus.Select(this.elementRef.nativeElement), this);
|
|
233
|
+
}
|
|
234
|
+
dataDefer(subscriber) {
|
|
235
|
+
this.subscriber = this.subscriber || subscriber;
|
|
236
|
+
if (!this.subscriber || !this.model || !this.model.completed) {
|
|
237
|
+
setTimeout(() => {
|
|
238
|
+
this.dataDefer(subscriber);
|
|
239
|
+
}, 500);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const models = this.dataRef();
|
|
243
|
+
this.empty = !models.length;
|
|
244
|
+
this.subscriber.next(models);
|
|
245
|
+
this.refresh();
|
|
246
|
+
}
|
|
247
|
+
dataRef() {
|
|
248
|
+
if (!this.model) {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
const models = this.model.get(this.property);
|
|
252
|
+
if (!models || !lodash_1.default.isArray(models)) {
|
|
253
|
+
return [];
|
|
254
|
+
}
|
|
255
|
+
return models;
|
|
256
|
+
}
|
|
257
|
+
onDataChange() {
|
|
258
|
+
this.prioritize();
|
|
259
|
+
this.dataDefer(this.subscriber);
|
|
260
|
+
this.refresh();
|
|
261
|
+
}
|
|
262
|
+
prioritize() {
|
|
263
|
+
const models = this.dataRef();
|
|
264
|
+
if (!models || !models.length) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
let priority = 0;
|
|
268
|
+
lodash_1.default.forEach(models, (model) => model.priority = priority++);
|
|
269
|
+
}
|
|
270
|
+
getSvg(url, options) {
|
|
271
|
+
const uid = this.addSvgIcon(url, options);
|
|
272
|
+
return new rxjs_1.Observable((subscriber) => {
|
|
273
|
+
this.iconRegistry
|
|
274
|
+
.getNamedSvgIcon(uid)
|
|
275
|
+
.subscribe({
|
|
276
|
+
error(err) {
|
|
277
|
+
console.error(`getSvg(${url}): ${err}`);
|
|
278
|
+
},
|
|
279
|
+
complete() {
|
|
280
|
+
subscriber.next(uid);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
addSvgIcon(url, options) {
|
|
286
|
+
if (url in this.svgIcons) {
|
|
287
|
+
return this.svgIcons[url];
|
|
288
|
+
}
|
|
289
|
+
if (!options) {
|
|
290
|
+
options = {};
|
|
291
|
+
}
|
|
292
|
+
const uid = this.svgIcons[url] = lodash_1.default.uniqueId('media_selector_svg');
|
|
293
|
+
this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options);
|
|
294
|
+
return uid;
|
|
295
|
+
}
|
|
296
|
+
toggleLibrary() {
|
|
297
|
+
this.libraryDisplay = !this.libraryDisplay;
|
|
298
|
+
stratus_1.Stratus.Environment.trigger(this.eventID, 'toggleLibrary');
|
|
299
|
+
stratus_1.Stratus.Environment.trigger(`${this.eventID}:toggleLibrary`, this.libraryDisplay);
|
|
300
|
+
}
|
|
301
|
+
showDetails(model) {
|
|
302
|
+
stratus_1.Stratus.Environment.trigger(this.eventID, 'showDetails');
|
|
303
|
+
stratus_1.Stratus.Environment.trigger(`${this.eventID}:showDetails`, model);
|
|
304
|
+
}
|
|
305
|
+
deleteMedia(model) {
|
|
306
|
+
stratus_1.Stratus.Environment.trigger(this.eventID, 'deleteMedia');
|
|
307
|
+
stratus_1.Stratus.Environment.trigger(`${this.eventID}:deleteMedia`, model);
|
|
308
|
+
}
|
|
309
|
+
removeFromSelected(model) {
|
|
310
|
+
stratus_1.Stratus.Environment.trigger(this.eventID, 'removeFromSelected');
|
|
311
|
+
stratus_1.Stratus.Environment.trigger(`${this.eventID}:removeFromSelected`, model);
|
|
312
|
+
}
|
|
313
|
+
dragEntered(event) {
|
|
314
|
+
const models = this.dataRef();
|
|
315
|
+
if (!models || !models.length) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const drag = event.item;
|
|
319
|
+
const dropList = event.container;
|
|
320
|
+
const dragIndex = drag.data;
|
|
321
|
+
const dropIndex = dropList.data;
|
|
322
|
+
const placeholderContainer = dropList.element.nativeElement;
|
|
323
|
+
const placeholderElement = placeholderContainer.querySelector('.cdk-drag-placeholder');
|
|
324
|
+
placeholderContainer.removeChild(placeholderElement);
|
|
325
|
+
placeholderContainer.parentElement.insertBefore(placeholderElement, placeholderContainer);
|
|
326
|
+
if (environment_1.cookie('env')) {
|
|
327
|
+
console.log('media move:', dragIndex, '->', dropIndex);
|
|
328
|
+
}
|
|
329
|
+
drag_drop_1.moveItemInArray(models, dragIndex, dropIndex);
|
|
330
|
+
let priority = 0;
|
|
331
|
+
lodash_1.default.forEach(models, (model) => model.priority = priority++);
|
|
332
|
+
this.model.trigger('change');
|
|
333
|
+
}
|
|
334
|
+
move(event) {
|
|
335
|
+
const point = this.getPointerPositionOnPage(event.event);
|
|
336
|
+
if (lodash_1.default.isUndefined(this.listGroup) || !this.listGroup) {
|
|
337
|
+
console.warn('this.listGroup does not exist:', this);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
if (lodash_1.default.isUndefined(this.listGroup._items)) {
|
|
341
|
+
console.warn('this.listGroup._items does not exist:', this.listGroup);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
this.listGroup._items.forEach((dropList) => {
|
|
345
|
+
if (!__isInsideDropListClientRect(dropList, point.x, point.y)) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
this.activeContainer = dropList;
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
moveItemInGrid(collection) {
|
|
352
|
+
if (environment_1.cookie('env')) {
|
|
353
|
+
console.log('moveItemInGrid:', collection);
|
|
354
|
+
}
|
|
355
|
+
if (!this.targetList) {
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
const placeholderElement = this.placeholder.element.nativeElement;
|
|
359
|
+
const parentElement = placeholderElement.parentElement;
|
|
360
|
+
placeholderElement.style.display = 'none';
|
|
361
|
+
parentElement.removeChild(placeholderElement);
|
|
362
|
+
parentElement.appendChild(placeholderElement);
|
|
363
|
+
parentElement.insertBefore(this.sourceList.element.nativeElement, parentElement.children[this.sourceIndex]);
|
|
364
|
+
this.targetList = null;
|
|
365
|
+
this.sourceList = null;
|
|
366
|
+
if (this.sourceIndex === this.targetIndex) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
drag_drop_1.moveItemInArray(collection, this.sourceIndex, this.targetIndex);
|
|
370
|
+
return true;
|
|
371
|
+
}
|
|
372
|
+
getPointerPositionOnPage(event) {
|
|
373
|
+
const point = __isTouchEvent(event) ? (event.touches[0] || event.changedTouches[0]) : event;
|
|
374
|
+
const scrollPosition = this.viewportRuler.getViewportScrollPosition();
|
|
375
|
+
return {
|
|
376
|
+
x: point.pageX - scrollPosition.left,
|
|
377
|
+
y: point.pageY - scrollPosition.top
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
__decorate([
|
|
382
|
+
core_1.Input(),
|
|
383
|
+
__metadata("design:type", String)
|
|
384
|
+
], MediaSelectorComponent.prototype, "target", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
core_1.Input(),
|
|
387
|
+
__metadata("design:type", String)
|
|
388
|
+
], MediaSelectorComponent.prototype, "targetSuffix", void 0);
|
|
389
|
+
__decorate([
|
|
390
|
+
core_1.Input(),
|
|
391
|
+
__metadata("design:type", Number)
|
|
392
|
+
], MediaSelectorComponent.prototype, "id", void 0);
|
|
393
|
+
__decorate([
|
|
394
|
+
core_1.Input(),
|
|
395
|
+
__metadata("design:type", Boolean)
|
|
396
|
+
], MediaSelectorComponent.prototype, "manifest", void 0);
|
|
397
|
+
__decorate([
|
|
398
|
+
core_1.Input(),
|
|
399
|
+
__metadata("design:type", Boolean)
|
|
400
|
+
], MediaSelectorComponent.prototype, "decouple", void 0);
|
|
401
|
+
__decorate([
|
|
402
|
+
core_1.Input(),
|
|
403
|
+
__metadata("design:type", Boolean)
|
|
404
|
+
], MediaSelectorComponent.prototype, "direct", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
core_1.Input(),
|
|
407
|
+
__metadata("design:type", Object)
|
|
408
|
+
], MediaSelectorComponent.prototype, "api", void 0);
|
|
409
|
+
__decorate([
|
|
410
|
+
core_1.Input(),
|
|
411
|
+
__metadata("design:type", String)
|
|
412
|
+
], MediaSelectorComponent.prototype, "urlRoot", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
core_1.Input(),
|
|
415
|
+
__metadata("design:type", String)
|
|
416
|
+
], MediaSelectorComponent.prototype, "type", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
core_1.Input(),
|
|
419
|
+
__metadata("design:type", String)
|
|
420
|
+
], MediaSelectorComponent.prototype, "property", void 0);
|
|
421
|
+
__decorate([
|
|
422
|
+
core_1.Input(),
|
|
423
|
+
__metadata("design:type", String)
|
|
424
|
+
], MediaSelectorComponent.prototype, "endpoint", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
core_1.ViewChild(drag_drop_1.CdkDropListGroup),
|
|
427
|
+
__metadata("design:type", drag_drop_1.CdkDropListGroup)
|
|
428
|
+
], MediaSelectorComponent.prototype, "listGroup", void 0);
|
|
429
|
+
__decorate([
|
|
430
|
+
core_1.ViewChild(drag_drop_1.CdkDropList),
|
|
431
|
+
__metadata("design:type", drag_drop_1.CdkDropList)
|
|
432
|
+
], MediaSelectorComponent.prototype, "placeholder", void 0);
|
|
433
|
+
MediaSelectorComponent = __decorate([
|
|
434
|
+
core_1.Component({
|
|
435
|
+
selector: `sa-${moduleName}`,
|
|
436
|
+
templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
|
|
437
|
+
}),
|
|
438
|
+
__metadata("design:paramtypes", [icon_1.MatIconRegistry,
|
|
439
|
+
platform_browser_1.DomSanitizer,
|
|
440
|
+
core_1.ChangeDetectorRef,
|
|
441
|
+
core_1.ElementRef,
|
|
442
|
+
scrolling_1.ViewportRuler])
|
|
443
|
+
], MediaSelectorComponent);
|
|
444
|
+
exports_1("MediaSelectorComponent", MediaSelectorComponent);
|
|
326
445
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
getPointerPositionOnPage(event) {
|
|
331
|
-
const point = __isTouchEvent(event) ? (event.touches[0] || event.changedTouches[0]) : event;
|
|
332
|
-
const scrollPosition = this.viewportRuler.getViewportScrollPosition();
|
|
333
|
-
return {
|
|
334
|
-
x: point.pageX - scrollPosition.left,
|
|
335
|
-
y: point.pageY - scrollPosition.top
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
__decorate([
|
|
340
|
-
Input(),
|
|
341
|
-
__metadata("design:type", String)
|
|
342
|
-
], MediaSelectorComponent.prototype, "target", void 0);
|
|
343
|
-
__decorate([
|
|
344
|
-
Input(),
|
|
345
|
-
__metadata("design:type", String)
|
|
346
|
-
], MediaSelectorComponent.prototype, "targetSuffix", void 0);
|
|
347
|
-
__decorate([
|
|
348
|
-
Input(),
|
|
349
|
-
__metadata("design:type", Number)
|
|
350
|
-
], MediaSelectorComponent.prototype, "id", void 0);
|
|
351
|
-
__decorate([
|
|
352
|
-
Input(),
|
|
353
|
-
__metadata("design:type", Boolean)
|
|
354
|
-
], MediaSelectorComponent.prototype, "manifest", void 0);
|
|
355
|
-
__decorate([
|
|
356
|
-
Input(),
|
|
357
|
-
__metadata("design:type", Boolean)
|
|
358
|
-
], MediaSelectorComponent.prototype, "decouple", void 0);
|
|
359
|
-
__decorate([
|
|
360
|
-
Input(),
|
|
361
|
-
__metadata("design:type", Boolean)
|
|
362
|
-
], MediaSelectorComponent.prototype, "direct", void 0);
|
|
363
|
-
__decorate([
|
|
364
|
-
Input(),
|
|
365
|
-
__metadata("design:type", Object)
|
|
366
|
-
], MediaSelectorComponent.prototype, "api", void 0);
|
|
367
|
-
__decorate([
|
|
368
|
-
Input(),
|
|
369
|
-
__metadata("design:type", String)
|
|
370
|
-
], MediaSelectorComponent.prototype, "urlRoot", void 0);
|
|
371
|
-
__decorate([
|
|
372
|
-
Input(),
|
|
373
|
-
__metadata("design:type", String)
|
|
374
|
-
], MediaSelectorComponent.prototype, "type", void 0);
|
|
375
|
-
__decorate([
|
|
376
|
-
Input(),
|
|
377
|
-
__metadata("design:type", String)
|
|
378
|
-
], MediaSelectorComponent.prototype, "property", void 0);
|
|
379
|
-
__decorate([
|
|
380
|
-
Input(),
|
|
381
|
-
__metadata("design:type", String)
|
|
382
|
-
], MediaSelectorComponent.prototype, "endpoint", void 0);
|
|
383
|
-
__decorate([
|
|
384
|
-
ViewChild(CdkDropListGroup),
|
|
385
|
-
__metadata("design:type", CdkDropListGroup)
|
|
386
|
-
], MediaSelectorComponent.prototype, "listGroup", void 0);
|
|
387
|
-
__decorate([
|
|
388
|
-
ViewChild(CdkDropList),
|
|
389
|
-
__metadata("design:type", CdkDropList)
|
|
390
|
-
], MediaSelectorComponent.prototype, "placeholder", void 0);
|
|
391
|
-
MediaSelectorComponent = __decorate([
|
|
392
|
-
Component({
|
|
393
|
-
selector: `sa-${moduleName}`,
|
|
394
|
-
templateUrl: `${localDir}/${moduleName}/${moduleName}.component${min}.html`,
|
|
395
|
-
}),
|
|
396
|
-
__metadata("design:paramtypes", [MatIconRegistry,
|
|
397
|
-
DomSanitizer,
|
|
398
|
-
ChangeDetectorRef,
|
|
399
|
-
ElementRef,
|
|
400
|
-
ViewportRuler])
|
|
401
|
-
], MediaSelectorComponent);
|
|
402
|
-
export { MediaSelectorComponent };
|
|
403
|
-
function __indexOf(collection, node) {
|
|
404
|
-
return Array.prototype.indexOf.call(collection, node);
|
|
405
|
-
}
|
|
406
|
-
function __isTouchEvent(event) {
|
|
407
|
-
return event.type.startsWith('touch');
|
|
408
|
-
}
|
|
409
|
-
function __isInsideDropListClientRect(dropList, x, y) {
|
|
410
|
-
const { top, bottom, left, right } = dropList.element.nativeElement.getBoundingClientRect();
|
|
411
|
-
return y >= top && y <= bottom && x >= left && x <= right;
|
|
412
|
-
}
|
|
446
|
+
};
|
|
447
|
+
});
|
|
413
448
|
|
|
414
449
|
//# sourceMappingURL=media-selector.component.js.map
|