@itcase/ui 1.0.84 → 1.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/Cell.js
CHANGED
|
@@ -5,6 +5,7 @@ var PropTypes = require('prop-types');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var index$1 = require('./Icon.js');
|
|
7
7
|
var index = require('./Text.js');
|
|
8
|
+
var index$2 = require('./Label.js');
|
|
8
9
|
var size = require('../constants/componentProps/size.js');
|
|
9
10
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
10
11
|
require('react-inlinesvg');
|
|
@@ -31,6 +32,7 @@ require('../constants/componentProps/shape.js');
|
|
|
31
32
|
require('../constants/componentProps/strokeColor.js');
|
|
32
33
|
require('../constants/componentProps/textColorActive.js');
|
|
33
34
|
require('../constants/componentProps/textColorHover.js');
|
|
35
|
+
require('../constants/componentProps/textAlign.js');
|
|
34
36
|
require('lodash/castArray');
|
|
35
37
|
|
|
36
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -42,18 +44,24 @@ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
|
42
44
|
function Cell(props) {
|
|
43
45
|
const {
|
|
44
46
|
className,
|
|
45
|
-
|
|
46
|
-
titleIconSize,
|
|
47
|
-
titleIconSrc,
|
|
48
|
-
titleIconBgFill,
|
|
47
|
+
isShowTitleIcon,
|
|
49
48
|
titleIconFill,
|
|
49
|
+
titleIconFillSize,
|
|
50
|
+
titleIconIconFill,
|
|
51
|
+
titleIconFillHover,
|
|
50
52
|
titleIconStroke,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
titleIconSrc,
|
|
54
|
+
titleIconShape,
|
|
55
|
+
titleIcon,
|
|
56
|
+
isShowValueIcon,
|
|
55
57
|
valueIconFill,
|
|
58
|
+
valueIconFillSize,
|
|
59
|
+
valueIconIconFill,
|
|
60
|
+
valueIconFillHover,
|
|
56
61
|
valueIconStroke,
|
|
62
|
+
valueIconSrc,
|
|
63
|
+
valueIconShape,
|
|
64
|
+
valueIcon,
|
|
57
65
|
isActive,
|
|
58
66
|
isDisabled,
|
|
59
67
|
set,
|
|
@@ -70,6 +78,21 @@ function Cell(props) {
|
|
|
70
78
|
titleTextSize,
|
|
71
79
|
titleTextColor,
|
|
72
80
|
titleTextWeight,
|
|
81
|
+
isShowTitleLabel,
|
|
82
|
+
titleLabelAppearance,
|
|
83
|
+
titleLabel,
|
|
84
|
+
titleLabelTextSize,
|
|
85
|
+
titleLabelShape,
|
|
86
|
+
titleLabelSize,
|
|
87
|
+
isShowValueLabel,
|
|
88
|
+
valueLabelAppearance,
|
|
89
|
+
valueLabel,
|
|
90
|
+
valueLabelTextSize,
|
|
91
|
+
valueLabelShape,
|
|
92
|
+
valueLabelSize,
|
|
93
|
+
isZeroPadding,
|
|
94
|
+
isZeroGap,
|
|
95
|
+
isReverse,
|
|
73
96
|
onClick,
|
|
74
97
|
onMouseEnter
|
|
75
98
|
} = props;
|
|
@@ -122,7 +145,7 @@ function Cell(props) {
|
|
|
122
145
|
propsKey: 'width'
|
|
123
146
|
});
|
|
124
147
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
125
|
-
className: clsx__default.default(className, 'cell', size && `cell_size_${size}`, set && `cell_set_${set}`, bgFillClass, bgFillHoverClass, isActive && bgFillActiveClass, isDisabled && bgFillDisabledClass, bgShapeClass, widthClass),
|
|
148
|
+
className: clsx__default.default(className, 'cell', size && `cell_size_${size}`, set && `cell_set_${set}`, bgFillClass, bgFillHoverClass, isActive && bgFillActiveClass, isDisabled && bgFillDisabledClass, bgShapeClass, widthClass, isZeroPadding && 'cell_reset-padding', isZeroGap && 'cell_reset-gap', isReverse && 'cell_reverse'),
|
|
126
149
|
onClick: onClick,
|
|
127
150
|
onMouseEnter: onMouseEnter
|
|
128
151
|
}, before && /*#__PURE__*/React__default.default.createElement("div", {
|
|
@@ -137,14 +160,22 @@ function Cell(props) {
|
|
|
137
160
|
tag: titleTag,
|
|
138
161
|
textColor: titleTextColor,
|
|
139
162
|
textWeight: titleTextWeight
|
|
140
|
-
}, title),
|
|
141
|
-
bgFill: titleIconBgFill,
|
|
163
|
+
}, title), isShowTitleIcon && /*#__PURE__*/React__default.default.createElement(index$1.Icon, {
|
|
142
164
|
className: "cell__icon",
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
fill: titleIconFill,
|
|
166
|
+
fillSize: titleIconFillSize,
|
|
167
|
+
iconFill: titleIconIconFill,
|
|
168
|
+
iconFillHover: titleIconFillHover,
|
|
145
169
|
iconStroke: titleIconStroke,
|
|
146
170
|
imageSrc: titleIconSrc,
|
|
171
|
+
shape: titleIconShape,
|
|
147
172
|
SvgImage: titleIcon
|
|
173
|
+
}), isShowTitleLabel && /*#__PURE__*/React__default.default.createElement(index$2.Label, {
|
|
174
|
+
appearance: titleLabelAppearance,
|
|
175
|
+
label: titleLabel,
|
|
176
|
+
labelTextSize: titleLabelTextSize,
|
|
177
|
+
shape: titleLabelShape,
|
|
178
|
+
size: titleLabelSize
|
|
148
179
|
})), value && /*#__PURE__*/React__default.default.createElement("div", {
|
|
149
180
|
className: "cell__data"
|
|
150
181
|
}, /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
@@ -153,14 +184,22 @@ function Cell(props) {
|
|
|
153
184
|
tag: valueTag,
|
|
154
185
|
textColor: valueTextColor,
|
|
155
186
|
textWeight: valueTextWeight
|
|
156
|
-
}, value),
|
|
157
|
-
bgFill: valueIconBgFill,
|
|
187
|
+
}, value), isShowValueIcon && /*#__PURE__*/React__default.default.createElement(index$1.Icon, {
|
|
158
188
|
className: "cell__icon",
|
|
159
|
-
|
|
160
|
-
|
|
189
|
+
fill: valueIconFill,
|
|
190
|
+
fillSize: valueIconFillSize,
|
|
191
|
+
iconFill: valueIconIconFill,
|
|
192
|
+
iconFillHover: valueIconFillHover,
|
|
161
193
|
iconStroke: valueIconStroke,
|
|
162
194
|
imageSrc: valueIconSrc,
|
|
195
|
+
shape: valueIconShape,
|
|
163
196
|
SvgImage: valueIcon
|
|
197
|
+
}), isShowValueLabel && /*#__PURE__*/React__default.default.createElement(index$2.Label, {
|
|
198
|
+
appearance: valueLabelAppearance,
|
|
199
|
+
label: valueLabel,
|
|
200
|
+
labelTextSize: valueLabelTextSize,
|
|
201
|
+
shape: valueLabelShape,
|
|
202
|
+
size: valueLabelSize
|
|
164
203
|
}))), after && /*#__PURE__*/React__default.default.createElement("div", {
|
|
165
204
|
className: "cell__after"
|
|
166
205
|
}, after));
|
|
@@ -171,14 +210,10 @@ Cell.propTypes = {
|
|
|
171
210
|
children: PropTypes__default.default.any,
|
|
172
211
|
className: PropTypes__default.default.string,
|
|
173
212
|
titleIcon: PropTypes__default.default.any,
|
|
174
|
-
titleIconBgFill: PropTypes__default.default.string,
|
|
175
213
|
titleIconFill: PropTypes__default.default.string,
|
|
176
|
-
titleIconSize: PropTypes__default.default.string,
|
|
177
214
|
titleIconStroke: PropTypes__default.default.string,
|
|
178
215
|
valueIcon: PropTypes__default.default.any,
|
|
179
|
-
valueIconBgFill: PropTypes__default.default.string,
|
|
180
216
|
valueIconFill: PropTypes__default.default.string,
|
|
181
|
-
valueIconSize: PropTypes__default.default.string,
|
|
182
217
|
valueIconStroke: PropTypes__default.default.string,
|
|
183
218
|
isActive: PropTypes__default.default.bool,
|
|
184
219
|
isDisabled: PropTypes__default.default.bool,
|
|
@@ -253,13 +288,6 @@ Cell.__docgenInfo = {
|
|
|
253
288
|
},
|
|
254
289
|
"required": false
|
|
255
290
|
},
|
|
256
|
-
"titleIconBgFill": {
|
|
257
|
-
"description": "",
|
|
258
|
-
"type": {
|
|
259
|
-
"name": "string"
|
|
260
|
-
},
|
|
261
|
-
"required": false
|
|
262
|
-
},
|
|
263
291
|
"titleIconFill": {
|
|
264
292
|
"description": "",
|
|
265
293
|
"type": {
|
|
@@ -267,13 +295,6 @@ Cell.__docgenInfo = {
|
|
|
267
295
|
},
|
|
268
296
|
"required": false
|
|
269
297
|
},
|
|
270
|
-
"titleIconSize": {
|
|
271
|
-
"description": "",
|
|
272
|
-
"type": {
|
|
273
|
-
"name": "string"
|
|
274
|
-
},
|
|
275
|
-
"required": false
|
|
276
|
-
},
|
|
277
298
|
"titleIconStroke": {
|
|
278
299
|
"description": "",
|
|
279
300
|
"type": {
|
|
@@ -288,13 +309,6 @@ Cell.__docgenInfo = {
|
|
|
288
309
|
},
|
|
289
310
|
"required": false
|
|
290
311
|
},
|
|
291
|
-
"valueIconBgFill": {
|
|
292
|
-
"description": "",
|
|
293
|
-
"type": {
|
|
294
|
-
"name": "string"
|
|
295
|
-
},
|
|
296
|
-
"required": false
|
|
297
|
-
},
|
|
298
312
|
"valueIconFill": {
|
|
299
313
|
"description": "",
|
|
300
314
|
"type": {
|
|
@@ -302,13 +316,6 @@ Cell.__docgenInfo = {
|
|
|
302
316
|
},
|
|
303
317
|
"required": false
|
|
304
318
|
},
|
|
305
|
-
"valueIconSize": {
|
|
306
|
-
"description": "",
|
|
307
|
-
"type": {
|
|
308
|
-
"name": "string"
|
|
309
|
-
},
|
|
310
|
-
"required": false
|
|
311
|
-
},
|
|
312
319
|
"valueIconStroke": {
|
|
313
320
|
"description": "",
|
|
314
321
|
"type": {
|
|
@@ -85,8 +85,8 @@ function NotificationItem(props) {
|
|
|
85
85
|
size: textSize,
|
|
86
86
|
textColor: textColor || notificationItemConfig.appearance[appearance] && notificationItemConfig.appearance[appearance].textColor.replace(/([A-Z])/g, '-$1').toLowerCase()
|
|
87
87
|
}, text), closeButton && /*#__PURE__*/React__default.default.createElement("div", {
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
className: clsx__default.default('notification__item-close', onClickClose && 'cursor_type_pointer'),
|
|
89
|
+
onClick: () => onClickClose && onClickClose(id)
|
|
90
90
|
}, closeButton)), after);
|
|
91
91
|
}
|
|
92
92
|
NotificationItem.propTypes = {
|
|
@@ -16,12 +16,24 @@
|
|
|
16
16
|
&_vertical {
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
|
+
gap: var(--cell-vertical-gap, 4px);
|
|
19
20
|
}
|
|
20
21
|
&_horizontal {
|
|
21
22
|
display: flex;
|
|
22
23
|
flex-direction: row;
|
|
23
24
|
justify-content: space-between;
|
|
24
|
-
gap: 20px;
|
|
25
|
+
gap: var(--cell-horizontal-gap, 20px);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.cell {
|
|
31
|
+
&_size {
|
|
32
|
+
@each $size in s, m, l, xl {
|
|
33
|
+
&_$(size) {
|
|
34
|
+
^^&__wrapper {
|
|
35
|
+
padding: var(--cell-size-$(size)-padding);
|
|
36
|
+
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
27
39
|
}
|
|
@@ -39,3 +51,30 @@
|
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
}
|
|
54
|
+
.cell {
|
|
55
|
+
&_reset-gap {
|
|
56
|
+
^&__wrapper {
|
|
57
|
+
gap: 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.cell {
|
|
62
|
+
&_reset-padding {
|
|
63
|
+
^&__wrapper {
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.cell {
|
|
69
|
+
&_reverse {
|
|
70
|
+
^&__wrapper {
|
|
71
|
+
flex-direction: column-reverse;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
:root {
|
|
76
|
+
--cell-size-s-padding: 6px;
|
|
77
|
+
--cell-size-m-padding: 6px;
|
|
78
|
+
--cell-size-l-padding: 6px;
|
|
79
|
+
--cell-size-xl-padding: 12px;
|
|
80
|
+
}
|