@npm-zenwork/tax-remittance-ui 0.1.12 → 0.1.14
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/components/entities/EntityActionsMenu.d.ts +7 -0
- package/dist/components/entities/entityListUtils.d.ts +8 -0
- package/dist/components/forms/StateSearchSelect.d.ts +20 -0
- package/dist/components/payments/stateIdInput.d.ts +47 -0
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +9168 -8782
- package/dist/index.mjs.map +1 -1
- package/dist/lib/entityFormUtils.d.ts +6 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityDetailsResponse } from '../../types/entity';
|
|
2
|
+
interface EntityActionsMenuProps {
|
|
3
|
+
entity: EntityDetailsResponse;
|
|
4
|
+
onEdit: (entity: EntityDetailsResponse) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function EntityActionsMenu({ entity, onEdit }: EntityActionsMenuProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { EntityDetailsResponse } from '../../types/entity';
|
|
2
2
|
export declare function formatEin(idNumber: string): string;
|
|
3
|
+
export declare function formatSsn(idNumber: string): string;
|
|
4
|
+
/** Format a stored 9-digit id for display: SSN for Individual, EIN otherwise. */
|
|
5
|
+
export declare function formatIdNumber(idNumber: string, accountType: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format an id as the user types — strips non-digits, caps at 9 digits, and
|
|
8
|
+
* inserts dashes for the appropriate mask (SSN `XXX-XX-XXXX`, EIN `XX-XXXXXXX`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatIdNumberInput(value: string, accountType: string): string;
|
|
3
11
|
export declare function formatPhone(phoneNumber: string): string;
|
|
4
12
|
export declare function formatJoinedDate(date: string): string;
|
|
5
13
|
export declare function getJoinedYear(date: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface StateOption {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
interface StateSearchSelectProps {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (code: string) => void;
|
|
9
|
+
options: StateOption[];
|
|
10
|
+
required?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Searchable state dropdown — the same search-and-filter behavior as the state
|
|
17
|
+
* payment "Choose a State" picker, styled to sit inside a form as a field.
|
|
18
|
+
*/
|
|
19
|
+
export declare function StateSearchSelect({ label, value, onChange, options, required, disabled, error, placeholder, }: StateSearchSelectProps): import("react").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live input restrictions for the State ID field, derived from the backend
|
|
3
|
+
* validation-metadata regex (`stateId.pattern`). Mirrors the SSN/EIN entry
|
|
4
|
+
* restrictions on the entity form: strip characters that can never be valid,
|
|
5
|
+
* normalize case, and cap the length — without ever blocking a valid value.
|
|
6
|
+
*
|
|
7
|
+
* The catalog patterns only use digit runs (`\d{n}` / `\d{n,m}`), literal
|
|
8
|
+
* uppercase letters, letter classes (`[A-Z]`), and the separators `-`, ` `,
|
|
9
|
+
* and `/`. The helpers below understand exactly that subset.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Sanitize a State ID as the user types: uppercase (validation uppercases
|
|
13
|
+
* anyway), then drop any character the selected state's format can't contain.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeStateId(value: string, pattern: string | null | undefined): string;
|
|
16
|
+
export type StateIdSlotKind = 'digit' | 'letter';
|
|
17
|
+
export type StateIdMaskToken = {
|
|
18
|
+
type: 'slot';
|
|
19
|
+
kind: StateIdSlotKind;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'separator';
|
|
22
|
+
char: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Turn a linear metadata pattern into an ordered mask so separators (`-`, ` `,
|
|
26
|
+
* `/`) can be auto-inserted as the user types — e.g. `\d{2}-\d{7}` yields two
|
|
27
|
+
* digit slots, a `-`, then seven digit slots, so `121234567` displays as
|
|
28
|
+
* `12-1234567`.
|
|
29
|
+
*
|
|
30
|
+
* Returns `null` when the pattern isn't a single fixed layout — alternations
|
|
31
|
+
* (`(?:…|…)`) or variable runs (`{n,m}`) have no unambiguous mask, so the
|
|
32
|
+
* caller keeps the plain sanitize behavior instead.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildStateIdMask(pattern: string | null | undefined): StateIdMaskToken[] | null;
|
|
35
|
+
/**
|
|
36
|
+
* Format a State ID against its mask as the user types: uppercase, keep only
|
|
37
|
+
* characters that fit each slot (in order), and auto-insert separators. A
|
|
38
|
+
* trailing separator isn't shown until the following slot has a character.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatStateId(value: string, tokens: StateIdMaskToken[]): string;
|
|
41
|
+
/**
|
|
42
|
+
* Longest string the `pattern` can match — used as the input `maxLength` so the
|
|
43
|
+
* field can't accept more characters than any accepted format. Returns
|
|
44
|
+
* `undefined` when the pattern uses a construct these helpers don't model, so
|
|
45
|
+
* the caller simply omits the cap rather than risk blocking a valid value.
|
|
46
|
+
*/
|
|
47
|
+
export declare function maxStateIdLength(pattern: string | null | undefined): number | undefined;
|