oa-componentbook 0.18.3 → 0.18.4
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/build/components/oa-component-bar-chart/BarChart.js +2 -4
- package/build/components/oa-component-form-item/CustomFormItem.js +7 -35
- package/build/components/oa-component-table/CustomTable.js +1 -5
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +3 -3
- package/package.json +6 -2
|
@@ -21,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
23
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
24
|
-
const FullSizeContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n \n display: inline-block;\n position: relative;\n width: 100%;\n padding-bottom: ", "%;\n vertical-align: top;\n overflow: hidden;\n\n .bar-chart-svg {\n display: inline-block;\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .empty-component-container {\n display: ", ";\n position: absolute;\n top: ", ";\n left: ", "
|
|
24
|
+
const FullSizeContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n \n display: inline-block;\n position: relative;\n width: 100%;\n padding-bottom: ", "%;\n vertical-align: top;\n overflow: hidden;\n\n .bar-chart-svg {\n display: inline-block;\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .empty-component-container {\n display: ", ";\n position: absolute;\n /* top: ", ";\n left: ", "; */\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%) scale(1.3);\n }\n"])), props => 100 / props.$aspectRatio, props => props !== null && props !== void 0 && props.$showNoData ? 'block' : 'none', props => "calc(".concat(props.$marginTop, "px + 50%)"), props => "calc(".concat(props.$marginLeft, "px + 50%)"));
|
|
25
25
|
function curvedBar(x, y, width, height, r) {
|
|
26
26
|
// x coordinates of top of arcs
|
|
27
27
|
const x0 = x + r;
|
|
@@ -197,10 +197,8 @@ function BarChart(_ref) {
|
|
|
197
197
|
});
|
|
198
198
|
return /*#__PURE__*/_react.default.createElement(FullSizeContainer, {
|
|
199
199
|
$aspectRatio: aspectRatio,
|
|
200
|
-
$marginTop: marginTop,
|
|
201
|
-
$marginRight: marginRight,
|
|
202
|
-
$marginBottom: marginBottom,
|
|
203
200
|
$marginLeft: marginLeft,
|
|
201
|
+
$marginTop: marginTop,
|
|
204
202
|
$showNoData: showNoData,
|
|
205
203
|
ref: barChartRef
|
|
206
204
|
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
3
|
require("core-js/modules/es.object.assign.js");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -8,54 +7,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
7
|
exports.default = CustomFormItem;
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
10
|
var _antd = require("antd");
|
|
13
11
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
14
|
-
const _excluded = ["label"
|
|
15
|
-
var _templateObject;
|
|
12
|
+
const _excluded = ["label"];
|
|
16
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
22
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
15
|
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; }
|
|
24
16
|
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; }
|
|
25
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
26
|
-
const StyledFormItem = (0, _styledComponents.default)(_antd.Form.Item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n label{\n height: auto !important;\n color: var(--color-primary-content) !important;\n margin: 0 0 4px !important;\n }\n .ant-col-24.ant-form-item-label{\n padding: 0;\n }\n"])));
|
|
27
17
|
function CustomFormItem(_ref) {
|
|
28
18
|
let {
|
|
29
|
-
label
|
|
30
|
-
labelPosition = 'left',
|
|
31
|
-
name,
|
|
32
|
-
children
|
|
19
|
+
label
|
|
33
20
|
} = _ref,
|
|
34
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
|
|
36
|
-
span: 24
|
|
37
|
-
}, props.labelCol) : props.labelCol;
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(StyledFormItem, _extends({
|
|
39
|
-
name: name,
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, _extends({
|
|
40
23
|
label: label ? /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
41
24
|
typography: "type-b2-400"
|
|
42
|
-
}, label) : undefined
|
|
43
|
-
|
|
44
|
-
}, props), children);
|
|
25
|
+
}, label) : undefined
|
|
26
|
+
}, props));
|
|
45
27
|
}
|
|
46
28
|
CustomFormItem.propTypes = {
|
|
47
|
-
label: _propTypes.default.string
|
|
48
|
-
name: _propTypes.default.string,
|
|
49
|
-
children: _propTypes.default.element,
|
|
50
|
-
labelPosition: _propTypes.default.oneOf(['left', 'top']),
|
|
51
|
-
initialValue: _propTypes.default.any,
|
|
52
|
-
labelCol: _propTypes.default.object
|
|
29
|
+
label: _propTypes.default.string
|
|
53
30
|
};
|
|
54
31
|
CustomFormItem.defaultProps = {
|
|
55
|
-
label: null
|
|
56
|
-
name: '',
|
|
57
|
-
children: /*#__PURE__*/_react.default.createElement("input", null),
|
|
58
|
-
labelPosition: 'left',
|
|
59
|
-
initialValue: null,
|
|
60
|
-
labelCol: null
|
|
32
|
+
label: null
|
|
61
33
|
};
|
|
@@ -88,12 +88,8 @@ function CustomTable(_ref) {
|
|
|
88
88
|
cellFontSizeMD: "".concat(_TypographiesMap.default['type-b2-400']['font-size'], "px"),
|
|
89
89
|
cellFontSizeSM: "".concat(_TypographiesMap.default['type-b2-400']['font-size'], "px"),
|
|
90
90
|
selectionColumnWidth: '54px',
|
|
91
|
-
colorText: _ColorVariablesMap.default['--color-primary-content']
|
|
92
|
-
rowSelectedHoverBg: _ColorVariablesMap.default['--color-secondary-background']
|
|
91
|
+
colorText: _ColorVariablesMap.default['--color-primary-content']
|
|
93
92
|
}
|
|
94
|
-
},
|
|
95
|
-
token: {
|
|
96
|
-
controlItemBgActive: _ColorVariablesMap.default['--color-secondary-background']
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
}, /*#__PURE__*/_react.default.createElement(StyledTable, _extends({
|
|
@@ -129,7 +129,7 @@ function AddSparePartWidget(_ref) {
|
|
|
129
129
|
rules: [{
|
|
130
130
|
// This field is required only if the corresponding part is selected
|
|
131
131
|
required: selectedParts.includes(spare.scopeId),
|
|
132
|
-
message: '
|
|
132
|
+
message: ''
|
|
133
133
|
// message: 'Enter the discount value.',
|
|
134
134
|
}],
|
|
135
135
|
initialValue: ""
|
|
@@ -145,7 +145,7 @@ function AddSparePartWidget(_ref) {
|
|
|
145
145
|
rules: [{
|
|
146
146
|
// This field is required only if the corresponding part is selected
|
|
147
147
|
required: selectedParts.includes(spare.scopeId),
|
|
148
|
-
message: '
|
|
148
|
+
message: ''
|
|
149
149
|
// message: 'Enter the discount value.',
|
|
150
150
|
}],
|
|
151
151
|
initialValue: ""
|
|
@@ -161,7 +161,7 @@ function AddSparePartWidget(_ref) {
|
|
|
161
161
|
rules: [{
|
|
162
162
|
// This field is required only if the corresponding part is selected
|
|
163
163
|
required: selectedParts.includes(spare.scopeId),
|
|
164
|
-
message: '
|
|
164
|
+
message: ''
|
|
165
165
|
// message: 'Enter the discount value.',
|
|
166
166
|
}],
|
|
167
167
|
initialValue: ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oa-componentbook",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable components",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -56,11 +56,15 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"start": "react-scripts start",
|
|
58
58
|
"build": "rm -rf build && NODE_ENV=production babel src/lib --out-dir build --copy-files",
|
|
59
|
+
"build-tracked": "git stash -u && npm run build && git stash pop",
|
|
59
60
|
"storybook": "storybook dev -p 6006",
|
|
60
61
|
"build-storybook": "storybook build",
|
|
61
62
|
"lint": "eslint src/** --ext .js,.jsx",
|
|
63
|
+
"lint-commit": "git add -u && git commit -m \"fix: Rectified auto-fixable lint errors for v$(npm show oa-componentbook version)\"",
|
|
62
64
|
"lint-fix": "npm run lint -- --fix",
|
|
63
|
-
"lint-fix-quiet": "npm run lint-fix -- --quiet"
|
|
65
|
+
"lint-fix-quiet": "npm run lint-fix -- --quiet",
|
|
66
|
+
"lint-fix-tracked": "git stash -u && npm run lint-fix-quiet && git stash pop",
|
|
67
|
+
"lint-fix-commit": "npm run lint-fix-tracked && npm run lint-commit"
|
|
64
68
|
},
|
|
65
69
|
"eslintConfig": {
|
|
66
70
|
"extends": [
|