@foldkit/ui 0.154.0 → 0.155.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 +1 -1
- package/dist/anchor/anchor.d.ts.map +1 -1
- package/dist/animation/index.d.ts +5 -5
- package/dist/animation/schema.d.ts.map +1 -1
- package/dist/animation/update.d.ts.map +1 -1
- package/dist/button/index.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +44 -44
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/combobox/multi.d.ts +47 -47
- package/dist/combobox/multi.d.ts.map +1 -1
- package/dist/combobox/shared.d.ts +44 -44
- package/dist/combobox/shared.d.ts.map +1 -1
- package/dist/combobox/shared.js +91 -78
- package/dist/combobox/single.d.ts +50 -50
- package/dist/combobox/single.d.ts.map +1 -1
- package/dist/datePicker/index.d.ts +102 -102
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts +38 -18
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +66 -39
- package/dist/dialog/public.d.ts +1 -1
- package/dist/dialog/public.d.ts.map +1 -1
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/dragAndDrop/index.d.ts +191 -191
- package/dist/dragAndDrop/index.d.ts.map +1 -1
- package/dist/fieldset/index.d.ts.map +1 -1
- package/dist/fileDrop/index.d.ts +10 -10
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/group.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.d.ts +103 -0
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -0
- package/dist/hoverIntent/hoverIntent.js +210 -0
- package/dist/hoverIntent/index.d.ts +4 -0
- package/dist/hoverIntent/index.d.ts.map +1 -0
- package/dist/hoverIntent/index.js +2 -0
- package/dist/hoverIntent/message.d.ts +42 -0
- package/dist/hoverIntent/message.d.ts.map +1 -0
- package/dist/hoverIntent/message.js +23 -0
- package/dist/hoverIntent/public.d.ts +3 -0
- package/dist/hoverIntent/public.d.ts.map +1 -0
- package/dist/hoverIntent/public.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/input/index.d.ts.map +1 -1
- package/dist/internal/optionExtensions.d.ts.map +1 -1
- package/dist/internal/selectors.d.ts.map +1 -1
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/listbox/multi.d.ts +43 -43
- package/dist/listbox/multi.d.ts.map +1 -1
- package/dist/listbox/shared.d.ts +38 -38
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +46 -39
- package/dist/listbox/single.d.ts +45 -45
- package/dist/listbox/single.d.ts.map +1 -1
- package/dist/menu/index.d.ts +70 -70
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +39 -32
- package/dist/nav/index.d.ts.map +1 -1
- package/dist/popover/index.d.ts +33 -33
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +36 -29
- package/dist/radioGroup/index.d.ts +6 -6
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/select/index.d.ts.map +1 -1
- package/dist/slider/index.d.ts +72 -72
- package/dist/slider/index.d.ts.map +1 -1
- package/dist/switch/index.d.ts.map +1 -1
- package/dist/tabs/index.d.ts +6 -6
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.d.ts +18 -15
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/toast/index.d.ts +224 -224
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/toast/schema.d.ts +16 -16
- package/dist/toast/schema.d.ts.map +1 -1
- package/dist/toast/test.d.ts.map +1 -1
- package/dist/toast/update.d.ts +151 -151
- package/dist/toast/update.d.ts.map +1 -1
- package/dist/tooltip/message.d.ts +2 -2
- package/dist/tooltip/message.d.ts.map +1 -1
- package/dist/tooltip/tooltip.d.ts +7 -7
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +15 -11
- package/dist/typeahead.d.ts.map +1 -1
- package/dist/virtualList/index.d.ts +10 -10
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +5 -5
- package/package.json +12 -10
package/dist/dialog/index.js
CHANGED
|
@@ -27,7 +27,8 @@ export const Model = S.Struct({
|
|
|
27
27
|
export const Message = defineMessageUnion({
|
|
28
28
|
RequestedOpen: {},
|
|
29
29
|
RequestedClose: {},
|
|
30
|
-
|
|
30
|
+
SucceededShowDialog: {},
|
|
31
|
+
FailedShowDialog: {},
|
|
31
32
|
CompletedCloseDialog: {},
|
|
32
33
|
Unmounted: {},
|
|
33
34
|
CompletedReleaseDialogResources: {},
|
|
@@ -62,17 +63,29 @@ export const initialFocusMarkerSelector = `[data-${initialFocusMarkerAttribute}]
|
|
|
62
63
|
* `Dom.showDialog`, which calls `show()` (not native `showModal()`) so other
|
|
63
64
|
* high-z-index overlays stay interactive. It layers the dialog with a high
|
|
64
65
|
* z-index, traps focus, and dispatches a `cancel` event on Esc. The Dialog
|
|
65
|
-
* component supplies its own backdrop.
|
|
66
|
+
* component supplies its own backdrop. If the dialog element is gone by the
|
|
67
|
+
* time the show runs, the lock is released and the Command reports
|
|
68
|
+
* `FailedShowDialog`. A closed dialog has no `OnUnmount`, so nothing else
|
|
69
|
+
* would release the lock. The update function then closes the Model. Without
|
|
70
|
+
* this close, the dialog would render open with no lock and no focus trap.
|
|
71
|
+
* The lock is also released if the Command is interrupted while it waits. */
|
|
66
72
|
export const ShowDialog = Command.define('ShowDialog', {
|
|
67
73
|
args: { id: S.String, focusSelector: S.String },
|
|
68
|
-
messages: [Message.
|
|
69
|
-
execute: ({ id, focusSelector }) => __foldkitBrandViewResult((Dom.lockScroll.pipe(Effect.andThen(() => __foldkitBrandViewResult((Dom.showDialog(dialogSelector(id), { focusSelector })), "@foldkit/ui/dialog/index.js#anonymous")), Effect.
|
|
74
|
+
messages: [Message.SucceededShowDialog, Message.FailedShowDialog],
|
|
75
|
+
execute: ({ id, focusSelector }) => __foldkitBrandViewResult((Dom.lockScroll.pipe(Effect.andThen(() => __foldkitBrandViewResult((Dom.showDialog(dialogSelector(id), { focusSelector }).pipe(Effect.onError(() => __foldkitBrandViewResult((Dom.unlockScroll), "@foldkit/ui/dialog/index.js#anonymous~2")), Effect.as(Message.SucceededShowDialog()), Effect.catch(() => __foldkitBrandViewResult((Effect.succeed(Message.FailedShowDialog())), "@foldkit/ui/dialog/index.js#anonymous~3")))), "@foldkit/ui/dialog/index.js#anonymous")))), "@foldkit/ui/dialog/index.js#execute"),
|
|
70
76
|
});
|
|
71
|
-
/** Calls `close()` on the native dialog element and unlocks page scroll
|
|
77
|
+
/** Calls `close()` on the native dialog element and unlocks page scroll when
|
|
78
|
+
* the close released the resources `ShowDialog` installed. A close that runs
|
|
79
|
+
* before the show has installed them leaves the lock alone. When the show
|
|
80
|
+
* then fails, it releases the lock itself. When the show succeeds, update
|
|
81
|
+
* closes the dialog again. If the dialog element is gone by the time the
|
|
82
|
+
* close runs, the Command calls `Dom.releaseDialogResources` instead. That
|
|
83
|
+
* releases the scroll lock, focus trap, return focus, and stack entry if the
|
|
84
|
+
* dialog still holds them. */
|
|
72
85
|
export const CloseDialog = Command.define('CloseDialog', {
|
|
73
86
|
args: { id: S.String },
|
|
74
87
|
messages: [Message.CompletedCloseDialog],
|
|
75
|
-
execute: ({ id }) => __foldkitBrandViewResult((Dom.closeDialog(dialogSelector(id)).pipe(Effect.andThen(
|
|
88
|
+
execute: ({ id }) => __foldkitBrandViewResult((Dom.closeDialog(dialogSelector(id)).pipe(Effect.andThen(isReleased => __foldkitBrandViewResult((isReleased ? Dom.unlockScroll : Effect.void), "@foldkit/ui/dialog/index.js#anonymous~4")), Effect.catch(() => __foldkitBrandViewResult((Dom.releaseDialogResources(id)), "@foldkit/ui/dialog/index.js#anonymous~5")), Effect.as(Message.CompletedCloseDialog()))), "@foldkit/ui/dialog/index.js#execute~2"),
|
|
76
89
|
});
|
|
77
90
|
/** Releases the framework hygiene the dialog holds while open (scroll lock,
|
|
78
91
|
* focus trap, return focus, stack entry) when the element unmounts without a
|
|
@@ -83,21 +96,28 @@ export const ReleaseDialogResources = Command.define('ReleaseDialogResources', {
|
|
|
83
96
|
messages: [Message.CompletedReleaseDialogResources],
|
|
84
97
|
execute: ({ id }) => __foldkitBrandViewResult((Dom.releaseDialogResources(id).pipe(Effect.ignore, Effect.as(Message.CompletedReleaseDialogResources()))), "@foldkit/ui/dialog/index.js#execute~3"),
|
|
85
98
|
});
|
|
99
|
+
const isLeaving = (model) => __foldkitBrandViewResult((model.animation.transitionState === 'LeaveStart' ||
|
|
100
|
+
model.animation.transitionState === 'LeaveAnimating'), "@foldkit/ui/dialog/index.js#isLeaving");
|
|
101
|
+
const isOpenOrAnimating = (model) => __foldkitBrandViewResult((model.isOpen || model.animation.transitionState !== 'Idle'), "@foldkit/ui/dialog/index.js#isOpenOrAnimating");
|
|
102
|
+
const resetToClosed = (model) => __foldkitBrandViewResult((evo(model, {
|
|
103
|
+
isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen"),
|
|
104
|
+
animation: () => __foldkitBrandViewResult((animationInit({ id: `${model.id}-panel` })), "@foldkit/ui/dialog/index.js#animation"),
|
|
105
|
+
})), "@foldkit/ui/dialog/index.js#resetToClosed");
|
|
86
106
|
const wrapAnimationMessage = (message) => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/dialog/index.js#wrapAnimationMessage");
|
|
87
107
|
const foldAnimationOutMessage = (outMessage, { liftCommand }) => __foldkitBrandViewResult((AnimationOutMessage.match(outMessage, {
|
|
88
108
|
StartedLeaveAnimating: () => __foldkitBrandViewResult((model => (__foldkitBrandViewResult(({
|
|
89
109
|
model,
|
|
90
110
|
commands: [liftCommand(animationDefaultLeaveCommand(model.animation))],
|
|
91
|
-
}), "@foldkit/ui/dialog/index.js#anonymous~
|
|
111
|
+
}), "@foldkit/ui/dialog/index.js#anonymous~6"))), "@foldkit/ui/dialog/index.js#StartedLeaveAnimating"),
|
|
92
112
|
TransitionedOut: () => __foldkitBrandViewResult((model => (__foldkitBrandViewResult(({
|
|
93
113
|
model,
|
|
94
114
|
commands: [CloseDialog({ id: model.id })],
|
|
95
|
-
}), "@foldkit/ui/dialog/index.js#anonymous~
|
|
115
|
+
}), "@foldkit/ui/dialog/index.js#anonymous~7"))), "@foldkit/ui/dialog/index.js#TransitionedOut"),
|
|
96
116
|
})), "@foldkit/ui/dialog/index.js#foldAnimationOutMessage");
|
|
97
117
|
const foldAnimation = Update.foldChild({
|
|
98
118
|
update: animationUpdate,
|
|
99
119
|
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/dialog/index.js#read"),
|
|
100
|
-
write: (model, nextAnimation) => __foldkitBrandViewResult((evo(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/dialog/index.js#animation") })), "@foldkit/ui/dialog/index.js#write"),
|
|
120
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((evo(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/dialog/index.js#animation~2") })), "@foldkit/ui/dialog/index.js#write"),
|
|
101
121
|
toParentMessage: wrapAnimationMessage,
|
|
102
122
|
foldOutMessage: foldAnimationOutMessage,
|
|
103
123
|
});
|
|
@@ -107,44 +127,42 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
107
127
|
const wasClosed = !model.isOpen;
|
|
108
128
|
const maybeShow = Option.liftPredicate(ShowDialog({
|
|
109
129
|
id: model.id,
|
|
110
|
-
focusSelector: Option.getOrElse(model.maybeFocusSelector, () => __foldkitBrandViewResult((initialFocusMarkerSelector), "@foldkit/ui/dialog/index.js#anonymous~
|
|
111
|
-
}), () => __foldkitBrandViewResult((wasClosed), "@foldkit/ui/dialog/index.js#anonymous~
|
|
130
|
+
focusSelector: Option.getOrElse(model.maybeFocusSelector, () => __foldkitBrandViewResult((initialFocusMarkerSelector), "@foldkit/ui/dialog/index.js#anonymous~8")),
|
|
131
|
+
}), () => __foldkitBrandViewResult((wasClosed), "@foldkit/ui/dialog/index.js#anonymous~9"));
|
|
112
132
|
const commands = Option.toArray(maybeShow);
|
|
113
133
|
const dialogOpen = model.isAnimated
|
|
114
134
|
? Update.combine(model, [
|
|
115
|
-
stepModel => (__foldkitBrandViewResult(({ model: stepModel, commands }), "@foldkit/ui/dialog/index.js#anonymous~
|
|
135
|
+
stepModel => (__foldkitBrandViewResult(({ model: stepModel, commands }), "@foldkit/ui/dialog/index.js#anonymous~10")),
|
|
116
136
|
foldAnimation(AnimationMessage.Showed()),
|
|
117
137
|
stepModel => (__foldkitBrandViewResult(({
|
|
118
|
-
model: evo(stepModel, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/dialog/index.js#isOpen") }),
|
|
119
|
-
}), "@foldkit/ui/dialog/index.js#anonymous~
|
|
138
|
+
model: evo(stepModel, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/dialog/index.js#isOpen~2") }),
|
|
139
|
+
}), "@foldkit/ui/dialog/index.js#anonymous~11")),
|
|
120
140
|
])
|
|
121
|
-
: { model: evo(model, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/dialog/index.js#isOpen~
|
|
141
|
+
: { model: evo(model, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/dialog/index.js#isOpen~3") }), commands };
|
|
122
142
|
return __foldkitBrandViewResult((wasClosed
|
|
123
143
|
? pipe(dialogOpen, Update.withOutMessage(OutMessage.Opened()))
|
|
124
144
|
: dialogOpen), "@foldkit/ui/dialog/index.js#RequestedOpen");
|
|
125
145
|
},
|
|
126
146
|
RequestedClose: () => {
|
|
127
|
-
|
|
128
|
-
const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating';
|
|
129
|
-
if (isLeaving) {
|
|
147
|
+
if (isLeaving(model)) {
|
|
130
148
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#RequestedClose");
|
|
131
149
|
}
|
|
132
150
|
const wasOpen = model.isOpen;
|
|
133
151
|
if (model.isAnimated) {
|
|
134
152
|
const dialogClose = Update.combine(model, [
|
|
135
153
|
stepModel => (__foldkitBrandViewResult(({
|
|
136
|
-
model: evo(stepModel, { isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen~
|
|
137
|
-
}), "@foldkit/ui/dialog/index.js#anonymous~
|
|
154
|
+
model: evo(stepModel, { isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen~4") }),
|
|
155
|
+
}), "@foldkit/ui/dialog/index.js#anonymous~12")),
|
|
138
156
|
foldAnimation(AnimationMessage.Hid()),
|
|
139
157
|
]);
|
|
140
158
|
return __foldkitBrandViewResult((wasOpen
|
|
141
159
|
? pipe(dialogClose, Update.withOutMessage(OutMessage.Closed()))
|
|
142
160
|
: dialogClose), "@foldkit/ui/dialog/index.js#RequestedClose");
|
|
143
161
|
}
|
|
144
|
-
const maybeClose = Option.liftPredicate(CloseDialog({ id: model.id }), () => __foldkitBrandViewResult((wasOpen), "@foldkit/ui/dialog/index.js#anonymous~
|
|
162
|
+
const maybeClose = Option.liftPredicate(CloseDialog({ id: model.id }), () => __foldkitBrandViewResult((wasOpen), "@foldkit/ui/dialog/index.js#anonymous~13"));
|
|
145
163
|
const commands = Option.toArray(maybeClose);
|
|
146
164
|
const dialogClose = {
|
|
147
|
-
model: evo(model, { isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen~
|
|
165
|
+
model: evo(model, { isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen~5") }),
|
|
148
166
|
commands,
|
|
149
167
|
};
|
|
150
168
|
return __foldkitBrandViewResult((wasOpen
|
|
@@ -153,14 +171,9 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
153
171
|
},
|
|
154
172
|
GotAnimationMessage: ({ message: animationMessage }) => __foldkitBrandViewResult((foldAnimation(model, animationMessage)), "@foldkit/ui/dialog/index.js#GotAnimationMessage"),
|
|
155
173
|
Unmounted: () => {
|
|
156
|
-
|
|
157
|
-
if (isHoldingResources) {
|
|
158
|
-
const nextModel = evo(model, {
|
|
159
|
-
isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/dialog/index.js#isOpen~5"),
|
|
160
|
-
animation: () => __foldkitBrandViewResult((animationInit({ id: `${model.id}-panel` })), "@foldkit/ui/dialog/index.js#animation~2"),
|
|
161
|
-
});
|
|
174
|
+
if (isOpenOrAnimating(model)) {
|
|
162
175
|
return __foldkitBrandViewResult(({
|
|
163
|
-
model:
|
|
176
|
+
model: resetToClosed(model),
|
|
164
177
|
commands: [ReleaseDialogResources({ id: model.id })],
|
|
165
178
|
}), "@foldkit/ui/dialog/index.js#Unmounted");
|
|
166
179
|
}
|
|
@@ -168,7 +181,22 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
168
181
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#Unmounted");
|
|
169
182
|
}
|
|
170
183
|
},
|
|
171
|
-
|
|
184
|
+
SucceededShowDialog: () => {
|
|
185
|
+
if (model.isOpen || isLeaving(model)) {
|
|
186
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#SucceededShowDialog");
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
return __foldkitBrandViewResult(({ model, commands: [CloseDialog({ id: model.id })] }), "@foldkit/ui/dialog/index.js#SucceededShowDialog");
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
FailedShowDialog: () => {
|
|
193
|
+
if (isOpenOrAnimating(model)) {
|
|
194
|
+
return __foldkitBrandViewResult(({ model: resetToClosed(model) }), "@foldkit/ui/dialog/index.js#FailedShowDialog");
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#FailedShowDialog");
|
|
198
|
+
}
|
|
199
|
+
},
|
|
172
200
|
CompletedCloseDialog: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#CompletedCloseDialog")),
|
|
173
201
|
CompletedReleaseDialogResources: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/dialog/index.js#CompletedReleaseDialogResources")),
|
|
174
202
|
})), "@foldkit/ui/dialog/index.js#update");
|
|
@@ -202,23 +230,22 @@ export const descriptionId = (model) => __foldkitBrandViewResult((`${model.id}-d
|
|
|
202
230
|
export const view = defineView((model, viewInputs, h) => {
|
|
203
231
|
const { id, isOpen, animation: { transitionState }, } = model;
|
|
204
232
|
const { toView } = viewInputs;
|
|
205
|
-
const
|
|
206
|
-
const isVisible = isOpen || isLeaving;
|
|
233
|
+
const isVisible = isOpen || isLeaving(model);
|
|
207
234
|
const animationAttributes = M.value(transitionState).pipe(M.when('EnterStart', () => __foldkitBrandViewResult(([
|
|
208
235
|
h.DataAttribute('closed', ''),
|
|
209
236
|
h.DataAttribute('enter', ''),
|
|
210
237
|
h.DataAttribute('transition', ''),
|
|
211
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~
|
|
238
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~15")), M.when('EnterAnimating', () => __foldkitBrandViewResult(([
|
|
212
239
|
h.DataAttribute('enter', ''),
|
|
213
240
|
h.DataAttribute('transition', ''),
|
|
214
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~
|
|
241
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~16")), M.when('LeaveStart', () => __foldkitBrandViewResult(([
|
|
215
242
|
h.DataAttribute('leave', ''),
|
|
216
243
|
h.DataAttribute('transition', ''),
|
|
217
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~
|
|
244
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~17")), M.when('LeaveAnimating', () => __foldkitBrandViewResult(([
|
|
218
245
|
h.DataAttribute('closed', ''),
|
|
219
246
|
h.DataAttribute('leave', ''),
|
|
220
247
|
h.DataAttribute('transition', ''),
|
|
221
|
-
]), "@foldkit/ui/dialog/index.js#anonymous~
|
|
248
|
+
]), "@foldkit/ui/dialog/index.js#anonymous~18")), M.orElse(() => __foldkitBrandViewResult(([]), "@foldkit/ui/dialog/index.js#anonymous~19")));
|
|
222
249
|
const dialogAttributes = [
|
|
223
250
|
h.Id(id),
|
|
224
251
|
h.AriaLabelledBy(titleId(model)),
|
|
@@ -244,7 +271,7 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
244
271
|
const backdropAttributes = [
|
|
245
272
|
h.Style({ minHeight: '100vh' }),
|
|
246
273
|
...animationAttributes,
|
|
247
|
-
...(isLeaving ? [] : [h.OnClick(Message.RequestedClose())]),
|
|
274
|
+
...(isLeaving(model) ? [] : [h.OnClick(Message.RequestedClose())]),
|
|
248
275
|
];
|
|
249
276
|
const panelAttributes = [h.Id(`${id}-panel`), ...animationAttributes];
|
|
250
277
|
const titleAttributes = [h.Id(titleId(model))];
|
|
@@ -254,7 +281,7 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
254
281
|
];
|
|
255
282
|
const closeButtonAttributes = [
|
|
256
283
|
h.Type('button'),
|
|
257
|
-
...(isLeaving ? [] : [h.OnClick(Message.RequestedClose())]),
|
|
284
|
+
...(isLeaving(model) ? [] : [h.OnClick(Message.RequestedClose())]),
|
|
258
285
|
];
|
|
259
286
|
return __foldkitBrandViewResult((toView({
|
|
260
287
|
dialog: childAttributes(dialogAttributes),
|
|
@@ -265,5 +292,5 @@ export const view = defineView((model, viewInputs, h) => {
|
|
|
265
292
|
initialFocus: childAttributes(initialFocusAttributes),
|
|
266
293
|
closeButton: childAttributes(closeButtonAttributes),
|
|
267
294
|
isVisible,
|
|
268
|
-
})), "@foldkit/ui/dialog/index.js#anonymous~
|
|
295
|
+
})), "@foldkit/ui/dialog/index.js#anonymous~14");
|
|
269
296
|
});
|
package/dist/dialog/public.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { init, update, open, close, view, titleId, descriptionId, Model, Message, OutMessage, type Opened, type Closed, type RequestedOpen, type RequestedClose, type
|
|
1
|
+
export { init, update, open, close, view, titleId, descriptionId, Model, Message, OutMessage, type Opened, type Closed, type RequestedOpen, type RequestedClose, type SucceededShowDialog, type FailedShowDialog, type CompletedCloseDialog, type Unmounted, type CompletedReleaseDialogResources, ShowDialog, CloseDialog, ReleaseDialogResources, } from './index.js';
|
|
2
2
|
export type { InitConfig, ViewInputs, RenderInfo } from './index.js';
|
|
3
3
|
//# sourceMappingURL=public.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,UAAU,EACV,WAAW,EACX,sBAAsB,GACvB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/dialog/public.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,aAAa,EACb,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,+BAA+B,EACpC,UAAU,EACV,WAAW,EACX,sBAAsB,GACvB,MAAM,YAAY,CAAA;AAEnB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disclosure/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAIhE;;;mCAGmC;AACnC,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/disclosure/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAIhE;;;mCAGmC;AACnC,eAAO,MAAM,QAAQ,OAAQ,MAAM,KAAG,MAAwB,CAAA;AAM9D;;;;;;;;;sEASsE;AACtE,MAAM,MAAM,oBAAoB,CAAC,OAAO,IAAI,QAAQ,CAAC;IACnD,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACzC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC;;;;;kFAK8E;IAC9E,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAA;CACtC,CAAC,CAAA;AAEF;;;;;;;;;;oBAUoB;AACpB,MAAM,MAAM,UAAU,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAA;IACtC,MAAM,EAAE,CAAC,UAAU,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;UAsBU;AACV,eAAO,MAAM,IAAI,GAAI,OAAO,UAClB,UAAU,CAAC,OAAO,CAAC,KACxB,WAAW,CAAC,OAAO,CAAC,KACtB,IAiFF,CAAA"}
|