@oliasoft-open-source/charts-library 4.7.0-beta-4 → 4.7.0-beta-5

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/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import React__default, { forwardRef, useRef, useEffect, createContext as createC
11
11
  import { produce } from "immer";
12
12
  import { round as round$2, displayNumber, isCloseTo, roundByMagnitude } from "@oliasoft-open-source/units";
13
13
  import cx from "classnames";
14
- import { Portal, Icon, Menu, Tooltip as Tooltip$2, Button, Flex, Text, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer } from "@oliasoft-open-source/react-ui-library";
14
+ import { Portal, Icon, Menu, Tooltip as Tooltip$2, Button, Text, Popover, Field, InputGroup, NumberInput, InputGroupAddon, Select, ButtonGroup, Spacer, Flex } from "@oliasoft-open-source/react-ui-library";
15
15
  import { isEmpty, isArray as isArray$2, some, has, cloneDeep, defaultTo, findIndex, set as set$2, debounce as debounce$3, isNil, map as map$3, find, get as get$1 } from "lodash";
16
16
  /*!
17
17
  * @kurkle/color v0.3.2
@@ -23055,7 +23055,6 @@ function getDragOptions({
23055
23055
  dragToZoom,
23056
23056
  doubleClickToReset,
23057
23057
  dragToPan,
23058
- orDoubleClickToCanvas,
23059
23058
  dragToMovePoints,
23060
23059
  dragDisabled,
23061
23060
  dragToMoveAnnotation
@@ -23064,23 +23063,25 @@ function getDragOptions({
23064
23063
  return [
23065
23064
  {
23066
23065
  buttonLabel: dragToZoom,
23067
- label: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
23068
- /* @__PURE__ */ jsx(Text, { children: "Drag to zoom" }),
23069
- /* @__PURE__ */ jsx(Text, { small: true, muted: true, children: doubleClickToReset })
23070
- ] }),
23066
+ label: dragToZoom,
23071
23067
  icon: /* @__PURE__ */ jsx(TbZoomIn, {}),
23072
23068
  selected: zoomEnabled,
23073
- onClick: onToggleZoom
23069
+ type: "Option",
23070
+ onClick: () => {
23071
+ if (!zoomEnabled)
23072
+ onToggleZoom();
23073
+ }
23074
23074
  },
23075
23075
  {
23076
23076
  buttonLabel: dragToPan,
23077
- label: /* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
23078
- /* @__PURE__ */ jsx(Text, { children: "Drag to pan" }),
23079
- /* @__PURE__ */ jsx(Text, { small: true, muted: true, children: orDoubleClickToCanvas })
23080
- ] }),
23077
+ label: dragToPan,
23081
23078
  icon: /* @__PURE__ */ jsx(TbArrowsMove, {}),
23082
23079
  selected: panEnabled,
23083
- onClick: onTogglePan
23080
+ type: "Option",
23081
+ onClick: () => {
23082
+ if (!panEnabled)
23083
+ onTogglePan();
23084
+ }
23084
23085
  },
23085
23086
  ...isDragDataAllowed ? [
23086
23087
  {
@@ -23088,7 +23089,10 @@ function getDragOptions({
23088
23089
  icon: /* @__PURE__ */ jsx(TbHandStop, {}),
23089
23090
  selected: enableDragPoints,
23090
23091
  type: "Option",
23091
- onClick: onToggleDragPoints
23092
+ onClick: () => {
23093
+ if (!enableDragPoints)
23094
+ onToggleDragPoints();
23095
+ }
23092
23096
  }
23093
23097
  ] : [],
23094
23098
  ...isDragAnnotationAllowed ? [
@@ -23097,14 +23101,23 @@ function getDragOptions({
23097
23101
  icon: /* @__PURE__ */ jsx(TbHandStop, {}),
23098
23102
  selected: enableDragAnnotation,
23099
23103
  type: "Option",
23100
- onClick: onToggleDragAnnotation
23104
+ onClick: () => {
23105
+ if (!enableDragAnnotation)
23106
+ onToggleDragAnnotation();
23107
+ }
23101
23108
  }
23102
23109
  ] : [],
23103
23110
  {
23104
23111
  label: dragDisabled,
23105
23112
  icon: /* @__PURE__ */ jsx(TbBan, {}),
23106
23113
  selected: !zoomEnabled && !panEnabled && !enableDragPoints && !enableDragAnnotation,
23114
+ type: "Option",
23107
23115
  onClick: onDisableDragOptions
23116
+ },
23117
+ {
23118
+ label: /* @__PURE__ */ jsx(Text, { small: true, muted: true, children: doubleClickToReset }),
23119
+ type: "Option",
23120
+ disabled: true
23108
23121
  }
23109
23122
  ];
23110
23123
  }
@@ -23124,7 +23137,6 @@ const DragOptions = ({
23124
23137
  dragToZoom,
23125
23138
  doubleClickToReset,
23126
23139
  dragToPan,
23127
- orDoubleClickToCanvas,
23128
23140
  dragToMovePoints,
23129
23141
  dragDisabled,
23130
23142
  dragToMoveAnnotation
@@ -23147,7 +23159,6 @@ const DragOptions = ({
23147
23159
  dragToZoom,
23148
23160
  doubleClickToReset,
23149
23161
  dragToPan,
23150
- orDoubleClickToCanvas,
23151
23162
  dragToMovePoints,
23152
23163
  dragDisabled,
23153
23164
  dragToMoveAnnotation
@@ -23156,20 +23167,11 @@ const DragOptions = ({
23156
23167
  [zoomEnabled, panEnabled, enableDragPoints, isDragDataAllowed]
23157
23168
  );
23158
23169
  const selectedOption = options.find((option) => option.selected);
23159
- const optionsWithDragPoints = options.map(
23160
- ({ icon, label, onClick, selected }) => ({
23161
- icon,
23162
- label,
23163
- type: "Option",
23164
- onClick,
23165
- disabled: selected
23166
- })
23167
- );
23168
23170
  return /* @__PURE__ */ jsx(
23169
23171
  Menu,
23170
23172
  {
23171
23173
  menu: {
23172
- sections: optionsWithDragPoints,
23174
+ sections: options,
23173
23175
  trigger: "Component",
23174
23176
  component: /* @__PURE__ */ jsx(
23175
23177
  Button,