@yanqirenshi/d3.ter 0.0.1

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/README.md ADDED
@@ -0,0 +1,68 @@
1
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2
+
3
+ ## Available Scripts
4
+
5
+ In the project directory, you can run:
6
+
7
+ ### `npm start`
8
+
9
+ Runs the app in the development mode.<br />
10
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11
+
12
+ The page will reload if you make edits.<br />
13
+ You will also see any lint errors in the console.
14
+
15
+ ### `npm test`
16
+
17
+ Launches the test runner in the interactive watch mode.<br />
18
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19
+
20
+ ### `npm run build`
21
+
22
+ Builds the app for production to the `build` folder.<br />
23
+ It correctly bundles React in production mode and optimizes the build for the best performance.
24
+
25
+ The build is minified and the filenames include the hashes.<br />
26
+ Your app is ready to be deployed!
27
+
28
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29
+
30
+ ### `npm run eject`
31
+
32
+ **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33
+
34
+ If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
35
+
36
+ Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
37
+
38
+ You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
39
+
40
+ ## Learn More
41
+
42
+ You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43
+
44
+ To learn React, check out the [React documentation](https://reactjs.org/).
45
+
46
+ ### Code Splitting
47
+
48
+ This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
49
+
50
+ ### Analyzing the Bundle Size
51
+
52
+ This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
53
+
54
+ ### Making a Progressive Web App
55
+
56
+ This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
57
+
58
+ ### Advanced Configuration
59
+
60
+ This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
61
+
62
+ ### Deployment
63
+
64
+ This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
65
+
66
+ ### `npm run build` fails to minify
67
+
68
+ This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
package/dist/App.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _Home = _interopRequireDefault(require("./pages/Home.js"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ function App() {
15
+ return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Home["default"], null));
16
+ }
17
+
18
+ var _default = App;
19
+ exports["default"] = _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _react2 = require("@testing-library/react");
6
+
7
+ var _App = _interopRequireDefault(require("./App"));
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+
11
+ test('renders learn react link', function () {
12
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_App["default"], null)),
13
+ getByText = _render.getByText;
14
+
15
+ var linkElement = getByText(/learn react/i);
16
+ expect(linkElement).toBeInTheDocument();
17
+ });
package/dist/index.css ADDED
@@ -0,0 +1,13 @@
1
+ body {
2
+ margin: 0;
3
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
+ sans-serif;
6
+ -webkit-font-smoothing: antialiased;
7
+ -moz-osx-font-smoothing: grayscale;
8
+ }
9
+
10
+ code {
11
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12
+ monospace;
13
+ }
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _reactDom = _interopRequireDefault(require("react-dom"));
8
+
9
+ require("./index.css");
10
+
11
+ var _App = _interopRequireDefault(require("./App"));
12
+
13
+ var serviceWorker = _interopRequireWildcard(require("./serviceWorker"));
14
+
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
+
21
+ _reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(_react["default"].StrictMode, null, /*#__PURE__*/_react["default"].createElement(_App["default"], null)), document.getElementById('root')); // If you want your app to work offline and load faster, you can change
22
+ // unregister() to register() below. Note this comes with some pitfalls.
23
+ // Learn more about service workers: https://bit.ly/CRA-PWA
24
+
25
+
26
+ serviceWorker.unregister();
@@ -0,0 +1,279 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _moment = _interopRequireDefault(require("moment"));
11
+
12
+ var _assh0le = _interopRequireDefault(require("@yanqirenshi/assh0le"));
13
+
14
+ var _Entity = _interopRequireDefault(require("./Entity.js"));
15
+
16
+ var _Identifier = _interopRequireDefault(require("./Identifier.js"));
17
+
18
+ var _IdentifierInstance = _interopRequireDefault(require("./IdentifierInstance.js"));
19
+
20
+ var _Attribute = _interopRequireDefault(require("./Attribute.js"));
21
+
22
+ var _AttributeInstance = _interopRequireDefault(require("./AttributeInstance.js"));
23
+
24
+ var _Relationship = _interopRequireDefault(require("./Relationship.js"));
25
+
26
+ var _Port = _interopRequireDefault(require("./Port.js"));
27
+
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+
30
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { 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 = it.call(o); }, 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; } } }; }
31
+
32
+ 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); }
33
+
34
+ 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; }
35
+
36
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
37
+
38
+ 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); } }
39
+
40
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
41
+
42
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
+
44
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
+
46
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
47
+
48
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
49
+
50
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
51
+
52
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
53
+
54
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
55
+
56
+ var AssholeD3TER = /*#__PURE__*/function (_Asshole) {
57
+ _inherits(AssholeD3TER, _Asshole);
58
+
59
+ var _super = _createSuper(AssholeD3TER);
60
+
61
+ function AssholeD3TER() {
62
+ var _this;
63
+
64
+ _classCallCheck(this, AssholeD3TER);
65
+
66
+ _this = _super.call(this);
67
+ _this.entity = new _Entity["default"]();
68
+ _this.relationship = new _Relationship["default"]();
69
+ _this.attribute = new _Attribute["default"]();
70
+ _this.attribute_instance = new _AttributeInstance["default"]();
71
+ _this.identifier = new _Identifier["default"]();
72
+ _this.identifier_instance = new _IdentifierInstance["default"]();
73
+ _this.port = new _Port["default"]();
74
+ _this._entities = _this.entity.list2pool([]);
75
+ _this._relationships = _this.relationship.list2pool([]);
76
+ _this._identifier = _this.identifier.list2pool([]);
77
+ _this._attribute = _this.attribute.list2pool([]);
78
+ _this._default = {
79
+ line: {
80
+ height: 14,
81
+ font: {
82
+ size: 14
83
+ }
84
+ }
85
+ };
86
+ return _this;
87
+ }
88
+ /* **************************************************************** *
89
+ * Data manegement
90
+ * **************************************************************** */
91
+
92
+
93
+ _createClass(AssholeD3TER, [{
94
+ key: "isEntityClass",
95
+ value: function isEntityClass(_class) {
96
+ var classes = ['RESOURCE', 'RESOURCE-SUBSET', 'EVENT', 'EVENT-SUBSET'];
97
+ return classes.indexOf(_class) > -1;
98
+ }
99
+ }, {
100
+ key: "buildRelationshipsWithPort",
101
+ value: function buildRelationshipsWithPort(relationships, entities) {
102
+ var out = {
103
+ list: [],
104
+ ht: {}
105
+ };
106
+
107
+ var _iterator = _createForOfIteratorHelper(relationships),
108
+ _step;
109
+
110
+ try {
111
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
112
+ var core = _step.value;
113
+ var identifier_from = this.entity.getIdentifier(core.from.id, entities);
114
+ var identifier_to = this.entity.getIdentifier(core.to.id, entities);
115
+ var port_from = this.port.build('from', core.from.position, identifier_from);
116
+ var port_to = this.port.build('to', core.to.position, identifier_to);
117
+ var element = this.relationship.build(core, port_from, port_to);
118
+ var entity_from = identifier_from._entity;
119
+ var entity_to = identifier_to._entity;
120
+ port_from._entity = entity_from;
121
+ port_to._entity = entity_to;
122
+ entity_from.ports.items.ht[port_from._id] = port_from;
123
+ entity_from.ports.items.list.push(port_from);
124
+ entity_to.ports.items.ht[port_to._id] = port_to;
125
+ entity_to.ports.items.list.push(port_to);
126
+ out.list.push(element);
127
+ out.ht[element._id] = element;
128
+ }
129
+ } catch (err) {
130
+ _iterator.e(err);
131
+ } finally {
132
+ _iterator.f();
133
+ }
134
+
135
+ return out;
136
+ }
137
+ }, {
138
+ key: "dataCore",
139
+ value: function dataCore(data) {
140
+ var _this2 = this;
141
+
142
+ this._identifiers = this.identifier.list2pool(data.identifiers, function (d) {
143
+ return _this2.identifier.build(d);
144
+ });
145
+ this._attributes = this.identifier.list2pool(data.attributes, function (d) {
146
+ return _this2.attribute.build(d);
147
+ });
148
+ var elements = {
149
+ identifiers: this._identifiers,
150
+ attributes: this._attributes
151
+ };
152
+ this._entities = this.entity.list2pool(data.entities, function (d) {
153
+ return _this2.entity.build(d, elements);
154
+ });
155
+ this.entity.sizing(this._entities.list);
156
+ this._relationships = this.buildRelationshipsWithPort(data.relationships, this._entities);
157
+ }
158
+ }, {
159
+ key: "data",
160
+ value: function data(_data) {
161
+ this.dataCore(_data);
162
+ this.draw();
163
+ return this;
164
+ }
165
+ /* **************************************************************** *
166
+ * Drag & Drop
167
+ * **************************************************************** */
168
+
169
+ }, {
170
+ key: "moveEdges",
171
+ value: function moveEdges(edges) {// TODO:
172
+ }
173
+ }, {
174
+ key: "moveEntity",
175
+ value: function moveEntity(entity) {
176
+ var selection = this.getLayerForeground().selectAll('g.entity').data([entity], function (d) {
177
+ return d._id;
178
+ });
179
+ selection.attr('transform', function (d) {
180
+ return 'translate(' + d.position.x + ',' + d.position.y + ')';
181
+ }); // this.moveEdges([...]);
182
+ }
183
+ }, {
184
+ key: "movePort",
185
+ value: function movePort(entity_core, port_core) {
186
+ var entity = this._data.find(function (d) {
187
+ return d._id === entity_core._id;
188
+ });
189
+
190
+ var port = entity.ports.items.ht[port_core._id];
191
+ this.positioningPort(entity, port); // redraw ports
192
+
193
+ var ports = this.getLayerForeground().selectAll('circle.entity-port').data([port], function (d) {
194
+ return d._id;
195
+ });
196
+ this.drawPortsCore(ports); // redraw edge
197
+
198
+ var edges = [];
199
+
200
+ var add_edges = function add_edges(ht) {
201
+ for (var k in ht) {
202
+ var edge = ht[k];
203
+ if (edge.from_class === "PORT-TER" && edge.to_class === "PORT-TER") edges.push(edge);
204
+ }
205
+ };
206
+
207
+ add_edges(this._relationships.indexes.from[port._id]);
208
+ add_edges(this._relationships.indexes.to[port._id]);
209
+ var elements = this.getLayerBackground().selectAll('line.connector').data(edges, function (d) {
210
+ return d._id;
211
+ });
212
+ this.drawEdgesCore(elements);
213
+ }
214
+ /* **************************************************************** *
215
+ * Draw
216
+ * **************************************************************** */
217
+
218
+ }, {
219
+ key: "draw",
220
+ value: function draw() {
221
+ this._callbacks = {};
222
+ this.entity.draw(this.getLayerForeground(), this._entities);
223
+ this.relationship.draw(this.getLayerBackground(), this._relationships);
224
+ }
225
+ /* **************************************************************** *
226
+ * move port
227
+ * **************************************************************** */
228
+
229
+ /* **************************************************************** *
230
+ * to Json
231
+ * **************************************************************** */
232
+
233
+ }, {
234
+ key: "stateTER2Json",
235
+ value: function stateTER2Json(state) {
236
+ var out = {};
237
+ out.cameras = state.cameras.list;
238
+ out.entities = state.entities.list;
239
+
240
+ var modifyColumns = function modifyColumns(obj) {
241
+ var new_data = Object.assign({}, obj);
242
+ delete new_data._entity;
243
+ delete new_data._parent;
244
+ return new_data;
245
+ };
246
+
247
+ out.identifier_instances = state.identifier_instances.list.map(modifyColumns);
248
+ out.attribute_instances = state.attribute_instances.list.map(modifyColumns);
249
+ out.relationships = state.relationships.list.map(function (obj) {
250
+ var new_data = Object.assign({}, obj);
251
+ delete new_data._from;
252
+ delete new_data._to;
253
+ return new_data;
254
+ });
255
+ out.ports = state.ports.list.map(function (obj) {
256
+ var new_data = Object.assign({}, obj);
257
+ delete new_data._element;
258
+ return new_data;
259
+ });
260
+ return JSON.stringify(out, null, 3);
261
+ }
262
+ }, {
263
+ key: "downloadJson",
264
+ value: function downloadJson(name, json) {
265
+ var blob = new Blob([json], {
266
+ type: 'application/json'
267
+ });
268
+ var a = document.createElement("a");
269
+ a.href = URL.createObjectURL(blob);
270
+ a.target = '_blank';
271
+ a.download = name + '.' + (0, _moment["default"])().format('YYYYMMDDHHmmssZZ') + '.json';
272
+ a.click();
273
+ }
274
+ }]);
275
+
276
+ return AssholeD3TER;
277
+ }(_assh0le["default"]);
278
+
279
+ exports["default"] = AssholeD3TER;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _Pool = _interopRequireDefault(require("./Pool.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
+
14
+ 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); } }
15
+
16
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
+
18
+ var Attribute = /*#__PURE__*/function () {
19
+ function Attribute() {
20
+ _classCallCheck(this, Attribute);
21
+ }
22
+
23
+ _createClass(Attribute, [{
24
+ key: "list2pool",
25
+ value: function list2pool(list) {
26
+ return new _Pool["default"]().list2pool(list, function (d) {
27
+ return d;
28
+ });
29
+ }
30
+ }, {
31
+ key: "template",
32
+ value: function template() {
33
+ return {
34
+ _id: null,
35
+ _class: 'ATTRIBUTE',
36
+ name: {
37
+ physical: '??',
38
+ logical: ''
39
+ },
40
+ _core: null
41
+ };
42
+ }
43
+ }, {
44
+ key: "build",
45
+ value: function build(core) {
46
+ var element = this.template();
47
+ element._id = core.id;
48
+ element.name = core.name;
49
+ element._core = core;
50
+ core._element = element;
51
+ return element;
52
+ }
53
+ }]);
54
+
55
+ return Attribute;
56
+ }();
57
+
58
+ exports["default"] = Attribute;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _ColumnInstance2 = _interopRequireDefault(require("./ColumnInstance.js"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
+
16
+ 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); } }
17
+
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+
20
+ 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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
+
28
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
+
34
+ var AttributeInstance = /*#__PURE__*/function (_ColumnInstance) {
35
+ _inherits(AttributeInstance, _ColumnInstance);
36
+
37
+ var _super = _createSuper(AttributeInstance);
38
+
39
+ function AttributeInstance() {
40
+ _classCallCheck(this, AttributeInstance);
41
+
42
+ return _super.apply(this, arguments);
43
+ }
44
+
45
+ _createClass(AttributeInstance, [{
46
+ key: "template",
47
+ value: function template() {
48
+ return {
49
+ _id: null,
50
+ _class: 'ATTRIBUTE-INSTANCE',
51
+ name: {
52
+ physical: '??',
53
+ logical: ''
54
+ },
55
+ position: {
56
+ x: 0,
57
+ y: 0
58
+ },
59
+ size: {
60
+ w: 0,
61
+ h: 0
62
+ },
63
+ _master: null,
64
+ _core: null
65
+ };
66
+ }
67
+ }]);
68
+
69
+ return AttributeInstance;
70
+ }(_ColumnInstance2["default"]);
71
+
72
+ exports["default"] = AttributeInstance;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _Pool = _interopRequireDefault(require("./Pool.js"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
+
12
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
+
14
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
+
16
+ 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; }
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); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
+
24
+ var ColumnInstance = /*#__PURE__*/function () {
25
+ function ColumnInstance() {
26
+ _classCallCheck(this, ColumnInstance);
27
+ }
28
+
29
+ _createClass(ColumnInstance, [{
30
+ key: "list2pool",
31
+ value: function list2pool(list) {
32
+ return new _Pool["default"]().list2pool(list);
33
+ }
34
+ }, {
35
+ key: "template",
36
+ value: function template() {
37
+ return {
38
+ _id: null,
39
+ _core: null,
40
+ _master: null,
41
+ name: null
42
+ };
43
+ }
44
+ }, {
45
+ key: "build",
46
+ value: function build(core, master) {
47
+ var element = this.template();
48
+ element._id = core.id;
49
+ element._core = core;
50
+ core._element = element;
51
+ element._master = master;
52
+ element.name = _objectSpread({}, core.name ? core.name : master.name);
53
+ return element;
54
+ }
55
+ }]);
56
+
57
+ return ColumnInstance;
58
+ }();
59
+
60
+ exports["default"] = ColumnInstance;