master
Igor Kulikov 6 years ago
parent 3abd19876c
commit 671b505b24

@ -1,8 +1,8 @@
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@angular/common')) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/common')) :
typeof define === 'function' && define.amd ? define('ngx-flowchart', ['exports', '@angular/core', 'rxjs', '@angular/common'], factory) : typeof define === 'function' && define.amd ? define('ngx-flowchart', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/common'], factory) :
(global = global || self, factory(global['ngx-flowchart'] = {}, global.ng.core, global.rxjs, global.ng.common)); (global = global || self, factory(global['ngx-flowchart'] = {}, global.ng.core, global.rxjs, global.rxjs.operators, global.ng.common));
}(this, (function (exports, core, rxjs, common) { 'use strict'; }(this, (function (exports, core, rxjs, operators, common) { 'use strict';
/*! ***************************************************************************** /*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved. Copyright (c) Microsoft Corporation. All rights reserved.
@ -548,11 +548,13 @@
*/ */
var FcModelService = /** @class */ (function () { var FcModelService = /** @class */ (function () {
function FcModelService(modelValidation, model, modelChanged, cd, selectedObjects, dropNode, createEdge, edgeAddedCallback, nodeRemovedCallback, edgeRemovedCallback, canvasHtmlElement, svgHtmlElement) { function FcModelService(modelValidation, model, modelChanged, cd, selectedObjects, dropNode, createEdge, edgeAddedCallback, nodeRemovedCallback, edgeRemovedCallback, canvasHtmlElement, svgHtmlElement) {
var _this = this;
this.connectorsHtmlElements = {}; this.connectorsHtmlElements = {};
this.nodesHtmlElements = {}; this.nodesHtmlElements = {};
this.canvasHtmlElement = null; this.canvasHtmlElement = null;
this.dragImage = null; this.dragImage = null;
this.svgHtmlElement = null; this.svgHtmlElement = null;
this.debouncer = new rxjs.Subject();
this.modelValidation = modelValidation; this.modelValidation = modelValidation;
this.model = model; this.model = model;
this.modelChanged = modelChanged; this.modelChanged = modelChanged;
@ -586,6 +588,12 @@
this.connectors = new ConnectorsModel(this); this.connectors = new ConnectorsModel(this);
this.nodes = new NodesModel(this); this.nodes = new NodesModel(this);
this.edges = new EdgesModel(this); this.edges = new EdgesModel(this);
this.debouncer
.pipe(operators.debounceTime(100))
.subscribe((/**
* @return {?}
*/
function () { return _this.modelChanged.emit(); }));
} }
/** /**
* @return {?} * @return {?}
@ -594,7 +602,7 @@
* @return {?} * @return {?}
*/ */
function () { function () {
this.modelChanged.emit(); this.debouncer.next();
}; };
/** /**
* @return {?} * @return {?}
@ -985,8 +993,16 @@
FcModelService.prototype.edgeRemovedCallback; FcModelService.prototype.edgeRemovedCallback;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.dropTargetId; FcModelService.prototype.dropTargetId;
/** @type {?} */ /**
* @type {?}
* @private
*/
FcModelService.prototype.modelChanged; FcModelService.prototype.modelChanged;
/**
* @type {?}
* @private
*/
FcModelService.prototype.debouncer;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.connectors; FcModelService.prototype.connectors;
/** @type {?} */ /** @type {?} */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,5 +1,6 @@
import { InjectionToken, Injectable, EventEmitter, Component, ChangeDetectionStrategy, ElementRef, IterableDiffers, ChangeDetectorRef, NgZone, HostBinding, Input, Output, HostListener, Directive, Inject, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule } from '@angular/core'; import { InjectionToken, Injectable, EventEmitter, Component, ChangeDetectionStrategy, ElementRef, IterableDiffers, ChangeDetectorRef, NgZone, HostBinding, Input, Output, HostListener, Directive, Inject, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule } from '@angular/core';
import { of } from 'rxjs'; import { Subject, of } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
/** /**
@ -346,6 +347,7 @@ class FcModelService {
this.canvasHtmlElement = null; this.canvasHtmlElement = null;
this.dragImage = null; this.dragImage = null;
this.svgHtmlElement = null; this.svgHtmlElement = null;
this.debouncer = new Subject();
this.modelValidation = modelValidation; this.modelValidation = modelValidation;
this.model = model; this.model = model;
this.modelChanged = modelChanged; this.modelChanged = modelChanged;
@ -379,12 +381,18 @@ class FcModelService {
this.connectors = new ConnectorsModel(this); this.connectors = new ConnectorsModel(this);
this.nodes = new NodesModel(this); this.nodes = new NodesModel(this);
this.edges = new EdgesModel(this); this.edges = new EdgesModel(this);
this.debouncer
.pipe(debounceTime(100))
.subscribe((/**
* @return {?}
*/
() => this.modelChanged.emit()));
} }
/** /**
* @return {?} * @return {?}
*/ */
notifyModelChanged() { notifyModelChanged() {
this.modelChanged.emit(); this.debouncer.next();
} }
/** /**
* @return {?} * @return {?}
@ -686,8 +694,16 @@ if (false) {
FcModelService.prototype.edgeRemovedCallback; FcModelService.prototype.edgeRemovedCallback;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.dropTargetId; FcModelService.prototype.dropTargetId;
/** @type {?} */ /**
* @type {?}
* @private
*/
FcModelService.prototype.modelChanged; FcModelService.prototype.modelChanged;
/**
* @type {?}
* @private
*/
FcModelService.prototype.debouncer;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.connectors; FcModelService.prototype.connectors;
/** @type {?} */ /** @type {?} */

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
import { __extends, __values, __assign } from 'tslib'; import { __extends, __values, __assign } from 'tslib';
import { InjectionToken, Injectable, EventEmitter, Component, ChangeDetectionStrategy, ElementRef, IterableDiffers, ChangeDetectorRef, NgZone, HostBinding, Input, Output, HostListener, Directive, Inject, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule } from '@angular/core'; import { InjectionToken, Injectable, EventEmitter, Component, ChangeDetectionStrategy, ElementRef, IterableDiffers, ChangeDetectorRef, NgZone, HostBinding, Input, Output, HostListener, Directive, Inject, ComponentFactoryResolver, ViewChild, ViewContainerRef, NgModule } from '@angular/core';
import { of } from 'rxjs'; import { Subject, of } from 'rxjs';
import { debounceTime } from 'rxjs/operators';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
/** /**
@ -350,11 +351,13 @@ function fcTopSort(graph) {
*/ */
var FcModelService = /** @class */ (function () { var FcModelService = /** @class */ (function () {
function FcModelService(modelValidation, model, modelChanged, cd, selectedObjects, dropNode, createEdge, edgeAddedCallback, nodeRemovedCallback, edgeRemovedCallback, canvasHtmlElement, svgHtmlElement) { function FcModelService(modelValidation, model, modelChanged, cd, selectedObjects, dropNode, createEdge, edgeAddedCallback, nodeRemovedCallback, edgeRemovedCallback, canvasHtmlElement, svgHtmlElement) {
var _this = this;
this.connectorsHtmlElements = {}; this.connectorsHtmlElements = {};
this.nodesHtmlElements = {}; this.nodesHtmlElements = {};
this.canvasHtmlElement = null; this.canvasHtmlElement = null;
this.dragImage = null; this.dragImage = null;
this.svgHtmlElement = null; this.svgHtmlElement = null;
this.debouncer = new Subject();
this.modelValidation = modelValidation; this.modelValidation = modelValidation;
this.model = model; this.model = model;
this.modelChanged = modelChanged; this.modelChanged = modelChanged;
@ -388,6 +391,12 @@ var FcModelService = /** @class */ (function () {
this.connectors = new ConnectorsModel(this); this.connectors = new ConnectorsModel(this);
this.nodes = new NodesModel(this); this.nodes = new NodesModel(this);
this.edges = new EdgesModel(this); this.edges = new EdgesModel(this);
this.debouncer
.pipe(debounceTime(100))
.subscribe((/**
* @return {?}
*/
function () { return _this.modelChanged.emit(); }));
} }
/** /**
* @return {?} * @return {?}
@ -396,7 +405,7 @@ var FcModelService = /** @class */ (function () {
* @return {?} * @return {?}
*/ */
function () { function () {
this.modelChanged.emit(); this.debouncer.next();
}; };
/** /**
* @return {?} * @return {?}
@ -787,8 +796,16 @@ if (false) {
FcModelService.prototype.edgeRemovedCallback; FcModelService.prototype.edgeRemovedCallback;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.dropTargetId; FcModelService.prototype.dropTargetId;
/** @type {?} */ /**
* @type {?}
* @private
*/
FcModelService.prototype.modelChanged; FcModelService.prototype.modelChanged;
/**
* @type {?}
* @private
*/
FcModelService.prototype.debouncer;
/** @type {?} */ /** @type {?} */
FcModelService.prototype.connectors; FcModelService.prototype.connectors;
/** @type {?} */ /** @type {?} */

File diff suppressed because one or more lines are too long

@ -18,7 +18,8 @@ export declare class FcModelService {
nodeRemovedCallback: (node: FcNode) => void; nodeRemovedCallback: (node: FcNode) => void;
edgeRemovedCallback: (edge: FcEdge) => void; edgeRemovedCallback: (edge: FcEdge) => void;
dropTargetId: string; dropTargetId: string;
modelChanged: EventEmitter<any>; private readonly modelChanged;
private readonly debouncer;
connectors: ConnectorsModel; connectors: ConnectorsModel;
nodes: NodesModel; nodes: NodesModel;
edges: EdgesModel; edges: EdgesModel;

Loading…
Cancel
Save