@agilemotion/oui-react-js 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApplicationManager.js +675 -1044
- package/dist/BasicApp.js +7 -27
- package/dist/BasicAppHome.js +27 -101
- package/dist/DynamicJS.js +109 -197
- package/dist/InteractionPortalApp.js +7 -27
- package/dist/InteractionPortalAppHome.js +21 -87
- package/dist/InteractionPortalApp_old.js +60 -122
- package/dist/RestUtils.js +269 -410
- package/dist/TypedValue.js +20 -26
- package/dist/Utils.js +295 -481
- package/dist/WithRouter.js +9 -17
- package/dist/assets/jss/components/authNavbarStyle.js +168 -171
- package/dist/assets/jss/components/buttonStyle.js +2 -5
- package/dist/assets/jss/components/cardAvatarStyle.js +2 -5
- package/dist/assets/jss/components/cardBodyStyle.js +2 -5
- package/dist/assets/jss/components/cardFooterStyle.js +2 -5
- package/dist/assets/jss/components/cardHeaderStyle.js +20 -17
- package/dist/assets/jss/components/cardIconStyle.js +2 -5
- package/dist/assets/jss/components/cardStyle.js +2 -5
- package/dist/assets/jss/components/cardTextStyle.js +2 -5
- package/dist/assets/jss/components/customDropdownStyle.js +171 -173
- package/dist/assets/jss/components/customInputStyle.js +5 -13
- package/dist/assets/jss/components/dropdownStyle.js +71 -74
- package/dist/assets/jss/components/footerStyle.js +14 -23
- package/dist/assets/jss/components/headerLinksStyle.js +52 -53
- package/dist/assets/jss/components/headerStyle.js +68 -73
- package/dist/assets/jss/components/navbarLinksStyle.js +81 -74
- package/dist/assets/jss/components/navbarStyle.js +79 -84
- package/dist/assets/jss/components/sidebarStyle.js +438 -441
- package/dist/assets/jss/components/typographyStyle.js +5 -13
- package/dist/assets/jss/rootStyle.js +85 -151
- package/dist/assets/jss/views/layoutStyle.js +45 -51
- package/dist/assets/jss/views/loginBasicStyle.js +2 -5
- package/dist/assets/jss/views/loginBusinessPortalStyle.js +2 -5
- package/dist/assets/jss/views/loginStyle.js +80 -87
- package/dist/components/AlertBar.js +20 -75
- package/dist/components/AlertItem.js +13 -49
- package/dist/components/AlertTemplate.js +12 -18
- package/dist/components/Button.js +41 -112
- package/dist/components/Calendar.js +99 -208
- package/dist/components/ConfirmationDialog.js +13 -54
- package/dist/components/DataGrid.js +271 -695
- package/dist/components/DataGridColumn.js +24 -74
- package/dist/components/DataGridFilter.js +107 -245
- package/dist/components/DataGridHeading.js +34 -78
- package/dist/components/Dialog.js +37 -130
- package/dist/components/DocumentTemplateDesigner.js +16 -57
- package/dist/components/DocumentTemplateDesignerComponent.js +47 -141
- package/dist/components/DocumentTemplatePlaceholderDialog.js +34 -67
- package/dist/components/DocumentViewer.js +25 -65
- package/dist/components/DocumentViewerComponent.js +13 -44
- package/dist/components/ElementResizeHandler.js +148 -200
- package/dist/components/FileThumb.js +15 -56
- package/dist/components/Graph.js +98 -203
- package/dist/components/GraphNode.js +20 -61
- package/dist/components/HtmlPanel.js +38 -105
- package/dist/components/Icon.js +174 -253
- package/dist/components/LoadingIndicator.js +4 -11
- package/dist/components/LottieIcon.js +63 -60
- package/dist/components/PopupView.js +21 -60
- package/dist/components/Portlet.js +18 -60
- package/dist/components/RegularButton.js +34 -42
- package/dist/components/SignaturePanel.js +19 -67
- package/dist/components/SocketManager.js +133 -228
- package/dist/components/StepperTitleBar.js +48 -99
- package/dist/components/TabPage.js +30 -47
- package/dist/components/TabPanel.js +35 -122
- package/dist/components/TableCellContent.js +34 -98
- package/dist/components/TemplateDesigner.js +115 -230
- package/dist/components/TemplateItemEventHandler.js +298 -481
- package/dist/components/TemplateTable.js +117 -218
- package/dist/components/TitleBar.js +15 -53
- package/dist/components/Toolbar.js +44 -110
- package/dist/components/Tooltip.js +37 -56
- package/dist/components/Tree.js +50 -143
- package/dist/components/UseIsVisible.js +5 -25
- package/dist/components/card/Card.js +35 -39
- package/dist/components/card/CardAvatar.js +21 -32
- package/dist/components/card/CardBody.js +29 -36
- package/dist/components/card/CardFooter.js +26 -35
- package/dist/components/card/CardHeader.js +29 -36
- package/dist/components/card/CardIcon.js +15 -29
- package/dist/components/card/CardText.js +15 -29
- package/dist/components/customInput/CustomInput.js +38 -40
- package/dist/components/dashboard/FoldingSideTabDashboard.js +65 -184
- package/dist/components/dashboard/SideMenuModuleDashboard.js +67 -185
- package/dist/components/dashboard/TopMenuModuleDashboard.js +22 -63
- package/dist/components/dashboard/components/Header.js +15 -52
- package/dist/components/dashboard/components/LeftDrawer.js +9 -23
- package/dist/components/dashboard/components/UserIdentity.js +4 -12
- package/dist/components/dashboard/components/blackDashboard/fixedPlugin/FixedPlugin.js +115 -155
- package/dist/components/dashboard/components/blackDashboard/sidebar/FoldingTabSidebar.js +344 -419
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenu.js +15 -29
- package/dist/components/dashboard/components/blackDashboard/sidebar/ModuleMenuSidebar.js +405 -485
- package/dist/components/dashboard/components/portal/Timeline.js +3 -8
- package/dist/components/dashboard/components/portal/Workspace.js +4 -13
- package/dist/components/footer/Footer.js +23 -45
- package/dist/components/footer/HomeFooter.js +38 -78
- package/dist/components/form/AddressSearch.js +26 -76
- package/dist/components/form/AutoComplete.js +54 -168
- package/dist/components/form/BaseField.js +59 -189
- package/dist/components/form/Checkbox.js +11 -24
- package/dist/components/form/DatePicker.js +28 -82
- package/dist/components/form/FieldSet.js +84 -300
- package/dist/components/form/Form.js +206 -501
- package/dist/components/form/GridField.js +83 -243
- package/dist/components/form/IconField.js +10 -21
- package/dist/components/form/ImageEditor.js +98 -208
- package/dist/components/form/LabelField.js +13 -28
- package/dist/components/form/LookupField.js +36 -102
- package/dist/components/form/MultiFileUploadField.js +67 -134
- package/dist/components/form/RadioGroup.js +20 -57
- package/dist/components/form/Section.js +33 -118
- package/dist/components/form/SelectItem.js +36 -83
- package/dist/components/form/SignatureTemplateDesignerField.js +12 -26
- package/dist/components/form/Switch.js +11 -24
- package/dist/components/form/TextField.js +19 -55
- package/dist/components/form/TimePicker.js +18 -43
- package/dist/components/form/TransferList.js +76 -200
- package/dist/components/form/UploadField.js +134 -256
- package/dist/components/grid/GridContainer.js +10 -23
- package/dist/components/grid/GridItem.js +10 -23
- package/dist/components/layout/CollapsiblePanel.js +20 -59
- package/dist/components/layout/Layout.js +40 -149
- package/dist/components/layout/View.js +65 -195
- package/dist/components/layout/ViewContainer.js +13 -33
- package/dist/components/layout/ViewPort.js +14 -48
- package/dist/components/layout/Window.js +62 -135
- package/dist/components/layout/WindowViewPort.js +18 -63
- package/dist/components/media/ClosablePanel.js +9 -18
- package/dist/components/media/LobbyWaitingList.js +11 -17
- package/dist/components/media/MediaSoupHelper.js +173 -401
- package/dist/components/media/SideBarContent.js +17 -34
- package/dist/components/media/SocketRequest.js +7 -18
- package/dist/components/media/SocketResponse.js +5 -14
- package/dist/components/media/Timer.js +18 -54
- package/dist/components/media/Toolbar.js +97 -254
- package/dist/components/media/ToolbarButton.js +34 -95
- package/dist/components/media/Toolbar_bck.js +70 -186
- package/dist/components/media/Tracks.js +19 -33
- package/dist/components/media/TrainingRoom.js +121 -374
- package/dist/components/media/Transports.js +17 -29
- package/dist/components/media/VCEventManager.js +45 -116
- package/dist/components/media/VCEventType.js +82 -168
- package/dist/components/media/VCParticipantList.js +16 -51
- package/dist/components/media/VCParticipantListItem.js +44 -141
- package/dist/components/media/VCRoom.js +14 -58
- package/dist/components/media/VCRoomParticipant.js +235 -556
- package/dist/components/media/VCRoomRecorder.js +106 -204
- package/dist/components/media/VCRoomWorkspace.js +248 -584
- package/dist/components/media/Video.js +27 -112
- package/dist/components/media/VideoPlayer.js +23 -91
- package/dist/components/media/chat/ChatRoom.js +143 -361
- package/dist/components/media/chat/ChatRoomItem.js +17 -58
- package/dist/components/media/chat/ChatRoomList.js +15 -60
- package/dist/components/menu/CollapsibleMenu.js +22 -52
- package/dist/components/menu/MenuBars.js +50 -116
- package/dist/components/menu/MenuButton.js +53 -130
- package/dist/components/menu/MenuItem.js +11 -51
- package/dist/components/menu/MenuLink.js +13 -41
- package/dist/components/menu/PopupMenu.js +13 -25
- package/dist/components/navbars/AuthNavbar.js +21 -56
- package/dist/components/navbars/HomeNavbar.js +213 -290
- package/dist/components/navbars/PortalNavbar.js +26 -81
- package/dist/components/signatures/AgilitySignaturePanel.js +41 -135
- package/dist/components/signatures/AlertItem.js +14 -50
- package/dist/components/signatures/Card.js +6 -16
- package/dist/components/signatures/DocumentContainer.js +57 -165
- package/dist/components/signatures/ImageSignatureInput.js +64 -124
- package/dist/components/signatures/MenuButton.js +28 -63
- package/dist/components/signatures/Prompt.js +6 -41
- package/dist/components/signatures/ResponsiveTable.js +181 -370
- package/dist/components/signatures/SearchView.js +34 -112
- package/dist/components/signatures/SignatorySearch.js +11 -44
- package/dist/components/signatures/SignatorySearchForm.js +19 -50
- package/dist/components/signatures/SignatureInput.js +28 -91
- package/dist/components/signatures/SignatureInputProps.js +49 -144
- package/dist/components/signatures/SignatureTemplateDesigner.js +230 -430
- package/dist/components/signatures/Toolbar.js +99 -173
- package/dist/components/signatures/ViewUtils.js +207 -313
- package/dist/components/typography/Danger.js +6 -11
- package/dist/components/typography/Info.js +7 -11
- package/dist/components/typography/Link.js +6 -12
- package/dist/event/ActionHandlers.js +48 -87
- package/dist/event/Event.js +21 -25
- package/dist/event/EventListener.js +54 -48
- package/dist/event/EventType.js +18 -40
- package/dist/event/LoadDataActionHandler.js +10 -31
- package/dist/event/Observable.js +204 -396
- package/dist/event/RouteActionHandler.js +119 -171
- package/dist/event/ScriptActionHandler.js +10 -32
- package/dist/event/ServiceCallActionHandler.js +37 -64
- package/dist/event/SignalGraphActionHandler.js +9 -31
- package/dist/js/Addresses.js +23 -42
- package/dist/js/Calendar.js +41 -89
- package/dist/js/DynamicLib.js +11 -23
- package/dist/js/Media.js +80 -174
- package/dist/js/Validators.js +6 -12
- package/dist/js/Windows.js +22 -40
- package/dist/redux/store/ConfigureStore.js +12 -29
- package/dist/redux/store/DashboardStore.js +47 -120
- package/dist/redux/store/History.js +2 -5
- package/dist/redux/store/SecurityStore.js +22 -65
- package/dist/security/TokenManager.js +29 -53
- package/dist/theme-default.js +3 -8
- package/dist/view/Dashboard.js +140 -308
- package/dist/view/PortalDashboard.js +6 -13
- package/dist/view/Settings.js +3 -11
- package/dist/view/Views.js +15 -35
- package/dist/view/security/ChangePasswordBasic.js +41 -147
- package/dist/view/security/ForgotPassword.js +26 -106
- package/dist/view/security/ForgotPasswordBasic.js +22 -96
- package/dist/view/security/Login.js +29 -117
- package/dist/view/security/LoginBasic.js +28 -108
- package/dist/view/security/LoginInteractionPortal.js +28 -106
- package/dist/view/security/ResetPassword.js +25 -110
- package/dist/view/security/ResetPasswordBasic.js +39 -142
- package/dist/view/security/Security.js +14 -26
- package/package.json +25 -20
|
@@ -4,516 +4,333 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _TemplateTable = _interopRequireDefault(require("./TemplateTable"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
13
|
-
|
|
14
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
-
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
17
|
-
|
|
18
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
-
|
|
20
|
-
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); } }
|
|
21
|
-
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
var parse = function parse(val) {
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const parse = val => {
|
|
27
10
|
return parseFloat(val.replace('px', ''));
|
|
28
11
|
};
|
|
29
|
-
|
|
30
|
-
var boundCheck = function boundCheck(pos, mousePos) {
|
|
12
|
+
const boundCheck = (pos, mousePos) => {
|
|
31
13
|
return pos - 8 < mousePos && pos + 8 > mousePos;
|
|
32
14
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_defineProperty(this, "dragStart", function (event) {
|
|
41
|
-
if (_this.selectedNode === event.target) {
|
|
42
|
-
if (document.body.style.cursor !== "move" || _this.resizingTableColumn) {
|
|
43
|
-
if (!_this.resizingTableColumn || _this.resizingBoundaryTableColumn) {
|
|
44
|
-
_this.currentResizeNode = event.target;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
event.preventDefault();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var parentLeft = event.target.parentElement.offsetLeft;
|
|
51
|
-
var parentTop = event.target.parentElement.offsetTop;
|
|
52
|
-
_this.dragOffset.x = event.clientX - (parentLeft + parseFloat(event.target.style.left.replace('px', '')));
|
|
53
|
-
_this.dragOffset.y = event.clientY - (parentTop + parseFloat(event.target.style.top.replace('px', '')));
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
_defineProperty(this, "dragOver", function (event) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
_defineProperty(this, "initDragAndDrop", function (selectionHandler, container) {
|
|
62
|
-
_this.dragOffset = {};
|
|
63
|
-
setTimeout(function () {
|
|
64
|
-
var elements = document.getElementsByClassName("dropTarget");
|
|
65
|
-
|
|
66
|
-
var _iterator = _createForOfIteratorHelper(elements),
|
|
67
|
-
_step;
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
71
|
-
var element = _step.value;
|
|
72
|
-
element.addEventListener("dragstart", _this.dragStart, false);
|
|
73
|
-
element.addEventListener("dragover", _this.dragOver, false);
|
|
74
|
-
}
|
|
75
|
-
} catch (err) {
|
|
76
|
-
_iterator.e(err);
|
|
77
|
-
} finally {
|
|
78
|
-
_iterator.f();
|
|
79
|
-
}
|
|
80
|
-
}, 2000);
|
|
81
|
-
container.addEventListener("mousedown", _this.handleMouseDown);
|
|
82
|
-
container.addEventListener("mouseup", function (event) {
|
|
83
|
-
return _this.handleMouseUp(event, selectionHandler);
|
|
84
|
-
});
|
|
85
|
-
container.addEventListener("mousemove", _this.handleMouseMove);
|
|
86
|
-
var parent = document.getElementsByClassName('__sys_placeholders')[0];
|
|
87
|
-
var placeHolders = document.getElementsByClassName('_draggable_');
|
|
88
|
-
|
|
89
|
-
var dropTarget = _this.getDropTarget(parent);
|
|
90
|
-
|
|
91
|
-
var _iterator2 = _createForOfIteratorHelper(placeHolders),
|
|
92
|
-
_step2;
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
var _loop = function _loop() {
|
|
96
|
-
var placeHolder = _step2.value;
|
|
97
|
-
placeHolder.addEventListener('mousemove', function (event) {
|
|
98
|
-
return _this.handleItemMouseMove(event, parent);
|
|
99
|
-
}, false);
|
|
100
|
-
placeHolder.addEventListener('mouseout', _this.handleItemMouseOut, false);
|
|
101
|
-
placeHolder.addEventListener('mouseup', function (event) {
|
|
102
|
-
return _this.handleItemMouseClick(placeHolder, placeHolder.id, selectionHandler);
|
|
103
|
-
}, false);
|
|
104
|
-
placeHolder.addEventListener('dragend', function (event) {
|
|
105
|
-
return _this.handleItemDrop(event, document.getElementsByClassName('dropTarget')[0]);
|
|
106
|
-
}, false);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
110
|
-
_loop();
|
|
15
|
+
class TemplateItemEventHandler {
|
|
16
|
+
constructor() {}
|
|
17
|
+
dragStart = event => {
|
|
18
|
+
if (this.selectedNode === event.target) {
|
|
19
|
+
if (document.body.style.cursor !== "move" || this.resizingTableColumn) {
|
|
20
|
+
if (!this.resizingTableColumn || this.resizingBoundaryTableColumn) {
|
|
21
|
+
this.currentResizeNode = event.target;
|
|
111
22
|
}
|
|
112
|
-
|
|
113
|
-
_iterator2.e(err);
|
|
114
|
-
} finally {
|
|
115
|
-
_iterator2.f();
|
|
23
|
+
event.preventDefault();
|
|
116
24
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
_this.resetBorders();
|
|
134
|
-
|
|
135
|
-
_this.selectedNode = null;
|
|
136
|
-
_this.selectedNodeInitPosition = null;
|
|
137
|
-
selectionHandler(null);
|
|
25
|
+
let parentLeft = event.target.parentElement.offsetLeft;
|
|
26
|
+
let parentTop = event.target.parentElement.offsetTop;
|
|
27
|
+
this.dragOffset.x = event.clientX - (parentLeft + parseFloat(event.target.style.left.replace('px', '')));
|
|
28
|
+
this.dragOffset.y = event.clientY - (parentTop + parseFloat(event.target.style.top.replace('px', '')));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
dragOver = event => {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
};
|
|
34
|
+
initDragAndDrop = (selectionHandler, container) => {
|
|
35
|
+
this.dragOffset = {};
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
let elements = document.getElementsByClassName("dropTarget");
|
|
38
|
+
for (const element of elements) {
|
|
39
|
+
element.addEventListener("dragstart", this.dragStart, false);
|
|
40
|
+
element.addEventListener("dragover", this.dragOver, false);
|
|
138
41
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
42
|
+
}, 2000);
|
|
43
|
+
container.addEventListener("mousedown", this.handleMouseDown);
|
|
44
|
+
container.addEventListener("mouseup", event => this.handleMouseUp(event, selectionHandler));
|
|
45
|
+
container.addEventListener("mousemove", this.handleMouseMove);
|
|
46
|
+
let parent = document.getElementsByClassName('__sys_placeholders')[0];
|
|
47
|
+
let placeHolders = document.getElementsByClassName('_draggable_');
|
|
48
|
+
let dropTarget = this.getDropTarget(parent);
|
|
49
|
+
for (const placeHolder of placeHolders) {
|
|
50
|
+
placeHolder.addEventListener('mousemove', event => this.handleItemMouseMove(event, parent), false);
|
|
51
|
+
placeHolder.addEventListener('mouseout', this.handleItemMouseOut, false);
|
|
52
|
+
placeHolder.addEventListener('mouseup', event => this.handleItemMouseClick(placeHolder, placeHolder.id, selectionHandler), false);
|
|
53
|
+
placeHolder.addEventListener('dragend', event => this.handleItemDrop(event, document.getElementsByClassName('dropTarget')[0]), false);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
handleMouseMove = event => {
|
|
57
|
+
this.resizeNode(event, this.currentResizeNode);
|
|
58
|
+
};
|
|
59
|
+
handleMouseDown = event => {
|
|
60
|
+
this.mouseDown = true;
|
|
61
|
+
};
|
|
62
|
+
handleMouseUp = (event, selectionHandler) => {
|
|
63
|
+
this.mouseDown = false;
|
|
64
|
+
this.currentResizeNode = null;
|
|
65
|
+
document.body.style.cursor = "default";
|
|
66
|
+
if (typeof event.target.className === 'string' && event.target.className !== '_draggable_' && !event.target.className.startsWith('_item_table')) {
|
|
67
|
+
this.resetBorders();
|
|
68
|
+
this.selectedNode = null;
|
|
69
|
+
this.selectedNodeInitPosition = null;
|
|
70
|
+
selectionHandler(null);
|
|
71
|
+
}
|
|
72
|
+
this.tableItemPreResizeWidth = null;
|
|
73
|
+
this.tableItemPreResizeHeight = null;
|
|
74
|
+
this.lastColItemPreResizeWidth = null;
|
|
75
|
+
this.firstColItemPreResizeWidth = null;
|
|
76
|
+
this.firstRowItemPreResizeHeight = null;
|
|
77
|
+
this.resizingTableColumn = false;
|
|
78
|
+
};
|
|
79
|
+
handleGrabRelease = (event, props, selectionHandler) => {
|
|
80
|
+
let width = props.width;
|
|
81
|
+
let height = props.height;
|
|
82
|
+
let parent = event.target;
|
|
83
|
+
let dropTarget = document.getElementsByClassName('dropTarget')[0]; //this.getDropTarget(parent);
|
|
84
|
+
|
|
85
|
+
if (dropTarget) {
|
|
86
|
+
let container = document.getElementById('templateContainer');
|
|
87
|
+
let node = document.createElement("div");
|
|
88
|
+
node.id = props.id;
|
|
89
|
+
node.style.lineHeight = event.target.style.lineHeight;
|
|
90
|
+
node.style.left = (props.left ? props.left : event.clientX - dropTarget.offsetLeft) + 'px';
|
|
91
|
+
node.style.top = (props.top ? props.top : container.scrollTop + event.clientY - dropTarget.offsetTop) + 'px';
|
|
92
|
+
node.style.border = '2px dashed green';
|
|
93
|
+
node.style.position = 'absolute';
|
|
94
|
+
node.className = "_draggable_";
|
|
95
|
+
node.setAttribute("draggable", true);
|
|
96
|
+
if (props.type === 'TABLE') {
|
|
97
|
+
let table = new _TemplateTable.default(props.table, node).build((resizing, boundary) => {
|
|
98
|
+
this.resizingTableColumn = resizing;
|
|
99
|
+
this.resizingBoundaryTableColumn = boundary;
|
|
100
|
+
}, parent => {
|
|
101
|
+
return this.selectedNode === parent;
|
|
102
|
+
});
|
|
103
|
+
node.appendChild(table);
|
|
104
|
+
node.style.padding = '1px';
|
|
105
|
+
node.style.width = parse(table.style.width) + 2 + 'px';
|
|
106
|
+
node.style.height = parse(table.style.height) + 2 + 'px';
|
|
107
|
+
} else {
|
|
108
|
+
node.style.height = height + 'px';
|
|
109
|
+
node.style.width = width + 'px';
|
|
110
|
+
node.innerText = props.description;
|
|
198
111
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
112
|
+
node.addEventListener('dragend', event => this.handleItemDrop(event, dropTarget), false);
|
|
113
|
+
let placeHolders = dropTarget.getElementsByClassName('__sys_placeholders')[0];
|
|
114
|
+
node.addEventListener('mousemove', event => this.handleItemMouseMove(event, placeHolders), false);
|
|
115
|
+
node.addEventListener('mouseout', this.handleItemMouseOut, false);
|
|
116
|
+
node.addEventListener('mouseup', event => this.handleItemMouseClick(node, props.id, selectionHandler), false);
|
|
117
|
+
placeHolders.appendChild(node);
|
|
118
|
+
this.selectedNode = node;
|
|
119
|
+
this.setSelectedInitNodePos();
|
|
120
|
+
}
|
|
121
|
+
if (typeof event.target.className === 'string' && !event.target.className.includes("paletteButton") && !event.target.className.includes("paletteButtonLabel") && !event.target.className.includes("paletteButtonSelected")) {
|
|
122
|
+
document.getElementsByTagName("body")[0].style.cursor = 'default';
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
getDropTarget(node) {
|
|
126
|
+
let parent = node;
|
|
127
|
+
let dropTarget = null;
|
|
128
|
+
while (parent) {
|
|
129
|
+
if (parent.className === 'dropTarget') {
|
|
130
|
+
dropTarget = parent;
|
|
131
|
+
break;
|
|
202
132
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
var newWidth = parse(node.style.width) - widthDiff; //console.log("\n\n\n SETTING SPEC LEFT : " + this.selectedNodeInitPosition.left);
|
|
237
|
-
|
|
238
|
-
resizeSpec.leftOffset = mouseX - _this.selectedNodeInitPosition.left;
|
|
239
|
-
|
|
240
|
-
if (newWidth >= 20) {
|
|
241
|
-
node.style.width = newWidth + 'px';
|
|
242
|
-
node.style.left = mouseX + 'px';
|
|
243
|
-
}
|
|
133
|
+
parent = parent.parentElement;
|
|
134
|
+
}
|
|
135
|
+
return dropTarget;
|
|
136
|
+
}
|
|
137
|
+
handleItemDrop = (event, target) => {
|
|
138
|
+
console.log("\n\n\n\nclientY : " + event.clientY + " offsetTop : " + target.offsetTop + " dragOffset.y : " + this.dragOffset.y);
|
|
139
|
+
event.target.style.left = event.clientX - target.offsetLeft - this.dragOffset.x + 'px';
|
|
140
|
+
event.target.style.top = event.clientY - target.offsetTop - this.dragOffset.y + 'px';
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
this.currentResizeNode = null;
|
|
143
|
+
this.mouseDown = false;
|
|
144
|
+
document.body.style.cursor = "default";
|
|
145
|
+
this.resetBorders();
|
|
146
|
+
event.target.style.border = '2px dashed green';
|
|
147
|
+
};
|
|
148
|
+
resizeTables(node, spec) {
|
|
149
|
+
let tables = node.getElementsByClassName('_item_table');
|
|
150
|
+
let table = tables && tables.length > 0 ? tables[0] : null;
|
|
151
|
+
if (!this.tableItemPreResizeWidth && table) {
|
|
152
|
+
this.tableItemPreResizeWidth = parse(table.style.width);
|
|
153
|
+
}
|
|
154
|
+
if (!this.tableItemPreResizeHeight && table) {
|
|
155
|
+
this.tableItemPreResizeHeight = parse(table.style.height);
|
|
156
|
+
}
|
|
157
|
+
if (table) {
|
|
158
|
+
if (spec.rightOffset !== 0) {
|
|
159
|
+
let numCols = table['data-num-cols'];
|
|
160
|
+
let lastCols = node.getElementsByClassName(`_item_table_col_${numCols - 1}`);
|
|
161
|
+
let newWidth;
|
|
162
|
+
let resized = true;
|
|
163
|
+
for (const lastCol of lastCols) {
|
|
164
|
+
if (!this.lastColItemPreResizeWidth) {
|
|
165
|
+
this.lastColItemPreResizeWidth = parse(lastCol.style.width);
|
|
244
166
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
167
|
+
newWidth = this.lastColItemPreResizeWidth + spec.rightOffset;
|
|
168
|
+
//console.log(spec.leftOffset + " : " + spec.rightOffset + " : " + this.lastColItemPreResizeWidth);
|
|
169
|
+
|
|
170
|
+
if (newWidth >= 32) {
|
|
171
|
+
lastCol.style.width = newWidth + 'px';
|
|
172
|
+
} else {
|
|
173
|
+
resized = false;
|
|
174
|
+
break;
|
|
254
175
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
176
|
+
}
|
|
177
|
+
if (resized) {
|
|
178
|
+
table.style.width = this.tableItemPreResizeWidth + spec.rightOffset + 'px';
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (spec.leftOffset !== 0) {
|
|
182
|
+
let newWidth;
|
|
183
|
+
let firstCols = node.getElementsByClassName('_item_table_col_0');
|
|
184
|
+
let resized = true;
|
|
185
|
+
for (const firstCol of firstCols) {
|
|
186
|
+
if (!this.firstColItemPreResizeWidth) {
|
|
187
|
+
this.firstColItemPreResizeWidth = parse(firstCol.style.width);
|
|
267
188
|
}
|
|
268
|
-
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (_newHeight >= 20) {
|
|
275
|
-
node.style.height = _newHeight + 'px';
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
resizeSpec.bottomResized = true;
|
|
189
|
+
newWidth = this.firstColItemPreResizeWidth + spec.leftOffset * -1;
|
|
190
|
+
if (newWidth >= 32) {
|
|
191
|
+
firstCol.style.width = newWidth + 'px';
|
|
192
|
+
} else {
|
|
193
|
+
resized = false;
|
|
194
|
+
break;
|
|
279
195
|
}
|
|
280
|
-
|
|
281
|
-
_this.resizeTables(node, resizeSpec);
|
|
282
196
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
_defineProperty(this, "updateCursor", function (node, event, itemParent) {
|
|
287
|
-
if (!_this.mouseDown && _this.selectedNode) {
|
|
288
|
-
var container = document.getElementById('templateContainer');
|
|
289
|
-
var left = parse(node.style.left) + container.offsetLeft;
|
|
290
|
-
var right = left + parse(node.style.width);
|
|
291
|
-
var top = parse(node.style.top) + itemParent.offsetTop;
|
|
292
|
-
var bottom = top + parse(node.style.height);
|
|
293
|
-
var mouseX = event.clientX + container.scrollLeft;
|
|
294
|
-
var mouseY = event.clientY + container.scrollTop;
|
|
295
|
-
_this.boundCheckTop = boundCheck(top, mouseY);
|
|
296
|
-
_this.boundCheckLeft = boundCheck(left, mouseX);
|
|
297
|
-
_this.boundCheckRight = boundCheck(right, mouseX);
|
|
298
|
-
_this.boundCheckBottom = boundCheck(bottom, mouseY);
|
|
299
|
-
|
|
300
|
-
if (_this.boundCheckTop && _this.boundCheckLeft || _this.boundCheckBottom && _this.boundCheckRight) {
|
|
301
|
-
document.body.style.cursor = "nwse-resize";
|
|
302
|
-
} else if (_this.boundCheckTop && _this.boundCheckRight || _this.boundCheckBottom && _this.boundCheckLeft) {
|
|
303
|
-
document.body.style.cursor = "nesw-resize";
|
|
304
|
-
} else if (_this.boundCheckTop || _this.boundCheckBottom) {
|
|
305
|
-
document.body.style.cursor = "ns-resize";
|
|
306
|
-
} else if (_this.boundCheckLeft || _this.boundCheckRight) {
|
|
307
|
-
document.body.style.cursor = "ew-resize";
|
|
308
|
-
} else {
|
|
309
|
-
document.body.style.cursor = "move";
|
|
197
|
+
if (resized) {
|
|
198
|
+
table.style.width = this.tableItemPreResizeWidth + spec.leftOffset * -1 + 'px';
|
|
310
199
|
}
|
|
311
|
-
|
|
312
|
-
_this.resizingItemParent = itemParent;
|
|
313
200
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
var _iterator3 = _createForOfIteratorHelper(items),
|
|
320
|
-
_step3;
|
|
321
|
-
|
|
322
|
-
try {
|
|
323
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
324
|
-
var item = _step3.value;
|
|
325
|
-
item.style.border = 'none';
|
|
201
|
+
if (spec.topOffset !== 0 || spec.bottomOffset !== 0) {
|
|
202
|
+
let newHeight;
|
|
203
|
+
let rows = node.getElementsByClassName('_item_table_tr');
|
|
204
|
+
if (!this.firstRowItemPreResizeHeight) {
|
|
205
|
+
this.firstRowItemPreResizeHeight = parse(rows[0].style.height);
|
|
326
206
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
|
|
334
|
-
_defineProperty(this, "handleItemMouseOut", function (event) {
|
|
335
|
-
if (!_this.currentResizeNode) {
|
|
336
|
-
document.body.style.cursor = "default";
|
|
337
|
-
}
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
_defineProperty(this, "handleItemMouseMove", function (event, itemParent) {
|
|
341
|
-
var node = event.target;
|
|
342
|
-
|
|
343
|
-
_this.updateCursor(node, event, itemParent);
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
_defineProperty(this, "handleItemMouseClick", function (node, id, selectionHandler) {
|
|
347
|
-
_this.resetBorders();
|
|
348
|
-
|
|
349
|
-
node.style.border = '2px dashed green';
|
|
350
|
-
_this.selectedNode = node;
|
|
351
|
-
|
|
352
|
-
_this.setSelectedInitNodePos();
|
|
353
|
-
|
|
354
|
-
selectionHandler(id, node);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
_createClass(TemplateItemEventHandler, [{
|
|
359
|
-
key: "getDropTarget",
|
|
360
|
-
value: function getDropTarget(node) {
|
|
361
|
-
var parent = node;
|
|
362
|
-
var dropTarget = null;
|
|
363
|
-
|
|
364
|
-
while (parent) {
|
|
365
|
-
if (parent.className === 'dropTarget') {
|
|
366
|
-
dropTarget = parent;
|
|
367
|
-
break;
|
|
207
|
+
if (spec.topOffset !== 0) {
|
|
208
|
+
newHeight = this.firstRowItemPreResizeHeight - spec.topOffset / rows.length;
|
|
209
|
+
} else if (spec.bottomOffset !== 0) {
|
|
210
|
+
newHeight = this.firstRowItemPreResizeHeight + spec.bottomOffset / rows.length;
|
|
368
211
|
}
|
|
369
|
-
|
|
370
|
-
|
|
212
|
+
for (const row of rows) {
|
|
213
|
+
row.style.height = newHeight + 'px';
|
|
214
|
+
}
|
|
215
|
+
if (spec.topOffset !== 0) {
|
|
216
|
+
table.style.height = this.tableItemPreResizeHeight - spec.topOffset + 'px';
|
|
217
|
+
}
|
|
218
|
+
if (spec.bottomOffset !== 0) {
|
|
219
|
+
table.style.height = this.tableItemPreResizeHeight + spec.bottomOffset + 'px';
|
|
220
|
+
}
|
|
221
|
+
table.style.height = this.tableItemPreResizeHeight + (spec.topOffset !== 0 ? spec.topOffset : spec.bottomOffset) + 'px';
|
|
371
222
|
}
|
|
372
|
-
|
|
373
|
-
return dropTarget;
|
|
374
223
|
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
this.
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
try {
|
|
400
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
401
|
-
var lastCol = _step4.value;
|
|
402
|
-
|
|
403
|
-
if (!this.lastColItemPreResizeWidth) {
|
|
404
|
-
this.lastColItemPreResizeWidth = parse(lastCol.style.width);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
newWidth = this.lastColItemPreResizeWidth + spec.rightOffset; //console.log(spec.leftOffset + " : " + spec.rightOffset + " : " + this.lastColItemPreResizeWidth);
|
|
408
|
-
|
|
409
|
-
if (newWidth >= 32) {
|
|
410
|
-
lastCol.style.width = newWidth + 'px';
|
|
411
|
-
} else {
|
|
412
|
-
resized = false;
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
} catch (err) {
|
|
417
|
-
_iterator4.e(err);
|
|
418
|
-
} finally {
|
|
419
|
-
_iterator4.f();
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
if (resized) {
|
|
423
|
-
table.style.width = this.tableItemPreResizeWidth + spec.rightOffset + 'px';
|
|
224
|
+
}
|
|
225
|
+
resizeNode = (event, node) => {
|
|
226
|
+
//console.log(this.mouseDown + " : " + node + " : " + this.resizingTableColumn);
|
|
227
|
+
if (this.mouseDown && node) {
|
|
228
|
+
let container = document.getElementById('templateContainer');
|
|
229
|
+
if (container) {
|
|
230
|
+
let mouseX = event.clientX - this.resizingItemParent.offsetLeft + container.scrollLeft;
|
|
231
|
+
let mouseY = event.clientY - this.resizingItemParent.offsetTop + container.scrollTop;
|
|
232
|
+
let resizeSpec = {
|
|
233
|
+
leftOffset: 0,
|
|
234
|
+
rightOffset: 0,
|
|
235
|
+
topOffset: 0,
|
|
236
|
+
bottomOffset: 0
|
|
237
|
+
};
|
|
238
|
+
if (this.boundCheckLeft) {
|
|
239
|
+
let widthDiff = mouseX - parse(node.style.left);
|
|
240
|
+
let newWidth = parse(node.style.width) - widthDiff;
|
|
241
|
+
|
|
242
|
+
//console.log("\n\n\n SETTING SPEC LEFT : " + this.selectedNodeInitPosition.left);
|
|
243
|
+
resizeSpec.leftOffset = mouseX - this.selectedNodeInitPosition.left;
|
|
244
|
+
if (newWidth >= 20) {
|
|
245
|
+
node.style.width = newWidth + 'px';
|
|
246
|
+
node.style.left = mouseX + 'px';
|
|
424
247
|
}
|
|
425
248
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
var _resized = true;
|
|
432
|
-
|
|
433
|
-
var _iterator5 = _createForOfIteratorHelper(firstCols),
|
|
434
|
-
_step5;
|
|
435
|
-
|
|
436
|
-
try {
|
|
437
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
438
|
-
var firstCol = _step5.value;
|
|
439
|
-
|
|
440
|
-
if (!this.firstColItemPreResizeWidth) {
|
|
441
|
-
this.firstColItemPreResizeWidth = parse(firstCol.style.width);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
_newWidth2 = this.firstColItemPreResizeWidth + spec.leftOffset * -1;
|
|
445
|
-
|
|
446
|
-
if (_newWidth2 >= 32) {
|
|
447
|
-
firstCol.style.width = _newWidth2 + 'px';
|
|
448
|
-
} else {
|
|
449
|
-
_resized = false;
|
|
450
|
-
break;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
} catch (err) {
|
|
454
|
-
_iterator5.e(err);
|
|
455
|
-
} finally {
|
|
456
|
-
_iterator5.f();
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (_resized) {
|
|
460
|
-
table.style.width = this.tableItemPreResizeWidth + spec.leftOffset * -1 + 'px';
|
|
249
|
+
if (this.boundCheckRight) {
|
|
250
|
+
let newWidth = mouseX - parse(node.style.left);
|
|
251
|
+
resizeSpec.rightOffset = newWidth - this.selectedNodeInitPosition.width;
|
|
252
|
+
if (newWidth >= 20) {
|
|
253
|
+
node.style.width = newWidth + 'px';
|
|
461
254
|
}
|
|
462
255
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
if (spec.topOffset !== 0) {
|
|
473
|
-
newHeight = this.firstRowItemPreResizeHeight - spec.topOffset / rows.length;
|
|
474
|
-
} else if (spec.bottomOffset !== 0) {
|
|
475
|
-
newHeight = this.firstRowItemPreResizeHeight + spec.bottomOffset / rows.length;
|
|
256
|
+
if (this.boundCheckTop) {
|
|
257
|
+
let heightDiff = mouseY - parse(node.style.top);
|
|
258
|
+
let newHeight = parse(node.style.height) - heightDiff;
|
|
259
|
+
resizeSpec.topOffset = mouseY - this.selectedNodeInitPosition.top;
|
|
260
|
+
if (newHeight >= 20) {
|
|
261
|
+
node.style.height = newHeight + 'px';
|
|
262
|
+
node.style.top = mouseY + 'px';
|
|
476
263
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
row.style.height = newHeight + 'px';
|
|
485
|
-
}
|
|
486
|
-
} catch (err) {
|
|
487
|
-
_iterator6.e(err);
|
|
488
|
-
} finally {
|
|
489
|
-
_iterator6.f();
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
if (spec.topOffset !== 0) {
|
|
493
|
-
table.style.height = this.tableItemPreResizeHeight - spec.topOffset + 'px';
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
if (spec.bottomOffset !== 0) {
|
|
497
|
-
table.style.height = this.tableItemPreResizeHeight + spec.bottomOffset + 'px';
|
|
264
|
+
resizeSpec.topResized = true;
|
|
265
|
+
}
|
|
266
|
+
if (this.boundCheckBottom) {
|
|
267
|
+
let newHeight = mouseY - parse(node.style.top);
|
|
268
|
+
resizeSpec.bottomOffset = newHeight - this.selectedNodeInitPosition.height;
|
|
269
|
+
if (newHeight >= 20) {
|
|
270
|
+
node.style.height = newHeight + 'px';
|
|
498
271
|
}
|
|
499
|
-
|
|
500
|
-
table.style.height = this.tableItemPreResizeHeight + (spec.topOffset !== 0 ? spec.topOffset : spec.bottomOffset) + 'px';
|
|
272
|
+
resizeSpec.bottomResized = true;
|
|
501
273
|
}
|
|
274
|
+
this.resizeTables(node, resizeSpec);
|
|
502
275
|
}
|
|
503
276
|
}
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
277
|
+
};
|
|
278
|
+
updateCursor = (node, event, itemParent) => {
|
|
279
|
+
if (!this.mouseDown && this.selectedNode) {
|
|
280
|
+
let container = document.getElementById('templateContainer');
|
|
281
|
+
let left = parse(node.style.left) + container.offsetLeft;
|
|
282
|
+
let right = left + parse(node.style.width);
|
|
283
|
+
let top = parse(node.style.top) + itemParent.offsetTop;
|
|
284
|
+
let bottom = top + parse(node.style.height);
|
|
285
|
+
let mouseX = event.clientX + container.scrollLeft;
|
|
286
|
+
let mouseY = event.clientY + container.scrollTop;
|
|
287
|
+
this.boundCheckTop = boundCheck(top, mouseY);
|
|
288
|
+
this.boundCheckLeft = boundCheck(left, mouseX);
|
|
289
|
+
this.boundCheckRight = boundCheck(right, mouseX);
|
|
290
|
+
this.boundCheckBottom = boundCheck(bottom, mouseY);
|
|
291
|
+
if (this.boundCheckTop && this.boundCheckLeft || this.boundCheckBottom && this.boundCheckRight) {
|
|
292
|
+
document.body.style.cursor = "nwse-resize";
|
|
293
|
+
} else if (this.boundCheckTop && this.boundCheckRight || this.boundCheckBottom && this.boundCheckLeft) {
|
|
294
|
+
document.body.style.cursor = "nesw-resize";
|
|
295
|
+
} else if (this.boundCheckTop || this.boundCheckBottom) {
|
|
296
|
+
document.body.style.cursor = "ns-resize";
|
|
297
|
+
} else if (this.boundCheckLeft || this.boundCheckRight) {
|
|
298
|
+
document.body.style.cursor = "ew-resize";
|
|
299
|
+
} else {
|
|
300
|
+
document.body.style.cursor = "move";
|
|
301
|
+
}
|
|
302
|
+
this.resizingItemParent = itemParent;
|
|
513
303
|
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
304
|
+
};
|
|
305
|
+
resetBorders = () => {
|
|
306
|
+
let items = document.getElementsByClassName("_draggable_");
|
|
307
|
+
for (const item of items) {
|
|
308
|
+
item.style.border = 'none';
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
handleItemMouseOut = event => {
|
|
312
|
+
if (!this.currentResizeNode) {
|
|
313
|
+
document.body.style.cursor = "default";
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
handleItemMouseMove = (event, itemParent) => {
|
|
317
|
+
let node = event.target;
|
|
318
|
+
this.updateCursor(node, event, itemParent);
|
|
319
|
+
};
|
|
320
|
+
handleItemMouseClick = (node, id, selectionHandler) => {
|
|
321
|
+
this.resetBorders();
|
|
322
|
+
node.style.border = '2px dashed green';
|
|
323
|
+
this.selectedNode = node;
|
|
324
|
+
this.setSelectedInitNodePos();
|
|
325
|
+
selectionHandler(id, node);
|
|
326
|
+
};
|
|
327
|
+
setSelectedInitNodePos() {
|
|
328
|
+
this.selectedNodeInitPosition = {
|
|
329
|
+
top: parse(this.selectedNode.style.top),
|
|
330
|
+
left: parse(this.selectedNode.style.left),
|
|
331
|
+
width: parse(this.selectedNode.style.width),
|
|
332
|
+
height: parse(this.selectedNode.style.height)
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
519
336
|
exports.default = TemplateItemEventHandler;
|