@oat-sa/tao-core-ui 3.24.1 → 3.24.3

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.
Files changed (140) hide show
  1. package/dist/animable/pulsable/pulsable.js +0 -1
  2. package/dist/autocomplete/css/autocomplete.css +1 -1
  3. package/dist/autocomplete/css/autocomplete.css.map +1 -1
  4. package/dist/badge/css/badge.css +6 -6
  5. package/dist/badge/css/badge.css.map +1 -1
  6. package/dist/breadcrumbs/css/breadcrumbs.css +2 -2
  7. package/dist/breadcrumbs/css/breadcrumbs.css.map +1 -1
  8. package/dist/calculator/css/calculator.css +8 -6
  9. package/dist/calculator/css/calculator.css.map +1 -1
  10. package/dist/class/css/selector.css +4 -4
  11. package/dist/class/css/selector.css.map +1 -1
  12. package/dist/component/css/components.css +5 -5
  13. package/dist/component/css/components.css.map +1 -1
  14. package/dist/component/css/windowComponent.css +1 -1
  15. package/dist/component/css/windowComponent.css.map +1 -1
  16. package/dist/component/draggable.js +0 -1
  17. package/dist/component/resizable.js +0 -1
  18. package/dist/contextualPopup/css/contextualPopup.css +1 -1
  19. package/dist/contextualPopup/css/contextualPopup.css.map +1 -1
  20. package/dist/datatable/css/datatable.css +3 -3
  21. package/dist/datatable/css/datatable.css.map +1 -1
  22. package/dist/datatable.js +1 -2
  23. package/dist/datetime/css/picker.css +13 -13
  24. package/dist/datetime/css/picker.css.map +1 -1
  25. package/dist/documentViewer/css/documentViewer.css +10 -10
  26. package/dist/documentViewer/css/documentViewer.css.map +1 -1
  27. package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +0 -1
  28. package/dist/dynamicComponent/css/dynamicComponent.css +1 -1
  29. package/dist/dynamicComponent/css/dynamicComponent.css.map +1 -1
  30. package/dist/dynamicComponent.js +1 -4
  31. package/dist/figure/FigureStateActive.js +20 -23
  32. package/dist/form/css/dropdownForm.css +1 -1
  33. package/dist/form/css/dropdownForm.css.map +1 -1
  34. package/dist/form/widget/widget.js +1 -4
  35. package/dist/highlighter.js +0 -2
  36. package/dist/image/ImgStateActive.js +13 -15
  37. package/dist/interactUtils.js +7 -8
  38. package/dist/itemButtonList/css/item-button-list.css +9 -3
  39. package/dist/itemButtonList/css/item-button-list.css.map +1 -1
  40. package/dist/itemButtonList.js +1 -2
  41. package/dist/keyNavigation/navigableDomElement.js +3 -4
  42. package/dist/keyNavigation/navigator.js +1 -2
  43. package/dist/listbox/css/listbox.css +1 -1
  44. package/dist/listbox/css/listbox.css.map +1 -1
  45. package/dist/maths/calculator/core/board.js +58 -127
  46. package/dist/maths/calculator/core/labels.js +1 -6
  47. package/dist/maths/calculator/css/calculator.css +18 -18
  48. package/dist/maths/calculator/css/calculator.css.map +1 -1
  49. package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +1 -6
  50. package/dist/mediaplayer/css/player.css +7 -7
  51. package/dist/mediaplayer/css/player.css.map +1 -1
  52. package/dist/mediaplayer/players/html5.js +3 -14
  53. package/dist/mediaplayer/players/youtube.js +3 -12
  54. package/dist/mediaplayer/utils/crossOrigin.js +1 -1
  55. package/dist/mediaplayer/utils/timeObserver.js +1 -2
  56. package/dist/mediaplayer/youtubeManager.js +1 -2
  57. package/dist/mediaplayer.js +2 -8
  58. package/dist/mediasizer.js +0 -1
  59. package/dist/resizeObserver.js +1 -3
  60. package/dist/resource/css/selector.css +31 -23
  61. package/dist/resource/css/selector.css.map +1 -1
  62. package/dist/resource/list.js +239 -203
  63. package/dist/resource/selector.js +0 -1
  64. package/dist/resource/tree.js +239 -203
  65. package/dist/resourcemgr/assetSearch.js +20 -18
  66. package/dist/resourcemgr/assetSearchContract.js +67 -12
  67. package/dist/resourcemgr/css/resourcemgr.css +17 -18
  68. package/dist/resourcemgr/css/resourcemgr.css.map +1 -1
  69. package/dist/resourcemgr/fileBrowser.js +3 -5
  70. package/dist/resourcemgr/fileSelector.js +3 -0
  71. package/dist/searchModal/advancedSearch.js +3 -4
  72. package/dist/searchModal/css/searchModal.css +14 -14
  73. package/dist/searchModal/css/searchModal.css.map +1 -1
  74. package/dist/searchModal.js +42 -53
  75. package/dist/switch/css/switch.css +2 -2
  76. package/dist/switch/css/switch.css.map +1 -1
  77. package/dist/tabs/css/tabs.css +2 -2
  78. package/dist/tabs/css/tabs.css.map +1 -1
  79. package/dist/taskQueue/css/taskQueue.css +4 -4
  80. package/dist/taskQueue/css/taskQueue.css.map +1 -1
  81. package/dist/taskQueue/taskQueueModel.js +1 -2
  82. package/dist/taskQueueButton/taskable.js +1 -2
  83. package/dist/validator/validators.js +0 -1
  84. package/dist/waitingDialog/css/waitingDialog.css +2 -2
  85. package/dist/waitingDialog/css/waitingDialog.css.map +1 -1
  86. package/package.json +1 -1
  87. package/src/autocomplete/css/autocomplete.css +1 -1
  88. package/src/autocomplete/css/autocomplete.css.map +1 -1
  89. package/src/badge/css/badge.css +6 -6
  90. package/src/badge/css/badge.css.map +1 -1
  91. package/src/breadcrumbs/css/breadcrumbs.css +2 -2
  92. package/src/breadcrumbs/css/breadcrumbs.css.map +1 -1
  93. package/src/calculator/css/calculator.css +8 -6
  94. package/src/calculator/css/calculator.css.map +1 -1
  95. package/src/class/css/selector.css +4 -4
  96. package/src/class/css/selector.css.map +1 -1
  97. package/src/component/css/components.css +5 -5
  98. package/src/component/css/components.css.map +1 -1
  99. package/src/component/css/windowComponent.css +1 -1
  100. package/src/component/css/windowComponent.css.map +1 -1
  101. package/src/contextualPopup/css/contextualPopup.css +1 -1
  102. package/src/contextualPopup/css/contextualPopup.css.map +1 -1
  103. package/src/css/basic.css +123 -113
  104. package/src/css/basic.css.map +1 -1
  105. package/src/datatable/css/datatable.css +3 -3
  106. package/src/datatable/css/datatable.css.map +1 -1
  107. package/src/datetime/css/picker.css +13 -13
  108. package/src/datetime/css/picker.css.map +1 -1
  109. package/src/documentViewer/css/documentViewer.css +10 -10
  110. package/src/documentViewer/css/documentViewer.css.map +1 -1
  111. package/src/dynamicComponent/css/dynamicComponent.css +1 -1
  112. package/src/dynamicComponent/css/dynamicComponent.css.map +1 -1
  113. package/src/form/css/dropdownForm.css +1 -1
  114. package/src/form/css/dropdownForm.css.map +1 -1
  115. package/src/itemButtonList/css/item-button-list.css +9 -3
  116. package/src/itemButtonList/css/item-button-list.css.map +1 -1
  117. package/src/listbox/css/listbox.css +1 -1
  118. package/src/listbox/css/listbox.css.map +1 -1
  119. package/src/maths/calculator/css/calculator.css +18 -18
  120. package/src/maths/calculator/css/calculator.css.map +1 -1
  121. package/src/mediaplayer/css/player.css +7 -7
  122. package/src/mediaplayer/css/player.css.map +1 -1
  123. package/src/resource/css/selector.css +31 -23
  124. package/src/resource/css/selector.css.map +1 -1
  125. package/src/resourcemgr/assetSearch.js +27 -19
  126. package/src/resourcemgr/assetSearchContract.js +67 -18
  127. package/src/resourcemgr/css/resourcemgr.css +17 -18
  128. package/src/resourcemgr/css/resourcemgr.css.map +1 -1
  129. package/src/resourcemgr/fileBrowser.js +9 -9
  130. package/src/resourcemgr/fileSelector.js +4 -0
  131. package/src/searchModal/css/searchModal.css +14 -14
  132. package/src/searchModal/css/searchModal.css.map +1 -1
  133. package/src/switch/css/switch.css +2 -2
  134. package/src/switch/css/switch.css.map +1 -1
  135. package/src/tabs/css/tabs.css +2 -2
  136. package/src/tabs/css/tabs.css.map +1 -1
  137. package/src/taskQueue/css/taskQueue.css +4 -4
  138. package/src/taskQueue/css/taskQueue.css.map +1 -1
  139. package/src/waitingDialog/css/waitingDialog.css +2 -2
  140. package/src/waitingDialog/css/waitingDialog.css.map +1 -1
@@ -1510,10 +1510,9 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
1510
1510
  * @param {term[]} list - List of terms.
1511
1511
  * @returns {object} - List of token values.
1512
1512
  */
1513
- const extractTokenValues = list => Object.entries(list).reduce((tokens, _ref) => {
1514
- let [token, {
1515
- value
1516
- }] = _ref;
1513
+ const extractTokenValues = list => Object.entries(list).reduce((tokens, [token, {
1514
+ value
1515
+ }]) => {
1517
1516
  tokens[token] = value;
1518
1517
  return tokens;
1519
1518
  }, {});
@@ -1524,8 +1523,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
1524
1523
  * @param {function} predicate - Filter function.
1525
1524
  * @returns {term[]} - List of terms that match the filter.
1526
1525
  */
1527
- const extractTokensByType = (list, predicate) => Object.entries(list).reduce((tokens, _ref2) => {
1528
- let [token, term] = _ref2;
1526
+ const extractTokensByType = (list, predicate) => Object.entries(list).reduce((tokens, [token, term]) => {
1529
1527
  if (predicate(term)) {
1530
1528
  tokens[token] = term;
1531
1529
  }
@@ -1588,8 +1586,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
1588
1586
  * @param {object} [config.digits] - List of additional digits: key being the name, value being the pattern
1589
1587
  * @returns {calculatorTokenizer}
1590
1588
  */
1591
- function tokenizerFactory() {
1592
- let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1589
+ function tokenizerFactory(config = {}) {
1593
1590
  const keywordsList = Object.assign({}, config.keywords, extractTokenValues(keywords));
1594
1591
  const symbolsList = Object.assign({}, config.symbols, extractTokenValues(symbols));
1595
1592
  const digitsList = Object.assign({}, config.digits, extractTokenValues(digits));
@@ -1817,8 +1814,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
1817
1814
  * @param {number} [decimalDigits=5]
1818
1815
  * @returns {string}
1819
1816
  */
1820
- roundVariable(variable) {
1821
- let decimalDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultDecimalDigits;
1817
+ roundVariable(variable, decimalDigits = defaultDecimalDigits) {
1822
1818
  const fullString = tokensHelper.stringValue(variable);
1823
1819
  const result = variable && variable.result;
1824
1820
  let resultString = fullString;
@@ -1880,9 +1876,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
1880
1876
  * @param {calculatorTokenizer} [tokenizer]
1881
1877
  * @returns {renderTerm[]}
1882
1878
  */
1883
- render(expression) {
1884
- let variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1885
- let tokenizer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1879
+ render(expression, variables = {}, tokenizer = null) {
1886
1880
  let tokens = expression;
1887
1881
  const exponents = [];
1888
1882
  const renderedTerms = [];
@@ -2012,8 +2006,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
2012
2006
  * @param {number} index
2013
2007
  * @returns {exponentTerms} - Returns the terms representing the exponent.
2014
2008
  */
2015
- function extractExponent(renderedTerms) {
2016
- let index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
2009
+ function extractExponent(renderedTerms, index = 0) {
2017
2010
  const extract = [];
2018
2011
  const len = renderedTerms.length;
2019
2012
  const first = renderedTerms[index];
@@ -5074,7 +5067,6 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
5074
5067
  // Ctor.underflow = true;
5075
5068
  } // else Ctor.underflow = false;
5076
5069
  }
5077
-
5078
5070
  return x;
5079
5071
  }
5080
5072
  function finiteToString(x, isExp, sd) {
@@ -8122,7 +8114,6 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8122
8114
  if (n > 171) {
8123
8115
  return Infinity; // Will overflow
8124
8116
  }
8125
-
8126
8117
  var value = n - 2;
8127
8118
  var res = n - 1;
8128
8119
  while (value > 1) {
@@ -8132,7 +8123,6 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8132
8123
  if (res === 0) {
8133
8124
  res = 1; // 0! is per definition 1
8134
8125
  }
8135
-
8136
8126
  return res;
8137
8127
  }
8138
8128
  if (n < 0.5) {
@@ -8141,7 +8131,6 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8141
8131
  if (n >= 171.35) {
8142
8132
  return Infinity; // will overflow
8143
8133
  }
8144
-
8145
8134
  if (n > 85.0) {
8146
8135
  // Extended Stirling Approx
8147
8136
  var twoN = n * n;
@@ -8533,16 +8522,8 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8533
8522
  * @param {...*} boundArgs - The arguments to partially apply before.
8534
8523
  * @returns {function} - The partially applied function.
8535
8524
  */
8536
- function partial(func) {
8537
- for (var _len = arguments.length, boundArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
8538
- boundArgs[_key - 1] = arguments[_key];
8539
- }
8540
- const wrapper = function () {
8541
- for (var _len2 = arguments.length, remainingArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8542
- remainingArgs[_key2] = arguments[_key2];
8543
- }
8544
- return func(...boundArgs, ...remainingArgs);
8545
- };
8525
+ function partial(func, ...boundArgs) {
8526
+ const wrapper = (...remainingArgs) => func(...boundArgs, ...remainingArgs);
8546
8527
  return wrapper;
8547
8528
  }
8548
8529
 
@@ -8552,16 +8533,8 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8552
8533
  * @param {...*} boundArgs - The arguments to partially apply after.
8553
8534
  * @returns {function} - The partially applied function.
8554
8535
  */
8555
- function partialRight(func) {
8556
- for (var _len3 = arguments.length, boundArgs = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
8557
- boundArgs[_key3 - 1] = arguments[_key3];
8558
- }
8559
- const wrapper = function () {
8560
- for (var _len4 = arguments.length, remainingArgs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
8561
- remainingArgs[_key4] = arguments[_key4];
8562
- }
8563
- return func(...remainingArgs, ...boundArgs);
8564
- };
8536
+ function partialRight(func, ...boundArgs) {
8537
+ const wrapper = (...remainingArgs) => func(...remainingArgs, ...boundArgs);
8565
8538
  return wrapper;
8566
8539
  }
8567
8540
 
@@ -8941,10 +8914,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
8941
8914
  * @param {...*} args
8942
8915
  * @returns {*}
8943
8916
  */
8944
- function useOrigin() {
8945
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
8946
- args[_key5] = arguments[_key5];
8947
- }
8917
+ function useOrigin(...args) {
8948
8918
  const origin = args.pop();
8949
8919
  return origin.apply(this, args.map(native));
8950
8920
  }
@@ -9014,13 +8984,10 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9014
8984
  * @param {number|string|Decimal} operands
9015
8985
  * @returns {Decimal} - Always returns a Decimal
9016
8986
  */
9017
- function functionOperator(operator) {
8987
+ function functionOperator(operator, ...operands) {
9018
8988
  if ('function' !== typeof ConfiguredDecimal[operator]) {
9019
8989
  throw new TypeError(`${operator} is not a valid function!`);
9020
8990
  }
9021
- for (var _len6 = arguments.length, operands = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
9022
- operands[_key6 - 1] = arguments[_key6];
9023
- }
9024
8991
  return ConfiguredDecimal[operator](...operands.map(decimalNumber));
9025
8992
  }
9026
8993
 
@@ -9160,8 +9127,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9160
9127
  * @param {token[]} tokens - The list of tokens on which apply the strategy.
9161
9128
  * @returns {token[]} - Returns the corrected list of tokens.
9162
9129
  */
9163
- function removeDummyOperators() {
9164
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9130
+ function removeDummyOperators(tokens = []) {
9165
9131
  while (tokens.length && endWithOperator(tokens)) {
9166
9132
  tokens.pop();
9167
9133
  }
@@ -9172,8 +9138,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9172
9138
  * @param {token[]} tokens - The list of tokens on which apply the strategy.
9173
9139
  * @returns {token[]} - Returns the corrected list of tokens.
9174
9140
  */
9175
- function correctParenthesis() {
9176
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9141
+ function correctParenthesis(tokens = []) {
9177
9142
  let parenthesis = 0;
9178
9143
  tokens.forEach(token => {
9179
9144
  const term = tokensHelper.getTerm(token);
@@ -9407,8 +9372,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9407
9372
  * @returns {boolean|null} - Returns `true` if the new token is rejected.
9408
9373
  * Otherwise, returns `null` if the strategy does not apply.
9409
9374
  */
9410
- function limitExpressionStart() {
9411
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9375
+ function limitExpressionStart(tokens = []) {
9412
9376
  // ex: '*', '/', '^'
9413
9377
  if (tokens.length === 1 && cannotStart(tokens[0])) {
9414
9378
  return true;
@@ -9436,8 +9400,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9436
9400
  * @returns {boolean|null} - Returns `true` if the new token is rejected.
9437
9401
  * Otherwise, returns `null` if the strategy does not apply.
9438
9402
  */
9439
- function limitDecimalSeparator() {
9440
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9403
+ function limitDecimalSeparator(tokens = []) {
9441
9404
  if (tokens.length <= 1) {
9442
9405
  return null;
9443
9406
  }
@@ -9458,8 +9421,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9458
9421
  * @returns {boolean|null} - Returns `true` if the new token is rejected.
9459
9422
  * Otherwise, returns `null` if the strategy does not apply.
9460
9423
  */
9461
- function limitExpressionClose() {
9462
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9424
+ function limitExpressionClose(tokens = []) {
9463
9425
  if (tokens.length < 2) {
9464
9426
  return null;
9465
9427
  }
@@ -9627,8 +9589,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9627
9589
  * @returns {boolean} - Returns `true` if the current expression must be replaced.
9628
9590
  * Otherwise, returns `false`.
9629
9591
  */
9630
- function replaceExpression() {
9631
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9592
+ function replaceExpression(tokens = []) {
9632
9593
  const [currentTerm] = tokens.slice(-2, -1);
9633
9594
  const [newTerm] = tokens.slice(-1);
9634
9595
  const currentToken = tokensHelper.getToken(currentTerm);
@@ -9690,8 +9651,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
9690
9651
  * @returns {number|null} - Returns `true` if the current token must be replaced.
9691
9652
  * Otherwise, returns `null` if the strategy does not apply.
9692
9653
  */
9693
- function replaceOperator() {
9694
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9654
+ function replaceOperator(tokens = []) {
9695
9655
  const currentTokens = tokens.slice(0, -1).reverse();
9696
9656
  const [newToken] = tokens.slice(-1);
9697
9657
  const newTerm = tokensHelper.getTerm(newToken);
@@ -10099,8 +10059,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10099
10059
  * Check a state and increase the internal counter if the internal flag changes from `true` to `false`.
10100
10060
  * @param {boolean} state
10101
10061
  */
10102
- check() {
10103
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
10062
+ check(state = false) {
10104
10063
  if (flag && !state) {
10105
10064
  counter++;
10106
10065
  }
@@ -10142,8 +10101,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10142
10101
  * @returns {boolean|null} - Returns `false` if the expression does not contain enough tokens.
10143
10102
  * Otherwise, returns `null` if the next strategy could apply.
10144
10103
  */
10145
- function expressionFilled() {
10146
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
10104
+ function expressionFilled(tokens = []) {
10147
10105
  if (tokens.length < 4) {
10148
10106
  return false;
10149
10107
  }
@@ -10155,8 +10113,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10155
10113
  * @returns {boolean|null} - Returns `false` if the new term to does not require the expression to be evaluated.
10156
10114
  * Otherwise, returns `null` if the next strategy could apply.
10157
10115
  */
10158
- function addingOperator() {
10159
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
10116
+ function addingOperator(tokens = []) {
10160
10117
  const [newToken] = tokens.slice(-1);
10161
10118
  const newTerm = tokensHelper.getTerm(newToken);
10162
10119
  if (!newTerm || newTerm.token === 'ASSIGN' || !isFunctionOperator(newTerm.token) && !tokensHelper.isBinaryOperator(newTerm)) {
@@ -10171,8 +10128,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10171
10128
  * @returns {boolean|null} - Returns `false` if the current term is a function.
10172
10129
  * Otherwise, returns `null` if the next strategy could apply.
10173
10130
  */
10174
- function orphanFunction() {
10175
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
10131
+ function orphanFunction(tokens = []) {
10176
10132
  const [currentToken] = tokens.slice(-2, -1);
10177
10133
  if (tokensHelper.isFunction(currentToken)) {
10178
10134
  return false;
@@ -10185,8 +10141,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10185
10141
  * @returns {boolean|null} - Returns `true` if the current expression can be evaluated.
10186
10142
  * Otherwise, returns `false`.
10187
10143
  */
10188
- function expressionComplete() {
10189
- let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
10144
+ function expressionComplete(tokens = []) {
10190
10145
  const currentTokens = tokens.slice(0, -1);
10191
10146
  const operands = counterFactory();
10192
10147
  const operators = counterFactory();
@@ -10270,17 +10225,16 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10270
10225
  * @param {object} [config.maths] - An optional config for the maths evaluator (@see mathsEvaluator)
10271
10226
  * @returns {calculator}
10272
10227
  */
10273
- function engineFactory() {
10274
- let {
10275
- expression = '',
10276
- position = null,
10277
- instant = false,
10278
- corrector = false,
10279
- variables = {},
10280
- commands = {},
10281
- plugins = {},
10282
- maths = {}
10283
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10228
+ function engineFactory({
10229
+ expression = '',
10230
+ position = null,
10231
+ instant = false,
10232
+ corrector = false,
10233
+ variables = {},
10234
+ commands = {},
10235
+ plugins = {},
10236
+ maths = {}
10237
+ } = {}) {
10284
10238
  /**
10285
10239
  * The list of event listeners.
10286
10240
  * @type {Map}
@@ -10364,8 +10318,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10364
10318
  * @param {function} listener - The listener to remove from the list.
10365
10319
  * @returns {calculator} - Chains the instance.
10366
10320
  */
10367
- off(names) {
10368
- let listener = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
10321
+ off(names, listener = null) {
10369
10322
  if ('undefined' === typeof names) {
10370
10323
  events.clear();
10371
10324
  return this;
@@ -10391,10 +10344,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10391
10344
  * @param {...*} args - Optional parameters to pass to each listener.
10392
10345
  * @returns {calculator} - Chains the instance.
10393
10346
  */
10394
- trigger(name) {
10395
- for (var _len7 = arguments.length, args = new Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
10396
- args[_key7 - 1] = arguments[_key7];
10397
- }
10347
+ trigger(name, ...args) {
10398
10348
  if ('undefined' === typeof name || !events.has(name)) {
10399
10349
  return this;
10400
10350
  }
@@ -10409,8 +10359,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10409
10359
  * @returns {calculator}
10410
10360
  * @fires configure
10411
10361
  */
10412
- configureMathsEvaluator() {
10413
- let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10362
+ configureMathsEvaluator(config = {}) {
10414
10363
  mathsEvaluator = mathsEvaluatorFactory(Object.assign(maths, config));
10415
10364
  this.trigger('configure', config);
10416
10365
  return this;
@@ -10421,8 +10370,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10421
10370
  * @returns {calculator}
10422
10371
  * @fires configure
10423
10372
  */
10424
- setDegreeMode() {
10425
- let degree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
10373
+ setDegreeMode(degree = true) {
10426
10374
  return this.configureMathsEvaluator({
10427
10375
  degree
10428
10376
  });
@@ -10440,8 +10388,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10440
10388
  * @returns {calculator}
10441
10389
  * @fires configure
10442
10390
  */
10443
- setInstantMode() {
10444
- let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
10391
+ setInstantMode(mode = true) {
10445
10392
  instant = mode;
10446
10393
  this.trigger('configure', {
10447
10394
  instant
@@ -10461,8 +10408,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
10461
10408
  * @returns {calculator}
10462
10409
  * @fires configure
10463
10410
  */
10464
- setCorrectorMode() {
10465
- let mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
10411
+ setCorrectorMode(mode = true) {
10466
10412
  corrector = mode;
10467
10413
  this.trigger('configure', {
10468
10414
  corrector
@@ -11194,15 +11140,12 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
11194
11140
  * @fires command-<name> with the parameters of the command
11195
11141
  * @fires error if the command is invalid
11196
11142
  */
11197
- invoke(name) {
11143
+ invoke(name, ...args) {
11198
11144
  const action = commandsRegistry.get(name);
11199
11145
  if ('function' !== typeof action) {
11200
11146
  this.trigger('error', new TypeError(`Invalid command: ${name}`));
11201
11147
  return false;
11202
11148
  }
11203
- for (var _len8 = arguments.length, args = new Array(_len8 > 1 ? _len8 - 1 : 0), _key8 = 1; _key8 < _len8; _key8++) {
11204
- args[_key8 - 1] = arguments[_key8];
11205
- }
11206
11149
  this.trigger(`command-${name}`, ...args);
11207
11150
  this.trigger('command', name, ...args);
11208
11151
  action.apply(this, args);
@@ -11330,8 +11273,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
11330
11273
  * @returns {renderTerm[]}
11331
11274
  * @fires render when the expression has been rendered
11332
11275
  */
11333
- render() {
11334
- let decimals = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultDecimalDigits;
11276
+ render(decimals = defaultDecimalDigits) {
11335
11277
  const formattedVariables = expressionHelper.roundAllVariables(this.getAllVariables(), decimals);
11336
11278
  const renderedTerms = expressionHelper.render(this.getTokens(), formattedVariables, tokenizer);
11337
11279
  this.trigger('render', renderedTerms);
@@ -11771,16 +11713,15 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
11771
11713
  * @param {object} [config.maths] - An optional config for the maths evaluator (@see mathsEvaluator).
11772
11714
  * @returns {calculator}
11773
11715
  */
11774
- function calculatorFactory() {
11775
- let {
11776
- expression = '',
11777
- position = 0,
11778
- instant = false,
11779
- corrector = true,
11780
- variables = {},
11781
- commands = {},
11782
- maths = {}
11783
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11716
+ function calculatorFactory({
11717
+ expression = '',
11718
+ position = 0,
11719
+ instant = false,
11720
+ corrector = true,
11721
+ variables = {},
11722
+ commands = {},
11723
+ maths = {}
11724
+ } = {}) {
11784
11725
  const plugins = {
11785
11726
  history: historyPlugin
11786
11727
  };
@@ -12067,10 +12008,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
12067
12008
  * @fires command-<name> with the parameters of the command
12068
12009
  * @fires error if the command is invalid
12069
12010
  */
12070
- useCommand(name) {
12071
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
12072
- args[_key - 1] = arguments[_key];
12073
- }
12011
+ useCommand(name, ...args) {
12074
12012
  calculator.invoke(name, ...args);
12075
12013
  return this;
12076
12014
  },
@@ -12120,9 +12058,7 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
12120
12058
  * @param {number} decimals - The number of decimals to present after the dot in the last result variable.
12121
12059
  * @returns {string}
12122
12060
  */
12123
- renderExpression() {
12124
- let expression = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
12125
- let decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultDecimalDigits;
12061
+ renderExpression(expression = null, decimals = defaultDecimalDigits) {
12126
12062
  const tokens = expression === null ? calculator.getTokens() : expression;
12127
12063
  const variables = expressionHelper.roundAllVariables(calculator.getAllVariables(), decimals);
12128
12064
  const renderedTerms = expressionHelper.nestExponents(expressionHelper.render(tokens, variables, calculator.getTokenizer()));
@@ -12197,16 +12133,12 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
12197
12133
  * @type {component}
12198
12134
  */
12199
12135
  const calculatorComponent = componentFactory(calculatorApi, defaultConfig$1).setTemplate(boardTpl).before('init', function beforeInit() {
12200
- var _this = this;
12201
12136
  calculator.configureMathsEvaluator(this.config.maths).on('configure', () => this.syncCalculatorState()).on('expression', expression => this.trigger('expressionchange', expression)).on('position', position => this.trigger('positionchange', position)).on('variableadd', (name, value) => this.trigger('variableadd', name, value)).on('variabledelete', name => this.trigger('variabledelete', name)).on('variableclear', () => this.trigger('variableclear')).on('commandadd', name => this.trigger('commandadd', name)).on('commanddelete', name => this.trigger('commanddelete', name)).on('term', (name, term) => {
12202
12137
  this.trigger('termadd', name, term);
12203
12138
  this.trigger(`termadd-${name}`, term);
12204
- }).on('command', function (name) {
12205
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
12206
- args[_key2 - 1] = arguments[_key2];
12207
- }
12208
- _this.trigger('command', name, ...args);
12209
- _this.trigger(`command-${name}`, ...args);
12139
+ }).on('command', (name, ...args) => {
12140
+ this.trigger('command', name, ...args);
12141
+ this.trigger(`command-${name}`, ...args);
12210
12142
  }).on('replace', (expression, position) => this.trigger('replace', expression, position)).on('insert', (expression, position) => this.trigger('insert', expression, position)).on('clear', () => this.trigger('clear')).on('reset', () => this.trigger('reset')).on('correct', () => this.trigger('correct')).on('evaluate', result => this.trigger('evaluate', result)).on('result', result => this.trigger('result', result)).on('syntaxerror', error => this.trigger('syntaxerror', error)).on('error', error => this.trigger('error', error));
12211
12143
  }).after('init', function afterInit() {
12212
12144
  this.render($container);
@@ -12219,7 +12151,6 @@ define(['handlebars', 'ui/areaBroker', 'ui/component', 'lib/handlebars/helpers']
12219
12151
  // where the expressions are input
12220
12152
  keyboard: $element.find('.keyboard') // the keyboard area that should provide a way to interact with the calculator
12221
12153
  });
12222
-
12223
12154
  const pluginsConfig = this.getConfig().plugins || {};
12224
12155
  if (Array.isArray(pluginFactories)) {
12225
12156
  pluginFactories.forEach(pluginFactory => {
@@ -1417,8 +1417,7 @@ define(['i18n', 'handlebars', 'lib/handlebars/helpers'], function (__, Handlebar
1417
1417
  * @param {function} predicate - Filter function.
1418
1418
  * @returns {term[]} - List of terms that match the filter.
1419
1419
  */
1420
- const extractTokensByType = (list, predicate) => Object.entries(list).reduce((tokens, _ref2) => {
1421
- let [token, term] = _ref2;
1420
+ const extractTokensByType = (list, predicate) => Object.entries(list).reduce((tokens, [token, term]) => {
1422
1421
  if (predicate(term)) {
1423
1422
  tokens[token] = term;
1424
1423
  }
@@ -4375,7 +4374,6 @@ define(['i18n', 'handlebars', 'lib/handlebars/helpers'], function (__, Handlebar
4375
4374
  // Ctor.underflow = true;
4376
4375
  } // else Ctor.underflow = false;
4377
4376
  }
4378
-
4379
4377
  return x;
4380
4378
  }
4381
4379
  function finiteToString(x, isExp, sd) {
@@ -7423,7 +7421,6 @@ define(['i18n', 'handlebars', 'lib/handlebars/helpers'], function (__, Handlebar
7423
7421
  if (n > 171) {
7424
7422
  return Infinity; // Will overflow
7425
7423
  }
7426
-
7427
7424
  var value = n - 2;
7428
7425
  var res = n - 1;
7429
7426
  while (value > 1) {
@@ -7433,7 +7430,6 @@ define(['i18n', 'handlebars', 'lib/handlebars/helpers'], function (__, Handlebar
7433
7430
  if (res === 0) {
7434
7431
  res = 1; // 0! is per definition 1
7435
7432
  }
7436
-
7437
7433
  return res;
7438
7434
  }
7439
7435
  if (n < 0.5) {
@@ -7442,7 +7438,6 @@ define(['i18n', 'handlebars', 'lib/handlebars/helpers'], function (__, Handlebar
7442
7438
  if (n >= 171.35) {
7443
7439
  return Infinity; // will overflow
7444
7440
  }
7445
-
7446
7441
  if (n > 85.0) {
7447
7442
  // Extended Stirling Approx
7448
7443
  var twoN = n * n;
@@ -124,14 +124,14 @@ Usage:
124
124
  height: calc(3.2em - 4px);
125
125
  }
126
126
  .calculator .calculator-keyboard button:hover:before {
127
- background: #a4a9b1;
127
+ background: rgb(64.2352941176%, 66.431372549%, 69.568627451%);
128
128
  }
129
129
  .calculator .calculator-keyboard button.disabled {
130
130
  visibility: hidden;
131
131
  }
132
132
  .calculator .calculator-keyboard button.switch span {
133
133
  color: #222 !important;
134
- border-color: #919191 !important;
134
+ border-color: rgb(56.6666666667%, 56.6666666667%, 56.6666666667%) !important;
135
135
  border-top: 1px solid;
136
136
  border-bottom: 1px solid;
137
137
  height: auto;
@@ -168,7 +168,7 @@ Usage:
168
168
  color: rgb(14, 93, 145) !important;
169
169
  }
170
170
  .calculator .calculator-keyboard button.execute:before {
171
- background: #3e7da7;
171
+ background: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
172
172
  }
173
173
  .calculator .calculator-keyboard button.execute span {
174
174
  font-weight: bold;
@@ -188,13 +188,13 @@ Usage:
188
188
  height: 1.2em;
189
189
  }
190
190
  .calculator.degree .calculator-keyboard button.switch[data-command=degree]:before {
191
- background: #3e7da7;
191
+ background: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
192
192
  }
193
193
  .calculator.degree .calculator-keyboard button.switch[data-command=degree] span {
194
194
  color: white !important;
195
195
  }
196
196
  .calculator.radian .calculator-keyboard button.switch[data-command=radian]:before {
197
- background: #3e7da7;
197
+ background: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
198
198
  }
199
199
  .calculator.radian .calculator-keyboard button.switch[data-command=radian] span {
200
200
  color: white !important;
@@ -217,20 +217,16 @@ Usage:
217
217
  .calculator .simple-screen .history {
218
218
  font-size: 1em !important;
219
219
  border: 1px solid #ddd;
220
- color: #4e4e4e;
220
+ color: rgb(30.6666666667%, 30.6666666667%, 30.6666666667%);
221
221
  height: calc(16px + 3.9em);
222
222
  line-height: 1.3em;
223
223
  }
224
- .calculator .simple-screen .history .history-line .history-expression {
225
- text-align: left;
226
- }
227
224
  .calculator .simple-screen .history .history-line .history-expression,
228
225
  .calculator .simple-screen .history .history-line .history-expression .term {
229
226
  font-weight: lighter;
230
227
  }
231
- .calculator .simple-screen .history .history-line .history-result {
232
- text-align: right;
233
- font-weight: bolder;
228
+ .calculator .simple-screen .history .history-line .history-expression {
229
+ text-align: left;
234
230
  }
235
231
  .calculator .simple-screen .history .history-line .history-result:before {
236
232
  content: "=";
@@ -238,6 +234,10 @@ Usage:
238
234
  font-weight: lighter;
239
235
  padding-right: 0.2em;
240
236
  }
237
+ .calculator .simple-screen .history .history-line .history-result {
238
+ text-align: right;
239
+ font-weight: bolder;
240
+ }
241
241
  .calculator .simple-screen .expression {
242
242
  font-size: 1.3em !important;
243
243
  background: rgb(255, 255, 255);
@@ -273,16 +273,16 @@ Usage:
273
273
  }
274
274
  .calculator .simple-screen .term.term-variable {
275
275
  font-weight: bold;
276
- color: #3e7da7;
276
+ color: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
277
277
  }
278
278
  .calculator .simple-screen .term.term-variable[data-token=VAR_ANS] {
279
- background: #ecf2f6;
279
+ background: rgb(92.4392156863%, 94.9176470588%, 96.5490196078%);
280
280
  padding: 0;
281
281
  margin: 0 0.4em;
282
282
  position: relative;
283
283
  }
284
284
  .calculator .simple-screen .term.term-variable[data-token=VAR_ANS]::before, .calculator .simple-screen .term.term-variable[data-token=VAR_ANS]::after {
285
- background: #ecf2f6;
285
+ background: rgb(92.4392156863%, 94.9176470588%, 96.5490196078%);
286
286
  content: "";
287
287
  border-radius: 50%;
288
288
  border: 2px none;
@@ -294,12 +294,12 @@ Usage:
294
294
  }
295
295
  .calculator .simple-screen .term.term-variable[data-token=VAR_ANS]::before {
296
296
  border-left-style: solid;
297
- border-left-color: #3e7da7;
297
+ border-left-color: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
298
298
  left: -0.2em;
299
299
  }
300
300
  .calculator .simple-screen .term.term-variable[data-token=VAR_ANS]::after {
301
301
  border-right-style: solid;
302
- border-right-color: #3e7da7;
302
+ border-right-color: rgb(24.3921568627%, 49.1764705882%, 65.4901960784%);
303
303
  right: -0.2em;
304
304
  }
305
305
  .calculator .simple-screen .term.term-variable[data-token=VAR_ANS] * {
@@ -323,6 +323,6 @@ Usage:
323
323
  text-decoration: underline wavy rgb(186, 18, 43);
324
324
  }
325
325
  .calculator.error .screen .expression {
326
- background: #f1d0d5;
326
+ background: rgb(94.5882352941%, 81.4117647059%, 83.3725490196%);
327
327
  }
328
328
  /*# sourceMappingURL=calculator.css.map */