@gridkitjs/forms-core 0.0.0-dev-20261206092422 → 0.0.0-dev-20261206150419
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/index.d.ts +1038 -181
- package/dist/index.js +1281 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -444,6 +444,8 @@ interface FormsMessages {
|
|
|
444
444
|
requiredChecked: string;
|
|
445
445
|
/** A required switch is off. */
|
|
446
446
|
requiredOn: string;
|
|
447
|
+
/** A required choice list has nothing chosen. */
|
|
448
|
+
requiredChoice: string;
|
|
447
449
|
/** The text is shorter than `minLength`. */
|
|
448
450
|
tooShort: (min: number) => string;
|
|
449
451
|
/** The text is longer than `maxLength`. */
|
|
@@ -612,6 +614,48 @@ interface FormsMessages {
|
|
|
612
614
|
fieldHelp: string;
|
|
613
615
|
/** A search input's placeholder. */
|
|
614
616
|
searchPlaceholder: string;
|
|
617
|
+
/** The button beside a choice list's search box that opens its options. */
|
|
618
|
+
showOptions: string;
|
|
619
|
+
/** Shown in a choice list that has no options at all. */
|
|
620
|
+
noOptions: string;
|
|
621
|
+
/** Announced once a choice list's search has settled on its options. */
|
|
622
|
+
resultCount: (count: number) => string;
|
|
623
|
+
/** Announced once a choice list's search has settled on none; `query` as typed. */
|
|
624
|
+
noMatches: (query: string) => string;
|
|
625
|
+
/** Announced as an option is ticked or unticked in a list taking several values. */
|
|
626
|
+
selectedCount: (count: number) => string;
|
|
627
|
+
/** Shown in a choice list whose source searches only from `min` characters. */
|
|
628
|
+
typeMore: (min: number) => string;
|
|
629
|
+
/** Shown and announced when a choice list's options failed to load. */
|
|
630
|
+
optionsFailed: string;
|
|
631
|
+
/** The row that asks a failed choice list's source again. */
|
|
632
|
+
retry: string;
|
|
633
|
+
/** The count of chosen options a collapsed field does not show: "+3". */
|
|
634
|
+
moreChosen: (count: number) => string;
|
|
635
|
+
/** The same count read by a screen reader: "and 3 more". */
|
|
636
|
+
moreChosenLabel: (count: number) => string;
|
|
637
|
+
/** The name of the list of chosen options' chips. */
|
|
638
|
+
chosenList: string;
|
|
639
|
+
/** A chip's remove button. */
|
|
640
|
+
removeChoice: (label: string) => string;
|
|
641
|
+
/** Announced as a chip is removed. */
|
|
642
|
+
choiceRemoved: (label: string) => string;
|
|
643
|
+
/** The row that chooses every option shown. */
|
|
644
|
+
selectAll: string;
|
|
645
|
+
/** The same row when the list holds only the options loaded so far. */
|
|
646
|
+
selectAllLoaded: (count: number) => string;
|
|
647
|
+
/** The row that creates an option from the search text. */
|
|
648
|
+
createOption: (text: string) => string;
|
|
649
|
+
/** Shown when the app could not create an option from `text`. */
|
|
650
|
+
createFailed: (text: string) => string;
|
|
651
|
+
/** A chosen key whose option no longer exists; `label` is the key as text. */
|
|
652
|
+
optionMissing: (label: string) => string;
|
|
653
|
+
/** More options chosen than `maxCount` allows. */
|
|
654
|
+
tooManyChoices: (max: number) => string;
|
|
655
|
+
/** Fewer options chosen than `minCount` asks for. */
|
|
656
|
+
tooFewChoices: (min: number) => string;
|
|
657
|
+
/** Shown and announced once `maxCount` options are chosen. */
|
|
658
|
+
maxChoicesReached: (max: number) => string;
|
|
615
659
|
/** Read before a message, naming its severity. */
|
|
616
660
|
severityLabel: (severity: Severity) => string;
|
|
617
661
|
/** How many messages of one severity a summary holds. */
|
|
@@ -704,6 +748,978 @@ declare function booleanFormatter(words: BooleanWords): (value: boolean | null,
|
|
|
704
748
|
/** Reads a toggle's words back as its value; anything else is `null`. */
|
|
705
749
|
declare function booleanParser(words: BooleanWords): (text: string, context: ParseContext<boolean>) => ParseResult<boolean>;
|
|
706
750
|
|
|
751
|
+
/** One message a field holds, ready to show. */
|
|
752
|
+
interface FieldMessage {
|
|
753
|
+
readonly severity: Severity;
|
|
754
|
+
/** The text shown, already localized. */
|
|
755
|
+
readonly text: string;
|
|
756
|
+
/**
|
|
757
|
+
* A stable id for the kind of message: `"unreadable"`, `"required"`,
|
|
758
|
+
* `"tooShort"`, `"tooLong"`, `"pattern"`, `"refused"`, or the app's own;
|
|
759
|
+
* `null` when it has none.
|
|
760
|
+
*/
|
|
761
|
+
readonly code: string | null;
|
|
762
|
+
/**
|
|
763
|
+
* Where it came from: reading the text (`"parse"`), a validator
|
|
764
|
+
* (`"validate"`), a refused commit (`"commit"`) or the app (`"app"`).
|
|
765
|
+
* Growable: a later release may add a source.
|
|
766
|
+
*/
|
|
767
|
+
readonly source: "parse" | "validate" | "commit" | "app";
|
|
768
|
+
}
|
|
769
|
+
/** A message as an app writes it: a string is an error. */
|
|
770
|
+
type FieldMessageInput = string | {
|
|
771
|
+
readonly text: string;
|
|
772
|
+
readonly severity?: Severity | undefined;
|
|
773
|
+
readonly code?: string | undefined;
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* Whatever an app or a validator returned, as a list of messages from
|
|
777
|
+
* `source`: one input or several, `null` and `undefined` for none.
|
|
778
|
+
*/
|
|
779
|
+
declare function toFieldMessages(input: FieldMessageInput | readonly FieldMessageInput[] | null | undefined, source: FieldMessage["source"]): FieldMessage[];
|
|
780
|
+
/**
|
|
781
|
+
* `messages` in the order a field shows them: the most serious first, and
|
|
782
|
+
* within a severity what the text could not say (parse), then a refused
|
|
783
|
+
* commit, then validators, then the app's own. Equal messages keep their
|
|
784
|
+
* order.
|
|
785
|
+
*/
|
|
786
|
+
declare function sortFieldMessages(messages: readonly FieldMessage[]): FieldMessage[];
|
|
787
|
+
/** Whether any of `messages` is an error: the only severity that blocks. */
|
|
788
|
+
declare function hasError(messages: readonly FieldMessage[]): boolean;
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Where a change came from. A minor release may add a member, so a `switch`
|
|
792
|
+
* over it needs a `default`.
|
|
793
|
+
*
|
|
794
|
+
* - `typing`: keys, deleting and text an input method composed.
|
|
795
|
+
* - `paste`, `drop`: text pasted or dropped in.
|
|
796
|
+
* - `step`: arrow keys or stepper buttons (number and date inputs).
|
|
797
|
+
* - `picker`: an option, a date or a row chosen in a popup.
|
|
798
|
+
* - `preset`: a preset such as "Last 7 days".
|
|
799
|
+
* - `clear`: the clear button, or Escape in a search box.
|
|
800
|
+
* - `undo`: the browser's undo or redo.
|
|
801
|
+
* - `api`: `setValue`, `reset` or a form reset.
|
|
802
|
+
* - `toggle`: a checkbox or switch flipped, by key or pointer.
|
|
803
|
+
* - `revert`: Escape put back the last committed value.
|
|
804
|
+
* - `autofill`: the text changed while the field did not have focus.
|
|
805
|
+
* - `remove`: a chip's or a file's remove button, or Backspace or Delete
|
|
806
|
+
* on a chip.
|
|
807
|
+
*/
|
|
808
|
+
type ChangeSource = "typing" | "paste" | "drop" | "step" | "picker" | "preset" | "clear" | "undo" | "api" | "toggle" | "revert" | "autofill" | "remove";
|
|
809
|
+
/**
|
|
810
|
+
* What ended an edit. A minor release may add a member, so a `switch` over
|
|
811
|
+
* it needs a `default`. Inputs that commit every change commit with the
|
|
812
|
+
* change's own source: `"remove"`, `"drop"` and `"paste"` among them.
|
|
813
|
+
*/
|
|
814
|
+
type CommitTrigger = "enter" | "tab" | "blur" | "picker" | "preset" | "clear" | "toggle" | "autofill" | "remove" | "drop" | "paste";
|
|
815
|
+
/** The browser's report of a text edit. */
|
|
816
|
+
interface TextInputDetails {
|
|
817
|
+
/**
|
|
818
|
+
* The `InputEvent`'s `inputType` (`"insertText"`,
|
|
819
|
+
* `"deleteContentBackward"`, `"insertFromPaste"`, `"historyUndo"`, ...);
|
|
820
|
+
* `null` when no browser edit made the change.
|
|
821
|
+
*/
|
|
822
|
+
readonly inputType: string | null;
|
|
823
|
+
/** The text inserted (typed, pasted, dropped, composed); `null` for a deletion. */
|
|
824
|
+
readonly data: string | null;
|
|
825
|
+
readonly selectionStart: number | null;
|
|
826
|
+
readonly selectionEnd: number | null;
|
|
827
|
+
readonly isComposing: boolean;
|
|
828
|
+
}
|
|
829
|
+
/** No per-input details. */
|
|
830
|
+
type NoDetails = Record<never, never>;
|
|
831
|
+
/**
|
|
832
|
+
* What every forms event carries. `value` and `text` are what the field
|
|
833
|
+
* holds after the change the event is about (the proposed value, in a
|
|
834
|
+
* before-event); `previousValue` and `previousText` what it held before.
|
|
835
|
+
* `N` is the native event type: `Event` in forms-dom and forms.
|
|
836
|
+
*/
|
|
837
|
+
interface FieldEventBase<V, N = unknown> {
|
|
838
|
+
readonly value: V | null;
|
|
839
|
+
readonly previousValue: V | null;
|
|
840
|
+
readonly text: string;
|
|
841
|
+
readonly previousText: string;
|
|
842
|
+
readonly source: ChangeSource;
|
|
843
|
+
/** The browser event behind it; `null` for a change the app made. */
|
|
844
|
+
readonly nativeEvent: N | null;
|
|
845
|
+
/** The text edit behind it; `null` when no browser edit made the change. */
|
|
846
|
+
readonly input: TextInputDetails | null;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* The text changed. Reading the text comes after it, so `value` and
|
|
850
|
+
* `previousValue` are both the value the field held before the edit.
|
|
851
|
+
* Each input adds its own details by intersection; a details key never
|
|
852
|
+
* reuses a base field's name.
|
|
853
|
+
*/
|
|
854
|
+
type FieldInputEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D;
|
|
855
|
+
/** The value changed. */
|
|
856
|
+
type FieldChangeEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D;
|
|
857
|
+
/** The field's messages were worked out again. */
|
|
858
|
+
type FieldValidateEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
859
|
+
/** Every message the field holds now, shown or not yet. */
|
|
860
|
+
readonly messages: readonly FieldMessage[];
|
|
861
|
+
/** Whether none of them is an error. */
|
|
862
|
+
readonly valid: boolean;
|
|
863
|
+
};
|
|
864
|
+
/** The user is done: the value is committed. */
|
|
865
|
+
type FieldCommitEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
866
|
+
readonly trigger: CommitTrigger;
|
|
867
|
+
/** Whether `value` differs from `previousValue`: the value at the last commit, or at focus. */
|
|
868
|
+
readonly changed: boolean;
|
|
869
|
+
/** The value when the field gained focus. */
|
|
870
|
+
readonly initialValue: V | null;
|
|
871
|
+
};
|
|
872
|
+
/**
|
|
873
|
+
* A text edit is about to happen. `text` is the proposed text; reading it
|
|
874
|
+
* comes later, so `value` and `previousValue` are the value held now.
|
|
875
|
+
*/
|
|
876
|
+
type FieldBeforeInputEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
877
|
+
/** False while an input method is composing: it owns the text, so the two calls below do nothing. */
|
|
878
|
+
readonly cancelable: boolean;
|
|
879
|
+
readonly defaultPrevented: boolean;
|
|
880
|
+
/** The edit does not happen. */
|
|
881
|
+
preventDefault(): void;
|
|
882
|
+
/** Inserts `data` in place of what was typed, pasted or dropped. */
|
|
883
|
+
setData(data: string): void;
|
|
884
|
+
};
|
|
885
|
+
/** The value is about to change to `value`. */
|
|
886
|
+
type FieldBeforeChangeEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
887
|
+
readonly defaultPrevented: boolean;
|
|
888
|
+
/** The value does not change; typed text is put back as it was before this edit. */
|
|
889
|
+
preventDefault(): void;
|
|
890
|
+
/** Changes to `value` instead; typed text becomes `format(value)` unless it already reads as it. */
|
|
891
|
+
setValue(value: V | null): void;
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* The value is about to be committed. The handler may return a promise:
|
|
895
|
+
* the commit waits for it, and so does the `onBlur` of a field being left.
|
|
896
|
+
*/
|
|
897
|
+
type FieldBeforeCommitEvent<V, D extends object = NoDetails, N = unknown> = FieldCommitEvent<V, D, N> & {
|
|
898
|
+
readonly defaultPrevented: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Refuses the commit; `message` (default `messages.checkFailed`) shows as
|
|
901
|
+
* an error. Called after a returned promise settles, it does nothing.
|
|
902
|
+
*/
|
|
903
|
+
preventDefault(message?: FieldMessageInput): void;
|
|
904
|
+
};
|
|
905
|
+
/** The field gained or lost focus. */
|
|
906
|
+
interface FieldFocusEvent<V, N = unknown> {
|
|
907
|
+
readonly value: V | null;
|
|
908
|
+
readonly text: string;
|
|
909
|
+
readonly nativeEvent: N | null;
|
|
910
|
+
}
|
|
911
|
+
/** Every handler a field calls, each optional, in the order they fire. */
|
|
912
|
+
interface FieldHandlers<V, D extends object = NoDetails, N = unknown> {
|
|
913
|
+
readonly onFocus?: ((event: FieldFocusEvent<V, N>) => void) | undefined;
|
|
914
|
+
readonly onBeforeInput?: ((event: FieldBeforeInputEvent<V, D, N>) => void) | undefined;
|
|
915
|
+
readonly onInput?: ((event: FieldInputEvent<V, D, N>) => void) | undefined;
|
|
916
|
+
readonly onBeforeChange?: ((event: FieldBeforeChangeEvent<V, D, N>) => void) | undefined;
|
|
917
|
+
readonly onChange?: ((event: FieldChangeEvent<V, D, N>) => void) | undefined;
|
|
918
|
+
readonly onValidate?: ((event: FieldValidateEvent<V, D, N>) => void) | undefined;
|
|
919
|
+
readonly onBeforeCommit?: ((event: FieldBeforeCommitEvent<V, D, N>) => void | Promise<void>) | undefined;
|
|
920
|
+
readonly onCommit?: ((event: FieldCommitEvent<V, D, N>) => void) | undefined;
|
|
921
|
+
readonly onBlur?: ((event: FieldFocusEvent<V, N>) => void) | undefined;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/** What identifies an option, and what a choice input's value holds. */
|
|
925
|
+
type OptionKey = string | number | bigint | boolean;
|
|
926
|
+
/** One choice. A minor release may add optional members. */
|
|
927
|
+
interface ChoiceOption<K extends OptionKey = OptionKey, T = unknown> {
|
|
928
|
+
/** The key the value holds; unique within its list. */
|
|
929
|
+
readonly value: K;
|
|
930
|
+
/** Plain text: shown, matched, typed ahead to, announced, written in display mode. */
|
|
931
|
+
readonly label: string;
|
|
932
|
+
/** A second line under the label; matched only when the match fields name it. */
|
|
933
|
+
readonly description?: string | undefined;
|
|
934
|
+
/**
|
|
935
|
+
* Never chosen by the user. The keys skip it unless the list makes
|
|
936
|
+
* disabled options reachable (`DisabledOptions`).
|
|
937
|
+
*/
|
|
938
|
+
readonly disabled?: boolean | undefined;
|
|
939
|
+
/** The group's label: options sharing it are drawn under one header. */
|
|
940
|
+
readonly group?: string | undefined;
|
|
941
|
+
/** Text of extra columns, by column id. */
|
|
942
|
+
readonly columns?: Readonly<Record<string, string>> | undefined;
|
|
943
|
+
/** More text to match on, never shown: a code, synonyms. */
|
|
944
|
+
readonly keywords?: readonly string[] | undefined;
|
|
945
|
+
/** The app's own record, handed back in events and templates. */
|
|
946
|
+
readonly data?: T | undefined;
|
|
947
|
+
}
|
|
948
|
+
/** The key type of an option type. */
|
|
949
|
+
type KeyOf<O extends ChoiceOption> = O["value"];
|
|
950
|
+
/** A tree node: an option with children, given or loaded on demand. */
|
|
951
|
+
interface TreeOption<K extends OptionKey = OptionKey, T = unknown> extends ChoiceOption<K, T> {
|
|
952
|
+
readonly children?: readonly TreeOption<K, T>[] | undefined;
|
|
953
|
+
/** Children exist but are not given: the source's `children` loads them. */
|
|
954
|
+
readonly hasChildren?: boolean | undefined;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Whether two keys are one: `Object.is`, so `NaN` equals itself and `0`
|
|
958
|
+
* and `-0` differ.
|
|
959
|
+
*/
|
|
960
|
+
declare function sameKey(a: OptionKey, b: OptionKey): boolean;
|
|
961
|
+
/**
|
|
962
|
+
* A key as text: what a hidden input submits, and what duplicate checks
|
|
963
|
+
* compare, since a form submission cannot tell `1` from `"1"`.
|
|
964
|
+
*/
|
|
965
|
+
declare function keyText(key: OptionKey): string;
|
|
966
|
+
/**
|
|
967
|
+
* The option a renderer shows for a key whose option is not known: its
|
|
968
|
+
* text as the label.
|
|
969
|
+
*/
|
|
970
|
+
declare function standInOption<K extends OptionKey, T = unknown>(key: K): ChoiceOption<K, T>;
|
|
971
|
+
/**
|
|
972
|
+
* The text of every key that more than one option in `options` holds, by
|
|
973
|
+
* `keyText`, each once, in the order of the second occurrence. A renderer
|
|
974
|
+
* draws every row and warns about these; the first option gives the label.
|
|
975
|
+
*/
|
|
976
|
+
declare function findDuplicateKeys(options: readonly ChoiceOption[]): readonly string[];
|
|
977
|
+
/** A row that does something rather than being a value. */
|
|
978
|
+
type OptionAction = {
|
|
979
|
+
readonly kind: "selectAll";
|
|
980
|
+
readonly scope: "matching" | "loaded" | "all";
|
|
981
|
+
} | {
|
|
982
|
+
readonly kind: "create";
|
|
983
|
+
readonly text: string;
|
|
984
|
+
} | {
|
|
985
|
+
readonly kind: "retry";
|
|
986
|
+
};
|
|
987
|
+
/** One row of an option list as a renderer draws it and a listbox moves over it. */
|
|
988
|
+
type OptionRow<O extends ChoiceOption> = {
|
|
989
|
+
readonly kind: "header";
|
|
990
|
+
readonly label: string;
|
|
991
|
+
/** How many options the group shows. */
|
|
992
|
+
readonly size: number;
|
|
993
|
+
} | {
|
|
994
|
+
readonly kind: "option";
|
|
995
|
+
readonly option: O;
|
|
996
|
+
/** Its group's label; `null` for an option with none. */
|
|
997
|
+
readonly group: string | null;
|
|
998
|
+
/** Its place among the options, from 0: `aria-posinset` is one more. */
|
|
999
|
+
readonly position: number;
|
|
1000
|
+
} | {
|
|
1001
|
+
readonly kind: "action";
|
|
1002
|
+
readonly action: OptionAction;
|
|
1003
|
+
};
|
|
1004
|
+
/** Action rows around the options: "Select all" first, "Create" or "Try again" last. */
|
|
1005
|
+
interface OptionRowActions {
|
|
1006
|
+
readonly start?: readonly OptionAction[] | undefined;
|
|
1007
|
+
readonly end?: readonly OptionAction[] | undefined;
|
|
1008
|
+
}
|
|
1009
|
+
/**
|
|
1010
|
+
* The rows an option list draws. Groups appear in the order of their first
|
|
1011
|
+
* option, each keeping its options' order, under a header; options with no
|
|
1012
|
+
* group form a group with no header, placed the same way. A group with no
|
|
1013
|
+
* option to show has no header either, so a search that filters out a
|
|
1014
|
+
* group's options removes the group.
|
|
1015
|
+
*/
|
|
1016
|
+
declare function flattenOptions<O extends ChoiceOption>(options: readonly O[], actions?: OptionRowActions): readonly OptionRow<O>[];
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Several chosen keys in the order they were chosen; `null` when none is,
|
|
1020
|
+
* never `[]`.
|
|
1021
|
+
*/
|
|
1022
|
+
type KeyList<K extends OptionKey> = readonly K[] | null;
|
|
1023
|
+
/** The keys of a value, `[]` for `null`. */
|
|
1024
|
+
declare function valueKeys<K extends OptionKey>(value: KeyList<K>): readonly K[];
|
|
1025
|
+
/** Keys as a value: `null` for none. */
|
|
1026
|
+
declare function toKeyList<K extends OptionKey>(keys: readonly K[]): KeyList<K>;
|
|
1027
|
+
/** Whether `value` holds `key`. */
|
|
1028
|
+
declare function hasKey<K extends OptionKey>(value: KeyList<K>, key: K): boolean;
|
|
1029
|
+
/** Whether two values hold the same keys in the same order: a reorder is a change. */
|
|
1030
|
+
declare function sameKeys<K extends OptionKey>(a: KeyList<K>, b: KeyList<K>): boolean;
|
|
1031
|
+
/** Whether another key may join `value` under `maxCount` (`null`: no limit). */
|
|
1032
|
+
declare function canAddKey<K extends OptionKey>(value: KeyList<K>, maxCount: number | null): boolean;
|
|
1033
|
+
/**
|
|
1034
|
+
* `value` with `keys` appended in their order, skipping keys it holds, and
|
|
1035
|
+
* stopping once it holds `maxCount`. A value already at or over the limit
|
|
1036
|
+
* gains nothing. Returns `value` itself when nothing was added.
|
|
1037
|
+
*/
|
|
1038
|
+
declare function addKeys<K extends OptionKey>(value: KeyList<K>, keys: readonly K[], maxCount?: number | null): KeyList<K>;
|
|
1039
|
+
/** `value` without `keys`, the rest in order. Returns `value` itself when it held none of them. */
|
|
1040
|
+
declare function removeKeys<K extends OptionKey>(value: KeyList<K>, keys: readonly K[]): KeyList<K>;
|
|
1041
|
+
/**
|
|
1042
|
+
* `key` removed when `value` holds it, else appended unless `value` holds
|
|
1043
|
+
* `maxCount` keys already, when `value` itself is returned.
|
|
1044
|
+
*/
|
|
1045
|
+
declare function toggleKey<K extends OptionKey>(value: KeyList<K>, key: K, maxCount?: number | null): KeyList<K>;
|
|
1046
|
+
/**
|
|
1047
|
+
* The keys of the options from row `from` to row `to`, both included, in
|
|
1048
|
+
* list order whichever way the range runs: what Shift with a click or an
|
|
1049
|
+
* arrow chooses. Headers, actions and disabled options are skipped.
|
|
1050
|
+
*/
|
|
1051
|
+
declare function rangeKeys<O extends ChoiceOption>(rows: readonly OptionRow<O>[], from: number, to: number): readonly O["value"][];
|
|
1052
|
+
/** How much of a scope is chosen: every enabled option, none, or some. */
|
|
1053
|
+
type ScopeState = "all" | "none" | "some";
|
|
1054
|
+
/**
|
|
1055
|
+
* How much of `scope` (the options matching the query, the loaded ones, or
|
|
1056
|
+
* stand-ins for every key a source has) `value` holds, counting enabled
|
|
1057
|
+
* options only: the tri-state of a "Select all" row.
|
|
1058
|
+
*/
|
|
1059
|
+
declare function scopeState<O extends ChoiceOption>(value: KeyList<O["value"]>, scope: readonly O[]): ScopeState;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether "Select all" over `scope` stays within `maxCount`: false when
|
|
1062
|
+
* adding its unchosen enabled options would go past the limit.
|
|
1063
|
+
*/
|
|
1064
|
+
declare function canSelectAll<O extends ChoiceOption>(value: KeyList<O["value"]>, scope: readonly O[], maxCount: number | null): boolean;
|
|
1065
|
+
/**
|
|
1066
|
+
* A "Select all" row chosen over `scope`. With every enabled option of the
|
|
1067
|
+
* scope chosen, it removes them (the scope's only); otherwise it appends
|
|
1068
|
+
* the unchosen enabled ones in scope order, the chosen keeping their
|
|
1069
|
+
* place. Disabled options are never added or removed. Past `maxCount` it
|
|
1070
|
+
* changes nothing and returns `value`.
|
|
1071
|
+
*/
|
|
1072
|
+
declare function selectAll<O extends ChoiceOption>(value: KeyList<O["value"]>, scope: readonly O[], maxCount?: number | null): KeyList<O["value"]>;
|
|
1073
|
+
/**
|
|
1074
|
+
* The clear button: `value` without every key the user may remove. A
|
|
1075
|
+
* `locked` key (a chosen disabled option) stays.
|
|
1076
|
+
*/
|
|
1077
|
+
declare function clearKeys<K extends OptionKey>(value: KeyList<K>, locked: (key: K) => boolean): KeyList<K>;
|
|
1078
|
+
/** What a change did to a value: each list in the order of the value it is found in. */
|
|
1079
|
+
interface KeyChanges<K extends OptionKey> {
|
|
1080
|
+
/** In `next` and not in `previous`, in `next`'s order. */
|
|
1081
|
+
readonly added: readonly K[];
|
|
1082
|
+
/** In `previous` and not in `next`, in `previous`'s order. */
|
|
1083
|
+
readonly removed: readonly K[];
|
|
1084
|
+
}
|
|
1085
|
+
/** The keys a change added and removed. */
|
|
1086
|
+
declare function keyChanges<K extends OptionKey>(previous: KeyList<K>, next: KeyList<K>): KeyChanges<K>;
|
|
1087
|
+
|
|
1088
|
+
/** Where the next page starts, as the source wrote it. */
|
|
1089
|
+
type OptionCursor = string | number;
|
|
1090
|
+
/** What a query asks for, apart from its page. */
|
|
1091
|
+
interface OptionQuery<F> {
|
|
1092
|
+
/** The search text as typed; `""` when the list opens. */
|
|
1093
|
+
readonly text: string;
|
|
1094
|
+
/** The app's dependent filter values (a city list's country), compared by value. */
|
|
1095
|
+
readonly filters: F;
|
|
1096
|
+
}
|
|
1097
|
+
/** One request a source answers. `S` is the signal type: `AbortSignal` in a browser. */
|
|
1098
|
+
interface OptionSearch<F, S> extends OptionQuery<F> {
|
|
1099
|
+
/** `null` for the first page, else the previous page's `next`. */
|
|
1100
|
+
readonly cursor: OptionCursor | null;
|
|
1101
|
+
readonly pageSize: number;
|
|
1102
|
+
/** Aborted as soon as this request is superseded or the input goes away. */
|
|
1103
|
+
readonly signal: S;
|
|
1104
|
+
}
|
|
1105
|
+
/** One page of a query's options. */
|
|
1106
|
+
interface OptionPage<O> {
|
|
1107
|
+
readonly options: readonly O[];
|
|
1108
|
+
/** Passed back as `cursor` for more; absent or `null` on the last page. */
|
|
1109
|
+
readonly next?: OptionCursor | null | undefined;
|
|
1110
|
+
/** How many options match in all, when the server knows. */
|
|
1111
|
+
readonly total?: number | undefined;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Where a choice input's options come from when they are not a local
|
|
1115
|
+
* list: a server, usually. The input never fetches by itself; it calls
|
|
1116
|
+
* these and shows their states. `F` is the dependent filters' type and
|
|
1117
|
+
* `S` the signal type.
|
|
1118
|
+
*/
|
|
1119
|
+
interface OptionSource<O extends ChoiceOption, F = undefined, S = unknown> {
|
|
1120
|
+
/** One page for a query. A bare array is a single, last page. */
|
|
1121
|
+
readonly search: (request: OptionSearch<F, S>) => Promise<OptionPage<O> | readonly O[]>;
|
|
1122
|
+
/**
|
|
1123
|
+
* The options of keys not loaded: the labels of a value the form opened
|
|
1124
|
+
* with. A key missing from the answer no longer exists.
|
|
1125
|
+
*/
|
|
1126
|
+
readonly resolve?: ((keys: readonly KeyOf<O>[], context: {
|
|
1127
|
+
readonly filters: F;
|
|
1128
|
+
readonly signal: S;
|
|
1129
|
+
}) => Promise<readonly O[]>) | undefined;
|
|
1130
|
+
/** Every key matching a query, for "select all" past the loaded pages. */
|
|
1131
|
+
readonly allKeys?: ((query: OptionQuery<F>, signal: S) => Promise<readonly KeyOf<O>[]>) | undefined;
|
|
1132
|
+
/**
|
|
1133
|
+
* `"source"` (the default): `search` filters by `text` itself.
|
|
1134
|
+
* `"local"`: it returns the whole list once per filters value, and the
|
|
1135
|
+
* input matches locally.
|
|
1136
|
+
*/
|
|
1137
|
+
readonly filtering?: "source" | "local" | undefined;
|
|
1138
|
+
/** Milliseconds typing must pause before `search`. Default 250. */
|
|
1139
|
+
readonly debounce?: number | undefined;
|
|
1140
|
+
/** Default 50. */
|
|
1141
|
+
readonly pageSize?: number | undefined;
|
|
1142
|
+
/** The shortest text that searches; shorter asks nothing. Default 0. */
|
|
1143
|
+
readonly minQueryLength?: number | undefined;
|
|
1144
|
+
}
|
|
1145
|
+
/** A tree's source: a source that also loads a node's children. */
|
|
1146
|
+
interface TreeSource<O extends TreeOption, F = undefined, S = unknown> extends OptionSource<O, F, S> {
|
|
1147
|
+
readonly children: (parent: KeyOf<O>, context: {
|
|
1148
|
+
readonly filters: F;
|
|
1149
|
+
readonly signal: S;
|
|
1150
|
+
readonly cursor: OptionCursor | null;
|
|
1151
|
+
}) => Promise<OptionPage<O> | readonly O[]>;
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* A fresh signal and the means to abort it. forms-core has no
|
|
1155
|
+
* `AbortSignal`, so whoever drives a source hands it one of these:
|
|
1156
|
+
* forms-dom's `abortSignals` makes `AbortController`s.
|
|
1157
|
+
*/
|
|
1158
|
+
type AbortFactory<S> = () => {
|
|
1159
|
+
readonly signal: S;
|
|
1160
|
+
readonly abort: () => void;
|
|
1161
|
+
};
|
|
1162
|
+
declare const DEFAULT_SOURCE_DEBOUNCE = 250;
|
|
1163
|
+
declare const DEFAULT_SOURCE_PAGE_SIZE = 50;
|
|
1164
|
+
/** A source's answer as a page. */
|
|
1165
|
+
declare function toOptionPage<O>(answer: OptionPage<O> | readonly O[]): OptionPage<O>;
|
|
1166
|
+
/**
|
|
1167
|
+
* Filter values as text, the same for the same values: object keys in any
|
|
1168
|
+
* order, members holding `undefined` left out, `bigint` and `Date` by
|
|
1169
|
+
* value. Filters are plain data; a function or symbol counts only as one.
|
|
1170
|
+
*/
|
|
1171
|
+
declare function filtersKey(filters: unknown): string;
|
|
1172
|
+
/** Whether two filter values are the same by value, so an inline `{ country }` object is fine. */
|
|
1173
|
+
declare function sameFilters(a: unknown, b: unknown): boolean;
|
|
1174
|
+
/** What a list shows from a query: every page so far, in order. */
|
|
1175
|
+
interface LoadedOptions<O> {
|
|
1176
|
+
readonly options: readonly O[];
|
|
1177
|
+
readonly next: OptionCursor | null;
|
|
1178
|
+
readonly total: number | null;
|
|
1179
|
+
}
|
|
1180
|
+
/** `page` after the pages in `shown`, or alone when `shown` is `null`. */
|
|
1181
|
+
declare function appendPage<O>(shown: LoadedOptions<O> | null, page: OptionPage<O>): LoadedOptions<O>;
|
|
1182
|
+
/**
|
|
1183
|
+
* A query's lifecycle. `shown` is what the list keeps showing meanwhile,
|
|
1184
|
+
* drawn dimmed: the last result for the same filters, never another
|
|
1185
|
+
* filter's. `request` numbers a request, so an answer to an earlier one
|
|
1186
|
+
* is ignored; `more` marks a next page rather than a new query.
|
|
1187
|
+
*/
|
|
1188
|
+
type SourceState<O, F> = {
|
|
1189
|
+
readonly kind: "idle";
|
|
1190
|
+
} | {
|
|
1191
|
+
readonly kind: "waiting";
|
|
1192
|
+
readonly query: OptionQuery<F>;
|
|
1193
|
+
readonly shown: LoadedOptions<O> | null;
|
|
1194
|
+
} | {
|
|
1195
|
+
readonly kind: "loading";
|
|
1196
|
+
readonly query: OptionQuery<F>;
|
|
1197
|
+
readonly request: number;
|
|
1198
|
+
readonly shown: LoadedOptions<O> | null;
|
|
1199
|
+
readonly more: boolean;
|
|
1200
|
+
} | {
|
|
1201
|
+
readonly kind: "loaded";
|
|
1202
|
+
readonly query: OptionQuery<F>;
|
|
1203
|
+
readonly result: LoadedOptions<O>;
|
|
1204
|
+
} | {
|
|
1205
|
+
readonly kind: "failed";
|
|
1206
|
+
readonly query: OptionQuery<F>;
|
|
1207
|
+
readonly request: number;
|
|
1208
|
+
readonly error: unknown;
|
|
1209
|
+
readonly shown: LoadedOptions<O> | null;
|
|
1210
|
+
readonly more: boolean;
|
|
1211
|
+
};
|
|
1212
|
+
/** What can happen to a query. */
|
|
1213
|
+
type SourceAction<O, F> =
|
|
1214
|
+
/** Typing: the query waits for the debounce. */
|
|
1215
|
+
{
|
|
1216
|
+
readonly type: "wait";
|
|
1217
|
+
readonly query: OptionQuery<F>;
|
|
1218
|
+
}
|
|
1219
|
+
/** A request starts: a new query, or its next page with `more`. */
|
|
1220
|
+
| {
|
|
1221
|
+
readonly type: "start";
|
|
1222
|
+
readonly query: OptionQuery<F>;
|
|
1223
|
+
readonly request: number;
|
|
1224
|
+
readonly more: boolean;
|
|
1225
|
+
} | {
|
|
1226
|
+
readonly type: "page";
|
|
1227
|
+
readonly request: number;
|
|
1228
|
+
readonly page: OptionPage<O>;
|
|
1229
|
+
} | {
|
|
1230
|
+
readonly type: "fail";
|
|
1231
|
+
readonly request: number;
|
|
1232
|
+
readonly error: unknown;
|
|
1233
|
+
}
|
|
1234
|
+
/** A result known without a request: a cached page, or a local list matched. */
|
|
1235
|
+
| {
|
|
1236
|
+
readonly type: "show";
|
|
1237
|
+
readonly query: OptionQuery<F>;
|
|
1238
|
+
readonly result: LoadedOptions<O>;
|
|
1239
|
+
}
|
|
1240
|
+
/** The query is dropped, and what it showed with it: the filters changed or the list closed. */
|
|
1241
|
+
| {
|
|
1242
|
+
readonly type: "reset";
|
|
1243
|
+
};
|
|
1244
|
+
declare const SOURCE_IDLE: SourceState<never, never>;
|
|
1245
|
+
/**
|
|
1246
|
+
* A query's state after `action`. Pure. A `page` or `fail` whose `request`
|
|
1247
|
+
* is not the one loading is ignored, so a superseded answer never replaces
|
|
1248
|
+
* a newer one, even from a source that ignores its signal.
|
|
1249
|
+
*/
|
|
1250
|
+
declare function sourceReducer<O, F>(state: SourceState<O, F>, action: SourceAction<O, F>): SourceState<O, F>;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* What a choice input adds to every event it fires. Each list holds full
|
|
1254
|
+
* options, in the order of the value it is found in; a key whose option
|
|
1255
|
+
* is not known yet is a stand-in `{ value, label: keyText(value) }`.
|
|
1256
|
+
*/
|
|
1257
|
+
interface ChoiceDetails<O extends ChoiceOption> {
|
|
1258
|
+
/** The options of the value, in its order. */
|
|
1259
|
+
readonly options: readonly O[];
|
|
1260
|
+
readonly previousOptions: readonly O[];
|
|
1261
|
+
/** In the value now and not before, in the value's order. */
|
|
1262
|
+
readonly added: readonly O[];
|
|
1263
|
+
/** In the value before and not now, in the previous value's order. */
|
|
1264
|
+
readonly removed: readonly O[];
|
|
1265
|
+
/** Keys of the value whose options are stand-ins: still resolving, missing or unresolved. */
|
|
1266
|
+
readonly unknownKeys: readonly KeyOf<O>[];
|
|
1267
|
+
/** The search text when it happened; `""` for a list without a search box. */
|
|
1268
|
+
readonly query: string;
|
|
1269
|
+
}
|
|
1270
|
+
/** With one value, the same plus the option itself. */
|
|
1271
|
+
interface SingleChoiceDetails<O extends ChoiceOption> extends ChoiceDetails<O> {
|
|
1272
|
+
readonly option: O | null;
|
|
1273
|
+
readonly previousOption: O | null;
|
|
1274
|
+
}
|
|
1275
|
+
/** The search text changed (`onQueryChange`). */
|
|
1276
|
+
interface QueryChangeEvent<N = unknown> {
|
|
1277
|
+
readonly query: string;
|
|
1278
|
+
readonly previousQuery: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* `typing`, `paste`, `drop`; `clear`; `revert` when the query is dropped
|
|
1281
|
+
* as the popup closes; `picker` when a pick ends it; `api`.
|
|
1282
|
+
*/
|
|
1283
|
+
readonly source: ChangeSource;
|
|
1284
|
+
readonly nativeEvent: N | null;
|
|
1285
|
+
}
|
|
1286
|
+
/** The highlighted option changed (`onHighlightChange`). */
|
|
1287
|
+
interface HighlightChangeEvent<O, N = unknown> {
|
|
1288
|
+
/** `null`: no option highlighted (the caret is back in the text). */
|
|
1289
|
+
readonly option: O | null;
|
|
1290
|
+
readonly previousOption: O | null;
|
|
1291
|
+
readonly by: "keyboard" | "pointer" | "typing" | "open";
|
|
1292
|
+
readonly nativeEvent: N | null;
|
|
1293
|
+
}
|
|
1294
|
+
/** The user asked to create an option from what they typed (`onCreate`). */
|
|
1295
|
+
interface CreateEvent<N = unknown> {
|
|
1296
|
+
/** The typed text, trimmed. */
|
|
1297
|
+
readonly text: string;
|
|
1298
|
+
readonly nativeEvent: N | null;
|
|
1299
|
+
}
|
|
1300
|
+
/** A source's request failed (`onLoadError`). */
|
|
1301
|
+
interface LoadErrorEvent<F> {
|
|
1302
|
+
readonly error: unknown;
|
|
1303
|
+
readonly query: OptionQuery<F>;
|
|
1304
|
+
}
|
|
1305
|
+
/** The option a key stands for: known, or a stand-in. */
|
|
1306
|
+
type OptionFinder<K extends OptionKey, T> = (key: K) => ChoiceOption<K, T> | null;
|
|
1307
|
+
/**
|
|
1308
|
+
* The details of a change between two values of a choice input with
|
|
1309
|
+
* several values. `optionOf` returns a key's option, or `null` when it is
|
|
1310
|
+
* not known (an option source controller's `lookup`, a local list).
|
|
1311
|
+
*/
|
|
1312
|
+
declare function choiceDetails<K extends OptionKey, T>(value: KeyList<K>, previous: KeyList<K>, optionOf: OptionFinder<K, T>, query: string): ChoiceDetails<ChoiceOption<K, T>>;
|
|
1313
|
+
/** The details of a change between two values of a choice input with one value. */
|
|
1314
|
+
declare function singleChoiceDetails<K extends OptionKey, T>(value: K | null, previous: K | null, optionOf: OptionFinder<K, T>, query: string): SingleChoiceDetails<ChoiceOption<K, T>>;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* How a query matches: anywhere in a field, at its start, or every query
|
|
1318
|
+
* word at the start of a word of some field, in any order.
|
|
1319
|
+
*/
|
|
1320
|
+
type MatchMode = "contains" | "startsWith" | "words";
|
|
1321
|
+
/** `[start, end)` in UTF-16 units of the original text, always whole graphemes. */
|
|
1322
|
+
type TextRange = readonly [start: number, end: number];
|
|
1323
|
+
/**
|
|
1324
|
+
* Where an option matched: ranges by field id (`"label"`, `"description"`,
|
|
1325
|
+
* `"keywords"`, a column id). A field that matched with nothing to
|
|
1326
|
+
* highlight, such as `"keywords"`, holds no ranges.
|
|
1327
|
+
*/
|
|
1328
|
+
interface OptionMatch {
|
|
1329
|
+
readonly fields: Readonly<Record<string, readonly TextRange[]>>;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Text folded for matching, with the original range each folded UTF-16
|
|
1333
|
+
* unit came from: `starts[i]` and `ends[i]` bound the grapheme of unit `i`.
|
|
1334
|
+
*/
|
|
1335
|
+
interface FoldedText {
|
|
1336
|
+
readonly text: string;
|
|
1337
|
+
readonly starts: readonly number[];
|
|
1338
|
+
readonly ends: readonly number[];
|
|
1339
|
+
}
|
|
1340
|
+
/** What a matcher is told besides the option and the query. */
|
|
1341
|
+
interface MatchContext<O> {
|
|
1342
|
+
readonly mode: MatchMode;
|
|
1343
|
+
readonly locale: Intl.LocalesArgument;
|
|
1344
|
+
/** Field ids to search. */
|
|
1345
|
+
readonly fields: readonly string[];
|
|
1346
|
+
/** The built-in matcher, to fall back on or wrap. */
|
|
1347
|
+
readonly defaultMatch: (option: O, query: string) => OptionMatch | null;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* An app's matcher. `true` is a match with nothing highlighted; `false` or
|
|
1351
|
+
* `null` is no match.
|
|
1352
|
+
*/
|
|
1353
|
+
type OptionMatcher<O> = (option: O, query: string, context: MatchContext<O>) => OptionMatch | boolean | null;
|
|
1354
|
+
/** The fields matched when an input names none. */
|
|
1355
|
+
declare const DEFAULT_MATCH_FIELDS: readonly string[];
|
|
1356
|
+
/**
|
|
1357
|
+
* `text` folded for matching, one grapheme at a time: lower case in the
|
|
1358
|
+
* locale, compatibility forms decomposed (full width, ligatures), accents
|
|
1359
|
+
* dropped from Latin, Greek, Cyrillic, Hebrew and Arabic letters, dotless
|
|
1360
|
+
* "ı" as "i" outside Turkish and Azerbaijani, and a final sigma as "σ".
|
|
1361
|
+
* Nothing expands: "ß" stays "ß".
|
|
1362
|
+
*/
|
|
1363
|
+
declare function foldText(text: string, locale: Intl.LocalesArgument): FoldedText;
|
|
1364
|
+
/**
|
|
1365
|
+
* The ranges of `query` in `text`, on the original text: `[]` for an empty
|
|
1366
|
+
* query (it matches everything), `null` for no match. In `words` mode every
|
|
1367
|
+
* query word must start a word of `text`.
|
|
1368
|
+
*/
|
|
1369
|
+
declare function matchText(text: string, query: string, mode: MatchMode, locale: Intl.LocalesArgument): readonly TextRange[] | null;
|
|
1370
|
+
/**
|
|
1371
|
+
* Where `query` matches `option` in the context's fields, or `null`. An
|
|
1372
|
+
* empty query matches with nothing highlighted.
|
|
1373
|
+
*/
|
|
1374
|
+
declare function matchOption<O extends ChoiceOption>(option: O, query: string, context: Omit<MatchContext<O>, "defaultMatch">): OptionMatch | null;
|
|
1375
|
+
/** An option a search kept, with its place in the list and where it matched. */
|
|
1376
|
+
interface OptionHit<O> {
|
|
1377
|
+
readonly option: O;
|
|
1378
|
+
readonly index: number;
|
|
1379
|
+
readonly match: OptionMatch;
|
|
1380
|
+
}
|
|
1381
|
+
/**
|
|
1382
|
+
* A list's options folded once for one set of fields and one locale, so
|
|
1383
|
+
* a keystroke folds only the query.
|
|
1384
|
+
*/
|
|
1385
|
+
interface OptionIndex<O extends ChoiceOption> {
|
|
1386
|
+
readonly options: readonly O[];
|
|
1387
|
+
/** Where `query` matches the option at `index`, or `null`. */
|
|
1388
|
+
readonly matchAt: (index: number, query: string, mode: MatchMode) => OptionMatch | null;
|
|
1389
|
+
/**
|
|
1390
|
+
* Every option `query` matches, in list order. An app's `matcher`
|
|
1391
|
+
* decides in place of the built-in one, which it receives as
|
|
1392
|
+
* `defaultMatch`.
|
|
1393
|
+
*/
|
|
1394
|
+
readonly search: (query: string, mode: MatchMode, matcher?: OptionMatcher<O>) => readonly OptionHit<O>[];
|
|
1395
|
+
}
|
|
1396
|
+
/** `options` folded once, for matching on `fields` in `locale`. */
|
|
1397
|
+
declare function createOptionIndex<O extends ChoiceOption>(options: readonly O[], fields: readonly string[], locale: Intl.LocalesArgument): OptionIndex<O>;
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Whether the keys reach disabled options: `"skip"` (the default, as a
|
|
1401
|
+
* native `<select>` does) or `"focus"`, which makes them reachable, to be
|
|
1402
|
+
* announced as unavailable and never chosen.
|
|
1403
|
+
*/
|
|
1404
|
+
type DisabledOptions = "skip" | "focus";
|
|
1405
|
+
/** What a listbox needs to know of a row to move over it. */
|
|
1406
|
+
interface NavigableRow {
|
|
1407
|
+
readonly kind: "header" | "option" | "action";
|
|
1408
|
+
readonly disabled: boolean;
|
|
1409
|
+
}
|
|
1410
|
+
/** A move of the active row. `rows` is how many rows a page holds. */
|
|
1411
|
+
type ActiveMove = {
|
|
1412
|
+
readonly kind: "next";
|
|
1413
|
+
} | {
|
|
1414
|
+
readonly kind: "previous";
|
|
1415
|
+
} | {
|
|
1416
|
+
readonly kind: "first";
|
|
1417
|
+
} | {
|
|
1418
|
+
readonly kind: "last";
|
|
1419
|
+
} | {
|
|
1420
|
+
readonly kind: "pageDown";
|
|
1421
|
+
readonly rows: number;
|
|
1422
|
+
} | {
|
|
1423
|
+
readonly kind: "pageUp";
|
|
1424
|
+
readonly rows: number;
|
|
1425
|
+
};
|
|
1426
|
+
/**
|
|
1427
|
+
* Whether the active row can land on `row`: never a header, a disabled
|
|
1428
|
+
* row only when `disabledOptions` is `"focus"`.
|
|
1429
|
+
*/
|
|
1430
|
+
declare function isLandingRow(row: NavigableRow, disabledOptions: DisabledOptions): boolean;
|
|
1431
|
+
/**
|
|
1432
|
+
* The row the active row moves to, or `null` when no row can be landed
|
|
1433
|
+
* on. Moves stop at the ends rather than wrapping, so a long list never
|
|
1434
|
+
* jumps end to end; a move with nowhere to go keeps `from`. With no active
|
|
1435
|
+
* row, "next" lands on the first row and "previous" on the last. A page
|
|
1436
|
+
* move lands on the row a page away, or the nearest landing row past it,
|
|
1437
|
+
* else the nearest before it.
|
|
1438
|
+
*/
|
|
1439
|
+
declare function moveActive(rows: readonly NavigableRow[], from: number | null, move: ActiveMove, disabledOptions?: DisabledOptions): number | null;
|
|
1440
|
+
/** A row type-ahead can find: `typeahead` is its label folded with `foldText`. */
|
|
1441
|
+
interface TypeaheadRow extends NavigableRow {
|
|
1442
|
+
readonly typeahead: string;
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* The row the typed `buffer` finds, folded as labels are, among the rows
|
|
1446
|
+
* the active row can land on; `null` when none starts with it. Repeating
|
|
1447
|
+
* one letter steps through the rows it starts, from the one after `from`.
|
|
1448
|
+
*/
|
|
1449
|
+
declare function typeaheadRow(rows: readonly TypeaheadRow[], from: number | null, buffer: string, locale: Intl.LocalesArgument, disabledOptions?: DisabledOptions): number | null;
|
|
1450
|
+
|
|
1451
|
+
/** What is known of a key's option now. */
|
|
1452
|
+
type KeyLookup<O> = {
|
|
1453
|
+
readonly kind: "known";
|
|
1454
|
+
readonly option: O;
|
|
1455
|
+
}
|
|
1456
|
+
/** Asked of the source's `resolve`, not answered yet. */
|
|
1457
|
+
| {
|
|
1458
|
+
readonly kind: "resolving";
|
|
1459
|
+
}
|
|
1460
|
+
/** `resolve` answered without it: the option no longer exists. */
|
|
1461
|
+
| {
|
|
1462
|
+
readonly kind: "missing";
|
|
1463
|
+
}
|
|
1464
|
+
/** Not known and not asked: no `resolve`, it failed, or nothing asked yet. */
|
|
1465
|
+
| {
|
|
1466
|
+
readonly kind: "unresolved";
|
|
1467
|
+
};
|
|
1468
|
+
/** Where a page is kept: its text, its filters as `filtersKey` wrote them, and its cursor. */
|
|
1469
|
+
interface PageKey {
|
|
1470
|
+
readonly text: string;
|
|
1471
|
+
readonly filters: string;
|
|
1472
|
+
readonly cursor: OptionCursor | null;
|
|
1473
|
+
}
|
|
1474
|
+
/** What a cache needs to ask a source for labels. */
|
|
1475
|
+
interface ResolveRequest<O extends ChoiceOption, F, S> {
|
|
1476
|
+
readonly resolve: NonNullable<OptionSource<O, F, S>["resolve"]>;
|
|
1477
|
+
readonly filters: F;
|
|
1478
|
+
readonly abort: AbortFactory<S>;
|
|
1479
|
+
}
|
|
1480
|
+
interface OptionCacheOptions {
|
|
1481
|
+
/** How many queries' pages it keeps, least recently used out first. Default 50. */
|
|
1482
|
+
readonly maxQueries?: number | undefined;
|
|
1483
|
+
/** How long a page stays fresh, in milliseconds; a stale page is asked again. Default 300 000. */
|
|
1484
|
+
readonly maxAge?: number | undefined;
|
|
1485
|
+
/** The clock, for tests. */
|
|
1486
|
+
readonly now?: (() => number) | undefined;
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* One source's pages and options, shared by every input on the source
|
|
1490
|
+
* that is handed it. Pages are kept by query and filters, so one filter
|
|
1491
|
+
* value never reads another's; options are kept by key for every label
|
|
1492
|
+
* an input shows. A renderer drives it through an option source
|
|
1493
|
+
* controller.
|
|
1494
|
+
*/
|
|
1495
|
+
interface OptionCache<O extends ChoiceOption> {
|
|
1496
|
+
/** A fresh page, or `null`. */
|
|
1497
|
+
readonly readPage: (key: PageKey) => OptionPage<O> | null;
|
|
1498
|
+
/** Keeps a page (a first page replaces the query's others) and its options by key. */
|
|
1499
|
+
readonly storePage: (key: PageKey, page: OptionPage<O>) => void;
|
|
1500
|
+
/** Options known without a request: an input's `options` and `valueOptions`, a created option. Silent. */
|
|
1501
|
+
readonly addOptions: (options: readonly O[]) => void;
|
|
1502
|
+
readonly lookup: (key: KeyOf<O>) => KeyLookup<O>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Asks for the options of `keys` not known, missing or already asked.
|
|
1505
|
+
* Keys asked in one microtask, by any input, go into one `resolve`
|
|
1506
|
+
* call per filters value. Its signal is never aborted: other inputs
|
|
1507
|
+
* may wait on the same call.
|
|
1508
|
+
*/
|
|
1509
|
+
readonly resolve: <F, S>(keys: readonly KeyOf<O>[], request: ResolveRequest<O, F, S>) => void;
|
|
1510
|
+
/** Forgets every page and every missing key; options by key stay. */
|
|
1511
|
+
readonly invalidate: () => void;
|
|
1512
|
+
/** Called when an answer makes a key's lookup change. */
|
|
1513
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
1514
|
+
/** Grows each time listeners are called. */
|
|
1515
|
+
readonly getVersion: () => number;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* A cache for one source. One per input by default; share one across
|
|
1519
|
+
* every input on a source (created once, at module level) so a form with
|
|
1520
|
+
* ten fields on it calls `resolve` once.
|
|
1521
|
+
*/
|
|
1522
|
+
declare function createOptionCache<O extends ChoiceOption>(options?: OptionCacheOptions): OptionCache<O>;
|
|
1523
|
+
|
|
1524
|
+
/**
|
|
1525
|
+
* Runs `callback` once after `delay` milliseconds and returns the function
|
|
1526
|
+
* that cancels it. forms-core keeps no timers of its own, so it can run
|
|
1527
|
+
* anywhere: whoever drives a field hands it one of these, the browser's
|
|
1528
|
+
* timers in a page and a fake one in a test.
|
|
1529
|
+
*/
|
|
1530
|
+
type Schedule = (callback: () => void, delay: number) => () => void;
|
|
1531
|
+
|
|
1532
|
+
/** What drives an option source controller; a renderer passes the latest on every update. */
|
|
1533
|
+
interface OptionSourceOptions<O extends ChoiceOption, F, S> {
|
|
1534
|
+
/** A new object is not a reset: the latest functions serve the next request. */
|
|
1535
|
+
readonly source: OptionSource<O, F, S>;
|
|
1536
|
+
readonly filters: F;
|
|
1537
|
+
readonly abort: AbortFactory<S>;
|
|
1538
|
+
/** The debounce's timer. */
|
|
1539
|
+
readonly schedule: Schedule;
|
|
1540
|
+
/** One per controller by default; share one per source with `createOptionCache`. */
|
|
1541
|
+
readonly cache?: OptionCache<O> | undefined;
|
|
1542
|
+
/** The input's matcher, used when the source's `filtering` is `"local"`. */
|
|
1543
|
+
readonly match: (option: O, text: string) => boolean;
|
|
1544
|
+
/** A request failed (the input's `onLoadError`). */
|
|
1545
|
+
readonly onError?: ((error: unknown, query: OptionQuery<F>) => void) | undefined;
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* One input's queries to a source: what the list shows, the debounce,
|
|
1549
|
+
* the request in flight and its signal, paging, and labels through the
|
|
1550
|
+
* cache. Listeners hear every change of the state and every label that
|
|
1551
|
+
* arrives (the cache's version grows then).
|
|
1552
|
+
*/
|
|
1553
|
+
interface OptionSourceController<O extends ChoiceOption, F, S> {
|
|
1554
|
+
readonly getState: () => SourceState<O, F>;
|
|
1555
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
1556
|
+
/**
|
|
1557
|
+
* Silent. Filters that differ by value drop the query and what it
|
|
1558
|
+
* showed; if a list shows, the same text is asked again at once.
|
|
1559
|
+
*/
|
|
1560
|
+
readonly setOptions: (options: OptionSourceOptions<O, F, S>) => void;
|
|
1561
|
+
/** Typing: the query is `text` now, asked after the debounce unless a fresh cached page answers at once. */
|
|
1562
|
+
readonly query: (text: string) => void;
|
|
1563
|
+
/** Opening, Enter, a retry: asked now, or answered at once from a fresh cached page. */
|
|
1564
|
+
readonly queryNow: (text: string) => void;
|
|
1565
|
+
/** The next page, when the loaded result has `next`. */
|
|
1566
|
+
readonly loadMore: () => void;
|
|
1567
|
+
/** Asks the failed request again. */
|
|
1568
|
+
readonly retry: () => void;
|
|
1569
|
+
/** Forgets the cache's pages and, if a list shows, asks again. */
|
|
1570
|
+
readonly invalidate: () => void;
|
|
1571
|
+
/** The list closed: aborts what is in flight, cancels the debounce and drops the query. */
|
|
1572
|
+
readonly close: () => void;
|
|
1573
|
+
/** Labels for `keys`, through the cache's batched `resolve`. */
|
|
1574
|
+
readonly resolve: (keys: readonly KeyOf<O>[]) => void;
|
|
1575
|
+
/** What is known of a key now. */
|
|
1576
|
+
readonly lookup: (key: KeyOf<O>) => KeyLookup<O>;
|
|
1577
|
+
readonly getCache: () => OptionCache<O>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Aborts what is in flight, cancels the debounce and ignores every
|
|
1580
|
+
* later answer. Silent, and the controller stays usable, so a second
|
|
1581
|
+
* mount can use it again.
|
|
1582
|
+
*/
|
|
1583
|
+
readonly destroy: () => void;
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* The controller between a choice input and its source. Each request
|
|
1587
|
+
* gets its own signal and number: a newer query aborts the older one at
|
|
1588
|
+
* once, and an older answer that arrives anyway is ignored.
|
|
1589
|
+
*/
|
|
1590
|
+
declare function createOptionSourceController<O extends ChoiceOption, F, S>(initial: OptionSourceOptions<O, F, S>): OptionSourceController<O, F, S>;
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* What a tree's value holds with several values: every ticked node
|
|
1594
|
+
* (`"all"`), ticked nodes with no children (`"leaves"`), or each ticked
|
|
1595
|
+
* node whose parent is not ticked, a whole parent standing for its
|
|
1596
|
+
* children (`"parent"`).
|
|
1597
|
+
*/
|
|
1598
|
+
type TreeValueMode = "all" | "leaves" | "parent";
|
|
1599
|
+
/** A node's tick: a parent with some of its enabled children ticked is `"mixed"`. */
|
|
1600
|
+
type TickState = "ticked" | "unticked" | "mixed";
|
|
1601
|
+
/** A tree's shape by key, built once per tree by `createTreeIndex`. */
|
|
1602
|
+
interface TreeIndex<K extends OptionKey> {
|
|
1603
|
+
/** The top-level keys, in order. */
|
|
1604
|
+
readonly roots: readonly K[];
|
|
1605
|
+
/** Every key, parents before their children, in order. */
|
|
1606
|
+
readonly keys: readonly K[];
|
|
1607
|
+
/** Whether the tree holds `key`. */
|
|
1608
|
+
readonly has: (key: K) => boolean;
|
|
1609
|
+
/** The parent's key; `null` for a top-level or unknown key. */
|
|
1610
|
+
readonly parentOf: (key: K) => K | null;
|
|
1611
|
+
/** The children's keys; `null` for a leaf, an unknown key or children not loaded yet. */
|
|
1612
|
+
readonly childrenOf: (key: K) => readonly K[] | null;
|
|
1613
|
+
readonly isDisabled: (key: K) => boolean;
|
|
1614
|
+
/** Keys listed again under their own descendant, or twice in the tree: left out, for a development warning. */
|
|
1615
|
+
readonly cycles: readonly K[];
|
|
1616
|
+
}
|
|
1617
|
+
/** The shape of `nodes`, by key. A key met a second time is left out and listed in `cycles`. */
|
|
1618
|
+
declare function createTreeIndex<O extends TreeOption>(nodes: readonly O[]): TreeIndex<KeyOf<O>>;
|
|
1619
|
+
/**
|
|
1620
|
+
* The ticked set after ticking (`tick` true) or unticking `key`. With
|
|
1621
|
+
* `cascade`, the tick carries down to every enabled descendant (a
|
|
1622
|
+
* disabled node and its subtree keep their state) and up: a parent is
|
|
1623
|
+
* ticked exactly when every enabled child is. Without it, the node ticks
|
|
1624
|
+
* alone. A disabled node changes nothing.
|
|
1625
|
+
*
|
|
1626
|
+
* The set keeps the order nodes were ticked in: the node, its
|
|
1627
|
+
* descendants, then the parents it completed, bottom up. `treeValue`
|
|
1628
|
+
* appends in that order.
|
|
1629
|
+
*/
|
|
1630
|
+
declare function tickNode<K extends OptionKey>(tree: TreeIndex<K>, ticked: ReadonlySet<K>, key: K, tick: boolean, cascade: boolean): ReadonlySet<K>;
|
|
1631
|
+
/**
|
|
1632
|
+
* A node's tick as a ticked set shows it, for a cascading tree: a node
|
|
1633
|
+
* with enabled children is ticked when they all are, unticked when none
|
|
1634
|
+
* is (and it is not ticked itself), and mixed otherwise; a leaf, or a
|
|
1635
|
+
* node whose children are not loaded, is ticked when the set holds it.
|
|
1636
|
+
*/
|
|
1637
|
+
declare function tickState<K extends OptionKey>(tree: TreeIndex<K>, ticked: ReadonlySet<K>, key: K): TickState;
|
|
1638
|
+
/**
|
|
1639
|
+
* The value a ticked set means in `mode`: the keys of `previous` it still
|
|
1640
|
+
* holds, in their order, then the rest in the order they were ticked.
|
|
1641
|
+
* Keys the tree does not hold stay. `null` when nothing is ticked.
|
|
1642
|
+
*/
|
|
1643
|
+
declare function treeValue<K extends OptionKey>(tree: TreeIndex<K>, ticked: ReadonlySet<K>, mode: TreeValueMode, previous: readonly K[] | null): readonly K[] | null;
|
|
1644
|
+
/**
|
|
1645
|
+
* The ticked set a value means, in any `TreeValueMode`: each key ticks its
|
|
1646
|
+
* node and, with `cascade` (the default), its enabled descendants, and
|
|
1647
|
+
* the parents follow. A disabled node in the value is ticked too. Keys
|
|
1648
|
+
* the tree does not hold stay in the set.
|
|
1649
|
+
*/
|
|
1650
|
+
declare function tickedFromValue<K extends OptionKey>(tree: TreeIndex<K>, value: readonly K[] | null, cascade?: boolean): ReadonlySet<K>;
|
|
1651
|
+
/** A visible row of a tree. */
|
|
1652
|
+
interface TreeRow<O extends TreeOption> {
|
|
1653
|
+
readonly option: O;
|
|
1654
|
+
/** Depth from 1: `aria-level`. */
|
|
1655
|
+
readonly level: number;
|
|
1656
|
+
/** Open, closed, or `null` for a leaf (no children, given or to load). */
|
|
1657
|
+
readonly expanded: boolean | null;
|
|
1658
|
+
/** The parent's row; `null` at the top. */
|
|
1659
|
+
readonly parent: number | null;
|
|
1660
|
+
/** How many siblings it has, itself included, and its place among them from 1: `aria-setsize`, `aria-posinset`. */
|
|
1661
|
+
readonly size: number;
|
|
1662
|
+
readonly position: number;
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* The rows a tree shows: every top-level node, and the children of every
|
|
1666
|
+
* open node. A node listed under its own descendant is left out.
|
|
1667
|
+
*/
|
|
1668
|
+
declare function flattenTree<O extends TreeOption>(nodes: readonly O[], open: ReadonlySet<KeyOf<O>>): readonly TreeRow<O>[];
|
|
1669
|
+
/** What a search keeps of a tree. */
|
|
1670
|
+
interface TreeSearch<O extends TreeOption> {
|
|
1671
|
+
/** Every match and its ancestors; a match keeps all its children. */
|
|
1672
|
+
readonly nodes: readonly O[];
|
|
1673
|
+
/** The ancestors of the matches, to show open while searching. */
|
|
1674
|
+
readonly open: ReadonlySet<KeyOf<O>>;
|
|
1675
|
+
/** Where each matching node matched. */
|
|
1676
|
+
readonly matches: ReadonlyMap<KeyOf<O>, OptionMatch>;
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* The nodes a search keeps: every node `query` matches, with its whole
|
|
1680
|
+
* subtree (closed unless a descendant matches too), and the ancestors of
|
|
1681
|
+
* every match, open. An empty query keeps the tree as it is.
|
|
1682
|
+
*/
|
|
1683
|
+
declare function searchTree<O extends TreeOption>(nodes: readonly O[], query: string, context: Omit<MatchContext<O>, "defaultMatch">): TreeSearch<O>;
|
|
1684
|
+
/**
|
|
1685
|
+
* A node's children loading on demand. `request` numbers the load, so an
|
|
1686
|
+
* answer to an earlier one is ignored.
|
|
1687
|
+
*/
|
|
1688
|
+
type ChildrenLoad = {
|
|
1689
|
+
readonly kind: "unloaded";
|
|
1690
|
+
} | {
|
|
1691
|
+
readonly kind: "loading";
|
|
1692
|
+
readonly request: number;
|
|
1693
|
+
} | {
|
|
1694
|
+
readonly kind: "loaded";
|
|
1695
|
+
} | {
|
|
1696
|
+
readonly kind: "failed";
|
|
1697
|
+
readonly error: unknown;
|
|
1698
|
+
};
|
|
1699
|
+
/** What can happen to a node's children load. */
|
|
1700
|
+
type ChildrenLoadAction = {
|
|
1701
|
+
readonly type: "start";
|
|
1702
|
+
readonly request: number;
|
|
1703
|
+
} | {
|
|
1704
|
+
readonly type: "loaded";
|
|
1705
|
+
readonly request: number;
|
|
1706
|
+
} | {
|
|
1707
|
+
readonly type: "fail";
|
|
1708
|
+
readonly request: number;
|
|
1709
|
+
readonly error: unknown;
|
|
1710
|
+
}
|
|
1711
|
+
/** Forget the children: the tree was reloaded. */
|
|
1712
|
+
| {
|
|
1713
|
+
readonly type: "reset";
|
|
1714
|
+
};
|
|
1715
|
+
declare const CHILDREN_UNLOADED: ChildrenLoad;
|
|
1716
|
+
/**
|
|
1717
|
+
* A children load after `action`. An answer whose `request` is not the
|
|
1718
|
+
* one loading is ignored; a load starts again from any state, a retry
|
|
1719
|
+
* after a failure among them.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function childrenLoadReducer(state: ChildrenLoad, action: ChildrenLoadAction): ChildrenLoad;
|
|
1722
|
+
|
|
707
1723
|
/** The day a week starts on in a locale, and its weekend days. */
|
|
708
1724
|
interface WeekInfo {
|
|
709
1725
|
readonly firstDay: Weekday;
|
|
@@ -928,176 +1944,6 @@ declare function formatDayOfMonth(date: PlainDate, locale: Intl.LocalesArgument)
|
|
|
928
1944
|
/** A year as a calendar's year list writes it, in the locale's digits. */
|
|
929
1945
|
declare function formatCalendarYear(year: number, locale: Intl.LocalesArgument): string;
|
|
930
1946
|
|
|
931
|
-
/** One message a field holds, ready to show. */
|
|
932
|
-
interface FieldMessage {
|
|
933
|
-
readonly severity: Severity;
|
|
934
|
-
/** The text shown, already localized. */
|
|
935
|
-
readonly text: string;
|
|
936
|
-
/**
|
|
937
|
-
* A stable id for the kind of message: `"unreadable"`, `"required"`,
|
|
938
|
-
* `"tooShort"`, `"tooLong"`, `"pattern"`, `"refused"`, or the app's own;
|
|
939
|
-
* `null` when it has none.
|
|
940
|
-
*/
|
|
941
|
-
readonly code: string | null;
|
|
942
|
-
/**
|
|
943
|
-
* Where it came from: reading the text (`"parse"`), a validator
|
|
944
|
-
* (`"validate"`), a refused commit (`"commit"`) or the app (`"app"`).
|
|
945
|
-
* Growable: a later release may add a source.
|
|
946
|
-
*/
|
|
947
|
-
readonly source: "parse" | "validate" | "commit" | "app";
|
|
948
|
-
}
|
|
949
|
-
/** A message as an app writes it: a string is an error. */
|
|
950
|
-
type FieldMessageInput = string | {
|
|
951
|
-
readonly text: string;
|
|
952
|
-
readonly severity?: Severity | undefined;
|
|
953
|
-
readonly code?: string | undefined;
|
|
954
|
-
};
|
|
955
|
-
/**
|
|
956
|
-
* Whatever an app or a validator returned, as a list of messages from
|
|
957
|
-
* `source`: one input or several, `null` and `undefined` for none.
|
|
958
|
-
*/
|
|
959
|
-
declare function toFieldMessages(input: FieldMessageInput | readonly FieldMessageInput[] | null | undefined, source: FieldMessage["source"]): FieldMessage[];
|
|
960
|
-
/**
|
|
961
|
-
* `messages` in the order a field shows them: the most serious first, and
|
|
962
|
-
* within a severity what the text could not say (parse), then a refused
|
|
963
|
-
* commit, then validators, then the app's own. Equal messages keep their
|
|
964
|
-
* order.
|
|
965
|
-
*/
|
|
966
|
-
declare function sortFieldMessages(messages: readonly FieldMessage[]): FieldMessage[];
|
|
967
|
-
/** Whether any of `messages` is an error: the only severity that blocks. */
|
|
968
|
-
declare function hasError(messages: readonly FieldMessage[]): boolean;
|
|
969
|
-
|
|
970
|
-
/**
|
|
971
|
-
* Where a change came from. A minor release may add a member, so a `switch`
|
|
972
|
-
* over it needs a `default`.
|
|
973
|
-
*
|
|
974
|
-
* - `typing`: keys, deleting and text an input method composed.
|
|
975
|
-
* - `paste`, `drop`: text pasted or dropped in.
|
|
976
|
-
* - `step`: arrow keys or stepper buttons (number and date inputs).
|
|
977
|
-
* - `picker`: an option, a date or a row chosen in a popup.
|
|
978
|
-
* - `preset`: a preset such as "Last 7 days".
|
|
979
|
-
* - `clear`: the clear button, or Escape in a search box.
|
|
980
|
-
* - `undo`: the browser's undo or redo.
|
|
981
|
-
* - `api`: `setValue`, `reset` or a form reset.
|
|
982
|
-
* - `toggle`: a checkbox or switch flipped, by key or pointer.
|
|
983
|
-
* - `revert`: Escape put back the last committed value.
|
|
984
|
-
* - `autofill`: the text changed while the field did not have focus.
|
|
985
|
-
*/
|
|
986
|
-
type ChangeSource = "typing" | "paste" | "drop" | "step" | "picker" | "preset" | "clear" | "undo" | "api" | "toggle" | "revert" | "autofill";
|
|
987
|
-
/**
|
|
988
|
-
* What ended an edit. A minor release may add a member, so a `switch` over
|
|
989
|
-
* it needs a `default`.
|
|
990
|
-
*/
|
|
991
|
-
type CommitTrigger = "enter" | "tab" | "blur" | "picker" | "preset" | "clear" | "toggle" | "autofill";
|
|
992
|
-
/** The browser's report of a text edit. */
|
|
993
|
-
interface TextInputDetails {
|
|
994
|
-
/**
|
|
995
|
-
* The `InputEvent`'s `inputType` (`"insertText"`,
|
|
996
|
-
* `"deleteContentBackward"`, `"insertFromPaste"`, `"historyUndo"`, ...);
|
|
997
|
-
* `null` when no browser edit made the change.
|
|
998
|
-
*/
|
|
999
|
-
readonly inputType: string | null;
|
|
1000
|
-
/** The text inserted (typed, pasted, dropped, composed); `null` for a deletion. */
|
|
1001
|
-
readonly data: string | null;
|
|
1002
|
-
readonly selectionStart: number | null;
|
|
1003
|
-
readonly selectionEnd: number | null;
|
|
1004
|
-
readonly isComposing: boolean;
|
|
1005
|
-
}
|
|
1006
|
-
/** No per-input details. */
|
|
1007
|
-
type NoDetails = Record<never, never>;
|
|
1008
|
-
/**
|
|
1009
|
-
* What every forms event carries. `value` and `text` are what the field
|
|
1010
|
-
* holds after the change the event is about (the proposed value, in a
|
|
1011
|
-
* before-event); `previousValue` and `previousText` what it held before.
|
|
1012
|
-
* `N` is the native event type: `Event` in forms-dom and forms.
|
|
1013
|
-
*/
|
|
1014
|
-
interface FieldEventBase<V, N = unknown> {
|
|
1015
|
-
readonly value: V | null;
|
|
1016
|
-
readonly previousValue: V | null;
|
|
1017
|
-
readonly text: string;
|
|
1018
|
-
readonly previousText: string;
|
|
1019
|
-
readonly source: ChangeSource;
|
|
1020
|
-
/** The browser event behind it; `null` for a change the app made. */
|
|
1021
|
-
readonly nativeEvent: N | null;
|
|
1022
|
-
/** The text edit behind it; `null` when no browser edit made the change. */
|
|
1023
|
-
readonly input: TextInputDetails | null;
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* The text changed. Reading the text comes after it, so `value` and
|
|
1027
|
-
* `previousValue` are both the value the field held before the edit.
|
|
1028
|
-
* Each input adds its own details by intersection; a details key never
|
|
1029
|
-
* reuses a base field's name.
|
|
1030
|
-
*/
|
|
1031
|
-
type FieldInputEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D;
|
|
1032
|
-
/** The value changed. */
|
|
1033
|
-
type FieldChangeEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D;
|
|
1034
|
-
/** The field's messages were worked out again. */
|
|
1035
|
-
type FieldValidateEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
1036
|
-
/** Every message the field holds now, shown or not yet. */
|
|
1037
|
-
readonly messages: readonly FieldMessage[];
|
|
1038
|
-
/** Whether none of them is an error. */
|
|
1039
|
-
readonly valid: boolean;
|
|
1040
|
-
};
|
|
1041
|
-
/** The user is done: the value is committed. */
|
|
1042
|
-
type FieldCommitEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
1043
|
-
readonly trigger: CommitTrigger;
|
|
1044
|
-
/** Whether `value` differs from `previousValue`: the value at the last commit, or at focus. */
|
|
1045
|
-
readonly changed: boolean;
|
|
1046
|
-
/** The value when the field gained focus. */
|
|
1047
|
-
readonly initialValue: V | null;
|
|
1048
|
-
};
|
|
1049
|
-
/**
|
|
1050
|
-
* A text edit is about to happen. `text` is the proposed text; reading it
|
|
1051
|
-
* comes later, so `value` and `previousValue` are the value held now.
|
|
1052
|
-
*/
|
|
1053
|
-
type FieldBeforeInputEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
1054
|
-
/** False while an input method is composing: it owns the text, so the two calls below do nothing. */
|
|
1055
|
-
readonly cancelable: boolean;
|
|
1056
|
-
readonly defaultPrevented: boolean;
|
|
1057
|
-
/** The edit does not happen. */
|
|
1058
|
-
preventDefault(): void;
|
|
1059
|
-
/** Inserts `data` in place of what was typed, pasted or dropped. */
|
|
1060
|
-
setData(data: string): void;
|
|
1061
|
-
};
|
|
1062
|
-
/** The value is about to change to `value`. */
|
|
1063
|
-
type FieldBeforeChangeEvent<V, D extends object = NoDetails, N = unknown> = FieldEventBase<V, N> & D & {
|
|
1064
|
-
readonly defaultPrevented: boolean;
|
|
1065
|
-
/** The value does not change; typed text is put back as it was before this edit. */
|
|
1066
|
-
preventDefault(): void;
|
|
1067
|
-
/** Changes to `value` instead; typed text becomes `format(value)` unless it already reads as it. */
|
|
1068
|
-
setValue(value: V | null): void;
|
|
1069
|
-
};
|
|
1070
|
-
/**
|
|
1071
|
-
* The value is about to be committed. The handler may return a promise:
|
|
1072
|
-
* the commit waits for it, and so does the `onBlur` of a field being left.
|
|
1073
|
-
*/
|
|
1074
|
-
type FieldBeforeCommitEvent<V, D extends object = NoDetails, N = unknown> = FieldCommitEvent<V, D, N> & {
|
|
1075
|
-
readonly defaultPrevented: boolean;
|
|
1076
|
-
/**
|
|
1077
|
-
* Refuses the commit; `message` (default `messages.checkFailed`) shows as
|
|
1078
|
-
* an error. Called after a returned promise settles, it does nothing.
|
|
1079
|
-
*/
|
|
1080
|
-
preventDefault(message?: FieldMessageInput): void;
|
|
1081
|
-
};
|
|
1082
|
-
/** The field gained or lost focus. */
|
|
1083
|
-
interface FieldFocusEvent<V, N = unknown> {
|
|
1084
|
-
readonly value: V | null;
|
|
1085
|
-
readonly text: string;
|
|
1086
|
-
readonly nativeEvent: N | null;
|
|
1087
|
-
}
|
|
1088
|
-
/** Every handler a field calls, each optional, in the order they fire. */
|
|
1089
|
-
interface FieldHandlers<V, D extends object = NoDetails, N = unknown> {
|
|
1090
|
-
readonly onFocus?: ((event: FieldFocusEvent<V, N>) => void) | undefined;
|
|
1091
|
-
readonly onBeforeInput?: ((event: FieldBeforeInputEvent<V, D, N>) => void) | undefined;
|
|
1092
|
-
readonly onInput?: ((event: FieldInputEvent<V, D, N>) => void) | undefined;
|
|
1093
|
-
readonly onBeforeChange?: ((event: FieldBeforeChangeEvent<V, D, N>) => void) | undefined;
|
|
1094
|
-
readonly onChange?: ((event: FieldChangeEvent<V, D, N>) => void) | undefined;
|
|
1095
|
-
readonly onValidate?: ((event: FieldValidateEvent<V, D, N>) => void) | undefined;
|
|
1096
|
-
readonly onBeforeCommit?: ((event: FieldBeforeCommitEvent<V, D, N>) => void | Promise<void>) | undefined;
|
|
1097
|
-
readonly onCommit?: ((event: FieldCommitEvent<V, D, N>) => void) | undefined;
|
|
1098
|
-
readonly onBlur?: ((event: FieldFocusEvent<V, N>) => void) | undefined;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
1947
|
/**
|
|
1102
1948
|
* The reading of a draft's text: `pending` while it has not been read yet
|
|
1103
1949
|
* (an input method is composing, or a change delay is running), else the
|
|
@@ -1633,6 +2479,21 @@ type ValidationResult = FieldMessageInput | readonly FieldMessageInput[] | null
|
|
|
1633
2479
|
type Validator<V> = (value: V | null, context: ValidatorContext) => ValidationResult;
|
|
1634
2480
|
/** `null`, or a string of only whitespace, is `messages.required`. */
|
|
1635
2481
|
declare function requiredRule<V>(): Validator<V>;
|
|
2482
|
+
/**
|
|
2483
|
+
* `null` is `messages.requiredChoice`: a choice input with nothing
|
|
2484
|
+
* chosen. Its value holds keys, so an empty string is a key like any other.
|
|
2485
|
+
*/
|
|
2486
|
+
declare function requiredChoiceRule<V>(): Validator<V>;
|
|
2487
|
+
/**
|
|
2488
|
+
* More than `max` keys is `messages.tooManyChoices`: a choice input with
|
|
2489
|
+
* several values, given one over its limit. `null` passes.
|
|
2490
|
+
*/
|
|
2491
|
+
declare function maxCountRule<K>(max: number): Validator<readonly K[]>;
|
|
2492
|
+
/**
|
|
2493
|
+
* Fewer than `min` keys is `messages.tooFewChoices`. `null` passes, as an
|
|
2494
|
+
* empty text passes `minLengthRule`: `required` asks for a first choice.
|
|
2495
|
+
*/
|
|
2496
|
+
declare function minCountRule<K>(min: number): Validator<readonly K[]>;
|
|
1636
2497
|
/** Fewer than `min` code points is `messages.tooShort`. `null` passes. */
|
|
1637
2498
|
declare function minLengthRule(min: number): Validator<string>;
|
|
1638
2499
|
/** More than `max` code points is `messages.tooLong`. `null` passes. */
|
|
@@ -2471,14 +3332,6 @@ type WritingDirection = "ltr" | "rtl";
|
|
|
2471
3332
|
*/
|
|
2472
3333
|
declare function inlineStep(key: string, direction?: WritingDirection): 1 | -1 | null;
|
|
2473
3334
|
|
|
2474
|
-
/**
|
|
2475
|
-
* Runs `callback` once after `delay` milliseconds and returns the function
|
|
2476
|
-
* that cancels it. forms-core keeps no timers of its own, so it can run
|
|
2477
|
-
* anywhere: whoever drives a field hands it one of these, the browser's
|
|
2478
|
-
* timers in a page and a fake one in a test.
|
|
2479
|
-
*/
|
|
2480
|
-
type Schedule = (callback: () => void, delay: number) => () => void;
|
|
2481
|
-
|
|
2482
3335
|
/**
|
|
2483
3336
|
* What a field is given: its value, how it reads and writes text, how it
|
|
2484
3337
|
* validates, and the app's handlers. A renderer passes the latest on every
|
|
@@ -3293,8 +4146,12 @@ declare function maxRule<V extends NumberLike>(max: NumberLike, options?: Number
|
|
|
3293
4146
|
*/
|
|
3294
4147
|
declare function stepRule<V extends NumberLike>(step: NumberLike, base?: NumberLike, options?: NumberOptions): Validator<V>;
|
|
3295
4148
|
|
|
3296
|
-
/**
|
|
3297
|
-
|
|
4149
|
+
/**
|
|
4150
|
+
* What opened a popup: its button, a key in the field (F4, Alt+ArrowDown),
|
|
4151
|
+
* or typing in a search box. A minor release may add a member, so a
|
|
4152
|
+
* `switch` over it needs a `default`.
|
|
4153
|
+
*/
|
|
4154
|
+
type PopupOpenReason = "button" | "keyboard" | "typing";
|
|
3298
4155
|
/**
|
|
3299
4156
|
* What closed a popup: Escape; a press outside it; a scroll outside it or
|
|
3300
4157
|
* the window resizing, which would leave it behind its field; focus or
|
|
@@ -3514,4 +4371,4 @@ interface VisibleRange {
|
|
|
3514
4371
|
*/
|
|
3515
4372
|
declare function visibleRange(heights: RowHeights, estimatedHeight: number, scrollTop: number, viewportHeight: number, overscan: number): VisibleRange;
|
|
3516
4373
|
|
|
3517
|
-
export { ALL_DAY, type AssembleContext, type BeforeInputDecision, type BooleanWords, CALENDAR_FISCAL_YEAR, CHECKBOX_WORDS, type CalendarAction, type CalendarContext, type CalendarDay, type CalendarLimits, type CalendarMonth, type CalendarMove, type CalendarState, type CalendarUnit, type CalendarView, type CalendarWeek, type ChangeCause, type ChangeSource, type CleanedNumber, type CommitOutcome, type CommitTrigger, type CompiledMask, type CompositeController, type CompositeDetailsContext, type CompositeFieldOptions, type CompositeState, type DateDetails, type DateFieldOptions, type DateLayout, type DateLayoutFields, type DateLayoutOptions, type DateLayoutPart, type DateParts, type DatePreset, type DateRange, type DateReadOptions, type DateReadingInfo, type DateRuleContext, type DateSegment, type DateSegmentType, type DateTextReading, type DateTimeDetails, type DateTimeFieldOptions, type DateUnreadableReason, type DecimalString, type DefaultTimes, type DurationDetails, type DurationLike, type DurationNotation, type DurationOptions, type DurationReading, type DurationUnit, type FieldAction, type FieldBeforeChangeEvent, type FieldBeforeCommitEvent, type FieldBeforeInputEvent, type FieldChangeEvent, type FieldCommitEvent, type FieldController, type FieldDraft, type FieldEventBase, type FieldFocusEvent, type FieldHandlers, type FieldInputEvent, type FieldMessage, type FieldMessageInput, type FieldOptions, type FieldPhase, type FieldRegistry, type FieldState, type FieldValidateEvent, type FiscalMonthPeriod, type FiscalQuarterPeriod, type FiscalYear, type FiscalYearPeriod, type FormatContext, type FormatPurpose, type Formatter, type FormsMessages, type FractionDigits, type InputFilter, type InputFilterDecision, type Instant, type InstantFieldOptions, type MaskCompileResult, type MaskDetails, type MaskEdit, type MaskInputHints, type MaskLetterCase, type MaskOptions, type MaskPreset, type MaskPresets, type MaskResult, type MaskSlot, type MaskSource, type MaskTokenDefinition, type MaskTokens, type MaskValueFormat, type MaskedText, type MessageSummary, type MonthGrid, type MonthGridOptions, type MonthPeriod, NO_TIME, type NegativeStyle, type NoDetails, type NoFlags, type NumberAffixes, type NumberDetails, type NumberEntry, type NumberEntryOptions, type NumberFieldOptions, type NumberLike, type NumberOptions, type NumberReading, type NumberReadingInfo, type NumberStep, type NumberStyle, type NumberSymbolOverrides, type NumberSymbols, type NumberTextForm, type NumberUnreadableReason, type NumberValue, type NumberValueType, type OvernightFlags, POPUP_CLOSED, type ParseContext, type ParseResult, type Parser, type PartChange, type PartController, type PartOptions, type PartTexts, type PartValues, type PercentScale, type Period, type PeriodDetails, type PeriodFieldOptions, type PeriodGranularity, type PeriodLayoutOptions, type PeriodParts, type PeriodValues, type PickedDays, type PivotOptions, type PlainDate, type PlainDateTime, type PlainTime, type PopupAction, type PopupCloseReason, type PopupOpenChange, type PopupOpenReason, type PopupState, type PopupStep, type QuarterPeriod, type Range, type RangeBounds, type RangeDetails, type RangeEnd, type RangeEnds, type RangeKind, type RangeOptions, type RangeOrientation, type RangePick, type RangePickAction, type RangePickStep, type RangeReading, type RangeTextOptions, type RangeValue, type RegisteredField, type RelativeDateRule, type RelativeRange, type RoundingMode, type RowHeights, SWITCH_WORDS, type Schedule, type SegmentAction, type SegmentAria, type SegmentContext, type SegmentEntry, type SegmentRun, type SegmentState, type SegmentStep, type SegmentType, type Severity, type SeverityCount, type SpanFormatter, type StepDirection, type StepRequest, type StepSize, type SummaryItem, type TextEdit, type TextInputDetails, type TextParseOptions, type TextReading, type TimeColumn, type TimeColumnOption, type TimeColumnType, type TimeColumnsOptions, type TimeDetails, type TimeFieldOptions, type TimeLimits, type TimeParts, type TimeRange, type TimeRangeContext, type TimeZoneDisambiguation, type ValidationResult, type Validator, type ValidatorContext, type VisibleRange, type WeekInfo, type WeekNumbering, type WeekOfYear, type Weekday, type WritingDirection, type YearPeriod, type ZonedRangeContext, type ZonedReading, addDays, addDecimals, addMonths, addPeriods, addYears, applyMaskEdit, availableDateRule, booleanFormatter, booleanParser, calendarMonth, calendarMonthParts, calendarReducer, calendarStart, calendarYears, checkedRule, clampCalendarDate, clampCalendarMonth, clampTime, cleanPastedNumber, commonDatePresets, compareCalendarMonths, compareDateTimes, compareDates, compareDecimals, compareInstants, comparePeriods, compareTimes, compileMask, convertDuration, countCharacters, counterAnnouncement, createCompositeController, createDefaultFormsMessages, createFieldController, createFieldRegistry, dateDetails, dateFormatter, dateFromInstant, dateFromPlainDate, dateFromPlainDateTime, dateLayout, dateParser, dateParts, datePresetLabel, dateRangeKind, dateTimeDetails, dateTimeFormatter, dateTimeParser, dateTimeRangeKind, dayOfWeek, dayTimeLimits, daysBetween, daysInMonth, daysToDateTimeRange, daysToInstantRange, decimalRangeKind, decimalToNumber, defaultFormsMessages, defaultWeekNumbering, durationDetails, durationFormatter, durationParser, endOfMonth, endsRule, exactInstantOf, fieldMessages, fieldReducer, fieldText, filterMaskEdit, filterNumberEdit, fixedFractionDigits, formatCalendarMonth, formatCalendarYear, formatDate, formatDateRange, formatDateSegments, formatDateTime, formatDateTimeSegments, formatDayOfMonth, formatDaySpan, formatDuration, formatInstant, formatMasked, formatMonthName, formatNumber, formatNumberRange, formatPeriod, formatPeriodPage, formatPeriodPlace, formatPeriodSegments, formatText, formatTime, formatTimeRange, formatTimeSegments, formatTimeSpan, formatWeekday, hasError, ibanRule, idleSegments, inlineStep, instantDetails, instantFormatter, instantFromDate, instantOf, instantParser, instantRangeKind, instantZoneMessage, ipv4Rule, isCalendarDayDisabled, isCalendarMonth, isCalendarMonthDisabled, isDecimalString, isInstant, isLeapYear, isPeriod, isPlainDate, isPlainDateTime, isPlainTime, isRelativeDateRule, isRelativeRange, isTimeZone, isValidMaskStart, joinSegments, luhnRule, maskDetails, maskFormatter, maskInputHints, maskParser, maskPresets, maxDateRule, maxDateTimeRule, maxDurationRule, maxInstantRule, maxLengthRule, maxPeriodRule, maxRule, maxSpanRule, maxTimeRule, minDateRule, minDateTimeRule, minDurationRule, minInstantRule, minLengthRule, minPeriodRule, minRule, minSpanRule, minTimeRule, minutesOfDay, monthGrid, monthOfDate, mostSevere, moveCalendarDate, nextCheckedValue, normalizeDecimal, nowIn, numberAffixes, numberCaret, numberDetails, numberFormatter, numberFractionDigits, numberParser, numberRangeKind, numberRangeKindOf, numberSymbols, numberToDecimal, offsetOf, orderRange, parseDuration, parseNumber, parsed, patternRule, periodDetails, periodFormatter, periodGranularity, periodLayout, periodOf, periodPage, periodPageYears, periodParser, periodParts, periodRange, pickedDays, pivotYear, plainDate, plainDateFromDate, plainDateTime, plainTime, popupReducer, rangeDetails, rangeEnds, rangeFlags, rangeIncludes, rangePickPreview, rangePickReducer, rangeSpan, readDateShortcut, readDateText, readRangeEnds, readTimeText, relativePreset, requiredRule, resolveDateRange, resolveDateRule, resolveFormsMessages, resolveRange, roundDecimal, runtimeTimeZone, sameDayIn, sameRange, sameRule, segmentAria, segmentReducer, segmentRuns, segmentSpans, segmentValue, segmentsTime, setTimeColumn, shiftDecimal, shownEnd, shownMessages, snapTime, sortFieldMessages, spanOf, splitDateTime, splitSegments, startOfDayIn, startOfMonth, startOfWeek, stepNumber, stepNumberValue, stepRule, subtractDecimals, summarizeMessages, textParser, timeColumns, timeDetails, timeFormatter, timeParser, timeParts, timeRangeKind, toFieldMessages, toInstant, toPeriod, toPlainDate, toPlainDateTime, toPlainTime, todayIn, typeaheadIndex, unreadable, visibleRange, wallClockOf, weekInfo, weekOf, writeSegment };
|
|
4374
|
+
export { ALL_DAY, type AbortFactory, type ActiveMove, type AssembleContext, type BeforeInputDecision, type BooleanWords, CALENDAR_FISCAL_YEAR, CHECKBOX_WORDS, CHILDREN_UNLOADED, type CalendarAction, type CalendarContext, type CalendarDay, type CalendarLimits, type CalendarMonth, type CalendarMove, type CalendarState, type CalendarUnit, type CalendarView, type CalendarWeek, type ChangeCause, type ChangeSource, type ChildrenLoad, type ChildrenLoadAction, type ChoiceDetails, type ChoiceOption, type CleanedNumber, type CommitOutcome, type CommitTrigger, type CompiledMask, type CompositeController, type CompositeDetailsContext, type CompositeFieldOptions, type CompositeState, type CreateEvent, DEFAULT_MATCH_FIELDS, DEFAULT_SOURCE_DEBOUNCE, DEFAULT_SOURCE_PAGE_SIZE, type DateDetails, type DateFieldOptions, type DateLayout, type DateLayoutFields, type DateLayoutOptions, type DateLayoutPart, type DateParts, type DatePreset, type DateRange, type DateReadOptions, type DateReadingInfo, type DateRuleContext, type DateSegment, type DateSegmentType, type DateTextReading, type DateTimeDetails, type DateTimeFieldOptions, type DateUnreadableReason, type DecimalString, type DefaultTimes, type DisabledOptions, type DurationDetails, type DurationLike, type DurationNotation, type DurationOptions, type DurationReading, type DurationUnit, type FieldAction, type FieldBeforeChangeEvent, type FieldBeforeCommitEvent, type FieldBeforeInputEvent, type FieldChangeEvent, type FieldCommitEvent, type FieldController, type FieldDraft, type FieldEventBase, type FieldFocusEvent, type FieldHandlers, type FieldInputEvent, type FieldMessage, type FieldMessageInput, type FieldOptions, type FieldPhase, type FieldRegistry, type FieldState, type FieldValidateEvent, type FiscalMonthPeriod, type FiscalQuarterPeriod, type FiscalYear, type FiscalYearPeriod, type FoldedText, type FormatContext, type FormatPurpose, type Formatter, type FormsMessages, type FractionDigits, type HighlightChangeEvent, type InputFilter, type InputFilterDecision, type Instant, type InstantFieldOptions, type KeyChanges, type KeyList, type KeyLookup, type KeyOf, type LoadErrorEvent, type LoadedOptions, type MaskCompileResult, type MaskDetails, type MaskEdit, type MaskInputHints, type MaskLetterCase, type MaskOptions, type MaskPreset, type MaskPresets, type MaskResult, type MaskSlot, type MaskSource, type MaskTokenDefinition, type MaskTokens, type MaskValueFormat, type MaskedText, type MatchContext, type MatchMode, type MessageSummary, type MonthGrid, type MonthGridOptions, type MonthPeriod, NO_TIME, type NavigableRow, type NegativeStyle, type NoDetails, type NoFlags, type NumberAffixes, type NumberDetails, type NumberEntry, type NumberEntryOptions, type NumberFieldOptions, type NumberLike, type NumberOptions, type NumberReading, type NumberReadingInfo, type NumberStep, type NumberStyle, type NumberSymbolOverrides, type NumberSymbols, type NumberTextForm, type NumberUnreadableReason, type NumberValue, type NumberValueType, type OptionAction, type OptionCache, type OptionCacheOptions, type OptionCursor, type OptionHit, type OptionIndex, type OptionKey, type OptionMatch, type OptionMatcher, type OptionPage, type OptionQuery, type OptionRow, type OptionRowActions, type OptionSearch, type OptionSource, type OptionSourceController, type OptionSourceOptions, type OvernightFlags, POPUP_CLOSED, type PageKey, type ParseContext, type ParseResult, type Parser, type PartChange, type PartController, type PartOptions, type PartTexts, type PartValues, type PercentScale, type Period, type PeriodDetails, type PeriodFieldOptions, type PeriodGranularity, type PeriodLayoutOptions, type PeriodParts, type PeriodValues, type PickedDays, type PivotOptions, type PlainDate, type PlainDateTime, type PlainTime, type PopupAction, type PopupCloseReason, type PopupOpenChange, type PopupOpenReason, type PopupState, type PopupStep, type QuarterPeriod, type QueryChangeEvent, type Range, type RangeBounds, type RangeDetails, type RangeEnd, type RangeEnds, type RangeKind, type RangeOptions, type RangeOrientation, type RangePick, type RangePickAction, type RangePickStep, type RangeReading, type RangeTextOptions, type RangeValue, type RegisteredField, type RelativeDateRule, type RelativeRange, type ResolveRequest, type RoundingMode, type RowHeights, SOURCE_IDLE, SWITCH_WORDS, type Schedule, type ScopeState, type SegmentAction, type SegmentAria, type SegmentContext, type SegmentEntry, type SegmentRun, type SegmentState, type SegmentStep, type SegmentType, type Severity, type SeverityCount, type SingleChoiceDetails, type SourceAction, type SourceState, type SpanFormatter, type StepDirection, type StepRequest, type StepSize, type SummaryItem, type TextEdit, type TextInputDetails, type TextParseOptions, type TextRange, type TextReading, type TickState, type TimeColumn, type TimeColumnOption, type TimeColumnType, type TimeColumnsOptions, type TimeDetails, type TimeFieldOptions, type TimeLimits, type TimeParts, type TimeRange, type TimeRangeContext, type TimeZoneDisambiguation, type TreeIndex, type TreeOption, type TreeRow, type TreeSearch, type TreeSource, type TreeValueMode, type TypeaheadRow, type ValidationResult, type Validator, type ValidatorContext, type VisibleRange, type WeekInfo, type WeekNumbering, type WeekOfYear, type Weekday, type WritingDirection, type YearPeriod, type ZonedRangeContext, type ZonedReading, addDays, addDecimals, addKeys, addMonths, addPeriods, addYears, appendPage, applyMaskEdit, availableDateRule, booleanFormatter, booleanParser, calendarMonth, calendarMonthParts, calendarReducer, calendarStart, calendarYears, canAddKey, canSelectAll, checkedRule, childrenLoadReducer, choiceDetails, clampCalendarDate, clampCalendarMonth, clampTime, cleanPastedNumber, clearKeys, commonDatePresets, compareCalendarMonths, compareDateTimes, compareDates, compareDecimals, compareInstants, comparePeriods, compareTimes, compileMask, convertDuration, countCharacters, counterAnnouncement, createCompositeController, createDefaultFormsMessages, createFieldController, createFieldRegistry, createOptionCache, createOptionIndex, createOptionSourceController, createTreeIndex, dateDetails, dateFormatter, dateFromInstant, dateFromPlainDate, dateFromPlainDateTime, dateLayout, dateParser, dateParts, datePresetLabel, dateRangeKind, dateTimeDetails, dateTimeFormatter, dateTimeParser, dateTimeRangeKind, dayOfWeek, dayTimeLimits, daysBetween, daysInMonth, daysToDateTimeRange, daysToInstantRange, decimalRangeKind, decimalToNumber, defaultFormsMessages, defaultWeekNumbering, durationDetails, durationFormatter, durationParser, endOfMonth, endsRule, exactInstantOf, fieldMessages, fieldReducer, fieldText, filterMaskEdit, filterNumberEdit, filtersKey, findDuplicateKeys, fixedFractionDigits, flattenOptions, flattenTree, foldText, formatCalendarMonth, formatCalendarYear, formatDate, formatDateRange, formatDateSegments, formatDateTime, formatDateTimeSegments, formatDayOfMonth, formatDaySpan, formatDuration, formatInstant, formatMasked, formatMonthName, formatNumber, formatNumberRange, formatPeriod, formatPeriodPage, formatPeriodPlace, formatPeriodSegments, formatText, formatTime, formatTimeRange, formatTimeSegments, formatTimeSpan, formatWeekday, hasError, hasKey, ibanRule, idleSegments, inlineStep, instantDetails, instantFormatter, instantFromDate, instantOf, instantParser, instantRangeKind, instantZoneMessage, ipv4Rule, isCalendarDayDisabled, isCalendarMonth, isCalendarMonthDisabled, isDecimalString, isInstant, isLandingRow, isLeapYear, isPeriod, isPlainDate, isPlainDateTime, isPlainTime, isRelativeDateRule, isRelativeRange, isTimeZone, isValidMaskStart, joinSegments, keyChanges, keyText, luhnRule, maskDetails, maskFormatter, maskInputHints, maskParser, maskPresets, matchOption, matchText, maxCountRule, maxDateRule, maxDateTimeRule, maxDurationRule, maxInstantRule, maxLengthRule, maxPeriodRule, maxRule, maxSpanRule, maxTimeRule, minCountRule, minDateRule, minDateTimeRule, minDurationRule, minInstantRule, minLengthRule, minPeriodRule, minRule, minSpanRule, minTimeRule, minutesOfDay, monthGrid, monthOfDate, mostSevere, moveActive, moveCalendarDate, nextCheckedValue, normalizeDecimal, nowIn, numberAffixes, numberCaret, numberDetails, numberFormatter, numberFractionDigits, numberParser, numberRangeKind, numberRangeKindOf, numberSymbols, numberToDecimal, offsetOf, orderRange, parseDuration, parseNumber, parsed, patternRule, periodDetails, periodFormatter, periodGranularity, periodLayout, periodOf, periodPage, periodPageYears, periodParser, periodParts, periodRange, pickedDays, pivotYear, plainDate, plainDateFromDate, plainDateTime, plainTime, popupReducer, rangeDetails, rangeEnds, rangeFlags, rangeIncludes, rangeKeys, rangePickPreview, rangePickReducer, rangeSpan, readDateShortcut, readDateText, readRangeEnds, readTimeText, relativePreset, removeKeys, requiredChoiceRule, requiredRule, resolveDateRange, resolveDateRule, resolveFormsMessages, resolveRange, roundDecimal, runtimeTimeZone, sameDayIn, sameFilters, sameKey, sameKeys, sameRange, sameRule, scopeState, searchTree, segmentAria, segmentReducer, segmentRuns, segmentSpans, segmentValue, segmentsTime, selectAll, setTimeColumn, shiftDecimal, shownEnd, shownMessages, singleChoiceDetails, snapTime, sortFieldMessages, sourceReducer, spanOf, splitDateTime, splitSegments, standInOption, startOfDayIn, startOfMonth, startOfWeek, stepNumber, stepNumberValue, stepRule, subtractDecimals, summarizeMessages, textParser, tickNode, tickState, tickedFromValue, timeColumns, timeDetails, timeFormatter, timeParser, timeParts, timeRangeKind, toFieldMessages, toInstant, toKeyList, toOptionPage, toPeriod, toPlainDate, toPlainDateTime, toPlainTime, todayIn, toggleKey, treeValue, typeaheadIndex, typeaheadRow, unreadable, valueKeys, visibleRange, wallClockOf, weekInfo, weekOf, writeSegment };
|