@ecopages/radiant-ui 0.1.0-rc.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/dist/components/ui/alert/alert.d.ts +2 -4
- package/dist/components/ui/alert/alert.script.d.ts +25 -15
- package/dist/components/ui/autocomplete/autocomplete.css +1 -2
- package/dist/components/ui/autocomplete/autocomplete.d.ts +8 -3
- package/dist/components/ui/autocomplete/autocomplete.script.d.ts +29 -4
- package/dist/components/ui/avatar/avatar.css +10 -8
- package/dist/components/ui/avatar/avatar.d.ts +3 -1
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +11 -11
- package/dist/components/ui/breadcrumb/breadcrumb.script.d.ts +10 -10
- package/dist/components/ui/calendar/calendar.css +10 -5
- package/dist/components/ui/calendar/calendar.script.d.ts +24 -21
- package/dist/components/ui/calendar/index.js +1 -1
- package/dist/components/ui/calendar/index.js.map +3 -3
- package/dist/components/ui/carousel/carousel-autoplay.d.ts +22 -0
- package/dist/components/ui/carousel/carousel-swipe.d.ts +17 -0
- package/dist/components/ui/carousel/carousel-window.d.ts +63 -0
- package/dist/components/ui/carousel/carousel.css +71 -18
- package/dist/components/ui/carousel/carousel.d.ts +8 -4
- package/dist/components/ui/carousel/carousel.script.d.ts +73 -40
- package/dist/components/ui/carousel/index.js +1 -1
- package/dist/components/ui/carousel/index.js.map +4 -4
- package/dist/components/ui/checkbox/checkbox.d.ts +11 -0
- package/dist/components/ui/checkbox/checkbox.script.d.ts +31 -8
- package/dist/components/ui/checkbox/index.js +1 -1
- package/dist/components/ui/checkbox/index.js.map +4 -4
- package/dist/components/ui/checkbox-group/checkbox-group.d.ts +4 -2
- package/dist/components/ui/checkbox-group/checkbox-group.script.d.ts +39 -20
- package/dist/components/ui/checkbox-group/index.js +1 -1
- package/dist/components/ui/checkbox-group/index.js.map +4 -4
- package/dist/components/ui/combobox/combobox.css +9 -1
- package/dist/components/ui/combobox/combobox.d.ts +12 -4
- package/dist/components/ui/combobox/combobox.script.d.ts +74 -25
- package/dist/components/ui/combobox/index.d.ts +2 -2
- package/dist/components/ui/combobox/index.js +1 -1
- package/dist/components/ui/combobox/index.js.map +4 -4
- package/dist/components/ui/cycle-toggle/cycle-toggle.d.ts +6 -2
- package/dist/components/ui/cycle-toggle/cycle-toggle.script.d.ts +35 -4
- package/dist/components/ui/cycle-toggle/index.js +1 -1
- package/dist/components/ui/cycle-toggle/index.js.map +3 -3
- package/dist/components/ui/date-field/date-field.css +13 -17
- package/dist/components/ui/date-field/date-field.d.ts +10 -8
- package/dist/components/ui/date-field/date-field.script.d.ts +35 -52
- package/dist/components/ui/date-field/index.js +1 -1
- package/dist/components/ui/date-field/index.js.map +4 -4
- package/dist/components/ui/date-input/date-input-segment-dom.d.ts +24 -0
- package/dist/components/ui/date-input/date-input.css +50 -0
- package/dist/components/ui/date-input/date-input.d.ts +8 -0
- package/dist/components/ui/date-input/date-input.script.d.ts +137 -0
- package/dist/components/ui/date-input/index.d.ts +2 -0
- package/dist/components/ui/date-input/index.js +2 -0
- package/dist/components/ui/date-input/index.js.map +7 -0
- package/dist/components/ui/date-range-picker/date-range-picker.css +18 -19
- package/dist/components/ui/date-range-picker/date-range-picker.d.ts +11 -9
- package/dist/components/ui/date-range-picker/date-range-picker.script.d.ts +42 -51
- package/dist/components/ui/date-range-picker/index.js +1 -1
- package/dist/components/ui/date-range-picker/index.js.map +4 -4
- package/dist/components/ui/dialog/dialog.css +18 -14
- package/dist/components/ui/dialog/dialog.d.ts +6 -0
- package/dist/components/ui/dialog/dialog.script.d.ts +43 -10
- package/dist/components/ui/dialog/index.js +1 -1
- package/dist/components/ui/dialog/index.js.map +4 -4
- package/dist/components/ui/disclosure/disclosure-group.script.d.ts +19 -3
- package/dist/components/ui/disclosure/disclosure.css +3 -6
- package/dist/components/ui/disclosure/disclosure.d.ts +23 -7
- package/dist/components/ui/disclosure/disclosure.script.d.ts +31 -7
- package/dist/components/ui/disclosure/index.d.ts +1 -1
- package/dist/components/ui/disclosure/index.js +1 -1
- package/dist/components/ui/disclosure/index.js.map +4 -4
- package/dist/components/ui/field/field-description.d.ts +1 -0
- package/dist/components/ui/field/field-error.d.ts +2 -2
- package/dist/components/ui/field/field.d.ts +4 -4
- package/dist/components/ui/field/field.script.d.ts +54 -24
- package/dist/components/ui/field/index.js +1 -1
- package/dist/components/ui/field/index.js.map +4 -4
- package/dist/components/ui/form/control-protocol.d.ts +38 -1
- package/dist/components/ui/form/form-context.d.ts +3 -0
- package/dist/components/ui/form/form.d.ts +6 -0
- package/dist/components/ui/form/form.script.d.ts +29 -12
- package/dist/components/ui/form/index.d.ts +2 -1
- package/dist/components/ui/form/index.js +1 -1
- package/dist/components/ui/form/index.js.map +4 -4
- package/dist/components/ui/grid/grid.d.ts +4 -3
- package/dist/components/ui/grid/grid.script.d.ts +19 -11
- package/dist/components/ui/hover-card/hover-card.css +12 -101
- package/dist/components/ui/hover-card/hover-card.d.ts +7 -2
- package/dist/components/ui/hover-card/hover-card.script.d.ts +36 -5
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/hover-card/index.js.map +4 -4
- package/dist/components/ui/input/index.js +1 -1
- package/dist/components/ui/input/index.js.map +4 -4
- package/dist/components/ui/input/input.css +1 -1
- package/dist/components/ui/knob/index.js +1 -1
- package/dist/components/ui/knob/index.js.map +3 -3
- package/dist/components/ui/knob/knob.css +6 -1
- package/dist/components/ui/knob/knob.d.ts +4 -4
- package/dist/components/ui/knob/knob.script.d.ts +55 -20
- package/dist/components/ui/label/index.js +1 -1
- package/dist/components/ui/label/index.js.map +4 -4
- package/dist/components/ui/label/label.d.ts +2 -1
- package/dist/components/ui/listbox/index.d.ts +2 -2
- package/dist/components/ui/listbox/index.js +1 -1
- package/dist/components/ui/listbox/index.js.map +4 -4
- package/dist/components/ui/listbox/listbox.css +14 -0
- package/dist/components/ui/listbox/listbox.d.ts +16 -2
- package/dist/components/ui/listbox/listbox.script.d.ts +55 -12
- package/dist/components/ui/menu-button/index.js +1 -1
- package/dist/components/ui/menu-button/index.js.map +4 -4
- package/dist/components/ui/menu-button/menu-button.d.ts +2 -2
- package/dist/components/ui/menu-button/menu-button.script.d.ts +30 -27
- package/dist/components/ui/menubar/index.js +1 -1
- package/dist/components/ui/menubar/index.js.map +4 -4
- package/dist/components/ui/menubar/menubar.script.d.ts +41 -15
- package/dist/components/ui/meter/index.js +1 -1
- package/dist/components/ui/meter/index.js.map +3 -3
- package/dist/components/ui/meter/meter.css +27 -2
- package/dist/components/ui/meter/meter.script.d.ts +19 -14
- package/dist/components/ui/navigation-menu/index.d.ts +1 -1
- package/dist/components/ui/navigation-menu/index.js +1 -1
- package/dist/components/ui/navigation-menu/index.js.map +4 -4
- package/dist/components/ui/navigation-menu/navigation-menu.css +32 -34
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts +34 -5
- package/dist/components/ui/navigation-menu/navigation-menu.script.d.ts +93 -12
- package/dist/components/ui/number-field/index.js +1 -1
- package/dist/components/ui/number-field/index.js.map +4 -4
- package/dist/components/ui/number-field/number-field.css +1 -1
- package/dist/components/ui/number-field/number-field.d.ts +8 -19
- package/dist/components/ui/number-field/number-field.script.d.ts +30 -9
- package/dist/components/ui/pagination/index.d.ts +1 -1
- package/dist/components/ui/pagination/index.js +1 -1
- package/dist/components/ui/pagination/index.js.map +3 -3
- package/dist/components/ui/pagination/pagination.css +50 -13
- package/dist/components/ui/pagination/pagination.d.ts +33 -9
- package/dist/components/ui/pagination/pagination.script.d.ts +29 -9
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/popover/index.js.map +4 -4
- package/dist/components/ui/popover/popover.d.ts +17 -1
- package/dist/components/ui/popover/popover.script.d.ts +57 -9
- package/dist/components/ui/radio-group/index.js +1 -1
- package/dist/components/ui/radio-group/index.js.map +4 -4
- package/dist/components/ui/radio-group/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group/radio-group.script.d.ts +35 -16
- package/dist/components/ui/select/index.d.ts +2 -2
- package/dist/components/ui/select/index.js +1 -1
- package/dist/components/ui/select/index.js.map +4 -4
- package/dist/components/ui/select/select.css +8 -6
- package/dist/components/ui/select/select.d.ts +18 -9
- package/dist/components/ui/select/select.script.d.ts +74 -26
- package/dist/components/ui/shared/calendar-popover-behavior.d.ts +27 -0
- package/dist/components/ui/shared/control-toggle.css +8 -4
- package/dist/components/ui/shared/field-label.d.ts +5 -0
- package/dist/components/ui/shared/listbox-host-controller.d.ts +41 -0
- package/dist/components/ui/shared/listbox-option.d.ts +4 -0
- package/dist/components/ui/shared/multi-value.d.ts +23 -1
- package/dist/components/ui/shared/numeric-range.d.ts +8 -0
- package/dist/components/ui/shared/popover.css +10 -99
- package/dist/components/ui/sidebar/index.d.ts +2 -1
- package/dist/components/ui/sidebar/index.js +1 -1
- package/dist/components/ui/sidebar/index.js.map +4 -4
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +12 -0
- package/dist/components/ui/sidebar/sidebar-trigger.script.d.ts +52 -31
- package/dist/components/ui/sidebar/sidebar.css +67 -61
- package/dist/components/ui/sidebar/sidebar.d.ts +9 -4
- package/dist/components/ui/sidebar/sidebar.script.d.ts +42 -20
- package/dist/components/ui/slider/index.js +1 -1
- package/dist/components/ui/slider/index.js.map +4 -4
- package/dist/components/ui/slider/slider.css +5 -5
- package/dist/components/ui/slider/slider.d.ts +20 -10
- package/dist/components/ui/slider/slider.script.d.ts +103 -27
- package/dist/components/ui/switch/index.js +1 -1
- package/dist/components/ui/switch/index.js.map +4 -4
- package/dist/components/ui/switch/switch.css +28 -22
- package/dist/components/ui/switch/switch.d.ts +13 -0
- package/dist/components/ui/switch/switch.script.d.ts +34 -8
- package/dist/components/ui/table/index.js +1 -1
- package/dist/components/ui/table/index.js.map +4 -4
- package/dist/components/ui/table/table.d.ts +9 -7
- package/dist/components/ui/table/table.script.d.ts +55 -12
- package/dist/components/ui/tabs/tabs.css +18 -12
- package/dist/components/ui/tabs/tabs.d.ts +7 -4
- package/dist/components/ui/tabs/tabs.script.d.ts +39 -9
- package/dist/components/ui/tag-group/index.js +1 -1
- package/dist/components/ui/tag-group/index.js.map +4 -4
- package/dist/components/ui/tag-group/tag-group.d.ts +19 -7
- package/dist/components/ui/tag-group/tag-group.script.d.ts +58 -10
- package/dist/components/ui/textarea/index.js +1 -1
- package/dist/components/ui/textarea/index.js.map +4 -4
- package/dist/components/ui/textarea/textarea.css +1 -1
- package/dist/components/ui/toast/index.js +1 -1
- package/dist/components/ui/toast/index.js.map +4 -4
- package/dist/components/ui/toast/toast.css +35 -32
- package/dist/components/ui/toast/toast.script.d.ts +17 -31
- package/dist/components/ui/toast/toaster.script.d.ts +24 -12
- package/dist/components/ui/toc/toc.script.d.ts +19 -8
- package/dist/components/ui/toolbar/toolbar.d.ts +5 -0
- package/dist/components/ui/toolbar/toolbar.script.d.ts +24 -4
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/components/ui/tooltip/index.js.map +4 -4
- package/dist/components/ui/tooltip/tooltip.css +14 -94
- package/dist/components/ui/tooltip/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip/tooltip.script.d.ts +36 -6
- package/dist/components/ui/tree/tree.d.ts +4 -3
- package/dist/components/ui/tree/tree.script.d.ts +28 -15
- package/dist/components/ui/treegrid/treegrid.d.ts +5 -3
- package/dist/components/ui/treegrid/treegrid.script.d.ts +33 -14
- package/dist/components/ui/window-splitter/index.d.ts +1 -1
- package/dist/components/ui/window-splitter/index.js +1 -1
- package/dist/components/ui/window-splitter/index.js.map +3 -3
- package/dist/components/ui/window-splitter/window-splitter.d.ts +10 -1
- package/dist/components/ui/window-splitter/window-splitter.script.d.ts +26 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/icons/check.d.ts +3 -0
- package/dist/lib/icons/chevron-down.d.ts +0 -1
- package/dist/lib/icons/index.d.ts +2 -0
- package/dist/lib/icons/x.d.ts +5 -0
- package/dist/lib/intl-date/index.d.ts +4 -2
- package/dist/lib/intl-date/segment-editing.d.ts +34 -0
- package/dist/lib/intl-date/segments.d.ts +26 -4
- package/dist/lib/non-empty.d.ts +6 -0
- package/dist/lib/unique-id.d.ts +11 -0
- package/dist/lib/viewport/breakpoints.d.ts +6 -0
- package/dist/lib/viewport/mobile-layout.d.ts +15 -0
- package/dist/styles/primitives.css +14 -11
- package/dist/styles/radiant-ui-core.css +10 -0
- package/dist/styles/radiant-ui.css +40 -11
- package/dist/styles/style-dependencies.json +38 -13
- package/dist/styles/styles.css +485 -252
- package/dist/styles/tailwind.css +40 -101
- package/dist/styles/tokens/presets/colors/aurora.css +2 -0
- package/dist/styles/tokens/presets/colors/basalt.css +2 -0
- package/dist/styles/tokens/presets/colors/ember.css +2 -0
- package/dist/styles/tokens/presets/colors/glacier.css +2 -0
- package/dist/styles/tokens/semantic.css +1 -0
- package/dist/styles/tokens/system.css +11 -3
- package/dist/styles/tokens/typography/default.css +8 -0
- package/package.json +27 -13
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type DateSegmentModel } from '@/lib/intl-date';
|
|
2
|
+
type SegmentDomPropsContext = {
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
locale: string | string[] | undefined;
|
|
5
|
+
readOnly: boolean;
|
|
6
|
+
segments: DateSegmentModel[];
|
|
7
|
+
useTextboxRole: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** DOM attributes for one editable `rui-date-input` segment span. */
|
|
10
|
+
export declare function getSegmentDomProps(segment: DateSegmentModel, context: SegmentDomPropsContext): {
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
ariaReadonly: true | undefined;
|
|
13
|
+
ariaRole: string;
|
|
14
|
+
ariaValuemax: number | undefined;
|
|
15
|
+
ariaValuemin: number | undefined;
|
|
16
|
+
ariaValuenow: number | undefined;
|
|
17
|
+
ariaValuetext: string | undefined;
|
|
18
|
+
className: string;
|
|
19
|
+
contenteditable: string | undefined;
|
|
20
|
+
inputmode: string | undefined;
|
|
21
|
+
suppresscontenteditablewarning: string | undefined;
|
|
22
|
+
tabindex: number | undefined;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
rui-date-input {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
min-width: 0px;
|
|
5
|
+
flex: 1;
|
|
6
|
+
}
|
|
7
|
+
@layer components {
|
|
8
|
+
.rui-date-input {
|
|
9
|
+
min-width: 0px;
|
|
10
|
+
flex: 1;
|
|
11
|
+
}
|
|
12
|
+
.rui-date-input__segments {
|
|
13
|
+
display: flex;
|
|
14
|
+
min-width: 0px;
|
|
15
|
+
flex: 1;
|
|
16
|
+
align-items: center;
|
|
17
|
+
overflow-x: clip;
|
|
18
|
+
overflow-y: clip;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
padding-inline: var(--space-control-x);
|
|
21
|
+
padding-block: var(--space-control-y);
|
|
22
|
+
font-size: var(--text-control-input);
|
|
23
|
+
font-variant-numeric: tabular-nums;
|
|
24
|
+
cursor: text;
|
|
25
|
+
}
|
|
26
|
+
.rui-date-input__segment {
|
|
27
|
+
border-radius: var(--radius-xs, var(--border-radius-xs));
|
|
28
|
+
padding-inline: calc(var(--spacing, 0.25rem) * 0.5);
|
|
29
|
+
text-align: end;
|
|
30
|
+
color: var(--color-on-background, var(--on-background));
|
|
31
|
+
--tw-outline-style: none;
|
|
32
|
+
outline-style: none;
|
|
33
|
+
caret-color: transparent;
|
|
34
|
+
-webkit-tap-highlight-color: transparent;
|
|
35
|
+
}
|
|
36
|
+
.rui-date-input__segment--placeholder {
|
|
37
|
+
color: var(--color-on-surface, var(--on-surface));
|
|
38
|
+
opacity: var(--opacity-muted, var(--opacity-muted));
|
|
39
|
+
}
|
|
40
|
+
.rui-date-input__segment[data-focused='true'] {
|
|
41
|
+
background-color: var(--focus-ring);
|
|
42
|
+
color: var(--on-focus-ring);
|
|
43
|
+
-webkit-text-fill-color: currentColor;
|
|
44
|
+
opacity: 1;
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
47
|
+
.rui-date-input__literal {
|
|
48
|
+
color: var(--color-on-background, var(--on-background));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsxCustomElementAttributes } from '@ecopages/jsx';
|
|
2
|
+
import type { RuiDateInput as RuiDateInputElement, RuiDateInputProps } from './date-input.script';
|
|
3
|
+
import './date-input.script';
|
|
4
|
+
/**
|
|
5
|
+
* Segment date editor. Stamps `data-rui-control` so `RuiField` can discover the host.
|
|
6
|
+
* The segment tree is rendered by `<rui-date-input>`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function RuiDateInput({ children, ...props }: JsxCustomElementAttributes<RuiDateInputElement, RuiDateInputProps>): import("@ecopages/jsx").JsxRenderable;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { FormAssociatedElement, type FormValue } from '@ecopages/radiant/form-associated-element';
|
|
2
|
+
import type { EventEmitter } from '@ecopages/radiant/tools/event-emitter';
|
|
3
|
+
import { type DatePartType, type DateSegmentModel } from '@/lib/intl-date';
|
|
4
|
+
export type RuiDateInputProps = {
|
|
5
|
+
value?: string;
|
|
6
|
+
min?: string;
|
|
7
|
+
max?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
};
|
|
14
|
+
export type RuiDateInputChangeDetail = {
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* `<rui-date-input>` — locale-ordered date segments for keyboard and touch entry.
|
|
19
|
+
*
|
|
20
|
+
* Derived Tree: the host `render()`s locale-ordered segments. Set `name` to submit
|
|
21
|
+
* the committed ISO value like a native `<input type="date">`. An empty named
|
|
22
|
+
* value submits an empty string.
|
|
23
|
+
*
|
|
24
|
+
* ## Light-DOM contract
|
|
25
|
+
*
|
|
26
|
+
* Generated by `render()` (do not author manually):
|
|
27
|
+
* - `[data-ref="root"]` — segment group (`role="group"`). Host sets `id` when labelled.
|
|
28
|
+
* - `[data-date-segment][data-type="month|day|year"]` — editable units (`contenteditable`).
|
|
29
|
+
* `data-focused="true"` marks the unit being edited.
|
|
30
|
+
*
|
|
31
|
+
* @see https://react-aria.adobe.com/DateField
|
|
32
|
+
* @element rui-date-input
|
|
33
|
+
* @attr {string} value - Canonical ISO `YYYY-MM-DD`. Default: `''`.
|
|
34
|
+
* @attr {string} min - Earliest allowed ISO date. Default: `''`.
|
|
35
|
+
* @attr {string} max - Latest allowed ISO date. Default: `''`.
|
|
36
|
+
* @attr {boolean} disabled - Disable editing. Default: `false`.
|
|
37
|
+
* @attr {boolean} read-only - Show value without editing. Default: `false`.
|
|
38
|
+
* @attr {string} name - Form field name on this host. An empty value submits `''`. Default: `''`.
|
|
39
|
+
* @attr {string} label - Accessible name when there is no associated label. Default: `''`.
|
|
40
|
+
* @attr {string} locale - BCP 47 locale tag, or comma-separated fallback list. Default: `''`.
|
|
41
|
+
* @fires rui-change - Emitted when a complete valid date is committed, or when all segments are cleared.
|
|
42
|
+
* @fires rui-form-reset - Emitted after a native form reset so a composite parent can restore its value.
|
|
43
|
+
*
|
|
44
|
+
* @cssclass rui-date-input - Root around the segment row.
|
|
45
|
+
* @cssclass rui-date-input__segments - Segment row.
|
|
46
|
+
* @cssclass rui-date-input__segment - Editable month, day, or year unit.
|
|
47
|
+
* @cssclass rui-date-input__segment--placeholder - Empty unit.
|
|
48
|
+
* @cssclass rui-date-input__literal - Locale separator between units.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* `segments` is the visible draft. `value` stays on the last
|
|
52
|
+
* committed ISO date until a unit completes, focus moves, or the control blurs.
|
|
53
|
+
* An in-progress digit buffer is not published just because the draft parses as
|
|
54
|
+
* a date. Only a `value` or `locale` change rebuilds the draft; other props keep it.
|
|
55
|
+
* After a cycle that moves `focusedPart` or rebuilds `segments`, `updated()` moves
|
|
56
|
+
* focus and the caret to `focusedPart` while focus is still inside the control.
|
|
57
|
+
*/
|
|
58
|
+
export declare class RuiDateInput extends FormAssociatedElement {
|
|
59
|
+
value: string;
|
|
60
|
+
min: string;
|
|
61
|
+
max: string;
|
|
62
|
+
readOnly: boolean;
|
|
63
|
+
label: string;
|
|
64
|
+
locale: string;
|
|
65
|
+
changeEvent: EventEmitter<RuiDateInputChangeDetail>;
|
|
66
|
+
segments: DateSegmentModel[];
|
|
67
|
+
focusedPart: DatePartType | null;
|
|
68
|
+
private readonly uid;
|
|
69
|
+
/** Digits typed into `focusedPart` that have not completed the unit yet. */
|
|
70
|
+
private buffer;
|
|
71
|
+
private useTextboxRole;
|
|
72
|
+
/**
|
|
73
|
+
* Part `updated()` still has to move DOM focus to.
|
|
74
|
+
*
|
|
75
|
+
* @remarks The render commit can restore focus to the old segment first; that
|
|
76
|
+
* `focusin` is ignored so it does not take editing back.
|
|
77
|
+
*/
|
|
78
|
+
private pendingFocus;
|
|
79
|
+
private get resolvedLocale();
|
|
80
|
+
private get isoValue();
|
|
81
|
+
private syncSegmentsFromValue;
|
|
82
|
+
/**
|
|
83
|
+
* @remarks SSR preparation and the connect-time `@onUpdated` both fill `segments`
|
|
84
|
+
* before the first render; this derives from `value` only for a render before either.
|
|
85
|
+
*/
|
|
86
|
+
private get displaySegments();
|
|
87
|
+
constructor();
|
|
88
|
+
private getSegmentElement;
|
|
89
|
+
/**
|
|
90
|
+
* Moves editing to `part` and commits the draft once, as `trigger`.
|
|
91
|
+
*
|
|
92
|
+
* @remarks A `leave` commits nothing when no part was focused, so first focus never
|
|
93
|
+
* publishes. A `blur` always commits: an edge arrow or a completed last unit clears
|
|
94
|
+
* `focusedPart` while focus stays inside, and that draft still gets the Blur column.
|
|
95
|
+
*/
|
|
96
|
+
private setFocusedPart;
|
|
97
|
+
private focusPart;
|
|
98
|
+
/**
|
|
99
|
+
* Moves focus and the caret to `focusedPart` after a cycle that changed it or rebuilt `segments`.
|
|
100
|
+
*
|
|
101
|
+
* @remarks Skipped once focus has left the control, so a rebuild in the turn focus
|
|
102
|
+
* moved elsewhere (before the blur commit clears `focusedPart`) cannot pull it back.
|
|
103
|
+
*/
|
|
104
|
+
protected updated(changed: ReadonlySet<string>): void;
|
|
105
|
+
/**
|
|
106
|
+
* Publishes, keeps, or restores the draft after `trigger`, per the commit table in `README.md`.
|
|
107
|
+
*
|
|
108
|
+
* @remarks An in-progress buffer only holds back an `edit`; leaving the part clears it first.
|
|
109
|
+
*/
|
|
110
|
+
private commit;
|
|
111
|
+
/**
|
|
112
|
+
* @remarks A changed `value` rebuilds `segments` through its `@onUpdated` in the next
|
|
113
|
+
* update cycle, so `segments` still holds the draft until then. An unchanged value
|
|
114
|
+
* rebuilds now so the display normalizes (`1` becomes `01`).
|
|
115
|
+
*/
|
|
116
|
+
private publish;
|
|
117
|
+
private partFromTarget;
|
|
118
|
+
/** @remarks A completed unit commits once, as the `leave` of the focus move it triggers. */
|
|
119
|
+
private handleDigit;
|
|
120
|
+
private handleBackspace;
|
|
121
|
+
private handleIncrement;
|
|
122
|
+
protected onConnected(): void;
|
|
123
|
+
protected formValue(): FormValue;
|
|
124
|
+
/** @remarks The reset value must survive a name assigned after first connect. */
|
|
125
|
+
protected formState(): FormValue;
|
|
126
|
+
protected restoreFormState(state: FormValue): void;
|
|
127
|
+
formResetCallback(): void;
|
|
128
|
+
private syncGroupLabel;
|
|
129
|
+
onGroupFocusIn(event: FocusEvent): void;
|
|
130
|
+
onSegmentFocusIn(event: FocusEvent): void;
|
|
131
|
+
onSegmentFocusOut(): void;
|
|
132
|
+
onSegmentKeyDown(event: KeyboardEvent): void;
|
|
133
|
+
onSegmentBeforeInput(event: InputEvent): void;
|
|
134
|
+
onSegmentPointerDown(event: Event): void;
|
|
135
|
+
private renderSegment;
|
|
136
|
+
render(): import("@ecopages/jsx").JsxRenderable;
|
|
137
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as Y}from"@ecopages/jsx/jsx-runtime";import{customElement as wt,event as Pt,onEvent as V,onUpdated as at,prop as k,registerSsrPreparationCallback as It,state as it}from"@ecopages/radiant";import{FormAssociatedElement as ot}from"@ecopages/radiant/form-associated-element";function j(t){if(t==null)return null;let e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t.trim());if(!e)return null;let r=Number(e[1]),n=Number(e[2])-1,a=Number(e[3]),i=new Date(r,n,a);return i.getFullYear()!==r||i.getMonth()!==n||i.getDate()!==a?null:i}function X(t){let e=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${e}-${r}-${n}`}function H(t,e,r){return!(e&&t<e||r&&t>r)}var _e=new Map;function lt(t,e){return`${JSON.stringify(t??null)}|${JSON.stringify(e)}`}function C(t,e){let r=lt(t,e),n=_e.get(r);if(n)return n;let a=new Intl.DateTimeFormat(t,e);return _e.set(r,a),a}var ct=new Date(2e3,0,1);function ft(t,e){return t==="year"?e==="year":t==="month"?e==="year"||e==="month":!0}function dt(t,e){let n=C(e,{[t]:t==="year"?"numeric":"2-digit"}).formatToParts(ct).find(a=>a.type===t);return n?n.value.replace(/\d/g,t==="year"?"y":t==="month"?"m":"d"):t==="year"?"yyyy":"mm"}function mt(t,e,r){let n=t==="year"?{year:"numeric"}:{[t]:"2-digit"};return C(r,n).formatToParts(e).find(a=>a.type===t)?.value??""}function z(t,e,r={}){let n=r.granularity??"day",a=t??r.placeholderDate??new Date;return C(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(a).filter(u=>u.type!=="era").map(u=>{if(u.type==="literal")return{type:"literal",value:u.value,placeholder:u.value,isPlaceholder:!1,editable:!1};let o=u.type;if(!ft(n,o))return null;let f=t!=null;return{type:o,value:f?mt(o,t,e):"",placeholder:dt(o,e),isPlaceholder:!f,editable:!0}}).filter(u=>u!=null)}function pt(t){if(t.isPlaceholder||t.value==="")return null;let e=Number(t.value);return Number.isFinite(e)?e:null}function ht(t){return t>=100?t:t>=69?1900+t:2e3+t}function we(t){let e={};for(let n of t){if(!n.editable)continue;let a=pt(n);if(a==null)return null;e[n.type]=n.type==="year"?ht(a):a}if(e.year==null||e.month==null||e.day==null)return null;let r=new Date(e.year,e.month-1,e.day);return r.getFullYear()!==e.year||r.getMonth()!==e.month-1||r.getDate()!==e.day?null:r}function Pe(t){return t.every(e=>!e.editable||e.isPlaceholder||e.value==="")}function ee(t,e={}){let r=t.find(i=>i.editable&&i.type==="year");if(r&&!r.isPlaceholder&&r.value!==""&&r.value.replace(/\D/g,"").length<4)return{kind:"partial-year"};if(Pe(t))return{kind:"empty"};let n=we(t);if(!n)return{kind:"incomplete"};let a=X(n);return H(a,e.min,e.max)?{kind:"date",iso:a}:{kind:"out-of-range"}}function te(t){return t==="year"?4:2}function gt(t,e){return t.findIndex(r=>r.editable&&r.type===e)}function yt(t){return t.map(e=>({...e}))}function ne(t,e,r){let n=yt(t),a=gt(n,e);return a<0||(n[a]={...n[a],...r}),n}function re(t){if(t==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}function K(t,e){return{min:1,max:Te(t,e)}}function Te(t,e){if(t==="month")return 12;if(t==="day"){let r=Ie(e,"year"),n=Ie(e,"month");return r!=null&&n!=null?new Date(r,n,0).getDate():31}return 9999}function Ie(t,e){let r=t.find(n=>n.editable&&n.type===e);return!r||r.isPlaceholder||r.value===""?null:Number(r.value)}function Fe(t,e){return t==="year"?String(e).padStart(4,"0"):String(e).padStart(2,"0")}function ae(t,e){try{let n=new Intl.DisplayNames(e,{type:"dateTimeField"}).of(t);if(n)return n}catch{}return t==="month"?"Month":t==="day"?"Day":"Year"}function L(t){return t.isPlaceholder||t.value===""?t.placeholder:t.value}function U(t){return t.isPlaceholder||t.value===""?null:re(t.value.replace(/\D/g,""))}function Ve(t,e){return ne(t,e,{value:"",isPlaceholder:!0})}function ke(t,e,r){return ne(t,e,{value:Fe(e,r),isPlaceholder:!1})}function ie(t,e,r){let n=t.find(f=>f.editable&&f.type===e);if(!n)return t;let{min:a,max:i}=K(e,t),o=(U(n)??(r>0?a-1:i+1))+r;return e==="month"||e==="day"?o<a?o=i:o>i&&(o=a):o=Math.max(a,o),ke(t,e,o)}function oe(t,e,r,n){let a=r.replace(/\D/g,"");if(!a)return{segments:t,enteredKeys:n,focusNext:!1};let i=n+a,u=re(i);if(u==null)return{segments:t,enteredKeys:n,focusNext:!1};let o=Te(e,t),f=u;f>o&&(f=re(a)??f);let P=te(e),v=+`${f}0`>o||i.length>=P||String(f).length>=P,E=v?Fe(e,f):String(f);return{segments:ne(t,e,{value:E,isPlaceholder:!1}),enteredKeys:v?"":i,focusNext:v}}function Ee(t){return t.filter(e=>e.editable).map(e=>e.type)}function F(t,e,r){let n=Ee(t),a=n.indexOf(e);if(a<0)return n[0]??null;let i=a+r;return i<0||i>=n.length?null:n[i]??null}function se(t){let e=null;for(let r of t){if(!r.editable)continue;let n=r.type;if(e||(e=n),r.isPlaceholder||r.value==="")return n}return e}function ue(t,e){let r=t.find(i=>i.editable&&i.type===e);if(!r)return{kind:"focus-previous"};if(r.isPlaceholder||r.value==="")return{kind:"focus-previous"};let n=r.value.replace(/\D/g,"");if(n.length<=1)return{kind:"updated",segments:Ve(t,e),enteredKeys:""};let a=n.slice(0,-1);return{kind:"updated",segments:t.map(i=>i.editable&&i.type===e?{...i,value:a,isPlaceholder:!1}:i),enteredKeys:a}}function Re(t){if(!t)return;let e=t.split(",").map(r=>r.trim()).filter(Boolean);return e.length>1?e:e[0]}var bt=/^[A-Za-z][A-Za-z0-9_-]*$/;function Ae(t){return bt.test(t)}function St(t){let e=t.trim();if(Ae(e))return e;let r=`rui-${e}`;return e&&Ae(r)?r:"rui"}function Le(t){let e=typeof crypto.randomUUID=="function"?crypto.randomUUID().replace(/-/g,""):Array.from(crypto.getRandomValues(new Uint8Array(16)),r=>r.toString(16).padStart(2,"0")).join("");return`${St(t)}-${e}`}function Oe(...t){return t.filter(Boolean).join(" ")}function Ne(t,e){let r=t.type,n=U(t),a=!e.useTextboxRole,i=a?"spinbutton":"textbox",u=!e.disabled&&!e.readOnly,o=K(r,e.segments);return{ariaLabel:ae(r,e.locale),ariaReadonly:e.readOnly||void 0,ariaRole:i,ariaValuemax:a?o.max:void 0,ariaValuemin:a?o.min:void 0,ariaValuenow:a&&n!=null?n:void 0,ariaValuetext:a?L(t):void 0,className:Oe("rui-date-input__segment",t.isPlaceholder&&"rui-date-input__segment--placeholder"),contenteditable:u?"true":void 0,inputmode:u?"numeric":void 0,suppresscontenteditablewarning:u?"true":void 0,tabindex:e.disabled?void 0:0}}var Be,Me,$e,je,Ce,ze,Ke,Ue,Ye,qe,Ge,We,Je,Ze,Qe,Xe,He,et,tt,rt;function xt(t,e,r,n,a,i){var u,o,f,P,v,E,I,le=Symbol.metadata||Symbol.for("Symbol.metadata"),ce=Object.defineProperty,q=Object.create,fe=[q(null),q(null)],de=e.length;function O(s,y,h){return function(l,c){y&&(c=l,l=t);for(var b=0;b<s.length;b++)c=s[b].apply(l,h?[c]:[]);return h?c:l}}function D(s,y,h,l){if(typeof s!="function"&&(l||s!==void 0))throw new TypeError(y+" must "+(h||"be")+" a function"+(l?"":" or undefined"));return s}function me(s,y,h,l,c,b,w,g,S,x,he){function G(m){if(!he(m))throw new TypeError("Attempted to access private element on non-instance")}var W=[].concat(y[0]),ge=y[3],J=!w,R=c===1,ye=c===3,be=c===4,N=c===2;function B(m,T,ve){return function($,De){return T&&(De=$,$=s),ve&&ve($),d[m].call($,De)}}if(!J){var d={},Z=[],_=ye?"get":be||R?"set":"value";if(S?(x||R?d={get:nt(function(){return ge(this)},l,"get"),set:function(m){y[4](this,m)}}:d[_]=ge,x||nt(d[_],l,N?"":_)):x||(d=Object.getOwnPropertyDescriptor(s,l)),!x&&!S){if((o=fe[+g][l])&&(o^c)!==7)throw Error("Decorating two elements with the same name ("+d[_].name+") is not supported yet");fe[+g][l]=c<3?1:c}}for(var p=s,M=W.length-1;M>=0;M-=h?2:1){var Se=D(W[M],"A decorator","be",!0),xe=h?W[M-1]:void 0,Q={},A={kind:["field","accessor","method","getter","setter","class"][c],name:l,metadata:u,addInitializer:function(m,T){if(m.v)throw new TypeError("attempted to call addInitializer after decoration was finished");D(T,"An initializer","be",!0),b.push(T)}.bind(null,Q)};if(J)o=Se.call(xe,p,A),Q.v=1,D(o,"class decorators","return")&&(p=o);else if(A.static=g,A.private=S,o=A.access={has:S?he.bind():function(m){return l in m}},be||(o.get=S?N?function(m){return G(m),d.value}:B("get",0,G):function(m){return m[l]}),N||ye||(o.set=S?B("set",0,G):function(m,T){m[l]=T}),p=Se.call(xe,R?{get:d.get,set:d.set}:d[_],A),Q.v=1,R){if(typeof p=="object"&&p)(o=D(p.get,"accessor.get"))&&(d.get=o),(o=D(p.set,"accessor.set"))&&(d.set=o),(o=D(p.init,"accessor.init"))&&Z.unshift(o);else if(p!==void 0)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else D(p,(x?"field":"method")+" decorators","return")&&(x?Z.unshift(p):d[_]=p)}return c<2&&w.push(O(Z,g,1),O(b,g,0)),x||J||(S?R?w.splice(-1,0,B("get",g),B("set",g)):w.push(N?d[_]:D.call.bind(d[_])):ce(s,l,d)),p}function pe(s){return ce(s,le,{configurable:!0,enumerable:!0,value:u})}return i!==void 0&&(u=i[le]),u=q(u??null),v=[],E=function(s){s&&v.push(O(s))},I=function(s,y){for(var h=0;h<r.length;h++){var l=r[h],c=l[1],b=7&c;if((8&c)==s&&!b==y){var w=l[2],g=!!l[3],S=16&c;me(s?t:t.prototype,l,S,g?"#"+w:vt(w),b,b<2?[]:s?P=P||[]:f=f||[],v,!!s,g,y,s&&g?function(x){return _t(x)===t}:a)}}},I(8,0),I(0,0),I(8,1),I(0,1),E(f),E(P),o=v,de||pe(t),{e:o,get c(){var s=[];return de&&[pe(t=me(t,[e],n,t.name,5,s)),O(s,1)]}}}function vt(t){var e=Dt(t,"string");return typeof e=="symbol"?e:e+""}function Dt(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nt(t,e,r){typeof e=="symbol"&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:r?r+" "+e:e})}catch{}return t}function _t(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(t!==null?typeof t:"null"));return t}function Tt(){return typeof navigator>"u"?!1:/iPad|iPhone|iPod/.test(navigator.userAgent)}var ut,st=class extends ot{static{({e:[$e,je,Ce,ze,Ke,Ue,Ye,qe,Ge,We,Je,Ze,Qe,Xe,He,et,tt,rt,Be],c:[ut,Me]}=xt(this,[wt("rui-date-input")],[[k({type:String,reflect:!0,defaultValue:""}),0,"value"],[k({type:String,defaultValue:""}),0,"min"],[k({type:String,defaultValue:""}),0,"max"],[k({type:Boolean,attribute:"read-only",reflect:!0,defaultValue:!1}),0,"readOnly"],[k({type:String,defaultValue:""}),0,"label"],[k({type:String,defaultValue:""}),0,"locale"],[Pt({name:"rui-change",bubbles:!0,composed:!0}),0,"changeEvent"],[it,0,"segments"],[it,0,"focusedPart"],[at(["value","locale"]),2,"syncSegmentsFromValue"],[at("label"),2,"syncGroupLabel"],[V({selector:'[data-ref="root"]',type:"focusin"}),2,"onGroupFocusIn"],[V({selector:"[data-date-segment]",type:"focusin"}),2,"onSegmentFocusIn"],[V({selector:"[data-date-segment]",type:"focusout"}),2,"onSegmentFocusOut"],[V({selector:"[data-date-segment]",type:"keydown"}),2,"onSegmentKeyDown"],[V({selector:"[data-date-segment]",type:"beforeinput"}),2,"onSegmentBeforeInput"],[V({selector:"[data-date-segment]",type:"pointerdown"}),2,"onSegmentPointerDown"]],0,void 0,ot))}value=(Be(this),$e(this));min=(je(this),Ce(this));max=(ze(this),Ke(this));readOnly=(Ue(this),Ye(this));label=(qe(this),Ge(this));locale=(We(this),Je(this));changeEvent=(Ze(this),Qe(this));segments=(Xe(this),He(this,[]));focusedPart=(et(this),tt(this,null));uid=(rt(this),Le("rui-date-input"));buffer="";useTextboxRole=Tt();pendingFocus=null;get resolvedLocale(){return Re(this.locale)}get isoValue(){return this.value??""}syncSegmentsFromValue(){this.segments=z(j(this.isoValue),this.resolvedLocale),this.buffer=""}get displaySegments(){return this.segments.length>0?this.segments:z(j(this.isoValue),this.resolvedLocale)}constructor(){super(),It(this,()=>this.syncSegmentsFromValue())}getSegmentElement(e){return this.querySelector(`[data-date-segment][data-type="${e}"]`)}setFocusedPart(e,r="leave"){let n=this.focusedPart;e===n&&r==="leave"||(this.buffer="",(n!=null||r==="blur")&&this.commit(r),this.focusedPart=e)}focusPart(e){this.setFocusedPart(e),this.pendingFocus=e}updated(e){super.updated(e),this.pendingFocus=null;let r=this.focusedPart;if(!r||!(e.has("focusedPart")||e.has("segments"))||!this.matches(":focus-within"))return;let n=this.getSegmentElement(r);n&&(document.activeElement!==n&&n.focus(),document.activeElement===n&&window.getSelection()?.collapse(n,0))}commit(e){if(e==="edit"&&this.buffer)return;let r=ee(this.segments,{min:this.min,max:this.max});switch(r.kind){case"partial-year":e!=="edit"&&this.syncSegmentsFromValue();return;case"incomplete":e==="blur"&&this.syncSegmentsFromValue();return;case"out-of-range":this.syncSegmentsFromValue();return;case"empty":this.publish("");return;case"date":this.publish(r.iso)}}publish(e){if(e===this.isoValue){this.syncSegmentsFromValue();return}this.value=e,this.changeEvent.emit({value:e})}partFromTarget(e){if(!(e instanceof HTMLElement))return null;let n=e.closest("[data-date-segment]")?.getAttribute("data-type");return n==="month"||n==="day"||n==="year"?n:null}handleDigit(e,r){this.setFocusedPart(e);let n=oe(this.segments,e,r,this.buffer);if(this.segments=n.segments,this.buffer=n.enteredKeys,n.focusNext){this.focusPart(F(this.segments,e,1));return}this.commit("edit")}handleBackspace(e){this.setFocusedPart(e);let r=ue(this.segments,e);if(r.kind==="focus-previous"){this.focusPart(F(this.segments,e,-1));return}this.segments=r.segments,this.buffer=r.enteredKeys,this.commit("edit")}handleIncrement(e,r){this.setFocusedPart(e),this.buffer="",this.segments=ie(this.segments,e,r),this.commit("edit")}onConnected(){this.syncSegmentsFromValue(),this.syncGroupLabel()}formValue(){return this.name?this.isoValue:null}formState(){return this.value}restoreFormState(e){this.value=typeof e=="string"?e:"",this.syncSegmentsFromValue()}formResetCallback(){super.formResetCallback(),this.dispatchEvent(new Event("rui-form-reset",{bubbles:!0}))}syncGroupLabel(){let e=this.querySelector('[data-ref="root"]');if(!e)return;e.id||(e.id=`${this.uid}-group`);let r=this.label||this.getAttribute("aria-label")||"";r?e.setAttribute("aria-label",r):e.removeAttribute("aria-label")}onGroupFocusIn(e){this.partFromTarget(e.target)||this.focusPart(se(this.segments))}onSegmentFocusIn(e){let r=this.partFromTarget(e.target);r&&(this.pendingFocus&&this.pendingFocus!==r||this.setFocusedPart(r))}onSegmentFocusOut(){queueMicrotask(()=>{this.matches(":focus-within")||this.setFocusedPart(null,"blur")})}onSegmentKeyDown(e){let r=this.partFromTarget(e.target);if(!(!r||this.effectiveDisabled||this.readOnly)){if(e.key==="ArrowLeft"){e.preventDefault(),this.focusPart(F(this.segments,r,-1));return}if(e.key==="ArrowRight"){e.preventDefault(),this.focusPart(F(this.segments,r,1));return}if(e.key==="ArrowUp"){e.preventDefault(),this.handleIncrement(r,1);return}if(e.key==="ArrowDown"){e.preventDefault(),this.handleIncrement(r,-1);return}(e.key==="Backspace"||e.key==="Delete")&&(e.preventDefault(),e.stopPropagation(),this.handleBackspace(r))}}onSegmentBeforeInput(e){let r=this.partFromTarget(e.target);if(!(!r||this.effectiveDisabled||this.readOnly))switch(e.preventDefault(),e.inputType){case"deleteContentBackward":case"deleteContentForward":this.handleBackspace(r);break;default:e.data!=null&&this.handleDigit(r,e.data);break}}onSegmentPointerDown(e){e.stopPropagation()}renderSegment(e,r){if(!e.editable)return Y("span",{class:"rui-date-input__literal","data-type":"literal","aria-hidden":"true",children:e.value},`literal-${r}`);let n=e.type,a=this.focusedPart===n,i=Ne(e,{disabled:this.effectiveDisabled,locale:this.resolvedLocale,readOnly:this.readOnly,segments:this.displaySegments,useTextboxRole:this.useTextboxRole});return Y("span",{class:i.className,"data-date-segment":!0,"data-type":n,"data-placeholder":e.isPlaceholder?"true":void 0,"data-focused":a?"true":void 0,role:i.ariaRole,"aria-label":i.ariaLabel,"aria-valuemin":i.ariaValuemin,"aria-valuemax":i.ariaValuemax,"aria-valuenow":i.ariaValuenow,"aria-valuetext":i.ariaValuetext,"aria-readonly":i.ariaReadonly,contenteditable:i.contenteditable,suppresscontenteditablewarning:i.suppresscontenteditablewarning,spellcheck:"false",inputmode:i.inputmode,tabindex:i.tabindex,children:L(e)},n)}render(){return Y("div",{class:"rui-date-input","data-ref":"root",role:"group",children:Y("div",{class:"rui-date-input__segments",children:this.displaySegments.map((e,r)=>this.renderSegment(e,r))})})}static{Me()}};import{jsx as Ft}from"@ecopages/jsx/jsx-runtime";function Vt({children:t,...e}){return Ft("rui-date-input",{"data-rui-control":!0,"data-rui-control-type":"date","data-rui-aria-target":'[data-ref="root"]',...e,children:t})}export{Vt as RuiDateInput,ut as RuiDateInputElement};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/ui/date-input/date-input.script.tsx", "../../../../src/lib/intl-date/iso.ts", "../../../../src/lib/intl-date/formatters.ts", "../../../../src/lib/intl-date/segments.ts", "../../../../src/lib/intl-date/segment-editing.ts", "../../../../src/lib/intl/locale.ts", "../../../../src/lib/unique-id.ts", "../../../../src/lib/cx.ts", "../../../../src/components/ui/date-input/date-input-segment-dom.ts", "../../../../src/components/ui/date-input/date-input.tsx"],
|
|
4
|
+
"sourcesContent": ["let _initProto, _initClass, _init_value, _init_extra_value, _init_min, _init_extra_min, _init_max, _init_extra_max, _init_readOnly, _init_extra_readOnly, _init_label, _init_extra_label, _init_locale, _init_extra_locale, _init_changeEvent, _init_extra_changeEvent, _init_segments, _init_extra_segments, _init_focusedPart, _init_extra_focusedPart;\nfunction _applyDecs(e, t, n, r, o, i) { var a, c, u, s, f, l, p, d = Symbol.metadata || Symbol.for(\"Symbol.metadata\"), m = Object.defineProperty, h = Object.create, y = [h(null), h(null)], v = t.length; function g(t, n, r) { return function (o, i) { n && (i = o, o = e); for (var a = 0; a < t.length; a++) i = t[a].apply(o, r ? [i] : []); return r ? i : o; }; } function b(e, t, n, r) { if (\"function\" != typeof e && (r || void 0 !== e)) throw new TypeError(t + \" must \" + (n || \"be\") + \" a function\" + (r ? \"\" : \" or undefined\")); return e; } function applyDec(e, t, n, r, o, i, u, s, f, l, p) { function d(e) { if (!p(e)) throw new TypeError(\"Attempted to access private element on non-instance\"); } var h = [].concat(t[0]), v = t[3], w = !u, D = 1 === o, S = 3 === o, j = 4 === o, E = 2 === o; function I(t, n, r) { return function (o, i) { return n && (i = o, o = e), r && r(o), P[t].call(o, i); }; } if (!w) { var P = {}, k = [], F = S ? \"get\" : j || D ? \"set\" : \"value\"; if (f ? (l || D ? P = { get: _setFunctionName(function () { return v(this); }, r, \"get\"), set: function (e) { t[4](this, e); } } : P[F] = v, l || _setFunctionName(P[F], r, E ? \"\" : F)) : l || (P = Object.getOwnPropertyDescriptor(e, r)), !l && !f) { if ((c = y[+s][r]) && 7 !== (c ^ o)) throw Error(\"Decorating two elements with the same name (\" + P[F].name + \") is not supported yet\"); y[+s][r] = o < 3 ? 1 : o; } } for (var N = e, O = h.length - 1; O >= 0; O -= n ? 2 : 1) { var T = b(h[O], \"A decorator\", \"be\", !0), z = n ? h[O - 1] : void 0, A = {}, H = { kind: [\"field\", \"accessor\", \"method\", \"getter\", \"setter\", \"class\"][o], name: r, metadata: a, addInitializer: function (e, t) { if (e.v) throw new TypeError(\"attempted to call addInitializer after decoration was finished\"); b(t, \"An initializer\", \"be\", !0), i.push(t); }.bind(null, A) }; if (w) c = T.call(z, N, H), A.v = 1, b(c, \"class decorators\", \"return\") && (N = c);else if (H.static = s, H.private = f, c = H.access = { has: f ? p.bind() : function (e) { return r in e; } }, j || (c.get = f ? E ? function (e) { return d(e), P.value; } : I(\"get\", 0, d) : function (e) { return e[r]; }), E || S || (c.set = f ? I(\"set\", 0, d) : function (e, t) { e[r] = t; }), N = T.call(z, D ? { get: P.get, set: P.set } : P[F], H), A.v = 1, D) { if (\"object\" == typeof N && N) (c = b(N.get, \"accessor.get\")) && (P.get = c), (c = b(N.set, \"accessor.set\")) && (P.set = c), (c = b(N.init, \"accessor.init\")) && k.unshift(c);else if (void 0 !== N) throw new TypeError(\"accessor decorators must return an object with get, set, or init properties or undefined\"); } else b(N, (l ? \"field\" : \"method\") + \" decorators\", \"return\") && (l ? k.unshift(N) : P[F] = N); } return o < 2 && u.push(g(k, s, 1), g(i, s, 0)), l || w || (f ? D ? u.splice(-1, 0, I(\"get\", s), I(\"set\", s)) : u.push(E ? P[F] : b.call.bind(P[F])) : m(e, r, P)), N; } function w(e) { return m(e, d, { configurable: !0, enumerable: !0, value: a }); } return void 0 !== i && (a = i[d]), a = h(null == a ? null : a), f = [], l = function (e) { e && f.push(g(e)); }, p = function (t, r) { for (var i = 0; i < n.length; i++) { var a = n[i], c = a[1], l = 7 & c; if ((8 & c) == t && !l == r) { var p = a[2], d = !!a[3], m = 16 & c; applyDec(t ? e : e.prototype, a, m, d ? \"#\" + p : _toPropertyKey(p), l, l < 2 ? [] : t ? s = s || [] : u = u || [], f, !!t, d, r, t && d ? function (t) { return _checkInRHS(t) === e; } : o); } } }, p(8, 0), p(0, 0), p(8, 1), p(0, 1), l(u), l(s), c = f, v || w(e), { e: c, get c() { var n = []; return v && [w(e = applyDec(e, [t], r, e.name, 5, n)), g(n, 1)]; } }; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == typeof i ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != typeof i) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _setFunctionName(e, t, n) { \"symbol\" == typeof t && (t = (t = t.description) ? \"[\" + t + \"]\" : \"\"); try { Object.defineProperty(e, \"name\", { configurable: !0, value: n ? n + \" \" + t : t }); } catch (e) {} return e; }\nfunction _checkInRHS(e) { if (Object(e) !== e) throw TypeError(\"right-hand side of 'in' should be an object, got \" + (null !== e ? typeof e : \"null\")); return e; }\nimport { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport { customElement, event, onEvent, onUpdated, prop, registerSsrPreparationCallback, state } from \"@ecopages/radiant\";\nimport { FormAssociatedElement } from \"@ecopages/radiant/form-associated-element\";\nimport { applyBackspaceToSegment, applyDigitToSegment, buildDateSegments, draftStatus, firstEmptyOrFirstPart, focusPartAfter, incrementSegmentValue, isoToDate, segmentDisplayText } from \"@/lib/intl-date\";\nimport { resolveLocale } from \"@/lib/intl/locale\";\nimport { uniqueId } from \"@/lib/unique-id\";\nimport { getSegmentDomProps } from \"./date-input-segment-dom\";\nfunction isIosDevice() {\n if (typeof navigator === \"undefined\") {\n return false;\n }\n return /iPad|iPhone|iPod/.test(navigator.userAgent);\n}\nlet _RuiDateInput;\nclass RuiDateInput extends FormAssociatedElement {\n static {\n ({\n e: [_init_value, _init_extra_value, _init_min, _init_extra_min, _init_max, _init_extra_max, _init_readOnly, _init_extra_readOnly, _init_label, _init_extra_label, _init_locale, _init_extra_locale, _init_changeEvent, _init_extra_changeEvent, _init_segments, _init_extra_segments, _init_focusedPart, _init_extra_focusedPart, _initProto],\n c: [_RuiDateInput, _initClass]\n } = _applyDecs(this, [customElement(\"rui-date-input\")], [[prop({\n type: String,\n reflect: true,\n defaultValue: \"\"\n }), 0, \"value\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"min\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"max\"], [prop({\n type: Boolean,\n attribute: \"read-only\",\n reflect: true,\n defaultValue: false\n }), 0, \"readOnly\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"label\"], [prop({\n type: String,\n defaultValue: \"\"\n }), 0, \"locale\"], [event({\n name: \"rui-change\",\n bubbles: true,\n composed: true\n }), 0, \"changeEvent\"], [state, 0, \"segments\"], [state, 0, \"focusedPart\"], [onUpdated([\"value\", \"locale\"]), 2, \"syncSegmentsFromValue\"], [onUpdated(\"label\"), 2, \"syncGroupLabel\"], [onEvent({\n selector: '[data-ref=\"root\"]',\n type: \"focusin\"\n }), 2, \"onGroupFocusIn\"], [onEvent({\n selector: \"[data-date-segment]\",\n type: \"focusin\"\n }), 2, \"onSegmentFocusIn\"], [onEvent({\n selector: \"[data-date-segment]\",\n type: \"focusout\"\n }), 2, \"onSegmentFocusOut\"], [onEvent({\n selector: \"[data-date-segment]\",\n type: \"keydown\"\n }), 2, \"onSegmentKeyDown\"], [onEvent({\n selector: \"[data-date-segment]\",\n type: \"beforeinput\"\n }), 2, \"onSegmentBeforeInput\"], [onEvent({\n selector: \"[data-date-segment]\",\n type: \"pointerdown\"\n }), 2, \"onSegmentPointerDown\"]], 0, void 0, FormAssociatedElement));\n }\n value = (_initProto(this), _init_value(this));\n min = (_init_extra_value(this), _init_min(this));\n max = (_init_extra_min(this), _init_max(this));\n readOnly = (_init_extra_max(this), _init_readOnly(this));\n label = (_init_extra_readOnly(this), _init_label(this));\n locale = (_init_extra_label(this), _init_locale(this));\n changeEvent = (_init_extra_locale(this), _init_changeEvent(this));\n segments = (_init_extra_changeEvent(this), _init_segments(this, []));\n focusedPart = (_init_extra_segments(this), _init_focusedPart(this, null));\n uid = (_init_extra_focusedPart(this), uniqueId(\"rui-date-input\"));\n /** Digits typed into `focusedPart` that have not completed the unit yet. */\n buffer = \"\";\n useTextboxRole = isIosDevice();\n /**\n * Part `updated()` still has to move DOM focus to.\n *\n * @remarks The render commit can restore focus to the old segment first; that\n * `focusin` is ignored so it does not take editing back.\n */\n pendingFocus = null;\n get resolvedLocale() {\n return resolveLocale(this.locale);\n }\n get isoValue() {\n return this.value ?? \"\";\n }\n syncSegmentsFromValue() {\n this.segments = buildDateSegments(isoToDate(this.isoValue), this.resolvedLocale);\n this.buffer = \"\";\n }\n /**\n * @remarks SSR preparation and the connect-time `@onUpdated` both fill `segments`\n * before the first render; this derives from `value` only for a render before either.\n */\n get displaySegments() {\n if (this.segments.length > 0) {\n return this.segments;\n }\n return buildDateSegments(isoToDate(this.isoValue), this.resolvedLocale);\n }\n constructor() {\n super();\n registerSsrPreparationCallback(this, () => this.syncSegmentsFromValue());\n }\n getSegmentElement(type) {\n return this.querySelector(`[data-date-segment][data-type=\"${type}\"]`);\n }\n /**\n * Moves editing to `part` and commits the draft once, as `trigger`.\n *\n * @remarks A `leave` commits nothing when no part was focused, so first focus never\n * publishes. A `blur` always commits: an edge arrow or a completed last unit clears\n * `focusedPart` while focus stays inside, and that draft still gets the Blur column.\n */\n setFocusedPart(part, trigger = \"leave\") {\n const previous = this.focusedPart;\n if (part === previous && trigger === \"leave\") {\n return;\n }\n this.buffer = \"\";\n if (previous != null || trigger === \"blur\") {\n this.commit(trigger);\n }\n this.focusedPart = part;\n }\n focusPart(type) {\n this.setFocusedPart(type);\n this.pendingFocus = type;\n }\n /**\n * Moves focus and the caret to `focusedPart` after a cycle that changed it or rebuilt `segments`.\n *\n * @remarks Skipped once focus has left the control, so a rebuild in the turn focus\n * moved elsewhere (before the blur commit clears `focusedPart`) cannot pull it back.\n */\n updated(changed) {\n super.updated(changed);\n this.pendingFocus = null;\n const part = this.focusedPart;\n if (!part || !(changed.has(\"focusedPart\") || changed.has(\"segments\")) || !this.matches(\":focus-within\")) {\n return;\n }\n const segment = this.getSegmentElement(part);\n if (!segment) {\n return;\n }\n if (document.activeElement !== segment) {\n segment.focus();\n }\n if (document.activeElement === segment) {\n window.getSelection()?.collapse(segment, 0);\n }\n }\n /**\n * Publishes, keeps, or restores the draft after `trigger`, per the commit table in `README.md`.\n *\n * @remarks An in-progress buffer only holds back an `edit`; leaving the part clears it first.\n */\n commit(trigger) {\n if (trigger === \"edit\" && this.buffer) {\n return;\n }\n const status = draftStatus(this.segments, {\n min: this.min,\n max: this.max\n });\n switch (status.kind) {\n case \"partial-year\":\n if (trigger !== \"edit\") {\n this.syncSegmentsFromValue();\n }\n return;\n case \"incomplete\":\n if (trigger === \"blur\") {\n this.syncSegmentsFromValue();\n }\n return;\n case \"out-of-range\":\n this.syncSegmentsFromValue();\n return;\n case \"empty\":\n this.publish(\"\");\n return;\n case \"date\":\n this.publish(status.iso);\n }\n }\n /**\n * @remarks A changed `value` rebuilds `segments` through its `@onUpdated` in the next\n * update cycle, so `segments` still holds the draft until then. An unchanged value\n * rebuilds now so the display normalizes (`1` becomes `01`).\n */\n publish(iso) {\n if (iso === this.isoValue) {\n this.syncSegmentsFromValue();\n return;\n }\n this.value = iso;\n this.changeEvent.emit({\n value: iso\n });\n }\n partFromTarget(target) {\n if (!(target instanceof HTMLElement)) {\n return null;\n }\n const segment = target.closest(\"[data-date-segment]\");\n const type = segment?.getAttribute(\"data-type\");\n if (type === \"month\" || type === \"day\" || type === \"year\") {\n return type;\n }\n return null;\n }\n /** @remarks A completed unit commits once, as the `leave` of the focus move it triggers. */\n handleDigit(part, key) {\n this.setFocusedPart(part);\n const result = applyDigitToSegment(this.segments, part, key, this.buffer);\n this.segments = result.segments;\n this.buffer = result.enteredKeys;\n if (result.focusNext) {\n this.focusPart(focusPartAfter(this.segments, part, 1));\n return;\n }\n this.commit(\"edit\");\n }\n handleBackspace(part) {\n this.setFocusedPart(part);\n const result = applyBackspaceToSegment(this.segments, part);\n if (result.kind === \"focus-previous\") {\n this.focusPart(focusPartAfter(this.segments, part, -1));\n return;\n }\n this.segments = result.segments;\n this.buffer = result.enteredKeys;\n this.commit(\"edit\");\n }\n handleIncrement(part, delta) {\n this.setFocusedPart(part);\n this.buffer = \"\";\n this.segments = incrementSegmentValue(this.segments, part, delta);\n this.commit(\"edit\");\n }\n onConnected() {\n this.syncSegmentsFromValue();\n this.syncGroupLabel();\n }\n formValue() {\n return this.name ? this.isoValue : null;\n }\n /** @remarks The reset value must survive a name assigned after first connect. */\n formState() {\n return this.value;\n }\n restoreFormState(state2) {\n this.value = typeof state2 === \"string\" ? state2 : \"\";\n this.syncSegmentsFromValue();\n }\n formResetCallback() {\n super.formResetCallback();\n this.dispatchEvent(new Event(\"rui-form-reset\", {\n bubbles: true\n }));\n }\n syncGroupLabel() {\n const root = this.querySelector('[data-ref=\"root\"]');\n if (!root) {\n return;\n }\n if (!root.id) {\n root.id = `${this.uid}-group`;\n }\n const ariaLabel = this.label || this.getAttribute(\"aria-label\") || \"\";\n if (ariaLabel) {\n root.setAttribute(\"aria-label\", ariaLabel);\n } else {\n root.removeAttribute(\"aria-label\");\n }\n }\n onGroupFocusIn(event2) {\n if (this.partFromTarget(event2.target)) {\n return;\n }\n this.focusPart(firstEmptyOrFirstPart(this.segments));\n }\n onSegmentFocusIn(event2) {\n const part = this.partFromTarget(event2.target);\n if (!part) {\n return;\n }\n if (this.pendingFocus && this.pendingFocus !== part) {\n return;\n }\n this.setFocusedPart(part);\n }\n onSegmentFocusOut() {\n queueMicrotask(() => {\n if (this.matches(\":focus-within\")) {\n return;\n }\n this.setFocusedPart(null, \"blur\");\n });\n }\n onSegmentKeyDown(event2) {\n const part = this.partFromTarget(event2.target);\n if (!part || this.effectiveDisabled || this.readOnly) {\n return;\n }\n if (event2.key === \"ArrowLeft\") {\n event2.preventDefault();\n this.focusPart(focusPartAfter(this.segments, part, -1));\n return;\n }\n if (event2.key === \"ArrowRight\") {\n event2.preventDefault();\n this.focusPart(focusPartAfter(this.segments, part, 1));\n return;\n }\n if (event2.key === \"ArrowUp\") {\n event2.preventDefault();\n this.handleIncrement(part, 1);\n return;\n }\n if (event2.key === \"ArrowDown\") {\n event2.preventDefault();\n this.handleIncrement(part, -1);\n return;\n }\n if (event2.key === \"Backspace\" || event2.key === \"Delete\") {\n event2.preventDefault();\n event2.stopPropagation();\n this.handleBackspace(part);\n }\n }\n onSegmentBeforeInput(event2) {\n const part = this.partFromTarget(event2.target);\n if (!part || this.effectiveDisabled || this.readOnly) {\n return;\n }\n event2.preventDefault();\n switch (event2.inputType) {\n case \"deleteContentBackward\":\n case \"deleteContentForward\":\n this.handleBackspace(part);\n break;\n default:\n if (event2.data != null) {\n this.handleDigit(part, event2.data);\n }\n break;\n }\n }\n onSegmentPointerDown(event2) {\n event2.stopPropagation();\n }\n renderSegment(segment, index) {\n if (!segment.editable) {\n return /* @__PURE__ */jsx(\"span\", {\n class: \"rui-date-input__literal\",\n \"data-type\": \"literal\",\n \"aria-hidden\": \"true\",\n children: segment.value\n }, `literal-${index}`);\n }\n const type = segment.type;\n const focused = this.focusedPart === type;\n const dom = getSegmentDomProps(segment, {\n disabled: this.effectiveDisabled,\n locale: this.resolvedLocale,\n readOnly: this.readOnly,\n segments: this.displaySegments,\n useTextboxRole: this.useTextboxRole\n });\n return /* @__PURE__ */jsx(\"span\", {\n class: dom.className,\n \"data-date-segment\": true,\n \"data-type\": type,\n \"data-placeholder\": segment.isPlaceholder ? \"true\" : void 0,\n \"data-focused\": focused ? \"true\" : void 0,\n role: dom.ariaRole,\n \"aria-label\": dom.ariaLabel,\n \"aria-valuemin\": dom.ariaValuemin,\n \"aria-valuemax\": dom.ariaValuemax,\n \"aria-valuenow\": dom.ariaValuenow,\n \"aria-valuetext\": dom.ariaValuetext,\n \"aria-readonly\": dom.ariaReadonly,\n contenteditable: dom.contenteditable,\n suppresscontenteditablewarning: dom.suppresscontenteditablewarning,\n spellcheck: \"false\",\n inputmode: dom.inputmode,\n tabindex: dom.tabindex,\n children: segmentDisplayText(segment)\n }, type);\n }\n render() {\n return /* @__PURE__ */jsx(\"div\", {\n class: \"rui-date-input\",\n \"data-ref\": \"root\",\n role: \"group\",\n children: /* @__PURE__ */jsx(\"div\", {\n class: \"rui-date-input__segments\",\n children: this.displaySegments.map((segment, index) => this.renderSegment(segment, index))\n })\n });\n }\n static {\n _initClass();\n }\n}\nexport { _RuiDateInput as RuiDateInput };", "export function isoToDate(iso) {\n if (iso == null) {\n return null;\n }\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(iso.trim());\n if (!match) {\n return null;\n }\n const year = Number(match[1]);\n const month = Number(match[2]) - 1;\n const day = Number(match[3]);\n const date = new Date(year, month, day);\n if (date.getFullYear() !== year || date.getMonth() !== month || date.getDate() !== day) {\n return null;\n }\n return date;\n}\nexport function dateToIso(date) {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\nexport function isIsoInRange(iso, min, max) {\n if (min && iso < min) {\n return false;\n }\n if (max && iso > max) {\n return false;\n }\n return true;\n}", "const formatterCache = /* @__PURE__ */new Map();\nfunction cacheKey(locale, options) {\n return `${JSON.stringify(locale ?? null)}|${JSON.stringify(options)}`;\n}\nexport function getDateTimeFormat(locale, options) {\n const key = cacheKey(locale, options);\n const cached = formatterCache.get(key);\n if (cached) {\n return cached;\n }\n const formatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(key, formatter);\n return formatter;\n}\nexport function formatDisplayDate(date, locale, style = \"medium\") {\n return getDateTimeFormat(locale, {\n dateStyle: style\n }).format(date);\n}\nexport function formatMonthYear(date, locale) {\n return getDateTimeFormat(locale, {\n month: \"long\",\n year: \"numeric\"\n }).format(date);\n}\nexport function getWeekdayLabels(locale, weekStartsOn) {\n const formatter = getDateTimeFormat(locale, {\n weekday: \"narrow\"\n });\n const labels = [];\n for (let offset = 0; offset < 7; offset += 1) {\n const dayIndex = (weekStartsOn + offset) % 7;\n const reference = new Date(2024, 0, dayIndex === 0 ? 7 : dayIndex);\n labels.push(formatter.format(reference));\n }\n return labels;\n}\nexport function formatDateRange(start, end, locale, style = \"medium\") {\n const formatter = getDateTimeFormat(locale, {\n dateStyle: style\n });\n if (typeof formatter.formatRange === \"function\") {\n return formatter.formatRange(start, end);\n }\n return `${formatter.format(start)} \\u2013 ${formatter.format(end)}`;\n}\nexport function formatTodayLabel(locale) {\n return new Intl.RelativeTimeFormat(locale, {\n numeric: \"auto\"\n }).format(0, \"day\");\n}", "import { getDateTimeFormat } from \"./formatters\";\nimport { dateToIso, isIsoInRange } from \"./iso\";\nconst PLACEHOLDER_DATE = new Date(2e3, 0, 1);\nfunction granularityIncludes(granularity, part) {\n if (granularity === \"year\") {\n return part === \"year\";\n }\n if (granularity === \"month\") {\n return part === \"year\" || part === \"month\";\n }\n return true;\n}\nfunction placeholderForPart(type, locale) {\n const sample = getDateTimeFormat(locale, {\n [type]: type === \"year\" ? \"numeric\" : \"2-digit\"\n }).formatToParts(PLACEHOLDER_DATE);\n const part = sample.find(entry => entry.type === type);\n if (!part) {\n return type === \"year\" ? \"yyyy\" : \"mm\";\n }\n return part.value.replace(/\\d/g, type === \"year\" ? \"y\" : type === \"month\" ? \"m\" : \"d\");\n}\nfunction formatPartValue(type, date, locale) {\n const options = type === \"year\" ? {\n year: \"numeric\"\n } : {\n [type]: \"2-digit\"\n };\n return getDateTimeFormat(locale, options).formatToParts(date).find(part => part.type === type)?.value ?? \"\";\n}\nexport function buildDateSegments(date, locale, options = {}) {\n const granularity = options.granularity ?? \"day\";\n const reference = date ?? options.placeholderDate ?? /* @__PURE__ */new Date();\n const parts = getDateTimeFormat(locale, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\"\n }).formatToParts(reference);\n return parts.filter(part => part.type !== \"era\").map(part => {\n if (part.type === \"literal\") {\n return {\n type: \"literal\",\n value: part.value,\n placeholder: part.value,\n isPlaceholder: false,\n editable: false\n };\n }\n const type = part.type;\n if (!granularityIncludes(granularity, type)) {\n return null;\n }\n const hasValue = date != null;\n return {\n type,\n value: hasValue ? formatPartValue(type, date, locale) : \"\",\n placeholder: placeholderForPart(type, locale),\n isPlaceholder: !hasValue,\n editable: true\n };\n }).filter(segment => segment != null);\n}\nfunction parseSegmentNumber(segment) {\n if (segment.isPlaceholder || segment.value === \"\") {\n return null;\n }\n const parsed = Number(segment.value);\n return Number.isFinite(parsed) ? parsed : null;\n}\nfunction normalizeYear(value) {\n if (value >= 100) {\n return value;\n }\n return value >= 69 ? 1900 + value : 2e3 + value;\n}\nexport function segmentsToDate(segments) {\n const values = {};\n for (const segment of segments) {\n if (!segment.editable) {\n continue;\n }\n const numeric = parseSegmentNumber(segment);\n if (numeric == null) {\n return null;\n }\n values[segment.type] = segment.type === \"year\" ? normalizeYear(numeric) : numeric;\n }\n if (values.year == null || values.month == null || values.day == null) {\n return null;\n }\n const date = new Date(values.year, values.month - 1, values.day);\n if (date.getFullYear() !== values.year || date.getMonth() !== values.month - 1 || date.getDate() !== values.day) {\n return null;\n }\n return date;\n}\nexport function allSegmentsEmpty(segments) {\n return segments.every(segment => !segment.editable || segment.isPlaceholder || segment.value === \"\");\n}\nexport function draftStatus(segments, range = {}) {\n const year = segments.find(segment => segment.editable && segment.type === \"year\");\n if (year && !year.isPlaceholder && year.value !== \"\" && year.value.replace(/\\D/g, \"\").length < 4) {\n return {\n kind: \"partial-year\"\n };\n }\n if (allSegmentsEmpty(segments)) {\n return {\n kind: \"empty\"\n };\n }\n const date = segmentsToDate(segments);\n if (!date) {\n return {\n kind: \"incomplete\"\n };\n }\n const iso = dateToIso(date);\n if (!isIsoInRange(iso, range.min, range.max)) {\n return {\n kind: \"out-of-range\"\n };\n }\n return {\n kind: \"date\",\n iso\n };\n}\nexport function getEditableSegmentIndices(segments) {\n return segments.map((segment, index) => segment.editable ? index : -1).filter(index => index >= 0);\n}\nexport function maxSegmentLength(type) {\n if (type === \"year\") {\n return 4;\n }\n return 2;\n}\nexport function clampSegmentValue(type, raw) {\n const digits = raw.replace(/\\D/g, \"\");\n return digits.slice(0, maxSegmentLength(type));\n}\nexport function incrementSegment(type, value, delta) {\n const numeric = Number(value || \"0\") + delta;\n if (type === \"month\") {\n const wrapped = (numeric - 1 + 12) % 12 + 1;\n return String(wrapped).padStart(2, \"0\");\n }\n if (type === \"day\") {\n const wrapped = (numeric - 1 + 31) % 31 + 1;\n return String(wrapped).padStart(2, \"0\");\n }\n const next = Math.max(1, numeric);\n return String(next).padStart(4, \"0\").slice(-4);\n}", "import { maxSegmentLength } from \"./segments\";\nfunction segmentIndex(segments, type) {\n return segments.findIndex(segment => segment.editable && segment.type === type);\n}\nfunction cloneSegments(segments) {\n return segments.map(segment => ({\n ...segment\n }));\n}\nfunction updateSegment(segments, type, patch) {\n const next = cloneSegments(segments);\n const index = segmentIndex(next, type);\n if (index < 0) {\n return next;\n }\n next[index] = {\n ...next[index],\n ...patch\n };\n return next;\n}\nfunction parseDigits(raw) {\n if (raw === \"\") {\n return null;\n }\n const parsed = Number(raw);\n return Number.isFinite(parsed) ? parsed : null;\n}\nexport function getSegmentBounds(type, segments) {\n return {\n min: 1,\n max: maxForPart(type, segments)\n };\n}\nfunction maxForPart(type, segments) {\n if (type === \"month\") {\n return 12;\n }\n if (type === \"day\") {\n const year = readPartNumber(segments, \"year\");\n const month = readPartNumber(segments, \"month\");\n if (year != null && month != null) {\n return new Date(year, month, 0).getDate();\n }\n return 31;\n }\n return 9999;\n}\nfunction readPartNumber(segments, type) {\n const segment = segments.find(entry => entry.editable && entry.type === type);\n if (!segment || segment.isPlaceholder || segment.value === \"\") {\n return null;\n }\n return Number(segment.value);\n}\nfunction padPart(type, value) {\n if (type === \"year\") {\n return String(value).padStart(4, \"0\");\n }\n return String(value).padStart(2, \"0\");\n}\nexport function segmentAriaName(type, locale) {\n try {\n const display = new Intl.DisplayNames(locale, {\n type: \"dateTimeField\"\n });\n const name = display.of(type);\n if (name) {\n return name;\n }\n } catch {}\n if (type === \"month\") {\n return \"Month\";\n }\n if (type === \"day\") {\n return \"Day\";\n }\n return \"Year\";\n}\nexport function segmentDisplayText(segment) {\n return segment.isPlaceholder || segment.value === \"\" ? segment.placeholder : segment.value;\n}\nexport function segmentNumericValue(segment) {\n if (segment.isPlaceholder || segment.value === \"\") {\n return null;\n }\n return parseDigits(segment.value.replace(/\\D/g, \"\"));\n}\nexport function clearSegmentValue(segments, type) {\n return updateSegment(segments, type, {\n value: \"\",\n isPlaceholder: true\n });\n}\nexport function setSegmentNumeric(segments, type, value) {\n return updateSegment(segments, type, {\n value: padPart(type, value),\n isPlaceholder: false\n });\n}\nexport function incrementSegmentValue(segments, type, delta) {\n const segment = segments.find(entry => entry.editable && entry.type === type);\n if (!segment) {\n return segments;\n }\n const {\n min,\n max\n } = getSegmentBounds(type, segments);\n const current = segmentNumericValue(segment) ?? (delta > 0 ? min - 1 : max + 1);\n let next = current + delta;\n if (type === \"month\" || type === \"day\") {\n if (next < min) {\n next = max;\n } else if (next > max) {\n next = min;\n }\n } else {\n next = Math.max(min, next);\n }\n return setSegmentNumeric(segments, type, next);\n}\nexport function applyDigitToSegment(segments, type, key, enteredKeys) {\n const digit = key.replace(/\\D/g, \"\");\n if (!digit) {\n return {\n segments,\n enteredKeys,\n focusNext: false\n };\n }\n const newEntered = enteredKeys + digit;\n const parsed = parseDigits(newEntered);\n if (parsed == null) {\n return {\n segments,\n enteredKeys,\n focusNext: false\n };\n }\n const max = maxForPart(type, segments);\n let segmentValue = parsed;\n if (segmentValue > max) {\n segmentValue = parseDigits(digit) ?? segmentValue;\n }\n const width = maxSegmentLength(type);\n const shouldFocusNext = Number(`${segmentValue}0`) > max || newEntered.length >= width || String(segmentValue).length >= width;\n const displayValue = shouldFocusNext ? padPart(type, segmentValue) : String(segmentValue);\n const nextSegments = updateSegment(segments, type, {\n value: displayValue,\n isPlaceholder: false\n });\n return {\n segments: nextSegments,\n enteredKeys: shouldFocusNext ? \"\" : newEntered,\n focusNext: shouldFocusNext\n };\n}\nexport function getEditablePartTypes(segments) {\n return segments.filter(segment => segment.editable).map(segment => segment.type);\n}\nexport function focusPartAfter(segments, type, direction) {\n const parts = getEditablePartTypes(segments);\n const index = parts.indexOf(type);\n if (index < 0) {\n return parts[0] ?? null;\n }\n const nextIndex = index + direction;\n if (nextIndex < 0 || nextIndex >= parts.length) {\n return null;\n }\n return parts[nextIndex] ?? null;\n}\nexport function firstEmptyOrFirstPart(segments) {\n let first = null;\n for (const segment of segments) {\n if (!segment.editable) {\n continue;\n }\n const type = segment.type;\n if (!first) {\n first = type;\n }\n if (segment.isPlaceholder || segment.value === \"\") {\n return type;\n }\n }\n return first;\n}\nexport function applyBackspaceToSegment(segments, part) {\n const segment = segments.find(entry => entry.editable && entry.type === part);\n if (!segment) {\n return {\n kind: \"focus-previous\"\n };\n }\n if (segment.isPlaceholder || segment.value === \"\") {\n return {\n kind: \"focus-previous\"\n };\n }\n const digits = segment.value.replace(/\\D/g, \"\");\n if (digits.length <= 1) {\n return {\n kind: \"updated\",\n segments: clearSegmentValue(segments, part),\n enteredKeys: \"\"\n };\n }\n const next = digits.slice(0, -1);\n return {\n kind: \"updated\",\n segments: segments.map(entry => entry.editable && entry.type === part ? {\n ...entry,\n value: next,\n isPlaceholder: false\n } : entry),\n enteredKeys: next\n };\n}", "export function resolveLocale(locale) {\n if (!locale) {\n return void 0;\n }\n const tags = locale.split(\",\").map(tag => tag.trim()).filter(Boolean);\n return tags.length > 1 ? tags : tags[0];\n}", "const CSS_SAFE_ID = /^[A-Za-z][A-Za-z0-9_-]*$/;\nexport function isCssSafeId(value) {\n return CSS_SAFE_ID.test(value);\n}\nfunction cssSafePrefix(prefix) {\n const trimmed = prefix.trim();\n if (isCssSafeId(trimmed)) {\n return trimmed;\n }\n const prefixed = `rui-${trimmed}`;\n if (trimmed && isCssSafeId(prefixed)) {\n return prefixed;\n }\n return \"rui\";\n}\nexport function uniqueId(prefix) {\n const token = typeof crypto.randomUUID === \"function\" ? crypto.randomUUID().replace(/-/g, \"\") : Array.from(crypto.getRandomValues(new Uint8Array(16)), byte => byte.toString(16).padStart(2, \"0\")).join(\"\");\n return `${cssSafePrefix(prefix)}-${token}`;\n}", "export function cx(...parts) {\n return parts.filter(Boolean).join(\" \");\n}", "import { cx } from \"@/lib/cx\";\nimport { getSegmentBounds, segmentAriaName, segmentDisplayText, segmentNumericValue } from \"@/lib/intl-date\";\nexport function getSegmentDomProps(segment, context) {\n const type = segment.type;\n const numeric = segmentNumericValue(segment);\n const spinbutton = !context.useTextboxRole;\n const ariaRole = spinbutton ? \"spinbutton\" : \"textbox\";\n const editable = !context.disabled && !context.readOnly;\n const bounds = getSegmentBounds(type, context.segments);\n return {\n ariaLabel: segmentAriaName(type, context.locale),\n ariaReadonly: context.readOnly || void 0,\n ariaRole,\n ariaValuemax: spinbutton ? bounds.max : void 0,\n ariaValuemin: spinbutton ? bounds.min : void 0,\n ariaValuenow: spinbutton && numeric != null ? numeric : void 0,\n ariaValuetext: spinbutton ? segmentDisplayText(segment) : void 0,\n className: cx(\"rui-date-input__segment\", segment.isPlaceholder && \"rui-date-input__segment--placeholder\"),\n contenteditable: editable ? \"true\" : void 0,\n inputmode: editable ? \"numeric\" : void 0,\n suppresscontenteditablewarning: editable ? \"true\" : void 0,\n tabindex: context.disabled ? void 0 : 0\n };\n}", "import { jsx } from \"@ecopages/jsx/jsx-runtime\";\nimport \"./date-input.script\";\nexport function RuiDateInput({\n children,\n ...props\n}) {\n return /* @__PURE__ */jsx(\"rui-date-input\", {\n \"data-rui-control\": true,\n \"data-rui-control-type\": \"date\",\n \"data-rui-aria-target\": '[data-ref=\"root\"]',\n ...props,\n children\n });\n}"],
|
|
5
|
+
"mappings": "AAMA,OAAS,OAAAA,MAAW,4BACpB,OAAS,iBAAAC,GAAe,SAAAC,GAAO,WAAAC,EAAS,aAAAC,GAAW,QAAAC,EAAM,kCAAAC,GAAgC,SAAAC,OAAa,oBACtG,OAAS,yBAAAC,OAA6B,4CCR/B,SAASC,EAAUC,EAAK,CAC7B,GAAIA,GAAO,KACT,OAAO,KAET,IAAMC,EAAQ,4BAA4B,KAAKD,EAAI,KAAK,CAAC,EACzD,GAAI,CAACC,EACH,OAAO,KAET,IAAMC,E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,OAAQ,KAAK,eACb,SAAU,KAAK,SACf,SAAU,KAAK,gBACf,eAAgB,KAAK,cACvB,CAAC,EACD,OAAsBkB,EAAI,OAAQ,CAChC,MAAOE,EAAI,UACX,oBAAqB,GACrB,YAAazB,EACb,mBAAoBK,EAAQ,cAAgB,OAAS,OACrD,eAAgBmB,EAAU,OAAS,OACnC,KAAMC,EAAI,SACV,aAAcA,EAAI,UAClB,gBAAiBA,EAAI,aACrB,gBAAiBA,EAAI,aACrB,gBAAiBA,EAAI,aACrB,iBAAkBA,EAAI,cACtB,gBAAiBA,EAAI,aACrB,gBAAiBA,EAAI,gBACrB,+BAAgCA,EAAI,+BACpC,WAAY,QACZ,UAAWA,EAAI,UACf,SAAUA,EAAI,SACd,SAAUE,EAAmBtB,CAAO,CACtC,EAAGL,CAAI,CACT,CACA,QAAS,CACP,OAAsBuB,EAAI,MAAO,CAC/B,MAAO,iBACP,WAAY,OACZ,KAAM,QACN,SAAyBA,EAAI,MAAO,CAClC,MAAO,2BACP,SAAU,KAAK,gBAAgB,IAAI,CAAClB,EAASiB,IAAU,KAAK,cAAcjB,EAASiB,CAAK,CAAC,CAC3F,CAAC,CACH,CAAC,CACH,CACA,MAAO,CACLjG,GAAW,CACb,CACF,ESjaA,OAAS,OAAAuG,OAAW,4BAEb,SAASC,GAAa,CAC3B,SAAAC,EACA,GAAGC,CACL,EAAG,CACD,OAAsBC,GAAI,iBAAkB,CAC1C,mBAAoB,GACpB,wBAAyB,OACzB,uBAAwB,oBACxB,GAAGD,EACH,SAAAD,CACF,CAAC,CACH",
|
|
6
|
+
"names": ["jsx", "customElement", "event", "onEvent", "onUpdated", "prop", "registerSsrPreparationCallback", "state", "FormAssociatedElement", "isoToDate", "iso", "match", "year", "month", "day", "date", "dateToIso", "isIsoInRange", "min", "max", "formatterCache", "cacheKey", "locale", "options", "getDateTimeFormat", "key", "cached", "formatter", "PLACEHOLDER_DATE", "granularityIncludes", "granularity", "part", "placeholderForPart", "type", "locale", "getDateTimeFormat", "entry", "formatPartValue", "date", "options", "buildDateSegments", "reference", "hasValue", "segment", "parseSegmentNumber", "parsed", "normalizeYear", "value", "segmentsToDate", "segments", "values", "numeric", "allSegmentsEmpty", "draftStatus", "range", "year", "iso", "dateToIso", "isIsoInRange", "maxSegmentLength", "type", "segmentIndex", "segments", "type", "segment", "cloneSegments", "updateSegment", "patch", "next", "index", "parseDigits", "raw", "parsed", "getSegmentBounds", "maxForPart", "year", "readPartNumber", "month", "entry", "padPart", "value", "segmentAriaName", "locale", "name", "segmentDisplayText", "segmentNumericValue", "clearSegmentValue", "setSegmentNumeric", "incrementSegmentValue", "delta", "min", "max", "applyDigitToSegment", "key", "enteredKeys", "digit", "newEntered", "segmentValue", "width", "maxSegmentLength", "shouldFocusNext", "displayValue", "getEditablePartTypes", "focusPartAfter", "direction", "parts", "nextIndex", "firstEmptyOrFirstPart", "first", "applyBackspaceToSegment", "part", "digits", "resolveLocale", "locale", "tags", "tag", "CSS_SAFE_ID", "isCssSafeId", "value", "cssSafePrefix", "prefix", "trimmed", "prefixed", "uniqueId", "token", "byte", "cx", "parts", "getSegmentDomProps", "segment", "context", "type", "numeric", "segmentNumericValue", "spinbutton", "ariaRole", "editable", "bounds", "getSegmentBounds", "segmentAriaName", "segmentDisplayText", "cx", "_initProto", "_initClass", "_init_value", "_init_extra_value", "_init_min", "_init_extra_min", "_init_max", "_init_extra_max", "_init_readOnly", "_init_extra_readOnly", "_init_label", "_init_extra_label", "_init_locale", "_init_extra_locale", "_init_changeEvent", "_init_extra_changeEvent", "_init_segments", "_init_extra_segments", "_init_focusedPart", "_init_extra_focusedPart", "_applyDecs", "e", "t", "n", "r", "o", "a", "c", "u", "s", "f", "l", "p", "d", "m", "h", "y", "v", "g", "i", "b", "applyDec", "w", "D", "S", "j", "E", "I", "P", "k", "F", "_setFunctionName", "N", "O", "T", "z", "A", "H", "_toPropertyKey", "_checkInRHS", "_toPrimitive", "isIosDevice", "_RuiDateInput", "RuiDateInput", "FormAssociatedElement", "customElement", "prop", "event", "state", "onUpdated", "onEvent", "uniqueId", "resolveLocale", "buildDateSegments", "isoToDate", "registerSsrPreparationCallback", "type", "part", "trigger", "previous", "changed", "segment", "status", "draftStatus", "iso", "target", "key", "result", "applyDigitToSegment", "focusPartAfter", "applyBackspaceToSegment", "delta", "incrementSegmentValue", "state2", "root", "ariaLabel", "event2", "firstEmptyOrFirstPart", "index", "jsx", "focused", "dom", "getSegmentDomProps", "segmentDisplayText", "jsx", "RuiDateInput", "children", "props", "jsx"]
|
|
7
|
+
}
|
|
@@ -14,9 +14,10 @@ rui-date-range-picker {
|
|
|
14
14
|
.rui-date-range-picker__group {
|
|
15
15
|
display: flex;
|
|
16
16
|
width: 100%;
|
|
17
|
-
min-width:
|
|
17
|
+
min-width: 0px;
|
|
18
18
|
align-items: center;
|
|
19
19
|
gap: var(--spacing-1, var(--space-1));
|
|
20
|
+
overflow: hidden;
|
|
20
21
|
border-radius: var(--radius-control, var(--radius-control));
|
|
21
22
|
border-style: var(--tw-border-style);
|
|
22
23
|
border-width: 1px;
|
|
@@ -30,43 +31,41 @@ rui-date-range-picker {
|
|
|
30
31
|
--tw-ring-color: var(--color-focus-ring, var(--focus-ring));
|
|
31
32
|
}
|
|
32
33
|
.rui-date-range-picker__values {
|
|
33
|
-
display:
|
|
34
|
+
display: grid;
|
|
34
35
|
min-width: 0px;
|
|
35
36
|
flex: 1;
|
|
37
|
+
grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
|
|
36
38
|
align-items: center;
|
|
37
39
|
gap: var(--spacing-inline, var(--space-inline));
|
|
38
40
|
}
|
|
39
41
|
.rui-date-range-picker__input {
|
|
40
|
-
width:
|
|
41
|
-
|
|
42
|
-
min-width: calc(var(--spacing, 0.25rem) * 24);
|
|
43
|
-
flex-shrink: 1;
|
|
42
|
+
width: 100%;
|
|
43
|
+
min-width: 0px;
|
|
44
44
|
border-style: var(--tw-border-style);
|
|
45
45
|
border-width: 0px;
|
|
46
46
|
background-color: transparent;
|
|
47
|
-
|
|
47
|
+
padding: 0px;
|
|
48
48
|
--tw-outline-style: none;
|
|
49
49
|
outline-style: none;
|
|
50
|
-
padding-inline: var(--space-control-x);
|
|
51
|
-
padding-block: var(--space-control-y);
|
|
52
|
-
font-size: var(--text-control, 0.875rem);
|
|
53
|
-
font-variant-numeric: tabular-nums;
|
|
54
|
-
}
|
|
55
|
-
.rui-date-range-picker__input::placeholder {
|
|
56
|
-
color: var(--color-on-surface, var(--on-surface));
|
|
57
|
-
opacity: var(--opacity-muted, var(--opacity-muted));
|
|
58
|
-
}
|
|
59
|
-
.rui-date-range-picker__input:disabled {
|
|
60
|
-
cursor: not-allowed;
|
|
61
|
-
opacity: var(--opacity-disabled, var(--opacity-disabled));
|
|
62
50
|
}
|
|
63
51
|
.rui-date-range-picker__separator {
|
|
64
52
|
flex-shrink: 0;
|
|
65
53
|
color: var(--color-on-surface, var(--on-surface));
|
|
66
54
|
}
|
|
67
55
|
.rui-date-range-picker__popover {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
max-width: calc(100vw - 1rem);
|
|
58
|
+
min-width: 0px;
|
|
68
59
|
padding: 0px;
|
|
69
60
|
}
|
|
61
|
+
.rui-date-range-picker__popover .rui-calendar {
|
|
62
|
+
width: auto;
|
|
63
|
+
max-width: 100%;
|
|
64
|
+
border-style: var(--tw-border-style);
|
|
65
|
+
border-width: 0px;
|
|
66
|
+
--tw-shadow: 0 0 #0000;
|
|
67
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
68
|
+
}
|
|
70
69
|
.rui-date-range-picker__popover[hidden] {
|
|
71
70
|
display: none;
|
|
72
71
|
}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import type { JsxCustomElementAttributes, JsxElementProps } from '@ecopages/jsx';
|
|
2
2
|
import { type RuiCalendarElement, type RuiCalendarProps } from '../calendar';
|
|
3
|
+
import { type RuiDateInputElement, type RuiDateInputProps } from '../date-input';
|
|
3
4
|
import type { RuiDateRangePicker as RuiDateRangePickerElement, RuiDateRangePickerProps } from './date-range-picker.script';
|
|
4
5
|
import './date-range-picker.script';
|
|
6
|
+
import '../date-input/date-input.script';
|
|
5
7
|
export type RuiDateRangePickerControlProps = JsxElementProps<HTMLDivElement>;
|
|
6
8
|
/** Bordered control row containing the date inputs and calendar toggle. */
|
|
7
9
|
export declare function RuiDateRangePickerControl({ children, class: className, ...props }: RuiDateRangePickerControlProps): import("@ecopages/jsx").JsxRenderable;
|
|
8
10
|
export type RuiDateRangePickerInputsProps = JsxElementProps<HTMLDivElement>;
|
|
9
11
|
/** Input row for `RuiDateRangePickerStartInput` and `RuiDateRangePickerEndInput`. */
|
|
10
12
|
export declare function RuiDateRangePickerInputs({ children, class: className, ...props }: RuiDateRangePickerInputsProps): import("@ecopages/jsx").JsxRenderable;
|
|
11
|
-
export type RuiDateRangePickerStartInputProps =
|
|
12
|
-
/** Start-date
|
|
13
|
+
export type RuiDateRangePickerStartInputProps = JsxCustomElementAttributes<RuiDateInputElement, RuiDateInputProps>;
|
|
14
|
+
/** Start-date segments. Stamps `[data-range-start]`. */
|
|
13
15
|
export declare function RuiDateRangePickerStartInput({ class: className, ...props }: RuiDateRangePickerStartInputProps): import("@ecopages/jsx").JsxRenderable;
|
|
14
|
-
export type RuiDateRangePickerEndInputProps =
|
|
15
|
-
/** End-date
|
|
16
|
+
export type RuiDateRangePickerEndInputProps = JsxCustomElementAttributes<RuiDateInputElement, RuiDateInputProps>;
|
|
17
|
+
/** End-date segments. Stamps `[data-range-end]`. */
|
|
16
18
|
export declare function RuiDateRangePickerEndInput({ class: className, ...props }: RuiDateRangePickerEndInputProps): import("@ecopages/jsx").JsxRenderable;
|
|
17
19
|
export type RuiDateRangePickerSeparatorProps = JsxElementProps<HTMLSpanElement>;
|
|
18
20
|
/** Visual separator between the start and end inputs. */
|
|
19
21
|
export declare function RuiDateRangePickerSeparator({ children, class: className, ...props }: RuiDateRangePickerSeparatorProps): import("@ecopages/jsx").JsxRenderable;
|
|
20
22
|
export type RuiDateRangePickerToggleProps = JsxElementProps<HTMLButtonElement>;
|
|
21
|
-
/**
|
|
23
|
+
/** Calendar toggle. Stamps `[data-range-trigger]` and `data-ref="trigger"`. */
|
|
22
24
|
export declare function RuiDateRangePickerToggle({ children, class: className, aria, ...props }: RuiDateRangePickerToggleProps): import("@ecopages/jsx").JsxRenderable;
|
|
23
25
|
export type RuiDateRangePickerPopoverProps = JsxElementProps<HTMLDivElement>;
|
|
24
|
-
/**
|
|
26
|
+
/** Popup shell. Stamps `[data-range-popover]` and `data-ref="popover"`. */
|
|
25
27
|
export declare function RuiDateRangePickerPopover({ children, class: className, ...props }: RuiDateRangePickerPopoverProps): import("@ecopages/jsx").JsxRenderable;
|
|
26
28
|
export type RuiDateRangePickerCalendarProps = JsxCustomElementAttributes<RuiCalendarElement, RuiCalendarProps>;
|
|
27
|
-
/**
|
|
29
|
+
/** Nested `rui-calendar` in range mode. Stamps `[data-range-calendar]`. */
|
|
28
30
|
export declare function RuiDateRangePickerCalendar(props: RuiDateRangePickerCalendarProps): import("@ecopages/jsx").JsxRenderable;
|
|
29
31
|
export type RuiDateRangePickerViewProps = JsxCustomElementAttributes<RuiDateRangePickerElement, RuiDateRangePickerProps> & {
|
|
30
32
|
/** Accessible name for the default start-date input. */
|
|
@@ -33,8 +35,8 @@ export type RuiDateRangePickerViewProps = JsxCustomElementAttributes<RuiDateRang
|
|
|
33
35
|
endLabel?: string;
|
|
34
36
|
};
|
|
35
37
|
/**
|
|
36
|
-
* Locale-aware date range picker with
|
|
38
|
+
* Locale-aware date range picker with segment inputs and a range calendar popover.
|
|
37
39
|
*
|
|
38
40
|
* Pair with `RuiLabel` / `RuiField` for labeling and validation.
|
|
39
41
|
*/
|
|
40
|
-
export declare function RuiDateRangePicker(
|
|
42
|
+
export declare function RuiDateRangePicker(props: RuiDateRangePickerViewProps): import("@ecopages/jsx").JsxRenderable;
|