ropav 0.0.10 → 0.0.12
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 +9 -0
- package/dist/accordion.css +115 -111
- package/dist/accordion.js +60 -16
- package/dist/alert.css +110 -108
- package/dist/alert.js +48 -26
- package/dist/aspect-ratio.css +17 -15
- package/dist/aspect-ratio.js +20 -6
- package/dist/avatar.css +98 -96
- package/dist/avatar.js +27 -16
- package/dist/badge.css +95 -93
- package/dist/badge.js +29 -16
- package/dist/base.css +672 -671
- package/dist/button-group.css +39 -37
- package/dist/button-group.js +23 -12
- package/dist/button-link.css +160 -158
- package/dist/button-link.js +43 -24
- package/dist/button.css +160 -158
- package/dist/button.js +37 -19
- package/dist/card.css +109 -107
- package/dist/card.js +42 -17
- package/dist/checkbox.css +139 -137
- package/dist/checkbox.js +103 -33
- package/dist/collapse.css +29 -27
- package/dist/collapse.js +44 -10
- package/dist/color-input.css +137 -107
- package/dist/color-input.js +117 -30
- package/dist/color-picker.css +309 -303
- package/dist/color-picker.js +147 -54
- package/dist/color-picker2.js +9 -1
- package/dist/color-swatch.css +48 -46
- package/dist/color-swatch.js +15 -11
- package/dist/color-swatch2.js +4 -0
- package/dist/components/accordion/accordion-item.d.ts +13 -1
- package/dist/components/accordion/index.d.ts +2 -1
- package/dist/components/accordion/index.js +2 -2
- package/dist/components/accordion/types.d.ts +9 -4
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/alert/index.d.ts +2 -2
- package/dist/components/alert/index.js +2 -2
- package/dist/components/alert/types.d.ts +4 -1
- package/dist/components/aspect-ratio/index.d.ts +2 -1
- package/dist/components/aspect-ratio/index.js +2 -2
- package/dist/components/aspect-ratio/types.d.ts +4 -1
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +2 -2
- package/dist/components/avatar/types.d.ts +4 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js +2 -2
- package/dist/components/badge/types.d.ts +4 -1
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/types.d.ts +4 -1
- package/dist/components/button-group/index.d.ts +2 -1
- package/dist/components/button-group/index.js +2 -2
- package/dist/components/button-group/types.d.ts +4 -1
- package/dist/components/button-link/index.d.ts +2 -1
- package/dist/components/button-link/index.js +2 -2
- package/dist/components/button-link/types.d.ts +4 -1
- package/dist/components/card/index.d.ts +2 -1
- package/dist/components/card/index.js +2 -2
- package/dist/components/card/types.d.ts +5 -1
- package/dist/components/checkbox/checkbox.d.ts +4 -1
- package/dist/components/checkbox/index.d.ts +2 -1
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/checkbox/types.d.ts +11 -2
- package/dist/components/checkbox/useCheckbox.d.ts +3 -1
- package/dist/components/collapse/collapse.d.ts +2 -2
- package/dist/components/collapse/index.d.ts +2 -1
- package/dist/components/collapse/index.js +2 -2
- package/dist/components/collapse/types.d.ts +9 -2
- package/dist/components/color-input/index.d.ts +2 -1
- package/dist/components/color-input/index.js +2 -2
- package/dist/components/color-input/types.d.ts +8 -2
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/color-input/useColorInputValue.d.ts +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/color-picker/index.js +2 -2
- package/dist/components/color-picker/types.d.ts +13 -1
- package/dist/components/color-swatch/index.d.ts +2 -1
- package/dist/components/color-swatch/index.js +2 -1
- package/dist/components/color-swatch/types.d.ts +4 -1
- package/dist/components/dialog/dialog-close.d.ts +21 -0
- package/dist/components/dialog/dialog-content.d.ts +32 -0
- package/dist/components/dialog/dialog-core.d.ts +27 -0
- package/dist/components/dialog/dialog-description.d.ts +21 -0
- package/dist/components/dialog/dialog-overlay.d.ts +21 -0
- package/dist/components/dialog/dialog-portal.d.ts +21 -0
- package/dist/components/dialog/dialog-root.d.ts +28 -0
- package/dist/components/dialog/dialog-title.d.ts +21 -0
- package/dist/components/dialog/dialog-trigger.d.ts +23 -0
- package/dist/components/dialog/index.d.ts +9 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/types.d.ts +61 -0
- package/dist/components/dropdown-menu/dropdown-menu-checkbox-item.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +34 -0
- package/dist/components/dropdown-menu/dropdown-menu-context-trigger.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-item-indicator.d.ts +24 -0
- package/dist/components/dropdown-menu/dropdown-menu-item-row.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-items.d.ts +24 -22
- package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +21 -0
- package/dist/components/dropdown-menu/dropdown-menu-outside.d.ts +3 -0
- package/dist/components/dropdown-menu/dropdown-menu-portal.d.ts +21 -0
- package/dist/components/dropdown-menu/dropdown-menu-primitive-core.d.ts +110 -0
- package/dist/components/dropdown-menu/dropdown-menu-primitives.d.ts +15 -0
- package/dist/components/dropdown-menu/dropdown-menu-radio-group.d.ts +25 -0
- package/dist/components/dropdown-menu/dropdown-menu-radio-item.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu-root.d.ts +30 -0
- package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +19 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +34 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +28 -0
- package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +23 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +6 -3
- package/dist/components/dropdown-menu/index.d.ts +32 -1
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/dropdown-menu/types.d.ts +145 -6
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +15 -3
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +10 -3
- package/dist/components/dropdown-menu/useDropdownMenuDom.d.ts +2 -1
- package/dist/components/dropdown-menu/useDropdownMenuInteractions.d.ts +4 -4
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +19 -0
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +27 -0
- package/dist/components/dropdown-menu/useDropdownMenuRenderItems.d.ts +14 -2
- package/dist/components/field/index.d.ts +2 -1
- package/dist/components/field/index.js +2 -2
- package/dist/components/field/types.d.ts +4 -1
- package/dist/components/floating/index.d.ts +3 -0
- package/dist/components/floating/index.js +3 -0
- package/dist/components/floating/types.d.ts +105 -0
- package/dist/components/floating/useFloatingPosition.d.ts +15 -0
- package/dist/components/floating/useHoverDisclosure.d.ts +2 -0
- package/dist/components/focus-trap/focus-trap.d.ts +31 -0
- package/dist/components/focus-trap/index.d.ts +4 -0
- package/dist/components/focus-trap/index.js +3 -0
- package/dist/components/focus-trap/types.d.ts +41 -0
- package/dist/components/focus-trap/useFocusTrap.d.ts +2 -0
- package/dist/components/icon-button/index.d.ts +2 -1
- package/dist/components/icon-button/index.js +2 -1
- package/dist/components/icon-button/types.d.ts +4 -1
- package/dist/components/input/index.d.ts +2 -1
- package/dist/components/input/index.js +2 -1
- package/dist/components/input/input.d.ts +4 -1
- package/dist/components/input/types.d.ts +7 -2
- package/dist/components/modal/index.d.ts +2 -1
- package/dist/components/modal/index.js +2 -2
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/modal/types.d.ts +11 -1
- package/dist/components/modal/useModal.d.ts +7 -4
- package/dist/components/number-input/index.d.ts +2 -1
- package/dist/components/number-input/index.js +2 -2
- package/dist/components/number-input/types.d.ts +7 -2
- package/dist/components/number-input/useNumberInput.d.ts +2 -1
- package/dist/components/overlay/index.d.ts +2 -1
- package/dist/components/overlay/index.js +2 -1
- package/dist/components/overlay/types.d.ts +4 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.js +2 -2
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/types.d.ts +20 -11
- package/dist/components/popover/usePopover.d.ts +9 -1
- package/dist/components/progress/index.d.ts +2 -2
- package/dist/components/progress/index.js +2 -2
- package/dist/components/progress/types.d.ts +4 -1
- package/dist/components/radio/index.d.ts +2 -1
- package/dist/components/radio/index.js +2 -2
- package/dist/components/radio/radio.d.ts +8 -3
- package/dist/components/radio/types.d.ts +37 -4
- package/dist/components/radio/useRadio.d.ts +12 -4
- package/dist/components/select/index.d.ts +2 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/types.d.ts +10 -2
- package/dist/components/select/useSelect.d.ts +3 -1
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/range-slider-tooltip.d.ts +3 -0
- package/dist/components/slider/range-slider.d.ts +7 -4
- package/dist/components/slider/slider.d.ts +4 -1
- package/dist/components/slider/sliderCore.d.ts +4 -4
- package/dist/components/slider/types.d.ts +22 -4
- package/dist/components/slider/useRangeSlider.d.ts +2 -2
- package/dist/components/slider/useSlider.d.ts +2 -2
- package/dist/components/switch/index.d.ts +2 -1
- package/dist/components/switch/index.js +2 -2
- package/dist/components/switch/switch.d.ts +4 -1
- package/dist/components/switch/types.d.ts +11 -2
- package/dist/components/switch/useSwitch.d.ts +3 -1
- package/dist/components/tabs/index.d.ts +2 -1
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tabs/types.d.ts +13 -4
- package/dist/components/teleport-provider/index.d.ts +3 -0
- package/dist/components/teleport-provider/index.js +3 -0
- package/dist/components/teleport-provider/teleport-provider.d.ts +21 -0
- package/dist/components/teleport-provider/types.d.ts +4 -0
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +6 -0
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/textarea/textarea.d.ts +4 -1
- package/dist/components/textarea/types.d.ts +10 -2
- package/dist/components/textarea/useTextarea.d.ts +2 -1
- package/dist/components/toast/index.d.ts +3 -2
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-store.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/toast/types.d.ts +20 -10
- package/dist/components/toast/useToast.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +2 -1
- package/dist/components/tooltip/index.js +2 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/types.d.ts +13 -12
- package/dist/components/tooltip/useTooltip.d.ts +12 -2
- package/dist/composables/useOverlayLayer.d.ts +32 -0
- package/dist/dialog.js +510 -0
- package/dist/dropdown-menu.css +191 -108
- package/dist/dropdown-menu.js +1954 -198
- package/dist/field.css +41 -39
- package/dist/field.js +40 -16
- package/dist/floating.js +403 -0
- package/dist/focus-trap.js +80 -0
- package/dist/icon-button.css +193 -189
- package/dist/icon-button.js +23 -18
- package/dist/icon-button2.js +8 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +39 -32
- package/dist/input.css +122 -120
- package/dist/input.js +63 -40
- package/dist/input2.js +9 -0
- package/dist/legacy-unlayered.css +5382 -0
- package/dist/modal.css +129 -127
- package/dist/modal.js +182 -281
- package/dist/number-input.css +87 -85
- package/dist/number-input.js +98 -26
- package/dist/overlay.css +26 -24
- package/dist/overlay.js +17 -9
- package/dist/overlay2.js +4 -0
- package/dist/popover.css +140 -107
- package/dist/popover.js +276 -196
- package/dist/popover2.js +6 -1
- package/dist/progress.css +101 -99
- package/dist/progress.js +50 -28
- package/dist/radio.css +114 -105
- package/dist/radio.js +237 -61
- package/dist/select.css +255 -242
- package/dist/select.js +257 -94
- package/dist/slider.css +1090 -1031
- package/dist/slider.js +443 -175
- package/dist/styles-api.d.ts +22 -0
- package/dist/styles-api.js +49 -0
- package/dist/switch.css +120 -108
- package/dist/switch.js +112 -38
- package/dist/tabs.css +286 -278
- package/dist/tabs.js +60 -21
- package/dist/teleport-provider.js +15 -0
- package/dist/textarea.css +132 -130
- package/dist/textarea.js +83 -31
- package/dist/toast.css +229 -225
- package/dist/toast.js +189 -118
- package/dist/tooltip.css +61 -106
- package/dist/tooltip.js +184 -228
- package/dist/tooltip2.js +8 -0
- package/dist/useControlState.js +4 -0
- package/dist/useFloatingPosition.js +1317 -0
- package/dist/useFocusTrap.js +130 -0
- package/dist/useFormControl.js +107 -0
- package/dist/useOverlayLayer.js +262 -0
- package/dist/useTeleportTarget.js +40 -0
- package/docs/public-floating-api.md +148 -0
- package/docs/public-styles-api.md +134 -0
- package/docs/public-tokens.md +545 -0
- package/package.json +37 -9
- package/src/styles/_tokens.scss +33 -28
- package/src/styles/_utilities.scss +11 -9
- package/src/styles/styles-manifest.json +4125 -0
- package/dist/rafScheduler.js +0 -34
- package/dist/useClickOutside.js +0 -24
package/dist/color-input.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import './color-input.css';
|
|
2
2
|
import { t as bem } from "./bem.js";
|
|
3
|
+
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
3
4
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
5
|
+
import { a as useTextFormControl, n as provideNestedFormControlOwner, o as useControllableValue } from "./useFormControl.js";
|
|
4
6
|
import { t as useControlState } from "./useControlState.js";
|
|
5
7
|
import { t as color_swatch_default } from "./color-swatch.js";
|
|
6
8
|
import { n as formatColorPickerValue, r as parseColorPickerValue, t as color_picker_default } from "./color-picker.js";
|
|
7
9
|
import { t as input_default } from "./input.js";
|
|
8
10
|
import { t as popover_default } from "./popover.js";
|
|
9
|
-
import { child, computed, createComponent, createIf, createSlot, defineVaporComponent, extend, markRaw, nextTick, on, onMounted, ref, renderEffect,
|
|
11
|
+
import { child, computed, createComponent, createIf, createSlot, createTemplateRefSetter, defineVaporComponent, extend, markRaw, nextTick, on, onMounted, ref, renderEffect, setDynamicProps, setInsertionState, shallowRef, template, unref, withModifiers } from "vue";
|
|
10
12
|
//#region ~icons/lucide/crosshair
|
|
11
13
|
var t0$1 = template("<svg viewBox=\"0 0 24 24\"width=1.2em height=1.2em><g fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><circle cx=12 cy=12 r=10></circle><path d=\"M22 12h-4M6 12H2m10-6V2m0 20v-4\">", 3, 1);
|
|
12
14
|
function render(_ctx) {
|
|
@@ -57,14 +59,17 @@ function onInputKeydown(event, popover) {
|
|
|
57
59
|
if (event.key === "Escape") popover.triggerProps.onKeydown(event);
|
|
58
60
|
}
|
|
59
61
|
function focusPickerFromTrigger(trigger) {
|
|
60
|
-
const
|
|
62
|
+
const contentId = trigger?.getAttribute("aria-controls")?.split(/\s+/).find(Boolean);
|
|
63
|
+
const picker = contentId ? trigger?.ownerDocument.getElementById(contentId)?.querySelector(".rp-color-picker") : null;
|
|
61
64
|
if (!picker) return;
|
|
62
65
|
(Boolean(picker.querySelector(".rp-color-picker__saturation")) ? picker.querySelector("input:not(:disabled), button:not(:disabled), [tabindex=\"0\"]") : picker.querySelector("[role=\"radio\"][aria-checked=\"true\"]") ?? picker.querySelector("[role=\"radio\"][tabindex=\"0\"]"))?.focus({ preventScroll: true });
|
|
63
66
|
}
|
|
64
67
|
function onPickerKeydown(event, popover) {
|
|
65
68
|
if (event.key !== "Escape") return;
|
|
66
69
|
const pickerRoot = event.currentTarget;
|
|
67
|
-
const
|
|
70
|
+
const content = pickerRoot instanceof Element ? pickerRoot.closest("[role=\"dialog\"]") : null;
|
|
71
|
+
const contentId = content?.id;
|
|
72
|
+
const focusTarget = contentId ? [...content.ownerDocument.querySelectorAll("[aria-controls]")].find((element) => element.getAttribute("aria-controls")?.split(/\s+/).includes(contentId)) : void 0;
|
|
68
73
|
event.stopPropagation();
|
|
69
74
|
focusTarget?.focus({ preventScroll: true });
|
|
70
75
|
popover.close();
|
|
@@ -117,11 +122,12 @@ function useColorInputPopover(getInputAttrs) {
|
|
|
117
122
|
}
|
|
118
123
|
//#endregion
|
|
119
124
|
//#region src/components/color-input/useColorInputValue.ts
|
|
120
|
-
function useColorInputValue(props, isControlInvalid) {
|
|
121
|
-
const
|
|
122
|
-
const
|
|
125
|
+
function useColorInputValue(props, isControlInvalid, getValue = () => props.modelValue ?? "") {
|
|
126
|
+
const currentValue = computed(getValue);
|
|
127
|
+
const parsedColor = computed(() => parseColorPickerValue(currentValue.value));
|
|
128
|
+
const previewColor = computed(() => parsedColor.value ? currentValue.value : void 0);
|
|
123
129
|
const hasValidSwatches = computed(() => Boolean(props.swatches?.some((swatch) => parseColorPickerValue(swatch))));
|
|
124
|
-
const hasInvalidColor = computed(() => props.validateColor &&
|
|
130
|
+
const hasInvalidColor = computed(() => props.validateColor && currentValue.value.trim().length > 0 && !parsedColor.value);
|
|
125
131
|
return {
|
|
126
132
|
previewColor,
|
|
127
133
|
hasValidSwatches,
|
|
@@ -132,9 +138,9 @@ function useColorInputValue(props, isControlInvalid) {
|
|
|
132
138
|
}
|
|
133
139
|
//#endregion
|
|
134
140
|
//#region src/components/color-input/useColorInput.ts
|
|
135
|
-
function useColorInput(props, emit) {
|
|
141
|
+
function useColorInput(props, emit, getValue = () => props.modelValue ?? "") {
|
|
136
142
|
const control = useControlState(props);
|
|
137
|
-
const value = useColorInputValue(props, () => control.invalid);
|
|
143
|
+
const value = useColorInputValue(props, () => control.invalid, getValue);
|
|
138
144
|
const popover = useColorInputPopover(() => props.inputAttrs);
|
|
139
145
|
const popoverDisabled = computed(() => control.disabled || Boolean(props.readonly) || Boolean(props.swatchesOnly) && !value.hasValidSwatches.value);
|
|
140
146
|
const eyeDropper = useColorInputEyeDropper({
|
|
@@ -176,17 +182,20 @@ function useColorInput(props, emit) {
|
|
|
176
182
|
}
|
|
177
183
|
//#endregion
|
|
178
184
|
//#region src/components/color-input/color-input.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
179
|
-
var t0 = template("<span data-v-
|
|
180
|
-
var t1 = template("<button data-v-
|
|
185
|
+
var t0 = template("<span data-v-0c4e1f32>");
|
|
186
|
+
var t1 = template("<button data-v-0c4e1f32><span data-v-0c4e1f32 class=rp-color-input__eye-dropper-icon aria-hidden=true></button>");
|
|
181
187
|
//#endregion
|
|
182
188
|
//#region src/components/color-input/color-input.vue
|
|
183
189
|
var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
184
190
|
name: "RpColorInput",
|
|
191
|
+
inheritAttrs: false,
|
|
185
192
|
__name: "color-input",
|
|
186
193
|
props: {
|
|
187
194
|
id: {},
|
|
188
195
|
name: {},
|
|
189
|
-
|
|
196
|
+
form: {},
|
|
197
|
+
modelValue: { default: void 0 },
|
|
198
|
+
defaultValue: { default: "" },
|
|
190
199
|
format: { default: "hex" },
|
|
191
200
|
size: {},
|
|
192
201
|
radius: {},
|
|
@@ -223,6 +232,7 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
223
232
|
describedby: {},
|
|
224
233
|
labelledby: {},
|
|
225
234
|
inputAttrs: {},
|
|
235
|
+
validationMessage: {},
|
|
226
236
|
validateColor: {
|
|
227
237
|
type: Boolean,
|
|
228
238
|
default: false
|
|
@@ -245,32 +255,82 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
245
255
|
type: Boolean,
|
|
246
256
|
default: true
|
|
247
257
|
},
|
|
248
|
-
eyeDropperAriaLabel: { default: "Pick color from screen" }
|
|
258
|
+
eyeDropperAriaLabel: { default: "Pick color from screen" },
|
|
259
|
+
classNames: {},
|
|
260
|
+
styles: {}
|
|
249
261
|
},
|
|
250
262
|
emits: ["update:modelValue", "update:open"],
|
|
251
263
|
setup(__props, { emit: __emit }) {
|
|
252
264
|
const props = __props;
|
|
253
265
|
const emit = __emit;
|
|
266
|
+
const controllable = useControllableValue({
|
|
267
|
+
modelValue: () => props.modelValue,
|
|
268
|
+
defaultValue: () => props.defaultValue,
|
|
269
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
270
|
+
});
|
|
271
|
+
const inputComponentRef = ref(null);
|
|
272
|
+
provideNestedFormControlOwner();
|
|
254
273
|
const { control, rootClass, previewColor, isInvalid, colorValidationMessage, popoverDisabled, getInputTriggerAttrs, rememberClose, onPickerKeydown, onFocusOut, showEyeDropper, isPickingColor, pickScreenColor, onInputUpdate, onPickerUpdate, onOpenUpdate } = useColorInput(props, {
|
|
255
|
-
modelValue: (value) =>
|
|
274
|
+
modelValue: (value) => controllable.setValue(value),
|
|
256
275
|
open: (value) => emit("update:open", value)
|
|
257
|
-
});
|
|
258
|
-
|
|
276
|
+
}, () => controllable.value.value);
|
|
277
|
+
const effectiveValidationMessage = computed(() => props.validationMessage !== void 0 ? props.validationMessage : colorValidationMessage.value);
|
|
278
|
+
useTextFormControl(() => inputComponentRef.value?.nativeElement, controllable, () => effectiveValidationMessage.value);
|
|
279
|
+
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
280
|
+
const rootAttrs = computed(() => getRootAttrs({
|
|
281
|
+
"data-disabled": presence(control.disabled),
|
|
282
|
+
"data-readonly": presence(props.readonly),
|
|
283
|
+
"data-invalid": presence(isInvalid.value),
|
|
284
|
+
onFocusout: onFocusOut
|
|
285
|
+
}));
|
|
286
|
+
const popoverClassNames = computed(() => ({
|
|
287
|
+
root: rootClass.value,
|
|
288
|
+
content: props.classNames?.content
|
|
289
|
+
}));
|
|
290
|
+
const popoverStyles = computed(() => ({ content: props.styles?.content }));
|
|
291
|
+
const inputClassNames = computed(() => ({
|
|
292
|
+
root: props.classNames?.control,
|
|
293
|
+
input: props.classNames?.input
|
|
294
|
+
}));
|
|
295
|
+
const inputStyles = computed(() => ({
|
|
296
|
+
root: props.styles?.control,
|
|
297
|
+
input: props.styles?.input
|
|
298
|
+
}));
|
|
299
|
+
const previewClassNames = computed(() => ({ root: ["rp-color-input__preview", props.classNames?.preview] }));
|
|
300
|
+
const previewStyles = computed(() => ({ root: props.styles?.preview }));
|
|
301
|
+
const pickerClassNames = computed(() => ({
|
|
302
|
+
root: props.classNames?.picker,
|
|
303
|
+
control: props.classNames?.pickerControl,
|
|
304
|
+
handle: props.classNames?.pickerHandle,
|
|
305
|
+
swatches: props.classNames?.pickerSwatches,
|
|
306
|
+
swatch: props.classNames?.pickerSwatch
|
|
307
|
+
}));
|
|
308
|
+
const pickerStyles = computed(() => ({
|
|
309
|
+
root: props.styles?.picker,
|
|
310
|
+
control: props.styles?.pickerControl,
|
|
311
|
+
handle: props.styles?.pickerHandle,
|
|
312
|
+
swatches: props.styles?.pickerSwatches,
|
|
313
|
+
swatch: props.styles?.pickerSwatch
|
|
314
|
+
}));
|
|
315
|
+
const _setTemplateRef = createTemplateRefSetter();
|
|
316
|
+
return createComponent(popover_default, { $: [() => rootAttrs.value, {
|
|
259
317
|
id: () => __props.popoverId,
|
|
260
|
-
class: () =>
|
|
318
|
+
"class-names": () => popoverClassNames.value,
|
|
319
|
+
styles: () => popoverStyles.value,
|
|
261
320
|
placement: () => __props.placement,
|
|
262
321
|
open: () => __props.open,
|
|
263
322
|
"keep-mounted": () => __props.keepMounted,
|
|
264
323
|
disabled: () => unref(popoverDisabled),
|
|
265
324
|
"aria-label": () => __props.pickerAriaLabel,
|
|
266
|
-
|
|
325
|
+
"content-class": () => `rp-color-input__popover rp-color-input__popover--size-${__props.size ?? "md"}`,
|
|
267
326
|
"onUpdate:open": () => unref(onOpenUpdate)
|
|
268
|
-
}, {
|
|
327
|
+
}] }, {
|
|
269
328
|
"default": (slotProps) => {
|
|
270
|
-
|
|
329
|
+
const n15 = createComponent(input_default, {
|
|
271
330
|
id: () => unref(control).id,
|
|
272
331
|
name: () => __props.name,
|
|
273
|
-
|
|
332
|
+
form: () => unref(control).form,
|
|
333
|
+
"model-value": () => unref(controllable).value.value,
|
|
274
334
|
type: "text",
|
|
275
335
|
size: () => __props.size,
|
|
276
336
|
radius: () => __props.radius,
|
|
@@ -284,7 +344,9 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
284
344
|
describedby: () => __props.describedby,
|
|
285
345
|
labelledby: () => __props.labelledby,
|
|
286
346
|
"input-attrs": () => unref(getInputTriggerAttrs)(slotProps),
|
|
287
|
-
"
|
|
347
|
+
"class-names": () => inputClassNames.value,
|
|
348
|
+
styles: () => inputStyles.value,
|
|
349
|
+
"validation-message": () => effectiveValidationMessage.value,
|
|
288
350
|
"onUpdate:modelValue": () => unref(onInputUpdate)
|
|
289
351
|
}, {
|
|
290
352
|
"left": extend(() => {
|
|
@@ -294,13 +356,16 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
294
356
|
}, () => {
|
|
295
357
|
return createIf(() => unref(previewColor), () => {
|
|
296
358
|
return createComponent(color_swatch_default, {
|
|
297
|
-
class:
|
|
359
|
+
"class-names": () => previewClassNames.value,
|
|
360
|
+
styles: () => previewStyles.value,
|
|
298
361
|
color: () => unref(previewColor),
|
|
299
362
|
size: "var(--_rp-color-input-preview-size)",
|
|
300
363
|
"aria-hidden": "true"
|
|
301
364
|
});
|
|
302
365
|
}, () => {
|
|
303
|
-
|
|
366
|
+
const n6 = t0();
|
|
367
|
+
renderEffect(() => setDynamicProps(n6, [unref(getPartAttrs)("preview", { class: ["rp-color-input__preview", "rp-color-input__preview--empty"] }), { "aria-hidden": "true" }]));
|
|
368
|
+
return n6;
|
|
304
369
|
}, 389);
|
|
305
370
|
}, 1);
|
|
306
371
|
}, { _: 8 }),
|
|
@@ -311,9 +376,12 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
311
376
|
const n12 = child(n13);
|
|
312
377
|
renderEffect(() => {
|
|
313
378
|
const _isPickingColor = unref(isPickingColor);
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
379
|
+
setDynamicProps(n13, [unref(getPartAttrs)("eyeDropper", { class: "rp-color-input__eye-dropper" }), {
|
|
380
|
+
type: "button",
|
|
381
|
+
disabled: unref(control).disabled || __props.readonly || _isPickingColor,
|
|
382
|
+
"aria-label": __props.eyeDropperAriaLabel,
|
|
383
|
+
"aria-busy": _isPickingColor || void 0
|
|
384
|
+
}]);
|
|
317
385
|
});
|
|
318
386
|
setInsertionState(n12, null, 0);
|
|
319
387
|
createSlot("eye-dropper-icon", null, () => {
|
|
@@ -324,12 +392,14 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
324
392
|
}
|
|
325
393
|
} : void 0]
|
|
326
394
|
});
|
|
395
|
+
_setTemplateRef(n15, inputComponentRef, null, "inputComponentRef");
|
|
396
|
+
return n15;
|
|
327
397
|
},
|
|
328
398
|
"content": (slotProps) => {
|
|
329
399
|
const _on_focusin = () => unref(rememberClose)(slotProps);
|
|
330
400
|
const _on_keydown = ($event) => unref(onPickerKeydown)($event, slotProps);
|
|
331
401
|
return createComponent(color_picker_default, {
|
|
332
|
-
"model-value": () =>
|
|
402
|
+
"model-value": () => unref(controllable).value.value,
|
|
333
403
|
format: () => __props.format,
|
|
334
404
|
size: () => __props.size,
|
|
335
405
|
readonly: () => __props.readonly,
|
|
@@ -337,6 +407,8 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
337
407
|
swatches: () => __props.swatches,
|
|
338
408
|
"swatches-per-row": () => __props.swatchesPerRow,
|
|
339
409
|
"aria-label": () => __props.pickerAriaLabel,
|
|
410
|
+
"class-names": () => pickerClassNames.value,
|
|
411
|
+
styles: () => pickerStyles.value,
|
|
340
412
|
onFocusin: () => _on_focusin,
|
|
341
413
|
onKeydown: () => _on_keydown,
|
|
342
414
|
"onUpdate:modelValue": () => unref(onPickerUpdate)
|
|
@@ -344,6 +416,21 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
344
416
|
}
|
|
345
417
|
}, true);
|
|
346
418
|
}
|
|
347
|
-
}), [["__scopeId", "data-v-
|
|
419
|
+
}), [["__scopeId", "data-v-0c4e1f32"]]);
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/components/color-input/types.ts
|
|
422
|
+
var colorInputParts = [
|
|
423
|
+
"root",
|
|
424
|
+
"control",
|
|
425
|
+
"input",
|
|
426
|
+
"preview",
|
|
427
|
+
"eyeDropper",
|
|
428
|
+
"content",
|
|
429
|
+
"picker",
|
|
430
|
+
"pickerControl",
|
|
431
|
+
"pickerHandle",
|
|
432
|
+
"pickerSwatches",
|
|
433
|
+
"pickerSwatch"
|
|
434
|
+
];
|
|
348
435
|
//#endregion
|
|
349
|
-
export { color_input_default as t };
|
|
436
|
+
export { color_input_default as n, colorInputParts as t };
|