@micromag/screen-ranking 0.3.595 → 0.3.599
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 +64 -16
- package/package.json +13 -13
package/es/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormattedMessage, defineMessage } from 'react-intl';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
@@ -25,6 +26,8 @@ var propTypes = {
|
|
|
25
26
|
layout: PropTypes.oneOf(['side', 'over']),
|
|
26
27
|
title: PropTypes$1.headingElement,
|
|
27
28
|
items: PropTypes.arrayOf(PropTypes$1.textElement),
|
|
29
|
+
itemTitleStyle: PropTypes$1.textStyle,
|
|
30
|
+
itemDescriptionStyle: PropTypes$1.textStyle,
|
|
28
31
|
numbersStyle: PropTypes$1.textStyle,
|
|
29
32
|
ascending: PropTypes.bool,
|
|
30
33
|
spacing: PropTypes.number,
|
|
@@ -40,6 +43,8 @@ var defaultProps = {
|
|
|
40
43
|
layout: 'side',
|
|
41
44
|
title: null,
|
|
42
45
|
items: [null],
|
|
46
|
+
itemTitleStyle: null,
|
|
47
|
+
itemDescriptionStyle: null,
|
|
43
48
|
numbersStyle: null,
|
|
44
49
|
ascending: false,
|
|
45
50
|
spacing: 20,
|
|
@@ -55,6 +60,8 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
55
60
|
var layout = _ref.layout,
|
|
56
61
|
title = _ref.title,
|
|
57
62
|
items = _ref.items,
|
|
63
|
+
itemTitleStyle = _ref.itemTitleStyle,
|
|
64
|
+
itemDescriptionStyle = _ref.itemDescriptionStyle,
|
|
58
65
|
numbersStyle = _ref.numbersStyle,
|
|
59
66
|
ascending = _ref.ascending,
|
|
60
67
|
spacing = _ref.spacing,
|
|
@@ -117,6 +124,12 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
117
124
|
description = _ref2$description === void 0 ? null : _ref2$description;
|
|
118
125
|
var hasItemTitle = isTextFilled(itemTitle);
|
|
119
126
|
var hasDescription = isTextFilled(description);
|
|
127
|
+
var _ref3 = itemTitle || {},
|
|
128
|
+
_ref3$textStyle = _ref3.textStyle,
|
|
129
|
+
titleTextStyle = _ref3$textStyle === void 0 ? null : _ref3$textStyle;
|
|
130
|
+
var _ref4 = description || {},
|
|
131
|
+
_ref4$textStyle = _ref4.textStyle,
|
|
132
|
+
descriptionTextStyle = _ref4$textStyle === void 0 ? null : _ref4$textStyle;
|
|
120
133
|
var itemTitleElement = /*#__PURE__*/React.createElement("div", {
|
|
121
134
|
className: styles.itemTitle
|
|
122
135
|
}, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
@@ -130,7 +143,9 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
130
143
|
}),
|
|
131
144
|
emptyClassName: styles.empty,
|
|
132
145
|
isEmpty: !hasItemTitle
|
|
133
|
-
}, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, itemTitle
|
|
146
|
+
}, hasItemTitle ? /*#__PURE__*/React.createElement(Heading, Object.assign({}, itemTitle, {
|
|
147
|
+
textStyle: _objectSpread(_objectSpread({}, itemTitleStyle || null), titleTextStyle)
|
|
148
|
+
})) : null));
|
|
134
149
|
var descriptionElement = /*#__PURE__*/React.createElement("div", {
|
|
135
150
|
className: styles.description
|
|
136
151
|
}, /*#__PURE__*/React.createElement(ScreenElement, {
|
|
@@ -144,7 +159,9 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
144
159
|
}),
|
|
145
160
|
emptyClassName: styles.empty,
|
|
146
161
|
isEmpty: !hasDescription
|
|
147
|
-
}, hasDescription ? /*#__PURE__*/React.createElement(Text, description
|
|
162
|
+
}, hasDescription ? /*#__PURE__*/React.createElement(Text, Object.assign({}, description, {
|
|
163
|
+
textStyle: _objectSpread(_objectSpread({}, itemDescriptionStyle || null), descriptionTextStyle)
|
|
164
|
+
})) : null));
|
|
148
165
|
var rankText = "".concat(ascending ? itemI + 1 : itemsCount - itemI);
|
|
149
166
|
return /*#__PURE__*/React.createElement("div", {
|
|
150
167
|
className: styles.item,
|
|
@@ -178,8 +195,8 @@ var RankingScreen = function RankingScreen(_ref) {
|
|
|
178
195
|
footerRef = _useDimensionObserver.ref,
|
|
179
196
|
_useDimensionObserver2 = _useDimensionObserver.height,
|
|
180
197
|
foterHeight = _useDimensionObserver2 === void 0 ? 0 : _useDimensionObserver2;
|
|
181
|
-
var onScrolledBottom = useCallback(function (
|
|
182
|
-
var initial =
|
|
198
|
+
var onScrolledBottom = useCallback(function (_ref5) {
|
|
199
|
+
var initial = _ref5.initial;
|
|
183
200
|
if (initial) {
|
|
184
201
|
trackScreenEvent('scroll', 'Screen');
|
|
185
202
|
}
|
|
@@ -312,26 +329,57 @@ var definition = {
|
|
|
312
329
|
}]
|
|
313
330
|
})
|
|
314
331
|
}, {
|
|
315
|
-
|
|
316
|
-
type: 'toggle',
|
|
332
|
+
type: 'fields',
|
|
317
333
|
label: defineMessage({
|
|
318
|
-
id: "
|
|
334
|
+
id: "xac4z/",
|
|
319
335
|
defaultMessage: [{
|
|
320
336
|
"type": 0,
|
|
321
|
-
"value": "
|
|
337
|
+
"value": "Entry styles"
|
|
322
338
|
}]
|
|
323
|
-
})
|
|
339
|
+
}),
|
|
340
|
+
isList: true,
|
|
341
|
+
fields: [{
|
|
342
|
+
name: 'itemTitleStyle',
|
|
343
|
+
type: 'text-style-form',
|
|
344
|
+
label: defineMessage({
|
|
345
|
+
id: "+AEVbJ",
|
|
346
|
+
defaultMessage: [{
|
|
347
|
+
"type": 0,
|
|
348
|
+
"value": "Title"
|
|
349
|
+
}]
|
|
350
|
+
})
|
|
351
|
+
}, {
|
|
352
|
+
name: 'itemDescriptionStyle',
|
|
353
|
+
type: 'text-style-form',
|
|
354
|
+
label: defineMessage({
|
|
355
|
+
id: "ZCe0r4",
|
|
356
|
+
defaultMessage: [{
|
|
357
|
+
"type": 0,
|
|
358
|
+
"value": "Description"
|
|
359
|
+
}]
|
|
360
|
+
})
|
|
361
|
+
}, {
|
|
362
|
+
name: 'numbersStyle',
|
|
363
|
+
type: 'text-style-form',
|
|
364
|
+
theme: {
|
|
365
|
+
textStyle: 'heading1'
|
|
366
|
+
},
|
|
367
|
+
label: defineMessage({
|
|
368
|
+
id: "UdrdRF",
|
|
369
|
+
defaultMessage: [{
|
|
370
|
+
"type": 0,
|
|
371
|
+
"value": "Numbers style"
|
|
372
|
+
}]
|
|
373
|
+
})
|
|
374
|
+
}]
|
|
324
375
|
}, {
|
|
325
|
-
name: '
|
|
326
|
-
type: '
|
|
327
|
-
theme: {
|
|
328
|
-
textStyle: 'heading1'
|
|
329
|
-
},
|
|
376
|
+
name: 'ascending',
|
|
377
|
+
type: 'toggle',
|
|
330
378
|
label: defineMessage({
|
|
331
|
-
id: "
|
|
379
|
+
id: "9DhYaZ",
|
|
332
380
|
defaultMessage: [{
|
|
333
381
|
"type": 0,
|
|
334
|
-
"value": "
|
|
382
|
+
"value": "Ascending"
|
|
335
383
|
}]
|
|
336
384
|
})
|
|
337
385
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/screen-ranking",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.599",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -60,17 +60,17 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.13.10",
|
|
63
|
-
"@micromag/core": "^0.3.
|
|
64
|
-
"@micromag/data": "^0.3.
|
|
65
|
-
"@micromag/element-background": "^0.3.
|
|
66
|
-
"@micromag/element-container": "^0.3.
|
|
67
|
-
"@micromag/element-footer": "^0.3.
|
|
68
|
-
"@micromag/element-header": "^0.3.
|
|
69
|
-
"@micromag/element-heading": "^0.3.
|
|
70
|
-
"@micromag/element-layout": "^0.3.
|
|
71
|
-
"@micromag/element-scroll": "^0.3.
|
|
72
|
-
"@micromag/element-text": "^0.3.
|
|
73
|
-
"@micromag/transforms": "^0.3.
|
|
63
|
+
"@micromag/core": "^0.3.599",
|
|
64
|
+
"@micromag/data": "^0.3.599",
|
|
65
|
+
"@micromag/element-background": "^0.3.599",
|
|
66
|
+
"@micromag/element-container": "^0.3.599",
|
|
67
|
+
"@micromag/element-footer": "^0.3.599",
|
|
68
|
+
"@micromag/element-header": "^0.3.599",
|
|
69
|
+
"@micromag/element-heading": "^0.3.599",
|
|
70
|
+
"@micromag/element-layout": "^0.3.599",
|
|
71
|
+
"@micromag/element-scroll": "^0.3.599",
|
|
72
|
+
"@micromag/element-text": "^0.3.599",
|
|
73
|
+
"@micromag/transforms": "^0.3.599",
|
|
74
74
|
"classnames": "^2.2.6",
|
|
75
75
|
"lodash": "^4.17.21",
|
|
76
76
|
"prop-types": "^15.7.2",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"access": "public",
|
|
82
82
|
"registry": "https://registry.npmjs.org/"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "406f96c799c4be116e64ed13bebc9151e3d38c95"
|
|
85
85
|
}
|