foldkit 0.82.9 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/anchor.d.ts +6 -0
- package/dist/ui/anchor.d.ts.map +1 -1
- package/dist/ui/anchor.js +27 -16
- package/dist/ui/animation/index.d.ts +4 -4
- package/dist/ui/animation/index.d.ts.map +1 -1
- package/dist/ui/button/index.d.ts +6 -6
- package/dist/ui/button/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +2 -2
- package/dist/ui/checkbox/index.d.ts +10 -10
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/checkbox/index.js +2 -2
- package/dist/ui/combobox/multi.d.ts +18 -14
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/multi.js +2 -2
- package/dist/ui/combobox/public.d.ts +1 -1
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +1 -1
- package/dist/ui/combobox/shared.d.ts +18 -13
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +11 -1
- package/dist/ui/combobox/single.d.ts +18 -14
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/combobox/single.js +2 -2
- package/dist/ui/datePicker/index.d.ts +1 -1
- package/dist/ui/datePicker/index.js +2 -2
- package/dist/ui/dialog/index.d.ts +8 -8
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +2 -2
- package/dist/ui/disclosure/index.d.ts +8 -8
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +2 -2
- package/dist/ui/dragAndDrop/index.d.ts +5 -5
- package/dist/ui/dragAndDrop/index.d.ts.map +1 -1
- package/dist/ui/fieldset/index.d.ts +7 -7
- package/dist/ui/fieldset/index.d.ts.map +1 -1
- package/dist/ui/fileDrop/index.js +2 -2
- package/dist/ui/input/index.d.ts +8 -8
- package/dist/ui/input/index.d.ts.map +1 -1
- package/dist/ui/listbox/multi.d.ts +16 -12
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/multi.js +2 -2
- package/dist/ui/listbox/public.d.ts +1 -1
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +1 -1
- package/dist/ui/listbox/shared.d.ts +16 -11
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +11 -1
- package/dist/ui/listbox/single.d.ts +16 -12
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/listbox/single.js +2 -2
- package/dist/ui/menu/index.d.ts +15 -12
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +13 -3
- package/dist/ui/menu/public.d.ts +1 -1
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +13 -10
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +13 -3
- package/dist/ui/popover/public.d.ts +1 -1
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/radioGroup/index.d.ts +13 -13
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +2 -2
- package/dist/ui/select/index.d.ts +8 -8
- package/dist/ui/select/index.d.ts.map +1 -1
- package/dist/ui/slider/index.d.ts +12 -12
- package/dist/ui/slider/index.d.ts.map +1 -1
- package/dist/ui/slider/index.js +2 -2
- package/dist/ui/switch/index.d.ts +10 -10
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/switch/index.js +2 -2
- package/dist/ui/tabs/index.d.ts +11 -11
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +2 -2
- package/dist/ui/textarea/index.d.ts +8 -8
- package/dist/ui/textarea/index.d.ts.map +1 -1
- package/dist/ui/toast/index.js +2 -2
- package/dist/ui/tooltip/index.d.ts +7 -7
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +2 -2
- package/dist/ui/virtualList/index.d.ts +4 -4
- package/dist/ui/virtualList/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -99,6 +99,8 @@ export declare const update: (model: {
|
|
|
99
99
|
readonly _tag: "CompletedClickItem";
|
|
100
100
|
} | {
|
|
101
101
|
readonly _tag: "CompletedAnchorMount";
|
|
102
|
+
} | {
|
|
103
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
102
104
|
} | {
|
|
103
105
|
readonly _tag: "Opened";
|
|
104
106
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -158,9 +160,9 @@ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Com
|
|
|
158
160
|
* focus commands. Use this in domain-event handlers when the combobox uses `onSelectedItem`. */
|
|
159
161
|
export declare const selectItem: (model: Model, item: string, displayText: string) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
160
162
|
/** Configuration for rendering a single-select combobox with `view`. */
|
|
161
|
-
export type ViewConfig<
|
|
163
|
+
export type ViewConfig<ParentMessage, Item extends string> = BaseViewConfig<ParentMessage, Item, Model>;
|
|
162
164
|
/** Renders a headless single-select combobox with keyboard navigation, selection tracking, and aria-activedescendant focus management. */
|
|
163
|
-
export declare const view: <
|
|
165
|
+
export declare const view: <ParentMessage, Item extends string>(config: Readonly<{
|
|
164
166
|
model: {
|
|
165
167
|
readonly id: string;
|
|
166
168
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -190,8 +192,10 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
190
192
|
readonly _tag: "CompletedAttachPreventBlur";
|
|
191
193
|
} | {
|
|
192
194
|
readonly _tag: "CompletedAttachSelectOnFocus";
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
+
} | {
|
|
196
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
197
|
+
}) => ParentMessage;
|
|
198
|
+
onSelectedItem?: (value: string) => ParentMessage;
|
|
195
199
|
items: readonly Item[];
|
|
196
200
|
itemToConfig: (item: Item, context: Readonly<{
|
|
197
201
|
isActive: boolean;
|
|
@@ -205,21 +209,21 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
205
209
|
itemToDisplayText: (item: Item, index: number) => string;
|
|
206
210
|
isItemDisabled?: (item: Item, index: number) => boolean;
|
|
207
211
|
inputClassName?: string;
|
|
208
|
-
inputAttributes?: readonly import("../../html/index.js").Attribute<
|
|
212
|
+
inputAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
209
213
|
inputPlaceholder?: string;
|
|
210
214
|
inputWrapperClassName?: string;
|
|
211
|
-
inputWrapperAttributes?: readonly import("../../html/index.js").Attribute<
|
|
215
|
+
inputWrapperAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
212
216
|
itemsClassName?: string;
|
|
213
|
-
itemsAttributes?: readonly import("../../html/index.js").Attribute<
|
|
217
|
+
itemsAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
214
218
|
itemsScrollClassName?: string;
|
|
215
|
-
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<
|
|
219
|
+
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
216
220
|
backdropClassName?: string;
|
|
217
|
-
backdropAttributes?: readonly import("../../html/index.js").Attribute<
|
|
221
|
+
backdropAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
218
222
|
className?: string;
|
|
219
|
-
attributes?: readonly import("../../html/index.js").Attribute<
|
|
223
|
+
attributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
220
224
|
buttonContent?: Html;
|
|
221
225
|
buttonClassName?: string;
|
|
222
|
-
buttonAttributes?: readonly import("../../html/index.js").Attribute<
|
|
226
|
+
buttonAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
223
227
|
formName?: string;
|
|
224
228
|
isDisabled?: boolean;
|
|
225
229
|
isInvalid?: boolean;
|
|
@@ -230,9 +234,9 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
230
234
|
className?: string;
|
|
231
235
|
}> | undefined;
|
|
232
236
|
groupClassName?: string;
|
|
233
|
-
groupAttributes?: readonly import("../../html/index.js").Attribute<
|
|
237
|
+
groupAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
234
238
|
separatorClassName?: string;
|
|
235
|
-
separatorAttributes?: readonly import("../../html/index.js").Attribute<
|
|
239
|
+
separatorAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
236
240
|
anchor?: Readonly<{
|
|
237
241
|
placement?: import("@floating-ui/dom").Placement;
|
|
238
242
|
gap?: number;
|
|
@@ -243,5 +247,5 @@ export declare const view: <Message, Item extends string>(config: Readonly<{
|
|
|
243
247
|
}>) => Html;
|
|
244
248
|
/** Creates a memoized single-select combobox view. Static config is captured in a closure;
|
|
245
249
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
246
|
-
export declare const lazy: <
|
|
250
|
+
export declare const lazy: <ParentMessage, Item extends string>(staticConfig: Omit<ViewConfig<ParentMessage, Item>, "model" | "toParentMessage" | "onSelectedItem">) => ((model: Model, toParentMessage: BaseViewConfig<ParentMessage, Item, Model>["toParentMessage"]) => Html);
|
|
247
251
|
//# sourceMappingURL=single.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../../src/ui/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,KAAK,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,E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E,cAAc,CAC7B,aAAa,EACb,IAAI,EACJ,KAAK,CACN,CAAC,iBAAiB,CAAC,KACjB,IAAI,CAoBR,CAAA"}
|
|
@@ -71,9 +71,9 @@ export const view = makeView({
|
|
|
71
71
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
72
72
|
export const lazy = (staticConfig) => {
|
|
73
73
|
const lazyView = createLazy();
|
|
74
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
74
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
75
75
|
...staticConfig,
|
|
76
76
|
model: currentModel,
|
|
77
|
-
toParentMessage:
|
|
77
|
+
toParentMessage: currentToParentMessage,
|
|
78
78
|
}), [model, toParentMessage]);
|
|
79
79
|
};
|
|
@@ -105,7 +105,7 @@ export declare const GotPopoverMessage: import("../../schema/index.js").Callable
|
|
|
105
105
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Opened", {}>, import("../../schema/index.js").CallableTaggedStruct<"Closed", {}>, import("../../schema/index.js").CallableTaggedStruct<"BlurredPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"PressedPointerOnButton", {
|
|
106
106
|
pointerType: S.String;
|
|
107
107
|
button: S.Number;
|
|
108
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedSetupInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedTeardownInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"IgnoredMouseClick", {}>, import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMount", {}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
108
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusPanel", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedFocusButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedLockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedUnlockScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedSetupInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedTeardownInert", {}>, import("../../schema/index.js").CallableTaggedStruct<"IgnoredMouseClick", {}>, import("../../schema/index.js").CallableTaggedStruct<"SuppressedSpaceScroll", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedAnchorMount", {}>, import("../../schema/index.js").CallableTaggedStruct<"CompletedBackdropPortal", {}>, import("../../schema/index.js").CallableTaggedStruct<"GotAnimationMessage", {
|
|
109
109
|
message: S.Union<[import("../../schema/index.js").CallableTaggedStruct<"Showed", {}>, import("../../schema/index.js").CallableTaggedStruct<"Hid", {}>, import("../../schema/index.js").CallableTaggedStruct<"AdvancedAnimationFrame", {}>, import("../../schema/index.js").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
110
110
|
}>]>;
|
|
111
111
|
}>;
|
|
@@ -264,9 +264,9 @@ export const view = (config) => {
|
|
|
264
264
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
265
265
|
export const lazy = (staticConfig) => {
|
|
266
266
|
const lazyView = createLazy();
|
|
267
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
267
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
268
268
|
...staticConfig,
|
|
269
269
|
model: currentModel,
|
|
270
|
-
toParentMessage:
|
|
270
|
+
toParentMessage: currentToParentMessage,
|
|
271
271
|
}), [model, toParentMessage]);
|
|
272
272
|
};
|
|
@@ -64,17 +64,17 @@ export declare const titleId: (model: Model) => string;
|
|
|
64
64
|
/** Returns the ID used for `aria-describedby` on the dialog. Apply this to your description element. */
|
|
65
65
|
export declare const descriptionId: (model: Model) => string;
|
|
66
66
|
/** Configuration for rendering a dialog with `view`. */
|
|
67
|
-
export type ViewConfig<
|
|
67
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
68
68
|
model: Model;
|
|
69
|
-
toParentMessage: (message: Closed | CompletedShowDialog | CompletedCloseDialog) =>
|
|
70
|
-
onClosed?: () =>
|
|
69
|
+
toParentMessage: (message: Closed | CompletedShowDialog | CompletedCloseDialog) => ParentMessage;
|
|
70
|
+
onClosed?: () => ParentMessage;
|
|
71
71
|
panelContent: Html;
|
|
72
72
|
panelClassName?: string;
|
|
73
|
-
panelAttributes?: ReadonlyArray<Attribute<
|
|
73
|
+
panelAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
74
74
|
backdropClassName?: string;
|
|
75
|
-
backdropAttributes?: ReadonlyArray<Attribute<
|
|
75
|
+
backdropAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
76
76
|
className?: string;
|
|
77
|
-
attributes?: ReadonlyArray<Attribute<
|
|
77
|
+
attributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
78
78
|
}>;
|
|
79
79
|
/** Programmatically opens the dialog, updating the model and returning
|
|
80
80
|
* show commands. Use this in domain-event handlers to open the dialog. */
|
|
@@ -83,12 +83,12 @@ export declare const open: (model: Model) => readonly [Model, ReadonlyArray<Comm
|
|
|
83
83
|
* close commands. Use this in domain-event handlers when the dialog uses `onClosed`. */
|
|
84
84
|
export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
85
85
|
/** Renders a headless dialog component backed by the native `<dialog>` element with `showModal()`. */
|
|
86
|
-
export declare const view: <
|
|
86
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
87
87
|
/** Creates a memoized dialog view. Static config (className, panelClassName,
|
|
88
88
|
* etc.) is captured in a closure. Dynamic fields — `model`, `toParentMessage`,
|
|
89
89
|
* and `panelContent` — are compared by reference per render via `createLazy`.
|
|
90
90
|
* When any of them change, the view re-renders; otherwise the cached VNode is
|
|
91
91
|
* reused and snabbdom skips the entire subtree. */
|
|
92
|
-
export declare const lazy: <
|
|
92
|
+
export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage" | "onClosed" | "panelContent">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"], panelContent: Html) => Html);
|
|
93
93
|
export {};
|
|
94
94
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAsB5B,6IAA6I;AAC7I,eAAO,MAAM,KAAK;;;;;;;;;;EAMhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wEAAwE;AACxE,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,wHAAwH;AACxH,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB,iFAA2B,CAAA;AAC3D,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAC7D,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB;;EAE9B,CAAA;AAEF,8DAA8D;AAC9D,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IACE,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,mBAAmB;IAC1B,OAAO,oBAAoB;IAC3B,OAAO,mBAAmB;CAC3B,CAOD,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CA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AAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB;yFACyF;AACzF,eAAO,MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,sGAAsG;AACtG,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IA8GF,CAAA;AAED;;;;oDAIoD;AACpD,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,UAAU,GAAG,cAAc,CAC1D,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,EAC7D,YAAY,EAAE,IAAI,KACf,IAAI,CAkBR,CAAA"}
|
package/dist/ui/dialog/index.js
CHANGED
|
@@ -189,10 +189,10 @@ export const view = (config) => {
|
|
|
189
189
|
* reused and snabbdom skips the entire subtree. */
|
|
190
190
|
export const lazy = (staticConfig) => {
|
|
191
191
|
const lazyView = createLazy();
|
|
192
|
-
return (model, toParentMessage, panelContent) => lazyView((currentModel,
|
|
192
|
+
return (model, toParentMessage, panelContent) => lazyView((currentModel, currentToParentMessage, currentPanelContent) => view({
|
|
193
193
|
...staticConfig,
|
|
194
194
|
model: currentModel,
|
|
195
|
-
toParentMessage:
|
|
195
|
+
toParentMessage: currentToParentMessage,
|
|
196
196
|
panelContent: currentPanelContent,
|
|
197
197
|
}), [model, toParentMessage, panelContent]);
|
|
198
198
|
};
|
|
@@ -37,22 +37,22 @@ export declare const FocusButton: Command.CommandDefinition<"FocusButton", {
|
|
|
37
37
|
/** Processes a disclosure message and returns the next model and commands. */
|
|
38
38
|
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
39
39
|
/** Configuration for rendering a disclosure with `view`. */
|
|
40
|
-
export type ViewConfig<
|
|
40
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
41
41
|
model: Model;
|
|
42
|
-
toParentMessage: (message: Toggled | Closed | CompletedFocusButton) =>
|
|
43
|
-
onToggled?: () =>
|
|
42
|
+
toParentMessage: (message: Toggled | Closed | CompletedFocusButton) => ParentMessage;
|
|
43
|
+
onToggled?: () => ParentMessage;
|
|
44
44
|
buttonClassName?: string;
|
|
45
|
-
buttonAttributes?: ReadonlyArray<Attribute<
|
|
45
|
+
buttonAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
46
46
|
buttonContent: Html;
|
|
47
47
|
panelClassName?: string;
|
|
48
|
-
panelAttributes?: ReadonlyArray<Attribute<
|
|
48
|
+
panelAttributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
49
49
|
panelContent: Html;
|
|
50
50
|
isDisabled?: boolean;
|
|
51
51
|
persistPanel?: boolean;
|
|
52
52
|
buttonElement?: TagName;
|
|
53
53
|
panelElement?: TagName;
|
|
54
54
|
className?: string;
|
|
55
|
-
attributes?: ReadonlyArray<Attribute<
|
|
55
|
+
attributes?: ReadonlyArray<Attribute<ParentMessage>>;
|
|
56
56
|
}>;
|
|
57
57
|
/** Programmatically toggles the disclosure, updating the model and returning
|
|
58
58
|
* focus commands. Use this in domain-event handlers when the disclosure uses `onToggled`. */
|
|
@@ -61,8 +61,8 @@ export declare const toggle: (model: Model) => readonly [Model, ReadonlyArray<Co
|
|
|
61
61
|
* focus commands. Use this in domain-event handlers to close the disclosure. */
|
|
62
62
|
export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
63
63
|
/** Renders a headless disclosure component with accessible ARIA attributes and keyboard support. */
|
|
64
|
-
export declare const view: <
|
|
64
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
65
65
|
/** Creates a memoized disclosure view. Static config is captured in a closure;
|
|
66
66
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
67
|
-
export declare const lazy: <
|
|
67
|
+
export declare const lazy: <ParentMessage>(staticConfig: Omit<ViewConfig<ParentMessage>, "model" | "toParentMessage" | "onToggled">) => ((model: Model, toParentMessage: ViewConfig<ParentMessage>["toParentMessage"]) => Html);
|
|
68
68
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/disclosure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,qBAAqB,CAAA;AAO5B,kGAAkG;AAClG,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,iFAAiF;AACjF,eAAO,MAAM,OAAO,qEAAe,CAAA;AACnC,gFAAgF;AAChF,eAAO,MAAM,MAAM,oEAAc,CAAA;AACjC,kEAAkE;AAClE,eAAO,MAAM,oBAAoB,kFAA4B,CAAA;AAE7D,kEAAkE;AAClE,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,KAAK,CAC3B;IAAC,OAAO,OAAO;IAAE,OAAO,MAAM;IAAE,OAAO,oBAAoB;CAAC,CACV,CAAA;AAEpD,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AACzC,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AACvC,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CAAA;AAEnE,MAAM,MAAM,OAAO,GAAG,OAAO,OA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pB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF;8FAC8F;AAC9F,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACjC,CAAA;AAE1B;iFACiF;AACjF,eAAO,MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,oGAAoG;AACpG,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAyGF,CAAA;AAED;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,CAAC,EACzB,OAAO,GAAG,iBAAiB,GAAG,WAAW,CAC1C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,iBAAiB,CAAC,KAC1D,IAAI,CAgBR,CAAA"}
|
|
@@ -105,9 +105,9 @@ export const view = (config) => {
|
|
|
105
105
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
106
106
|
export const lazy = (staticConfig) => {
|
|
107
107
|
const lazyView = createLazy();
|
|
108
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
108
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
109
109
|
...staticConfig,
|
|
110
110
|
model: currentModel,
|
|
111
|
-
toParentMessage:
|
|
111
|
+
toParentMessage: currentToParentMessage,
|
|
112
112
|
}), [model, toParentMessage]);
|
|
113
113
|
};
|
|
@@ -260,19 +260,19 @@ export declare const subscriptions: import("../../runtime/subscription.js").Subs
|
|
|
260
260
|
/** Messages the draggable view helper can dispatch. */
|
|
261
261
|
export type DraggableMessage = typeof PressedDraggable.Type | typeof ActivatedKeyboardDrag.Type;
|
|
262
262
|
/** Configuration for creating draggable attributes with `draggable`. */
|
|
263
|
-
export type DraggableConfig<
|
|
263
|
+
export type DraggableConfig<ParentMessage> = Readonly<{
|
|
264
264
|
model: Model;
|
|
265
|
-
toParentMessage: (message: DraggableMessage) =>
|
|
265
|
+
toParentMessage: (message: DraggableMessage) => ParentMessage;
|
|
266
266
|
itemId: string;
|
|
267
267
|
containerId: string;
|
|
268
268
|
index: number;
|
|
269
269
|
}>;
|
|
270
270
|
/** Returns attributes the parent attaches to a draggable element. Handles pointer-down, keyboard activation, and ARIA. */
|
|
271
|
-
export declare const draggable: <
|
|
271
|
+
export declare const draggable: <ParentMessage>(config: DraggableConfig<ParentMessage>) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
272
272
|
/** Returns attributes the parent attaches to a droppable container element. */
|
|
273
|
-
export declare const droppable: <
|
|
273
|
+
export declare const droppable: <ParentMessage>(containerId: string, label?: string) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
274
274
|
/** Returns attributes the parent attaches to a sortable item element. Typically combined with `draggable`. */
|
|
275
|
-
export declare const sortable: <
|
|
275
|
+
export declare const sortable: <ParentMessage>(itemId: string) => ReadonlyArray<Attribute<ParentMessage>>;
|
|
276
276
|
/** Returns positioning styles for the ghost element, or None when not dragging with a pointer. */
|
|
277
277
|
export declare const ghostStyle: (model: Model) => Option.Option<Record<string, string>>;
|
|
278
278
|
/** Returns true when the component is actively dragging (pointer or keyboard). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/dragAndDrop/index.ts"],"names":[],"mappings":"AAAA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OAAO,KAAK,KACX,MAAM,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,IAAI,CAUpC,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Attribute } from '../../html/index.js';
|
|
2
2
|
import type { Html } from '../../html/index.js';
|
|
3
3
|
/** Attribute groups the fieldset component provides to the consumer's `toView` callback. */
|
|
4
|
-
export type FieldsetAttributes<
|
|
5
|
-
fieldset: ReadonlyArray<Attribute<
|
|
6
|
-
legend: ReadonlyArray<Attribute<
|
|
7
|
-
description: ReadonlyArray<Attribute<
|
|
4
|
+
export type FieldsetAttributes<ParentMessage> = Readonly<{
|
|
5
|
+
fieldset: ReadonlyArray<Attribute<ParentMessage>>;
|
|
6
|
+
legend: ReadonlyArray<Attribute<ParentMessage>>;
|
|
7
|
+
description: ReadonlyArray<Attribute<ParentMessage>>;
|
|
8
8
|
}>;
|
|
9
9
|
/** Configuration for rendering a fieldset with `view`. */
|
|
10
|
-
export type ViewConfig<
|
|
10
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
11
11
|
id: string;
|
|
12
|
-
toView: (attributes: FieldsetAttributes<
|
|
12
|
+
toView: (attributes: FieldsetAttributes<ParentMessage>) => Html;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
}>;
|
|
15
15
|
/** Generates the legend element ID from the fieldset's base ID. */
|
|
@@ -17,5 +17,5 @@ export declare const legendId: (id: string) => string;
|
|
|
17
17
|
/** Generates the description element ID from the fieldset's base ID. */
|
|
18
18
|
export declare const descriptionId: (id: string) => string;
|
|
19
19
|
/** Renders an accessible fieldset by building ARIA attribute groups and delegating layout to the consumer's `toView` callback. */
|
|
20
|
-
export declare const view: <
|
|
20
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,4FAA4F;AAC5F,MAAM,MAAM,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,4FAA4F;AAC5F,MAAM,MAAM,kBAAkB,CAAC,aAAa,IAAI,QAAQ,CAAC;IACvD,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IACjD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC/C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF,0DAA0D;AAC1D,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC,aAAa,CAAC,KAAK,IAAI,CAAA;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC,CAAA;AAEF,mEAAmE;AACnE,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,KAAG,MAAwB,CAAA;AAE9D,wEAAwE;AACxE,eAAO,MAAM,aAAa,GAAI,IAAI,MAAM,KAAG,MAA6B,CAAA;AAExE,kIAAkI;AAClI,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAwBF,CAAA"}
|
|
@@ -134,9 +134,9 @@ export const view = (config) => {
|
|
|
134
134
|
* `createLazy`. */
|
|
135
135
|
export const lazy = (staticConfig) => {
|
|
136
136
|
const lazyView = createLazy();
|
|
137
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
137
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
138
138
|
...staticConfig,
|
|
139
139
|
model: currentModel,
|
|
140
|
-
toParentMessage:
|
|
140
|
+
toParentMessage: currentToParentMessage,
|
|
141
141
|
}), [model, toParentMessage]);
|
|
142
142
|
};
|
package/dist/ui/input/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Attribute } from '../../html/index.js';
|
|
2
2
|
import type { Html } from '../../html/index.js';
|
|
3
3
|
/** Attribute groups the input component provides to the consumer's `toView` callback. */
|
|
4
|
-
export type InputAttributes<
|
|
5
|
-
input: ReadonlyArray<Attribute<
|
|
6
|
-
label: ReadonlyArray<Attribute<
|
|
7
|
-
description: ReadonlyArray<Attribute<
|
|
4
|
+
export type InputAttributes<ParentMessage> = Readonly<{
|
|
5
|
+
input: ReadonlyArray<Attribute<ParentMessage>>;
|
|
6
|
+
label: ReadonlyArray<Attribute<ParentMessage>>;
|
|
7
|
+
description: ReadonlyArray<Attribute<ParentMessage>>;
|
|
8
8
|
}>;
|
|
9
9
|
/** Configuration for rendering an input with `view`. */
|
|
10
|
-
export type ViewConfig<
|
|
10
|
+
export type ViewConfig<ParentMessage> = Readonly<{
|
|
11
11
|
id: string;
|
|
12
|
-
toView: (attributes: InputAttributes<
|
|
13
|
-
onInput?: (value: string) =>
|
|
12
|
+
toView: (attributes: InputAttributes<ParentMessage>) => Html;
|
|
13
|
+
onInput?: (value: string) => ParentMessage;
|
|
14
14
|
value?: string;
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
isInvalid?: boolean;
|
|
@@ -22,5 +22,5 @@ export type ViewConfig<Message> = Readonly<{
|
|
|
22
22
|
/** Generates the description element ID from the input's base ID. */
|
|
23
23
|
export declare const descriptionId: (id: string) => string;
|
|
24
24
|
/** Renders an accessible input by building ARIA attribute groups and delegating layout to the consumer's `toView` callback. */
|
|
25
|
-
export declare const view: <
|
|
25
|
+
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/input/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,yFAAyF;AACzF,MAAM,MAAM,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/input/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAI/C,yFAAyF;AACzF,MAAM,MAAM,eAAe,CAAC,aAAa,IAAI,QAAQ,CAAC;IACpD,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9C,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;IAC9C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAA;CACrD,CAAC,CAAA;AAEF,wDAAwD;AACxD,MAAM,MAAM,UAAU,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,CAAC,UAAU,EAAE,eAAe,CAAC,aAAa,CAAC,KAAK,IAAI,CAAA;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,CAAA;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC,CAAA;AAEF,qEAAqE;AACrE,eAAO,MAAM,aAAa,GAAI,IAAI,MAAM,KAAG,MAA6B,CAAA;AAExE,+HAA+H;AAC/H,eAAO,MAAM,IAAI,GAAI,aAAa,EAChC,QAAQ,UAAU,CAAC,aAAa,CAAC,KAChC,IAyEF,CAAA"}
|
|
@@ -132,6 +132,8 @@ export declare const update: (model: {
|
|
|
132
132
|
readonly _tag: "CompletedAnchorMount";
|
|
133
133
|
} | {
|
|
134
134
|
readonly _tag: "CompletedFocusItemsOnMount";
|
|
135
|
+
} | {
|
|
136
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
135
137
|
} | {
|
|
136
138
|
readonly _tag: "GotAnimationMessage";
|
|
137
139
|
readonly message: {
|
|
@@ -158,9 +160,9 @@ export declare const close: (model: Model) => readonly [Model, ReadonlyArray<Com
|
|
|
158
160
|
/** Programmatically toggles an item in the multi-select listbox. Use this in domain-event handlers when the listbox uses `onSelectedItem`. */
|
|
159
161
|
export declare const selectItem: (model: Model, item: string) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
160
162
|
/** Configuration for rendering a multi-select listbox with `view`. */
|
|
161
|
-
export type ViewConfig<
|
|
163
|
+
export type ViewConfig<ParentMessage, Item> = BaseViewConfig<ParentMessage, Item, Model>;
|
|
162
164
|
/** Renders a headless multi-select listbox with typeahead search, keyboard navigation, selection tracking, and aria-activedescendant focus management. */
|
|
163
|
-
export declare const view: <
|
|
165
|
+
export declare const view: <ParentMessage, Item>(config: Readonly<{
|
|
164
166
|
model: {
|
|
165
167
|
readonly id: string;
|
|
166
168
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
@@ -187,8 +189,10 @@ export declare const view: <Message, Item>(config: Readonly<{
|
|
|
187
189
|
readonly _tag: "CompletedAnchorMount";
|
|
188
190
|
} | {
|
|
189
191
|
readonly _tag: "CompletedFocusItemsOnMount";
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
+
} | {
|
|
193
|
+
readonly _tag: "CompletedBackdropPortal";
|
|
194
|
+
}) => ParentMessage;
|
|
195
|
+
onSelectedItem?: (value: string) => ParentMessage;
|
|
192
196
|
items: readonly Item[];
|
|
193
197
|
itemToConfig: (item: Item, context: Readonly<{
|
|
194
198
|
isActive: boolean;
|
|
@@ -204,24 +208,24 @@ export declare const view: <Message, Item>(config: Readonly<{
|
|
|
204
208
|
isButtonDisabled?: boolean;
|
|
205
209
|
buttonContent: Html;
|
|
206
210
|
buttonClassName?: string;
|
|
207
|
-
buttonAttributes?: readonly import("../../html/index.js").Attribute<
|
|
211
|
+
buttonAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
208
212
|
itemsClassName?: string;
|
|
209
|
-
itemsAttributes?: readonly import("../../html/index.js").Attribute<
|
|
213
|
+
itemsAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
210
214
|
itemsScrollClassName?: string;
|
|
211
|
-
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<
|
|
215
|
+
itemsScrollAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
212
216
|
backdropClassName?: string;
|
|
213
|
-
backdropAttributes?: readonly import("../../html/index.js").Attribute<
|
|
217
|
+
backdropAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
214
218
|
className?: string;
|
|
215
|
-
attributes?: readonly import("../../html/index.js").Attribute<
|
|
219
|
+
attributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
216
220
|
itemGroupKey?: (item: Item, index: number) => string;
|
|
217
221
|
groupToHeading?: (groupKey: string) => Readonly<{
|
|
218
222
|
content: Html;
|
|
219
223
|
className?: string;
|
|
220
224
|
}> | undefined;
|
|
221
225
|
groupClassName?: string;
|
|
222
|
-
groupAttributes?: readonly import("../../html/index.js").Attribute<
|
|
226
|
+
groupAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
223
227
|
separatorClassName?: string;
|
|
224
|
-
separatorAttributes?: readonly import("../../html/index.js").Attribute<
|
|
228
|
+
separatorAttributes?: readonly import("../../html/index.js").Attribute<ParentMessage>[];
|
|
225
229
|
anchor?: Readonly<{
|
|
226
230
|
placement?: import("@floating-ui/dom").Placement;
|
|
227
231
|
gap?: number;
|
|
@@ -236,5 +240,5 @@ export declare const view: <Message, Item>(config: Readonly<{
|
|
|
236
240
|
}>) => Html;
|
|
237
241
|
/** Creates a memoized multi-select listbox view. Static config is captured in a closure;
|
|
238
242
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
239
|
-
export declare const lazy: <
|
|
243
|
+
export declare const lazy: <ParentMessage, Item>(staticConfig: Omit<ViewConfig<ParentMessage, Item>, "model" | "toParentMessage" | "onSelectedItem">) => ((model: Model, toParentMessage: BaseViewConfig<ParentMessage, Item, Model>["toParentMessage"]) => Html);
|
|
240
244
|
//# sourceMappingURL=multi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAEzD,OAAO,KAAK,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,qBAAqB,CAAA;AAE3D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EACnB,MAAM,EACN,KAAK,OAAO,EACZ,MAAM,EACN,YAAY,EAIb,MAAM,aAAa,CAAA;AAIpB,iKAAiK;AACjK,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;EAGhB,CAAA;AAEF,MAA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;;;;;;;;;;;;;KAMjB,CAAA;AAEF;uFACuF;AACvF,eAAO,MAAM,IAAI,GACf,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACK,CAAA;AAEhE;wFACwF;AACxF,eAAO,MAAM,KAAK,GAChB,OAAO,KAAK,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAClC,CAAA;AAEzB,8IAA8I;AAC9I,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,EACZ,MAAM,MAAM,KACX,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CACpB,CAAA;AAIvC,sEAAsE;AACtE,MAAM,MAAM,UAAU,CAAC,aAAa,EAAE,IAAI,IAAI,cAAc,CAC1D,aAAa,EACb,IAAI,EACJ,KAAK,CACN,CAAA;AAED,0JAA0J;AAC1J,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAYf,CAAA;AAEF;mFACmF;AACnF,eAAO,MAAM,IAAI,GAAI,aAAa,EAAE,IAAI,EACtC,cAAc,IAAI,CAChB,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,EAC/B,OAAO,GAAG,iBAAiB,GAAG,gBAAgB,CAC/C,KACA,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,cAAc,CAC7B,aAAa,EACb,IAAI,EACJ,KAAK,CACN,CAAC,iBAAiB,CAAC,KACjB,IAAI,CAoBR,CAAA"}
|
package/dist/ui/listbox/multi.js
CHANGED
|
@@ -39,9 +39,9 @@ export const view = makeView({
|
|
|
39
39
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
40
40
|
export const lazy = (staticConfig) => {
|
|
41
41
|
const lazyView = createLazy();
|
|
42
|
-
return (model, toParentMessage) => lazyView((currentModel,
|
|
42
|
+
return (model, toParentMessage) => lazyView((currentModel, currentToParentMessage) => view({
|
|
43
43
|
...staticConfig,
|
|
44
44
|
model: currentModel,
|
|
45
|
-
toParentMessage:
|
|
45
|
+
toParentMessage: currentToParentMessage,
|
|
46
46
|
}), [model, toParentMessage]);
|
|
47
47
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { init, update, open, close, selectItem, view, lazy, Model, } from './single.js';
|
|
2
|
-
export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMount, CompletedFocusItemsOnMount, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
2
|
+
export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMount, CompletedFocusItemsOnMount, CompletedBackdropPortal, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
3
3
|
export type { ActivationTrigger, Opened, Closed, BlurredItems, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, Searched, PressedPointerOnButton, IgnoredMouseClick, SuppressedSpaceScroll, ItemConfig, GroupHeading, } from './shared.js';
|
|
4
4
|
export type { InitConfig, ViewConfig } from './single.js';
|
|
5
5
|
export type { AnchorConfig } from '../anchor.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEzD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/ui/listbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,KAAK,GACN,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,iBAAiB,EACjB,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,EACR,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,YAAY,GACb,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEzD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { init, update, open, close, selectItem, view, lazy, Model, } from './single.js';
|
|
2
|
-
export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMount, CompletedFocusItemsOnMount, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
2
|
+
export { Message, Orientation, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedFocusButton, CompletedFocusItems, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorMount, CompletedFocusItemsOnMount, CompletedBackdropPortal, ClearedSearch, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusButton, FocusItems, ScrollIntoView, ClickItem, DelayClearSearch, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
3
3
|
export * as Multi from './multiPublic.js';
|