@foldkit/ui 0.153.0 → 0.154.0-canary.2f2a07458578
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/README.md +1 -1
- package/dist/anchor/anchor.d.ts +14 -1
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +58 -5
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/button/index.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +44 -44
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/combobox/multi.d.ts +47 -47
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/shared.d.ts +44 -44
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +91 -78
- package/dist/combobox/single.d.ts +50 -50
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/datePicker/index.d.ts +102 -102
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts +38 -18
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +66 -39
- package/dist/dialog/public.d.ts +1 -1
- package/dist/dialog/public.d.ts.map +1 -1
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.d.ts +191 -191
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/fieldset/index.d.ts.map +1 -1
- package/dist/fileDrop/index.d.ts +10 -10
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/group.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.d.ts +103 -0
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -0
- package/dist/hoverIntent/hoverIntent.js +210 -0
- package/dist/hoverIntent/index.d.ts +4 -0
- package/dist/hoverIntent/index.d.ts.map +1 -0
- package/dist/hoverIntent/index.js +2 -0
- package/dist/hoverIntent/message.d.ts +42 -0
- package/dist/hoverIntent/message.d.ts.map +1 -0
- package/dist/hoverIntent/message.js +23 -0
- package/dist/hoverIntent/public.d.ts +3 -0
- package/dist/hoverIntent/public.d.ts.map +1 -0
- package/dist/hoverIntent/public.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/input/index.d.ts.map +1 -1
- package/dist/internal/optionExtensions.d.ts.map +1 -1
- package/dist/internal/selectors.d.ts.map +1 -1
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/listbox/multi.d.ts +43 -43
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/shared.d.ts +38 -38
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +46 -39
- package/dist/listbox/single.d.ts +45 -45
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/menu/index.d.ts +70 -70
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +39 -32
- package/dist/nav/index.d.ts.map +1 -1
- package/dist/popover/index.d.ts +48 -33
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +46 -26
- package/dist/popover/public.d.ts +1 -1
- package/dist/popover/public.d.ts.map +1 -1
- package/dist/popover/public.js +1 -1
- package/dist/radioGroup/index.d.ts +6 -6
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/select/index.d.ts.map +1 -1
- package/dist/slider/index.d.ts +72 -72
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/switch/index.d.ts.map +1 -1
- package/dist/tabs/index.d.ts +6 -6
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.d.ts +18 -15
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +224 -224
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/schema.d.ts +16 -16
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/update.d.ts +151 -151
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/tooltip/message.d.ts +2 -2
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/tooltip.d.ts +7 -7
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +15 -11
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/virtualList/index.d.ts +10 -10
- package/dist/virtualList/index.d.ts.map +1 -1
- package/package.json +12 -10
|
@@ -52,36 +52,36 @@ export declare const baseInit: (config: BaseInitConfig) => BaseModel;
|
|
|
52
52
|
/** Union of all messages the combobox component can produce. */
|
|
53
53
|
export declare const Message: import("foldkit/message").MessageUnion<{
|
|
54
54
|
readonly Opened: {
|
|
55
|
-
|
|
55
|
+
maybeActiveItemIndex: S.Option<S.Number>;
|
|
56
56
|
};
|
|
57
57
|
readonly Closed: {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
restingInputValue: S.String;
|
|
59
|
+
isClearable: S.Boolean;
|
|
60
60
|
};
|
|
61
61
|
readonly BlurredInput: {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
restingInputValue: S.String;
|
|
63
|
+
isClearable: S.Boolean;
|
|
64
64
|
};
|
|
65
65
|
readonly ActivatedItem: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
index: S.Number;
|
|
67
|
+
activationTrigger: S.Literals<readonly ["Pointer", "Keyboard"]>;
|
|
68
|
+
maybeImmediateSelection: S.Option<S.Struct<{
|
|
69
69
|
readonly item: S.String;
|
|
70
70
|
}>>;
|
|
71
71
|
};
|
|
72
72
|
readonly DeactivatedItem: {};
|
|
73
73
|
readonly SelectedItem: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
item: S.String;
|
|
75
|
+
displayText: S.String;
|
|
76
|
+
wasSelected: S.Boolean;
|
|
77
77
|
};
|
|
78
78
|
readonly MovedPointerOverItem: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
index: S.Number;
|
|
80
|
+
screenX: S.Number;
|
|
81
|
+
screenY: S.Number;
|
|
82
82
|
};
|
|
83
83
|
readonly RequestedItemClick: {
|
|
84
|
-
|
|
84
|
+
index: S.Number;
|
|
85
85
|
};
|
|
86
86
|
readonly SuppressedItemCommit: {};
|
|
87
87
|
readonly CompletedLockScroll: {};
|
|
@@ -96,7 +96,7 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
96
96
|
readonly CompletedAttachComboboxSelectOnFocus: {};
|
|
97
97
|
readonly CompletedPortalComboboxBackdrop: {};
|
|
98
98
|
readonly GotAnimationMessage: {
|
|
99
|
-
|
|
99
|
+
message: import("foldkit/message").MessageUnion<{
|
|
100
100
|
readonly Showed: {};
|
|
101
101
|
readonly Hid: {};
|
|
102
102
|
readonly CompletedWaitForPaint: {};
|
|
@@ -104,11 +104,11 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
104
104
|
}>;
|
|
105
105
|
};
|
|
106
106
|
readonly UpdatedInputValue: {
|
|
107
|
-
|
|
107
|
+
value: S.String;
|
|
108
108
|
};
|
|
109
109
|
readonly PressedToggleButton: {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
restingInputValue: S.String;
|
|
111
|
+
isClearable: S.Boolean;
|
|
112
112
|
};
|
|
113
113
|
}>;
|
|
114
114
|
export type Opened = typeof Message.Opened.Type;
|
|
@@ -138,7 +138,7 @@ export type ClearedSelection = typeof OutMessage.ClearedSelection.Type;
|
|
|
138
138
|
/** Union of out-messages the combobox component can produce. The parent folds `Selected` into the selection it owns and clears that selection on `ClearedSelection`. */
|
|
139
139
|
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
140
140
|
readonly Selected: {
|
|
141
|
-
|
|
141
|
+
value: S.String;
|
|
142
142
|
};
|
|
143
143
|
readonly ClearedSelection: {};
|
|
144
144
|
}>;
|
|
@@ -213,13 +213,13 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinitionWith
|
|
|
213
213
|
}, Effect.Effect<{
|
|
214
214
|
readonly _tag: "GotAnimationMessage";
|
|
215
215
|
readonly message: {
|
|
216
|
-
readonly _tag: "Showed";
|
|
217
|
-
} | {
|
|
218
|
-
readonly _tag: "Hid";
|
|
219
|
-
} | {
|
|
220
216
|
readonly _tag: "CompletedWaitForPaint";
|
|
221
217
|
} | {
|
|
222
218
|
readonly _tag: "EndedAnimation";
|
|
219
|
+
} | {
|
|
220
|
+
readonly _tag: "Hid";
|
|
221
|
+
} | {
|
|
222
|
+
readonly _tag: "Showed";
|
|
223
223
|
};
|
|
224
224
|
}, never, never>>;
|
|
225
225
|
/** Creates a combobox update function from variant-specific handlers. Shared logic (open, close, activate, transition) is handled internally; only close, selection, and immediate-activation behavior varies by variant. */
|
|
@@ -230,14 +230,6 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
230
230
|
}>) => (model: Model, message: Message) => Readonly<{
|
|
231
231
|
model: Model;
|
|
232
232
|
commands?: Update.Commands<{
|
|
233
|
-
readonly _tag: "CompletedLockScroll";
|
|
234
|
-
} | {
|
|
235
|
-
readonly _tag: "CompletedUnlockScroll";
|
|
236
|
-
} | {
|
|
237
|
-
readonly _tag: "CompletedInertOthers";
|
|
238
|
-
} | {
|
|
239
|
-
readonly _tag: "CompletedRestoreInert";
|
|
240
|
-
} | {
|
|
241
233
|
readonly _tag: "Opened";
|
|
242
234
|
readonly maybeActiveItemIndex: Option.Option<number>;
|
|
243
235
|
} | {
|
|
@@ -251,7 +243,7 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
251
243
|
} | {
|
|
252
244
|
readonly _tag: "ActivatedItem";
|
|
253
245
|
readonly index: number;
|
|
254
|
-
readonly activationTrigger: "
|
|
246
|
+
readonly activationTrigger: "Keyboard" | "Pointer";
|
|
255
247
|
readonly maybeImmediateSelection: Option.Option<{
|
|
256
248
|
readonly item: string;
|
|
257
249
|
}>;
|
|
@@ -272,6 +264,14 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
272
264
|
readonly index: number;
|
|
273
265
|
} | {
|
|
274
266
|
readonly _tag: "SuppressedItemCommit";
|
|
267
|
+
} | {
|
|
268
|
+
readonly _tag: "CompletedLockScroll";
|
|
269
|
+
} | {
|
|
270
|
+
readonly _tag: "CompletedUnlockScroll";
|
|
271
|
+
} | {
|
|
272
|
+
readonly _tag: "CompletedInertOthers";
|
|
273
|
+
} | {
|
|
274
|
+
readonly _tag: "CompletedRestoreInert";
|
|
275
275
|
} | {
|
|
276
276
|
readonly _tag: "CompletedFocusInput";
|
|
277
277
|
} | {
|
|
@@ -285,17 +285,6 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
285
285
|
readonly _tag: "PressedToggleButton";
|
|
286
286
|
readonly restingInputValue: string;
|
|
287
287
|
readonly isClearable: boolean;
|
|
288
|
-
} | {
|
|
289
|
-
readonly _tag: "GotAnimationMessage";
|
|
290
|
-
readonly message: {
|
|
291
|
-
readonly _tag: "Showed";
|
|
292
|
-
} | {
|
|
293
|
-
readonly _tag: "Hid";
|
|
294
|
-
} | {
|
|
295
|
-
readonly _tag: "CompletedWaitForPaint";
|
|
296
|
-
} | {
|
|
297
|
-
readonly _tag: "EndedAnimation";
|
|
298
|
-
};
|
|
299
288
|
} | {
|
|
300
289
|
readonly _tag: "CompletedAnchorCombobox";
|
|
301
290
|
} | {
|
|
@@ -304,6 +293,17 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
304
293
|
readonly _tag: "CompletedAttachComboboxSelectOnFocus";
|
|
305
294
|
} | {
|
|
306
295
|
readonly _tag: "CompletedPortalComboboxBackdrop";
|
|
296
|
+
} | {
|
|
297
|
+
readonly _tag: "GotAnimationMessage";
|
|
298
|
+
readonly message: {
|
|
299
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
300
|
+
} | {
|
|
301
|
+
readonly _tag: "EndedAnimation";
|
|
302
|
+
} | {
|
|
303
|
+
readonly _tag: "Hid";
|
|
304
|
+
} | {
|
|
305
|
+
readonly _tag: "Showed";
|
|
306
|
+
};
|
|
307
307
|
}, never>;
|
|
308
308
|
outMessage?: OutMessage<string>;
|
|
309
309
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/combobox/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAEN,MAAM,EAEN,MAAM,IAAI,CAAC,EAEZ,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAExD,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AACxE,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,EACL,YAAY,EAGb,MAAM,oBAAoB,CAAA;AAW3B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAK7C,OAAO,EAAE,eAAe,EAAE,CAAA;AAI1B,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,8CAAsC,CAAA;AACpE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,oKAAoK;AACpK,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;EAepB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C,4EAA4E;AAC5E,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;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9D,IAAI,SAAS,MAAM,OAEN,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,CACvE,CAAA"}
|
package/dist/combobox/shared.js
CHANGED
|
@@ -368,66 +368,79 @@ export const makeUpdate = (handlers) => {
|
|
|
368
368
|
* capture listener that prevents input blur on item presses. Exposed so
|
|
369
369
|
* Scene tests can call
|
|
370
370
|
* `Scene.Mount.resolve(AnchorCombobox, CompletedAnchorCombobox())`. */
|
|
371
|
-
export const AnchorCombobox = Mount.define('AnchorCombobox', {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
buttonId,
|
|
381
|
-
anchor,
|
|
382
|
-
interceptTab: false,
|
|
383
|
-
});
|
|
384
|
-
return __foldkitBrandViewResult((() => {
|
|
385
|
-
element.removeEventListener('pointerdown', preventBlur, {
|
|
371
|
+
export const AnchorCombobox = Mount.define('AnchorCombobox', {
|
|
372
|
+
args: { buttonId: S.String, anchor: AnchorConfig },
|
|
373
|
+
messages: [Message.CompletedAnchorCombobox],
|
|
374
|
+
execute: ({ element, buttonId, anchor }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
375
|
+
yield* Effect.acquireRelease(Effect.sync(() => {
|
|
376
|
+
const preventBlur = (event) => {
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
};
|
|
379
|
+
element.addEventListener('pointerdown', preventBlur, {
|
|
386
380
|
capture: true,
|
|
387
381
|
});
|
|
388
|
-
teardownAnchor(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
})
|
|
382
|
+
const teardownAnchor = anchorSetup(element, {
|
|
383
|
+
buttonId,
|
|
384
|
+
anchor,
|
|
385
|
+
interceptTab: false,
|
|
386
|
+
});
|
|
387
|
+
return __foldkitBrandViewResult((() => {
|
|
388
|
+
element.removeEventListener('pointerdown', preventBlur, {
|
|
389
|
+
capture: true,
|
|
390
|
+
});
|
|
391
|
+
teardownAnchor();
|
|
392
|
+
}), "@foldkit/ui/combobox/shared.js#anonymous~10");
|
|
393
|
+
}), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/combobox/shared.js#anonymous~12"));
|
|
394
|
+
return __foldkitBrandViewResult((Message.CompletedAnchorCombobox()), "@foldkit/ui/combobox/shared.js#anonymous~9");
|
|
395
|
+
})), "@foldkit/ui/combobox/shared.js#execute~7"),
|
|
396
|
+
});
|
|
393
397
|
/** The Mount this Combobox renders to install a `pointerdown`-cancelling
|
|
394
398
|
* capture listener that prevents blur on item presses. Exposed so Scene
|
|
395
399
|
* tests can call
|
|
396
400
|
* `Scene.Mount.resolve(AttachComboboxPreventBlur, CompletedAttachComboboxPreventBlur())`. */
|
|
397
|
-
export const AttachComboboxPreventBlur = Mount.define('AttachComboboxPreventBlur',
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
})), "@foldkit/ui/combobox/shared.js#anonymous~15"));
|
|
401
|
+
export const AttachComboboxPreventBlur = Mount.define('AttachComboboxPreventBlur', {
|
|
402
|
+
messages: [Message.CompletedAttachComboboxPreventBlur],
|
|
403
|
+
execute: ({ element }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
404
|
+
yield* Effect.acquireRelease(Effect.sync(() => {
|
|
405
|
+
const handler = (event) => {
|
|
406
|
+
event.preventDefault();
|
|
407
|
+
};
|
|
408
|
+
element.addEventListener('pointerdown', handler, { capture: true });
|
|
409
|
+
return __foldkitBrandViewResult((handler), "@foldkit/ui/combobox/shared.js#anonymous~14");
|
|
410
|
+
}), handler => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((element.removeEventListener('pointerdown', handler, {
|
|
411
|
+
capture: true,
|
|
412
|
+
})), "@foldkit/ui/combobox/shared.js#anonymous~16"))), "@foldkit/ui/combobox/shared.js#anonymous~15"));
|
|
413
|
+
return __foldkitBrandViewResult((Message.CompletedAttachComboboxPreventBlur()), "@foldkit/ui/combobox/shared.js#anonymous~13");
|
|
414
|
+
})), "@foldkit/ui/combobox/shared.js#execute~8"),
|
|
415
|
+
});
|
|
409
416
|
/** The Mount this Combobox renders to install the input's select-on-focus
|
|
410
417
|
* behavior. Exposed so Scene tests can call
|
|
411
418
|
* `Scene.Mount.resolve(AttachComboboxSelectOnFocus, CompletedAttachComboboxSelectOnFocus())`. */
|
|
412
|
-
export const AttachComboboxSelectOnFocus = Mount.define('AttachComboboxSelectOnFocus',
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
})), "@foldkit/ui/combobox/shared.js#anonymous~20"));
|
|
419
|
+
export const AttachComboboxSelectOnFocus = Mount.define('AttachComboboxSelectOnFocus', {
|
|
420
|
+
messages: [Message.CompletedAttachComboboxSelectOnFocus],
|
|
421
|
+
execute: ({ element }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
422
|
+
yield* Effect.acquireRelease(Effect.sync(() => {
|
|
423
|
+
const handler = () => {
|
|
424
|
+
if (element instanceof HTMLInputElement) {
|
|
425
|
+
element.select();
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
element.addEventListener('focus', handler);
|
|
429
|
+
return __foldkitBrandViewResult((handler), "@foldkit/ui/combobox/shared.js#anonymous~18");
|
|
430
|
+
}), handler => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((element.removeEventListener('focus', handler)), "@foldkit/ui/combobox/shared.js#anonymous~20"))), "@foldkit/ui/combobox/shared.js#anonymous~19"));
|
|
431
|
+
return __foldkitBrandViewResult((Message.CompletedAttachComboboxSelectOnFocus()), "@foldkit/ui/combobox/shared.js#anonymous~17");
|
|
432
|
+
})), "@foldkit/ui/combobox/shared.js#execute~9"),
|
|
433
|
+
});
|
|
424
434
|
/** The backdrop-portaling Mount this Combobox renders. Exposed so Scene tests can
|
|
425
435
|
* call `Scene.Mount.resolve(PortalComboboxBackdrop, CompletedPortalComboboxBackdrop())` to
|
|
426
436
|
* acknowledge the mount produced by the rendered backdrop. */
|
|
427
|
-
export const PortalComboboxBackdrop = Mount.define('PortalComboboxBackdrop',
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
437
|
+
export const PortalComboboxBackdrop = Mount.define('PortalComboboxBackdrop', {
|
|
438
|
+
messages: [Message.CompletedPortalComboboxBackdrop],
|
|
439
|
+
execute: ({ element }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
440
|
+
yield* Effect.acquireRelease(Effect.sync(() => __foldkitBrandViewResult((portalToContainingRoot(element)), "@foldkit/ui/combobox/shared.js#anonymous~22")), cleanup => __foldkitBrandViewResult((Effect.sync(cleanup)), "@foldkit/ui/combobox/shared.js#anonymous~23"));
|
|
441
|
+
return __foldkitBrandViewResult((Message.CompletedPortalComboboxBackdrop()), "@foldkit/ui/combobox/shared.js#anonymous~21");
|
|
442
|
+
})), "@foldkit/ui/combobox/shared.js#execute~10"),
|
|
443
|
+
});
|
|
431
444
|
/** Creates a combobox view function from variant-specific behavior. Shared rendering logic (input, items, transitions, keyboard navigation) is handled internally; only listbox multi-select semantics vary by variant. */
|
|
432
445
|
export const makeView = (behavior) => {
|
|
433
446
|
const impl = defineView((model, viewInputs, h) => {
|
|
@@ -452,30 +465,30 @@ export const makeView = (behavior) => {
|
|
|
452
465
|
h.DataAttribute('closed', ''),
|
|
453
466
|
h.DataAttribute('enter', ''),
|
|
454
467
|
h.DataAttribute('transition', ''),
|
|
455
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
468
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~25")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
456
469
|
h.DataAttribute('enter', ''),
|
|
457
470
|
h.DataAttribute('transition', ''),
|
|
458
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
471
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~26")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
|
|
459
472
|
h.DataAttribute('leave', ''),
|
|
460
473
|
h.DataAttribute('transition', ''),
|
|
461
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
474
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~27")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
|
|
462
475
|
h.DataAttribute('closed', ''),
|
|
463
476
|
h.DataAttribute('leave', ''),
|
|
464
477
|
h.DataAttribute('transition', ''),
|
|
465
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
478
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~28")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/combobox/shared.js#anonymous~29")));
|
|
466
479
|
const isDisabledAtIndex = (index) => __foldkitBrandViewResult((Predicate.isNotUndefined(isItemDisabled) &&
|
|
467
|
-
pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
480
|
+
pipe(items, Array.get(index), Option.exists(item => __foldkitBrandViewResult((isItemDisabled(item, index)), "@foldkit/ui/combobox/shared.js#anonymous~30")))), "@foldkit/ui/combobox/shared.js#isDisabledAtIndex");
|
|
468
481
|
const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(0, 1);
|
|
469
482
|
const lastEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(items.length - 1, -1);
|
|
470
|
-
const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((-1), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
483
|
+
const resolveActiveIndex = keyToIndex('ArrowDown', 'ArrowUp', items.length, Option.getOrElse(maybeActiveItemIndex, () => __foldkitBrandViewResult((-1), "@foldkit/ui/combobox/shared.js#anonymous~31")), isDisabledAtIndex);
|
|
471
484
|
const resolveImmediateSelection = (targetIndex) => {
|
|
472
485
|
if (isReadOnly) {
|
|
473
486
|
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#resolveImmediateSelection");
|
|
474
487
|
}
|
|
475
488
|
else {
|
|
476
|
-
return __foldkitBrandViewResult((pipe(OptionExt.when(immediate, targetIndex), Option.flatMap(index => __foldkitBrandViewResult((Array.get(items, index)), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
489
|
+
return __foldkitBrandViewResult((pipe(OptionExt.when(immediate, targetIndex), Option.flatMap(index => __foldkitBrandViewResult((Array.get(items, index)), "@foldkit/ui/combobox/shared.js#anonymous~32")), Option.map(targetItem => (__foldkitBrandViewResult(({
|
|
477
490
|
item: itemToValue(targetItem, targetIndex),
|
|
478
|
-
}), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
491
|
+
}), "@foldkit/ui/combobox/shared.js#anonymous~33"))))), "@foldkit/ui/combobox/shared.js#resolveImmediateSelection");
|
|
479
492
|
}
|
|
480
493
|
};
|
|
481
494
|
const resolveCommitMessage = () => {
|
|
@@ -483,61 +496,61 @@ export const makeView = (behavior) => {
|
|
|
483
496
|
return __foldkitBrandViewResult((Option.as(maybeActiveItemIndex, Message.SuppressedItemCommit())), "@foldkit/ui/combobox/shared.js#resolveCommitMessage");
|
|
484
497
|
}
|
|
485
498
|
else {
|
|
486
|
-
return __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
499
|
+
return __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/combobox/shared.js#anonymous~34"))), "@foldkit/ui/combobox/shared.js#resolveCommitMessage");
|
|
487
500
|
}
|
|
488
501
|
};
|
|
489
502
|
const handleInputKeyDown = (key) => __foldkitBrandViewResult((M.value(key).pipe(M.when('ArrowDown', () => {
|
|
490
503
|
if (!isOpen) {
|
|
491
504
|
return __foldkitBrandViewResult((Option.some(Message.Opened({
|
|
492
505
|
maybeActiveItemIndex: Option.some(firstEnabledIndex),
|
|
493
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
506
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~35");
|
|
494
507
|
}
|
|
495
508
|
const targetIndex = resolveActiveIndex('ArrowDown');
|
|
496
509
|
return __foldkitBrandViewResult((Option.some(Message.ActivatedItem({
|
|
497
510
|
index: targetIndex,
|
|
498
511
|
activationTrigger: 'Keyboard',
|
|
499
512
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
500
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
513
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~35");
|
|
501
514
|
}), M.when('ArrowUp', () => {
|
|
502
515
|
if (!isOpen) {
|
|
503
516
|
return __foldkitBrandViewResult((Option.some(Message.Opened({
|
|
504
517
|
maybeActiveItemIndex: Option.some(lastEnabledIndex),
|
|
505
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
518
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~36");
|
|
506
519
|
}
|
|
507
520
|
const targetIndex = resolveActiveIndex('ArrowUp');
|
|
508
521
|
return __foldkitBrandViewResult((Option.some(Message.ActivatedItem({
|
|
509
522
|
index: targetIndex,
|
|
510
523
|
activationTrigger: 'Keyboard',
|
|
511
524
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
512
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
525
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~36");
|
|
513
526
|
}), M.when('Enter', () => {
|
|
514
527
|
if (!isOpen) {
|
|
515
|
-
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
528
|
+
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~37");
|
|
516
529
|
}
|
|
517
|
-
return __foldkitBrandViewResult((resolveCommitMessage()), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
530
|
+
return __foldkitBrandViewResult((resolveCommitMessage()), "@foldkit/ui/combobox/shared.js#anonymous~37");
|
|
518
531
|
}), M.when('Escape', () => {
|
|
519
532
|
if (!isOpen) {
|
|
520
|
-
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
533
|
+
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~38");
|
|
521
534
|
}
|
|
522
|
-
return __foldkitBrandViewResult((Option.some(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
535
|
+
return __foldkitBrandViewResult((Option.some(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))), "@foldkit/ui/combobox/shared.js#anonymous~38");
|
|
523
536
|
}), M.whenOr('Home', 'End', () => {
|
|
524
537
|
if (!isOpen) {
|
|
525
|
-
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
538
|
+
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~39");
|
|
526
539
|
}
|
|
527
540
|
const targetIndex = resolveActiveIndex(key);
|
|
528
541
|
return __foldkitBrandViewResult((Option.some(Message.ActivatedItem({
|
|
529
542
|
index: targetIndex,
|
|
530
543
|
activationTrigger: 'Keyboard',
|
|
531
544
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
532
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
533
|
-
}), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
545
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~39");
|
|
546
|
+
}), M.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~40")))), "@foldkit/ui/combobox/shared.js#handleInputKeyDown");
|
|
534
547
|
const maybeActiveDescendant = Option.match(maybeActiveItemIndex, {
|
|
535
548
|
onNone: () => __foldkitBrandViewResult(([]), "@foldkit/ui/combobox/shared.js#onNone~3"),
|
|
536
549
|
onSome: index => __foldkitBrandViewResult(([h.AriaActiveDescendant(itemId(id, index))]), "@foldkit/ui/combobox/shared.js#onSome~3"),
|
|
537
550
|
});
|
|
538
551
|
const onInputAttributes = isReadOnly
|
|
539
552
|
? []
|
|
540
|
-
: [h.OnInput(value => __foldkitBrandViewResult((Message.UpdatedInputValue({ value })), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
553
|
+
: [h.OnInput(value => __foldkitBrandViewResult((Message.UpdatedInputValue({ value })), "@foldkit/ui/combobox/shared.js#anonymous~41"))];
|
|
541
554
|
const resolvedInputAttributes = [
|
|
542
555
|
h.Id(`${id}-input`),
|
|
543
556
|
h.Role('combobox'),
|
|
@@ -608,7 +621,7 @@ export const makeView = (behavior) => {
|
|
|
608
621
|
...itemsAttributes,
|
|
609
622
|
];
|
|
610
623
|
const comboboxItems = Array.map(items, (item, index) => {
|
|
611
|
-
const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
624
|
+
const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => __foldkitBrandViewResult((activeIndex === index), "@foldkit/ui/combobox/shared.js#anonymous~43"));
|
|
612
625
|
const isDisabledItem = isDisabledAtIndex(index);
|
|
613
626
|
const isSelectedItem = isValueSelected(itemToValue(item, index));
|
|
614
627
|
const itemConfig = itemToConfig(item, {
|
|
@@ -647,13 +660,13 @@ export const makeView = (behavior) => {
|
|
|
647
660
|
index,
|
|
648
661
|
screenX,
|
|
649
662
|
screenY,
|
|
650
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
663
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~44")),
|
|
651
664
|
]),
|
|
652
|
-
h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', Message.DeactivatedItem())), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
665
|
+
h.OnPointerLeave(pointerType => __foldkitBrandViewResult((OptionExt.when(pointerType !== 'touch', Message.DeactivatedItem())), "@foldkit/ui/combobox/shared.js#anonymous~45")),
|
|
653
666
|
]
|
|
654
667
|
: []),
|
|
655
668
|
...(itemConfig.className ? [h.Class(itemConfig.className)] : []),
|
|
656
|
-
], [itemConfig.content])), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
669
|
+
], [itemConfig.content])), "@foldkit/ui/combobox/shared.js#anonymous~42");
|
|
657
670
|
});
|
|
658
671
|
const renderGroupedItems = () => {
|
|
659
672
|
if (!itemGroupKey) {
|
|
@@ -662,7 +675,7 @@ export const makeView = (behavior) => {
|
|
|
662
675
|
const segments = groupContiguous(comboboxItems, (_, index) => __foldkitBrandViewResult((Array.get(items, index).pipe(Option.match({
|
|
663
676
|
onNone: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/shared.js#onNone~4"),
|
|
664
677
|
onSome: item => __foldkitBrandViewResult((itemGroupKey(item, index)), "@foldkit/ui/combobox/shared.js#onSome~4"),
|
|
665
|
-
}))), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
678
|
+
}))), "@foldkit/ui/combobox/shared.js#anonymous~46"));
|
|
666
679
|
return __foldkitBrandViewResult((Array.flatMap(segments, (segment, segmentIndex) => {
|
|
667
680
|
const maybeHeading = Option.fromNullishOr(groupToHeading && groupToHeading(segment.key));
|
|
668
681
|
const headingId = `${id}-heading-${segment.key}`;
|
|
@@ -698,7 +711,7 @@ export const makeView = (behavior) => {
|
|
|
698
711
|
]),
|
|
699
712
|
]
|
|
700
713
|
: [];
|
|
701
|
-
return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
714
|
+
return __foldkitBrandViewResult(([...separator, groupElement]), "@foldkit/ui/combobox/shared.js#anonymous~47");
|
|
702
715
|
})), "@foldkit/ui/combobox/shared.js#renderGroupedItems");
|
|
703
716
|
};
|
|
704
717
|
const backdrop = h.keyed('div')(`${id}-backdrop`, [
|
|
@@ -763,7 +776,7 @@ export const makeView = (behavior) => {
|
|
|
763
776
|
h.Type('hidden'),
|
|
764
777
|
h.Name(formName),
|
|
765
778
|
h.Value(selectedValue),
|
|
766
|
-
])), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
779
|
+
])), "@foldkit/ui/combobox/shared.js#anonymous~48")),
|
|
767
780
|
})
|
|
768
781
|
: [];
|
|
769
782
|
const wrapperAttributes = [
|
|
@@ -783,9 +796,9 @@ export const makeView = (behavior) => {
|
|
|
783
796
|
? visibleContent
|
|
784
797
|
: []),
|
|
785
798
|
...hiddenInputs,
|
|
786
|
-
])), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
799
|
+
])), "@foldkit/ui/combobox/shared.js#anonymous~24");
|
|
787
800
|
});
|
|
788
801
|
return __foldkitBrandViewResult((() =>
|
|
789
802
|
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions */
|
|
790
|
-
__foldkitBrandViewResult((impl), "@foldkit/ui/combobox/shared.js#anonymous~
|
|
803
|
+
__foldkitBrandViewResult((impl), "@foldkit/ui/combobox/shared.js#anonymous~49")), "@foldkit/ui/combobox/shared.js#makeView");
|
|
791
804
|
};
|