From 11072c92de3aec370e93c21134621ac993f601bc Mon Sep 17 00:00:00 2001 From: Ahmed Abbas Date: Mon, 6 Jan 2020 17:52:39 +0200 Subject: designer client screen functionality: - insert action into main board - drag function from palette and drop over an action - prevent drag function outside action - insert multiple actions into the board Issue-ID: CCSDK-2017 Issue-ID: CCSDK-1783 Signed-off-by: Ahmed Abbas Change-Id: Id7528404ba70ca05561127c22e8bf4d27766bb91 --- .../designer/jointjs/elements/action.element.ts | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/jointjs/elements/action.element.ts (limited to 'cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/jointjs/elements/action.element.ts') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/jointjs/elements/action.element.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/jointjs/elements/action.element.ts new file mode 100644 index 000000000..212905814 --- /dev/null +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/jointjs/elements/action.element.ts @@ -0,0 +1,64 @@ +import * as joint from 'jointjs'; +/** + * please refer to documentation in file palette.function.element.ts to get more details + * about how to create new element type and define it in typescript + */ + +declare module 'jointjs' { + namespace shapes { + // add new module called "app" under the already existing "shapes" modeule inside jointjs + export namespace app { + class ActionElement extends joint.shapes.standard.Rectangle { + } + } + } +} + +const rectWidth = 616; +const rectHeight = 381; +// custom element implementation +// https://resources.jointjs.com/tutorials/joint/tutorials/custom-elements.html#markup +const ActionElement = joint.shapes.standard.Rectangle.define('app.ActionElement', { + size: {width: rectWidth, height: rectHeight} +}, + { + markup: + ` + + + + + + + + + + + + + + + + + + + + Action 1 + + + + + ` +}); + +Object.assign(joint.shapes, { + app: { + ActionElement + } +}); -- cgit 1.2.3-korg