@steroidsjs/bootstrap 3.0.0-beta.97 → 3.0.0-beta.98
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/content/Chart/ChartView.d.ts +2 -0
- package/content/Chart/ChartView.js +47 -0
- package/content/Chart/ChartView.scss +8 -0
- package/form/CheckboxListField/CheckboxListFieldView.js +7 -7
- package/form/RadioField/RadioFieldView.js +1 -1
- package/form/RadioListField/RadioListFieldView.js +6 -8
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
19
|
+
var DEFAULT_AXIS_PARAMS = {
|
|
20
|
+
tickSize: 5,
|
|
21
|
+
tickPadding: 5,
|
|
22
|
+
tickRotation: 0,
|
|
23
|
+
legend: '',
|
|
24
|
+
legendPosition: 'middle'
|
|
25
|
+
};
|
|
26
|
+
var DEFAULT_LINE_CHART_CONFIG = {
|
|
27
|
+
yScale: {
|
|
28
|
+
type: 'linear',
|
|
29
|
+
min: 'auto',
|
|
30
|
+
max: 'auto',
|
|
31
|
+
stacked: true,
|
|
32
|
+
reverse: false
|
|
33
|
+
},
|
|
34
|
+
xScale: { type: 'point' },
|
|
35
|
+
axisBottom: __assign(__assign({}, DEFAULT_AXIS_PARAMS), { legendOffset: 36 }),
|
|
36
|
+
axisLeft: __assign(__assign({}, DEFAULT_AXIS_PARAMS), { legendOffset: -40 }),
|
|
37
|
+
pointSize: 8,
|
|
38
|
+
useMesh: true
|
|
39
|
+
};
|
|
40
|
+
function ChartView(props) {
|
|
41
|
+
var bem = (0, hooks_1.useBem)('ChartView');
|
|
42
|
+
var ChartComponent = props.chartComponent;
|
|
43
|
+
var defaultChartConfig = (props.useDefaultLineChartConfig && DEFAULT_LINE_CHART_CONFIG) || {};
|
|
44
|
+
return (react_1["default"].createElement("div", { className: bem(bem.block(), props.className), style: __assign({ height: "".concat(props.height, "px") }, props.style) },
|
|
45
|
+
react_1["default"].createElement(ChartComponent, __assign({ data: props.data }, defaultChartConfig, props.config))));
|
|
46
|
+
}
|
|
47
|
+
exports["default"] = ChartView;
|
|
@@ -36,19 +36,19 @@ function CheckboxListFieldView(props) {
|
|
|
36
36
|
return (React.createElement("div", { className: bem(bem.block((_a = {},
|
|
37
37
|
_a["".concat(props.orientation)] = !!props.orientation,
|
|
38
38
|
_a))) }, props.items.map(function (checkbox, checkboxIndex) { return props.renderCheckbox({
|
|
39
|
+
key: checkboxIndex,
|
|
40
|
+
id: "".concat(prefix, "_").concat(checkbox.id),
|
|
41
|
+
label: checkbox.label,
|
|
39
42
|
inputProps: {
|
|
40
43
|
name: "".concat(prefix, "_").concat(checkbox.id),
|
|
41
|
-
checked: null,
|
|
42
44
|
type: 'checkbox',
|
|
43
|
-
|
|
45
|
+
checked: props.selectedIds.includes(checkbox.id),
|
|
44
46
|
onChange: function () {
|
|
45
47
|
props.onItemSelect(checkbox.id);
|
|
46
|
-
}
|
|
48
|
+
},
|
|
49
|
+
disabled: props.disabled
|
|
47
50
|
},
|
|
48
|
-
|
|
49
|
-
label: checkbox.label,
|
|
50
|
-
id: "".concat(prefix, "_").concat(checkbox.id),
|
|
51
|
-
key: checkboxIndex
|
|
51
|
+
size: props.size
|
|
52
52
|
}); })));
|
|
53
53
|
}
|
|
54
54
|
exports["default"] = CheckboxListFieldView;
|
|
@@ -49,7 +49,7 @@ function RadioFieldView(props) {
|
|
|
49
49
|
}), props.className), onClick: props.onChange },
|
|
50
50
|
React.createElement("input", __assign({ className: bem(bem.element('input', {
|
|
51
51
|
checked: props.checked
|
|
52
|
-
})), id: props.id || id }, props.inputProps, {
|
|
52
|
+
})), id: props.id || id }, props.inputProps, { disabled: props.disabled, required: props.required })),
|
|
53
53
|
React.createElement("label", { className: bem.element('label'), htmlFor: props.id || id },
|
|
54
54
|
React.createElement("span", { className: bem.element('ellipse') }),
|
|
55
55
|
props.label)));
|
|
@@ -36,20 +36,18 @@ function RadioListFieldView(props) {
|
|
|
36
36
|
return (React.createElement("div", { className: bem(bem.block((_a = {},
|
|
37
37
|
_a["".concat(props.orientation)] = !!props.orientation,
|
|
38
38
|
_a)), props.className) }, props.items.map(function (radio, radioIndex) { return props.renderRadio({
|
|
39
|
+
key: radioIndex,
|
|
40
|
+
id: "".concat(prefix, "_").concat(radio.id),
|
|
41
|
+
label: radio.label,
|
|
39
42
|
inputProps: {
|
|
40
43
|
name: "".concat(prefix, "_").concat(radio.id),
|
|
41
|
-
checked: null,
|
|
42
44
|
type: 'radio',
|
|
43
|
-
|
|
45
|
+
checked: props.selectedIds.includes(radio.id),
|
|
44
46
|
onChange: function () {
|
|
45
47
|
props.onItemSelect(radio.id);
|
|
46
|
-
}
|
|
48
|
+
},
|
|
49
|
+
disabled: props.disabled
|
|
47
50
|
},
|
|
48
|
-
disabled: props.disabled,
|
|
49
|
-
checked: props.selectedIds.includes(radio.id),
|
|
50
|
-
label: radio.label,
|
|
51
|
-
id: "".concat(prefix, "_").concat(radio.id),
|
|
52
|
-
key: radioIndex,
|
|
53
51
|
size: props.size
|
|
54
52
|
}); })));
|
|
55
53
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -38,6 +38,9 @@ exports["default"] = {
|
|
|
38
38
|
'content.CopyToClipboardView': {
|
|
39
39
|
lazy: function () { return require('./content/CopyToClipboard/CopyToClipboardView')["default"]; }
|
|
40
40
|
},
|
|
41
|
+
'content.ChartView': {
|
|
42
|
+
lazy: function () { return require('./content/Chart/ChartView')["default"]; }
|
|
43
|
+
},
|
|
41
44
|
'content.SliderView': {
|
|
42
45
|
lazy: function () { return require('./content/Slider/SliderView')["default"]; }
|
|
43
46
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.98",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-use": "^17.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.
|
|
40
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.82",
|
|
41
41
|
"@steroidsjs/eslint-config": "^2.1.4",
|
|
42
42
|
"@types/enzyme": "^3.10.8",
|
|
43
43
|
"@types/googlemaps": "^3.43.3",
|