@auronui/vue 1.0.5 → 1.0.7
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/cjs/index.cjs +314 -45
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/autocomplete/AutocompleteContent.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteItem.js.map +1 -1
- package/dist/components/autocomplete/AutocompleteItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBoxContent.js.map +1 -1
- package/dist/components/combo-box/ComboBoxContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/combo-box/ComboBoxItem.js.map +1 -1
- package/dist/components/combo-box/ComboBoxItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/tabs/Tab.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/components/tabs/Tab.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/TabList.js.map +1 -1
- package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js +262 -3
- package/dist/components/tabs/TabList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js +14 -6
- package/dist/components/tabs/Tabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/tabs/tabs.context.js.map +1 -1
- package/dist/index.d.ts +8972 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { composeClassName } from "../../utils/composeClassName.js";
|
|
2
2
|
import { useTabsProvide } from "./tabs.context.js";
|
|
3
|
-
import { computed, createBlock, defineComponent, normalizeClass, openBlock, renderSlot, toRef, unref, withCtx } from "vue";
|
|
3
|
+
import { computed, createBlock, defineComponent, normalizeClass, openBlock, ref, renderSlot, toRef, unref, watch, withCtx } from "vue";
|
|
4
4
|
import { tabsVariants } from "@auronui/styles";
|
|
5
5
|
import { TabsRoot } from "reka-ui";
|
|
6
6
|
//#region src/components/tabs/Tabs.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -18,26 +18,34 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
18
18
|
setup(__props, { emit: __emit }) {
|
|
19
19
|
const props = __props;
|
|
20
20
|
const emit = __emit;
|
|
21
|
+
const internalValue = ref(props.modelValue ?? props.defaultValue);
|
|
22
|
+
watch(() => props.modelValue, (v) => {
|
|
23
|
+
if (v !== void 0) internalValue.value = v;
|
|
24
|
+
});
|
|
25
|
+
function changeTab(value) {
|
|
26
|
+
internalValue.value = value;
|
|
27
|
+
emit("update:modelValue", value);
|
|
28
|
+
}
|
|
21
29
|
const slotFns = computed(() => tabsVariants({ variant: props.variant }));
|
|
22
30
|
useTabsProvide({
|
|
23
31
|
slotFns,
|
|
24
|
-
orientation: toRef(props, "orientation")
|
|
32
|
+
orientation: toRef(props, "orientation"),
|
|
33
|
+
currentValue: internalValue,
|
|
34
|
+
changeTab
|
|
25
35
|
});
|
|
26
36
|
return (_ctx, _cache) => {
|
|
27
37
|
return openBlock(), createBlock(unref(TabsRoot), {
|
|
28
|
-
"model-value":
|
|
29
|
-
"default-value": props.defaultValue,
|
|
38
|
+
"model-value": internalValue.value,
|
|
30
39
|
orientation: props.orientation,
|
|
31
40
|
"activation-mode": props.activationMode,
|
|
32
41
|
class: normalizeClass(unref(composeClassName)(slotFns.value.base(), props.class)),
|
|
33
42
|
"data-orientation": props.orientation,
|
|
34
|
-
"onUpdate:modelValue":
|
|
43
|
+
"onUpdate:modelValue": changeTab
|
|
35
44
|
}, {
|
|
36
45
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
37
46
|
_: 3
|
|
38
47
|
}, 8, [
|
|
39
48
|
"model-value",
|
|
40
|
-
"default-value",
|
|
41
49
|
"orientation",
|
|
42
50
|
"activation-mode",
|
|
43
51
|
"class",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: string\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"
|
|
1
|
+
{"version":3,"file":"Tabs.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/tabs/Tabs.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, toRef, watch } from 'vue'\nimport { TabsRoot } from 'reka-ui'\nimport { tabsVariants, type TabsVariants } from '@auronui/styles'\nimport { composeClassName } from '../../utils/composeClassName'\nimport { useTabsProvide } from './tabs.context'\n\nconst props = withDefaults(defineProps<{\n modelValue?: string\n defaultValue?: string\n orientation?: 'horizontal' | 'vertical'\n variant?: TabsVariants['variant']\n activationMode?: 'automatic' | 'manual'\n class?: string\n}>(), {\n orientation: 'horizontal',\n variant: 'primary',\n activationMode: 'automatic',\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst internalValue = ref<string | undefined>(props.modelValue ?? props.defaultValue)\n\nwatch(() => props.modelValue, (v) => {\n if (v !== undefined) internalValue.value = v\n})\n\nfunction changeTab(value: string) {\n internalValue.value = value\n emit('update:modelValue', value)\n}\n\nconst slotFns = computed(() => tabsVariants({ variant: props.variant }))\n\nuseTabsProvide({\n slotFns,\n orientation: toRef(props, 'orientation'),\n currentValue: internalValue,\n changeTab,\n})\n</script>\n\n<template>\n <TabsRoot\n :model-value=\"internalValue\"\n :orientation=\"props.orientation\"\n :activation-mode=\"props.activationMode\"\n :class=\"composeClassName(slotFns.base(), props.class)\"\n :data-orientation=\"props.orientation\"\n @update:model-value=\"changeTab\"\n >\n <slot />\n </TabsRoot>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAOA,MAAM,QAAQ;EAad,MAAM,OAAO;EAIb,MAAM,gBAAgB,IAAwB,MAAM,cAAc,MAAM,aAAY;AAEpF,cAAY,MAAM,aAAa,MAAM;AACnC,OAAI,MAAM,KAAA,EAAW,eAAc,QAAQ;IAC5C;EAED,SAAS,UAAU,OAAe;AAChC,iBAAc,QAAQ;AACtB,QAAK,qBAAqB,MAAK;;EAGjC,MAAM,UAAU,eAAe,aAAa,EAAE,SAAS,MAAM,SAAS,CAAC,CAAA;AAEvE,iBAAe;GACb;GACA,aAAa,MAAM,OAAO,cAAc;GACxC,cAAc;GACd;GACD,CAAA;;uBAIC,YASW,MAAA,SAAA,EAAA;IARR,eAAa,cAAA;IACb,aAAa,MAAM;IACnB,mBAAiB,MAAM;IACvB,OAAK,eAAE,MAAA,iBAAgB,CAAC,QAAA,MAAQ,MAAI,EAAI,MAAM,MAAK,CAAA;IACnD,oBAAkB,MAAM;IACxB,uBAAoB;;2BAEb,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.context.js","names":[],"sources":["../../../src/components/tabs/tabs.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { Ref } from 'vue'\nimport type { tabsVariants } from '@auronui/styles'\n\n// Return shape of tabsVariants({ variant }) — each key is a slot function that returns a string\nexport type TabsSlotFns = ReturnType<typeof tabsVariants>\n\nexport interface TabsContext {\n slotFns: Ref<TabsSlotFns>\n orientation: Ref<'horizontal' | 'vertical'>\n}\n\nexport const {\n useProvide: useTabsProvide,\n useInject: useTabsInject,\n key: tabsContextKey,\n} = createContext<TabsContext>('Tabs')\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"tabs.context.js","names":[],"sources":["../../../src/components/tabs/tabs.context.ts"],"sourcesContent":["import { createContext } from '../../utils/context'\nimport type { Ref } from 'vue'\nimport type { tabsVariants } from '@auronui/styles'\n\n// Return shape of tabsVariants({ variant }) — each key is a slot function that returns a string\nexport type TabsSlotFns = ReturnType<typeof tabsVariants>\n\nexport interface TabsContext {\n slotFns: Ref<TabsSlotFns>\n orientation: Ref<'horizontal' | 'vertical'>\n currentValue: Ref<string | undefined>\n changeTab: (value: string) => void\n}\n\nexport const {\n useProvide: useTabsProvide,\n useInject: useTabsInject,\n key: tabsContextKey,\n} = createContext<TabsContext>('Tabs')\n"],"mappings":";;AAcA,IAAa,EACX,YAAY,gBACZ,WAAW,eACX,KAAK,mBACH,cAA2B,OAAO"}
|