@selectwin/kit 0.1.46 → 0.1.48
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/SelectFilterBar.d.ts +12 -0
- package/dist/SelectPaymentBrand.d.ts +27 -0
- package/dist/SelectRepeatingFieldArray.d.ts +11 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3126 -3092
- package/dist/style.css +1 -1
- package/package.json +6 -3
|
@@ -9,6 +9,18 @@ export interface SelectFilterDef {
|
|
|
9
9
|
value: string;
|
|
10
10
|
}[];
|
|
11
11
|
pinned?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The value is set but NOT usable — say so on the filter itself.
|
|
14
|
+
*
|
|
15
|
+
* The case this exists for: a filter the caller refuses to send to the backend (a public id with
|
|
16
|
+
* the wrong prefix would be a 400, so the list is queried without it). Without this, the only
|
|
17
|
+
* place to say so is a banner above the table — far from the facet that caused it, while the
|
|
18
|
+
* facet keeps looking applied and the list keeps looking filtered. Here the facet turns critical,
|
|
19
|
+
* the message shows inside its popover, and the applied tag carries it too.
|
|
20
|
+
*
|
|
21
|
+
* It's a message ABOUT the value, not a block: the bar never drops or rewrites what was typed.
|
|
22
|
+
*/
|
|
23
|
+
error?: string;
|
|
12
24
|
}
|
|
13
25
|
type SelectFilterBarOwnProps = {
|
|
14
26
|
filters: SelectFilterDef[];
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
export interface SelectCardBrand {
|
|
2
|
+
/** Canonical slug — what the API stores and what should be written back. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** Human label ("American Express", not "amex"). */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Icon base name under the payicons CDN. */
|
|
7
|
+
file: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* THE card-brand vocabulary — exported as data, not just baked into the icon lookup.
|
|
11
|
+
*
|
|
12
|
+
* Anything that lets someone CHOOSE a brand (an MDR sheet row, a brand allowlist, a filter facet)
|
|
13
|
+
* needs the same list with human labels. Before this it had to be retyped in the app, with a
|
|
14
|
+
* comment asking the next person to keep it in sync by hand — so the picker and the icons could
|
|
15
|
+
* drift, and the failure mode was silent: a brand missing from the copy simply couldn't be priced.
|
|
16
|
+
*
|
|
17
|
+
* Ordered by how often it shows up in Brazilian card volume, so a `<select>` built straight from
|
|
18
|
+
* this puts the common brands first. Use `value` for storage and `label` for display.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SELECT_CARD_BRANDS: readonly SelectCardBrand[];
|
|
21
|
+
/** `"American Express"`, `"AMEX"`, `"diners-club"` → the canonical entry, or null if unknown. */
|
|
22
|
+
export declare function selectCardBrand(brand: string | undefined | null): SelectCardBrand | null;
|
|
23
|
+
/**
|
|
24
|
+
* Human label for a stored slug. An UNKNOWN brand comes back **as it was given** — never "—" and
|
|
25
|
+
* never blank: a brand the kit ships no icon for is still the only information the row has.
|
|
26
|
+
*/
|
|
27
|
+
export declare function selectCardBrandLabel(brand: string): string;
|
|
1
28
|
export declare function SelectPaymentBrand({ method, cardBrand,
|
|
2
29
|
/** Chip height in px; width is derived to a card aspect ratio (1.2). Default 24×29. */
|
|
3
30
|
size,
|
|
@@ -23,9 +23,19 @@ export interface SelectRepeatingFieldArrayProps<T> {
|
|
|
23
23
|
rowLabel?: (index: number, item: T) => ReactNode;
|
|
24
24
|
min?: number;
|
|
25
25
|
max?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Block "add" for a reason that ISN'T a count — the caller's own rule (a vocabulary the rows draw
|
|
28
|
+
* from is exhausted, a prerequisite isn't met, the form is read-only).
|
|
29
|
+
*
|
|
30
|
+
* Without it the only lever is `max`, which callers end up setting to `items.length` to mean "not
|
|
31
|
+
* now". That works but states something false: `max` is the array's capacity, and pinning it to
|
|
32
|
+
* the current length says the list is full when the truth is that the NEXT row has nothing valid
|
|
33
|
+
* to be. Pair with `helpText` — a disabled button with no reason next to it is a dead end.
|
|
34
|
+
*/
|
|
35
|
+
addDisabled?: boolean;
|
|
26
36
|
reorderable?: boolean;
|
|
27
37
|
chrome?: 'card' | 'bare';
|
|
28
38
|
emptyState?: ReactNode;
|
|
29
39
|
helpText?: ReactNode;
|
|
30
40
|
}
|
|
31
|
-
export declare function SelectRepeatingFieldArray<T extends object>({ items, onChange, renderRow, newItem, addLabel, rowLabel, min, max, reorderable, chrome, emptyState, helpText, }: SelectRepeatingFieldArrayProps<T>): import("react").JSX.Element;
|
|
41
|
+
export declare function SelectRepeatingFieldArray<T extends object>({ items, onChange, renderRow, newItem, addLabel, rowLabel, min, max, addDisabled, reorderable, chrome, emptyState, helpText, }: SelectRepeatingFieldArrayProps<T>): import("react").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,8 @@ export { SelectSegmented } from './SelectSegmented';
|
|
|
25
25
|
export { SelectBadge } from './SelectBadge';
|
|
26
26
|
export { SelectStatusBadge, SELECT_TRANSACTION_STATUS } from './SelectStatusBadge';
|
|
27
27
|
export { SelectActionMenu } from './SelectActionMenu';
|
|
28
|
-
export { SelectPaymentBrand } from './SelectPaymentBrand';
|
|
28
|
+
export { SelectPaymentBrand, SELECT_CARD_BRANDS, selectCardBrand, selectCardBrandLabel } from './SelectPaymentBrand';
|
|
29
|
+
export type { SelectCardBrand } from './SelectPaymentBrand';
|
|
29
30
|
export { SelectJsonViewer } from './SelectJsonViewer';
|
|
30
31
|
export type { SelectJsonViewerProps } from './SelectJsonViewer';
|
|
31
32
|
export { SelectTimeline } from './SelectTimeline';
|