@foldkit/ui 0.161.0 → 0.162.0-canary.591649ea58a6
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/animation/update.d.ts.map +1 -1
- package/dist/animation/update.js +11 -7
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +27 -19
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/combobox/multi.js +2 -2
- package/dist/combobox/shared.js +15 -15
- package/dist/combobox/single.js +4 -4
- package/dist/datePicker/index.d.ts.map +1 -1
- package/dist/datePicker/index.js +10 -10
- package/dist/dialog/index.js +9 -9
- package/dist/disclosure/index.d.ts +1 -1
- package/dist/disclosure/index.js +1 -1
- package/dist/dragAndDrop/index.js +11 -11
- package/dist/fileDrop/index.d.ts.map +1 -1
- package/dist/fileDrop/index.js +7 -5
- package/dist/hoverIntent/hoverIntent.d.ts.map +1 -1
- package/dist/hoverIntent/hoverIntent.js +16 -16
- package/dist/listbox/shared.d.ts.map +1 -1
- package/dist/listbox/shared.js +20 -18
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +23 -17
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.js +12 -10
- package/dist/radioGroup/index.d.ts.map +1 -1
- package/dist/radioGroup/index.js +5 -3
- package/dist/slider/index.js +6 -6
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.js +5 -3
- package/dist/test/apps/disabledButton.d.ts.map +1 -1
- package/dist/test/apps/disabledButton.js +3 -3
- package/dist/toast/update.js +7 -7
- package/dist/tooltip/tooltip.d.ts.map +1 -1
- package/dist/tooltip/tooltip.js +14 -12
- package/dist/virtualList/index.d.ts.map +1 -1
- package/dist/virtualList/index.js +8 -6
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAM1C,OAAO,EACL,KAAK,GAAG,EACR,OAAO,EACP,KAAK,KAAK,EACV,UAAU,EACV,KAAK,MAAM,EACZ,MAAM,aAAa,CAAA;AAMpB,KAAK,YAAY,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;AAG3E,gFAAgF;AAChF,eAAO,MAAM,YAAY;;iBAGvB,CAAA;AACF,sHAAsH;AACtH,eAAO,MAAM,uBAAuB;;;;iBAUnC,CAAA;AAED;;;qBAGqB;AACrB,wBAAgB,MAAM,CACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,GAAG,GAAG,GACpB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAChC,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/animation/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAM1C,OAAO,EACL,KAAK,GAAG,EACR,OAAO,EACP,KAAK,KAAK,EACV,UAAU,EACV,KAAK,MAAM,EACZ,MAAM,aAAa,CAAA;AAMpB,KAAK,YAAY,GAAG,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;AAG3E,gFAAgF;AAChF,eAAO,MAAM,YAAY;;iBAGvB,CAAA;AACF,sHAAsH;AACtH,eAAO,MAAM,uBAAuB;;;;iBAUnC,CAAA;AAED;;;qBAGqB;AACrB,wBAAgB,MAAM,CACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,GAAG,GAAG,GACpB,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAChC,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,CAAA;AAsEpE,mDAAmD;AACnD,eAAO,MAAM,IAAI,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAC/B,CAAA;AAEjC,mDAAmD;AACnD,eAAO,MAAM,IAAI,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAClC,CAAA;AAE9B,iEAAiE;AACjE,eAAO,MAAM,MAAM,UAAW,KAAK,KAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAMjE,CAAA;AAED,2NAA2N;AAC3N,eAAO,MAAM,mBAAmB,UAAW,KAAK,KAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAC/B,CAAA"}
|
package/dist/animation/update.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Effect, Match, Schema } from 'effect';
|
|
|
3
3
|
import * as Command from 'foldkit/command';
|
|
4
4
|
import * as Dom from 'foldkit/dom';
|
|
5
5
|
import * as Render from 'foldkit/render';
|
|
6
|
-
import {
|
|
6
|
+
import { modifyFields } from 'foldkit/struct';
|
|
7
7
|
import { idSelector } from '../internal/selectors.js';
|
|
8
8
|
import { Message, OutMessage, } from './schema.js';
|
|
9
9
|
// UPDATE
|
|
@@ -28,7 +28,7 @@ export function update(model, message) {
|
|
|
28
28
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#Showed");
|
|
29
29
|
}
|
|
30
30
|
return __foldkitBrandViewResult(({
|
|
31
|
-
model:
|
|
31
|
+
model: modifyFields(model, {
|
|
32
32
|
isShowing: () => __foldkitBrandViewResult((true), "@foldkit/ui/animation/update.js#isShowing"),
|
|
33
33
|
transitionState: () => __foldkitBrandViewResult(('EnterStart'), "@foldkit/ui/animation/update.js#transitionState"),
|
|
34
34
|
}),
|
|
@@ -42,7 +42,7 @@ export function update(model, message) {
|
|
|
42
42
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#Hid");
|
|
43
43
|
}
|
|
44
44
|
return __foldkitBrandViewResult(({
|
|
45
|
-
model:
|
|
45
|
+
model: modifyFields(model, {
|
|
46
46
|
isShowing: () => __foldkitBrandViewResult((false), "@foldkit/ui/animation/update.js#isShowing~2"),
|
|
47
47
|
transitionState: () => __foldkitBrandViewResult(('LeaveStart'), "@foldkit/ui/animation/update.js#transitionState~2"),
|
|
48
48
|
}),
|
|
@@ -50,16 +50,20 @@ export function update(model, message) {
|
|
|
50
50
|
}), "@foldkit/ui/animation/update.js#Hid");
|
|
51
51
|
},
|
|
52
52
|
CompletedWaitForPaint: () => __foldkitBrandViewResult((Match.value(model.transitionState).pipe(withUpdateReturn, Match.when('EnterStart', () => (__foldkitBrandViewResult(({
|
|
53
|
-
model:
|
|
53
|
+
model: modifyFields(model, {
|
|
54
|
+
transitionState: () => __foldkitBrandViewResult(('EnterAnimating'), "@foldkit/ui/animation/update.js#transitionState~3"),
|
|
55
|
+
}),
|
|
54
56
|
commands: [WaitForAnimationSettled({ id: model.id })],
|
|
55
57
|
}), "@foldkit/ui/animation/update.js#anonymous"))), Match.when('LeaveStart', () => (__foldkitBrandViewResult(({
|
|
56
|
-
model:
|
|
58
|
+
model: modifyFields(model, {
|
|
59
|
+
transitionState: () => __foldkitBrandViewResult(('LeaveAnimating'), "@foldkit/ui/animation/update.js#transitionState~4"),
|
|
60
|
+
}),
|
|
57
61
|
outMessage: OutMessage.StartedLeaveAnimating(),
|
|
58
62
|
}), "@foldkit/ui/animation/update.js#anonymous~2"))), Match.orElse(() => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#anonymous~3"))))), "@foldkit/ui/animation/update.js#CompletedWaitForPaint"),
|
|
59
63
|
EndedAnimation: () => __foldkitBrandViewResult((Match.value(model.transitionState).pipe(withUpdateReturn, Match.when('EnterAnimating', () => (__foldkitBrandViewResult(({
|
|
60
|
-
model:
|
|
64
|
+
model: modifyFields(model, { transitionState: () => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/animation/update.js#transitionState~5") }),
|
|
61
65
|
}), "@foldkit/ui/animation/update.js#anonymous~4"))), Match.when('LeaveAnimating', () => (__foldkitBrandViewResult(({
|
|
62
|
-
model:
|
|
66
|
+
model: modifyFields(model, { transitionState: () => __foldkitBrandViewResult(('Idle'), "@foldkit/ui/animation/update.js#transitionState~6") }),
|
|
63
67
|
outMessage: OutMessage.TransitionedOut(),
|
|
64
68
|
}), "@foldkit/ui/animation/update.js#anonymous~5"))), Match.orElse(() => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/animation/update.js#anonymous~6"))))), "@foldkit/ui/animation/update.js#EndedAnimation"),
|
|
65
69
|
})), "@foldkit/ui/animation/update.js#update");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EAIN,MAAM,EACN,MAAM,EAEP,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,IAAI,EAGV,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAOxC;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AI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWhB,CAAA"}
|
package/dist/calendar/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as Command from 'foldkit/command';
|
|
|
5
5
|
import * as Dom from 'foldkit/dom';
|
|
6
6
|
import { childAttributes, } from 'foldkit/html';
|
|
7
7
|
import { defineMessageUnion } from 'foldkit/message';
|
|
8
|
-
import {
|
|
8
|
+
import { modifyFields } from 'foldkit/struct';
|
|
9
9
|
import { defineView } from 'foldkit/submodel';
|
|
10
10
|
import * as Update from 'foldkit/update';
|
|
11
11
|
import * as OptionExt from '../internal/optionExtensions.js';
|
|
@@ -104,7 +104,7 @@ export const selectDate = (model, date) => __foldkitBrandViewResult((update(mode
|
|
|
104
104
|
* example when opening a date picker onto its current value so the selected
|
|
105
105
|
* month is visible. Returns the model directly because it produces no
|
|
106
106
|
* commands and no OutMessage. */
|
|
107
|
-
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((
|
|
107
|
+
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((modifyFields(model, {
|
|
108
108
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(date)), "@foldkit/ui/calendar/index.js#maybeFocusedDate"),
|
|
109
109
|
viewYear: () => __foldkitBrandViewResult((date.year), "@foldkit/ui/calendar/index.js#viewYear"),
|
|
110
110
|
viewMonth: () => __foldkitBrandViewResult((date.month), "@foldkit/ui/calendar/index.js#viewMonth"),
|
|
@@ -117,17 +117,17 @@ export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewRes
|
|
|
117
117
|
* Does NOT reconcile the current selection. If a previously-selected date
|
|
118
118
|
* is now below the new minimum, it remains selected. Callers should clear or
|
|
119
119
|
* reassign the selection explicitly if their domain requires it. */
|
|
120
|
-
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((
|
|
120
|
+
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((modifyFields(model, { maybeMinDate: () => __foldkitBrandViewResult((maybeMinDate), "@foldkit/ui/calendar/index.js#maybeMinDate") })), "@foldkit/ui/calendar/index.js#anonymous~2"));
|
|
121
121
|
/** Reflects the maximum selectable date onto the model. Pass `Option.none()`
|
|
122
122
|
* to remove the maximum. Does NOT reconcile the current selection. */
|
|
123
|
-
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((
|
|
123
|
+
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((modifyFields(model, { maybeMaxDate: () => __foldkitBrandViewResult((maybeMaxDate), "@foldkit/ui/calendar/index.js#maybeMaxDate") })), "@foldkit/ui/calendar/index.js#anonymous~3"));
|
|
124
124
|
/** Reflects the list of individually-disabled dates onto the model. Pass an
|
|
125
125
|
* empty array to clear. Does NOT reconcile the current selection. */
|
|
126
|
-
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((
|
|
126
|
+
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((modifyFields(model, { disabledDates: () => __foldkitBrandViewResult((disabledDates), "@foldkit/ui/calendar/index.js#disabledDates") })), "@foldkit/ui/calendar/index.js#anonymous~4"));
|
|
127
127
|
/** Reflects the days of the week that are disabled (e.g. weekends) onto the
|
|
128
128
|
* model. Pass an empty array to clear. Does NOT reconcile the current
|
|
129
129
|
* selection. */
|
|
130
|
-
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((
|
|
130
|
+
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((modifyFields(model, { disabledDaysOfWeek: () => __foldkitBrandViewResult((disabledDaysOfWeek), "@foldkit/ui/calendar/index.js#disabledDaysOfWeek") })), "@foldkit/ui/calendar/index.js#anonymous~5"));
|
|
131
131
|
/** Returns the calendar to Days mode regardless of current depth. Useful for
|
|
132
132
|
* standalone (non-popovered) consumers that want to wire their own back-out
|
|
133
133
|
* gesture. Popovered consumers like `DatePicker` don't need this. Escape
|
|
@@ -143,7 +143,7 @@ export const dropToDays = (model) => {
|
|
|
143
143
|
onNone: () => __foldkitBrandViewResult((1), "@foldkit/ui/calendar/index.js#onNone"),
|
|
144
144
|
onSome: date => __foldkitBrandViewResult((Math.min(date.day, Calendar.daysInMonth(model.viewYear, model.viewMonth))), "@foldkit/ui/calendar/index.js#onSome"),
|
|
145
145
|
});
|
|
146
|
-
return __foldkitBrandViewResult((
|
|
146
|
+
return __foldkitBrandViewResult((modifyFields(model, {
|
|
147
147
|
viewMode: () => __foldkitBrandViewResult(('Days'), "@foldkit/ui/calendar/index.js#viewMode"),
|
|
148
148
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(Calendar.make(model.viewYear, model.viewMonth, focusedDay))), "@foldkit/ui/calendar/index.js#maybeFocusedDate~2"),
|
|
149
149
|
})), "@foldkit/ui/calendar/index.js#dropToDays");
|
|
@@ -214,7 +214,7 @@ const currentOrFallbackFocus = (model) => __foldkitBrandViewResult((Option.getOr
|
|
|
214
214
|
* the parent infers month transitions from the date itself rather than from
|
|
215
215
|
* a separate `ChangedViewMonth` signal that would race with the selection. */
|
|
216
216
|
const commitSelection = (model, date) => (__foldkitBrandViewResult(({
|
|
217
|
-
model:
|
|
217
|
+
model: modifyFields(model, {
|
|
218
218
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(date)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~3"),
|
|
219
219
|
viewYear: () => __foldkitBrandViewResult((date.year), "@foldkit/ui/calendar/index.js#viewYear~2"),
|
|
220
220
|
viewMonth: () => __foldkitBrandViewResult((date.month), "@foldkit/ui/calendar/index.js#viewMonth~2"),
|
|
@@ -228,7 +228,7 @@ const applyFocusMove = (model, candidate, direction, cap) => {
|
|
|
228
228
|
const clamped = clampToRange(model, candidate);
|
|
229
229
|
const nextFocus = skipDisabled(model, clamped, direction, cap);
|
|
230
230
|
const crossedMonth = nextFocus.year !== model.viewYear || nextFocus.month !== model.viewMonth;
|
|
231
|
-
const nextModel =
|
|
231
|
+
const nextModel = modifyFields(model, {
|
|
232
232
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~4"),
|
|
233
233
|
viewYear: () => __foldkitBrandViewResult((nextFocus.year), "@foldkit/ui/calendar/index.js#viewYear~3"),
|
|
234
234
|
viewMonth: () => __foldkitBrandViewResult((nextFocus.month), "@foldkit/ui/calendar/index.js#viewMonth~3"),
|
|
@@ -265,7 +265,7 @@ const applyViewMonthChange = (model, year, month, direction) => {
|
|
|
265
265
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#applyViewMonthChange");
|
|
266
266
|
}
|
|
267
267
|
const nextFocus = moveFocusForViewChange(model, year, month, direction);
|
|
268
|
-
const nextModel =
|
|
268
|
+
const nextModel = modifyFields(model, {
|
|
269
269
|
viewYear: () => __foldkitBrandViewResult((year), "@foldkit/ui/calendar/index.js#viewYear~4"),
|
|
270
270
|
viewMonth: () => __foldkitBrandViewResult((month), "@foldkit/ui/calendar/index.js#viewMonth~4"),
|
|
271
271
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~5"),
|
|
@@ -298,7 +298,7 @@ const applyMonthsFocusShift = (model, monthShift) => {
|
|
|
298
298
|
const focused = currentOrFallbackFocus(model);
|
|
299
299
|
const nextFocus = Calendar.addMonths(focused, monthShift);
|
|
300
300
|
return __foldkitBrandViewResult(({
|
|
301
|
-
model:
|
|
301
|
+
model: modifyFields(model, {
|
|
302
302
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~6"),
|
|
303
303
|
viewYear: () => __foldkitBrandViewResult((nextFocus.year), "@foldkit/ui/calendar/index.js#viewYear~5"),
|
|
304
304
|
}),
|
|
@@ -312,7 +312,7 @@ const applyYearsFocusShift = (model, yearShift) => {
|
|
|
312
312
|
const focused = currentOrFallbackFocus(model);
|
|
313
313
|
const nextFocus = Calendar.addYears(focused, yearShift);
|
|
314
314
|
return __foldkitBrandViewResult(({
|
|
315
|
-
model:
|
|
315
|
+
model: modifyFields(model, {
|
|
316
316
|
maybeFocusedDate: () => __foldkitBrandViewResult((Option.some(nextFocus)), "@foldkit/ui/calendar/index.js#maybeFocusedDate~7"),
|
|
317
317
|
}),
|
|
318
318
|
}), "@foldkit/ui/calendar/index.js#applyYearsFocusShift");
|
|
@@ -360,10 +360,10 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
360
360
|
return __foldkitBrandViewResult((applyViewMonthChange(model, next.year, next.month, 1)), "@foldkit/ui/calendar/index.js#ClickedNextMonthButton");
|
|
361
361
|
},
|
|
362
362
|
ClickedHeading: () => __foldkitBrandViewResult((Match.value(model.viewMode).pipe(withUpdateReturn, Match.when('Days', () => (__foldkitBrandViewResult(({
|
|
363
|
-
model:
|
|
363
|
+
model: modifyFields(model, { viewMode: () => __foldkitBrandViewResult(('Months'), "@foldkit/ui/calendar/index.js#viewMode~2") }),
|
|
364
364
|
commands: [FocusGrid({ id: model.id })],
|
|
365
365
|
}), "@foldkit/ui/calendar/index.js#anonymous~35"))), Match.when('Months', () => (__foldkitBrandViewResult(({
|
|
366
|
-
model:
|
|
366
|
+
model: modifyFields(model, { viewMode: () => __foldkitBrandViewResult(('Years'), "@foldkit/ui/calendar/index.js#viewMode~3") }),
|
|
367
367
|
commands: [FocusGrid({ id: model.id })],
|
|
368
368
|
}), "@foldkit/ui/calendar/index.js#anonymous~36"))), Match.when('Years', () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#anonymous~37"))), Match.exhaustive)), "@foldkit/ui/calendar/index.js#ClickedHeading"),
|
|
369
369
|
SelectedMonth: ({ month }) => {
|
|
@@ -373,7 +373,9 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
373
373
|
else {
|
|
374
374
|
const viewMonthChange = applyViewMonthChange(model, model.viewYear, month, jumpDirection(model, model.viewYear, month));
|
|
375
375
|
const monthSelection = {
|
|
376
|
-
model:
|
|
376
|
+
model: modifyFields(viewMonthChange.model, {
|
|
377
|
+
viewMode: () => __foldkitBrandViewResult(('Days'), "@foldkit/ui/calendar/index.js#viewMode~4"),
|
|
378
|
+
}),
|
|
377
379
|
commands: [FocusGrid({ id: model.id })],
|
|
378
380
|
};
|
|
379
381
|
return __foldkitBrandViewResult((pipe(monthSelection, Update.withOutMessage(viewMonthChange.outMessage))), "@foldkit/ui/calendar/index.js#SelectedMonth");
|
|
@@ -386,17 +388,23 @@ export const update = (model, message) => __foldkitBrandViewResult((Message.matc
|
|
|
386
388
|
else {
|
|
387
389
|
const yearViewMonthChange = applyViewMonthChange(model, year, model.viewMonth, jumpDirection(model, year, model.viewMonth));
|
|
388
390
|
const yearSelection = {
|
|
389
|
-
model:
|
|
391
|
+
model: modifyFields(yearViewMonthChange.model, {
|
|
392
|
+
viewMode: () => __foldkitBrandViewResult(('Months'), "@foldkit/ui/calendar/index.js#viewMode~5"),
|
|
393
|
+
}),
|
|
390
394
|
commands: [FocusGrid({ id: model.id })],
|
|
391
395
|
};
|
|
392
396
|
return __foldkitBrandViewResult((pipe(yearSelection, Update.withOutMessage(yearViewMonthChange.outMessage))), "@foldkit/ui/calendar/index.js#SelectedYear");
|
|
393
397
|
}
|
|
394
398
|
},
|
|
395
399
|
PagedYears: ({ direction }) => __foldkitBrandViewResult((applyYearsFocusShift(model, direction * YEARS_PAGE_SIZE)), "@foldkit/ui/calendar/index.js#PagedYears"),
|
|
396
|
-
FocusedGrid: () => (__foldkitBrandViewResult(({
|
|
397
|
-
|
|
400
|
+
FocusedGrid: () => (__foldkitBrandViewResult(({
|
|
401
|
+
model: modifyFields(model, { isGridFocused: () => __foldkitBrandViewResult((true), "@foldkit/ui/calendar/index.js#isGridFocused") }),
|
|
402
|
+
}), "@foldkit/ui/calendar/index.js#FocusedGrid")),
|
|
403
|
+
BlurredGrid: () => (__foldkitBrandViewResult(({
|
|
404
|
+
model: modifyFields(model, { isGridFocused: () => __foldkitBrandViewResult((false), "@foldkit/ui/calendar/index.js#isGridFocused~2") }),
|
|
405
|
+
}), "@foldkit/ui/calendar/index.js#BlurredGrid")),
|
|
398
406
|
RefreshedToday: ({ today }) => (__foldkitBrandViewResult(({
|
|
399
|
-
model:
|
|
407
|
+
model: modifyFields(model, { today: () => __foldkitBrandViewResult((today), "@foldkit/ui/calendar/index.js#today") }),
|
|
400
408
|
}), "@foldkit/ui/calendar/index.js#RefreshedToday")),
|
|
401
409
|
CompletedFocusGrid: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/calendar/index.js#CompletedFocusGrid")),
|
|
402
410
|
})), "@foldkit/ui/calendar/index.js#update");
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export declare const descriptionId: (id: string) => string;
|
|
|
77
77
|
*
|
|
78
78
|
* // In update:
|
|
79
79
|
* ToggledTerms: ({ isChecked }) => ({
|
|
80
|
-
* model:
|
|
80
|
+
* model: modifyFields(model, { acceptedTerms: () => isChecked }),
|
|
81
81
|
* }),
|
|
82
82
|
* ``` */
|
|
83
83
|
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
package/dist/checkbox/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export const descriptionId = (id) => __foldkitBrandViewResult((`${id}-descriptio
|
|
|
22
22
|
*
|
|
23
23
|
* // In update:
|
|
24
24
|
* ToggledTerms: ({ isChecked }) => ({
|
|
25
|
-
* model:
|
|
25
|
+
* model: modifyFields(model, { acceptedTerms: () => isChecked }),
|
|
26
26
|
* }),
|
|
27
27
|
* ``` */
|
|
28
28
|
export const view = (config, h) => {
|
package/dist/combobox/multi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Option, Schema } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { modifyFields } from 'foldkit/struct';
|
|
4
4
|
import { BaseModel, Message, OutMessage, baseInit, closedBaseModel, makeUpdate, makeView, } from './shared.js';
|
|
5
5
|
// MODEL
|
|
6
6
|
/** Schema for the multi-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.selectedValues`. */
|
|
@@ -18,7 +18,7 @@ export const init = (config) => __foldkitBrandViewResult((baseInit(config)), "@f
|
|
|
18
18
|
* design. Clear the selection by toggling each value off. */
|
|
19
19
|
export const update = makeUpdate({
|
|
20
20
|
handleClose: model => (__foldkitBrandViewResult(({
|
|
21
|
-
model:
|
|
21
|
+
model: modifyFields(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/multi.js#inputValue") }),
|
|
22
22
|
}), "@foldkit/ui/combobox/multi.js#handleClose")),
|
|
23
23
|
handleSelectedItem: (model, item) => (__foldkitBrandViewResult(({
|
|
24
24
|
model,
|
package/dist/combobox/shared.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as Command from 'foldkit/command';
|
|
|
4
4
|
import * as Dom from 'foldkit/dom';
|
|
5
5
|
import { defineMessageUnion } from 'foldkit/message';
|
|
6
6
|
import * as Mount from 'foldkit/mount';
|
|
7
|
-
import {
|
|
7
|
+
import { makeModifyFieldsFor } from 'foldkit/struct';
|
|
8
8
|
import { defineView } from 'foldkit/submodel';
|
|
9
9
|
import * as Update from 'foldkit/update';
|
|
10
10
|
import { AnchorConfig, anchorSetup, portalToContainingRoot, } from '../anchor/index.js';
|
|
@@ -119,9 +119,9 @@ const backdropSelector = (id) => __foldkitBrandViewResult((idSelector(`${id}-bac
|
|
|
119
119
|
export const itemSelector = (id, index) => __foldkitBrandViewResult((idSelector(`${id}-item-${index}`)), "@foldkit/ui/combobox/shared.js#itemSelector");
|
|
120
120
|
export const itemId = (id, index) => __foldkitBrandViewResult((`${id}-item-${index}`), "@foldkit/ui/combobox/shared.js#itemId");
|
|
121
121
|
// HELPERS
|
|
122
|
-
const
|
|
122
|
+
const modifyBaseFields = makeModifyFieldsFor();
|
|
123
123
|
/** Resets only shared base fields to their closed state. Does not touch inputValue. That is variant-specific. */
|
|
124
|
-
export const closedBaseModel = (model) => __foldkitBrandViewResult((
|
|
124
|
+
export const closedBaseModel = (model) => __foldkitBrandViewResult((modifyBaseFields(model, {
|
|
125
125
|
isOpen: () => __foldkitBrandViewResult((false), "@foldkit/ui/combobox/shared.js#isOpen"),
|
|
126
126
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex"),
|
|
127
127
|
activationTrigger: () => __foldkitBrandViewResult(('Keyboard'), "@foldkit/ui/combobox/shared.js#activationTrigger"),
|
|
@@ -193,20 +193,20 @@ export const makeUpdate = (handlers) => {
|
|
|
193
193
|
const foldAnimation = Update.foldChild({
|
|
194
194
|
update: animationUpdate,
|
|
195
195
|
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read"),
|
|
196
|
-
write: (model, nextAnimation) => __foldkitBrandViewResult((
|
|
196
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((modifyBaseFields(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/combobox/shared.js#animation") })), "@foldkit/ui/combobox/shared.js#write"),
|
|
197
197
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage"),
|
|
198
198
|
foldOutMessage: foldAnimationOutMessage,
|
|
199
199
|
});
|
|
200
200
|
const foldAnimationShow = Update.foldChildStep({
|
|
201
201
|
update: animationShow,
|
|
202
202
|
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read~2"),
|
|
203
|
-
write: (model, nextAnimation) => __foldkitBrandViewResult((
|
|
203
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((modifyBaseFields(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/combobox/shared.js#animation~2") })), "@foldkit/ui/combobox/shared.js#write~2"),
|
|
204
204
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage~2"),
|
|
205
205
|
});
|
|
206
206
|
const foldAnimationHide = Update.foldChildStep({
|
|
207
207
|
update: animationHide,
|
|
208
208
|
read: (model) => __foldkitBrandViewResult((Option.some(model.animation)), "@foldkit/ui/combobox/shared.js#read~3"),
|
|
209
|
-
write: (model, nextAnimation) => __foldkitBrandViewResult((
|
|
209
|
+
write: (model, nextAnimation) => __foldkitBrandViewResult((modifyBaseFields(model, { animation: () => __foldkitBrandViewResult((nextAnimation), "@foldkit/ui/combobox/shared.js#animation~3") })), "@foldkit/ui/combobox/shared.js#write~3"),
|
|
210
210
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotAnimationMessage({ message })), "@foldkit/ui/combobox/shared.js#toParentMessage~3"),
|
|
211
211
|
});
|
|
212
212
|
const internalUpdate = (model, message) => {
|
|
@@ -242,12 +242,12 @@ export const makeUpdate = (handlers) => {
|
|
|
242
242
|
}), "@foldkit/ui/combobox/shared.js#anonymous~4")),
|
|
243
243
|
foldAnimationShow,
|
|
244
244
|
stepModel => (__foldkitBrandViewResult(({
|
|
245
|
-
model:
|
|
245
|
+
model: modifyBaseFields(stepModel, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/combobox/shared.js#isOpen~2") }),
|
|
246
246
|
}), "@foldkit/ui/combobox/shared.js#anonymous~5")),
|
|
247
247
|
])), "@foldkit/ui/combobox/shared.js#openCombobox");
|
|
248
248
|
}
|
|
249
249
|
return __foldkitBrandViewResult(({
|
|
250
|
-
model:
|
|
250
|
+
model: modifyBaseFields(baseModel, { isOpen: () => __foldkitBrandViewResult((true), "@foldkit/ui/combobox/shared.js#isOpen~3") }),
|
|
251
251
|
commands: Array.getSomes([maybeLockScroll, maybeInertOthers]),
|
|
252
252
|
}), "@foldkit/ui/combobox/shared.js#openCombobox");
|
|
253
253
|
};
|
|
@@ -275,7 +275,7 @@ export const makeUpdate = (handlers) => {
|
|
|
275
275
|
CompletedAttachComboboxPreventBlur: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/combobox/shared.js#CompletedAttachComboboxPreventBlur")),
|
|
276
276
|
CompletedAttachComboboxSelectOnFocus: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/combobox/shared.js#CompletedAttachComboboxSelectOnFocus")),
|
|
277
277
|
CompletedPortalComboboxBackdrop: () => (__foldkitBrandViewResult(({ model }), "@foldkit/ui/combobox/shared.js#CompletedPortalComboboxBackdrop")),
|
|
278
|
-
Opened: ({ maybeActiveItemIndex }) => __foldkitBrandViewResult((openCombobox(
|
|
278
|
+
Opened: ({ maybeActiveItemIndex }) => __foldkitBrandViewResult((openCombobox(modifyBaseFields(model, {
|
|
279
279
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((maybeActiveItemIndex), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~2"),
|
|
280
280
|
activationTrigger: () => __foldkitBrandViewResult((Option.match(maybeActiveItemIndex, {
|
|
281
281
|
onNone: () => __foldkitBrandViewResult(('Pointer'), "@foldkit/ui/combobox/shared.js#onNone"),
|
|
@@ -293,7 +293,7 @@ export const makeUpdate = (handlers) => {
|
|
|
293
293
|
? closeCombobox(model, closeWithoutFocusCommands, restingInputValue, isClearable)
|
|
294
294
|
: { model }), "@foldkit/ui/combobox/shared.js#BlurredInput"),
|
|
295
295
|
ActivatedItem: ({ index, activationTrigger, maybeImmediateSelection, }) => {
|
|
296
|
-
const highlightedModel =
|
|
296
|
+
const highlightedModel = modifyBaseFields(model, {
|
|
297
297
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.some(index)), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~3"),
|
|
298
298
|
activationTrigger: () => __foldkitBrandViewResult((activationTrigger), "@foldkit/ui/combobox/shared.js#activationTrigger~3"),
|
|
299
299
|
});
|
|
@@ -320,7 +320,7 @@ export const makeUpdate = (handlers) => {
|
|
|
320
320
|
return __foldkitBrandViewResult(({ model }), "@foldkit/ui/combobox/shared.js#MovedPointerOverItem");
|
|
321
321
|
}
|
|
322
322
|
return __foldkitBrandViewResult(({
|
|
323
|
-
model:
|
|
323
|
+
model: modifyBaseFields(model, {
|
|
324
324
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.some(index)), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~4"),
|
|
325
325
|
activationTrigger: () => __foldkitBrandViewResult(('Pointer'), "@foldkit/ui/combobox/shared.js#activationTrigger~4"),
|
|
326
326
|
maybeLastPointerPosition: () => __foldkitBrandViewResult((Option.some({ screenX, screenY })), "@foldkit/ui/combobox/shared.js#maybeLastPointerPosition~3"),
|
|
@@ -329,7 +329,7 @@ export const makeUpdate = (handlers) => {
|
|
|
329
329
|
},
|
|
330
330
|
DeactivatedItem: () => __foldkitBrandViewResult((model.activationTrigger === 'Pointer'
|
|
331
331
|
? {
|
|
332
|
-
model:
|
|
332
|
+
model: modifyBaseFields(model, {
|
|
333
333
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~5"),
|
|
334
334
|
}),
|
|
335
335
|
}
|
|
@@ -344,14 +344,14 @@ export const makeUpdate = (handlers) => {
|
|
|
344
344
|
UpdatedInputValue: ({ value }) => {
|
|
345
345
|
if (model.isOpen) {
|
|
346
346
|
return __foldkitBrandViewResult(({
|
|
347
|
-
model:
|
|
347
|
+
model: modifyBaseFields(model, {
|
|
348
348
|
inputValue: () => __foldkitBrandViewResult((value), "@foldkit/ui/combobox/shared.js#inputValue"),
|
|
349
349
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.some(0)), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~6"),
|
|
350
350
|
activationTrigger: () => __foldkitBrandViewResult(('Keyboard'), "@foldkit/ui/combobox/shared.js#activationTrigger~5"),
|
|
351
351
|
}),
|
|
352
352
|
}), "@foldkit/ui/combobox/shared.js#UpdatedInputValue");
|
|
353
353
|
}
|
|
354
|
-
return __foldkitBrandViewResult((openCombobox(
|
|
354
|
+
return __foldkitBrandViewResult((openCombobox(modifyBaseFields(model, {
|
|
355
355
|
inputValue: () => __foldkitBrandViewResult((value), "@foldkit/ui/combobox/shared.js#inputValue~2"),
|
|
356
356
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.some(0)), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~7"),
|
|
357
357
|
activationTrigger: () => __foldkitBrandViewResult(('Keyboard'), "@foldkit/ui/combobox/shared.js#activationTrigger~6"),
|
|
@@ -362,7 +362,7 @@ export const makeUpdate = (handlers) => {
|
|
|
362
362
|
if (model.isOpen) {
|
|
363
363
|
return __foldkitBrandViewResult((closeCombobox(model, closeWithFocusCommands, restingInputValue, isClearable)), "@foldkit/ui/combobox/shared.js#PressedToggleButton");
|
|
364
364
|
}
|
|
365
|
-
return __foldkitBrandViewResult((Update.combine(
|
|
365
|
+
return __foldkitBrandViewResult((Update.combine(modifyBaseFields(model, {
|
|
366
366
|
maybeActiveItemIndex: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeActiveItemIndex~8"),
|
|
367
367
|
activationTrigger: () => __foldkitBrandViewResult(('Pointer'), "@foldkit/ui/combobox/shared.js#activationTrigger~7"),
|
|
368
368
|
maybeLastPointerPosition: () => __foldkitBrandViewResult((Option.none()), "@foldkit/ui/combobox/shared.js#maybeLastPointerPosition~5"),
|
package/dist/combobox/single.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
2
|
import { Option, Schema } from 'effect';
|
|
3
|
-
import {
|
|
3
|
+
import { modifyFields } 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
|
|
@@ -19,19 +19,19 @@ export const update = makeUpdate({
|
|
|
19
19
|
handleClose: (model, restingInputValue, isClearable) => {
|
|
20
20
|
if (isClearable && model.nullable && model.inputValue === '') {
|
|
21
21
|
return __foldkitBrandViewResult(({
|
|
22
|
-
model:
|
|
22
|
+
model: modifyFields(closedBaseModel(model), { inputValue: () => __foldkitBrandViewResult((''), "@foldkit/ui/combobox/single.js#inputValue") }),
|
|
23
23
|
outMessage: OutMessage.ClearedSelection(),
|
|
24
24
|
}), "@foldkit/ui/combobox/single.js#handleClose");
|
|
25
25
|
}
|
|
26
26
|
return __foldkitBrandViewResult(({
|
|
27
|
-
model:
|
|
27
|
+
model: modifyFields(closedBaseModel(model), {
|
|
28
28
|
inputValue: () => __foldkitBrandViewResult((restingInputValue), "@foldkit/ui/combobox/single.js#inputValue~2"),
|
|
29
29
|
}),
|
|
30
30
|
}), "@foldkit/ui/combobox/single.js#handleClose");
|
|
31
31
|
},
|
|
32
32
|
handleSelectedItem: (model, item, displayText, wasSelected, context) => {
|
|
33
33
|
const nullableDeselect = model.nullable && wasSelected;
|
|
34
|
-
return __foldkitBrandViewResult((context.closeWithFocus(
|
|
34
|
+
return __foldkitBrandViewResult((context.closeWithFocus(modifyFields(closedBaseModel(model), {
|
|
35
35
|
inputValue: () => (__foldkitBrandViewResult((nullableDeselect ? '' : displayText), "@foldkit/ui/combobox/single.js#inputValue~3")),
|
|
36
36
|
}), OutMessage.Selected({ value: item }))), "@foldkit/ui/combobox/single.js#handleSelectedItem");
|
|
37
37
|
},
|
|
@@ -1 +1 @@
|
|
|
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,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA;AAMlD;;;;wBAIwB;AACxB,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIhB,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AAIrC,mEAAmE;AACnE,eAAO,MAAM,OAAO;;QACI,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACR,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QACL,IAAI;;;;;;;;;EAI3B,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAIzC,yDAAyD;AACzD,eAAO,MAAM,UAAU;;QAEnB,IAAI;QACJ,KAAK;;;QAES,IAAI;;;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AA;IACzB,iBAAiB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IACjD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kBAAkB,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CACnD,CAAC,GACA,UAAU,CAAC,UAAU,CAAA;AAEvB;;;;gEAIgE;AAChE,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiJhB,CAAA"}
|
package/dist/datePicker/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
|
2
2
|
import { Function, Option, Predicate, Schema } from 'effect';
|
|
3
3
|
import * as Calendar from 'foldkit/calendar';
|
|
4
4
|
import { defineMessageUnion } from 'foldkit/message';
|
|
5
|
-
import {
|
|
5
|
+
import { modifyFields } from 'foldkit/struct';
|
|
6
6
|
import { defineView } from 'foldkit/submodel';
|
|
7
7
|
import * as Update from 'foldkit/update';
|
|
8
8
|
import * as UiCalendar from '../calendar/index.js';
|
|
@@ -70,10 +70,10 @@ export const init = (config) => (__foldkitBrandViewResult(({
|
|
|
70
70
|
}),
|
|
71
71
|
}), "@foldkit/ui/datePicker/index.js#init"));
|
|
72
72
|
const dropCalendarToDays = model => (__foldkitBrandViewResult(({
|
|
73
|
-
model:
|
|
73
|
+
model: modifyFields(model, { calendar: UiCalendar.dropToDays }),
|
|
74
74
|
}), "@foldkit/ui/datePicker/index.js#dropCalendarToDays"));
|
|
75
75
|
const readPopover = (model) => __foldkitBrandViewResult((Option.some(model.popover)), "@foldkit/ui/datePicker/index.js#readPopover");
|
|
76
|
-
const writePopover = (model, nextPopover) => __foldkitBrandViewResult((
|
|
76
|
+
const writePopover = (model, nextPopover) => __foldkitBrandViewResult((modifyFields(model, { popover: () => __foldkitBrandViewResult((nextPopover), "@foldkit/ui/datePicker/index.js#popover") })), "@foldkit/ui/datePicker/index.js#writePopover");
|
|
77
77
|
const toGotPopoverMessage = (message) => __foldkitBrandViewResult((Message.GotPopoverMessage({ message })), "@foldkit/ui/datePicker/index.js#toGotPopoverMessage");
|
|
78
78
|
const foldPopoverOutMessage = Popover.OutMessage.match({
|
|
79
79
|
Opened: () => __foldkitBrandViewResult((dropCalendarToDays), "@foldkit/ui/datePicker/index.js#Opened"),
|
|
@@ -111,7 +111,7 @@ const toDatePickerOutMessage = UiCalendar.OutMessage.match({
|
|
|
111
111
|
const foldCalendar = Update.foldChild({
|
|
112
112
|
update: UiCalendar.update,
|
|
113
113
|
read: (model) => __foldkitBrandViewResult((Option.some(model.calendar)), "@foldkit/ui/datePicker/index.js#read"),
|
|
114
|
-
write: (model, nextCalendar) => __foldkitBrandViewResult((
|
|
114
|
+
write: (model, nextCalendar) => __foldkitBrandViewResult((modifyFields(model, { calendar: () => __foldkitBrandViewResult((nextCalendar), "@foldkit/ui/datePicker/index.js#calendar") })), "@foldkit/ui/datePicker/index.js#write"),
|
|
115
115
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage"),
|
|
116
116
|
toParentOutMessage: toDatePickerOutMessage,
|
|
117
117
|
foldOutMessage: foldCalendarOutMessage,
|
|
@@ -119,7 +119,7 @@ const foldCalendar = Update.foldChild({
|
|
|
119
119
|
const foldCalendarSelectDate = Update.foldChild({
|
|
120
120
|
update: UiCalendar.selectDate,
|
|
121
121
|
read: (model) => __foldkitBrandViewResult((Option.some(model.calendar)), "@foldkit/ui/datePicker/index.js#read~2"),
|
|
122
|
-
write: (model, nextCalendar) => __foldkitBrandViewResult((
|
|
122
|
+
write: (model, nextCalendar) => __foldkitBrandViewResult((modifyFields(model, { calendar: () => __foldkitBrandViewResult((nextCalendar), "@foldkit/ui/datePicker/index.js#calendar~2") })), "@foldkit/ui/datePicker/index.js#write~2"),
|
|
123
123
|
toParentMessage: message => __foldkitBrandViewResult((Message.GotCalendarMessage({ message })), "@foldkit/ui/datePicker/index.js#toParentMessage~2"),
|
|
124
124
|
toParentOutMessage: toDatePickerOutMessage,
|
|
125
125
|
foldOutMessage: foldCalendarOutMessage,
|
|
@@ -148,7 +148,7 @@ export const clear = (model) => __foldkitBrandViewResult((update(model, Message.
|
|
|
148
148
|
* known date, for example after the parent sets its value externally (a URL
|
|
149
149
|
* parameter, a saved draft) so opening the picker shows that month. Returns
|
|
150
150
|
* the Model directly because it produces no Commands and no OutMessage. */
|
|
151
|
-
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((
|
|
151
|
+
export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewResult((modifyFields(model, {
|
|
152
152
|
calendar: () => __foldkitBrandViewResult((UiCalendar.focusDate(model.calendar, date)), "@foldkit/ui/datePicker/index.js#calendar~3"),
|
|
153
153
|
})), "@foldkit/ui/datePicker/index.js#anonymous~2"));
|
|
154
154
|
/** Reflects the minimum selectable date onto the embedded calendar. Pass
|
|
@@ -159,25 +159,25 @@ export const focusDate = Function.dual(2, (model, date) => __foldkitBrandViewRes
|
|
|
159
159
|
* Does NOT reconcile the current selection. If a previously-selected date
|
|
160
160
|
* is now below the new minimum, it remains selected. Callers should `clear`
|
|
161
161
|
* or reassign the selection explicitly if their domain requires it. */
|
|
162
|
-
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((
|
|
162
|
+
export const reflectMinDate = Function.dual(2, (model, maybeMinDate) => __foldkitBrandViewResult((modifyFields(model, {
|
|
163
163
|
calendar: () => __foldkitBrandViewResult((UiCalendar.reflectMinDate(model.calendar, maybeMinDate)), "@foldkit/ui/datePicker/index.js#calendar~4"),
|
|
164
164
|
})), "@foldkit/ui/datePicker/index.js#anonymous~3"));
|
|
165
165
|
/** Reflects the maximum selectable date onto the embedded calendar. Pass
|
|
166
166
|
* `Option.none()` to remove the maximum. Does NOT reconcile the current
|
|
167
167
|
* selection. */
|
|
168
|
-
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((
|
|
168
|
+
export const reflectMaxDate = Function.dual(2, (model, maybeMaxDate) => __foldkitBrandViewResult((modifyFields(model, {
|
|
169
169
|
calendar: () => __foldkitBrandViewResult((UiCalendar.reflectMaxDate(model.calendar, maybeMaxDate)), "@foldkit/ui/datePicker/index.js#calendar~5"),
|
|
170
170
|
})), "@foldkit/ui/datePicker/index.js#anonymous~4"));
|
|
171
171
|
/** Reflects the list of individually-disabled dates onto the embedded
|
|
172
172
|
* calendar. Pass an empty array to clear. Does NOT reconcile the current
|
|
173
173
|
* selection. */
|
|
174
|
-
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((
|
|
174
|
+
export const reflectDisabledDates = Function.dual(2, (model, disabledDates) => __foldkitBrandViewResult((modifyFields(model, {
|
|
175
175
|
calendar: () => __foldkitBrandViewResult((UiCalendar.reflectDisabledDates(model.calendar, disabledDates)), "@foldkit/ui/datePicker/index.js#calendar~6"),
|
|
176
176
|
})), "@foldkit/ui/datePicker/index.js#anonymous~5"));
|
|
177
177
|
/** Reflects the days of the week that are disabled onto the embedded calendar
|
|
178
178
|
* (e.g. weekends). Pass an empty array to clear. Does NOT reconcile the
|
|
179
179
|
* current selection. */
|
|
180
|
-
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((
|
|
180
|
+
export const reflectDisabledDaysOfWeek = Function.dual(2, (model, disabledDaysOfWeek) => __foldkitBrandViewResult((modifyFields(model, {
|
|
181
181
|
calendar: () => __foldkitBrandViewResult((UiCalendar.reflectDisabledDaysOfWeek(model.calendar, disabledDaysOfWeek)), "@foldkit/ui/datePicker/index.js#calendar~7"),
|
|
182
182
|
})), "@foldkit/ui/datePicker/index.js#anonymous~6"));
|
|
183
183
|
// SELECTORS
|