ropav 0.0.11 → 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 +3 -0
- package/dist/checkbox.css +32 -32
- package/dist/checkbox.js +33 -14
- package/dist/color-input.css +19 -19
- package/dist/color-input.js +35 -17
- package/dist/components/checkbox/types.d.ts +5 -1
- package/dist/components/checkbox/useCheckbox.d.ts +1 -1
- package/dist/components/color-input/types.d.ts +4 -1
- package/dist/components/color-input/useColorInput.d.ts +1 -1
- package/dist/components/color-input/useColorInputValue.d.ts +1 -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 -724
- 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 +5 -2
- package/dist/components/dropdown-menu/index.d.ts +28 -49
- package/dist/components/dropdown-menu/index.js +2 -2
- package/dist/components/dropdown-menu/types.d.ts +5 -2
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts +8 -4
- package/dist/components/dropdown-menu/useDropdownMenuDisclosure.d.ts +7 -2
- package/dist/components/dropdown-menu/useDropdownMenuPortalPosition.d.ts +3 -3
- package/dist/components/dropdown-menu/useDropdownMenuPrimitiveContent.d.ts +27 -0
- package/dist/components/floating/index.d.ts +3 -1
- package/dist/components/floating/index.js +3 -0
- package/dist/components/floating/types.d.ts +75 -1
- package/dist/components/floating/useFloatingPosition.d.ts +3 -26
- package/dist/components/floating/useHoverDisclosure.d.ts +2 -0
- package/dist/components/input/input.d.ts +4 -1
- package/dist/components/input/types.d.ts +3 -1
- package/dist/components/modal/index.d.ts +1 -1
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/modal/types.d.ts +3 -0
- package/dist/components/modal/useModal.d.ts +7 -4
- package/dist/components/number-input/types.d.ts +3 -1
- package/dist/components/number-input/useNumberInput.d.ts +2 -1
- package/dist/components/popover/usePopover.d.ts +2 -2
- package/dist/components/radio/types.d.ts +17 -1
- package/dist/components/radio/useRadio.d.ts +3 -0
- package/dist/components/select/select.d.ts +4 -1
- package/dist/components/select/types.d.ts +6 -1
- package/dist/components/select/useSelect.d.ts +3 -2
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/slider/range-slider.d.ts +3 -3
- package/dist/components/slider/types.d.ts +11 -3
- package/dist/components/slider/useRangeSlider.d.ts +1 -1
- package/dist/components/slider/useSlider.d.ts +1 -1
- package/dist/components/switch/types.d.ts +5 -1
- package/dist/components/switch/useSwitch.d.ts +1 -1
- package/dist/components/teleport-provider/index.d.ts +1 -0
- package/dist/components/teleport-provider/index.js +2 -1
- package/dist/components/teleport-provider/useTeleportTarget.d.ts +4 -3
- package/dist/components/textarea/types.d.ts +4 -1
- package/dist/components/textarea/useTextarea.d.ts +1 -1
- package/dist/components/toast/index.d.ts +2 -1
- package/dist/components/toast/index.js +2 -2
- package/dist/components/toast/toast-store.d.ts +2 -0
- package/dist/components/toast/types.d.ts +10 -4
- package/dist/components/toast/useToast.d.ts +2 -2
- package/dist/components/tooltip/useTooltip.d.ts +3 -3
- package/dist/composables/useOverlayLayer.d.ts +32 -0
- package/dist/dialog.js +510 -0
- package/dist/dropdown-menu.css +4 -5
- package/dist/dropdown-menu.js +1141 -886
- package/dist/floating.js +403 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -4
- package/dist/input.css +24 -24
- package/dist/input.js +21 -11
- package/dist/legacy-unlayered.css +424 -503
- package/dist/modal.css +28 -28
- package/dist/modal.js +141 -200
- package/dist/number-input.css +20 -20
- package/dist/number-input.js +44 -16
- package/dist/popover.css +4 -4
- package/dist/popover.js +25 -40
- package/dist/radio.css +18 -18
- package/dist/radio.js +96 -18
- package/dist/select.css +54 -43
- package/dist/select.js +185 -67
- package/dist/slider.css +183 -202
- package/dist/slider.js +138 -37
- package/dist/switch.css +17 -17
- package/dist/switch.js +31 -13
- package/dist/textarea.css +26 -26
- package/dist/textarea.js +19 -9
- package/dist/toast.js +110 -99
- package/dist/tooltip.css +5 -80
- package/dist/tooltip.js +7 -3
- package/dist/useControlState.js +4 -0
- package/dist/useFloatingPosition.js +71 -38
- package/dist/useFormControl.js +107 -0
- package/dist/useOverlayLayer.js +262 -0
- package/dist/useTeleportTarget.js +21 -10
- package/docs/public-floating-api.md +148 -0
- package/docs/public-styles-api.md +2 -1
- package/package.json +10 -6
- package/dist/useClickOutside.js +0 -24
package/README.md
CHANGED
|
@@ -42,3 +42,6 @@ import { Button } from 'ropav';
|
|
|
42
42
|
Use typed `classNames` and `styles`, documented state attributes, and variables listed in the packaged styles manifest. DOM nesting, internal selectors and undocumented variables are private implementation details.
|
|
43
43
|
|
|
44
44
|
See the [Public Styles API](./docs/public-styles-api.md) and [public token table](./docs/public-tokens.md). Layered consumers should declare `reset, ropav.tokens, ropav.components, app`; `ropav/legacy-unlayered.css` is the temporary compatibility import for unlayered resets.
|
|
45
|
+
|
|
46
|
+
For headless Tooltip, HoverCard and custom menu markup, see the
|
|
47
|
+
[public floating API](./docs/public-floating-api.md).
|
package/dist/checkbox.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-checkbox[data-v-
|
|
2
|
+
.rp-checkbox[data-v-cc3e1126] {
|
|
3
3
|
--_rp-checkbox-color: var(--rp-color-control-selected-bg);
|
|
4
4
|
--_rp-checkbox-on-color: var(--rp-color-control-selected-fg);
|
|
5
5
|
--_rp-checkbox-size: 24px;
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
user-select: none;
|
|
18
18
|
vertical-align: top;
|
|
19
19
|
}
|
|
20
|
-
.rp-checkbox--disabled[data-v-
|
|
20
|
+
.rp-checkbox--disabled[data-v-cc3e1126] {
|
|
21
21
|
opacity: var(--rp-opacity-disabled);
|
|
22
22
|
cursor: not-allowed;
|
|
23
23
|
}
|
|
24
|
-
.rp-checkbox[data-v-
|
|
24
|
+
.rp-checkbox[data-v-cc3e1126] {
|
|
25
25
|
gap: var(--rp-spacing-2);
|
|
26
26
|
font-size: var(--_rp-checkbox-font-size);
|
|
27
27
|
}
|
|
28
|
-
.rp-checkbox__native[data-v-
|
|
28
|
+
.rp-checkbox__native[data-v-cc3e1126] {
|
|
29
29
|
position: absolute;
|
|
30
30
|
width: 1px;
|
|
31
31
|
height: 1px;
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
border-width: 0;
|
|
38
38
|
pointer-events: none;
|
|
39
39
|
}
|
|
40
|
-
.rp-checkbox__native:focus-visible + .rp-checkbox__box[data-v-
|
|
40
|
+
.rp-checkbox__native:focus-visible + .rp-checkbox__box[data-v-cc3e1126] {
|
|
41
41
|
border-color: var(--rp-color-control-border-focus);
|
|
42
42
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--rp-color-focus-ring);
|
|
43
43
|
}
|
|
44
|
-
.rp-checkbox__box[data-v-
|
|
44
|
+
.rp-checkbox__box[data-v-cc3e1126] {
|
|
45
45
|
display: inline-flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
justify-content: center;
|
|
@@ -53,90 +53,90 @@
|
|
|
53
53
|
background-color: var(--rp-color-control-bg);
|
|
54
54
|
transition: background-color var(--rp-transition-fast), border-color var(--rp-transition-fast);
|
|
55
55
|
}
|
|
56
|
-
.rp-checkbox--checked .rp-checkbox__box[data-v-
|
|
56
|
+
.rp-checkbox--checked .rp-checkbox__box[data-v-cc3e1126], .rp-checkbox--indeterminate .rp-checkbox__box[data-v-cc3e1126] {
|
|
57
57
|
background-color: var(--_rp-checkbox-checked-bg);
|
|
58
58
|
border-color: var(--_rp-checkbox-checked-border);
|
|
59
59
|
}
|
|
60
|
-
.rp-checkbox--invalid .rp-checkbox__box[data-v-
|
|
60
|
+
.rp-checkbox--invalid .rp-checkbox__box[data-v-cc3e1126] {
|
|
61
61
|
border-color: var(--_rp-checkbox-invalid-border);
|
|
62
62
|
}
|
|
63
|
-
.rp-checkbox--invalid .rp-checkbox__native:focus-visible + .rp-checkbox__box[data-v-
|
|
63
|
+
.rp-checkbox--invalid .rp-checkbox__native:focus-visible + .rp-checkbox__box[data-v-cc3e1126] {
|
|
64
64
|
border-color: var(--_rp-checkbox-invalid-border);
|
|
65
65
|
box-shadow: 0 0 0 var(--rp-border-width-medium) var(--_rp-checkbox-invalid-ring);
|
|
66
66
|
}
|
|
67
|
-
.rp-checkbox__icon[data-v-
|
|
67
|
+
.rp-checkbox__icon[data-v-cc3e1126] {
|
|
68
68
|
width: 60%;
|
|
69
69
|
height: 60%;
|
|
70
70
|
color: var(--_rp-checkbox-checked-icon);
|
|
71
71
|
transform-origin: center;
|
|
72
72
|
}
|
|
73
|
-
.rp-checkbox__icon[data-v-
|
|
73
|
+
.rp-checkbox__icon[data-v-cc3e1126] [stroke-width] {
|
|
74
74
|
stroke-width: 3;
|
|
75
75
|
}
|
|
76
|
-
.rp-checkbox__label[data-v-
|
|
76
|
+
.rp-checkbox__label[data-v-cc3e1126] {
|
|
77
77
|
line-height: var(--rp-line-height-md);
|
|
78
78
|
color: var(--rp-color-text);
|
|
79
79
|
}
|
|
80
|
-
.rp-checkbox--outline[data-v-
|
|
80
|
+
.rp-checkbox--outline[data-v-cc3e1126] {
|
|
81
81
|
--_rp-checkbox-checked-bg: var(--rp-color-control-bg);
|
|
82
82
|
--_rp-checkbox-checked-border: var(--_rp-checkbox-color);
|
|
83
83
|
--_rp-checkbox-checked-icon: var(--_rp-checkbox-color);
|
|
84
84
|
}
|
|
85
|
-
.rp-checkbox--size-xs[data-v-
|
|
85
|
+
.rp-checkbox--size-xs[data-v-cc3e1126] {
|
|
86
86
|
--_rp-checkbox-size: 16px;
|
|
87
87
|
--_rp-checkbox-font-size: var(--rp-font-size-xs);
|
|
88
88
|
}
|
|
89
|
-
.rp-checkbox--size-sm[data-v-
|
|
89
|
+
.rp-checkbox--size-sm[data-v-cc3e1126] {
|
|
90
90
|
--_rp-checkbox-size: 20px;
|
|
91
91
|
--_rp-checkbox-font-size: var(--rp-font-size-sm);
|
|
92
92
|
}
|
|
93
|
-
.rp-checkbox--size-md[data-v-
|
|
93
|
+
.rp-checkbox--size-md[data-v-cc3e1126] {
|
|
94
94
|
--_rp-checkbox-size: 24px;
|
|
95
95
|
--_rp-checkbox-font-size: var(--rp-font-size-md);
|
|
96
96
|
}
|
|
97
|
-
.rp-checkbox--size-lg[data-v-
|
|
97
|
+
.rp-checkbox--size-lg[data-v-cc3e1126] {
|
|
98
98
|
--_rp-checkbox-size: 30px;
|
|
99
99
|
--_rp-checkbox-font-size: var(--rp-font-size-lg);
|
|
100
100
|
}
|
|
101
|
-
.rp-checkbox--size-xl[data-v-
|
|
101
|
+
.rp-checkbox--size-xl[data-v-cc3e1126] {
|
|
102
102
|
--_rp-checkbox-size: 36px;
|
|
103
103
|
--_rp-checkbox-font-size: var(--rp-font-size-xl);
|
|
104
104
|
}
|
|
105
|
-
.rp-checkbox--radius-xs[data-v-
|
|
105
|
+
.rp-checkbox--radius-xs[data-v-cc3e1126] {
|
|
106
106
|
--_rp-checkbox-radius: 2px;
|
|
107
107
|
}
|
|
108
|
-
.rp-checkbox--radius-sm[data-v-
|
|
108
|
+
.rp-checkbox--radius-sm[data-v-cc3e1126] {
|
|
109
109
|
--_rp-checkbox-radius: 4px;
|
|
110
110
|
}
|
|
111
|
-
.rp-checkbox--radius-md[data-v-
|
|
111
|
+
.rp-checkbox--radius-md[data-v-cc3e1126] {
|
|
112
112
|
--_rp-checkbox-radius: 6px;
|
|
113
113
|
}
|
|
114
|
-
.rp-checkbox--radius-lg[data-v-
|
|
114
|
+
.rp-checkbox--radius-lg[data-v-cc3e1126] {
|
|
115
115
|
--_rp-checkbox-radius: 8px;
|
|
116
116
|
}
|
|
117
|
-
.rp-checkbox--radius-xl[data-v-
|
|
117
|
+
.rp-checkbox--radius-xl[data-v-cc3e1126] {
|
|
118
118
|
--_rp-checkbox-radius: var(--rp-radius-full);
|
|
119
119
|
}
|
|
120
|
-
.rp-checkbox-icon-enter-active[data-v-
|
|
121
|
-
.rp-checkbox-icon-leave-active[data-v-
|
|
120
|
+
.rp-checkbox-icon-enter-active[data-v-cc3e1126],
|
|
121
|
+
.rp-checkbox-icon-leave-active[data-v-cc3e1126] {
|
|
122
122
|
transition: opacity var(--rp-transition-base), transform var(--rp-transition-base);
|
|
123
123
|
}
|
|
124
|
-
.rp-checkbox-icon-enter-from[data-v-
|
|
125
|
-
.rp-checkbox-icon-leave-to[data-v-
|
|
124
|
+
.rp-checkbox-icon-enter-from[data-v-cc3e1126],
|
|
125
|
+
.rp-checkbox-icon-leave-to[data-v-cc3e1126] {
|
|
126
126
|
opacity: 0;
|
|
127
127
|
transform: translateY(3px) scale(0.85);
|
|
128
128
|
}
|
|
129
|
-
.rp-checkbox-icon-enter-to[data-v-
|
|
130
|
-
.rp-checkbox-icon-leave-from[data-v-
|
|
129
|
+
.rp-checkbox-icon-enter-to[data-v-cc3e1126],
|
|
130
|
+
.rp-checkbox-icon-leave-from[data-v-cc3e1126] {
|
|
131
131
|
opacity: 1;
|
|
132
132
|
transform: translateY(0) scale(1);
|
|
133
133
|
}
|
|
134
|
-
.rp-checkbox-icon-leave-to[data-v-
|
|
134
|
+
.rp-checkbox-icon-leave-to[data-v-cc3e1126] {
|
|
135
135
|
transform: translateY(-3px) scale(0.85);
|
|
136
136
|
}
|
|
137
137
|
@media (prefers-reduced-motion: reduce) {
|
|
138
|
-
.rp-checkbox-icon-enter-active[data-v-
|
|
139
|
-
.rp-checkbox-icon-leave-active[data-v-
|
|
138
|
+
.rp-checkbox-icon-enter-active[data-v-cc3e1126],
|
|
139
|
+
.rp-checkbox-icon-leave-active[data-v-cc3e1126] {
|
|
140
140
|
transition: none;
|
|
141
141
|
}
|
|
142
142
|
}
|
package/dist/checkbox.js
CHANGED
|
@@ -5,6 +5,7 @@ import { n as getComponentColorValue, r as getComponentContrastColor } from "./c
|
|
|
5
5
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
6
6
|
import { t as check_default } from "./check.js";
|
|
7
7
|
import { t as minus_default } from "./minus.js";
|
|
8
|
+
import { o as useControllableValue, r as useCheckedFormControl } from "./useFormControl.js";
|
|
8
9
|
import { t as useControlState } from "./useControlState.js";
|
|
9
10
|
import { VaporTransition, child, computed, createComponent, createIf, createSlot, defineVaporComponent, extend, next, ref, renderEffect, setBlockKey, setDynamicProps, setInsertionState, setStaticTemplateRef, template, unref } from "vue";
|
|
10
11
|
//#region src/components/checkbox/useCheckbox.ts
|
|
@@ -17,11 +18,11 @@ function getCheckboxColorStyle(color, autoContrast) {
|
|
|
17
18
|
if (autoContrast) style["--_rp-checkbox-on-color"] = getComponentContrastColor(color ?? "primary", { autoContrast });
|
|
18
19
|
return style;
|
|
19
20
|
}
|
|
20
|
-
function useCheckbox(props, emitUpdate) {
|
|
21
|
+
function useCheckbox(props, emitUpdate, getValue = () => props.modelValue ?? false) {
|
|
21
22
|
const inputRef = ref(null);
|
|
22
23
|
const control = useControlState(props);
|
|
23
24
|
const rootClass = computed(() => bem("rp-checkbox", {
|
|
24
|
-
checked:
|
|
25
|
+
checked: getValue(),
|
|
25
26
|
indeterminate: props.indeterminate,
|
|
26
27
|
disabled: control.disabled,
|
|
27
28
|
invalid: control.invalid,
|
|
@@ -47,8 +48,8 @@ function useCheckbox(props, emitUpdate) {
|
|
|
47
48
|
}
|
|
48
49
|
//#endregion
|
|
49
50
|
//#region src/components/checkbox/checkbox.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
50
|
-
var t0 = template("<span data-v-
|
|
51
|
-
var t1 = template("<label data-v-
|
|
51
|
+
var t0 = template("<span data-v-cc3e1126>");
|
|
52
|
+
var t1 = template("<label data-v-cc3e1126><input data-v-cc3e1126><span data-v-cc3e1126></span>", 1);
|
|
52
53
|
//#endregion
|
|
53
54
|
//#region src/components/checkbox/checkbox.vue
|
|
54
55
|
var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -58,7 +59,16 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
58
59
|
props: {
|
|
59
60
|
id: {},
|
|
60
61
|
name: {},
|
|
61
|
-
|
|
62
|
+
form: {},
|
|
63
|
+
modelValue: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: void 0
|
|
66
|
+
},
|
|
67
|
+
defaultValue: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
},
|
|
71
|
+
value: { default: "on" },
|
|
62
72
|
variant: {},
|
|
63
73
|
color: {},
|
|
64
74
|
autoContrast: { type: Boolean },
|
|
@@ -84,6 +94,7 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
84
94
|
default: false
|
|
85
95
|
},
|
|
86
96
|
inputAttrs: {},
|
|
97
|
+
validationMessage: {},
|
|
87
98
|
classNames: {},
|
|
88
99
|
styles: {}
|
|
89
100
|
},
|
|
@@ -91,10 +102,14 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
91
102
|
setup(__props, { expose: __expose, emit: __emit, slots: $slots }) {
|
|
92
103
|
const props = __props;
|
|
93
104
|
const emit = __emit;
|
|
94
|
-
const
|
|
95
|
-
|
|
105
|
+
const controllable = useControllableValue({
|
|
106
|
+
modelValue: () => props.modelValue,
|
|
107
|
+
defaultValue: () => props.defaultValue,
|
|
108
|
+
onChange: (value) => emit("update:modelValue", value)
|
|
96
109
|
});
|
|
97
|
-
const
|
|
110
|
+
const { inputRef, control, rootClass, rootStyle, onChange, focus } = useCheckbox(props, (value) => controllable.setValue(value), () => controllable.value.value);
|
|
111
|
+
const state = computed(() => props.indeterminate ? "indeterminate" : controllable.value.value ? "checked" : "unchecked");
|
|
112
|
+
useCheckedFormControl(() => inputRef.value, controllable, () => props.validationMessage);
|
|
98
113
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
99
114
|
const rootAttrs = computed(() => getRootAttrs({
|
|
100
115
|
class: rootClass.value,
|
|
@@ -127,20 +142,24 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
127
142
|
const n8 = next(n0, 1);
|
|
128
143
|
setStaticTemplateRef(n0, inputRef, null, "inputRef");
|
|
129
144
|
renderEffect(() => {
|
|
145
|
+
const _nativeInputAttrs = nativeInputAttrs.value;
|
|
130
146
|
const _control = unref(control);
|
|
131
|
-
const
|
|
147
|
+
const _controllable = unref(controllable);
|
|
132
148
|
const _indeterminate = __props.indeterminate;
|
|
149
|
+
const _controllable_value = _controllable.value;
|
|
133
150
|
const _control_required = _control.required;
|
|
134
151
|
setDynamicProps(n13, [rootAttrs.value]);
|
|
135
|
-
setDynamicProps(n0, [
|
|
152
|
+
setDynamicProps(n0, [_nativeInputAttrs, {
|
|
136
153
|
id: _control.id,
|
|
137
154
|
name: __props.name,
|
|
155
|
+
form: _control.form ?? _nativeInputAttrs.form,
|
|
138
156
|
type: "checkbox",
|
|
139
|
-
|
|
157
|
+
value: __props.value,
|
|
158
|
+
checked: _controllable_value.value,
|
|
140
159
|
disabled: _control.disabled || void 0,
|
|
141
160
|
required: _control_required || void 0,
|
|
142
161
|
indeterminate: _indeterminate,
|
|
143
|
-
"aria-checked": _indeterminate ? "mixed" :
|
|
162
|
+
"aria-checked": _indeterminate ? "mixed" : _controllable_value.value,
|
|
144
163
|
"aria-label": __props.ariaLabel || void 0,
|
|
145
164
|
"aria-labelledby": _control.ariaLabelledby,
|
|
146
165
|
"aria-describedby": _control.ariaDescribedby,
|
|
@@ -161,7 +180,7 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
161
180
|
const n3 = createComponent(unref(minus_default), { class: "rp-checkbox__icon" });
|
|
162
181
|
setBlockKey(n3, "minus");
|
|
163
182
|
return n3;
|
|
164
|
-
}, () => createIf(() =>
|
|
183
|
+
}, () => createIf(() => unref(controllable).value.value, () => {
|
|
165
184
|
const n5 = createComponent(unref(check_default), { class: "rp-checkbox__icon" });
|
|
166
185
|
setBlockKey(n5, "check");
|
|
167
186
|
return n5;
|
|
@@ -177,7 +196,7 @@ var checkbox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PUR
|
|
|
177
196
|
});
|
|
178
197
|
return n13;
|
|
179
198
|
}
|
|
180
|
-
}), [["__scopeId", "data-v-
|
|
199
|
+
}), [["__scopeId", "data-v-cc3e1126"]]);
|
|
181
200
|
//#endregion
|
|
182
201
|
//#region src/components/checkbox/types.ts
|
|
183
202
|
var checkboxParts = [
|
package/dist/color-input.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@layer ropav.components {
|
|
2
|
-
.rp-color-input[data-v-
|
|
2
|
+
.rp-color-input[data-v-0c4e1f32] {
|
|
3
3
|
--_rp-color-input-height: var(--rp-size-control-md);
|
|
4
4
|
--_rp-color-input-preview-size: calc(var(--_rp-color-input-height) / 2);
|
|
5
5
|
--_rp-color-input-preview-inset: calc(
|
|
@@ -18,42 +18,42 @@
|
|
|
18
18
|
font-family: var(--rp-font-family);
|
|
19
19
|
vertical-align: middle;
|
|
20
20
|
}
|
|
21
|
-
.rp-color-input--size-xs[data-v-
|
|
21
|
+
.rp-color-input--size-xs[data-v-0c4e1f32] {
|
|
22
22
|
--_rp-color-input-height: var(--rp-size-control-xs);
|
|
23
23
|
}
|
|
24
|
-
.rp-color-input--size-sm[data-v-
|
|
24
|
+
.rp-color-input--size-sm[data-v-0c4e1f32] {
|
|
25
25
|
--_rp-color-input-height: var(--rp-size-control-sm);
|
|
26
26
|
}
|
|
27
|
-
.rp-color-input--size-md[data-v-
|
|
27
|
+
.rp-color-input--size-md[data-v-0c4e1f32] {
|
|
28
28
|
--_rp-color-input-height: var(--rp-size-control-md);
|
|
29
29
|
}
|
|
30
|
-
.rp-color-input--size-lg[data-v-
|
|
30
|
+
.rp-color-input--size-lg[data-v-0c4e1f32] {
|
|
31
31
|
--_rp-color-input-height: var(--rp-size-control-lg);
|
|
32
32
|
}
|
|
33
|
-
.rp-color-input--size-xl[data-v-
|
|
33
|
+
.rp-color-input--size-xl[data-v-0c4e1f32] {
|
|
34
34
|
--_rp-color-input-height: var(--rp-size-control-xl);
|
|
35
35
|
}
|
|
36
|
-
html.dark .rp-color-input[data-v-
|
|
36
|
+
html.dark .rp-color-input[data-v-0c4e1f32], [data-rp-color-scheme=dark] .rp-color-input[data-v-0c4e1f32] {
|
|
37
37
|
--_rp-color-input-empty-tile: var(--rp-color-dark-6);
|
|
38
38
|
--_rp-color-input-empty-tile-alt: var(--rp-color-dark-4);
|
|
39
39
|
}
|
|
40
|
-
.rp-color-input[data-v-
|
|
40
|
+
.rp-color-input[data-v-0c4e1f32] .rp-input {
|
|
41
41
|
width: 100%;
|
|
42
42
|
min-width: 180px;
|
|
43
43
|
padding-inline-start: calc(var(--_rp-color-input-preview-inset) - var(--rp-border-width-thin));
|
|
44
44
|
}
|
|
45
|
-
.rp-color-input[data-v-
|
|
45
|
+
.rp-color-input[data-v-0c4e1f32] .rp-popover__content {
|
|
46
46
|
min-width: auto;
|
|
47
47
|
padding: var(--rp-spacing-3);
|
|
48
48
|
padding-inline: calc(var(--_rp-color-input-preview-inset) - var(--rp-border-width-thin));
|
|
49
49
|
}
|
|
50
|
-
.rp-color-input[data-v-
|
|
50
|
+
.rp-color-input[data-v-0c4e1f32] .rp-color-picker {
|
|
51
51
|
--_rp-color-picker-size: min(
|
|
52
52
|
var(--_rp-color-picker-saturation-width),
|
|
53
53
|
calc(100vw - var(--rp-spacing-12))
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
.rp-color-input__preview[data-v-
|
|
56
|
+
.rp-color-input__preview[data-v-0c4e1f32] {
|
|
57
57
|
--_rp-color-swatch-radius: 50%;
|
|
58
58
|
width: var(--_rp-color-input-preview-size);
|
|
59
59
|
height: var(--_rp-color-input-preview-size);
|
|
@@ -61,14 +61,14 @@ html.dark .rp-color-input[data-v-cf9bd64a], [data-rp-color-scheme=dark] .rp-colo
|
|
|
61
61
|
border-radius: 50%;
|
|
62
62
|
pointer-events: none;
|
|
63
63
|
}
|
|
64
|
-
.rp-color-input__preview--empty[data-v-
|
|
64
|
+
.rp-color-input__preview--empty[data-v-0c4e1f32] {
|
|
65
65
|
box-sizing: border-box;
|
|
66
66
|
display: inline-flex;
|
|
67
67
|
background: var(--_rp-color-input-empty-grid);
|
|
68
68
|
background-size: calc(var(--_rp-color-input-preview-size) / 2) calc(var(--_rp-color-input-preview-size) / 2);
|
|
69
69
|
border: var(--rp-border-width-thin) dashed var(--rp-color-control-border);
|
|
70
70
|
}
|
|
71
|
-
.rp-color-input__eye-dropper[data-v-
|
|
71
|
+
.rp-color-input__eye-dropper[data-v-0c4e1f32] {
|
|
72
72
|
padding: 0;
|
|
73
73
|
font: inherit;
|
|
74
74
|
background: none;
|
|
@@ -81,29 +81,29 @@ html.dark .rp-color-input[data-v-cf9bd64a], [data-rp-color-scheme=dark] .rp-colo
|
|
|
81
81
|
color: var(--rp-color-control-icon);
|
|
82
82
|
transition: color var(--rp-transition-fast), opacity var(--rp-transition-fast);
|
|
83
83
|
}
|
|
84
|
-
.rp-color-input__eye-dropper[data-v-
|
|
84
|
+
.rp-color-input__eye-dropper[data-v-0c4e1f32]:hover:not(:disabled) {
|
|
85
85
|
color: var(--rp-color-control-fg);
|
|
86
86
|
}
|
|
87
|
-
.rp-color-input__eye-dropper[data-v-
|
|
87
|
+
.rp-color-input__eye-dropper[data-v-0c4e1f32]:focus-visible {
|
|
88
88
|
outline: var(--rp-border-width-medium) solid var(--rp-color-focus-ring);
|
|
89
89
|
outline-offset: 2px;
|
|
90
90
|
}
|
|
91
|
-
.rp-color-input__eye-dropper[data-v-
|
|
91
|
+
.rp-color-input__eye-dropper[data-v-0c4e1f32]:disabled {
|
|
92
92
|
cursor: not-allowed;
|
|
93
93
|
opacity: var(--rp-opacity-disabled);
|
|
94
94
|
}
|
|
95
|
-
.rp-color-input__eye-dropper-icon[data-v-
|
|
95
|
+
.rp-color-input__eye-dropper-icon[data-v-0c4e1f32] {
|
|
96
96
|
display: inline-flex;
|
|
97
97
|
align-items: center;
|
|
98
98
|
width: 1em;
|
|
99
99
|
height: 1em;
|
|
100
100
|
flex-shrink: 0;
|
|
101
101
|
}
|
|
102
|
-
.rp-color-input__eye-dropper-icon svg[data-v-
|
|
102
|
+
.rp-color-input__eye-dropper-icon svg[data-v-0c4e1f32] {
|
|
103
103
|
width: 100%;
|
|
104
104
|
height: 100%;
|
|
105
105
|
}
|
|
106
|
-
.rp-color-input__eye-dropper-icon[data-v-
|
|
106
|
+
.rp-color-input__eye-dropper-icon[data-v-0c4e1f32] > svg {
|
|
107
107
|
width: 100%;
|
|
108
108
|
height: 100%;
|
|
109
109
|
}
|
package/dist/color-input.js
CHANGED
|
@@ -2,12 +2,13 @@ import './color-input.css';
|
|
|
2
2
|
import { t as bem } from "./bem.js";
|
|
3
3
|
import { n as useStylesApi, t as presence } from "./styles-api.js";
|
|
4
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";
|
|
5
6
|
import { t as useControlState } from "./useControlState.js";
|
|
6
7
|
import { t as color_swatch_default } from "./color-swatch.js";
|
|
7
8
|
import { n as formatColorPickerValue, r as parseColorPickerValue, t as color_picker_default } from "./color-picker.js";
|
|
8
9
|
import { t as input_default } from "./input.js";
|
|
9
10
|
import { t as popover_default } from "./popover.js";
|
|
10
|
-
import { child, computed, createComponent, createIf, createSlot, defineVaporComponent, extend, markRaw, nextTick, on, onMounted, ref, renderEffect, setDynamicProps, setInsertionState, shallowRef, template, unref, withModifiers } from "vue";
|
|
11
|
+
import { child, computed, createComponent, createIf, createSlot, createTemplateRefSetter, defineVaporComponent, extend, markRaw, nextTick, on, onMounted, ref, renderEffect, setDynamicProps, setInsertionState, shallowRef, template, unref, withModifiers } from "vue";
|
|
11
12
|
//#region ~icons/lucide/crosshair
|
|
12
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);
|
|
13
14
|
function render(_ctx) {
|
|
@@ -121,11 +122,12 @@ function useColorInputPopover(getInputAttrs) {
|
|
|
121
122
|
}
|
|
122
123
|
//#endregion
|
|
123
124
|
//#region src/components/color-input/useColorInputValue.ts
|
|
124
|
-
function useColorInputValue(props, isControlInvalid) {
|
|
125
|
-
const
|
|
126
|
-
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);
|
|
127
129
|
const hasValidSwatches = computed(() => Boolean(props.swatches?.some((swatch) => parseColorPickerValue(swatch))));
|
|
128
|
-
const hasInvalidColor = computed(() => props.validateColor &&
|
|
130
|
+
const hasInvalidColor = computed(() => props.validateColor && currentValue.value.trim().length > 0 && !parsedColor.value);
|
|
129
131
|
return {
|
|
130
132
|
previewColor,
|
|
131
133
|
hasValidSwatches,
|
|
@@ -136,9 +138,9 @@ function useColorInputValue(props, isControlInvalid) {
|
|
|
136
138
|
}
|
|
137
139
|
//#endregion
|
|
138
140
|
//#region src/components/color-input/useColorInput.ts
|
|
139
|
-
function useColorInput(props, emit) {
|
|
141
|
+
function useColorInput(props, emit, getValue = () => props.modelValue ?? "") {
|
|
140
142
|
const control = useControlState(props);
|
|
141
|
-
const value = useColorInputValue(props, () => control.invalid);
|
|
143
|
+
const value = useColorInputValue(props, () => control.invalid, getValue);
|
|
142
144
|
const popover = useColorInputPopover(() => props.inputAttrs);
|
|
143
145
|
const popoverDisabled = computed(() => control.disabled || Boolean(props.readonly) || Boolean(props.swatchesOnly) && !value.hasValidSwatches.value);
|
|
144
146
|
const eyeDropper = useColorInputEyeDropper({
|
|
@@ -180,8 +182,8 @@ function useColorInput(props, emit) {
|
|
|
180
182
|
}
|
|
181
183
|
//#endregion
|
|
182
184
|
//#region src/components/color-input/color-input.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
183
|
-
var t0 = template("<span data-v-
|
|
184
|
-
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>");
|
|
185
187
|
//#endregion
|
|
186
188
|
//#region src/components/color-input/color-input.vue
|
|
187
189
|
var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineVaporComponent({
|
|
@@ -191,7 +193,9 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
191
193
|
props: {
|
|
192
194
|
id: {},
|
|
193
195
|
name: {},
|
|
194
|
-
|
|
196
|
+
form: {},
|
|
197
|
+
modelValue: { default: void 0 },
|
|
198
|
+
defaultValue: { default: "" },
|
|
195
199
|
format: { default: "hex" },
|
|
196
200
|
size: {},
|
|
197
201
|
radius: {},
|
|
@@ -228,6 +232,7 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
228
232
|
describedby: {},
|
|
229
233
|
labelledby: {},
|
|
230
234
|
inputAttrs: {},
|
|
235
|
+
validationMessage: {},
|
|
231
236
|
validateColor: {
|
|
232
237
|
type: Boolean,
|
|
233
238
|
default: false
|
|
@@ -258,10 +263,19 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
258
263
|
setup(__props, { emit: __emit }) {
|
|
259
264
|
const props = __props;
|
|
260
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();
|
|
261
273
|
const { control, rootClass, previewColor, isInvalid, colorValidationMessage, popoverDisabled, getInputTriggerAttrs, rememberClose, onPickerKeydown, onFocusOut, showEyeDropper, isPickingColor, pickScreenColor, onInputUpdate, onPickerUpdate, onOpenUpdate } = useColorInput(props, {
|
|
262
|
-
modelValue: (value) =>
|
|
274
|
+
modelValue: (value) => controllable.setValue(value),
|
|
263
275
|
open: (value) => emit("update:open", value)
|
|
264
|
-
});
|
|
276
|
+
}, () => controllable.value.value);
|
|
277
|
+
const effectiveValidationMessage = computed(() => props.validationMessage !== void 0 ? props.validationMessage : colorValidationMessage.value);
|
|
278
|
+
useTextFormControl(() => inputComponentRef.value?.nativeElement, controllable, () => effectiveValidationMessage.value);
|
|
265
279
|
const { getPartAttrs, getRootAttrs } = useStylesApi(props, "root");
|
|
266
280
|
const rootAttrs = computed(() => getRootAttrs({
|
|
267
281
|
"data-disabled": presence(control.disabled),
|
|
@@ -298,6 +312,7 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
298
312
|
swatches: props.styles?.pickerSwatches,
|
|
299
313
|
swatch: props.styles?.pickerSwatch
|
|
300
314
|
}));
|
|
315
|
+
const _setTemplateRef = createTemplateRefSetter();
|
|
301
316
|
return createComponent(popover_default, { $: [() => rootAttrs.value, {
|
|
302
317
|
id: () => __props.popoverId,
|
|
303
318
|
"class-names": () => popoverClassNames.value,
|
|
@@ -311,10 +326,11 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
311
326
|
"onUpdate:open": () => unref(onOpenUpdate)
|
|
312
327
|
}] }, {
|
|
313
328
|
"default": (slotProps) => {
|
|
314
|
-
|
|
329
|
+
const n15 = createComponent(input_default, {
|
|
315
330
|
id: () => unref(control).id,
|
|
316
331
|
name: () => __props.name,
|
|
317
|
-
|
|
332
|
+
form: () => unref(control).form,
|
|
333
|
+
"model-value": () => unref(controllable).value.value,
|
|
318
334
|
type: "text",
|
|
319
335
|
size: () => __props.size,
|
|
320
336
|
radius: () => __props.radius,
|
|
@@ -330,7 +346,7 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
330
346
|
"input-attrs": () => unref(getInputTriggerAttrs)(slotProps),
|
|
331
347
|
"class-names": () => inputClassNames.value,
|
|
332
348
|
styles: () => inputStyles.value,
|
|
333
|
-
"validation-message": () =>
|
|
349
|
+
"validation-message": () => effectiveValidationMessage.value,
|
|
334
350
|
"onUpdate:modelValue": () => unref(onInputUpdate)
|
|
335
351
|
}, {
|
|
336
352
|
"left": extend(() => {
|
|
@@ -376,12 +392,14 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
376
392
|
}
|
|
377
393
|
} : void 0]
|
|
378
394
|
});
|
|
395
|
+
_setTemplateRef(n15, inputComponentRef, null, "inputComponentRef");
|
|
396
|
+
return n15;
|
|
379
397
|
},
|
|
380
398
|
"content": (slotProps) => {
|
|
381
399
|
const _on_focusin = () => unref(rememberClose)(slotProps);
|
|
382
400
|
const _on_keydown = ($event) => unref(onPickerKeydown)($event, slotProps);
|
|
383
401
|
return createComponent(color_picker_default, {
|
|
384
|
-
"model-value": () =>
|
|
402
|
+
"model-value": () => unref(controllable).value.value,
|
|
385
403
|
format: () => __props.format,
|
|
386
404
|
size: () => __props.size,
|
|
387
405
|
readonly: () => __props.readonly,
|
|
@@ -398,7 +416,7 @@ var color_input_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
398
416
|
}
|
|
399
417
|
}, true);
|
|
400
418
|
}
|
|
401
|
-
}), [["__scopeId", "data-v-
|
|
419
|
+
}), [["__scopeId", "data-v-0c4e1f32"]]);
|
|
402
420
|
//#endregion
|
|
403
421
|
//#region src/components/color-input/types.ts
|
|
404
422
|
var colorInputParts = [
|
|
@@ -10,7 +10,10 @@ export type CheckboxVariant = 'solid' | 'outline';
|
|
|
10
10
|
export interface CheckboxProps extends StylesApiProps<CheckboxPart> {
|
|
11
11
|
id?: string;
|
|
12
12
|
name?: string;
|
|
13
|
-
|
|
13
|
+
form?: string;
|
|
14
|
+
modelValue?: boolean;
|
|
15
|
+
defaultValue?: boolean;
|
|
16
|
+
value?: string | number;
|
|
14
17
|
variant?: CheckboxVariant;
|
|
15
18
|
color?: CheckboxColor;
|
|
16
19
|
autoContrast?: boolean;
|
|
@@ -24,4 +27,5 @@ export interface CheckboxProps extends StylesApiProps<CheckboxPart> {
|
|
|
24
27
|
labelledby?: string;
|
|
25
28
|
indeterminate?: boolean;
|
|
26
29
|
inputAttrs?: InputHTMLAttributes;
|
|
30
|
+
validationMessage?: string;
|
|
27
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'vue';
|
|
2
2
|
import { CheckboxProps } from './types.js';
|
|
3
|
-
export declare function useCheckbox(props: Readonly<CheckboxProps>, emitUpdate: (value: boolean) => void): {
|
|
3
|
+
export declare function useCheckbox(props: Readonly<CheckboxProps>, emitUpdate: (value: boolean) => void, getValue?: () => boolean): {
|
|
4
4
|
inputRef: import('vue').Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
5
5
|
control: import('../../composables/useControlState.js').ControlState;
|
|
6
6
|
rootClass: import('vue').ComputedRef<string[]>;
|
|
@@ -8,7 +8,9 @@ export type ColorInputPart = (typeof colorInputParts)[number];
|
|
|
8
8
|
export interface ColorInputProps extends StylesApiProps<ColorInputPart> {
|
|
9
9
|
id?: string;
|
|
10
10
|
name?: string;
|
|
11
|
-
|
|
11
|
+
form?: string;
|
|
12
|
+
modelValue?: ColorPickerValue;
|
|
13
|
+
defaultValue?: ColorPickerValue;
|
|
12
14
|
format?: ColorPickerFormat;
|
|
13
15
|
size?: InputSize;
|
|
14
16
|
radius?: InputRadius;
|
|
@@ -24,6 +26,7 @@ export interface ColorInputProps extends StylesApiProps<ColorInputPart> {
|
|
|
24
26
|
describedby?: string;
|
|
25
27
|
labelledby?: string;
|
|
26
28
|
inputAttrs?: InputHTMLAttributes;
|
|
29
|
+
validationMessage?: string;
|
|
27
30
|
validateColor?: boolean;
|
|
28
31
|
invalidColorMessage?: string;
|
|
29
32
|
swatches?: string[];
|
|
@@ -4,7 +4,7 @@ interface UseColorInputEmitters {
|
|
|
4
4
|
modelValue: (value: ColorPickerValue) => void;
|
|
5
5
|
open: (value: boolean) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function useColorInput(props: Readonly<ColorInputProps>, emit: UseColorInputEmitters): {
|
|
7
|
+
export declare function useColorInput(props: Readonly<ColorInputProps>, emit: UseColorInputEmitters, getValue?: () => string): {
|
|
8
8
|
onInputUpdate: (nextValue: ColorPickerValue) => void;
|
|
9
9
|
onPickerUpdate: (nextValue: ColorPickerValue) => void;
|
|
10
10
|
onOpenUpdate: (open: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColorInputProps } from './types.js';
|
|
2
|
-
export declare function useColorInputValue(props: Readonly<ColorInputProps>, isControlInvalid: () => boolean): {
|
|
2
|
+
export declare function useColorInputValue(props: Readonly<ColorInputProps>, isControlInvalid: () => boolean, getValue?: () => string): {
|
|
3
3
|
previewColor: import('vue').ComputedRef<string | undefined>;
|
|
4
4
|
hasValidSwatches: import('vue').ComputedRef<boolean>;
|
|
5
5
|
hasInvalidColor: import('vue').ComputedRef<boolean | undefined>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DialogCloseProps } from './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<DialogCloseProps> & (typeof globalThis extends {
|
|
4
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
5
|
+
} ? P : {});
|
|
6
|
+
expose: (exposed: {}) => void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
default?: (props: {}) => any;
|
|
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
|
+
}) & {};
|