@stratusjs/angular 0.5.5 → 0.5.6

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.
@@ -1,6 +1,6 @@
1
1
  System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/environment', '@stratusjs/angularjs/services/model', '@stratusjs/angularjs/services/registry', '@stratusjs/core/events/eventManager', 'html2pdf', 'font-awesome', 'froala-plugins', 'froala-embedly', 'froala-font-awesome', 'froala-image-tui', 'froala-editor', '@stratusjs/core/misc', '@stratusjs/core/datastore/xhr', '@stratusjs/angularjs/services/collection', '@agentepsilon/decko', 'zone.js/dist/zone'], (function (exports) {
2
2
  'use strict';
3
- var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, isNil, includes, set, isObject$2, assignIn, cookie, Model, Registry, EventManager$1, FroalaEditor, isJSON, XHR, Collection, debounce$1;
3
+ var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, debounce$1, isNumber, isBoolean, isArray$1, isFunction$1, isNil, includes, set, isObject$2, assignIn, cookie, Model, Registry, EventManager$1, FroalaEditor, safeUniqueId, isJSON, XHR, Collection, debounce$2;
4
4
  return {
5
5
  setters: [function (module) {
6
6
  Stratus = module.Stratus;
@@ -13,6 +13,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
13
13
  isUndefined = module.isUndefined;
14
14
  isString = module.isString;
15
15
  extend$1 = module.extend;
16
+ debounce$1 = module.debounce;
17
+ isNumber = module.isNumber;
18
+ isBoolean = module.isBoolean;
19
+ isArray$1 = module.isArray;
20
+ isFunction$1 = module.isFunction;
16
21
  isNil = module.isNil;
17
22
  includes = module.includes;
18
23
  set = module.set;
@@ -29,13 +34,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
29
34
  }, function () {}, function () {}, function () {}, function () {}, function () {}, function () {}, function (module) {
30
35
  FroalaEditor = module["default"];
31
36
  }, function (module) {
37
+ safeUniqueId = module.safeUniqueId;
32
38
  isJSON = module.isJSON;
33
39
  }, function (module) {
34
40
  XHR = module.XHR;
35
41
  }, function (module) {
36
42
  Collection = module.Collection;
37
43
  }, function (module) {
38
- debounce$1 = module.debounce;
44
+ debounce$2 = module.debounce;
39
45
  }, function () {}],
40
46
  execute: (function () {
41
47
 
@@ -79358,8 +79364,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79358
79364
  this.elementRef = elementRef;
79359
79365
  this.fb = fb;
79360
79366
  this.dialog = dialog;
79361
- this.title = moduleName$8 + '_component';
79367
+ this.title = `${moduleName$8}_component`;
79362
79368
  this.dev = !!cookie('env');
79369
+ this.debug = !!cookie(`debug_${moduleName$8}`);
79363
79370
  this.editor = 'froala';
79364
79371
  this._ = _;
79365
79372
  this.has = has$2;
@@ -79376,16 +79383,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79376
79383
  dataString: new FormControl(),
79377
79384
  });
79378
79385
  this.dataChangeLog = [];
79379
- this.dataString = '';
79386
+ this.incomingData = '';
79387
+ this.outgoingData = '';
79380
79388
  this.debounceSave = true;
79381
79389
  this.debounceTime = 5000;
79382
- this.forceSave = true;
79383
- this.froalaButtons = [
79384
- 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|', 'formatBlock',
79385
- 'blockStyle', 'inlineStyle', 'paragraphStyle', 'paragraphFormat', 'align', 'formatOL',
79386
- 'formatUL', 'outdent', 'indent', '|', 'insertLink', 'insertImage', 'insertVideo', 'insertFile',
79387
- 'insertTable', '|', 'undo', 'redo', 'removeFormat', 'wordPaste', 'help', 'html', 'fullscreen'
79388
- ];
79390
+ this.forceSave = false;
79389
79391
  this.froalaStandardButtons = {
79390
79392
  moreText: [
79391
79393
  'bold',
@@ -79444,6 +79446,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79444
79446
  initialized: (froalaEditorDirective) => {
79445
79447
  this.froalaEditorDirective = froalaEditorDirective;
79446
79448
  },
79449
+ blur: (event) => this.onBlur(event),
79450
+ focus: (event) => this.onFocus(event),
79447
79451
  },
79448
79452
  codeBeautifierOptions: {
79449
79453
  end_with_newline: true,
@@ -79872,7 +79876,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79872
79876
  this.styled = true;
79873
79877
  this.refresh();
79874
79878
  });
79875
- this.hydrate(elementRef, sanitizer, ["title", "uid", "dev", "debug", "editor", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "property", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "initialized", "styled", "blurred", "focused", "codeViewIsOpen", "form", "dataChangeLog", "dataString", "debounceSave", "debounceTime", "forceSave", "froalaEditorDirective", "froalaButtons", "froalaStandardButtons", "froalaConfig", "sanitizer", "ref", "elementRef", "fb", "dialog", "ngOnInit", "modelSave", "listDuplicates", "normalizeIn", "normalizeOut", "changeImgSize", "handleError", "fetchData", "dataDefer", "dataRef", "onDataChange", "created", "changedEditor", "onChangeEvent", "onFocus", "onBlur", "bypassHTML", "trigger", "openCitationDialog", "openLinkDialog", "openMediaDialog", "openCodeViewDialog", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
79879
+ this.hydrate(elementRef, sanitizer, ["title", "uid", "dev", "debug", "editor", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "property", "_", "has", "log", "Stratus", "registry", "fetched", "data", "collection", "model", "dataSub", "onChange", "subscriber", "svgIcons", "initialized", "styled", "blurred", "focused", "codeViewIsOpen", "form", "dataChangeLog", "incomingData", "outgoingData", "debounceSave", "debounceTime", "forceSave", "froalaEditorDirective", "froalaStandardButtons", "froalaConfig", "sanitizer", "ref", "elementRef", "fb", "dialog", "ngOnInit", "modelSave", "listDuplicates", "normalizeIn", "normalizeOut", "changeImgSize", "handleError", "fetchData", "dataDefer", "dataRef", "onDataChange", "created", "changedEditor", "onChangeEvent", "onFocus", "onBlur", "bypassHTML", "trigger", "openCitationDialog", "openLinkDialog", "openMediaDialog", "openCodeViewDialog", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
79876
79880
  this.fetchData()
79877
79881
  .then(data => {
79878
79882
  if (!data || !(data instanceof EventManager$1)) {
@@ -79927,6 +79931,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79927
79931
  this.model.changedExternal = true;
79928
79932
  this.model.trigger('change');
79929
79933
  });
79934
+ dataControl.valueChanges.forEach((value) => this.outgoingData = value);
79930
79935
  }
79931
79936
  else {
79932
79937
  dataControl.valueChanges.forEach((value) => this.modelSave(value));
@@ -79948,7 +79953,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
79948
79953
  innerHTML = this.froalaEditorDirective.getEditor().el.innerHTML;
79949
79954
  }
79950
79955
  this.model.set(this.property, this.normalizeOut(innerHTML || value));
79951
- this.model.changedExternal = false;
79956
+ if (this.debounceSave) {
79957
+ this.model.changedExternal = false;
79958
+ }
79952
79959
  if (this.forceSave && !_.isEmpty(this.model.getIdentifier())) {
79953
79960
  this.model.save();
79954
79961
  }
@@ -80041,7 +80048,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80041
80048
  }, 250);
80042
80049
  return;
80043
80050
  }
80044
- const prevString = _.clone(this.dataString);
80051
+ const prevString = _.clone(this.incomingData);
80045
80052
  const dataString = this.dataRef();
80046
80053
  if (prevString === dataString) {
80047
80054
  return;
@@ -80072,7 +80079,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80072
80079
  if (!this.model) {
80073
80080
  return '';
80074
80081
  }
80075
- return this.dataString = this.normalizeIn(this.model.get(this.property));
80082
+ return this.incomingData = this.normalizeIn(this.model.get(this.property));
80076
80083
  }
80077
80084
  onDataChange() {
80078
80085
  this.dataDefer(this.subscriber);
@@ -80083,16 +80090,26 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80083
80090
  changedEditor(event) {
80084
80091
  console.log('editor-change:', event);
80085
80092
  }
80086
- onChangeEvent($event) {
80087
- console.log('change:', $event);
80093
+ onChangeEvent(event) {
80094
+ console.log('change:', event);
80088
80095
  }
80089
- onFocus($event) {
80096
+ onFocus(event) {
80097
+ if (this.dev && this.debug) {
80098
+ console.warn(`[onFocus] triggered on ${this.uid}`);
80099
+ }
80090
80100
  this.focused = true;
80091
80101
  this.blurred = false;
80092
80102
  }
80093
- onBlur($event) {
80103
+ onBlur(event) {
80104
+ if (this.dev && this.debug) {
80105
+ console.warn(`[onBlur] triggered on ${this.uid}`);
80106
+ }
80094
80107
  this.focused = false;
80095
80108
  this.blurred = true;
80109
+ if (!this.debounceSave) {
80110
+ return;
80111
+ }
80112
+ this.modelSave(this.outgoingData);
80096
80113
  }
80097
80114
  bypassHTML(html) {
80098
80115
  return this.sanitizer.bypassSecurityTrustHtml(html);
@@ -117814,7 +117831,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117814
117831
  };
117815
117832
  this.storedMarkers = [];
117816
117833
  this.highestMarkerZIndex = 0;
117817
- this.uid = _.uniqueId(`sa_${_.snakeCase(moduleName$5)}_component_`);
117834
+ this.uid = safeUniqueId('sa', moduleName$5, 'component');
117818
117835
  Stratus.Instances[this.uid] = this;
117819
117836
  Stratus.Internals.CssLoader(`${localDir$9}/${moduleName$5}.component.css`)
117820
117837
  .then(() => {
@@ -117827,7 +117844,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117827
117844
  this.hydrate(this.elementRef, this.sanitizer, ["gMap", "map", "info", "title", "uid", "initializing", "initialized", "styled", "watcher", "height", "width", "referenceParent", "fullHeight", "fullHeightMinusElements", "fullHeightMinusElementNames", "googleMapsKey", "markers", "callback", "zoom", "mapType", "zoomControl", "scrollwheel", "disableDoubleClickZoom", "center", "defaultIcon", "defaultIconHover", "defaultIconLabelOriginX", "defaultIconLabelOriginY", "options", "storedMarkers", "highestMarkerZIndex", "resizeDebounce", "fitMarkerBoundsDebounce", "Differ", "window", "sanitizer", "elementRef", "ngDoCheck", "ngOnInit", "ngAfterViewInit", "onResize", "resize", "getWindowSize", "getDocumentSize", "getElementSize", "getParentSize", "updateWidgetSize", "fitMarkerBounds", "decodeHTML", "processOptions", "processProvidedMarkersPath", "processProvidedCallback", "getMarkerBounds", "fitBounds", "initGoogleMapsApi", "getCurrentPosition", "centerAtPosition", "panToPosition", "getHighestMarkerZIndex", "addMarker", "removeMarkers", "googleMaps", "mapClick", "openMarkerInfo", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
117828
117845
  this.processOptions();
117829
117846
  this.updateWidgetSize();
117830
- if (_.isEmpty(this.googleMapsKey)) {
117847
+ if (isEmpty(this.googleMapsKey)) {
117831
117848
  this.googleMapsKey = devGoogleMapsKey;
117832
117849
  }
117833
117850
  if (this.googleMapsKey === devGoogleMapsKey) {
@@ -117868,14 +117885,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117868
117885
  }
117869
117886
  onResize() {
117870
117887
  if (!this.resizeDebounce) {
117871
- this.resizeDebounce = _.debounce(this.resize.bind(this), 150, { leading: false, trailing: true, maxWait: 1500 });
117888
+ this.resizeDebounce = debounce$1(this.resize.bind(this), 150, { leading: false, trailing: true, maxWait: 1500 });
117872
117889
  }
117873
117890
  this.resizeDebounce();
117874
117891
  }
117875
117892
  resize() {
117876
117893
  this.updateWidgetSize();
117877
117894
  if (!this.fitMarkerBoundsDebounce) {
117878
- this.fitMarkerBoundsDebounce = _.debounce(this.fitMarkerBounds.bind(this), 300, { leading: false, trailing: true });
117895
+ this.fitMarkerBoundsDebounce = debounce$1(this.fitMarkerBounds.bind(this), 300, { leading: false, trailing: true });
117879
117896
  }
117880
117897
  this.fitMarkerBoundsDebounce();
117881
117898
  }
@@ -117943,29 +117960,29 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117943
117960
  return txt.value;
117944
117961
  }
117945
117962
  processOptions() {
117946
- if (!_.isNumber(this.zoom)) {
117963
+ if (!isNumber(this.zoom)) {
117947
117964
  this.zoom = Number.parseInt(this.zoom, 10);
117948
117965
  }
117949
- if (_.isString(this.defaultIconLabelOriginX) &&
117966
+ if (isString(this.defaultIconLabelOriginX) &&
117950
117967
  !isNaN(parseFloat(this.defaultIconLabelOriginX)) &&
117951
117968
  isFinite(this.defaultIconLabelOriginX)) {
117952
117969
  this.defaultIconLabelOriginX = Number.parseInt(this.defaultIconLabelOriginX, 10);
117953
117970
  }
117954
- if (_.isString(this.defaultIconLabelOriginY) &&
117971
+ if (isString(this.defaultIconLabelOriginY) &&
117955
117972
  !isNaN(parseFloat(this.defaultIconLabelOriginY)) &&
117956
117973
  isFinite(this.defaultIconLabelOriginY)) {
117957
117974
  this.defaultIconLabelOriginY = Number.parseInt(this.defaultIconLabelOriginY, 10);
117958
117975
  }
117959
- if (!_.isBoolean(this.zoomControl)) {
117976
+ if (!isBoolean(this.zoomControl)) {
117960
117977
  this.zoomControl = (this.zoomControl === 'true');
117961
117978
  }
117962
- if (!_.isBoolean(this.scrollwheel)) {
117979
+ if (!isBoolean(this.scrollwheel)) {
117963
117980
  this.scrollwheel = (this.scrollwheel === 'true');
117964
117981
  }
117965
- if (!_.isBoolean(this.disableDoubleClickZoom)) {
117982
+ if (!isBoolean(this.disableDoubleClickZoom)) {
117966
117983
  this.disableDoubleClickZoom = (this.disableDoubleClickZoom === 'true');
117967
117984
  }
117968
- if (!_.isBoolean(this.fullHeight)) {
117985
+ if (!isBoolean(this.fullHeight)) {
117969
117986
  this.fullHeight = (this.fullHeight === 'true');
117970
117987
  }
117971
117988
  this.options = {
@@ -117981,15 +117998,15 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117981
117998
  }
117982
117999
  const fullHeightMinusElementNames = this.fullHeightMinusElements && isJSON(this.fullHeightMinusElements) ?
117983
118000
  JSON.parse(this.fullHeightMinusElements) : null;
117984
- if (_.isArray(fullHeightMinusElementNames)) {
118001
+ if (isArray$1(fullHeightMinusElementNames)) {
117985
118002
  this.fullHeight = true;
117986
118003
  this.fullHeightMinusElementNames = fullHeightMinusElementNames;
117987
118004
  }
117988
118005
  }
117989
118006
  processProvidedMarkersPath() {
117990
- if (_.isString(this.markers)) {
118007
+ if (isString(this.markers)) {
117991
118008
  this.watcher.watch(this.window, this.markers, (newValue) => {
117992
- if (_.isArray(newValue)) {
118009
+ if (isArray$1(newValue)) {
117993
118010
  this.removeMarkers();
117994
118011
  newValue.forEach((mark) => {
117995
118012
  this.addMarker(mark);
@@ -117998,7 +118015,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
117998
118015
  }
117999
118016
  });
118000
118017
  }
118001
- else if (_.isArray(this.markers)) {
118018
+ else if (isArray$1(this.markers)) {
118002
118019
  this.markers.forEach((mark) => {
118003
118020
  this.addMarker(mark);
118004
118021
  });
@@ -118006,10 +118023,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
118006
118023
  }
118007
118024
  }
118008
118025
  processProvidedCallback() {
118009
- if (_.isString(this.callback)) {
118026
+ if (isString(this.callback)) {
118010
118027
  this.callback = this.watcher.getFromPath(window, this.callback);
118011
118028
  }
118012
- if (_.isFunction(this.callback)) {
118029
+ if (isFunction$1(this.callback)) {
118013
118030
  this.callback(this);
118014
118031
  }
118015
118032
  }
@@ -118098,9 +118115,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
118098
118115
  }
118099
118116
  else {
118100
118117
  marker.icon = marker.icon || this.defaultIcon;
118101
- if (_.isString(marker.icon) &&
118102
- _.isNumber(this.defaultIconLabelOriginX) &&
118103
- _.isNumber(this.defaultIconLabelOriginY)) {
118118
+ if (isString(marker.icon) &&
118119
+ isNumber(this.defaultIconLabelOriginX) &&
118120
+ isNumber(this.defaultIconLabelOriginY)) {
118104
118121
  marker.icon = {
118105
118122
  url: marker.icon,
118106
118123
  labelOrigin: new google.maps.Point(this.defaultIconLabelOriginX, this.defaultIconLabelOriginY)
@@ -118112,9 +118129,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
118112
118129
  }
118113
118130
  marker.iconHover = marker.iconHover || this.defaultIconHover;
118114
118131
  if (marker.iconHover) {
118115
- if (_.isString(marker.iconHover) &&
118116
- _.isNumber(this.defaultIconLabelOriginX) &&
118117
- _.isNumber(this.defaultIconLabelOriginY)) {
118132
+ if (isString(marker.iconHover) &&
118133
+ isNumber(this.defaultIconLabelOriginX) &&
118134
+ isNumber(this.defaultIconLabelOriginY)) {
118118
118135
  marker.iconHover = {
118119
118136
  url: marker.iconHover,
118120
118137
  labelOrigin: new google.maps.Point(this.defaultIconLabelOriginX, this.defaultIconLabelOriginY)
@@ -118152,7 +118169,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
118152
118169
  }
118153
118170
  mapClick(marker, markerSetting) {
118154
118171
  let clickOptions = markerSetting.click || { action: '' };
118155
- if (_.isFunction(clickOptions)) {
118172
+ if (isFunction$1(clickOptions)) {
118156
118173
  clickOptions = {
118157
118174
  action: 'function',
118158
118175
  function: clickOptions
@@ -120475,7 +120492,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
120475
120492
  __metadata$3("design:type", String)
120476
120493
  ], TreeComponent.prototype, "property", void 0);
120477
120494
  __decorate$3([
120478
- debounce$1(50),
120495
+ debounce$2(50),
120479
120496
  __metadata$3("design:type", Function),
120480
120497
  __metadata$3("design:paramtypes", [Object]),
120481
120498
  __metadata$3("design:returntype", void 0)