@helpdice/ui 2.6.1-beta.3 → 2.6.1-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.
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
4
+ var _excluded = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
5
5
  import _JSXStyle from "../styled-jsx.es.js";
6
6
  import React, { useState, useEffect, useRef, forwardRef, useMemo, useImperativeHandle } from 'react';
7
7
  import { isNumber, cleanValue, fixedDecimalValue, formatValue, getLocaleConfig, padTrimValue, getSuffix, repositionCursor } from './utils';
@@ -23,6 +23,7 @@ export var InputCurrency = /*#__PURE__*/forwardRef(function (_ref, ref) {
23
23
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
24
24
  userMaxLength = _ref.maxLength,
25
25
  userValue = _ref.value,
26
+ onValueChange = _ref.onValueChange,
26
27
  fixedDecimalLength = _ref.fixedDecimalLength,
27
28
  placeholder = _ref.placeholder,
28
29
  decimalScale = _ref.decimalScale,
@@ -143,7 +144,7 @@ export var InputCurrency = /*#__PURE__*/forwardRef(function (_ref, ref) {
143
144
  return;
144
145
  }
145
146
  if (stringValue === '' || stringValue === '-' || stringValue === decimalSeparator) {
146
- onChange && onChange(undefined, name, {
147
+ onValueChange && onValueChange(undefined, name, {
147
148
  "float": null,
148
149
  formatted: '',
149
150
  value: ''
@@ -181,15 +182,15 @@ export var InputCurrency = /*#__PURE__*/forwardRef(function (_ref, ref) {
181
182
  // });
182
183
 
183
184
  setStateValue(formattedValue);
184
- if (onChange) {
185
+ if (onValueChange) {
185
186
  var values = {
186
187
  "float": numberValue,
187
188
  formatted: formattedValue,
188
189
  value: stringValue
189
190
  };
190
- onChange(stringValue, name, values);
191
+ onValueChange(stringValue, name, values);
191
192
  }
192
- // onChange && onChange(stringValue);
193
+ // onValueChange && onValueChange(stringValue);
193
194
  };
194
195
 
195
196
  /**
@@ -200,6 +201,7 @@ export var InputCurrency = /*#__PURE__*/forwardRef(function (_ref, ref) {
200
201
  value = _event$target.value,
201
202
  selectionStart = _event$target.selectionStart;
202
203
  processChange(value, selectionStart);
204
+ if (onChange) onChange(event);
203
205
  };
204
206
 
205
207
  /**
@@ -231,8 +233,8 @@ export var InputCurrency = /*#__PURE__*/forwardRef(function (_ref, ref) {
231
233
  var formattedValue = formatValue(_extends({}, formatValueOptions, {
232
234
  value: newValue
233
235
  }));
234
- if (onChange && formatValueOnBlur) {
235
- onChange(newValue, name, {
236
+ if (onValueChange && formatValueOnBlur) {
237
+ onValueChange(newValue, name, {
236
238
  "float": numberValue,
237
239
  formatted: formattedValue,
238
240
  value: newValue
@@ -1,2 +1,2 @@
1
- import Notetip from "./note-tip";
1
+ import Notetip from "./notetip";
2
2
  export default Notetip;
@@ -14,13 +14,15 @@ import useResize from '../utils/use-resize';
14
14
  import { TableContext } from './table-context';
15
15
  import useScale, { withScale } from '../use-scale';
16
16
  import TableColumn from './table-column';
17
- import { ChevronLeft, ChevronRight } from '@helpdice/icons';
18
17
  import Pagination from '../pagination';
19
18
  import Button from '../button';
20
19
  import Tooltip from '../tooltip';
21
20
  import Placeholder from '../placeholder';
22
21
  import { useTheme } from '@helpdice/theme';
23
22
  import Loading from '../loading';
23
+ // icons
24
+ import ChevronLeft from "@helpdice/icons/curved/ChevronLeft";
25
+ import ChevronRight from "@helpdice/icons/curved/ChevronRight";
24
26
  function TableComponent(tableProps) {
25
27
  /* eslint-disable @typescript-eslint/no-unused-vars */
26
28
  var _ref = tableProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "2.6.1-beta.3",
3
+ "version": "2.6.1-beta.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -62,7 +62,7 @@
62
62
  "@babel/preset-react": "^7.14.5",
63
63
  "@babel/preset-typescript": "^7.14.5",
64
64
  "@babel/standalone": "^7.28.3",
65
- "@helpdice/icons": "1.2.7",
65
+ "@helpdice/icons": "1.3.8",
66
66
  "@helpdice/pro": "2.2.0",
67
67
  "@helpdice/sdk": "^0.4.3",
68
68
  "@helpdice/utils": "^0.1.4",
File without changes
File without changes
File without changes