@hebium-ui/vue 0.1.0-alpha.2 → 0.1.0-alpha.3
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/_virtual/_/plugin-vue/export-helper.js +1 -2
- package/dist/components/alert/alert.js +2 -5
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +0 -2
- package/dist/components/alert/alert.vue.d.ts +0 -2
- package/dist/components/anchor/anchor.js +2 -5
- package/dist/components/anchor/anchor.js.map +1 -1
- package/dist/components/anchor/anchor.types.d.ts +0 -2
- package/dist/components/anchor/anchor.vue.d.ts +1 -3
- package/dist/components/avatar/avatar.js +2 -7
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/avatar/avatar.types.d.ts +0 -2
- package/dist/components/avatar/avatar.vue.d.ts +0 -2
- package/dist/components/blockquote/blockquote.js +2 -10
- package/dist/components/blockquote/blockquote.js.map +1 -1
- package/dist/components/blockquote/blockquote.types.d.ts +0 -2
- package/dist/components/blockquote/blockquote.vue.d.ts +0 -2
- package/dist/components/button/button.js +2 -5
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/button.types.d.ts +0 -2
- package/dist/components/button/button.vue.d.ts +1 -3
- package/dist/components/checkbox/checkbox.js +18 -15
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/checkbox.types.d.ts +1 -3
- package/dist/components/checkbox/checkbox.vue.d.ts +0 -2
- package/dist/components/code/code.js +2 -7
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/code/code.types.d.ts +0 -2
- package/dist/components/code/code.vue.d.ts +1 -3
- package/dist/components/details/details.js +2 -9
- package/dist/components/details/details.js.map +1 -1
- package/dist/components/details/details.types.d.ts +0 -2
- package/dist/components/details/details.vue.d.ts +0 -2
- package/dist/components/dialog/dialog-close.js +2 -3
- package/dist/components/dialog/dialog-close.js.map +1 -1
- package/dist/components/dialog/dialog-close.vue.d.ts +0 -2
- package/dist/components/dialog/dialog-content.js +1 -6
- package/dist/components/dialog/dialog-content.js.map +1 -1
- package/dist/components/dialog/dialog-content.vue.d.ts +0 -2
- package/dist/components/dialog/dialog-trigger.js +2 -8
- package/dist/components/dialog/dialog-trigger.js.map +1 -1
- package/dist/components/dialog/dialog-trigger.vue.d.ts +1 -3
- package/dist/components/dialog/dialog.context.d.ts +0 -2
- package/dist/components/dialog/dialog.context.js +1 -2
- package/dist/components/dialog/dialog.js +1 -2
- package/dist/components/dialog/dialog.types.d.ts +0 -2
- package/dist/components/dialog/dialog.vue.d.ts +0 -2
- package/dist/components/dl/dl-dd.js +2 -3
- package/dist/components/dl/dl-dd.js.map +1 -1
- package/dist/components/dl/dl-dd.vue.d.ts +0 -2
- package/dist/components/dl/dl-dt.js +2 -3
- package/dist/components/dl/dl-dt.js.map +1 -1
- package/dist/components/dl/dl-dt.vue.d.ts +0 -2
- package/dist/components/dl/dl.js +2 -3
- package/dist/components/dl/dl.js.map +1 -1
- package/dist/components/dl/dl.types.d.ts +0 -2
- package/dist/components/dl/dl.vue.d.ts +0 -2
- package/dist/components/drawer/drawer-close.js +2 -3
- package/dist/components/drawer/drawer-close.js.map +1 -1
- package/dist/components/drawer/drawer-close.vue.d.ts +0 -2
- package/dist/components/drawer/drawer-content.js +1 -6
- package/dist/components/drawer/drawer-content.js.map +1 -1
- package/dist/components/drawer/drawer-content.vue.d.ts +0 -2
- package/dist/components/drawer/drawer-trigger.js +2 -7
- package/dist/components/drawer/drawer-trigger.js.map +1 -1
- package/dist/components/drawer/drawer-trigger.vue.d.ts +1 -3
- package/dist/components/drawer/drawer.context.d.ts +0 -2
- package/dist/components/drawer/drawer.context.js +1 -2
- package/dist/components/drawer/drawer.js +1 -2
- package/dist/components/drawer/drawer.types.d.ts +0 -2
- package/dist/components/drawer/drawer.vue.d.ts +0 -2
- package/dist/components/fieldset/fieldset.js +2 -3
- package/dist/components/fieldset/fieldset.js.map +1 -1
- package/dist/components/fieldset/fieldset.types.d.ts +0 -2
- package/dist/components/fieldset/fieldset.vue.d.ts +0 -2
- package/dist/components/heading/heading.js +2 -8
- package/dist/components/heading/heading.js.map +1 -1
- package/dist/components/heading/heading.types.d.ts +0 -2
- package/dist/components/heading/heading.vue.d.ts +0 -2
- package/dist/components/hr/hr.js +2 -7
- package/dist/components/hr/hr.js.map +1 -1
- package/dist/components/hr/hr.types.d.ts +0 -2
- package/dist/components/hr/hr.vue.d.ts +1 -3
- package/dist/components/index.d.ts +24 -18
- package/dist/components/input/input.js +10 -14
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.types.d.ts +0 -2
- package/dist/components/input/input.vue.d.ts +0 -2
- package/dist/components/label/label.js +2 -7
- package/dist/components/label/label.js.map +1 -1
- package/dist/components/label/label.types.d.ts +0 -2
- package/dist/components/label/label.vue.d.ts +1 -3
- package/dist/components/menu/menu-content.js +1 -4
- package/dist/components/menu/menu-content.js.map +1 -1
- package/dist/components/menu/menu-content.vue.d.ts +1 -3
- package/dist/components/menu/menu-item.js +1 -4
- package/dist/components/menu/menu-item.js.map +1 -1
- package/dist/components/menu/menu-item.vue.d.ts +1 -3
- package/dist/components/menu/menu-trigger.js +2 -8
- package/dist/components/menu/menu-trigger.js.map +1 -1
- package/dist/components/menu/menu-trigger.vue.d.ts +1 -3
- package/dist/components/menu/menu.context.d.ts +0 -2
- package/dist/components/menu/menu.context.js +1 -2
- package/dist/components/menu/menu.js +1 -2
- package/dist/components/menu/menu.types.d.ts +0 -2
- package/dist/components/menu/menu.vue.d.ts +0 -2
- package/dist/components/paragraph/paragraph.js +2 -5
- package/dist/components/paragraph/paragraph.js.map +1 -1
- package/dist/components/paragraph/paragraph.types.d.ts +0 -2
- package/dist/components/paragraph/paragraph.vue.d.ts +1 -3
- package/dist/components/popover/popover-content.js +2 -5
- package/dist/components/popover/popover-content.js.map +1 -1
- package/dist/components/popover/popover-content.vue.d.ts +1 -3
- package/dist/components/popover/popover-trigger.js +2 -7
- package/dist/components/popover/popover-trigger.js.map +1 -1
- package/dist/components/popover/popover-trigger.vue.d.ts +1 -3
- package/dist/components/popover/popover.context.d.ts +0 -2
- package/dist/components/popover/popover.context.js +1 -2
- package/dist/components/popover/popover.js +1 -2
- package/dist/components/popover/popover.types.d.ts +0 -2
- package/dist/components/popover/popover.vue.d.ts +0 -2
- package/dist/components/progress/progress.js +3 -7
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/progress/progress.types.d.ts +0 -2
- package/dist/components/progress/progress.vue.d.ts +0 -2
- package/dist/components/radio/radio.js +4 -11
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio/radio.types.d.ts +0 -2
- package/dist/components/radio/radio.vue.d.ts +0 -2
- package/dist/components/radiogroup/radiogroup.js +11 -9
- package/dist/components/radiogroup/radiogroup.js.map +1 -1
- package/dist/components/radiogroup/radiogroup.types.d.ts +0 -2
- package/dist/components/radiogroup/radiogroup.vue.d.ts +1 -3
- package/dist/components/section/section.js +2 -5
- package/dist/components/section/section.js.map +1 -1
- package/dist/components/section/section.types.d.ts +0 -2
- package/dist/components/section/section.vue.d.ts +1 -3
- package/dist/components/segmented-control/segmented-control-item.js +1 -4
- package/dist/components/segmented-control/segmented-control-item.js.map +1 -1
- package/dist/components/segmented-control/segmented-control-item.vue.d.ts +1 -3
- package/dist/components/segmented-control/segmented-control.context.js +1 -2
- package/dist/components/segmented-control/segmented-control.js +2 -5
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.types.d.ts +1 -3
- package/dist/components/segmented-control/segmented-control.vue.d.ts +1 -3
- package/dist/components/select/select.js +11 -12
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/select.types.d.ts +0 -2
- package/dist/components/select/select.vue.d.ts +0 -2
- package/dist/components/skip-link/index.d.ts +3 -0
- package/dist/components/skip-link/skip-link.js +79 -0
- package/dist/components/skip-link/skip-link.js.map +1 -0
- package/dist/components/skip-link/skip-link.types.d.ts +10 -0
- package/dist/components/skip-link/skip-link.vue.d.ts +28 -0
- package/dist/components/table/table-caption.js +2 -7
- package/dist/components/table/table-caption.js.map +1 -1
- package/dist/components/table/table-caption.vue.d.ts +0 -2
- package/dist/components/table/table-tbody.js +2 -3
- package/dist/components/table/table-tbody.js.map +1 -1
- package/dist/components/table/table-tbody.vue.d.ts +0 -2
- package/dist/components/table/table-td.js +2 -3
- package/dist/components/table/table-td.js.map +1 -1
- package/dist/components/table/table-td.vue.d.ts +0 -2
- package/dist/components/table/table-tfoot.js +2 -3
- package/dist/components/table/table-tfoot.js.map +1 -1
- package/dist/components/table/table-tfoot.vue.d.ts +0 -2
- package/dist/components/table/table-th.js +2 -3
- package/dist/components/table/table-th.js.map +1 -1
- package/dist/components/table/table-th.vue.d.ts +0 -2
- package/dist/components/table/table-thead.js +2 -3
- package/dist/components/table/table-thead.js.map +1 -1
- package/dist/components/table/table-thead.vue.d.ts +0 -2
- package/dist/components/table/table-tr.js +2 -7
- package/dist/components/table/table-tr.js.map +1 -1
- package/dist/components/table/table-tr.vue.d.ts +0 -2
- package/dist/components/table/table.js +2 -7
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/table/table.types.d.ts +0 -2
- package/dist/components/table/table.vue.d.ts +0 -2
- package/dist/components/tabs/tabs-list.js +2 -7
- package/dist/components/tabs/tabs-list.js.map +1 -1
- package/dist/components/tabs/tabs-list.vue.d.ts +1 -3
- package/dist/components/tabs/tabs-panel.js +2 -8
- package/dist/components/tabs/tabs-panel.js.map +1 -1
- package/dist/components/tabs/tabs-panel.vue.d.ts +1 -3
- package/dist/components/tabs/tabs-tab.js +1 -4
- package/dist/components/tabs/tabs-tab.js.map +1 -1
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -3
- package/dist/components/tabs/tabs.context.js +1 -2
- package/dist/components/tabs/tabs.js +2 -5
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tabs/tabs.types.d.ts +1 -3
- package/dist/components/tabs/tabs.vue.d.ts +1 -3
- package/dist/components/text/index.d.ts +3 -0
- package/dist/components/text/text.js +96 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text/text.types.d.ts +24 -0
- package/dist/components/text/text.vue.d.ts +28 -0
- package/dist/components/textarea/textarea.js +10 -14
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/textarea/textarea.types.d.ts +0 -2
- package/dist/components/textarea/textarea.vue.d.ts +0 -2
- package/dist/components/tooltip/tooltip-content.js +1 -4
- package/dist/components/tooltip/tooltip-content.js.map +1 -1
- package/dist/components/tooltip/tooltip-content.vue.d.ts +1 -3
- package/dist/components/tooltip/tooltip-trigger.js +1 -4
- package/dist/components/tooltip/tooltip-trigger.js.map +1 -1
- package/dist/components/tooltip/tooltip-trigger.vue.d.ts +1 -3
- package/dist/components/tooltip/tooltip.context.d.ts +0 -2
- package/dist/components/tooltip/tooltip.context.js +1 -2
- package/dist/components/tooltip/tooltip.js +1 -2
- package/dist/components/tooltip/tooltip.types.d.ts +0 -2
- package/dist/components/tooltip/tooltip.vue.d.ts +0 -2
- package/dist/components/visually-hidden/visually-hidden.js +2 -7
- package/dist/components/visually-hidden/visually-hidden.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.types.d.ts +0 -2
- package/dist/components/visually-hidden/visually-hidden.vue.d.ts +1 -3
- package/dist/index.d.ts +22 -18
- package/dist/index.js +3 -1
- package/dist/plugin.d.ts +40 -38
- package/dist/plugin.js +5 -2
- package/dist/plugin.js.map +1 -1
- package/dist/provider/hui-provider.context.d.ts +8 -4
- package/dist/provider/hui-provider.context.js +9 -3
- package/dist/provider/hui-provider.context.js.map +1 -1
- package/dist/provider/hui-provider.js +1 -2
- package/dist/provider/hui-provider.vue.d.ts +0 -2
- package/dist/types/element.d.ts +0 -2
- package/dist/types/hui-component.d.ts +0 -2
- package/dist/types/polymorphic.d.ts +0 -2
- package/dist/utils/attr-to-bool.js +1 -2
- package/dist/utils/use-slot-presence.js +13 -0
- package/dist/utils/use-slot-presence.js.map +1 -0
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js"
|
|
|
3
3
|
import { useTabsContext } from "./tabs.context.js";
|
|
4
4
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { tabRecipe, tabsControl } from "@hebium-ui/core";
|
|
6
|
-
|
|
6
|
+
// src/components/tabs/tabs-tab.vue
|
|
7
7
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "HuiTabsTab",
|
|
9
9
|
inheritAttrs: false,
|
|
@@ -52,8 +52,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
52
52
|
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
53
53
|
"as",
|
|
54
54
|
"value",
|
|
55
|
-
"class",
|
|
56
|
-
"style",
|
|
57
55
|
"onClick",
|
|
58
56
|
"onKeydown",
|
|
59
57
|
"onFocus"
|
|
@@ -129,7 +127,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
129
127
|
}, 16, ["class", "style"]);
|
|
130
128
|
}
|
|
131
129
|
var tabs_tab_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/tabs/tabs-tab.vue"]]);
|
|
132
|
-
//#endregion
|
|
133
130
|
export { tabs_tab_default as default };
|
|
134
131
|
|
|
135
132
|
//# sourceMappingURL=tabs-tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-tab.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tabs/tabs-tab.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'button'\"\n>\nimport { tabRecipe, tabsControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n toRaw,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { useTabsContext } from \"./tabs.context\";\nimport type { TabsTabOwnProps } from \"./tabs.types\";\n\ndefineOptions({\n name: \"HuiTabsTab\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TabsTabOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TabsTabOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TabsTab\", props, attrs);\nconst component = computed<E | \"button\">(() =>\n toRaw(resolvedProps.value.as ?? \"button\")\n);\nconst context = useTabsContext();\nconst recipe = computed(() => tabRecipe({}));\nconst cls = useHuiClasses(\n \"TabsTab\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"TabsTab\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"value\",\n \"
|
|
1
|
+
{"version":3,"file":"tabs-tab.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tabs/tabs-tab.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'button'\"\n>\nimport { tabRecipe, tabsControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n toRaw,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { useTabsContext } from \"./tabs.context\";\nimport type { TabsTabOwnProps } from \"./tabs.types\";\n\ndefineOptions({\n name: \"HuiTabsTab\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TabsTabOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TabsTabOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TabsTab\", props, attrs);\nconst component = computed<E | \"button\">(() =>\n toRaw(resolvedProps.value.as ?? \"button\")\n);\nconst context = useTabsContext();\nconst recipe = computed(() => tabRecipe({}));\nconst cls = useHuiClasses(\n \"TabsTab\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"TabsTab\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"value\",\n \"onClick\",\n \"onKeydown\",\n \"onFocus\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...tabsControl.getTabAttributes(\n {\n rootId: context.rootId.value,\n selectedValue: context.selectedValue.value,\n },\n resolvedProps.value.value,\n { isButtonElement: resolvedProps.value.as === undefined },\n ),\n ...forwardedAttrs.value,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\nfunction handleClick(event: MouseEvent): void {\n const onClick = resolvedProps.value[\"onClick\"];\n if (typeof onClick === \"function\") onClick(event);\n if (event.defaultPrevented) return;\n\n context.onSelect(resolvedProps.value.value);\n}\n\nfunction handleKeydown(event: KeyboardEvent): void {\n const onKeydown = resolvedProps.value[\"onKeydown\"];\n if (typeof onKeydown === \"function\") onKeydown(event);\n if (event.defaultPrevented) return;\n\n const action = tabsControl.handleTabKeydown(event);\n switch (action) {\n case \"activate\":\n context.onSelect(resolvedProps.value.value);\n return;\n case \"focus-move\":\n tabsControl.moveFocus(event, context.rootId.value);\n return;\n case \"none\":\n return;\n }\n}\n\nfunction handleFocus(event: FocusEvent): void {\n const onFocus = resolvedProps.value[\"onFocus\"];\n if (typeof onFocus === \"function\") onFocus(event);\n if (event.defaultPrevented) return;\n\n if (context.activation.value === \"auto\") {\n context.onSelect(resolvedProps.value.value);\n }\n}\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n @click=\"handleClick\"\n @keydown=\"handleKeydown\"\n @focus=\"handleFocus\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,WAAW,OAAO,KAAK;EACzD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,QAAQ,CAC1C;EACA,MAAM,UAAU,eAAe;EAC/B,MAAM,SAAS,eAAe,UAAU,CAAC,CAAC,CAAC;EAC3C,MAAM,MAAM,cACV,WACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,WACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,YAAY,iBACb;IACE,QAAQ,QAAQ,OAAO;IACvB,eAAe,QAAQ,cAAc;GACvC,GACA,cAAc,MAAM,OACpB,EAAE,iBAAiB,cAAc,MAAM,OAAO,KAAA,EAAU,CAC1D;GACA,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAS,YAAY,OAAyB;GAC5C,MAAM,UAAU,cAAc,MAAM;GACpC,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK;GAChD,IAAI,MAAM,kBAAkB;GAE5B,QAAQ,SAAS,cAAc,MAAM,KAAK;EAC5C;EAEA,SAAS,cAAc,OAA4B;GACjD,MAAM,YAAY,cAAc,MAAM;GACtC,IAAI,OAAO,cAAc,YAAY,UAAU,KAAK;GACpD,IAAI,MAAM,kBAAkB;GAG5B,QADe,YAAY,iBAAiB,KACpC,GAAR;IACE,KAAK;KACH,QAAQ,SAAS,cAAc,MAAM,KAAK;KAC1C;IACF,KAAK;KACH,YAAY,UAAU,OAAO,QAAQ,OAAO,KAAK;KACjD;IACF,KAAK,QACH;GACJ;EACF;EAEA,SAAS,YAAY,OAAyB;GAC5C,MAAM,UAAU,cAAc,MAAM;GACpC,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK;GAChD,IAAI,MAAM,kBAAkB;GAE5B,IAAI,QAAQ,WAAW,UAAU,QAC/B,QAAQ,SAAS,cAAc,MAAM,KAAK;EAE9C;EAEA,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,YAWYC,wBAVL,OAAA,SAAS,GADhBC,WAWY,EATV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;EACX,SAAO,OAAA;EACP,WAAS,OAAA;EACT,SAAO,OAAA;;EAER,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -2,14 +2,13 @@ import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../t
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
import { TabsTabOwnProps } from "./tabs.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
|
-
//#region src/components/tabs/tabs-tab.vue.d.ts
|
|
6
5
|
declare const __VLS_export: <E extends ElementType = "button">(__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<{
|
|
7
6
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<TabsTabOwnProps & {
|
|
8
7
|
as?: E | undefined;
|
|
9
8
|
} & {
|
|
10
9
|
class?: ClassValue | undefined;
|
|
11
10
|
style?: StyleValue | undefined;
|
|
12
|
-
} & Omit<HuiElementPropsNoInfer<E>, "
|
|
11
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "as" | "value">> & (typeof globalThis extends {
|
|
13
12
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
13
|
} ? P : {});
|
|
15
14
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -25,6 +24,5 @@ declare const __VLS_export: <E extends ElementType = "button">(__VLS_props: NonN
|
|
|
25
24
|
};
|
|
26
25
|
declare const _default: typeof __VLS_export;
|
|
27
26
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
28
|
-
//#endregion
|
|
29
27
|
export { _default as default };
|
|
30
28
|
//# sourceMappingURL=tabs-tab.vue.d.ts.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { inject } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/components/tabs/tabs.context.ts
|
|
3
3
|
const TabsContext = Symbol("Tabs");
|
|
4
4
|
function useTabsContext() {
|
|
5
5
|
const context = inject(TabsContext);
|
|
6
6
|
if (!context) throw new Error("[Hebium UI] Tabs compound components must be used within <Tabs>");
|
|
7
7
|
return context;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { TabsContext, useTabsContext };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=tabs.context.js.map
|
|
@@ -3,7 +3,7 @@ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js"
|
|
|
3
3
|
import { TabsContext } from "./tabs.context.js";
|
|
4
4
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, provide, renderSlot, resolveDynamicComponent, shallowRef, toRaw, useAttrs, useId, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { tabrootRecipe, tabsControl } from "@hebium-ui/core";
|
|
6
|
-
|
|
6
|
+
// src/components/tabs/tabs.vue
|
|
7
7
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "HuiTabs",
|
|
9
9
|
inheritAttrs: false,
|
|
@@ -77,9 +77,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
77
77
|
"value",
|
|
78
78
|
"defaultValue",
|
|
79
79
|
"onChange",
|
|
80
|
-
"activation"
|
|
81
|
-
"class",
|
|
82
|
-
"style"
|
|
80
|
+
"activation"
|
|
83
81
|
]);
|
|
84
82
|
const rootAttrs = computed(() => ({
|
|
85
83
|
...tabsControl.getRootAttributes({
|
|
@@ -138,7 +136,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
138
136
|
}, 16, ["class", "style"]);
|
|
139
137
|
}
|
|
140
138
|
var tabs_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/tabs/tabs.vue"]]);
|
|
141
|
-
//#endregion
|
|
142
139
|
export { tabs_default as default };
|
|
143
140
|
|
|
144
141
|
//# sourceMappingURL=tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tabs/tabs.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"V extends string, E extends ElementType = 'div'\"\n>\nimport { tabrootRecipe, tabsControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n provide,\n shallowRef,\n type StyleValue,\n toRaw,\n useAttrs,\n useId,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { TabsContext } from \"./tabs.context\";\nimport type { ActivationMode, TabsOwnProps } from \"./tabs.types\";\n\ndefineOptions({\n name: \"HuiTabs\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TabsOwnProps<V>\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TabsOwnProps<V> | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Tabs\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst generatedId = useId();\nconst rootId = computed(() => resolvedProps.value[\"id\"] || generatedId);\nconst uncontrolledValue = shallowRef<V | undefined>(\n resolvedProps.value.value\n ?? resolvedProps.value.defaultValue\n ?? resolvedProps.value.values[0],\n);\nconst selectedValue = computed<V | undefined>(() =>\n resolvedProps.value.value ?? uncontrolledValue.value\n);\nconst activation = computed<ActivationMode>(() =>\n resolvedProps.value.activation ?? \"manual\"\n);\nconst recipe = computed(() => tabrootRecipe({}));\nconst cls = useHuiClasses(\n \"Tabs\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Tabs\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"id\",\n \"values\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"activation\",\n
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tabs/tabs.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"V extends string, E extends ElementType = 'div'\"\n>\nimport { tabrootRecipe, tabsControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n provide,\n shallowRef,\n type StyleValue,\n toRaw,\n useAttrs,\n useId,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { TabsContext } from \"./tabs.context\";\nimport type { ActivationMode, TabsOwnProps } from \"./tabs.types\";\n\ndefineOptions({\n name: \"HuiTabs\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TabsOwnProps<V>\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TabsOwnProps<V> | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Tabs\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst generatedId = useId();\nconst rootId = computed(() => resolvedProps.value[\"id\"] || generatedId);\nconst uncontrolledValue = shallowRef<V | undefined>(\n resolvedProps.value.value\n ?? resolvedProps.value.defaultValue\n ?? resolvedProps.value.values[0],\n);\nconst selectedValue = computed<V | undefined>(() =>\n resolvedProps.value.value ?? uncontrolledValue.value\n);\nconst activation = computed<ActivationMode>(() =>\n resolvedProps.value.activation ?? \"manual\"\n);\nconst recipe = computed(() => tabrootRecipe({}));\nconst cls = useHuiClasses(\n \"Tabs\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Tabs\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"id\",\n \"values\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"activation\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...tabsControl.getRootAttributes({\n rootId: rootId.value,\n selectedValue: selectedValue.value,\n }),\n ...forwardedAttrs.value,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\nfunction onSelect(nextValue: string): void {\n const resolved = resolvedProps.value;\n if (!resolved.values.some((value: V) => value === nextValue)) {\n throw new Error(`[Hebium UI] Unexpected Tab value: ${nextValue}`);\n }\n\n const value = nextValue as V;\n uncontrolledValue.value = value;\n resolved.onChange?.(value);\n}\n\nprovide(TabsContext, {\n rootId,\n selectedValue,\n onSelect,\n activation,\n});\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,QAAQ,OAAO,KAAK;EACtD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,KAAK,CACvC;EACA,MAAM,cAAc,MAAM;EAC1B,MAAM,SAAS,eAAe,cAAc,MAAM,SAAS,WAAW;EACtE,MAAM,oBAAoB,WACxB,cAAc,MAAM,SACf,cAAc,MAAM,gBACpB,cAAc,MAAM,OAAO,EAClC;EACA,MAAM,gBAAgB,eACpB,cAAc,MAAM,SAAS,kBAAkB,KACjD;EACA,MAAM,aAAa,eACjB,cAAc,MAAM,cAAc,QACpC;EACA,MAAM,SAAS,eAAe,cAAc,CAAC,CAAC,CAAC;EAC/C,MAAM,MAAM,cACV,QACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,YAAY,kBAAkB;IAC/B,QAAQ,OAAO;IACf,eAAe,cAAc;GAC/B,CAAC;GACD,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAS,SAAS,WAAyB;GACzC,MAAM,WAAW,cAAc;GAC/B,IAAI,CAAC,SAAS,OAAO,MAAM,UAAa,UAAU,SAAS,GACzD,MAAM,IAAI,MAAM,qCAAqC,WAAW;GAGlE,MAAM,QAAQ;GACd,kBAAkB,QAAQ;GAC1B,SAAS,WAAW,KAAK;EAC3B;EAEA,QAAQ,aAAa;GACnB;GACA;GACA;GACA;EACF,CAAC;EAED,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,YAQYC,wBAPL,OAAA,SAAS,GADhBC,WAQY,EANV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;;EAEZ,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -2,13 +2,12 @@ import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
|
2
2
|
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
3
|
import "../../types/index.js";
|
|
4
4
|
import { TabSlots, TablistSlots, TabpanelSlots, TabrootSlots } from "@hebium-ui/core";
|
|
5
|
-
//#region src/components/tabs/tabs.types.d.ts
|
|
6
5
|
export type ActivationMode = "manual" | "auto";
|
|
7
6
|
export interface TabsOwnProps<V extends string> {
|
|
8
7
|
/**
|
|
9
8
|
* The list of allowed tab values.
|
|
10
9
|
*/
|
|
11
|
-
values: V[];
|
|
10
|
+
values: readonly V[];
|
|
12
11
|
/**
|
|
13
12
|
* The currently selected tab value.
|
|
14
13
|
*/
|
|
@@ -57,5 +56,4 @@ export type TabsPanelProps<E extends ElementType = "div"> = HuiPolymorphicProps<
|
|
|
57
56
|
export interface TabsPanelExposed<E extends ElementType = "div"> {
|
|
58
57
|
readonly root: HuiElementInstance<E> | null;
|
|
59
58
|
}
|
|
60
|
-
//#endregion
|
|
61
59
|
//# sourceMappingURL=tabs.types.d.ts.map
|
|
@@ -2,14 +2,13 @@ import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../t
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
import { TabsOwnProps } from "./tabs.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
|
-
//#region src/components/tabs/tabs.vue.d.ts
|
|
6
5
|
declare const __VLS_export: <V extends string, E extends ElementType = "div">(__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<{
|
|
7
6
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<TabsOwnProps<V> & {
|
|
8
7
|
as?: E | undefined;
|
|
9
8
|
} & {
|
|
10
9
|
class?: ClassValue | undefined;
|
|
11
10
|
style?: StyleValue | undefined;
|
|
12
|
-
} & Omit<HuiElementPropsNoInfer<E>, "
|
|
11
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "as" | keyof TabsOwnProps<V>>> & (typeof globalThis extends {
|
|
13
12
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
13
|
} ? P : {});
|
|
15
14
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -25,6 +24,5 @@ declare const __VLS_export: <V extends string, E extends ElementType = "div">(__
|
|
|
25
24
|
};
|
|
26
25
|
declare const _default: typeof __VLS_export;
|
|
27
26
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
28
|
-
//#endregion
|
|
29
27
|
export { _default as default };
|
|
30
28
|
//# sourceMappingURL=tabs.vue.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
|
+
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { textRecipe } from "@hebium-ui/core";
|
|
5
|
+
// src/components/text/text.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiText",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "text",
|
|
10
|
+
props: {
|
|
11
|
+
color: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
textOverflow: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
as: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
class: {
|
|
24
|
+
type: [
|
|
25
|
+
Boolean,
|
|
26
|
+
null,
|
|
27
|
+
String,
|
|
28
|
+
Object,
|
|
29
|
+
Array
|
|
30
|
+
],
|
|
31
|
+
required: false,
|
|
32
|
+
skipCheck: true
|
|
33
|
+
},
|
|
34
|
+
style: {
|
|
35
|
+
type: [
|
|
36
|
+
Boolean,
|
|
37
|
+
null,
|
|
38
|
+
String,
|
|
39
|
+
Object,
|
|
40
|
+
Array
|
|
41
|
+
],
|
|
42
|
+
required: false,
|
|
43
|
+
skipCheck: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
setup(__props, { expose: __expose }) {
|
|
47
|
+
const props = __props;
|
|
48
|
+
const attrs = useAttrs();
|
|
49
|
+
const resolvedProps = useHuiProps("Text", props, attrs);
|
|
50
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "span"));
|
|
51
|
+
const recipe = computed(() => textRecipe({
|
|
52
|
+
color: resolvedProps.value.color,
|
|
53
|
+
textOverflow: resolvedProps.value.textOverflow
|
|
54
|
+
}));
|
|
55
|
+
const cls = useHuiClasses("Text", recipe, computed(() => ({ root: props.class })));
|
|
56
|
+
const sls = useHuiStyles("Text", computed(() => ({ root: props.style })));
|
|
57
|
+
const rootAttrs = useHuiAttrs(resolvedProps, [
|
|
58
|
+
"as",
|
|
59
|
+
"color",
|
|
60
|
+
"textOverflow",
|
|
61
|
+
"class",
|
|
62
|
+
"style"
|
|
63
|
+
]);
|
|
64
|
+
const rootRef = useTemplateRef("root");
|
|
65
|
+
__expose({ root: rootRef });
|
|
66
|
+
const __returned__ = {
|
|
67
|
+
props,
|
|
68
|
+
attrs,
|
|
69
|
+
resolvedProps,
|
|
70
|
+
component,
|
|
71
|
+
recipe,
|
|
72
|
+
cls,
|
|
73
|
+
sls,
|
|
74
|
+
rootAttrs,
|
|
75
|
+
rootRef
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
78
|
+
enumerable: false,
|
|
79
|
+
value: true
|
|
80
|
+
});
|
|
81
|
+
return __returned__;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
85
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
86
|
+
class: $setup.cls.root,
|
|
87
|
+
style: $setup.sls.root
|
|
88
|
+
}), {
|
|
89
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
90
|
+
_: 3
|
|
91
|
+
}, 16, ["class", "style"]);
|
|
92
|
+
}
|
|
93
|
+
var text_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/text/text.vue"]]);
|
|
94
|
+
export { text_default as default };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'span'\"\n>\nimport { textRecipe } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n toRaw,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport type { TextOwnProps } from \"./text.types\";\n\ndefineOptions({\n name: \"HuiText\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TextOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TextOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Text\", props, attrs);\nconst component = computed<E | \"span\">(() =>\n toRaw(resolvedProps.value.as ?? \"span\")\n);\nconst recipe = computed(() =>\n textRecipe({\n color: resolvedProps.value.color,\n textOverflow: resolvedProps.value.textOverflow,\n })\n);\nconst cls = useHuiClasses(\n \"Text\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Text\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"color\",\n \"textOverflow\",\n \"class\",\n \"style\",\n]);\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,QAAQ,OAAO,KAAK;EACtD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,MAAM,CACxC;EACA,MAAM,SAAS,eACb,WAAW;GACT,OAAO,cAAc,MAAM;GAC3B,cAAc,cAAc,MAAM;EACpC,CAAC,CACH;EACA,MAAM,MAAM,cACV,QACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe;GAC3C;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,YAQYC,wBAPL,OAAA,SAAS,GADhBC,WAQY,EANV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;;EAEZ,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { TextSlots, TextVariants } from "@hebium-ui/core";
|
|
5
|
+
export interface TextOwnProps {
|
|
6
|
+
/**
|
|
7
|
+
* The semantic color of the text.
|
|
8
|
+
*
|
|
9
|
+
* @default "text"
|
|
10
|
+
*/
|
|
11
|
+
color?: TextVariants["color"] | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* How overflowing text is displayed.
|
|
14
|
+
* Use "ellipsis" to truncate text to a single line with an ellipsis.
|
|
15
|
+
*
|
|
16
|
+
* @default "unset"
|
|
17
|
+
*/
|
|
18
|
+
textOverflow?: TextVariants["textOverflow"] | undefined;
|
|
19
|
+
}
|
|
20
|
+
export type TextProps<E extends ElementType = "span"> = HuiPolymorphicProps<E, TextOwnProps, TextSlots>;
|
|
21
|
+
export interface TextExposed<E extends ElementType = "span"> {
|
|
22
|
+
readonly root: HuiElementInstance<E> | null;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=text.types.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { TextOwnProps } from "./text.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
5
|
+
declare const __VLS_export: <E extends ElementType = "span">(__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<{
|
|
6
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<TextOwnProps & {
|
|
7
|
+
as?: E | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
class?: ClassValue | undefined;
|
|
10
|
+
style?: StyleValue | undefined;
|
|
11
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "as" | keyof TextOwnProps>> & (typeof globalThis extends {
|
|
12
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
13
|
+
} ? P : {});
|
|
14
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
15
|
+
root: Readonly<import("vue").ShallowRef<HuiElementInstance<E> | null>>;
|
|
16
|
+
}>) => void;
|
|
17
|
+
attrs: any;
|
|
18
|
+
slots: {
|
|
19
|
+
default?: () => unknown;
|
|
20
|
+
};
|
|
21
|
+
emit: {};
|
|
22
|
+
}>) => import("vue").VNode & {
|
|
23
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
27
|
+
export { _default as default };
|
|
28
|
+
//# sourceMappingURL=text.vue.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../provider/hui-provider.context.js";
|
|
2
2
|
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
3
|
import { attrToBool } from "../../utils/attr-to-bool.js";
|
|
4
|
+
import { useSlotPresence } from "../../utils/use-slot-presence.js";
|
|
4
5
|
import label_default from "../label/label.js";
|
|
5
|
-
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, defineComponent, mergeProps, normalizeClass, normalizeProps, normalizeStyle,
|
|
6
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, defineComponent, mergeProps, normalizeClass, normalizeProps, normalizeStyle, openBlock, renderSlot, useAttrs, useId, useSlots, useTemplateRef, withCtx } from "vue";
|
|
6
7
|
import { inputControl, inputRecipe, toStrbool } from "@hebium-ui/core";
|
|
7
|
-
|
|
8
|
+
// src/components/textarea/textarea.vue
|
|
8
9
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
10
|
name: "HuiTextarea",
|
|
10
11
|
inheritAttrs: false,
|
|
@@ -33,12 +34,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
33
34
|
const attrs = useAttrs();
|
|
34
35
|
const resolvedProps = useHuiProps("Textarea", props, attrs);
|
|
35
36
|
const generatedId = useId();
|
|
36
|
-
const hasLabel =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
const hasLabel = useSlotPresence(slots, [
|
|
38
|
+
"label",
|
|
39
|
+
"description",
|
|
40
|
+
"error"
|
|
41
|
+
]);
|
|
42
|
+
const hasError = useSlotPresence(slots, ["error"]);
|
|
42
43
|
const inputState = computed(() => {
|
|
43
44
|
const resolved = resolvedProps.value;
|
|
44
45
|
return {
|
|
@@ -62,11 +63,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
63
|
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
63
64
|
"id",
|
|
64
65
|
"color",
|
|
65
|
-
"labelProps"
|
|
66
|
-
"classes",
|
|
67
|
-
"styles",
|
|
68
|
-
"class",
|
|
69
|
-
"style"
|
|
66
|
+
"labelProps"
|
|
70
67
|
]);
|
|
71
68
|
const textareaAttrs = computed(() => ({
|
|
72
69
|
...inputControl.getControlAttributes(inputState.value),
|
|
@@ -131,7 +128,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
131
128
|
}), null, 16)], 6);
|
|
132
129
|
}
|
|
133
130
|
var textarea_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/textarea/textarea.vue"]]);
|
|
134
|
-
//#endregion
|
|
135
131
|
export { textarea_default as default };
|
|
136
132
|
|
|
137
133
|
//# sourceMappingURL=textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","names":["_useSlots","Label","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_normalizeProps","_mergeProps","_createSlots","_withCtx","_renderSlot","_createCommentVNode","_createElementVNode"],"sources":["../../../src/components/textarea/textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n inputControl,\n inputRecipe,\n type InputSlots as InputRecipeSlots,\n toStrbool,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n
|
|
1
|
+
{"version":3,"file":"textarea.js","names":["_useSlots","Label","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_normalizeProps","_mergeProps","_createSlots","_withCtx","_renderSlot","_createCommentVNode","_createElementVNode"],"sources":["../../../src/components/textarea/textarea.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n inputControl,\n inputRecipe,\n type InputSlots as InputRecipeSlots,\n toStrbool,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useId,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport { attrToBool, useSlotPresence } from \"~/utils\";\nimport { Label } from \"../label\";\nimport type { TextareaOwnProps } from \"./textarea.types\";\n\ndefineOptions({\n name: \"HuiTextarea\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TextareaOwnProps\n & {\n classes?:\n | Partial<Record<InputRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<InputRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"textarea\">,\n keyof TextareaOwnProps | \"children\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Textarea\", props, attrs);\nconst generatedId = useId();\nconst hasLabel = useSlotPresence(slots, [\"label\", \"description\", \"error\"]);\nconst hasError = useSlotPresence(slots, [\"error\"]);\n\nconst inputState = computed(() => {\n const resolved = resolvedProps.value;\n\n return {\n id: resolved.id || generatedId,\n invalid: hasError.value,\n required: attrToBool(resolved.required ?? resolved[\"aria-required\"]),\n disabled: attrToBool(resolved.disabled)\n || attrToBool(resolved[\"aria-disabled\"]),\n readOnly: attrToBool(resolved.readonly)\n || attrToBool(resolved[\"aria-readonly\"]),\n };\n});\nconst recipe = computed(() => {\n const state = inputState.value;\n\n return inputRecipe({\n color: resolvedProps.value.color,\n height: \"auto\",\n error: toStrbool(state.invalid),\n });\n});\nconst cls = useHuiClasses(\n \"Textarea\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Textarea\", InputRecipeSlots>(\n \"Textarea\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"id\",\n \"color\",\n \"labelProps\",\n]);\nconst textareaAttrs = computed<Record<string, unknown>>(() => ({\n ...inputControl.getControlAttributes(inputState.value),\n ...forwardedAttrs.value,\n}));\nconst labelAttrs = computed<Record<string, unknown>>(() => ({\n ...inputControl.getLabelAttributes(inputState.value),\n ...resolvedProps.value.labelProps,\n}));\nconst textareaRef = useTemplateRef<HuiElementInstance<\"textarea\">>(\"textarea\");\n\ndefineExpose({\n textarea: textareaRef,\n});\n</script>\n\n<template>\n <div :class=\"cls.root\" :style=\"sls.root\">\n <Label v-if=\"hasLabel\" v-bind=\"labelAttrs\">\n <template v-if=\"slots.label\" #default>\n <slot name=\"label\" />\n </template>\n <template v-if=\"slots.description\" #description>\n <slot name=\"description\" />\n </template>\n <template v-if=\"slots.error\" #error>\n <slot name=\"error\" />\n </template>\n </Label>\n <textarea\n ref=\"textarea\"\n v-bind=\"textareaAttrs\"\n :class=\"cls.input\"\n :style=\"sls.input\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,YAAY,OAAO,KAAK;EAC1D,MAAM,cAAc,MAAM;EAC1B,MAAM,WAAW,gBAAgB,OAAO;GAAC;GAAS;GAAe;EAAO,CAAC;EACzE,MAAM,WAAW,gBAAgB,OAAO,CAAC,OAAO,CAAC;EAEjD,MAAM,aAAa,eAAe;GAChC,MAAM,WAAW,cAAc;GAE/B,OAAO;IACL,IAAI,SAAS,MAAM;IACnB,SAAS,SAAS;IAClB,UAAU,WAAW,SAAS,YAAY,SAAS,gBAAgB;IACnE,UAAU,WAAW,SAAS,QAAQ,KACjC,WAAW,SAAS,gBAAgB;IACzC,UAAU,WAAW,SAAS,QAAQ,KACjC,WAAW,SAAS,gBAAgB;GAC3C;EACF,CAAC;EACD,MAAM,SAAS,eAAe;GAC5B,MAAM,QAAQ,WAAW;GAEzB,OAAO,YAAY;IACjB,OAAO,cAAc,MAAM;IAC3B,QAAQ;IACR,OAAO,UAAU,MAAM,OAAO;GAChC,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,YACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,YACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;EACF,CAAC;EACD,MAAM,gBAAgB,gBAAyC;GAC7D,GAAG,aAAa,qBAAqB,WAAW,KAAK;GACrD,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,gBAAyC;GAC1D,GAAG,aAAa,mBAAmB,WAAW,KAAK;GACnD,GAAG,cAAc,MAAM;EACzB,EAAE;EACF,MAAM,cAAc,eAA+C,UAAU;EAE7E,SAAa,EACX,UAAU,YACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAE,UAAA,GAAAC,mBAkBM,OAAA;EAlBA,OAAKC,eAAE,OAAA,IAAI,IAAI;EAAG,OAAKC,eAAE,OAAA,IAAI,IAAI;C,IACxB,OAAA,YAAbH,UAAA,GAAAI,YAUQ,OAAA,UAAAC,eAAAC,WAAA,EAAA,KAAA,EAAA,GAVuB,OAAA,UAAU,CAAA,GAAAC,YAAA,EAAA,GAAA,EAAA,GAAA;EACvB,OAAA,MAAM,Q;GAAQ,MAAA;GAC5B,IAAAC,cAAqB,CAArBC,WAAqB,KAAA,QAAA,OAAA,C;;;EAEP,OAAA,MAAM,c;GAAc,MAAA;GAClC,IAAAD,cAA2B,CAA3BC,WAA2B,KAAA,QAAA,aAAA,C;;;EAEb,OAAA,MAAM,Q;GAAQ,MAAA;GAC5B,IAAAD,cAAqB,CAArBC,WAAqB,KAAA,QAAA,OAAA,C;;;C,+CAGzBE,mBAKE,YALFL,WAKE,EAJA,KAAI,WAAU,GACN,OAAA,eAAa;EACpB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI"}
|
|
@@ -4,7 +4,6 @@ import "../../types/index.js";
|
|
|
4
4
|
import { LabelProps } from "../label/label.types.js";
|
|
5
5
|
import "../label/index.js";
|
|
6
6
|
import { InputSlots, InputVariants } from "@hebium-ui/core";
|
|
7
|
-
//#region src/components/textarea/textarea.types.d.ts
|
|
8
7
|
type HtmlTextareaProps = Omit<HuiElementProps<"textarea">, "children" | "color">;
|
|
9
8
|
export interface TextareaOwnProps {
|
|
10
9
|
/**
|
|
@@ -22,6 +21,5 @@ export type TextareaProps = HuiComponentProps<HtmlTextareaProps & TextareaOwnPro
|
|
|
22
21
|
export interface TextareaExposed {
|
|
23
22
|
readonly textarea: HuiElementInstance<"textarea"> | null;
|
|
24
23
|
}
|
|
25
|
-
//#endregion
|
|
26
24
|
export {};
|
|
27
25
|
//# sourceMappingURL=textarea.types.d.ts.map
|
|
@@ -3,7 +3,6 @@ import "../../types/index.js";
|
|
|
3
3
|
import { TextareaOwnProps } from "./textarea.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
5
|
import { InputSlots } from "@hebium-ui/core";
|
|
6
|
-
//#region src/components/textarea/textarea.vue.d.ts
|
|
7
6
|
type Props = TextareaOwnProps & {
|
|
8
7
|
classes?: Partial<Record<InputSlots, ClassValue | undefined>> | undefined;
|
|
9
8
|
styles?: Partial<Record<InputSlots, StyleValue | undefined>> | undefined;
|
|
@@ -23,6 +22,5 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
23
22
|
$slots: S;
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
|
-
//#endregion
|
|
27
25
|
export { _default as default };
|
|
28
26
|
//# sourceMappingURL=textarea.vue.d.ts.map
|
|
@@ -3,7 +3,7 @@ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js"
|
|
|
3
3
|
import { useTooltipId } from "./tooltip.context.js";
|
|
4
4
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { popoverRecipe, tooltipControl } from "@hebium-ui/core";
|
|
6
|
-
|
|
6
|
+
// src/components/tooltip/tooltip-content.vue
|
|
7
7
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "HuiTooltipContent",
|
|
9
9
|
inheritAttrs: false,
|
|
@@ -75,8 +75,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
75
75
|
"fallbacks",
|
|
76
76
|
"visibility",
|
|
77
77
|
"padding",
|
|
78
|
-
"class",
|
|
79
|
-
"style",
|
|
80
78
|
"onPointerleave"
|
|
81
79
|
]);
|
|
82
80
|
const rootAttrs = computed(() => ({
|
|
@@ -122,7 +120,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
122
120
|
}, 16, ["class", "style"]);
|
|
123
121
|
}
|
|
124
122
|
var tooltip_content_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/tooltip/tooltip-content.vue"]]);
|
|
125
|
-
//#endregion
|
|
126
123
|
export { tooltip_content_default as default };
|
|
127
124
|
|
|
128
125
|
//# sourceMappingURL=tooltip-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-content.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tooltip/tooltip-content.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport { popoverRecipe, tooltipControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { useTooltipId } from \"./tooltip.context\";\nimport type { TooltipContentOwnProps } from \"./tooltip.types\";\n\ndefineOptions({\n name: \"HuiTooltipContent\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TooltipContentOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TooltipContentOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TooltipContent\", props, attrs);\nconst component = computed<E | \"div\">(() => resolvedProps.value.as ?? \"div\");\nconst tooltipId = useTooltipId();\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n return popoverRecipe({\n position: resolved.position,\n fallbacks: resolved.fallbacks,\n visibility: resolved.visibility,\n padding: resolved.padding,\n });\n});\nconst cls = useHuiClasses(\n \"TooltipContent\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"TooltipContent\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"position\",\n \"fallbacks\",\n \"visibility\",\n \"padding\",\n \"
|
|
1
|
+
{"version":3,"file":"tooltip-content.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tooltip/tooltip-content.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport { popoverRecipe, tooltipControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { useTooltipId } from \"./tooltip.context\";\nimport type { TooltipContentOwnProps } from \"./tooltip.types\";\n\ndefineOptions({\n name: \"HuiTooltipContent\",\n inheritAttrs: false,\n});\n\ntype Props =\n & TooltipContentOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof TooltipContentOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TooltipContent\", props, attrs);\nconst component = computed<E | \"div\">(() => resolvedProps.value.as ?? \"div\");\nconst tooltipId = useTooltipId();\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n return popoverRecipe({\n position: resolved.position,\n fallbacks: resolved.fallbacks,\n visibility: resolved.visibility,\n padding: resolved.padding,\n });\n});\nconst cls = useHuiClasses(\n \"TooltipContent\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"TooltipContent\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"position\",\n \"fallbacks\",\n \"visibility\",\n \"padding\",\n \"onPointerleave\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...tooltipControl.getContentAttributes({ tooltipId: tooltipId.value }),\n ...forwardedAttrs.value,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\nfunction handlePointerLeave(event: PointerEvent): void {\n const onPointerleave = resolvedProps.value[\"onPointerleave\"];\n if (typeof onPointerleave === \"function\") onPointerleave(event);\n tooltipControl.hideTooltip(tooltipId.value);\n}\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n @pointerleave=\"handlePointerLeave\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,kBAAkB,OAAO,KAAK;EAChE,MAAM,YAAY,eAA0B,cAAc,MAAM,MAAM,KAAK;EAC3E,MAAM,YAAY,aAAa;EAC/B,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAC/B,OAAO,cAAc;IACnB,UAAU,SAAS;IACnB,WAAW,SAAS;IACpB,YAAY,SAAS;IACrB,SAAS,SAAS;GACpB,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,kBACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,kBACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,eAAe,qBAAqB,EAAE,WAAW,UAAU,MAAM,CAAC;GACrE,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAS,mBAAmB,OAA2B;GACrD,MAAM,iBAAiB,cAAc,MAAM;GAC3C,IAAI,OAAO,mBAAmB,YAAY,eAAe,KAAK;GAC9D,eAAe,YAAY,UAAU,KAAK;EAC5C;EAEA,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,YASYC,wBARL,OAAA,SAAS,GADhBC,WASY,EAPV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;EACX,gBAAc,OAAA;;EAEf,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -2,14 +2,13 @@ import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../t
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
import { TooltipContentOwnProps } from "./tooltip.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
|
-
//#region src/components/tooltip/tooltip-content.vue.d.ts
|
|
6
5
|
declare const __VLS_export: <E extends ElementType = "div">(__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<{
|
|
7
6
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<TooltipContentOwnProps & {
|
|
8
7
|
as?: E | undefined;
|
|
9
8
|
} & {
|
|
10
9
|
class?: ClassValue | undefined;
|
|
11
10
|
style?: StyleValue | undefined;
|
|
12
|
-
} & Omit<HuiElementPropsNoInfer<E>, "
|
|
11
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "as" | keyof TooltipContentOwnProps>> & (typeof globalThis extends {
|
|
13
12
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
13
|
} ? P : {});
|
|
15
14
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -25,6 +24,5 @@ declare const __VLS_export: <E extends ElementType = "div">(__VLS_props: NonNull
|
|
|
25
24
|
};
|
|
26
25
|
declare const _default: typeof __VLS_export;
|
|
27
26
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
28
|
-
//#endregion
|
|
29
27
|
export { _default as default };
|
|
30
28
|
//# sourceMappingURL=tooltip-content.vue.d.ts.map
|
|
@@ -4,7 +4,7 @@ import button_default from "../button/button.js";
|
|
|
4
4
|
import { useTooltipId } from "./tooltip.context.js";
|
|
5
5
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
6
6
|
import { tooltipControl } from "@hebium-ui/core";
|
|
7
|
-
|
|
7
|
+
// src/components/tooltip/tooltip-trigger.vue
|
|
8
8
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
9
|
name: "HuiTooltipTrigger",
|
|
10
10
|
inheritAttrs: false,
|
|
@@ -47,8 +47,6 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
47
47
|
const sls = useHuiStyles("TooltipTrigger", computed(() => ({ root: props.style })));
|
|
48
48
|
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
49
49
|
"as",
|
|
50
|
-
"class",
|
|
51
|
-
"style",
|
|
52
50
|
"onPointerenter",
|
|
53
51
|
"onPointerleave",
|
|
54
52
|
"onFocus",
|
|
@@ -119,7 +117,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
119
117
|
}, 16, ["class", "style"]);
|
|
120
118
|
}
|
|
121
119
|
var tooltip_trigger_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/tooltip/tooltip-trigger.vue"]]);
|
|
122
|
-
//#endregion
|
|
123
120
|
export { tooltip_trigger_default as default };
|
|
124
121
|
|
|
125
122
|
//# sourceMappingURL=tooltip-trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-trigger.js","names":["Button","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tooltip/tooltip-trigger.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = typeof Button\"\n>\nimport { tooltipControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { Button } from \"../button\";\nimport { useTooltipId } from \"./tooltip.context\";\n\ndefineOptions({\n name: \"HuiTooltipTrigger\",\n inheritAttrs: false,\n});\n\ntype Props =\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TooltipTrigger\", props, attrs);\nconst component = computed<E | typeof Button>(() =>\n resolvedProps.value.as ?? Button\n);\nconst tooltipId = useTooltipId();\nconst cls = useHuiClasses<\"TooltipTrigger\", \"root\">(\n \"TooltipTrigger\",\n computed(() => ({ root: \"\" })),\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles<\"TooltipTrigger\", \"root\">(\n \"TooltipTrigger\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"
|
|
1
|
+
{"version":3,"file":"tooltip-trigger.js","names":["Button","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/tooltip/tooltip-trigger.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = typeof Button\"\n>\nimport { tooltipControl } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type {\n ElementType,\n HuiElementInstance,\n HuiElementPropsNoInfer,\n} from \"~/types\";\nimport { Button } from \"../button\";\nimport { useTooltipId } from \"./tooltip.context\";\n\ndefineOptions({\n name: \"HuiTooltipTrigger\",\n inheritAttrs: false,\n});\n\ntype Props =\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"TooltipTrigger\", props, attrs);\nconst component = computed<E | typeof Button>(() =>\n resolvedProps.value.as ?? Button\n);\nconst tooltipId = useTooltipId();\nconst cls = useHuiClasses<\"TooltipTrigger\", \"root\">(\n \"TooltipTrigger\",\n computed(() => ({ root: \"\" })),\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles<\"TooltipTrigger\", \"root\">(\n \"TooltipTrigger\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"onPointerenter\",\n \"onPointerleave\",\n \"onFocus\",\n \"onBlur\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...tooltipControl.getTriggerAttributes(\n { tooltipId: tooltipId.value },\n { isButtonElement: resolvedProps.value.as === undefined },\n ),\n ...forwardedAttrs.value,\n}));\nconst rootRef = useTemplateRef<HuiElementInstance<E>>(\"root\");\n\nfunction handlePointerEnter(event: PointerEvent): void {\n const onPointerenter = resolvedProps.value[\"onPointerenter\"];\n if (typeof onPointerenter === \"function\") onPointerenter(event);\n if (!(event.currentTarget instanceof HTMLElement)) return;\n\n tooltipControl.showTooltip(tooltipId.value, event.currentTarget);\n}\n\nfunction handlePointerLeave(event: PointerEvent): void {\n const onPointerleave = resolvedProps.value[\"onPointerleave\"];\n if (typeof onPointerleave === \"function\") onPointerleave(event);\n tooltipControl.hideTooltip(tooltipId.value);\n}\n\nfunction handleFocus(event: FocusEvent): void {\n const onFocus = resolvedProps.value[\"onFocus\"];\n if (typeof onFocus === \"function\") onFocus(event);\n if (!(event.currentTarget instanceof HTMLElement)) return;\n\n tooltipControl.showTooltip(tooltipId.value, event.currentTarget);\n}\n\nfunction handleBlur(event: FocusEvent): void {\n const onBlur = resolvedProps.value[\"onBlur\"];\n if (typeof onBlur === \"function\") onBlur(event);\n tooltipControl.hideTooltip(tooltipId.value);\n}\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <component\n :is=\"component\"\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n @pointerenter=\"handlePointerEnter\"\n @pointerleave=\"handlePointerLeave\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n >\n <slot />\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,kBAAkB,OAAO,KAAK;EAChE,MAAM,YAAY,eAChB,cAAc,MAAM,MAAMA,cAC5B;EACA,MAAM,YAAY,aAAa;EAC/B,MAAM,MAAM,cACV,kBACA,gBAAgB,EAAE,MAAM,GAAG,EAAE,GAC7B,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,kBACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,eAAe,qBAChB,EAAE,WAAW,UAAU,MAAM,GAC7B,EAAE,iBAAiB,cAAc,MAAM,OAAO,KAAA,EAAU,CAC1D;GACA,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAS,mBAAmB,OAA2B;GACrD,MAAM,iBAAiB,cAAc,MAAM;GAC3C,IAAI,OAAO,mBAAmB,YAAY,eAAe,KAAK;GAC9D,IAAI,EAAE,MAAM,yBAAyB,cAAc;GAEnD,eAAe,YAAY,UAAU,OAAO,MAAM,aAAa;EACjE;EAEA,SAAS,mBAAmB,OAA2B;GACrD,MAAM,iBAAiB,cAAc,MAAM;GAC3C,IAAI,OAAO,mBAAmB,YAAY,eAAe,KAAK;GAC9D,eAAe,YAAY,UAAU,KAAK;EAC5C;EAEA,SAAS,YAAY,OAAyB;GAC5C,MAAM,UAAU,cAAc,MAAM;GACpC,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK;GAChD,IAAI,EAAE,MAAM,yBAAyB,cAAc;GAEnD,eAAe,YAAY,UAAU,OAAO,MAAM,aAAa;EACjE;EAEA,SAAS,WAAW,OAAyB;GAC3C,MAAM,SAAS,cAAc,MAAM;GACnC,IAAI,OAAO,WAAW,YAAY,OAAO,KAAK;GAC9C,eAAe,YAAY,UAAU,KAAK;EAC5C;EAEA,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAC,UAAA,GAAAC,YAYYC,wBAXL,OAAA,SAAS,GADhBC,WAYY,EAVV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;EACX,gBAAc,OAAA;EACd,gBAAc,OAAA;EACd,SAAO,OAAA;EACP,QAAM,OAAA;;EAEP,SAAAC,cAAQ,CAARC,WAAQ,KAAA,QAAA,SAAA,C"}
|