@proyecto-viviana/solid-stately 0.1.5 → 0.2.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/index.js +226 -504
- package/dist/index.jsx +6407 -0
- package/package.json +3 -5
- package/dist/index.js.map +0 -1
- package/src/autocomplete/createAutocompleteState.d.ts +0 -46
- package/src/autocomplete/createAutocompleteState.d.ts.map +0 -1
- package/src/autocomplete/createAutocompleteState.ts +0 -90
- package/src/autocomplete/index.d.ts +0 -2
- package/src/autocomplete/index.d.ts.map +0 -1
- package/src/autocomplete/index.ts +0 -5
- package/src/calendar/createCalendarState.d.ts +0 -130
- package/src/calendar/createCalendarState.d.ts.map +0 -1
- package/src/calendar/createCalendarState.ts +0 -461
- package/src/calendar/createDateFieldState.d.ts +0 -110
- package/src/calendar/createDateFieldState.d.ts.map +0 -1
- package/src/calendar/createDateFieldState.ts +0 -562
- package/src/calendar/createRangeCalendarState.d.ts +0 -146
- package/src/calendar/createRangeCalendarState.d.ts.map +0 -1
- package/src/calendar/createRangeCalendarState.ts +0 -535
- package/src/calendar/createTimeFieldState.d.ts +0 -95
- package/src/calendar/createTimeFieldState.d.ts.map +0 -1
- package/src/calendar/createTimeFieldState.ts +0 -483
- package/src/calendar/index.d.ts +0 -7
- package/src/calendar/index.d.ts.map +0 -1
- package/src/calendar/index.ts +0 -81
- package/src/checkbox/createCheckboxGroupState.d.ts +0 -71
- package/src/checkbox/createCheckboxGroupState.d.ts.map +0 -1
- package/src/checkbox/createCheckboxGroupState.ts +0 -193
- package/src/checkbox/index.d.ts +0 -2
- package/src/checkbox/index.d.ts.map +0 -1
- package/src/checkbox/index.ts +0 -5
- package/src/collections/ListCollection.d.ts +0 -37
- package/src/collections/ListCollection.d.ts.map +0 -1
- package/src/collections/ListCollection.ts +0 -146
- package/src/collections/createListState.d.ts +0 -79
- package/src/collections/createListState.d.ts.map +0 -1
- package/src/collections/createListState.ts +0 -264
- package/src/collections/createMenuState.d.ts +0 -50
- package/src/collections/createMenuState.d.ts.map +0 -1
- package/src/collections/createMenuState.ts +0 -106
- package/src/collections/createSelectionState.d.ts +0 -76
- package/src/collections/createSelectionState.d.ts.map +0 -1
- package/src/collections/createSelectionState.ts +0 -336
- package/src/collections/index.d.ts +0 -6
- package/src/collections/index.d.ts.map +0 -1
- package/src/collections/index.ts +0 -46
- package/src/collections/types.d.ts +0 -147
- package/src/collections/types.d.ts.map +0 -1
- package/src/collections/types.ts +0 -169
- package/src/color/Color.d.ts +0 -28
- package/src/color/Color.d.ts.map +0 -1
- package/src/color/Color.ts +0 -951
- package/src/color/createColorAreaState.d.ts +0 -76
- package/src/color/createColorAreaState.d.ts.map +0 -1
- package/src/color/createColorAreaState.ts +0 -293
- package/src/color/createColorFieldState.d.ts +0 -55
- package/src/color/createColorFieldState.d.ts.map +0 -1
- package/src/color/createColorFieldState.ts +0 -292
- package/src/color/createColorSliderState.d.ts +0 -67
- package/src/color/createColorSliderState.d.ts.map +0 -1
- package/src/color/createColorSliderState.ts +0 -241
- package/src/color/createColorWheelState.d.ts +0 -51
- package/src/color/createColorWheelState.d.ts.map +0 -1
- package/src/color/createColorWheelState.ts +0 -211
- package/src/color/index.d.ts +0 -10
- package/src/color/index.d.ts.map +0 -1
- package/src/color/index.ts +0 -47
- package/src/color/types.d.ts +0 -106
- package/src/color/types.d.ts.map +0 -1
- package/src/color/types.ts +0 -127
- package/src/combobox/createComboBoxState.d.ts +0 -125
- package/src/combobox/createComboBoxState.d.ts.map +0 -1
- package/src/combobox/createComboBoxState.ts +0 -703
- package/src/combobox/index.d.ts +0 -5
- package/src/combobox/index.d.ts.map +0 -1
- package/src/combobox/index.ts +0 -13
- package/src/disclosure/createDisclosureState.d.ts +0 -64
- package/src/disclosure/createDisclosureState.d.ts.map +0 -1
- package/src/disclosure/createDisclosureState.ts +0 -193
- package/src/disclosure/index.d.ts +0 -2
- package/src/disclosure/index.d.ts.map +0 -1
- package/src/disclosure/index.ts +0 -9
- package/src/dnd/createDragState.d.ts +0 -59
- package/src/dnd/createDragState.d.ts.map +0 -1
- package/src/dnd/createDragState.ts +0 -153
- package/src/dnd/createDraggableCollectionState.d.ts +0 -57
- package/src/dnd/createDraggableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDraggableCollectionState.ts +0 -165
- package/src/dnd/createDropState.d.ts +0 -61
- package/src/dnd/createDropState.d.ts.map +0 -1
- package/src/dnd/createDropState.ts +0 -212
- package/src/dnd/createDroppableCollectionState.d.ts +0 -78
- package/src/dnd/createDroppableCollectionState.d.ts.map +0 -1
- package/src/dnd/createDroppableCollectionState.ts +0 -357
- package/src/dnd/index.d.ts +0 -11
- package/src/dnd/index.d.ts.map +0 -1
- package/src/dnd/index.ts +0 -76
- package/src/dnd/types.d.ts +0 -264
- package/src/dnd/types.d.ts.map +0 -1
- package/src/dnd/types.ts +0 -317
- package/src/form/createFormValidationState.d.ts +0 -100
- package/src/form/createFormValidationState.d.ts.map +0 -1
- package/src/form/createFormValidationState.ts +0 -389
- package/src/form/index.d.ts +0 -2
- package/src/form/index.d.ts.map +0 -1
- package/src/form/index.ts +0 -15
- package/src/grid/createGridState.d.ts +0 -12
- package/src/grid/createGridState.d.ts.map +0 -1
- package/src/grid/createGridState.ts +0 -327
- package/src/grid/index.d.ts +0 -7
- package/src/grid/index.d.ts.map +0 -1
- package/src/grid/index.ts +0 -13
- package/src/grid/types.d.ts +0 -156
- package/src/grid/types.d.ts.map +0 -1
- package/src/grid/types.ts +0 -179
- package/src/index.d.ts +0 -26
- package/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -383
- package/src/numberfield/createNumberFieldState.d.ts +0 -65
- package/src/numberfield/createNumberFieldState.d.ts.map +0 -1
- package/src/numberfield/createNumberFieldState.ts +0 -383
- package/src/numberfield/index.d.ts +0 -2
- package/src/numberfield/index.d.ts.map +0 -1
- package/src/numberfield/index.ts +0 -5
- package/src/overlays/createOverlayTriggerState.d.ts +0 -32
- package/src/overlays/createOverlayTriggerState.d.ts.map +0 -1
- package/src/overlays/createOverlayTriggerState.ts +0 -67
- package/src/overlays/index.d.ts +0 -2
- package/src/overlays/index.d.ts.map +0 -1
- package/src/overlays/index.ts +0 -5
- package/src/radio/createRadioGroupState.d.ts +0 -77
- package/src/radio/createRadioGroupState.d.ts.map +0 -1
- package/src/radio/createRadioGroupState.ts +0 -201
- package/src/radio/index.d.ts +0 -2
- package/src/radio/index.d.ts.map +0 -1
- package/src/radio/index.ts +0 -6
- package/src/searchfield/createSearchFieldState.d.ts +0 -25
- package/src/searchfield/createSearchFieldState.d.ts.map +0 -1
- package/src/searchfield/createSearchFieldState.ts +0 -62
- package/src/searchfield/index.d.ts +0 -3
- package/src/searchfield/index.d.ts.map +0 -1
- package/src/searchfield/index.ts +0 -5
- package/src/select/createSelectState.d.ts +0 -73
- package/src/select/createSelectState.d.ts.map +0 -1
- package/src/select/createSelectState.ts +0 -181
- package/src/select/index.d.ts +0 -2
- package/src/select/index.d.ts.map +0 -1
- package/src/select/index.ts +0 -5
- package/src/slider/createSliderState.d.ts +0 -72
- package/src/slider/createSliderState.d.ts.map +0 -1
- package/src/slider/createSliderState.ts +0 -211
- package/src/slider/index.d.ts +0 -3
- package/src/slider/index.d.ts.map +0 -1
- package/src/slider/index.ts +0 -6
- package/src/ssr/index.d.ts +0 -28
- package/src/ssr/index.d.ts.map +0 -1
- package/src/ssr/index.ts +0 -41
- package/src/table/TableCollection.d.ts +0 -52
- package/src/table/TableCollection.d.ts.map +0 -1
- package/src/table/TableCollection.ts +0 -388
- package/src/table/createTableState.d.ts +0 -12
- package/src/table/createTableState.d.ts.map +0 -1
- package/src/table/createTableState.ts +0 -127
- package/src/table/index.d.ts +0 -8
- package/src/table/index.d.ts.map +0 -1
- package/src/table/index.ts +0 -18
- package/src/table/types.d.ts +0 -139
- package/src/table/types.d.ts.map +0 -1
- package/src/table/types.ts +0 -150
- package/src/tabs/createTabListState.d.ts +0 -68
- package/src/tabs/createTabListState.d.ts.map +0 -1
- package/src/tabs/createTabListState.ts +0 -240
- package/src/tabs/index.d.ts +0 -2
- package/src/tabs/index.d.ts.map +0 -1
- package/src/tabs/index.ts +0 -7
- package/src/textfield/createTextFieldState.d.ts +0 -30
- package/src/textfield/createTextFieldState.d.ts.map +0 -1
- package/src/textfield/createTextFieldState.ts +0 -75
- package/src/textfield/index.d.ts +0 -2
- package/src/textfield/index.d.ts.map +0 -1
- package/src/textfield/index.ts +0 -5
- package/src/toast/createToastState.d.ts +0 -118
- package/src/toast/createToastState.d.ts.map +0 -1
- package/src/toast/createToastState.ts +0 -316
- package/src/toast/index.d.ts +0 -2
- package/src/toast/index.d.ts.map +0 -1
- package/src/toast/index.ts +0 -11
- package/src/toggle/createToggleState.d.ts +0 -34
- package/src/toggle/createToggleState.d.ts.map +0 -1
- package/src/toggle/createToggleState.ts +0 -94
- package/src/toggle/index.d.ts +0 -2
- package/src/toggle/index.d.ts.map +0 -1
- package/src/toggle/index.ts +0 -5
- package/src/tooltip/createTooltipTriggerState.d.ts +0 -39
- package/src/tooltip/createTooltipTriggerState.d.ts.map +0 -1
- package/src/tooltip/createTooltipTriggerState.ts +0 -183
- package/src/tooltip/index.d.ts +0 -2
- package/src/tooltip/index.d.ts.map +0 -1
- package/src/tooltip/index.ts +0 -6
- package/src/tree/TreeCollection.d.ts +0 -40
- package/src/tree/TreeCollection.d.ts.map +0 -1
- package/src/tree/TreeCollection.ts +0 -175
- package/src/tree/createTreeState.d.ts +0 -14
- package/src/tree/createTreeState.d.ts.map +0 -1
- package/src/tree/createTreeState.ts +0 -392
- package/src/tree/index.d.ts +0 -7
- package/src/tree/index.d.ts.map +0 -1
- package/src/tree/index.ts +0 -13
- package/src/tree/types.d.ts +0 -157
- package/src/tree/types.d.ts.map +0 -1
- package/src/tree/types.ts +0 -174
- package/src/utils/index.d.ts +0 -2
- package/src/utils/index.d.ts.map +0 -1
- package/src/utils/index.ts +0 -1
- package/src/utils/reactivity.d.ts +0 -28
- package/src/utils/reactivity.d.ts.map +0 -1
- package/src/utils/reactivity.ts +0 -36
package/dist/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { createContext, createSignal, createUniqueId, untrack, createMemo, createEffect, onCleanup, on, useContext } from 'solid-js';
|
|
2
|
+
import { isServer as isServer$1 } from 'solid-js/web';
|
|
3
|
+
import { getLocalTimeZone, startOfMonth, endOfMonth, DateFormatter, today, getDayOfWeek, toCalendarDate as toCalendarDate$1, toCalendarDateTime, isSameDay, isSameMonth, startOfWeek, getWeeksInMonth } from '@internationalized/date';
|
|
4
|
+
export { CalendarDate as CalendarDateClass, CalendarDateTime as CalendarDateTimeClass, DateFormatter, Time as TimeClass, ZonedDateTime as ZonedDateTimeClass, endOfMonth, endOfWeek, endOfYear, getDayOfWeek, getLocalTimeZone, getWeeksInMonth, isSameDay, isSameMonth, isSameYear, isToday, isWeekend, maxDate, minDate, now, parseAbsolute, parseAbsoluteToLocal, parseDate, parseDateTime, parseTime, parseZonedDateTime, startOfMonth, startOfWeek, startOfYear, toCalendarDate, toCalendarDateTime, toTime, toZoned, today } from '@internationalized/date';
|
|
5
|
+
|
|
1
6
|
// src/toggle/createToggleState.ts
|
|
2
|
-
import { createSignal } from "solid-js";
|
|
3
7
|
|
|
4
8
|
// src/utils/reactivity.ts
|
|
5
9
|
function access(value) {
|
|
@@ -44,18 +48,15 @@ function createToggleState(props = {}) {
|
|
|
44
48
|
toggle
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
|
-
|
|
48
|
-
// src/autocomplete/createAutocompleteState.ts
|
|
49
|
-
import { createSignal as createSignal2 } from "solid-js";
|
|
50
51
|
function createAutocompleteState(props = {}) {
|
|
51
52
|
const {
|
|
52
53
|
inputValue: controlledInputValue,
|
|
53
54
|
defaultInputValue = "",
|
|
54
55
|
onInputChange
|
|
55
56
|
} = props;
|
|
56
|
-
const [focusedNodeId, setFocusedNodeId] =
|
|
57
|
+
const [focusedNodeId, setFocusedNodeId] = createSignal(null);
|
|
57
58
|
const isControlled = controlledInputValue !== void 0;
|
|
58
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
59
|
+
const [uncontrolledValue, setUncontrolledValue] = createSignal(defaultInputValue);
|
|
59
60
|
const inputValue = () => {
|
|
60
61
|
return isControlled ? controlledInputValue : uncontrolledValue();
|
|
61
62
|
};
|
|
@@ -72,14 +73,11 @@ function createAutocompleteState(props = {}) {
|
|
|
72
73
|
setFocusedNodeId
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
-
// src/textfield/createTextFieldState.ts
|
|
77
|
-
import { createSignal as createSignal3 } from "solid-js";
|
|
78
76
|
function createTextFieldState(props = {}) {
|
|
79
77
|
const getProps = () => access(props);
|
|
80
78
|
const initialProps = getProps();
|
|
81
79
|
const initialValue = initialProps.value ?? initialProps.defaultValue ?? "";
|
|
82
|
-
const [internalValue, setInternalValue] =
|
|
80
|
+
const [internalValue, setInternalValue] = createSignal(initialValue);
|
|
83
81
|
const isControlled = () => getProps().value !== void 0;
|
|
84
82
|
const value = () => {
|
|
85
83
|
const p = getProps();
|
|
@@ -97,14 +95,11 @@ function createTextFieldState(props = {}) {
|
|
|
97
95
|
setValue
|
|
98
96
|
};
|
|
99
97
|
}
|
|
100
|
-
|
|
101
|
-
// src/checkbox/createCheckboxGroupState.ts
|
|
102
|
-
import { createSignal as createSignal4 } from "solid-js";
|
|
103
98
|
function createCheckboxGroupState(props = {}) {
|
|
104
99
|
const getProps = () => access(props);
|
|
105
100
|
const initialProps = getProps();
|
|
106
101
|
const initialValue = initialProps.value ?? initialProps.defaultValue ?? [];
|
|
107
|
-
const [internalValue, setInternalValue] =
|
|
102
|
+
const [internalValue, setInternalValue] = createSignal(initialValue);
|
|
108
103
|
const isControlled = () => getProps().value !== void 0;
|
|
109
104
|
const value = () => {
|
|
110
105
|
const p = getProps();
|
|
@@ -182,14 +177,7 @@ function createCheckboxGroupState(props = {}) {
|
|
|
182
177
|
toggleValue
|
|
183
178
|
};
|
|
184
179
|
}
|
|
185
|
-
|
|
186
|
-
// src/radio/createRadioGroupState.ts
|
|
187
|
-
import { createSignal as createSignal5, untrack } from "solid-js";
|
|
188
|
-
|
|
189
|
-
// src/ssr/index.ts
|
|
190
|
-
import { createUniqueId } from "solid-js";
|
|
191
|
-
import { isServer as _isServer } from "solid-js/web";
|
|
192
|
-
var isServer = _isServer;
|
|
180
|
+
var isServer = isServer$1;
|
|
193
181
|
function createIsSSR() {
|
|
194
182
|
return isServer;
|
|
195
183
|
}
|
|
@@ -207,11 +195,11 @@ function createRadioGroupState(props = {}) {
|
|
|
207
195
|
const getProps = () => access(props);
|
|
208
196
|
const initialProps = untrack(() => getProps());
|
|
209
197
|
const name = initialProps.name || `radio-group-${createId()}`;
|
|
210
|
-
const [internalValue, setInternalValue] =
|
|
198
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
211
199
|
initialProps.defaultValue ?? null
|
|
212
200
|
);
|
|
213
|
-
const [lastFocusedValue, setLastFocusedValueInternal] =
|
|
214
|
-
const [syncVersion, setSyncVersion] =
|
|
201
|
+
const [lastFocusedValue, setLastFocusedValueInternal] = createSignal(null);
|
|
202
|
+
const [syncVersion, setSyncVersion] = createSignal(0);
|
|
215
203
|
const isControlled = () => getProps().value !== void 0;
|
|
216
204
|
const selectedValue = () => {
|
|
217
205
|
const p = getProps();
|
|
@@ -262,12 +250,9 @@ function createRadioGroupState(props = {}) {
|
|
|
262
250
|
radioGroupSyncVersion.set(state, syncVersion);
|
|
263
251
|
return state;
|
|
264
252
|
}
|
|
265
|
-
|
|
266
|
-
// src/overlays/createOverlayTriggerState.ts
|
|
267
|
-
import { createSignal as createSignal6 } from "solid-js";
|
|
268
253
|
function createOverlayTriggerState(props = {}) {
|
|
269
254
|
const propsAccessor = () => access(props);
|
|
270
|
-
const [internalOpen, setInternalOpen] =
|
|
255
|
+
const [internalOpen, setInternalOpen] = createSignal(propsAccessor().defaultOpen ?? false);
|
|
271
256
|
const isOpen = () => {
|
|
272
257
|
const p = propsAccessor();
|
|
273
258
|
return p.isOpen !== void 0 ? p.isOpen : internalOpen();
|
|
@@ -397,16 +382,13 @@ function createListCollection(items, options = {}) {
|
|
|
397
382
|
}));
|
|
398
383
|
return new ListCollection(nodes);
|
|
399
384
|
}
|
|
400
|
-
|
|
401
|
-
// src/collections/createSelectionState.ts
|
|
402
|
-
import { createSignal as createSignal7 } from "solid-js";
|
|
403
385
|
function createSelectionState(props = {}) {
|
|
404
386
|
const getProps = () => access(props);
|
|
405
|
-
const [internalBehavior, setInternalBehavior] =
|
|
406
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
387
|
+
const [internalBehavior, setInternalBehavior] = createSignal("toggle");
|
|
388
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = createSignal(
|
|
407
389
|
getInitialSelection(getProps().defaultSelectedKeys)
|
|
408
390
|
);
|
|
409
|
-
const [anchorKey, setAnchorKey] =
|
|
391
|
+
const [anchorKey, setAnchorKey] = createSignal(null);
|
|
410
392
|
const selectionMode = () => getProps().selectionMode ?? "none";
|
|
411
393
|
const selectionBehavior = () => {
|
|
412
394
|
return getProps().selectionBehavior ?? internalBehavior();
|
|
@@ -587,9 +569,6 @@ function normalizeSelection(keys) {
|
|
|
587
569
|
if (keys === "all") return "all";
|
|
588
570
|
return new Set(keys);
|
|
589
571
|
}
|
|
590
|
-
|
|
591
|
-
// src/collections/createListState.ts
|
|
592
|
-
import { createSignal as createSignal8 } from "solid-js";
|
|
593
572
|
function createListState(props) {
|
|
594
573
|
const getProps = () => access(props);
|
|
595
574
|
const collection = () => {
|
|
@@ -656,9 +635,9 @@ function createListState(props) {
|
|
|
656
635
|
return getProps().allowDuplicateSelectionEvents;
|
|
657
636
|
}
|
|
658
637
|
});
|
|
659
|
-
const [isFocused, setIsFocused] =
|
|
660
|
-
const [focusedKey, setFocusedKeyInternal] =
|
|
661
|
-
const [childFocusStrategy, setChildFocusStrategy] =
|
|
638
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
639
|
+
const [focusedKey, setFocusedKeyInternal] = createSignal(null);
|
|
640
|
+
const [childFocusStrategy, setChildFocusStrategy] = createSignal(null);
|
|
662
641
|
const setFocusedKey = (key, childStrategy) => {
|
|
663
642
|
setFocusedKeyInternal(key);
|
|
664
643
|
setChildFocusStrategy(childStrategy ?? null);
|
|
@@ -782,9 +761,6 @@ function createMenuState(props) {
|
|
|
782
761
|
close
|
|
783
762
|
};
|
|
784
763
|
}
|
|
785
|
-
|
|
786
|
-
// src/select/createSelectState.ts
|
|
787
|
-
import { createSignal as createSignal9 } from "solid-js";
|
|
788
764
|
function createSelectState(props) {
|
|
789
765
|
const getProps = () => access(props);
|
|
790
766
|
const overlayState = createOverlayTriggerState({
|
|
@@ -799,7 +775,7 @@ function createSelectState(props) {
|
|
|
799
775
|
}
|
|
800
776
|
});
|
|
801
777
|
const isControlled = () => getProps().selectedKey !== void 0;
|
|
802
|
-
const [internalSelectedKey, setInternalSelectedKey] =
|
|
778
|
+
const [internalSelectedKey, setInternalSelectedKey] = createSignal(
|
|
803
779
|
getProps().defaultSelectedKey ?? null
|
|
804
780
|
);
|
|
805
781
|
const selectedKey = () => {
|
|
@@ -871,9 +847,6 @@ function createSelectState(props) {
|
|
|
871
847
|
}
|
|
872
848
|
};
|
|
873
849
|
}
|
|
874
|
-
|
|
875
|
-
// src/combobox/createComboBoxState.ts
|
|
876
|
-
import { createSignal as createSignal10, createMemo, createEffect } from "solid-js";
|
|
877
850
|
var defaultContainsFilter = (textValue, inputValue) => {
|
|
878
851
|
return textValue.toLowerCase().includes(inputValue.toLowerCase());
|
|
879
852
|
};
|
|
@@ -883,15 +856,15 @@ function createComboBoxState(props) {
|
|
|
883
856
|
const allowsEmptyCollection = () => getProps().allowsEmptyCollection ?? false;
|
|
884
857
|
const allowsCustomValue = () => getProps().allowsCustomValue ?? false;
|
|
885
858
|
const shouldCloseOnBlur = () => getProps().shouldCloseOnBlur ?? true;
|
|
886
|
-
const [focusStrategy, setFocusStrategy] =
|
|
887
|
-
const [showAllItems, setShowAllItems] =
|
|
859
|
+
const [focusStrategy, setFocusStrategy] = createSignal(null);
|
|
860
|
+
const [showAllItems, setShowAllItems] = createSignal(false);
|
|
888
861
|
let menuOpenTrigger = "focus";
|
|
889
862
|
const isSelectionControlled = () => getProps().selectedKey !== void 0;
|
|
890
|
-
const [internalSelectedKey, setInternalSelectedKey] =
|
|
863
|
+
const [internalSelectedKey, setInternalSelectedKey] = createSignal(
|
|
891
864
|
getProps().defaultSelectedKey ?? null
|
|
892
865
|
);
|
|
893
866
|
const isInputControlled = () => getProps().inputValue !== void 0;
|
|
894
|
-
const [internalInputValue, setInternalInputValue] =
|
|
867
|
+
const [internalInputValue, setInternalInputValue] = createSignal(
|
|
895
868
|
getProps().defaultInputValue ?? ""
|
|
896
869
|
);
|
|
897
870
|
let inputInitialized = false;
|
|
@@ -904,7 +877,7 @@ function createComboBoxState(props) {
|
|
|
904
877
|
}
|
|
905
878
|
getProps().onInputChange?.(value);
|
|
906
879
|
};
|
|
907
|
-
const [lastValue, setLastValue] =
|
|
880
|
+
const [lastValue, setLastValue] = createSignal(inputValue());
|
|
908
881
|
const selectedKey = () => {
|
|
909
882
|
return isSelectionControlled() ? getProps().selectedKey ?? null : internalSelectedKey();
|
|
910
883
|
};
|
|
@@ -1073,11 +1046,10 @@ function createComboBoxState(props) {
|
|
|
1073
1046
|
commitSelection();
|
|
1074
1047
|
}
|
|
1075
1048
|
};
|
|
1076
|
-
const [isFocused, setIsFocused] =
|
|
1077
|
-
let valueOnFocus = "";
|
|
1049
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
1078
1050
|
const setFocused = (focused) => {
|
|
1079
1051
|
if (focused) {
|
|
1080
|
-
|
|
1052
|
+
inputValue();
|
|
1081
1053
|
if (menuTrigger() === "focus" && !getProps().isReadOnly) {
|
|
1082
1054
|
open(null, "focus");
|
|
1083
1055
|
}
|
|
@@ -1286,9 +1258,6 @@ function createFilteredCollection(items, original) {
|
|
|
1286
1258
|
}
|
|
1287
1259
|
};
|
|
1288
1260
|
}
|
|
1289
|
-
|
|
1290
|
-
// src/tabs/createTabListState.ts
|
|
1291
|
-
import { createSignal as createSignal11 } from "solid-js";
|
|
1292
1261
|
function createTabListState(props) {
|
|
1293
1262
|
const getProps = () => access(props);
|
|
1294
1263
|
const collection = () => {
|
|
@@ -1349,7 +1318,7 @@ function createTabListState(props) {
|
|
|
1349
1318
|
}
|
|
1350
1319
|
return findFirstNonDisabledKey();
|
|
1351
1320
|
};
|
|
1352
|
-
const [selectedKeyInternal, setSelectedKeyInternal] =
|
|
1321
|
+
const [selectedKeyInternal, setSelectedKeyInternal] = createSignal(
|
|
1353
1322
|
getInitialSelectedKey()
|
|
1354
1323
|
);
|
|
1355
1324
|
const selectedKey = () => {
|
|
@@ -1375,9 +1344,9 @@ function createTabListState(props) {
|
|
|
1375
1344
|
const isDisabled = () => getProps().isDisabled ?? false;
|
|
1376
1345
|
const keyboardActivation = () => getProps().keyboardActivation ?? "automatic";
|
|
1377
1346
|
const orientation = () => getProps().orientation ?? "horizontal";
|
|
1378
|
-
const [isFocused, setIsFocused] =
|
|
1379
|
-
const [focusedKey, setFocusedKeyInternal] =
|
|
1380
|
-
const [childFocusStrategy, setChildFocusStrategy] =
|
|
1347
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
1348
|
+
const [focusedKey, setFocusedKeyInternal] = createSignal(null);
|
|
1349
|
+
const [childFocusStrategy, setChildFocusStrategy] = createSignal(null);
|
|
1381
1350
|
const setFocusedKey = (key, childStrategy) => {
|
|
1382
1351
|
setFocusedKeyInternal(key);
|
|
1383
1352
|
setChildFocusStrategy(childStrategy ?? null);
|
|
@@ -1402,9 +1371,6 @@ function createTabListState(props) {
|
|
|
1402
1371
|
childFocusStrategy
|
|
1403
1372
|
};
|
|
1404
1373
|
}
|
|
1405
|
-
|
|
1406
|
-
// src/numberfield/createNumberFieldState.ts
|
|
1407
|
-
import { createSignal as createSignal12, createMemo as createMemo2 } from "solid-js";
|
|
1408
1374
|
function handleDecimalOperation(operator, value1, value2) {
|
|
1409
1375
|
const getDecimals = (n) => {
|
|
1410
1376
|
const str = String(n);
|
|
@@ -1434,12 +1400,12 @@ function createNumberFieldState(props) {
|
|
|
1434
1400
|
const getProps = () => access(props);
|
|
1435
1401
|
const locale = () => getProps().locale ?? "en-US";
|
|
1436
1402
|
const formatOptions = () => getProps().formatOptions ?? {};
|
|
1437
|
-
const formatter =
|
|
1403
|
+
const formatter = createMemo(() => {
|
|
1438
1404
|
return new Intl.NumberFormat(locale(), formatOptions());
|
|
1439
1405
|
});
|
|
1440
1406
|
const parseNumber = (value) => {
|
|
1441
1407
|
if (!value || value === "" || value === "-") return NaN;
|
|
1442
|
-
|
|
1408
|
+
formatOptions();
|
|
1443
1409
|
const testNumber = formatter().format(1.1);
|
|
1444
1410
|
const decimalSeparator = testNumber.charAt(1);
|
|
1445
1411
|
let normalized = value;
|
|
@@ -1454,14 +1420,14 @@ function createNumberFieldState(props) {
|
|
|
1454
1420
|
if (isNaN(value)) return "";
|
|
1455
1421
|
return formatter().format(value);
|
|
1456
1422
|
};
|
|
1457
|
-
const step =
|
|
1423
|
+
const step = createMemo(() => {
|
|
1458
1424
|
const p = getProps();
|
|
1459
1425
|
if (p.step != null) return p.step;
|
|
1460
1426
|
if (p.formatOptions?.style === "percent") return 0.01;
|
|
1461
1427
|
return 1;
|
|
1462
1428
|
});
|
|
1463
|
-
const [inputValue, setInputValueInternal] =
|
|
1464
|
-
const [numberValue, setNumberValue] =
|
|
1429
|
+
const [inputValue, setInputValueInternal] = createSignal("");
|
|
1430
|
+
const [numberValue, setNumberValue] = createSignal(NaN);
|
|
1465
1431
|
const initValue = () => {
|
|
1466
1432
|
const p = getProps();
|
|
1467
1433
|
const initial = p.value ?? p.defaultValue;
|
|
@@ -1477,7 +1443,7 @@ function createNumberFieldState(props) {
|
|
|
1477
1443
|
initValue();
|
|
1478
1444
|
}
|
|
1479
1445
|
};
|
|
1480
|
-
const actualNumberValue =
|
|
1446
|
+
const actualNumberValue = createMemo(() => {
|
|
1481
1447
|
ensureInitialized();
|
|
1482
1448
|
const p = getProps();
|
|
1483
1449
|
if (p.value !== void 0) {
|
|
@@ -1487,7 +1453,7 @@ function createNumberFieldState(props) {
|
|
|
1487
1453
|
});
|
|
1488
1454
|
const validate = (value) => {
|
|
1489
1455
|
if (value === "" || value === "-") return true;
|
|
1490
|
-
|
|
1456
|
+
formatOptions();
|
|
1491
1457
|
const testNumber = formatter().format(1.1);
|
|
1492
1458
|
const decimalSeparator = testNumber.charAt(1);
|
|
1493
1459
|
const pattern = new RegExp(
|
|
@@ -1523,7 +1489,7 @@ function createNumberFieldState(props) {
|
|
|
1523
1489
|
p.onChange?.(parsed);
|
|
1524
1490
|
}
|
|
1525
1491
|
};
|
|
1526
|
-
const canIncrement =
|
|
1492
|
+
const canIncrement = createMemo(() => {
|
|
1527
1493
|
ensureInitialized();
|
|
1528
1494
|
const p = getProps();
|
|
1529
1495
|
if (p.isDisabled || p.isReadOnly) return false;
|
|
@@ -1532,7 +1498,7 @@ function createNumberFieldState(props) {
|
|
|
1532
1498
|
if (p.maxValue == null) return true;
|
|
1533
1499
|
return handleDecimalOperation("+", current, step()) <= p.maxValue;
|
|
1534
1500
|
});
|
|
1535
|
-
const canDecrement =
|
|
1501
|
+
const canDecrement = createMemo(() => {
|
|
1536
1502
|
ensureInitialized();
|
|
1537
1503
|
const p = getProps();
|
|
1538
1504
|
if (p.isDisabled || p.isReadOnly) return false;
|
|
@@ -1615,16 +1581,13 @@ function createNumberFieldState(props) {
|
|
|
1615
1581
|
decrementToMin
|
|
1616
1582
|
};
|
|
1617
1583
|
}
|
|
1618
|
-
|
|
1619
|
-
// src/searchfield/createSearchFieldState.ts
|
|
1620
|
-
import { createSignal as createSignal13, createMemo as createMemo3 } from "solid-js";
|
|
1621
1584
|
function createSearchFieldState(props) {
|
|
1622
1585
|
const getProps = () => access(props);
|
|
1623
1586
|
const isControlled = () => getProps().value !== void 0;
|
|
1624
|
-
const [internalValue, setInternalValue] =
|
|
1587
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
1625
1588
|
getProps().defaultValue ?? ""
|
|
1626
1589
|
);
|
|
1627
|
-
const value =
|
|
1590
|
+
const value = createMemo(() => {
|
|
1628
1591
|
const p = getProps();
|
|
1629
1592
|
return isControlled() ? p.value ?? "" : internalValue();
|
|
1630
1593
|
});
|
|
@@ -1640,9 +1603,6 @@ function createSearchFieldState(props) {
|
|
|
1640
1603
|
setValue
|
|
1641
1604
|
};
|
|
1642
1605
|
}
|
|
1643
|
-
|
|
1644
|
-
// src/slider/createSliderState.ts
|
|
1645
|
-
import { createSignal as createSignal14, createMemo as createMemo4 } from "solid-js";
|
|
1646
1606
|
var DEFAULT_MIN = 0;
|
|
1647
1607
|
var DEFAULT_MAX = 100;
|
|
1648
1608
|
var DEFAULT_STEP = 1;
|
|
@@ -1664,20 +1624,20 @@ function createSliderState(props) {
|
|
|
1664
1624
|
const isDisabled = getProps().isDisabled ?? false;
|
|
1665
1625
|
const pageStep = Math.max(step, snapToStep2((maxValue - minValue) / 10, 0, maxValue - minValue, step));
|
|
1666
1626
|
const isControlled = () => getProps().value !== void 0;
|
|
1667
|
-
const [internalValue, setInternalValue] =
|
|
1627
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
1668
1628
|
snapToStep2(getProps().defaultValue ?? minValue, minValue, maxValue, step)
|
|
1669
1629
|
);
|
|
1670
|
-
const [isDragging, setIsDragging] =
|
|
1671
|
-
const [isFocused, setIsFocused] =
|
|
1672
|
-
const value =
|
|
1630
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
1631
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
1632
|
+
const value = createMemo(() => {
|
|
1673
1633
|
const p = getProps();
|
|
1674
1634
|
const rawValue = isControlled() ? p.value ?? minValue : internalValue();
|
|
1675
1635
|
return snapToStep2(rawValue, minValue, maxValue, step);
|
|
1676
1636
|
});
|
|
1677
|
-
const getValuePercent =
|
|
1637
|
+
const getValuePercent = createMemo(() => {
|
|
1678
1638
|
return (value() - minValue) / (maxValue - minValue);
|
|
1679
1639
|
});
|
|
1680
|
-
const getFormattedValue =
|
|
1640
|
+
const getFormattedValue = createMemo(() => {
|
|
1681
1641
|
const p = getProps();
|
|
1682
1642
|
const formatter = new Intl.NumberFormat(p.locale, p.formatOptions);
|
|
1683
1643
|
return formatter.format(value());
|
|
@@ -1734,9 +1694,6 @@ function createSliderState(props) {
|
|
|
1734
1694
|
isDisabled
|
|
1735
1695
|
};
|
|
1736
1696
|
}
|
|
1737
|
-
|
|
1738
|
-
// src/tooltip/createTooltipTriggerState.ts
|
|
1739
|
-
import { createSignal as createSignal15, onCleanup } from "solid-js";
|
|
1740
1697
|
var TOOLTIP_DELAY = 1500;
|
|
1741
1698
|
var TOOLTIP_COOLDOWN = 500;
|
|
1742
1699
|
var tooltips = {};
|
|
@@ -1763,7 +1720,7 @@ function createTooltipTriggerState(props = {}) {
|
|
|
1763
1720
|
const overlayState = createOverlayTriggerState(props);
|
|
1764
1721
|
const id = `tooltip-${++tooltipId}`;
|
|
1765
1722
|
let closeTimeout = null;
|
|
1766
|
-
const [closeCallback, setCloseCallback] =
|
|
1723
|
+
const [closeCallback, setCloseCallback] = createSignal(() => overlayState.close());
|
|
1767
1724
|
const ensureTooltipEntry = () => {
|
|
1768
1725
|
tooltips[id] = hideTooltip;
|
|
1769
1726
|
};
|
|
@@ -1856,9 +1813,6 @@ function createTooltipTriggerState(props = {}) {
|
|
|
1856
1813
|
close: hideTooltip
|
|
1857
1814
|
};
|
|
1858
1815
|
}
|
|
1859
|
-
|
|
1860
|
-
// src/toast/createToastState.ts
|
|
1861
|
-
import { createSignal as createSignal16, onCleanup as onCleanup2 } from "solid-js";
|
|
1862
1816
|
var Timer = class {
|
|
1863
1817
|
timerId = null;
|
|
1864
1818
|
startTime = 0;
|
|
@@ -2020,11 +1974,11 @@ var ToastQueue = class {
|
|
|
2020
1974
|
}
|
|
2021
1975
|
};
|
|
2022
1976
|
function createToastState(props) {
|
|
2023
|
-
const [visibleToasts, setVisibleToasts] =
|
|
1977
|
+
const [visibleToasts, setVisibleToasts] = createSignal([]);
|
|
2024
1978
|
const unsubscribe = props.queue.subscribe((toasts) => {
|
|
2025
1979
|
setVisibleToasts(toasts);
|
|
2026
1980
|
});
|
|
2027
|
-
|
|
1981
|
+
onCleanup(() => {
|
|
2028
1982
|
unsubscribe();
|
|
2029
1983
|
});
|
|
2030
1984
|
return {
|
|
@@ -2040,12 +1994,9 @@ function createToastQueue(options) {
|
|
|
2040
1994
|
const state = createToastState({ queue });
|
|
2041
1995
|
return { ...state, queue };
|
|
2042
1996
|
}
|
|
2043
|
-
|
|
2044
|
-
// src/disclosure/createDisclosureState.ts
|
|
2045
|
-
import { createSignal as createSignal17, createEffect as createEffect2 } from "solid-js";
|
|
2046
1997
|
function createDisclosureState(props = {}) {
|
|
2047
1998
|
const propsAccessor = () => access(props);
|
|
2048
|
-
const [internalExpanded, setInternalExpanded] =
|
|
1999
|
+
const [internalExpanded, setInternalExpanded] = createSignal(
|
|
2049
2000
|
propsAccessor().defaultExpanded ?? false
|
|
2050
2001
|
);
|
|
2051
2002
|
const isExpanded = () => {
|
|
@@ -2072,7 +2023,7 @@ function createDisclosureState(props = {}) {
|
|
|
2072
2023
|
}
|
|
2073
2024
|
function createDisclosureGroupState(props = {}) {
|
|
2074
2025
|
const propsAccessor = () => access(props);
|
|
2075
|
-
const [internalKeys, setInternalKeys] =
|
|
2026
|
+
const [internalKeys, setInternalKeys] = createSignal(
|
|
2076
2027
|
new Set(propsAccessor().defaultExpandedKeys ?? [])
|
|
2077
2028
|
);
|
|
2078
2029
|
const expandedKeys = () => {
|
|
@@ -2086,7 +2037,7 @@ function createDisclosureGroupState(props = {}) {
|
|
|
2086
2037
|
}
|
|
2087
2038
|
p.onExpandedChange?.(keys);
|
|
2088
2039
|
};
|
|
2089
|
-
|
|
2040
|
+
createEffect(() => {
|
|
2090
2041
|
const p = propsAccessor();
|
|
2091
2042
|
const allowsMultiple = p.allowsMultipleExpanded ?? false;
|
|
2092
2043
|
const keys = expandedKeys();
|
|
@@ -2132,22 +2083,6 @@ function createDisclosureGroupState(props = {}) {
|
|
|
2132
2083
|
isExpanded
|
|
2133
2084
|
};
|
|
2134
2085
|
}
|
|
2135
|
-
|
|
2136
|
-
// src/calendar/createCalendarState.ts
|
|
2137
|
-
import { createSignal as createSignal18, createMemo as createMemo5 } from "solid-js";
|
|
2138
|
-
import {
|
|
2139
|
-
today,
|
|
2140
|
-
getLocalTimeZone,
|
|
2141
|
-
isSameDay,
|
|
2142
|
-
isSameMonth,
|
|
2143
|
-
startOfMonth,
|
|
2144
|
-
endOfMonth,
|
|
2145
|
-
startOfWeek,
|
|
2146
|
-
getWeeksInMonth,
|
|
2147
|
-
getDayOfWeek,
|
|
2148
|
-
DateFormatter,
|
|
2149
|
-
toCalendarDate as intlToCalendarDate
|
|
2150
|
-
} from "@internationalized/date";
|
|
2151
2086
|
function createCalendarState(props = {}) {
|
|
2152
2087
|
const timeZone = getLocalTimeZone();
|
|
2153
2088
|
const locale = props.locale ?? "en-US";
|
|
@@ -2169,22 +2104,22 @@ function createCalendarState(props = {}) {
|
|
|
2169
2104
|
}
|
|
2170
2105
|
return today(timeZone);
|
|
2171
2106
|
};
|
|
2172
|
-
const [internalValue, setInternalValue] =
|
|
2107
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
2173
2108
|
props.defaultValue ?? null
|
|
2174
2109
|
);
|
|
2175
|
-
const [focusedDate, setFocusedDateInternal] =
|
|
2110
|
+
const [focusedDate, setFocusedDateInternal] = createSignal(
|
|
2176
2111
|
getInitialFocusedDate()
|
|
2177
2112
|
);
|
|
2178
|
-
const [isFocused, setFocused] =
|
|
2179
|
-
const [isPaginating, setIsPaginating] =
|
|
2180
|
-
const value =
|
|
2113
|
+
const [isFocused, setFocused] = createSignal(false);
|
|
2114
|
+
const [isPaginating, setIsPaginating] = createSignal(false);
|
|
2115
|
+
const value = createMemo(() => {
|
|
2181
2116
|
const controlled = access(props.value);
|
|
2182
2117
|
return controlled !== void 0 ? controlled : internalValue();
|
|
2183
2118
|
});
|
|
2184
|
-
const isDisabled =
|
|
2185
|
-
const isReadOnly =
|
|
2186
|
-
const validationState =
|
|
2187
|
-
const visibleRange =
|
|
2119
|
+
const isDisabled = createMemo(() => access(props.isDisabled) ?? false);
|
|
2120
|
+
const isReadOnly = createMemo(() => access(props.isReadOnly) ?? false);
|
|
2121
|
+
const validationState = createMemo(() => access(props.validationState));
|
|
2122
|
+
const visibleRange = createMemo(() => {
|
|
2188
2123
|
const focused = focusedDate();
|
|
2189
2124
|
const start = startOfMonth(focused);
|
|
2190
2125
|
let end = endOfMonth(focused);
|
|
@@ -2193,7 +2128,7 @@ function createCalendarState(props = {}) {
|
|
|
2193
2128
|
}
|
|
2194
2129
|
return { start, end };
|
|
2195
2130
|
});
|
|
2196
|
-
const weekDays =
|
|
2131
|
+
const weekDays = createMemo(() => {
|
|
2197
2132
|
const formatter = new DateFormatter(locale, { weekday: "short" });
|
|
2198
2133
|
const startDay = props.firstDayOfWeek ?? 0;
|
|
2199
2134
|
const days = [];
|
|
@@ -2206,7 +2141,7 @@ function createCalendarState(props = {}) {
|
|
|
2206
2141
|
}
|
|
2207
2142
|
return days;
|
|
2208
2143
|
});
|
|
2209
|
-
const title =
|
|
2144
|
+
const title = createMemo(() => {
|
|
2210
2145
|
const formatter = new DateFormatter(locale, {
|
|
2211
2146
|
month: "long",
|
|
2212
2147
|
year: "numeric"
|
|
@@ -2372,26 +2307,10 @@ function createCalendarState(props = {}) {
|
|
|
2372
2307
|
};
|
|
2373
2308
|
}
|
|
2374
2309
|
function toCalendarDate(date) {
|
|
2375
|
-
return
|
|
2310
|
+
return toCalendarDate$1(date);
|
|
2376
2311
|
}
|
|
2377
|
-
|
|
2378
|
-
// src/calendar/createRangeCalendarState.ts
|
|
2379
|
-
import { createSignal as createSignal19, createMemo as createMemo6 } from "solid-js";
|
|
2380
|
-
import {
|
|
2381
|
-
today as today2,
|
|
2382
|
-
getLocalTimeZone as getLocalTimeZone2,
|
|
2383
|
-
isSameDay as isSameDay2,
|
|
2384
|
-
isSameMonth as isSameMonth2,
|
|
2385
|
-
startOfMonth as startOfMonth2,
|
|
2386
|
-
endOfMonth as endOfMonth2,
|
|
2387
|
-
startOfWeek as startOfWeek2,
|
|
2388
|
-
getWeeksInMonth as getWeeksInMonth2,
|
|
2389
|
-
getDayOfWeek as getDayOfWeek2,
|
|
2390
|
-
DateFormatter as DateFormatter2,
|
|
2391
|
-
toCalendarDate as intlToCalendarDate2
|
|
2392
|
-
} from "@internationalized/date";
|
|
2393
2312
|
function createRangeCalendarState(props = {}) {
|
|
2394
|
-
const timeZone =
|
|
2313
|
+
const timeZone = getLocalTimeZone();
|
|
2395
2314
|
const locale = props.locale ?? "en-US";
|
|
2396
2315
|
const visibleMonths = props.visibleMonths ?? 1;
|
|
2397
2316
|
const getInitialFocusedDate = () => {
|
|
@@ -2409,25 +2328,25 @@ function createRangeCalendarState(props = {}) {
|
|
|
2409
2328
|
if (props.defaultValue?.start) {
|
|
2410
2329
|
return toCalendarDate2(props.defaultValue.start);
|
|
2411
2330
|
}
|
|
2412
|
-
return
|
|
2331
|
+
return today(timeZone);
|
|
2413
2332
|
};
|
|
2414
|
-
const [internalValue, setInternalValue] =
|
|
2333
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
2415
2334
|
props.defaultValue ?? null
|
|
2416
2335
|
);
|
|
2417
|
-
const [focusedDate, setFocusedDateInternal] =
|
|
2336
|
+
const [focusedDate, setFocusedDateInternal] = createSignal(
|
|
2418
2337
|
getInitialFocusedDate()
|
|
2419
2338
|
);
|
|
2420
|
-
const [anchorDate, setAnchorDate] =
|
|
2421
|
-
const [isFocused, setFocused] =
|
|
2422
|
-
const [isDragging, setDragging] =
|
|
2423
|
-
const value =
|
|
2339
|
+
const [anchorDate, setAnchorDate] = createSignal(null);
|
|
2340
|
+
const [isFocused, setFocused] = createSignal(false);
|
|
2341
|
+
const [isDragging, setDragging] = createSignal(false);
|
|
2342
|
+
const value = createMemo(() => {
|
|
2424
2343
|
const controlled = access(props.value);
|
|
2425
2344
|
return controlled !== void 0 ? controlled : internalValue();
|
|
2426
2345
|
});
|
|
2427
|
-
const isDisabled =
|
|
2428
|
-
const isReadOnly =
|
|
2429
|
-
const validationState =
|
|
2430
|
-
const highlightedRange =
|
|
2346
|
+
const isDisabled = createMemo(() => access(props.isDisabled) ?? false);
|
|
2347
|
+
const isReadOnly = createMemo(() => access(props.isReadOnly) ?? false);
|
|
2348
|
+
const validationState = createMemo(() => access(props.validationState));
|
|
2349
|
+
const highlightedRange = createMemo(() => {
|
|
2431
2350
|
const anchor = anchorDate();
|
|
2432
2351
|
if (!anchor) {
|
|
2433
2352
|
const v = value();
|
|
@@ -2445,21 +2364,21 @@ function createRangeCalendarState(props = {}) {
|
|
|
2445
2364
|
}
|
|
2446
2365
|
return { start: focused, end: anchor };
|
|
2447
2366
|
});
|
|
2448
|
-
const visibleRange =
|
|
2367
|
+
const visibleRange = createMemo(() => {
|
|
2449
2368
|
const focused = focusedDate();
|
|
2450
|
-
const start =
|
|
2451
|
-
let end =
|
|
2369
|
+
const start = startOfMonth(focused);
|
|
2370
|
+
let end = endOfMonth(focused);
|
|
2452
2371
|
for (let i = 1; i < visibleMonths; i++) {
|
|
2453
|
-
end =
|
|
2372
|
+
end = endOfMonth(end.add({ months: 1 }));
|
|
2454
2373
|
}
|
|
2455
2374
|
return { start, end };
|
|
2456
2375
|
});
|
|
2457
|
-
const weekDays =
|
|
2458
|
-
const formatter = new
|
|
2376
|
+
const weekDays = createMemo(() => {
|
|
2377
|
+
const formatter = new DateFormatter(locale, { weekday: "short" });
|
|
2459
2378
|
const startDay = props.firstDayOfWeek ?? 0;
|
|
2460
2379
|
const days = [];
|
|
2461
|
-
const base =
|
|
2462
|
-
const dayOfWeek =
|
|
2380
|
+
const base = today(timeZone);
|
|
2381
|
+
const dayOfWeek = getDayOfWeek(base, locale);
|
|
2463
2382
|
const weekStart = base.subtract({ days: (dayOfWeek - startDay + 7) % 7 });
|
|
2464
2383
|
for (let i = 0; i < 7; i++) {
|
|
2465
2384
|
const day = weekStart.add({ days: i });
|
|
@@ -2467,8 +2386,8 @@ function createRangeCalendarState(props = {}) {
|
|
|
2467
2386
|
}
|
|
2468
2387
|
return days;
|
|
2469
2388
|
});
|
|
2470
|
-
const title =
|
|
2471
|
-
const formatter = new
|
|
2389
|
+
const title = createMemo(() => {
|
|
2390
|
+
const formatter = new DateFormatter(locale, {
|
|
2472
2391
|
month: "long",
|
|
2473
2392
|
year: "numeric"
|
|
2474
2393
|
});
|
|
@@ -2506,15 +2425,15 @@ function createRangeCalendarState(props = {}) {
|
|
|
2506
2425
|
const isSelectionStart = (date) => {
|
|
2507
2426
|
const range = highlightedRange();
|
|
2508
2427
|
if (!range) return false;
|
|
2509
|
-
return
|
|
2428
|
+
return isSameDay(toCalendarDate2(date), range.start);
|
|
2510
2429
|
};
|
|
2511
2430
|
const isSelectionEnd = (date) => {
|
|
2512
2431
|
const range = highlightedRange();
|
|
2513
2432
|
if (!range) return false;
|
|
2514
|
-
return
|
|
2433
|
+
return isSameDay(toCalendarDate2(date), range.end);
|
|
2515
2434
|
};
|
|
2516
2435
|
const isCellFocused = (date) => {
|
|
2517
|
-
return
|
|
2436
|
+
return isSameDay(toCalendarDate2(date), focusedDate());
|
|
2518
2437
|
};
|
|
2519
2438
|
const isCellUnavailable = (date) => {
|
|
2520
2439
|
return props.isDateUnavailable?.(date) ?? false;
|
|
@@ -2532,7 +2451,7 @@ function createRangeCalendarState(props = {}) {
|
|
|
2532
2451
|
const isOutsideVisibleRange = (date) => {
|
|
2533
2452
|
const range = visibleRange();
|
|
2534
2453
|
const calDate = toCalendarDate2(date);
|
|
2535
|
-
return !
|
|
2454
|
+
return !isSameMonth(calDate, range.start) && !isSameMonth(calDate, range.end);
|
|
2536
2455
|
};
|
|
2537
2456
|
const isInvalid = (date) => {
|
|
2538
2457
|
return isCellDisabled(date) || isCellUnavailable(date);
|
|
@@ -2562,10 +2481,10 @@ function createRangeCalendarState(props = {}) {
|
|
|
2562
2481
|
setFocusedDate(focusedDate().add({ weeks: 1 }));
|
|
2563
2482
|
};
|
|
2564
2483
|
const focusPageStart = () => {
|
|
2565
|
-
setFocusedDate(
|
|
2484
|
+
setFocusedDate(startOfMonth(focusedDate()));
|
|
2566
2485
|
};
|
|
2567
2486
|
const focusPageEnd = () => {
|
|
2568
|
-
setFocusedDate(
|
|
2487
|
+
setFocusedDate(endOfMonth(focusedDate()));
|
|
2569
2488
|
};
|
|
2570
2489
|
const selectFocusedDate = () => {
|
|
2571
2490
|
if (isReadOnly() || isDisabled()) return;
|
|
@@ -2599,8 +2518,8 @@ function createRangeCalendarState(props = {}) {
|
|
|
2599
2518
|
};
|
|
2600
2519
|
const getDatesInWeek = (weekIndex, monthStartDate) => {
|
|
2601
2520
|
const startDate = monthStartDate ?? visibleRange().start;
|
|
2602
|
-
const monthStart =
|
|
2603
|
-
const weekStart =
|
|
2521
|
+
const monthStart = startOfMonth(startDate);
|
|
2522
|
+
const weekStart = startOfWeek(monthStart, locale);
|
|
2604
2523
|
const week = [];
|
|
2605
2524
|
const firstDayOfWeek = weekStart.add({ weeks: weekIndex });
|
|
2606
2525
|
for (let i = 0; i < 7; i++) {
|
|
@@ -2611,7 +2530,7 @@ function createRangeCalendarState(props = {}) {
|
|
|
2611
2530
|
};
|
|
2612
2531
|
const getWeeksInMonthFn = (date) => {
|
|
2613
2532
|
const monthDate = date ?? focusedDate();
|
|
2614
|
-
return
|
|
2533
|
+
return getWeeksInMonth(monthDate, locale);
|
|
2615
2534
|
};
|
|
2616
2535
|
return {
|
|
2617
2536
|
value,
|
|
@@ -2658,41 +2577,31 @@ function createRangeCalendarState(props = {}) {
|
|
|
2658
2577
|
};
|
|
2659
2578
|
}
|
|
2660
2579
|
function toCalendarDate2(date) {
|
|
2661
|
-
return
|
|
2580
|
+
return toCalendarDate$1(date);
|
|
2662
2581
|
}
|
|
2663
|
-
|
|
2664
|
-
// src/calendar/createDateFieldState.ts
|
|
2665
|
-
import { createSignal as createSignal20, createMemo as createMemo7 } from "solid-js";
|
|
2666
|
-
import {
|
|
2667
|
-
today as today3,
|
|
2668
|
-
getLocalTimeZone as getLocalTimeZone3,
|
|
2669
|
-
DateFormatter as DateFormatter3,
|
|
2670
|
-
toCalendarDate as intlToCalendarDate3,
|
|
2671
|
-
toCalendarDateTime
|
|
2672
|
-
} from "@internationalized/date";
|
|
2673
2582
|
function createDateFieldState(props = {}) {
|
|
2674
|
-
const timeZone =
|
|
2583
|
+
const timeZone = getLocalTimeZone();
|
|
2675
2584
|
const locale = props.locale ?? "en-US";
|
|
2676
2585
|
const granularity = props.granularity ?? "day";
|
|
2677
|
-
const [internalValue, setInternalValue] =
|
|
2586
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
2678
2587
|
props.defaultValue ?? null
|
|
2679
2588
|
);
|
|
2680
|
-
const [placeholderDate, setPlaceholderDate] =
|
|
2681
|
-
const value =
|
|
2589
|
+
const [placeholderDate, setPlaceholderDate] = createSignal({});
|
|
2590
|
+
const value = createMemo(() => {
|
|
2682
2591
|
const controlled = access(props.value);
|
|
2683
2592
|
return controlled !== void 0 ? controlled : internalValue();
|
|
2684
2593
|
});
|
|
2685
|
-
const dateValue =
|
|
2594
|
+
const dateValue = createMemo(() => {
|
|
2686
2595
|
const v = value();
|
|
2687
2596
|
if (v) return v;
|
|
2688
2597
|
const parts = placeholderDate();
|
|
2689
|
-
const placeholder = props.placeholderValue ??
|
|
2598
|
+
const placeholder = props.placeholderValue ?? today(timeZone);
|
|
2690
2599
|
if (Object.keys(parts).length === 0) return null;
|
|
2691
2600
|
const year = parts.year ?? placeholder.year;
|
|
2692
2601
|
const month = parts.month ?? placeholder.month;
|
|
2693
2602
|
const day = parts.day ?? placeholder.day;
|
|
2694
2603
|
if (granularity === "day") {
|
|
2695
|
-
return
|
|
2604
|
+
return toCalendarDate$1(placeholder).set({ year, month, day });
|
|
2696
2605
|
}
|
|
2697
2606
|
const hour = parts.hour ?? 0;
|
|
2698
2607
|
const minute = parts.minute ?? 0;
|
|
@@ -2706,11 +2615,11 @@ function createDateFieldState(props = {}) {
|
|
|
2706
2615
|
second
|
|
2707
2616
|
});
|
|
2708
2617
|
});
|
|
2709
|
-
const isDisabled =
|
|
2710
|
-
const isReadOnly =
|
|
2711
|
-
const isRequired =
|
|
2712
|
-
const validationState =
|
|
2713
|
-
const isInvalid =
|
|
2618
|
+
const isDisabled = createMemo(() => access(props.isDisabled) ?? false);
|
|
2619
|
+
const isReadOnly = createMemo(() => access(props.isReadOnly) ?? false);
|
|
2620
|
+
const isRequired = createMemo(() => access(props.isRequired) ?? false);
|
|
2621
|
+
const validationState = createMemo(() => access(props.validationState));
|
|
2622
|
+
const isInvalid = createMemo(() => {
|
|
2714
2623
|
const v = value();
|
|
2715
2624
|
if (!v) return false;
|
|
2716
2625
|
const minValue = access(props.minValue);
|
|
@@ -2719,9 +2628,9 @@ function createDateFieldState(props = {}) {
|
|
|
2719
2628
|
if (maxValue && v.compare(maxValue) > 0) return true;
|
|
2720
2629
|
return validationState() === "invalid";
|
|
2721
2630
|
});
|
|
2722
|
-
const segments =
|
|
2631
|
+
const segments = createMemo(() => {
|
|
2723
2632
|
const v = value();
|
|
2724
|
-
const placeholder = props.placeholderValue ??
|
|
2633
|
+
const placeholder = props.placeholderValue ?? today(timeZone);
|
|
2725
2634
|
const parts = placeholderDate();
|
|
2726
2635
|
const segs = [];
|
|
2727
2636
|
const formatOptions = {
|
|
@@ -2739,7 +2648,7 @@ function createDateFieldState(props = {}) {
|
|
|
2739
2648
|
formatOptions.hourCycle = props.hourCycle === 12 ? "h12" : "h23";
|
|
2740
2649
|
}
|
|
2741
2650
|
}
|
|
2742
|
-
const formatter = new
|
|
2651
|
+
const formatter = new DateFormatter(locale, formatOptions);
|
|
2743
2652
|
const dateToFormat = v ?? placeholder;
|
|
2744
2653
|
const formattedParts = formatter.formatToParts(dateToFormat.toDate(timeZone));
|
|
2745
2654
|
for (const part of formattedParts) {
|
|
@@ -2754,7 +2663,6 @@ function createDateFieldState(props = {}) {
|
|
|
2754
2663
|
});
|
|
2755
2664
|
} else if (type) {
|
|
2756
2665
|
const segValue = getSegmentValue(v, type);
|
|
2757
|
-
const placeholderValue = getSegmentValue(placeholder, type);
|
|
2758
2666
|
const partValue = parts[type];
|
|
2759
2667
|
const hasValue = v !== null || partValue !== void 0;
|
|
2760
2668
|
segs.push({
|
|
@@ -2799,7 +2707,7 @@ function createDateFieldState(props = {}) {
|
|
|
2799
2707
|
if (isDisabled() || isReadOnly()) return;
|
|
2800
2708
|
const v = value();
|
|
2801
2709
|
const current = v ? getSegmentValue(v, type) : placeholderDate()[type];
|
|
2802
|
-
const max = getMaxValue(type, v ?? props.placeholderValue ??
|
|
2710
|
+
const max = getMaxValue(type, v ?? props.placeholderValue ?? today(timeZone));
|
|
2803
2711
|
const min = getMinValue(type);
|
|
2804
2712
|
const newValue = current !== void 0 ? current + 1 : min;
|
|
2805
2713
|
setSegment(type, newValue > max ? min : newValue);
|
|
@@ -2808,7 +2716,7 @@ function createDateFieldState(props = {}) {
|
|
|
2808
2716
|
if (isDisabled() || isReadOnly()) return;
|
|
2809
2717
|
const v = value();
|
|
2810
2718
|
const current = v ? getSegmentValue(v, type) : placeholderDate()[type];
|
|
2811
|
-
const max = getMaxValue(type, v ?? props.placeholderValue ??
|
|
2719
|
+
const max = getMaxValue(type, v ?? props.placeholderValue ?? today(timeZone));
|
|
2812
2720
|
const min = getMinValue(type);
|
|
2813
2721
|
const newValue = current !== void 0 ? current - 1 : max;
|
|
2814
2722
|
setSegment(type, newValue < min ? max : newValue);
|
|
@@ -2850,7 +2758,7 @@ function createDateFieldState(props = {}) {
|
|
|
2850
2758
|
options.second = "2-digit";
|
|
2851
2759
|
}
|
|
2852
2760
|
}
|
|
2853
|
-
const formatter = new
|
|
2761
|
+
const formatter = new DateFormatter(locale, options);
|
|
2854
2762
|
return formatter.format(v.toDate(timeZone));
|
|
2855
2763
|
};
|
|
2856
2764
|
return {
|
|
@@ -2993,31 +2901,24 @@ function updateDatePart(date, type, value) {
|
|
|
2993
2901
|
return date;
|
|
2994
2902
|
}
|
|
2995
2903
|
}
|
|
2996
|
-
|
|
2997
|
-
// src/calendar/createTimeFieldState.ts
|
|
2998
|
-
import { createSignal as createSignal21, createMemo as createMemo8 } from "solid-js";
|
|
2999
|
-
import {
|
|
3000
|
-
getLocalTimeZone as getLocalTimeZone4,
|
|
3001
|
-
DateFormatter as DateFormatter4
|
|
3002
|
-
} from "@internationalized/date";
|
|
3003
2904
|
function createTimeFieldState(props = {}) {
|
|
3004
|
-
|
|
2905
|
+
getLocalTimeZone();
|
|
3005
2906
|
const locale = props.locale ?? "en-US";
|
|
3006
2907
|
const granularity = props.granularity ?? "minute";
|
|
3007
2908
|
const hourCycle = props.hourCycle ?? 12;
|
|
3008
|
-
const [internalValue, setInternalValue] =
|
|
2909
|
+
const [internalValue, setInternalValue] = createSignal(
|
|
3009
2910
|
props.defaultValue ?? null
|
|
3010
2911
|
);
|
|
3011
|
-
const [placeholderParts, setPlaceholderParts] =
|
|
3012
|
-
const value =
|
|
2912
|
+
const [placeholderParts, setPlaceholderParts] = createSignal({});
|
|
2913
|
+
const value = createMemo(() => {
|
|
3013
2914
|
const controlled = access(props.value);
|
|
3014
2915
|
return controlled !== void 0 ? controlled : internalValue();
|
|
3015
2916
|
});
|
|
3016
|
-
const isDisabled =
|
|
3017
|
-
const isReadOnly =
|
|
3018
|
-
const isRequired =
|
|
3019
|
-
const validationState =
|
|
3020
|
-
const isInvalid =
|
|
2917
|
+
const isDisabled = createMemo(() => access(props.isDisabled) ?? false);
|
|
2918
|
+
const isReadOnly = createMemo(() => access(props.isReadOnly) ?? false);
|
|
2919
|
+
const isRequired = createMemo(() => access(props.isRequired) ?? false);
|
|
2920
|
+
const validationState = createMemo(() => access(props.validationState));
|
|
2921
|
+
const isInvalid = createMemo(() => {
|
|
3021
2922
|
const v = value();
|
|
3022
2923
|
if (!v) return false;
|
|
3023
2924
|
const minValue = access(props.minValue);
|
|
@@ -3026,7 +2927,7 @@ function createTimeFieldState(props = {}) {
|
|
|
3026
2927
|
if (maxValue && compareTime(v, maxValue) > 0) return true;
|
|
3027
2928
|
return validationState() === "invalid";
|
|
3028
2929
|
});
|
|
3029
|
-
const segments =
|
|
2930
|
+
const segments = createMemo(() => {
|
|
3030
2931
|
const v = value();
|
|
3031
2932
|
const parts = placeholderParts();
|
|
3032
2933
|
const segs = [];
|
|
@@ -3042,7 +2943,7 @@ function createTimeFieldState(props = {}) {
|
|
|
3042
2943
|
if (v) {
|
|
3043
2944
|
baseDate.setHours(getHour(v), getMinute(v), getSecond(v));
|
|
3044
2945
|
}
|
|
3045
|
-
const formatter = new
|
|
2946
|
+
const formatter = new DateFormatter(locale, formatOptions);
|
|
3046
2947
|
const formattedParts = formatter.formatToParts(baseDate);
|
|
3047
2948
|
for (const part of formattedParts) {
|
|
3048
2949
|
const type = mapTimePartType(part.type);
|
|
@@ -3088,7 +2989,7 @@ function createTimeFieldState(props = {}) {
|
|
|
3088
2989
|
if (type === "literal") return;
|
|
3089
2990
|
const v = value();
|
|
3090
2991
|
if (v) {
|
|
3091
|
-
const updated = updateTimePart(v, type, newValue
|
|
2992
|
+
const updated = updateTimePart(v, type, newValue);
|
|
3092
2993
|
setValue(updated);
|
|
3093
2994
|
} else {
|
|
3094
2995
|
setPlaceholderParts((prev) => ({
|
|
@@ -3277,71 +3178,31 @@ function compareTime(a, b) {
|
|
|
3277
3178
|
const bSecond = getSecond(b);
|
|
3278
3179
|
return aSecond - bSecond;
|
|
3279
3180
|
}
|
|
3280
|
-
|
|
3281
|
-
// src/calendar/index.ts
|
|
3282
|
-
import {
|
|
3283
|
-
today as today4,
|
|
3284
|
-
now,
|
|
3285
|
-
getLocalTimeZone as getLocalTimeZone5,
|
|
3286
|
-
parseDate,
|
|
3287
|
-
parseDateTime,
|
|
3288
|
-
parseTime,
|
|
3289
|
-
parseAbsolute,
|
|
3290
|
-
parseAbsoluteToLocal,
|
|
3291
|
-
parseZonedDateTime,
|
|
3292
|
-
toCalendarDate as toCalendarDate3,
|
|
3293
|
-
toCalendarDateTime as toCalendarDateTime2,
|
|
3294
|
-
toZoned,
|
|
3295
|
-
toTime,
|
|
3296
|
-
CalendarDate,
|
|
3297
|
-
CalendarDateTime,
|
|
3298
|
-
ZonedDateTime,
|
|
3299
|
-
Time,
|
|
3300
|
-
DateFormatter as DateFormatter5,
|
|
3301
|
-
isSameDay as isSameDay3,
|
|
3302
|
-
isSameMonth as isSameMonth3,
|
|
3303
|
-
isSameYear,
|
|
3304
|
-
isToday,
|
|
3305
|
-
isWeekend,
|
|
3306
|
-
startOfMonth as startOfMonth3,
|
|
3307
|
-
endOfMonth as endOfMonth3,
|
|
3308
|
-
startOfWeek as startOfWeek3,
|
|
3309
|
-
endOfWeek,
|
|
3310
|
-
startOfYear,
|
|
3311
|
-
endOfYear,
|
|
3312
|
-
getWeeksInMonth as getWeeksInMonth3,
|
|
3313
|
-
getDayOfWeek as getDayOfWeek3,
|
|
3314
|
-
minDate,
|
|
3315
|
-
maxDate
|
|
3316
|
-
} from "@internationalized/date";
|
|
3317
|
-
|
|
3318
|
-
// src/grid/createGridState.ts
|
|
3319
|
-
import { createSignal as createSignal22, createEffect as createEffect3, createMemo as createMemo9, on } from "solid-js";
|
|
3320
3181
|
function createGridState(options) {
|
|
3321
3182
|
const getOptions = () => options();
|
|
3322
|
-
const disabledKeys =
|
|
3183
|
+
const disabledKeys = createMemo(() => {
|
|
3323
3184
|
const keys = getOptions().disabledKeys;
|
|
3324
3185
|
return keys ? new Set(keys) : /* @__PURE__ */ new Set();
|
|
3325
3186
|
});
|
|
3326
|
-
const [isFocused, setIsFocused] =
|
|
3327
|
-
const [focusedKey, setFocusedKeyInternal] =
|
|
3328
|
-
const [childFocusStrategy, setChildFocusStrategy] =
|
|
3329
|
-
const [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] =
|
|
3330
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
3187
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
3188
|
+
const [focusedKey, setFocusedKeyInternal] = createSignal(null);
|
|
3189
|
+
const [childFocusStrategy, setChildFocusStrategy] = createSignal(null);
|
|
3190
|
+
const [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = createSignal(false);
|
|
3191
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = createSignal(
|
|
3331
3192
|
getInitialSelection2(getOptions().defaultSelectedKeys)
|
|
3332
3193
|
);
|
|
3333
|
-
const [anchorKey, setAnchorKey] =
|
|
3334
|
-
const selectedKeys =
|
|
3194
|
+
const [anchorKey, setAnchorKey] = createSignal(null);
|
|
3195
|
+
const selectedKeys = createMemo(() => {
|
|
3335
3196
|
const opts = getOptions();
|
|
3336
3197
|
if (opts.selectedKeys !== void 0) {
|
|
3337
3198
|
return normalizeSelection2(opts.selectedKeys);
|
|
3338
3199
|
}
|
|
3339
3200
|
return internalSelectedKeys();
|
|
3340
3201
|
});
|
|
3341
|
-
const selectionMode =
|
|
3342
|
-
|
|
3343
|
-
const disallowEmptySelection =
|
|
3344
|
-
const focusMode =
|
|
3202
|
+
const selectionMode = createMemo(() => getOptions().selectionMode ?? "none");
|
|
3203
|
+
createMemo(() => getOptions().selectionBehavior ?? "toggle");
|
|
3204
|
+
const disallowEmptySelection = createMemo(() => getOptions().disallowEmptySelection ?? false);
|
|
3205
|
+
const focusMode = createMemo(() => getOptions().focusMode ?? "row");
|
|
3345
3206
|
const setFocusedKey = (key, strategy = "first") => {
|
|
3346
3207
|
const opts = getOptions();
|
|
3347
3208
|
const collection = opts.collection;
|
|
@@ -3360,7 +3221,7 @@ function createGridState(options) {
|
|
|
3360
3221
|
setChildFocusStrategy(strategy);
|
|
3361
3222
|
};
|
|
3362
3223
|
let cachedCollection = null;
|
|
3363
|
-
|
|
3224
|
+
createEffect(
|
|
3364
3225
|
on(
|
|
3365
3226
|
() => getOptions().collection,
|
|
3366
3227
|
(collection) => {
|
|
@@ -3548,9 +3409,6 @@ function normalizeSelection2(keys) {
|
|
|
3548
3409
|
if (keys === "all") return "all";
|
|
3549
3410
|
return new Set(keys);
|
|
3550
3411
|
}
|
|
3551
|
-
|
|
3552
|
-
// src/table/createTableState.ts
|
|
3553
|
-
import { createMemo as createMemo10 } from "solid-js";
|
|
3554
3412
|
var OPPOSITE_SORT_DIRECTION = {
|
|
3555
3413
|
ascending: "descending",
|
|
3556
3414
|
descending: "ascending"
|
|
@@ -3568,10 +3426,10 @@ function createTableState(options) {
|
|
|
3568
3426
|
defaultSelectedKeys: getOptions().defaultSelectedKeys,
|
|
3569
3427
|
onSelectionChange: getOptions().onSelectionChange
|
|
3570
3428
|
}));
|
|
3571
|
-
const sortDescriptor =
|
|
3429
|
+
const sortDescriptor = createMemo(() => {
|
|
3572
3430
|
return getOptions().sortDescriptor ?? null;
|
|
3573
3431
|
});
|
|
3574
|
-
const showSelectionCheckboxes =
|
|
3432
|
+
const showSelectionCheckboxes = createMemo(() => {
|
|
3575
3433
|
return getOptions().showSelectionCheckboxes ?? false;
|
|
3576
3434
|
});
|
|
3577
3435
|
const sort = (columnKey, direction) => {
|
|
@@ -3915,55 +3773,52 @@ var TableCollection = class {
|
|
|
3915
3773
|
function createTableCollection(options) {
|
|
3916
3774
|
return new TableCollection(options);
|
|
3917
3775
|
}
|
|
3918
|
-
|
|
3919
|
-
// src/tree/createTreeState.ts
|
|
3920
|
-
import { createSignal as createSignal23, createEffect as createEffect4, createMemo as createMemo11, on as on2 } from "solid-js";
|
|
3921
3776
|
function createTreeState(options) {
|
|
3922
3777
|
const getOptions = () => options();
|
|
3923
|
-
const disabledKeys =
|
|
3778
|
+
const disabledKeys = createMemo(() => {
|
|
3924
3779
|
const keys = getOptions().disabledKeys;
|
|
3925
3780
|
return keys ? new Set(keys) : /* @__PURE__ */ new Set();
|
|
3926
3781
|
});
|
|
3927
|
-
const [internalExpandedKeys, setInternalExpandedKeys] =
|
|
3782
|
+
const [internalExpandedKeys, setInternalExpandedKeys] = createSignal(
|
|
3928
3783
|
getInitialExpandedKeys(getOptions().defaultExpandedKeys)
|
|
3929
3784
|
);
|
|
3930
|
-
const expandedKeys =
|
|
3785
|
+
const expandedKeys = createMemo(() => {
|
|
3931
3786
|
const opts = getOptions();
|
|
3932
3787
|
if (opts.expandedKeys !== void 0) {
|
|
3933
3788
|
return new Set(opts.expandedKeys);
|
|
3934
3789
|
}
|
|
3935
3790
|
return internalExpandedKeys();
|
|
3936
3791
|
});
|
|
3937
|
-
const collection =
|
|
3792
|
+
const collection = createMemo(() => {
|
|
3938
3793
|
const opts = getOptions();
|
|
3939
3794
|
return opts.collectionFactory(expandedKeys());
|
|
3940
3795
|
});
|
|
3941
|
-
const [isFocused, setIsFocused] =
|
|
3942
|
-
const [focusedKey, setFocusedKeyInternal] =
|
|
3943
|
-
const [childFocusStrategy, setChildFocusStrategy] =
|
|
3944
|
-
const [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] =
|
|
3945
|
-
const [internalSelectedKeys, setInternalSelectedKeys] =
|
|
3796
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
3797
|
+
const [focusedKey, setFocusedKeyInternal] = createSignal(null);
|
|
3798
|
+
const [childFocusStrategy, setChildFocusStrategy] = createSignal(null);
|
|
3799
|
+
const [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = createSignal(false);
|
|
3800
|
+
const [internalSelectedKeys, setInternalSelectedKeys] = createSignal(
|
|
3946
3801
|
getInitialSelection3(getOptions().defaultSelectedKeys)
|
|
3947
3802
|
);
|
|
3948
|
-
const [anchorKey, setAnchorKey] =
|
|
3949
|
-
const selectedKeys =
|
|
3803
|
+
const [anchorKey, setAnchorKey] = createSignal(null);
|
|
3804
|
+
const selectedKeys = createMemo(() => {
|
|
3950
3805
|
const opts = getOptions();
|
|
3951
3806
|
if (opts.selectedKeys !== void 0) {
|
|
3952
3807
|
return normalizeSelection3(opts.selectedKeys);
|
|
3953
3808
|
}
|
|
3954
3809
|
return internalSelectedKeys();
|
|
3955
3810
|
});
|
|
3956
|
-
const selectionMode =
|
|
3957
|
-
|
|
3958
|
-
const disallowEmptySelection =
|
|
3959
|
-
const disabledBehavior =
|
|
3811
|
+
const selectionMode = createMemo(() => getOptions().selectionMode ?? "none");
|
|
3812
|
+
createMemo(() => getOptions().selectionBehavior ?? "toggle");
|
|
3813
|
+
const disallowEmptySelection = createMemo(() => getOptions().disallowEmptySelection ?? false);
|
|
3814
|
+
const disabledBehavior = createMemo(() => getOptions().disabledBehavior ?? "all");
|
|
3960
3815
|
const setFocusedKey = (key, strategy = "first") => {
|
|
3961
3816
|
setFocusedKeyInternal(key);
|
|
3962
3817
|
setChildFocusStrategy(strategy);
|
|
3963
3818
|
};
|
|
3964
3819
|
let cachedCollection = null;
|
|
3965
|
-
|
|
3966
|
-
|
|
3820
|
+
createEffect(
|
|
3821
|
+
on(collection, (coll) => {
|
|
3967
3822
|
const currentFocusedKey = focusedKey();
|
|
3968
3823
|
if (currentFocusedKey != null && cachedCollection) {
|
|
3969
3824
|
const visibleKeys = [...coll.getKeys()];
|
|
@@ -5080,13 +4935,10 @@ function normalizeColor(value) {
|
|
|
5080
4935
|
}
|
|
5081
4936
|
return value;
|
|
5082
4937
|
}
|
|
5083
|
-
|
|
5084
|
-
// src/color/createColorSliderState.ts
|
|
5085
|
-
import { createSignal as createSignal24, createMemo as createMemo12 } from "solid-js";
|
|
5086
4938
|
function createColorSliderState(options) {
|
|
5087
4939
|
const getOptions = () => options();
|
|
5088
|
-
const [internalValue, setInternalValue] =
|
|
5089
|
-
const [isDragging, setIsDragging] =
|
|
4940
|
+
const [internalValue, setInternalValue] = createSignal(null);
|
|
4941
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
5090
4942
|
const initValue = () => {
|
|
5091
4943
|
const opts = getOptions();
|
|
5092
4944
|
if (opts.defaultValue) {
|
|
@@ -5100,21 +4952,21 @@ function createColorSliderState(options) {
|
|
|
5100
4952
|
setInternalValue(init);
|
|
5101
4953
|
}
|
|
5102
4954
|
}
|
|
5103
|
-
const value =
|
|
4955
|
+
const value = createMemo(() => {
|
|
5104
4956
|
const opts = getOptions();
|
|
5105
4957
|
if (opts.value !== void 0) {
|
|
5106
4958
|
return normalizeColor(opts.value);
|
|
5107
4959
|
}
|
|
5108
4960
|
return internalValue() ?? normalizeColor("#ff0000");
|
|
5109
4961
|
});
|
|
5110
|
-
const channel =
|
|
5111
|
-
const isDisabled =
|
|
5112
|
-
const locale =
|
|
5113
|
-
const channelRange =
|
|
5114
|
-
const step =
|
|
5115
|
-
const pageSize =
|
|
5116
|
-
const minValue =
|
|
5117
|
-
const maxValue =
|
|
4962
|
+
const channel = createMemo(() => getOptions().channel);
|
|
4963
|
+
const isDisabled = createMemo(() => getOptions().isDisabled ?? false);
|
|
4964
|
+
const locale = createMemo(() => getOptions().locale ?? "en-US");
|
|
4965
|
+
const channelRange = createMemo(() => value().getChannelRange(channel()));
|
|
4966
|
+
const step = createMemo(() => channelRange().step);
|
|
4967
|
+
const pageSize = createMemo(() => channelRange().pageSize);
|
|
4968
|
+
const minValue = createMemo(() => channelRange().minValue);
|
|
4969
|
+
const maxValue = createMemo(() => channelRange().maxValue);
|
|
5118
4970
|
const updateValue = (newColor) => {
|
|
5119
4971
|
const opts = getOptions();
|
|
5120
4972
|
if (opts.value !== void 0) {
|
|
@@ -5210,13 +5062,10 @@ function createColorSliderState(options) {
|
|
|
5210
5062
|
getThumbValueLabel
|
|
5211
5063
|
};
|
|
5212
5064
|
}
|
|
5213
|
-
|
|
5214
|
-
// src/color/createColorAreaState.ts
|
|
5215
|
-
import { createSignal as createSignal25, createMemo as createMemo13 } from "solid-js";
|
|
5216
5065
|
function createColorAreaState(options) {
|
|
5217
5066
|
const getOptions = () => options();
|
|
5218
|
-
const [internalValue, setInternalValue] =
|
|
5219
|
-
const [isDragging, setIsDragging] =
|
|
5067
|
+
const [internalValue, setInternalValue] = createSignal(null);
|
|
5068
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
5220
5069
|
const initValue = () => {
|
|
5221
5070
|
const opts = getOptions();
|
|
5222
5071
|
if (opts.defaultValue) {
|
|
@@ -5230,30 +5079,30 @@ function createColorAreaState(options) {
|
|
|
5230
5079
|
setInternalValue(init);
|
|
5231
5080
|
}
|
|
5232
5081
|
}
|
|
5233
|
-
const value =
|
|
5082
|
+
const value = createMemo(() => {
|
|
5234
5083
|
const opts = getOptions();
|
|
5235
5084
|
if (opts.value !== void 0) {
|
|
5236
5085
|
return normalizeColor(opts.value);
|
|
5237
5086
|
}
|
|
5238
5087
|
return internalValue() ?? normalizeColor("#ff0000");
|
|
5239
5088
|
});
|
|
5240
|
-
const isDisabled =
|
|
5241
|
-
const axes =
|
|
5089
|
+
const isDisabled = createMemo(() => getOptions().isDisabled ?? false);
|
|
5090
|
+
const axes = createMemo(() => {
|
|
5242
5091
|
const opts = getOptions();
|
|
5243
5092
|
return value().getColorSpaceAxes({
|
|
5244
5093
|
xChannel: opts.xChannel,
|
|
5245
5094
|
yChannel: opts.yChannel
|
|
5246
5095
|
});
|
|
5247
5096
|
});
|
|
5248
|
-
const xChannel =
|
|
5249
|
-
const yChannel =
|
|
5250
|
-
const zChannel =
|
|
5251
|
-
const xRange =
|
|
5252
|
-
const yRange =
|
|
5253
|
-
const xChannelStep =
|
|
5254
|
-
const yChannelStep =
|
|
5255
|
-
const xChannelPageStep =
|
|
5256
|
-
const yChannelPageStep =
|
|
5097
|
+
const xChannel = createMemo(() => axes().xChannel);
|
|
5098
|
+
const yChannel = createMemo(() => axes().yChannel);
|
|
5099
|
+
const zChannel = createMemo(() => axes().zChannel);
|
|
5100
|
+
const xRange = createMemo(() => value().getChannelRange(xChannel()));
|
|
5101
|
+
const yRange = createMemo(() => value().getChannelRange(yChannel()));
|
|
5102
|
+
const xChannelStep = createMemo(() => xRange().step);
|
|
5103
|
+
const yChannelStep = createMemo(() => yRange().step);
|
|
5104
|
+
const xChannelPageStep = createMemo(() => xRange().pageSize);
|
|
5105
|
+
const yChannelPageStep = createMemo(() => yRange().pageSize);
|
|
5257
5106
|
const updateValue = (newColor) => {
|
|
5258
5107
|
const opts = getOptions();
|
|
5259
5108
|
if (opts.value !== void 0) {
|
|
@@ -5373,13 +5222,10 @@ function createColorAreaState(options) {
|
|
|
5373
5222
|
getDisplayColor
|
|
5374
5223
|
};
|
|
5375
5224
|
}
|
|
5376
|
-
|
|
5377
|
-
// src/color/createColorWheelState.ts
|
|
5378
|
-
import { createSignal as createSignal26, createMemo as createMemo14 } from "solid-js";
|
|
5379
5225
|
function createColorWheelState(options) {
|
|
5380
5226
|
const getOptions = () => options();
|
|
5381
|
-
const [internalValue, setInternalValue] =
|
|
5382
|
-
const [isDragging, setIsDragging] =
|
|
5227
|
+
const [internalValue, setInternalValue] = createSignal(null);
|
|
5228
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
5383
5229
|
const initValue = () => {
|
|
5384
5230
|
const opts = getOptions();
|
|
5385
5231
|
if (opts.defaultValue) {
|
|
@@ -5393,17 +5239,17 @@ function createColorWheelState(options) {
|
|
|
5393
5239
|
setInternalValue(init);
|
|
5394
5240
|
}
|
|
5395
5241
|
}
|
|
5396
|
-
const value =
|
|
5242
|
+
const value = createMemo(() => {
|
|
5397
5243
|
const opts = getOptions();
|
|
5398
5244
|
if (opts.value !== void 0) {
|
|
5399
5245
|
return normalizeColor(opts.value);
|
|
5400
5246
|
}
|
|
5401
5247
|
return internalValue() ?? normalizeColor("#ff0000");
|
|
5402
5248
|
});
|
|
5403
|
-
const isDisabled =
|
|
5404
|
-
const hueRange =
|
|
5405
|
-
const step =
|
|
5406
|
-
const pageStep =
|
|
5249
|
+
const isDisabled = createMemo(() => getOptions().isDisabled ?? false);
|
|
5250
|
+
const hueRange = createMemo(() => value().getChannelRange("hue"));
|
|
5251
|
+
const step = createMemo(() => hueRange().step);
|
|
5252
|
+
const pageStep = createMemo(() => hueRange().pageSize);
|
|
5407
5253
|
const updateValue = (newColor) => {
|
|
5408
5254
|
const opts = getOptions();
|
|
5409
5255
|
if (opts.value !== void 0) {
|
|
@@ -5478,14 +5324,11 @@ function createColorWheelState(options) {
|
|
|
5478
5324
|
getDisplayColor
|
|
5479
5325
|
};
|
|
5480
5326
|
}
|
|
5481
|
-
|
|
5482
|
-
// src/color/createColorFieldState.ts
|
|
5483
|
-
import { createSignal as createSignal27, createMemo as createMemo15 } from "solid-js";
|
|
5484
5327
|
function createColorFieldState(options) {
|
|
5485
5328
|
const getOptions = () => options();
|
|
5486
|
-
const [internalValue, setInternalValue] =
|
|
5487
|
-
const [inputValue, setInputValueInternal] =
|
|
5488
|
-
const [isInvalid, setIsInvalid] =
|
|
5329
|
+
const [internalValue, setInternalValue] = createSignal(null);
|
|
5330
|
+
const [inputValue, setInputValueInternal] = createSignal("");
|
|
5331
|
+
const [isInvalid, setIsInvalid] = createSignal(false);
|
|
5489
5332
|
const initValue = () => {
|
|
5490
5333
|
const opts = getOptions();
|
|
5491
5334
|
if (opts.defaultValue) {
|
|
@@ -5501,7 +5344,7 @@ function createColorFieldState(options) {
|
|
|
5501
5344
|
setInputValueInternal(formatColorValue(init, getOptions().channel, getOptions().colorFormat));
|
|
5502
5345
|
}
|
|
5503
5346
|
}
|
|
5504
|
-
const value =
|
|
5347
|
+
const value = createMemo(() => {
|
|
5505
5348
|
const opts = getOptions();
|
|
5506
5349
|
if (opts.value !== void 0) {
|
|
5507
5350
|
if (opts.value === null) return null;
|
|
@@ -5509,9 +5352,9 @@ function createColorFieldState(options) {
|
|
|
5509
5352
|
}
|
|
5510
5353
|
return internalValue();
|
|
5511
5354
|
});
|
|
5512
|
-
const channel =
|
|
5513
|
-
const isDisabled =
|
|
5514
|
-
const isReadOnly =
|
|
5355
|
+
const channel = createMemo(() => getOptions().channel);
|
|
5356
|
+
const isDisabled = createMemo(() => getOptions().isDisabled ?? false);
|
|
5357
|
+
const isReadOnly = createMemo(() => getOptions().isReadOnly ?? false);
|
|
5515
5358
|
function formatColorValue(color, chan, format) {
|
|
5516
5359
|
if (!color) return "";
|
|
5517
5360
|
if (chan) {
|
|
@@ -5654,12 +5497,9 @@ function createColorFieldState(options) {
|
|
|
5654
5497
|
validate
|
|
5655
5498
|
};
|
|
5656
5499
|
}
|
|
5657
|
-
|
|
5658
|
-
// src/dnd/createDragState.ts
|
|
5659
|
-
import { createSignal as createSignal28, createMemo as createMemo16 } from "solid-js";
|
|
5660
5500
|
function createDragState(props) {
|
|
5661
|
-
const getProps =
|
|
5662
|
-
const [isDragging, setIsDragging] =
|
|
5501
|
+
const getProps = createMemo(() => props());
|
|
5502
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
5663
5503
|
const startDrag = (x, y) => {
|
|
5664
5504
|
const p = getProps();
|
|
5665
5505
|
if (p.isDisabled) return;
|
|
@@ -5731,12 +5571,9 @@ function createDragState(props) {
|
|
|
5731
5571
|
getAllowedDropOperations
|
|
5732
5572
|
};
|
|
5733
5573
|
}
|
|
5734
|
-
|
|
5735
|
-
// src/dnd/createDropState.ts
|
|
5736
|
-
import { createSignal as createSignal29, createMemo as createMemo17 } from "solid-js";
|
|
5737
5574
|
function createDropState(props) {
|
|
5738
|
-
const getProps =
|
|
5739
|
-
const [isDropTarget, setIsDropTarget] =
|
|
5575
|
+
const getProps = createMemo(() => props());
|
|
5576
|
+
const [isDropTarget, setIsDropTarget] = createSignal(false);
|
|
5740
5577
|
const enterTarget = (x, y) => {
|
|
5741
5578
|
const p = getProps();
|
|
5742
5579
|
if (p.isDisabled) return;
|
|
@@ -5829,13 +5666,10 @@ function createDropState(props) {
|
|
|
5829
5666
|
getDropOperationForPoint
|
|
5830
5667
|
};
|
|
5831
5668
|
}
|
|
5832
|
-
|
|
5833
|
-
// src/dnd/createDraggableCollectionState.ts
|
|
5834
|
-
import { createSignal as createSignal30, createMemo as createMemo18 } from "solid-js";
|
|
5835
5669
|
function createDraggableCollectionState(props) {
|
|
5836
|
-
const getProps =
|
|
5837
|
-
const [isDragging, setIsDragging] =
|
|
5838
|
-
const [draggingKeys, setDraggingKeys] =
|
|
5670
|
+
const getProps = createMemo(() => props());
|
|
5671
|
+
const [isDragging, setIsDragging] = createSignal(false);
|
|
5672
|
+
const [draggingKeys, setDraggingKeys] = createSignal(
|
|
5839
5673
|
/* @__PURE__ */ new Set()
|
|
5840
5674
|
);
|
|
5841
5675
|
const startDrag = (keys, x, y) => {
|
|
@@ -5915,14 +5749,11 @@ function createDraggableCollectionState(props) {
|
|
|
5915
5749
|
getAllowedDropOperations
|
|
5916
5750
|
};
|
|
5917
5751
|
}
|
|
5918
|
-
|
|
5919
|
-
// src/dnd/createDroppableCollectionState.ts
|
|
5920
|
-
import { createSignal as createSignal31, createMemo as createMemo19 } from "solid-js";
|
|
5921
5752
|
var DIRECTORY_DRAG_TYPE = /* @__PURE__ */ Symbol("directory");
|
|
5922
5753
|
function createDroppableCollectionState(props) {
|
|
5923
|
-
const getProps =
|
|
5924
|
-
const [isDropTarget, setIsDropTarget] =
|
|
5925
|
-
const [target, setTarget] =
|
|
5754
|
+
const getProps = createMemo(() => props());
|
|
5755
|
+
const [isDropTarget, setIsDropTarget] = createSignal(false);
|
|
5756
|
+
const [target, setTarget] = createSignal(null);
|
|
5926
5757
|
const isAccepted = (types) => {
|
|
5927
5758
|
const p = getProps();
|
|
5928
5759
|
const acceptedTypes = p.acceptedDragTypes ?? "all";
|
|
@@ -6114,15 +5945,6 @@ function targetsEqual(a, b) {
|
|
|
6114
5945
|
}
|
|
6115
5946
|
return false;
|
|
6116
5947
|
}
|
|
6117
|
-
|
|
6118
|
-
// src/form/createFormValidationState.ts
|
|
6119
|
-
import {
|
|
6120
|
-
createContext,
|
|
6121
|
-
createEffect as createEffect5,
|
|
6122
|
-
createMemo as createMemo20,
|
|
6123
|
-
createSignal as createSignal32,
|
|
6124
|
-
useContext
|
|
6125
|
-
} from "solid-js";
|
|
6126
5948
|
var VALID_VALIDITY_STATE = {
|
|
6127
5949
|
badInput: false,
|
|
6128
5950
|
customError: false,
|
|
@@ -6187,54 +6009,54 @@ function createFormValidationState(props) {
|
|
|
6187
6009
|
validate,
|
|
6188
6010
|
validationBehavior = "aria"
|
|
6189
6011
|
} = props;
|
|
6190
|
-
const isInvalidProp =
|
|
6012
|
+
const isInvalidProp = createMemo(
|
|
6191
6013
|
() => isInvalid ?? (validationState === "invalid" ? true : void 0)
|
|
6192
6014
|
);
|
|
6193
|
-
const controlledError =
|
|
6015
|
+
const controlledError = createMemo(
|
|
6194
6016
|
() => isInvalidProp() !== void 0 ? {
|
|
6195
6017
|
isInvalid: isInvalidProp(),
|
|
6196
6018
|
validationErrors: [],
|
|
6197
6019
|
validationDetails: CUSTOM_VALIDITY_STATE
|
|
6198
6020
|
} : null
|
|
6199
6021
|
);
|
|
6200
|
-
const clientError =
|
|
6022
|
+
const clientError = createMemo(() => {
|
|
6201
6023
|
if (!validate || props.value == null) {
|
|
6202
6024
|
return null;
|
|
6203
6025
|
}
|
|
6204
6026
|
const validateErrors = runValidate(validate, props.value);
|
|
6205
6027
|
return getValidationResult(validateErrors);
|
|
6206
6028
|
});
|
|
6207
|
-
const builtinValidation =
|
|
6029
|
+
const builtinValidation = createMemo(() => {
|
|
6208
6030
|
if (builtinValidationProp?.validationDetails.valid) {
|
|
6209
6031
|
return void 0;
|
|
6210
6032
|
}
|
|
6211
6033
|
return builtinValidationProp;
|
|
6212
6034
|
});
|
|
6213
6035
|
const serverErrors = useContext(FormValidationContext);
|
|
6214
|
-
const serverErrorMessages =
|
|
6036
|
+
const serverErrorMessages = createMemo(() => {
|
|
6215
6037
|
if (name) {
|
|
6216
6038
|
return Array.isArray(name) ? name.flatMap((n) => asArray(serverErrors[n])) : asArray(serverErrors[name]);
|
|
6217
6039
|
}
|
|
6218
6040
|
return [];
|
|
6219
6041
|
});
|
|
6220
|
-
const [lastServerErrors, setLastServerErrors] =
|
|
6221
|
-
const [isServerErrorCleared, setServerErrorCleared] =
|
|
6222
|
-
|
|
6042
|
+
const [lastServerErrors, setLastServerErrors] = createSignal(serverErrors);
|
|
6043
|
+
const [isServerErrorCleared, setServerErrorCleared] = createSignal(false);
|
|
6044
|
+
createEffect(() => {
|
|
6223
6045
|
if (serverErrors !== lastServerErrors()) {
|
|
6224
6046
|
setLastServerErrors(serverErrors);
|
|
6225
6047
|
setServerErrorCleared(false);
|
|
6226
6048
|
}
|
|
6227
6049
|
});
|
|
6228
|
-
const serverError =
|
|
6050
|
+
const serverError = createMemo(
|
|
6229
6051
|
() => getValidationResult(isServerErrorCleared() ? [] : serverErrorMessages())
|
|
6230
6052
|
);
|
|
6231
|
-
const [currentValidity, setCurrentValidity] =
|
|
6053
|
+
const [currentValidity, setCurrentValidity] = createSignal(
|
|
6232
6054
|
DEFAULT_VALIDATION_RESULT
|
|
6233
6055
|
);
|
|
6234
|
-
const [commitQueued, setCommitQueued] =
|
|
6056
|
+
const [commitQueued, setCommitQueued] = createSignal(false);
|
|
6235
6057
|
let nextValidation = DEFAULT_VALIDATION_RESULT;
|
|
6236
6058
|
let lastError = DEFAULT_VALIDATION_RESULT;
|
|
6237
|
-
|
|
6059
|
+
createEffect(() => {
|
|
6238
6060
|
if (!commitQueued()) {
|
|
6239
6061
|
return;
|
|
6240
6062
|
}
|
|
@@ -6245,10 +6067,10 @@ function createFormValidationState(props) {
|
|
|
6245
6067
|
setCurrentValidity(error);
|
|
6246
6068
|
}
|
|
6247
6069
|
});
|
|
6248
|
-
const realtimeValidation =
|
|
6070
|
+
const realtimeValidation = createMemo(
|
|
6249
6071
|
() => controlledError() || serverError() || clientError() || builtinValidation() || DEFAULT_VALIDATION_RESULT
|
|
6250
6072
|
);
|
|
6251
|
-
const displayValidation =
|
|
6073
|
+
const displayValidation = createMemo(() => {
|
|
6252
6074
|
if (validationBehavior === "native") {
|
|
6253
6075
|
return controlledError() || serverError() || currentValidity();
|
|
6254
6076
|
}
|
|
@@ -6304,105 +6126,5 @@ function mergeValidation(...results) {
|
|
|
6304
6126
|
validationDetails
|
|
6305
6127
|
};
|
|
6306
6128
|
}
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
CalendarDateTime as CalendarDateTimeClass,
|
|
6310
|
-
DEFAULT_VALIDATION_RESULT,
|
|
6311
|
-
DIRECTORY_DRAG_TYPE,
|
|
6312
|
-
DateFormatter5 as DateFormatter,
|
|
6313
|
-
FormValidationContext,
|
|
6314
|
-
ListCollection,
|
|
6315
|
-
TableCollection,
|
|
6316
|
-
Time as TimeClass,
|
|
6317
|
-
Timer,
|
|
6318
|
-
ToastQueue,
|
|
6319
|
-
TreeCollection,
|
|
6320
|
-
VALID_VALIDITY_STATE,
|
|
6321
|
-
ZonedDateTime as ZonedDateTimeClass,
|
|
6322
|
-
access,
|
|
6323
|
-
canUseDOM,
|
|
6324
|
-
createAutocompleteState,
|
|
6325
|
-
createCalendarState,
|
|
6326
|
-
createCheckboxGroupState,
|
|
6327
|
-
createColorAreaState,
|
|
6328
|
-
createColorFieldState,
|
|
6329
|
-
createColorSliderState,
|
|
6330
|
-
createColorWheelState,
|
|
6331
|
-
createComboBoxState,
|
|
6332
|
-
createDateFieldState,
|
|
6333
|
-
createDisclosureGroupState,
|
|
6334
|
-
createDisclosureState,
|
|
6335
|
-
createDragState,
|
|
6336
|
-
createDraggableCollectionState,
|
|
6337
|
-
createDropState,
|
|
6338
|
-
createDroppableCollectionState,
|
|
6339
|
-
createFormValidationState,
|
|
6340
|
-
createGridState,
|
|
6341
|
-
createHSBColor,
|
|
6342
|
-
createHSLColor,
|
|
6343
|
-
createId,
|
|
6344
|
-
createIsSSR,
|
|
6345
|
-
createListCollection,
|
|
6346
|
-
createListState,
|
|
6347
|
-
createMenuState,
|
|
6348
|
-
createOverlayTriggerState as createMenuTriggerState,
|
|
6349
|
-
createNumberFieldState,
|
|
6350
|
-
createOverlayTriggerState,
|
|
6351
|
-
createRGBColor,
|
|
6352
|
-
createRadioGroupState,
|
|
6353
|
-
createRangeCalendarState,
|
|
6354
|
-
createSearchFieldState,
|
|
6355
|
-
createSelectState,
|
|
6356
|
-
createSelectionState,
|
|
6357
|
-
createSingleSelectListState,
|
|
6358
|
-
createSliderState,
|
|
6359
|
-
createTabListState,
|
|
6360
|
-
createTableCollection,
|
|
6361
|
-
createTableState,
|
|
6362
|
-
createTextFieldState,
|
|
6363
|
-
createTimeFieldState,
|
|
6364
|
-
createToastQueue,
|
|
6365
|
-
createToastState,
|
|
6366
|
-
createToggleState,
|
|
6367
|
-
createTooltipTriggerState,
|
|
6368
|
-
createTreeCollection,
|
|
6369
|
-
createTreeState,
|
|
6370
|
-
defaultContainsFilter,
|
|
6371
|
-
endOfMonth3 as endOfMonth,
|
|
6372
|
-
endOfWeek,
|
|
6373
|
-
endOfYear,
|
|
6374
|
-
getDayOfWeek3 as getDayOfWeek,
|
|
6375
|
-
getLocalTimeZone5 as getLocalTimeZone,
|
|
6376
|
-
getWeeksInMonth3 as getWeeksInMonth,
|
|
6377
|
-
isAccessor,
|
|
6378
|
-
isSameDay3 as isSameDay,
|
|
6379
|
-
isSameMonth3 as isSameMonth,
|
|
6380
|
-
isSameYear,
|
|
6381
|
-
isServer,
|
|
6382
|
-
isToday,
|
|
6383
|
-
isWeekend,
|
|
6384
|
-
maxDate,
|
|
6385
|
-
mergeValidation,
|
|
6386
|
-
minDate,
|
|
6387
|
-
normalizeColor,
|
|
6388
|
-
now,
|
|
6389
|
-
parseAbsolute,
|
|
6390
|
-
parseAbsoluteToLocal,
|
|
6391
|
-
parseColor,
|
|
6392
|
-
parseDate,
|
|
6393
|
-
parseDateTime,
|
|
6394
|
-
parseTime,
|
|
6395
|
-
parseZonedDateTime,
|
|
6396
|
-
privateValidationStateProp,
|
|
6397
|
-
radioGroupSyncVersion,
|
|
6398
|
-
resetTooltipState,
|
|
6399
|
-
startOfMonth3 as startOfMonth,
|
|
6400
|
-
startOfWeek3 as startOfWeek,
|
|
6401
|
-
startOfYear,
|
|
6402
|
-
toCalendarDate3 as toCalendarDate,
|
|
6403
|
-
toCalendarDateTime2 as toCalendarDateTime,
|
|
6404
|
-
toTime,
|
|
6405
|
-
toZoned,
|
|
6406
|
-
today4 as today
|
|
6407
|
-
};
|
|
6408
|
-
//# sourceMappingURL=index.js.map
|
|
6129
|
+
|
|
6130
|
+
export { DEFAULT_VALIDATION_RESULT, DIRECTORY_DRAG_TYPE, FormValidationContext, ListCollection, TableCollection, Timer, ToastQueue, TreeCollection, VALID_VALIDITY_STATE, access, canUseDOM, createAutocompleteState, createCalendarState, createCheckboxGroupState, createColorAreaState, createColorFieldState, createColorSliderState, createColorWheelState, createComboBoxState, createDateFieldState, createDisclosureGroupState, createDisclosureState, createDragState, createDraggableCollectionState, createDropState, createDroppableCollectionState, createFormValidationState, createGridState, createHSBColor, createHSLColor, createId, createIsSSR, createListCollection, createListState, createMenuState, createOverlayTriggerState as createMenuTriggerState, createNumberFieldState, createOverlayTriggerState, createRGBColor, createRadioGroupState, createRangeCalendarState, createSearchFieldState, createSelectState, createSelectionState, createSingleSelectListState, createSliderState, createTabListState, createTableCollection, createTableState, createTextFieldState, createTimeFieldState, createToastQueue, createToastState, createToggleState, createTooltipTriggerState, createTreeCollection, createTreeState, defaultContainsFilter, isAccessor, isServer, mergeValidation, normalizeColor, parseColor, privateValidationStateProp, radioGroupSyncVersion, resetTooltipState };
|