basicprimitivesreact
Advanced tools
Comparing version 5.4.13 to 5.4.14
@@ -1,72 +0,24 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _react = _interopRequireWildcard(require("react")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _Graphics = _interopRequireDefault(require("./Graphics")); | ||
var _Templates = require("./Templates"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var BaseDiagram = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(BaseDiagram, _Component); | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
import './Diagrams.css'; | ||
import Graphics from './Graphics'; | ||
import { AnnotationLabelTemplate, ButtonsTemplate, CheckBoxTemplate, CursorTemplate, DotHighlightTemplate, GroupTitleTemplate, HighlightTemplate, ItemTemplate, UserTemplate, LabelAnnotationTemplate } from './Templates'; | ||
function BaseDiagram(props, namespace) { | ||
var _this; | ||
_classCallCheck(this, BaseDiagram); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(BaseDiagram).call(this, props)); | ||
_this.namespace = namespace; | ||
var config = props.config, | ||
centerOnCursor = props.centerOnCursor; | ||
var highlightItem = config.highlightItem, | ||
cursorItem = config.cursorItem, | ||
selectedItems = config.selectedItems; | ||
_this.state = { | ||
class BaseDiagram extends Component { | ||
constructor(props, namespace) { | ||
super(props); | ||
this.namespace = namespace; | ||
const { | ||
config, | ||
centerOnCursor | ||
} = props; | ||
const { | ||
highlightItem, | ||
cursorItem, | ||
selectedItems | ||
} = config; | ||
this.state = { | ||
viewportSize: { | ||
@@ -80,160 +32,161 @@ width: 0, | ||
}, | ||
centerOnCursor: centerOnCursor, | ||
highlightItem: highlightItem, | ||
cursorItem: cursorItem, | ||
centerOnCursor, | ||
highlightItem, | ||
cursorItem, | ||
selectedItems: (selectedItems || []).slice() | ||
}; | ||
var viewportSize = _this.state.viewportSize; | ||
_this.onRefreshViewport = _this.onRefreshViewport.bind(_assertThisInitialized(_this)); | ||
_this.onSizeChanged = _this.onSizeChanged.bind(_assertThisInitialized(_this)); | ||
_this.onScroll = _this.onScroll.bind(_assertThisInitialized(_this)); | ||
_this.onMouseMove = _this.onMouseMove.bind(_assertThisInitialized(_this)); | ||
_this.onClick = _this.onClick.bind(_assertThisInitialized(_this)); | ||
_this.onCheckboxChange = _this.onCheckboxChange.bind(_assertThisInitialized(_this)); | ||
_this.onKeyDown = _this.onKeyDown.bind(_assertThisInitialized(_this)); | ||
_this.getOptions = _this.getOptions.bind(_assertThisInitialized(_this)); | ||
_this.getGraphics = _this.getGraphics.bind(_assertThisInitialized(_this)); | ||
_this.getLayout = _this.getLayout.bind(_assertThisInitialized(_this)); | ||
_this.setLayout = _this.setLayout.bind(_assertThisInitialized(_this)); | ||
_this.getEventArgs = _this.getEventArgs.bind(_assertThisInitialized(_this)); | ||
_this.centerOnCursor = _this.centerOnCursor.bind(_assertThisInitialized(_this)); | ||
_this.onItemRender = _this.onItemRender.bind(_assertThisInitialized(_this)); | ||
_this.onHighlightRender = _this.onHighlightRender.bind(_assertThisInitialized(_this)); | ||
_this.onCursorRender = _this.onCursorRender.bind(_assertThisInitialized(_this)); | ||
_this.scrollPanelRef = _react["default"].createRef(); | ||
_this.mousePanelRef = _react["default"].createRef(); | ||
_this.placeholderRef = _react["default"].createRef(); | ||
_this.calloutPlaceholderRef = _react["default"].createRef(); | ||
_this.layoutOptions = {}; | ||
_this.templatesHash = {}; | ||
_this.graphics = new _Graphics["default"](viewportSize); | ||
_this.templates = { | ||
AnnotationLabelTemplate: _Templates.AnnotationLabelTemplate, | ||
ButtonsTemplate: _Templates.ButtonsTemplate, | ||
CheckBoxTemplate: _Templates.CheckBoxTemplate, | ||
CursorTemplate: _Templates.CursorTemplate, | ||
DotHighlightTemplate: _Templates.DotHighlightTemplate, | ||
GroupTitleTemplate: _Templates.GroupTitleTemplate, | ||
HighlightTemplate: _Templates.HighlightTemplate, | ||
ItemTemplate: _Templates.ItemTemplate, | ||
UserTemplate: _Templates.UserTemplate, | ||
LabelAnnotationTemplate: _Templates.LabelAnnotationTemplate | ||
const { | ||
viewportSize | ||
} = this.state; | ||
this.onRefreshViewport = this.onRefreshViewport.bind(this); | ||
this.onSizeChanged = this.onSizeChanged.bind(this); | ||
this.onScroll = this.onScroll.bind(this); | ||
this.onMouseMove = this.onMouseMove.bind(this); | ||
this.onClick = this.onClick.bind(this); | ||
this.onCheckboxChange = this.onCheckboxChange.bind(this); | ||
this.onKeyDown = this.onKeyDown.bind(this); | ||
this.getOptions = this.getOptions.bind(this); | ||
this.getGraphics = this.getGraphics.bind(this); | ||
this.getLayout = this.getLayout.bind(this); | ||
this.setLayout = this.setLayout.bind(this); | ||
this.getEventArgs = this.getEventArgs.bind(this); | ||
this.centerOnCursor = this.centerOnCursor.bind(this); | ||
this.onItemRender = this.onItemRender.bind(this); | ||
this.onHighlightRender = this.onHighlightRender.bind(this); | ||
this.onCursorRender = this.onCursorRender.bind(this); | ||
this.scrollPanelRef = React.createRef(); | ||
this.mousePanelRef = React.createRef(); | ||
this.placeholderRef = React.createRef(); | ||
this.calloutPlaceholderRef = React.createRef(); | ||
this.layoutOptions = {}; | ||
this.templatesHash = {}; | ||
this.graphics = new Graphics(viewportSize); | ||
this.templates = { | ||
AnnotationLabelTemplate, | ||
ButtonsTemplate, | ||
CheckBoxTemplate, | ||
CursorTemplate, | ||
DotHighlightTemplate, | ||
GroupTitleTemplate, | ||
HighlightTemplate, | ||
ItemTemplate, | ||
UserTemplate, | ||
LabelAnnotationTemplate | ||
}; | ||
_this.tasks = namespace.TaskManagerFactory(_this.getOptions, _this.getGraphics, _this.getLayout, _this.setLayout, _this.templates); | ||
return _this; | ||
this.tasks = namespace.TaskManagerFactory(this.getOptions, this.getGraphics, this.getLayout, this.setLayout, this.templates); | ||
} | ||
_createClass(BaseDiagram, [{ | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
var nextConfig = nextProps.config, | ||
centerOnCursor = nextProps.centerOnCursor; | ||
var config = this.props.config; | ||
componentWillReceiveProps(nextProps) { | ||
const { | ||
config: nextConfig, | ||
centerOnCursor | ||
} = nextProps; | ||
const { | ||
config | ||
} = this.props; | ||
if (config !== nextConfig) { | ||
var highlightItem = nextConfig.highlightItem, | ||
cursorItem = nextConfig.cursorItem, | ||
selectedItems = nextConfig.selectedItems; | ||
this.setState({ | ||
highlightItem: highlightItem, | ||
cursorItem: cursorItem, | ||
selectedItems: (selectedItems || []).slice(), | ||
centerOnCursor: centerOnCursor | ||
}); | ||
} | ||
if (config !== nextConfig) { | ||
const { | ||
highlightItem, | ||
cursorItem, | ||
selectedItems | ||
} = nextConfig; | ||
this.setState({ | ||
highlightItem, | ||
cursorItem, | ||
selectedItems: (selectedItems || []).slice(), | ||
centerOnCursor | ||
}); | ||
} | ||
}, { | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
// The following code is ResizeObserver Polyfill | ||
// It is added to the rendered page to track size changes of control placeholder | ||
// npm install resize-observer-polyfill --save-dev | ||
require('resize-observer-polyfill/dist/ResizeObserver.global'); | ||
} | ||
this.observer = new ResizeObserver(this.onSizeChanged); | ||
this.observer.observe(this.scrollPanelRef.current); | ||
this.centerOnCursor(); | ||
this.fixPixelAlignment(); | ||
} | ||
}, { | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
// destroy timer | ||
clearTimeout(this.timer); | ||
this.timer = null; // destroy observer | ||
componentDidMount() { | ||
// The following code is ResizeObserver Polyfill | ||
// It is added to the rendered page to track size changes of control placeholder | ||
// npm install resize-observer-polyfill --save-dev | ||
require('resize-observer-polyfill/dist/ResizeObserver.global'); | ||
this.observer.disconnect(); | ||
} | ||
}, { | ||
key: "componentDidUpdate", | ||
value: function componentDidUpdate() { | ||
this.centerOnCursor(); | ||
} | ||
}, { | ||
key: "centerOnCursor", | ||
value: function centerOnCursor() { | ||
var centerOnCursor = this.state.centerOnCursor; | ||
this.observer = new ResizeObserver(this.onSizeChanged); | ||
this.observer.observe(this.scrollPanelRef.current); | ||
this.centerOnCursor(); | ||
this.fixPixelAlignment(); | ||
} | ||
if (centerOnCursor) { | ||
/* scroll to offset */ | ||
var centerOnCursorTask = this.tasks.getTask("CenterOnCursorTask"); | ||
var placeholderOffset = centerOnCursorTask.getPlaceholderOffset(); | ||
var scrollLeft = placeholderOffset.x, | ||
scrollTop = placeholderOffset.y; | ||
this.scrollPanelRef.current.scrollLeft = scrollLeft; | ||
this.scrollPanelRef.current.scrollTop = scrollTop; | ||
} | ||
componentWillUnmount() { | ||
// destroy timer | ||
clearTimeout(this.timer); | ||
this.timer = null; // destroy observer | ||
this.observer.disconnect(); | ||
} | ||
componentDidUpdate() { | ||
this.centerOnCursor(); | ||
} | ||
centerOnCursor() { | ||
const { | ||
centerOnCursor | ||
} = this.state; | ||
if (centerOnCursor) { | ||
/* scroll to offset */ | ||
const centerOnCursorTask = this.tasks.getTask("CenterOnCursorTask"); | ||
const placeholderOffset = centerOnCursorTask.getPlaceholderOffset(); | ||
const { | ||
x: scrollLeft, | ||
y: scrollTop | ||
} = placeholderOffset; | ||
this.scrollPanelRef.current.scrollLeft = scrollLeft; | ||
this.scrollPanelRef.current.scrollTop = scrollTop; | ||
} | ||
}, { | ||
key: "fixPixelAlignment", | ||
value: function fixPixelAlignment() { | ||
var current = this.scrollPanelRef.current; | ||
} | ||
var pixelAlignmentFix = _basicprimitives["default"].common.getFixOfPixelALignment(current); | ||
fixPixelAlignment() { | ||
const { | ||
current | ||
} = this.scrollPanelRef; | ||
var pixelAlignmentFix = primitives.common.getFixOfPixelALignment(current); | ||
current.style.marginLeft = pixelAlignmentFix.width + "px"; | ||
current.style.marginTop = pixelAlignmentFix.height + "px"; | ||
} | ||
current.style.marginLeft = pixelAlignmentFix.width + "px"; | ||
current.style.marginTop = pixelAlignmentFix.height + "px"; | ||
onSizeChanged() { | ||
const { | ||
width, | ||
height | ||
} = primitives.common.getInnerSize(this.scrollPanelRef.current); | ||
this.setState({ | ||
viewportSize: { | ||
width, | ||
height | ||
}, | ||
centerOnCursor: true | ||
}); | ||
} | ||
onScroll() { | ||
if (this.timer == null) { | ||
this.timer = setTimeout(this.onRefreshViewport, 200); | ||
} | ||
}, { | ||
key: "onSizeChanged", | ||
value: function onSizeChanged() { | ||
var _primitives$common$ge = _basicprimitives["default"].common.getInnerSize(this.scrollPanelRef.current), | ||
width = _primitives$common$ge.width, | ||
height = _primitives$common$ge.height; | ||
} | ||
this.setState({ | ||
viewportSize: { | ||
width: width, | ||
height: height | ||
}, | ||
centerOnCursor: true | ||
}); | ||
} | ||
}, { | ||
key: "onScroll", | ||
value: function onScroll() { | ||
if (this.timer == null) { | ||
this.timer = setTimeout(this.onRefreshViewport, 200); | ||
} | ||
} | ||
}, { | ||
key: "onRefreshViewport", | ||
value: function onRefreshViewport() { | ||
clearTimeout(this.timer); | ||
this.timer = null; | ||
var _this$scrollPanelRef$ = this.scrollPanelRef.current, | ||
scrollTop = _this$scrollPanelRef$.scrollTop, | ||
scrollLeft = _this$scrollPanelRef$.scrollLeft; | ||
this.setState({ | ||
contentPosition: { | ||
x: Math.floor(scrollLeft), | ||
y: Math.floor(scrollTop) | ||
}, | ||
centerOnCursor: false | ||
}); | ||
} | ||
}, { | ||
key: "onMouseMove", | ||
value: function onMouseMove(event) { | ||
var placeholderOffset = _basicprimitives["default"].common.getElementOffset(this.mousePanelRef.current), | ||
onRefreshViewport() { | ||
clearTimeout(this.timer); | ||
this.timer = null; | ||
const { | ||
scrollTop, | ||
scrollLeft | ||
} = this.scrollPanelRef.current; | ||
this.setState({ | ||
contentPosition: { | ||
x: Math.floor(scrollLeft), | ||
y: Math.floor(scrollTop) | ||
}, | ||
centerOnCursor: false | ||
}); | ||
} | ||
onMouseMove(event) { | ||
const placeholderOffset = primitives.common.getElementOffset(this.mousePanelRef.current), | ||
x = event.pageX - placeholderOffset.left, | ||
@@ -244,63 +197,59 @@ y = event.pageY - placeholderOffset.top, | ||
if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
var itemId = createTransformTask.getTreeItemForMousePosition(x, y, highlightItemOptionTask.getGravityRadius()); | ||
this.setHighlightItem(event, itemId); | ||
} | ||
if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
const itemId = createTransformTask.getTreeItemForMousePosition(x, y, highlightItemOptionTask.getGravityRadius()); | ||
this.setHighlightItem(event, itemId); | ||
} | ||
}, { | ||
key: "getEventArgs", | ||
value: function getEventArgs(oldTreeItemId, newTreeItemId, name) { | ||
var result = new this.namespace.EventArgs(), | ||
combinedContextsTask = this.tasks.getTask("CombinedContextsTask"), | ||
alignDiagramTask = this.tasks.getTask("AlignDiagramTask"), | ||
oldItemConfig = combinedContextsTask.getConfig(oldTreeItemId), | ||
newItemConfig = combinedContextsTask.getConfig(newTreeItemId), | ||
itemPosition, | ||
offset, | ||
panelOffset; | ||
} | ||
if (oldItemConfig && oldItemConfig.id != null) { | ||
result.oldContext = oldItemConfig; | ||
} | ||
getEventArgs(oldTreeItemId, newTreeItemId, name) { | ||
var result = new this.namespace.EventArgs(), | ||
combinedContextsTask = this.tasks.getTask("CombinedContextsTask"), | ||
alignDiagramTask = this.tasks.getTask("AlignDiagramTask"), | ||
oldItemConfig = combinedContextsTask.getConfig(oldTreeItemId), | ||
newItemConfig = combinedContextsTask.getConfig(newTreeItemId), | ||
itemPosition, | ||
offset, | ||
panelOffset; | ||
if (newItemConfig && newItemConfig.id != null) { | ||
result.context = newItemConfig; | ||
if (oldItemConfig && oldItemConfig.id != null) { | ||
result.oldContext = oldItemConfig; | ||
} | ||
if (newItemConfig.parent !== null) { | ||
result.parentItem = combinedContextsTask.getConfig(newItemConfig.parent); | ||
} | ||
if (newItemConfig && newItemConfig.id != null) { | ||
result.context = newItemConfig; | ||
panelOffset = _basicprimitives["default"].common.getElementOffset(this.mousePanelRef.current); | ||
offset = _basicprimitives["default"].common.getElementOffset(this.scrollPanelRef.current); | ||
itemPosition = alignDiagramTask.getItemPosition(newTreeItemId); | ||
result.position = new _basicprimitives["default"].common.Rect(itemPosition.actualPosition).translate(panelOffset.left, panelOffset.top).translate(-offset.left, -offset.top); | ||
if (newItemConfig.parent !== null) { | ||
result.parentItem = combinedContextsTask.getConfig(newItemConfig.parent); | ||
} | ||
if (name != null) { | ||
result.name = name; | ||
} | ||
panelOffset = primitives.common.getElementOffset(this.mousePanelRef.current); | ||
offset = primitives.common.getElementOffset(this.scrollPanelRef.current); | ||
itemPosition = alignDiagramTask.getItemPosition(newTreeItemId); | ||
result.position = new primitives.common.Rect(itemPosition.actualPosition).translate(panelOffset.left, panelOffset.top).translate(-offset.left, -offset.top); | ||
} | ||
return result; | ||
if (name != null) { | ||
result.name = name; | ||
} | ||
}, { | ||
key: "setHighlightItem", | ||
value: function setHighlightItem(event, newHighlightItemId) { | ||
var eventArgs, | ||
cancel = false; | ||
var _this$props = this.props, | ||
onHighlightChanging = _this$props.onHighlightChanging, | ||
onHighlightChanged = _this$props.onHighlightChanged; | ||
var highlightItem = this.state.highlightItem; | ||
if (newHighlightItemId !== highlightItem) { | ||
eventArgs = this.getEventArgs(highlightItem, newHighlightItemId); | ||
return result; | ||
} | ||
if (onHighlightChanging != null) { | ||
if (!onHighlightChanging(event, eventArgs)) { | ||
cancel = true; | ||
this.setState({ | ||
highlightItem: newHighlightItemId | ||
}); | ||
} | ||
} else { | ||
setHighlightItem(event, newHighlightItemId) { | ||
let eventArgs, | ||
cancel = false; | ||
const { | ||
onHighlightChanging, | ||
onHighlightChanged | ||
} = this.props; | ||
const { | ||
highlightItem | ||
} = this.state; | ||
if (newHighlightItemId !== highlightItem) { | ||
eventArgs = this.getEventArgs(highlightItem, newHighlightItemId); | ||
if (onHighlightChanging != null) { | ||
if (!onHighlightChanging(event, eventArgs)) { | ||
cancel = true; | ||
this.setState({ | ||
@@ -310,34 +259,35 @@ highlightItem: newHighlightItemId | ||
} | ||
} else { | ||
this.setState({ | ||
highlightItem: newHighlightItemId | ||
}); | ||
} | ||
; | ||
; | ||
if (!cancel) { | ||
if (onHighlightChanged != null) { | ||
onHighlightChanged(event, eventArgs); | ||
} | ||
if (!cancel) { | ||
if (onHighlightChanged != null) { | ||
onHighlightChanged(event, eventArgs); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "setCursorItem", | ||
value: function setCursorItem(event, newCursorItemId) { | ||
var eventArgs, | ||
cancel = false; | ||
var _this$props2 = this.props, | ||
onCursorChanging = _this$props2.onCursorChanging, | ||
onCursorChanged = _this$props2.onCursorChanged; | ||
var cursorItem = this.state.cursorItem; | ||
} | ||
if (newCursorItemId !== cursorItem) { | ||
eventArgs = this.getEventArgs(cursorItem, newCursorItemId); | ||
setCursorItem(event, newCursorItemId) { | ||
let eventArgs, | ||
cancel = false; | ||
const { | ||
onCursorChanging, | ||
onCursorChanged | ||
} = this.props; | ||
const { | ||
cursorItem | ||
} = this.state; | ||
if (onCursorChanging != null) { | ||
if (!onCursorChanging(event, eventArgs)) { | ||
cancel = true; | ||
this.setState({ | ||
cursorItem: newCursorItemId, | ||
centerOnCursor: true | ||
}); | ||
} | ||
} else { | ||
if (newCursorItemId !== cursorItem) { | ||
eventArgs = this.getEventArgs(cursorItem, newCursorItemId); | ||
if (onCursorChanging != null) { | ||
if (!onCursorChanging(event, eventArgs)) { | ||
cancel = true; | ||
this.setState({ | ||
@@ -348,369 +298,362 @@ cursorItem: newCursorItemId, | ||
} | ||
} else { | ||
this.setState({ | ||
cursorItem: newCursorItemId, | ||
centerOnCursor: true | ||
}); | ||
} | ||
if (!cancel) { | ||
if (onCursorChanged != null) { | ||
onCursorChanged(event, eventArgs); | ||
} | ||
if (!cancel) { | ||
if (onCursorChanged != null) { | ||
onCursorChanged(event, eventArgs); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "onClick", | ||
value: function onClick(event) { | ||
var placeholderOffset = _basicprimitives["default"].common.getElementOffset(this.mousePanelRef.current), | ||
x = event.pageX - placeholderOffset.left, | ||
y = event.pageY - placeholderOffset.top, | ||
createTransformTask = this.tasks.getTask("CreateTransformTask"), | ||
cursorItemOptionTask = this.tasks.getTask("CursorItemOptionTask"), | ||
highlightItemOptionTask = this.tasks.getTask("HighlightItemOptionTask"), | ||
newCursorItemId = createTransformTask.getTreeItemForMousePosition(x, y, highlightItemOptionTask.getGravityRadius()), | ||
target; | ||
} | ||
target = event.target; | ||
onClick(event) { | ||
var placeholderOffset = primitives.common.getElementOffset(this.mousePanelRef.current), | ||
x = event.pageX - placeholderOffset.left, | ||
y = event.pageY - placeholderOffset.top, | ||
createTransformTask = this.tasks.getTask("CreateTransformTask"), | ||
cursorItemOptionTask = this.tasks.getTask("CursorItemOptionTask"), | ||
highlightItemOptionTask = this.tasks.getTask("HighlightItemOptionTask"), | ||
newCursorItemId = createTransformTask.getTreeItemForMousePosition(x, y, highlightItemOptionTask.getGravityRadius()), | ||
target; | ||
target = event.target; | ||
if (newCursorItemId !== null) { | ||
if (target.getAttribute("name") === "checkbox" || target.getAttribute("name") === "selectiontext") {//ignore jslint | ||
} else { | ||
if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, newCursorItemId); | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
if (newCursorItemId !== null) { | ||
if (target.getAttribute("name") === "checkbox" || target.getAttribute("name") === "selectiontext") {//ignore jslint | ||
} else { | ||
if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, newCursorItemId); | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "onCheckboxChange", | ||
value: function onCheckboxChange(event) { | ||
var _this$props3 = this.props, | ||
onSelectionChanging = _this$props3.onSelectionChanging, | ||
onSelectionChanged = _this$props3.onSelectionChanged; | ||
var selectedItems = this.state.selectedItems; | ||
var newSelectedItems = []; | ||
var target = event.target; | ||
var itemid = target.getAttribute("data-id"); | ||
var checked = event.target.checked; | ||
var cancel = false; | ||
} | ||
if (itemid != null) { | ||
if (checked) { | ||
newSelectedItems = [].concat(_toConsumableArray(selectedItems), [itemid]); | ||
} else { | ||
// eslint-disable-next-line | ||
newSelectedItems = selectedItems.filter(function (id) { | ||
return id != itemid; | ||
}); // User type may not mach string value in data attribute | ||
} | ||
onCheckboxChange(event) { | ||
const { | ||
onSelectionChanging, | ||
onSelectionChanged | ||
} = this.props; | ||
let { | ||
selectedItems | ||
} = this.state; | ||
let newSelectedItems = []; | ||
const { | ||
target | ||
} = event; | ||
var itemid = target.getAttribute("data-id"); | ||
const checked = event.target.checked; | ||
let cancel = false; | ||
if (onSelectionChanging != null) { | ||
cancel = onSelectionChanging(event, selectedItems, newSelectedItems); | ||
} | ||
if (itemid != null) { | ||
if (checked) { | ||
newSelectedItems = [...selectedItems, itemid]; | ||
} else { | ||
// eslint-disable-next-line | ||
newSelectedItems = selectedItems.filter(id => id != itemid); // User type may not mach string value in data attribute | ||
} | ||
if (!cancel) { | ||
this.setState({ | ||
selectedItems: newSelectedItems | ||
}); | ||
if (onSelectionChanging != null) { | ||
cancel = onSelectionChanging(event, selectedItems, newSelectedItems); | ||
} | ||
if (onSelectionChanged != null) { | ||
onSelectionChanged(event, selectedItems, newSelectedItems); | ||
} | ||
if (!cancel) { | ||
this.setState({ | ||
selectedItems: newSelectedItems | ||
}); | ||
if (onSelectionChanged != null) { | ||
onSelectionChanged(event, selectedItems, newSelectedItems); | ||
} | ||
} | ||
} | ||
}, { | ||
key: "onKeyDown", | ||
value: function onKeyDown(event) { | ||
var highlightItemTask = this.tasks.getTask("HighlightItemTask"), | ||
highlightItemOptionTask = this.tasks.getTask("HighlightItemOptionTask"), | ||
cursorItemTask = this.tasks.getTask("CursorItemTask"), | ||
cursorItemOptionTask = this.tasks.getTask("CursorItemOptionTask"), | ||
alignDiagramTask = this.tasks.getTask('AlignDiagramTask'), | ||
createTransformTask = this.tasks.getTask('CreateTransformTask'), | ||
transform = createTransformTask.getTransform(), | ||
navigationItem = null, | ||
newNavigationItem, | ||
direction = null, | ||
accepted; | ||
} | ||
if (highlightItemOptionTask.hasHighlightEnabled() && cursorItemOptionTask.hasCursorEnabled()) { | ||
navigationItem = highlightItemTask.getHighlightTreeItem(); | ||
onKeyDown(event) { | ||
var highlightItemTask = this.tasks.getTask("HighlightItemTask"), | ||
highlightItemOptionTask = this.tasks.getTask("HighlightItemOptionTask"), | ||
cursorItemTask = this.tasks.getTask("CursorItemTask"), | ||
cursorItemOptionTask = this.tasks.getTask("CursorItemOptionTask"), | ||
alignDiagramTask = this.tasks.getTask('AlignDiagramTask'), | ||
createTransformTask = this.tasks.getTask('CreateTransformTask'), | ||
transform = createTransformTask.getTransform(), | ||
navigationItem = null, | ||
newNavigationItem, | ||
direction = null, | ||
accepted; | ||
if (navigationItem === null) { | ||
navigationItem = cursorItemTask.getCursorTreeItem(); | ||
} | ||
} else if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
navigationItem = highlightItemTask.getHighlightTreeItem(); | ||
} else if (cursorItemOptionTask.hasCursorEnabled()) { | ||
if (highlightItemOptionTask.hasHighlightEnabled() && cursorItemOptionTask.hasCursorEnabled()) { | ||
navigationItem = highlightItemTask.getHighlightTreeItem(); | ||
if (navigationItem === null) { | ||
navigationItem = cursorItemTask.getCursorTreeItem(); | ||
} | ||
} else if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
navigationItem = highlightItemTask.getHighlightTreeItem(); | ||
} else if (cursorItemOptionTask.hasCursorEnabled()) { | ||
navigationItem = cursorItemTask.getCursorTreeItem(); | ||
} | ||
if (navigationItem != null) { | ||
switch (event.which) { | ||
case 13: | ||
/*Enter*/ | ||
if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, navigationItem); | ||
event.preventDefault(); | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
if (navigationItem != null) { | ||
switch (event.which) { | ||
case 13: | ||
/*Enter*/ | ||
if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, navigationItem); | ||
event.preventDefault(); | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
break; | ||
break; | ||
case 40: | ||
/*Down*/ | ||
direction = _basicprimitives["default"].common.OrientationType.Bottom; | ||
break; | ||
case 40: | ||
/*Down*/ | ||
direction = primitives.common.OrientationType.Bottom; | ||
break; | ||
case 38: | ||
/*Up*/ | ||
direction = _basicprimitives["default"].common.OrientationType.Top; | ||
break; | ||
case 38: | ||
/*Up*/ | ||
direction = primitives.common.OrientationType.Top; | ||
break; | ||
case 37: | ||
/*Left*/ | ||
direction = _basicprimitives["default"].common.OrientationType.Left; | ||
break; | ||
case 37: | ||
/*Left*/ | ||
direction = primitives.common.OrientationType.Left; | ||
break; | ||
case 39: | ||
/*Right*/ | ||
direction = _basicprimitives["default"].common.OrientationType.Right; | ||
break; | ||
case 39: | ||
/*Right*/ | ||
direction = primitives.common.OrientationType.Right; | ||
break; | ||
default: | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
if (direction != null) { | ||
accepted = false; | ||
if (direction != null) { | ||
accepted = false; | ||
while (!accepted) { | ||
accepted = true; | ||
direction = transform.getOrientation(direction); | ||
newNavigationItem = alignDiagramTask.getNextItem(navigationItem, direction); | ||
while (!accepted) { | ||
accepted = true; | ||
direction = transform.getOrientation(direction); | ||
newNavigationItem = alignDiagramTask.getNextItem(navigationItem, direction); | ||
if (newNavigationItem != null) { | ||
event.preventDefault(); | ||
if (newNavigationItem != null) { | ||
event.preventDefault(); | ||
if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
this.setHighlightItem(event, newNavigationItem); | ||
} else if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, newNavigationItem); | ||
} | ||
if (highlightItemOptionTask.hasHighlightEnabled()) { | ||
this.setHighlightItem(event, newNavigationItem); | ||
} else if (cursorItemOptionTask.hasCursorEnabled()) { | ||
this.setCursorItem(event, newNavigationItem); | ||
} | ||
} | ||
} | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
this.scrollPanelRef.current.focus(); | ||
} | ||
} | ||
}, { | ||
key: "onItemRender", | ||
value: function onItemRender(data) { | ||
var templateName = data.templateName; | ||
var template = this.templatesHash[templateName]; | ||
return template.onItemRender(data); | ||
} | ||
}, { | ||
key: "onHighlightRender", | ||
value: function onHighlightRender(data) { | ||
var templateName = data.templateName; | ||
var template = this.templatesHash[templateName]; | ||
return template.onHighlightRender(data); | ||
} | ||
}, { | ||
key: "onCursorRender", | ||
value: function onCursorRender(data) { | ||
var templateName = data.templateName; | ||
var template = this.templatesHash[templateName]; | ||
return template.onCursorRender(data); | ||
} | ||
}, { | ||
key: "getOptions", | ||
value: function getOptions() { | ||
var config = this.props.config; | ||
var templates = config.templates || []; | ||
var effectiveTemplates = templates.map(function (template) { | ||
var onItemRender = template.onItemRender, | ||
onHighlightRender = template.onHighlightRender, | ||
onCursorRender = template.onCursorRender; | ||
return _objectSpread({}, template, { | ||
itemTemplate: !onItemRender ? null : "<p>This template is not being used in React</p>", | ||
highlightTemplate: !onHighlightRender ? null : "<p>This template is not being used in React</p>", | ||
cursorTemplate: !onCursorRender ? null : "<p>This template is not being used in React</p>" | ||
}); | ||
}); | ||
this.templatesHash = templates.reduce(function (agg, template) { | ||
var name = template.name; | ||
agg[name] = template; | ||
return agg; | ||
}, {}); | ||
var _this$state = this.state, | ||
highlightItem = _this$state.highlightItem, | ||
cursorItem = _this$state.cursorItem, | ||
selectedItems = _this$state.selectedItems; | ||
return _objectSpread({}, config, { | ||
templates: effectiveTemplates, | ||
highlightItem: highlightItem, | ||
cursorItem: cursorItem, | ||
selectedItems: selectedItems, | ||
onItemRender: this.onItemRender, | ||
onCursorRender: this.onCursorRender, | ||
onHighlightRender: this.onHighlightRender | ||
}); | ||
} | ||
}, { | ||
key: "getGraphics", | ||
value: function getGraphics() { | ||
return this.graphics; | ||
} | ||
}, { | ||
key: "getLayout", | ||
value: function getLayout() { | ||
var _this$state2 = this.state, | ||
centerOnCursor = _this$state2.centerOnCursor, | ||
viewportSize = _this$state2.viewportSize, | ||
contentPosition = _this$state2.contentPosition; | ||
return { | ||
forceCenterOnCursor: centerOnCursor, | ||
scrollPanelSize: viewportSize, | ||
placeholderOffset: contentPosition | ||
}; | ||
} | ||
}, { | ||
key: "setLayout", | ||
value: function setLayout(layoutOptions) { | ||
var autoSize = layoutOptions.autoSize, | ||
scale = layoutOptions.scale, | ||
contentSize = layoutOptions.contentSize, | ||
scrollPanelSize = layoutOptions.scrollPanelSize, | ||
autoSizeMinimum = layoutOptions.autoSizeMinimum, | ||
autoSizeMaximum = layoutOptions.autoSizeMaximum; | ||
/* set size of panel with content */ | ||
} | ||
var mousePanelSize = new _basicprimitives["default"].common.Size(contentSize); | ||
mousePanelSize.scale(1 * scale); | ||
var scrollPanelAutoSize = new _basicprimitives["default"].common.Size(scrollPanelSize); | ||
onItemRender(data) { | ||
const { | ||
templateName | ||
} = data; | ||
const template = this.templatesHash[templateName]; | ||
return template.onItemRender(data); | ||
} | ||
if (autoSize) { | ||
/* resize element to fit placeholder if control in autosize mode */ | ||
scrollPanelAutoSize = new _basicprimitives["default"].common.Size(mousePanelSize.width + 25, mousePanelSize.height + 25); | ||
scrollPanelAutoSize.cropBySize(autoSizeMaximum); | ||
scrollPanelAutoSize.addSize(autoSizeMinimum); //ignore jslint | ||
} | ||
onHighlightRender(data) { | ||
const { | ||
templateName | ||
} = data; | ||
const template = this.templatesHash[templateName]; | ||
return template.onHighlightRender(data); | ||
} | ||
this.layoutOptions = { | ||
autoSize: autoSize, | ||
scrollPanelSize: scrollPanelAutoSize, | ||
mousePanelSize: mousePanelSize, | ||
scale: scale | ||
onCursorRender(data) { | ||
const { | ||
templateName | ||
} = data; | ||
const template = this.templatesHash[templateName]; | ||
return template.onCursorRender(data); | ||
} | ||
getOptions() { | ||
const { | ||
config | ||
} = this.props; | ||
const templates = config.templates || []; | ||
const effectiveTemplates = templates.map(template => { | ||
const { | ||
onItemRender, | ||
onHighlightRender, | ||
onCursorRender | ||
} = template; | ||
return { ...template, | ||
itemTemplate: !onItemRender ? null : "<p>This template is not being used in React</p>", | ||
highlightTemplate: !onHighlightRender ? null : "<p>This template is not being used in React</p>", | ||
cursorTemplate: !onCursorRender ? null : "<p>This template is not being used in React</p>" | ||
}; | ||
return scrollPanelAutoSize; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var graphics = this.graphics; | ||
this.tasks.process('OptionsTask', null, false); | ||
var _this$graphics$placeh = this.graphics.placeholders, | ||
placeholder = _this$graphics$placeh.placeholder, | ||
calloutplaceholder = _this$graphics$placeh.calloutplaceholder; | ||
var placeholderRectCSS = placeholder.rect.getCSS(); | ||
var _this$layoutOptions = this.layoutOptions, | ||
autoSize = _this$layoutOptions.autoSize, | ||
scale = _this$layoutOptions.scale, | ||
scrollPanelSize = _this$layoutOptions.scrollPanelSize, | ||
mousePanelSize = _this$layoutOptions.mousePanelSize; | ||
/* set CSS scale of content */ | ||
}); | ||
this.templatesHash = templates.reduce((agg, template) => { | ||
const { | ||
name | ||
} = template; | ||
agg[name] = template; | ||
return agg; | ||
}, {}); | ||
const { | ||
highlightItem, | ||
cursorItem, | ||
selectedItems | ||
} = this.state; | ||
return { ...config, | ||
templates: effectiveTemplates, | ||
highlightItem, | ||
cursorItem, | ||
selectedItems, | ||
onItemRender: this.onItemRender, | ||
onCursorRender: this.onCursorRender, | ||
onHighlightRender: this.onHighlightRender | ||
}; | ||
} | ||
var scaletext = "scale(" + scale + "," + scale + ")"; | ||
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("div", { | ||
ref: this.scrollPanelRef, | ||
onScroll: this.onScroll, | ||
onKeyDown: this.onKeyDown, | ||
style: _objectSpread({ | ||
position: "relative", | ||
overflow: "auto", | ||
WebkitOverflowScrolling: "touch", | ||
width: "100%", | ||
height: "100%", | ||
padding: "0px", | ||
marginBottom: "0px", | ||
marginRight: "0px" | ||
}, autoSize ? scrollPanelSize.getCSS() : {}), | ||
tabIndex: "0" | ||
}, _react["default"].createElement("div", { | ||
ref: this.mousePanelRef, | ||
onMouseMove: this.onMouseMove, | ||
onClick: this.onClick, | ||
onChange: this.onCheckboxChange, | ||
style: _objectSpread({ | ||
position: "absolute", | ||
overflow: "hidden" | ||
}, mousePanelSize.getCSS()) | ||
}, _react["default"].createElement("div", { | ||
ref: this.placeholderRef, | ||
style: _objectSpread({}, placeholderRectCSS, { | ||
position: "absolute", | ||
overflow: "hidden", | ||
"transformOrigin": "0 0", | ||
"transform": scaletext, | ||
"msTransform": scaletext, | ||
getGraphics() { | ||
return this.graphics; | ||
} | ||
/* IE 9 */ | ||
"WebkitTransform": scaletext, | ||
getLayout() { | ||
const { | ||
centerOnCursor, | ||
viewportSize, | ||
contentPosition | ||
} = this.state; | ||
return { | ||
forceCenterOnCursor: centerOnCursor, | ||
scrollPanelSize: viewportSize, | ||
placeholderOffset: contentPosition | ||
}; | ||
} | ||
/* Safari and Chrome */ | ||
"OTransform": scaletext, | ||
setLayout(layoutOptions) { | ||
const { | ||
autoSize, | ||
scale, | ||
contentSize, | ||
scrollPanelSize, | ||
autoSizeMinimum, | ||
autoSizeMaximum | ||
} = layoutOptions; | ||
/* set size of panel with content */ | ||
/* Opera */ | ||
"MozTransform": scaletext | ||
/* Firefox */ | ||
let mousePanelSize = new primitives.common.Size(contentSize); | ||
mousePanelSize.scale(1 * scale); | ||
let scrollPanelAutoSize = new primitives.common.Size(scrollPanelSize); | ||
}) | ||
}, graphics.map(this, "placeholder", function (layerKey, elements) { | ||
return _react["default"].createElement("div", { | ||
key: layerKey, | ||
style: { | ||
position: "absolute", | ||
overflow: "visible", | ||
left: "0px", | ||
top: "0px" | ||
} | ||
}, elements); | ||
}), calloutplaceholder && _react["default"].createElement("div", { | ||
key: "Callout", | ||
style: { | ||
position: "absolute", | ||
overflow: "visible", | ||
left: calloutplaceholder.rect.x + "px", | ||
top: calloutplaceholder.rect.y + "px" | ||
} | ||
}, graphics.map(this, "calloutplaceholder", function (layerKey, elements) { | ||
return _react["default"].createElement("div", { | ||
key: layerKey, | ||
style: { | ||
position: "absolute", | ||
overflow: "visible" | ||
} | ||
}, elements); | ||
})))))); | ||
if (autoSize) { | ||
/* resize element to fit placeholder if control in autosize mode */ | ||
scrollPanelAutoSize = new primitives.common.Size(mousePanelSize.width + 25, mousePanelSize.height + 25); | ||
scrollPanelAutoSize.cropBySize(autoSizeMaximum); | ||
scrollPanelAutoSize.addSize(autoSizeMinimum); //ignore jslint | ||
} | ||
}]); | ||
return BaseDiagram; | ||
}(_react.Component); | ||
this.layoutOptions = { | ||
autoSize, | ||
scrollPanelSize: scrollPanelAutoSize, | ||
mousePanelSize, | ||
scale | ||
}; | ||
return scrollPanelAutoSize; | ||
} | ||
render() { | ||
const graphics = this.graphics; | ||
this.tasks.process('OptionsTask', null, false); | ||
const { | ||
placeholder, | ||
calloutplaceholder | ||
} = this.graphics.placeholders; | ||
const placeholderRectCSS = placeholder.rect.getCSS(); | ||
const { | ||
autoSize, | ||
scale, | ||
scrollPanelSize, | ||
mousePanelSize | ||
} = this.layoutOptions; | ||
/* set CSS scale of content */ | ||
var scaletext = "scale(" + scale + "," + scale + ")"; | ||
return React.createElement(React.Fragment, null, React.createElement("div", { | ||
ref: this.scrollPanelRef, | ||
className: "BPScrollPanel", | ||
onScroll: this.onScroll, | ||
onKeyDown: this.onKeyDown, | ||
style: autoSize ? scrollPanelSize.getCSS() : {}, | ||
tabIndex: "0" | ||
}, React.createElement("div", { | ||
ref: this.mousePanelRef, | ||
className: "BPMousePanel", | ||
onMouseMove: this.onMouseMove, | ||
onClick: this.onClick, | ||
onChange: this.onCheckboxChange, | ||
style: mousePanelSize.getCSS() | ||
}, React.createElement("div", { | ||
ref: this.placeholderRef, | ||
className: "BPPlaceholderPanel", | ||
style: { ...placeholderRectCSS, | ||
"transformOrigin": "0 0", | ||
"transform": scaletext, | ||
"msTransform": scaletext, | ||
/* IE 9 */ | ||
"WebkitTransform": scaletext, | ||
/* Safari and Chrome */ | ||
"OTransform": scaletext, | ||
/* Opera */ | ||
"MozTransform": scaletext | ||
/* Firefox */ | ||
} | ||
}, graphics.map(this, "placeholder", (layerKey, elements) => React.createElement("div", { | ||
key: layerKey, | ||
className: "BPLayerPanel", | ||
style: { | ||
left: "0px", | ||
top: "0px" | ||
} | ||
}, elements)), calloutplaceholder && React.createElement("div", { | ||
key: "Callout", | ||
className: "BPCalloutPlaceholderPanel", | ||
style: { | ||
left: calloutplaceholder.rect.x + "px", | ||
top: calloutplaceholder.rect.y + "px" | ||
} | ||
}, graphics.map(this, "calloutplaceholder", (layerKey, elements) => React.createElement("div", { | ||
key: layerKey, | ||
className: "BPLayerPanel" | ||
}, elements))))))); | ||
} | ||
} | ||
_defineProperty(BaseDiagram, "propTypes", { | ||
centerOnCursor: _propTypes["default"].bool, | ||
centerOnCursor: PropTypes.bool, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onHighlightChanging: _propTypes["default"].func, | ||
onHighlightChanging: PropTypes.func, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onHighlightChanged: _propTypes["default"].func, | ||
onHighlightChanged: PropTypes.func, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onCursorChanging: _propTypes["default"].func, | ||
onCursorChanging: PropTypes.func, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onCursorChanged: _propTypes["default"].func, | ||
onCursorChanged: PropTypes.func, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onSelectionChanging: _propTypes["default"].func, | ||
onSelectionChanging: PropTypes.func, | ||
// eslint-disable-line react/no-unused-prop-types | ||
onSelectionChanged: _propTypes["default"].func // eslint-disable-line react/no-unused-prop-types | ||
onSelectionChanged: PropTypes.func // eslint-disable-line react/no-unused-prop-types | ||
@@ -729,3 +672,2 @@ }); | ||
var _default = BaseDiagram; | ||
exports["default"] = _default; | ||
export default BaseDiagram; |
@@ -1,52 +0,19 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _BaseDiagram2 = _interopRequireDefault(require("./BaseDiagram")); | ||
var _FamDiagramConfig = _interopRequireDefault(require("./Schemas/FamDiagramConfig")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var FamDiagram = | ||
/*#__PURE__*/ | ||
function (_BaseDiagram) { | ||
_inherits(FamDiagram, _BaseDiagram); | ||
import primitives from 'basicprimitives'; | ||
import BaseDiagram from './BaseDiagram'; | ||
import FamDiagramConfig from './Schemas/FamDiagramConfig'; | ||
function FamDiagram(props) { | ||
_classCallCheck(this, FamDiagram); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(FamDiagram).call(this, props, _basicprimitives["default"].famdiagram)); | ||
class FamDiagram extends BaseDiagram { | ||
constructor(props) { | ||
super(props, primitives.famdiagram); | ||
} | ||
return FamDiagram; | ||
}(_BaseDiagram2["default"]); | ||
} | ||
_defineProperty(FamDiagram, "propTypes", { | ||
config: _FamDiagramConfig["default"].isRequired // eslint-disable-line react/no-unused-prop-types | ||
config: FamDiagramConfig.isRequired // eslint-disable-line react/no-unused-prop-types | ||
}); | ||
var _default = FamDiagram; | ||
exports["default"] = _default; | ||
export default FamDiagram; |
@@ -1,48 +0,22 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import primitives from 'basicprimitives'; | ||
import RotatedText from './Templates/RotatedText'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class Placeholder { | ||
constructor(name) { | ||
this.name = name; | ||
this.layers = {}; | ||
this.activeLayer = null; | ||
this.size = null; | ||
this.rect = null; | ||
this.hasGraphics = true; | ||
this.isVisible = true; | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
} | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _RotatedText = _interopRequireDefault(require("./Templates/RotatedText")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var Placeholder = function Placeholder(name) { | ||
_classCallCheck(this, Placeholder); | ||
this.name = name; | ||
this.layers = {}; | ||
this.activeLayer = null; | ||
this.size = null; | ||
this.rect = null; | ||
this.hasGraphics = true; | ||
this.isVisible = true; | ||
}; | ||
; | ||
var Layer = | ||
/*#__PURE__*/ | ||
function () { | ||
function Layer(name) { | ||
_classCallCheck(this, Layer); | ||
class Layer { | ||
constructor(name) { | ||
this.name = name; | ||
@@ -53,21 +27,13 @@ this.items = []; | ||
_createClass(Layer, [{ | ||
key: "reset", | ||
value: function reset() { | ||
this.items = []; | ||
this.polylines = []; | ||
} | ||
}]); | ||
reset() { | ||
this.items = []; | ||
this.polylines = []; | ||
} | ||
return Layer; | ||
}(); | ||
} | ||
; | ||
var Graphics = | ||
/*#__PURE__*/ | ||
function () { | ||
function Graphics(size) { | ||
_classCallCheck(this, Graphics); | ||
class Graphics { | ||
constructor(size) { | ||
this.placeholders = {}; | ||
@@ -77,4 +43,4 @@ this.activePlaceholder = null; | ||
this.hasGraphics = true; | ||
this.names = Object.keys(_basicprimitives["default"].common.Layers).reduce(function (agg, key) { | ||
agg[_basicprimitives["default"].common.Layers[key]] = key; | ||
this.names = Object.keys(primitives.common.Layers).reduce((agg, key) => { | ||
agg[primitives.common.Layers[key]] = key; | ||
return agg; | ||
@@ -87,333 +53,292 @@ }, []); | ||
_createClass(Graphics, [{ | ||
key: "clean", | ||
value: function clean() { | ||
this.placeholders = {}; | ||
this.activePlaceholder = null; | ||
} | ||
}, { | ||
key: "resize", | ||
value: function resize(name, width, height) { | ||
this.activatePlaceholder(name); | ||
this.resizePlaceholder(this.activePlaceholder, 0, 0, width, height); | ||
} | ||
}, { | ||
key: "position", | ||
value: function position(name, left, top, width, height) { | ||
this.activatePlaceholder(name); | ||
this.resizePlaceholder(this.activePlaceholder, left, top, width, height); | ||
} | ||
}, { | ||
key: "show", | ||
value: function show(name) { | ||
var placeholder = this.placeholders[name]; | ||
clean() { | ||
this.placeholders = {}; | ||
this.activePlaceholder = null; | ||
} | ||
if (placeholder != null) { | ||
placeholder.isVisible = true; | ||
} | ||
resize(name, width, height) { | ||
this.activatePlaceholder(name); | ||
this.resizePlaceholder(this.activePlaceholder, 0, 0, width, height); | ||
} | ||
position(name, left, top, width, height) { | ||
this.activatePlaceholder(name); | ||
this.resizePlaceholder(this.activePlaceholder, left, top, width, height); | ||
} | ||
show(name) { | ||
var placeholder = this.placeholders[name]; | ||
if (placeholder != null) { | ||
placeholder.isVisible = true; | ||
} | ||
}, { | ||
key: "hide", | ||
value: function hide(name) { | ||
var placeholder = this.placeholders[name]; | ||
} | ||
if (placeholder != null) { | ||
placeholder.isVisible = false; | ||
} | ||
hide(name) { | ||
var placeholder = this.placeholders[name]; | ||
if (placeholder != null) { | ||
placeholder.isVisible = false; | ||
} | ||
}, { | ||
key: "resizePlaceholder", | ||
value: function resizePlaceholder(placeholder, left, top, width, height) { | ||
placeholder.size = new _basicprimitives["default"].common.Size(width, height); | ||
placeholder.rect = new _basicprimitives["default"].common.Rect(left, top, width, height); | ||
} | ||
}, { | ||
key: "reset", | ||
value: function reset(placeholderName, layerKey) { | ||
var layerName = this.names[layerKey]; | ||
var placeholder = this.placeholders[placeholderName]; | ||
} | ||
if (placeholder != null) { | ||
var layer = placeholder.layers[layerName]; | ||
resizePlaceholder(placeholder, left, top, width, height) { | ||
placeholder.size = new primitives.common.Size(width, height); | ||
placeholder.rect = new primitives.common.Rect(left, top, width, height); | ||
} | ||
if (layer != null) { | ||
layer.reset(); | ||
} | ||
reset(placeholderName, layerKey) { | ||
const layerName = this.names[layerKey]; | ||
const placeholder = this.placeholders[placeholderName]; | ||
if (placeholder != null) { | ||
const layer = placeholder.layers[layerName]; | ||
if (layer != null) { | ||
layer.reset(); | ||
} | ||
} | ||
}, { | ||
key: "activate", | ||
value: function activate(placeholderName, layerKey) { | ||
this.activatePlaceholder(placeholderName); | ||
this.activateLayer(layerKey); | ||
return this.activePlaceholder; | ||
} | ||
}, { | ||
key: "activatePlaceholder", | ||
value: function activatePlaceholder(name) { | ||
var placeholder = this.placeholders[name]; | ||
} | ||
if (placeholder === undefined) { | ||
placeholder = new Placeholder(name); | ||
placeholder.size = this.size; | ||
placeholder.rect = new _basicprimitives["default"].common.Rect(0, 0, placeholder.size.width, placeholder.size.height); | ||
this.placeholders[name] = placeholder; | ||
} | ||
activate(placeholderName, layerKey) { | ||
this.activatePlaceholder(placeholderName); | ||
this.activateLayer(layerKey); | ||
return this.activePlaceholder; | ||
} | ||
this.activePlaceholder = placeholder; | ||
activatePlaceholder(name) { | ||
let placeholder = this.placeholders[name]; | ||
if (placeholder === undefined) { | ||
placeholder = new Placeholder(name); | ||
placeholder.size = this.size; | ||
placeholder.rect = new primitives.common.Rect(0, 0, placeholder.size.width, placeholder.size.height); | ||
this.placeholders[name] = placeholder; | ||
} | ||
}, { | ||
key: "activateLayer", | ||
value: function activateLayer(value) { | ||
var name = this.names[value]; | ||
var layer = this.activePlaceholder.layers[name]; | ||
if (layer === undefined) { | ||
layer = new Layer(name); | ||
this.activePlaceholder.layers[name] = layer; | ||
} | ||
this.activePlaceholder = placeholder; | ||
} | ||
this.activePlaceholder.activeLayer = layer; | ||
activateLayer(value) { | ||
const name = this.names[value]; | ||
let layer = this.activePlaceholder.layers[name]; | ||
if (layer === undefined) { | ||
layer = new Layer(name); | ||
this.activePlaceholder.layers[name] = layer; | ||
} | ||
}, { | ||
key: "map", | ||
value: function map(thisArg, placeholderName, onLayer) { | ||
var result = []; | ||
if (onLayer != null) { | ||
var placeholder = this.placeholders[placeholderName]; | ||
this.names.forEach(function (layerKey) { | ||
var layer = placeholder.layers[layerKey]; | ||
this.activePlaceholder.activeLayer = layer; | ||
} | ||
if (layer != null) { | ||
result.push(onLayer.call(thisArg, layerKey, _react["default"].createElement(_react["default"].Fragment, null, layer.polylines.length > 0 ? _react["default"].createElement("svg", { | ||
height: placeholder.size.height, | ||
width: placeholder.size.width | ||
}, layer.polylines) : null, layer.items))); | ||
} | ||
}); | ||
} | ||
map(thisArg, placeholderName, onLayer) { | ||
var result = []; | ||
return result; | ||
} | ||
}, { | ||
key: "text", | ||
value: function text(x, y, width, height, label, orientation, horizontalAlignment, verticalAlignment, attr) { | ||
this.activePlaceholder.activeLayer.items.push(_react["default"].createElement("div", { | ||
key: this.activePlaceholder.activeLayer.items.length, | ||
style: _objectSpread({ | ||
position: "absolute", | ||
overflow: "visible", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box" | ||
}, attr, { | ||
top: y + "px", | ||
left: x + "px" | ||
}) | ||
}, _react["default"].createElement(_RotatedText["default"], { | ||
width: width, | ||
height: height, | ||
orientation: this.orientations[orientation], | ||
horizontalAlignment: this.horizontalAlignments[horizontalAlignment], | ||
verticalAlignment: this.verticalAlignments[verticalAlignment] | ||
}, label))); | ||
} | ||
}, { | ||
key: "polylinesBuffer", | ||
value: function polylinesBuffer(buffer) { | ||
buffer.loop(this, function (polyline) { | ||
if (polyline.length() > 0) { | ||
this.polyline(polyline); | ||
if (onLayer != null) { | ||
const placeholder = this.placeholders[placeholderName]; | ||
this.names.forEach(layerKey => { | ||
const layer = placeholder.layers[layerKey]; | ||
if (layer != null) { | ||
result.push(onLayer.call(thisArg, layerKey, React.createElement(React.Fragment, null, layer.polylines.length > 0 ? React.createElement("svg", { | ||
height: placeholder.size.height, | ||
width: placeholder.size.width | ||
}, layer.polylines) : null, layer.items))); | ||
} | ||
}); | ||
} | ||
}, { | ||
key: "polyline", | ||
value: function polyline(polylineData) { | ||
var data, | ||
attr = polylineData.paletteItem.toAttr(), | ||
step, | ||
radius, | ||
cornerRadius, | ||
style = {}; //polyline = new primitives.common.Element(this._svgxmlns, "path"); | ||
if (attr.fillColor !== undefined) { | ||
style.fill = attr.fillColor; | ||
style.fillOpacity = attr.opacity; | ||
} else { | ||
style.fillOpacity = 0; | ||
return result; | ||
} | ||
text(x, y, width, height, label, orientation, horizontalAlignment, verticalAlignment, attr) { | ||
this.activePlaceholder.activeLayer.items.push(React.createElement("div", { | ||
className: "BPItemPlaceholder", | ||
key: this.activePlaceholder.activeLayer.items.length, | ||
style: { ...attr, | ||
top: y + "px", | ||
left: x + "px" | ||
} | ||
}, React.createElement(RotatedText, { | ||
width: width, | ||
height: height, | ||
orientation: this.orientations[orientation], | ||
horizontalAlignment: this.horizontalAlignments[horizontalAlignment], | ||
verticalAlignment: this.verticalAlignments[verticalAlignment] | ||
}, label))); | ||
} | ||
if (attr.lineWidth !== undefined && attr.borderColor !== undefined) { | ||
style.stroke = attr.borderColor; | ||
style.strokeWidth = attr.lineWidth; | ||
polylinesBuffer(buffer) { | ||
buffer.loop(this, function (polyline) { | ||
if (polyline.length() > 0) { | ||
this.polyline(polyline); | ||
} | ||
}); | ||
} | ||
if (attr.opacity !== undefined) { | ||
style.strokeOpacity = attr.opacity; | ||
} else { | ||
style.strokeOpacity = 1; | ||
} | ||
polyline(polylineData) { | ||
var data, | ||
attr = polylineData.paletteItem.toAttr(), | ||
step, | ||
radius, | ||
cornerRadius, | ||
style = {}; //polyline = new primitives.common.Element(this._svgxmlns, "path"); | ||
if (attr.fillColor !== undefined) { | ||
style.fill = attr.fillColor; | ||
style.fillOpacity = attr.opacity; | ||
} else { | ||
style.fillOpacity = 0; | ||
} | ||
if (attr.lineWidth !== undefined && attr.borderColor !== undefined) { | ||
style.stroke = attr.borderColor; | ||
style.strokeWidth = attr.lineWidth; | ||
if (attr.opacity !== undefined) { | ||
style.strokeOpacity = attr.opacity; | ||
} else { | ||
style.stroke = "transparent"; | ||
style.strokeWidth = 0; | ||
style.strokeOpacity = 1; | ||
} | ||
} else { | ||
style.stroke = "transparent"; | ||
style.strokeWidth = 0; | ||
} | ||
if (attr.lineType != null) { | ||
step = Math.round(attr.lineWidth) || 1; | ||
if (attr.lineType != null) { | ||
step = Math.round(attr.lineWidth) || 1; | ||
switch (attr.lineType) { | ||
case _basicprimitives["default"].common.LineType.Dotted: | ||
style.strokeDasharray = step + "," + step; | ||
break; | ||
switch (attr.lineType) { | ||
case primitives.common.LineType.Dotted: | ||
style.strokeDasharray = step + "," + step; | ||
break; | ||
case _basicprimitives["default"].common.LineType.Dashed: | ||
style.strokeDasharray = step * 5 + "," + step * 3; | ||
break; | ||
case primitives.common.LineType.Dashed: | ||
style.strokeDasharray = step * 5 + "," + step * 3; | ||
break; | ||
case _basicprimitives["default"].common.LineType.Solid: | ||
default: | ||
style.strokeDasharray = ""; | ||
break; | ||
} | ||
case primitives.common.LineType.Solid: | ||
default: | ||
style.strokeDasharray = ""; | ||
break; | ||
} | ||
} | ||
data = ""; | ||
polylineData.loop(this, function (segment) { | ||
switch (segment.segmentType) { | ||
case _basicprimitives["default"].common.SegmentType.Move: | ||
data = ""; | ||
polylineData.loop(this, function (segment) { | ||
switch (segment.segmentType) { | ||
case primitives.common.SegmentType.Move: | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
case primitives.common.SegmentType.Line: | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
case primitives.common.SegmentType.QuadraticArc: | ||
data += "Q" + (Math.round(segment.cpX) + 0.5) + " " + (Math.round(segment.cpY) + 0.5) + " " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
case primitives.common.SegmentType.Dot: | ||
// A rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y | ||
if (segment.width === segment.height && segment.width / 2.0 <= segment.cornerRadius) { | ||
// dot | ||
radius = segment.width / 2.0; | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
data += "A" + radius + " " + radius + " 0 0 0 " + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
data += "A" + radius + " " + radius + " 0 0 0 " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
} else if (segment.cornerRadius === 0) { | ||
// square | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
case _basicprimitives["default"].common.SegmentType.Line: | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
} else { | ||
cornerRadius = Math.min(segment.cornerRadius, Math.min(segment.width / 2.0, segment.height / 2.0)); | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + cornerRadius) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width - cornerRadius) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + segment.height - cornerRadius) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + segment.width - cornerRadius) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x + cornerRadius) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + segment.height - cornerRadius) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
} | ||
case _basicprimitives["default"].common.SegmentType.QuadraticArc: | ||
data += "Q" + (Math.round(segment.cpX) + 0.5) + " " + (Math.round(segment.cpY) + 0.5) + " " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
break; | ||
case _basicprimitives["default"].common.SegmentType.Dot: | ||
// A rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y | ||
if (segment.width === segment.height && segment.width / 2.0 <= segment.cornerRadius) { | ||
// dot | ||
radius = segment.width / 2.0; | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
data += "A" + radius + " " + radius + " 0 0 0 " + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
data += "A" + radius + " " + radius + " 0 0 0 " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + segment.height / 2.0 + 0.5); | ||
} else if (segment.cornerRadius === 0) { | ||
// square | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
} else { | ||
cornerRadius = Math.min(segment.cornerRadius, Math.min(segment.width / 2.0, segment.height / 2.0)); | ||
data += "M" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + cornerRadius) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width - cornerRadius) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
data += "L" + (Math.round(segment.x + segment.width) + 0.5) + " " + (Math.round(segment.y + segment.height - cornerRadius) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x + segment.width - cornerRadius) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "L" + (Math.round(segment.x + cornerRadius) + 0.5) + " " + (Math.round(segment.y + segment.height) + 0.5); | ||
data += "A" + Math.round(cornerRadius) + " " + Math.round(cornerRadius) + " 0 0 1 " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + segment.height - cornerRadius) + 0.5); | ||
data += "L" + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y + cornerRadius) + 0.5); | ||
} | ||
case primitives.common.SegmentType.CubicArc: | ||
data += "C" + (Math.round(segment.cpX1) + 0.5) + " " + (Math.round(segment.cpY1) + 0.5) + " " + (Math.round(segment.cpX2) + 0.5) + " " + (Math.round(segment.cpY2) + 0.5) + " " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
this.activePlaceholder.activeLayer.polylines.push(React.createElement("path", { | ||
key: this.activePlaceholder.activeLayer.polylines.length, | ||
d: data, | ||
style: style | ||
})); | ||
} | ||
case _basicprimitives["default"].common.SegmentType.CubicArc: | ||
data += "C" + (Math.round(segment.cpX1) + 0.5) + " " + (Math.round(segment.cpY1) + 0.5) + " " + (Math.round(segment.cpX2) + 0.5) + " " + (Math.round(segment.cpY2) + 0.5) + " " + (Math.round(segment.x) + 0.5) + " " + (Math.round(segment.y) + 0.5); | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
this.activePlaceholder.activeLayer.polylines.push(_react["default"].createElement("path", { | ||
key: this.activePlaceholder.activeLayer.polylines.length, | ||
d: data, | ||
style: style | ||
})); | ||
} | ||
}, { | ||
key: "template", | ||
value: function template(x, y, width, height, contentx, contenty, contentWidth, contentHeight, _template, hashCode, onRenderTemplate, uiHash, attr) { | ||
//ignore jslint | ||
var style; | ||
var left = x + contentx, | ||
template(x, y, width, height, contentx, contenty, contentWidth, contentHeight, template, hashCode, onRenderTemplate, uiHash, attr) { | ||
//ignore jslint | ||
let style; | ||
const left = x + contentx, | ||
top = y + contenty, | ||
templateWidth = contentWidth, | ||
templateHeight = contentHeight; | ||
style = _objectSpread({ | ||
"width": templateWidth + "px", | ||
"height": templateHeight + "px", | ||
"top": top + "px", | ||
"left": left + "px", | ||
"position": "absolute", | ||
"padding": "0px", | ||
"margin": "0px" | ||
}, attr); | ||
style = { | ||
"width": templateWidth + "px", | ||
"height": templateHeight + "px", | ||
"top": top + "px", | ||
"left": left + "px", | ||
"position": "absolute", | ||
"padding": "0px", | ||
"margin": "0px", | ||
...attr | ||
}; | ||
if (uiHash == null) { | ||
uiHash = {}; | ||
} | ||
if (uiHash == null) { | ||
uiHash = {}; | ||
} | ||
uiHash.x = left; | ||
uiHash.y = top; | ||
uiHash.width = templateWidth; | ||
uiHash.height = templateHeight; | ||
uiHash.x = left; | ||
uiHash.y = top; | ||
uiHash.width = templateWidth; | ||
uiHash.height = templateHeight; | ||
if (onRenderTemplate !== null) { | ||
this.activePlaceholder.activeLayer.items.push(_react["default"].createElement("div", { | ||
key: this.activePlaceholder.activeLayer.items.length, | ||
style: _objectSpread({ | ||
position: "absolute", | ||
overflow: "visible", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box" | ||
}, style) | ||
}, onRenderTemplate(uiHash))); | ||
} | ||
; | ||
if (onRenderTemplate !== null) { | ||
this.activePlaceholder.activeLayer.items.push(React.createElement("div", { | ||
className: "BPItemPlaceholder", | ||
key: this.activePlaceholder.activeLayer.items.length, | ||
style: style | ||
}, onRenderTemplate(uiHash))); | ||
} | ||
}, { | ||
key: "getPxSize", | ||
value: function getPxSize(value, base) { | ||
var result = value; | ||
if (typeof value === "string") { | ||
if (value.indexOf("pt") > 0) { | ||
result = parseInt(value, 10) * 96 / 72; | ||
} else if (value.indexOf("%") > 0) { | ||
result = parseFloat(value) / 100.0 * base; | ||
} else { | ||
result = parseInt(value, 10); | ||
} | ||
; | ||
} | ||
getPxSize(value, base) { | ||
var result = value; | ||
if (typeof value === "string") { | ||
if (value.indexOf("pt") > 0) { | ||
result = parseInt(value, 10) * 96 / 72; | ||
} else if (value.indexOf("%") > 0) { | ||
result = parseFloat(value) / 100.0 * base; | ||
} else { | ||
result = parseInt(value, 10); | ||
} | ||
return result; | ||
} | ||
}]); | ||
return Graphics; | ||
}(); | ||
return result; | ||
} | ||
} | ||
; | ||
var _default = Graphics; | ||
exports["default"] = _default; | ||
export default Graphics; |
@@ -1,61 +0,4 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.TemplateConfig = exports.ShapeAnnotationConfig = exports.PaletteItemConfig = exports.OrgDiagramItemConfig = exports.OrgDiagramConfig = exports.LabelAnnotationConfig = exports.HighlightPathAnnotationConfig = exports.FamDiagramItemConfig = exports.FamDiagramConfig = exports.ConnectorAnnotationConfig = exports.BackgroundAnnotationConfig = exports.FamDiagram = exports.OrgDiagram = void 0; | ||
var _OrgDiagram = _interopRequireDefault(require("./OrgDiagram")); | ||
var _FamDiagram = _interopRequireDefault(require("./FamDiagram")); | ||
var _BackgroundAnnotationConfig = _interopRequireDefault(require("./Schemas/BackgroundAnnotationConfig")); | ||
var _ConnectorAnnotationConfig = _interopRequireDefault(require("./Schemas/ConnectorAnnotationConfig")); | ||
var _FamDiagramConfig = _interopRequireDefault(require("./Schemas/FamDiagramConfig")); | ||
var _FamDiagramItemConfig = _interopRequireDefault(require("./Schemas/FamDiagramItemConfig")); | ||
var _HighlightPathAnnotationConfig = _interopRequireDefault(require("./Schemas/HighlightPathAnnotationConfig")); | ||
var _LabelAnnotationConfig = _interopRequireDefault(require("./Schemas/LabelAnnotationConfig")); | ||
var _OrgDiagramConfig = _interopRequireDefault(require("./Schemas/OrgDiagramConfig")); | ||
var _OrgDiagramItemConfig = _interopRequireDefault(require("./Schemas/OrgDiagramItemConfig")); | ||
var _PaletteItemConfig = _interopRequireDefault(require("./Schemas/PaletteItemConfig")); | ||
var _ShapeAnnotationConfig = _interopRequireDefault(require("./Schemas/ShapeAnnotationConfig")); | ||
var _TemplateConfig = _interopRequireDefault(require("./Schemas/TemplateConfig")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var OrgDiagram = _OrgDiagram["default"]; | ||
exports.OrgDiagram = OrgDiagram; | ||
var FamDiagram = _FamDiagram["default"]; | ||
exports.FamDiagram = FamDiagram; | ||
var BackgroundAnnotationConfig = _BackgroundAnnotationConfig["default"]; | ||
exports.BackgroundAnnotationConfig = BackgroundAnnotationConfig; | ||
var ConnectorAnnotationConfig = _ConnectorAnnotationConfig["default"]; | ||
exports.ConnectorAnnotationConfig = ConnectorAnnotationConfig; | ||
var FamDiagramConfig = _FamDiagramConfig["default"]; | ||
exports.FamDiagramConfig = FamDiagramConfig; | ||
var FamDiagramItemConfig = _FamDiagramItemConfig["default"]; | ||
exports.FamDiagramItemConfig = FamDiagramItemConfig; | ||
var HighlightPathAnnotationConfig = _HighlightPathAnnotationConfig["default"]; | ||
exports.HighlightPathAnnotationConfig = HighlightPathAnnotationConfig; | ||
var LabelAnnotationConfig = _LabelAnnotationConfig["default"]; | ||
exports.LabelAnnotationConfig = LabelAnnotationConfig; | ||
var OrgDiagramConfig = _OrgDiagramConfig["default"]; | ||
exports.OrgDiagramConfig = OrgDiagramConfig; | ||
var OrgDiagramItemConfig = _OrgDiagramItemConfig["default"]; | ||
exports.OrgDiagramItemConfig = OrgDiagramItemConfig; | ||
var PaletteItemConfig = _PaletteItemConfig["default"]; | ||
exports.PaletteItemConfig = PaletteItemConfig; | ||
var ShapeAnnotationConfig = _ShapeAnnotationConfig["default"]; | ||
exports.ShapeAnnotationConfig = ShapeAnnotationConfig; | ||
var TemplateConfig = _TemplateConfig["default"]; | ||
exports.TemplateConfig = TemplateConfig; | ||
import orgDiagram from './OrgDiagram'; | ||
import famDiagram from './FamDiagram'; | ||
export const OrgDiagram = orgDiagram; | ||
export const FamDiagram = famDiagram; |
@@ -1,52 +0,19 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _BaseDiagram2 = _interopRequireDefault(require("./BaseDiagram")); | ||
var _OrgDiagramConfig = _interopRequireDefault(require("./Schemas/OrgDiagramConfig")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var OrgDiagram = | ||
/*#__PURE__*/ | ||
function (_BaseDiagram) { | ||
_inherits(OrgDiagram, _BaseDiagram); | ||
import primitives from 'basicprimitives'; | ||
import BaseDiagram from './BaseDiagram'; | ||
import OrgDiagramConfig from './Schemas/OrgDiagramConfig'; | ||
function OrgDiagram(props) { | ||
_classCallCheck(this, OrgDiagram); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(OrgDiagram).call(this, props, _basicprimitives["default"].orgdiagram)); | ||
class OrgDiagram extends BaseDiagram { | ||
constructor(props) { | ||
super(props, primitives.orgdiagram); | ||
} | ||
return OrgDiagram; | ||
}(_BaseDiagram2["default"]); | ||
} | ||
_defineProperty(OrgDiagram, "propTypes", { | ||
config: _OrgDiagramConfig["default"].isRequired // eslint-disable-line react/no-unused-prop-types | ||
config: OrgDiagramConfig.isRequired // eslint-disable-line react/no-unused-prop-types | ||
}); | ||
var _default = OrgDiagram; | ||
exports["default"] = _default; | ||
export default OrgDiagram; |
@@ -1,34 +0,21 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var BackgroundAnnotationConfig = _propTypes["default"].shape({ | ||
annotationType: _propTypes["default"].oneOf([_basicprimitives["default"].common.AnnotationType.Background]), | ||
items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
includeChildren: _propTypes["default"].bool, | ||
zOrderType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ZOrderType)), | ||
offset: _propTypes["default"].shape({ | ||
left: _propTypes["default"].number.isRequired, | ||
top: _propTypes["default"].number.isRequired, | ||
right: _propTypes["default"].number.isRequired, | ||
bottom: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const BackgroundAnnotationConfig = PropTypes.shape({ | ||
annotationType: PropTypes.oneOf([primitives.common.AnnotationType.Background]), | ||
items: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
includeChildren: PropTypes.bool, | ||
zOrderType: PropTypes.oneOf(Object.values(primitives.common.ZOrderType)), | ||
offset: PropTypes.shape({ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired | ||
}), | ||
lineWidth: _propTypes["default"].number, | ||
opacity: _propTypes["default"].number, | ||
borderColor: _propTypes["default"].string, | ||
fillColor: _propTypes["default"].string, | ||
lineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
selectItems: _propTypes["default"].bool | ||
lineWidth: PropTypes.number, | ||
opacity: PropTypes.number, | ||
borderColor: PropTypes.string, | ||
fillColor: PropTypes.string, | ||
lineType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
selectItems: PropTypes.bool | ||
}); | ||
var _default = BackgroundAnnotationConfig; | ||
exports["default"] = _default; | ||
export default BackgroundAnnotationConfig; |
@@ -1,40 +0,27 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var ConnectorAnnotationConfig = _propTypes["default"].shape({ | ||
annotationType: _propTypes["default"].oneOf([_basicprimitives["default"].common.AnnotationType.Connector]), | ||
zOrderType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ZOrderType)), | ||
fromItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
toItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
connectorShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ConnectorShapeType)), | ||
connectorPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ConnectorPlacementType)), | ||
labelPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ConnectorLabelPlacementType)), | ||
offset: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].shape({ | ||
left: _propTypes["default"].number.isRequired, | ||
top: _propTypes["default"].number.isRequired, | ||
right: _propTypes["default"].number.isRequired, | ||
bottom: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const ConnectorAnnotationConfig = PropTypes.shape({ | ||
annotationType: PropTypes.oneOf([primitives.common.AnnotationType.Connector]), | ||
zOrderType: PropTypes.oneOf(Object.values(primitives.common.ZOrderType)), | ||
fromItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
toItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
connectorShapeType: PropTypes.oneOf(Object.values(primitives.common.ConnectorShapeType)), | ||
connectorPlacementType: PropTypes.oneOf(Object.values(primitives.common.ConnectorPlacementType)), | ||
labelPlacementType: PropTypes.oneOf(Object.values(primitives.common.ConnectorLabelPlacementType)), | ||
offset: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired | ||
})]), | ||
lineWidth: _propTypes["default"].number, | ||
color: _propTypes["default"].string, | ||
lineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
selectItems: _propTypes["default"].bool, | ||
label: _propTypes["default"].string, | ||
size: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
lineWidth: PropTypes.number, | ||
color: PropTypes.string, | ||
lineType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
selectItems: PropTypes.bool, | ||
label: PropTypes.string, | ||
size: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}) | ||
}); | ||
var _default = ConnectorAnnotationConfig; | ||
exports["default"] = _default; | ||
export default ConnectorAnnotationConfig; |
@@ -1,135 +0,114 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _FamDiagramItemConfig = _interopRequireDefault(require("./FamDiagramItemConfig")); | ||
var _TemplateConfig = _interopRequireDefault(require("./TemplateConfig")); | ||
var _BackgroundAnnotationConfig = _interopRequireDefault(require("./BackgroundAnnotationConfig")); | ||
var _ConnectorAnnotationConfig = _interopRequireDefault(require("./ConnectorAnnotationConfig")); | ||
var _HighlightPathAnnotationConfig = _interopRequireDefault(require("./HighlightPathAnnotationConfig")); | ||
var _ShapeAnnotationConfig = _interopRequireDefault(require("./ShapeAnnotationConfig")); | ||
var _LabelAnnotationConfig = _interopRequireDefault(require("./LabelAnnotationConfig")); | ||
var _PaletteItemConfig = _interopRequireDefault(require("./PaletteItemConfig")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var Config = _propTypes["default"].shape({ | ||
navigationMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.NavigationMode)), | ||
graphicsType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.GraphicsType)), | ||
pageFitMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PageFitMode)), | ||
minimalVisibility: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Visibility)), | ||
orientationType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.OrientationType)), | ||
verticalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.VerticalAlignmentType)), | ||
arrowsDirection: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.GroupByType)), | ||
showExtraArrows: _propTypes["default"].bool, | ||
extraArrowsMinimumSpace: _propTypes["default"].number, | ||
groupByType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.GroupByType)), | ||
alignBylevels: _propTypes["default"].bool, | ||
enableMatrixLayout: _propTypes["default"].bool, | ||
minimumMatrixSize: _propTypes["default"].number, | ||
maximumColumnsInMatrix: _propTypes["default"].number, | ||
hideGrandParentsConnectors: _propTypes["default"].bool, | ||
bevelSize: _propTypes["default"].number, | ||
elbowType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ElbowType)), | ||
elbowDotSize: _propTypes["default"].number, | ||
emptyDiagramMessage: _propTypes["default"].string, | ||
items: _propTypes["default"].arrayOf(_FamDiagramItemConfig["default"]), | ||
annotations: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_BackgroundAnnotationConfig["default"], _ConnectorAnnotationConfig["default"], _HighlightPathAnnotationConfig["default"], _ShapeAnnotationConfig["default"], _LabelAnnotationConfig["default"]])), | ||
cursorItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
highlightItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
highlightGravityRadius: _propTypes["default"].number, | ||
selectedItems: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
hasSelectorCheckbox: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
selectCheckBoxLabel: _propTypes["default"].string, | ||
selectionPathMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.SelectionPathMode)), | ||
neighboursSelectionMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.NeighboursSelectionMode)), | ||
templates: _propTypes["default"].arrayOf(_TemplateConfig["default"]), | ||
defaultTemplateName: _propTypes["default"].string, | ||
defaultLabelAnnotationTemplate: _propTypes["default"].string, | ||
hasButtons: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
onButtonsRender: _propTypes["default"].func, | ||
normalLevelShift: _propTypes["default"].number, | ||
dotLevelShift: _propTypes["default"].number, | ||
lineLevelShift: _propTypes["default"].number, | ||
normalItemsInterval: _propTypes["default"].number, | ||
dotItemsInterval: _propTypes["default"].number, | ||
lineItemsInterval: _propTypes["default"].number, | ||
cousinsIntervalMultiplier: _propTypes["default"].number, | ||
itemTitleFirstFontColor: _propTypes["default"].string, | ||
itemTitleSecondFontColor: _propTypes["default"].string, | ||
minimizedItemShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
linesColor: _propTypes["default"].string, | ||
linesWidth: _propTypes["default"].number, | ||
linesType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
showNeigboursConnectorsHighlighted: _propTypes["default"].bool, | ||
highlightLinesColor: _propTypes["default"].string, | ||
highlightLinesWidth: _propTypes["default"].number, | ||
highlightLinesType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
linesPalette: _propTypes["default"].arrayOf(_PaletteItemConfig["default"]), | ||
calloutMaximumVisibility: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Visibility)), | ||
showCallout: _propTypes["default"].bool, | ||
calloutPlacementOffset: _propTypes["default"].number, | ||
defaultCalloutTemplateName: _propTypes["default"].string, | ||
calloutfillColor: _propTypes["default"].string, | ||
calloutBorderColor: _propTypes["default"].string, | ||
calloutOffset: _propTypes["default"].number, | ||
calloutCornerRadius: _propTypes["default"].number, | ||
calloutPointerWidth: _propTypes["default"].string, | ||
calloutLineWidth: _propTypes["default"].number, | ||
calloutOpacity: _propTypes["default"].number, | ||
buttonsPanelSize: _propTypes["default"].number, | ||
groupTitlePanelSize: _propTypes["default"].number, | ||
checkBoxPanelSize: _propTypes["default"].number, | ||
groupTitlePlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.AdviserPlacementType)), | ||
groupTitleOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)), | ||
groupTitleVerticalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.VerticalAlignmentType)), | ||
groupTitleHorizontalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.HorizontalAlignmentType)), | ||
groupTitleFontSize: _propTypes["default"].string, | ||
groupTitleFontFamily: _propTypes["default"].string, | ||
groupTitleColor: _propTypes["default"].string, | ||
groupTitleFontWeight: _propTypes["default"].string, | ||
groupTitleFontStyle: _propTypes["default"].string, | ||
distance: _propTypes["default"].number, | ||
scale: _propTypes["default"].number, | ||
minimumScale: _propTypes["default"].number, | ||
maximumScale: _propTypes["default"].number, | ||
showLabels: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
labelSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
import ItemConfig from './FamDiagramItemConfig'; | ||
import TemplateConfig from './TemplateConfig'; | ||
import BackgroundAnnotationConfig from './BackgroundAnnotationConfig'; | ||
import ConnectorAnnotationConfig from './ConnectorAnnotationConfig'; | ||
import HighlightPathAnnotationConfig from './HighlightPathAnnotationConfig'; | ||
import ShapeAnnotationConfig from './ShapeAnnotationConfig'; | ||
import LabelAnnotationConfig from './LabelAnnotationConfig'; | ||
import PaletteItemConfig from './PaletteItemConfig'; | ||
const Config = PropTypes.shape({ | ||
navigationMode: PropTypes.oneOf(Object.values(primitives.common.NavigationMode)), | ||
graphicsType: PropTypes.oneOf(Object.values(primitives.common.GraphicsType)), | ||
pageFitMode: PropTypes.oneOf(Object.values(primitives.common.PageFitMode)), | ||
minimalVisibility: PropTypes.oneOf(Object.values(primitives.common.Visibility)), | ||
orientationType: PropTypes.oneOf(Object.values(primitives.common.OrientationType)), | ||
verticalAlignment: PropTypes.oneOf(Object.values(primitives.common.VerticalAlignmentType)), | ||
arrowsDirection: PropTypes.oneOf(Object.values(primitives.common.GroupByType)), | ||
showExtraArrows: PropTypes.bool, | ||
extraArrowsMinimumSpace: PropTypes.number, | ||
groupByType: PropTypes.oneOf(Object.values(primitives.common.GroupByType)), | ||
alignBylevels: PropTypes.bool, | ||
enableMatrixLayout: PropTypes.bool, | ||
minimumMatrixSize: PropTypes.number, | ||
maximumColumnsInMatrix: PropTypes.number, | ||
hideGrandParentsConnectors: PropTypes.bool, | ||
bevelSize: PropTypes.number, | ||
elbowType: PropTypes.oneOf(Object.values(primitives.common.ElbowType)), | ||
elbowDotSize: PropTypes.number, | ||
emptyDiagramMessage: PropTypes.string, | ||
items: PropTypes.arrayOf(ItemConfig), | ||
annotations: PropTypes.arrayOf(PropTypes.oneOfType([BackgroundAnnotationConfig, ConnectorAnnotationConfig, HighlightPathAnnotationConfig, ShapeAnnotationConfig, LabelAnnotationConfig])), | ||
cursorItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
highlightItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
highlightGravityRadius: PropTypes.number, | ||
selectedItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
hasSelectorCheckbox: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
selectCheckBoxLabel: PropTypes.string, | ||
selectionPathMode: PropTypes.oneOf(Object.values(primitives.common.SelectionPathMode)), | ||
neighboursSelectionMode: PropTypes.oneOf(Object.values(primitives.common.NeighboursSelectionMode)), | ||
templates: PropTypes.arrayOf(TemplateConfig), | ||
defaultTemplateName: PropTypes.string, | ||
defaultLabelAnnotationTemplate: PropTypes.string, | ||
hasButtons: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
onButtonsRender: PropTypes.func, | ||
normalLevelShift: PropTypes.number, | ||
dotLevelShift: PropTypes.number, | ||
lineLevelShift: PropTypes.number, | ||
normalItemsInterval: PropTypes.number, | ||
dotItemsInterval: PropTypes.number, | ||
lineItemsInterval: PropTypes.number, | ||
cousinsIntervalMultiplier: PropTypes.number, | ||
itemTitleFirstFontColor: PropTypes.string, | ||
itemTitleSecondFontColor: PropTypes.string, | ||
minimizedItemShapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
linesColor: PropTypes.string, | ||
linesWidth: PropTypes.number, | ||
linesType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
showNeigboursConnectorsHighlighted: PropTypes.bool, | ||
highlightLinesColor: PropTypes.string, | ||
highlightLinesWidth: PropTypes.number, | ||
highlightLinesType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
linesPalette: PropTypes.arrayOf(PaletteItemConfig), | ||
calloutMaximumVisibility: PropTypes.oneOf(Object.values(primitives.common.Visibility)), | ||
showCallout: PropTypes.bool, | ||
calloutPlacementOffset: PropTypes.number, | ||
defaultCalloutTemplateName: PropTypes.string, | ||
calloutfillColor: PropTypes.string, | ||
calloutBorderColor: PropTypes.string, | ||
calloutOffset: PropTypes.number, | ||
calloutCornerRadius: PropTypes.number, | ||
calloutPointerWidth: PropTypes.string, | ||
calloutLineWidth: PropTypes.number, | ||
calloutOpacity: PropTypes.number, | ||
buttonsPanelSize: PropTypes.number, | ||
groupTitlePanelSize: PropTypes.number, | ||
checkBoxPanelSize: PropTypes.number, | ||
groupTitlePlacementType: PropTypes.oneOf(Object.values(primitives.common.AdviserPlacementType)), | ||
groupTitleOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)), | ||
groupTitleVerticalAlignment: PropTypes.oneOf(Object.values(primitives.common.VerticalAlignmentType)), | ||
groupTitleHorizontalAlignment: PropTypes.oneOf(Object.values(primitives.common.HorizontalAlignmentType)), | ||
groupTitleFontSize: PropTypes.string, | ||
groupTitleFontFamily: PropTypes.string, | ||
groupTitleColor: PropTypes.string, | ||
groupTitleFontWeight: PropTypes.string, | ||
groupTitleFontStyle: PropTypes.string, | ||
distance: PropTypes.number, | ||
scale: PropTypes.number, | ||
minimumScale: PropTypes.number, | ||
maximumScale: PropTypes.number, | ||
showLabels: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
labelSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
labelOffset: _propTypes["default"].number, | ||
labelOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)), | ||
labelPlacement: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PlacementType)), | ||
labelFontSize: _propTypes["default"].string, | ||
labelFontFamily: _propTypes["default"].string, | ||
labelColor: _propTypes["default"].string, | ||
labelFontWeight: _propTypes["default"].string, | ||
labelFontStyle: _propTypes["default"].string, | ||
enablePanning: _propTypes["default"].bool, | ||
autoSizeMinimum: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
labelOffset: PropTypes.number, | ||
labelOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)), | ||
labelPlacement: PropTypes.oneOf(Object.values(primitives.common.PlacementType)), | ||
labelFontSize: PropTypes.string, | ||
labelFontFamily: PropTypes.string, | ||
labelColor: PropTypes.string, | ||
labelFontWeight: PropTypes.string, | ||
labelFontStyle: PropTypes.string, | ||
enablePanning: PropTypes.bool, | ||
autoSizeMinimum: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
autoSizeMaximum: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
autoSizeMaximum: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}) | ||
}); | ||
var _default = Config; | ||
exports["default"] = _default; | ||
export default Config; |
@@ -1,43 +0,30 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var ItemConfig = _propTypes["default"].shape({ | ||
id: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]).isRequired, | ||
parents: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
spouses: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
title: _propTypes["default"].string, | ||
description: _propTypes["default"].string, | ||
image: _propTypes["default"].string, | ||
context: _propTypes["default"].any, | ||
itemTitleColor: _propTypes["default"].string, | ||
minimizedItemShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
groupTitle: _propTypes["default"].string, | ||
groupTitleColor: _propTypes["default"].string, | ||
isActive: _propTypes["default"].bool, | ||
hasSelectorCheckbox: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
hasButtons: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
templateName: _propTypes["default"].string, | ||
showCallout: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
calloutTemplateName: _propTypes["default"].string, | ||
label: _propTypes["default"].string, | ||
showLabel: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
labelSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const ItemConfig = PropTypes.shape({ | ||
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, | ||
parents: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
spouses: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
image: PropTypes.string, | ||
context: PropTypes.any, | ||
itemTitleColor: PropTypes.string, | ||
minimizedItemShapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
groupTitle: PropTypes.string, | ||
groupTitleColor: PropTypes.string, | ||
isActive: PropTypes.bool, | ||
hasSelectorCheckbox: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
hasButtons: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
templateName: PropTypes.string, | ||
showCallout: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
calloutTemplateName: PropTypes.string, | ||
label: PropTypes.string, | ||
showLabel: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
labelSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
labelOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)), | ||
labelPlacement: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PlacementType)) | ||
labelOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)), | ||
labelPlacement: PropTypes.oneOf(Object.values(primitives.common.PlacementType)) | ||
}); | ||
var _default = ItemConfig; | ||
exports["default"] = _default; | ||
export default ItemConfig; |
@@ -1,27 +0,14 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const HighlightPathAnnotationConfig = PropTypes.shape({ | ||
annotationType: PropTypes.oneOf([primitives.common.AnnotationType.HighlightPath]), | ||
zOrderType: PropTypes.oneOf(Object.values(primitives.common.ZOrderType)), | ||
items: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
lineWidth: PropTypes.number, | ||
color: PropTypes.string, | ||
lineType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
opacity: PropTypes.number, | ||
showArrows: PropTypes.bool, | ||
selectItems: PropTypes.bool | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var HighlightPathAnnotationConfig = _propTypes["default"].shape({ | ||
annotationType: _propTypes["default"].oneOf([_basicprimitives["default"].common.AnnotationType.HighlightPath]), | ||
zOrderType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ZOrderType)), | ||
items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
lineWidth: _propTypes["default"].number, | ||
color: _propTypes["default"].string, | ||
lineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
opacity: _propTypes["default"].number, | ||
showArrows: _propTypes["default"].bool, | ||
selectItems: _propTypes["default"].bool | ||
}); | ||
var _default = HighlightPathAnnotationConfig; | ||
exports["default"] = _default; | ||
export default HighlightPathAnnotationConfig; |
@@ -1,24 +0,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const LabelAnnotationConfig = PropTypes.shape({ | ||
annotationType: PropTypes.oneOf([primitives.common.AnnotationType.Label]), | ||
fromItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, | ||
toItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])).isRequired, | ||
title: PropTypes.string, | ||
itemTitleColor: PropTypes.string, | ||
templateName: PropTypes.string | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var LabelAnnotationConfig = _propTypes["default"].shape({ | ||
annotationType: _propTypes["default"].oneOf([_basicprimitives["default"].common.AnnotationType.Label]), | ||
fromItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]).isRequired, | ||
toItems: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])).isRequired, | ||
title: _propTypes["default"].string, | ||
itemTitleColor: _propTypes["default"].string, | ||
templateName: _propTypes["default"].string | ||
}); | ||
var _default = LabelAnnotationConfig; | ||
exports["default"] = _default; | ||
export default LabelAnnotationConfig; |
@@ -1,127 +0,108 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _OrgDiagramItemConfig = _interopRequireDefault(require("./OrgDiagramItemConfig")); | ||
var _TemplateConfig = _interopRequireDefault(require("./TemplateConfig")); | ||
var _BackgroundAnnotationConfig = _interopRequireDefault(require("./BackgroundAnnotationConfig")); | ||
var _ConnectorAnnotationConfig = _interopRequireDefault(require("./ConnectorAnnotationConfig")); | ||
var _HighlightPathAnnotationConfig = _interopRequireDefault(require("./HighlightPathAnnotationConfig")); | ||
var _ShapeAnnotationConfig = _interopRequireDefault(require("./ShapeAnnotationConfig")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var Config = _propTypes["default"].shape({ | ||
navigationMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.NavigationMode)), | ||
graphicsType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.GraphicsType)), | ||
pageFitMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PageFitMode)), | ||
minimalVisibility: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Visibility)), | ||
orientationType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.OrientationType)), | ||
horizontalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.HorizontalAlignmentType)), | ||
verticalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.VerticalAlignmentType)), | ||
arrowsDirection: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.GroupByType)), | ||
showExtraArrows: _propTypes["default"].bool, | ||
extraArrowsMinimumSpace: _propTypes["default"].number, | ||
showHorizontalArrows: _propTypes["default"].bool, | ||
connectorType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ConnectorType)), | ||
bevelSize: _propTypes["default"].number, | ||
elbowType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ElbowType)), | ||
elbowDotSize: _propTypes["default"].number, | ||
emptyDiagramMessage: _propTypes["default"].string, | ||
items: _propTypes["default"].arrayOf(_OrgDiagramItemConfig["default"]), | ||
annotations: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_BackgroundAnnotationConfig["default"], _ConnectorAnnotationConfig["default"], _HighlightPathAnnotationConfig["default"], _ShapeAnnotationConfig["default"]])), | ||
cursorItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
highlightItem: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
highlightGravityRadius: _propTypes["default"].number, | ||
selectedItems: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
hasSelectorCheckbox: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
selectCheckBoxLabel: _propTypes["default"].string, | ||
selectionPathMode: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.SelectionPathMode)), | ||
templates: _propTypes["default"].arrayOf(_TemplateConfig["default"]), | ||
defaultTemplateName: _propTypes["default"].string, | ||
hasButtons: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
onButtonsRender: _propTypes["default"].func, | ||
normalLevelShift: _propTypes["default"].number, | ||
dotLevelShift: _propTypes["default"].number, | ||
lineLevelShift: _propTypes["default"].number, | ||
normalItemsInterval: _propTypes["default"].number, | ||
dotItemsInterval: _propTypes["default"].number, | ||
lineItemsInterval: _propTypes["default"].number, | ||
cousinsIntervalMultiplier: _propTypes["default"].number, | ||
itemTitleFirstFontColor: _propTypes["default"].string, | ||
itemTitleSecondFontColor: _propTypes["default"].string, | ||
minimizedItemShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
linesColor: _propTypes["default"].string, | ||
linesWidth: _propTypes["default"].number, | ||
linesType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
highlightLinesColor: _propTypes["default"].string, | ||
highlightLinesWidth: _propTypes["default"].number, | ||
highlightLinesType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
calloutMaximumVisibility: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Visibility)), | ||
showCallout: _propTypes["default"].bool, | ||
calloutPlacementOffset: _propTypes["default"].number, | ||
defaultCalloutTemplateName: _propTypes["default"].string, | ||
calloutfillColor: _propTypes["default"].string, | ||
calloutBorderColor: _propTypes["default"].string, | ||
calloutOffset: _propTypes["default"].number, | ||
calloutCornerRadius: _propTypes["default"].number, | ||
calloutPointerWidth: _propTypes["default"].string, | ||
calloutLineWidth: _propTypes["default"].number, | ||
calloutOpacity: _propTypes["default"].number, | ||
childrenPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ChildrenPlacementType)), | ||
leavesPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ChildrenPlacementType)), | ||
maximumColumnsInMatrix: _propTypes["default"].number, | ||
buttonsPanelSize: _propTypes["default"].number, | ||
groupTitlePanelSize: _propTypes["default"].number, | ||
checkBoxPanelSize: _propTypes["default"].number, | ||
groupTitlePlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.AdviserPlacementType)), | ||
groupTitleOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)), | ||
groupTitleVerticalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.VerticalAlignmentType)), | ||
groupTitleHorizontalAlignment: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.HorizontalAlignmentType)), | ||
groupTitleFontSize: _propTypes["default"].string, | ||
groupTitleFontFamily: _propTypes["default"].string, | ||
groupTitleColor: _propTypes["default"].string, | ||
groupTitleFontWeight: _propTypes["default"].string, | ||
groupTitleFontStyle: _propTypes["default"].string, | ||
distance: _propTypes["default"].number, | ||
scale: _propTypes["default"].number, | ||
minimumScale: _propTypes["default"].number, | ||
maximumScale: _propTypes["default"].number, | ||
showLabels: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
labelSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
import ItemConfig from './OrgDiagramItemConfig'; | ||
import TemplateConfig from './TemplateConfig'; | ||
import BackgroundAnnotationConfig from './BackgroundAnnotationConfig'; | ||
import ConnectorAnnotationConfig from './ConnectorAnnotationConfig'; | ||
import HighlightPathAnnotationConfig from './HighlightPathAnnotationConfig'; | ||
import ShapeAnnotationConfig from './ShapeAnnotationConfig'; | ||
const Config = PropTypes.shape({ | ||
navigationMode: PropTypes.oneOf(Object.values(primitives.common.NavigationMode)), | ||
graphicsType: PropTypes.oneOf(Object.values(primitives.common.GraphicsType)), | ||
pageFitMode: PropTypes.oneOf(Object.values(primitives.common.PageFitMode)), | ||
minimalVisibility: PropTypes.oneOf(Object.values(primitives.common.Visibility)), | ||
orientationType: PropTypes.oneOf(Object.values(primitives.common.OrientationType)), | ||
horizontalAlignment: PropTypes.oneOf(Object.values(primitives.common.HorizontalAlignmentType)), | ||
verticalAlignment: PropTypes.oneOf(Object.values(primitives.common.VerticalAlignmentType)), | ||
arrowsDirection: PropTypes.oneOf(Object.values(primitives.common.GroupByType)), | ||
showExtraArrows: PropTypes.bool, | ||
extraArrowsMinimumSpace: PropTypes.number, | ||
showHorizontalArrows: PropTypes.bool, | ||
connectorType: PropTypes.oneOf(Object.values(primitives.common.ConnectorType)), | ||
bevelSize: PropTypes.number, | ||
elbowType: PropTypes.oneOf(Object.values(primitives.common.ElbowType)), | ||
elbowDotSize: PropTypes.number, | ||
emptyDiagramMessage: PropTypes.string, | ||
items: PropTypes.arrayOf(ItemConfig), | ||
annotations: PropTypes.arrayOf(PropTypes.oneOfType([BackgroundAnnotationConfig, ConnectorAnnotationConfig, HighlightPathAnnotationConfig, ShapeAnnotationConfig])), | ||
cursorItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
highlightItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
highlightGravityRadius: PropTypes.number, | ||
selectedItems: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
hasSelectorCheckbox: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
selectCheckBoxLabel: PropTypes.string, | ||
selectionPathMode: PropTypes.oneOf(Object.values(primitives.common.SelectionPathMode)), | ||
templates: PropTypes.arrayOf(TemplateConfig), | ||
defaultTemplateName: PropTypes.string, | ||
hasButtons: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
onButtonsRender: PropTypes.func, | ||
normalLevelShift: PropTypes.number, | ||
dotLevelShift: PropTypes.number, | ||
lineLevelShift: PropTypes.number, | ||
normalItemsInterval: PropTypes.number, | ||
dotItemsInterval: PropTypes.number, | ||
lineItemsInterval: PropTypes.number, | ||
cousinsIntervalMultiplier: PropTypes.number, | ||
itemTitleFirstFontColor: PropTypes.string, | ||
itemTitleSecondFontColor: PropTypes.string, | ||
minimizedItemShapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
linesColor: PropTypes.string, | ||
linesWidth: PropTypes.number, | ||
linesType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
highlightLinesColor: PropTypes.string, | ||
highlightLinesWidth: PropTypes.number, | ||
highlightLinesType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
calloutMaximumVisibility: PropTypes.oneOf(Object.values(primitives.common.Visibility)), | ||
showCallout: PropTypes.bool, | ||
calloutPlacementOffset: PropTypes.number, | ||
defaultCalloutTemplateName: PropTypes.string, | ||
calloutfillColor: PropTypes.string, | ||
calloutBorderColor: PropTypes.string, | ||
calloutOffset: PropTypes.number, | ||
calloutCornerRadius: PropTypes.number, | ||
calloutPointerWidth: PropTypes.string, | ||
calloutLineWidth: PropTypes.number, | ||
calloutOpacity: PropTypes.number, | ||
childrenPlacementType: PropTypes.oneOf(Object.values(primitives.common.ChildrenPlacementType)), | ||
leavesPlacementType: PropTypes.oneOf(Object.values(primitives.common.ChildrenPlacementType)), | ||
maximumColumnsInMatrix: PropTypes.number, | ||
buttonsPanelSize: PropTypes.number, | ||
groupTitlePanelSize: PropTypes.number, | ||
checkBoxPanelSize: PropTypes.number, | ||
groupTitlePlacementType: PropTypes.oneOf(Object.values(primitives.common.AdviserPlacementType)), | ||
groupTitleOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)), | ||
groupTitleVerticalAlignment: PropTypes.oneOf(Object.values(primitives.common.VerticalAlignmentType)), | ||
groupTitleHorizontalAlignment: PropTypes.oneOf(Object.values(primitives.common.HorizontalAlignmentType)), | ||
groupTitleFontSize: PropTypes.string, | ||
groupTitleFontFamily: PropTypes.string, | ||
groupTitleColor: PropTypes.string, | ||
groupTitleFontWeight: PropTypes.string, | ||
groupTitleFontStyle: PropTypes.string, | ||
distance: PropTypes.number, | ||
scale: PropTypes.number, | ||
minimumScale: PropTypes.number, | ||
maximumScale: PropTypes.number, | ||
showLabels: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
labelSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
labelOffset: _propTypes["default"].number, | ||
labelOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)), | ||
labelPlacement: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PlacementType)), | ||
labelFontSize: _propTypes["default"].string, | ||
labelFontFamily: _propTypes["default"].string, | ||
labelColor: _propTypes["default"].string, | ||
labelFontWeight: _propTypes["default"].string, | ||
labelFontStyle: _propTypes["default"].string, | ||
enablePanning: _propTypes["default"].bool, | ||
autoSizeMinimum: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
labelOffset: PropTypes.number, | ||
labelOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)), | ||
labelPlacement: PropTypes.oneOf(Object.values(primitives.common.PlacementType)), | ||
labelFontSize: PropTypes.string, | ||
labelFontFamily: PropTypes.string, | ||
labelColor: PropTypes.string, | ||
labelFontWeight: PropTypes.string, | ||
labelFontStyle: PropTypes.string, | ||
enablePanning: PropTypes.bool, | ||
autoSizeMinimum: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
autoSizeMaximum: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
autoSizeMaximum: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}) | ||
}); | ||
var _default = Config; | ||
exports["default"] = _default; | ||
export default Config; |
@@ -1,45 +0,32 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var ItemConfig = _propTypes["default"].shape({ | ||
id: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]).isRequired, | ||
parent: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]), | ||
title: _propTypes["default"].string, | ||
description: _propTypes["default"].string, | ||
image: _propTypes["default"].string, | ||
context: _propTypes["default"].any, | ||
itemTitleColor: _propTypes["default"].string, | ||
minimizedItemShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
groupTitle: _propTypes["default"].string, | ||
groupTitleColor: _propTypes["default"].string, | ||
isVisible: _propTypes["default"].bool, | ||
isActive: _propTypes["default"].bool, | ||
hasSelectorCheckbox: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
hasButtons: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
itemType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].orgdiagram.ItemType)), | ||
adviserPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.AdviserPlacementType)), | ||
childrenPlacementType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ChildrenPlacementType)), | ||
templateName: _propTypes["default"].string, | ||
showCallout: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
calloutTemplateName: _propTypes["default"].string, | ||
label: _propTypes["default"].string, | ||
showLabel: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.Enabled)), | ||
labelSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const ItemConfig = PropTypes.shape({ | ||
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired, | ||
parent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
title: PropTypes.string, | ||
description: PropTypes.string, | ||
image: PropTypes.string, | ||
context: PropTypes.any, | ||
itemTitleColor: PropTypes.string, | ||
minimizedItemShapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
groupTitle: PropTypes.string, | ||
groupTitleColor: PropTypes.string, | ||
isVisible: PropTypes.bool, | ||
isActive: PropTypes.bool, | ||
hasSelectorCheckbox: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
hasButtons: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
itemType: PropTypes.oneOf(Object.values(primitives.orgdiagram.ItemType)), | ||
adviserPlacementType: PropTypes.oneOf(Object.values(primitives.common.AdviserPlacementType)), | ||
childrenPlacementType: PropTypes.oneOf(Object.values(primitives.common.ChildrenPlacementType)), | ||
templateName: PropTypes.string, | ||
showCallout: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
calloutTemplateName: PropTypes.string, | ||
label: PropTypes.string, | ||
showLabel: PropTypes.oneOf(Object.values(primitives.common.Enabled)), | ||
labelSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
labelOrientation: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].text.TextOrientationType)) | ||
labelOrientation: PropTypes.oneOf(Object.values(primitives.text.TextOrientationType)) | ||
}); | ||
var _default = ItemConfig; | ||
exports["default"] = _default; | ||
export default ItemConfig; |
@@ -1,21 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
import primitives from 'basicprimitives'; | ||
import PropTypes from 'prop-types'; | ||
const PaletteItemConfig = PropTypes.shape({ | ||
lineColor: PropTypes.string, | ||
lineWidth: PropTypes.number, | ||
lineType: PropTypes.oneOf(Object.values(primitives.common.LineType)) | ||
}); | ||
exports["default"] = void 0; | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var PaletteItemConfig = _propTypes["default"].shape({ | ||
lineColor: _propTypes["default"].string, | ||
lineWidth: _propTypes["default"].number, | ||
lineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)) | ||
}); | ||
var _default = PaletteItemConfig; | ||
exports["default"] = _default; | ||
export default PaletteItemConfig; |
@@ -1,42 +0,29 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var ShapeAnnotationConfig = _propTypes["default"].shape({ | ||
annotationType: _propTypes["default"].oneOf([_basicprimitives["default"].common.AnnotationType.Shape]), | ||
zOrderType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ZOrderType)), | ||
items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string])), | ||
shapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
offset: _propTypes["default"].shape({ | ||
left: _propTypes["default"].number.isRequired, | ||
top: _propTypes["default"].number.isRequired, | ||
right: _propTypes["default"].number.isRequired, | ||
bottom: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const ShapeAnnotationConfig = PropTypes.shape({ | ||
annotationType: PropTypes.oneOf([primitives.common.AnnotationType.Shape]), | ||
zOrderType: PropTypes.oneOf(Object.values(primitives.common.ZOrderType)), | ||
items: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), | ||
shapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
offset: PropTypes.shape({ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired | ||
}), | ||
lineWidth: _propTypes["default"].number, | ||
cornerRadius: _propTypes["default"].string, | ||
opacity: _propTypes["default"].number, | ||
borderColor: _propTypes["default"].string, | ||
fillColor: _propTypes["default"].string, | ||
lineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
selectItems: _propTypes["default"].bool, | ||
label: _propTypes["default"].string, | ||
labelSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
lineWidth: PropTypes.number, | ||
cornerRadius: PropTypes.string, | ||
opacity: PropTypes.number, | ||
borderColor: PropTypes.string, | ||
fillColor: PropTypes.string, | ||
lineType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
selectItems: PropTypes.bool, | ||
label: PropTypes.string, | ||
labelSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
labelPlacement: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.PlacementType)), | ||
labelOffset: _propTypes["default"].number | ||
labelPlacement: PropTypes.oneOf(Object.values(primitives.common.PlacementType)), | ||
labelOffset: PropTypes.number | ||
}); | ||
var _default = ShapeAnnotationConfig; | ||
exports["default"] = _default; | ||
export default ShapeAnnotationConfig; |
@@ -1,54 +0,41 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var TemplateConfig = _propTypes["default"].shape({ | ||
name: _propTypes["default"].string, | ||
isActive: _propTypes["default"].bool, | ||
itemSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
import PropTypes from 'prop-types'; | ||
import primitives from 'basicprimitives'; | ||
const TemplateConfig = PropTypes.shape({ | ||
name: PropTypes.string, | ||
isActive: PropTypes.bool, | ||
itemSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
itemBorderWidth: _propTypes["default"].number, | ||
onItemRender: _propTypes["default"].func, | ||
minimizedItemShapeType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.ShapeType)), | ||
minimizedItemSize: _propTypes["default"].shape({ | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired | ||
itemBorderWidth: PropTypes.number, | ||
onItemRender: PropTypes.func, | ||
minimizedItemShapeType: PropTypes.oneOf(Object.values(primitives.common.ShapeType)), | ||
minimizedItemSize: PropTypes.shape({ | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired | ||
}), | ||
minimizedItemCornerRadius: _propTypes["default"].number, | ||
minimizedItemLineWidth: _propTypes["default"].number, | ||
minimizedItemBorderColor: _propTypes["default"].string, | ||
minimizedItemLineType: _propTypes["default"].oneOf(Object.values(_basicprimitives["default"].common.LineType)), | ||
minimizedItemFillColor: _propTypes["default"].string, | ||
minimizedItemOpacity: _propTypes["default"].number, | ||
highlightPadding: _propTypes["default"].shape({ | ||
left: _propTypes["default"].number.isRequired, | ||
top: _propTypes["default"].number.isRequired, | ||
right: _propTypes["default"].number.isRequired, | ||
bottom: _propTypes["default"].number.isRequired | ||
minimizedItemCornerRadius: PropTypes.number, | ||
minimizedItemLineWidth: PropTypes.number, | ||
minimizedItemBorderColor: PropTypes.string, | ||
minimizedItemLineType: PropTypes.oneOf(Object.values(primitives.common.LineType)), | ||
minimizedItemFillColor: PropTypes.string, | ||
minimizedItemOpacity: PropTypes.number, | ||
highlightPadding: PropTypes.shape({ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired | ||
}), | ||
highlightBorderWidth: _propTypes["default"].number, | ||
onHighlightRender: _propTypes["default"].func, | ||
cursorPadding: _propTypes["default"].shape({ | ||
left: _propTypes["default"].number.isRequired, | ||
top: _propTypes["default"].number.isRequired, | ||
right: _propTypes["default"].number.isRequired, | ||
bottom: _propTypes["default"].number.isRequired | ||
highlightBorderWidth: PropTypes.number, | ||
onHighlightRender: PropTypes.func, | ||
cursorPadding: PropTypes.shape({ | ||
left: PropTypes.number.isRequired, | ||
top: PropTypes.number.isRequired, | ||
right: PropTypes.number.isRequired, | ||
bottom: PropTypes.number.isRequired | ||
}), | ||
cursorBorderWidth: _propTypes["default"].number, | ||
onCursorRender: _propTypes["default"].func, | ||
onButtonsRender: _propTypes["default"].func | ||
cursorBorderWidth: PropTypes.number, | ||
onCursorRender: PropTypes.func, | ||
onButtonsRender: PropTypes.func | ||
}); | ||
var _default = TemplateConfig; | ||
exports["default"] = _default; | ||
export default TemplateConfig; |
@@ -1,37 +0,11 @@ | ||
"use strict"; | ||
class AbstractTemplate { | ||
template() {} | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
getHashCode() {} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
render(data) {} | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
} | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
var AbstractTemplate = | ||
/*#__PURE__*/ | ||
function () { | ||
function AbstractTemplate() { | ||
_classCallCheck(this, AbstractTemplate); | ||
} | ||
_createClass(AbstractTemplate, [{ | ||
key: "template", | ||
value: function template() {} | ||
}, { | ||
key: "getHashCode", | ||
value: function getHashCode() {} | ||
}, { | ||
key: "render", | ||
value: function render(data) {} | ||
}]); | ||
return AbstractTemplate; | ||
}(); | ||
; | ||
var _default = AbstractTemplate; | ||
exports["default"] = _default; | ||
export default AbstractTemplate; |
@@ -1,54 +0,14 @@ | ||
"use strict"; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var AnnotationLabelTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(AnnotationLabelTemplate, _AbstractTemplate); | ||
function AnnotationLabelTemplate() { | ||
_classCallCheck(this, AnnotationLabelTemplate); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(AnnotationLabelTemplate).apply(this, arguments)); | ||
class AnnotationLabelTemplate extends AbstractTemplate { | ||
render(data) { | ||
var { | ||
label | ||
} = data.context; | ||
return label; | ||
} | ||
_createClass(AnnotationLabelTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var label = data.context.label; | ||
return label; | ||
} | ||
}]); | ||
} | ||
return AnnotationLabelTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = AnnotationLabelTemplate; | ||
exports["default"] = _default; | ||
export default AnnotationLabelTemplate; |
@@ -1,54 +0,14 @@ | ||
"use strict"; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var ButtonsTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(ButtonsTemplate, _AbstractTemplate); | ||
function ButtonsTemplate() { | ||
_classCallCheck(this, ButtonsTemplate); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(ButtonsTemplate).apply(this, arguments)); | ||
class ButtonsTemplate extends AbstractTemplate { | ||
render(data) { | ||
const { | ||
onButtonsRender | ||
} = data; | ||
return onButtonsRender(data); | ||
} | ||
_createClass(ButtonsTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var onButtonsRender = data.onButtonsRender; | ||
return onButtonsRender(data); | ||
} | ||
}]); | ||
} | ||
return ButtonsTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = ButtonsTemplate; | ||
exports["default"] = _default; | ||
export default ButtonsTemplate; |
@@ -1,82 +0,30 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class CheckBoxTemplate extends AbstractTemplate { | ||
constructor(selectCheckBoxLabel) { | ||
super(); | ||
this.render = this.render.bind(this); | ||
this.selectCheckBoxLabel = selectCheckBoxLabel; | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var CheckBoxTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(CheckBoxTemplate, _AbstractTemplate); | ||
function CheckBoxTemplate(selectCheckBoxLabel) { | ||
var _this; | ||
_classCallCheck(this, CheckBoxTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(CheckBoxTemplate).call(this)); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
_this.selectCheckBoxLabel = selectCheckBoxLabel; | ||
return _this; | ||
render(data) { | ||
return React.createElement("div", { | ||
className: "BPSelectionCheckBoxContainer" | ||
}, React.createElement("input", { | ||
type: "checkbox", | ||
name: "checkbox", | ||
className: "BPSelectionCheckBox", | ||
checked: data.isSelected, | ||
"data-id": data.id | ||
}), React.createElement("span", { | ||
name: "selectiontext", | ||
className: "BPSelectionText", | ||
"data-id": data.id | ||
}, this.selectCheckBoxLabel)); | ||
} | ||
_createClass(CheckBoxTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
return _react["default"].createElement("div", { | ||
style: { | ||
textAlign: "left" | ||
} | ||
}, _react["default"].createElement("input", { | ||
type: "checkbox", | ||
name: "checkbox", | ||
style: { | ||
fontSize: "12px", | ||
lineHeight: "12px", | ||
verticalAlign: "middle" | ||
}, | ||
checked: data.isSelected, | ||
"data-id": data.id | ||
}), _react["default"].createElement("span", { | ||
name: "selectiontext", | ||
style: { | ||
fontSize: "12px", | ||
lineHeight: "12px", | ||
verticalAlign: "middle" | ||
}, | ||
"data-id": data.id | ||
}, this.selectCheckBoxLabel)); | ||
} | ||
}]); | ||
} | ||
return CheckBoxTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = CheckBoxTemplate; | ||
exports["default"] = _default; | ||
export default CheckBoxTemplate; |
@@ -1,103 +0,32 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class CursorTemplate extends AbstractTemplate { | ||
constructor(options, itemTemplateConfig) { | ||
super(); | ||
this.options = options; | ||
this.itemTemplateConfig = itemTemplateConfig; | ||
this.render = this.render.bind(this); | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var CursorTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(CursorTemplate, _AbstractTemplate); | ||
function CursorTemplate(options, itemTemplateConfig) { | ||
var _this; | ||
_classCallCheck(this, CursorTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(CursorTemplate).call(this)); | ||
_this.options = options; | ||
_this.itemTemplateConfig = itemTemplateConfig; | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
_this.style = { | ||
position: "absolute", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box", | ||
MozBorderRadius: "4px", | ||
WebkitBorderRadius: "4px", | ||
KhtmlBorderRadius: "4px", | ||
BorderRadius: "4px", | ||
border: "2px solid #fbd850", | ||
background: "#ffffff", | ||
color: "#eb8f00", | ||
width: "100%", | ||
height: "100%", | ||
left: "-2px", | ||
top: "-2px" | ||
render(data) { | ||
const { | ||
cursorPadding, | ||
itemSize, | ||
cursorBorderWidth | ||
} = this.itemTemplateConfig; | ||
const style = { | ||
width: itemSize.width + cursorPadding.left + cursorPadding.right + "px", | ||
height: itemSize.height + cursorPadding.top + cursorPadding.bottom + "px", | ||
borderWidth: cursorBorderWidth + "px" | ||
}; | ||
return _this; | ||
return React.createElement("div", { | ||
className: "BPCursorFrame", | ||
style: style | ||
}); | ||
} | ||
_createClass(CursorTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var _this$itemTemplateCon = this.itemTemplateConfig, | ||
cursorPadding = _this$itemTemplateCon.cursorPadding, | ||
itemSize = _this$itemTemplateCon.itemSize, | ||
cursorBorderWidth = _this$itemTemplateCon.cursorBorderWidth; | ||
} | ||
var style = _objectSpread({}, this.style, { | ||
width: itemSize.width + cursorPadding.left + cursorPadding.right + "px", | ||
height: itemSize.height + cursorPadding.top + cursorPadding.bottom + "px", | ||
borderWidth: cursorBorderWidth + "px" | ||
}); | ||
return _react["default"].createElement("div", { | ||
style: style | ||
}); | ||
} | ||
}]); | ||
return CursorTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = CursorTemplate; | ||
exports["default"] = _default; | ||
export default CursorTemplate; |
@@ -1,110 +0,44 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class DotHighlightTemplate extends AbstractTemplate { | ||
constructor(options, itemTemplateConfig) { | ||
super(); | ||
this.render = this.render.bind(this); | ||
this.config = itemTemplateConfig; | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
render(data) { | ||
const { | ||
minimizedItemCornerRadius, | ||
highlightPadding, | ||
highlightBorderWidth, | ||
minimizedItemSize | ||
} = this.config; | ||
let radius = 0; | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
if (minimizedItemCornerRadius === null) { | ||
radius = Math.max(minimizedItemSize.width / 2, minimizedItemSize.height / 2) + highlightPadding.left; | ||
} else { | ||
radius = minimizedItemCornerRadius + highlightPadding.left; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var DotHighlightTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(DotHighlightTemplate, _AbstractTemplate); | ||
function DotHighlightTemplate(options, itemTemplateConfig) { | ||
var _this; | ||
_classCallCheck(this, DotHighlightTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(DotHighlightTemplate).call(this)); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
_this.config = itemTemplateConfig; | ||
_this.style = { | ||
position: "absolute", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box", | ||
border: "1px solid #fbcb09", | ||
background: "#fdf5ce", | ||
color: "#c77405", | ||
width: "100%", | ||
height: "100%", | ||
left: "0px", | ||
top: "0px" | ||
const style = { | ||
borderWidth: highlightBorderWidth + "px", | ||
left: -highlightBorderWidth + "px", | ||
top: -highlightBorderWidth + "px", | ||
MozBorderRadius: radius + "px", | ||
WebkitBorderRadius: radius + "px", | ||
KhtmlBorderRadius: radius + "px", | ||
borderRadius: radius + "px" | ||
}; | ||
return _this; | ||
return React.createElement("div", { | ||
className: "BPHighlightDotFrame", | ||
style: style | ||
}); | ||
} | ||
_createClass(DotHighlightTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var _this$config = this.config, | ||
minimizedItemCornerRadius = _this$config.minimizedItemCornerRadius, | ||
highlightPadding = _this$config.highlightPadding, | ||
highlightBorderWidth = _this$config.highlightBorderWidth, | ||
minimizedItemSize = _this$config.minimizedItemSize; | ||
var radius = 0; | ||
} | ||
if (minimizedItemCornerRadius === null) { | ||
radius = Math.max(minimizedItemSize.width / 2, minimizedItemSize.height / 2) + highlightPadding.left; | ||
} else { | ||
radius = minimizedItemCornerRadius + highlightPadding.left; | ||
} | ||
var style = _objectSpread({}, this.style, { | ||
borderWidth: highlightBorderWidth + "px", | ||
left: -highlightBorderWidth + "px", | ||
top: -highlightBorderWidth + "px", | ||
MozBorderRadius: radius + "px", | ||
WebkitBorderRadius: radius + "px", | ||
KhtmlBorderRadius: radius + "px", | ||
borderRadius: radius + "px" | ||
}); | ||
return _react["default"].createElement("div", { | ||
style: style | ||
}); | ||
} | ||
}]); | ||
return DotHighlightTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = DotHighlightTemplate; | ||
exports["default"] = _default; | ||
export default DotHighlightTemplate; |
@@ -1,134 +0,60 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
import RotatedText from './RotatedText'; | ||
import primitives from 'basicprimitives'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _react = _interopRequireDefault(require("react")); | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
var _RotatedText = _interopRequireDefault(require("./RotatedText")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var GroupTitleTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(GroupTitleTemplate, _AbstractTemplate); | ||
function GroupTitleTemplate(options) { | ||
var _this; | ||
_classCallCheck(this, GroupTitleTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(GroupTitleTemplate).call(this)); | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
_this.options = options; | ||
_this.style = { | ||
position: "absolute", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box", | ||
MozBorderRadius: "4px", | ||
WebkitBorderRadius: "4px", | ||
KhtmlBorderRadius: "4px", | ||
BorderRadius: "4px", | ||
background: "royalblue", | ||
borderWidth: 0, | ||
color: "white", | ||
padding: 0, | ||
width: "100%", | ||
height: "100%", | ||
left: "-1px", | ||
top: "-1px" | ||
}; | ||
return _this; | ||
class GroupTitleTemplate extends AbstractTemplate { | ||
constructor(options) { | ||
super(); | ||
this.render = this.render.bind(this); | ||
this.options = options; | ||
} | ||
_createClass(GroupTitleTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var _this$options = this.options, | ||
groupTitleFontSize = _this$options.groupTitleFontSize, | ||
groupTitleFontFamily = _this$options.groupTitleFontFamily, | ||
groupTitleFontWeight = _this$options.groupTitleFontWeight, | ||
groupTitleFontStyle = _this$options.groupTitleFontStyle, | ||
itemTitleSecondFontColor = _this$options.itemTitleSecondFontColor, | ||
itemTitleFirstFontColor = _this$options.itemTitleFirstFontColor, | ||
groupTitleOrientation = _this$options.groupTitleOrientation, | ||
groupTitleHorizontalAlignment = _this$options.groupTitleHorizontalAlignment, | ||
groupTitleVerticalAlignment = _this$options.groupTitleVerticalAlignment, | ||
groupTitleColor = _this$options.groupTitleColor; | ||
var itemConfig = data.context, | ||
width = data.width, | ||
height = data.height; | ||
var backgroundColor = itemConfig.groupTitleColor || groupTitleColor; | ||
var label = (itemConfig.groupTitle || "").replace("\n", "<br/>"); | ||
var color = _basicprimitives["default"].common.highestContrast(backgroundColor, itemTitleSecondFontColor, itemTitleFirstFontColor); | ||
var orientations = ['Horizontal', 'RotateLeft', 'RotateRight', 'Horizontal'], | ||
render(data) { | ||
const { | ||
groupTitleFontSize, | ||
groupTitleFontFamily, | ||
groupTitleFontWeight, | ||
groupTitleFontStyle, | ||
itemTitleSecondFontColor, | ||
itemTitleFirstFontColor, | ||
groupTitleOrientation, | ||
groupTitleHorizontalAlignment, | ||
groupTitleVerticalAlignment, | ||
groupTitleColor | ||
} = this.options; | ||
const { | ||
context: itemConfig, | ||
width, | ||
height | ||
} = data; | ||
const backgroundColor = itemConfig.groupTitleColor || groupTitleColor; | ||
const label = (itemConfig.groupTitle || "").replace("\n", "<br/>"); | ||
const color = primitives.common.highestContrast(backgroundColor, itemTitleSecondFontColor, itemTitleFirstFontColor); | ||
const orientations = ['Horizontal', 'RotateLeft', 'RotateRight', 'Horizontal'], | ||
horizontalAlignments = ['center', 'left', 'right'], | ||
verticalAlignments = ['top', 'middle', 'bottom']; | ||
const style = { | ||
backgroundColor, | ||
color, | ||
fontSize: groupTitleFontSize, | ||
fontFamily: groupTitleFontFamily, | ||
fontWeight: groupTitleFontWeight, | ||
fontStyle: groupTitleFontStyle | ||
}; | ||
return React.createElement("div", { | ||
className: "BPGroupTitleFrame", | ||
style: style | ||
}, React.createElement(RotatedText, { | ||
width: width, | ||
height: height, | ||
orientation: orientations[groupTitleOrientation], | ||
horizontalAlignment: horizontalAlignments[groupTitleHorizontalAlignment], | ||
verticalAlignment: verticalAlignments[groupTitleVerticalAlignment] | ||
}, label)); | ||
} | ||
var style = _objectSpread({}, this.style, { | ||
backgroundColor: backgroundColor, | ||
color: color, | ||
fontSize: groupTitleFontSize, | ||
fontFamily: groupTitleFontFamily, | ||
fontWeight: groupTitleFontWeight, | ||
fontStyle: groupTitleFontStyle | ||
}); | ||
} | ||
return _react["default"].createElement("div", { | ||
style: style | ||
}, _react["default"].createElement(_RotatedText["default"], { | ||
width: width, | ||
height: height, | ||
orientation: orientations[groupTitleOrientation], | ||
horizontalAlignment: horizontalAlignments[groupTitleHorizontalAlignment], | ||
verticalAlignment: verticalAlignments[groupTitleVerticalAlignment] | ||
}, label)); | ||
} | ||
}]); | ||
return GroupTitleTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = GroupTitleTemplate; | ||
exports["default"] = _default; | ||
export default GroupTitleTemplate; |
@@ -1,95 +0,28 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class HighlightTemplate extends AbstractTemplate { | ||
constructor(options, config) { | ||
super(); | ||
this.options = options; | ||
this.config = config; | ||
this.render = this.render.bind(this); | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var HighlightTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(HighlightTemplate, _AbstractTemplate); | ||
function HighlightTemplate(options, config) { | ||
var _this; | ||
_classCallCheck(this, HighlightTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(HighlightTemplate).call(this)); | ||
_this.options = options; | ||
_this.config = config; | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); | ||
_this.style = { | ||
position: "absolute", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box", | ||
MozBorderRadius: "4px", | ||
WebkitBorderRadius: "4px", | ||
KhtmlBorderRadius: "4px", | ||
BorderRadius: "4px", | ||
border: "1px solid #fbcb09", | ||
background: "#fdf5ce", | ||
color: "#c77405", | ||
width: "100%", | ||
height: "100%", | ||
left: "-1px", | ||
top: "-1px" | ||
render(data) { | ||
const { | ||
highlightBorderWidth | ||
} = this.config; | ||
const style = { | ||
borderWidth: highlightBorderWidth + "px" | ||
}; | ||
return _this; | ||
return React.createElement("div", { | ||
className: "BPHighlightFrame", | ||
style: style | ||
}); | ||
} | ||
_createClass(HighlightTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var highlightBorderWidth = this.config.highlightBorderWidth; | ||
return _react["default"].createElement("div", { | ||
style: _objectSpread({}, this.style, { | ||
borderWidth: highlightBorderWidth + "px" | ||
}) | ||
}); | ||
} | ||
}]); | ||
} | ||
return HighlightTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = HighlightTemplate; | ||
exports["default"] = _default; | ||
export default HighlightTemplate; |
@@ -1,49 +0,20 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.LabelAnnotationTemplate = exports.UserTemplate = exports.ItemTemplate = exports.HighlightTemplate = exports.GroupTitleTemplate = exports.DotHighlightTemplate = exports.CursorTemplate = exports.CheckBoxTemplate = exports.ButtonsTemplate = exports.AnnotationLabelTemplate = void 0; | ||
var _AnnotationLabelTemplate = _interopRequireDefault(require("./AnnotationLabelTemplate")); | ||
var _ButtonsTemplate = _interopRequireDefault(require("./ButtonsTemplate")); | ||
var _CheckBoxTemplate = _interopRequireDefault(require("./CheckBoxTemplate")); | ||
var _CursorTemplate = _interopRequireDefault(require("./CursorTemplate")); | ||
var _DotHighlightTemplate = _interopRequireDefault(require("./DotHighlightTemplate")); | ||
var _GroupTitleTemplate = _interopRequireDefault(require("./GroupTitleTemplate")); | ||
var _HighlightTemplate = _interopRequireDefault(require("./HighlightTemplate")); | ||
var _ItemTemplate = _interopRequireDefault(require("./ItemTemplate")); | ||
var _UserTemplate = _interopRequireDefault(require("./UserTemplate")); | ||
var _LabelAnnotationTemplate = _interopRequireDefault(require("./LabelAnnotationTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var AnnotationLabelTemplate = _AnnotationLabelTemplate["default"]; | ||
exports.AnnotationLabelTemplate = AnnotationLabelTemplate; | ||
var ButtonsTemplate = _ButtonsTemplate["default"]; | ||
exports.ButtonsTemplate = ButtonsTemplate; | ||
var CheckBoxTemplate = _CheckBoxTemplate["default"]; | ||
exports.CheckBoxTemplate = CheckBoxTemplate; | ||
var CursorTemplate = _CursorTemplate["default"]; | ||
exports.CursorTemplate = CursorTemplate; | ||
var DotHighlightTemplate = _DotHighlightTemplate["default"]; | ||
exports.DotHighlightTemplate = DotHighlightTemplate; | ||
var GroupTitleTemplate = _GroupTitleTemplate["default"]; | ||
exports.GroupTitleTemplate = GroupTitleTemplate; | ||
var HighlightTemplate = _HighlightTemplate["default"]; | ||
exports.HighlightTemplate = HighlightTemplate; | ||
var ItemTemplate = _ItemTemplate["default"]; | ||
exports.ItemTemplate = ItemTemplate; | ||
var UserTemplate = _UserTemplate["default"]; | ||
exports.UserTemplate = UserTemplate; | ||
var LabelAnnotationTemplate = _LabelAnnotationTemplate["default"]; | ||
exports.LabelAnnotationTemplate = LabelAnnotationTemplate; | ||
import annotationLabelTemplate from './AnnotationLabelTemplate'; | ||
import buttonsTemplate from './ButtonsTemplate'; | ||
import checkBoxTemplate from './CheckBoxTemplate'; | ||
import cursorTemplate from './CursorTemplate'; | ||
import dotHighlightTemplate from './DotHighlightTemplate'; | ||
import groupTitleTemplate from './GroupTitleTemplate'; | ||
import highlightTemplate from './HighlightTemplate'; | ||
import itemTemplate from './ItemTemplate'; | ||
import userTemplate from './UserTemplate'; | ||
import labelAnnotationTemplate from './LabelAnnotationTemplate'; | ||
export const AnnotationLabelTemplate = annotationLabelTemplate; | ||
export const ButtonsTemplate = buttonsTemplate; | ||
export const CheckBoxTemplate = checkBoxTemplate; | ||
export const CursorTemplate = cursorTemplate; | ||
export const DotHighlightTemplate = dotHighlightTemplate; | ||
export const GroupTitleTemplate = groupTitleTemplate; | ||
export const HighlightTemplate = highlightTemplate; | ||
export const ItemTemplate = itemTemplate; | ||
export const UserTemplate = userTemplate; | ||
export const LabelAnnotationTemplate = labelAnnotationTemplate; |
@@ -1,186 +0,45 @@ | ||
"use strict"; | ||
import React from 'react'; | ||
import primitives from 'basicprimitives'; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
class ItemTemplate extends AbstractTemplate { | ||
constructor(options, config) { | ||
super(); | ||
this.options = options; | ||
this.config = config; | ||
this.render = this.render.bind(this); | ||
} | ||
var _react = _interopRequireDefault(require("react")); | ||
var _basicprimitives = _interopRequireDefault(require("basicprimitives")); | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var ItemTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(ItemTemplate, _AbstractTemplate); | ||
function ItemTemplate(options, config) { | ||
var _this; | ||
_classCallCheck(this, ItemTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(ItemTemplate).call(this)); | ||
_this.options = options; | ||
_this.config = config; | ||
_this.render = _this.render.bind(_assertThisInitialized(_this)); // It is unlikly that anybody would use default template in final product, so | ||
// having in-line styles is not a problem | ||
var item = { | ||
position: "absolute", | ||
overflow: "visible", | ||
fontFamily: "Trebuchet MS, Tahoma, Verdana, Arial, sans-serif", | ||
WebkitTapHighlightColor: "rgba(0,0,0,0)", | ||
WebkitUserSelect: "none", | ||
WebkitTouchCallout: "none", | ||
KhtmlUserSelect: "none", | ||
MozUserSelect: "none", | ||
msUserSelect: "none", | ||
userSelect: "none", | ||
boxSizing: "content-box" | ||
}; | ||
var cornerAll = { | ||
MozBorderRadius: "4px", | ||
WebkitBorderRadius: "4px", | ||
KhtmlBorderRadius: "4px", | ||
BorderRadius: "4px" | ||
}; | ||
var itemFrame = { | ||
border: "1px solid #dddddd", | ||
background: "#eeeeee", | ||
color: "#333333" | ||
}; | ||
var defaultTemplate = _objectSpread({}, item, {}, cornerAll, {}, itemFrame, { | ||
width: "100%", | ||
height: "100%", | ||
left: "-1px", | ||
top: "-1px" | ||
}); | ||
var title = _objectSpread({}, item, { | ||
textOverflow: "ellipsis", | ||
OTextOverflow: "ellipsis", | ||
whiteSpace: "nowrap", | ||
textAlign: "left", | ||
fontSize: "14px", | ||
lineHeight: "16px", | ||
color: "white", | ||
padding: 0 | ||
}); | ||
var background = _objectSpread({}, item, {}, cornerAll, {}, itemFrame); | ||
var photoFrame = _objectSpread({}, item, { | ||
border: "1px solid #cccccc", | ||
background: "#f6f6f6", | ||
color: "#1c94c4" | ||
}); | ||
_this.styles = { | ||
defaultTemplate: defaultTemplate, | ||
title: _objectSpread({}, title, { | ||
top: "2px", | ||
left: "2px", | ||
right: "2px", | ||
height: "16px" | ||
}), | ||
background: _objectSpread({}, background, { | ||
top: "2px", | ||
left: "2px", | ||
right: "2px", | ||
height: "20px" | ||
}), | ||
photoFrame: _objectSpread({}, photoFrame, { | ||
top: "26px", | ||
left: "2px", | ||
width: "50px", | ||
height: "60px" | ||
}), | ||
photo: { | ||
height: "60px", | ||
width: "50px" | ||
}, | ||
description: _objectSpread({}, item, { | ||
overflow: "hidden", | ||
textAlign: "left", | ||
top: "26px", | ||
left: "56px", | ||
right: "2px", | ||
bottom: "2px", | ||
fontSize: "12px" | ||
}) | ||
}; | ||
return _this; | ||
render(data) { | ||
const { | ||
context: itemConfig | ||
} = data; | ||
const itemTitleColor = itemConfig.itemTitleColor != null ? itemConfig.itemTitleColor : primitives.common.Colors.RoyalBlue, | ||
color = primitives.common.highestContrast(itemTitleColor, this.options.itemTitleSecondFontColor, this.options.itemTitleFirstFontColor); | ||
return React.createElement("div", { | ||
className: "BPDefaultTemplate" | ||
}, React.createElement("div", { | ||
className: "BPTitleBackground", | ||
style: { | ||
backgroundColor: itemTitleColor | ||
} | ||
}, React.createElement("div", { | ||
className: "BPTitle", | ||
style: { | ||
color | ||
} | ||
}, itemConfig.title)), React.createElement("div", { | ||
className: "BPPhotoFrame" | ||
}, React.createElement("img", { | ||
className: "BPPhoto", | ||
src: itemConfig.image, | ||
alt: itemConfig.title | ||
})), React.createElement("div", { | ||
className: "BPDescription" | ||
}, itemConfig.description)); | ||
} | ||
_createClass(ItemTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var itemConfig = data.context; | ||
var _this$styles = this.styles, | ||
defaultTemplate = _this$styles.defaultTemplate, | ||
title = _this$styles.title, | ||
background = _this$styles.background, | ||
photoFrame = _this$styles.photoFrame, | ||
photo = _this$styles.photo, | ||
description = _this$styles.description; | ||
} | ||
var itemTitleColor = itemConfig.itemTitleColor != null ? itemConfig.itemTitleColor : _basicprimitives["default"].common.Colors.RoyalBlue, | ||
color = _basicprimitives["default"].common.highestContrast(itemTitleColor, this.options.itemTitleSecondFontColor, this.options.itemTitleFirstFontColor); | ||
return _react["default"].createElement("div", { | ||
style: defaultTemplate | ||
}, _react["default"].createElement("div", { | ||
style: _objectSpread({}, background, { | ||
backgroundColor: itemTitleColor | ||
}) | ||
}, _react["default"].createElement("div", { | ||
style: _objectSpread({}, title, { | ||
color: color | ||
}) | ||
}, itemConfig.title)), _react["default"].createElement("div", { | ||
style: photoFrame | ||
}, _react["default"].createElement("img", { | ||
style: photo, | ||
src: itemConfig.image, | ||
alt: itemConfig.title | ||
})), _react["default"].createElement("div", { | ||
style: description | ||
}, itemConfig.description)); | ||
} | ||
}]); | ||
return ItemTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = ItemTemplate; | ||
exports["default"] = _default; | ||
export default ItemTemplate; |
@@ -1,54 +0,14 @@ | ||
"use strict"; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var LabelAnnotationTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(LabelAnnotationTemplate, _AbstractTemplate); | ||
function LabelAnnotationTemplate() { | ||
_classCallCheck(this, LabelAnnotationTemplate); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(LabelAnnotationTemplate).apply(this, arguments)); | ||
class LabelAnnotationTemplate extends AbstractTemplate { | ||
render(data) { | ||
var { | ||
title | ||
} = data.context; | ||
return title; | ||
} | ||
_createClass(LabelAnnotationTemplate, [{ | ||
key: "render", | ||
value: function render(data) { | ||
var title = data.context.title; | ||
return title; | ||
} | ||
}]); | ||
} | ||
return LabelAnnotationTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
; | ||
var _default = LabelAnnotationTemplate; | ||
exports["default"] = _default; | ||
export default LabelAnnotationTemplate; |
@@ -1,143 +0,95 @@ | ||
"use strict"; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
var _react = _interopRequireWildcard(require("react")); | ||
class RotatedText extends Component { | ||
getTransform(orientation) { | ||
let result = ""; | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
switch (orientation) { | ||
case 'RotateLeft': | ||
result = "rotate(-90deg)"; | ||
break; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
case 'RotateRight': | ||
result = "rotate(90deg)"; | ||
break; | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } | ||
default: | ||
break; | ||
} | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var RotatedText = | ||
/*#__PURE__*/ | ||
function (_Component) { | ||
_inherits(RotatedText, _Component); | ||
function RotatedText() { | ||
_classCallCheck(this, RotatedText); | ||
return _possibleConstructorReturn(this, _getPrototypeOf(RotatedText).apply(this, arguments)); | ||
return result; | ||
} | ||
_createClass(RotatedText, [{ | ||
key: "getTransform", | ||
value: function getTransform(orientation) { | ||
var result = ""; | ||
render() { | ||
const { | ||
children, | ||
width, | ||
height, | ||
orientation, | ||
horizontalAlignment, | ||
verticalAlignment | ||
} = this.props; | ||
const transform = this.getTransform(orientation); | ||
let size = null; | ||
switch (orientation) { | ||
case 'RotateLeft': | ||
result = "rotate(-90deg)"; | ||
break; | ||
case 'RotateRight': | ||
result = "rotate(90deg)"; | ||
break; | ||
default: | ||
break; | ||
} | ||
return result; | ||
if (orientation === "Horizontal") { | ||
size = { | ||
width: width + "px", | ||
height: height + "px", | ||
maxWidth: width + "px", | ||
maxHeight: height + "px" | ||
}; | ||
} else { | ||
size = { | ||
width: height + "px", | ||
height: width + "px", | ||
maxWidth: height + "px", | ||
maxHeight: width + "px", | ||
left: Math.round(width / 2.0 - height / 2.0) + "px", | ||
top: Math.round(height / 2.0 - width / 2.0) + "px" | ||
}; | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var _this$props = this.props, | ||
children = _this$props.children, | ||
width = _this$props.width, | ||
height = _this$props.height, | ||
orientation = _this$props.orientation, | ||
horizontalAlignment = _this$props.horizontalAlignment, | ||
verticalAlignment = _this$props.verticalAlignment; | ||
var transform = this.getTransform(orientation); | ||
var size = null; | ||
if (orientation === "Horizontal") { | ||
size = { | ||
width: width + "px", | ||
height: height + "px", | ||
maxWidth: width + "px", | ||
maxHeight: height + "px" | ||
}; | ||
} else { | ||
size = { | ||
width: height + "px", | ||
height: width + "px", | ||
maxWidth: height + "px", | ||
maxHeight: width + "px", | ||
left: Math.round(width / 2.0 - height / 2.0) + "px", | ||
top: Math.round(height / 2.0 - width / 2.0) + "px" | ||
}; | ||
var style = { | ||
position: "absolute", | ||
padding: 0, | ||
margin: 0, | ||
lineHeight: 1, | ||
textAlign: horizontalAlignment, | ||
WebkitTransformOrigin: "center center", | ||
MozTransformOrigin: "center center", | ||
OTransformOrigin: "center center", | ||
msTransformOrigin: "center center", | ||
WebkitTransform: transform, | ||
MozTransform: transform, | ||
OTransform: transform, | ||
msTransform: transform, | ||
transform, | ||
...size | ||
}; | ||
return verticalAlignment === 'top' ? React.createElement("div", { | ||
style: style | ||
}, children) : React.createElement("table", { | ||
style: { ...style, | ||
borderCollapse: "collapse" | ||
} | ||
}, React.createElement("tbody", null, React.createElement("tr", null, React.createElement("td", { | ||
style: { | ||
verticalAlign: verticalAlignment, | ||
padding: 0 | ||
} | ||
}, children)))); | ||
} | ||
var style = _objectSpread({ | ||
position: "absolute", | ||
padding: 0, | ||
margin: 0, | ||
lineHeight: 1, | ||
textAlign: horizontalAlignment, | ||
WebkitTransformOrigin: "center center", | ||
MozTransformOrigin: "center center", | ||
OTransformOrigin: "center center", | ||
msTransformOrigin: "center center", | ||
WebkitTransform: transform, | ||
MozTransform: transform, | ||
OTransform: transform, | ||
msTransform: transform, | ||
transform: transform | ||
}, size); | ||
} | ||
return verticalAlignment === 'top' ? _react["default"].createElement("div", { | ||
style: style | ||
}, children) : _react["default"].createElement("table", { | ||
style: _objectSpread({}, style, { | ||
borderCollapse: "collapse" | ||
}) | ||
}, _react["default"].createElement("tbody", null, _react["default"].createElement("tr", null, _react["default"].createElement("td", { | ||
style: { | ||
verticalAlign: verticalAlignment, | ||
padding: 0 | ||
} | ||
}, children)))); | ||
} | ||
}]); | ||
return RotatedText; | ||
}(_react.Component); | ||
_defineProperty(RotatedText, "propTypes", { | ||
width: _propTypes["default"].number.isRequired, | ||
height: _propTypes["default"].number.isRequired, | ||
orientation: _propTypes["default"].oneOf(['Horizontal', 'RotateLeft', 'RotateRight']), | ||
horizontalAlignment: _propTypes["default"].oneOf(['left', 'center', 'right']), | ||
verticalAlignment: _propTypes["default"].oneOf(['top', 'middle', 'bottom']) | ||
width: PropTypes.number.isRequired, | ||
height: PropTypes.number.isRequired, | ||
orientation: PropTypes.oneOf(['Horizontal', 'RotateLeft', 'RotateRight']), | ||
horizontalAlignment: PropTypes.oneOf(['left', 'center', 'right']), | ||
verticalAlignment: PropTypes.oneOf(['top', 'middle', 'bottom']) | ||
}); | ||
@@ -151,3 +103,2 @@ | ||
var _default = RotatedText; | ||
exports["default"] = _default; | ||
export default RotatedText; |
@@ -1,46 +0,12 @@ | ||
"use strict"; | ||
import AbstractTemplate from './AbstractTemplate'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _AbstractTemplate2 = _interopRequireDefault(require("./AbstractTemplate")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var UserTemplate = | ||
/*#__PURE__*/ | ||
function (_AbstractTemplate) { | ||
_inherits(UserTemplate, _AbstractTemplate); | ||
function UserTemplate(options, content, onRender) { | ||
var _this; | ||
_classCallCheck(this, UserTemplate); | ||
_this = _possibleConstructorReturn(this, _getPrototypeOf(UserTemplate).call(this)); | ||
_this.render = onRender; | ||
return _this; | ||
class UserTemplate extends AbstractTemplate { | ||
constructor(options, content, onRender) { | ||
super(); | ||
this.render = onRender; | ||
} | ||
return UserTemplate; | ||
}(_AbstractTemplate2["default"]); | ||
} | ||
; | ||
var _default = UserTemplate; | ||
exports["default"] = _default; | ||
export default UserTemplate; |
{ | ||
"name": "basicprimitivesreact", | ||
"version": "5.4.13", | ||
"version": "5.4.14", | ||
"main": "dist/index.js", | ||
@@ -22,3 +22,3 @@ "module": "dist/index.js", | ||
"dependencies": { | ||
"basicprimitives": "^5.4.0", | ||
"basicprimitives": "^5.4.14", | ||
"resize-observer-polyfill": "^1.5.1" | ||
@@ -109,2 +109,2 @@ }, | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34
159941
1876
1
Updatedbasicprimitives@^5.4.14