@longline/aqua-ui 1.0.239 → 1.0.240

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.
@@ -1,4 +1,3 @@
1
1
  export * from './Histogram';
2
2
  export * from './IHistogramBin';
3
3
  export * from './HistogramAppearance';
4
- export * from './HistogramSingleValue';
@@ -1,4 +1,3 @@
1
1
  export * from './Histogram';
2
2
  export * from './IHistogramBin';
3
3
  export * from './HistogramAppearance';
4
- export * from './HistogramSingleValue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longline/aqua-ui",
3
- "version": "1.0.239",
3
+ "version": "1.0.240",
4
4
  "description": "AquaUI",
5
5
  "author": "Alexander van Oostenrijk / Longline Environment",
6
6
  "license": "Commercial",
@@ -1,8 +0,0 @@
1
- import * as React from "react";
2
- interface IProps {
3
- /** @ignore */
4
- className?: string;
5
- value: string;
6
- }
7
- declare const HistogramSingleValue: (props: IProps) => React.JSX.Element;
8
- export { HistogramSingleValue };
@@ -1,42 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- var __assign = (this && this.__assign) || function () {
6
- __assign = Object.assign || function(t) {
7
- for (var s, i = 1, n = arguments.length; i < n; i++) {
8
- s = arguments[i];
9
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
- t[p] = s[p];
11
- }
12
- return t;
13
- };
14
- return __assign.apply(this, arguments);
15
- };
16
- import * as React from "react";
17
- import styled from "styled-components";
18
- var HistogramSingleValueBase = function (_a) {
19
- var value = _a.value, className = _a.className;
20
- var textRef = React.useRef(null);
21
- var _b = React.useState(1), scale = _b[0], setScale = _b[1];
22
- React.useEffect(function () {
23
- if (textRef.current) {
24
- // measure at default font size
25
- var bbox = textRef.current.getBBox();
26
- if (bbox.width && bbox.height) {
27
- var scaleX = 100 / bbox.width;
28
- var scaleY = 100 / bbox.height;
29
- // uniform scale (preserve proportions)
30
- setScale(Math.min(scaleX, scaleY));
31
- }
32
- }
33
- }, [value]);
34
- return (React.createElement("div", { className: className },
35
- React.createElement("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid meet" },
36
- React.createElement("g", { transform: "translate(50,50) scale(".concat(scale, ") translate(-50,-50)") },
37
- React.createElement("text", { ref: textRef, x: "50", y: "50", dominantBaseline: "middle", textAnchor: "middle" }, value)))));
38
- };
39
- var HistogramSingleValueStyled = styled(HistogramSingleValueBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n inset: 0;\n padding: 16px;\n & > svg {\n width: 100%;\n height: 100%;\n font: ", ";\n fill: #fff;\n user-select: none;\n }\n"], ["\n position: absolute;\n inset: 0;\n padding: 16px;\n & > svg {\n width: 100%;\n height: 100%;\n font: ", ";\n fill: #fff;\n user-select: none;\n }\n"])), function (p) { return p.theme.font.dataSmall; });
40
- var HistogramSingleValue = function (props) { return React.createElement(HistogramSingleValueStyled, __assign({}, props)); };
41
- export { HistogramSingleValue };
42
- var templateObject_1;