本地logicflow依赖包
This commit is contained in:
1 parent
8ff82208ad
commit
30f225df00
290 files changed
+18624
-16276
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { CircleNode, CircleNodeModel } from '@logicflow/core';
|
||||
declare class EndEventModel extends CircleNodeModel {
|
||||
static extendKey: string;
|
||||
constructor(data: any, graphModel: any);
|
||||
setAttributes(): void;
|
||||
getConnectedSourceRules(): import("@logicflow/core").ConnectRule[];
|
||||
}
|
||||
declare class EndEventView extends CircleNode {
|
||||
static extendKey: string;
|
||||
getAnchorStyle(): {
|
||||
visibility: string;
|
||||
};
|
||||
getShape(): import("preact").VNode<any>;
|
||||
}
|
||||
declare const EndEvent: {
|
||||
type: string;
|
||||
view: typeof EndEventView;
|
||||
model: typeof EndEventModel;
|
||||
};
|
||||
export { EndEventView, EndEventModel };
|
||||
export default EndEvent;
|
||||
@@ -0,0 +1,88 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
import { CircleNode, CircleNodeModel, h } from '@logicflow/core';
|
||||
import { getBpmnId } from '../getBpmnId';
|
||||
var EndEventModel = /** @class */ (function (_super) {
|
||||
__extends(EndEventModel, _super);
|
||||
function EndEventModel(data, graphModel) {
|
||||
var _this = this;
|
||||
if (!data.id) {
|
||||
data.id = "Event_" + getBpmnId();
|
||||
}
|
||||
if (!data.text) {
|
||||
data.text = '';
|
||||
}
|
||||
if (data.text && typeof data.text === 'string') {
|
||||
data.text = {
|
||||
value: data.text,
|
||||
x: data.x,
|
||||
y: data.y + 40,
|
||||
};
|
||||
}
|
||||
_this = _super.call(this, data, graphModel) || this;
|
||||
return _this;
|
||||
}
|
||||
EndEventModel.prototype.setAttributes = function () {
|
||||
this.r = 18;
|
||||
};
|
||||
EndEventModel.prototype.getConnectedSourceRules = function () {
|
||||
var rules = _super.prototype.getConnectedSourceRules.call(this);
|
||||
var notAsSource = {
|
||||
message: '结束节点不能作为边的起点',
|
||||
validate: function () { return false; },
|
||||
};
|
||||
rules.push(notAsSource);
|
||||
return rules;
|
||||
};
|
||||
EndEventModel.extendKey = 'EndEventModel';
|
||||
return EndEventModel;
|
||||
}(CircleNodeModel));
|
||||
var EndEventView = /** @class */ (function (_super) {
|
||||
__extends(EndEventView, _super);
|
||||
function EndEventView() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
EndEventView.prototype.getAnchorStyle = function () {
|
||||
return {
|
||||
visibility: 'hidden',
|
||||
};
|
||||
};
|
||||
EndEventView.prototype.getShape = function () {
|
||||
var model = this.props.model;
|
||||
var style = model.getNodeStyle();
|
||||
var x = model.x, y = model.y, r = model.r;
|
||||
var outCircle = _super.prototype.getShape.call(this);
|
||||
return h('g', {}, outCircle, h('circle', __assign(__assign({}, style), { cx: x, cy: y, r: r - 5 })));
|
||||
};
|
||||
EndEventView.extendKey = 'EndEventView';
|
||||
return EndEventView;
|
||||
}(CircleNode));
|
||||
var EndEvent = {
|
||||
type: 'bpmn:endEvent',
|
||||
view: EndEventView,
|
||||
model: EndEventModel,
|
||||
};
|
||||
export { EndEventView, EndEventModel };
|
||||
export default EndEvent;
|
||||
@@ -0,0 +1,17 @@
|
||||
import { CircleNode, CircleNodeModel } from '@logicflow/core';
|
||||
declare class StartEventModel extends CircleNodeModel {
|
||||
static extendKey: string;
|
||||
constructor(data: any, graphModel: any);
|
||||
setAttributes(): void;
|
||||
getConnectedTargetRules(): import("@logicflow/core").ConnectRule[];
|
||||
}
|
||||
declare class StartEventView extends CircleNode {
|
||||
static extendKey: string;
|
||||
}
|
||||
declare const StartEvent: {
|
||||
type: string;
|
||||
view: typeof StartEventView;
|
||||
model: typeof StartEventModel;
|
||||
};
|
||||
export { StartEventModel, StartEventView };
|
||||
export default StartEvent;
|
||||
@@ -0,0 +1,67 @@
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
import { CircleNode, CircleNodeModel } from '@logicflow/core';
|
||||
import { getBpmnId } from '../getBpmnId';
|
||||
var StartEventModel = /** @class */ (function (_super) {
|
||||
__extends(StartEventModel, _super);
|
||||
function StartEventModel(data, graphModel) {
|
||||
var _this = this;
|
||||
if (!data.id) {
|
||||
data.id = "Event_" + getBpmnId();
|
||||
}
|
||||
if (!data.text) {
|
||||
data.text = '';
|
||||
}
|
||||
if (data.text && typeof data.text === 'string') {
|
||||
data.text = {
|
||||
value: data.text,
|
||||
x: data.x,
|
||||
y: data.y + 40,
|
||||
};
|
||||
}
|
||||
// fix: 不能直接全部加,会导致下载后再次上传,位置错误。
|
||||
// data.text.y += 40;
|
||||
_this = _super.call(this, data, graphModel) || this;
|
||||
return _this;
|
||||
}
|
||||
StartEventModel.prototype.setAttributes = function () {
|
||||
this.r = 18;
|
||||
};
|
||||
StartEventModel.prototype.getConnectedTargetRules = function () {
|
||||
var rules = _super.prototype.getConnectedTargetRules.call(this);
|
||||
var notAsTarget = {
|
||||
message: '起始节点不能作为边的终点',
|
||||
validate: function () { return false; },
|
||||
};
|
||||
rules.push(notAsTarget);
|
||||
return rules;
|
||||
};
|
||||
StartEventModel.extendKey = 'StartEventModel';
|
||||
return StartEventModel;
|
||||
}(CircleNodeModel));
|
||||
var StartEventView = /** @class */ (function (_super) {
|
||||
__extends(StartEventView, _super);
|
||||
function StartEventView() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
StartEventView.extendKey = 'StartEventNode';
|
||||
return StartEventView;
|
||||
}(CircleNode));
|
||||
var StartEvent = {
|
||||
type: 'bpmn:startEvent',
|
||||
view: StartEventView,
|
||||
model: StartEventModel,
|
||||
};
|
||||
export { StartEventModel, StartEventView };
|
||||
export default StartEvent;
|
||||
Reference in new issue
Block a user