orio-ui 1.16.2 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/assets/css/variables.css +1 -1
- package/dist/runtime/components/Badge.d.vue.ts +2 -0
- package/dist/runtime/components/Badge.vue +13 -4
- package/dist/runtime/components/Badge.vue.d.ts +2 -0
- package/dist/runtime/components/Button.d.vue.ts +2 -1
- package/dist/runtime/components/Button.vue +11 -5
- package/dist/runtime/components/Button.vue.d.ts +2 -1
- package/dist/runtime/components/CheckBox.d.vue.ts +2 -1
- package/dist/runtime/components/CheckBox.vue +11 -3
- package/dist/runtime/components/CheckBox.vue.d.ts +2 -1
- package/dist/runtime/components/ControlElement.vue +21 -11
- package/dist/runtime/components/Icon.d.vue.ts +0 -1
- package/dist/runtime/components/Icon.vue +7 -14
- package/dist/runtime/components/Icon.vue.d.ts +0 -1
- package/dist/runtime/components/Input.d.vue.ts +2 -2
- package/dist/runtime/components/Input.vue +14 -6
- package/dist/runtime/components/Input.vue.d.ts +2 -2
- package/dist/runtime/components/NavButton.d.vue.ts +2 -1
- package/dist/runtime/components/NavButton.vue +11 -5
- package/dist/runtime/components/NavButton.vue.d.ts +2 -1
- package/dist/runtime/components/NumberInput/Horizontal.d.vue.ts +1 -1
- package/dist/runtime/components/NumberInput/Horizontal.vue +7 -1
- package/dist/runtime/components/NumberInput/Horizontal.vue.d.ts +1 -1
- package/dist/runtime/components/NumberInput/Vertical.d.vue.ts +1 -1
- package/dist/runtime/components/NumberInput/Vertical.vue +7 -1
- package/dist/runtime/components/NumberInput/Vertical.vue.d.ts +1 -1
- package/dist/runtime/components/NumberInput/index.d.vue.ts +3 -2
- package/dist/runtime/components/NumberInput/index.vue +23 -3
- package/dist/runtime/components/NumberInput/index.vue.d.ts +3 -2
- package/dist/runtime/components/Popover.d.vue.ts +22 -51
- package/dist/runtime/components/Popover.vue +37 -65
- package/dist/runtime/components/Popover.vue.d.ts +22 -51
- package/dist/runtime/components/RadioButton.d.vue.ts +3 -2
- package/dist/runtime/components/RadioButton.vue +12 -5
- package/dist/runtime/components/RadioButton.vue.d.ts +3 -2
- package/dist/runtime/components/Selector.d.vue.ts +2 -1
- package/dist/runtime/components/Selector.vue +68 -10
- package/dist/runtime/components/Selector.vue.d.ts +2 -1
- package/dist/runtime/components/SwitchButton.d.vue.ts +2 -1
- package/dist/runtime/components/SwitchButton.vue +10 -2
- package/dist/runtime/components/SwitchButton.vue.d.ts +2 -1
- package/dist/runtime/components/Textarea.d.vue.ts +2 -1
- package/dist/runtime/components/Textarea.vue +10 -7
- package/dist/runtime/components/Textarea.vue.d.ts +2 -1
- package/dist/runtime/components/view/Text.d.vue.ts +1 -1
- package/dist/runtime/components/view/Text.vue.d.ts +1 -1
- package/dist/runtime/composables/useListKeyboard.d.ts +19 -0
- package/dist/runtime/composables/useListKeyboard.js +59 -0
- package/dist/runtime/composables/useValidation.d.ts +3 -3
- package/dist/runtime/composables/useValidation.js +5 -6
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--border-radius-sm:4px;--border-radius-md:8px;--border-radius-lg:12px;--border-radius-pill:9999px;--font-sm:0.75rem;--font-md:0.875rem;--font-lg:1.25rem;--font-xl:1.75rem}
|
|
1
|
+
:root{--border-radius-sm:4px;--border-radius-md:8px;--border-radius-lg:12px;--border-radius-pill:9999px;--font-xs:0.65rem;--font-sm:0.75rem;--font-md:0.875rem;--font-lg:1.25rem;--font-xl:1.75rem}
|
|
@@ -2,6 +2,7 @@ export type BadgeVariant = "danger" | "alert" | "primary" | "grey";
|
|
|
2
2
|
interface Props {
|
|
3
3
|
variant?: BadgeVariant;
|
|
4
4
|
pill?: boolean;
|
|
5
|
+
hidden?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
7
8
|
type __VLS_Slots = {} & {
|
|
@@ -14,6 +15,7 @@ type __VLS_Slots = {} & {
|
|
|
14
15
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
16
|
variant: BadgeVariant;
|
|
16
17
|
pill: boolean;
|
|
18
|
+
hidden: boolean;
|
|
17
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { useSlots, computed } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
variant: { type: String, required: false, default: "primary" },
|
|
5
|
-
pill: { type: Boolean, required: false, default: false }
|
|
5
|
+
pill: { type: Boolean, required: false, default: false },
|
|
6
|
+
hidden: { type: Boolean, required: false, default: false }
|
|
6
7
|
});
|
|
7
8
|
const slots = useSlots();
|
|
8
9
|
const hasWrapping = computed(() => !!slots.wrapping);
|
|
@@ -13,15 +14,23 @@ const isDot = computed(() => !hasDefaultContent.value);
|
|
|
13
14
|
<template>
|
|
14
15
|
<div v-if="hasWrapping" class="badge-wrapper">
|
|
15
16
|
<slot name="wrapping" />
|
|
16
|
-
<span
|
|
17
|
+
<span
|
|
18
|
+
v-if="!hidden"
|
|
19
|
+
class="badge positioned"
|
|
20
|
+
:class="[variant, { pill, dot: isDot }]"
|
|
21
|
+
>
|
|
17
22
|
<slot />
|
|
18
23
|
</span>
|
|
19
24
|
</div>
|
|
20
|
-
<span
|
|
25
|
+
<span
|
|
26
|
+
v-else-if="!hidden"
|
|
27
|
+
class="badge"
|
|
28
|
+
:class="[variant, { pill, dot: isDot }]"
|
|
29
|
+
>
|
|
21
30
|
<slot />
|
|
22
31
|
</span>
|
|
23
32
|
</template>
|
|
24
33
|
|
|
25
34
|
<style scoped>
|
|
26
|
-
.badge-wrapper{display:inline-flex;position:relative}.badge{align-items:center;border:1px solid transparent;border-radius:var(--border-radius-sm);display:inline-flex;font-size:var(--font-sm);font-weight:600;justify-content:center;padding:.125rem .35rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.badge.positioned{position:absolute;right
|
|
35
|
+
.badge-wrapper{display:inline-flex;position:relative}.badge{align-items:center;border:1px solid transparent;border-radius:var(--border-radius-sm);display:inline-flex;font-size:var(--font-sm);font-weight:600;justify-content:center;padding:.125rem .35rem;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.badge.positioned{position:absolute;right:15%;top:15%;transform:translate(50%,-50%)}.badge.pill{border-radius:var(--border-radius-pill)}.badge.dot{border-radius:50%;height:.5rem;min-height:.5rem;min-width:.5rem;padding:0;width:.5rem}.badge.primary{background-color:var(--color-accent);border-color:var(--color-accent);color:var(--color-accent-ink)}.badge.danger{background-color:var(--color-danger);border-color:var(--color-danger);color:var(--color-danger-ink)}.badge.alert{background-color:var(--color-alert);border-color:var(--color-alert);color:var(--color-alert-ink)}.badge.grey{background-color:var(--color-surface);border-color:var(--color-border);color:var(--color-muted)}
|
|
27
36
|
</style>
|
|
@@ -2,6 +2,7 @@ export type BadgeVariant = "danger" | "alert" | "primary" | "grey";
|
|
|
2
2
|
interface Props {
|
|
3
3
|
variant?: BadgeVariant;
|
|
4
4
|
pill?: boolean;
|
|
5
|
+
hidden?: boolean;
|
|
5
6
|
}
|
|
6
7
|
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
7
8
|
type __VLS_Slots = {} & {
|
|
@@ -14,6 +15,7 @@ type __VLS_Slots = {} & {
|
|
|
14
15
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
16
|
variant: BadgeVariant;
|
|
16
17
|
pill: boolean;
|
|
18
|
+
hidden: boolean;
|
|
17
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
20
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
21
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, toRefs,
|
|
2
|
+
import { computed, toRefs, useSlots } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
variant: { type: String, required: false, default: "primary" },
|
|
5
5
|
icon: { type: String, required: false },
|
|
6
6
|
loading: { type: Boolean, required: false },
|
|
7
|
-
disabled: { type: Boolean, required: false }
|
|
7
|
+
disabled: { type: Boolean, required: false },
|
|
8
|
+
appearance: { type: String, required: false },
|
|
9
|
+
error: { type: [String, null], required: false },
|
|
10
|
+
group: { type: Boolean, required: false },
|
|
11
|
+
id: { type: String, required: false },
|
|
12
|
+
label: { type: String, required: false },
|
|
13
|
+
layout: { type: String, required: false },
|
|
14
|
+
size: { type: String, required: false }
|
|
8
15
|
});
|
|
9
16
|
const { loading, disabled } = toRefs(props);
|
|
10
|
-
const attrs = useAttrs();
|
|
11
17
|
const slots = useSlots();
|
|
12
18
|
const isIconOnly = computed(() => {
|
|
13
19
|
const hasIcon = !!props.icon || !!slots.icon;
|
|
@@ -32,9 +38,9 @@ function onMouseleave(event) {
|
|
|
32
38
|
</script>
|
|
33
39
|
|
|
34
40
|
<template>
|
|
35
|
-
<orio-control-element>
|
|
41
|
+
<orio-control-element v-bind="props">
|
|
36
42
|
<button
|
|
37
|
-
v-bind="attrs"
|
|
43
|
+
v-bind="$attrs"
|
|
38
44
|
:class="[variant, 'gradient-hover', { 'icon-only': isIconOnly }]"
|
|
39
45
|
:disabled
|
|
40
46
|
@click="click"
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
const modelValue = defineModel({ type: Boolean, ...{ required: false } });
|
|
3
|
-
defineProps({
|
|
3
|
+
const props = defineProps({
|
|
4
4
|
checkedIcon: { type: String, required: false },
|
|
5
|
-
uncheckedIcon: { type: String, required: false }
|
|
5
|
+
uncheckedIcon: { type: String, required: false },
|
|
6
|
+
appearance: { type: String, required: false },
|
|
7
|
+
error: { type: [String, null], required: false },
|
|
8
|
+
group: { type: Boolean, required: false },
|
|
9
|
+
id: { type: String, required: false },
|
|
10
|
+
label: { type: String, required: false },
|
|
11
|
+
layout: { type: String, required: false },
|
|
12
|
+
size: { type: String, required: false }
|
|
6
13
|
});
|
|
7
14
|
</script>
|
|
8
15
|
|
|
9
16
|
<template>
|
|
10
|
-
<orio-control-element class="checkbox">
|
|
17
|
+
<orio-control-element v-bind="props" class="checkbox">
|
|
11
18
|
<label class="checkbox-label">
|
|
12
19
|
<input
|
|
13
20
|
v-model="modelValue"
|
|
14
21
|
type="checkbox"
|
|
15
22
|
class="checkbox-input"
|
|
16
23
|
tabindex="-1"
|
|
24
|
+
v-bind="$attrs"
|
|
17
25
|
/>
|
|
18
26
|
<span
|
|
19
27
|
class="checkbox-box"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useId } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
appearance: { type: String, required: false, default: "normal" },
|
|
5
6
|
error: { type: [String, null], required: false, default: null },
|
|
@@ -15,7 +16,10 @@ const props = defineProps({
|
|
|
15
16
|
<div
|
|
16
17
|
class="control"
|
|
17
18
|
:class="[appearance, layout, `size-${size}`, { 'has-error': error, group }]"
|
|
18
|
-
v-bind="
|
|
19
|
+
v-bind="{
|
|
20
|
+
...$attrs,
|
|
21
|
+
...group ? { role: 'group', ...label ? { 'aria-labelledby': id } : {} } : {}
|
|
22
|
+
}"
|
|
19
23
|
>
|
|
20
24
|
<component
|
|
21
25
|
:is="group ? 'span' : 'label'"
|
|
@@ -26,7 +30,7 @@ const props = defineProps({
|
|
|
26
30
|
{{ label }}
|
|
27
31
|
</component>
|
|
28
32
|
<div class="control-group">
|
|
29
|
-
<div class="slot-wrapper"
|
|
33
|
+
<div class="slot-wrapper">
|
|
30
34
|
<slot :id />
|
|
31
35
|
</div>
|
|
32
36
|
<span v-if="error" class="control-error">{{ error }}</span>
|
|
@@ -37,46 +41,50 @@ const props = defineProps({
|
|
|
37
41
|
<style scoped>
|
|
38
42
|
.control {
|
|
39
43
|
--control-font-size: var(--font-md);
|
|
44
|
+
--control-label-font-size: var(--font-sm);
|
|
40
45
|
--control-py: 0.5rem;
|
|
41
46
|
--control-px: 0.75rem;
|
|
42
47
|
--control-gap: 0.5rem;
|
|
43
48
|
--control-radius: var(--border-radius-md);
|
|
44
49
|
--control-icon-size: 1rem;
|
|
45
50
|
--control-inner-block-start: 1.25rem;
|
|
46
|
-
--control-inner-block-end: 0.
|
|
51
|
+
--control-inner-block-end: 0.2rem;
|
|
47
52
|
--control-label-block-start: 0.25rem;
|
|
48
53
|
}
|
|
49
54
|
.control.size-sm {
|
|
50
55
|
--control-font-size: var(--font-sm);
|
|
56
|
+
--control-label-font-size: var(--font-xs);
|
|
51
57
|
--control-py: 0.25rem;
|
|
52
58
|
--control-px: 0.5rem;
|
|
53
59
|
--control-gap: 0.25rem;
|
|
54
60
|
--control-radius: var(--border-radius-sm);
|
|
55
61
|
--control-icon-size: 0.75rem;
|
|
56
62
|
--control-inner-block-start: 1rem;
|
|
57
|
-
--control-inner-block-end: 0.
|
|
63
|
+
--control-inner-block-end: 0.1rem;
|
|
58
64
|
--control-label-block-start: 0.2rem;
|
|
59
65
|
}
|
|
60
66
|
.control.size-lg {
|
|
61
67
|
--control-font-size: var(--font-lg);
|
|
68
|
+
--control-label-font-size: var(--font-md);
|
|
62
69
|
--control-py: 0.625rem;
|
|
63
70
|
--control-px: 1rem;
|
|
64
71
|
--control-gap: 0.5rem;
|
|
65
72
|
--control-radius: var(--border-radius-md);
|
|
66
73
|
--control-icon-size: 1.25rem;
|
|
67
|
-
--control-inner-block-start: 1.
|
|
68
|
-
--control-inner-block-end: 0.
|
|
74
|
+
--control-inner-block-start: 1.1rem;
|
|
75
|
+
--control-inner-block-end: 0.2rem;
|
|
69
76
|
--control-label-block-start: 0.25rem;
|
|
70
77
|
}
|
|
71
78
|
.control.size-xl {
|
|
72
79
|
--control-font-size: var(--font-xl);
|
|
80
|
+
--control-label-font-size: var(--font-lg);
|
|
73
81
|
--control-py: 0.75rem;
|
|
74
82
|
--control-px: 1.25rem;
|
|
75
83
|
--control-gap: 0.75rem;
|
|
76
84
|
--control-radius: var(--border-radius-lg);
|
|
77
85
|
--control-icon-size: 1.5rem;
|
|
78
|
-
--control-inner-block-start:
|
|
79
|
-
--control-inner-block-end: 0
|
|
86
|
+
--control-inner-block-start: 1.5rem;
|
|
87
|
+
--control-inner-block-end: 0;
|
|
80
88
|
--control-label-block-start: 0.25rem;
|
|
81
89
|
}
|
|
82
90
|
.control {
|
|
@@ -86,7 +94,7 @@ const props = defineProps({
|
|
|
86
94
|
gap: 0.1rem;
|
|
87
95
|
}
|
|
88
96
|
.control .control-label {
|
|
89
|
-
font-size: var(--control-font-size);
|
|
97
|
+
font-size: var(--control-label-font-size);
|
|
90
98
|
user-select: none;
|
|
91
99
|
}
|
|
92
100
|
.control .control-group {
|
|
@@ -94,13 +102,15 @@ const props = defineProps({
|
|
|
94
102
|
}
|
|
95
103
|
.control .control-error {
|
|
96
104
|
color: var(--color-danger);
|
|
97
|
-
font-size: var(--control-font-size);
|
|
105
|
+
font-size: var(--control-label-font-size);
|
|
98
106
|
}
|
|
99
107
|
.control .slot-wrapper :deep(*) {
|
|
100
108
|
font-size: var(--control-font-size);
|
|
101
109
|
}
|
|
110
|
+
.control.has-error .slot-wrapper {
|
|
111
|
+
border: 1px solid var(--color-danger);
|
|
112
|
+
}
|
|
102
113
|
.control.has-error .slot-wrapper :deep(*) {
|
|
103
|
-
border-color: var(--color-danger);
|
|
104
114
|
font-size: var(--control-font-size);
|
|
105
115
|
}
|
|
106
116
|
.control.minimal {
|
|
@@ -6,7 +6,6 @@ export interface IconProps {
|
|
|
6
6
|
}
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
8
8
|
color: string;
|
|
9
|
-
size: string | number;
|
|
10
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
10
|
declare const _default: typeof __VLS_export;
|
|
12
11
|
export default _default;
|
|
@@ -3,31 +3,24 @@ import { computed } from "vue";
|
|
|
3
3
|
import { iconRegistry } from "../utils/icon-registry";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
name: { type: null, required: true },
|
|
6
|
-
size: { type: [String, Number], required: false
|
|
6
|
+
size: { type: [String, Number], required: false },
|
|
7
7
|
color: { type: String, required: false, default: "currentColor" }
|
|
8
8
|
});
|
|
9
9
|
const iconSvg = computed(() => iconRegistry[props.name] || "");
|
|
10
|
-
const sizeValue = computed(
|
|
11
|
-
(
|
|
12
|
-
|
|
10
|
+
const sizeValue = computed(() => {
|
|
11
|
+
if (props.size == null) return void 0;
|
|
12
|
+
return typeof props.size === "number" ? `${props.size}px` : props.size;
|
|
13
|
+
});
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<template>
|
|
16
17
|
<span
|
|
17
18
|
class="orio-icon"
|
|
18
|
-
:style="{
|
|
19
|
-
width: sizeValue,
|
|
20
|
-
height: sizeValue,
|
|
21
|
-
color,
|
|
22
|
-
display: 'inline-flex',
|
|
23
|
-
alignItems: 'center',
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
flexShrink: 0
|
|
26
|
-
}"
|
|
19
|
+
:style="{ color, width: sizeValue, height: sizeValue }"
|
|
27
20
|
v-html="iconSvg"
|
|
28
21
|
/>
|
|
29
22
|
</template>
|
|
30
23
|
|
|
31
24
|
<style scoped>
|
|
32
|
-
.orio-icon{align-items:center;display:inline-flex;flex-shrink:0;justify-content:center}.orio-icon :deep(svg){fill:currentColor;height:100%;width:100%}
|
|
25
|
+
.orio-icon{align-items:center;display:inline-flex;flex-shrink:0;height:var(--control-icon-size,1.5em);justify-content:center;width:var(--control-icon-size,1.5em)}.orio-icon :deep(svg){fill:currentColor;height:100%;width:100%}
|
|
33
26
|
</style>
|
|
@@ -6,7 +6,6 @@ export interface IconProps {
|
|
|
6
6
|
}
|
|
7
7
|
declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
8
8
|
color: string;
|
|
9
|
-
size: string | number;
|
|
10
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
10
|
declare const _default: typeof __VLS_export;
|
|
12
11
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ControlLayout } from "./ControlElement.vue.js";
|
|
1
|
+
import type { ControlLayout, ControlProps } from "./ControlElement.vue.js";
|
|
2
2
|
export type InputLayout = ControlLayout | "inner";
|
|
3
|
-
interface Props {
|
|
3
|
+
interface Props extends Omit<ControlProps, "layout"> {
|
|
4
4
|
layout?: InputLayout;
|
|
5
5
|
}
|
|
6
6
|
type __VLS_Props = Props;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
defineProps({
|
|
3
|
-
layout: { type: String, required: false, default: "vertical" }
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
layout: { type: String, required: false, default: "vertical" },
|
|
4
|
+
appearance: { type: String, required: false },
|
|
5
|
+
error: { type: [String, null], required: false },
|
|
6
|
+
group: { type: Boolean, required: false },
|
|
7
|
+
id: { type: String, required: false },
|
|
8
|
+
label: { type: String, required: false },
|
|
9
|
+
size: { type: String, required: false }
|
|
4
10
|
});
|
|
5
11
|
const modelValue = defineModel({ type: String, ...{ default: "" } });
|
|
6
12
|
</script>
|
|
@@ -8,12 +14,12 @@ const modelValue = defineModel({ type: String, ...{ default: "" } });
|
|
|
8
14
|
<template>
|
|
9
15
|
<orio-control-element
|
|
10
16
|
v-slot="{ id }"
|
|
11
|
-
v-bind="
|
|
17
|
+
v-bind="props"
|
|
12
18
|
:layout="layout === 'inner' ? 'vertical' : layout"
|
|
13
19
|
:class="{ inner: layout === 'inner' }"
|
|
14
20
|
>
|
|
15
21
|
<slot name="before" />
|
|
16
|
-
<input
|
|
22
|
+
<input :id v-model="modelValue" type="text" v-bind="$attrs" />
|
|
17
23
|
<slot name="after" />
|
|
18
24
|
</orio-control-element>
|
|
19
25
|
</template>
|
|
@@ -66,12 +72,14 @@ input {
|
|
|
66
72
|
.inner :deep(.control-label) {
|
|
67
73
|
position: absolute;
|
|
68
74
|
z-index: 1;
|
|
69
|
-
pointer-events: none;
|
|
70
75
|
left: var(--control-px);
|
|
71
76
|
top: var(--control-label-block-start);
|
|
72
77
|
color: var(--color-muted);
|
|
73
78
|
}
|
|
79
|
+
.inner :deep(.slot-wrapper) {
|
|
80
|
+
padding: var(--control-inner-block-start) var(--control-px) var(--control-inner-block-end);
|
|
81
|
+
}
|
|
74
82
|
.inner input {
|
|
75
|
-
padding:
|
|
83
|
+
padding: 0;
|
|
76
84
|
}
|
|
77
85
|
</style>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ControlLayout } from "./ControlElement.vue.js";
|
|
1
|
+
import type { ControlLayout, ControlProps } from "./ControlElement.vue.js";
|
|
2
2
|
export type InputLayout = ControlLayout | "inner";
|
|
3
|
-
interface Props {
|
|
3
|
+
interface Props extends Omit<ControlProps, "layout"> {
|
|
4
4
|
layout?: InputLayout;
|
|
5
5
|
}
|
|
6
6
|
type __VLS_Props = Props;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, toRefs,
|
|
2
|
+
import { computed, toRefs, useSlots } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
icon: { type: String, required: false },
|
|
5
5
|
disabled: { type: Boolean, required: false },
|
|
6
|
-
active: { type: Boolean, required: false, default: false }
|
|
6
|
+
active: { type: Boolean, required: false, default: false },
|
|
7
|
+
appearance: { type: String, required: false },
|
|
8
|
+
error: { type: [String, null], required: false },
|
|
9
|
+
group: { type: Boolean, required: false },
|
|
10
|
+
id: { type: String, required: false },
|
|
11
|
+
label: { type: String, required: false },
|
|
12
|
+
layout: { type: String, required: false },
|
|
13
|
+
size: { type: String, required: false }
|
|
7
14
|
});
|
|
8
15
|
const { disabled, active } = toRefs(props);
|
|
9
|
-
const attrs = useAttrs();
|
|
10
16
|
const slots = useSlots();
|
|
11
17
|
const isIconOnly = computed(() => {
|
|
12
18
|
const hasIcon = !!props.icon || !!slots.icon;
|
|
@@ -21,9 +27,9 @@ function click(event) {
|
|
|
21
27
|
</script>
|
|
22
28
|
|
|
23
29
|
<template>
|
|
24
|
-
<orio-control-element>
|
|
30
|
+
<orio-control-element v-bind="props">
|
|
25
31
|
<button
|
|
26
|
-
v-bind="attrs"
|
|
32
|
+
v-bind="$attrs"
|
|
27
33
|
:class="{ 'icon-only': isIconOnly, active }"
|
|
28
34
|
:disabled
|
|
29
35
|
:aria-current="active ? 'page' : void 0"
|
|
@@ -9,8 +9,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
10
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
disabled: boolean;
|
|
13
12
|
layout: import("../Input.vue.js").InputLayout;
|
|
13
|
+
disabled: boolean;
|
|
14
14
|
step: number;
|
|
15
15
|
min: number;
|
|
16
16
|
max: number;
|
|
@@ -6,7 +6,13 @@ defineProps({
|
|
|
6
6
|
max: { type: Number, required: false, default: void 0 },
|
|
7
7
|
step: { type: Number, required: false, default: 1 },
|
|
8
8
|
decimalPlaces: { type: Number, required: false, default: 0 },
|
|
9
|
-
disabled: { type: Boolean, required: false, default: false }
|
|
9
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
10
|
+
appearance: { type: String, required: false },
|
|
11
|
+
error: { type: [String, null], required: false },
|
|
12
|
+
group: { type: Boolean, required: false },
|
|
13
|
+
id: { type: String, required: false },
|
|
14
|
+
label: { type: String, required: false },
|
|
15
|
+
size: { type: String, required: false }
|
|
10
16
|
});
|
|
11
17
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
12
18
|
const { pressAndHold, stop } = usePressAndHold();
|
|
@@ -9,8 +9,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
10
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
disabled: boolean;
|
|
13
12
|
layout: import("../Input.vue.js").InputLayout;
|
|
13
|
+
disabled: boolean;
|
|
14
14
|
step: number;
|
|
15
15
|
min: number;
|
|
16
16
|
max: number;
|
|
@@ -9,8 +9,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
10
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
disabled: boolean;
|
|
13
12
|
layout: import("../Input.vue.js").InputLayout;
|
|
13
|
+
disabled: boolean;
|
|
14
14
|
step: number;
|
|
15
15
|
min: number;
|
|
16
16
|
max: number;
|
|
@@ -6,7 +6,13 @@ defineProps({
|
|
|
6
6
|
max: { type: Number, required: false, default: void 0 },
|
|
7
7
|
step: { type: Number, required: false, default: 1 },
|
|
8
8
|
decimalPlaces: { type: Number, required: false, default: 0 },
|
|
9
|
-
disabled: { type: Boolean, required: false, default: false }
|
|
9
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
10
|
+
appearance: { type: String, required: false },
|
|
11
|
+
error: { type: [String, null], required: false },
|
|
12
|
+
group: { type: Boolean, required: false },
|
|
13
|
+
id: { type: String, required: false },
|
|
14
|
+
label: { type: String, required: false },
|
|
15
|
+
size: { type: String, required: false }
|
|
10
16
|
});
|
|
11
17
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
12
18
|
const { pressAndHold, stop } = usePressAndHold();
|
|
@@ -9,8 +9,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
9
9
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
10
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
11
11
|
}>, {
|
|
12
|
-
disabled: boolean;
|
|
13
12
|
layout: import("../Input.vue.js").InputLayout;
|
|
13
|
+
disabled: boolean;
|
|
14
14
|
step: number;
|
|
15
15
|
min: number;
|
|
16
16
|
max: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ControlProps } from "../ControlElement.vue.js";
|
|
1
2
|
import type { InputLayout } from "../Input.vue.js";
|
|
2
|
-
export interface NumberInputProps {
|
|
3
|
+
export interface NumberInputProps extends Omit<ControlProps, "layout"> {
|
|
3
4
|
layout?: InputLayout;
|
|
4
5
|
min?: number;
|
|
5
6
|
max?: number;
|
|
@@ -28,8 +29,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
28
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
30
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
30
31
|
}>, {
|
|
31
|
-
disabled: boolean;
|
|
32
32
|
layout: InputLayout;
|
|
33
|
+
disabled: boolean;
|
|
33
34
|
step: number;
|
|
34
35
|
min: number;
|
|
35
36
|
max: number;
|
|
@@ -6,7 +6,13 @@ const props = defineProps({
|
|
|
6
6
|
max: { type: Number, required: false, default: void 0 },
|
|
7
7
|
step: { type: Number, required: false, default: 1 },
|
|
8
8
|
decimalPlaces: { type: Number, required: false, default: 0 },
|
|
9
|
-
disabled: { type: Boolean, required: false, default: false }
|
|
9
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
10
|
+
appearance: { type: String, required: false },
|
|
11
|
+
error: { type: [String, null], required: false },
|
|
12
|
+
group: { type: Boolean, required: false },
|
|
13
|
+
id: { type: String, required: false },
|
|
14
|
+
label: { type: String, required: false },
|
|
15
|
+
size: { type: String, required: false }
|
|
10
16
|
});
|
|
11
17
|
const { min, max, step, decimalPlaces } = toRefs(props);
|
|
12
18
|
const modelValue = defineModel({ type: Number, ...{ default: 0 } });
|
|
@@ -36,6 +42,17 @@ const isAtMax = computed(
|
|
|
36
42
|
const isAtMin = computed(
|
|
37
43
|
() => Number.isFinite(min.value) && modelValue.value <= min.value
|
|
38
44
|
);
|
|
45
|
+
const controlProps = computed(() => {
|
|
46
|
+
const {
|
|
47
|
+
min: _min,
|
|
48
|
+
max: _max,
|
|
49
|
+
step: _step,
|
|
50
|
+
decimalPlaces: _decimalPlaces,
|
|
51
|
+
disabled: _disabled,
|
|
52
|
+
...rest
|
|
53
|
+
} = props;
|
|
54
|
+
return rest;
|
|
55
|
+
});
|
|
39
56
|
const slotExpose = computed(() => ({
|
|
40
57
|
increase,
|
|
41
58
|
decrease,
|
|
@@ -47,7 +64,7 @@ const slotExpose = computed(() => ({
|
|
|
47
64
|
<template>
|
|
48
65
|
<orio-control-element
|
|
49
66
|
v-slot="{ id }"
|
|
50
|
-
v-bind="
|
|
67
|
+
v-bind="controlProps"
|
|
51
68
|
:layout="layout === 'inner' ? 'vertical' : layout"
|
|
52
69
|
:class="{ inner: layout === 'inner' }"
|
|
53
70
|
>
|
|
@@ -58,6 +75,10 @@ const slotExpose = computed(() => ({
|
|
|
58
75
|
v-model="modelValue"
|
|
59
76
|
type="number"
|
|
60
77
|
class="number-input"
|
|
78
|
+
:disabled
|
|
79
|
+
:min
|
|
80
|
+
:max
|
|
81
|
+
:step
|
|
61
82
|
@blur="onBlur"
|
|
62
83
|
/>
|
|
63
84
|
<div class="controls">
|
|
@@ -117,7 +138,6 @@ input[type=number] {
|
|
|
117
138
|
.inner :deep(.control-label) {
|
|
118
139
|
position: absolute;
|
|
119
140
|
z-index: 1;
|
|
120
|
-
pointer-events: none;
|
|
121
141
|
left: var(--control-px);
|
|
122
142
|
top: var(--control-label-block-start);
|
|
123
143
|
color: var(--color-muted);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ControlProps } from "../ControlElement.vue.js";
|
|
1
2
|
import type { InputLayout } from "../Input.vue.js";
|
|
2
|
-
export interface NumberInputProps {
|
|
3
|
+
export interface NumberInputProps extends Omit<ControlProps, "layout"> {
|
|
3
4
|
layout?: InputLayout;
|
|
4
5
|
min?: number;
|
|
5
6
|
max?: number;
|
|
@@ -28,8 +29,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
28
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
30
|
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
30
31
|
}>, {
|
|
31
|
-
disabled: boolean;
|
|
32
32
|
layout: InputLayout;
|
|
33
|
+
disabled: boolean;
|
|
33
34
|
step: number;
|
|
34
35
|
min: number;
|
|
35
36
|
max: number;
|