ropav 0.4.0 → 0.5.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/components/autocomplete/autocomplete-root.js +3 -1
- package/dist/components/autocomplete/index.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbs-item.js +1 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -0
- package/dist/components/calendar/index.d.ts +5 -3
- package/dist/components/calendar-year-picker/index.d.ts +4 -2
- package/dist/components/checkbox/checkbox-content.js +1 -1
- package/dist/components/color-field/index.d.ts +1 -0
- package/dist/components/color-input-group/color-input-group-root.js +2 -0
- package/dist/components/color-input-group/color-input-group.types.d.ts +2 -0
- package/dist/components/color-input-group/index.d.ts +2 -0
- package/dist/components/combo-box/combo-box-root.js +9 -2
- package/dist/components/combo-box/combo-box.types.d.ts +3 -0
- package/dist/components/combo-box/index.d.ts +3 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/date-input-group/date-input-group-root.js +2 -0
- package/dist/components/date-input-group/date-input-group-segment.js +1 -1
- package/dist/components/date-input-group/date-input-group.types.d.ts +2 -0
- package/dist/{composables → components/date-input-group}/use-date-segment.d.ts +2 -2
- package/dist/{composables → components/date-input-group}/use-date-segment.js +9 -9
- package/dist/components/date-range-picker/date-range-picker-root.js +1 -1
- package/dist/components/date-range-picker/index.d.ts +15 -14
- package/dist/{composables → components/date-range-picker}/use-date-range-picker.d.ts +7 -7
- package/dist/{composables → components/date-range-picker}/use-date-range-picker.js +10 -10
- package/dist/components/drawer/drawer-dialog.js +1 -1
- package/dist/{composables → components/drawer}/use-drawer-drag.d.ts +1 -1
- package/dist/{composables → components/drawer}/use-drawer-drag.js +1 -1
- package/dist/components/dropdown/dropdown-menu.js +1 -0
- package/dist/components/dropdown/dropdown-submenu-trigger.js +1 -1
- package/dist/components/dropdown/index.d.ts +4 -2
- package/dist/{composables → components/dropdown}/use-safely-mouse-to-submenu.js +1 -1
- package/dist/components/icons/icon-overlay-arrow.js +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input-root.js +3 -0
- package/dist/components/input/input.types.d.ts +5 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/input-group-root.js +3 -0
- package/dist/components/input-group/input-group.types.d.ts +5 -0
- package/dist/components/input-otp/index.d.ts +6 -4
- package/dist/components/link/index.d.ts +2 -0
- package/dist/components/link/link-root.js +22 -5
- package/dist/components/link/link.types.d.ts +14 -3
- package/dist/{composables → components/list-box}/drag-collection.d.ts +2 -2
- package/dist/{composables → components/list-box}/drag-collection.js +1 -1
- package/dist/components/list-box/index.d.ts +4 -0
- package/dist/components/list-box/list-box-root.js +53 -32
- package/dist/components/list-box/list-box.types.d.ts +2 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/menu-root.js +5 -1
- package/dist/components/menu/menu.types.d.ts +3 -0
- package/dist/components/number-field/index.d.ts +3 -0
- package/dist/components/number-field/number-field-root.js +2 -0
- package/dist/components/number-field/number-field.types.d.ts +2 -0
- package/dist/components/overlay/overlay-arrow.js +64 -11
- package/dist/components/radio/radio-content.js +1 -1
- package/dist/components/range-calendar/index.d.ts +18 -15
- package/dist/components/router-provider/index.d.ts +5 -0
- package/dist/components/router-provider/index.js +3 -0
- package/dist/components/router-provider/router-provider.context.d.ts +40 -0
- package/dist/components/router-provider/router-provider.context.js +16 -0
- package/dist/components/router-provider/router-provider.d.ts +21 -0
- package/dist/components/router-provider/router-provider.js +22 -0
- package/dist/components/router-provider/router-provider.types.d.ts +23 -0
- package/dist/components/scroll-shadow/use-scroll-shadow.js +25 -1
- package/dist/components/search-field/index.d.ts +2 -0
- package/dist/components/search-field/search-field-root.js +3 -1
- package/dist/components/search-field/search-field.types.d.ts +2 -0
- package/dist/{composables → components/search-field}/use-search-field.d.ts +2 -2
- package/dist/{composables → components/search-field}/use-search-field.js +3 -3
- package/dist/components/segmented-control/index.d.ts +134 -0
- package/dist/components/segmented-control/index.js +15 -0
- package/dist/components/segmented-control/segmented-control-indicator.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control-indicator.js +36 -0
- package/dist/components/segmented-control/segmented-control-item.d.ts +21 -0
- package/dist/components/segmented-control/segmented-control-item.js +96 -0
- package/dist/components/segmented-control/segmented-control-root.d.ts +25 -0
- package/dist/components/segmented-control/segmented-control-root.js +112 -0
- package/dist/components/segmented-control/segmented-control-separator.d.ts +19 -0
- package/dist/components/segmented-control/segmented-control-separator.js +18 -0
- package/dist/components/segmented-control/segmented-control.context.d.ts +17 -0
- package/dist/components/segmented-control/segmented-control.context.js +12 -0
- package/dist/components/segmented-control/segmented-control.types.d.ts +67 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/select-hidden-select.js +1 -1
- package/dist/components/select/select-root.js +2 -0
- package/dist/components/select/select.types.d.ts +2 -0
- package/dist/components/sidebar/index.d.ts +544 -0
- package/dist/components/sidebar/index.js +47 -0
- package/dist/components/sidebar/sidebar-collapsible-trigger.d.ts +21 -0
- package/dist/components/sidebar/sidebar-collapsible-trigger.js +70 -0
- package/dist/components/sidebar/sidebar-collapsible.d.ts +24 -0
- package/dist/components/sidebar/sidebar-collapsible.js +78 -0
- package/dist/components/sidebar/sidebar-content.d.ts +21 -0
- package/dist/components/sidebar/sidebar-content.js +37 -0
- package/dist/components/sidebar/sidebar-footer.d.ts +21 -0
- package/dist/components/sidebar/sidebar-footer.js +24 -0
- package/dist/components/sidebar/sidebar-group-label.d.ts +21 -0
- package/dist/components/sidebar/sidebar-group-label.js +32 -0
- package/dist/components/sidebar/sidebar-group.d.ts +21 -0
- package/dist/components/sidebar/sidebar-group.js +48 -0
- package/dist/components/sidebar/sidebar-header.d.ts +21 -0
- package/dist/components/sidebar/sidebar-header.js +24 -0
- package/dist/components/sidebar/sidebar-inset.d.ts +21 -0
- package/dist/components/sidebar/sidebar-inset.js +24 -0
- package/dist/components/sidebar/sidebar-item-icon.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-icon.js +20 -0
- package/dist/components/sidebar/sidebar-item-indicator.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-indicator.js +48 -0
- package/dist/components/sidebar/sidebar-item-label.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-label.js +28 -0
- package/dist/components/sidebar/sidebar-item-tooltip.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-tooltip.js +38 -0
- package/dist/components/sidebar/sidebar-item-trailing.d.ts +21 -0
- package/dist/components/sidebar/sidebar-item-trailing.js +28 -0
- package/dist/components/sidebar/sidebar-item.d.ts +23 -0
- package/dist/components/sidebar/sidebar-item.js +160 -0
- package/dist/components/sidebar/sidebar-panel.d.ts +21 -0
- package/dist/components/sidebar/sidebar-panel.js +88 -0
- package/dist/components/sidebar/sidebar-rail.d.ts +21 -0
- package/dist/components/sidebar/sidebar-rail.js +210 -0
- package/dist/components/sidebar/sidebar-root.d.ts +31 -0
- package/dist/components/sidebar/sidebar-root.js +138 -0
- package/dist/components/sidebar/sidebar-separator.d.ts +19 -0
- package/dist/components/sidebar/sidebar-separator.js +16 -0
- package/dist/components/sidebar/sidebar-sub-menu.d.ts +23 -0
- package/dist/components/sidebar/sidebar-sub-menu.js +40 -0
- package/dist/components/sidebar/sidebar-trigger.d.ts +21 -0
- package/dist/components/sidebar/sidebar-trigger.js +69 -0
- package/dist/components/sidebar/sidebar.context.d.ts +75 -0
- package/dist/components/sidebar/sidebar.context.js +30 -0
- package/dist/components/sidebar/sidebar.state.d.ts +73 -0
- package/dist/components/sidebar/sidebar.state.js +76 -0
- package/dist/components/sidebar/sidebar.storage.d.ts +8 -0
- package/dist/components/sidebar/sidebar.storage.js +45 -0
- package/dist/components/sidebar/sidebar.types.d.ts +259 -0
- package/dist/components/splitter/index.d.ts +143 -0
- package/dist/components/splitter/index.js +13 -0
- package/dist/components/splitter/splitter-handle.d.ts +21 -0
- package/dist/components/splitter/splitter-handle.js +209 -0
- package/dist/components/splitter/splitter-panel.d.ts +21 -0
- package/dist/components/splitter/splitter-panel.js +70 -0
- package/dist/components/splitter/splitter-root.d.ts +31 -0
- package/dist/components/splitter/splitter-root.js +152 -0
- package/dist/components/splitter/splitter.context.d.ts +15 -0
- package/dist/components/splitter/splitter.context.js +5 -0
- package/dist/components/splitter/splitter.state.d.ts +87 -0
- package/dist/components/splitter/splitter.state.js +322 -0
- package/dist/components/splitter/splitter.storage.d.ts +15 -0
- package/dist/components/splitter/splitter.storage.js +56 -0
- package/dist/components/splitter/splitter.types.d.ts +98 -0
- package/dist/components/switch/switch-content.js +1 -1
- package/dist/components/table/index.d.ts +10 -9
- package/dist/components/table/table-body.js +13 -13
- package/dist/components/table/table-cell.js +49 -46
- package/dist/components/table/table-column-resizer.js +1 -1
- package/dist/components/table/table-column.js +1 -1
- package/dist/components/table/table-content.js +37 -18
- package/dist/{composables → components/table}/table-drag-collection.d.ts +1 -1
- package/dist/{composables → components/table}/table-drag-collection.js +1 -1
- package/dist/components/table/table-drop-indicator.js +3 -1
- package/dist/components/table/table-resizable-container.d.ts +4 -5
- package/dist/components/table/table-row.js +45 -14
- package/dist/components/table/table-virtualizer-item.d.ts +2 -7
- package/dist/components/table/table-virtualizer-item.js +20 -9
- package/dist/components/table/table.context.d.ts +11 -3
- package/dist/components/table/table.types.d.ts +1 -1
- package/dist/{composables → components/table}/use-grid-keyboard.d.ts +3 -3
- package/dist/{composables → components/table}/use-grid-keyboard.js +57 -55
- package/dist/{composables → components/table}/use-grid-selection-announcement.d.ts +2 -2
- package/dist/{composables → components/table}/use-grid-selection-announcement.js +2 -2
- package/dist/{composables → components/table}/use-table-collection.d.ts +2 -2
- package/dist/{composables → components/table}/use-table-collection.js +4 -4
- package/dist/{composables → components/table}/use-table-column-layout.d.ts +13 -20
- package/dist/components/table/use-table-column-layout.js +115 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea-root.js +3 -0
- package/dist/components/textarea/textarea.types.d.ts +5 -0
- package/dist/components/textfield/index.d.ts +2 -0
- package/dist/components/textfield/textfield-root.js +5 -1
- package/dist/components/textfield/textfield.context.d.ts +2 -0
- package/dist/components/textfield/textfield.types.d.ts +5 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/toast-default-content.js +1 -1
- package/dist/components/toolbar/index.d.ts +3 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip-root.js +1 -1
- package/dist/components/virtualizer/index.d.ts +3 -1
- package/dist/components/virtualizer/index.js +2 -1
- package/dist/components/virtualizer/use-virtualizer-item.d.ts +23 -0
- package/dist/components/virtualizer/use-virtualizer-item.js +45 -0
- package/dist/components/virtualizer/virtualizer-item.js +7 -41
- package/dist/components/virtualizer/virtualizer-scrollbar-track.d.ts +20 -0
- package/dist/components/virtualizer/virtualizer-scrollbar-track.js +141 -0
- package/dist/components/virtualizer/virtualizer-scrollbar.d.ts +18 -0
- package/dist/components/virtualizer/virtualizer-scrollbar.js +55 -0
- package/dist/components/virtualizer/virtualizer.context.d.ts +17 -1
- package/dist/composables/drag-manager.js +1 -13
- package/dist/composables/index.d.ts +3 -71
- package/dist/composables/use-collection.d.ts +22 -3
- package/dist/composables/use-collection.js +67 -14
- package/dist/composables/use-color-area.js +2 -2
- package/dist/composables/use-color-field.js +1 -1
- package/dist/composables/use-combo-box.js +1 -1
- package/dist/composables/use-date-field.js +1 -1
- package/dist/composables/use-drag-and-drop.js +1 -1
- package/dist/composables/use-drag.d.ts +6 -5
- package/dist/composables/use-draggable-item.d.ts +2 -2
- package/dist/composables/use-droppable-collection.js +2 -2
- package/dist/composables/use-droppable-item.js +1 -1
- package/dist/composables/use-form-reset.d.ts +6 -2
- package/dist/composables/use-form-reset.js +9 -5
- package/dist/composables/use-list-keyboard.js +64 -62
- package/dist/composables/use-number-field.js +1 -1
- package/dist/composables/use-select.js +2 -2
- package/dist/composables/use-selection-manager.js +4 -4
- package/dist/composables/use-single-select-list-state.d.ts +37 -0
- package/dist/composables/use-single-select-list-state.js +110 -0
- package/dist/composables/use-slider-thumb.js +2 -2
- package/dist/composables/use-slider.js +1 -1
- package/dist/composables/use-tab-list-state.d.ts +10 -29
- package/dist/composables/use-tab-list-state.js +10 -99
- package/dist/composables/use-text-field.js +1 -1
- package/dist/composables/use-virtualizer-scroll.d.ts +52 -2
- package/dist/composables/use-virtualizer-scroll.js +79 -13
- package/dist/composables/use-virtualizer.d.ts +24 -4
- package/dist/composables/use-virtualizer.js +40 -6
- package/dist/index.js +52 -80
- package/dist/utils/document-order.d.ts +14 -0
- package/dist/utils/document-order.js +17 -0
- package/dist/utils/flex-sizing.d.ts +41 -0
- package/dist/utils/flex-sizing.js +140 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/open-link.d.ts +31 -0
- package/dist/utils/open-link.js +32 -0
- package/dist/utils/story-truncation.d.ts +20 -0
- package/dist/utils/story-users.d.ts +11 -0
- package/dist/utils/virtualizer-collection.d.ts +14 -4
- package/dist/utils/virtualizer-collection.js +9 -14
- package/dist/utils/virtualizer-layout-info.js +3 -2
- package/dist/utils/virtualizer-list-layout.d.ts +75 -29
- package/dist/utils/virtualizer-list-layout.js +182 -99
- package/dist/utils/virtualizer-offsets.d.ts +111 -0
- package/dist/utils/virtualizer-offsets.js +159 -0
- package/dist/utils/virtualizer-overscan.d.ts +9 -15
- package/dist/utils/virtualizer-overscan.js +14 -33
- package/dist/utils/virtualizer-table-layout.d.ts +50 -21
- package/dist/utils/virtualizer-table-layout.js +130 -89
- package/dist/version.js +1 -1
- package/package.json +19 -3
- package/dist/composables/use-table-column-layout.js +0 -214
- /package/dist/{composables → components/dropdown}/use-safely-mouse-to-submenu.d.ts +0 -0
|
@@ -1,21 +1,73 @@
|
|
|
1
1
|
import { useOverlayArrowContext } from "./overlay.context.js";
|
|
2
|
-
import { computed, createSlot, defineVaporComponent, renderEffect, setAttr, setClass, setInsertionState, setStyle, setTemplateRefBinding, template } from "vue";
|
|
2
|
+
import { child, computed, createSlot, defineVaporComponent, renderEffect, setAttr, setClass, setInsertionState, setStyle, setTemplateRefBinding, shallowRef, template, watch } from "vue";
|
|
3
3
|
//#region src/components/overlay/overlay-arrow.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
4
|
-
var t0 = template("<div>", 1);
|
|
4
|
+
var t0 = template("<div><!><svg aria-hidden=true focusable=false height=0 style=\"position: absolute\" width=0><filter id=ropav-overlay-edge color-interpolation-filters=sRGB height=200% width=200% x=-50% y=-50%><feFlood result=line style=\"flood-color: var(--overlay-edge-line, transparent)\"></feFlood><feComposite in=line in2=SourceAlpha operator=out result=outside></feComposite><feGaussianBlur in=outside result=soft stdDeviation=0.5></feGaussianBlur><feComposite in=soft in2=SourceAlpha operator=in result=glow></feComposite><feMerge><feMergeNode in=SourceGraphic></feMergeNode><feMergeNode in=glow>", 1);
|
|
5
|
+
var SKIRT = 2;
|
|
6
|
+
/** Half the mouth's width: the shape's mouth spans the middle 10 of its 12 unit box. */
|
|
7
|
+
var HALF_MOUTH = 5;
|
|
8
|
+
/**
|
|
9
|
+
* How much deeper than the skirt the arrow sits, where the overlay's edge is curved.
|
|
10
|
+
*
|
|
11
|
+
* The mouth is straight, and it normally lies exactly on the overlay's edge, whose flat run its
|
|
12
|
+
* ends meet tangentially. Near a corner the edge has curved away from that line — entirely, when
|
|
13
|
+
* a large radius has clamped a short overlay toward a pill — and the mouth's ends would hang past
|
|
14
|
+
* the curve as two bare horns. The recession under each end follows from the radius the overlay
|
|
15
|
+
* actually renders, and the whole arrow is pulled in that far, plus a little for antialiasing.
|
|
16
|
+
*/
|
|
5
17
|
var overlay_arrow_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__PURE__*/ defineVaporComponent({
|
|
6
18
|
__name: "overlay-arrow",
|
|
7
19
|
props: { class: {} },
|
|
8
20
|
setup(__props) {
|
|
9
21
|
const props = __props;
|
|
10
22
|
const arrow = useOverlayArrowContext();
|
|
23
|
+
const element = shallowRef(null);
|
|
11
24
|
const setElement = (next) => {
|
|
12
|
-
|
|
25
|
+
element.value = next ?? null;
|
|
26
|
+
arrow?.registerElement(element.value);
|
|
13
27
|
};
|
|
14
28
|
const placement = computed(() => arrow?.placement.value ?? null);
|
|
29
|
+
/** The straight run the shape carries above its mouth, buried inside the overlay. */
|
|
30
|
+
const burial = shallowRef(0);
|
|
31
|
+
const measureBurial = () => {
|
|
32
|
+
const own = element.value;
|
|
33
|
+
const side = placement.value;
|
|
34
|
+
const isHorizontal = side === "top" || side === "bottom";
|
|
35
|
+
const centre = Number.parseFloat(arrow?.style.value[isHorizontal ? "left" : "top"] ?? "");
|
|
36
|
+
const overlay = own?.offsetParent;
|
|
37
|
+
if (!own || !side || !Number.isFinite(centre) || !(overlay instanceof HTMLElement)) return 0;
|
|
38
|
+
const width = overlay.offsetWidth;
|
|
39
|
+
const height = overlay.offsetHeight;
|
|
40
|
+
const edge = isHorizontal ? width : height;
|
|
41
|
+
const declared = getComputedStyle(overlay).borderTopLeftRadius;
|
|
42
|
+
const radius = Math.min(declared.includes("%") ? Math.min(width, height) : Number.parseFloat(declared) || 0, width / 2, height / 2);
|
|
43
|
+
if (radius <= 0) return 0;
|
|
44
|
+
const recessionAt = (position) => {
|
|
45
|
+
const intoCorner = Math.max(radius - position, position - (edge - radius), 0);
|
|
46
|
+
if (intoCorner <= 0) return 0;
|
|
47
|
+
const reach = Math.min(intoCorner, radius);
|
|
48
|
+
return radius - Math.sqrt(radius * radius - reach * reach);
|
|
49
|
+
};
|
|
50
|
+
const deepest = Math.max(recessionAt(centre - HALF_MOUTH), recessionAt(centre + HALF_MOUTH));
|
|
51
|
+
return deepest > 0 ? Math.min(deepest + .5, 4) : 0;
|
|
52
|
+
};
|
|
53
|
+
watch([
|
|
54
|
+
element,
|
|
55
|
+
placement,
|
|
56
|
+
() => arrow?.style.value
|
|
57
|
+
], () => {
|
|
58
|
+
burial.value = measureBurial();
|
|
59
|
+
}, {
|
|
60
|
+
flush: "post",
|
|
61
|
+
immediate: true
|
|
62
|
+
});
|
|
15
63
|
/**
|
|
16
64
|
* Pinned to the edge the overlay is placed against, and centred on the offset the positioner
|
|
17
65
|
* worked out.
|
|
18
66
|
*
|
|
67
|
+
* Pulled back into the overlay by the skirt, so the shape overlaps the body it grows out of
|
|
68
|
+
* rather than touching it: shapes that merely touch each antialias the shared row at fractional
|
|
69
|
+
* device pixel ratios, and the page bleeds through the seam.
|
|
70
|
+
*
|
|
19
71
|
* The offset names the arrow's centre, so it is pulled back by half its own size on the cross
|
|
20
72
|
* axis — done with a transform rather than arithmetic because only the stylesheet knows how big
|
|
21
73
|
* the arrow is.
|
|
@@ -25,20 +77,21 @@ var overlay_arrow_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__
|
|
|
25
77
|
return {
|
|
26
78
|
position: "absolute",
|
|
27
79
|
transform: side === "top" || side === "bottom" ? "translateX(-50%)" : "translateY(-50%)",
|
|
28
|
-
...side ? { [side]:
|
|
80
|
+
...side ? { [side]: `calc(100% - ${SKIRT + burial.value}px)` } : {},
|
|
29
81
|
...arrow?.style.value ?? {}
|
|
30
82
|
};
|
|
31
83
|
});
|
|
32
|
-
const
|
|
84
|
+
const n2 = t0();
|
|
85
|
+
const n1 = child(n2);
|
|
33
86
|
renderEffect(() => {
|
|
34
|
-
setClass(
|
|
35
|
-
setAttr(
|
|
36
|
-
setStyle(
|
|
87
|
+
setClass(n2, props.class);
|
|
88
|
+
setAttr(n2, "data-placement", placement.value ?? void 0);
|
|
89
|
+
setStyle(n2, style.value);
|
|
37
90
|
});
|
|
38
|
-
setInsertionState(n1);
|
|
91
|
+
setInsertionState(n2, n1);
|
|
39
92
|
createSlot();
|
|
40
|
-
setTemplateRefBinding(
|
|
41
|
-
return
|
|
93
|
+
setTemplateRefBinding(n2, () => setElement);
|
|
94
|
+
return n2;
|
|
42
95
|
}
|
|
43
96
|
});
|
|
44
97
|
//#endregion
|
|
@@ -21,7 +21,7 @@ var radio_content_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__
|
|
|
21
21
|
const setInputEl = (element) => {
|
|
22
22
|
inputEl.value = element instanceof HTMLInputElement ? element : null;
|
|
23
23
|
};
|
|
24
|
-
useFormReset(inputEl, state.defaultSelectedValue, state.setSelectedValue);
|
|
24
|
+
useFormReset(inputEl, state.defaultSelectedValue, state.setSelectedValue, form);
|
|
25
25
|
watch([inputEl, isSelected], ([input, selected]) => setFormChecked(input, selected), {
|
|
26
26
|
flush: "post",
|
|
27
27
|
immediate: true
|
|
@@ -13,7 +13,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
13
13
|
slots: {
|
|
14
14
|
default?: (props: import("./range-calendar.types.js").RangeCalendarRootSlotProps) => unknown;
|
|
15
15
|
};
|
|
16
|
-
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("
|
|
16
|
+
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("./index.js").DateRange | null) => void) & ((evt: "update:yearPickerOpen", isOpen: boolean) => void);
|
|
17
17
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
18
18
|
props: import('vue').PublicProps & {
|
|
19
19
|
class?: string;
|
|
@@ -22,15 +22,15 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
22
22
|
ariaLabelledby?: string;
|
|
23
23
|
ariaDescribedby?: string;
|
|
24
24
|
ariaDetails?: string;
|
|
25
|
-
value?: import("
|
|
26
|
-
defaultValue?: import("
|
|
25
|
+
value?: import("./index.js").DateRange | null;
|
|
26
|
+
defaultValue?: import("./index.js").DateRange | null;
|
|
27
27
|
focusedValue?: import("@internationalized/date").DateValue | null;
|
|
28
28
|
defaultFocusedValue?: import("@internationalized/date").DateValue | null;
|
|
29
29
|
minValue?: import("@internationalized/date").DateValue | null;
|
|
30
30
|
maxValue?: import("@internationalized/date").DateValue | null;
|
|
31
31
|
isDateUnavailable?: (date: import("@internationalized/date").DateValue, anchorDate: import("@internationalized/date").CalendarDate | null) => boolean;
|
|
32
32
|
allowsNonContiguousRanges?: boolean;
|
|
33
|
-
commitBehavior?: import("
|
|
33
|
+
commitBehavior?: import("./index.js").RangeCalendarCommitBehavior;
|
|
34
34
|
isDisabled?: boolean;
|
|
35
35
|
isReadOnly?: boolean;
|
|
36
36
|
isInvalid?: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
43
43
|
isYearPickerOpen?: boolean;
|
|
44
44
|
defaultYearPickerOpen?: boolean;
|
|
45
45
|
"onUpdate:focusedValue"?: ((value: import("@internationalized/date").CalendarDate) => any) | undefined;
|
|
46
|
-
"onUpdate:value"?: ((value: import("
|
|
46
|
+
"onUpdate:value"?: ((value: import("./index.js").DateRange | null) => any) | undefined;
|
|
47
47
|
"onUpdate:yearPickerOpen"?: ((isOpen: boolean) => any) | undefined;
|
|
48
48
|
} & (typeof globalThis extends {
|
|
49
49
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -53,7 +53,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
53
53
|
slots: {
|
|
54
54
|
default?: (props: import("./range-calendar.types.js").RangeCalendarRootSlotProps) => unknown;
|
|
55
55
|
};
|
|
56
|
-
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("
|
|
56
|
+
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("./index.js").DateRange | null) => void) & ((evt: "update:yearPickerOpen", isOpen: boolean) => void);
|
|
57
57
|
}>) => import('vue').VNode & {
|
|
58
58
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
59
59
|
}) & {
|
|
@@ -215,7 +215,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
215
215
|
props: import('vue').PublicProps & {
|
|
216
216
|
class?: string;
|
|
217
217
|
offset?: import("@internationalized/date").DateDuration;
|
|
218
|
-
format?: import("
|
|
218
|
+
format?: import("./index.js").CalendarHeadingFormatOptions;
|
|
219
219
|
} & (typeof globalThis extends {
|
|
220
220
|
__VLS_PROPS_FALLBACK: infer P;
|
|
221
221
|
} ? P : {});
|
|
@@ -253,7 +253,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
253
253
|
slots: {
|
|
254
254
|
default?: (props: import("./range-calendar.types.js").RangeCalendarRootSlotProps) => unknown;
|
|
255
255
|
};
|
|
256
|
-
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("
|
|
256
|
+
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("./index.js").DateRange | null) => void) & ((evt: "update:yearPickerOpen", isOpen: boolean) => void);
|
|
257
257
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
258
258
|
props: import('vue').PublicProps & {
|
|
259
259
|
class?: string;
|
|
@@ -262,15 +262,15 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
262
262
|
ariaLabelledby?: string;
|
|
263
263
|
ariaDescribedby?: string;
|
|
264
264
|
ariaDetails?: string;
|
|
265
|
-
value?: import("
|
|
266
|
-
defaultValue?: import("
|
|
265
|
+
value?: import("./index.js").DateRange | null;
|
|
266
|
+
defaultValue?: import("./index.js").DateRange | null;
|
|
267
267
|
focusedValue?: import("@internationalized/date").DateValue | null;
|
|
268
268
|
defaultFocusedValue?: import("@internationalized/date").DateValue | null;
|
|
269
269
|
minValue?: import("@internationalized/date").DateValue | null;
|
|
270
270
|
maxValue?: import("@internationalized/date").DateValue | null;
|
|
271
271
|
isDateUnavailable?: (date: import("@internationalized/date").DateValue, anchorDate: import("@internationalized/date").CalendarDate | null) => boolean;
|
|
272
272
|
allowsNonContiguousRanges?: boolean;
|
|
273
|
-
commitBehavior?: import("
|
|
273
|
+
commitBehavior?: import("./index.js").RangeCalendarCommitBehavior;
|
|
274
274
|
isDisabled?: boolean;
|
|
275
275
|
isReadOnly?: boolean;
|
|
276
276
|
isInvalid?: boolean;
|
|
@@ -283,7 +283,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
283
283
|
isYearPickerOpen?: boolean;
|
|
284
284
|
defaultYearPickerOpen?: boolean;
|
|
285
285
|
"onUpdate:focusedValue"?: ((value: import("@internationalized/date").CalendarDate) => any) | undefined;
|
|
286
|
-
"onUpdate:value"?: ((value: import("
|
|
286
|
+
"onUpdate:value"?: ((value: import("./index.js").DateRange | null) => any) | undefined;
|
|
287
287
|
"onUpdate:yearPickerOpen"?: ((isOpen: boolean) => any) | undefined;
|
|
288
288
|
} & (typeof globalThis extends {
|
|
289
289
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -293,7 +293,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
293
293
|
slots: {
|
|
294
294
|
default?: (props: import("./range-calendar.types.js").RangeCalendarRootSlotProps) => unknown;
|
|
295
295
|
};
|
|
296
|
-
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("
|
|
296
|
+
emit: ((evt: "update:focusedValue", value: import("@internationalized/date").CalendarDate) => void) & ((evt: "update:value", value: import("./index.js").DateRange | null) => void) & ((evt: "update:yearPickerOpen", isOpen: boolean) => void);
|
|
297
297
|
}>) => import('vue').VNode & {
|
|
298
298
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
299
299
|
};
|
|
@@ -330,7 +330,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
330
330
|
props: import('vue').PublicProps & {
|
|
331
331
|
class?: string;
|
|
332
332
|
visibleYears?: number;
|
|
333
|
-
format?: import("
|
|
333
|
+
format?: import("../index.js").CalendarYearPickerFormatOptions;
|
|
334
334
|
} & (typeof globalThis extends {
|
|
335
335
|
__VLS_PROPS_FALLBACK: infer P;
|
|
336
336
|
} ? P : {});
|
|
@@ -395,7 +395,7 @@ export declare const RangeCalendar: ((__VLS_props: NonNullable<Awaited<typeof __
|
|
|
395
395
|
props: import('vue').PublicProps & {
|
|
396
396
|
class?: string;
|
|
397
397
|
offset?: import("@internationalized/date").DateDuration;
|
|
398
|
-
format?: import("
|
|
398
|
+
format?: import("./index.js").CalendarHeadingFormatOptions;
|
|
399
399
|
} & (typeof globalThis extends {
|
|
400
400
|
__VLS_PROPS_FALLBACK: infer P;
|
|
401
401
|
} ? P : {});
|
|
@@ -434,5 +434,8 @@ export { RangeCalendarCell, RangeCalendarCellIndicator, RangeCalendarGrid, Range
|
|
|
434
434
|
export type { RangeCalendarCellIndicatorProps, RangeCalendarCellProps, RangeCalendarCellSlotProps, RangeCalendarGridBodyProps, RangeCalendarGridBodySlotProps, RangeCalendarGridHeaderProps, RangeCalendarGridHeaderSlotProps, RangeCalendarGridProps, RangeCalendarHeaderCellProps, RangeCalendarHeaderProps, RangeCalendarHeadingProps, RangeCalendarNavButtonProps, RangeCalendarRootProps, RangeCalendarRootProps as RangeCalendarProps, RangeCalendarRootSlotProps, } from "./range-calendar.types.js";
|
|
435
435
|
export { provideRangeCalendarContext, provideRangeCalendarOwnerContext, useRangeCalendarContext, useRangeCalendarOwnerContext, } from "./range-calendar.context.js";
|
|
436
436
|
export type { RangeCalendarContext, RangeCalendarOwnedProps, RangeCalendarOwnerContext, } from "./range-calendar.context.js";
|
|
437
|
+
export type { AnyCalendarState, DateRange } from "../../composables/use-calendar.js";
|
|
438
|
+
export type { CalendarHeadingFormatOptions } from "../../composables/use-calendar-heading.js";
|
|
439
|
+
export type { RangeCalendarCommitBehavior } from "../../composables/use-range-calendar.js";
|
|
437
440
|
export { rangeCalendarVariants } from "@ropav/styles";
|
|
438
441
|
export type { RangeCalendarVariants } from "@ropav/styles";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import RouterProviderRoot from "./router-provider.js";
|
|
2
|
+
export { RouterProviderRoot, RouterProviderRoot as RouterProvider };
|
|
3
|
+
export type { RouterProviderRootProps, RouterProviderRootProps as RouterProviderProps, } from "./router-provider.types.js";
|
|
4
|
+
export { useRouterContext } from "./router-provider.context.js";
|
|
5
|
+
export type { RouterContext } from "./router-provider.context.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The application's router, reduced to the three questions a link has to ask it.
|
|
3
|
+
*
|
|
4
|
+
* Ported from React Aria's `packages/react-aria/src/utils/RouterProvider.tsx`
|
|
5
|
+
* (react-aria 3.51.0), minus its `isNative` branch — this package has no native target.
|
|
6
|
+
*
|
|
7
|
+
* `resolveHref` is React's `useHref` renamed: in Vue a `use*` name promises a composable that
|
|
8
|
+
* may only be called during `setup()`, and this one is a plain function called from a `computed`.
|
|
9
|
+
*/
|
|
10
|
+
export interface RouterContext {
|
|
11
|
+
/**
|
|
12
|
+
* Hands a same-origin, unmodified activation to the application's router.
|
|
13
|
+
*
|
|
14
|
+
* Receives the href as the link declared it, not as the anchor renders it — `resolveHref` is
|
|
15
|
+
* for the DOM, and a router wants back the path it was given.
|
|
16
|
+
*/
|
|
17
|
+
navigate: (href: string, options?: unknown) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Whether this href addresses the route showing now.
|
|
20
|
+
*
|
|
21
|
+
* The matching rule lives entirely here, in the application's own predicate: exact against
|
|
22
|
+
* prefix, trailing slashes and query handling all differ per route and per link, and a library
|
|
23
|
+
* that guessed would be wrong for half of them.
|
|
24
|
+
*/
|
|
25
|
+
isCurrent: (href: string) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Turns an app-relative href into the URL the anchor should carry, for a router mounted under
|
|
28
|
+
* a base path or running in hash mode. The rendered href is what a middle-click opens and what
|
|
29
|
+
* "copy link address" yields, so it has to be the real one.
|
|
30
|
+
*/
|
|
31
|
+
resolveHref: (href: string) => string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The router an ancestor has supplied, or `null` when nobody has and the browser's own navigation
|
|
35
|
+
* is what should happen.
|
|
36
|
+
*
|
|
37
|
+
* Loose, because most of the tree runs without a router — a documentation page, a test, an app
|
|
38
|
+
* that never routes — and following the href is the right answer there, not an error.
|
|
39
|
+
*/
|
|
40
|
+
export declare const useRouterContext: () => RouterContext | null, provideRouterContext: (value: RouterContext | null) => RouterContext | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext } from "../../utils/create-context.js";
|
|
2
|
+
//#region src/components/router-provider/router-provider.context.ts
|
|
3
|
+
/**
|
|
4
|
+
* The router an ancestor has supplied, or `null` when nobody has and the browser's own navigation
|
|
5
|
+
* is what should happen.
|
|
6
|
+
*
|
|
7
|
+
* Loose, because most of the tree runs without a router — a documentation page, a test, an app
|
|
8
|
+
* that never routes — and following the href is the right answer there, not an error.
|
|
9
|
+
*/
|
|
10
|
+
var [useRouterContext, provideRouterContext] = createContext({
|
|
11
|
+
defaultValue: null,
|
|
12
|
+
name: "RouterContext",
|
|
13
|
+
strict: false
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { provideRouterContext, useRouterContext };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RouterProviderRootProps } from "./router-provider.types.js";
|
|
2
|
+
declare const __VLS_export: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, 'attrs' | 'emit' | 'slots'>>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
3
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<RouterProviderRootProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: () => unknown;
|
|
10
|
+
};
|
|
11
|
+
emit: {};
|
|
12
|
+
}>) => import('vue').VNode & {
|
|
13
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
18
|
+
[K in keyof T]: T[K];
|
|
19
|
+
} : {
|
|
20
|
+
[K in keyof T as K]: T[K];
|
|
21
|
+
}) & {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { provideRouterContext } from "./router-provider.context.js";
|
|
2
|
+
import { createSlot, defineVaporComponent } from "vue";
|
|
3
|
+
//#region src/components/router-provider/router-provider.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
4
|
+
var router_provider_vue_vue_type_script_setup_true_vapor_true_lang_default = /*@__PURE__*/ defineVaporComponent({
|
|
5
|
+
__name: "router-provider",
|
|
6
|
+
props: {
|
|
7
|
+
navigate: { type: Function },
|
|
8
|
+
isCurrent: { type: Function },
|
|
9
|
+
resolveHref: { type: Function }
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
provideRouterContext({
|
|
14
|
+
isCurrent: (href) => props.isCurrent?.(href) ?? false,
|
|
15
|
+
navigate: (href, options) => props.navigate(href, options),
|
|
16
|
+
resolveHref: (href) => props.resolveHref?.(href) ?? href
|
|
17
|
+
});
|
|
18
|
+
return createSlot();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { router_provider_vue_vue_type_script_setup_true_vapor_true_lang_default as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface RouterProviderRootProps {
|
|
2
|
+
/**
|
|
3
|
+
* Performs a client-side navigation to `href`. In a vue-router application this is
|
|
4
|
+
* `(href, options) => router.push({path: href, ...options})`.
|
|
5
|
+
*
|
|
6
|
+
* Receives the href as the link declared it, so a router gets back the path it was given
|
|
7
|
+
* rather than the one `resolveHref` produced for the DOM.
|
|
8
|
+
*/
|
|
9
|
+
navigate: (href: string, options?: unknown) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Whether an href addresses the route showing now, for links that ask with `aria-current="auto"`.
|
|
12
|
+
*
|
|
13
|
+
* The matching rule is yours: `(href) => route.path === href` for an exact match,
|
|
14
|
+
* `(href) => route.path.startsWith(href)` for a section. Omitted, no link resolves as current.
|
|
15
|
+
*/
|
|
16
|
+
isCurrent?: (href: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Rewrites an app-relative href into the URL the anchor should carry, for a router mounted
|
|
19
|
+
* under a base path or running in hash mode — `(href) => router.resolve(href).href`.
|
|
20
|
+
* Omitted, the href renders as written.
|
|
21
|
+
*/
|
|
22
|
+
resolveHref?: (href: string) => string;
|
|
23
|
+
}
|
|
@@ -77,10 +77,34 @@ var useScrollShadow = (options) => {
|
|
|
77
77
|
checkOverflow();
|
|
78
78
|
current.addEventListener("scroll", checkOverflow, { passive: true });
|
|
79
79
|
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(checkOverflow);
|
|
80
|
-
|
|
80
|
+
/**
|
|
81
|
+
* The container **and** everything directly inside it.
|
|
82
|
+
*
|
|
83
|
+
* Watching the container alone sees only half of what makes a region scrollable: the other
|
|
84
|
+
* half is the content growing while the region keeps its size, which is what an accordion or
|
|
85
|
+
* a disclosure opening inside one does. Nothing scrolls and nothing resizes, so a check that
|
|
86
|
+
* waits for either turns up only once the reader scrolls — by which point the shadow has
|
|
87
|
+
* stopped being the hint it exists to be.
|
|
88
|
+
*
|
|
89
|
+
* Direct children are enough. In normal flow nothing can grow the scrollable area without
|
|
90
|
+
* growing one of them, so watching deeper would cost an entry per row and report the same
|
|
91
|
+
* thing.
|
|
92
|
+
*/
|
|
93
|
+
const observe = () => {
|
|
94
|
+
observer?.disconnect();
|
|
95
|
+
observer?.observe(current);
|
|
96
|
+
for (const child of Array.from(current.children)) observer?.observe(child);
|
|
97
|
+
};
|
|
98
|
+
observe();
|
|
99
|
+
const mutations = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver(() => {
|
|
100
|
+
observe();
|
|
101
|
+
checkOverflow();
|
|
102
|
+
});
|
|
103
|
+
mutations?.observe(current, { childList: true });
|
|
81
104
|
onCleanup(() => {
|
|
82
105
|
current.removeEventListener("scroll", checkOverflow);
|
|
83
106
|
observer?.disconnect();
|
|
107
|
+
mutations?.disconnect();
|
|
84
108
|
cancelPendingFrame();
|
|
85
109
|
previous = null;
|
|
86
110
|
});
|
|
@@ -13,6 +13,7 @@ export declare const SearchField: ((__VLS_props: NonNullable<Awaited<typeof __VL
|
|
|
13
13
|
props: import('vue').PublicProps & {
|
|
14
14
|
class?: string;
|
|
15
15
|
variant?: import("@ropav/styles").SearchFieldVariants["variant"];
|
|
16
|
+
size?: import("@ropav/styles").SearchFieldVariants["size"];
|
|
16
17
|
fullWidth?: boolean;
|
|
17
18
|
value?: string;
|
|
18
19
|
defaultValue?: string;
|
|
@@ -129,6 +130,7 @@ export declare const SearchField: ((__VLS_props: NonNullable<Awaited<typeof __VL
|
|
|
129
130
|
props: import('vue').PublicProps & {
|
|
130
131
|
class?: string;
|
|
131
132
|
variant?: import("@ropav/styles").SearchFieldVariants["variant"];
|
|
133
|
+
size?: import("@ropav/styles").SearchFieldVariants["size"];
|
|
132
134
|
fullWidth?: boolean;
|
|
133
135
|
value?: string;
|
|
134
136
|
defaultValue?: string;
|
|
@@ -5,7 +5,7 @@ import { useAutocompleteInputContext } from "../../composables/use-autocomplete.
|
|
|
5
5
|
import { provideFieldErrorContext } from "../field-error/field-error.context.js";
|
|
6
6
|
import { provideTextFieldControlContext } from "../../composables/use-text-field.js";
|
|
7
7
|
import { provideSearchFieldContext } from "./search-field.context.js";
|
|
8
|
-
import { useSearchField } from "
|
|
8
|
+
import { useSearchField } from "./use-search-field.js";
|
|
9
9
|
import { computed, createSlot, defineVaporComponent, renderEffect, setAttr, setClass, setInsertionState, template, unref, watch } from "vue";
|
|
10
10
|
import { searchFieldVariants } from "@ropav/styles";
|
|
11
11
|
//#region src/components/search-field/search-field-root.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
@@ -15,6 +15,7 @@ var search_field_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /
|
|
|
15
15
|
props: {
|
|
16
16
|
class: {},
|
|
17
17
|
variant: { default: void 0 },
|
|
18
|
+
size: {},
|
|
18
19
|
fullWidth: {
|
|
19
20
|
type: Boolean,
|
|
20
21
|
default: void 0
|
|
@@ -128,6 +129,7 @@ var search_field_root_vue_vue_type_script_setup_true_vapor_true_lang_default = /
|
|
|
128
129
|
});
|
|
129
130
|
const slots = computed(() => searchFieldVariants({
|
|
130
131
|
fullWidth: props.fullWidth,
|
|
132
|
+
size: props.size,
|
|
131
133
|
variant: props.variant
|
|
132
134
|
}));
|
|
133
135
|
provideFieldIdsContext(field.fieldIds);
|
|
@@ -4,6 +4,8 @@ export interface SearchFieldRootProps {
|
|
|
4
4
|
class?: string;
|
|
5
5
|
/** Visual variant. @default "primary" */
|
|
6
6
|
variant?: SearchFieldVariants["variant"];
|
|
7
|
+
/** How tall the field stands, matching a button of the same size. @default "md" */
|
|
8
|
+
size?: SearchFieldVariants["size"];
|
|
7
9
|
/** Whether the field stretches to fill its container. */
|
|
8
10
|
fullWidth?: boolean;
|
|
9
11
|
/** Text in the field. Makes it controlled. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PressResponder } from "
|
|
2
|
-
import type { UseTextFieldOptions, UseTextFieldReturn } from "
|
|
1
|
+
import type { PressResponder } from "../../composables/press-responder.js";
|
|
2
|
+
import type { UseTextFieldOptions, UseTextFieldReturn } from "../../composables/use-text-field.js";
|
|
3
3
|
import type { ComputedRef, MaybeRefOrGetter } from "vue";
|
|
4
4
|
export interface UseSearchFieldOptions extends Omit<UseTextFieldOptions, "type"> {
|
|
5
5
|
/** Kind of control the browser should offer. @default "search" */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { usePress } from "
|
|
2
|
-
import { useTextField } from "
|
|
1
|
+
import { usePress } from "../../composables/use-press.js";
|
|
2
|
+
import { useTextField } from "../../composables/use-text-field.js";
|
|
3
3
|
import { computed, toValue } from "vue";
|
|
4
|
-
//#region src/
|
|
4
|
+
//#region src/components/search-field/use-search-field.ts
|
|
5
5
|
/**
|
|
6
6
|
* Behaviour and accessibility for a search field, ported from React Aria's
|
|
7
7
|
* `packages/react-aria/src/searchfield/useSearchField.ts` (react-aria 3.51.0).
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import SegmentedControlIndicator from "./segmented-control-indicator.js";
|
|
2
|
+
import SegmentedControlItem from "./segmented-control-item.js";
|
|
3
|
+
import SegmentedControlRoot from "./segmented-control-root.js";
|
|
4
|
+
import SegmentedControlSeparator from "./segmented-control-separator.js";
|
|
5
|
+
export declare const SegmentedControl: ((__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
6
|
+
attrs: any;
|
|
7
|
+
slots: {
|
|
8
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlRootSlotProps) => unknown;
|
|
9
|
+
};
|
|
10
|
+
emit: ((evt: "selectionChange", key: import("../../index.js").CollectionKey) => void) & ((evt: "update:selectedKey", key: import("../../index.js").CollectionKey) => void);
|
|
11
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
12
|
+
props: import('vue').PublicProps & {
|
|
13
|
+
class?: string;
|
|
14
|
+
size?: import("@ropav/styles").SegmentedControlVariants["size"];
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
selectedKey?: import("../../index.js").CollectionKey;
|
|
17
|
+
defaultSelectedKey?: import("../../index.js").CollectionKey;
|
|
18
|
+
disabledKeys?: import("../../index.js").CollectionKey[];
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
ariaLabelledby?: string;
|
|
22
|
+
ariaDescribedby?: string;
|
|
23
|
+
onSelectionChange?: (((key: import("../../index.js").CollectionKey) => void) & ((key: import("../../index.js").CollectionKey) => any)) | undefined;
|
|
24
|
+
"onUpdate:selectedKey"?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
25
|
+
} & (typeof globalThis extends {
|
|
26
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
27
|
+
} ? P : {});
|
|
28
|
+
expose: (exposed: {}) => void;
|
|
29
|
+
attrs: any;
|
|
30
|
+
slots: {
|
|
31
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlRootSlotProps) => unknown;
|
|
32
|
+
};
|
|
33
|
+
emit: ((evt: "selectionChange", key: import("../../index.js").CollectionKey) => void) & ((evt: "update:selectedKey", key: import("../../index.js").CollectionKey) => void);
|
|
34
|
+
}>) => import('vue').VNode & {
|
|
35
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
36
|
+
}) & {
|
|
37
|
+
Indicator: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
38
|
+
attrs: any;
|
|
39
|
+
slots: {};
|
|
40
|
+
emit: {};
|
|
41
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
42
|
+
props: import('vue').PublicProps & {
|
|
43
|
+
class?: string;
|
|
44
|
+
} & (typeof globalThis extends {
|
|
45
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
46
|
+
} ? P : {});
|
|
47
|
+
expose: (exposed: {}) => void;
|
|
48
|
+
attrs: any;
|
|
49
|
+
slots: {};
|
|
50
|
+
emit: {};
|
|
51
|
+
}>) => import('vue').VNode & {
|
|
52
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
53
|
+
};
|
|
54
|
+
Item: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
55
|
+
attrs: any;
|
|
56
|
+
slots: {
|
|
57
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlItemSlotProps) => unknown;
|
|
58
|
+
};
|
|
59
|
+
emit: {};
|
|
60
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
61
|
+
props: import('vue').PublicProps & {
|
|
62
|
+
class?: string;
|
|
63
|
+
id: import("../../index.js").CollectionKey;
|
|
64
|
+
isDisabled?: boolean;
|
|
65
|
+
textValue?: string;
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
} & (typeof globalThis extends {
|
|
68
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
69
|
+
} ? P : {});
|
|
70
|
+
expose: (exposed: {}) => void;
|
|
71
|
+
attrs: any;
|
|
72
|
+
slots: {
|
|
73
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlItemSlotProps) => unknown;
|
|
74
|
+
};
|
|
75
|
+
emit: {};
|
|
76
|
+
}>) => import('vue').VNode & {
|
|
77
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
78
|
+
};
|
|
79
|
+
Root: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
80
|
+
attrs: any;
|
|
81
|
+
slots: {
|
|
82
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlRootSlotProps) => unknown;
|
|
83
|
+
};
|
|
84
|
+
emit: ((evt: "selectionChange", key: import("../../index.js").CollectionKey) => void) & ((evt: "update:selectedKey", key: import("../../index.js").CollectionKey) => void);
|
|
85
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
86
|
+
props: import('vue').PublicProps & {
|
|
87
|
+
class?: string;
|
|
88
|
+
size?: import("@ropav/styles").SegmentedControlVariants["size"];
|
|
89
|
+
fullWidth?: boolean;
|
|
90
|
+
selectedKey?: import("../../index.js").CollectionKey;
|
|
91
|
+
defaultSelectedKey?: import("../../index.js").CollectionKey;
|
|
92
|
+
disabledKeys?: import("../../index.js").CollectionKey[];
|
|
93
|
+
isDisabled?: boolean;
|
|
94
|
+
ariaLabel?: string;
|
|
95
|
+
ariaLabelledby?: string;
|
|
96
|
+
ariaDescribedby?: string;
|
|
97
|
+
onSelectionChange?: (((key: import("../../index.js").CollectionKey) => void) & ((key: import("../../index.js").CollectionKey) => any)) | undefined;
|
|
98
|
+
"onUpdate:selectedKey"?: ((key: import("../../index.js").CollectionKey) => any) | undefined;
|
|
99
|
+
} & (typeof globalThis extends {
|
|
100
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
101
|
+
} ? P : {});
|
|
102
|
+
expose: (exposed: {}) => void;
|
|
103
|
+
attrs: any;
|
|
104
|
+
slots: {
|
|
105
|
+
default?: (props: import("./segmented-control.types.js").SegmentedControlRootSlotProps) => unknown;
|
|
106
|
+
};
|
|
107
|
+
emit: ((evt: "selectionChange", key: import("../../index.js").CollectionKey) => void) & ((evt: "update:selectedKey", key: import("../../index.js").CollectionKey) => void);
|
|
108
|
+
}>) => import('vue').VNode & {
|
|
109
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
110
|
+
};
|
|
111
|
+
Separator: (__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>['props'], __VLS_ctx?: {
|
|
112
|
+
attrs: any;
|
|
113
|
+
slots: {};
|
|
114
|
+
emit: {};
|
|
115
|
+
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>['expose'], __VLS_setup?: Promise<{
|
|
116
|
+
props: import('vue').PublicProps & {
|
|
117
|
+
class?: string;
|
|
118
|
+
} & (typeof globalThis extends {
|
|
119
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
120
|
+
} ? P : {});
|
|
121
|
+
expose: (exposed: {}) => void;
|
|
122
|
+
attrs: any;
|
|
123
|
+
slots: {};
|
|
124
|
+
emit: {};
|
|
125
|
+
}>) => import('vue').VNode & {
|
|
126
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
export { SegmentedControlRoot, SegmentedControlItem, SegmentedControlIndicator, SegmentedControlSeparator, };
|
|
130
|
+
export type { SegmentedControlRootProps, SegmentedControlRootProps as SegmentedControlProps, SegmentedControlRootSlotProps, SegmentedControlItemProps, SegmentedControlItemSlotProps, SegmentedControlIndicatorProps, SegmentedControlSeparatorProps, SegmentedControlOrientation, } from "./segmented-control.types.js";
|
|
131
|
+
export { useSegmentedControlContext, useSegmentedControlItemContext, } from "./segmented-control.context.js";
|
|
132
|
+
export type { SegmentedControlContext, SegmentedControlItemContext, } from "./segmented-control.context.js";
|
|
133
|
+
export { segmentedControlVariants } from "@ropav/styles";
|
|
134
|
+
export type { SegmentedControlVariants } from "@ropav/styles";
|