hadron-document 7.9.0 → 7.12.0
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 +5 -5
- package/dist/document.d.ts +54 -0
- package/dist/document.d.ts.map +1 -0
- package/dist/document.js +248 -0
- package/dist/document.js.map +1 -0
- package/dist/editor/date.d.ts +13 -0
- package/dist/editor/date.d.ts.map +1 -0
- package/dist/editor/date.js +65 -0
- package/dist/editor/date.js.map +1 -0
- package/dist/editor/decimal128.d.ts +9 -0
- package/dist/editor/decimal128.d.ts.map +1 -0
- package/dist/editor/decimal128.js +32 -0
- package/dist/editor/decimal128.js.map +1 -0
- package/dist/editor/double.d.ts +10 -0
- package/dist/editor/double.d.ts.map +1 -0
- package/dist/editor/double.js +44 -0
- package/dist/editor/double.js.map +1 -0
- package/dist/editor/index.d.ts +38 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +51 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/int32.d.ts +7 -0
- package/dist/editor/int32.d.ts.map +1 -0
- package/dist/editor/int32.js +17 -0
- package/dist/editor/int32.js.map +1 -0
- package/dist/editor/int64.d.ts +9 -0
- package/dist/editor/int64.d.ts.map +1 -0
- package/dist/editor/int64.js +32 -0
- package/dist/editor/int64.js.map +1 -0
- package/dist/editor/null.d.ts +8 -0
- package/dist/editor/null.d.ts.map +1 -0
- package/dist/editor/null.js +20 -0
- package/dist/editor/null.js.map +1 -0
- package/dist/editor/objectid.d.ts +10 -0
- package/dist/editor/objectid.d.ts.map +1 -0
- package/dist/editor/objectid.js +38 -0
- package/dist/editor/objectid.js.map +1 -0
- package/dist/editor/standard.d.ts +16 -0
- package/dist/editor/standard.d.ts.map +1 -0
- package/dist/editor/standard.js +49 -0
- package/dist/editor/standard.js.map +1 -0
- package/dist/editor/string.d.ts +7 -0
- package/dist/editor/string.d.ts.map +1 -0
- package/dist/editor/string.js +15 -0
- package/dist/editor/string.js.map +1 -0
- package/dist/editor/undefined.d.ts +8 -0
- package/dist/editor/undefined.d.ts.map +1 -0
- package/dist/editor/undefined.js +20 -0
- package/dist/editor/undefined.js.map +1 -0
- package/dist/element-events.d.ts +11 -0
- package/dist/element-events.d.ts.map +1 -0
- package/dist/element-events.js +12 -0
- package/dist/element-events.js.map +1 -0
- package/dist/element.d.ts +114 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +660 -0
- package/dist/element.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/object-generator.d.ts +12 -0
- package/dist/object-generator.d.ts.map +1 -0
- package/dist/object-generator.js +94 -0
- package/dist/object-generator.js.map +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +37 -0
- package/dist/utils.js.map +1 -0
- package/package.json +42 -28
- package/.babelrc.js +0 -14
- package/.depcheckrc +0 -6
- package/.eslintignore +0 -1
- package/index.d.ts +0 -192
- package/index.js +0 -1
- package/lib/document.js +0 -624
- package/lib/editor/date.js +0 -151
- package/lib/editor/decimal128.js +0 -88
- package/lib/editor/double.js +0 -113
- package/lib/editor/index.js +0 -50
- package/lib/editor/int32.js +0 -68
- package/lib/editor/int64.js +0 -88
- package/lib/editor/null.js +0 -81
- package/lib/editor/objectid.js +0 -98
- package/lib/editor/standard.js +0 -108
- package/lib/editor/string.js +0 -48
- package/lib/editor/undefined.js +0 -81
- package/lib/element-events.js +0 -15
- package/lib/element.js +0 -1307
- package/lib/index.js +0 -7
- package/lib/object-generator.js +0 -180
- package/lib/utils.js +0 -10
- package/src/document.js +0 -432
- package/src/editor/date.js +0 -95
- package/src/editor/decimal128.js +0 -46
- package/src/editor/double.js +0 -70
- package/src/editor/index.js +0 -40
- package/src/editor/int32.js +0 -29
- package/src/editor/int64.js +0 -46
- package/src/editor/null.js +0 -42
- package/src/editor/objectid.js +0 -54
- package/src/editor/standard.js +0 -78
- package/src/editor/string.js +0 -20
- package/src/editor/undefined.js +0 -42
- package/src/element-events.js +0 -14
- package/src/element.js +0 -1002
- package/src/index.js +0 -5
- package/src/object-generator.js +0 -96
- package/src/utils.js +0 -6
package/lib/editor/objectid.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
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
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
|
-
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); } }
|
|
8
|
-
|
|
9
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
-
|
|
11
|
-
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); }
|
|
12
|
-
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
-
|
|
15
|
-
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); }; }
|
|
16
|
-
|
|
17
|
-
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); }
|
|
18
|
-
|
|
19
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
|
|
21
|
-
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; } }
|
|
22
|
-
|
|
23
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
-
|
|
25
|
-
var TypeChecker = require('hadron-type-checker');
|
|
26
|
-
|
|
27
|
-
var Events = require('../element-events');
|
|
28
|
-
|
|
29
|
-
var StandardEditor = require('./standard');
|
|
30
|
-
/**
|
|
31
|
-
* CRUD editor for object id values.
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var ObjectIdEditor = /*#__PURE__*/function (_StandardEditor) {
|
|
36
|
-
_inherits(ObjectIdEditor, _StandardEditor);
|
|
37
|
-
|
|
38
|
-
var _super = _createSuper(ObjectIdEditor);
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Create the editor with the element.
|
|
42
|
-
*
|
|
43
|
-
* @param {Element} element - The hadron document element.
|
|
44
|
-
*/
|
|
45
|
-
function ObjectIdEditor(element) {
|
|
46
|
-
_classCallCheck(this, ObjectIdEditor);
|
|
47
|
-
|
|
48
|
-
return _super.call(this, element);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Complete the object id edit by converting the valid string to an object id
|
|
52
|
-
* object or leaving as invalid.
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_createClass(ObjectIdEditor, [{
|
|
57
|
-
key: "complete",
|
|
58
|
-
value: function complete() {
|
|
59
|
-
if (this.element.isCurrentTypeValid()) {
|
|
60
|
-
this.element.edit(TypeChecker.cast(this.element.currentValue, 'ObjectId'));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Edit the element with the provided value.
|
|
65
|
-
*
|
|
66
|
-
* @param {Object} value - The new value.
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
}, {
|
|
70
|
-
key: "edit",
|
|
71
|
-
value: function edit(value) {
|
|
72
|
-
try {
|
|
73
|
-
TypeChecker.cast(value, 'ObjectId');
|
|
74
|
-
this.element.currentValue = value;
|
|
75
|
-
this.element.setValid();
|
|
76
|
-
|
|
77
|
-
this.element._bubbleUp(Events.Edited, this.element);
|
|
78
|
-
} catch (e) {
|
|
79
|
-
this.element.setInvalid(value, this.element.currentType, e.message);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Start the object id edit.
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
}, {
|
|
87
|
-
key: "start",
|
|
88
|
-
value: function start() {
|
|
89
|
-
if (this.element.isCurrentTypeValid()) {
|
|
90
|
-
this.edit(String(this.element.currentValue));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}]);
|
|
94
|
-
|
|
95
|
-
return ObjectIdEditor;
|
|
96
|
-
}(StandardEditor);
|
|
97
|
-
|
|
98
|
-
module.exports = ObjectIdEditor;
|
package/lib/editor/standard.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
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); } }
|
|
6
|
-
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
-
|
|
9
|
-
var TypeChecker = require('hadron-type-checker');
|
|
10
|
-
|
|
11
|
-
var Events = require('../element-events');
|
|
12
|
-
|
|
13
|
-
var _require = require('../utils'),
|
|
14
|
-
fieldStringLen = _require.fieldStringLen;
|
|
15
|
-
/**
|
|
16
|
-
* Regex to match an array or object string.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var ARRAY_OR_OBJECT = /^(\[|\{)(.+)(\]|\})$/;
|
|
21
|
-
/**
|
|
22
|
-
* CRUD editor for standard values.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
var StandardEditor = /*#__PURE__*/function () {
|
|
26
|
-
/**
|
|
27
|
-
* Create the editor with the element.
|
|
28
|
-
*
|
|
29
|
-
* @param {Element} element - The hadron document element.
|
|
30
|
-
*/
|
|
31
|
-
function StandardEditor(element) {
|
|
32
|
-
_classCallCheck(this, StandardEditor);
|
|
33
|
-
|
|
34
|
-
this.element = element;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Edit the element with the provided value.
|
|
38
|
-
*
|
|
39
|
-
* @param {Object} value - The new value.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_createClass(StandardEditor, [{
|
|
44
|
-
key: "edit",
|
|
45
|
-
value: function edit(value) {
|
|
46
|
-
var currentType = this.element.currentType;
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
var newValue = TypeChecker.cast(value, currentType);
|
|
50
|
-
this.element.edit(newValue);
|
|
51
|
-
} catch (e) {
|
|
52
|
-
this.element.setInvalid(value, currentType, e.message);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Edit the element via a paste.
|
|
57
|
-
*
|
|
58
|
-
* @param {String} value - The balue.
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
}, {
|
|
62
|
-
key: "paste",
|
|
63
|
-
value: function paste(value) {
|
|
64
|
-
if (value.match(ARRAY_OR_OBJECT)) {
|
|
65
|
-
this.edit(JSON.parse(value));
|
|
66
|
-
|
|
67
|
-
this.element._bubbleUp(Events.Converted, this.element);
|
|
68
|
-
} else {
|
|
69
|
-
this.edit(value);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Get the number of characters the value should display.
|
|
74
|
-
*
|
|
75
|
-
* @param {Boolean} editMode - If the element is being edited.
|
|
76
|
-
*
|
|
77
|
-
* @returns {Number} The number of characters.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
}, {
|
|
81
|
-
key: "size",
|
|
82
|
-
value: function size() {
|
|
83
|
-
return fieldStringLen(this.element.currentValue);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get the value being edited.
|
|
87
|
-
*
|
|
88
|
-
* @returns {Object} The value.
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
}, {
|
|
92
|
-
key: "value",
|
|
93
|
-
value: function value() {
|
|
94
|
-
return this.element.currentValue;
|
|
95
|
-
} // Standard editing requires no special start/complete behaviour.
|
|
96
|
-
|
|
97
|
-
}, {
|
|
98
|
-
key: "start",
|
|
99
|
-
value: function start() {}
|
|
100
|
-
}, {
|
|
101
|
-
key: "complete",
|
|
102
|
-
value: function complete() {}
|
|
103
|
-
}]);
|
|
104
|
-
|
|
105
|
-
return StandardEditor;
|
|
106
|
-
}();
|
|
107
|
-
|
|
108
|
-
module.exports = StandardEditor;
|
package/lib/editor/string.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
|
-
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); }
|
|
8
|
-
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
-
|
|
11
|
-
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); }; }
|
|
12
|
-
|
|
13
|
-
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); }
|
|
14
|
-
|
|
15
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
-
|
|
17
|
-
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; } }
|
|
18
|
-
|
|
19
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20
|
-
|
|
21
|
-
var StandardEditor = require('./standard');
|
|
22
|
-
|
|
23
|
-
var STRING_TYPE = 'String';
|
|
24
|
-
/**
|
|
25
|
-
* CRUD editor for string values.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
var StringEditor = /*#__PURE__*/function (_StandardEditor) {
|
|
29
|
-
_inherits(StringEditor, _StandardEditor);
|
|
30
|
-
|
|
31
|
-
var _super = _createSuper(StringEditor);
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Create the editor with the element.
|
|
35
|
-
*
|
|
36
|
-
* @param {Element} element - The hadron document element.
|
|
37
|
-
*/
|
|
38
|
-
function StringEditor(element) {
|
|
39
|
-
_classCallCheck(this, StringEditor);
|
|
40
|
-
|
|
41
|
-
return _super.call(this, element);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return StringEditor;
|
|
45
|
-
}(StandardEditor);
|
|
46
|
-
|
|
47
|
-
module.exports = StringEditor;
|
|
48
|
-
module.exports.STRING_TYPE = STRING_TYPE;
|
package/lib/editor/undefined.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
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
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
|
|
7
|
-
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); } }
|
|
8
|
-
|
|
9
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
-
|
|
11
|
-
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); }
|
|
12
|
-
|
|
13
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
-
|
|
15
|
-
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); }; }
|
|
16
|
-
|
|
17
|
-
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); }
|
|
18
|
-
|
|
19
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
-
|
|
21
|
-
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; } }
|
|
22
|
-
|
|
23
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24
|
-
|
|
25
|
-
var StandardEditor = require('./standard');
|
|
26
|
-
/**
|
|
27
|
-
* Undefined is always 'undefined'
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var VALUE = 'undefined';
|
|
32
|
-
/**
|
|
33
|
-
* CRUD editor for undefined values.
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
var UndefinedEditor = /*#__PURE__*/function (_StandardEditor) {
|
|
37
|
-
_inherits(UndefinedEditor, _StandardEditor);
|
|
38
|
-
|
|
39
|
-
var _super = _createSuper(UndefinedEditor);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Create the editor with the element.
|
|
43
|
-
*
|
|
44
|
-
* @param {Element} element - The hadron document element.
|
|
45
|
-
*/
|
|
46
|
-
function UndefinedEditor(element) {
|
|
47
|
-
_classCallCheck(this, UndefinedEditor);
|
|
48
|
-
|
|
49
|
-
return _super.call(this, element);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get the number of characters the value should display.
|
|
53
|
-
*
|
|
54
|
-
* @param {Boolean} editMode - If the element is being edited.
|
|
55
|
-
*
|
|
56
|
-
* @returns {Number} The number of characters.
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_createClass(UndefinedEditor, [{
|
|
61
|
-
key: "size",
|
|
62
|
-
value: function size() {
|
|
63
|
-
return VALUE.length;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get the value being edited.
|
|
67
|
-
*
|
|
68
|
-
* @returns {Object} The value.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
}, {
|
|
72
|
-
key: "value",
|
|
73
|
-
value: function value() {
|
|
74
|
-
return VALUE;
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
|
|
78
|
-
return UndefinedEditor;
|
|
79
|
-
}(StandardEditor);
|
|
80
|
-
|
|
81
|
-
module.exports = UndefinedEditor;
|
package/lib/element-events.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The event constant.
|
|
5
|
-
*/
|
|
6
|
-
var Events = {
|
|
7
|
-
Added: 'Element::Added',
|
|
8
|
-
Edited: 'Element::Edited',
|
|
9
|
-
Removed: 'Element::Removed',
|
|
10
|
-
Reverted: 'Element::Reverted',
|
|
11
|
-
Converted: 'Element::Converted',
|
|
12
|
-
Invalid: 'Element::Invalid',
|
|
13
|
-
Valid: 'Element::Valid'
|
|
14
|
-
};
|
|
15
|
-
module.exports = Events;
|