TestModule.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _react = _interopRequireDefault(require("react"));
  7. var _Module2 = _interopRequireDefault(require("./Module"));
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
  10. 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; }
  11. 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); }
  12. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13. 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); } }
  14. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  15. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  16. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  18. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  19. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  21. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  22. var Test =
  23. /*#__PURE__*/
  24. function (_Module) {
  25. _inherits(Test, _Module);
  26. function Test(props) {
  27. var _this;
  28. _classCallCheck(this, Test);
  29. _this = _possibleConstructorReturn(this, _getPrototypeOf(Test).call(this, props)); // this.number.onUpdate(() => this.output.set(this.number.value * this.number.value));
  30. _this.output.set(_this.number.value * _this.number.value); // NEED CTOR ON 2nd param import FILE FIRST
  31. // this.ImageModule = this.ModuleSystem.ghostModule("TESTNAV","Text", {text: "/logo.png", size:'25px'});
  32. // {this.ImageModule.render()}
  33. return _this;
  34. }
  35. _createClass(Test, [{
  36. key: "render",
  37. value: function render() {
  38. return _react.default.createElement("div", {
  39. className: "asd"
  40. }, _react.default.createElement("div", {
  41. className: "card-body"
  42. }, _react.default.createElement("div", {
  43. className: "card-title"
  44. }, "asdasdasdasd", this.number.value, this.height.value, this.header.value, JSON.stringify(this.ar2.value)), _get(_getPrototypeOf(Test.prototype), "render", this).call(this)));
  45. }
  46. }]);
  47. return Test;
  48. }(_Module2.default);
  49. Test.EditPosition = "center";
  50. Test.Outputs = {
  51. output: {}
  52. };
  53. Test.Inputs = _objectSpread({}, _Module2.default.Inputs, {
  54. number: {
  55. type: _Module2.default.Types.Number,
  56. required: true,
  57. defaultValue: 1
  58. },
  59. bb: {
  60. type: _Module2.default.Types.Boolean,
  61. defaultValue: true
  62. },
  63. height: {
  64. type: _Module2.default.Types.Text,
  65. required: false,
  66. defaultValue: "auto"
  67. },
  68. header: {
  69. type: _Module2.default.Types.Text,
  70. required: false,
  71. defaultValue: ""
  72. },
  73. image: {
  74. type: _Module2.default.Types.Text,
  75. required: false,
  76. defaultValue: ""
  77. },
  78. image2: {
  79. type: _Module2.default.Types.Object,
  80. required: false,
  81. defaultValue: {}
  82. },
  83. arr: {
  84. type: _Module2.default.Types.Array,
  85. required: false,
  86. defaultValue: ["123", "123"],
  87. arrType: _Module2.default.Types.Text
  88. },
  89. ar2: {
  90. type: _Module2.default.Types.Array,
  91. required: false,
  92. defaultValue: [{
  93. asd: 123
  94. }, {
  95. b: 1
  96. }],
  97. arrType: _Module2.default.Types.Object
  98. }
  99. });
  100. Test.Category = "Test";
  101. var _default = Test;
  102. exports.default = _default;