react-restyle-components 0.3.45 → 0.3.47

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.
@@ -7,7 +7,7 @@ interface TextInputDropdownProps {
7
7
  value?: string;
8
8
  defaultValue?: string;
9
9
  onChange?: (item: string) => void;
10
- onBlur?: (event: React.FocusEvent<HTMLInputElement>, value?: string) => void;
10
+ onBlur?: (event: React.FocusEvent<HTMLInputElement> | null, value?: string) => void;
11
11
  disabled?: boolean;
12
12
  allowCustomInput?: boolean;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/text-input-dropdown/text-input-dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,qIAW3B,sBAAsB,4CA0PxB,CAAC"}
1
+ {"version":3,"file":"text-input-dropdown.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/atoms/text-input-dropdown/text-input-dropdown.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,CACP,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,IAAI,EAChD,KAAK,CAAC,EAAE,MAAM,KACX,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,qIAW3B,sBAAsB,4CA0PxB,CAAC"}
@@ -56,6 +56,8 @@ export const TextInputDropdown = ({ items, className, hasError, placeholder = 'S
56
56
  setIsOpen(false);
57
57
  setIsEditing(false);
58
58
  onChange && onChange(item);
59
+ if (item)
60
+ onBlur && onBlur(null, item); // Trigger onBlur when selection changes
59
61
  };
60
62
  const handleInputClick = () => {
61
63
  if (!disabled) {
@@ -1,4 +1,4 @@
1
- export * from './src/utility.util';
1
+ export * from './src/utility/utility.util';
2
2
  export * from './src/calculation/calculation.util';
3
3
  export * from './src/convert/numberToWords/numToWords.util';
4
4
  export * from './src/convert/typography/camelCaseToTitleCase.util';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oDAAoD,CAAC;AACnE,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './src/utility.util';
1
+ export * from './src/utility/utility.util';
2
2
  export * from './src/calculation/calculation.util';
3
3
  export * from './src/convert/numberToWords/numToWords.util';
4
4
  export * from './src/convert/typography/camelCaseToTitleCase.util';
@@ -1,4 +1,4 @@
1
- export * from './utility.util';
1
+ export * from './utility/utility.util';
2
2
  export * from './calculation/calculation.util';
3
3
  export * from './convert/numberToWords/numToWords.util';
4
4
  export * from './convert/typography/camelCaseToTitleCase.util';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core-utils/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core-utils/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './utility.util';
1
+ export * from './utility/utility.util';
2
2
  export * from './calculation/calculation.util';
3
3
  export * from './convert/numberToWords/numToWords.util';
4
4
  export * from './convert/typography/camelCaseToTitleCase.util';
@@ -0,0 +1,4 @@
1
+ export declare const debounce: any;
2
+ export declare const calculateHoursDifference: (date1: Date, date2: Date) => number;
3
+ export declare const calculateHoursDifferenceDecimal: (date1: Date, date2: Date) => number;
4
+ //# sourceMappingURL=utility.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility.util.d.ts","sourceRoot":"","sources":["../../../../../src/core-utils/src/utility/utility.util.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAEb,CAAC;AAET,eAAO,MAAM,wBAAwB,UAAW,IAAI,SAAS,IAAI,KAAG,MAGnE,CAAC;AAEF,eAAO,MAAM,+BAA+B,UACnC,IAAI,SACJ,IAAI,KACV,MAGF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import * as _ from 'lodash';
2
+ export const debounce = _.debounce((fun) => {
3
+ fun();
4
+ }, 1000);
5
+ export const calculateHoursDifference = (date1, date2) => {
6
+ const diffInMs = Math.abs(date2.getTime() - date1.getTime());
7
+ return Math.floor(diffInMs / (1000 * 60 * 60));
8
+ };
9
+ export const calculateHoursDifferenceDecimal = (date1, date2) => {
10
+ const diffInMs = Math.abs(date2.getTime() - date1.getTime());
11
+ return diffInMs / (1000 * 60 * 60);
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-restyle-components",
3
- "version": "0.3.45",
3
+ "version": "0.3.47",
4
4
  "private": false,
5
5
  "description": "Easy use restyle components",
6
6
  "author": {
@@ -1,2 +0,0 @@
1
- export declare const debounce: any;
2
- //# sourceMappingURL=utility.util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utility.util.d.ts","sourceRoot":"","sources":["../../../../src/core-utils/src/utility.util.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,KAEb,CAAC"}
@@ -1,4 +0,0 @@
1
- import * as _ from 'lodash';
2
- export const debounce = _.debounce((fun) => {
3
- fun();
4
- }, 1000);