@cashub/ui 0.13.1 → 0.13.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.
- package/chart/BarChart.js +23 -11
- package/chart/DoughnutChart.js +20 -9
- package/chart/LineChart.js +20 -9
- package/package.json +1 -1
- package/select/Select.js +2 -2
package/chart/BarChart.js
CHANGED
|
@@ -17,14 +17,29 @@ var _padEmptyChartBar = _interopRequireDefault(require("./utils/padEmptyChartBar
|
|
|
17
17
|
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
|
|
20
|
+
var _excluded = ["height", "data", "options"];
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
+
|
|
28
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
|
|
22
34
|
var BarChart = function BarChart(_ref) {
|
|
23
35
|
var _ref$height = _ref.height,
|
|
24
36
|
height = _ref$height === void 0 ? 300 : _ref$height,
|
|
25
37
|
data = _ref.data,
|
|
26
38
|
_ref$options = _ref.options,
|
|
27
|
-
options = _ref$options === void 0 ? {} : _ref$options
|
|
39
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
40
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
|
|
42
|
+
var chartRef = (0, _react.useRef)();
|
|
28
43
|
var theme = (0, _react.useContext)(_styledComponents.ThemeContext); // fix: read value from theme
|
|
29
44
|
|
|
30
45
|
_reactChartjs.defaults.font.family = theme.fontFamily;
|
|
@@ -114,16 +129,13 @@ var BarChart = function BarChart(_ref) {
|
|
|
114
129
|
}
|
|
115
130
|
};
|
|
116
131
|
}, [customOptions, theme.fontOnPrimary]);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
125
|
-
}, [height, data, defaultOptions]);
|
|
126
|
-
return Chart;
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Bar, _objectSpread({
|
|
133
|
+
ref: chartRef,
|
|
134
|
+
height: height,
|
|
135
|
+
data: data,
|
|
136
|
+
options: defaultOptions,
|
|
137
|
+
plugins: [_padEmptyChartBar.default]
|
|
138
|
+
}, props));
|
|
127
139
|
};
|
|
128
140
|
|
|
129
141
|
var _default = BarChart;
|
package/chart/DoughnutChart.js
CHANGED
|
@@ -15,12 +15,26 @@ var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
|
|
|
15
15
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
|
|
18
|
+
var _excluded = ["height", "data"];
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
20
32
|
var DoughnutChart = function DoughnutChart(_ref) {
|
|
21
33
|
var _ref$height = _ref.height,
|
|
22
34
|
height = _ref$height === void 0 ? 300 : _ref$height,
|
|
23
|
-
data = _ref.data
|
|
35
|
+
data = _ref.data,
|
|
36
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
37
|
+
|
|
24
38
|
var theme = (0, _react.useContext)(_styledComponents.ThemeContext); // fix: read value from theme
|
|
25
39
|
|
|
26
40
|
_reactChartjs.defaults.font.family = theme.fontFamily;
|
|
@@ -45,14 +59,11 @@ var DoughnutChart = function DoughnutChart(_ref) {
|
|
|
45
59
|
}
|
|
46
60
|
};
|
|
47
61
|
}, []);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
});
|
|
54
|
-
}, [height, data, defaultOptions]);
|
|
55
|
-
return Chart;
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Doughnut, _objectSpread({
|
|
63
|
+
height: height,
|
|
64
|
+
data: data,
|
|
65
|
+
options: defaultOptions
|
|
66
|
+
}, props));
|
|
56
67
|
};
|
|
57
68
|
|
|
58
69
|
var _default = DoughnutChart;
|
package/chart/LineChart.js
CHANGED
|
@@ -15,14 +15,28 @@ var _customTooltip = _interopRequireDefault(require("./utils/customTooltip"));
|
|
|
15
15
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
|
|
18
|
+
var _excluded = ["height", "data", "options"];
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
20
32
|
var LineChart = function LineChart(_ref) {
|
|
21
33
|
var _ref$height = _ref.height,
|
|
22
34
|
height = _ref$height === void 0 ? 300 : _ref$height,
|
|
23
35
|
data = _ref.data,
|
|
24
36
|
_ref$options = _ref.options,
|
|
25
|
-
options = _ref$options === void 0 ? {} : _ref$options
|
|
37
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
38
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
|
|
26
40
|
var theme = (0, _react.useContext)(_styledComponents.ThemeContext); // fix: read value from theme
|
|
27
41
|
|
|
28
42
|
_reactChartjs.defaults.font.family = theme.fontFamily;
|
|
@@ -107,14 +121,11 @@ var LineChart = function LineChart(_ref) {
|
|
|
107
121
|
}
|
|
108
122
|
};
|
|
109
123
|
}, [customOptions, theme.fontOnPrimary]);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
}, [height, data, defaultOptions]);
|
|
117
|
-
return Chart;
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactChartjs.Line, _objectSpread({
|
|
125
|
+
height: height,
|
|
126
|
+
data: data,
|
|
127
|
+
options: defaultOptions
|
|
128
|
+
}, props));
|
|
118
129
|
};
|
|
119
130
|
|
|
120
131
|
var _default = LineChart;
|
package/package.json
CHANGED
package/select/Select.js
CHANGED
|
@@ -531,7 +531,7 @@ var Select = function Select(_ref) {
|
|
|
531
531
|
options.forEach(function (option) {
|
|
532
532
|
if (option.child && option.child.length > 0) {
|
|
533
533
|
var tmpFilteredChildOptions = option.child.filter(function (option) {
|
|
534
|
-
return option.text.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
534
|
+
return option.text.toLowerCase().indexOf(search.toLowerCase().trim()) !== -1;
|
|
535
535
|
});
|
|
536
536
|
|
|
537
537
|
if (tmpFilteredChildOptions.length > 0) {
|
|
@@ -539,7 +539,7 @@ var Select = function Select(_ref) {
|
|
|
539
539
|
child: tmpFilteredChildOptions
|
|
540
540
|
}));
|
|
541
541
|
}
|
|
542
|
-
} else if (option.text.toLowerCase().indexOf(search.toLowerCase()) !== -1) {
|
|
542
|
+
} else if (option.text.toLowerCase().indexOf(search.toLowerCase().trim()) !== -1) {
|
|
543
543
|
tmpFilteredOptions.push(option);
|
|
544
544
|
}
|
|
545
545
|
});
|