juxtapose 4.0.130 → 4.0.132
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/lib/example/mvcApplication/constants.js +3 -3
- package/lib/example/mvcApplication/controller.js +3 -3
- package/lib/example/mvcApplication/model.js +8 -37
- package/lib/example/mvcApplication/view/button/resetPassword.js +18 -168
- package/lib/example/mvcApplication/view/form/password.js +43 -199
- package/lib/example/mvcApplication/view/input/password.js +22 -125
- package/lib/example/mvcApplication/view/paragraph/message.js +14 -160
- package/lib/example/mvcApplication/view/paragraph/validationError.js +32 -220
- package/lib/example/mvcApplication/view.js +18 -164
- package/lib/example/mvcApplication.js +9 -9
- package/lib/example/simpleApplication.js +3 -3
- package/lib/examples.js +3 -3
- package/lib/juxtapose.js +2 -2
- package/package.json +5 -1
- package/.swcrc +0 -11
- package/bin/main.js +0 -15
- package/example/mvc-application.html +0 -51
- package/example/simple-application.html +0 -35
- package/examples.js +0 -6355
- package/index.html +0 -16
|
@@ -16,7 +16,7 @@ _export(exports, {
|
|
|
16
16
|
return ERROR_DELAY;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const ERROR_DELAY = 1000;
|
|
20
|
+
const EMPTY_STRING = "";
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9leGFtcGxlL212Y0FwcGxpY2F0aW9uL2NvbnN0YW50cy5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0IGNvbnN0IEVSUk9SX0RFTEFZID0gMTAwMDtcbmV4cG9ydCBjb25zdCBFTVBUWV9TVFJJTkcgPSBcIlwiO1xuIl0sIm5hbWVzIjpbIkVNUFRZX1NUUklORyIsIkVSUk9SX0RFTEFZIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7UUFHYUE7ZUFBQUE7O1FBREFDO2VBQUFBOzs7QUFBTixNQUFNQSxjQUFjO0FBQ3BCLE1BQU1ELGVBQWUifQ==
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const controller = {};
|
|
12
|
+
const _default = controller;
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9leGFtcGxlL212Y0FwcGxpY2F0aW9uL2NvbnRyb2xsZXIuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmNvbnN0IGNvbnRyb2xsZXIgPSB7fTtcblxuZXhwb3J0IGRlZmF1bHQgY29udHJvbGxlcjtcbiJdLCJuYW1lcyI6WyJjb250cm9sbGVyIl0sIm1hcHBpbmdzIjoiQUFBQTs7OzsrQkFJQTs7O2VBQUE7OztBQUZBLE1BQU1BLGFBQWEsQ0FBQztNQUVwQixXQUFlQSJ9
|
|
@@ -8,45 +8,16 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return Model;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
class Model {
|
|
12
|
+
constructor(){
|
|
13
|
+
this.password = null;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
for(var i = 0; i < props.length; i++){
|
|
18
|
-
var descriptor = props[i];
|
|
19
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
-
descriptor.configurable = true;
|
|
21
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
15
|
+
setPassword(password) {
|
|
16
|
+
this.password = password;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
-
return Constructor;
|
|
29
|
-
}
|
|
30
|
-
var Model = /*#__PURE__*/ function() {
|
|
31
|
-
function Model() {
|
|
32
|
-
_class_call_check(this, Model);
|
|
18
|
+
resetPassword() {
|
|
33
19
|
this.password = null;
|
|
34
20
|
}
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
key: "setPassword",
|
|
38
|
-
value: function setPassword(password) {
|
|
39
|
-
this.password = password;
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
key: "resetPassword",
|
|
44
|
-
value: function resetPassword() {
|
|
45
|
-
this.password = null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]);
|
|
49
|
-
return Model;
|
|
50
|
-
}();
|
|
21
|
+
}
|
|
51
22
|
|
|
52
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9leGFtcGxlL212Y0FwcGxpY2F0aW9uL21vZGVsLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBNb2RlbCB7XG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMucGFzc3dvcmQgPSBudWxsO1xuICB9XG5cbiAgc2V0UGFzc3dvcmQocGFzc3dvcmQpIHtcbiAgICB0aGlzLnBhc3N3b3JkID0gcGFzc3dvcmQ7XG4gIH1cblxuICByZXNldFBhc3N3b3JkKCkge1xuICAgIHRoaXMucGFzc3dvcmQgPSBudWxsO1xuICB9XG59XG4iXSwibmFtZXMiOlsiTW9kZWwiLCJwYXNzd29yZCIsInNldFBhc3N3b3JkIiwicmVzZXRQYXNzd29yZCJdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7K0JBRUE7OztlQUFxQkE7OztBQUFOLE1BQU1BO0lBQ25CLGFBQWM7UUFDWixJQUFJLENBQUNDLFFBQVEsR0FBRztJQUNsQjtJQUVBQyxZQUFZRCxRQUFRLEVBQUU7UUFDcEIsSUFBSSxDQUFDQSxRQUFRLEdBQUdBO0lBQ2xCO0lBRUFFLGdCQUFnQjtRQUNkLElBQUksQ0FBQ0YsUUFBUSxHQUFHO0lBQ2xCO0FBQ0YifQ==
|
|
@@ -8,180 +8,30 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return ResetPasswordButton;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _assert_this_initialized(self) {
|
|
14
|
-
if (self === void 0) {
|
|
15
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
16
|
-
}
|
|
17
|
-
return self;
|
|
18
|
-
}
|
|
19
|
-
function _call_super(_this, derived, args) {
|
|
20
|
-
derived = _get_prototype_of(derived);
|
|
21
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
22
|
-
}
|
|
23
|
-
function _class_call_check(instance, Constructor) {
|
|
24
|
-
if (!(instance instanceof Constructor)) {
|
|
25
|
-
throw new TypeError("Cannot call a class as a function");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _construct(Parent, args, Class) {
|
|
29
|
-
if (_is_native_reflect_construct()) {
|
|
30
|
-
_construct = Reflect.construct;
|
|
31
|
-
} else {
|
|
32
|
-
_construct = function construct(Parent, args, Class) {
|
|
33
|
-
var a = [
|
|
34
|
-
null
|
|
35
|
-
];
|
|
36
|
-
a.push.apply(a, args);
|
|
37
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
38
|
-
var instance = new Constructor();
|
|
39
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
40
|
-
return instance;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return _construct.apply(null, arguments);
|
|
44
|
-
}
|
|
45
|
-
function _defineProperties(target, props) {
|
|
46
|
-
for(var i = 0; i < props.length; i++){
|
|
47
|
-
var descriptor = props[i];
|
|
48
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
49
|
-
descriptor.configurable = true;
|
|
50
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
51
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
55
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
56
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
57
|
-
return Constructor;
|
|
58
|
-
}
|
|
59
|
-
function _define_property(obj, key, value) {
|
|
60
|
-
if (key in obj) {
|
|
61
|
-
Object.defineProperty(obj, key, {
|
|
62
|
-
value: value,
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true,
|
|
65
|
-
writable: true
|
|
66
|
-
});
|
|
67
|
-
} else {
|
|
68
|
-
obj[key] = value;
|
|
69
|
-
}
|
|
70
|
-
return obj;
|
|
71
|
-
}
|
|
72
|
-
function _get_prototype_of(o) {
|
|
73
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
74
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
75
|
-
};
|
|
76
|
-
return _get_prototype_of(o);
|
|
77
|
-
}
|
|
78
|
-
function _inherits(subClass, superClass) {
|
|
79
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
80
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
81
|
-
}
|
|
82
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
83
|
-
constructor: {
|
|
84
|
-
value: subClass,
|
|
85
|
-
writable: true,
|
|
86
|
-
configurable: true
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
90
|
-
}
|
|
11
|
+
const _easy = require("easy");
|
|
12
|
+
const _controller = /*#__PURE__*/ _interop_require_default(require("../../controller"));
|
|
91
13
|
function _interop_require_default(obj) {
|
|
92
14
|
return obj && obj.__esModule ? obj : {
|
|
93
15
|
default: obj
|
|
94
16
|
};
|
|
95
17
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
function _possible_constructor_return(self, call) {
|
|
100
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
101
|
-
return call;
|
|
102
|
-
}
|
|
103
|
-
return _assert_this_initialized(self);
|
|
104
|
-
}
|
|
105
|
-
function _set_prototype_of(o, p) {
|
|
106
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
107
|
-
o.__proto__ = p;
|
|
108
|
-
return o;
|
|
18
|
+
class ResetPasswordButton extends _easy.Element {
|
|
19
|
+
clickHandler = (event, element)=>{
|
|
20
|
+
_controller.default.resetPassword();
|
|
109
21
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
if (typeof _cache !== "undefined") {
|
|
124
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
125
|
-
_cache.set(Class, Wrapper);
|
|
126
|
-
}
|
|
127
|
-
function Wrapper() {
|
|
128
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
129
|
-
}
|
|
130
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
131
|
-
constructor: {
|
|
132
|
-
value: Wrapper,
|
|
133
|
-
enumerable: false,
|
|
134
|
-
writable: true,
|
|
135
|
-
configurable: true
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
return _set_prototype_of(Wrapper, Class);
|
|
22
|
+
didMount() {
|
|
23
|
+
this.onClick(this.clickHandler, this);
|
|
24
|
+
}
|
|
25
|
+
willMount() {
|
|
26
|
+
this.offClick(this.clickHandler, this);
|
|
27
|
+
}
|
|
28
|
+
childElements() {
|
|
29
|
+
return "Reset password";
|
|
30
|
+
}
|
|
31
|
+
static tagName = "button";
|
|
32
|
+
static defaultProperties = {
|
|
33
|
+
className: "reset-password"
|
|
139
34
|
};
|
|
140
|
-
return _wrap_native_super(Class);
|
|
141
35
|
}
|
|
142
|
-
function _is_native_reflect_construct() {
|
|
143
|
-
try {
|
|
144
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
145
|
-
} catch (_) {}
|
|
146
|
-
return (_is_native_reflect_construct = function() {
|
|
147
|
-
return !!result;
|
|
148
|
-
})();
|
|
149
|
-
}
|
|
150
|
-
var ResetPasswordButton = /*#__PURE__*/ function(Element) {
|
|
151
|
-
_inherits(ResetPasswordButton, Element);
|
|
152
|
-
function ResetPasswordButton() {
|
|
153
|
-
_class_call_check(this, ResetPasswordButton);
|
|
154
|
-
var _this;
|
|
155
|
-
_this = _call_super(this, ResetPasswordButton, arguments), _define_property(_this, "clickHandler", function(event, element) {
|
|
156
|
-
_controller.default.resetPassword();
|
|
157
|
-
});
|
|
158
|
-
return _this;
|
|
159
|
-
}
|
|
160
|
-
_create_class(ResetPasswordButton, [
|
|
161
|
-
{
|
|
162
|
-
key: "didMount",
|
|
163
|
-
value: function didMount() {
|
|
164
|
-
this.onClick(this.clickHandler, this);
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
key: "willMount",
|
|
169
|
-
value: function willMount() {
|
|
170
|
-
this.offClick(this.clickHandler, this);
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
key: "childElements",
|
|
175
|
-
value: function childElements() {
|
|
176
|
-
return "Reset password";
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
]);
|
|
180
|
-
return ResetPasswordButton;
|
|
181
|
-
}(_wrap_native_super(_easy.Element));
|
|
182
|
-
_define_property(ResetPasswordButton, "tagName", "button");
|
|
183
|
-
_define_property(ResetPasswordButton, "defaultProperties", {
|
|
184
|
-
className: "reset-password"
|
|
185
|
-
});
|
|
186
36
|
|
|
187
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9leGFtcGxlL212Y0FwcGxpY2F0aW9uL3ZpZXcvYnV0dG9uL3Jlc2V0UGFzc3dvcmQuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCB7IEVsZW1lbnQgfSBmcm9tIFwiZWFzeVwiO1xuXG5pbXBvcnQgY29udHJvbGxlciBmcm9tIFwiLi4vLi4vY29udHJvbGxlclwiO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBSZXNldFBhc3N3b3JkQnV0dG9uIGV4dGVuZHMgRWxlbWVudCB7XG4gIGNsaWNrSGFuZGxlciA9IChldmVudCwgZWxlbWVudCkgPT4ge1xuICAgIGNvbnRyb2xsZXIucmVzZXRQYXNzd29yZCgpO1xuICB9XG5cbiAgZGlkTW91bnQoKSB7XG4gICAgdGhpcy5vbkNsaWNrKHRoaXMuY2xpY2tIYW5kbGVyLCB0aGlzKTtcbiAgfVxuXG4gIHdpbGxNb3VudCgpIHtcbiAgICB0aGlzLm9mZkNsaWNrKHRoaXMuY2xpY2tIYW5kbGVyLCB0aGlzKTtcbiAgfVxuXG4gIGNoaWxkRWxlbWVudHMoKSB7XG4gICAgcmV0dXJuIFwiUmVzZXQgcGFzc3dvcmRc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
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function _assert_this_initialized(self) {
|
|
17
|
-
if (self === void 0) {
|
|
18
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19
|
-
}
|
|
20
|
-
return self;
|
|
21
|
-
}
|
|
22
|
-
function _call_super(_this, derived, args) {
|
|
23
|
-
derived = _get_prototype_of(derived);
|
|
24
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
25
|
-
}
|
|
26
|
-
function _class_call_check(instance, Constructor) {
|
|
27
|
-
if (!(instance instanceof Constructor)) {
|
|
28
|
-
throw new TypeError("Cannot call a class as a function");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function _construct(Parent, args, Class) {
|
|
32
|
-
if (_is_native_reflect_construct()) {
|
|
33
|
-
_construct = Reflect.construct;
|
|
34
|
-
} else {
|
|
35
|
-
_construct = function construct(Parent, args, Class) {
|
|
36
|
-
var a = [
|
|
37
|
-
null
|
|
38
|
-
];
|
|
39
|
-
a.push.apply(a, args);
|
|
40
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
41
|
-
var instance = new Constructor();
|
|
42
|
-
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
43
|
-
return instance;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return _construct.apply(null, arguments);
|
|
47
|
-
}
|
|
48
|
-
function _defineProperties(target, props) {
|
|
49
|
-
for(var i = 0; i < props.length; i++){
|
|
50
|
-
var descriptor = props[i];
|
|
51
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
52
|
-
descriptor.configurable = true;
|
|
53
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
54
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
58
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
59
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
60
|
-
return Constructor;
|
|
61
|
-
}
|
|
62
|
-
function _define_property(obj, key, value) {
|
|
63
|
-
if (key in obj) {
|
|
64
|
-
Object.defineProperty(obj, key, {
|
|
65
|
-
value: value,
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true
|
|
69
|
-
});
|
|
70
|
-
} else {
|
|
71
|
-
obj[key] = value;
|
|
72
|
-
}
|
|
73
|
-
return obj;
|
|
74
|
-
}
|
|
75
|
-
function _get_prototype_of(o) {
|
|
76
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
77
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
78
|
-
};
|
|
79
|
-
return _get_prototype_of(o);
|
|
80
|
-
}
|
|
81
|
-
function _inherits(subClass, superClass) {
|
|
82
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
83
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
84
|
-
}
|
|
85
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
86
|
-
constructor: {
|
|
87
|
-
value: subClass,
|
|
88
|
-
writable: true,
|
|
89
|
-
configurable: true
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
93
|
-
}
|
|
11
|
+
const _easy = require("easy");
|
|
12
|
+
const _controller = /*#__PURE__*/ _interop_require_default(require("../../controller"));
|
|
13
|
+
const _password = /*#__PURE__*/ _interop_require_default(require("../input/password"));
|
|
14
|
+
const _validationError = /*#__PURE__*/ _interop_require_default(require("../paragraph/validationError"));
|
|
15
|
+
const _constants = require("../../constants");
|
|
94
16
|
function _interop_require_default(obj) {
|
|
95
17
|
return obj && obj.__esModule ? obj : {
|
|
96
18
|
default: obj
|
|
97
19
|
};
|
|
98
20
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return _assert_this_initialized(self);
|
|
107
|
-
}
|
|
108
|
-
function _set_prototype_of(o, p) {
|
|
109
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
110
|
-
o.__proto__ = p;
|
|
111
|
-
return o;
|
|
112
|
-
};
|
|
113
|
-
return _set_prototype_of(o, p);
|
|
114
|
-
}
|
|
115
|
-
function _type_of(obj) {
|
|
116
|
-
"@swc/helpers - typeof";
|
|
117
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
118
|
-
}
|
|
119
|
-
function _wrap_native_super(Class) {
|
|
120
|
-
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
121
|
-
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
122
|
-
if (Class === null || !_is_native_function(Class)) return Class;
|
|
123
|
-
if (typeof Class !== "function") {
|
|
124
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
21
|
+
class PasswordForm extends _easy.Element {
|
|
22
|
+
validateAndSubmitForm() {
|
|
23
|
+
const passwordValid = this.validateForm();
|
|
24
|
+
if (!passwordValid) {
|
|
25
|
+
this.showValidationError("The password is invalid");
|
|
26
|
+
} else {
|
|
27
|
+
this.submitForm();
|
|
125
28
|
}
|
|
126
|
-
if (typeof _cache !== "undefined") {
|
|
127
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
128
|
-
_cache.set(Class, Wrapper);
|
|
129
|
-
}
|
|
130
|
-
function Wrapper() {
|
|
131
|
-
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
132
|
-
}
|
|
133
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
134
|
-
constructor: {
|
|
135
|
-
value: Wrapper,
|
|
136
|
-
enumerable: false,
|
|
137
|
-
writable: true,
|
|
138
|
-
configurable: true
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return _set_prototype_of(Wrapper, Class);
|
|
142
|
-
};
|
|
143
|
-
return _wrap_native_super(Class);
|
|
144
|
-
}
|
|
145
|
-
function _is_native_reflect_construct() {
|
|
146
|
-
try {
|
|
147
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
148
|
-
} catch (_) {}
|
|
149
|
-
return (_is_native_reflect_construct = function() {
|
|
150
|
-
return !!result;
|
|
151
|
-
})();
|
|
152
|
-
}
|
|
153
|
-
var PasswordForm = /*#__PURE__*/ function(Element) {
|
|
154
|
-
_inherits(PasswordForm, Element);
|
|
155
|
-
function PasswordForm() {
|
|
156
|
-
_class_call_check(this, PasswordForm);
|
|
157
|
-
return _call_super(this, PasswordForm, arguments);
|
|
158
29
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
30
|
+
validateForm() {
|
|
31
|
+
const password = this.getPassword(), passwordValid = isPasswordValid(password);
|
|
32
|
+
return passwordValid;
|
|
33
|
+
}
|
|
34
|
+
submitForm() {
|
|
35
|
+
const password = this.getPassword();
|
|
36
|
+
_controller.default.setPassword(password);
|
|
37
|
+
this.clearPassword();
|
|
38
|
+
}
|
|
39
|
+
childElements() {
|
|
40
|
+
return [
|
|
41
|
+
/*#__PURE__*/ React.createElement(_password.default, null),
|
|
42
|
+
/*#__PURE__*/ React.createElement(_validationError.default, null),
|
|
43
|
+
/*#__PURE__*/ React.createElement(_easy.Button, {
|
|
44
|
+
className: "submit",
|
|
45
|
+
onClick: (event, element)=>{
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
this.validateAndSubmitForm();
|
|
168
48
|
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
value: function submitForm() {
|
|
181
|
-
var password = this.getPassword();
|
|
182
|
-
_controller.default.setPassword(password);
|
|
183
|
-
this.clearPassword();
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
key: "childElements",
|
|
188
|
-
value: function childElements() {
|
|
189
|
-
var _this = this;
|
|
190
|
-
return [
|
|
191
|
-
/*#__PURE__*/ React.createElement(_password.default, null),
|
|
192
|
-
/*#__PURE__*/ React.createElement(_validationError.default, null),
|
|
193
|
-
/*#__PURE__*/ React.createElement(_easy.Button, {
|
|
194
|
-
className: "submit",
|
|
195
|
-
onClick: function(event, element) {
|
|
196
|
-
event.preventDefault();
|
|
197
|
-
_this.validateAndSubmitForm();
|
|
198
|
-
}
|
|
199
|
-
}, "Submit")
|
|
200
|
-
];
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
key: "initialise",
|
|
205
|
-
value: function initialise() {
|
|
206
|
-
this.assignContext();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
]);
|
|
210
|
-
return PasswordForm;
|
|
211
|
-
}(_wrap_native_super(_easy.Element));
|
|
212
|
-
_define_property(PasswordForm, "tagName", "form");
|
|
213
|
-
_define_property(PasswordForm, "defaultProperties", {
|
|
214
|
-
className: "password"
|
|
215
|
-
});
|
|
49
|
+
}, "Submit")
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
initialise() {
|
|
53
|
+
this.assignContext();
|
|
54
|
+
}
|
|
55
|
+
static tagName = "form";
|
|
56
|
+
static defaultProperties = {
|
|
57
|
+
className: "password"
|
|
58
|
+
};
|
|
59
|
+
}
|
|
216
60
|
function isPasswordValid(password) {
|
|
217
|
-
|
|
61
|
+
const passwordValid = password !== _constants.EMPTY_STRING;
|
|
218
62
|
return passwordValid;
|
|
219
63
|
}
|
|
220
64
|
|
|
221
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
65
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozL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