oolib 2.203.1 → 2.204.0

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,7 +1,7 @@
1
- import { SANS_3, SANS_4_5, SANS_2 } from "../../Typo";
1
+ import { UI_BODY_DF, UI_BODY_SM_DF, UI_TITLE } from "../../../v2/components/Typo2";
2
2
  export type LoaderSize = 'L' | 'S' | 'M';
3
3
  export interface DimensionResult {
4
- TypoComp: typeof SANS_3 | typeof SANS_4_5 | typeof SANS_2;
4
+ TypoComp: typeof UI_BODY_DF | typeof UI_BODY_SM_DF | typeof UI_TITLE;
5
5
  trackThickness: number;
6
6
  diameter: number;
7
7
  }
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getTypoAndLoaderDimensions = void 0;
4
- var Typo_1 = require("../../Typo");
4
+ var Typo2_1 = require("../../../v2/components/Typo2");
5
5
  var getTypoAndLoaderDimensions = function (size) {
6
6
  if (size === void 0) { size = 'M'; }
7
7
  switch (size) {
8
8
  case 'L':
9
- return { TypoComp: Typo_1.SANS_4_5, trackThickness: 10, diameter: 70 };
9
+ return { TypoComp: Typo2_1.UI_TITLE, trackThickness: 10, diameter: 70 };
10
10
  case 'S':
11
- return { TypoComp: Typo_1.SANS_2, trackThickness: 3.65, diameter: 21.35 };
11
+ return { TypoComp: Typo2_1.UI_BODY_SM_DF, trackThickness: 3.65, diameter: 21.35 };
12
12
  case 'M':
13
13
  default:
14
- return { TypoComp: Typo_1.SANS_3, trackThickness: 7, diameter: 43 };
14
+ return { TypoComp: Typo2_1.UI_BODY_DF, trackThickness: 7, diameter: 43 };
15
15
  }
16
16
  };
17
17
  exports.getTypoAndLoaderDimensions = getTypoAndLoaderDimensions;
@@ -1,5 +1,7 @@
1
- export function PhoneInput({ passValidationErrorToFormValidation, ...props }: {
1
+ export function PhoneInput({ passValidationErrorToFormValidation, minPhoneNoLength, maxPhoneNoLength, ...props }: {
2
2
  [x: string]: any;
3
3
  passValidationErrorToFormValidation: any;
4
+ minPhoneNoLength?: number;
5
+ maxPhoneNoLength?: number;
4
6
  }): React.JSX.Element;
5
7
  import React from "react";
@@ -29,7 +29,7 @@ exports.PhoneInput = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var __1 = require("..");
31
31
  var PhoneInput = function (_a) {
32
- var passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, props = __rest(_a, ["passValidationErrorToFormValidation"]);
32
+ var passValidationErrorToFormValidation = _a.passValidationErrorToFormValidation, _b = _a.minPhoneNoLength, minPhoneNoLength = _b === void 0 ? 9 : _b, _c = _a.maxPhoneNoLength, maxPhoneNoLength = _c === void 0 ? 11 : _c, props = __rest(_a, ["passValidationErrorToFormValidation", "minPhoneNoLength", "maxPhoneNoLength"]);
33
33
  var handleValidation = function (value) {
34
34
  var errorObj;
35
35
  if (isNaN(value)) {
@@ -38,7 +38,7 @@ var PhoneInput = function (_a) {
38
38
  passValidationErrorToFormValidation(errorObj.type);
39
39
  return errorObj;
40
40
  }
41
- if (value.length < 9) {
41
+ if (value.length < minPhoneNoLength) {
42
42
  errorObj = { type: "error", msg: "Enter a valid phone number" };
43
43
  if (passValidationErrorToFormValidation)
44
44
  passValidationErrorToFormValidation(errorObj.type);
@@ -48,6 +48,6 @@ var PhoneInput = function (_a) {
48
48
  if (passValidationErrorToFormValidation)
49
49
  passValidationErrorToFormValidation("success");
50
50
  };
51
- return (react_1.default.createElement(__1.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength: 11 }, props)));
51
+ return (react_1.default.createElement(__1.TextInput, __assign({ type: "tel", placeholder: "Enter Phone...", handleValidation: handleValidation, maxLength: maxPhoneNoLength }, props)));
52
52
  };
53
53
  exports.PhoneInput = PhoneInput;
@@ -118,6 +118,7 @@ var BarGraph = function (_a) {
118
118
  var tagCategory = _a.tagCategory, index1 = _a.index1, _c = _a.showCount, showCount = _c === void 0 ? true : _c, _d = _a.showPercent, showPercent = _d === void 0 ? true : _d, onClick = _a.onClick, debug = _a.debug;
119
119
  var containerRef = (0, react_1.useRef)();
120
120
  var _e = (0, BarChart_1.useTrackMousePosition)({ containerRef: containerRef }), mousePosition = _e.mousePosition, isHovering = _e.isHovering;
121
+ var _f = (0, react_1.useState)(null), hoveredBarIndex = _f[0], setHoveredBarIndex = _f[1];
121
122
  var truncateText = function (text, maxLength) {
122
123
  if (maxLength === void 0) { maxLength = 30; }
123
124
  if (!text)
@@ -127,10 +128,10 @@ var BarGraph = function (_a) {
127
128
  return text.slice(0, maxLength) + '...';
128
129
  };
129
130
  var handleBarMouseEnter = function (index) {
130
- setActiveTooltip(index);
131
+ setHoveredBarIndex(index);
131
132
  };
132
133
  var handleBarMouseLeave = function () {
133
- setActiveTooltip(null);
134
+ setHoveredBarIndex(null);
134
135
  };
135
136
  var handleBarClick = function (tag) {
136
137
  if (onClick) {
@@ -146,6 +147,7 @@ var BarGraph = function (_a) {
146
147
  count: showCount ? tag.count : undefined,
147
148
  tooltipLabel: tag.display
148
149
  }];
150
+ var isHovered = isHovering && hoveredBarIndex === index;
149
151
  return (react_1.default.createElement("div", { key: tag._id || "".concat(index1, "-").concat(index), onMouseEnter: function () { return handleBarMouseEnter(index); }, onMouseLeave: handleBarMouseLeave, onClick: function () { return handleBarClick(tag); }, style: { cursor: onClick ? 'pointer' : 'default' } },
150
152
  react_1.default.createElement(styled_1.StyledSingleBarWrapper, { barSections: tag.barSections, debug: debug },
151
153
  react_1.default.createElement(styled_1.StyledBar, { style: {
@@ -154,7 +156,7 @@ var BarGraph = function (_a) {
154
156
  } }),
155
157
  react_1.default.createElement(styled_1.StyledLabelWrapper, null,
156
158
  react_1.default.createElement(__2.UI_BODY_SM, null, truncateText(tag === null || tag === void 0 ? void 0 : tag.display, 30))),
157
- (isHovering && mousePosition) && (react_1.default.createElement(CustomTooltip_1.default, { active: true, payload: [tag], mousePosition: mousePosition, value: tooltipData, showPercent: showPercent })))));
159
+ isHovered && mousePosition && (react_1.default.createElement(CustomTooltip_1.default, { active: true, payload: [tag], mousePosition: mousePosition, value: tooltipData, showPercent: showPercent })))));
158
160
  })));
159
161
  };
160
162
  exports.BarGraph = BarGraph;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.203.1",
3
+ "version": "2.204.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",