ropav 0.1.7 → 0.1.9
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 +5 -4
- package/dist/ancestry.js +136 -0
- package/dist/calendar.css +184 -0
- package/dist/calendar.js +739 -0
- package/dist/calendar2.js +37 -0
- package/dist/chevron-left.js +12 -0
- package/dist/color-picker.js +38 -88
- package/dist/combobox.css +251 -0
- package/dist/combobox.js +410 -0
- package/dist/components/calendar/calendar.d.ts +30 -0
- package/dist/components/calendar/calendarBehavior.d.ts +49 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/index.js +3 -0
- package/dist/components/calendar/types.d.ts +56 -0
- package/dist/components/calendar/useCalendar.d.ts +24 -0
- package/dist/components/color-picker/useColorPickerDrag.d.ts +1 -1
- package/dist/components/color-picker/useColorPickerSaturation.d.ts +1 -1
- package/dist/components/color-picker/useColorPickerSlider.d.ts +1 -1
- package/dist/components/combobox/combobox.d.ts +29 -0
- package/dist/components/combobox/comboboxModel.d.ts +4 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/combobox/types.d.ts +43 -0
- package/dist/components/combobox/useCombobox.d.ts +45 -0
- package/dist/components/date-picker/date-picker.d.ts +33 -0
- package/dist/components/date-picker/datePickerModel.d.ts +10 -0
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/date-picker/index.js +2 -0
- package/dist/components/date-picker/types.d.ts +59 -0
- package/dist/components/date-picker/useDatePicker.d.ts +29 -0
- package/dist/components/date-picker/useDatePickerValueState.d.ts +21 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdownMenuContext.d.ts +7 -18
- package/dist/components/dropdown-menu/dropdownMenuInteraction.d.ts +3 -3
- package/dist/components/dropdown-menu/dropdownMenuInteractionTypes.d.ts +58 -29
- package/dist/components/dropdown-menu/useDropdownMenuDataController.d.ts +4 -3
- package/dist/components/dropdown-menu/useDropdownMenuDataRegistration.d.ts +6 -4
- package/dist/components/dropdown-menu/useDropdownMenuPresentation.d.ts +3 -4
- package/dist/components/dropdown-menu/useDropdownMenuTargetBindings.d.ts +5 -5
- package/dist/components/dropzone/dropzone.d.ts +31 -0
- package/dist/components/dropzone/dropzoneModel.d.ts +16 -0
- package/dist/components/dropzone/index.d.ts +3 -0
- package/dist/components/dropzone/index.js +2 -0
- package/dist/components/dropzone/types.d.ts +56 -0
- package/dist/components/dropzone/useDropzone.d.ts +25 -0
- package/dist/components/file-input/file-input.d.ts +29 -0
- package/dist/components/file-input/index.d.ts +3 -0
- package/dist/components/file-input/index.js +2 -0
- package/dist/components/file-input/types.d.ts +37 -0
- package/dist/components/file-input/useFileInput.d.ts +15 -0
- package/dist/components/floating/index.js +1 -1
- package/dist/components/floating/useFloatingPosition.d.ts +1 -13
- package/dist/components/floating/useFloatingTargetLifecycle.d.ts +32 -0
- package/dist/components/floating/useHoverDisclosure.d.ts +10 -0
- package/dist/components/hover-card/hover-card.d.ts +25 -0
- package/dist/components/hover-card/index.d.ts +3 -0
- package/dist/components/hover-card/index.js +2 -0
- package/dist/components/hover-card/types.d.ts +45 -0
- package/dist/components/hover-card/useHoverCard.d.ts +22 -0
- package/dist/components/hover-card/useHoverCardDisclosure.d.ts +19 -0
- package/dist/components/multi-select/index.d.ts +3 -0
- package/dist/components/multi-select/index.js +2 -0
- package/dist/components/multi-select/multi-select.d.ts +30 -0
- package/dist/components/multi-select/multiSelectModel.d.ts +3 -0
- package/dist/components/multi-select/types.d.ts +49 -0
- package/dist/components/multi-select/useMultiSelect.d.ts +46 -0
- package/dist/components/number-input/useNumberInput.d.ts +1 -3
- package/dist/components/popover/usePopoverBindings.d.ts +3 -6
- package/dist/components/scroll-area/useScrollArea.d.ts +4 -4
- package/dist/components/scroll-area/useScrollAreaAttributes.d.ts +3 -3
- package/dist/components/scroll-area/useScrollAreaPointer.d.ts +1 -1
- package/dist/components/segmented-control/index.d.ts +3 -0
- package/dist/components/segmented-control/index.js +2 -0
- package/dist/components/segmented-control/segmented-control.d.ts +26 -0
- package/dist/components/segmented-control/types.d.ts +47 -0
- package/dist/components/segmented-control/useSegmentedControl.d.ts +15 -0
- package/dist/components/select/useSelect.d.ts +31 -19
- package/dist/components/slider/useRangeSlider.d.ts +1 -1
- package/dist/components/slider/useRangeSliderPointer.d.ts +1 -1
- package/dist/components/slider/useSlider.d.ts +1 -1
- package/dist/components/slider/useSliderPointer.d.ts +15 -0
- package/dist/components/slider/useSliderValueState.d.ts +1 -0
- package/dist/components/tags-input/index.d.ts +3 -0
- package/dist/components/tags-input/index.js +2 -0
- package/dist/components/tags-input/tags-input.d.ts +27 -0
- package/dist/components/tags-input/tagsInputModel.d.ts +12 -0
- package/dist/components/tags-input/types.d.ts +37 -0
- package/dist/components/tags-input/useTagsInput.d.ts +23 -0
- package/dist/components/toolbar/index.d.ts +3 -0
- package/dist/components/toolbar/index.js +2 -0
- package/dist/components/toolbar/toolbar.d.ts +24 -0
- package/dist/components/toolbar/types.d.ts +12 -0
- package/dist/components/toolbar/useToolbar.d.ts +7 -0
- package/dist/components/tooltip/useTooltipTargetBindings.d.ts +12 -0
- package/dist/date-picker.css +49 -0
- package/dist/date-picker.js +811 -0
- package/dist/dialog.js +9 -20
- package/dist/direction.js +6 -0
- package/dist/dropdown-menu.css +21 -3
- package/dist/dropdown-menu.js +341 -261
- package/dist/dropzone.css +135 -0
- package/dist/dropzone.js +431 -0
- package/dist/file-input.css +135 -0
- package/dist/file-input.js +198 -0
- package/dist/focusNavigation.js +12 -6
- package/dist/hover-card.css +80 -0
- package/dist/hover-card.js +402 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +15 -3
- package/dist/internal/composables/useOverlayLayer.d.ts +12 -0
- package/dist/modal.js +1 -1
- package/dist/multi-select.css +316 -0
- package/dist/multi-select.js +481 -0
- package/dist/nativeChoice.js +169 -0
- package/dist/number-input.css +18 -18
- package/dist/number-input.js +36 -38
- package/dist/pagination.js +1 -10
- package/dist/pointerSession.js +130 -0
- package/dist/popover.css +21 -3
- package/dist/popover.js +37 -62
- package/dist/scroll-area.js +52 -62
- package/dist/segmented-control.css +176 -0
- package/dist/segmented-control.js +382 -0
- package/dist/select.css +50 -48
- package/dist/select.js +121 -271
- package/dist/slider.css +78 -69
- package/dist/slider.js +161 -145
- package/dist/tags-input.css +197 -0
- package/dist/tags-input.js +380 -0
- package/dist/toolbar.css +15 -0
- package/dist/toolbar.js +143 -0
- package/dist/tooltip.js +35 -30
- package/dist/useEditableOptionList.js +216 -0
- package/dist/useFlatOptionCollection.js +134 -0
- package/dist/useFloatingPosition.js +4 -160
- package/dist/useFloatingTargetLifecycle.js +127 -0
- package/dist/useFormControl.js +1 -0
- package/dist/{floating.js → useHoverDisclosure.js} +338 -421
- package/dist/useNativeChoiceTransaction.js +46 -0
- package/dist/useNativeFileSelection.js +86 -0
- package/dist/useOverlayZIndex.js +246 -15
- package/dist/utils/date.d.ts +13 -0
- package/dist/utils/dateAvailability.d.ts +7 -0
- package/dist/utils/dom/ancestry.d.ts +1 -0
- package/dist/utils/dom/direction.d.ts +2 -0
- package/dist/utils/dom/files.d.ts +3 -0
- package/dist/utils/dom/focusNavigation.d.ts +4 -1
- package/dist/utils/dom/nativeChoice.d.ts +17 -0
- package/dist/utils/dom/pointerSession.d.ts +20 -0
- package/dist/utils/dom/scroll.d.ts +2 -1
- package/dist/utils/optionFilter.d.ts +5 -0
- package/docs/public-floating-api.md +7 -4
- package/docs/public-styles-api.md +28 -12
- package/package.json +68 -40
- package/src/styles/_mixins.scss +26 -0
- package/src/styles/styles-manifest.json +1 -2
- package/dist/components/floating/hoverDisclosureInteractionModel.d.ts +0 -42
- package/dist/components/floating/useHoverDisclosureInteractions.d.ts +0 -32
- package/dist/components/floating/useHoverDisclosureOpenState.d.ts +0 -25
- package/dist/components/floating/useHoverDisclosureTargetBinding.d.ts +0 -27
- package/dist/components/select/useSelectNativeControl.d.ts +0 -9
- package/dist/components/select/useSelectNativeValue.d.ts +0 -9
- package/dist/pointer.js +0 -9
- package/dist/utils/dom/pointer.d.ts +0 -2
- package/docs/code-architecture.md +0 -118
package/dist/number-input.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-number-input[data-v-
|
|
2
|
+
.rp-number-input[data-v-64cb2fc3] {
|
|
3
3
|
--_rp-number-input-control-size: var(--_rp-input-height);
|
|
4
4
|
--_rp-number-input-text-align: left;
|
|
5
5
|
overflow: hidden;
|
|
@@ -7,39 +7,39 @@
|
|
|
7
7
|
padding-inline: 0;
|
|
8
8
|
vertical-align: middle;
|
|
9
9
|
}
|
|
10
|
-
.rp-number-input[data-v-
|
|
10
|
+
.rp-number-input[data-v-64cb2fc3] .rp-input__native {
|
|
11
11
|
appearance: textfield;
|
|
12
12
|
padding-inline: var(--_rp-input-padding-x);
|
|
13
13
|
text-align: var(--_rp-number-input-text-align);
|
|
14
14
|
}
|
|
15
|
-
.rp-number-input--text-align-center[data-v-
|
|
15
|
+
.rp-number-input--text-align-center[data-v-64cb2fc3] {
|
|
16
16
|
--_rp-number-input-text-align: center;
|
|
17
17
|
}
|
|
18
|
-
.rp-number-input--text-align-right[data-v-
|
|
18
|
+
.rp-number-input--text-align-right[data-v-64cb2fc3] {
|
|
19
19
|
--_rp-number-input-text-align: right;
|
|
20
20
|
}
|
|
21
|
-
.rp-number-input[data-v-
|
|
22
|
-
.rp-number-input[data-v-
|
|
21
|
+
.rp-number-input[data-v-64cb2fc3] .rp-input__native::-webkit-inner-spin-button,
|
|
22
|
+
.rp-number-input[data-v-64cb2fc3] .rp-input__native::-webkit-outer-spin-button {
|
|
23
23
|
margin: 0;
|
|
24
24
|
appearance: none;
|
|
25
25
|
}
|
|
26
|
-
.rp-number-input[data-v-
|
|
27
|
-
.rp-number-input[data-v-
|
|
26
|
+
.rp-number-input[data-v-64cb2fc3] .rp-input__left,
|
|
27
|
+
.rp-number-input[data-v-64cb2fc3] .rp-input__right {
|
|
28
28
|
align-self: stretch;
|
|
29
29
|
margin-block: calc(-1 * var(--rp-border-width-thin));
|
|
30
30
|
}
|
|
31
|
-
.rp-number-input__controls[data-v-
|
|
31
|
+
.rp-number-input__controls[data-v-64cb2fc3] {
|
|
32
32
|
display: inline-flex;
|
|
33
33
|
height: var(--_rp-input-height);
|
|
34
34
|
flex-shrink: 0;
|
|
35
35
|
}
|
|
36
|
-
.rp-number-input__controls--left[data-v-
|
|
36
|
+
.rp-number-input__controls--left[data-v-64cb2fc3] {
|
|
37
37
|
border-inline-end: var(--rp-border-width-thin) solid var(--rp-color-control-border);
|
|
38
38
|
}
|
|
39
|
-
.rp-number-input__controls--right[data-v-
|
|
39
|
+
.rp-number-input__controls--right[data-v-64cb2fc3] {
|
|
40
40
|
border-inline-start: var(--rp-border-width-thin) solid var(--rp-color-control-border);
|
|
41
41
|
}
|
|
42
|
-
.rp-number-input__control[data-v-
|
|
42
|
+
.rp-number-input__control[data-v-64cb2fc3] {
|
|
43
43
|
padding: 0;
|
|
44
44
|
font: inherit;
|
|
45
45
|
background: none;
|
|
@@ -55,29 +55,29 @@
|
|
|
55
55
|
color: var(--rp-color-control-icon);
|
|
56
56
|
transition: color var(--rp-transition-fast), background-color var(--rp-transition-fast), opacity var(--rp-transition-fast);
|
|
57
57
|
}
|
|
58
|
-
.rp-number-input__control + .rp-number-input__control[data-v-
|
|
58
|
+
.rp-number-input__control + .rp-number-input__control[data-v-64cb2fc3] {
|
|
59
59
|
border-inline-start: var(--rp-border-width-thin) solid var(--rp-color-control-border);
|
|
60
60
|
}
|
|
61
|
-
.rp-number-input__control[data-v-
|
|
61
|
+
.rp-number-input__control[data-v-64cb2fc3]:hover:not(:disabled) {
|
|
62
62
|
color: var(--rp-color-control-fg);
|
|
63
63
|
background-color: var(--rp-color-default-hover);
|
|
64
64
|
}
|
|
65
|
-
.rp-number-input__control[data-v-
|
|
65
|
+
.rp-number-input__control[data-v-64cb2fc3]:disabled {
|
|
66
66
|
cursor: not-allowed;
|
|
67
67
|
opacity: var(--rp-opacity-disabled);
|
|
68
68
|
}
|
|
69
|
-
.rp-number-input__control-icon[data-v-
|
|
69
|
+
.rp-number-input__control-icon[data-v-64cb2fc3] {
|
|
70
70
|
display: inline-flex;
|
|
71
71
|
align-items: center;
|
|
72
72
|
width: 0.875em;
|
|
73
73
|
height: 0.875em;
|
|
74
74
|
flex-shrink: 0;
|
|
75
75
|
}
|
|
76
|
-
.rp-number-input__control-icon svg[data-v-
|
|
76
|
+
.rp-number-input__control-icon svg[data-v-64cb2fc3] {
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 100%;
|
|
79
79
|
}
|
|
80
|
-
.rp-number-input__control-icon[data-v-
|
|
80
|
+
.rp-number-input__control-icon[data-v-64cb2fc3] > svg {
|
|
81
81
|
display: block;
|
|
82
82
|
width: 100%;
|
|
83
83
|
height: 100%;
|
package/dist/number-input.js
CHANGED
|
@@ -8,7 +8,7 @@ import { t as minus_default } from "./minus.js";
|
|
|
8
8
|
import { i as useFormControl, n as provideNestedFormControlOwner } from "./useFormControl.js";
|
|
9
9
|
import { t as useControlState } from "./useControlState.js";
|
|
10
10
|
import { t as input_default } from "./input.js";
|
|
11
|
-
import { child, computed, createComponent, createFor, createIf, createSlot, defineVaporComponent, markRaw, on,
|
|
11
|
+
import { child, computed, createComponent, createFor, createIf, createSlot, defineVaporComponent, markRaw, on, renderEffect, setDynamicProps, setInsertionState, setStaticTemplateRef, template, unref, useTemplateRef, withModifiers } from "vue";
|
|
12
12
|
//#region ~icons/lucide/plus
|
|
13
13
|
var t0$1 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"M5 12h14m-7-7v14\">", 3, 1);
|
|
14
14
|
function render(_ctx) {
|
|
@@ -81,11 +81,18 @@ function getModelInputValue(value) {
|
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region src/components/number-input/useNumberInput.ts
|
|
84
|
-
function useNumberInput(props,
|
|
84
|
+
function useNumberInput(props, onUpdate) {
|
|
85
|
+
const controllable = useControllableValue({
|
|
86
|
+
modelValue: () => props.modelValue,
|
|
87
|
+
defaultValue: () => props.defaultValue ?? null,
|
|
88
|
+
onChange: onUpdate
|
|
89
|
+
});
|
|
90
|
+
const inputComponent = useTemplateRef("inputComponent");
|
|
91
|
+
provideNestedFormControlOwner();
|
|
85
92
|
const control = useControlState(props);
|
|
86
93
|
const bounds = computed(() => normalizeNumberInputBounds(props.min, props.max));
|
|
87
94
|
const nativeStep = computed(() => normalizeNumberInputStep(props.step));
|
|
88
|
-
const currentValue =
|
|
95
|
+
const currentValue = controllable.value;
|
|
89
96
|
const modelInputValue = computed(() => getModelInputValue(currentValue.value));
|
|
90
97
|
const isInteractive = computed(() => !control.disabled && !props.readonly);
|
|
91
98
|
const controlsPosition = computed(() => normalizeNumberInputControlsPosition(props.controlsPosition));
|
|
@@ -126,12 +133,12 @@ function useNumberInput(props, emitUpdate, getValue = () => props.modelValue ??
|
|
|
126
133
|
const current = Number.isFinite(currentValue.value) ? currentValue.value : null;
|
|
127
134
|
const next = stepNumberInputValue(current, direction, nativeStep.value, bounds.value);
|
|
128
135
|
if (current !== null && next === current) return false;
|
|
129
|
-
|
|
136
|
+
controllable.setValue(next);
|
|
130
137
|
return true;
|
|
131
138
|
}
|
|
132
139
|
function onInputUpdate(value) {
|
|
133
140
|
if (!isInteractive.value) return;
|
|
134
|
-
|
|
141
|
+
controllable.setValue(parseNumberInputValue(value));
|
|
135
142
|
}
|
|
136
143
|
function onKeydown(event) {
|
|
137
144
|
if (!isInteractive.value) return;
|
|
@@ -155,13 +162,25 @@ function useNumberInput(props, emitUpdate, getValue = () => props.modelValue ??
|
|
|
155
162
|
const next = clampNumberInputValue(current, bounds.value);
|
|
156
163
|
if (next === current) return;
|
|
157
164
|
input.value = String(next);
|
|
158
|
-
|
|
165
|
+
controllable.setValue(next);
|
|
159
166
|
}
|
|
167
|
+
useFormControl({
|
|
168
|
+
elements: () => [inputComponent.value?.nativeElement],
|
|
169
|
+
isControlled: () => controllable.isControlled.value,
|
|
170
|
+
initializeDefault(element) {
|
|
171
|
+
element.defaultValue = getModelInputValue(controllable.initialValue);
|
|
172
|
+
},
|
|
173
|
+
validationMessage: () => props.validationMessage,
|
|
174
|
+
readResetValue([element]) {
|
|
175
|
+
controllable.resetValue(parseNumberInputValue(element.value));
|
|
176
|
+
},
|
|
177
|
+
syncControlledValue([element]) {
|
|
178
|
+
element.value = getModelInputValue(controllable.value.value);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
160
181
|
return {
|
|
161
182
|
control,
|
|
162
183
|
rootClass,
|
|
163
|
-
bounds,
|
|
164
|
-
nativeStep,
|
|
165
184
|
nativeInputAttrs: computed(() => {
|
|
166
185
|
const attrs = props.inputAttrs ?? {};
|
|
167
186
|
return {
|
|
@@ -193,10 +212,10 @@ function useNumberInput(props, emitUpdate, getValue = () => props.modelValue ??
|
|
|
193
212
|
}
|
|
194
213
|
//#endregion
|
|
195
214
|
//#region src/components/number-input/number-input.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
196
|
-
var t0 = template("<button data-v-
|
|
197
|
-
var t1 = template("<span data-v-
|
|
198
|
-
var t2 = template("<button data-v-
|
|
199
|
-
var t3 = template("<span data-v-
|
|
215
|
+
var t0 = template("<button data-v-64cb2fc3><span data-v-64cb2fc3 class=rp-number-input__control-icon aria-hidden=true></button>");
|
|
216
|
+
var t1 = template("<span data-v-64cb2fc3 class=\"rp-number-input__controls rp-number-input__controls--left\">");
|
|
217
|
+
var t2 = template("<button data-v-64cb2fc3><span data-v-64cb2fc3 class=rp-number-input__control-icon aria-hidden=true>");
|
|
218
|
+
var t3 = template("<span data-v-64cb2fc3 class=\"rp-number-input__controls rp-number-input__controls--right\">");
|
|
200
219
|
//#endregion
|
|
201
220
|
//#region src/components/number-input/number-input.vue
|
|
202
221
|
var number_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -219,8 +238,8 @@ var number_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
219
238
|
type: Boolean,
|
|
220
239
|
default: true
|
|
221
240
|
},
|
|
222
|
-
controlsPosition: { default: "
|
|
223
|
-
textAlign: { default: "
|
|
241
|
+
controlsPosition: { default: "split" },
|
|
242
|
+
textAlign: { default: "center" },
|
|
224
243
|
clampOnBlur: {
|
|
225
244
|
type: Boolean,
|
|
226
245
|
default: true
|
|
@@ -259,28 +278,7 @@ var number_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
259
278
|
setup(__props, { emit: __emit }) {
|
|
260
279
|
const props = __props;
|
|
261
280
|
const emit = __emit;
|
|
262
|
-
const
|
|
263
|
-
modelValue: () => props.modelValue,
|
|
264
|
-
defaultValue: () => props.defaultValue,
|
|
265
|
-
onChange: (value) => emit("update:modelValue", value)
|
|
266
|
-
});
|
|
267
|
-
const inputComponentRef = ref(null);
|
|
268
|
-
provideNestedFormControlOwner();
|
|
269
|
-
const { control, rootClass, nativeInputAttrs, modelInputValue, leftControls, rightControls, canIncrement, canDecrement, increment, decrement, onInputUpdate } = useNumberInput(props, (value) => controllable.setValue(value), () => controllable.value.value);
|
|
270
|
-
useFormControl({
|
|
271
|
-
elements: () => [inputComponentRef.value?.nativeElement],
|
|
272
|
-
isControlled: () => controllable.isControlled.value,
|
|
273
|
-
initializeDefault(element) {
|
|
274
|
-
element.defaultValue = getModelInputValue(controllable.initialValue);
|
|
275
|
-
},
|
|
276
|
-
validationMessage: () => props.validationMessage,
|
|
277
|
-
readResetValue(elements) {
|
|
278
|
-
controllable.resetValue(parseNumberInputValue(elements[0].value));
|
|
279
|
-
},
|
|
280
|
-
syncControlledValue(elements) {
|
|
281
|
-
elements[0].value = getModelInputValue(controllable.value.value);
|
|
282
|
-
}
|
|
283
|
-
});
|
|
281
|
+
const { control, rootClass, nativeInputAttrs, modelInputValue, leftControls, rightControls, canIncrement, canDecrement, increment, decrement, onInputUpdate } = useNumberInput(props, (value) => emit("update:modelValue", value));
|
|
284
282
|
const { attrs, getPartAttrs } = useStylesApi(props, "root");
|
|
285
283
|
const inputClassNames = computed(() => ({
|
|
286
284
|
root: [rootClass.value, props.classNames?.root],
|
|
@@ -410,10 +408,10 @@ var number_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
410
408
|
return n28;
|
|
411
409
|
}
|
|
412
410
|
} : void 0] }, true);
|
|
413
|
-
setStaticTemplateRef(n30,
|
|
411
|
+
setStaticTemplateRef(n30, "inputComponent");
|
|
414
412
|
return n30;
|
|
415
413
|
}
|
|
416
|
-
}), [["__scopeId", "data-v-
|
|
414
|
+
}), [["__scopeId", "data-v-64cb2fc3"]]);
|
|
417
415
|
//#endregion
|
|
418
416
|
//#region src/components/number-input/types.ts
|
|
419
417
|
var numberInputParts = [
|
package/dist/pagination.js
CHANGED
|
@@ -6,18 +6,9 @@ import { t as bem } from "./bem.js";
|
|
|
6
6
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
7
7
|
import { t as clamp } from "./number.js";
|
|
8
8
|
import { a as getComponentVariantColorRoles, t as componentColors } from "./componentColors.js";
|
|
9
|
+
import { t as chevron_left_default } from "./chevron-left.js";
|
|
9
10
|
import { t as chevron_right_default } from "./chevron-right.js";
|
|
10
11
|
import { child, computed, createComponent, createFor, createIf, createSlot, defineVaporComponent, markRaw, on, renderEffect, setDynamicProps, setInsertionState, setText, template, toDisplayString, unref } from "vue";
|
|
11
|
-
//#region ~icons/lucide/chevron-left
|
|
12
|
-
var t0$4 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"m15 18l-6-6l6-6\">", 3, 1);
|
|
13
|
-
function render$3(_ctx) {
|
|
14
|
-
return t0$4();
|
|
15
|
-
}
|
|
16
|
-
var chevron_left_default = markRaw(defineVaporComponent({
|
|
17
|
-
name: "lucide-chevron-left",
|
|
18
|
-
render: render$3
|
|
19
|
-
}));
|
|
20
|
-
//#endregion
|
|
21
12
|
//#region ~icons/lucide/chevrons-left
|
|
22
13
|
var t0$3 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><path fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2 d=\"m11 17l-5-5l5-5m7 10l-5-5l5-5\">", 3, 1);
|
|
23
14
|
function render$2(_ctx) {
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { t as createRafScheduler } from "./rafScheduler.js";
|
|
2
|
+
//#region src/utils/dom/pointerSession.ts
|
|
3
|
+
function getPointerId(event) {
|
|
4
|
+
return Number.isFinite(event.pointerId) ? event.pointerId : void 0;
|
|
5
|
+
}
|
|
6
|
+
function isMatchingPointer(event, pointerId) {
|
|
7
|
+
return pointerId === void 0 || getPointerId(event) === pointerId;
|
|
8
|
+
}
|
|
9
|
+
function createPointerSession(adapter) {
|
|
10
|
+
let session;
|
|
11
|
+
let pendingPointerEvent;
|
|
12
|
+
let geometryDirty = false;
|
|
13
|
+
function refreshGeometry(currentSession) {
|
|
14
|
+
if (!geometryDirty) return true;
|
|
15
|
+
if (!adapter.refreshGeometry) {
|
|
16
|
+
geometryDirty = false;
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (!adapter.refreshGeometry(currentSession.state)) return false;
|
|
20
|
+
geometryDirty = false;
|
|
21
|
+
return session === currentSession;
|
|
22
|
+
}
|
|
23
|
+
function applyScheduledUpdate() {
|
|
24
|
+
const currentSession = session;
|
|
25
|
+
if (!currentSession || !refreshGeometry(currentSession)) return;
|
|
26
|
+
const event = pendingPointerEvent;
|
|
27
|
+
pendingPointerEvent = void 0;
|
|
28
|
+
if (event) adapter.onUpdate(event, currentSession.state);
|
|
29
|
+
}
|
|
30
|
+
const updateScheduler = createRafScheduler(applyScheduledUpdate, () => session?.view);
|
|
31
|
+
function cancelPendingUpdate() {
|
|
32
|
+
updateScheduler.cancel();
|
|
33
|
+
pendingPointerEvent = void 0;
|
|
34
|
+
}
|
|
35
|
+
function flushPendingUpdate() {
|
|
36
|
+
updateScheduler.cancel();
|
|
37
|
+
applyScheduledUpdate();
|
|
38
|
+
}
|
|
39
|
+
function scheduleUpdate() {
|
|
40
|
+
if (session) updateScheduler.schedule();
|
|
41
|
+
}
|
|
42
|
+
function onGeometryChange() {
|
|
43
|
+
if (!session) return;
|
|
44
|
+
geometryDirty = true;
|
|
45
|
+
scheduleUpdate();
|
|
46
|
+
}
|
|
47
|
+
function removeListeners(currentSession) {
|
|
48
|
+
currentSession.view?.removeEventListener("pointermove", onPointerMove);
|
|
49
|
+
currentSession.view?.removeEventListener("pointerup", onPointerEnd);
|
|
50
|
+
currentSession.view?.removeEventListener("pointercancel", onPointerEnd);
|
|
51
|
+
if (adapter.refreshGeometry) {
|
|
52
|
+
currentSession.view?.removeEventListener("resize", onGeometryChange);
|
|
53
|
+
currentSession.view?.removeEventListener("scroll", onGeometryChange, true);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function stop() {
|
|
57
|
+
const stoppedSession = session;
|
|
58
|
+
if (!stoppedSession) return;
|
|
59
|
+
removeListeners(stoppedSession);
|
|
60
|
+
cancelPendingUpdate();
|
|
61
|
+
geometryDirty = false;
|
|
62
|
+
session = void 0;
|
|
63
|
+
adapter.onStop?.(stoppedSession.state);
|
|
64
|
+
}
|
|
65
|
+
function addListeners(currentSession) {
|
|
66
|
+
currentSession.view?.addEventListener("pointermove", onPointerMove);
|
|
67
|
+
currentSession.view?.addEventListener("pointerup", onPointerEnd);
|
|
68
|
+
currentSession.view?.addEventListener("pointercancel", onPointerEnd);
|
|
69
|
+
if (adapter.refreshGeometry) {
|
|
70
|
+
currentSession.view?.addEventListener("resize", onGeometryChange);
|
|
71
|
+
currentSession.view?.addEventListener("scroll", onGeometryChange, true);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function updateImmediately(event, currentSession) {
|
|
75
|
+
if (refreshGeometry(currentSession)) adapter.onUpdate(event, currentSession.state);
|
|
76
|
+
}
|
|
77
|
+
function onPointerMove(event) {
|
|
78
|
+
const currentSession = session;
|
|
79
|
+
if (!currentSession || !isMatchingPointer(event, currentSession.pointerId)) return;
|
|
80
|
+
if (adapter.updateMode === "immediate") {
|
|
81
|
+
updateImmediately(event, currentSession);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
pendingPointerEvent = event;
|
|
85
|
+
scheduleUpdate();
|
|
86
|
+
}
|
|
87
|
+
function applyEndUpdate(event, currentSession) {
|
|
88
|
+
switch (adapter.endUpdate ?? "pending-pointerup") {
|
|
89
|
+
case "event":
|
|
90
|
+
cancelPendingUpdate();
|
|
91
|
+
updateImmediately(event, currentSession);
|
|
92
|
+
break;
|
|
93
|
+
case "none":
|
|
94
|
+
cancelPendingUpdate();
|
|
95
|
+
break;
|
|
96
|
+
case "pending-pointerup":
|
|
97
|
+
if (event.type === "pointerup") flushPendingUpdate();
|
|
98
|
+
else cancelPendingUpdate();
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function onPointerEnd(event) {
|
|
103
|
+
const currentSession = session;
|
|
104
|
+
if (!currentSession || !isMatchingPointer(event, currentSession.pointerId)) return;
|
|
105
|
+
applyEndUpdate(event, currentSession);
|
|
106
|
+
stop();
|
|
107
|
+
}
|
|
108
|
+
function start(event, initialize) {
|
|
109
|
+
if (event.button !== 0 || event.isPrimary === false) return false;
|
|
110
|
+
const next = initialize();
|
|
111
|
+
if (!next) return false;
|
|
112
|
+
stop();
|
|
113
|
+
const nextSession = {
|
|
114
|
+
pointerId: getPointerId(event),
|
|
115
|
+
state: next.state,
|
|
116
|
+
view: next.target.ownerDocument.defaultView
|
|
117
|
+
};
|
|
118
|
+
session = nextSession;
|
|
119
|
+
geometryDirty = next.geometryDirty ?? false;
|
|
120
|
+
adapter.onStart?.(event, next.state);
|
|
121
|
+
if (session === nextSession) addListeners(nextSession);
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
start,
|
|
126
|
+
stop
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
export { createPointerSession as t };
|
package/dist/popover.css
CHANGED
|
@@ -108,15 +108,33 @@
|
|
|
108
108
|
left: 0;
|
|
109
109
|
translate: none;
|
|
110
110
|
}
|
|
111
|
+
.rp-popover__arrow[data-v-519e9856] {
|
|
112
|
+
background-color: inherit;
|
|
113
|
+
border: inherit;
|
|
114
|
+
rotate: 45deg;
|
|
115
|
+
}
|
|
116
|
+
.rp-popover__arrow[data-side=top][data-v-519e9856] {
|
|
117
|
+
border-top-color: transparent;
|
|
118
|
+
border-left-color: transparent;
|
|
119
|
+
}
|
|
120
|
+
.rp-popover__arrow[data-side=right][data-v-519e9856] {
|
|
121
|
+
border-top-color: transparent;
|
|
122
|
+
border-right-color: transparent;
|
|
123
|
+
}
|
|
124
|
+
.rp-popover__arrow[data-side=bottom][data-v-519e9856] {
|
|
125
|
+
border-right-color: transparent;
|
|
126
|
+
border-bottom-color: transparent;
|
|
127
|
+
}
|
|
128
|
+
.rp-popover__arrow[data-side=left][data-v-519e9856] {
|
|
129
|
+
border-bottom-color: transparent;
|
|
130
|
+
border-left-color: transparent;
|
|
131
|
+
}
|
|
111
132
|
.rp-popover__arrow[data-v-519e9856] {
|
|
112
133
|
position: absolute;
|
|
113
134
|
box-sizing: border-box;
|
|
114
135
|
width: var(--_rp-popover-arrow-size);
|
|
115
136
|
height: var(--_rp-popover-arrow-size);
|
|
116
137
|
pointer-events: none;
|
|
117
|
-
background-color: inherit;
|
|
118
|
-
border: inherit;
|
|
119
|
-
rotate: 45deg;
|
|
120
138
|
}
|
|
121
139
|
.rp-popover__arrow[data-side=top][data-v-519e9856] {
|
|
122
140
|
bottom: calc(-1 * var(--_rp-popover-arrow-size) / 2);
|
package/dist/popover.js
CHANGED
|
@@ -3,17 +3,16 @@ import { t as useControllableValue } from "./useControllableValue.js";
|
|
|
3
3
|
import { t as useStylesApi } from "./styles-api.js";
|
|
4
4
|
import { n as toPresenceAttribute } from "./attributes.js";
|
|
5
5
|
import { t as bem } from "./bem.js";
|
|
6
|
-
import { t as isElement } from "./query.js";
|
|
7
6
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
8
|
-
import { a as snapshotAttributes, i as restoreAttributes } from "./attributes2.js";
|
|
9
7
|
import { n as mergeAriaIdRefs } from "./aria.js";
|
|
10
8
|
import { i as isNodeWithinElement } from "./events.js";
|
|
11
9
|
import { n as useOverlayZIndex, r as useOverlayLayer } from "./useOverlayZIndex.js";
|
|
12
10
|
import { t as getFloatingOffsetStyle } from "./floatingOffset.js";
|
|
13
11
|
import { t as useFocusTrap } from "./useFocusTrap.js";
|
|
14
|
-
import {
|
|
12
|
+
import { t as useFloatingPosition } from "./useFloatingPosition.js";
|
|
13
|
+
import { t as useFloatingTargetLifecycle } from "./useFloatingTargetLifecycle.js";
|
|
15
14
|
import { n as useTeleportTarget } from "./useTeleportTarget.js";
|
|
16
|
-
import { VaporTeleport, VaporTransition, applyVShow, computed, createComponent, createIf, createSlot, createTemplateRefSetter, defineVaporComponent, extend, isRef, nextTick, on, ref, renderEffect, setAttr, setDynamicProps, setInsertionState, setStyle, setTemplateRefBinding, template, unref, useAttrs, useId, useSlots, watch } from "vue";
|
|
15
|
+
import { VaporTeleport, VaporTransition, applyVShow, computed, createComponent, createIf, createSlot, createTemplateRefSetter, defineVaporComponent, extend, isRef, nextTick, on, onBeforeUnmount, ref, renderEffect, setAttr, setDynamicProps, setInsertionState, setStyle, setTemplateRefBinding, template, unref, useAttrs, useId, useSlots, watch } from "vue";
|
|
17
16
|
//#region src/components/popover/usePopoverBindings.ts
|
|
18
17
|
var TARGET_ATTRIBUTES = [
|
|
19
18
|
"aria-controls",
|
|
@@ -25,44 +24,20 @@ function applyTargetAttributes(element, snapshot, options) {
|
|
|
25
24
|
element.setAttribute("aria-expanded", String(options.expanded));
|
|
26
25
|
element.setAttribute("aria-haspopup", options.role);
|
|
27
26
|
}
|
|
28
|
-
function usePopoverBindings({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!explicit || !target || disabled) return;
|
|
43
|
-
const snapshot = snapshotAttributes(target, TARGET_ATTRIBUTES);
|
|
44
|
-
applyTargetAttributes(target, snapshot, {
|
|
45
|
-
id,
|
|
46
|
-
expanded: visible,
|
|
47
|
-
role
|
|
48
|
-
});
|
|
49
|
-
onCleanup(() => restoreAttributes(target, snapshot));
|
|
50
|
-
}, { flush: "sync" });
|
|
51
|
-
watch(isVisible, (visible, _previous, onCleanup) => {
|
|
52
|
-
if (!visible || typeof document === "undefined") return;
|
|
53
|
-
document.addEventListener("click", onDocumentClick, true);
|
|
54
|
-
document.addEventListener("mousedown", onDocumentPointerDown, true);
|
|
55
|
-
document.addEventListener("touchstart", onDocumentPointerDown, true);
|
|
56
|
-
document.addEventListener("keydown", onDocumentKeydown);
|
|
57
|
-
onCleanup(() => {
|
|
58
|
-
document.removeEventListener("click", onDocumentClick, true);
|
|
59
|
-
document.removeEventListener("mousedown", onDocumentPointerDown, true);
|
|
60
|
-
document.removeEventListener("touchstart", onDocumentPointerDown, true);
|
|
61
|
-
document.removeEventListener("keydown", onDocumentKeydown);
|
|
62
|
-
});
|
|
63
|
-
}, {
|
|
64
|
-
flush: "sync",
|
|
65
|
-
immediate: true
|
|
27
|
+
function usePopoverBindings({ targetLifecycle, popoverId, popoverRole, isVisible, isDisabled, onTriggerClick }) {
|
|
28
|
+
targetLifecycle.bindTarget({
|
|
29
|
+
listeners: [["click", onTriggerClick]],
|
|
30
|
+
attributes: {
|
|
31
|
+
names: TARGET_ATTRIBUTES,
|
|
32
|
+
isActive: () => !isDisabled.value,
|
|
33
|
+
apply: (target, snapshot) => {
|
|
34
|
+
applyTargetAttributes(target, snapshot, {
|
|
35
|
+
id: popoverId.value,
|
|
36
|
+
expanded: isVisible.value,
|
|
37
|
+
role: popoverRole.value
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
66
41
|
});
|
|
67
42
|
}
|
|
68
43
|
//#endregion
|
|
@@ -92,8 +67,11 @@ function usePopover(props, emitOpenChange) {
|
|
|
92
67
|
const placement = computed(() => props.placement ?? DEFAULT_PLACEMENT);
|
|
93
68
|
const popoverRole = computed(() => props.role ?? DEFAULT_ROLE);
|
|
94
69
|
const teleportTo = useTeleportTarget(() => props.teleportTo);
|
|
95
|
-
const
|
|
96
|
-
|
|
70
|
+
const targetLifecycle = useFloatingTargetLifecycle({
|
|
71
|
+
target: () => props.target,
|
|
72
|
+
fallback: rootRef
|
|
73
|
+
});
|
|
74
|
+
const { isExplicitTarget, reference, targetElement } = targetLifecycle;
|
|
97
75
|
const hasContent = computed(() => Boolean(slots.content || isExplicitTarget.value && slots.default));
|
|
98
76
|
const isDisabled = computed(() => Boolean(props.disabled || !hasContent.value));
|
|
99
77
|
const isOpen = controllableOpen.value;
|
|
@@ -208,9 +186,6 @@ function usePopover(props, emitOpenChange) {
|
|
|
208
186
|
event.stopPropagation();
|
|
209
187
|
closePopover();
|
|
210
188
|
}
|
|
211
|
-
function isEventInsidePopover(event) {
|
|
212
|
-
return layer.isInside(event, [rootRef.value, targetElement.value]);
|
|
213
|
-
}
|
|
214
189
|
function onCompositeFocusout(event) {
|
|
215
190
|
const nextTarget = event.relatedTarget;
|
|
216
191
|
if (isNodeWithinElement(nextTarget, rootRef.value) || isNodeWithinElement(nextTarget, contentRef.value) || isNodeWithinElement(nextTarget, targetElement.value)) return;
|
|
@@ -218,21 +193,24 @@ function usePopover(props, emitOpenChange) {
|
|
|
218
193
|
const listeners = Array.isArray(listener) ? listener : [listener];
|
|
219
194
|
for (const current of listeners) if (typeof current === "function") current(event);
|
|
220
195
|
}
|
|
221
|
-
function onDocumentClick(
|
|
222
|
-
if (
|
|
223
|
-
if (props.closeOnOutsideClick === false || isEventInsidePopover(event)) return;
|
|
196
|
+
function onDocumentClick() {
|
|
197
|
+
if (props.closeOnOutsideClick === false) return;
|
|
224
198
|
closePopoverWithoutReturnFocus();
|
|
225
199
|
}
|
|
226
|
-
function onDocumentPointerDown(
|
|
227
|
-
if (
|
|
228
|
-
if (props.closeOnOutsideClick === false || isEventInsidePopover(event)) return;
|
|
200
|
+
function onDocumentPointerDown() {
|
|
201
|
+
if (props.closeOnOutsideClick === false) return;
|
|
229
202
|
closePopoverWithoutReturnFocus();
|
|
230
203
|
}
|
|
231
|
-
function onDocumentKeydown(
|
|
232
|
-
if (
|
|
233
|
-
if (props.closeOnEscape === false || event.key !== "Escape") return;
|
|
204
|
+
function onDocumentKeydown() {
|
|
205
|
+
if (props.closeOnEscape === false) return;
|
|
234
206
|
closePopover();
|
|
235
207
|
}
|
|
208
|
+
const disconnectLayerInteraction = layer.connectInteraction({
|
|
209
|
+
inside: () => [rootRef.value, targetElement.value],
|
|
210
|
+
clickOutside: onDocumentClick,
|
|
211
|
+
pointerDownOutside: onDocumentPointerDown,
|
|
212
|
+
escapeKeyDown: onDocumentKeydown
|
|
213
|
+
});
|
|
236
214
|
watch(isDisabled, (disabled) => {
|
|
237
215
|
if (disabled) closePopover();
|
|
238
216
|
});
|
|
@@ -249,17 +227,14 @@ function usePopover(props, emitOpenChange) {
|
|
|
249
227
|
immediate: true
|
|
250
228
|
});
|
|
251
229
|
usePopoverBindings({
|
|
252
|
-
|
|
253
|
-
targetElement,
|
|
230
|
+
targetLifecycle,
|
|
254
231
|
popoverId,
|
|
255
232
|
popoverRole,
|
|
256
233
|
isVisible,
|
|
257
234
|
isDisabled,
|
|
258
|
-
onTriggerClick
|
|
259
|
-
onDocumentClick,
|
|
260
|
-
onDocumentPointerDown,
|
|
261
|
-
onDocumentKeydown
|
|
235
|
+
onTriggerClick
|
|
262
236
|
});
|
|
237
|
+
onBeforeUnmount(disconnectLayerInteraction);
|
|
263
238
|
return {
|
|
264
239
|
rootRef,
|
|
265
240
|
contentRef,
|