victory-bar 37.0.1-next.2 → 37.0.2
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/CHANGELOG.md +8 -4
- package/dist/victory-bar.js +22 -25
- package/dist/victory-bar.min.js +1 -1
- package/es/bar-helper-methods.d.ts +6 -6
- package/es/bar.d.ts +19 -19
- package/es/bar.js +2 -4
- package/es/geometry-helper-methods.d.ts +90 -90
- package/es/helper-methods.d.ts +7 -7
- package/es/index.d.ts +5 -5
- package/es/path-helper-methods.d.ts +7 -7
- package/es/victory-bar.d.ts +129 -129
- package/lib/bar-helper-methods.d.ts +6 -6
- package/lib/bar.d.ts +19 -19
- package/lib/bar.js +3 -4
- package/lib/geometry-helper-methods.d.ts +90 -90
- package/lib/helper-methods.d.ts +7 -7
- package/lib/index.d.ts +5 -5
- package/lib/path-helper-methods.d.ts +7 -7
- package/lib/victory-bar.d.ts +129 -129
- package/package.json +7 -4
- package/src/bar.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# victory-bar
|
|
2
2
|
|
|
3
|
-
## 37.0.
|
|
3
|
+
## 37.0.2
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
- Ensure undefined props do not overwrite defaults ([#2852](https://github.com/FormidableLabs/victory/pull/2852))
|
|
8
|
+
|
|
9
|
+
## 37.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Fix the signature of class static functions in components ([#2840](https://github.com/FormidableLabs/victory/pull/2840))
|
|
10
14
|
|
|
11
15
|
## 37.0.0
|
|
12
16
|
|
package/dist/victory-bar.js
CHANGED
|
@@ -116,12 +116,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
116
116
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
117
117
|
/* harmony export */ "Bar": function() { return /* binding */ Bar; }
|
|
118
118
|
/* harmony export */ });
|
|
119
|
-
/* harmony import */ var
|
|
120
|
-
/* harmony import */ var
|
|
121
|
-
/* harmony import */ var
|
|
122
|
-
/* harmony import */ var
|
|
123
|
-
/* harmony import */ var
|
|
124
|
-
/* harmony import */ var
|
|
119
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/defaults */ "../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/defaults.js");
|
|
120
|
+
/* harmony import */ var lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_defaults__WEBPACK_IMPORTED_MODULE_0__);
|
|
121
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
|
|
122
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
123
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
124
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/path.js");
|
|
125
|
+
/* harmony import */ var _bar_helper_methods__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bar-helper-methods */ "./bar-helper-methods.ts");
|
|
126
|
+
/* harmony import */ var _path_helper_methods__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path-helper-methods */ "./path-helper-methods.ts");
|
|
127
|
+
|
|
125
128
|
|
|
126
129
|
|
|
127
130
|
|
|
@@ -139,18 +142,18 @@ const evaluateProps = props => {
|
|
|
139
142
|
* `id`
|
|
140
143
|
* `tabIndex`
|
|
141
144
|
*/
|
|
142
|
-
const style = (0,
|
|
143
|
-
const barWidth = (0,
|
|
145
|
+
const style = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_2__.getStyle)(props.style, props);
|
|
146
|
+
const barWidth = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_2__.getBarWidth)(props.barWidth, Object.assign({}, props, {
|
|
144
147
|
style
|
|
145
148
|
}));
|
|
146
|
-
const cornerRadius = (0,
|
|
149
|
+
const cornerRadius = (0,_bar_helper_methods__WEBPACK_IMPORTED_MODULE_2__.getCornerRadius)(props.cornerRadius, Object.assign({}, props, {
|
|
147
150
|
style,
|
|
148
151
|
barWidth
|
|
149
152
|
}));
|
|
150
|
-
const ariaLabel =
|
|
151
|
-
const desc =
|
|
152
|
-
const id =
|
|
153
|
-
const tabIndex =
|
|
153
|
+
const ariaLabel = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.ariaLabel, props);
|
|
154
|
+
const desc = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.desc, props);
|
|
155
|
+
const id = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.id, props);
|
|
156
|
+
const tabIndex = victory_core__WEBPACK_IMPORTED_MODULE_3__.evaluateProp(props.tabIndex, props);
|
|
154
157
|
return Object.assign({}, props, {
|
|
155
158
|
ariaLabel,
|
|
156
159
|
style,
|
|
@@ -162,17 +165,14 @@ const evaluateProps = props => {
|
|
|
162
165
|
});
|
|
163
166
|
};
|
|
164
167
|
const defaultProps = {
|
|
165
|
-
pathComponent: /*#__PURE__*/
|
|
168
|
+
pathComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.Path, null),
|
|
166
169
|
role: "presentation",
|
|
167
170
|
shapeRendering: "auto"
|
|
168
171
|
};
|
|
169
172
|
|
|
170
173
|
// eslint-disable-next-line prefer-arrow-callback
|
|
171
|
-
const Bar = /*#__PURE__*/(0,
|
|
172
|
-
const props = evaluateProps({
|
|
173
|
-
...defaultProps,
|
|
174
|
-
...initialProps
|
|
175
|
-
});
|
|
174
|
+
const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function Bar(initialProps, ref) {
|
|
175
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_0___default()({}, initialProps, defaultProps));
|
|
176
176
|
const {
|
|
177
177
|
polar,
|
|
178
178
|
origin,
|
|
@@ -180,12 +180,12 @@ const Bar = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(funct
|
|
|
180
180
|
barWidth,
|
|
181
181
|
cornerRadius
|
|
182
182
|
} = props;
|
|
183
|
-
const path = polar ? (0,
|
|
183
|
+
const path = polar ? (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getPolarBarPath)(props, cornerRadius) : (0,_path_helper_methods__WEBPACK_IMPORTED_MODULE_5__.getBarPath)(props, barWidth, cornerRadius);
|
|
184
184
|
const defaultTransform = polar && origin ? `translate(${origin.x}, ${origin.y})` : undefined;
|
|
185
185
|
if (!props.pathComponent) {
|
|
186
186
|
return null;
|
|
187
187
|
}
|
|
188
|
-
return /*#__PURE__*/
|
|
188
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(props.pathComponent, {
|
|
189
189
|
...props.events,
|
|
190
190
|
"aria-label": props.ariaLabel,
|
|
191
191
|
style,
|
|
@@ -6556,10 +6556,7 @@ const defaultProps = {
|
|
|
6556
6556
|
lineHeight: 1
|
|
6557
6557
|
};
|
|
6558
6558
|
const VictoryLabel = initialProps => {
|
|
6559
|
-
const props = evaluateProps({
|
|
6560
|
-
...defaultProps,
|
|
6561
|
-
...initialProps
|
|
6562
|
-
});
|
|
6559
|
+
const props = evaluateProps(lodash_defaults__WEBPACK_IMPORTED_MODULE_1___default()({}, initialProps, defaultProps));
|
|
6563
6560
|
if (props.text === null || props.text === undefined) {
|
|
6564
6561
|
return null;
|
|
6565
6562
|
}
|