orio-ui 1.17.0 → 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.
Files changed (49) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/Badge.d.vue.ts +2 -0
  3. package/dist/runtime/components/Badge.vue +13 -4
  4. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  5. package/dist/runtime/components/Button.d.vue.ts +2 -1
  6. package/dist/runtime/components/Button.vue +11 -5
  7. package/dist/runtime/components/Button.vue.d.ts +2 -1
  8. package/dist/runtime/components/CheckBox.d.vue.ts +2 -1
  9. package/dist/runtime/components/CheckBox.vue +11 -3
  10. package/dist/runtime/components/CheckBox.vue.d.ts +2 -1
  11. package/dist/runtime/components/ControlElement.vue +6 -2
  12. package/dist/runtime/components/Icon.d.vue.ts +0 -1
  13. package/dist/runtime/components/Icon.vue +7 -14
  14. package/dist/runtime/components/Icon.vue.d.ts +0 -1
  15. package/dist/runtime/components/Input.d.vue.ts +2 -2
  16. package/dist/runtime/components/Input.vue +9 -4
  17. package/dist/runtime/components/Input.vue.d.ts +2 -2
  18. package/dist/runtime/components/NavButton.d.vue.ts +2 -1
  19. package/dist/runtime/components/NavButton.vue +11 -5
  20. package/dist/runtime/components/NavButton.vue.d.ts +2 -1
  21. package/dist/runtime/components/NumberInput/Horizontal.d.vue.ts +1 -1
  22. package/dist/runtime/components/NumberInput/Horizontal.vue +7 -1
  23. package/dist/runtime/components/NumberInput/Horizontal.vue.d.ts +1 -1
  24. package/dist/runtime/components/NumberInput/Vertical.d.vue.ts +1 -1
  25. package/dist/runtime/components/NumberInput/Vertical.vue +7 -1
  26. package/dist/runtime/components/NumberInput/Vertical.vue.d.ts +1 -1
  27. package/dist/runtime/components/NumberInput/index.d.vue.ts +3 -2
  28. package/dist/runtime/components/NumberInput/index.vue +23 -3
  29. package/dist/runtime/components/NumberInput/index.vue.d.ts +3 -2
  30. package/dist/runtime/components/Popover.d.vue.ts +22 -51
  31. package/dist/runtime/components/Popover.vue +37 -65
  32. package/dist/runtime/components/Popover.vue.d.ts +22 -51
  33. package/dist/runtime/components/RadioButton.d.vue.ts +3 -2
  34. package/dist/runtime/components/RadioButton.vue +12 -5
  35. package/dist/runtime/components/RadioButton.vue.d.ts +3 -2
  36. package/dist/runtime/components/Selector.d.vue.ts +2 -1
  37. package/dist/runtime/components/Selector.vue +68 -10
  38. package/dist/runtime/components/Selector.vue.d.ts +2 -1
  39. package/dist/runtime/components/SwitchButton.d.vue.ts +2 -1
  40. package/dist/runtime/components/SwitchButton.vue +10 -2
  41. package/dist/runtime/components/SwitchButton.vue.d.ts +2 -1
  42. package/dist/runtime/components/Textarea.d.vue.ts +2 -1
  43. package/dist/runtime/components/Textarea.vue +10 -7
  44. package/dist/runtime/components/Textarea.vue.d.ts +2 -1
  45. package/dist/runtime/components/view/Text.d.vue.ts +1 -1
  46. package/dist/runtime/components/view/Text.vue.d.ts +1 -1
  47. package/dist/runtime/composables/useListKeyboard.d.ts +19 -0
  48. package/dist/runtime/composables/useListKeyboard.js +59 -0
  49. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0 || ^4.0.0"
6
6
  },
7
- "version": "1.17.0",
7
+ "version": "1.18.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -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 class="badge positioned" :class="[variant, { pill, dot: isDot }]">
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 v-else class="badge" :class="[variant, { pill, dot: isDot }]">
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:.5rem;top:.5rem;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)}
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,4 +1,5 @@
1
- interface Props {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ interface Props extends ControlProps {
2
3
  variant?: "primary" | "secondary" | "subdued";
3
4
  icon?: string;
4
5
  loading?: boolean;
@@ -1,13 +1,19 @@
1
1
  <script setup>
2
- import { computed, toRefs, useAttrs, useSlots } from "vue";
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,4 +1,5 @@
1
- interface Props {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ interface Props extends ControlProps {
2
3
  variant?: "primary" | "secondary" | "subdued";
3
4
  icon?: string;
4
5
  loading?: boolean;
@@ -1,4 +1,5 @@
1
- export interface CheckBoxProps {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ export interface CheckBoxProps extends ControlProps {
2
3
  checkedIcon?: string;
3
4
  uncheckedIcon?: string;
4
5
  }
@@ -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,4 +1,5 @@
1
- export interface CheckBoxProps {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ export interface CheckBoxProps extends ControlProps {
2
3
  checkedIcon?: string;
3
4
  uncheckedIcon?: string;
4
5
  }
@@ -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="group ? { role: 'group', 'aria-labelledby': id } : {}"
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" v-bind="$attrs">
33
+ <div class="slot-wrapper">
30
34
  <slot :id />
31
35
  </div>
32
36
  <span v-if="error" class="control-error">{{ error }}</span>
@@ -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, default: "1em" },
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
- () => typeof props.size === "number" ? `${props.size}px` : props.size
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,7 +14,7 @@ const modelValue = defineModel({ type: String, ...{ default: "" } });
8
14
  <template>
9
15
  <orio-control-element
10
16
  v-slot="{ id }"
11
- v-bind="$attrs"
17
+ v-bind="props"
12
18
  :layout="layout === 'inner' ? 'vertical' : layout"
13
19
  :class="{ inner: layout === 'inner' }"
14
20
  >
@@ -66,7 +72,6 @@ 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);
@@ -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,4 +1,5 @@
1
- interface Props {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ interface Props extends ControlProps {
2
3
  icon?: string;
3
4
  disabled?: boolean;
4
5
  active?: boolean;
@@ -1,12 +1,18 @@
1
1
  <script setup>
2
- import { computed, toRefs, useAttrs, useSlots } from "vue";
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"
@@ -1,4 +1,5 @@
1
- interface Props {
1
+ import type { ControlProps } from "./ControlElement.vue.js";
2
+ interface Props extends ControlProps {
2
3
  icon?: string;
3
4
  disabled?: boolean;
4
5
  active?: boolean;
@@ -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="$attrs"
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;
@@ -1,3 +1,20 @@
1
+ type PopoverPosition = "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "left-top" | "left-bottom" | "right-top" | "right-bottom";
2
+ interface PopoverProps {
3
+ /**
4
+ * Defines where the popover is placed relative to the trigger.
5
+ * Acceptable single values: 'top', 'bottom', 'left', 'right'
6
+ * Acceptable combos: 'top-left', 'top-right', 'bottom-left', 'bottom-right',
7
+ * 'left-top', 'left-bottom', 'right-top', 'right-bottom'
8
+ * If you only provide 'top', 'bottom', 'left', or 'right',
9
+ * it aligns center by default.
10
+ */
11
+ position?: PopoverPosition;
12
+ /**
13
+ * Distance (in px) between the popover and the trigger element.
14
+ */
15
+ offset?: number;
16
+ disabled?: boolean;
17
+ }
1
18
  /**
2
19
  * Toggles popover visibility.
3
20
  * @param {boolean|null} force - If `true`/`false`, force that state; if `null`, toggle.
@@ -5,67 +22,21 @@
5
22
  declare function togglePopover(force?: boolean | null): Promise<void>;
6
23
  declare var __VLS_1: {
7
24
  toggle: typeof togglePopover;
25
+ isOpen: boolean;
8
26
  }, __VLS_15: {
9
27
  toggle: typeof togglePopover;
28
+ isOpen: true;
10
29
  };
11
30
  type __VLS_Slots = {} & {
12
31
  default?: (props: typeof __VLS_1) => any;
13
32
  } & {
14
33
  content?: (props: typeof __VLS_15) => any;
15
34
  };
16
- declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
17
- /**
18
- * Defines where the popover is placed relative to the trigger.
19
- * Acceptable single values: 'top', 'bottom', 'left', 'right'
20
- * Acceptable combos: 'top-left', 'top-right', 'bottom-left', 'bottom-right',
21
- * 'left-top', 'left-bottom', 'right-top', 'right-bottom'
22
- * If you only provide 'top', 'bottom', 'left', or 'right',
23
- * it aligns center by default.
24
- */
25
- position: {
26
- type: StringConstructor;
27
- default: string;
28
- };
29
- /**
30
- * Distance (in px) between the popover and the trigger element.
31
- */
32
- offset: {
33
- type: NumberConstructor;
34
- default: number;
35
- };
36
- disabled: {
37
- type: BooleanConstructor;
38
- default: boolean;
39
- };
40
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
- /**
42
- * Defines where the popover is placed relative to the trigger.
43
- * Acceptable single values: 'top', 'bottom', 'left', 'right'
44
- * Acceptable combos: 'top-left', 'top-right', 'bottom-left', 'bottom-right',
45
- * 'left-top', 'left-bottom', 'right-top', 'right-bottom'
46
- * If you only provide 'top', 'bottom', 'left', or 'right',
47
- * it aligns center by default.
48
- */
49
- position: {
50
- type: StringConstructor;
51
- default: string;
52
- };
53
- /**
54
- * Distance (in px) between the popover and the trigger element.
55
- */
56
- offset: {
57
- type: NumberConstructor;
58
- default: number;
59
- };
60
- disabled: {
61
- type: BooleanConstructor;
62
- default: boolean;
63
- };
64
- }>> & Readonly<{}>, {
35
+ declare const __VLS_base: import("vue").DefineComponent<PopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{}>, {
65
36
  disabled: boolean;
66
- position: string;
37
+ position: PopoverPosition;
67
38
  offset: number;
68
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
69
40
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
70
41
  declare const _default: typeof __VLS_export;
71
42
  export default _default;