@proyecto-viviana/solidaria-components 0.3.2 → 0.4.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/ActionBar.js +184 -0
- package/dist/ActionBar.js.map +1 -0
- package/dist/ActionBar.jsx +128 -0
- package/dist/ActionBar.jsx.map +1 -0
- package/dist/ActionGroup.js +179 -0
- package/dist/ActionGroup.js.map +1 -0
- package/dist/ActionGroup.jsx +129 -0
- package/dist/ActionGroup.jsx.map +1 -0
- package/dist/Alert.js +111 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Alert.jsx +82 -0
- package/dist/Alert.jsx.map +1 -0
- package/dist/Autocomplete.js +130 -0
- package/dist/Autocomplete.js.map +1 -0
- package/dist/Autocomplete.jsx +116 -0
- package/dist/Autocomplete.jsx.map +1 -0
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs.js +334 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/Breadcrumbs.jsx +266 -0
- package/dist/Breadcrumbs.jsx.map +1 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +348 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.jsx +314 -0
- package/dist/Button.jsx.map +1 -0
- package/dist/Calendar.d.ts +4 -4
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Calendar.js +538 -0
- package/dist/Calendar.js.map +1 -0
- package/dist/Calendar.jsx +333 -0
- package/dist/Calendar.jsx.map +1 -0
- package/dist/CalendarPicker.d.ts +33 -0
- package/dist/CalendarPicker.d.ts.map +1 -0
- package/dist/CalendarPicker.js +44 -0
- package/dist/CalendarPicker.js.map +1 -0
- package/dist/CalendarPicker.jsx +44 -0
- package/dist/CalendarPicker.jsx.map +1 -0
- package/dist/Checkbox.d.ts +83 -4
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +923 -0
- package/dist/Checkbox.js.map +1 -0
- package/dist/Checkbox.jsx +707 -0
- package/dist/Checkbox.jsx.map +1 -0
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Collection.js +202 -0
- package/dist/Collection.js.map +1 -0
- package/dist/Collection.jsx +152 -0
- package/dist/Collection.jsx.map +1 -0
- package/dist/Color.d.ts.map +1 -1
- package/dist/Color.js +1720 -0
- package/dist/Color.js.map +1 -0
- package/dist/Color.jsx +1344 -0
- package/dist/Color.jsx.map +1 -0
- package/dist/ColorEditor.js +208 -0
- package/dist/ColorEditor.js.map +1 -0
- package/dist/ColorEditor.jsx +120 -0
- package/dist/ColorEditor.jsx.map +1 -0
- package/dist/ComboBox.d.ts +4 -4
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ComboBox.js +992 -0
- package/dist/ComboBox.js.map +1 -0
- package/dist/ComboBox.jsx +714 -0
- package/dist/ComboBox.jsx.map +1 -0
- package/dist/ContextualHelpTrigger.js +146 -0
- package/dist/ContextualHelpTrigger.js.map +1 -0
- package/dist/ContextualHelpTrigger.jsx +109 -0
- package/dist/ContextualHelpTrigger.jsx.map +1 -0
- package/dist/DateField.d.ts +3 -3
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DateField.js +4 -0
- package/dist/DateField.jsx +4 -0
- package/dist/DateField2.js +499 -0
- package/dist/DateField2.js.map +1 -0
- package/dist/DateField2.jsx +317 -0
- package/dist/DateField2.jsx.map +1 -0
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DatePicker.js +991 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/DatePicker.jsx +682 -0
- package/dist/DatePicker.jsx.map +1 -0
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +337 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Dialog.jsx +192 -0
- package/dist/Dialog.jsx.map +1 -0
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/Disclosure.js +328 -0
- package/dist/Disclosure.js.map +1 -0
- package/dist/Disclosure.jsx +230 -0
- package/dist/Disclosure.jsx.map +1 -0
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragAndDrop.js +176 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/DragAndDrop.jsx +160 -0
- package/dist/DragAndDrop.jsx.map +1 -0
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/DropZone.js +189 -0
- package/dist/DropZone.js.map +1 -0
- package/dist/DropZone.jsx +144 -0
- package/dist/DropZone.jsx.map +1 -0
- package/dist/FieldError.js +66 -0
- package/dist/FieldError.js.map +1 -0
- package/dist/FieldError.jsx +47 -0
- package/dist/FieldError.jsx.map +1 -0
- package/dist/FileTrigger.js +79 -0
- package/dist/FileTrigger.js.map +1 -0
- package/dist/FileTrigger.jsx +49 -0
- package/dist/FileTrigger.jsx.map +1 -0
- package/dist/Focusable.js +70 -0
- package/dist/Focusable.js.map +1 -0
- package/dist/Focusable.jsx +69 -0
- package/dist/Focusable.jsx.map +1 -0
- package/dist/Form.js +99 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.jsx +73 -0
- package/dist/Form.jsx.map +1 -0
- package/dist/GridList.d.ts +34 -2
- package/dist/GridList.d.ts.map +1 -1
- package/dist/GridList.js +723 -0
- package/dist/GridList.js.map +1 -0
- package/dist/GridList.jsx +552 -0
- package/dist/GridList.jsx.map +1 -0
- package/dist/HiddenTimeInput.js +104 -0
- package/dist/HiddenTimeInput.js.map +1 -0
- package/dist/HiddenTimeInput.jsx +69 -0
- package/dist/HiddenTimeInput.jsx.map +1 -0
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +127 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.jsx +72 -0
- package/dist/Icon.jsx.map +1 -0
- package/dist/Keyboard.js +30 -0
- package/dist/Keyboard.js.map +1 -0
- package/dist/Keyboard.jsx +24 -0
- package/dist/Keyboard.jsx.map +1 -0
- package/dist/Landmark.js +134 -0
- package/dist/Landmark.js.map +1 -0
- package/dist/Landmark.jsx +118 -0
- package/dist/Landmark.jsx.map +1 -0
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +219 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.jsx +189 -0
- package/dist/Link.jsx.map +1 -0
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListBox.js +670 -0
- package/dist/ListBox.js.map +1 -0
- package/dist/ListBox.jsx +508 -0
- package/dist/ListBox.jsx.map +1 -0
- package/dist/Menu.d.ts +27 -9
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +1254 -0
- package/dist/Menu.js.map +1 -0
- package/dist/Menu.jsx +1042 -0
- package/dist/Menu.jsx.map +1 -0
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +123 -0
- package/dist/Meter.js.map +1 -0
- package/dist/Meter.jsx +107 -0
- package/dist/Meter.jsx.map +1 -0
- package/dist/Modal.d.ts.map +1 -1
- package/dist/Modal.js +380 -0
- package/dist/Modal.js.map +1 -0
- package/dist/Modal.jsx +314 -0
- package/dist/Modal.jsx.map +1 -0
- package/dist/NumberField.d.ts +3 -3
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/NumberField.js +573 -0
- package/dist/NumberField.js.map +1 -0
- package/dist/NumberField.jsx +443 -0
- package/dist/NumberField.jsx.map +1 -0
- package/dist/Popover.d.ts +10 -2
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +464 -0
- package/dist/Popover.js.map +1 -0
- package/dist/Popover.jsx +333 -0
- package/dist/Popover.jsx.map +1 -0
- package/dist/Pressable.js +69 -0
- package/dist/Pressable.js.map +1 -0
- package/dist/Pressable.jsx +68 -0
- package/dist/Pressable.jsx.map +1 -0
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar.js +130 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ProgressBar.jsx +114 -0
- package/dist/ProgressBar.jsx.map +1 -0
- package/dist/RadioGroup.d.ts +82 -4
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +931 -0
- package/dist/RadioGroup.js.map +1 -0
- package/dist/RadioGroup.jsx +681 -0
- package/dist/RadioGroup.jsx.map +1 -0
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RangeCalendar.js +410 -0
- package/dist/RangeCalendar.js.map +1 -0
- package/dist/RangeCalendar.jsx +253 -0
- package/dist/RangeCalendar.jsx.map +1 -0
- package/dist/RouterProvider.js +118 -0
- package/dist/RouterProvider.js.map +1 -0
- package/dist/RouterProvider.jsx +112 -0
- package/dist/RouterProvider.jsx.map +1 -0
- package/dist/SearchField.d.ts +2 -2
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/SearchField.js +643 -0
- package/dist/SearchField.js.map +1 -0
- package/dist/SearchField.jsx +526 -0
- package/dist/SearchField.jsx.map +1 -0
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +1031 -0
- package/dist/Select.js.map +1 -0
- package/dist/Select.jsx +744 -0
- package/dist/Select.jsx.map +1 -0
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/SelectionIndicator.js +86 -0
- package/dist/SelectionIndicator.js.map +1 -0
- package/dist/SelectionIndicator.jsx +50 -0
- package/dist/SelectionIndicator.jsx.map +1 -0
- package/dist/Separator.js +97 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Separator.jsx +85 -0
- package/dist/Separator.jsx.map +1 -0
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/SharedElementTransition.js +165 -0
- package/dist/SharedElementTransition.js.map +1 -0
- package/dist/SharedElementTransition.jsx +138 -0
- package/dist/SharedElementTransition.jsx.map +1 -0
- package/dist/Slider.d.ts +33 -1
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +515 -0
- package/dist/Slider.js.map +1 -0
- package/dist/Slider.jsx +403 -0
- package/dist/Slider.jsx.map +1 -0
- package/dist/StepList.js +198 -0
- package/dist/StepList.js.map +1 -0
- package/dist/StepList.jsx +141 -0
- package/dist/StepList.jsx.map +1 -0
- package/dist/Switch.d.ts +65 -2
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +534 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.jsx +393 -0
- package/dist/Switch.jsx.map +1 -0
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +1759 -0
- package/dist/Table.js.map +1 -0
- package/dist/Table.jsx +1348 -0
- package/dist/Table.jsx.map +1 -0
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +595 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tabs.jsx +367 -0
- package/dist/Tabs.jsx.map +1 -0
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/TagGroup.js +378 -0
- package/dist/TagGroup.js.map +1 -0
- package/dist/TagGroup.jsx +270 -0
- package/dist/TagGroup.jsx.map +1 -0
- package/dist/Text.d.ts +18 -6
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +42 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.jsx +35 -0
- package/dist/Text.jsx.map +1 -0
- package/dist/TextField.d.ts +6 -6
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TextField.js +436 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.jsx +403 -0
- package/dist/TextField.jsx.map +1 -0
- package/dist/TimeField.d.ts +3 -3
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/TimeField.js +372 -0
- package/dist/TimeField.js.map +1 -0
- package/dist/TimeField.jsx +224 -0
- package/dist/TimeField.jsx.map +1 -0
- package/dist/Toast.d.ts +14 -0
- package/dist/Toast.d.ts.map +1 -1
- package/dist/Toast.js +551 -0
- package/dist/Toast.js.map +1 -0
- package/dist/Toast.jsx +361 -0
- package/dist/Toast.jsx.map +1 -0
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton.js +123 -0
- package/dist/ToggleButton.js.map +1 -0
- package/dist/ToggleButton.jsx +88 -0
- package/dist/ToggleButton.jsx.map +1 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.js +114 -0
- package/dist/ToggleButtonGroup.js.map +1 -0
- package/dist/ToggleButtonGroup.jsx +85 -0
- package/dist/ToggleButtonGroup.jsx.map +1 -0
- package/dist/Toolbar.js +112 -0
- package/dist/Toolbar.js.map +1 -0
- package/dist/Toolbar.jsx +92 -0
- package/dist/Toolbar.jsx.map +1 -0
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +539 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/Tooltip.jsx +465 -0
- package/dist/Tooltip.jsx.map +1 -0
- package/dist/Tree.d.ts +14 -2
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +1424 -0
- package/dist/Tree.js.map +1 -0
- package/dist/Tree.jsx +1172 -0
- package/dist/Tree.jsx.map +1 -0
- package/dist/Virtualizer.d.ts +16 -2
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/Virtualizer.js +2 -0
- package/dist/Virtualizer.jsx +2 -0
- package/dist/Virtualizer2.js +751 -0
- package/dist/Virtualizer2.js.map +1 -0
- package/dist/Virtualizer2.jsx +730 -0
- package/dist/Virtualizer2.jsx.map +1 -0
- package/dist/VirtualizerLayouts.d.ts +18 -0
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +42 -0
- package/dist/VisuallyHidden.js.map +1 -0
- package/dist/VisuallyHidden.jsx +35 -0
- package/dist/VisuallyHidden.jsx.map +1 -0
- package/dist/contexts.js +33 -0
- package/dist/contexts.js.map +1 -0
- package/dist/contexts.jsx +33 -0
- package/dist/contexts.jsx.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -23932
- package/dist/index.jsx +70 -18337
- package/dist/useDragAndDrop.js +2 -0
- package/dist/useDragAndDrop.jsx +2 -0
- package/dist/useDragAndDrop2.js +395 -0
- package/dist/useDragAndDrop2.js.map +1 -0
- package/dist/useDragAndDrop2.jsx +395 -0
- package/dist/useDragAndDrop2.jsx.map +1 -0
- package/dist/utils.d.ts +83 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +285 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.jsx +277 -0
- package/dist/utils.jsx.map +1 -0
- package/dist/virtualizer/Layout.js +144 -0
- package/dist/virtualizer/Layout.js.map +1 -0
- package/dist/virtualizer/Layout.jsx +144 -0
- package/dist/virtualizer/Layout.jsx.map +1 -0
- package/package.json +401 -4
- package/src/Breadcrumbs.tsx +3 -1
- package/src/Button.tsx +22 -2
- package/src/Calendar.tsx +27 -10
- package/src/CalendarPicker.tsx +73 -0
- package/src/Checkbox.tsx +539 -3
- package/src/Collection.tsx +9 -3
- package/src/Color.tsx +42 -14
- package/src/ComboBox.tsx +50 -6
- package/src/DateField.tsx +20 -2
- package/src/DatePicker.tsx +57 -5
- package/src/Dialog.tsx +13 -5
- package/src/Disclosure.tsx +3 -1
- package/src/DragAndDrop.tsx +3 -1
- package/src/DropZone.tsx +3 -1
- package/src/GridList.tsx +125 -24
- package/src/Icon.tsx +3 -1
- package/src/Link.tsx +3 -1
- package/src/ListBox.tsx +31 -4
- package/src/Menu.tsx +252 -128
- package/src/Meter.tsx +3 -1
- package/src/Modal.tsx +100 -52
- package/src/NumberField.tsx +51 -8
- package/src/Popover.tsx +40 -10
- package/src/ProgressBar.tsx +3 -1
- package/src/RadioGroup.tsx +468 -4
- package/src/RangeCalendar.tsx +3 -1
- package/src/SearchField.tsx +27 -3
- package/src/Select.tsx +22 -7
- package/src/SelectionIndicator.tsx +3 -1
- package/src/SharedElementTransition.tsx +3 -1
- package/src/Slider.tsx +159 -13
- package/src/Switch.tsx +395 -2
- package/src/Table.tsx +409 -95
- package/src/Tabs.tsx +16 -45
- package/src/TagGroup.tsx +3 -1
- package/src/Text.tsx +31 -10
- package/src/TextField.tsx +43 -5
- package/src/TimeField.tsx +20 -2
- package/src/Toast.tsx +79 -14
- package/src/ToggleButton.tsx +3 -1
- package/src/ToggleButtonGroup.tsx +3 -1
- package/src/Tooltip.tsx +3 -1
- package/src/Tree.tsx +77 -9
- package/src/Virtualizer.tsx +180 -31
- package/src/VirtualizerLayouts.ts +45 -10
- package/src/index.ts +50 -0
- package/src/utils.tsx +243 -27
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { Provider, dataAttr, useIsHydrated, useRenderProps } from "./utils.jsx";
|
|
2
|
+
import { TextContext } from "./Text.jsx";
|
|
3
|
+
import { FormContext } from "./Form.jsx";
|
|
4
|
+
import { For, Show, createContext, createEffect, createMemo, createSignal, onCleanup, splitProps, useContext } from "solid-js";
|
|
5
|
+
import { createDateField, createDateSegment, createFormValidation } from "@proyecto-viviana/solidaria";
|
|
6
|
+
import { access, createDateFieldState } from "@proyecto-viviana/solid-stately";
|
|
7
|
+
//#region src/HiddenDateInput.tsx
|
|
8
|
+
/**
|
|
9
|
+
* HiddenDateInput component for solidaria-components
|
|
10
|
+
*
|
|
11
|
+
* A hidden native date/datetime-local input for form submission.
|
|
12
|
+
* Renders server-side with the initial value for SSR safety.
|
|
13
|
+
*/
|
|
14
|
+
function accessValue(value) {
|
|
15
|
+
return typeof value === "function" ? value() : value;
|
|
16
|
+
}
|
|
17
|
+
function formatDateValue(value, granularity) {
|
|
18
|
+
if (!value) return "";
|
|
19
|
+
if ("timeZone" in value) return String(value);
|
|
20
|
+
const dateValue = value;
|
|
21
|
+
const year = String(dateValue.year).padStart(4, "0");
|
|
22
|
+
const month = String(dateValue.month).padStart(2, "0");
|
|
23
|
+
const day = String(dateValue.day).padStart(2, "0");
|
|
24
|
+
if (granularity === "day") return `${year}-${month}-${day}`;
|
|
25
|
+
const hasHour = "hour" in dateValue;
|
|
26
|
+
const hour = hasHour ? String(dateValue.hour).padStart(2, "0") : "00";
|
|
27
|
+
const hasMinute = hasHour && "minute" in dateValue;
|
|
28
|
+
const minute = hasMinute ? String(dateValue.minute).padStart(2, "0") : "00";
|
|
29
|
+
if (granularity === "second" && hasMinute && "second" in dateValue) return `${year}-${month}-${day}T${hour}:${minute}:${String(dateValue.second).padStart(2, "0")}`;
|
|
30
|
+
return `${year}-${month}-${day}T${hour}:${minute}`;
|
|
31
|
+
}
|
|
32
|
+
function HiddenDateInput(props) {
|
|
33
|
+
const granularity = () => props.granularity ?? "day";
|
|
34
|
+
const hasValidationBehavior = () => props.validationBehavior != null;
|
|
35
|
+
const validationBehavior = () => props.validationBehavior;
|
|
36
|
+
const usesNativeValidation = () => validationBehavior() === "native";
|
|
37
|
+
const value = () => accessValue(props.value);
|
|
38
|
+
const minValue = () => accessValue(props.minValue);
|
|
39
|
+
const maxValue = () => accessValue(props.maxValue);
|
|
40
|
+
const hasTimeZoneValue = () => Boolean(value() && "timeZone" in value() || minValue() && "timeZone" in minValue() || maxValue() && "timeZone" in maxValue());
|
|
41
|
+
const inputType = () => usesNativeValidation() ? "text" : hasValidationBehavior() ? "hidden" : hasTimeZoneValue() ? "hidden" : granularity() === "day" ? "date" : "datetime-local";
|
|
42
|
+
const formattedValue = () => formatDateValue(value(), granularity());
|
|
43
|
+
const formattedMin = () => formatDateValue(minValue(), granularity());
|
|
44
|
+
const formattedMax = () => formatDateValue(maxValue(), granularity());
|
|
45
|
+
const [inputRef, setInputRef] = createSignal();
|
|
46
|
+
if (props.validationState) createFormValidation({
|
|
47
|
+
get validationBehavior() {
|
|
48
|
+
return validationBehavior();
|
|
49
|
+
},
|
|
50
|
+
get focus() {
|
|
51
|
+
return props.focus;
|
|
52
|
+
}
|
|
53
|
+
}, props.validationState, inputRef);
|
|
54
|
+
createEffect(() => {
|
|
55
|
+
const val = formattedValue();
|
|
56
|
+
const input = inputRef();
|
|
57
|
+
if (input && input.value !== val) input.value = val;
|
|
58
|
+
});
|
|
59
|
+
return <input ref={(el) => {
|
|
60
|
+
setInputRef(el);
|
|
61
|
+
}} type={inputType()} name={props.name} form={props.form} value={formattedValue()} autocomplete={props.autoComplete} disabled={props.isDisabled} required={usesNativeValidation() && props.isRequired ? true : void 0} hidden={usesNativeValidation() || void 0} min={hasValidationBehavior() ? void 0 : formattedMin() || void 0} max={hasValidationBehavior() ? void 0 : formattedMax() || void 0} onChange={usesNativeValidation() ? () => {} : void 0} tabIndex={-1} aria-hidden="true" style={{
|
|
62
|
+
position: "absolute",
|
|
63
|
+
width: "1px",
|
|
64
|
+
height: "1px",
|
|
65
|
+
padding: "0",
|
|
66
|
+
margin: "-1px",
|
|
67
|
+
overflow: "hidden",
|
|
68
|
+
clip: "rect(0, 0, 0, 0)",
|
|
69
|
+
"white-space": "nowrap",
|
|
70
|
+
"border-width": "0"
|
|
71
|
+
}} />;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/DateRangePickerContext.tsx
|
|
75
|
+
const DateRangePickerContext = createContext(null);
|
|
76
|
+
function useDateRangePickerContext() {
|
|
77
|
+
const context = useContext(DateRangePickerContext);
|
|
78
|
+
if (!context) throw new Error("DateRangePicker components must be used within a DateRangePicker");
|
|
79
|
+
return context;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/DateField.tsx
|
|
83
|
+
/**
|
|
84
|
+
* DateField component for solidaria-components
|
|
85
|
+
*
|
|
86
|
+
* Pre-wired headless date field component with segment-based editing.
|
|
87
|
+
* Port of react-aria-components/src/DateField.tsx
|
|
88
|
+
*/
|
|
89
|
+
const DateFieldContext = createContext(null);
|
|
90
|
+
const DateFieldStateContext = createContext(null);
|
|
91
|
+
function withFormValidationBehavior(props, formContext) {
|
|
92
|
+
if (!formContext?.validationBehavior) return props;
|
|
93
|
+
return new Proxy(props, {
|
|
94
|
+
get(target, property, receiver) {
|
|
95
|
+
const localValue = Reflect.get(target, property, receiver);
|
|
96
|
+
if (property === "validationBehavior" && localValue === void 0) return formContext.validationBehavior;
|
|
97
|
+
return localValue;
|
|
98
|
+
},
|
|
99
|
+
has(target, property) {
|
|
100
|
+
return Reflect.has(target, property) || property === "validationBehavior" && formContext.validationBehavior !== void 0;
|
|
101
|
+
},
|
|
102
|
+
ownKeys(target) {
|
|
103
|
+
const keys = new Set(Reflect.ownKeys(target));
|
|
104
|
+
if (formContext.validationBehavior !== void 0) keys.add("validationBehavior");
|
|
105
|
+
return Array.from(keys);
|
|
106
|
+
},
|
|
107
|
+
getOwnPropertyDescriptor(target, property) {
|
|
108
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
|
|
109
|
+
if (descriptor) return descriptor;
|
|
110
|
+
if (property === "validationBehavior" && formContext.validationBehavior !== void 0) return {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
configurable: true,
|
|
113
|
+
get: () => formContext.validationBehavior
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function useDateFieldContext() {
|
|
119
|
+
const context = useContext(DateFieldContext);
|
|
120
|
+
if (!context) throw new Error("DateField components must be used within a DateField");
|
|
121
|
+
return context;
|
|
122
|
+
}
|
|
123
|
+
function useDateInputContext(slot) {
|
|
124
|
+
const dateFieldContext = useContext(DateFieldContext);
|
|
125
|
+
if (dateFieldContext) return dateFieldContext;
|
|
126
|
+
const dateRangePickerContext = useContext(DateRangePickerContext);
|
|
127
|
+
if (dateRangePickerContext && slot === "start") return dateRangePickerContext.startFieldContext;
|
|
128
|
+
if (dateRangePickerContext && slot === "end") return dateRangePickerContext.endFieldContext;
|
|
129
|
+
throw new Error("DateInput components must be used within a DateField or DateRangePicker slot");
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* A date field allows users to enter and edit date values using a keyboard.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```tsx
|
|
136
|
+
* <DateField label="Date">
|
|
137
|
+
* <Label>Date</Label>
|
|
138
|
+
* <DateInput>
|
|
139
|
+
* {(segment) => <DateSegment segment={segment} />}
|
|
140
|
+
* </DateInput>
|
|
141
|
+
* </DateField>
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
function DateField(props) {
|
|
145
|
+
const isHydrated = useIsHydrated();
|
|
146
|
+
const formContext = useContext(FormContext);
|
|
147
|
+
return <Show when={isHydrated()} fallback={<div class="solidaria-DateField solidaria-DateField--placeholder" aria-hidden="true" />}>
|
|
148
|
+
<DateFieldInner {...props} __formContext={formContext} />
|
|
149
|
+
</Show>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Internal DateField component that renders after client mount.
|
|
153
|
+
*/
|
|
154
|
+
function DateFieldInner(props) {
|
|
155
|
+
const formContext = props.__formContext ?? useContext(FormContext);
|
|
156
|
+
const [local, stateProps, rest] = splitProps(withFormValidationBehavior(props, formContext), [
|
|
157
|
+
"children",
|
|
158
|
+
"class",
|
|
159
|
+
"style",
|
|
160
|
+
"slot",
|
|
161
|
+
"__formContext"
|
|
162
|
+
], [
|
|
163
|
+
"value",
|
|
164
|
+
"defaultValue",
|
|
165
|
+
"onChange",
|
|
166
|
+
"minValue",
|
|
167
|
+
"maxValue",
|
|
168
|
+
"isInvalid",
|
|
169
|
+
"isDisabled",
|
|
170
|
+
"isReadOnly",
|
|
171
|
+
"isRequired",
|
|
172
|
+
"locale",
|
|
173
|
+
"granularity",
|
|
174
|
+
"hourCycle",
|
|
175
|
+
"hideTimeZone",
|
|
176
|
+
"placeholderValue",
|
|
177
|
+
"shouldForceLeadingZeros",
|
|
178
|
+
"validationState",
|
|
179
|
+
"validationBehavior",
|
|
180
|
+
"validate",
|
|
181
|
+
"description",
|
|
182
|
+
"errorMessage",
|
|
183
|
+
"isDateUnavailable"
|
|
184
|
+
]);
|
|
185
|
+
const [fieldRef, setFieldRef] = createSignal(null);
|
|
186
|
+
const state = createDateFieldState(stateProps);
|
|
187
|
+
const fieldAria = createDateField(() => ({
|
|
188
|
+
...rest,
|
|
189
|
+
description: stateProps.description,
|
|
190
|
+
errorMessage: stateProps.errorMessage
|
|
191
|
+
}), state, fieldRef);
|
|
192
|
+
const renderValues = createMemo(() => ({
|
|
193
|
+
isDisabled: state.isDisabled(),
|
|
194
|
+
isReadOnly: state.isReadOnly(),
|
|
195
|
+
isRequired: state.isRequired(),
|
|
196
|
+
isInvalid: state.isInvalid()
|
|
197
|
+
}));
|
|
198
|
+
const renderProps = useRenderProps({
|
|
199
|
+
class: local.class,
|
|
200
|
+
style: local.style,
|
|
201
|
+
defaultClassName: "solidaria-DateField"
|
|
202
|
+
}, renderValues);
|
|
203
|
+
const validationBehavior = () => stateProps.validationBehavior ?? formContext?.validationBehavior ?? "native";
|
|
204
|
+
const textSlots = { slots: {
|
|
205
|
+
get description() {
|
|
206
|
+
return fieldAria.descriptionProps;
|
|
207
|
+
},
|
|
208
|
+
get errorMessage() {
|
|
209
|
+
return fieldAria.errorMessageProps;
|
|
210
|
+
}
|
|
211
|
+
} };
|
|
212
|
+
return <DateFieldStateContext.Provider value={state}>
|
|
213
|
+
<DateFieldContext.Provider value={{
|
|
214
|
+
state,
|
|
215
|
+
aria: {
|
|
216
|
+
labelProps: fieldAria.labelProps,
|
|
217
|
+
inputProps: fieldAria.inputProps,
|
|
218
|
+
descriptionProps: fieldAria.descriptionProps,
|
|
219
|
+
errorMessageProps: fieldAria.errorMessageProps
|
|
220
|
+
}
|
|
221
|
+
}}>
|
|
222
|
+
<div ref={setFieldRef} {...fieldAria.fieldProps} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-readonly={dataAttr(state.isReadOnly())} data-required={dataAttr(state.isRequired())} data-invalid={dataAttr(state.isInvalid())}>
|
|
223
|
+
<Provider values={[[TextContext, textSlots]]}>
|
|
224
|
+
{local.children}
|
|
225
|
+
</Provider>
|
|
226
|
+
</div>
|
|
227
|
+
<Show when={rest.name}>
|
|
228
|
+
<HiddenDateInput name={rest.name} form={rest.form} value={state.value()} autoComplete={rest.autoComplete} isDisabled={state.isDisabled()} isRequired={state.isRequired()} validationBehavior={validationBehavior()} validationState={state} focus={() => {
|
|
229
|
+
fieldRef()?.querySelector("[role=\"spinbutton\"]")?.focus();
|
|
230
|
+
}} minValue={access(stateProps.minValue)} maxValue={access(stateProps.maxValue)} granularity={state.granularity} />
|
|
231
|
+
</Show>
|
|
232
|
+
</DateFieldContext.Provider>
|
|
233
|
+
</DateFieldStateContext.Provider>;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* The input area containing date segments.
|
|
237
|
+
*/
|
|
238
|
+
function DateInput(props) {
|
|
239
|
+
const context = useDateInputContext(props.slot);
|
|
240
|
+
const { state, aria } = context;
|
|
241
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
242
|
+
const [inputRef, setInputRef] = createSignal(null);
|
|
243
|
+
const renderValues = createMemo(() => ({
|
|
244
|
+
isDisabled: state.isDisabled(),
|
|
245
|
+
isFocused: isFocused()
|
|
246
|
+
}));
|
|
247
|
+
const renderProps = useRenderProps({
|
|
248
|
+
class: props.class,
|
|
249
|
+
style: props.style,
|
|
250
|
+
defaultClassName: "solidaria-DateInput"
|
|
251
|
+
}, renderValues);
|
|
252
|
+
createEffect(() => {
|
|
253
|
+
const element = inputRef();
|
|
254
|
+
const handler = props.onPointerDownCapture;
|
|
255
|
+
if (!element || !handler) return;
|
|
256
|
+
const listener = (event) => handler(event);
|
|
257
|
+
element.addEventListener("pointerdown", listener, { capture: true });
|
|
258
|
+
onCleanup(() => element.removeEventListener("pointerdown", listener, { capture: true }));
|
|
259
|
+
});
|
|
260
|
+
return <DateFieldContext.Provider value={context}>
|
|
261
|
+
<div ref={setInputRef} {...aria.inputProps} class={renderProps.class()} style={renderProps.style()} data-disabled={dataAttr(state.isDisabled())} data-focused={dataAttr(isFocused())} onFocusIn={() => setIsFocused(true)} onFocusOut={() => setIsFocused(false)}>
|
|
262
|
+
<For each={state.segments()}>{(segment) => props.children?.(segment)}</For>
|
|
263
|
+
</div>
|
|
264
|
+
</DateFieldContext.Provider>;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* A segment of a date field (year, month, day, etc.).
|
|
268
|
+
*/
|
|
269
|
+
function DateSegment(props) {
|
|
270
|
+
const { state } = useDateFieldContext();
|
|
271
|
+
const [segmentRef, setSegmentRef] = createSignal(null);
|
|
272
|
+
const segmentAria = createDateSegment({ segment: props.segment }, state, segmentRef);
|
|
273
|
+
const renderValues = createMemo(() => ({
|
|
274
|
+
isFocused: segmentAria.isFocused,
|
|
275
|
+
isEditable: segmentAria.isEditable,
|
|
276
|
+
isPlaceholder: segmentAria.isPlaceholder,
|
|
277
|
+
type: props.segment.type,
|
|
278
|
+
text: segmentAria.text
|
|
279
|
+
}));
|
|
280
|
+
const renderProps = useRenderProps({
|
|
281
|
+
get children() {
|
|
282
|
+
return props.children;
|
|
283
|
+
},
|
|
284
|
+
class: props.class,
|
|
285
|
+
style: props.style,
|
|
286
|
+
defaultClassName: "solidaria-DateSegment"
|
|
287
|
+
}, renderValues);
|
|
288
|
+
const getChildren = () => {
|
|
289
|
+
if (typeof props.children === "function") return renderProps.renderChildren();
|
|
290
|
+
return segmentAria.text;
|
|
291
|
+
};
|
|
292
|
+
return <span ref={setSegmentRef} {...segmentAria.segmentProps} class={renderProps.class()} style={renderProps.style()} data-focused={dataAttr(segmentAria.isFocused)} data-editable={dataAttr(segmentAria.isEditable)} data-placeholder={dataAttr(segmentAria.isPlaceholder)} data-type={props.segment.type}>
|
|
293
|
+
{getChildren()}
|
|
294
|
+
</span>;
|
|
295
|
+
}
|
|
296
|
+
function DateFieldLabel(props) {
|
|
297
|
+
const { aria } = useDateFieldContext();
|
|
298
|
+
return <span {...aria.labelProps} class={props.class}>
|
|
299
|
+
{props.children}
|
|
300
|
+
</span>;
|
|
301
|
+
}
|
|
302
|
+
function DateFieldDescription(props) {
|
|
303
|
+
const { aria } = useDateFieldContext();
|
|
304
|
+
return <p {...aria.descriptionProps} class={props.class}>
|
|
305
|
+
{props.children}
|
|
306
|
+
</p>;
|
|
307
|
+
}
|
|
308
|
+
function DateFieldErrorMessage(props) {
|
|
309
|
+
const { aria } = useDateFieldContext();
|
|
310
|
+
return <p {...aria.errorMessageProps} class={props.class}>
|
|
311
|
+
{props.children}
|
|
312
|
+
</p>;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
export { DateFieldLabel as a, DateSegment as c, useDateRangePickerContext as d, HiddenDateInput as f, DateFieldErrorMessage as i, useDateFieldContext as l, DateFieldContext as n, DateFieldStateContext as o, DateFieldDescription as r, DateInput as s, DateField as t, DateRangePickerContext as u };
|
|
316
|
+
|
|
317
|
+
//# sourceMappingURL=DateField2.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateField2.jsx","names":[],"sources":["../src/HiddenDateInput.tsx","../src/DateRangePickerContext.tsx","../src/DateField.tsx"],"sourcesContent":["/**\n * HiddenDateInput component for solidaria-components\n *\n * A hidden native date/datetime-local input for form submission.\n * Renders server-side with the initial value for SSR safety.\n */\nimport { type JSX, createEffect, createSignal } from \"solid-js\";\nimport { type DateValue, type FormValidationState } from \"@proyecto-viviana/solid-stately\";\nimport { createFormValidation } from \"@proyecto-viviana/solidaria\";\n\ntype MaybeAccessor<T> = T | (() => T);\n\nexport interface HiddenDateInputProps {\n name?: string;\n form?: string;\n value?: MaybeAccessor<DateValue | null | undefined>;\n autoComplete?: string;\n isDisabled?: boolean;\n isRequired?: boolean;\n validationBehavior?: \"aria\" | \"native\";\n validationState?: FormValidationState;\n focus?: () => void;\n minValue?: MaybeAccessor<DateValue | undefined>;\n maxValue?: MaybeAccessor<DateValue | undefined>;\n granularity?: \"day\" | \"hour\" | \"minute\" | \"second\";\n}\n\nfunction accessValue<T>(value: MaybeAccessor<T> | undefined): T | undefined {\n return typeof value === \"function\" ? (value as () => T)() : value;\n}\n\nfunction formatDateValue(\n value: DateValue | undefined | null,\n granularity: \"day\" | \"hour\" | \"minute\" | \"second\",\n): string {\n if (!value) return \"\";\n\n if (\"timeZone\" in value) {\n return String(value);\n }\n\n const dateValue = value;\n\n const year = String(dateValue.year).padStart(4, \"0\");\n const month = String(dateValue.month).padStart(2, \"0\");\n const day = String(dateValue.day).padStart(2, \"0\");\n\n if (granularity === \"day\") {\n return `${year}-${month}-${day}`;\n }\n\n const hasHour = \"hour\" in dateValue;\n const hour = hasHour ? String((dateValue as { hour: number }).hour).padStart(2, \"0\") : \"00\";\n const hasMinute = hasHour && \"minute\" in dateValue;\n const minute = hasMinute\n ? String((dateValue as { minute: number }).minute).padStart(2, \"0\")\n : \"00\";\n\n if (granularity === \"second\" && hasMinute && \"second\" in dateValue) {\n const second = String((dateValue as { second: number }).second).padStart(2, \"0\");\n return `${year}-${month}-${day}T${hour}:${minute}:${second}`;\n }\n\n return `${year}-${month}-${day}T${hour}:${minute}`;\n}\n\nexport function HiddenDateInput(props: HiddenDateInputProps): JSX.Element {\n const granularity = () => props.granularity ?? \"day\";\n const hasValidationBehavior = () => props.validationBehavior != null;\n const validationBehavior = () => props.validationBehavior;\n const usesNativeValidation = () => validationBehavior() === \"native\";\n const value = () => accessValue(props.value);\n const minValue = () => accessValue(props.minValue);\n const maxValue = () => accessValue(props.maxValue);\n const hasTimeZoneValue = () =>\n Boolean(\n (value() && \"timeZone\" in value()!) ||\n (minValue() && \"timeZone\" in minValue()!) ||\n (maxValue() && \"timeZone\" in maxValue()!),\n );\n const inputType = () =>\n usesNativeValidation()\n ? \"text\"\n : hasValidationBehavior()\n ? \"hidden\"\n : hasTimeZoneValue()\n ? \"hidden\"\n : granularity() === \"day\"\n ? \"date\"\n : \"datetime-local\";\n const formattedValue = () => formatDateValue(value(), granularity());\n const formattedMin = () => formatDateValue(minValue(), granularity());\n const formattedMax = () => formatDateValue(maxValue(), granularity());\n\n const [inputRef, setInputRef] = createSignal<HTMLInputElement>();\n\n if (props.validationState) {\n createFormValidation(\n {\n get validationBehavior() {\n return validationBehavior();\n },\n get focus() {\n return props.focus;\n },\n },\n props.validationState,\n inputRef,\n );\n }\n\n createEffect(() => {\n const val = formattedValue();\n const input = inputRef();\n if (input && input.value !== val) {\n input.value = val;\n }\n });\n\n return (\n <input\n ref={(el) => {\n setInputRef(el);\n }}\n type={inputType()}\n name={props.name}\n form={props.form}\n value={formattedValue()}\n autocomplete={props.autoComplete}\n disabled={props.isDisabled}\n required={usesNativeValidation() && props.isRequired ? true : undefined}\n hidden={usesNativeValidation() || undefined}\n min={hasValidationBehavior() ? undefined : formattedMin() || undefined}\n max={hasValidationBehavior() ? undefined : formattedMax() || undefined}\n onChange={usesNativeValidation() ? () => {} : undefined}\n tabIndex={-1}\n aria-hidden=\"true\"\n style={\n {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n \"white-space\": \"nowrap\",\n \"border-width\": \"0\",\n } as JSX.CSSProperties\n }\n />\n );\n}\n","import { createContext, useContext } from \"solid-js\";\nimport { type createDateRangePicker } from \"@proyecto-viviana/solidaria\";\nimport {\n type DateFieldState,\n type DateValue,\n type RangeCalendarState,\n} from \"@proyecto-viviana/solid-stately\";\n\nexport interface DateRangePickerFieldContextValue {\n state: DateFieldState<DateValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport interface DateRangePickerContextValue {\n calendarState: RangeCalendarState<DateValue>;\n startFieldState: DateFieldState<DateValue>;\n endFieldState: DateFieldState<DateValue>;\n startFieldContext: DateRangePickerFieldContextValue;\n endFieldContext: DateRangePickerFieldContextValue;\n overlayState: {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n };\n triggerRef: () => HTMLElement | null;\n setTriggerRef: (element: HTMLElement | null) => void;\n pickerAria: ReturnType<typeof createDateRangePicker>;\n}\n\nexport const DateRangePickerContext = createContext<DateRangePickerContextValue | null>(null);\n\nexport function useDateRangePickerContext(): DateRangePickerContextValue {\n const context = useContext(DateRangePickerContext);\n if (!context) {\n throw new Error(\"DateRangePicker components must be used within a DateRangePicker\");\n }\n return context;\n}\n","/**\n * DateField component for solidaria-components\n *\n * Pre-wired headless date field component with segment-based editing.\n * Port of react-aria-components/src/DateField.tsx\n */\n\nimport {\n type JSX,\n type Context,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n splitProps,\n useContext,\n For,\n Show,\n} from \"solid-js\";\nimport {\n createDateField,\n createDateSegment,\n type AriaDateFieldProps,\n} from \"@proyecto-viviana/solidaria\";\nimport {\n createDateFieldState,\n access,\n type DateFieldState,\n type DateFieldStateProps,\n type DateSegment as DateSegmentType,\n type CalendarDate,\n type DateValue,\n} from \"@proyecto-viviana/solid-stately\";\nimport {\n type RenderChildren,\n type ClassNameOrFunction,\n type StyleOrFunction,\n type SlotProps,\n useRenderProps,\n dataAttr,\n useIsHydrated,\n Provider,\n} from \"./utils\";\nimport { TextContext } from \"./Text\";\nimport { HiddenDateInput } from \"./HiddenDateInput\";\nimport { FormContext, type FormProps } from \"./Form\";\nimport {\n DateRangePickerContext,\n type DateRangePickerFieldContextValue,\n} from \"./DateRangePickerContext\";\n\nexport interface DateFieldRenderProps {\n /** Whether the field is disabled. */\n isDisabled: boolean;\n /** Whether the field is read-only. */\n isReadOnly: boolean;\n /** Whether the field is required. */\n isRequired: boolean;\n /** Whether the field is invalid. */\n isInvalid: boolean;\n}\n\nexport interface DateFieldProps<T extends DateValue = DateValue>\n extends\n Omit<AriaDateFieldProps, \"id\" | \"isDisabled\" | \"isReadOnly\" | \"isRequired\">,\n Omit<DateFieldStateProps<T>, \"locale\">,\n SlotProps {\n /** The children of the component. */\n children?: JSX.Element | ((segment: DateSegmentType) => JSX.Element);\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateFieldRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateFieldRenderProps>;\n /** The locale to use for formatting. */\n locale?: string;\n}\n\nexport interface DateInputRenderProps {\n /** Whether the input is disabled. */\n isDisabled: boolean;\n /** Whether the input is focused. */\n isFocused: boolean;\n}\n\nexport interface DateInputProps extends SlotProps {\n /** The children of the component (render function receiving segments). */\n children?: (segment: DateSegmentType) => JSX.Element;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateInputRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateInputRenderProps>;\n /** Handler called during the pointer down capture phase. */\n onPointerDownCapture?: JSX.EventHandler<HTMLDivElement, PointerEvent>;\n}\n\nexport interface DateSegmentRenderProps {\n /** Whether the segment is focused. */\n isFocused: boolean;\n /** Whether the segment is editable. */\n isEditable: boolean;\n /** Whether the segment is a placeholder. */\n isPlaceholder: boolean;\n /** The segment type. */\n type: DateSegmentType[\"type\"];\n /** The text to display. */\n text: string;\n}\n\nexport interface DateSegmentProps extends SlotProps {\n /** The segment data. */\n segment: DateSegmentType;\n /** The children of the component. A function may be provided to receive render props. */\n children?: RenderChildren<DateSegmentRenderProps>;\n /** The CSS className for the element. */\n class?: ClassNameOrFunction<DateSegmentRenderProps>;\n /** The inline style for the element. */\n style?: StyleOrFunction<DateSegmentRenderProps>;\n}\n\nexport interface DateFieldContextValue {\n state: DateFieldState<DateValue>;\n aria: {\n labelProps: Record<string, unknown>;\n inputProps: Record<string, unknown>;\n descriptionProps: Record<string, unknown>;\n errorMessageProps: Record<string, unknown>;\n };\n}\n\nexport const DateFieldContext = createContext<DateFieldContextValue | null>(null);\nexport const DateFieldStateContext = createContext<DateFieldState<DateValue> | null>(null);\n\nfunction withFormValidationBehavior<P extends object>(props: P, formContext: FormProps | null): P {\n if (!formContext?.validationBehavior) {\n return props;\n }\n\n return new Proxy(props, {\n get(target, property, receiver) {\n const localValue = Reflect.get(target, property, receiver);\n if (property === \"validationBehavior\" && localValue === undefined) {\n return formContext.validationBehavior;\n }\n\n return localValue;\n },\n has(target, property) {\n return (\n Reflect.has(target, property) ||\n (property === \"validationBehavior\" && formContext.validationBehavior !== undefined)\n );\n },\n ownKeys(target) {\n const keys = new Set(Reflect.ownKeys(target));\n if (formContext.validationBehavior !== undefined) {\n keys.add(\"validationBehavior\");\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, property) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (descriptor) {\n return descriptor;\n }\n\n if (property === \"validationBehavior\" && formContext.validationBehavior !== undefined) {\n return {\n enumerable: true,\n configurable: true,\n get: () => formContext.validationBehavior,\n };\n }\n\n return undefined;\n },\n });\n}\n\nexport function useDateFieldContext(): DateFieldContextValue {\n const context = useContext(DateFieldContext);\n if (!context) {\n throw new Error(\"DateField components must be used within a DateField\");\n }\n return context;\n}\n\nfunction useDateInputContext(\n slot?: string,\n): DateFieldContextValue | DateRangePickerFieldContextValue {\n const dateFieldContext = useContext(DateFieldContext);\n if (dateFieldContext) {\n return dateFieldContext;\n }\n\n const dateRangePickerContext = useContext(DateRangePickerContext);\n if (dateRangePickerContext && slot === \"start\") {\n return dateRangePickerContext.startFieldContext;\n }\n if (dateRangePickerContext && slot === \"end\") {\n return dateRangePickerContext.endFieldContext;\n }\n\n throw new Error(\"DateInput components must be used within a DateField or DateRangePicker slot\");\n}\n\n/**\n * A date field allows users to enter and edit date values using a keyboard.\n *\n * @example\n * ```tsx\n * <DateField label=\"Date\">\n * <Label>Date</Label>\n * <DateInput>\n * {(segment) => <DateSegment segment={segment} />}\n * </DateInput>\n * </DateField>\n * ```\n */\nexport function DateField<T extends DateValue = CalendarDate>(\n props: DateFieldProps<T>,\n): JSX.Element {\n // Use hydration-safe pattern for client-only rendering\n const isHydrated = useIsHydrated();\n const formContext = useContext(FormContext);\n\n return (\n <Show\n when={isHydrated()}\n fallback={\n <div class=\"solidaria-DateField solidaria-DateField--placeholder\" aria-hidden=\"true\" />\n }\n >\n <DateFieldInner {...props} __formContext={formContext} />\n </Show>\n );\n}\n\ntype DateFieldInnerProps<T extends DateValue = DateValue> = DateFieldProps<T> & {\n __formContext?: FormProps | null;\n};\n\n/**\n * Internal DateField component that renders after client mount.\n */\nfunction DateFieldInner<T extends DateValue = CalendarDate>(\n props: DateFieldInnerProps<T>,\n): JSX.Element {\n const formContext = props.__formContext ?? useContext(FormContext);\n const mergedProps = withFormValidationBehavior(props, formContext);\n const [local, stateProps, rest] = splitProps(\n mergedProps,\n [\"children\", \"class\", \"style\", \"slot\", \"__formContext\"],\n [\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"minValue\",\n \"maxValue\",\n \"isInvalid\",\n \"isDisabled\",\n \"isReadOnly\",\n \"isRequired\",\n \"locale\",\n \"granularity\",\n \"hourCycle\",\n \"hideTimeZone\",\n \"placeholderValue\",\n \"shouldForceLeadingZeros\",\n \"validationState\",\n \"validationBehavior\",\n \"validate\",\n \"description\",\n \"errorMessage\",\n \"isDateUnavailable\",\n ],\n );\n\n const [fieldRef, setFieldRef] = createSignal<HTMLDivElement | null>(null);\n\n const state = createDateFieldState(stateProps);\n\n const fieldAria = createDateField(\n () => ({\n ...(rest as Record<string, unknown>),\n description: stateProps.description,\n errorMessage: stateProps.errorMessage,\n }),\n state as unknown as DateFieldState<DateValue>,\n fieldRef,\n );\n\n const renderValues = createMemo<DateFieldRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isReadOnly: state.isReadOnly(),\n isRequired: state.isRequired(),\n isInvalid: state.isInvalid(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: local.class,\n style: local.style,\n defaultClassName: \"solidaria-DateField\",\n },\n renderValues,\n );\n\n const validationBehavior = () =>\n (stateProps as { validationBehavior?: \"aria\" | \"native\" }).validationBehavior ??\n formContext?.validationBehavior ??\n \"native\";\n\n const textSlots = {\n slots: {\n get description() {\n return fieldAria.descriptionProps;\n },\n get errorMessage() {\n return fieldAria.errorMessageProps;\n },\n },\n };\n\n return (\n <DateFieldStateContext.Provider value={state as unknown as DateFieldState<DateValue>}>\n <DateFieldContext.Provider\n value={{\n state: state as unknown as DateFieldState<DateValue>,\n aria: {\n labelProps: fieldAria.labelProps,\n inputProps: fieldAria.inputProps,\n descriptionProps: fieldAria.descriptionProps,\n errorMessageProps: fieldAria.errorMessageProps,\n },\n }}\n >\n <div\n ref={setFieldRef}\n {...fieldAria.fieldProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-readonly={dataAttr(state.isReadOnly())}\n data-required={dataAttr(state.isRequired())}\n data-invalid={dataAttr(state.isInvalid())}\n >\n <Provider values={[[TextContext, textSlots]] as Array<[Context<unknown>, unknown]>}>\n {local.children as JSX.Element}\n </Provider>\n </div>\n <Show when={(rest as Record<string, unknown>).name}>\n <HiddenDateInput\n name={(rest as Record<string, unknown>).name as string | undefined}\n form={(rest as Record<string, unknown>).form as string | undefined}\n value={state.value()}\n autoComplete={(rest as Record<string, unknown>).autoComplete as string | undefined}\n isDisabled={state.isDisabled()}\n isRequired={state.isRequired()}\n validationBehavior={validationBehavior()}\n validationState={state}\n focus={() => {\n fieldRef()?.querySelector<HTMLElement>('[role=\"spinbutton\"]')?.focus();\n }}\n minValue={access(stateProps.minValue) as DateValue | undefined}\n maxValue={access(stateProps.maxValue) as DateValue | undefined}\n granularity={state.granularity}\n />\n </Show>\n </DateFieldContext.Provider>\n </DateFieldStateContext.Provider>\n );\n}\n\n/**\n * The input area containing date segments.\n */\nexport function DateInput(props: DateInputProps): JSX.Element {\n const context = useDateInputContext(props.slot);\n const { state, aria } = context;\n const [isFocused, setIsFocused] = createSignal(false);\n const [inputRef, setInputRef] = createSignal<HTMLDivElement | null>(null);\n\n const renderValues = createMemo<DateInputRenderProps>(() => ({\n isDisabled: state.isDisabled(),\n isFocused: isFocused(),\n }));\n\n const renderProps = useRenderProps(\n {\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DateInput\",\n },\n renderValues,\n );\n\n createEffect(() => {\n const element = inputRef();\n const handler = props.onPointerDownCapture;\n if (!element || !handler) return;\n\n const listener = (event: PointerEvent) =>\n (handler as unknown as (event: PointerEvent) => void)(event);\n element.addEventListener(\"pointerdown\", listener, { capture: true });\n onCleanup(() => element.removeEventListener(\"pointerdown\", listener, { capture: true }));\n });\n\n return (\n <DateFieldContext.Provider value={context as DateFieldContextValue}>\n <div\n ref={setInputRef}\n {...aria.inputProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-disabled={dataAttr(state.isDisabled())}\n data-focused={dataAttr(isFocused())}\n onFocusIn={() => setIsFocused(true)}\n onFocusOut={() => setIsFocused(false)}\n >\n <For each={state.segments()}>{(segment) => props.children?.(segment)}</For>\n </div>\n </DateFieldContext.Provider>\n );\n}\n\n/**\n * A segment of a date field (year, month, day, etc.).\n */\nexport function DateSegment(props: DateSegmentProps): JSX.Element {\n const { state } = useDateFieldContext();\n const [segmentRef, setSegmentRef] = createSignal<HTMLElement | null>(null);\n\n const segmentAria = createDateSegment({ segment: props.segment }, state, segmentRef);\n\n const renderValues = createMemo<DateSegmentRenderProps>(() => ({\n isFocused: segmentAria.isFocused,\n isEditable: segmentAria.isEditable,\n isPlaceholder: segmentAria.isPlaceholder,\n type: props.segment.type,\n text: segmentAria.text,\n }));\n\n const renderProps = useRenderProps(\n {\n get children() {\n return props.children;\n },\n class: props.class,\n style: props.style,\n defaultClassName: \"solidaria-DateSegment\",\n },\n renderValues,\n );\n\n // Determine children content - avoid Show for SSR hydration compatibility\n const getChildren = () => {\n if (typeof props.children === \"function\") {\n return renderProps.renderChildren();\n }\n return segmentAria.text;\n };\n\n return (\n <span\n ref={setSegmentRef}\n {...segmentAria.segmentProps}\n class={renderProps.class()}\n style={renderProps.style()}\n data-focused={dataAttr(segmentAria.isFocused)}\n data-editable={dataAttr(segmentAria.isEditable)}\n data-placeholder={dataAttr(segmentAria.isPlaceholder)}\n data-type={props.segment.type}\n >\n {getChildren()}\n </span>\n );\n}\n\nexport interface DateFieldLabelProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldLabel(props: DateFieldLabelProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <span {...aria.labelProps} class={props.class}>\n {props.children}\n </span>\n );\n}\n\nexport interface DateFieldDescriptionProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldDescription(props: DateFieldDescriptionProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <p {...aria.descriptionProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport interface DateFieldErrorMessageProps {\n children?: JSX.Element;\n class?: string;\n}\n\nexport function DateFieldErrorMessage(props: DateFieldErrorMessageProps): JSX.Element {\n const { aria } = useDateFieldContext();\n return (\n <p {...aria.errorMessageProps} class={props.class}>\n {props.children}\n </p>\n );\n}\n\nexport type { DateFieldState, DateSegmentType };\n"],"mappings":";;;;;;;;;;;;;AA2BA,SAAS,YAAe,OAAoD;CAC1E,OAAO,OAAO,UAAU,aAAc,MAAkB,IAAI;AAC9D;AAEA,SAAS,gBACP,OACA,aACQ;CACR,IAAI,CAAC,OAAO,OAAO;CAEnB,IAAI,cAAc,OAChB,OAAO,OAAO,KAAK;CAGrB,MAAM,YAAY;CAElB,MAAM,OAAO,OAAO,UAAU,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;CACnD,MAAM,QAAQ,OAAO,UAAU,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG;CACrD,MAAM,MAAM,OAAO,UAAU,GAAG,CAAC,CAAC,SAAS,GAAG,GAAG;CAEjD,IAAI,gBAAgB,OAClB,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG;CAG7B,MAAM,UAAU,UAAU;CAC1B,MAAM,OAAO,UAAU,OAAQ,UAA+B,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI;CACvF,MAAM,YAAY,WAAW,YAAY;CACzC,MAAM,SAAS,YACX,OAAQ,UAAiC,MAAM,CAAC,CAAC,SAAS,GAAG,GAAG,IAChE;CAEJ,IAAI,gBAAgB,YAAY,aAAa,YAAY,WAEvD,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,GAAG,OAAO,GADlC,OAAQ,UAAiC,MAAM,CAA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|
4
4
|
* Pre-wired headless date picker component that combines a date field with a calendar popup.
|
|
5
5
|
* Port of react-aria-components/src/DatePicker.tsx
|
|
6
6
|
*/
|
|
7
|
-
import { type JSX } from "solid-js";
|
|
7
|
+
import { type JSX, type Context } from "solid-js";
|
|
8
8
|
import { createDatePicker, type AriaDatePickerProps, type AriaDateRangePickerProps } from "@proyecto-viviana/solidaria";
|
|
9
9
|
import { type DateFieldState, type DatePickerState, type CalendarStateProps, type CalendarState, type RangeCalendarState, type DateFieldStateProps, type CalendarDate, type DateValue, type RangeCalendarStateProps } from "@proyecto-viviana/solid-stately";
|
|
10
10
|
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
@@ -114,9 +114,9 @@ export interface DatePickerButtonProps extends SlotProps {
|
|
|
114
114
|
}
|
|
115
115
|
export interface DateRangePickerButtonProps extends DatePickerButtonProps {
|
|
116
116
|
}
|
|
117
|
-
export declare const DatePickerContext:
|
|
118
|
-
export declare const DatePickerStateContext:
|
|
119
|
-
export declare const DateRangePickerStateContext:
|
|
117
|
+
export declare const DatePickerContext: Context<DatePickerContextValue | null>;
|
|
118
|
+
export declare const DatePickerStateContext: Context<DateFieldState<DateValue> | null>;
|
|
119
|
+
export declare const DateRangePickerStateContext: Context<RangeCalendarState<DateValue> | null>;
|
|
120
120
|
export { DateRangePickerContext, useDateRangePickerContext } from "./DateRangePickerContext";
|
|
121
121
|
export type { DateRangePickerContextValue, DateRangePickerFieldContextValue, } from "./DateRangePickerContext";
|
|
122
122
|
export declare function useDatePickerContext(): DatePickerContextValue;
|
package/dist/DatePicker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../src/DatePicker.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../src/DatePicker.tsx"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