@pie-lib/math-input 6.6.1-next.224 → 6.6.1-next.414
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/CHANGELOG.md +95 -0
- package/lib/horizontal-keypad.js +24 -32
- package/lib/horizontal-keypad.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/keypad/index.js +67 -63
- package/lib/keypad/index.js.map +1 -1
- package/lib/keypad/keys-layout.js +1 -1
- package/lib/keypad/keys-layout.js.map +1 -1
- package/lib/keys/basic-operators.js.map +1 -1
- package/lib/keys/chars.js.map +1 -1
- package/lib/keys/comparison.js +5 -3
- package/lib/keys/comparison.js.map +1 -1
- package/lib/keys/constants.js.map +1 -1
- package/lib/keys/digits.js +2 -2
- package/lib/keys/digits.js.map +1 -1
- package/lib/keys/edit.js.map +1 -1
- package/lib/keys/exponent.js.map +1 -1
- package/lib/keys/fractions.js.map +1 -1
- package/lib/keys/geometry.js +5 -3
- package/lib/keys/geometry.js.map +1 -1
- package/lib/keys/grades.js +11 -23
- package/lib/keys/grades.js.map +1 -1
- package/lib/keys/index.js +3 -3
- package/lib/keys/index.js.map +1 -1
- package/lib/keys/log.js.map +1 -1
- package/lib/keys/logic.js.map +1 -1
- package/lib/keys/matrices.js.map +1 -1
- package/lib/keys/misc.js.map +1 -1
- package/lib/keys/navigation.js.map +1 -1
- package/lib/keys/operators.js.map +1 -1
- package/lib/keys/statistics.js.map +1 -1
- package/lib/keys/sub-sup.js.map +1 -1
- package/lib/keys/trigonometry.js.map +1 -1
- package/lib/keys/utils.js +7 -17
- package/lib/keys/utils.js.map +1 -1
- package/lib/keys/vars.js.map +1 -1
- package/lib/math-input.js +27 -41
- package/lib/math-input.js.map +1 -1
- package/lib/mq/custom-elements.js.map +1 -1
- package/lib/mq/index.js +2 -2
- package/lib/mq/index.js.map +1 -1
- package/lib/mq/input.js +23 -35
- package/lib/mq/input.js.map +1 -1
- package/lib/mq/static.js +19 -29
- package/lib/mq/static.js.map +1 -1
- package/package.json +2 -2
- package/src/horizontal-keypad.jsx +3 -1
- package/src/keypad/index.jsx +44 -9
- package/src/keys/grades.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,101 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.6.9](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.8...@pie-lib/math-input@6.6.9) (2022-04-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **math-input:** PD-1669 handle latex with errors in keypad buttons ([6b36f17](https://github.com/pie-framework/pie-lib/commit/6b36f175deffbd0a0fe021f4f7a11d7c4f14a014))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [6.6.8](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.7...@pie-lib/math-input@6.6.8) (2022-02-04)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [6.6.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.6...@pie-lib/math-input@6.6.7) (2022-01-10)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [6.6.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.5...@pie-lib/math-input@6.6.6) (2021-10-04)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **math-input:** Fixed left-right arrow button ([6109149](https://github.com/pie-framework/pie-lib/commit/6109149))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [6.6.5](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.4...@pie-lib/math-input@6.6.5) (2021-10-04)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **math-input:** create proper latex expression for log base button ([ca0c3f0](https://github.com/pie-framework/pie-lib/commit/ca0c3f0))
|
|
50
|
+
* **math-input:** Made overarc button consistent with the others PD-1315 ([8726469](https://github.com/pie-framework/pie-lib/commit/8726469))
|
|
51
|
+
* **math-input:** Made segment, ray and line buttons more consistent PD-1315 ([e7e4e29](https://github.com/pie-framework/pie-lib/commit/e7e4e29))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [6.6.4](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.3...@pie-lib/math-input@6.6.4) (2021-09-20)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Bug Fixes
|
|
61
|
+
|
|
62
|
+
* **math-input, math-toolbar:** Adjusted parallelogram button size ([699431e](https://github.com/pie-framework/pie-lib/commit/699431e))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## [6.6.3](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.2...@pie-lib/math-input@6.6.3) (2021-09-16)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* **math-input:** render measured angle as m + angle sign PD-368 ([670fb56](https://github.com/pie-framework/pie-lib/commit/670fb56))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [6.6.2](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.1...@pie-lib/math-input@6.6.2) (2021-09-08)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @pie-lib/math-input
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [6.6.1](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.6.0...@pie-lib/math-input@6.6.1) (2021-09-08)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* **math-input:** default latex when received is wrong ([d872f60](https://github.com/pie-framework/pie-lib/commit/d872f60))
|
|
93
|
+
* **math-input:** default latex when received is wrong (2) ([dc71307](https://github.com/pie-framework/pie-lib/commit/dc71307))
|
|
94
|
+
* **math-input:** fix e button on advanced algebra math editor PD-1280 ([dbfb53b](https://github.com/pie-framework/pie-lib/commit/dbfb53b))
|
|
95
|
+
* **math-input:** Fixed arrows button for pits ([66dd6a9](https://github.com/pie-framework/pie-lib/commit/66dd6a9))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
6
101
|
# [6.6.0](https://github.com/pie-framework/pie-lib/compare/@pie-lib/math-input@6.5.14...@pie-lib/math-input@6.6.0) (2021-08-30)
|
|
7
102
|
|
|
8
103
|
|
package/lib/horizontal-keypad.js
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
var _grades = require("./keys/grades");
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
var _utils = require("./keys/utils");
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
var _keypad = _interopRequireDefault(require("./keypad"));
|
|
35
33
|
|
|
36
|
-
function
|
|
34
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
37
35
|
|
|
38
36
|
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; } }
|
|
39
37
|
|
|
40
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
38
|
var toOldModel = function toOldModel(d) {
|
|
45
39
|
if (d.command) {
|
|
46
40
|
return {
|
|
@@ -60,30 +54,28 @@ var toOldModel = function toOldModel(d) {
|
|
|
60
54
|
};
|
|
61
55
|
|
|
62
56
|
var HorizontalKeypad = /*#__PURE__*/function (_React$Component) {
|
|
63
|
-
|
|
57
|
+
(0, _inherits2["default"])(HorizontalKeypad, _React$Component);
|
|
64
58
|
|
|
65
59
|
var _super = _createSuper(HorizontalKeypad);
|
|
66
60
|
|
|
67
61
|
function HorizontalKeypad() {
|
|
68
62
|
var _this;
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
(0, _classCallCheck2["default"])(this, HorizontalKeypad);
|
|
71
65
|
|
|
72
66
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
67
|
args[_key] = arguments[_key];
|
|
74
68
|
}
|
|
75
69
|
|
|
76
70
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
77
|
-
|
|
78
|
-
_defineProperty(_assertThisInitialized(_this), "keypadPress", function (data) {
|
|
71
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "keypadPress", function (data) {
|
|
79
72
|
var onClick = _this.props.onClick;
|
|
80
73
|
onClick(toOldModel(data));
|
|
81
74
|
});
|
|
82
|
-
|
|
83
75
|
return _this;
|
|
84
76
|
}
|
|
85
77
|
|
|
86
|
-
|
|
78
|
+
(0, _createClass2["default"])(HorizontalKeypad, [{
|
|
87
79
|
key: "render",
|
|
88
80
|
value: function render() {
|
|
89
81
|
var _this$props = this.props,
|
|
@@ -91,34 +83,34 @@ var HorizontalKeypad = /*#__PURE__*/function (_React$Component) {
|
|
|
91
83
|
onFocus = _this$props.onFocus,
|
|
92
84
|
noDecimal = _this$props.noDecimal,
|
|
93
85
|
className = _this$props.className,
|
|
94
|
-
additionalKeys = _this$props.additionalKeys
|
|
86
|
+
additionalKeys = _this$props.additionalKeys,
|
|
87
|
+
layoutForKeyPad = _this$props.layoutForKeyPad;
|
|
95
88
|
var normalizedKeys = (0, _grades.normalizeAdditionalKeys)(additionalKeys);
|
|
96
89
|
return /*#__PURE__*/_react["default"].createElement(_keypad["default"], {
|
|
97
90
|
className: className,
|
|
98
91
|
onFocus: onFocus,
|
|
99
92
|
noDecimal: noDecimal,
|
|
93
|
+
layoutForKeyPad: layoutForKeyPad,
|
|
100
94
|
additionalKeys: (0, _utils.extendKeySet)((0, _grades.keysForGrade)(mode), normalizedKeys),
|
|
101
95
|
onPress: this.keypadPress,
|
|
102
96
|
mode: mode
|
|
103
97
|
});
|
|
104
98
|
}
|
|
105
99
|
}]);
|
|
106
|
-
|
|
107
100
|
return HorizontalKeypad;
|
|
108
101
|
}(_react["default"].Component);
|
|
109
102
|
|
|
110
103
|
exports["default"] = HorizontalKeypad;
|
|
111
|
-
|
|
112
|
-
_defineProperty(HorizontalKeypad, "propTypes", {
|
|
104
|
+
(0, _defineProperty2["default"])(HorizontalKeypad, "propTypes", {
|
|
113
105
|
className: _propTypes["default"].string,
|
|
114
106
|
mode: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
107
|
+
layoutForKeyPad: _propTypes["default"].object,
|
|
115
108
|
onClick: _propTypes["default"].func.isRequired,
|
|
116
109
|
onFocus: _propTypes["default"].func,
|
|
117
110
|
noDecimal: _propTypes["default"].bool,
|
|
118
111
|
additionalKeys: _propTypes["default"].array
|
|
119
112
|
});
|
|
120
|
-
|
|
121
|
-
_defineProperty(HorizontalKeypad, "defaultProps", {
|
|
113
|
+
(0, _defineProperty2["default"])(HorizontalKeypad, "defaultProps", {
|
|
122
114
|
mode: 'scientific',
|
|
123
115
|
noDecimal: false,
|
|
124
116
|
additionalKeys: []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"horizontal-keypad.js","names":["toOldModel","d","command","value","type","write","keystroke","HorizontalKeypad","data","onClick","props","mode","onFocus","noDecimal","className","additionalKeys","layoutForKeyPad","normalizedKeys","normalizeAdditionalKeys","extendKeySet","keysForGrade","keypadPress","React","Component","PropTypes","string","oneOfType","number","object","func","isRequired","bool","array"],"sources":["../src/horizontal-keypad.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { keysForGrade, normalizeAdditionalKeys } from './keys/grades';\nimport { extendKeySet } from './keys/utils';\nimport Keypad from './keypad';\n\nconst toOldModel = d => {\n if (d.command) {\n return { value: d.command, type: 'command' };\n } else if (d.write) {\n return { value: d.write };\n } else if (d.keystroke) {\n return { type: 'cursor', value: d.keystroke };\n }\n};\n\nexport default class HorizontalKeypad extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n layoutForKeyPad: PropTypes.object,\n onClick: PropTypes.func.isRequired,\n onFocus: PropTypes.func,\n noDecimal: PropTypes.bool,\n additionalKeys: PropTypes.array\n };\n\n static defaultProps = {\n mode: 'scientific',\n noDecimal: false,\n additionalKeys: []\n };\n\n keypadPress = data => {\n const { onClick } = this.props;\n\n onClick(toOldModel(data));\n };\n\n render() {\n const { mode, onFocus, noDecimal, className, additionalKeys, layoutForKeyPad } = this.props;\n const normalizedKeys = normalizeAdditionalKeys(additionalKeys);\n\n return (\n <Keypad\n className={className}\n onFocus={onFocus}\n noDecimal={noDecimal}\n layoutForKeyPad={layoutForKeyPad}\n additionalKeys={extendKeySet(keysForGrade(mode), normalizedKeys)}\n onPress={this.keypadPress}\n mode={mode}\n />\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,CAAC,EAAI;EACtB,IAAIA,CAAC,CAACC,OAAN,EAAe;IACb,OAAO;MAAEC,KAAK,EAAEF,CAAC,CAACC,OAAX;MAAoBE,IAAI,EAAE;IAA1B,CAAP;EACD,CAFD,MAEO,IAAIH,CAAC,CAACI,KAAN,EAAa;IAClB,OAAO;MAAEF,KAAK,EAAEF,CAAC,CAACI;IAAX,CAAP;EACD,CAFM,MAEA,IAAIJ,CAAC,CAACK,SAAN,EAAiB;IACtB,OAAO;MAAEF,IAAI,EAAE,QAAR;MAAkBD,KAAK,EAAEF,CAAC,CAACK;IAA3B,CAAP;EACD;AACF,CARD;;IAUqBC,gB;;;;;;;;;;;;;;;oGAiBL,UAAAC,IAAI,EAAI;MACpB,IAAQC,OAAR,GAAoB,MAAKC,KAAzB,CAAQD,OAAR;MAEAA,OAAO,CAACT,UAAU,CAACQ,IAAD,CAAX,CAAP;IACD,C;;;;;;WAED,kBAAS;MACP,kBAAiF,KAAKE,KAAtF;MAAA,IAAQC,IAAR,eAAQA,IAAR;MAAA,IAAcC,OAAd,eAAcA,OAAd;MAAA,IAAuBC,SAAvB,eAAuBA,SAAvB;MAAA,IAAkCC,SAAlC,eAAkCA,SAAlC;MAAA,IAA6CC,cAA7C,eAA6CA,cAA7C;MAAA,IAA6DC,eAA7D,eAA6DA,eAA7D;MACA,IAAMC,cAAc,GAAG,IAAAC,+BAAA,EAAwBH,cAAxB,CAAvB;MAEA,oBACE,gCAAC,kBAAD;QACE,SAAS,EAAED,SADb;QAEE,OAAO,EAAEF,OAFX;QAGE,SAAS,EAAEC,SAHb;QAIE,eAAe,EAAEG,eAJnB;QAKE,cAAc,EAAE,IAAAG,mBAAA,EAAa,IAAAC,oBAAA,EAAaT,IAAb,CAAb,EAAiCM,cAAjC,CALlB;QAME,OAAO,EAAE,KAAKI,WANhB;QAOE,IAAI,EAAEV;MAPR,EADF;IAWD;;;EAtC2CW,iBAAA,CAAMC,S;;;iCAA/BhB,gB,eACA;EACjBO,SAAS,EAAEU,qBAAA,CAAUC,MADJ;EAEjBd,IAAI,EAAEa,qBAAA,CAAUE,SAAV,CAAoB,CAACF,qBAAA,CAAUC,MAAX,EAAmBD,qBAAA,CAAUG,MAA7B,CAApB,CAFW;EAGjBX,eAAe,EAAEQ,qBAAA,CAAUI,MAHV;EAIjBnB,OAAO,EAAEe,qBAAA,CAAUK,IAAV,CAAeC,UAJP;EAKjBlB,OAAO,EAAEY,qBAAA,CAAUK,IALF;EAMjBhB,SAAS,EAAEW,qBAAA,CAAUO,IANJ;EAOjBhB,cAAc,EAAES,qBAAA,CAAUQ;AAPT,C;iCADAzB,gB,kBAWG;EACpBI,IAAI,EAAE,YADc;EAEpBE,SAAS,EAAE,KAFS;EAGpBE,cAAc,EAAE;AAHI,C"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
@@ -32,8 +34,6 @@ var mq = _interopRequireWildcard(require("./mq"));
|
|
|
32
34
|
|
|
33
35
|
exports.mq = mq;
|
|
34
36
|
|
|
35
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
36
|
-
|
|
37
37
|
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); }
|
|
38
38
|
|
|
39
39
|
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; }
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["addLeftBracket","s","indexOf","addRightBracket","length","rmLeftBracket","substring","rmRightBracket","addBrackets","removeBrackets","updateSpans","spans","Array","from","document","querySelectorAll","forEach","span","innerText","className","style","fontSize"],"sources":["../src/index.jsx"],"sourcesContent":["import { keysForGrade } from './keys/grades';\n\nconst addLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s : `\\\\(${s}`);\nconst addRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s : `${s}\\\\)`);\nconst rmLeftBracket = s => (s.indexOf('\\\\(') === 0 ? s.substring(2) : s);\nconst rmRightBracket = s => (s.indexOf('\\\\)') === s.length - 2 ? s.substring(0, s.length - 2) : s);\n\nconst addBrackets = s => addRightBracket(addLeftBracket(s));\nconst removeBrackets = s => rmRightBracket(rmLeftBracket(s));\n\n// increase the font of parallel notation\nconst updateSpans = () => {\n const spans = Array.from(document.querySelectorAll('span[mathquill-command-id]'));\n (spans || []).forEach(span => {\n if (span && span.innerText === '∥' && span.className !== 'mq-editable-field') {\n span.style.fontSize = '32px';\n }\n });\n};\n\nimport * as keys from './keys';\n\nimport HorizontalKeypad from './horizontal-keypad';\n\nimport * as mq from './mq';\n\nexport { keysForGrade, addBrackets, removeBrackets, keys, HorizontalKeypad, mq, updateSpans };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAoBA;;;;AAEA;;AAEA;;;;;;;;AAtBA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAAAC,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqB,CAArB,GAAyBD,CAAzB,gBAAmCA,CAAnC,CAAL;AAAA,CAAxB;;AACA,IAAME,eAAe,GAAG,SAAlBA,eAAkB,CAAAF,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqBD,CAAC,CAACG,MAAF,GAAW,CAAhC,GAAoCH,CAApC,aAA2CA,CAA3C,QAAL;AAAA,CAAzB;;AACA,IAAMI,aAAa,GAAG,SAAhBA,aAAgB,CAAAJ,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqB,CAArB,GAAyBD,CAAC,CAACK,SAAF,CAAY,CAAZ,CAAzB,GAA0CL,CAA/C;AAAA,CAAvB;;AACA,IAAMM,cAAc,GAAG,SAAjBA,cAAiB,CAAAN,CAAC;EAAA,OAAKA,CAAC,CAACC,OAAF,CAAU,KAAV,MAAqBD,CAAC,CAACG,MAAF,GAAW,CAAhC,GAAoCH,CAAC,CAACK,SAAF,CAAY,CAAZ,EAAeL,CAAC,CAACG,MAAF,GAAW,CAA1B,CAApC,GAAmEH,CAAxE;AAAA,CAAxB;;AAEA,IAAMO,WAAW,GAAG,SAAdA,WAAc,CAAAP,CAAC;EAAA,OAAIE,eAAe,CAACH,cAAc,CAACC,CAAD,CAAf,CAAnB;AAAA,CAArB;;;;AACA,IAAMQ,cAAc,GAAG,SAAjBA,cAAiB,CAAAR,CAAC;EAAA,OAAIM,cAAc,CAACF,aAAa,CAACJ,CAAD,CAAd,CAAlB;AAAA,CAAxB,C,CAEA;;;;;AACA,IAAMS,WAAW,GAAG,SAAdA,WAAc,GAAM;EACxB,IAAMC,KAAK,GAAGC,KAAK,CAACC,IAAN,CAAWC,QAAQ,CAACC,gBAAT,CAA0B,4BAA1B,CAAX,CAAd;EACA,CAACJ,KAAK,IAAI,EAAV,EAAcK,OAAd,CAAsB,UAAAC,IAAI,EAAI;IAC5B,IAAIA,IAAI,IAAIA,IAAI,CAACC,SAAL,KAAmB,GAA3B,IAAkCD,IAAI,CAACE,SAAL,KAAmB,mBAAzD,EAA8E;MAC5EF,IAAI,CAACG,KAAL,CAAWC,QAAX,GAAsB,MAAtB;IACD;EACF,CAJD;AAKD,CAPD"}
|
package/lib/keypad/index.js
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = exports.KeyPad = void 0;
|
|
9
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
|
|
16
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
+
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
|
|
20
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
+
|
|
22
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
+
|
|
24
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
+
|
|
26
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
+
|
|
28
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
+
|
|
10
30
|
var _react = _interopRequireDefault(require("react"));
|
|
11
31
|
|
|
12
32
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -37,44 +57,14 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
37
57
|
|
|
38
58
|
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; }
|
|
39
59
|
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
43
|
-
|
|
44
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
45
|
-
|
|
46
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
47
|
-
|
|
48
|
-
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); }
|
|
49
|
-
|
|
50
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
51
|
-
|
|
52
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
53
|
-
|
|
54
|
-
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; }
|
|
55
|
-
|
|
56
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
57
|
-
|
|
58
|
-
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); } }
|
|
59
|
-
|
|
60
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
60
|
+
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; }
|
|
61
61
|
|
|
62
|
-
function
|
|
62
|
+
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) { (0, _defineProperty2["default"])(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; }
|
|
63
63
|
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
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); }; }
|
|
67
|
-
|
|
68
|
-
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); }
|
|
69
|
-
|
|
70
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
64
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
71
65
|
|
|
72
66
|
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; } }
|
|
73
67
|
|
|
74
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
75
|
-
|
|
76
|
-
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; }
|
|
77
|
-
|
|
78
68
|
var log = (0, _debug["default"])('pie-lib:math-inline:keypad');
|
|
79
69
|
var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
80
70
|
return {
|
|
@@ -103,14 +93,16 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
103
93
|
width: '30px',
|
|
104
94
|
marginTop: '0 !important',
|
|
105
95
|
borderTop: '2px solid black',
|
|
96
|
+
fontFamily: 'Roboto, Helvetica, Arial, sans-serif !important',
|
|
106
97
|
'&.mq-arrow-both': {
|
|
98
|
+
top: '5px !important',
|
|
107
99
|
'& *': {
|
|
108
100
|
lineHeight: '1 !important'
|
|
109
101
|
},
|
|
110
102
|
'&:before': {
|
|
111
103
|
fontSize: '80%',
|
|
112
104
|
left: 'calc(-13%)',
|
|
113
|
-
top: '-0.
|
|
105
|
+
top: '-0.31em'
|
|
114
106
|
},
|
|
115
107
|
'&:after': {
|
|
116
108
|
fontSize: '80% !important',
|
|
@@ -120,12 +112,12 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
120
112
|
'&.mq-empty:before': {
|
|
121
113
|
fontSize: '80%',
|
|
122
114
|
left: 'calc(-13%)',
|
|
123
|
-
top: '-0.
|
|
115
|
+
top: '-0.26em'
|
|
124
116
|
},
|
|
125
117
|
'&.mq-empty:after': {
|
|
126
118
|
fontSize: '80%',
|
|
127
119
|
right: 'calc(-13%)',
|
|
128
|
-
top: '-0.
|
|
120
|
+
top: '-0.26em'
|
|
129
121
|
},
|
|
130
122
|
'&.mq-empty': {
|
|
131
123
|
minHeight: '1.4em'
|
|
@@ -186,7 +178,7 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
186
178
|
paddingTop: '0 !important'
|
|
187
179
|
},
|
|
188
180
|
'&:after': {
|
|
189
|
-
top: '-
|
|
181
|
+
top: '-2.8em !important'
|
|
190
182
|
}
|
|
191
183
|
}
|
|
192
184
|
}
|
|
@@ -223,34 +215,43 @@ var LatexButton = (0, _styles.withStyles)(function (theme) {
|
|
|
223
215
|
}));
|
|
224
216
|
});
|
|
225
217
|
|
|
218
|
+
var createCustomLayout = function createCustomLayout(layoutObj) {
|
|
219
|
+
if (layoutObj) {
|
|
220
|
+
return {
|
|
221
|
+
gridTemplateColumns: "repeat(".concat(layoutObj.columns, ", minmax(min-content, 150px))"),
|
|
222
|
+
gridTemplateRows: "repeat(".concat(layoutObj.rows, ", minmax(40px, 60px))"),
|
|
223
|
+
gridAutoFlow: 'initial'
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return {};
|
|
228
|
+
};
|
|
229
|
+
|
|
226
230
|
var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
227
|
-
|
|
231
|
+
(0, _inherits2["default"])(KeyPad, _React$Component);
|
|
228
232
|
|
|
229
233
|
var _super = _createSuper(KeyPad);
|
|
230
234
|
|
|
231
235
|
function KeyPad() {
|
|
232
236
|
var _this;
|
|
233
237
|
|
|
234
|
-
|
|
238
|
+
(0, _classCallCheck2["default"])(this, KeyPad);
|
|
235
239
|
|
|
236
240
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
237
241
|
args[_key] = arguments[_key];
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
241
|
-
|
|
242
|
-
_defineProperty(_assertThisInitialized(_this), "buttonClick", function (key) {
|
|
245
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "buttonClick", function (key) {
|
|
243
246
|
log('[buttonClick]', key);
|
|
244
247
|
var onPress = _this.props.onPress;
|
|
245
248
|
onPress(key);
|
|
246
249
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
var transposed = [].concat(_toConsumableArray((0, _keysLayout.sortKeys)(base)), _toConsumableArray((0, _keysLayout.sortKeys)(extras)));
|
|
250
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "flowKeys", function (base, extras) {
|
|
251
|
+
var transposed = [].concat((0, _toConsumableArray2["default"])((0, _keysLayout.sortKeys)(base)), (0, _toConsumableArray2["default"])((0, _keysLayout.sortKeys)(extras)));
|
|
250
252
|
return _lodash["default"].flatten(transposed);
|
|
251
253
|
});
|
|
252
|
-
|
|
253
|
-
_defineProperty(_assertThisInitialized(_this), "keyIsNotAllowed", function (key) {
|
|
254
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "keyIsNotAllowed", function (key) {
|
|
254
255
|
var noDecimal = _this.props.noDecimal;
|
|
255
256
|
|
|
256
257
|
if ((key.write === '.' && key.label === '.' || key.write === ',' && key.label === ',') && noDecimal) {
|
|
@@ -259,11 +260,10 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
259
260
|
|
|
260
261
|
return false;
|
|
261
262
|
});
|
|
262
|
-
|
|
263
263
|
return _this;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
(0, _createClass2["default"])(KeyPad, [{
|
|
267
267
|
key: "render",
|
|
268
268
|
value: function render() {
|
|
269
269
|
var _this2 = this;
|
|
@@ -273,18 +273,21 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
273
273
|
className = _this$props.className,
|
|
274
274
|
baseSet = _this$props.baseSet,
|
|
275
275
|
additionalKeys = _this$props.additionalKeys,
|
|
276
|
+
layoutForKeyPad = _this$props.layoutForKeyPad,
|
|
276
277
|
onFocus = _this$props.onFocus,
|
|
277
278
|
mode = _this$props.mode;
|
|
278
|
-
var noBaseSet = ['non-negative-integers', 'integers', 'decimals', 'fractions', 'item-authoring'];
|
|
279
|
+
var noBaseSet = ['non-negative-integers', 'integers', 'decimals', 'fractions', 'item-authoring', 'language'];
|
|
279
280
|
var keysWithoutBaseSet = noBaseSet.includes(mode);
|
|
280
281
|
var allKeys = keysWithoutBaseSet ? this.flowKeys([], additionalKeys || []) : this.flowKeys(baseSet, additionalKeys || []); //, ...sortKeys(additionalKeys)];
|
|
281
282
|
|
|
282
283
|
var shift = allKeys.length % 5 ? 1 : 0;
|
|
283
|
-
|
|
284
|
+
|
|
285
|
+
var style = _objectSpread({
|
|
284
286
|
gridTemplateColumns: "repeat(".concat(Math.floor(allKeys.length / 5) + shift, ", minmax(min-content, 150px))")
|
|
285
|
-
};
|
|
287
|
+
}, createCustomLayout(layoutForKeyPad));
|
|
288
|
+
|
|
286
289
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
287
|
-
className: (0, _classnames["default"])(classes.keys, className),
|
|
290
|
+
className: (0, _classnames["default"])(classes.keys, className, classes[mode]),
|
|
288
291
|
style: style,
|
|
289
292
|
onFocus: onFocus
|
|
290
293
|
}, allKeys.map(function (k, index) {
|
|
@@ -296,15 +299,15 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
296
299
|
});
|
|
297
300
|
}
|
|
298
301
|
|
|
299
|
-
var common = {
|
|
302
|
+
var common = _objectSpread({
|
|
300
303
|
onClick: onClick,
|
|
301
|
-
className: (0, _classnames["default"])(classes.labelButton, !keysWithoutBaseSet && classes[k.category], k.label === ',' && classes.comma, k.label === '.' && classes.dot),
|
|
304
|
+
className: (0, _classnames["default"])(classes.labelButton, !keysWithoutBaseSet && classes[k.category], classes[k.extraClass], k.label === ',' && classes.comma, k.label === '.' && classes.dot),
|
|
302
305
|
disabled: _this2.keyIsNotAllowed(k),
|
|
303
306
|
key: "".concat(k.label || k.latex || k.command, "-").concat(index)
|
|
304
|
-
};
|
|
307
|
+
}, k.actions || {});
|
|
305
308
|
|
|
306
309
|
if (k.latex) {
|
|
307
|
-
return /*#__PURE__*/_react["default"].createElement(LatexButton,
|
|
310
|
+
return /*#__PURE__*/_react["default"].createElement(LatexButton, (0, _extends2["default"])({
|
|
308
311
|
latex: k.latex
|
|
309
312
|
}, common, {
|
|
310
313
|
className: classes.latexButton
|
|
@@ -315,7 +318,7 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
315
318
|
return /*#__PURE__*/_react["default"].createElement(_Button["default"], common, k.label);
|
|
316
319
|
} else {
|
|
317
320
|
var Icon = k.icon ? k.icon : 'div';
|
|
318
|
-
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"],
|
|
321
|
+
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], (0, _extends2["default"])({
|
|
319
322
|
tabIndex: '-1'
|
|
320
323
|
}, common), /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
321
324
|
className: classes.icon
|
|
@@ -324,24 +327,22 @@ var KeyPad = /*#__PURE__*/function (_React$Component) {
|
|
|
324
327
|
}));
|
|
325
328
|
}
|
|
326
329
|
}]);
|
|
327
|
-
|
|
328
330
|
return KeyPad;
|
|
329
331
|
}(_react["default"].Component);
|
|
330
332
|
|
|
331
333
|
exports.KeyPad = KeyPad;
|
|
332
|
-
|
|
333
|
-
_defineProperty(KeyPad, "propTypes", {
|
|
334
|
+
(0, _defineProperty2["default"])(KeyPad, "propTypes", {
|
|
334
335
|
classes: _propTypes["default"].object.isRequired,
|
|
335
336
|
className: _propTypes["default"].string,
|
|
336
337
|
baseSet: _propTypes["default"].array,
|
|
337
338
|
additionalKeys: _propTypes["default"].array,
|
|
339
|
+
layoutForKeyPad: _propTypes["default"].object,
|
|
338
340
|
onPress: _propTypes["default"].func.isRequired,
|
|
339
341
|
onFocus: _propTypes["default"].func,
|
|
340
342
|
noDecimal: _propTypes["default"].bool,
|
|
341
343
|
mode: _propTypes["default"].string
|
|
342
344
|
});
|
|
343
|
-
|
|
344
|
-
_defineProperty(KeyPad, "defaultProps", {
|
|
345
|
+
(0, _defineProperty2["default"])(KeyPad, "defaultProps", {
|
|
345
346
|
baseSet: _keys.baseSet,
|
|
346
347
|
noDecimal: false
|
|
347
348
|
});
|
|
@@ -359,6 +360,9 @@ var styles = function styles(theme) {
|
|
|
359
360
|
gridColumnGap: '0px',
|
|
360
361
|
gridAutoFlow: 'column'
|
|
361
362
|
},
|
|
363
|
+
character: {
|
|
364
|
+
textTransform: 'initial !important'
|
|
365
|
+
},
|
|
362
366
|
holder: {
|
|
363
367
|
position: 'relative',
|
|
364
368
|
width: '100%',
|