@thx/controls 14.0.4 → 15.0.0
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/date/DatePicker/datepicker.stories.d.ts +7 -0
- package/dist/date/LocalDatePicker/MaskedDateInput.d.ts +7 -6
- package/dist/date/LocalDatePicker/localdatepicker.stories.d.ts +8 -0
- package/dist/date/LocalDatePicker/maskeddateinput.stories.d.ts +5 -0
- package/dist/date/LocalMonthSelect/localmonthselect.stories.d.ts +6 -0
- package/dist/date/LocalTimePicker/MaskedTimeInput.d.ts +7 -6
- package/dist/date/LocalTimePicker/localtimepicker.stories.d.ts +7 -0
- package/dist/date/LocalTimePicker/maskedtimeinput.stories.d.ts +7 -0
- package/dist/date/MonthDayPicker/monthdaypicker.stories.d.ts +7 -0
- package/dist/date/MonthYearPicker/monthyearpicker.stories.d.ts +8 -0
- package/dist/date/YearSelect/yearselect.stories.d.ts +7 -0
- package/dist/form/TForm/addeditforms.stories.d.ts +30 -0
- package/dist/form/TForm/tform.stories.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1241 -654
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/inputs/CreditCardInput/CreditCardInput.d.ts +14 -5
- package/dist/inputs/CreditCardInput/CreditCardNumberInput.d.ts +8 -0
- package/dist/inputs/CreditCardInput/creditcardinput.stories.d.ts +5 -0
- package/dist/inputs/CreditCardInput/index.d.ts +1 -1
- package/dist/inputs/MaskedInput/MaskedInput.d.ts +4 -11
- package/dist/inputs/MaskedInput/index.d.ts +1 -0
- package/dist/inputs/MaskedInput/maskedinput.stories.d.ts +6 -0
- package/dist/inputs/MaskedInput/useMaskedInput.d.ts +9 -0
- package/dist/inputs/PhoneInput/PhoneInput.d.ts +2 -1
- package/dist/inputs/PhoneInput/phoneinput.stories.d.ts +5 -0
- package/dist/inputs/RadioGroup/radiogroup.stories.d.ts +6 -0
- package/dist/inputs/Scriptel/withScriptel.d.ts +0 -1
- package/dist/inputs/ScriptelInput/scriptelnput.stories.d.ts +5 -0
- package/dist/inputs/SinInput/SinInput.d.ts +5 -4
- package/dist/inputs/SinInput/sininput.stories.d.ts +5 -0
- package/dist/inputs/TableInput/DropdownCell.d.ts +0 -1
- package/dist/inputs/TableInput/HoverCell.d.ts +0 -1
- package/dist/inputs/TableInput/MoneyCell.d.ts +0 -1
- package/dist/inputs/TableInput/MoneyEditCell.d.ts +0 -1
- package/dist/inputs/TableInput/MoneySumFooter.d.ts +0 -1
- package/dist/inputs/TableInput/StringEditCell.d.ts +0 -1
- package/dist/inputs/TableInput/main.story.d.ts +7 -0
- package/dist/inputs/TableInput/tableinput.stories.d.ts +6 -0
- package/dist/inputs/TableInput/withHover.story.d.ts +7 -0
- package/dist/money/MoneyCurrencyInput/MoneyCurrencyInput.d.ts +1 -1
- package/dist/money/MoneyCurrencyInput/moneycurrencyinput.stories.d.ts +5 -0
- package/dist/money/MoneyInput/MoneyInput.d.ts +3 -4
- package/dist/money/MoneyInput/moneyinput.stories.d.ts +6 -0
- package/dist/money/useMoneyInput.d.ts +6 -8
- package/package.json +32 -42
- package/dist/form/TForm/TFormInner.d.ts +0 -33
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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 {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentStory, Meta } from '@storybook/react';
|
|
2
|
+
import { CreditCardInput } from './CreditCardInput';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: ComponentStory<typeof CreditCardInput>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { CreditCardInput } from './CreditCardInput';
|
|
2
|
-
export type {
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentStory, Meta } from '@storybook/react';
|
|
2
|
+
import { MaskedInput } from './MaskedInput';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: ComponentStory<typeof MaskedInput>;
|
|
6
|
+
export declare const AutoUnmask: ComponentStory<typeof 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;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentStory, Meta } from '@storybook/react';
|
|
2
|
+
import { RadioGroup } from './RadioGroup';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: ComponentStory<typeof RadioGroup>;
|
|
6
|
+
export declare const WithoutRadioGroup: ComponentStory<typeof RadioGroup>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MaskedInputProps } from '../MaskedInput';
|
|
3
|
-
export interface SinInputProps {
|
|
4
|
-
|
|
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
|
|
7
|
+
export declare function SinInput(props: SinInputProps): JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { DropdownProps } from 'semantic-ui-react';
|
|
3
2
|
import type { TableCellProps } from './TableInput';
|
|
4
3
|
export declare function DropdownCell<D extends Record<string, unknown>>(dropdownProps: DropdownProps): (props: TableCellProps<D>) => JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentStory, Meta } from '@storybook/react';
|
|
2
|
+
import { MoneyCurrencyInput } from './MoneyCurrencyInput';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: ComponentStory<typeof MoneyCurrencyInput>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
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 |
|
|
9
|
-
defaultCurrency?:
|
|
7
|
+
value?: Money | MoneyObject;
|
|
8
|
+
defaultCurrency?: Currency;
|
|
10
9
|
onBlur?: (ev: any) => void;
|
|
11
10
|
prefix?: string;
|
|
12
11
|
showPrefix?: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ComponentStory, Meta } from '@storybook/react';
|
|
2
|
+
import { MoneyInput } from './MoneyInput';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Main: ComponentStory<typeof MoneyInput>;
|
|
6
|
+
export declare const MoreDecimals: ComponentStory<typeof MoneyInput>;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Currencies, IMoneyObject } from '@thx/money';
|
|
3
1
|
import Money from 'js-money';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
4
3
|
interface UseMoneyInputProps {
|
|
5
|
-
|
|
6
|
-
value?: Money
|
|
7
|
-
|
|
4
|
+
value?: Money;
|
|
5
|
+
onChange?: (value?: Money) => void;
|
|
6
|
+
onSet?: (value?: Money) => void;
|
|
8
7
|
prefix?: string;
|
|
9
8
|
showPrefix?: boolean;
|
|
10
9
|
wholeNumber?: boolean;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
11
|
+
declare type SetValueFn = (value?: Money) => void;
|
|
12
|
+
export declare function useMoneyInput(props: UseMoneyInputProps): [MutableRefObject<HTMLInputElement | null>, SetValueFn];
|
|
15
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thx/controls",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "A collection of components designed with SemanticUI.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/thr-consulting/thr-addons/issues"
|
|
@@ -18,70 +18,60 @@
|
|
|
18
18
|
"index.js"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"build": "
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"lint": "
|
|
28
|
-
"lint:fix": "
|
|
29
|
-
"sort": "
|
|
30
|
-
"depcheck": "depcheck",
|
|
21
|
+
"build": "thx build",
|
|
22
|
+
"build-storybook": "build-storybook",
|
|
23
|
+
"build:dev": "thx build:dev",
|
|
24
|
+
"build:prod": "thx build:prod",
|
|
25
|
+
"clean": "thx clean",
|
|
26
|
+
"deps": "thx -p *.stories.tsx,*.story.tsx -i style-loader,css-loader deps",
|
|
27
|
+
"lint": "thx lint",
|
|
28
|
+
"lint:fix": "thx lint:fix",
|
|
29
|
+
"sort": "thx sort",
|
|
31
30
|
"storybook": "start-storybook -p 8000 --ci",
|
|
32
|
-
"ts": "
|
|
31
|
+
"ts": "thx ts"
|
|
33
32
|
},
|
|
34
33
|
"eslintConfig": {
|
|
35
34
|
"parserOptions": {
|
|
36
35
|
"project": "./tsconfig-eslint.json"
|
|
37
36
|
}
|
|
38
37
|
},
|
|
39
|
-
"jest": {
|
|
40
|
-
"collectCoverageFrom": [
|
|
41
|
-
"<rootDir>/src/**/*.js",
|
|
42
|
-
"<rootDir>/src/**/*.ts"
|
|
43
|
-
],
|
|
44
|
-
"coverageDirectory": "<rootDir>/../../docs/assets/coverage/controls",
|
|
45
|
-
"testPathIgnorePatterns": [
|
|
46
|
-
"/node_modules/"
|
|
47
|
-
],
|
|
48
|
-
"transform": {
|
|
49
|
-
"^.+\\.[tj]sx?$": "<rootDir>/../../tools/jest-transform-server.js"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
38
|
"dependencies": {
|
|
53
|
-
"@js-joda/core": "^
|
|
54
|
-
"@thx/date": "^
|
|
55
|
-
"@thx/money": "^
|
|
56
|
-
"@thx/yup-types": "^
|
|
57
|
-
"@types/inputmask": "^5.0.
|
|
58
|
-
"@types/react-datepicker": "^
|
|
39
|
+
"@js-joda/core": "^4.0.0",
|
|
40
|
+
"@thx/date": "^15.0.0",
|
|
41
|
+
"@thx/money": "^15.0.0",
|
|
42
|
+
"@thx/yup-types": "^15.0.0",
|
|
43
|
+
"@types/inputmask": "^5.0.1",
|
|
44
|
+
"@types/react-datepicker": "^4.1.7",
|
|
45
|
+
"credit-card-type": "^9.1.0",
|
|
59
46
|
"debug": "^4.1.1",
|
|
60
47
|
"eventemitter3": "^4.0.0",
|
|
61
48
|
"flat": "^5.0.0",
|
|
62
|
-
"formik": "^2.
|
|
63
|
-
"inputmask": "^5.0.
|
|
49
|
+
"formik": "^2.2.9",
|
|
50
|
+
"inputmask": "^5.0.6",
|
|
64
51
|
"js-money": "^0.6.3",
|
|
65
52
|
"lodash": "^4.17.15",
|
|
66
|
-
"
|
|
53
|
+
"luhn": "^2.4.1",
|
|
54
|
+
"react-credit-cards": "^0.8.3",
|
|
55
|
+
"react-datepicker": "^4.2.1",
|
|
67
56
|
"react-table": "^7.6.3",
|
|
68
|
-
"
|
|
57
|
+
"social-insurance-number": "^0.2.2",
|
|
58
|
+
"use-deep-compare-effect": "1.4.0"
|
|
69
59
|
},
|
|
70
60
|
"devDependencies": {
|
|
71
|
-
"css-loader": "^
|
|
72
|
-
"style-loader": "^
|
|
61
|
+
"css-loader": "^6.3.0",
|
|
62
|
+
"style-loader": "^3.3.0"
|
|
73
63
|
},
|
|
74
64
|
"peerDependencies": {
|
|
75
|
-
"react": "
|
|
76
|
-
"react-dom": "
|
|
65
|
+
"react": "17.x",
|
|
66
|
+
"react-dom": "17.x",
|
|
77
67
|
"react-router-dom": "5.x",
|
|
78
|
-
"semantic-ui-react": "
|
|
68
|
+
"semantic-ui-react": "2.x"
|
|
79
69
|
},
|
|
80
70
|
"engines": {
|
|
81
|
-
"node": ">=
|
|
71
|
+
"node": ">=14"
|
|
82
72
|
},
|
|
83
73
|
"publishConfig": {
|
|
84
74
|
"access": "public"
|
|
85
75
|
},
|
|
86
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "6e448208ce9112a61ee68c5daffbf7d59615cf41"
|
|
87
77
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { FormikProps } from 'formik';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export interface TFormChildrenProps<Values> extends FormikProps<Values> {
|
|
4
|
-
renderWarnings: () => JSX.Element | null;
|
|
5
|
-
hasErrors: boolean;
|
|
6
|
-
hasWarnings: boolean;
|
|
7
|
-
fieldError: (fieldName: keyof Values | string | number) => boolean;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
errorMarkedCleared: boolean;
|
|
10
|
-
submitDisabled: boolean;
|
|
11
|
-
formError: boolean;
|
|
12
|
-
}
|
|
13
|
-
interface ApolloError {
|
|
14
|
-
message?: string;
|
|
15
|
-
graphQLErrors?: {
|
|
16
|
-
message?: string;
|
|
17
|
-
}[];
|
|
18
|
-
}
|
|
19
|
-
export interface TFormProps<Values> {
|
|
20
|
-
children?: ((props: TFormChildrenProps<Values>) => React.ReactNode) | React.ReactNode;
|
|
21
|
-
loading?: boolean;
|
|
22
|
-
error?: ApolloError;
|
|
23
|
-
onValidate?: (isValid: boolean) => void;
|
|
24
|
-
getSubmitFn?: (submitFormFn: () => Promise<void> | Promise<any>) => void;
|
|
25
|
-
onChange?: (values: Values) => void;
|
|
26
|
-
}
|
|
27
|
-
interface TFormInnerProps<Values> {
|
|
28
|
-
formikProps: FormikProps<Values>;
|
|
29
|
-
tFormProps: TFormProps<Values>;
|
|
30
|
-
children?: ((props: TFormChildrenProps<Values>) => React.ReactNode) | React.ReactNode;
|
|
31
|
-
}
|
|
32
|
-
export declare function TFormInner<Values>(props: TFormInnerProps<Values>): JSX.Element | null;
|
|
33
|
-
export {};
|