foldkit 0.38.0 → 0.40.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/README.md +4 -2
- package/dist/command/index.d.ts +15 -9
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +16 -4
- package/dist/command/public.d.ts +2 -2
- package/dist/command/public.d.ts.map +1 -1
- package/dist/command/public.js +1 -1
- package/dist/devtools/overlay.d.ts +34 -1
- package/dist/devtools/overlay.d.ts.map +1 -1
- package/dist/devtools/overlay.js +24 -16
- package/dist/fieldValidation/index.d.ts +45 -37
- package/dist/fieldValidation/index.d.ts.map +1 -1
- package/dist/fieldValidation/public.d.ts +1 -1
- package/dist/fieldValidation/public.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/runtime/managedResource.d.ts +1 -1
- package/dist/runtime/managedResource.js +1 -1
- package/dist/runtime/runtime.d.ts +10 -10
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +2 -2
- package/dist/runtime/subscription.d.ts +3 -3
- package/dist/runtime/subscription.d.ts.map +1 -1
- package/dist/runtime/subscription.js +2 -2
- package/dist/task/dom.d.ts +6 -6
- package/dist/task/dom.js +6 -6
- package/dist/task/inert.d.ts +2 -2
- package/dist/task/inert.js +2 -2
- package/dist/task/scrollLock.d.ts +2 -2
- package/dist/task/scrollLock.js +2 -2
- package/dist/task/time.d.ts +1 -1
- package/dist/task/time.js +1 -1
- package/dist/test/index.d.ts +40 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +138 -0
- package/dist/test/public.d.ts +3 -0
- package/dist/test/public.d.ts.map +1 -0
- package/dist/test/public.js +1 -0
- package/dist/ui/checkbox/index.d.ts +1 -1
- package/dist/ui/checkbox/index.d.ts.map +1 -1
- package/dist/ui/combobox/multi.d.ts +8 -8
- package/dist/ui/combobox/public.d.ts +1 -1
- package/dist/ui/combobox/shared.d.ts +58 -26
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +34 -24
- package/dist/ui/combobox/single.d.ts +8 -8
- package/dist/ui/dialog/index.d.ts +20 -8
- package/dist/ui/dialog/index.d.ts.map +1 -1
- package/dist/ui/dialog/index.js +15 -11
- package/dist/ui/dialog/public.d.ts +1 -1
- package/dist/ui/dialog/public.js +1 -1
- package/dist/ui/disclosure/index.d.ts +8 -5
- package/dist/ui/disclosure/index.d.ts.map +1 -1
- package/dist/ui/disclosure/index.js +6 -5
- package/dist/ui/disclosure/public.d.ts +1 -1
- package/dist/ui/listbox/multi.d.ts +8 -8
- package/dist/ui/listbox/public.d.ts +1 -1
- package/dist/ui/listbox/shared.d.ts +61 -22
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +41 -29
- package/dist/ui/listbox/single.d.ts +8 -8
- package/dist/ui/menu/index.d.ts +56 -17
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +46 -34
- package/dist/ui/popover/index.d.ts +42 -13
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +34 -25
- package/dist/ui/radioGroup/index.d.ts +8 -5
- package/dist/ui/radioGroup/index.d.ts.map +1 -1
- package/dist/ui/radioGroup/index.js +5 -4
- package/dist/ui/switch/index.d.ts +1 -1
- package/dist/ui/switch/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.d.ts +6 -3
- package/dist/ui/tabs/index.d.ts.map +1 -1
- package/dist/ui/tabs/index.js +6 -5
- package/package.json +5 -1
package/dist/ui/menu/index.js
CHANGED
|
@@ -69,23 +69,23 @@ export const MovedPointerOverItem = m('MovedPointerOverItem', {
|
|
|
69
69
|
screenY: S.Number,
|
|
70
70
|
});
|
|
71
71
|
/** Sent when the focus-items command completes after opening the menu. */
|
|
72
|
-
export const
|
|
72
|
+
export const CompletedFocusItems = m('CompletedFocusItems');
|
|
73
73
|
/** Sent when the focus-button command completes after closing or selecting. */
|
|
74
|
-
export const
|
|
74
|
+
export const CompletedFocusButton = m('CompletedFocusButton');
|
|
75
75
|
/** Sent when the scroll lock command completes. */
|
|
76
|
-
export const
|
|
76
|
+
export const CompletedLockScroll = m('CompletedLockScroll');
|
|
77
77
|
/** Sent when the scroll unlock command completes. */
|
|
78
|
-
export const
|
|
78
|
+
export const CompletedUnlockScroll = m('CompletedUnlockScroll');
|
|
79
79
|
/** Sent when the inert-others command completes. */
|
|
80
|
-
export const
|
|
80
|
+
export const CompletedSetupInert = m('CompletedSetupInert');
|
|
81
81
|
/** Sent when the restore-inert command completes. */
|
|
82
|
-
export const
|
|
82
|
+
export const CompletedTeardownInert = m('CompletedTeardownInert');
|
|
83
83
|
/** Sent when the scroll-into-view command completes after keyboard activation. */
|
|
84
84
|
export const CompletedScrollIntoView = m('CompletedScrollIntoView');
|
|
85
85
|
/** Sent when the programmatic click command completes. */
|
|
86
|
-
export const
|
|
86
|
+
export const CompletedClickItem = m('CompletedClickItem');
|
|
87
87
|
/** Sent when the advance-focus command completes. */
|
|
88
|
-
export const
|
|
88
|
+
export const CompletedAdvanceFocus = m('CompletedAdvanceFocus');
|
|
89
89
|
/** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
|
|
90
90
|
export const IgnoredMouseClick = m('IgnoredMouseClick');
|
|
91
91
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
@@ -111,7 +111,7 @@ export const ReleasedPointerOnItems = m('ReleasedPointerOnItems', {
|
|
|
111
111
|
timeStamp: S.Number,
|
|
112
112
|
});
|
|
113
113
|
/** Union of all messages the menu component can produce. */
|
|
114
|
-
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, Searched, ClearedSearch,
|
|
114
|
+
export const Message = S.Union(Opened, Closed, ClosedByTab, ActivatedItem, DeactivatedItem, SelectedItem, MovedPointerOverItem, RequestedItemClick, Searched, ClearedSearch, CompletedFocusItems, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, CompletedScrollIntoView, CompletedClickItem, CompletedAdvanceFocus, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement, PressedPointerOnButton, ReleasedPointerOnItems);
|
|
115
115
|
// INIT
|
|
116
116
|
const SEARCH_DEBOUNCE_MILLISECONDS = 350;
|
|
117
117
|
const LEFT_MOUSE_BUTTON = 0;
|
|
@@ -148,16 +148,28 @@ const buttonSelector = (id) => `#${id}-button`;
|
|
|
148
148
|
const itemsSelector = (id) => `#${id}-items`;
|
|
149
149
|
const itemSelector = (id, index) => `#${id}-item-${index}`;
|
|
150
150
|
const withUpdateReturn = M.withReturnType();
|
|
151
|
+
export const RequestFrame = Command.define('RequestFrame', AdvancedTransitionFrame);
|
|
152
|
+
export const LockScroll = Command.define('LockScroll', CompletedLockScroll);
|
|
153
|
+
export const UnlockScroll = Command.define('UnlockScroll', CompletedUnlockScroll);
|
|
154
|
+
export const InertOthers = Command.define('InertOthers', CompletedSetupInert);
|
|
155
|
+
export const RestoreInert = Command.define('RestoreInert', CompletedTeardownInert);
|
|
156
|
+
export const FocusItems = Command.define('FocusItems', CompletedFocusItems);
|
|
157
|
+
export const FocusButton = Command.define('FocusButton', CompletedFocusButton);
|
|
158
|
+
export const ScrollIntoView = Command.define('ScrollIntoView', CompletedScrollIntoView);
|
|
159
|
+
export const ClickItem = Command.define('ClickItem', CompletedClickItem);
|
|
160
|
+
export const DelayClearSearch = Command.define('DelayClearSearch', ClearedSearch);
|
|
161
|
+
export const WaitForTransitions = Command.define('WaitForTransitions', EndedTransition);
|
|
162
|
+
export const DetectMovementOrTransitionEnd = Command.define('DetectMovementOrTransitionEnd', DetectedButtonMovement, EndedTransition);
|
|
151
163
|
/** Processes a menu message and returns the next model and commands. */
|
|
152
164
|
export const update = (model, message) => {
|
|
153
|
-
const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame())
|
|
154
|
-
const maybeLockScroll = OptionExt.when(model.isModal, Task.lockScroll.pipe(Effect.as(
|
|
155
|
-
const maybeUnlockScroll = OptionExt.when(model.isModal, Task.unlockScroll.pipe(Effect.as(
|
|
156
|
-
const maybeInertOthers = OptionExt.when(model.isModal, Task.inertOthers(model.id, [
|
|
165
|
+
const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
|
|
166
|
+
const maybeLockScroll = OptionExt.when(model.isModal, LockScroll(Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))));
|
|
167
|
+
const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll(Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))));
|
|
168
|
+
const maybeInertOthers = OptionExt.when(model.isModal, InertOthers(Task.inertOthers(model.id, [
|
|
157
169
|
buttonSelector(model.id),
|
|
158
170
|
itemsSelector(model.id),
|
|
159
|
-
]).pipe(Effect.as(
|
|
160
|
-
const maybeRestoreInert = OptionExt.when(model.isModal, Task.restoreInert(model.id).pipe(Effect.as(
|
|
171
|
+
]).pipe(Effect.as(CompletedSetupInert()))));
|
|
172
|
+
const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
|
|
161
173
|
return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
162
174
|
Opened: ({ maybeActiveItemIndex }) => {
|
|
163
175
|
const nextModel = evo(model, {
|
|
@@ -174,7 +186,7 @@ export const update = (model, message) => {
|
|
|
174
186
|
});
|
|
175
187
|
return [
|
|
176
188
|
nextModel,
|
|
177
|
-
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
189
|
+
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusItems(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))))),
|
|
178
190
|
];
|
|
179
191
|
},
|
|
180
192
|
Closed: () => [
|
|
@@ -183,7 +195,7 @@ export const update = (model, message) => {
|
|
|
183
195
|
maybeNextFrame,
|
|
184
196
|
maybeUnlockScroll,
|
|
185
197
|
maybeRestoreInert,
|
|
186
|
-
]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
198
|
+
]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
|
|
187
199
|
],
|
|
188
200
|
ClosedByTab: () => [
|
|
189
201
|
closedModel(model),
|
|
@@ -196,7 +208,7 @@ export const update = (model, message) => {
|
|
|
196
208
|
}),
|
|
197
209
|
activationTrigger === 'Keyboard'
|
|
198
210
|
? [
|
|
199
|
-
Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView())
|
|
211
|
+
ScrollIntoView(Task.scrollIntoView(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedScrollIntoView()))),
|
|
200
212
|
]
|
|
201
213
|
: [],
|
|
202
214
|
],
|
|
@@ -223,12 +235,12 @@ export const update = (model, message) => {
|
|
|
223
235
|
maybeNextFrame,
|
|
224
236
|
maybeUnlockScroll,
|
|
225
237
|
maybeRestoreInert,
|
|
226
|
-
]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
238
|
+
]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
|
|
227
239
|
],
|
|
228
240
|
RequestedItemClick: ({ index }) => [
|
|
229
241
|
model,
|
|
230
242
|
[
|
|
231
|
-
Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(
|
|
243
|
+
ClickItem(Task.clickElement(itemSelector(model.id, index)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))),
|
|
232
244
|
],
|
|
233
245
|
],
|
|
234
246
|
Searched: ({ key, maybeTargetIndex }) => {
|
|
@@ -241,7 +253,7 @@ export const update = (model, message) => {
|
|
|
241
253
|
maybeActiveItemIndex: () => Option.orElse(maybeTargetIndex, () => model.maybeActiveItemIndex),
|
|
242
254
|
}),
|
|
243
255
|
[
|
|
244
|
-
Task.delay(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version: nextSearchVersion }))
|
|
256
|
+
DelayClearSearch(Task.delay(SEARCH_DEBOUNCE_MILLISECONDS).pipe(Effect.as(ClearedSearch({ version: nextSearchVersion })))),
|
|
245
257
|
],
|
|
246
258
|
];
|
|
247
259
|
},
|
|
@@ -254,12 +266,12 @@ export const update = (model, message) => {
|
|
|
254
266
|
AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
|
|
255
267
|
evo(model, { transitionState: () => 'EnterAnimating' }),
|
|
256
268
|
[
|
|
257
|
-
Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())
|
|
269
|
+
WaitForTransitions(Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition()))),
|
|
258
270
|
],
|
|
259
271
|
]), M.when('LeaveStart', () => [
|
|
260
272
|
evo(model, { transitionState: () => 'LeaveAnimating' }),
|
|
261
273
|
[
|
|
262
|
-
Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())))
|
|
274
|
+
DetectMovementOrTransitionEnd(Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(itemsSelector(model.id)).pipe(Effect.as(EndedTransition())))),
|
|
263
275
|
],
|
|
264
276
|
]), M.orElse(() => [model, []])),
|
|
265
277
|
EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.whenOr('EnterAnimating', 'LeaveAnimating', () => [
|
|
@@ -284,7 +296,7 @@ export const update = (model, message) => {
|
|
|
284
296
|
maybeNextFrame,
|
|
285
297
|
maybeUnlockScroll,
|
|
286
298
|
maybeRestoreInert,
|
|
287
|
-
]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
299
|
+
]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
|
|
288
300
|
];
|
|
289
301
|
}
|
|
290
302
|
const nextModel = evo(withPointerType, {
|
|
@@ -299,7 +311,7 @@ export const update = (model, message) => {
|
|
|
299
311
|
});
|
|
300
312
|
return [
|
|
301
313
|
nextModel,
|
|
302
|
-
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
314
|
+
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusItems(Task.focus(itemsSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusItems()))))),
|
|
303
315
|
];
|
|
304
316
|
},
|
|
305
317
|
ReleasedPointerOnItems: ({ screenX, screenY, timeStamp }) => {
|
|
@@ -319,19 +331,19 @@ export const update = (model, message) => {
|
|
|
319
331
|
return [
|
|
320
332
|
model,
|
|
321
333
|
[
|
|
322
|
-
Task.clickElement(itemSelector(model.id, model.maybeActiveItemIndex.value)).pipe(Effect.ignore, Effect.as(
|
|
334
|
+
ClickItem(Task.clickElement(itemSelector(model.id, model.maybeActiveItemIndex.value)).pipe(Effect.ignore, Effect.as(CompletedClickItem()))),
|
|
323
335
|
],
|
|
324
336
|
];
|
|
325
337
|
},
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
338
|
+
CompletedFocusItems: () => [model, []],
|
|
339
|
+
CompletedFocusButton: () => [model, []],
|
|
340
|
+
CompletedLockScroll: () => [model, []],
|
|
341
|
+
CompletedUnlockScroll: () => [model, []],
|
|
342
|
+
CompletedSetupInert: () => [model, []],
|
|
343
|
+
CompletedTeardownInert: () => [model, []],
|
|
332
344
|
CompletedScrollIntoView: () => [model, []],
|
|
333
|
-
|
|
334
|
-
|
|
345
|
+
CompletedClickItem: () => [model, []],
|
|
346
|
+
CompletedAdvanceFocus: () => [model, []],
|
|
335
347
|
IgnoredMouseClick: () => [model, []],
|
|
336
348
|
SuppressedSpaceScroll: () => [model, []],
|
|
337
349
|
}));
|
|
@@ -24,17 +24,17 @@ export declare const PressedPointerOnButton: import("../../schema").CallableTagg
|
|
|
24
24
|
button: typeof S.Number;
|
|
25
25
|
}>;
|
|
26
26
|
/** Sent when the focus-panel command completes after opening the popover. */
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const CompletedFocusPanel: import("../../schema").CallableTaggedStruct<"CompletedFocusPanel", {}>;
|
|
28
28
|
/** Sent when the focus-button command completes after closing. */
|
|
29
|
-
export declare const
|
|
29
|
+
export declare const CompletedFocusButton: import("../../schema").CallableTaggedStruct<"CompletedFocusButton", {}>;
|
|
30
30
|
/** Sent when the scroll lock command completes. */
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const CompletedLockScroll: import("../../schema").CallableTaggedStruct<"CompletedLockScroll", {}>;
|
|
32
32
|
/** Sent when the scroll unlock command completes. */
|
|
33
|
-
export declare const
|
|
33
|
+
export declare const CompletedUnlockScroll: import("../../schema").CallableTaggedStruct<"CompletedUnlockScroll", {}>;
|
|
34
34
|
/** Sent when the inert-others command completes. */
|
|
35
|
-
export declare const
|
|
35
|
+
export declare const CompletedSetupInert: import("../../schema").CallableTaggedStruct<"CompletedSetupInert", {}>;
|
|
36
36
|
/** Sent when the restore-inert command completes. */
|
|
37
|
-
export declare const
|
|
37
|
+
export declare const CompletedTeardownInert: import("../../schema").CallableTaggedStruct<"CompletedTeardownInert", {}>;
|
|
38
38
|
/** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
|
|
39
39
|
export declare const IgnoredMouseClick: import("../../schema").CallableTaggedStruct<"IgnoredMouseClick", {}>;
|
|
40
40
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
@@ -51,12 +51,12 @@ export declare const Message: S.Union<[
|
|
|
51
51
|
typeof Closed,
|
|
52
52
|
typeof ClosedByTab,
|
|
53
53
|
typeof PressedPointerOnButton,
|
|
54
|
-
typeof
|
|
55
|
-
typeof
|
|
56
|
-
typeof
|
|
57
|
-
typeof
|
|
58
|
-
typeof
|
|
59
|
-
typeof
|
|
54
|
+
typeof CompletedFocusPanel,
|
|
55
|
+
typeof CompletedFocusButton,
|
|
56
|
+
typeof CompletedLockScroll,
|
|
57
|
+
typeof CompletedUnlockScroll,
|
|
58
|
+
typeof CompletedSetupInert,
|
|
59
|
+
typeof CompletedTeardownInert,
|
|
60
60
|
typeof IgnoredMouseClick,
|
|
61
61
|
typeof SuppressedSpaceScroll,
|
|
62
62
|
typeof AdvancedTransitionFrame,
|
|
@@ -78,7 +78,36 @@ export type InitConfig = Readonly<{
|
|
|
78
78
|
}>;
|
|
79
79
|
/** Creates an initial popover model from a config. Defaults to closed. */
|
|
80
80
|
export declare const init: (config: InitConfig) => Model;
|
|
81
|
-
type UpdateReturn = [Model, ReadonlyArray<Command.Command<Message>>];
|
|
81
|
+
type UpdateReturn = readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
82
|
+
export declare const RequestFrame: Command.CommandDefinition<"RequestFrame", {
|
|
83
|
+
readonly _tag: "AdvancedTransitionFrame";
|
|
84
|
+
}>;
|
|
85
|
+
export declare const LockScroll: Command.CommandDefinition<"LockScroll", {
|
|
86
|
+
readonly _tag: "CompletedLockScroll";
|
|
87
|
+
}>;
|
|
88
|
+
export declare const UnlockScroll: Command.CommandDefinition<"UnlockScroll", {
|
|
89
|
+
readonly _tag: "CompletedUnlockScroll";
|
|
90
|
+
}>;
|
|
91
|
+
export declare const InertOthers: Command.CommandDefinition<"InertOthers", {
|
|
92
|
+
readonly _tag: "CompletedSetupInert";
|
|
93
|
+
}>;
|
|
94
|
+
export declare const RestoreInert: Command.CommandDefinition<"RestoreInert", {
|
|
95
|
+
readonly _tag: "CompletedTeardownInert";
|
|
96
|
+
}>;
|
|
97
|
+
export declare const FocusPanel: Command.CommandDefinition<"FocusPanel", {
|
|
98
|
+
readonly _tag: "CompletedFocusPanel";
|
|
99
|
+
}>;
|
|
100
|
+
export declare const FocusButton: Command.CommandDefinition<"FocusButton", {
|
|
101
|
+
readonly _tag: "CompletedFocusButton";
|
|
102
|
+
}>;
|
|
103
|
+
export declare const WaitForTransitions: Command.CommandDefinition<"WaitForTransitions", {
|
|
104
|
+
readonly _tag: "EndedTransition";
|
|
105
|
+
}>;
|
|
106
|
+
export declare const DetectMovementOrTransitionEnd: Command.CommandDefinition<"DetectMovementOrTransitionEnd", {
|
|
107
|
+
readonly _tag: "EndedTransition";
|
|
108
|
+
} | {
|
|
109
|
+
readonly _tag: "DetectedButtonMovement";
|
|
110
|
+
}>;
|
|
82
111
|
/** Processes a popover message and returns the next model and commands. */
|
|
83
112
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
84
113
|
/** Configuration for rendering a popover with `view`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/popover/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAKxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,sGAAsG;AACtG,eAAO,MAAM,KAAK;;;;;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W,CAAC,KAAK,IAAI,CAgBtE,CAAA"}
|
package/dist/ui/popover/index.js
CHANGED
|
@@ -30,17 +30,17 @@ export const PressedPointerOnButton = m('PressedPointerOnButton', {
|
|
|
30
30
|
button: S.Number,
|
|
31
31
|
});
|
|
32
32
|
/** Sent when the focus-panel command completes after opening the popover. */
|
|
33
|
-
export const
|
|
33
|
+
export const CompletedFocusPanel = m('CompletedFocusPanel');
|
|
34
34
|
/** Sent when the focus-button command completes after closing. */
|
|
35
|
-
export const
|
|
35
|
+
export const CompletedFocusButton = m('CompletedFocusButton');
|
|
36
36
|
/** Sent when the scroll lock command completes. */
|
|
37
|
-
export const
|
|
37
|
+
export const CompletedLockScroll = m('CompletedLockScroll');
|
|
38
38
|
/** Sent when the scroll unlock command completes. */
|
|
39
|
-
export const
|
|
39
|
+
export const CompletedUnlockScroll = m('CompletedUnlockScroll');
|
|
40
40
|
/** Sent when the inert-others command completes. */
|
|
41
|
-
export const
|
|
41
|
+
export const CompletedSetupInert = m('CompletedSetupInert');
|
|
42
42
|
/** Sent when the restore-inert command completes. */
|
|
43
|
-
export const
|
|
43
|
+
export const CompletedTeardownInert = m('CompletedTeardownInert');
|
|
44
44
|
/** Sent when a mouse click on the button is ignored because pointer-down already handled the toggle. */
|
|
45
45
|
export const IgnoredMouseClick = m('IgnoredMouseClick');
|
|
46
46
|
/** Sent when a Space key-up is captured to prevent page scrolling. */
|
|
@@ -52,7 +52,7 @@ export const EndedTransition = m('EndedTransition');
|
|
|
52
52
|
/** Sent internally when the popover button moves in the viewport during a leave transition, cancelling the animation. */
|
|
53
53
|
export const DetectedButtonMovement = m('DetectedButtonMovement');
|
|
54
54
|
/** Union of all messages the popover component can produce. */
|
|
55
|
-
export const Message = S.Union(Opened, Closed, ClosedByTab, PressedPointerOnButton,
|
|
55
|
+
export const Message = S.Union(Opened, Closed, ClosedByTab, PressedPointerOnButton, CompletedFocusPanel, CompletedFocusButton, CompletedLockScroll, CompletedUnlockScroll, CompletedSetupInert, CompletedTeardownInert, IgnoredMouseClick, SuppressedSpaceScroll, AdvancedTransitionFrame, EndedTransition, DetectedButtonMovement);
|
|
56
56
|
// INIT
|
|
57
57
|
const LEFT_MOUSE_BUTTON = 0;
|
|
58
58
|
/** Creates an initial popover model from a config. Defaults to closed. */
|
|
@@ -73,16 +73,25 @@ const closedModel = (model) => evo(model, {
|
|
|
73
73
|
const buttonSelector = (id) => `#${id}-button`;
|
|
74
74
|
const panelSelector = (id) => `#${id}-panel`;
|
|
75
75
|
const withUpdateReturn = M.withReturnType();
|
|
76
|
+
export const RequestFrame = Command.define('RequestFrame', AdvancedTransitionFrame);
|
|
77
|
+
export const LockScroll = Command.define('LockScroll', CompletedLockScroll);
|
|
78
|
+
export const UnlockScroll = Command.define('UnlockScroll', CompletedUnlockScroll);
|
|
79
|
+
export const InertOthers = Command.define('InertOthers', CompletedSetupInert);
|
|
80
|
+
export const RestoreInert = Command.define('RestoreInert', CompletedTeardownInert);
|
|
81
|
+
export const FocusPanel = Command.define('FocusPanel', CompletedFocusPanel);
|
|
82
|
+
export const FocusButton = Command.define('FocusButton', CompletedFocusButton);
|
|
83
|
+
export const WaitForTransitions = Command.define('WaitForTransitions', EndedTransition);
|
|
84
|
+
export const DetectMovementOrTransitionEnd = Command.define('DetectMovementOrTransitionEnd', DetectedButtonMovement, EndedTransition);
|
|
76
85
|
/** Processes a popover message and returns the next model and commands. */
|
|
77
86
|
export const update = (model, message) => {
|
|
78
|
-
const maybeNextFrame = OptionExt.when(model.isAnimated, Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame())
|
|
79
|
-
const maybeLockScroll = OptionExt.when(model.isModal, Task.lockScroll.pipe(Effect.as(
|
|
80
|
-
const maybeUnlockScroll = OptionExt.when(model.isModal, Task.unlockScroll.pipe(Effect.as(
|
|
81
|
-
const maybeInertOthers = OptionExt.when(model.isModal, Task.inertOthers(model.id, [
|
|
87
|
+
const maybeNextFrame = OptionExt.when(model.isAnimated, RequestFrame(Task.nextFrame.pipe(Effect.as(AdvancedTransitionFrame()))));
|
|
88
|
+
const maybeLockScroll = OptionExt.when(model.isModal, LockScroll(Task.lockScroll.pipe(Effect.as(CompletedLockScroll()))));
|
|
89
|
+
const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll(Task.unlockScroll.pipe(Effect.as(CompletedUnlockScroll()))));
|
|
90
|
+
const maybeInertOthers = OptionExt.when(model.isModal, InertOthers(Task.inertOthers(model.id, [
|
|
82
91
|
buttonSelector(model.id),
|
|
83
92
|
panelSelector(model.id),
|
|
84
|
-
]).pipe(Effect.as(
|
|
85
|
-
const maybeRestoreInert = OptionExt.when(model.isModal, Task.restoreInert(model.id).pipe(Effect.as(
|
|
93
|
+
]).pipe(Effect.as(CompletedSetupInert()))));
|
|
94
|
+
const maybeRestoreInert = OptionExt.when(model.isModal, RestoreInert(Task.restoreInert(model.id).pipe(Effect.as(CompletedTeardownInert()))));
|
|
86
95
|
return M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
87
96
|
Opened: () => {
|
|
88
97
|
const nextModel = evo(model, {
|
|
@@ -91,7 +100,7 @@ export const update = (model, message) => {
|
|
|
91
100
|
});
|
|
92
101
|
return [
|
|
93
102
|
nextModel,
|
|
94
|
-
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
103
|
+
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusPanel(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))))),
|
|
95
104
|
];
|
|
96
105
|
},
|
|
97
106
|
Closed: () => [
|
|
@@ -100,7 +109,7 @@ export const update = (model, message) => {
|
|
|
100
109
|
maybeNextFrame,
|
|
101
110
|
maybeUnlockScroll,
|
|
102
111
|
maybeRestoreInert,
|
|
103
|
-
]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
112
|
+
]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
|
|
104
113
|
],
|
|
105
114
|
ClosedByTab: () => [
|
|
106
115
|
closedModel(model),
|
|
@@ -120,7 +129,7 @@ export const update = (model, message) => {
|
|
|
120
129
|
maybeNextFrame,
|
|
121
130
|
maybeUnlockScroll,
|
|
122
131
|
maybeRestoreInert,
|
|
123
|
-
]), Array.prepend(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
132
|
+
]), Array.prepend(FocusButton(Task.focus(buttonSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusButton()))))),
|
|
124
133
|
];
|
|
125
134
|
}
|
|
126
135
|
const nextModel = evo(withPointerType, {
|
|
@@ -129,18 +138,18 @@ export const update = (model, message) => {
|
|
|
129
138
|
});
|
|
130
139
|
return [
|
|
131
140
|
nextModel,
|
|
132
|
-
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(
|
|
141
|
+
pipe(Array.getSomes([maybeNextFrame, maybeLockScroll, maybeInertOthers]), Array.prepend(FocusPanel(Task.focus(panelSelector(model.id)).pipe(Effect.ignore, Effect.as(CompletedFocusPanel()))))),
|
|
133
142
|
];
|
|
134
143
|
},
|
|
135
144
|
AdvancedTransitionFrame: () => M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => [
|
|
136
145
|
evo(model, { transitionState: () => 'EnterAnimating' }),
|
|
137
146
|
[
|
|
138
|
-
Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())
|
|
147
|
+
WaitForTransitions(Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition()))),
|
|
139
148
|
],
|
|
140
149
|
]), M.when('LeaveStart', () => [
|
|
141
150
|
evo(model, { transitionState: () => 'LeaveAnimating' }),
|
|
142
151
|
[
|
|
143
|
-
Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())))
|
|
152
|
+
DetectMovementOrTransitionEnd(Effect.raceFirst(Task.detectElementMovement(buttonSelector(model.id)).pipe(Effect.as(DetectedButtonMovement())), Task.waitForTransitions(panelSelector(model.id)).pipe(Effect.as(EndedTransition())))),
|
|
144
153
|
],
|
|
145
154
|
]), M.orElse(() => [model, []])),
|
|
146
155
|
EndedTransition: () => M.value(model.transitionState).pipe(withUpdateReturn, M.whenOr('EnterAnimating', 'LeaveAnimating', () => [
|
|
@@ -151,12 +160,12 @@ export const update = (model, message) => {
|
|
|
151
160
|
evo(model, { transitionState: () => 'Idle' }),
|
|
152
161
|
[],
|
|
153
162
|
]), M.orElse(() => [model, []])),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
CompletedFocusPanel: () => [model, []],
|
|
164
|
+
CompletedFocusButton: () => [model, []],
|
|
165
|
+
CompletedLockScroll: () => [model, []],
|
|
166
|
+
CompletedUnlockScroll: () => [model, []],
|
|
167
|
+
CompletedSetupInert: () => [model, []],
|
|
168
|
+
CompletedTeardownInert: () => [model, []],
|
|
160
169
|
IgnoredMouseClick: () => [model, []],
|
|
161
170
|
SuppressedSpaceScroll: () => [model, []],
|
|
162
171
|
}));
|
|
@@ -17,14 +17,14 @@ export declare const SelectedOption: import("../../schema").CallableTaggedStruct
|
|
|
17
17
|
index: typeof S.Number;
|
|
18
18
|
}>;
|
|
19
19
|
/** Sent when the focus-option command completes. */
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const CompletedFocusOption: import("../../schema").CallableTaggedStruct<"CompletedFocusOption", {}>;
|
|
21
21
|
/** Union of all messages the radio group component can produce. */
|
|
22
22
|
export declare const Message: S.Union<[
|
|
23
23
|
typeof SelectedOption,
|
|
24
|
-
typeof
|
|
24
|
+
typeof CompletedFocusOption
|
|
25
25
|
]>;
|
|
26
26
|
export type SelectedOption = typeof SelectedOption.Type;
|
|
27
|
-
export type
|
|
27
|
+
export type CompletedFocusOption = typeof CompletedFocusOption.Type;
|
|
28
28
|
export type Message = typeof Message.Type;
|
|
29
29
|
/** Configuration for creating a radio group model with `init`. */
|
|
30
30
|
export type InitConfig = Readonly<{
|
|
@@ -34,8 +34,11 @@ export type InitConfig = Readonly<{
|
|
|
34
34
|
}>;
|
|
35
35
|
/** Creates an initial radio group model from a config. Defaults to no selection and vertical orientation. */
|
|
36
36
|
export declare const init: (config: InitConfig) => Model;
|
|
37
|
+
export declare const FocusOption: Command.CommandDefinition<"FocusOption", {
|
|
38
|
+
readonly _tag: "CompletedFocusOption";
|
|
39
|
+
}>;
|
|
37
40
|
/** Processes a radio group message and returns the next model and commands. */
|
|
38
|
-
export declare const update: (model: Model, message: Message) => [Model, ReadonlyArray<Command.Command<Message>>];
|
|
41
|
+
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
39
42
|
/** Attribute groups the radio group component provides for each option's `content` callback. */
|
|
40
43
|
export type OptionAttributes<Message> = Readonly<{
|
|
41
44
|
option: ReadonlyArray<Attribute<Message>>;
|
|
@@ -58,7 +61,7 @@ export type NarrowedSelectedOption<RadioOption extends string> = Readonly<{
|
|
|
58
61
|
/** Configuration for rendering a radio group with `view`. */
|
|
59
62
|
export type ViewConfig<Message, RadioOption extends string> = Readonly<{
|
|
60
63
|
model: Model;
|
|
61
|
-
toMessage: (message: NarrowedSelectedOption<RadioOption> |
|
|
64
|
+
toMessage: (message: NarrowedSelectedOption<RadioOption> | CompletedFocusOption) => Message;
|
|
62
65
|
options: ReadonlyArray<RadioOption>;
|
|
63
66
|
optionToConfig: (option: RadioOption, context: Readonly<{
|
|
64
67
|
isSelected: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","s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AC,CAAA;IACnC,cAAc,EAAE,CACd,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,QAAQ,CAAC;QAChB,UAAU,EAAE,OAAO,CAAA;QACnB,QAAQ,EAAE,OAAO,CAAA;QACjB,UAAU,EAAE,OAAO,CAAA;KACpB,CAAC,KACC,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IACvC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;IAClE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC,CAAA;AAQF,6IAA6I;AAC7I,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,WAAW,SAAS,MAAM,EACtD,QAAQ,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,KACvC,IA6OF,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,WAAW,SAAS,MAAM,EACtD,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC1E,CAAC,CACF,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,WAAW,CAAC,KACrD,IAAI,CAgBR,CAAA"}
|
|
@@ -21,9 +21,9 @@ export const SelectedOption = m('SelectedOption', {
|
|
|
21
21
|
index: S.Number,
|
|
22
22
|
});
|
|
23
23
|
/** Sent when the focus-option command completes. */
|
|
24
|
-
export const
|
|
24
|
+
export const CompletedFocusOption = m('CompletedFocusOption');
|
|
25
25
|
/** Union of all messages the radio group component can produce. */
|
|
26
|
-
export const Message = S.Union(SelectedOption,
|
|
26
|
+
export const Message = S.Union(SelectedOption, CompletedFocusOption);
|
|
27
27
|
/** Creates an initial radio group model from a config. Defaults to no selection and vertical orientation. */
|
|
28
28
|
export const init = (config) => ({
|
|
29
29
|
id: config.id,
|
|
@@ -32,6 +32,7 @@ export const init = (config) => ({
|
|
|
32
32
|
});
|
|
33
33
|
// UPDATE
|
|
34
34
|
const optionId = (id, index) => `${id}-option-${index}`;
|
|
35
|
+
export const FocusOption = Command.define('FocusOption', CompletedFocusOption);
|
|
35
36
|
/** Processes a radio group message and returns the next model and commands. */
|
|
36
37
|
export const update = (model, message) => M.value(message).pipe(M.withReturnType(), M.tagsExhaustive({
|
|
37
38
|
SelectedOption: ({ value, index }) => {
|
|
@@ -39,11 +40,11 @@ export const update = (model, message) => M.value(message).pipe(M.withReturnType
|
|
|
39
40
|
return [
|
|
40
41
|
evo(model, { selectedValue: () => Option.some(value) }),
|
|
41
42
|
[
|
|
42
|
-
Task.focus(selector).pipe(Effect.ignore, Effect.as(
|
|
43
|
+
FocusOption(Task.focus(selector).pipe(Effect.ignore, Effect.as(CompletedFocusOption()))),
|
|
43
44
|
],
|
|
44
45
|
];
|
|
45
46
|
},
|
|
46
|
-
|
|
47
|
+
CompletedFocusOption: () => [model, []],
|
|
47
48
|
}));
|
|
48
49
|
const labelId = (id, index) => `${id}-option-${index}-label`;
|
|
49
50
|
const descriptionId = (id, index) => `${id}-option-${index}-description`;
|
|
@@ -21,7 +21,7 @@ export type InitConfig = Readonly<{
|
|
|
21
21
|
/** Creates an initial switch model from a config. Defaults to unchecked. */
|
|
22
22
|
export declare const init: (config: InitConfig) => Model;
|
|
23
23
|
/** Processes a switch message and returns the next model and commands. */
|
|
24
|
-
export declare const update: (model: Model, _message: Message) => [Model, ReadonlyArray<Command<Message>>];
|
|
24
|
+
export declare const update: (model: Model, _message: Message) => readonly [Model, ReadonlyArray<Command<Message>>];
|
|
25
25
|
/** Attribute groups the switch component provides to the consumer's `toView` callback. */
|
|
26
26
|
export type SwitchAttributes<Message> = Readonly<{
|
|
27
27
|
button: ReadonlyArray<Attribute<Message>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAoB,MAAM,YAAY,CAAA;AAMxE,qFAAqF;AACrF,eAAO,MAAM,KAAK;;;EAGhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,oEAAoE;AACpE,eAAO,MAAM,OAAO,4DAAe,CAAA;AAEnC,gEAAgE;AAChE,eAAO,MAAM,OAAO,4DAAU,CAAA;AAE9B,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC,CAAA;AAEF,4EAA4E;AAC5E,eAAO,MAAM,IAAI,GAAI,QAAQ,UAAU,KAAG,KAGxC,CAAA;AAIF,0EAA0E;AAC1E,eAAO,MAAM,MAAM,GACjB,OAAO,KAAK,EACZ,UAAU,OAAO,KAChB,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,IAAI,CAAC,E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CAAA;AAEF,wDAAwD;AACxD,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;IACxC,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IACvD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC,CAAA;AAKF,uIAAuI;AACvI,eAAO,MAAM,IAAI,GAAI,OAAO,EAAE,QAAQ,UAAU,CAAC,OAAO,CAAC,KAAG,IAmE3D,CAAA;AAED;6EAC6E;AAC7E,eAAO,MAAM,IAAI,GAAI,OAAO,EAC1B,cAAc,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC,KAC7D,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,IAAI,CAgBtE,CAAA"}
|
package/dist/ui/tabs/index.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export declare const TabFocused: import("../../schema").CallableTaggedStruct<"Ta
|
|
|
25
25
|
index: typeof S.Number;
|
|
26
26
|
}>;
|
|
27
27
|
/** Sent when the focus-tab command completes. */
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const CompletedFocusTab: import("../../schema").CallableTaggedStruct<"CompletedFocusTab", {}>;
|
|
29
29
|
/** Union of all messages the tabs component can produce. */
|
|
30
30
|
export declare const Message: S.Union<[
|
|
31
31
|
typeof TabSelected,
|
|
32
32
|
typeof TabFocused,
|
|
33
|
-
typeof
|
|
33
|
+
typeof CompletedFocusTab
|
|
34
34
|
]>;
|
|
35
35
|
export type TabSelected = typeof TabSelected.Type;
|
|
36
36
|
export type TabFocused = typeof TabFocused.Type;
|
|
@@ -43,8 +43,11 @@ export type InitConfig = Readonly<{
|
|
|
43
43
|
}>;
|
|
44
44
|
/** Creates an initial tabs model from a config. Defaults to first tab and automatic activation. */
|
|
45
45
|
export declare const init: (config: InitConfig) => Model;
|
|
46
|
+
export declare const FocusTab: Command.CommandDefinition<"FocusTab", {
|
|
47
|
+
readonly _tag: "CompletedFocusTab";
|
|
48
|
+
}>;
|
|
46
49
|
/** Processes a tabs message and returns the next model and commands. */
|
|
47
|
-
export declare const update: (model: Model, message: Message) => [Model, ReadonlyArray<Command.Command<Message>>];
|
|
50
|
+
export declare const update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>];
|
|
48
51
|
/** Configuration for an individual tab's button and panel content. */
|
|
49
52
|
export type TabConfig<Message = unknown> = Readonly<{
|
|
50
53
|
buttonClassName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,MAAM,IAAI,CAAC,EAGZ,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,OAAO,EAGb,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI1E,yFAAyF;AACzF,eAAO,MAAM,WAAW,uCAAsC,CAAA;AAC9D,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAA;AAEjD,yGAAyG;AACzG,eAAO,MAAM,cAAc,oCAAmC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,kGAAkG;AAClG,eAAO,MAAM,KAAK;;;;;EAKhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAA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