oolib 2.199.7 → 2.199.9

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.
@@ -65,6 +65,7 @@ var genTagComp_1 = require("../utils/genTagComp");
65
65
  var styled_1 = require("../styled");
66
66
  var BlockLabel_1 = require("../../BlockLabel");
67
67
  var getBlockLabelProps_1 = require("../../../../utils/getBlockLabelProps");
68
+ var List_1 = require("../../List");
68
69
  function DropdownMulti(_a) {
69
70
  var saveValueAsString = _a.saveValueAsString, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className,
70
71
  // injectOtherOption,
@@ -101,7 +102,7 @@ function DropdownMulti(_a) {
101
102
  // rm the selectedOps from ops list (since they are shown anyway in the selectedops list)
102
103
  var selectedValues = currentValue.map(function (v) { return v.value; });
103
104
  // Check if we're dealing with grouped data
104
- var isGrouped = (0, getValue_1.isGroupedData)(ops);
105
+ var isGrouped = (0, List_1.isGroupedData)(ops);
105
106
  if (isGrouped) {
106
107
  // For grouped data, filter out selected options from each group
107
108
  return ops.map(function (group) {
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.getValue_MULTI = exports.getValue_SINGLE = void 0;
11
11
  var toArray_1 = require("../../../../utils/toArray");
12
+ var List_1 = require("../../List");
12
13
  var getAllOptionsFns_1 = require("./getAllOptionsFns");
13
14
  // Note: - saveValueAsString can be misleading here, because the value could be a string, integer, boolean values
14
15
  // maybe we can rename to saveValueOnly, or some better name
@@ -28,7 +29,7 @@ var getValue_SINGLE = function (_a) {
28
29
  if (!saveValueAsString)
29
30
  return valueProp;
30
31
  var allOptions = optionsFn ? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options;
31
- if (isGroupedData(allOptions)) {
32
+ if ((0, List_1.isGroupedData)(allOptions)) {
32
33
  // For grouped data, search through all options in all groups
33
34
  for (var _i = 0, allOptions_1 = allOptions; _i < allOptions_1.length; _i++) {
34
35
  var group = allOptions_1[_i];
@@ -51,7 +52,7 @@ var getValue_MULTI = function (_a) {
51
52
  return valueProp;
52
53
  var allOptions = optionsFn
53
54
  ? (_b = (0, getAllOptionsFns_1.getAllOptionsFns)(theme))[optionsFn.fn].apply(_b, ((0, toArray_1.toArray)(optionsFn.args) || [])) : options;
54
- if (isGroupedData(allOptions)) {
55
+ if ((0, List_1.isGroupedData)(allOptions)) {
55
56
  // For grouped data, map each value and search through all options in all groups
56
57
  return valueProp.map(function (vProp) {
57
58
  for (var _i = 0, allOptions_2 = allOptions; _i < allOptions_2.length; _i++) {
@@ -13,14 +13,14 @@ var __assign = (this && this.__assign) || function () {
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.keywordSearchOptions = void 0;
15
15
  var isStringMatch_1 = require("../../../../utils/isStringMatch");
16
- var getValue_1 = require("./getValue");
16
+ var List_1 = require("../../List");
17
17
  var keywordSearchOptions = function (_a) {
18
18
  var options = _a.options, searchString = _a.searchString, searchFieldsConfig = _a.searchFieldsConfig, setFilteredOptionsInParent = _a.setFilteredOptionsInParent;
19
19
  // If any options are loading, return the original options
20
20
  if (options.some(function (d) { return d.loading === true; }))
21
21
  return options;
22
22
  // Check if we're dealing with grouped data
23
- var isGrouped = (0, getValue_1.isGroupedData)(options);
23
+ var isGrouped = (0, List_1.isGroupedData)(options);
24
24
  if (isGrouped) {
25
25
  // Handle grouped data
26
26
  var filteredGroups = options.map(function (group) {
@@ -1,4 +1,5 @@
1
1
  export const StyledListWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export function isGroupedData(options: any): boolean;
2
3
  export function List({ id, options, value, focussedOp, scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName, invert, S, observerRef, isMulti, isTagsStyle, setFocusSelectTagsInput, disableShadow, isSearchable, searchbarPlaceholder, searchBarFocus, searchString, setSearchString, setSearchBarFocus, children, enableBorder, style }: {
3
4
  id: any;
4
5
  options?: any[];
@@ -37,7 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
37
37
  };
38
38
  })();
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.List = exports.StyledListWrapper = void 0;
40
+ exports.List = exports.isGroupedData = exports.StyledListWrapper = void 0;
41
41
  var react_1 = __importStar(require("react"));
42
42
  var styled_components_1 = __importStar(require("styled-components"));
43
43
  var NoOptionResultsComp_1 = require("../Dropdowns/comps/NoOptionResultsComp");
@@ -62,11 +62,9 @@ var isGroupedData = function (options) {
62
62
  }
63
63
  // Check the first item in the array
64
64
  // If it has an 'options' property that is an array, it's grouped data
65
- return (options[0] &&
66
- typeof options[0] === "object" &&
67
- Array.isArray(options[0].options) &&
68
- options[0].options.length > 0);
65
+ return (Array.isArray(options) && options.every(function (op) { return !!(op === null || op === void 0 ? void 0 : op.options) && Array.isArray(op.options); }));
69
66
  };
67
+ exports.isGroupedData = isGroupedData;
70
68
  var List = function (_a) {
71
69
  // const theme = useTheme();
72
70
  var id = _a.id, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, focussedOp = _a.focussedOp, scrollFocussedOpIntoView = _a.scrollFocussedOpIntoView, parentOnChange = _a.onChange, optionsClassName = _a.optionsClassName, invert = _a.invert, S = _a.S, observerRef = _a.observerRef, _c = _a.isMulti, isMulti = _c === void 0 ? false : _c, isTagsStyle = _a.isTagsStyle, setFocusSelectTagsInput = _a.setFocusSelectTagsInput, disableShadow = _a.disableShadow, isSearchable = _a.isSearchable, searchbarPlaceholder = _a.searchbarPlaceholder, searchBarFocus = _a.searchBarFocus, searchString = _a.searchString, setSearchString = _a.setSearchString, setSearchBarFocus = _a.setSearchBarFocus, children = _a.children, enableBorder = _a.enableBorder, style = _a.style;
@@ -74,7 +72,7 @@ var List = function (_a) {
74
72
  if (options.length === 0) {
75
73
  return react_1.default.createElement(NoOptionResultsComp_1.NoOptionResultsComp, { S: S });
76
74
  }
77
- if (isGroupedData(options)) {
75
+ if ((0, exports.isGroupedData)(options)) {
78
76
  return (react_1.default.createElement(react_1.Fragment, null, options.map(function (group, index) { return (react_1.default.createElement(ListGroup_1.ListGroup, { id: id, key: "group-".concat(index), group: group, index: index, value: value, focussedOp: focussedOp, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: parentOnChange, optionsClassName: optionsClassName, invert: invert, S: S, observerRef: observerRef, isMulti: isMulti, isTagsStyle: isTagsStyle, setFocusSelectTagsInput: setFocusSelectTagsInput, setSearchString: setSearchString, setSearchBarFocus: setSearchBarFocus, disableShadow: disableShadow })); })));
79
77
  }
80
78
  return options.map(function (option, index) { return (react_1.default.createElement(ListItem_1.ListItem, { key: option.value, option: option, isSelected: (!option.loading && (value === null || value === void 0 ? void 0 : value.value) === option.value), isFocussed: focussedOp === index, index: index, scrollFocussedOpIntoView: scrollFocussedOpIntoView, onChange: function () {
@@ -55,8 +55,8 @@ var CustomizedLabel_1 = require("./comps/CustomizedLabel");
55
55
  var __1 = require("../../../..");
56
56
  var usePrepareData_1 = require("../utils/usePrepareData");
57
57
  var _base_barchart_ui_configs_1 = require("./_base_barchart_ui_configs");
58
+ var CustomTooltip_1 = __importDefault(require("./comps/CustomTooltip"));
58
59
  var Legend_1 = require("./comps/Legend");
59
- var OptimizedTooltip_1 = __importDefault(require("./comps/CustomTooltip/OptimizedTooltip"));
60
60
  var useTrackMousePosition = function () {
61
61
  var _a = (0, react_1.useState)({
62
62
  x: 0,
@@ -268,7 +268,20 @@ var BarChartRenderer = function (_a) {
268
268
  } },
269
269
  react_1.default.createElement(recharts_1.XAxis, { hide: true, type: "number", domain: [0, dataMaxValue] }),
270
270
  react_1.default.createElement(recharts_1.YAxis, { hide: true, type: "category" }),
271
- isBreakdown && (react_1.default.createElement(recharts_1.Tooltip, { cursor: false, content: react_1.default.createElement(OptimizedTooltip_1.default, null), animationDuration: 0, isAnimationActive: false, allowEscapeViewBox: { x: false, y: false }, position: { x: undefined, y: undefined } })),
271
+ isBreakdown && (react_1.default.createElement(recharts_1.Tooltip, { cursor: false,
272
+ // content={<OptimizedTooltip />}
273
+ // animationDuration={0}
274
+ // isAnimationActive={false}
275
+ // allowEscapeViewBox={{ x: false, y: false }}
276
+ // position={{ x: undefined, y: undefined }}
277
+ content: function (props) {
278
+ var _a;
279
+ return (react_1.default.createElement(CustomTooltip_1.default, __assign({}, props, { breakdownCategoryName: breakdownCategoryName, activeBar: activeBar, mousePosition: mousePosition, showPercent: showPercent,
280
+ // god knows why the dataindex gets stored against props.label.
281
+ // this is some internal recharts thing for tooltips specifically.
282
+ // we dont do this.
283
+ value: (_a = data[props.label]) === null || _a === void 0 ? void 0 : _a.map(function (item, idx) { return (__assign({}, item.labels)); }) })));
284
+ }, allowEscapeViewBox: { x: true, y: true } })),
272
285
  isBreakdown
273
286
  ? data[0].map(function (_, stackIndex) {
274
287
  //note that this map renders the individual bars within a breakdown group
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.199.7",
3
+ "version": "2.199.9",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",