@foldkit/ui 0.156.0 → 0.157.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/anchor/anchor.d.ts +18 -18
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/anchor/anchor.js +16 -16
- package/dist/animation/index.d.ts +4 -4
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +8 -8
- package/dist/animation/public.d.ts +1 -1
- package/dist/animation/public.d.ts.map +1 -1
- package/dist/animation/public.js +1 -1
- package/dist/animation/schema.d.ts +6 -6
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +5 -5
- package/dist/animation/update.d.ts +8 -2
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +22 -9
- package/dist/calendar/index.d.ts +56 -56
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +49 -37
- package/dist/checkbox/index.js +2 -2
- package/dist/combobox/multi.d.ts +19 -19
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.d.ts +61 -61
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +74 -62
- package/dist/combobox/single.d.ts +19 -19
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/combobox/single.js +2 -2
- package/dist/datePicker/index.d.ts +72 -72
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +12 -12
- package/dist/dialog/index.d.ts +14 -14
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +35 -23
- package/dist/disclosure/index.js +2 -2
- package/dist/dragAndDrop/index.d.ts +61 -61
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +85 -85
- package/dist/fileDrop/index.d.ts +6 -6
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +6 -6
- package/dist/hoverIntent/hoverIntent.d.ts +15 -15
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +17 -17
- package/dist/hoverIntent/message.d.ts +4 -4
- package/dist/hoverIntent/message.d.ts.map +1 -1
- package/dist/hoverIntent/message.js +4 -4
- package/dist/keyboard.js +2 -2
- package/dist/listbox/multi.d.ts +19 -19
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multi.js +2 -2
- package/dist/listbox/shared.d.ts +58 -58
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +74 -62
- package/dist/listbox/single.d.ts +19 -19
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/listbox/single.js +2 -2
- package/dist/menu/index.d.ts +67 -67
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +82 -67
- package/dist/popover/index.d.ts +34 -34
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +49 -37
- package/dist/radioGroup/index.d.ts +12 -12
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +16 -16
- package/dist/slider/index.d.ts +14 -14
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/slider/index.js +31 -31
- package/dist/switch/index.js +2 -2
- package/dist/tabs/index.d.ts +14 -14
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +18 -18
- package/dist/test/apps/disabledButton.d.ts +12 -12
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +5 -5
- package/dist/textarea/index.d.ts +2 -2
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +63 -63
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +19 -19
- package/dist/toast/schema.d.ts +55 -55
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +29 -29
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +3 -3
- package/dist/toast/update.d.ts +61 -61
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +13 -13
- package/dist/tooltip/message.d.ts +3 -3
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/message.js +3 -3
- package/dist/tooltip/tooltip.d.ts +24 -24
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +13 -13
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/typeahead.js +3 -3
- package/dist/virtualList/index.d.ts +16 -16
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +13 -13
- package/package.json +3 -3
package/dist/combobox/shared.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Array, Effect, Match
|
|
2
|
+
import { Array, Effect, Match, Option, Predicate, Schema, pipe } from 'effect';
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import * as Dom from 'foldkit/dom';
|
|
5
5
|
import { defineMessageUnion } from 'foldkit/message';
|
|
@@ -11,8 +11,8 @@ import { AnchorConfig, anchorSetup, portalToContainingRoot, } from '../anchor/in
|
|
|
11
11
|
// NOTE: Animation imports are split across schema + update to avoid a circular
|
|
12
12
|
// dependency: animation → html → runtime → devtools → combobox → animation.
|
|
13
13
|
// The barrel (../animation) imports from html, which starts the cycle.
|
|
14
|
-
import
|
|
15
|
-
import { update as animationUpdate } from '../animation/update.js';
|
|
14
|
+
import * as Animation from '../animation/schema.js';
|
|
15
|
+
import { hide as animationHide, show as animationShow, update as animationUpdate, } from '../animation/update.js';
|
|
16
16
|
import { groupContiguous } from '../group.js';
|
|
17
17
|
import * as OptionExt from '../internal/optionExtensions.js';
|
|
18
18
|
import { idSelector } from '../internal/selectors.js';
|
|
@@ -20,21 +20,21 @@ import { findFirstEnabledIndex, keyToIndex } from '../keyboard.js';
|
|
|
20
20
|
export { groupContiguous };
|
|
21
21
|
// MODEL
|
|
22
22
|
/** Schema for the activation trigger: whether the user interacted via mouse or keyboard. */
|
|
23
|
-
export const ActivationTrigger =
|
|
24
|
-
/** Schema fields shared by all combobox variants (single-select and multi-select). Spread into each variant's `
|
|
25
|
-
export const BaseModel =
|
|
26
|
-
id:
|
|
27
|
-
isOpen:
|
|
28
|
-
isAnimated:
|
|
29
|
-
isModal:
|
|
30
|
-
nullable:
|
|
31
|
-
immediate:
|
|
32
|
-
selectInputOnFocus:
|
|
33
|
-
animation:
|
|
34
|
-
maybeActiveItemIndex:
|
|
23
|
+
export const ActivationTrigger = Schema.Literals(['Pointer', 'Keyboard']);
|
|
24
|
+
/** Schema fields shared by all combobox variants (single-select and multi-select). Spread into each variant's `Schema.Struct` to avoid duplicating field definitions. */
|
|
25
|
+
export const BaseModel = Schema.Struct({
|
|
26
|
+
id: Schema.String,
|
|
27
|
+
isOpen: Schema.Boolean,
|
|
28
|
+
isAnimated: Schema.Boolean,
|
|
29
|
+
isModal: Schema.Boolean,
|
|
30
|
+
nullable: Schema.Boolean,
|
|
31
|
+
immediate: Schema.Boolean,
|
|
32
|
+
selectInputOnFocus: Schema.Boolean,
|
|
33
|
+
animation: Animation.Model,
|
|
34
|
+
maybeActiveItemIndex: Schema.Option(Schema.Number),
|
|
35
35
|
activationTrigger: ActivationTrigger,
|
|
36
|
-
inputValue:
|
|
37
|
-
maybeLastPointerPosition:
|
|
36
|
+
inputValue: Schema.String,
|
|
37
|
+
maybeLastPointerPosition: Schema.Option(Schema.Struct({ screenX: Schema.Number, screenY: Schema.Number })),
|
|
38
38
|
});
|
|
39
39
|
/** Creates the shared base fields for a combobox model from a config. Each variant spreads this and adds its selection fields. */
|
|
40
40
|
export const baseInit = (config) => (__foldkitBrandViewResult(({
|
|
@@ -45,7 +45,7 @@ export const baseInit = (config) => (__foldkitBrandViewResult(({
|
|
|
45
45
|
nullable: config.nullable ?? false,
|
|
46
46
|
immediate: config.immediate ?? false,
|
|
47
47
|
selectInputOnFocus: config.selectInputOnFocus ?? false,
|
|
48
|
-
animation:
|
|
48
|
+
animation: Animation.init({ id: `${config.id}-items` }),
|
|
49
49
|
maybeActiveItemIndex: Option.none(),
|
|
50
50
|
activationTrigger: 'Keyboard',
|
|
51
51
|
inputValue: '',
|
|
@@ -54,32 +54,32 @@ export const baseInit = (config) => (__foldkitBrandViewResult(({
|
|
|
54
54
|
// MESSAGE
|
|
55
55
|
/** Union of all messages the combobox component can produce. */
|
|
56
56
|
export const Message = defineMessageUnion({
|
|
57
|
-
Opened: { maybeActiveItemIndex:
|
|
57
|
+
Opened: { maybeActiveItemIndex: Schema.Option(Schema.Number) },
|
|
58
58
|
Closed: {
|
|
59
|
-
restingInputValue:
|
|
60
|
-
isClearable:
|
|
59
|
+
restingInputValue: Schema.String,
|
|
60
|
+
isClearable: Schema.Boolean,
|
|
61
61
|
},
|
|
62
62
|
BlurredInput: {
|
|
63
|
-
restingInputValue:
|
|
64
|
-
isClearable:
|
|
63
|
+
restingInputValue: Schema.String,
|
|
64
|
+
isClearable: Schema.Boolean,
|
|
65
65
|
},
|
|
66
66
|
ActivatedItem: {
|
|
67
|
-
index:
|
|
67
|
+
index: Schema.Number,
|
|
68
68
|
activationTrigger: ActivationTrigger,
|
|
69
|
-
maybeImmediateSelection:
|
|
69
|
+
maybeImmediateSelection: Schema.Option(Schema.Struct({ item: Schema.String })),
|
|
70
70
|
},
|
|
71
71
|
DeactivatedItem: {},
|
|
72
72
|
SelectedItem: {
|
|
73
|
-
item:
|
|
74
|
-
displayText:
|
|
75
|
-
wasSelected:
|
|
73
|
+
item: Schema.String,
|
|
74
|
+
displayText: Schema.String,
|
|
75
|
+
wasSelected: Schema.Boolean,
|
|
76
76
|
},
|
|
77
77
|
MovedPointerOverItem: {
|
|
78
|
-
index:
|
|
79
|
-
screenX:
|
|
80
|
-
screenY:
|
|
78
|
+
index: Schema.Number,
|
|
79
|
+
screenX: Schema.Number,
|
|
80
|
+
screenY: Schema.Number,
|
|
81
81
|
},
|
|
82
|
-
RequestedItemClick: { index:
|
|
82
|
+
RequestedItemClick: { index: Schema.Number },
|
|
83
83
|
SuppressedItemCommit: {},
|
|
84
84
|
CompletedLockScroll: {},
|
|
85
85
|
CompletedUnlockScroll: {},
|
|
@@ -92,16 +92,16 @@ export const Message = defineMessageUnion({
|
|
|
92
92
|
CompletedAttachComboboxPreventBlur: {},
|
|
93
93
|
CompletedAttachComboboxSelectOnFocus: {},
|
|
94
94
|
CompletedPortalComboboxBackdrop: {},
|
|
95
|
-
GotAnimationMessage: { message:
|
|
96
|
-
UpdatedInputValue: { value:
|
|
95
|
+
GotAnimationMessage: { message: Animation.Message },
|
|
96
|
+
UpdatedInputValue: { value: Schema.String },
|
|
97
97
|
PressedToggleButton: {
|
|
98
|
-
restingInputValue:
|
|
99
|
-
isClearable:
|
|
98
|
+
restingInputValue: Schema.String,
|
|
99
|
+
isClearable: Schema.Boolean,
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
102
|
/** Union of out-messages the combobox component can produce. The parent folds `Selected` into the selection it owns and clears that selection on `ClearedSelection`. */
|
|
103
103
|
export const OutMessage = defineMessageUnion({
|
|
104
|
-
Selected: { value:
|
|
104
|
+
Selected: { value: Schema.String },
|
|
105
105
|
ClearedSelection: {},
|
|
106
106
|
});
|
|
107
107
|
// SELECTORS
|
|
@@ -137,53 +137,53 @@ export const UnlockScroll = Command.define('UnlockScroll', {
|
|
|
137
137
|
});
|
|
138
138
|
/** Marks all elements outside the combobox as inert for modal behavior. */
|
|
139
139
|
export const InertOthers = Command.define('InertOthers', {
|
|
140
|
-
args: { id:
|
|
140
|
+
args: { id: Schema.String },
|
|
141
141
|
messages: [Message.CompletedInertOthers],
|
|
142
142
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.inertOthers(id, [inputWrapperSelector(id), itemsSelector(id)]).pipe(Effect.as(Message.CompletedInertOthers()))), "@foldkit/ui/combobox/shared.js#execute"),
|
|
143
143
|
});
|
|
144
144
|
/** Removes the inert attribute from elements outside the combobox. */
|
|
145
145
|
export const RestoreInert = Command.define('RestoreInert', {
|
|
146
|
-
args: { id:
|
|
146
|
+
args: { id: Schema.String },
|
|
147
147
|
messages: [Message.CompletedRestoreInert],
|
|
148
148
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.restoreInert(id).pipe(Effect.as(Message.CompletedRestoreInert()))), "@foldkit/ui/combobox/shared.js#execute~2"),
|
|
149
149
|
});
|
|
150
150
|
/** Moves focus to the combobox input after selection or close. */
|
|
151
151
|
export const FocusInput = Command.define('FocusInput', {
|
|
152
|
-
args: { id:
|
|
152
|
+
args: { id: Schema.String },
|
|
153
153
|
messages: [Message.CompletedFocusInput],
|
|
154
154
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.focus(inputSelector(id)).pipe(Effect.ignore, Effect.as(Message.CompletedFocusInput()))), "@foldkit/ui/combobox/shared.js#execute~3"),
|
|
155
155
|
});
|
|
156
156
|
/** Scrolls the active combobox item into view after keyboard navigation. */
|
|
157
157
|
export const ScrollIntoView = Command.define('ScrollIntoView', {
|
|
158
|
-
args: { id:
|
|
158
|
+
args: { id: Schema.String, index: Schema.Number },
|
|
159
159
|
messages: [Message.CompletedScrollIntoView],
|
|
160
160
|
execute: ({ id, index }) => __foldkitBrandViewResult((Dom.scrollIntoView(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(Message.CompletedScrollIntoView()))), "@foldkit/ui/combobox/shared.js#execute~4"),
|
|
161
161
|
});
|
|
162
162
|
/** Programmatically clicks the active combobox item's DOM element. */
|
|
163
163
|
export const ClickItem = Command.define('ClickItem', {
|
|
164
|
-
args: { id:
|
|
164
|
+
args: { id: Schema.String, index: Schema.Number },
|
|
165
165
|
messages: [Message.CompletedClickItem],
|
|
166
166
|
execute: ({ id, index }) => __foldkitBrandViewResult((Dom.clickElement(itemSelector(id, index)).pipe(Effect.ignore, Effect.as(Message.CompletedClickItem()))), "@foldkit/ui/combobox/shared.js#execute~5"),
|
|
167
167
|
});
|
|
168
168
|
/** Detects whether the combobox input wrapper moved or the leave animation ended. Whichever comes first; both outcomes signal the Animation submodel that leave is complete. */
|
|
169
169
|
export const DetectMovementOrAnimationEnd = Command.define('DetectMovementOrAnimationEnd', {
|
|
170
|
-
args: { id:
|
|
170
|
+
args: { id: Schema.String },
|
|
171
171
|
messages: [Message.GotAnimationMessage],
|
|
172
172
|
execute: ({ id }) => __foldkitBrandViewResult((Effect.raceFirst(Dom.detectElementMovement(inputWrapperSelector(id)).pipe(Effect.as(Message.GotAnimationMessage({
|
|
173
|
-
message:
|
|
173
|
+
message: Animation.Message.EndedAnimation(),
|
|
174
174
|
}))), Dom.waitForAnimationSettled(itemsSelector(id)).pipe(Effect.as(Message.GotAnimationMessage({
|
|
175
|
-
message:
|
|
175
|
+
message: Animation.Message.EndedAnimation(),
|
|
176
176
|
}))))), "@foldkit/ui/combobox/shared.js#execute~6"),
|
|
177
177
|
});
|
|
178
178
|
/** 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. */
|
|
179
179
|
export const makeUpdate = (handlers) => {
|
|
180
|
-
const foldAnimationOutMessage =
|
|
180
|
+
const foldAnimationOutMessage = Animation.OutMessage.match({
|
|
181
181
|
StartedLeaveAnimating: () => __foldkitBrandViewResult((model => (__foldkitBrandViewResult(({
|
|
182
182
|
model,
|
|
183
183
|
commands: [DetectMovementOrAnimationEnd({ id: model.id })],
|
|
184
184
|
}), "@foldkit/ui/combobox/shared.js#anonymous"))), "@foldkit/ui/combobox/shared.js#StartedLeaveAnimating"),
|
|
185
185
|
TransitionedOut: () => __foldkitBrandViewResult((model => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/combobox/shared.js#anonymous~2"))), "@foldkit/ui/combobox/shared.js#TransitionedOut"),
|
|
186
|
-
})
|
|
186
|
+
});
|
|
187
187
|
const foldAnimation = Update.foldChild({
|
|
188
188
|
update: animationUpdate,
|
|
189
189
|
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read"),
|
|
@@ -191,6 +191,18 @@ export const makeUpdate = (handlers) => {
|
|
|
191
191
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage"),
|
|
192
192
|
foldOutMessage: foldAnimationOutMessage,
|
|
193
193
|
});
|
|
194
|
+
const foldAnimationShow = Update.foldChildStep({
|
|
195
|
+
update: animationShow,
|
|
196
|
+
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read~2"),
|
|
197
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((constrainedEvo(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/combobox/shared.js#animation~2") })), "@foldkit/ui/combobox/shared.js#write~2"),
|
|
198
|
+
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage~2"),
|
|
199
|
+
});
|
|
200
|
+
const foldAnimationHide = Update.foldChildStep({
|
|
201
|
+
update: animationHide,
|
|
202
|
+
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read~3"),
|
|
203
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((constrainedEvo(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/combobox/shared.js#animation~3") })), "@foldkit/ui/combobox/shared.js#write~3"),
|
|
204
|
+
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage~3"),
|
|
205
|
+
});
|
|
194
206
|
const internalUpdate = (model, message) => {
|
|
195
207
|
const maybeLockScroll = OptionExt.when(model.isModal, LockScroll());
|
|
196
208
|
const maybeUnlockScroll = OptionExt.when(model.isModal, UnlockScroll());
|
|
@@ -210,7 +222,7 @@ export const makeUpdate = (handlers) => {
|
|
|
210
222
|
if (didClose && model.isAnimated) {
|
|
211
223
|
return __foldkitBrandViewResult((pipe(nextModel, Update.combine([
|
|
212
224
|
stepModel => (__foldkitBrandViewResult(({ model: stepModel, commands }), "@foldkit/ui/combobox/shared.js#anonymous~3")),
|
|
213
|
-
|
|
225
|
+
foldAnimationHide,
|
|
214
226
|
]), Update.withOutMessage(outMessage))), "@foldkit/ui/combobox/shared.js#closeSelectedItemWithFocus");
|
|
215
227
|
}
|
|
216
228
|
return __foldkitBrandViewResult((Update.withOutMessage({ model: nextModel, commands }, outMessage)), "@foldkit/ui/combobox/shared.js#closeSelectedItemWithFocus");
|
|
@@ -222,7 +234,7 @@ export const makeUpdate = (handlers) => {
|
|
|
222
234
|
model: stepModel,
|
|
223
235
|
commands: Array.getSomes([maybeLockScroll, maybeInertOthers]),
|
|
224
236
|
}), "@foldkit/ui/combobox/shared.js#anonymous~4")),
|
|
225
|
-
|
|
237
|
+
foldAnimationShow,
|
|
226
238
|
stepModel => (__foldkitBrandViewResult(({
|
|
227
239
|
model: constrainedEvo(stepModel, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/combobox/shared.js#isOpen~2") }),
|
|
228
240
|
}), "@foldkit/ui/combobox/shared.js#anonymous~5")),
|
|
@@ -238,7 +250,7 @@ export const makeUpdate = (handlers) => {
|
|
|
238
250
|
if (model.isAnimated) {
|
|
239
251
|
return __foldkitBrandViewResult((pipe(comboboxClose.model, Update.combine([
|
|
240
252
|
stepModel => (__foldkitBrandViewResult(({ model: stepModel, commands }), "@foldkit/ui/combobox/shared.js#anonymous~6")),
|
|
241
|
-
|
|
253
|
+
foldAnimationHide,
|
|
242
254
|
]), Update.withOutMessage(comboboxClose.outMessage))), "@foldkit/ui/combobox/shared.js#closeCombobox");
|
|
243
255
|
}
|
|
244
256
|
return __foldkitBrandViewResult((Update.withOutMessage({ model: comboboxClose.model, commands }, comboboxClose.outMessage)), "@foldkit/ui/combobox/shared.js#closeCombobox");
|
|
@@ -369,7 +381,7 @@ export const makeUpdate = (handlers) => {
|
|
|
369
381
|
* Scene tests can call
|
|
370
382
|
* `Scene.Mount.resolve(AnchorCombobox, CompletedAnchorCombobox())`. */
|
|
371
383
|
export const AnchorCombobox = Mount.define('AnchorCombobox', {
|
|
372
|
-
args: { buttonId:
|
|
384
|
+
args: { buttonId: Schema.String, anchor: AnchorConfig },
|
|
373
385
|
messages: [Message.CompletedAnchorCombobox],
|
|
374
386
|
execute: ({ element, buttonId, anchor }) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
375
387
|
yield* Effect.acquireRelease(Effect.sync(() => {
|
|
@@ -461,21 +473,21 @@ export const makeView = (behavior) => {
|
|
|
461
473
|
const isValueSelected = (itemValue) => __foldkitBrandViewResult((Array.contains(selectedValues, itemValue)), "@foldkit/ui/combobox/shared.js#isValueSelected");
|
|
462
474
|
const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
|
|
463
475
|
const isVisible = isOpen || isLeaving;
|
|
464
|
-
const animationAttributes =
|
|
476
|
+
const animationAttributes = Match.value(transitionState).pipe(Match.when('EnterStart', () => __foldkitBrandViewResult(([
|
|
465
477
|
h.DataAttribute('closed', ''),
|
|
466
478
|
h.DataAttribute('enter', ''),
|
|
467
479
|
h.DataAttribute('transition', ''),
|
|
468
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~25")),
|
|
480
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~25")), Match.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
469
481
|
h.DataAttribute('enter', ''),
|
|
470
482
|
h.DataAttribute('transition', ''),
|
|
471
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~26")),
|
|
483
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~26")), Match.when('LeaveStart', () => __foldkitBrandViewResult(([
|
|
472
484
|
h.DataAttribute('leave', ''),
|
|
473
485
|
h.DataAttribute('transition', ''),
|
|
474
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~27")),
|
|
486
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~27")), Match.when('LeaveAnimating', () => __foldkitBrandViewResult(([
|
|
475
487
|
h.DataAttribute('closed', ''),
|
|
476
488
|
h.DataAttribute('leave', ''),
|
|
477
489
|
h.DataAttribute('transition', ''),
|
|
478
|
-
]), "@foldkit/ui/combobox/shared.js#anonymous~28")),
|
|
490
|
+
]), "@foldkit/ui/combobox/shared.js#anonymous~28")), Match.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/combobox/shared.js#anonymous~29")));
|
|
479
491
|
const isDisabledAtIndex = (index) => __foldkitBrandViewResult((Predicate.isNotUndefined(isItemDisabled) &&
|
|
480
492
|
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");
|
|
481
493
|
const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(0, 1);
|
|
@@ -499,7 +511,7 @@ export const makeView = (behavior) => {
|
|
|
499
511
|
return __foldkitBrandViewResult((Option.map(maybeActiveItemIndex, index => __foldkitBrandViewResult((Message.RequestedItemClick({ index })), "@foldkit/ui/combobox/shared.js#anonymous~34"))), "@foldkit/ui/combobox/shared.js#resolveCommitMessage");
|
|
500
512
|
}
|
|
501
513
|
};
|
|
502
|
-
const handleInputKeyDown = (key) => __foldkitBrandViewResult((
|
|
514
|
+
const handleInputKeyDown = (key) => __foldkitBrandViewResult((Match.value(key).pipe(Match.when('ArrowDown', () => {
|
|
503
515
|
if (!isOpen) {
|
|
504
516
|
return __foldkitBrandViewResult((Option.some(Message.Opened({
|
|
505
517
|
maybeActiveItemIndex: Option.some(firstEnabledIndex),
|
|
@@ -511,7 +523,7 @@ export const makeView = (behavior) => {
|
|
|
511
523
|
activationTrigger: 'Keyboard',
|
|
512
524
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
513
525
|
}))), "@foldkit/ui/combobox/shared.js#anonymous~35");
|
|
514
|
-
}),
|
|
526
|
+
}), Match.when('ArrowUp', () => {
|
|
515
527
|
if (!isOpen) {
|
|
516
528
|
return __foldkitBrandViewResult((Option.some(Message.Opened({
|
|
517
529
|
maybeActiveItemIndex: Option.some(lastEnabledIndex),
|
|
@@ -523,17 +535,17 @@ export const makeView = (behavior) => {
|
|
|
523
535
|
activationTrigger: 'Keyboard',
|
|
524
536
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
525
537
|
}))), "@foldkit/ui/combobox/shared.js#anonymous~36");
|
|
526
|
-
}),
|
|
538
|
+
}), Match.when('Enter', () => {
|
|
527
539
|
if (!isOpen) {
|
|
528
540
|
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~37");
|
|
529
541
|
}
|
|
530
542
|
return __foldkitBrandViewResult((resolveCommitMessage()), "@foldkit/ui/combobox/shared.js#anonymous~37");
|
|
531
|
-
}),
|
|
543
|
+
}), Match.when('Escape', () => {
|
|
532
544
|
if (!isOpen) {
|
|
533
545
|
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~38");
|
|
534
546
|
}
|
|
535
547
|
return __foldkitBrandViewResult((Option.some(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))), "@foldkit/ui/combobox/shared.js#anonymous~38");
|
|
536
|
-
}),
|
|
548
|
+
}), Match.whenOr('Home', 'End', () => {
|
|
537
549
|
if (!isOpen) {
|
|
538
550
|
return __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~39");
|
|
539
551
|
}
|
|
@@ -543,7 +555,7 @@ export const makeView = (behavior) => {
|
|
|
543
555
|
activationTrigger: 'Keyboard',
|
|
544
556
|
maybeImmediateSelection: resolveImmediateSelection(targetIndex),
|
|
545
557
|
}))), "@foldkit/ui/combobox/shared.js#anonymous~39");
|
|
546
|
-
}),
|
|
558
|
+
}), Match.orElse(() => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#anonymous~40")))), "@foldkit/ui/combobox/shared.js#handleInputKeyDown");
|
|
547
559
|
const maybeActiveDescendant = Option.match(maybeActiveItemIndex, {
|
|
548
560
|
onNone: () => __foldkitBrandViewResult(([]), "@foldkit/ui/combobox/shared.js#onNone~3"),
|
|
549
561
|
onSome: index => __foldkitBrandViewResult(([h.AriaActiveDescendant(itemId(id, index))]), "@foldkit/ui/combobox/shared.js#onSome~3"),
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Option, Schema
|
|
1
|
+
import { Option, Schema } from 'effect';
|
|
2
2
|
import { type Update } from 'foldkit';
|
|
3
3
|
import { type View as SubmodelView } from 'foldkit/submodel';
|
|
4
4
|
import { type BaseInitConfig, type BaseViewInputsCommon, Message, OutMessage } from './shared.js';
|
|
5
5
|
/** Schema for the single-select combobox's private interaction state (open/closed status, active item, activation trigger, typed input value). The selection is owned by the parent and passed in via `ViewInputs.maybeSelectedValue`. */
|
|
6
|
-
export declare const Model:
|
|
7
|
-
readonly id:
|
|
8
|
-
readonly isOpen:
|
|
9
|
-
readonly isAnimated:
|
|
10
|
-
readonly isModal:
|
|
11
|
-
readonly nullable:
|
|
12
|
-
readonly immediate:
|
|
13
|
-
readonly selectInputOnFocus:
|
|
14
|
-
readonly animation:
|
|
15
|
-
readonly id:
|
|
16
|
-
readonly isShowing:
|
|
17
|
-
readonly transitionState:
|
|
6
|
+
export declare const Model: Schema.Struct<{
|
|
7
|
+
readonly id: Schema.String;
|
|
8
|
+
readonly isOpen: Schema.Boolean;
|
|
9
|
+
readonly isAnimated: Schema.Boolean;
|
|
10
|
+
readonly isModal: Schema.Boolean;
|
|
11
|
+
readonly nullable: Schema.Boolean;
|
|
12
|
+
readonly immediate: Schema.Boolean;
|
|
13
|
+
readonly selectInputOnFocus: Schema.Boolean;
|
|
14
|
+
readonly animation: Schema.Struct<{
|
|
15
|
+
readonly id: Schema.String;
|
|
16
|
+
readonly isShowing: Schema.Boolean;
|
|
17
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
18
18
|
}>;
|
|
19
|
-
readonly maybeActiveItemIndex:
|
|
20
|
-
readonly activationTrigger:
|
|
21
|
-
readonly inputValue:
|
|
22
|
-
readonly maybeLastPointerPosition:
|
|
23
|
-
readonly screenX:
|
|
24
|
-
readonly screenY:
|
|
19
|
+
readonly maybeActiveItemIndex: Schema.Option<Schema.Number>;
|
|
20
|
+
readonly activationTrigger: Schema.Literals<readonly ["Pointer", "Keyboard"]>;
|
|
21
|
+
readonly inputValue: Schema.String;
|
|
22
|
+
readonly maybeLastPointerPosition: Schema.Option<Schema.Struct<{
|
|
23
|
+
readonly screenX: Schema.Number;
|
|
24
|
+
readonly screenY: Schema.Number;
|
|
25
25
|
}>>;
|
|
26
26
|
}>;
|
|
27
27
|
export type Model = typeof Model.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/combobox/single.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EAAE,KAAK,IAAI,IAAI,YAAY,EAAc,MAAM,kBAAkB,CAAA;AAExE,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EACzB,OAAO,EACP,UAAU,EAKX,MAAM,aAAa,CAAA;AAIpB,0OAA0O;AAC1O,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,oOAAoO;AACpO,MAAM,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,gIAAgI;AAChI,eAAO,MAAM,IAAI,WAAY,U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I,EACV,WAAW,EAAE,MAAM,KAChB,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAC7B,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAChD,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAA;CAC7E,CAAC,CAAA;AAEF;;;;;wDAKwD;AACxD,eAAO,MAAM,MAAM,GAAI,IAAI,SAAS,MAAM,GAAG,MAAM,OAAK,MAAM,CAAC,IAAI,CAuClE,CAAA"}
|
package/dist/combobox/single.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Option, Schema
|
|
2
|
+
import { Option, Schema } from 'effect';
|
|
3
3
|
import { evo } from 'foldkit/struct';
|
|
4
4
|
import { defineView } from 'foldkit/submodel';
|
|
5
5
|
import { BaseModel, Message, OutMessage, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
|
|
6
6
|
// MODEL
|
|
7
7
|
/** Schema for the single-select combobox's private interaction state (open/closed status, active item, activation trigger, typed input value). The selection is owned by the parent and passed in via `ViewInputs.maybeSelectedValue`. */
|
|
8
|
-
export const Model =
|
|
8
|
+
export const Model = Schema.Struct({
|
|
9
9
|
...BaseModel.fields,
|
|
10
10
|
});
|
|
11
11
|
/** Creates an initial single-select combobox model from a config. Defaults to closed with no active item and an empty input. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Option, Schema
|
|
1
|
+
import { Option, Schema } from 'effect';
|
|
2
2
|
import * as Calendar from 'foldkit/calendar';
|
|
3
3
|
import type { CalendarDate } from 'foldkit/calendar';
|
|
4
4
|
import type { ChildAttribute, Html } from 'foldkit/html';
|
|
@@ -11,60 +11,60 @@ import * as UiCalendar from '../calendar/index.js';
|
|
|
11
11
|
* `ViewInputs.maybeSelectedDate`. This holds the embedded Calendar submodel
|
|
12
12
|
* (the visible grid) and the embedded Popover submodel (the open/close +
|
|
13
13
|
* transition layer). */
|
|
14
|
-
export declare const Model:
|
|
15
|
-
readonly id:
|
|
16
|
-
readonly calendar:
|
|
17
|
-
readonly id:
|
|
18
|
-
readonly today:
|
|
19
|
-
readonly year:
|
|
20
|
-
readonly month:
|
|
21
|
-
readonly day:
|
|
14
|
+
export declare const Model: Schema.Struct<{
|
|
15
|
+
readonly id: Schema.String;
|
|
16
|
+
readonly calendar: Schema.Struct<{
|
|
17
|
+
readonly id: Schema.String;
|
|
18
|
+
readonly today: Schema.Struct<{
|
|
19
|
+
readonly year: Schema.Int;
|
|
20
|
+
readonly month: Schema.Int;
|
|
21
|
+
readonly day: Schema.Int;
|
|
22
22
|
}>;
|
|
23
|
-
readonly viewYear:
|
|
24
|
-
readonly viewMonth:
|
|
25
|
-
readonly viewMode:
|
|
26
|
-
readonly maybeFocusedDate:
|
|
27
|
-
readonly year:
|
|
28
|
-
readonly month:
|
|
29
|
-
readonly day:
|
|
23
|
+
readonly viewYear: Schema.Int;
|
|
24
|
+
readonly viewMonth: Schema.Int;
|
|
25
|
+
readonly viewMode: Schema.Literals<readonly ["Days", "Months", "Years"]>;
|
|
26
|
+
readonly maybeFocusedDate: Schema.Option<Schema.Struct<{
|
|
27
|
+
readonly year: Schema.Int;
|
|
28
|
+
readonly month: Schema.Int;
|
|
29
|
+
readonly day: Schema.Int;
|
|
30
30
|
}>>;
|
|
31
|
-
readonly isGridFocused:
|
|
32
|
-
readonly locale:
|
|
33
|
-
readonly firstDayOfWeek:
|
|
34
|
-
readonly monthNames:
|
|
35
|
-
readonly shortMonthNames:
|
|
36
|
-
readonly dayNames:
|
|
37
|
-
readonly shortDayNames:
|
|
31
|
+
readonly isGridFocused: Schema.Boolean;
|
|
32
|
+
readonly locale: Schema.Struct<{
|
|
33
|
+
readonly firstDayOfWeek: Schema.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>;
|
|
34
|
+
readonly monthNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
35
|
+
readonly shortMonthNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
36
|
+
readonly dayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
37
|
+
readonly shortDayNames: Schema.Tuple<readonly [Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String, Schema.String]>;
|
|
38
38
|
}>;
|
|
39
|
-
readonly maybeMinDate:
|
|
40
|
-
readonly year:
|
|
41
|
-
readonly month:
|
|
42
|
-
readonly day:
|
|
39
|
+
readonly maybeMinDate: Schema.Option<Schema.Struct<{
|
|
40
|
+
readonly year: Schema.Int;
|
|
41
|
+
readonly month: Schema.Int;
|
|
42
|
+
readonly day: Schema.Int;
|
|
43
43
|
}>>;
|
|
44
|
-
readonly maybeMaxDate:
|
|
45
|
-
readonly year:
|
|
46
|
-
readonly month:
|
|
47
|
-
readonly day:
|
|
44
|
+
readonly maybeMaxDate: Schema.Option<Schema.Struct<{
|
|
45
|
+
readonly year: Schema.Int;
|
|
46
|
+
readonly month: Schema.Int;
|
|
47
|
+
readonly day: Schema.Int;
|
|
48
48
|
}>>;
|
|
49
|
-
readonly disabledDaysOfWeek:
|
|
50
|
-
readonly disabledDates:
|
|
51
|
-
readonly year:
|
|
52
|
-
readonly month:
|
|
53
|
-
readonly day:
|
|
49
|
+
readonly disabledDaysOfWeek: Schema.$Array<Schema.Literals<readonly ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]>>;
|
|
50
|
+
readonly disabledDates: Schema.$Array<Schema.Struct<{
|
|
51
|
+
readonly year: Schema.Int;
|
|
52
|
+
readonly month: Schema.Int;
|
|
53
|
+
readonly day: Schema.Int;
|
|
54
54
|
}>>;
|
|
55
55
|
}>;
|
|
56
|
-
readonly popover:
|
|
57
|
-
readonly id:
|
|
58
|
-
readonly isOpen:
|
|
59
|
-
readonly isAnimated:
|
|
60
|
-
readonly isModal:
|
|
61
|
-
readonly contentFocus:
|
|
62
|
-
readonly animation:
|
|
63
|
-
readonly id:
|
|
64
|
-
readonly isShowing:
|
|
65
|
-
readonly transitionState:
|
|
56
|
+
readonly popover: Schema.Struct<{
|
|
57
|
+
readonly id: Schema.String;
|
|
58
|
+
readonly isOpen: Schema.Boolean;
|
|
59
|
+
readonly isAnimated: Schema.Boolean;
|
|
60
|
+
readonly isModal: Schema.Boolean;
|
|
61
|
+
readonly contentFocus: Schema.Boolean;
|
|
62
|
+
readonly animation: Schema.Struct<{
|
|
63
|
+
readonly id: Schema.String;
|
|
64
|
+
readonly isShowing: Schema.Boolean;
|
|
65
|
+
readonly transitionState: Schema.Literals<readonly ["Idle", "EnterStart", "EnterAnimating", "LeaveStart", "LeaveAnimating"]>;
|
|
66
66
|
}>;
|
|
67
|
-
readonly maybeLastButtonPointerType:
|
|
67
|
+
readonly maybeLastButtonPointerType: Schema.Option<Schema.String>;
|
|
68
68
|
}>;
|
|
69
69
|
}>;
|
|
70
70
|
export type Model = typeof Model.Type;
|
|
@@ -73,35 +73,35 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
73
73
|
readonly GotCalendarMessage: {
|
|
74
74
|
message: import("foldkit/message").MessageUnion<{
|
|
75
75
|
readonly ClickedDay: {
|
|
76
|
-
date:
|
|
77
|
-
readonly year:
|
|
78
|
-
readonly month:
|
|
79
|
-
readonly day:
|
|
76
|
+
date: Schema.Struct<{
|
|
77
|
+
readonly year: Schema.Int;
|
|
78
|
+
readonly month: Schema.Int;
|
|
79
|
+
readonly day: Schema.Int;
|
|
80
80
|
}>;
|
|
81
81
|
};
|
|
82
82
|
readonly PressedKeyOnGrid: {
|
|
83
|
-
key:
|
|
84
|
-
isShift:
|
|
83
|
+
key: Schema.String;
|
|
84
|
+
isShift: Schema.Boolean;
|
|
85
85
|
};
|
|
86
86
|
readonly ClickedPreviousMonthButton: {};
|
|
87
87
|
readonly ClickedNextMonthButton: {};
|
|
88
88
|
readonly ClickedHeading: {};
|
|
89
89
|
readonly SelectedMonth: {
|
|
90
|
-
month:
|
|
90
|
+
month: Schema.Int;
|
|
91
91
|
};
|
|
92
92
|
readonly SelectedYear: {
|
|
93
|
-
year:
|
|
93
|
+
year: Schema.Int;
|
|
94
94
|
};
|
|
95
95
|
readonly PagedYears: {
|
|
96
|
-
direction:
|
|
96
|
+
direction: Schema.Literals<readonly [1, -1]>;
|
|
97
97
|
};
|
|
98
98
|
readonly FocusedGrid: {};
|
|
99
99
|
readonly BlurredGrid: {};
|
|
100
100
|
readonly RefreshedToday: {
|
|
101
|
-
today:
|
|
102
|
-
readonly year:
|
|
103
|
-
readonly month:
|
|
104
|
-
readonly day:
|
|
101
|
+
today: Schema.Struct<{
|
|
102
|
+
readonly year: Schema.Int;
|
|
103
|
+
readonly month: Schema.Int;
|
|
104
|
+
readonly day: Schema.Int;
|
|
105
105
|
}>;
|
|
106
106
|
};
|
|
107
107
|
readonly CompletedFocusGrid: {};
|
|
@@ -113,8 +113,8 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
113
113
|
readonly RequestedClose: {};
|
|
114
114
|
readonly BlurredPanel: {};
|
|
115
115
|
readonly PressedPointerOnButton: {
|
|
116
|
-
pointerType:
|
|
117
|
-
button:
|
|
116
|
+
pointerType: Schema.String;
|
|
117
|
+
button: Schema.Number;
|
|
118
118
|
};
|
|
119
119
|
readonly CompletedFocusPanel: {};
|
|
120
120
|
readonly CompletedFocusButton: {};
|
|
@@ -137,10 +137,10 @@ export declare const Message: import("foldkit/message").MessageUnion<{
|
|
|
137
137
|
}>;
|
|
138
138
|
};
|
|
139
139
|
readonly RequestedSelectDate: {
|
|
140
|
-
date:
|
|
141
|
-
readonly year:
|
|
142
|
-
readonly month:
|
|
143
|
-
readonly day:
|
|
140
|
+
date: Schema.Struct<{
|
|
141
|
+
readonly year: Schema.Int;
|
|
142
|
+
readonly month: Schema.Int;
|
|
143
|
+
readonly day: Schema.Int;
|
|
144
144
|
}>;
|
|
145
145
|
};
|
|
146
146
|
readonly Cleared: {};
|
|
@@ -151,14 +151,14 @@ export type Message = typeof Message.Type;
|
|
|
151
151
|
/** Union of out-messages the date picker can produce. */
|
|
152
152
|
export declare const OutMessage: import("foldkit/message").MessageUnion<{
|
|
153
153
|
readonly ChangedViewMonth: {
|
|
154
|
-
year:
|
|
155
|
-
month:
|
|
154
|
+
year: Schema.Int;
|
|
155
|
+
month: Schema.Int;
|
|
156
156
|
};
|
|
157
157
|
readonly SelectedDate: {
|
|
158
|
-
date:
|
|
159
|
-
readonly year:
|
|
160
|
-
readonly month:
|
|
161
|
-
readonly day:
|
|
158
|
+
date: Schema.Struct<{
|
|
159
|
+
readonly year: Schema.Int;
|
|
160
|
+
readonly month: Schema.Int;
|
|
161
|
+
readonly day: Schema.Int;
|
|
162
162
|
}>;
|
|
163
163
|
};
|
|
164
164
|
readonly ClearedDate: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/datePicker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAa,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAGxD,OAAO,EAAE,KAAK,OAAO,EAAc,MAA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