educoreapp2 1.0.8 → 1.0.9
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/spxbasecode/EduLog.js +16 -0
- package/dist/spxbasecode/Request.js +43 -0
- package/dist/spxbasecode/Validators.js +66 -0
- package/dist/spxbasecode/WS.js +71 -0
- package/dist/spxbasecode/cmps/BaseAnimation.js +79 -0
- package/dist/spxbasecode/cmps/BaseButton.js +41 -0
- package/dist/spxbasecode/cmps/BaseButtonIcon.js +78 -0
- package/dist/spxbasecode/cmps/BaseButtonImage.js +66 -0
- package/dist/spxbasecode/cmps/BaseCard.js +95 -0
- package/dist/spxbasecode/cmps/BaseCenter.js +33 -0
- package/dist/spxbasecode/cmps/BaseError.js +48 -0
- package/dist/spxbasecode/cmps/BaseForm.js +96 -0
- package/dist/spxbasecode/cmps/BaseForm2.js +81 -0
- package/dist/spxbasecode/cmps/BaseImage.js +45 -0
- package/dist/spxbasecode/cmps/BaseImg.js +62 -0
- package/dist/spxbasecode/cmps/BaseInputString.js +244 -0
- package/dist/spxbasecode/cmps/BaseLabel.js +48 -0
- package/dist/spxbasecode/cmps/BaseLang.js +51 -0
- package/dist/spxbasecode/cmps/BaseList.js +82 -0
- package/dist/spxbasecode/cmps/BasePage.js +26 -0
- package/dist/spxbasecode/cmps/BaseReadTextButton.js +40 -0
- package/dist/spxbasecode/cmps/BaseSSOLogin.js +31 -0
- package/dist/spxbasecode/cmps/BaseSlimPage.js +58 -0
- package/dist/spxbasecode/cmps/EduPage.js +20 -0
- package/dist/spxbasecode/cmps/LogoEdupanel.js +45 -0
- package/dist/spxbasecode/cmps/Menu.js +135 -0
- package/dist/spxbasecode/cmps/PageWithMenu.js +54 -0
- package/dist/spxbasecode/cmps/SpeechToText.js +48 -0
- package/dist/spxbasecode/cmps/TextToCommand.js +98 -0
- package/dist/spxbasecode/img/soundOff.svg +1 -0
- package/dist/spxbasecode/img/soundOn.png +0 -0
- package/package.json +1 -1
@@ -0,0 +1,96 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _reactstrap = require("reactstrap");
|
9
|
+
var _educoreapp = require("educoreapp2");
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
14
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
15
|
+
class BaseForm extends _react.Component {
|
16
|
+
constructor(props) {
|
17
|
+
super();
|
18
|
+
_defineProperty(this, "handleSubmit", event => {
|
19
|
+
event.preventDefault();
|
20
|
+
this.handle2();
|
21
|
+
});
|
22
|
+
this.props = props;
|
23
|
+
this.module = props.module;
|
24
|
+
this.act = props.act;
|
25
|
+
this.objs = {};
|
26
|
+
let this2 = this;
|
27
|
+
setTimeout(() => {
|
28
|
+
this2.props.parent.form = this2;
|
29
|
+
this2.props.parent.initForm();
|
30
|
+
}, 240);
|
31
|
+
this.state = {
|
32
|
+
components: []
|
33
|
+
};
|
34
|
+
}
|
35
|
+
init(data) {
|
36
|
+
for (let k in data) {
|
37
|
+
if (_educoreapp.Tools.empty(this.objs[k])) {
|
38
|
+
continue;
|
39
|
+
}
|
40
|
+
this.objs[k].setValue(data[k]);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
async valid() {
|
44
|
+
let isValid = true;
|
45
|
+
for (let k in this.objs) {
|
46
|
+
let el = this.objs[k];
|
47
|
+
let v = await el.valid();
|
48
|
+
isValid = isValid && v;
|
49
|
+
}
|
50
|
+
return isValid;
|
51
|
+
}
|
52
|
+
addObj(obj) {
|
53
|
+
this.objs[obj.states.name] = obj;
|
54
|
+
}
|
55
|
+
async getData() {
|
56
|
+
let res = {};
|
57
|
+
for (let k in this.objs) {
|
58
|
+
let el = this.objs[k];
|
59
|
+
let v = el.getValue();
|
60
|
+
res[k] = v;
|
61
|
+
}
|
62
|
+
return res;
|
63
|
+
}
|
64
|
+
async handle2() {
|
65
|
+
let x = await this.valid();
|
66
|
+
if (!x) {
|
67
|
+
return;
|
68
|
+
}
|
69
|
+
let params = await this.getData();
|
70
|
+
let this2 = this;
|
71
|
+
window.App.API.exec(this.module, this.act, params, ss => {
|
72
|
+
//console.log("XxxxkkkkkkXX",ss);
|
73
|
+
let params = [];
|
74
|
+
this2.props.onSucc(ss.data);
|
75
|
+
}, ee => {
|
76
|
+
//if ()
|
77
|
+
console.log("XxxiiiixXX3eeee", ee);
|
78
|
+
});
|
79
|
+
}
|
80
|
+
render() {
|
81
|
+
let error = null;
|
82
|
+
let lab1 = this.props.lab1;
|
83
|
+
if (_educoreapp.Tools.empty(lab1)) {
|
84
|
+
lab1 = "Login";
|
85
|
+
}
|
86
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.Form, {
|
87
|
+
onSubmit: this.handleSubmit
|
88
|
+
}, error && /*#__PURE__*/_react.default.createElement(_reactstrap.Alert, {
|
89
|
+
color: "danger"
|
90
|
+
}, error), this.props.children, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
91
|
+
color: "primary",
|
92
|
+
type: "submit"
|
93
|
+
}, lab1));
|
94
|
+
}
|
95
|
+
}
|
96
|
+
var _default = exports.default = BaseForm;
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _reactstrap = require("reactstrap");
|
9
|
+
var _BaseInputString = _interopRequireDefault(require("./BaseInputString.jsx"));
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
16
|
+
class BaseForm2 extends _react.Component {
|
17
|
+
constructor(props) {
|
18
|
+
super();
|
19
|
+
_defineProperty(this, "handleSubmit", event => {
|
20
|
+
event.preventDefault();
|
21
|
+
let xx = this.objs.login;
|
22
|
+
this.addCh();
|
23
|
+
});
|
24
|
+
this.props = props;
|
25
|
+
this.objs = {};
|
26
|
+
let this2 = this;
|
27
|
+
setTimeout(() => {
|
28
|
+
this2.props.parent.form = this2;
|
29
|
+
}, 240);
|
30
|
+
this.state = {
|
31
|
+
components: []
|
32
|
+
};
|
33
|
+
}
|
34
|
+
addObj(obj) {
|
35
|
+
this.objs[obj.states.name] = obj;
|
36
|
+
}
|
37
|
+
addXXX(type, props) {
|
38
|
+
if (type == "BaseInputString") {
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_BaseInputString.default, {
|
40
|
+
key: props.key,
|
41
|
+
id: props.id,
|
42
|
+
label: props.label,
|
43
|
+
name: props.name,
|
44
|
+
placeholder: props.placeholder,
|
45
|
+
value: props.value,
|
46
|
+
parent: props.parent
|
47
|
+
});
|
48
|
+
}
|
49
|
+
}
|
50
|
+
addCh() {
|
51
|
+
let pp = {
|
52
|
+
key: this.state.components.length + 1,
|
53
|
+
id: "aaa1",
|
54
|
+
label: "aaa1",
|
55
|
+
name: "aaa1",
|
56
|
+
placeholder: "aaa1",
|
57
|
+
value: "",
|
58
|
+
parent: this.props.parent
|
59
|
+
};
|
60
|
+
let xx = this.addXXX("BaseInputString", pp);
|
61
|
+
let this2 = this;
|
62
|
+
setTimeout(() => {
|
63
|
+
this2.setState(prevState => ({
|
64
|
+
components: [...prevState.components, xx]
|
65
|
+
}));
|
66
|
+
// this2.forceUpdate();
|
67
|
+
}, 500);
|
68
|
+
}
|
69
|
+
render() {
|
70
|
+
let error = null;
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.Form, {
|
72
|
+
onSubmit: this.handleSubmit
|
73
|
+
}, error && /*#__PURE__*/_react.default.createElement(_reactstrap.Alert, {
|
74
|
+
color: "danger"
|
75
|
+
}, error), this.state.components, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
|
76
|
+
color: "primary",
|
77
|
+
type: "submit"
|
78
|
+
}, "Login"));
|
79
|
+
}
|
80
|
+
}
|
81
|
+
var _default = exports.default = BaseForm2;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _reactBootstrap = require("react-bootstrap");
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
11
|
+
class BaseImage extends _react.Component {
|
12
|
+
constructor(props) {
|
13
|
+
super();
|
14
|
+
this.props = props;
|
15
|
+
}
|
16
|
+
render() {
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_reactBootstrap.Card, {
|
18
|
+
onClick: event => this.props.click(event)
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
20
|
+
style: {
|
21
|
+
position: 'relative',
|
22
|
+
textAlign: 'center'
|
23
|
+
}
|
24
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
25
|
+
src: this.props.src,
|
26
|
+
alt: "Obrazek",
|
27
|
+
style: {
|
28
|
+
width: '100%'
|
29
|
+
}
|
30
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
31
|
+
style: {
|
32
|
+
position: 'absolute',
|
33
|
+
top: '50%',
|
34
|
+
left: '50%',
|
35
|
+
transform: 'translate(-50%, -50%)'
|
36
|
+
}
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrap.Card.Body, null, /*#__PURE__*/_react.default.createElement(_reactBootstrap.Card.Title, {
|
38
|
+
style: {
|
39
|
+
fontSize: "40px",
|
40
|
+
color: 'white'
|
41
|
+
}
|
42
|
+
}, this.props.title)))));
|
43
|
+
}
|
44
|
+
}
|
45
|
+
var _default = exports.default = BaseImage;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _educoreapp = require("educoreapp2");
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
11
|
+
class BaseImg extends _react.Component {
|
12
|
+
constructor(props) {
|
13
|
+
super();
|
14
|
+
this.states = {};
|
15
|
+
this.initFromProps(props);
|
16
|
+
}
|
17
|
+
initFromProps(props) {
|
18
|
+
if (_educoreapp.Tools.empty(props)) {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
//this.setState("onClick",props.onClick);
|
22
|
+
this.states.onClick = props.onClick;
|
23
|
+
this.states.backgroundColor = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.backgroundColor) ? props.backgroundColor : "inherit";
|
24
|
+
this.states.label = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.label) ? props.label : "";
|
25
|
+
this.states.photo = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.photo) ? props.photo : null;
|
26
|
+
this.states.alt = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.alt) ? props.alt : "";
|
27
|
+
this.states.nvdiscrpt = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.nvdiscrpt) ? props.nvdiscrpt : "";
|
28
|
+
this.states.width = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.width) ? props.width : "250px";
|
29
|
+
this.states.height = !_educoreapp.Tools.empty(props) && !_educoreapp.Tools.empty(props.height) ? props.height : "50px";
|
30
|
+
}
|
31
|
+
render() {
|
32
|
+
this.initFromProps(this.props);
|
33
|
+
let props = this.states;
|
34
|
+
/*<img style={{width:props.width, height:props.height,
|
35
|
+
backgroundColor: props.backgroundColor}} src={props.photo} alt={props.alt} />
|
36
|
+
*/
|
37
|
+
if (!_educoreapp.Tools.empty(props.photo)) {
|
38
|
+
let src = props.photo;
|
39
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
40
|
+
role: "figure",
|
41
|
+
"aria-description": this.states.label,
|
42
|
+
style: {
|
43
|
+
backgroundImage: "url(".concat(src, ")"),
|
44
|
+
backgroundRepeat: "no-repeat",
|
45
|
+
backgroundSize: "100% 100%",
|
46
|
+
backgroundPosition: 'center',
|
47
|
+
width: props.width,
|
48
|
+
height: props.height
|
49
|
+
}
|
50
|
+
});
|
51
|
+
} else {
|
52
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
53
|
+
style: {
|
54
|
+
width: props.width,
|
55
|
+
height: props.height,
|
56
|
+
backgroundColor: props.backgroundColor
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
var _default = exports.default = BaseImg;
|
@@ -0,0 +1,244 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _reactstrap = require("reactstrap");
|
9
|
+
var _educoreapp = require("educoreapp2");
|
10
|
+
var _Validators = _interopRequireDefault(require("../Validators.jsx"));
|
11
|
+
var _BaseError = _interopRequireDefault(require("./BaseError.jsx"));
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
17
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
|
+
class BaseInputString extends _react.Component {
|
19
|
+
constructor(props) {
|
20
|
+
super();
|
21
|
+
_defineProperty(this, "handleChange", event => {
|
22
|
+
this.setNeutral();
|
23
|
+
const {
|
24
|
+
name,
|
25
|
+
value
|
26
|
+
} = event.target;
|
27
|
+
//console.log(value);
|
28
|
+
this.value = _educoreapp.Tools.copy(value, true);
|
29
|
+
//this.states.value=Tools.copy(value,true);
|
30
|
+
//value={this.state.value}
|
31
|
+
});
|
32
|
+
this.isLoadData = false;
|
33
|
+
this.isNeedLoad = false;
|
34
|
+
this.props = props;
|
35
|
+
this.list = [];
|
36
|
+
this.isReadOnly = false;
|
37
|
+
if (!_educoreapp.Tools.empty(props.readonly)) {
|
38
|
+
this.isReadOnly = props.readonly;
|
39
|
+
}
|
40
|
+
this.module = props.module;
|
41
|
+
this.pageName = props.pageName;
|
42
|
+
this.value = null;
|
43
|
+
if (this.props.type == "select") {
|
44
|
+
this.isNeedLoad = true;
|
45
|
+
}
|
46
|
+
this.state = {
|
47
|
+
value: this.value
|
48
|
+
};
|
49
|
+
this.states = {
|
50
|
+
rq: 1,
|
51
|
+
id: props.id,
|
52
|
+
className2: "inputStringNeutral",
|
53
|
+
label: props.label,
|
54
|
+
name: props.name,
|
55
|
+
error: "",
|
56
|
+
placeholder: props.placeholder,
|
57
|
+
validator: {
|
58
|
+
maxLength: props.maxlength,
|
59
|
+
minLength: props.minlength,
|
60
|
+
require: props.require
|
61
|
+
}
|
62
|
+
};
|
63
|
+
this.validator = this.states.validator;
|
64
|
+
let this2 = this;
|
65
|
+
setTimeout(() => {
|
66
|
+
this2.props.parent.form.addObj(this2);
|
67
|
+
}, 500);
|
68
|
+
//this.states.type="text";
|
69
|
+
}
|
70
|
+
setNeutral() {
|
71
|
+
this.states.error = null;
|
72
|
+
this.states.className2 = "inputStringNeutral";
|
73
|
+
this.upd();
|
74
|
+
}
|
75
|
+
setOK() {
|
76
|
+
this.states.error = null;
|
77
|
+
this.states.className2 = "inputStringOK";
|
78
|
+
this.upd();
|
79
|
+
}
|
80
|
+
upd() {
|
81
|
+
this.setState({
|
82
|
+
rq: this.states.rq++
|
83
|
+
});
|
84
|
+
}
|
85
|
+
setError(error) {
|
86
|
+
let TT = _educoreapp.Translate.getT(window.App.lang, "Error", "Error");
|
87
|
+
let xx = "inputStringError";
|
88
|
+
this.states.className2 = xx;
|
89
|
+
let str = TT[error];
|
90
|
+
console.log(this.states.validator.minLength);
|
91
|
+
let MAP = {
|
92
|
+
"label": this.states.label,
|
93
|
+
"minLength": this.states.validator.minLength,
|
94
|
+
"maxLength": this.states.validator.maxLength
|
95
|
+
};
|
96
|
+
for (let k in MAP) {
|
97
|
+
//console.log(k);
|
98
|
+
let val = MAP[k];
|
99
|
+
str = str.replaceAll("$" + k + "$", val);
|
100
|
+
}
|
101
|
+
//console.log(str,TT[error]);
|
102
|
+
this.states.error = str;
|
103
|
+
this.upd();
|
104
|
+
}
|
105
|
+
async valid() {
|
106
|
+
this.setNeutral();
|
107
|
+
let val = this.getValue();
|
108
|
+
let val1 = await _Validators.default.IsRequire(this, val);
|
109
|
+
if (!val1) {
|
110
|
+
return false;
|
111
|
+
}
|
112
|
+
let val2 = await _Validators.default.HasMinLength(this, val);
|
113
|
+
if (!val2) {
|
114
|
+
return false;
|
115
|
+
}
|
116
|
+
let val3 = await _Validators.default.HasMaxLength(this, val);
|
117
|
+
if (!val3) {
|
118
|
+
return false;
|
119
|
+
}
|
120
|
+
let val4 = true;
|
121
|
+
if (["passwordNumber"].indexOf(this.props.type) >= 0) {
|
122
|
+
val4 = await _Validators.default.IsNumeric(this, val);
|
123
|
+
}
|
124
|
+
if (!val4) {
|
125
|
+
console.log("EEEEEE", this.states.name, val);
|
126
|
+
return false;
|
127
|
+
}
|
128
|
+
this.render();
|
129
|
+
return val1 && val2 && val3;
|
130
|
+
}
|
131
|
+
getValue() {
|
132
|
+
if (this.props.type != "select") {
|
133
|
+
return this.value;
|
134
|
+
}
|
135
|
+
{
|
136
|
+
let inp = document.getElementById(this.states.id);
|
137
|
+
this.value = inp.value;
|
138
|
+
return this.value;
|
139
|
+
}
|
140
|
+
}
|
141
|
+
setValue(data) {
|
142
|
+
this.value = data;
|
143
|
+
this.state.value = this.value;
|
144
|
+
let inp = document.getElementById(this.states.id);
|
145
|
+
if (inp !== null) {
|
146
|
+
inp.value = this.value;
|
147
|
+
}
|
148
|
+
this.upd();
|
149
|
+
}
|
150
|
+
renderString(typ) {
|
151
|
+
let className3 = this.states.className2 + "";
|
152
|
+
if (this.isReadOnly) {
|
153
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
154
|
+
className: className3,
|
155
|
+
type: typ,
|
156
|
+
name: this.states.name,
|
157
|
+
readOnly: true,
|
158
|
+
id: this.states.id,
|
159
|
+
placeholder: this.states.placeholder,
|
160
|
+
onChange: this.handleChange
|
161
|
+
});
|
162
|
+
} else {
|
163
|
+
return /*#__PURE__*/_react.default.createElement(_reactstrap.Input, {
|
164
|
+
className: className3,
|
165
|
+
type: typ,
|
166
|
+
name: this.states.name,
|
167
|
+
id: this.states.id,
|
168
|
+
placeholder: this.states.placeholder,
|
169
|
+
onChange: this.handleChange
|
170
|
+
});
|
171
|
+
}
|
172
|
+
}
|
173
|
+
renderSelect() {
|
174
|
+
let className3 = "form-select " + this.states.className2 + "";
|
175
|
+
return /*#__PURE__*/_react.default.createElement("select", {
|
176
|
+
name: this.states.name,
|
177
|
+
id: this.states.id,
|
178
|
+
className: className3,
|
179
|
+
size: "3",
|
180
|
+
"aria-label": "size 3 select example"
|
181
|
+
}, Object.keys(this.list).map(function (key) {
|
182
|
+
let el = this.list[key];
|
183
|
+
let vname = el.vname;
|
184
|
+
let id = el.id;
|
185
|
+
return /*#__PURE__*/_react.default.createElement("option", {
|
186
|
+
key: id,
|
187
|
+
value: id
|
188
|
+
}, vname);
|
189
|
+
}.bind(this)));
|
190
|
+
}
|
191
|
+
loadData() {
|
192
|
+
//console.log("loadData",this.props);
|
193
|
+
let listName = this.props.list;
|
194
|
+
let this2 = this;
|
195
|
+
window.App.getList(listName, function (data) {
|
196
|
+
this2.isLoadData = true;
|
197
|
+
// console.log("loadData data",data);
|
198
|
+
this2.list = data;
|
199
|
+
this2.upd();
|
200
|
+
});
|
201
|
+
}
|
202
|
+
render() {
|
203
|
+
if (this.isNeedLoad) {
|
204
|
+
if (!this.isLoadData) {
|
205
|
+
this.loadData();
|
206
|
+
return /*#__PURE__*/_react.default.createElement("div", null, "Not load");
|
207
|
+
}
|
208
|
+
}
|
209
|
+
let rendObj = this.renderString("string");
|
210
|
+
switch (this.props.type) {
|
211
|
+
case "passwordNumber":
|
212
|
+
rendObj = this.renderString("password");
|
213
|
+
break;
|
214
|
+
case "select":
|
215
|
+
rendObj = this.renderSelect();
|
216
|
+
break;
|
217
|
+
case "date":
|
218
|
+
rendObj = this.renderString("date");
|
219
|
+
break;
|
220
|
+
default:
|
221
|
+
break;
|
222
|
+
}
|
223
|
+
|
224
|
+
/*
|
225
|
+
<FormGroup>
|
226
|
+
<Label style={{color:'white'}} for="email">{this.states.label}</Label>*/
|
227
|
+
let label2 = "";
|
228
|
+
let isShowLabel = true;
|
229
|
+
if (isShowLabel) {
|
230
|
+
label2 = /*#__PURE__*/_react.default.createElement(_reactstrap.Label, {
|
231
|
+
style: {
|
232
|
+
color: 'black'
|
233
|
+
},
|
234
|
+
for: "email"
|
235
|
+
}, this.states.label);
|
236
|
+
}
|
237
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
238
|
+
className: "row mb-3"
|
239
|
+
}, label2, rendObj, /*#__PURE__*/_react.default.createElement(_BaseError.default, {
|
240
|
+
text: this.states.error
|
241
|
+
}));
|
242
|
+
}
|
243
|
+
}
|
244
|
+
var _default = exports.default = BaseInputString;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
|
+
var _educoreapp = require("educoreapp2");
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
class BaseLabel extends _react.default.Component {
|
12
|
+
render() {
|
13
|
+
let {
|
14
|
+
text,
|
15
|
+
color,
|
16
|
+
font,
|
17
|
+
size,
|
18
|
+
data
|
19
|
+
} = this.props;
|
20
|
+
if (!_educoreapp.Tools.empty(data)) {
|
21
|
+
color = data.color;
|
22
|
+
font = data.font;
|
23
|
+
size = data.font_size;
|
24
|
+
text = data.text;
|
25
|
+
}
|
26
|
+
const labelStyle = {
|
27
|
+
color: color,
|
28
|
+
fontFamily: font,
|
29
|
+
fontSize: size
|
30
|
+
//textAlign:"center"
|
31
|
+
};
|
32
|
+
return /*#__PURE__*/_react.default.createElement("label", {
|
33
|
+
style: labelStyle
|
34
|
+
}, text);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
BaseLabel.propTypes = {
|
38
|
+
content: _propTypes.default.string,
|
39
|
+
color: _propTypes.default.string,
|
40
|
+
font: _propTypes.default.string,
|
41
|
+
size: _propTypes.default.string
|
42
|
+
};
|
43
|
+
BaseLabel.defaultProps = {
|
44
|
+
color: 'black',
|
45
|
+
font: 'Arial',
|
46
|
+
size: '14px'
|
47
|
+
};
|
48
|
+
var _default = exports.default = BaseLabel;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
8
|
+
var _lang_pl = require("../../img/lang_pl.svg");
|
9
|
+
var _lang_en = require("../../img/lang_en.svg");
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
|
+
function BaseFlag(props) {
|
13
|
+
if (props.lang === "pl_PL") {
|
14
|
+
return /*#__PURE__*/_react.default.createElement(_lang_pl.ReactComponent, {
|
15
|
+
width: props.width,
|
16
|
+
height: props.height
|
17
|
+
});
|
18
|
+
} else if (props.lang === "en_GB") {
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_lang_en.ReactComponent, {
|
20
|
+
width: props.width,
|
21
|
+
height: props.height
|
22
|
+
});
|
23
|
+
} else {
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_lang_en.ReactComponent, {
|
25
|
+
width: props.width,
|
26
|
+
height: props.height
|
27
|
+
});
|
28
|
+
}
|
29
|
+
}
|
30
|
+
class BaseLang extends _react.Component {
|
31
|
+
constructor(props) {
|
32
|
+
super();
|
33
|
+
this.props = props;
|
34
|
+
}
|
35
|
+
render() {
|
36
|
+
let lang = "pl_PL";
|
37
|
+
if (window.App.lang === 'pl_PL') {
|
38
|
+
lang = "en_GB";
|
39
|
+
}
|
40
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
41
|
+
onClick: event => window.App.changeLang(lang),
|
42
|
+
width: "50",
|
43
|
+
height: "50"
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(BaseFlag, {
|
45
|
+
width: "50",
|
46
|
+
height: "50",
|
47
|
+
lang: lang
|
48
|
+
}));
|
49
|
+
}
|
50
|
+
}
|
51
|
+
var _default = exports.default = BaseLang;
|