ropav 0.1.5 → 0.1.6
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 +4 -0
- package/dist/accordion.js +11 -8
- package/dist/alert.css +18 -18
- package/dist/alert.js +18 -17
- package/dist/avatar.js +2 -2
- package/dist/badge.js +2 -2
- package/dist/base.css +18 -13
- package/dist/button-group.js +1 -1
- package/dist/button-link.js +10 -12
- package/dist/button.css +32 -27
- package/dist/button.js +10 -12
- package/dist/{useButtonColor.js → button.scss_vue_type_style_index_0_src_true_lang.js} +2 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +6 -6
- package/dist/collapse.css +6 -6
- package/dist/collapse.js +4 -4
- package/dist/collectionNavigation.js +2 -2
- package/dist/color-input.css +19 -19
- package/dist/color-input.js +5 -5
- package/dist/color-picker.css +7 -7
- package/dist/color-picker.js +4 -5
- package/dist/color-swatch.js +1 -1
- package/dist/componentColors.js +42 -2
- package/dist/components/checkbox/useCheckbox.d.ts +1 -1
- package/dist/components/color-input/color-input.d.ts +2 -2
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/dialog/dialog-core.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu-primitive-core.d.ts +1 -1
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +2 -2
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +3 -4
- package/dist/components/input/useInput.d.ts +1 -1
- package/dist/components/number-input/useNumberInput.d.ts +1 -1
- package/dist/components/progress/useProgress.d.ts +1 -1
- package/dist/components/radio/useRadio.d.ts +2 -2
- package/dist/components/scroll-area/scrollAreaCore.d.ts +5 -0
- package/dist/components/scroll-area/types.d.ts +4 -0
- package/dist/components/scroll-area/useScrollArea.d.ts +1 -0
- package/dist/components/scroll-area/useScrollAreaMetrics.d.ts +3 -0
- package/dist/components/scroll-area/useScrollAreaPresentation.d.ts +3 -0
- package/dist/components/select/useSelect.d.ts +2 -1
- package/dist/components/select/useSelectNativeValue.d.ts +1 -7
- package/dist/components/slider/sliderCore.d.ts +2 -1
- package/dist/components/slider/useRangeSlider.d.ts +1 -1
- package/dist/components/slider/useSlider.d.ts +1 -1
- package/dist/components/switch/useSwitch.d.ts +1 -1
- package/dist/components/textarea/useTextarea.d.ts +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +2 -0
- package/dist/composables/useControllableValue.d.ts +14 -0
- package/dist/dialog.js +8 -5
- package/dist/dropdown-menu.js +43 -29
- package/dist/field.js +1 -1
- package/dist/floating.js +19 -7
- package/dist/icon-button.css +12 -173
- package/dist/icon-button.js +5 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.js +7 -5
- package/dist/input.css +24 -24
- package/dist/input.js +5 -5
- package/dist/modal.js +11 -7
- package/dist/number-input.css +18 -18
- package/dist/number-input.js +7 -7
- package/dist/overlay.js +1 -1
- package/dist/pagination.js +3 -3
- package/dist/popover.js +9 -6
- package/dist/progress.css +29 -21
- package/dist/progress.js +17 -10
- package/dist/radio.js +3 -3
- package/dist/scroll-area.css +10 -1
- package/dist/scroll-area.js +82 -25
- package/dist/select.css +45 -45
- package/dist/select.js +48 -26
- package/dist/slider.css +142 -142
- package/dist/slider.js +32 -38
- package/dist/switch.css +17 -17
- package/dist/switch.js +6 -6
- package/dist/tabs.css +3 -3
- package/dist/tabs.js +25 -15
- package/dist/textarea.css +26 -26
- package/dist/textarea.js +4 -4
- package/dist/toast.css +26 -26
- package/dist/toast.js +24 -19
- package/dist/tooltip.js +11 -8
- package/dist/useCollapse.js +12 -7
- package/dist/useControlState.js +1 -1
- package/dist/useControllableValue.js +8 -2
- package/dist/useFloatingPosition.js +4 -1140
- package/dist/useFormControl.js +3 -2
- package/dist/useOverlayZIndex.js +1 -1
- package/dist/useRequiredInject.js +1 -1
- package/docs/public-composables-api.md +52 -0
- package/package.json +45 -38
- package/src/styles/_mixins.scss +4 -0
- package/src/styles/_tokens.scss +12 -12
- package/src/styles/_variables.scss +1 -1
- package/dist/button-link.css +0 -167
- /package/dist/{composables → internal/composables}/useOverlayLayer.d.ts +0 -0
package/dist/select.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import './select.css';
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as bem } from "./bem.js";
|
|
2
|
+
import { t as useControllableValue } from "./useControllableValue.js";
|
|
4
3
|
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
4
|
+
import { t as bem } from "./bem.js";
|
|
5
5
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
6
|
-
import { t as
|
|
6
|
+
import { t as x_default } from "./x.js";
|
|
7
7
|
import { i as useFormControl } from "./useFormControl.js";
|
|
8
8
|
import { t as useControlState } from "./useControlState.js";
|
|
9
9
|
import { n as getNextEnabledIndex, r as useTypeahead, t as getEnabledIndexes } from "./collectionNavigation.js";
|
|
@@ -19,29 +19,47 @@ var chevrons_up_down_default = markRaw(defineVaporComponent({
|
|
|
19
19
|
render
|
|
20
20
|
}));
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/composables/useClickOutside.ts
|
|
22
|
+
//#region src/internal/composables/useClickOutside.ts
|
|
23
|
+
function isEventInside(event, element) {
|
|
24
|
+
if (event.composedPath().includes(element)) return true;
|
|
25
|
+
const eventTarget = event.target;
|
|
26
|
+
const NodeConstructor = element.ownerDocument.defaultView?.Node;
|
|
27
|
+
return Boolean(eventTarget && NodeConstructor && eventTarget instanceof NodeConstructor && element.contains(eventTarget));
|
|
28
|
+
}
|
|
23
29
|
function useClickOutside(target, active, callback) {
|
|
24
|
-
|
|
30
|
+
const targets = Array.isArray(target) ? target : [target];
|
|
31
|
+
const listeningDocuments = /* @__PURE__ */ new Set();
|
|
25
32
|
let stopWatch;
|
|
26
|
-
function handler(
|
|
27
|
-
if (!
|
|
33
|
+
function handler(event) {
|
|
34
|
+
if (!targets.some((current) => {
|
|
35
|
+
const element = current.value;
|
|
36
|
+
return element ? isEventInside(event, element) : false;
|
|
37
|
+
})) callback(event);
|
|
28
38
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
function detachListeners() {
|
|
40
|
+
for (const document of listeningDocuments) document.removeEventListener("click", handler, true);
|
|
41
|
+
listeningDocuments.clear();
|
|
42
|
+
}
|
|
43
|
+
function syncListeners() {
|
|
44
|
+
detachListeners();
|
|
45
|
+
if (!active.value) return;
|
|
46
|
+
for (const current of targets) {
|
|
47
|
+
const document = current.value?.ownerDocument;
|
|
48
|
+
if (!document || listeningDocuments.has(document)) continue;
|
|
49
|
+
document.addEventListener("click", handler, true);
|
|
50
|
+
listeningDocuments.add(document);
|
|
51
|
+
}
|
|
34
52
|
}
|
|
35
53
|
onMounted(() => {
|
|
36
|
-
stopWatch = watch(active,
|
|
54
|
+
stopWatch = watch([active, ...targets], syncListeners, { immediate: true });
|
|
37
55
|
});
|
|
38
56
|
onBeforeUnmount(() => {
|
|
39
57
|
stopWatch?.();
|
|
40
|
-
|
|
58
|
+
detachListeners();
|
|
41
59
|
});
|
|
42
60
|
}
|
|
43
61
|
//#endregion
|
|
44
|
-
//#region src/composables/useCollectionNavigation.ts
|
|
62
|
+
//#region src/internal/composables/useCollectionNavigation.ts
|
|
45
63
|
function useCollectionNavigation(options) {
|
|
46
64
|
const activeKey = shallowRef(null);
|
|
47
65
|
const isDisabled = options.isDisabled ?? (() => false);
|
|
@@ -118,7 +136,8 @@ function useSelect(props, emitUpdate, getValue = () => props.modelValue ?? null,
|
|
|
118
136
|
const selectRef = ref(null);
|
|
119
137
|
const isOpen = ref(false);
|
|
120
138
|
const selectId = useId();
|
|
121
|
-
const
|
|
139
|
+
const popupId = `${selectId}-popup`;
|
|
140
|
+
const listboxId = `${popupId}-viewport`;
|
|
122
141
|
const control = useControlState(props);
|
|
123
142
|
const visibleOptions = computed(() => props.options ?? []);
|
|
124
143
|
const value = computed(getValue);
|
|
@@ -262,6 +281,7 @@ function useSelect(props, emitUpdate, getValue = () => props.modelValue ?? null,
|
|
|
262
281
|
triggerRef,
|
|
263
282
|
isOpen,
|
|
264
283
|
selectId,
|
|
284
|
+
popupId,
|
|
265
285
|
listboxId,
|
|
266
286
|
control,
|
|
267
287
|
visibleOptions,
|
|
@@ -376,12 +396,12 @@ function useSelectNativeControl(props, emitUpdate, triggerRef) {
|
|
|
376
396
|
}
|
|
377
397
|
//#endregion
|
|
378
398
|
//#region src/components/select/select.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
379
|
-
var t0 = template("<option data-v-
|
|
380
|
-
var t1 = template("<button data-v-
|
|
399
|
+
var t0 = template("<option data-v-7eb8ed79> ");
|
|
400
|
+
var t1 = template("<button data-v-7eb8ed79></button>");
|
|
381
401
|
var t2 = template("No options", 2);
|
|
382
|
-
var t3 = template("<div data-v-
|
|
383
|
-
var t4 = template("<div data-v-
|
|
384
|
-
var t5 = template("<div data-v-
|
|
402
|
+
var t3 = template("<div data-v-7eb8ed79>");
|
|
403
|
+
var t4 = template("<div data-v-7eb8ed79> ");
|
|
404
|
+
var t5 = template("<div data-v-7eb8ed79><select data-v-7eb8ed79><option data-v-7eb8ed79 value></option></select><div data-v-7eb8ed79><span data-v-7eb8ed79> </span><span data-v-7eb8ed79><span data-v-7eb8ed79 class=rp-select__arrow aria-hidden=true>", 1);
|
|
385
405
|
delegateEvents("mousedown", "click", "keydown");
|
|
386
406
|
//#endregion
|
|
387
407
|
//#region src/components/select/select.vue
|
|
@@ -430,7 +450,7 @@ var select_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
430
450
|
const emit = __emit;
|
|
431
451
|
const triggerRef = ref(null);
|
|
432
452
|
const { nativeSelectRef, selectedValue, nativeInputAttrs, requestValueUpdate } = useSelectNativeControl(props, (value) => emit("update:modelValue", value), triggerRef);
|
|
433
|
-
const { selectRef, isOpen, selectId, listboxId, control, visibleOptions, focusedIndex, activeDescendantId, rootClass, hasValue, displayLabel, canClear, toggle, selectOption, clearSelection, onOptionMouseenter, onFocusout, onTriggerKeydown } = useSelect(props, requestValueUpdate, () => selectedValue.value, triggerRef);
|
|
453
|
+
const { selectRef, isOpen, selectId, popupId, listboxId, control, visibleOptions, focusedIndex, activeDescendantId, rootClass, hasValue, displayLabel, canClear, toggle, selectOption, clearSelection, onOptionMouseenter, onFocusout, onTriggerKeydown } = useSelect(props, requestValueUpdate, () => selectedValue.value, triggerRef);
|
|
434
454
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
435
455
|
const rootAttrs = computed(() => getRootAttrs({
|
|
436
456
|
class: rootClass.value,
|
|
@@ -533,12 +553,14 @@ var select_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
533
553
|
createComponent(VaporTransition, { name: "rp-select-dropdown" }, extend(() => {
|
|
534
554
|
return createIf(() => unref(isOpen), () => {
|
|
535
555
|
return createComponent(scroll_area_default, { $: [() => unref(getPartAttrs)("content", { class: "rp-select__dropdown" }), {
|
|
536
|
-
|
|
537
|
-
id: () => unref(listboxId),
|
|
556
|
+
id: () => unref(popupId),
|
|
538
557
|
embedded: "",
|
|
539
558
|
type: "auto",
|
|
540
559
|
scrollbars: "y",
|
|
541
|
-
"viewport-attrs": () => ({
|
|
560
|
+
"viewport-attrs": () => ({
|
|
561
|
+
role: "listbox",
|
|
562
|
+
tabindex: -1
|
|
563
|
+
}),
|
|
542
564
|
"data-state": () => unref(isOpen) ? "open" : "closed"
|
|
543
565
|
}] }, extend(() => {
|
|
544
566
|
return [createIf(() => unref(visibleOptions).length === 0, () => {
|
|
@@ -585,7 +607,7 @@ var select_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
585
607
|
_setTemplateRef(n26, selectRef, null, "selectRef");
|
|
586
608
|
return n26;
|
|
587
609
|
}
|
|
588
|
-
}), [["__scopeId", "data-v-
|
|
610
|
+
}), [["__scopeId", "data-v-7eb8ed79"]]);
|
|
589
611
|
//#endregion
|
|
590
612
|
//#region src/components/select/types.ts
|
|
591
613
|
var selectParts = [
|