@servicetitan/form 41.0.0 → 41.2.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/color-picker/color-picker.d.ts +1 -1
- package/dist/color-picker/color-picker.d.ts.map +1 -1
- package/dist/color-picker/color-picker.js.map +1 -1
- package/dist/date-range-picker/date-range-picker.d.ts +4 -3
- package/dist/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/date-range-picker/date-range-picker.js +1 -1
- package/dist/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/demo/color-picker.d.ts +1 -1
- package/dist/demo/color-picker.d.ts.map +1 -1
- package/dist/demo/color-picker.js.map +1 -1
- package/dist/demo/date-range-picker.d.ts +1 -1
- package/dist/demo/date-range-picker.d.ts.map +1 -1
- package/dist/demo/date-range-picker.js.map +1 -1
- package/dist/demo/file-uploader.d.ts +1 -1
- package/dist/demo/file-uploader.d.ts.map +1 -1
- package/dist/demo/file-uploader.js.map +1 -1
- package/dist/demo/input-date-mask.d.ts +1 -1
- package/dist/demo/input-date-mask.d.ts.map +1 -1
- package/dist/demo/input-date-mask.js.map +1 -1
- package/dist/demo/number-input.d.ts +1 -1
- package/dist/demo/number-input.d.ts.map +1 -1
- package/dist/demo/number-input.js.map +1 -1
- package/dist/demo/original-number-input.d.ts +1 -1
- package/dist/demo/original-number-input.d.ts.map +1 -1
- package/dist/demo/original-number-input.js.map +1 -1
- package/dist/demo/phone-number-input-a2.d.ts +1 -1
- package/dist/demo/phone-number-input-a2.d.ts.map +1 -1
- package/dist/demo/phone-number-input-a2.js.map +1 -1
- package/dist/demo/phone-number-input.d.ts +1 -1
- package/dist/demo/phone-number-input.d.ts.map +1 -1
- package/dist/demo/phone-number-input.js.map +1 -1
- package/dist/file-uploader/config.d.ts +1 -1
- package/dist/file-uploader/config.d.ts.map +1 -1
- package/dist/file-uploader/config.js.map +1 -1
- package/dist/file-uploader/file-uploader.d.ts.map +1 -1
- package/dist/file-uploader/file-uploader.js.map +1 -1
- package/dist/form-state-error-banner/form-state-error-banner.d.ts +1 -1
- package/dist/form-state-error-banner/form-state-error-banner.d.ts.map +1 -1
- package/dist/form-state-error-banner/form-state-error-banner.js.map +1 -1
- package/dist/input-date-mask/input-date-mask.d.ts +2 -2
- package/dist/input-date-mask/input-date-mask.d.ts.map +1 -1
- package/dist/input-date-mask/input-date-mask.js.map +1 -1
- package/dist/label/label.d.ts +1 -1
- package/dist/label/label.d.ts.map +1 -1
- package/dist/label/label.js.map +1 -1
- package/dist/masked-input.d.ts +3 -3
- package/dist/masked-input.d.ts.map +1 -1
- package/dist/masked-input.js.map +1 -1
- package/dist/number-input/get-formatted-string.d.ts +1 -1
- package/dist/number-input/get-formatted-string.d.ts.map +1 -1
- package/dist/number-input/get-formatted-string.js.map +1 -1
- package/dist/number-input/number-input.d.ts +3 -3
- package/dist/number-input/number-input.d.ts.map +1 -1
- package/dist/number-input/number-input.js.map +1 -1
- package/dist/number-input/process-value.d.ts +2 -2
- package/dist/number-input/process-value.d.ts.map +1 -1
- package/dist/number-input/process-value.js.map +1 -1
- package/dist/original-number-input/ordinal-number-input.d.ts +1 -1
- package/dist/original-number-input/ordinal-number-input.d.ts.map +1 -1
- package/dist/original-number-input/ordinal-number-input.js.map +1 -1
- package/dist/phone-number-input/phone-number-input-a2.d.ts +3 -3
- package/dist/phone-number-input/phone-number-input-a2.d.ts.map +1 -1
- package/dist/phone-number-input/phone-number-input-a2.js.map +1 -1
- package/dist/phone-number-input/phone-number-input.d.ts +1 -1
- package/dist/phone-number-input/phone-number-input.d.ts.map +1 -1
- package/dist/phone-number-input/phone-number-input.js.map +1 -1
- package/package.json +12 -12
- package/src/color-picker/color-picker.tsx +2 -1
- package/src/date-range-picker/date-range-picker.tsx +6 -5
- package/src/demo/color-picker.tsx +4 -2
- package/src/demo/date-range-picker.tsx +3 -2
- package/src/demo/file-uploader.tsx +4 -2
- package/src/demo/input-date-mask.tsx +2 -1
- package/src/demo/number-input.tsx +2 -1
- package/src/demo/original-number-input.tsx +2 -1
- package/src/demo/phone-number-input-a2.tsx +3 -2
- package/src/demo/phone-number-input.tsx +1 -1
- package/src/file-uploader/__tests__/uploader.test.ts +1 -1
- package/src/file-uploader/config.tsx +1 -1
- package/src/file-uploader/file-uploader.tsx +2 -1
- package/src/form-state-error-banner/form-state-error-banner.tsx +1 -1
- package/src/input-date-mask/input-date-mask.tsx +4 -2
- package/src/label/label.tsx +1 -1
- package/src/masked-input.tsx +5 -3
- package/src/number-input/__tests__/get-formatted-string.test.ts +1 -1
- package/src/number-input/__tests__/process-value.test.ts +1 -1
- package/src/number-input/get-formatted-string.ts +1 -1
- package/src/number-input/number-input.tsx +7 -12
- package/src/number-input/process-value.ts +2 -2
- package/src/original-number-input/ordinal-number-input.tsx +4 -2
- package/src/phone-number-input/__tests__/phone-number-input-a2.test.tsx +1 -1
- package/src/phone-number-input/phone-number-input-a2.tsx +6 -3
- package/src/phone-number-input/phone-number-input.tsx +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Banner } from '@servicetitan/design-system';
|
|
2
2
|
import { traverseFormState } from '@servicetitan/form-state';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
import { FormState, ValidatableMapOrArray } from 'formstate';
|
|
4
|
+
import type { FormState, ValidatableMapOrArray } from 'formstate';
|
|
5
5
|
|
|
6
6
|
export interface FormStateErrorBannerProps<T extends ValidatableMapOrArray> {
|
|
7
7
|
form: FormState<T>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { FC, ChangeEvent,
|
|
2
|
-
import {
|
|
1
|
+
import type { FC, ChangeEvent, InputHTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import type { InputProps } from '@servicetitan/design-system';
|
|
4
|
+
import { Input } from '@servicetitan/design-system';
|
|
3
5
|
import { action } from 'mobx';
|
|
4
6
|
import { useLocalStore, observer } from 'mobx-react';
|
|
5
7
|
import moment from 'moment';
|
package/src/label/label.tsx
CHANGED
package/src/masked-input.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { FC, InputHTMLAttributes, ChangeEvent } from 'react';
|
|
1
|
+
import type { FC, InputHTMLAttributes, ChangeEvent } from 'react';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import type { Props as ReactMaskedInputProps } from 'react-input-mask';
|
|
4
|
+
import ReactInputMask from 'react-input-mask';
|
|
5
|
+
import type { FormInputProps } from '@servicetitan/design-system';
|
|
6
|
+
import { Form } from '@servicetitan/design-system';
|
|
5
7
|
|
|
6
8
|
type MaskedInputProps = FormInputProps &
|
|
7
9
|
Omit<ReactMaskedInputProps, keyof InputHTMLAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { formatNumber as formatNumberDefault } from 'accounting';
|
|
2
2
|
|
|
3
|
-
import { EmptyValue, NumberValue, Separators } from './common-interfaces';
|
|
3
|
+
import type { EmptyValue, NumberValue, Separators } from './common-interfaces';
|
|
4
4
|
|
|
5
5
|
export type FormatNumber = (
|
|
6
6
|
value: number,
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
useState,
|
|
4
|
-
useEffect,
|
|
5
|
-
useRef,
|
|
6
|
-
SyntheticEvent,
|
|
7
|
-
KeyboardEvent,
|
|
8
|
-
FocusEvent,
|
|
9
|
-
} from 'react';
|
|
1
|
+
import type { SyntheticEvent, KeyboardEvent, FocusEvent } from 'react';
|
|
2
|
+
import { useCallback, useState, useEffect, useRef } from 'react';
|
|
10
3
|
|
|
11
4
|
import { useOptionalDependencies } from '@servicetitan/react-ioc';
|
|
12
5
|
|
|
13
|
-
import {
|
|
6
|
+
import type { InputProps, InputOnChangeData } from '@servicetitan/design-system';
|
|
7
|
+
import { Input } from '@servicetitan/design-system';
|
|
14
8
|
import { CULTURE_TOKEN } from '@servicetitan/culture';
|
|
15
9
|
|
|
16
10
|
import { processValue } from './process-value';
|
|
17
|
-
import { FormatNumber
|
|
18
|
-
import {
|
|
11
|
+
import type { FormatNumber } from './get-formatted-string';
|
|
12
|
+
import { getFormattedString } from './get-formatted-string';
|
|
13
|
+
import type { EmptyValue, NumberValue } from './common-interfaces';
|
|
19
14
|
import { formatNumber as formatNumberDefault } from 'accounting';
|
|
20
15
|
|
|
21
16
|
import debounce from 'debounce';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatNumber as formatNumberDefault } from 'accounting';
|
|
2
2
|
|
|
3
|
-
import { EmptyValue, NumberValue, Range, Separators } from './common-interfaces';
|
|
4
|
-
import { FormatNumber } from './get-formatted-string';
|
|
3
|
+
import type { EmptyValue, NumberValue, Range, Separators } from './common-interfaces';
|
|
4
|
+
import type { FormatNumber } from './get-formatted-string';
|
|
5
5
|
|
|
6
6
|
interface ProcessValueOptions<TEmpty extends EmptyValue> {
|
|
7
7
|
emptyValue: TEmpty;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InputProps } from '@servicetitan/design-system';
|
|
2
|
+
import { Input } from '@servicetitan/design-system';
|
|
2
3
|
import { action, observable, makeObservable } from 'mobx';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
|
-
import {
|
|
5
|
+
import type { ChangeEvent } from 'react';
|
|
6
|
+
import { Component } from 'react';
|
|
5
7
|
|
|
6
8
|
export interface OrdinalNumberInputProps extends Omit<InputProps, 'onChange'> {
|
|
7
9
|
min: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
2
2
|
import '@testing-library/jest-dom';
|
|
3
3
|
|
|
4
|
-
import { Culture } from '@servicetitan/culture';
|
|
4
|
+
import type { Culture } from '@servicetitan/culture';
|
|
5
5
|
|
|
6
6
|
// Mock useOptionalDependencies from react-ioc
|
|
7
7
|
const mockUseOptionalDependencies = jest.fn();
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { ChangeEvent, FC
|
|
1
|
+
import type { ChangeEvent, FC } from 'react';
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import ReactInputMask from 'react-input-mask';
|
|
3
4
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import type { TextFieldProps } from '@servicetitan/anvil2';
|
|
6
|
+
import { TextField } from '@servicetitan/anvil2';
|
|
7
|
+
import type { Culture } from '@servicetitan/culture';
|
|
8
|
+
import { CULTURE_TOKEN } from '@servicetitan/culture';
|
|
6
9
|
import { useOptionalDependencies } from '@servicetitan/react-ioc';
|
|
7
10
|
|
|
8
11
|
type PhoneNumberInputA2Props = TextFieldProps & {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import InputMask from 'react-input-mask';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { FormInputProps } from '@servicetitan/design-system';
|
|
5
|
+
import { Form } from '@servicetitan/design-system';
|
|
5
6
|
|
|
6
7
|
export interface PhoneNumberInputProps extends FormInputProps {
|
|
7
8
|
sip?: boolean;
|