@micromag/screen-keypad 0.3.658 → 0.3.659
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/es/index.js +13 -4
- package/package.json +18 -18
package/es/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
5
|
import { animated } from '@react-spring/web';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
|
+
import { isString } from 'lodash';
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
9
|
import React, { useRef, useMemo, useState, useCallback, useEffect } from 'react';
|
|
9
10
|
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
@@ -418,7 +419,7 @@ var KeypadScreen = function KeypadScreen(_ref) {
|
|
|
418
419
|
_ref15$id = _ref15.id,
|
|
419
420
|
id = _ref15$id === void 0 ? null : _ref15$id,
|
|
420
421
|
_ref15$label = _ref15.label,
|
|
421
|
-
|
|
422
|
+
itemLabel = _ref15$label === void 0 ? null : _ref15$label,
|
|
422
423
|
_ref15$visual = _ref15.visual,
|
|
423
424
|
visual = _ref15$visual === void 0 ? null : _ref15$visual,
|
|
424
425
|
_ref15$textStyle = _ref15.textStyle,
|
|
@@ -446,6 +447,14 @@ var KeypadScreen = function KeypadScreen(_ref) {
|
|
|
446
447
|
var _ref18 = content || {},
|
|
447
448
|
_ref18$body = _ref18.body,
|
|
448
449
|
contentBody = _ref18$body === void 0 ? null : _ref18$body;
|
|
450
|
+
var finalLabel = isString(itemLabel) ? {
|
|
451
|
+
body: itemLabel
|
|
452
|
+
} : itemLabel || {};
|
|
453
|
+
var _ref19 = finalLabel || {},
|
|
454
|
+
_ref19$body = _ref19.body,
|
|
455
|
+
label = _ref19$body === void 0 ? null : _ref19$body,
|
|
456
|
+
_ref19$buttonStyle = _ref19.buttonStyle,
|
|
457
|
+
labelButtonStyle = _ref19$buttonStyle === void 0 ? null : _ref19$buttonStyle;
|
|
449
458
|
var key = label || visualUrl || id;
|
|
450
459
|
var isEmpty = label === null && visual === null;
|
|
451
460
|
var isExternalLink = url !== null && !inWebView;
|
|
@@ -455,7 +464,7 @@ var KeypadScreen = function KeypadScreen(_ref) {
|
|
|
455
464
|
className: styles.item
|
|
456
465
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
457
466
|
className: classNames([styles.button, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.layoutLabelBottom, buttonLayout === 'label-bottom'), styles.layoutLabelTop, buttonLayout === 'label-top'), styles.layoutNoLabel, buttonLayout === 'no-label'), styles.layoutLabelOver, buttonLayout === 'label-over'), styles.fillImage, fillImage === true), styles.isEmpty, isEmpty), styles.isLink, url !== null), styles.disableHover, isPopupEmpty && url === null)]),
|
|
458
|
-
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getStyleFromBox(buttonBoxStyle)), getStyleFromText(buttonTextStyle)), getStyleFromBox(boxStyle)), getStyleFromText(textStyle)), getStyleFromAlignment(alignment || buttonAlignment, true, 'flex-start')),
|
|
467
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, getStyleFromBox(buttonBoxStyle)), getStyleFromText(buttonTextStyle)), getStyleFromBox(labelButtonStyle || boxStyle)), getStyleFromText(textStyle)), getStyleFromAlignment(alignment || buttonAlignment, true, 'flex-start')),
|
|
459
468
|
external: isExternalLink,
|
|
460
469
|
href: isExternalLink ? url : null,
|
|
461
470
|
focusable: current,
|
|
@@ -488,9 +497,9 @@ var KeypadScreen = function KeypadScreen(_ref) {
|
|
|
488
497
|
}),
|
|
489
498
|
emptyClassName: classNames([styles.empty, styles.emptyButtonLabel]),
|
|
490
499
|
isEmpty: label === null
|
|
491
|
-
}, label !== null || !isInteractivePreview ? /*#__PURE__*/React.createElement(
|
|
500
|
+
}, label !== null || !isInteractivePreview ? /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
492
501
|
className: styles.buttonLabel
|
|
493
|
-
},
|
|
502
|
+
}, finalLabel)) : null)));
|
|
494
503
|
});
|
|
495
504
|
}, [items, screenState, keypadSettings, buttonAlignment, buttonBoxStyle, buttonTextStyle, buttonLayout]);
|
|
496
505
|
useEffect(function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-keypad",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.659",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -65,22 +65,22 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@babel/runtime": "^7.13.10",
|
|
68
|
-
"@micromag/core": "^0.3.
|
|
69
|
-
"@micromag/element-background": "^0.3.
|
|
70
|
-
"@micromag/element-button": "^0.3.
|
|
71
|
-
"@micromag/element-call-to-action": "^0.3.
|
|
72
|
-
"@micromag/element-container": "^0.3.
|
|
73
|
-
"@micromag/element-footer": "^0.3.
|
|
74
|
-
"@micromag/element-grid": "^0.3.
|
|
75
|
-
"@micromag/element-header": "^0.3.
|
|
76
|
-
"@micromag/element-heading": "^0.3.
|
|
77
|
-
"@micromag/element-keypad": "^0.3.
|
|
78
|
-
"@micromag/element-layout": "^0.3.
|
|
79
|
-
"@micromag/element-scroll": "^0.3.
|
|
80
|
-
"@micromag/element-text": "^0.3.
|
|
81
|
-
"@micromag/element-urbania-author": "^0.3.
|
|
82
|
-
"@micromag/element-visual": "^0.3.
|
|
83
|
-
"@micromag/transforms": "^0.3.
|
|
68
|
+
"@micromag/core": "^0.3.659",
|
|
69
|
+
"@micromag/element-background": "^0.3.659",
|
|
70
|
+
"@micromag/element-button": "^0.3.659",
|
|
71
|
+
"@micromag/element-call-to-action": "^0.3.659",
|
|
72
|
+
"@micromag/element-container": "^0.3.659",
|
|
73
|
+
"@micromag/element-footer": "^0.3.659",
|
|
74
|
+
"@micromag/element-grid": "^0.3.659",
|
|
75
|
+
"@micromag/element-header": "^0.3.659",
|
|
76
|
+
"@micromag/element-heading": "^0.3.659",
|
|
77
|
+
"@micromag/element-keypad": "^0.3.659",
|
|
78
|
+
"@micromag/element-layout": "^0.3.659",
|
|
79
|
+
"@micromag/element-scroll": "^0.3.659",
|
|
80
|
+
"@micromag/element-text": "^0.3.659",
|
|
81
|
+
"@micromag/element-urbania-author": "^0.3.659",
|
|
82
|
+
"@micromag/element-visual": "^0.3.659",
|
|
83
|
+
"@micromag/transforms": "^0.3.659",
|
|
84
84
|
"@react-spring/core": "^9.6.1",
|
|
85
85
|
"@react-spring/web": "^9.6.1",
|
|
86
86
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"access": "public",
|
|
96
96
|
"registry": "https://registry.npmjs.org/"
|
|
97
97
|
},
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "7c13dad69a7e377cd2f900d95cb95694a3a8fcbb"
|
|
99
99
|
}
|