@foldkit/ui 0.136.0 → 0.138.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.d.ts +7 -1
- package/dist/anchor.d.ts.map +1 -1
- package/dist/anchor.js +74 -26
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +4 -4
- 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 +2 -2
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/schema.js +2 -2
- package/dist/animation/update.d.ts +3 -3
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +8 -8
- package/dist/checkbox/index.d.ts +4 -0
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +4 -2
- package/dist/checkbox/public.d.ts +1 -1
- package/dist/checkbox/public.d.ts.map +1 -1
- package/dist/checkbox/public.js +1 -1
- package/dist/combobox/multi.d.ts +30 -8
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/multiPublic.d.ts +1 -1
- package/dist/combobox/multiPublic.d.ts.map +1 -1
- package/dist/combobox/public.d.ts +3 -3
- package/dist/combobox/public.d.ts.map +1 -1
- package/dist/combobox/public.js +1 -1
- package/dist/combobox/shared.d.ts +4 -3
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +2 -2
- package/dist/combobox/single.d.ts +30 -8
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/datePicker/index.d.ts +2 -2
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +1 -1
- package/dist/dialog/index.d.ts +2 -2
- package/dist/dragAndDrop/index.d.ts +7 -7
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.js +8 -8
- package/dist/dragAndDrop/public.d.ts +1 -1
- package/dist/dragAndDrop/public.d.ts.map +1 -1
- package/dist/dragAndDrop/public.js +1 -1
- package/dist/listbox/multi.d.ts +31 -9
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/multiPublic.d.ts +1 -1
- package/dist/listbox/multiPublic.d.ts.map +1 -1
- package/dist/listbox/public.d.ts +3 -3
- package/dist/listbox/public.d.ts.map +1 -1
- package/dist/listbox/public.js +1 -1
- package/dist/listbox/shared.d.ts +19 -10
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +22 -12
- package/dist/listbox/single.d.ts +31 -9
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/menu/index.d.ts +47 -19
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +24 -15
- package/dist/menu/public.d.ts +2 -2
- package/dist/menu/public.d.ts.map +1 -1
- package/dist/menu/public.js +1 -1
- package/dist/popover/index.d.ts +4 -3
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/public.d.ts +2 -2
- package/dist/popover/public.d.ts.map +1 -1
- package/dist/popover/public.js +1 -1
- package/dist/slider/public.d.ts +2 -2
- package/dist/slider/public.d.ts.map +1 -1
- package/dist/slider/public.js +1 -1
- package/dist/tabs/index.d.ts +13 -4
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/public.d.ts +2 -2
- package/dist/tabs/public.d.ts.map +1 -1
- package/dist/tabs/public.js +1 -1
- package/dist/test/apps/disabledButton.d.ts +2 -2
- package/dist/test/apps/disabledButton.js +1 -1
- package/dist/toast/index.d.ts +19 -18
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/index.js +5 -4
- package/dist/toast/public.d.ts +1 -1
- package/dist/toast/public.d.ts.map +1 -1
- package/dist/toast/public.js +1 -1
- package/dist/toast/schema.d.ts +5 -5
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/schema.js +2 -2
- package/dist/toast/test.d.ts +6 -5
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/test.js +8 -7
- package/dist/toast/update.d.ts +14 -14
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/toast/update.js +7 -7
- package/dist/tooltip/index.d.ts +2 -177
- package/dist/tooltip/index.d.ts.map +1 -1
- package/dist/tooltip/index.js +2 -260
- package/dist/tooltip/message.d.ts +53 -0
- package/dist/tooltip/message.d.ts.map +1 -0
- package/dist/tooltip/message.js +45 -0
- package/dist/tooltip/public.d.ts +1 -1
- package/dist/tooltip/public.d.ts.map +1 -1
- package/dist/tooltip/public.js +1 -1
- package/dist/tooltip/tooltip.d.ts +130 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +226 -0
- package/dist/virtualList/index.js +5 -2
- package/package.json +2 -2
package/dist/anchor.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const AnchorConfig: S.Struct<{
|
|
|
9
9
|
readonly offset: S.optional<S.Number>;
|
|
10
10
|
readonly padding: S.optional<S.Number>;
|
|
11
11
|
readonly portal: S.optional<S.Boolean>;
|
|
12
|
+
readonly isPlacementLocked: S.optional<S.Boolean>;
|
|
12
13
|
}>;
|
|
13
14
|
export type AnchorConfig = typeof AnchorConfig.Type;
|
|
14
15
|
/** Relocates an element into the shared `foldkit-portal-root` div within its
|
|
@@ -29,7 +30,12 @@ export declare const portalToContainingRoot: (element: Element) => (() => void);
|
|
|
29
30
|
* first position computation clears visibility, deferred via
|
|
30
31
|
* requestAnimationFrame so the element is painted before focus fires.
|
|
31
32
|
* `focusSelector` optionally targets a descendant (e.g. a calendar grid
|
|
32
|
-
* inside a popover panel) instead of the panel itself.
|
|
33
|
+
* inside a popover panel) instead of the panel itself.
|
|
34
|
+
* The side the element currently sits on is written to `data-placement`, so
|
|
35
|
+
* CSS can react to it. When `isPlacementLocked` is true, the element keeps the
|
|
36
|
+
* side that the first positioning picks, `flip` is removed from every later
|
|
37
|
+
* update, and `data-placement` holds that locked side. Otherwise the attribute
|
|
38
|
+
* tracks the side each update resolves to, including the ones `flip` moves. */
|
|
33
39
|
export declare const anchorSetup: (config: {
|
|
34
40
|
buttonId: string;
|
|
35
41
|
anchor: AnchorConfig;
|
package/dist/anchor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../src/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../src/anchor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,MAAM,IAAI,CAAC,EAAgB,MAAM,QAAQ,CAAA;AAYnE;mFACmF;AACnF,eAAO,MAAM,SAAS,qKAapB,CAAA;AAEF,oGAAoG;AACpG,eAAO,MAAM,YAAY;;;;;;;EAOvB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAkCnD;;;;;;0DAM0D;AAC1D,eAAO,MAAM,sBAAsB,GAAI,SAAS,OAAO,KAAG,CAAC,MAAM,IAAI,CAWpE,CAAA;AAKD;;;;;;;;;;;;;;;gFAegF;AAChF,eAAO,MAAM,WAAW,GACrB,QAAQ;IACP,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,MACA,SAAS,OAAO,KAAG,CAAC,MAAM,IAAI,CAkK9B,CAAA"}
|
package/dist/anchor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Function, Schema as S } from 'effect';
|
|
2
|
+
import { Array, Function, Schema as S, String, pipe } from 'effect';
|
|
3
3
|
import { autoUpdate, computePosition, flip, offset as floatingOffset, shift, size, } from '@floating-ui/dom';
|
|
4
4
|
/** Schema mirroring `@floating-ui/dom`'s `Placement` literal union: a side
|
|
5
5
|
* (`top`/`right`/`bottom`/`left`) optionally suffixed with `-start` or `-end`. */
|
|
@@ -24,6 +24,7 @@ export const AnchorConfig = S.Struct({
|
|
|
24
24
|
offset: S.optional(S.Number),
|
|
25
25
|
padding: S.optional(S.Number),
|
|
26
26
|
portal: S.optional(S.Boolean),
|
|
27
|
+
isPlacementLocked: S.optional(S.Boolean),
|
|
27
28
|
});
|
|
28
29
|
const PORTAL_ROOT_ID = 'foldkit-portal-root';
|
|
29
30
|
const getOrCreatePortalRoot = (element) => {
|
|
@@ -71,6 +72,7 @@ export const portalToContainingRoot = (element) => {
|
|
|
71
72
|
}
|
|
72
73
|
}), "@foldkit/ui/anchor.js#portalToContainingRoot");
|
|
73
74
|
};
|
|
75
|
+
const toSide = (placement) => __foldkitBrandViewResult((pipe(placement, String.split('-'), Array.headNonEmpty)), "@foldkit/ui/anchor.js#toSide");
|
|
74
76
|
/** Positions a floating element relative to its button using Floating UI, then
|
|
75
77
|
* returns a cleanup function. Designed to be called inside an `OnMount`
|
|
76
78
|
* action: the consumer wraps the call in `Effect.sync` and stashes the
|
|
@@ -81,7 +83,12 @@ export const portalToContainingRoot = (element) => {
|
|
|
81
83
|
* first position computation clears visibility, deferred via
|
|
82
84
|
* requestAnimationFrame so the element is painted before focus fires.
|
|
83
85
|
* `focusSelector` optionally targets a descendant (e.g. a calendar grid
|
|
84
|
-
* inside a popover panel) instead of the panel itself.
|
|
86
|
+
* inside a popover panel) instead of the panel itself.
|
|
87
|
+
* The side the element currently sits on is written to `data-placement`, so
|
|
88
|
+
* CSS can react to it. When `isPlacementLocked` is true, the element keeps the
|
|
89
|
+
* side that the first positioning picks, `flip` is removed from every later
|
|
90
|
+
* update, and `data-placement` holds that locked side. Otherwise the attribute
|
|
91
|
+
* tracks the side each update resolves to, including the ones `flip` moves. */
|
|
85
92
|
export const anchorSetup = (config) => __foldkitBrandViewResult(((element) => {
|
|
86
93
|
// NOTE: resolve the button and any focus target within the element's own
|
|
87
94
|
// root, which is a shadow root when the app is hosted in one (e.g. the
|
|
@@ -105,38 +112,69 @@ export const anchorSetup = (config) => __foldkitBrandViewResult(((element) => {
|
|
|
105
112
|
if (inShadow) {
|
|
106
113
|
element.style.position = 'fixed';
|
|
107
114
|
}
|
|
108
|
-
const { placement, gap, offset: crossAxis, padding } = config.anchor;
|
|
115
|
+
const { placement, gap, offset: crossAxis, padding, isPlacementLocked, } = config.anchor;
|
|
109
116
|
const shouldInterceptTab = config.interceptTab ?? true;
|
|
117
|
+
const isPlacementLockEnabled = isPlacementLocked ?? false;
|
|
110
118
|
let isFirstUpdate = true;
|
|
111
|
-
|
|
119
|
+
let isActive = true;
|
|
120
|
+
let isPositioning = false;
|
|
121
|
+
let isPositioningQueued = false;
|
|
122
|
+
let lockedPlacement;
|
|
123
|
+
const positionElement = () => {
|
|
124
|
+
if (!isActive) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (isPlacementLockEnabled && isPositioning) {
|
|
128
|
+
isPositioningQueued = true;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (isPlacementLockEnabled) {
|
|
132
|
+
isPositioning = true;
|
|
133
|
+
}
|
|
134
|
+
const isLocked = isPlacementLockEnabled && lockedPlacement !== undefined;
|
|
135
|
+
const requestedPlacement = lockedPlacement ?? placement ?? 'bottom-start';
|
|
112
136
|
computePosition(button, element, {
|
|
113
|
-
placement:
|
|
137
|
+
placement: requestedPlacement,
|
|
114
138
|
strategy,
|
|
115
139
|
middleware: [
|
|
116
140
|
floatingOffset({
|
|
117
141
|
mainAxis: gap ?? 0,
|
|
118
142
|
crossAxis: crossAxis ?? 0,
|
|
119
143
|
}),
|
|
120
|
-
flip({ padding: padding ?? 0 }),
|
|
144
|
+
...(isLocked ? [] : [flip({ padding: padding ?? 0 })]),
|
|
121
145
|
shift({ padding: padding ?? 0 }),
|
|
122
146
|
size({
|
|
123
147
|
padding: padding ?? 0,
|
|
124
148
|
apply({ rects, availableHeight }) {
|
|
149
|
+
if (!isActive) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
125
152
|
element.style.setProperty('--button-width', `${rects.reference.width}px`);
|
|
126
|
-
element.style.maxHeight = `${availableHeight}px`;
|
|
153
|
+
element.style.maxHeight = `${Math.max(0, availableHeight)}px`;
|
|
127
154
|
element.style.overflowY = 'auto';
|
|
128
155
|
element.style.overscrollBehavior = 'none';
|
|
129
156
|
},
|
|
130
157
|
}),
|
|
131
158
|
],
|
|
132
|
-
})
|
|
159
|
+
})
|
|
160
|
+
.then(({ x, y, placement: resolvedPlacement }) => {
|
|
161
|
+
if (!isActive) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
133
164
|
element.style.left = `${x}px`;
|
|
134
165
|
element.style.top = `${y}px`;
|
|
166
|
+
if (isPlacementLockEnabled) {
|
|
167
|
+
lockedPlacement = lockedPlacement ?? resolvedPlacement;
|
|
168
|
+
}
|
|
169
|
+
element.setAttribute('data-placement', toSide(lockedPlacement ?? resolvedPlacement));
|
|
135
170
|
if (isFirstUpdate) {
|
|
136
171
|
isFirstUpdate = false;
|
|
137
172
|
element.style.visibility = '';
|
|
138
173
|
if (config.focusAfterPosition ?? false) {
|
|
139
174
|
requestAnimationFrame(() => {
|
|
175
|
+
if (!isActive) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
140
178
|
const target = config.focusSelector
|
|
141
179
|
? owner.querySelector(config.focusSelector)
|
|
142
180
|
: element;
|
|
@@ -146,25 +184,35 @@ export const anchorSetup = (config) => __foldkitBrandViewResult(((element) => {
|
|
|
146
184
|
});
|
|
147
185
|
}
|
|
148
186
|
}
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (event instanceof KeyboardEvent && event.key === 'Tab') {
|
|
154
|
-
button.focus();
|
|
187
|
+
})
|
|
188
|
+
.finally(() => {
|
|
189
|
+
if (isPlacementLockEnabled) {
|
|
190
|
+
isPositioning = false;
|
|
155
191
|
}
|
|
156
|
-
|
|
192
|
+
if (isActive && isPositioningQueued) {
|
|
193
|
+
isPositioningQueued = false;
|
|
194
|
+
positionElement();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const floatingCleanup = autoUpdate(button, element, positionElement);
|
|
199
|
+
const handleTabKey = (event) => {
|
|
200
|
+
if (event instanceof KeyboardEvent && event.key === 'Tab') {
|
|
201
|
+
button.focus();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
const isTabIntercepted = isPortal && shouldInterceptTab;
|
|
205
|
+
if (isTabIntercepted) {
|
|
157
206
|
element.addEventListener('keydown', handleTabKey);
|
|
158
|
-
return __foldkitBrandViewResult((() => {
|
|
159
|
-
floatingCleanup();
|
|
160
|
-
element.removeEventListener('keydown', handleTabKey);
|
|
161
|
-
portalCleanup?.();
|
|
162
|
-
}), "@foldkit/ui/anchor.js#anonymous~2");
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return __foldkitBrandViewResult((() => {
|
|
166
|
-
floatingCleanup();
|
|
167
|
-
portalCleanup?.();
|
|
168
|
-
}), "@foldkit/ui/anchor.js#anonymous~2");
|
|
169
207
|
}
|
|
208
|
+
return __foldkitBrandViewResult((() => {
|
|
209
|
+
isActive = false;
|
|
210
|
+
isPositioningQueued = false;
|
|
211
|
+
floatingCleanup();
|
|
212
|
+
if (isTabIntercepted) {
|
|
213
|
+
element.removeEventListener('keydown', handleTabKey);
|
|
214
|
+
}
|
|
215
|
+
element.removeAttribute('data-placement');
|
|
216
|
+
portalCleanup?.();
|
|
217
|
+
}), "@foldkit/ui/anchor.js#anonymous~2");
|
|
170
218
|
}), "@foldkit/ui/anchor.js#anchorSetup");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ChildAttribute, Html, TagName } from 'foldkit/html';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { CompletedWaitForPaint, EndedAnimation, Hid, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, init } from './schema.js';
|
|
3
|
+
import { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, update } from './update.js';
|
|
4
4
|
export type { InitConfig } from './schema.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
5
|
+
export { CompletedWaitForPaint, EndedAnimation, Hid, init, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, };
|
|
6
|
+
export { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, update };
|
|
7
7
|
/** Per-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field. */
|
|
8
8
|
export type ViewInputs = Readonly<{
|
|
9
9
|
content: Html;
|
|
@@ -33,7 +33,7 @@ export declare const view: import("foldkit/submodel").View<{
|
|
|
33
33
|
} | {
|
|
34
34
|
readonly _tag: "Hid";
|
|
35
35
|
} | {
|
|
36
|
-
readonly _tag: "
|
|
36
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
37
37
|
} | {
|
|
38
38
|
readonly _tag: "EndedAnimation";
|
|
39
39
|
}, Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/animation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGjE,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,GAAG,EACH,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,IAAI,EACL,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,MAAM,EACP,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,GAAG,EACH,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,MAAM,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,GAChB,CAAA;AAED,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,EAAE,CAAA;AAI7E,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,OAAO,EAAE,IAAI,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;2EAEuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;aAnBN,IAAI;gBACD,MAAM;iBACL,aAAa,CAAC,cAAc,CAAC;cAChC,OAAO;IACjB;;2EAEuE;kBACzD,OAAO;GA2GtB,CAAA"}
|
package/dist/animation/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Match as M } from 'effect';
|
|
3
3
|
import { defineView } from 'foldkit/submodel';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
4
|
+
import { CompletedWaitForPaint, EndedAnimation, Hid, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, init, } from './schema.js';
|
|
5
|
+
import { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, update, } from './update.js';
|
|
6
|
+
export { CompletedWaitForPaint, EndedAnimation, Hid, init, Message, Model, OutMessage, Showed, StartedLeaveAnimating, TransitionState, TransitionedOut, };
|
|
7
|
+
export { WaitForAnimationSettled, WaitForPaint, defaultLeaveCommand, update };
|
|
8
8
|
/** Renders a headless animation wrapper that coordinates CSS transitions and
|
|
9
9
|
* CSS keyframe animations via data attributes.
|
|
10
10
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { init, update, view, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid,
|
|
1
|
+
export { init, update, view, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid, CompletedWaitForPaint, EndedAnimation, StartedLeaveAnimating, TransitionedOut, TransitionState, WaitForPaint, WaitForAnimationSettled, } from './index.js';
|
|
2
2
|
export type { InitConfig, ViewInputs } from './index.js';
|
|
3
3
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/animation/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,EACH,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/animation/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,EACH,qBAAqB,EACrB,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/animation/public.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init, update, view, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid,
|
|
1
|
+
export { init, update, view, defaultLeaveCommand, Model, Message, OutMessage, Showed, Hid, CompletedWaitForPaint, EndedAnimation, StartedLeaveAnimating, TransitionedOut, TransitionState, WaitForPaint, WaitForAnimationSettled, } from './index.js';
|
|
@@ -14,14 +14,14 @@ export declare const Showed: import("foldkit/schema").CallableTaggedStruct<"Show
|
|
|
14
14
|
/** Sent when the animation should leave (become hidden). Starts the leave sequence. */
|
|
15
15
|
export declare const Hid: import("foldkit/schema").CallableTaggedStruct<"Hid", {}>;
|
|
16
16
|
/** Sent internally when a double-rAF completes, advancing the lifecycle to its animating phase. */
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const CompletedWaitForPaint: import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>;
|
|
18
18
|
/** Sent internally when all CSS animations on the element have settled. Covers both CSS transitions and CSS keyframe animations. */
|
|
19
19
|
export declare const EndedAnimation: import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>;
|
|
20
20
|
/** Union of all messages the animation component can produce. */
|
|
21
21
|
export declare const Message: S.Union<[
|
|
22
22
|
typeof Showed,
|
|
23
23
|
typeof Hid,
|
|
24
|
-
typeof
|
|
24
|
+
typeof CompletedWaitForPaint,
|
|
25
25
|
typeof EndedAnimation
|
|
26
26
|
]>;
|
|
27
27
|
export type Message = typeof Message.Type;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/animation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAKpC,6EAA6E;AAC7E,eAAO,MAAM,eAAe,+FAM1B,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD,kHAAkH;AAClH,eAAO,MAAM,KAAK;;;;EAIhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,wFAAwF;AACxF,eAAO,MAAM,MAAM,6DAAc,CAAA;AACjC,uFAA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iE;AACjE,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,KAIxC,CAAA"}
|
package/dist/animation/schema.js
CHANGED
|
@@ -23,11 +23,11 @@ export const Showed = m('Showed');
|
|
|
23
23
|
/** Sent when the animation should leave (become hidden). Starts the leave sequence. */
|
|
24
24
|
export const Hid = m('Hid');
|
|
25
25
|
/** Sent internally when a double-rAF completes, advancing the lifecycle to its animating phase. */
|
|
26
|
-
export const
|
|
26
|
+
export const CompletedWaitForPaint = m('CompletedWaitForPaint');
|
|
27
27
|
/** Sent internally when all CSS animations on the element have settled. Covers both CSS transitions and CSS keyframe animations. */
|
|
28
28
|
export const EndedAnimation = m('EndedAnimation');
|
|
29
29
|
/** Union of all messages the animation component can produce. */
|
|
30
|
-
export const Message = S.Union([Showed, Hid,
|
|
30
|
+
export const Message = S.Union([Showed, Hid, CompletedWaitForPaint, EndedAnimation]);
|
|
31
31
|
// OUT MESSAGE
|
|
32
32
|
/** Sent to the parent when the leave sequence advances to LeaveAnimating. The parent is responsible for providing the command that detects when the leave animation completes (e.g. WaitForAnimationSettled or a racing command). Use `defaultLeaveCommand` for the standard behavior. */
|
|
33
33
|
export const StartedLeaveAnimating = m('StartedLeaveAnimating');
|
|
@@ -6,9 +6,9 @@ type UpdateReturn = readonly [
|
|
|
6
6
|
ReadonlyArray<Command.Command<Message>>,
|
|
7
7
|
Option.Option<OutMessage>
|
|
8
8
|
];
|
|
9
|
-
/**
|
|
10
|
-
export declare const
|
|
11
|
-
readonly _tag: "
|
|
9
|
+
/** Waits for paint via double-rAF before the enter/leave lifecycle advances. */
|
|
10
|
+
export declare const WaitForPaint: Command.CommandDefinitionNoArgs<"WaitForPaint", Effect.Effect<{
|
|
11
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
12
12
|
}, never, never>>;
|
|
13
13
|
/** Waits for all CSS animations on the element to settle. Covers both CSS transitions and CSS keyframe animations. */
|
|
14
14
|
export declare const WaitForAnimationSettled: Command.CommandDefinitionWithArgs<"WaitForAnimationSettled", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChE,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAM1C,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAA;AAMpB,KAAK,YAAY,GAAG,SAAS;IAC3B,KAAK;IACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;CAC1B,CAAA;AAGD,
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAc,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChE,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAM1C,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAA;AAMpB,KAAK,YAAY,GAAG,SAAS;IAC3B,KAAK;IACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;CAC1B,CAAA;AAGD,gFAAgF;AAChF,eAAO,MAAM,YAAY;;iBAGvB,CAAA;AACF,sHAAsH;AACtH,eAAO,MAAM,uBAAuB;;;;iBAUnC,CAAA;AAED,oGAAoG;AACpG,eAAO,MAAM,MAAM,GAAI,OAAO,KAAK,EAAE,SAAS,OAAO,KAAG,YAyEvD,CAAA;AAED,2NAA2N;AAC3N,eAAO,MAAM,mBAAmB,GAAI,OAAO,KAAK,KAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAC/B,CAAA"}
|
package/dist/animation/update.js
CHANGED
|
@@ -5,14 +5,14 @@ import * as Dom from 'foldkit/dom';
|
|
|
5
5
|
import * as Render from 'foldkit/render';
|
|
6
6
|
import { evo } from 'foldkit/struct';
|
|
7
7
|
import { idSelector } from '../internal/selectors.js';
|
|
8
|
-
import {
|
|
8
|
+
import { CompletedWaitForPaint, EndedAnimation, StartedLeaveAnimating, TransitionedOut, } from './schema.js';
|
|
9
9
|
// UPDATE
|
|
10
10
|
const elementSelector = (id) => __foldkitBrandViewResult((idSelector(id)), "@foldkit/ui/animation/update.js#elementSelector");
|
|
11
11
|
const withUpdateReturn = M.withReturnType();
|
|
12
|
-
/**
|
|
13
|
-
export const
|
|
14
|
-
messages: [
|
|
15
|
-
execute: Render.afterPaint.pipe(Effect.as(
|
|
12
|
+
/** Waits for paint via double-rAF before the enter/leave lifecycle advances. */
|
|
13
|
+
export const WaitForPaint = Command.define('WaitForPaint', {
|
|
14
|
+
messages: [CompletedWaitForPaint],
|
|
15
|
+
execute: Render.afterPaint.pipe(Effect.as(CompletedWaitForPaint())),
|
|
16
16
|
});
|
|
17
17
|
/** Waits for all CSS animations on the element to settle. Covers both CSS transitions and CSS keyframe animations. */
|
|
18
18
|
export const WaitForAnimationSettled = Command.define('WaitForAnimationSettled', {
|
|
@@ -22,7 +22,7 @@ export const WaitForAnimationSettled = Command.define('WaitForAnimationSettled',
|
|
|
22
22
|
});
|
|
23
23
|
/** Processes an animation message and returns the next model, commands, and optional OutMessage. */
|
|
24
24
|
export const update = (model, message) => {
|
|
25
|
-
const maybeNextFrame =
|
|
25
|
+
const maybeNextFrame = WaitForPaint();
|
|
26
26
|
return __foldkitBrandViewResult((M.value(message).pipe(withUpdateReturn, M.tagsExhaustive({
|
|
27
27
|
Showed: () => {
|
|
28
28
|
if (model.isShowing) {
|
|
@@ -52,7 +52,7 @@ export const update = (model, message) => {
|
|
|
52
52
|
Option.none(),
|
|
53
53
|
]), "@foldkit/ui/animation/update.js#Hid");
|
|
54
54
|
},
|
|
55
|
-
|
|
55
|
+
CompletedWaitForPaint: () => __foldkitBrandViewResult((M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterStart', () => __foldkitBrandViewResult(([
|
|
56
56
|
evo(model, { transitionState: () => __foldkitBrandViewResult(('EnterAnimating'), "@foldkit/ui/animation/update.js#transitionState~3") }),
|
|
57
57
|
[WaitForAnimationSettled({ id: model.id })],
|
|
58
58
|
Option.none(),
|
|
@@ -60,7 +60,7 @@ export const update = (model, message) => {
|
|
|
60
60
|
evo(model, { transitionState: () => __foldkitBrandViewResult(('LeaveAnimating'), "@foldkit/ui/animation/update.js#transitionState~4") }),
|
|
61
61
|
[],
|
|
62
62
|
Option.some(StartedLeaveAnimating()),
|
|
63
|
-
]), "@foldkit/ui/animation/update.js#anonymous~2")), M.orElse(() => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/animation/update.js#anonymous~3")))), "@foldkit/ui/animation/update.js#
|
|
63
|
+
]), "@foldkit/ui/animation/update.js#anonymous~2")), M.orElse(() => __foldkitBrandViewResult(([model, [], Option.none()]), "@foldkit/ui/animation/update.js#anonymous~3")))), "@foldkit/ui/animation/update.js#CompletedWaitForPaint"),
|
|
64
64
|
EndedAnimation: () => __foldkitBrandViewResult((M.value(model.transitionState).pipe(withUpdateReturn, M.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
65
65
|
evo(model, { transitionState: () => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/animation/update.js#transitionState~5") }),
|
|
66
66
|
[],
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ export type ViewConfig<Message> = Readonly<{
|
|
|
39
39
|
name?: string;
|
|
40
40
|
value?: string;
|
|
41
41
|
}>;
|
|
42
|
+
/** Generates the label element ID from the checkbox's base ID. */
|
|
43
|
+
export declare const labelId: (id: string) => string;
|
|
44
|
+
/** Generates the description element ID from the checkbox's base ID. */
|
|
45
|
+
export declare const descriptionId: (id: string) => string;
|
|
42
46
|
/** Renders an accessible checkbox as a stateless controlled component. The
|
|
43
47
|
* parent owns the checked state (`isChecked`) and receives the new state via
|
|
44
48
|
* `onToggle` when the user toggles it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/checkbox/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAIhE;;;;;;;;;;;;;kDAakD;AAClD,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI,QAAQ,CAAC;IACjD,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC/C,CAAC,CAAA;AAEF;;;;;;;;;kBASkB;AAClB,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAA;IACzC,MAAM,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IAC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,GAAI,OAAO,EAC1B,QAAQ,UAAU,CAAC,OAAO,CAAC,EAC3B,GAAG,WAAW,CAAC,OAAO,CAAC,KACtB,IAmEF,CAAA"}
|
package/dist/checkbox/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Match as M, Option } from 'effect';
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
/** Generates the label element ID from the checkbox's base ID. */
|
|
4
|
+
export const labelId = (id) => __foldkitBrandViewResult((`${id}-label`), "@foldkit/ui/checkbox/index.js#labelId");
|
|
5
|
+
/** Generates the description element ID from the checkbox's base ID. */
|
|
6
|
+
export const descriptionId = (id) => __foldkitBrandViewResult((`${id}-description`), "@foldkit/ui/checkbox/index.js#descriptionId");
|
|
5
7
|
/** Renders an accessible checkbox as a stateless controlled component. The
|
|
6
8
|
* parent owns the checked state (`isChecked`) and receives the new state via
|
|
7
9
|
* `onToggle` when the user toggles it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/checkbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/checkbox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAEzD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/checkbox/public.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { view } from './index.js';
|
|
1
|
+
export { view, labelId, descriptionId } from './index.js';
|
package/dist/combobox/multi.d.ts
CHANGED
|
@@ -140,7 +140,7 @@ export declare const update: (model: {
|
|
|
140
140
|
} | {
|
|
141
141
|
readonly _tag: "Hid";
|
|
142
142
|
} | {
|
|
143
|
-
readonly _tag: "
|
|
143
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
144
144
|
} | {
|
|
145
145
|
readonly _tag: "EndedAnimation";
|
|
146
146
|
};
|
|
@@ -159,15 +159,37 @@ export declare const close: (model: Model) => UpdateReturn;
|
|
|
159
159
|
export declare const selectItem: (model: Model, item: string) => UpdateReturn;
|
|
160
160
|
/** Per-render view inputs passed to the view via `h.submodel`'s `viewInputs` field. */
|
|
161
161
|
export type ViewInputs<Item extends string> = BaseViewInputs<Item>;
|
|
162
|
+
/** The `view`, `update`, and programmatic helpers that
|
|
163
|
+
* `Combobox.Multi.create` returns, bound to one `Item` type. Name it to
|
|
164
|
+
* annotate a value that holds a created bundle, such as a field on a
|
|
165
|
+
* config object or a function parameter that takes the bundle rather than
|
|
166
|
+
* calling `create` itself. */
|
|
167
|
+
export type Bundle<Item extends string = string> = Readonly<{
|
|
168
|
+
view: SubmodelView<Model, Message, ViewInputs<Item>>;
|
|
169
|
+
update: (model: Model, message: Message) => readonly [
|
|
170
|
+
Model,
|
|
171
|
+
ReadonlyArray<Command.Command<Message>>,
|
|
172
|
+
Option.Option<OutMessage<Item>>
|
|
173
|
+
];
|
|
174
|
+
selectItem: (model: Model, item: Item) => readonly [
|
|
175
|
+
Model,
|
|
176
|
+
ReadonlyArray<Command.Command<Message>>,
|
|
177
|
+
Option.Option<OutMessage<Item>>
|
|
178
|
+
];
|
|
179
|
+
open: (model: Model) => readonly [
|
|
180
|
+
Model,
|
|
181
|
+
ReadonlyArray<Command.Command<Message>>,
|
|
182
|
+
Option.Option<OutMessage<Item>>
|
|
183
|
+
];
|
|
184
|
+
close: (model: Model) => readonly [
|
|
185
|
+
Model,
|
|
186
|
+
ReadonlyArray<Command.Command<Message>>,
|
|
187
|
+
Option.Option<OutMessage<Item>>
|
|
188
|
+
];
|
|
189
|
+
}>;
|
|
162
190
|
/** Pairs the multi-select combobox's `view` and `update` (and programmatic
|
|
163
191
|
* helpers) behind a single Item-typed entry point. `selectItem` emits
|
|
164
192
|
* `Selected({ value })`; the parent toggles the value's membership. */
|
|
165
|
-
export declare const create: <Item extends string = string>() =>
|
|
166
|
-
view: SubmodelView<Model, Message, BaseViewInputs<Item>>;
|
|
167
|
-
update: (model: Model, message: Message) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Item>>];
|
|
168
|
-
selectItem: (model: Model, item: Item) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Item>>];
|
|
169
|
-
open: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Item>>];
|
|
170
|
-
close: (model: Model) => readonly [Model, ReadonlyArray<Command.Command<Message>>, Option.Option<OutMessage<Item>>];
|
|
171
|
-
}>;
|
|
193
|
+
export declare const create: <Item extends string = string>() => Bundle<Item>;
|
|
172
194
|
export {};
|
|
173
195
|
//# sourceMappingURL=multi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi.d.ts","sourceRoot":"","sources":["../../src/combobox/multi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,KAAK,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE/C,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,cAAc,EAGnB,KAAK,OAAO,EAEZ,KAAK,UAAU,EAOhB,MAAM,aAAa,CAAA;AAIpB,qOAAqO;AACrO,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;EAEhB,CAAA;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,mOAAmO;AACnO,MAAM,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,+HAA+H;AAC/H,eAAO,MAAM,IAAI,GAAI,QAA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AAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;IACD,IAAI,EAAE,CACJ,KAAK,EAAE,KAAK,KACT,SAAS;QACZ,KAAK;QACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;IACD,KAAK,EAAE,CACL,KAAK,EAAE,KAAK,KACT,SAAS;QACZ,KAAK;QACL,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;KAChC,CAAA;CACF,CAAC,CAAA;AAEF;;wEAEwE;AACxE,eAAO,MAAM,MAAM,GAAI,IAAI,SAAS,MAAM,GAAG,MAAM,OAAK,MAAM,CAAC,IAAI,CAoBlE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiPublic.d.ts","sourceRoot":"","sources":["../../src/combobox/multiPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"multiPublic.d.ts","sourceRoot":"","sources":["../../src/combobox/multiPublic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { init, create, Model } from './single.js';
|
|
2
2
|
export { inputId } from './shared.js';
|
|
3
|
-
export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
4
|
-
export type { ActivationTrigger,
|
|
5
|
-
export type { InitConfig, ViewInputs } from './single.js';
|
|
3
|
+
export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, } from './shared.js';
|
|
4
|
+
export type { ActivationTrigger, ItemConfig, GroupHeading, BaseViewInputsCommon, } from './shared.js';
|
|
5
|
+
export type { Bundle, InitConfig, ViewInputs } from './single.js';
|
|
6
6
|
export type { AnchorConfig } from '../anchor.js';
|
|
7
7
|
export * as Multi from './multiPublic.js';
|
|
8
8
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,cAAc,EACd,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,4BAA4B,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/combobox/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EACL,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,kCAAkC,EAClC,oCAAoC,EACpC,+BAA+B,EAC/B,cAAc,EACd,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,4BAA4B,EAC5B,MAAM,EACN,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,oBAAoB,GACrB,MAAM,aAAa,CAAA;AAEpB,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEjE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAA"}
|
package/dist/combobox/public.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { init, create, Model } from './single.js';
|
|
2
2
|
export { inputId } from './shared.js';
|
|
3
|
-
export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, } from './shared.js';
|
|
3
|
+
export { Message, OutMessage, Selected, ClearedSelection, SelectedItem, CompletedLockScroll, CompletedUnlockScroll, CompletedInertOthers, CompletedRestoreInert, CompletedFocusInput, CompletedScrollIntoView, CompletedClickItem, CompletedAnchorCombobox, CompletedAttachComboboxPreventBlur, CompletedAttachComboboxSelectOnFocus, CompletedPortalComboboxBackdrop, AnchorCombobox, AttachComboboxPreventBlur, AttachComboboxSelectOnFocus, PortalComboboxBackdrop, GotAnimationMessage, LockScroll, UnlockScroll, InertOthers, RestoreInert, FocusInput, ScrollIntoView, ClickItem, DetectMovementOrAnimationEnd, Opened, Closed, BlurredInput, ActivatedItem, DeactivatedItem, MovedPointerOverItem, RequestedItemClick, UpdatedInputValue, PressedToggleButton, } from './shared.js';
|
|
4
4
|
export * as Multi from './multiPublic.js';
|
|
@@ -110,7 +110,7 @@ export declare const CompletedAttachComboboxSelectOnFocus: import("foldkit/schem
|
|
|
110
110
|
export declare const CompletedPortalComboboxBackdrop: import("foldkit/schema").CallableTaggedStruct<"CompletedPortalComboboxBackdrop", {}>;
|
|
111
111
|
/** Wraps an Animation submodel message for delegation. */
|
|
112
112
|
export declare const GotAnimationMessage: import("foldkit/schema").CallableTaggedStruct<"GotAnimationMessage", {
|
|
113
|
-
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"
|
|
113
|
+
message: S.Union<[import("foldkit/schema").CallableTaggedStruct<"Showed", {}>, import("foldkit/schema").CallableTaggedStruct<"Hid", {}>, import("foldkit/schema").CallableTaggedStruct<"CompletedWaitForPaint", {}>, import("foldkit/schema").CallableTaggedStruct<"EndedAnimation", {}>]>;
|
|
114
114
|
}>;
|
|
115
115
|
/** Sent when the user types in the input. */
|
|
116
116
|
export declare const UpdatedInputValue: import("foldkit/schema").CallableTaggedStruct<"UpdatedInputValue", {
|
|
@@ -252,7 +252,7 @@ export declare const DetectMovementOrAnimationEnd: Command.CommandDefinitionWith
|
|
|
252
252
|
} | {
|
|
253
253
|
readonly _tag: "Hid";
|
|
254
254
|
} | {
|
|
255
|
-
readonly _tag: "
|
|
255
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
256
256
|
} | {
|
|
257
257
|
readonly _tag: "EndedAnimation";
|
|
258
258
|
};
|
|
@@ -332,7 +332,7 @@ export declare const makeUpdate: <Model extends BaseModel>(handlers: Readonly<{
|
|
|
332
332
|
} | {
|
|
333
333
|
readonly _tag: "Hid";
|
|
334
334
|
} | {
|
|
335
|
-
readonly _tag: "
|
|
335
|
+
readonly _tag: "CompletedWaitForPaint";
|
|
336
336
|
} | {
|
|
337
337
|
readonly _tag: "EndedAnimation";
|
|
338
338
|
};
|
|
@@ -354,6 +354,7 @@ export declare const AnchorCombobox: Mount.MountDefinitionWithArgs<"AnchorCombob
|
|
|
354
354
|
readonly offset: S.optional<S.Number>;
|
|
355
355
|
readonly padding: S.optional<S.Number>;
|
|
356
356
|
readonly portal: S.optional<S.Boolean>;
|
|
357
|
+
readonly isPlacementLocked: S.optional<S.Boolean>;
|
|
357
358
|
}>;
|
|
358
359
|
}, {
|
|
359
360
|
readonly _tag: "CompletedAnchorCombobox";
|