@thx/controls 14.2.0 → 15.1.1

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,16 @@
1
1
  /// <reference types="react" />
2
- import { CreditCardCardNameEnum } from '@thx/yup-types';
3
- import { MaskedInputProps } from '../MaskedInput';
4
- export interface CreditCardInputType {
5
- cardType?: (cardType: CreditCardCardNameEnum | undefined) => void;
2
+ import type { LocalDate } from '@js-joda/core';
3
+ import 'react-credit-cards/es/styles-compiled.css';
4
+ import { InputProps } from 'semantic-ui-react';
5
+ import './styles.css';
6
+ export interface CreditCardData {
7
+ number?: string;
8
+ name?: string;
9
+ cvc?: string;
10
+ expiry?: LocalDate;
6
11
  }
7
- export declare function CreditCardInput({ cardType, ...rest }: CreditCardInputType & Omit<MaskedInputProps, 'mask'>): JSX.Element;
12
+ export declare type CreditCardInputProps = {
13
+ value?: CreditCardData;
14
+ onChange?: (data: CreditCardData) => void;
15
+ } & Pick<InputProps, 'disabled' | 'onBlur'>;
16
+ export declare function CreditCardInput(props: CreditCardInputProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { InputProps } from 'semantic-ui-react';
3
+ interface CreditCardNumberInputProps {
4
+ onChange?: (value: string | undefined) => void;
5
+ value?: string;
6
+ }
7
+ export declare function CreditCardNumberInput(props: CreditCardNumberInputProps & Omit<InputProps, 'onChange'>): JSX.Element;
8
+ export {};
@@ -1,2 +1,2 @@
1
1
  export { CreditCardInput } from './CreditCardInput';
2
- export type { CreditCardInputType } from './CreditCardInput';
2
+ export type { CreditCardInputProps } from './CreditCardInput';
@@ -1,15 +1,8 @@
1
1
  /// <reference types="react" />
2
- import Inputmask from 'inputmask';
3
2
  import { InputProps } from 'semantic-ui-react';
4
- /**
5
- * See source code for detailed prop types or {@link https://github.com/RobinHerbots/jquery.inputmask|here} for more info.
6
- * @typedef {Object} inputmaskPropTypes
7
- */
8
- export interface MaskedInputProps {
3
+ import { UseMaskedInputProps } from './useMaskedInput';
4
+ export declare type MaskedInputProps = {
9
5
  name?: string;
10
- value?: string;
11
- onChange?: (value?: string) => void;
12
6
  onBlur?: (event: any) => void;
13
- mask?: Inputmask.Options;
14
- }
15
- export declare function MaskedInput(props: MaskedInputProps & Omit<InputProps, 'onChange'>): JSX.Element;
7
+ } & UseMaskedInputProps & Omit<InputProps, 'onChange'>;
8
+ export declare function MaskedInput(props: MaskedInputProps): JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export { MaskedInput } from './MaskedInput';
2
+ export { useMaskedInput } from './useMaskedInput';
2
3
  export type { MaskedInputProps } from './MaskedInput';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import Inputmask from 'inputmask';
3
+ export interface UseMaskedInputProps {
4
+ value?: string;
5
+ onChange?: (value?: string) => void;
6
+ mask?: Inputmask.Options;
7
+ onSet?: (value?: string) => void;
8
+ }
9
+ export declare function useMaskedInput(props: UseMaskedInputProps): import("react").MutableRefObject<HTMLInputElement | null>;
@@ -2,5 +2,6 @@
2
2
  import { MaskedInputProps } from '../MaskedInput';
3
3
  export interface PhoneInputProps {
4
4
  extension?: boolean;
5
+ onChange?: (value?: string) => void;
5
6
  }
6
- export declare function PhoneInput(props: PhoneInputProps & Omit<MaskedInputProps, 'mask'>): JSX.Element;
7
+ export declare function PhoneInput(props: PhoneInputProps & Omit<MaskedInputProps, 'mask' | 'onChange'>): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ScriptelProps } from './Scriptel';
2
3
  /**
3
4
  * A HoC that provides a connection to a Scriptel Omniscript device.
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { MaskedInputProps } from '../MaskedInput';
3
- export interface SinInputProps {
4
- hasSin: boolean;
2
+ import type { MaskedInputProps } from '../MaskedInput';
3
+ export interface SinInputProps extends Omit<MaskedInputProps, 'mask'> {
4
+ value?: string;
5
+ onChange(value?: string): void;
5
6
  }
6
- export declare function SinInput(props: SinInputProps & Omit<MaskedInputProps, 'mask' | 'name'>): JSX.Element;
7
+ export declare function SinInput(props: SinInputProps): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { DropdownProps } from 'semantic-ui-react';
2
3
  import type { TableCellProps } from './TableInput';
3
4
  export declare function DropdownCell<D extends Record<string, unknown>>(dropdownProps: DropdownProps): (props: TableCellProps<D>) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { CellProps, Renderer } from 'react-table';
2
3
  interface HoverCellOptions<D extends Record<string, unknown>> {
3
4
  Action: Renderer<CellProps<D>>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type Money from 'js-money';
2
3
  import type { CellProps } from 'react-table';
3
4
  interface MoneyCellOptions<D extends Record<string, unknown>> {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type Money from 'js-money';
2
3
  import type { TableCellProps } from './TableInput';
3
4
  import type { AddRowOnTabIf } from './addRowOnTab';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { IdType, TableInstance } from 'react-table';
2
3
  interface MoneySumFooterOptions<A extends Record<string, unknown>> {
3
4
  id: IdType<A>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InputProps } from 'semantic-ui-react';
2
3
  import type { TableCellProps } from './TableInput';
3
4
  import type { AddRowOnTabIf } from './addRowOnTab';
@@ -2,7 +2,7 @@
2
2
  import { InputProps } from 'semantic-ui-react';
3
3
  import type { MoneyInputProps } from '../MoneyInput';
4
4
  export interface MoneyCurrencyInputProps extends MoneyInputProps {
5
- currencyOptions?: {
5
+ currencies?: {
6
6
  key: string;
7
7
  value: string;
8
8
  text: string;
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
- import type { Currencies, IMoneyObject } from '@thx/money';
3
- import type Money from 'js-money';
2
+ import Money, { Currency, MoneyObject } from 'js-money';
4
3
  import { InputProps } from 'semantic-ui-react';
5
4
  export interface MoneyInputProps {
6
5
  name?: string;
7
6
  onChange?: (value: Money) => void;
8
- value?: Money | IMoneyObject;
9
- defaultCurrency?: Currencies.Currency;
7
+ value?: Money | MoneyObject;
8
+ defaultCurrency?: Currency;
10
9
  onBlur?: (ev: any) => void;
11
10
  prefix?: string;
12
11
  showPrefix?: boolean;
@@ -1,14 +1,13 @@
1
- import { Currencies, IMoneyObject } from '@thx/money';
2
1
  import Money from 'js-money';
2
+ import { MutableRefObject } from 'react';
3
3
  interface UseMoneyInputProps {
4
- onChange?: (value: Money) => void;
5
- value?: Money | IMoneyObject;
6
- defaultCurrency?: Currencies.Currency;
4
+ value?: Money;
5
+ onChange?: (value?: Money) => void;
6
+ onSet?: (value?: Money) => void;
7
7
  prefix?: string;
8
8
  showPrefix?: boolean;
9
9
  wholeNumber?: boolean;
10
10
  }
11
- export declare function useMoneyInput(props: UseMoneyInputProps): {
12
- inputElement: import("react").MutableRefObject<HTMLInputElement | null>;
13
- };
11
+ declare type SetValueFn = (value?: Money) => void;
12
+ export declare function useMoneyInput(props: UseMoneyInputProps): [MutableRefObject<HTMLInputElement | null>, SetValueFn];
14
13
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thx/controls",
3
- "version": "14.2.0",
3
+ "version": "15.1.1",
4
4
  "description": "A collection of components designed with SemanticUI.",
5
5
  "bugs": {
6
6
  "url": "https://github.com/thr-consulting/thr-addons/issues"
@@ -19,10 +19,11 @@
19
19
  ],
20
20
  "scripts": {
21
21
  "build": "thx build",
22
+ "build-storybook": "build-storybook",
22
23
  "build:dev": "thx build:dev",
23
24
  "build:prod": "thx build:prod",
24
25
  "clean": "thx clean",
25
- "deps": "thx -p *.stories.tsx -i style-loader,css-loader deps",
26
+ "deps": "thx -p *.stories.tsx,*.story.tsx -i style-loader,css-loader deps",
26
27
  "lint": "thx lint",
27
28
  "lint:fix": "thx lint:fix",
28
29
  "sort": "thx sort",
@@ -36,11 +37,12 @@
36
37
  },
37
38
  "dependencies": {
38
39
  "@js-joda/core": "^4.0.0",
39
- "@thx/date": "^14.2.0",
40
- "@thx/money": "^14.2.0",
41
- "@thx/yup-types": "^14.2.0",
40
+ "@thx/date": "^15.1.1",
41
+ "@thx/money": "^15.1.1",
42
+ "@thx/yup-types": "^15.1.1",
42
43
  "@types/inputmask": "^5.0.1",
43
44
  "@types/react-datepicker": "^4.1.7",
45
+ "credit-card-type": "^9.1.0",
44
46
  "debug": "^4.1.1",
45
47
  "eventemitter3": "^4.0.0",
46
48
  "flat": "^5.0.0",
@@ -48,8 +50,11 @@
48
50
  "inputmask": "^5.0.6",
49
51
  "js-money": "^0.6.3",
50
52
  "lodash": "^4.17.15",
53
+ "luhn": "^2.4.1",
54
+ "react-credit-cards": "^0.8.3",
51
55
  "react-datepicker": "^4.2.1",
52
56
  "react-table": "^7.6.3",
57
+ "social-insurance-number": "^0.2.2",
53
58
  "use-deep-compare-effect": "1.4.0"
54
59
  },
55
60
  "devDependencies": {
@@ -68,5 +73,5 @@
68
73
  "publishConfig": {
69
74
  "access": "public"
70
75
  },
71
- "gitHead": "f2263570d349ddf1e2556f81515a178002374b9f"
76
+ "gitHead": "71c2dabf3b35fc12e48244dfc8a84bfa5a5bf3f7"
72
77
  }