@una-ui/nuxt-edge 1.0.0-alpha.0-29174397.f2b46e8 → 1.0.0-alpha.0-29174694.a8be6b4
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/module.mjs +1 -1
- package/dist/runtime/components/number-field/NumberField.vue +73 -0
- package/dist/runtime/components/number-field/NumberField.vue.d.ts +28 -0
- package/dist/runtime/components/number-field/NumberFieldContent.vue +20 -0
- package/dist/runtime/components/number-field/NumberFieldContent.vue.d.ts +13 -0
- package/dist/runtime/components/number-field/NumberFieldDecrement.vue +33 -0
- package/dist/runtime/components/number-field/NumberFieldDecrement.vue.d.ts +16 -0
- package/dist/runtime/components/number-field/NumberFieldIncrement.vue +33 -0
- package/dist/runtime/components/number-field/NumberFieldIncrement.vue.d.ts +16 -0
- package/dist/runtime/components/number-field/NumberFieldInput.vue +24 -0
- package/dist/runtime/components/number-field/NumberFieldInput.vue.d.ts +5 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/number-field.d.ts +48 -0
- package/dist/runtime/types/number-field.js +0 -0
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { NumberFieldRoot, useForwardPropsEmits } from "reka-ui";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import NumberFieldContent from "./NumberFieldContent.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
numberField: { type: null, required: false, default: "outline-primary" },
|
|
8
|
+
_numberFieldContent: { type: Object, required: false },
|
|
9
|
+
_numberFieldDecrement: { type: Object, required: false },
|
|
10
|
+
_numberFieldIncrement: { type: Object, required: false },
|
|
11
|
+
_numberFieldInput: { type: Object, required: false },
|
|
12
|
+
una: { type: Object, required: false },
|
|
13
|
+
defaultValue: { type: Number, required: false },
|
|
14
|
+
modelValue: { type: [Number, null], required: false },
|
|
15
|
+
min: { type: Number, required: false },
|
|
16
|
+
max: { type: Number, required: false },
|
|
17
|
+
step: { type: Number, required: false },
|
|
18
|
+
stepSnapping: { type: Boolean, required: false },
|
|
19
|
+
formatOptions: { type: null, required: false },
|
|
20
|
+
locale: { type: String, required: false },
|
|
21
|
+
disabled: { type: Boolean, required: false },
|
|
22
|
+
disableWheelChange: { type: Boolean, required: false },
|
|
23
|
+
invertWheelChange: { type: Boolean, required: false },
|
|
24
|
+
id: { type: String, required: false },
|
|
25
|
+
asChild: { type: Boolean, required: false },
|
|
26
|
+
as: { type: null, required: false },
|
|
27
|
+
name: { type: String, required: false },
|
|
28
|
+
required: { type: Boolean, required: false },
|
|
29
|
+
leading: { type: String, required: false, default: "i-lucide-minus" },
|
|
30
|
+
trailing: { type: String, required: false, default: "i-lucide-plus" },
|
|
31
|
+
class: { type: null, required: false },
|
|
32
|
+
size: { type: null, required: false, default: "md" }
|
|
33
|
+
});
|
|
34
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
35
|
+
const delegatedProps = reactiveOmit(props, "class", "numberField");
|
|
36
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<NumberFieldRoot
|
|
41
|
+
v-bind="forwarded"
|
|
42
|
+
:class="cn('number-field', props.class)"
|
|
43
|
+
>
|
|
44
|
+
<slot>
|
|
45
|
+
<NumberFieldContent :size>
|
|
46
|
+
<slot name="content">
|
|
47
|
+
<NNumberFieldDecrement
|
|
48
|
+
v-bind="forwarded._numberFieldDecrement"
|
|
49
|
+
:icon="props.leading"
|
|
50
|
+
:size
|
|
51
|
+
:una
|
|
52
|
+
>
|
|
53
|
+
<slot name="decrement" />
|
|
54
|
+
</NNumberFieldDecrement>
|
|
55
|
+
<NNumberFieldInput
|
|
56
|
+
v-bind="forwarded._numberFieldInput"
|
|
57
|
+
:size
|
|
58
|
+
:number-field
|
|
59
|
+
:una
|
|
60
|
+
/>
|
|
61
|
+
<NNumberFieldIncrement
|
|
62
|
+
v-bind="forwarded._numberFieldIncrement"
|
|
63
|
+
:icon="props.trailing"
|
|
64
|
+
:size
|
|
65
|
+
:una
|
|
66
|
+
>
|
|
67
|
+
<slot name="increment" />
|
|
68
|
+
</NNumberFieldIncrement>
|
|
69
|
+
</slot>
|
|
70
|
+
</NumberFieldContent>
|
|
71
|
+
</slot>
|
|
72
|
+
</NumberFieldRoot>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NNumberFieldProps } from '../../types/index.js';
|
|
2
|
+
declare var __VLS_6: {}, __VLS_11: {}, __VLS_17: {}, __VLS_27: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
} & {
|
|
6
|
+
content?: (props: typeof __VLS_11) => any;
|
|
7
|
+
} & {
|
|
8
|
+
decrement?: (props: typeof __VLS_17) => any;
|
|
9
|
+
} & {
|
|
10
|
+
increment?: (props: typeof __VLS_27) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:modelValue": (val: number) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<NNumberFieldProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((val: number) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
leading: string;
|
|
18
|
+
trailing: string;
|
|
19
|
+
size: import("vue").HTMLAttributes["class"];
|
|
20
|
+
numberField: import("vue").HTMLAttributes["class"];
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { cn } from "../../utils";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
una: { type: Object, required: false },
|
|
5
|
+
class: { type: null, required: false },
|
|
6
|
+
size: { type: null, required: false }
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
:class="cn(
|
|
13
|
+
'number-field-content',
|
|
14
|
+
props.una?.numberFieldContent,
|
|
15
|
+
props.class
|
|
16
|
+
)"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NNumberFieldContentProps } from '../../types/index.js';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldContentProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { NumberFieldDecrement, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import Icon from "../elements/Icon.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
icon: { type: String, required: false, default: "i-lucide-minus" },
|
|
8
|
+
una: { type: Object, required: false },
|
|
9
|
+
disabled: { type: Boolean, required: false },
|
|
10
|
+
asChild: { type: Boolean, required: false },
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
class: { type: null, required: false },
|
|
13
|
+
size: { type: null, required: false, default: "md" }
|
|
14
|
+
});
|
|
15
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
16
|
+
const forwarded = useForwardProps(delegatedProps);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<NumberFieldDecrement
|
|
21
|
+
data-slot="decrement"
|
|
22
|
+
v-bind="forwarded"
|
|
23
|
+
:class="cn(
|
|
24
|
+
'number-field-decrement',
|
|
25
|
+
props.una?.numberFieldDecrement,
|
|
26
|
+
props.class
|
|
27
|
+
)"
|
|
28
|
+
>
|
|
29
|
+
<slot>
|
|
30
|
+
<Icon :name="icon" />
|
|
31
|
+
</slot>
|
|
32
|
+
</NumberFieldDecrement>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NNumberFieldDecrementProps } from '../../types/index.js';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldDecrementProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldDecrementProps> & Readonly<{}>, {
|
|
7
|
+
icon: string;
|
|
8
|
+
size: import("vue").HTMLAttributes["class"];
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { NumberFieldIncrement, useForwardProps } from "reka-ui";
|
|
4
|
+
import { cn } from "../../utils";
|
|
5
|
+
import Icon from "../elements/Icon.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
icon: { type: String, required: false, default: "i-lucide-plus" },
|
|
8
|
+
una: { type: Object, required: false },
|
|
9
|
+
disabled: { type: Boolean, required: false },
|
|
10
|
+
asChild: { type: Boolean, required: false },
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
class: { type: null, required: false },
|
|
13
|
+
size: { type: null, required: false, default: "md" }
|
|
14
|
+
});
|
|
15
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
16
|
+
const forwarded = useForwardProps(delegatedProps);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<NumberFieldIncrement
|
|
21
|
+
data-slot="increment"
|
|
22
|
+
v-bind="forwarded"
|
|
23
|
+
:class="cn(
|
|
24
|
+
'number-field-increment',
|
|
25
|
+
props.una?.numberFieldIncrement,
|
|
26
|
+
props.class
|
|
27
|
+
)"
|
|
28
|
+
>
|
|
29
|
+
<slot>
|
|
30
|
+
<Icon :name="icon" />
|
|
31
|
+
</slot>
|
|
32
|
+
</NumberFieldIncrement>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NNumberFieldIncrementProps } from '../../types/index.js';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<NNumberFieldIncrementProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldIncrementProps> & Readonly<{}>, {
|
|
7
|
+
icon: string;
|
|
8
|
+
size: import("vue").HTMLAttributes["class"];
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NumberFieldInput } from "reka-ui";
|
|
3
|
+
import { cn } from "../../utils";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
una: { type: Object, required: false },
|
|
6
|
+
asChild: { type: Boolean, required: false },
|
|
7
|
+
as: { type: null, required: false },
|
|
8
|
+
class: { type: null, required: false },
|
|
9
|
+
size: { type: null, required: false },
|
|
10
|
+
numberField: { type: null, required: false, default: "outline-primary" }
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<NumberFieldInput
|
|
16
|
+
data-slot="input"
|
|
17
|
+
:class="cn(
|
|
18
|
+
'number-field-input',
|
|
19
|
+
props.una?.numberFieldInput,
|
|
20
|
+
props.class
|
|
21
|
+
)"
|
|
22
|
+
:number-field
|
|
23
|
+
/>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NNumberFieldInputProps } from '../../types/index.js';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<NNumberFieldInputProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NNumberFieldInputProps> & Readonly<{}>, {
|
|
3
|
+
numberField: import("vue").HTMLAttributes["class"];
|
|
4
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -24,6 +24,7 @@ export * from './kbd.js';
|
|
|
24
24
|
export * from './label.js';
|
|
25
25
|
export * from './link.js';
|
|
26
26
|
export * from './navigation-menu.js';
|
|
27
|
+
export * from './number-field.js';
|
|
27
28
|
export * from './pagination.js';
|
|
28
29
|
export * from './popover.js';
|
|
29
30
|
export * from './progress.js';
|
|
@@ -24,6 +24,7 @@ export * from "./kbd.js";
|
|
|
24
24
|
export * from "./label.js";
|
|
25
25
|
export * from "./link.js";
|
|
26
26
|
export * from "./navigation-menu.js";
|
|
27
|
+
export * from "./number-field.js";
|
|
27
28
|
export * from "./pagination.js";
|
|
28
29
|
export * from "./popover.js";
|
|
29
30
|
export * from "./progress.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { NumberFieldDecrementProps, NumberFieldIncrementProps, NumberFieldInputProps, NumberFieldRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import type { NInputProps } from './input.js';
|
|
4
|
+
export interface NNumberFieldProps extends NumberFieldRootProps, Pick<NInputProps, 'leading' | 'trailing'>, BaseExtensions {
|
|
5
|
+
/**
|
|
6
|
+
* Allows you to add `UnaUI` input preset properties,
|
|
7
|
+
* Think of it as a shortcut for adding options or variants to the preset if available.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/number-field.ts
|
|
10
|
+
* @example
|
|
11
|
+
* numberField="solid-green"
|
|
12
|
+
*/
|
|
13
|
+
numberField?: HTMLAttributes['class'];
|
|
14
|
+
_numberFieldContent?: NNumberFieldContentProps;
|
|
15
|
+
_numberFieldDecrement?: NNumberFieldDecrementProps;
|
|
16
|
+
_numberFieldIncrement?: NNumberFieldIncrementProps;
|
|
17
|
+
_numberFieldInput?: NNumberFieldInputProps;
|
|
18
|
+
/**
|
|
19
|
+
* `UnaUI` preset configuration
|
|
20
|
+
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/number-field.ts
|
|
21
|
+
*/
|
|
22
|
+
una?: NNumberFieldUnaProps;
|
|
23
|
+
}
|
|
24
|
+
export interface NNumberFieldContentProps extends BaseExtensions {
|
|
25
|
+
una?: Pick<NNumberFieldUnaProps, 'numberFieldContent'>;
|
|
26
|
+
}
|
|
27
|
+
export interface NNumberFieldDecrementProps extends NumberFieldDecrementProps, BaseExtensions {
|
|
28
|
+
icon?: string;
|
|
29
|
+
una?: Pick<NNumberFieldUnaProps, 'numberFieldDecrement'>;
|
|
30
|
+
}
|
|
31
|
+
export interface NNumberFieldIncrementProps extends NumberFieldIncrementProps, BaseExtensions {
|
|
32
|
+
icon?: string;
|
|
33
|
+
una?: Pick<NNumberFieldUnaProps, 'numberFieldIncrement'>;
|
|
34
|
+
}
|
|
35
|
+
export interface NNumberFieldInputProps extends NumberFieldInputProps, BaseExtensions, Pick<NNumberFieldProps, 'numberField'> {
|
|
36
|
+
una?: Pick<NNumberFieldUnaProps, 'numberFieldInput'>;
|
|
37
|
+
}
|
|
38
|
+
export interface NNumberFieldUnaProps {
|
|
39
|
+
numberFieldContent?: HTMLAttributes['class'];
|
|
40
|
+
numberFieldIncrement?: HTMLAttributes['class'];
|
|
41
|
+
numberFieldDecrement?: HTMLAttributes['class'];
|
|
42
|
+
numberFieldInput?: HTMLAttributes['class'];
|
|
43
|
+
}
|
|
44
|
+
interface BaseExtensions {
|
|
45
|
+
class?: HTMLAttributes['class'];
|
|
46
|
+
size?: HTMLAttributes['class'];
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt-edge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.0-
|
|
4
|
+
"version": "1.0.0-alpha.0-29174694.a8be6b4",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@nuxt/kit": "^3.17.5",
|
|
42
42
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
43
43
|
"@tanstack/vue-table": "^8.21.3",
|
|
44
|
-
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-
|
|
45
|
-
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-
|
|
44
|
+
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-29174694.a8be6b4",
|
|
45
|
+
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-29174694.a8be6b4",
|
|
46
46
|
"@unocss/core": "^66.2.0",
|
|
47
47
|
"@unocss/nuxt": "^66.2.0",
|
|
48
48
|
"@unocss/preset-attributify": "^66.2.0",
|