@hebium-ui/vue 0.1.0-alpha.1 → 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 +10 -5
- package/dist/components/paragraph/paragraph.js.map +1 -1
- package/dist/components/paragraph/paragraph.types.d.ts +6 -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 +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radiogroup.js","names":["_useSlots","Label","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_normalizeProps","_createSlots","_renderSlot","_createCommentVNode","_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../../src/components/radiogroup/radiogroup.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport {\n radiogroupControl,\n radiogroupRecipe,\n type RadiogroupSlots as RadiogroupRecipeSlots,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\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 { attrToBool } from \"~/utils\";\nimport { Label } from \"../label\";\nimport type { RadiogroupOwnProps } from \"./radiogroup.types\";\n\ndefineOptions({\n name: \"HuiRadiogroup\",\n inheritAttrs: false,\n});\n\ntype Props =\n & RadiogroupOwnProps\n & { as?: E | undefined }\n & {\n classes?:\n | Partial<Record<RadiogroupRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<RadiogroupRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n | keyof RadiogroupOwnProps\n | \"as\"\n | \"classes\"\n | \"styles\"\n | \"class\"\n | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Radiogroup\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst labelId = useId();\nconst hasLabel =
|
|
1
|
+
{"version":3,"file":"radiogroup.js","names":["_useSlots","Label","_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_normalizeProps","_createSlots","_renderSlot","_createCommentVNode","_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../../src/components/radiogroup/radiogroup.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport {\n radiogroupControl,\n radiogroupRecipe,\n type RadiogroupSlots as RadiogroupRecipeSlots,\n} from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\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 { attrToBool, useSlotPresence } from \"~/utils\";\nimport { Label } from \"../label\";\nimport type { RadiogroupOwnProps } from \"./radiogroup.types\";\n\ndefineOptions({\n name: \"HuiRadiogroup\",\n inheritAttrs: false,\n});\n\ntype Props =\n & RadiogroupOwnProps\n & { as?: E | undefined }\n & {\n classes?:\n | Partial<Record<RadiogroupRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<RadiogroupRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n | keyof RadiogroupOwnProps\n | \"as\"\n | \"classes\"\n | \"styles\"\n | \"class\"\n | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Radiogroup\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst labelId = useId();\nconst hasLabel = useSlotPresence(slots, [\"label\", \"description\", \"error\"]);\nconst hasError = useSlotPresence(slots, [\"error\"]);\nconst radiogroupState = computed(() => ({\n labelId,\n hasLabel: hasLabel.value,\n invalid: hasError.value,\n required: attrToBool(resolvedProps.value[\"aria-required\"]),\n}));\nconst recipe = computed(() =>\n radiogroupRecipe({ direction: resolvedProps.value.direction })\n);\nconst cls = useHuiClasses(\n \"Radiogroup\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Radiogroup\", RadiogroupRecipeSlots>(\n \"Radiogroup\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"direction\",\n \"labelProps\",\n]);\nconst rootAttrs = computed<Record<string, unknown>>(() => ({\n ...radiogroupControl.getRootAttributes(radiogroupState.value),\n ...forwardedAttrs.value,\n}));\nconst labelAttrs = computed<Record<string, unknown>>(() => ({\n as: \"div\",\n ...radiogroupControl.getLabelAttributes(radiogroupState.value),\n ...resolvedProps.value.labelProps,\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 <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 <div :class=\"cls.group\" :style=\"sls.group\">\n <slot />\n </div>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAOd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,cAAc,OAAO,KAAK;EAC5D,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,KAAK,CACvC;EACA,MAAM,UAAU,MAAM;EACtB,MAAM,WAAW,gBAAgB,OAAO;GAAC;GAAS;GAAe;EAAO,CAAC;EACzE,MAAM,WAAW,gBAAgB,OAAO,CAAC,OAAO,CAAC;EACjD,MAAM,kBAAkB,gBAAgB;GACtC;GACA,UAAU,SAAS;GACnB,SAAS,SAAS;GAClB,UAAU,WAAW,cAAc,MAAM,gBAAgB;EAC3D,EAAE;EACF,MAAM,SAAS,eACb,iBAAiB,EAAE,WAAW,cAAc,MAAM,UAAU,CAAC,CAC/D;EACA,MAAM,MAAM,cACV,cACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,cACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;EACF,CAAC;EACD,MAAM,YAAY,gBAAyC;GACzD,GAAG,kBAAkB,kBAAkB,gBAAgB,KAAK;GAC5D,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,gBAAyC;GAC1D,IAAI;GACJ,GAAG,kBAAkB,mBAAmB,gBAAgB,KAAK;GAC7D,GAAG,cAAc,MAAM;EACzB,EAAE;EACF,MAAM,UAAU,eAAsC,MAAM;EAE5D,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAE,UAAA,GAAAC,YAqBYC,wBApBL,OAAA,SAAS,GADhBC,WAqBY,EAnBV,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;;EAEZ,SAAAC,cAUQ,CAVK,OAAA,YAAbJ,UAAA,GAAAC,YAUQ,OAAA,UAAAI,eAAAF,WAAA,EAAA,KAAA,EAAA,GAVuB,OAAA,UAAU,CAAA,GAAAG,YAAA,EAAA,GAAA,EAAA,GAAA;GACvB,OAAA,MAAM,Q;IAAQ,MAAA;IAC5B,IAAAF,cAAqB,CAArBG,WAAqB,KAAA,QAAA,OAAA,C;;;GAEP,OAAA,MAAM,c;IAAc,MAAA;IAClC,IAAAH,cAA2B,CAA3BG,WAA2B,KAAA,QAAA,aAAA,C;;;GAEb,OAAA,MAAM,Q;IAAQ,MAAA;IAC5B,IAAAH,cAAqB,CAArBG,WAAqB,KAAA,QAAA,OAAA,C;;;E,+CAGzBE,mBAEM,OAAA;GAFA,OAAKC,eAAE,OAAA,IAAI,KAAK;GAAG,OAAKC,eAAE,OAAA,IAAI,KAAK;E,IACvCJ,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -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 { RadiogroupSlots, RadiogroupVariants } from "@hebium-ui/core";
|
|
7
|
-
//#region src/components/radiogroup/radiogroup.types.d.ts
|
|
8
7
|
export interface RadiogroupOwnProps {
|
|
9
8
|
/**
|
|
10
9
|
* The direction in which radio options are laid out.
|
|
@@ -21,5 +20,4 @@ export type RadiogroupProps<E extends ElementType = "div"> = HuiPolymorphicProps
|
|
|
21
20
|
export interface RadiogroupExposed<E extends ElementType = "div"> {
|
|
22
21
|
readonly root: HuiElementInstance<E> | null;
|
|
23
22
|
}
|
|
24
|
-
//#endregion
|
|
25
23
|
//# sourceMappingURL=radiogroup.types.d.ts.map
|
|
@@ -3,14 +3,13 @@ import "../../types/index.js";
|
|
|
3
3
|
import { RadiogroupOwnProps } from "./radiogroup.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
5
|
import { RadiogroupSlots } from "@hebium-ui/core";
|
|
6
|
-
//#region src/components/radiogroup/radiogroup.vue.d.ts
|
|
7
6
|
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<{
|
|
8
7
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<RadiogroupOwnProps & {
|
|
9
8
|
as?: E | undefined;
|
|
10
9
|
} & {
|
|
11
10
|
classes?: Partial<Record<RadiogroupSlots, ClassValue | undefined>> | undefined;
|
|
12
11
|
styles?: Partial<Record<RadiogroupSlots, StyleValue | undefined>> | undefined;
|
|
13
|
-
} & Omit<HuiElementPropsNoInfer<E>, "
|
|
12
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "classes" | "styles" | "as" | keyof RadiogroupOwnProps>> & (typeof globalThis extends {
|
|
14
13
|
__VLS_PROPS_FALLBACK: infer P;
|
|
15
14
|
} ? P : {});
|
|
16
15
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -29,6 +28,5 @@ declare const __VLS_export: <E extends ElementType = "div">(__VLS_props: NonNull
|
|
|
29
28
|
};
|
|
30
29
|
declare const _default: typeof __VLS_export;
|
|
31
30
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
32
|
-
//#endregion
|
|
33
31
|
export { _default as default };
|
|
34
32
|
//# sourceMappingURL=radiogroup.vue.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { useHuiAttrs, useHuiClasses, useHuiProps, useHuiStyles } from "../../pro
|
|
|
2
2
|
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js";
|
|
3
3
|
import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
4
4
|
import { sectionRecipe } from "@hebium-ui/core";
|
|
5
|
-
|
|
5
|
+
// src/components/section/section.vue
|
|
6
6
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
7
|
name: "HuiSection",
|
|
8
8
|
inheritAttrs: false,
|
|
@@ -72,9 +72,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
72
72
|
"bg",
|
|
73
73
|
"radius",
|
|
74
74
|
"padding",
|
|
75
|
-
"border"
|
|
76
|
-
"class",
|
|
77
|
-
"style"
|
|
75
|
+
"border"
|
|
78
76
|
]);
|
|
79
77
|
const rootRef = useTemplateRef("root");
|
|
80
78
|
__expose({ root: rootRef });
|
|
@@ -106,7 +104,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
106
104
|
}, 16, ["class", "style"]);
|
|
107
105
|
}
|
|
108
106
|
var section_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/section/section.vue"]]);
|
|
109
|
-
//#endregion
|
|
110
107
|
export { section_default as default };
|
|
111
108
|
|
|
112
109
|
//# sourceMappingURL=section.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/section/section.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'section'\"\n>\nimport { sectionRecipe } 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 { SectionOwnProps } from \"./section.types\";\n\ndefineOptions({\n name: \"HuiSection\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SectionOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SectionOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Section\", props, attrs);\nconst component = computed<E | \"section\">(() =>\n toRaw(resolvedProps.value.as ?? \"section\")\n);\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n\n return sectionRecipe({\n bg: resolved.bg,\n radius: resolved.radius,\n padding: resolved.padding,\n border: resolved.border,\n });\n});\nconst cls = useHuiClasses(\n \"Section\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Section\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"bg\",\n \"radius\",\n \"padding\",\n \"border\",\n
|
|
1
|
+
{"version":3,"file":"section.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/section/section.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'section'\"\n>\nimport { sectionRecipe } 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 { SectionOwnProps } from \"./section.types\";\n\ndefineOptions({\n name: \"HuiSection\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SectionOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SectionOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Section\", props, attrs);\nconst component = computed<E | \"section\">(() =>\n toRaw(resolvedProps.value.as ?? \"section\")\n);\nconst recipe = computed(() => {\n const resolved = resolvedProps.value;\n\n return sectionRecipe({\n bg: resolved.bg,\n radius: resolved.radius,\n padding: resolved.padding,\n border: resolved.border,\n });\n});\nconst cls = useHuiClasses(\n \"Section\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"Section\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"bg\",\n \"radius\",\n \"padding\",\n \"border\",\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,WAAW,OAAO,KAAK;EACzD,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,SAAS,CAC3C;EACA,MAAM,SAAS,eAAe;GAC5B,MAAM,WAAW,cAAc;GAE/B,OAAO,cAAc;IACnB,IAAI,SAAS;IACb,QAAQ,SAAS;IACjB,SAAS,SAAS;IAClB,QAAQ,SAAS;GACnB,CAAC;EACH,CAAC;EACD,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,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"}
|
|
@@ -2,7 +2,6 @@ import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
|
2
2
|
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
3
|
import "../../types/index.js";
|
|
4
4
|
import { SectionSlots, SectionVariants } from "@hebium-ui/core";
|
|
5
|
-
//#region src/components/section/section.types.d.ts
|
|
6
5
|
export interface SectionOwnProps {
|
|
7
6
|
/**
|
|
8
7
|
* The background color of the section.
|
|
@@ -33,5 +32,4 @@ export type SectionProps<E extends ElementType = "section"> = HuiPolymorphicProp
|
|
|
33
32
|
export interface SectionExposed<E extends ElementType = "section"> {
|
|
34
33
|
readonly root: HuiElementInstance<E> | null;
|
|
35
34
|
}
|
|
36
|
-
//#endregion
|
|
37
35
|
//# sourceMappingURL=section.types.d.ts.map
|
|
@@ -2,14 +2,13 @@ import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../t
|
|
|
2
2
|
import "../../types/index.js";
|
|
3
3
|
import { SectionOwnProps } from "./section.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
|
-
//#region src/components/section/section.vue.d.ts
|
|
6
5
|
declare const __VLS_export: <E extends ElementType = "section">(__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<SectionOwnProps & {
|
|
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 SectionOwnProps>> & (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 = "section">(__VLS_props: Non
|
|
|
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=section.vue.d.ts.map
|
|
@@ -3,7 +3,7 @@ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js"
|
|
|
3
3
|
import { useSegmentedControlContext } from "./segmented-control.context.js";
|
|
4
4
|
import { computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, toRaw, useAttrs, useTemplateRef, withCtx } from "vue";
|
|
5
5
|
import { segmentedControl, segmentedControlItemRecipe } from "@hebium-ui/core";
|
|
6
|
-
|
|
6
|
+
// src/components/segmented-control/segmented-control-item.vue
|
|
7
7
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "HuiSegmentedControlItem",
|
|
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
|
]);
|
|
59
57
|
const controlAttrs = computed(() => ({
|
|
@@ -104,7 +102,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
104
102
|
}, 16, ["class", "style"]))]);
|
|
105
103
|
}
|
|
106
104
|
var segmented_control_item_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/segmented-control/segmented-control-item.vue"]]);
|
|
107
|
-
//#endregion
|
|
108
105
|
export { segmented_control_item_default as default };
|
|
109
106
|
|
|
110
107
|
//# sourceMappingURL=segmented-control-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-control-item.js","names":["_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/segmented-control/segmented-control-item.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'button'\"\n>\nimport { segmentedControl, segmentedControlItemRecipe } 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 { useSegmentedControlContext } from \"./segmented-control.context\";\nimport type { SegmentedControlItemOwnProps } from \"./segmented-control.types\";\n\ndefineOptions({\n name: \"HuiSegmentedControlItem\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SegmentedControlItemOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SegmentedControlItemOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"SegmentedControlItem\", props, attrs);\nconst component = computed<E | \"button\">(() =>\n toRaw(resolvedProps.value.as ?? \"button\")\n);\nconst context = useSegmentedControlContext();\nconst recipe = computed(() => segmentedControlItemRecipe({}));\nconst cls = useHuiClasses(\n \"SegmentedControlItem\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"SegmentedControlItem\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"value\",\n \"
|
|
1
|
+
{"version":3,"file":"segmented-control-item.js","names":["_openBlock","_createElementBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/segmented-control/segmented-control-item.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'button'\"\n>\nimport { segmentedControl, segmentedControlItemRecipe } 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 { useSegmentedControlContext } from \"./segmented-control.context\";\nimport type { SegmentedControlItemOwnProps } from \"./segmented-control.types\";\n\ndefineOptions({\n name: \"HuiSegmentedControlItem\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SegmentedControlItemOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SegmentedControlItemOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"SegmentedControlItem\", props, attrs);\nconst component = computed<E | \"button\">(() =>\n toRaw(resolvedProps.value.as ?? \"button\")\n);\nconst context = useSegmentedControlContext();\nconst recipe = computed(() => segmentedControlItemRecipe({}));\nconst cls = useHuiClasses(\n \"SegmentedControlItem\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"SegmentedControlItem\",\n computed(() => ({ root: props.style })),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"as\",\n \"value\",\n \"onClick\",\n]);\nconst controlAttrs = computed<Record<string, unknown>>(() => ({\n ...segmentedControl.getItemAttributes(\n {\n isButtonElement: resolvedProps.value.as === undefined,\n selectedValue: context.selectedValue.value,\n },\n resolvedProps.value.value,\n ),\n ...forwardedAttrs.value,\n}));\nconst controlRef = useTemplateRef<HuiElementInstance<E>>(\"control\");\n\nfunction handleClick(event: MouseEvent): void {\n const resolved = resolvedProps.value;\n const onClick = resolved[\"onClick\"];\n if (typeof onClick === \"function\") onClick(event);\n if (event.defaultPrevented) return;\n\n context.onSelect(resolved.value);\n}\n\ndefineExpose({\n control: controlRef,\n});\n</script>\n\n<template>\n <li>\n <component\n :is=\"component\"\n ref=\"control\"\n v-bind=\"controlAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n @click=\"handleClick\"\n >\n <slot />\n </component>\n </li>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,wBAAwB,OAAO,KAAK;EACtE,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,QAAQ,CAC1C;EACA,MAAM,UAAU,2BAA2B;EAC3C,MAAM,SAAS,eAAe,2BAA2B,CAAC,CAAC,CAAC;EAC5D,MAAM,MAAM,cACV,wBACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,wBACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,iBAAiB,YAAY,eAAe;GAChD;GACA;GACA;EACF,CAAC;EACD,MAAM,eAAe,gBAAyC;GAC5D,GAAG,iBAAiB,kBAClB;IACE,iBAAiB,cAAc,MAAM,OAAO,KAAA;IAC5C,eAAe,QAAQ,cAAc;GACvC,GACA,cAAc,MAAM,KACtB;GACA,GAAG,eAAe;EACpB,EAAE;EACF,MAAM,aAAa,eAAsC,SAAS;EAElE,SAAS,YAAY,OAAyB;GAC5C,MAAM,WAAW,cAAc;GAC/B,MAAM,UAAU,SAAS;GACzB,IAAI,OAAO,YAAY,YAAY,QAAQ,KAAK;GAChD,IAAI,MAAM,kBAAkB;GAE5B,QAAQ,SAAS,SAAS,KAAK;EACjC;EAEA,SAAa,EACX,SAAS,WACX,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,mBAWK,MAAA,MAAA,EAVHD,UAAA,GAAAE,YASYC,wBARL,OAAA,SAAS,GADhBC,WASY,EAPV,KAAI,UAAS,GACL,OAAA,cAAY;EACnB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;EACX,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 { SegmentedControlItemOwnProps } from "./segmented-control.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
|
-
//#region src/components/segmented-control/segmented-control-item.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<SegmentedControlItemOwnProps & {
|
|
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=segmented-control-item.vue.d.ts.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { inject } from "vue";
|
|
2
|
-
|
|
2
|
+
// src/components/segmented-control/segmented-control.context.ts
|
|
3
3
|
const SegmentedControlContext = Symbol("SegmentedControl");
|
|
4
4
|
function useSegmentedControlContext() {
|
|
5
5
|
const context = inject(SegmentedControlContext);
|
|
6
6
|
if (!context) throw new Error("[Hebium UI] SegmentedControl compound components must be used within <SegmentedControl>");
|
|
7
7
|
return context;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { SegmentedControlContext, useSegmentedControlContext };
|
|
11
10
|
|
|
12
11
|
//# sourceMappingURL=segmented-control.context.js.map
|
|
@@ -3,7 +3,7 @@ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.js"
|
|
|
3
3
|
import { SegmentedControlContext } from "./segmented-control.context.js";
|
|
4
4
|
import { computed, createElementBlock, defineComponent, mergeProps, openBlock, provide, renderSlot, shallowRef, useAttrs, useTemplateRef } from "vue";
|
|
5
5
|
import { segmentedControlRootRecipe } from "@hebium-ui/core";
|
|
6
|
-
|
|
6
|
+
// src/components/segmented-control/segmented-control.vue
|
|
7
7
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
8
8
|
name: "HuiSegmentedControl",
|
|
9
9
|
inheritAttrs: false,
|
|
@@ -62,9 +62,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
62
|
"values",
|
|
63
63
|
"value",
|
|
64
64
|
"defaultValue",
|
|
65
|
-
"onChange"
|
|
66
|
-
"class",
|
|
67
|
-
"style"
|
|
65
|
+
"onChange"
|
|
68
66
|
]);
|
|
69
67
|
const rootRef = useTemplateRef("root");
|
|
70
68
|
function onSelect(nextValue) {
|
|
@@ -106,7 +104,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
106
104
|
}), [renderSlot(_ctx.$slots, "default")], 16);
|
|
107
105
|
}
|
|
108
106
|
var segmented_control_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/segmented-control/segmented-control.vue"]]);
|
|
109
|
-
//#endregion
|
|
110
107
|
export { segmented_control_default as default };
|
|
111
108
|
|
|
112
109
|
//# sourceMappingURL=segmented-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-control.js","names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot"],"sources":["../../../src/components/segmented-control/segmented-control.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"V extends string\">\nimport { segmentedControlRootRecipe } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n provide,\n shallowRef,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport { SegmentedControlContext } from \"./segmented-control.context\";\nimport type { SegmentedControlOwnProps } from \"./segmented-control.types\";\n\ndefineOptions({\n name: \"HuiSegmentedControl\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SegmentedControlOwnProps<V>\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"ul\">,\n keyof SegmentedControlOwnProps<V> | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"SegmentedControl\", props, attrs);\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 recipe = computed(() => segmentedControlRootRecipe({}));\nconst cls = useHuiClasses(\n \"SegmentedControl\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"SegmentedControl\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"values\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n
|
|
1
|
+
{"version":3,"file":"segmented-control.js","names":["_openBlock","_createElementBlock","_mergeProps","_renderSlot"],"sources":["../../../src/components/segmented-control/segmented-control.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"V extends string\">\nimport { segmentedControlRootRecipe } from \"@hebium-ui/core\";\nimport {\n type ClassValue,\n computed,\n provide,\n shallowRef,\n type StyleValue,\n useAttrs,\n useTemplateRef,\n} from \"vue\";\nimport {\n useHuiAttrs,\n useHuiClasses,\n useHuiProps,\n useHuiStyles,\n} from \"~/provider\";\nimport type { HuiElementInstance, HuiElementPropsNoInfer } from \"~/types\";\nimport { SegmentedControlContext } from \"./segmented-control.context\";\nimport type { SegmentedControlOwnProps } from \"./segmented-control.types\";\n\ndefineOptions({\n name: \"HuiSegmentedControl\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SegmentedControlOwnProps<V>\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"ul\">,\n keyof SegmentedControlOwnProps<V> | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"SegmentedControl\", props, attrs);\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 recipe = computed(() => segmentedControlRootRecipe({}));\nconst cls = useHuiClasses(\n \"SegmentedControl\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"SegmentedControl\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\n \"values\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n]);\nconst rootRef = useTemplateRef<HuiElementInstance<\"ul\">>(\"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(\n `[Hebium UI] Unexpected SegmentedControl value: ${nextValue}`,\n );\n }\n\n const value = nextValue as V;\n uncontrolledValue.value = value;\n resolved.onChange?.(value);\n}\n\nprovide(SegmentedControlContext, {\n selectedValue,\n onSelect,\n});\n\ndefineExpose({\n root: rootRef,\n});\n</script>\n\n<template>\n <ul\n ref=\"root\"\n v-bind=\"rootAttrs\"\n :class=\"cls.root\"\n :style=\"sls.root\"\n >\n <slot />\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,MAAM,QAAQ;EAMd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,oBAAoB,OAAO,KAAK;EAClE,MAAM,oBAAoB,WACxB,cAAc,MAAM,SACf,cAAc,MAAM,gBACpB,cAAc,MAAM,OAAO,EAClC;EACA,MAAM,gBAAgB,eACpB,cAAc,MAAM,SAAS,kBAAkB,KACjD;EACA,MAAM,SAAS,eAAe,2BAA2B,CAAC,CAAC,CAAC;EAC5D,MAAM,MAAM,cACV,oBACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,oBACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe;GAC3C;GACA;GACA;GACA;EACF,CAAC;EACD,MAAM,UAAU,eAAyC,MAAM;EAE/D,SAAS,SAAS,WAAyB;GACzC,MAAM,WAAW,cAAc;GAC/B,IAAI,CAAC,SAAS,OAAO,MAAM,UAAa,UAAU,SAAS,GACzD,MAAM,IAAI,MACR,kDAAkD,WACpD;GAGF,MAAM,QAAQ;GACd,kBAAkB,QAAQ;GAC1B,SAAS,WAAW,KAAK;EAC3B;EAEA,QAAQ,yBAAyB;GAC/B;GACA;EACF,CAAC;EAED,SAAa,EACX,MAAM,QACR,CAAC;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAA,UAAA,GAAAC,mBAOK,MAPLC,WAOK,EANH,KAAI,OAAM,GACF,OAAA,WAAS;EAChB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;C,KAEZC,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -3,13 +3,12 @@ import { HuiComponentProps } from "../../types/hui-component.js";
|
|
|
3
3
|
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
4
4
|
import "../../types/index.js";
|
|
5
5
|
import { SegmentedControlItemSlots, SegmentedControlRootSlots } from "@hebium-ui/core";
|
|
6
|
-
//#region src/components/segmented-control/segmented-control.types.d.ts
|
|
7
6
|
type HtmlUlProps = Omit<HuiElementProps<"ul">, "onChange">;
|
|
8
7
|
export interface SegmentedControlOwnProps<V extends string> {
|
|
9
8
|
/**
|
|
10
9
|
* The list of allowed segmented-control values.
|
|
11
10
|
*/
|
|
12
|
-
values: V[];
|
|
11
|
+
values: readonly V[];
|
|
13
12
|
/**
|
|
14
13
|
* The currently selected segmented-control value.
|
|
15
14
|
*/
|
|
@@ -37,6 +36,5 @@ export type SegmentedControlItemProps<E extends ElementType = "button"> = HuiPol
|
|
|
37
36
|
export interface SegmentedControlItemExposed<E extends ElementType = "button"> {
|
|
38
37
|
readonly control: HuiElementInstance<E> | null;
|
|
39
38
|
}
|
|
40
|
-
//#endregion
|
|
41
39
|
export {};
|
|
42
40
|
//# sourceMappingURL=segmented-control.types.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SegmentedControlOwnProps } from "./segmented-control.types.js";
|
|
2
2
|
import { ClassValue, StyleValue } from "vue";
|
|
3
|
-
//#region src/components/segmented-control/segmented-control.vue.d.ts
|
|
4
3
|
declare const __VLS_export: <V extends string>(__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<{
|
|
5
4
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<SegmentedControlOwnProps<V> & {
|
|
6
5
|
class?: ClassValue | undefined;
|
|
7
6
|
style?: StyleValue | undefined;
|
|
8
|
-
} & Omit<import("vue").HTMLAttributes & import("vue").ReservedProps, "
|
|
7
|
+
} & Omit<import("vue").HTMLAttributes & import("vue").ReservedProps, "class" | "style" | keyof SegmentedControlOwnProps<V>>> & (typeof globalThis extends {
|
|
9
8
|
__VLS_PROPS_FALLBACK: infer P;
|
|
10
9
|
} ? P : {});
|
|
11
10
|
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -21,6 +20,5 @@ declare const __VLS_export: <V extends string>(__VLS_props: NonNullable<Awaited<
|
|
|
21
20
|
};
|
|
22
21
|
declare const _default: typeof __VLS_export;
|
|
23
22
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
24
|
-
//#endregion
|
|
25
23
|
export { _default as default };
|
|
26
24
|
//# sourceMappingURL=segmented-control.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
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, selectRecipe, toStrbool } from "@hebium-ui/core";
|
|
7
|
-
|
|
8
|
+
// src/components/select/select.vue
|
|
8
9
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
10
|
name: "HuiSelect",
|
|
10
11
|
inheritAttrs: false,
|
|
@@ -29,12 +30,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
29
30
|
const attrs = useAttrs();
|
|
30
31
|
const resolvedProps = useHuiProps("Select", props, attrs);
|
|
31
32
|
const generatedId = useId();
|
|
32
|
-
const hasLabel =
|
|
33
|
+
const hasLabel = useSlotPresence(slots, [
|
|
34
|
+
"label",
|
|
35
|
+
"description",
|
|
36
|
+
"error"
|
|
37
|
+
]);
|
|
38
|
+
const hasError = useSlotPresence(slots, ["error"]);
|
|
33
39
|
const inputState = computed(() => {
|
|
34
40
|
const resolved = resolvedProps.value;
|
|
35
41
|
return {
|
|
36
42
|
id: resolved.id || generatedId,
|
|
37
|
-
invalid:
|
|
43
|
+
invalid: hasError.value,
|
|
38
44
|
required: attrToBool(resolved.required ?? resolved["aria-required"]),
|
|
39
45
|
disabled: attrToBool(resolved.disabled) || attrToBool(resolved["aria-disabled"])
|
|
40
46
|
};
|
|
@@ -45,14 +51,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
45
51
|
});
|
|
46
52
|
const cls = useHuiClasses("Select", recipe, computed(() => props.classes ?? {}));
|
|
47
53
|
const sls = useHuiStyles("Select", computed(() => props.styles ?? {}));
|
|
48
|
-
const forwardedAttrs = useHuiAttrs(resolvedProps, [
|
|
49
|
-
"id",
|
|
50
|
-
"labelProps",
|
|
51
|
-
"classes",
|
|
52
|
-
"styles",
|
|
53
|
-
"class",
|
|
54
|
-
"style"
|
|
55
|
-
]);
|
|
54
|
+
const forwardedAttrs = useHuiAttrs(resolvedProps, ["id", "labelProps"]);
|
|
56
55
|
const selectAttrs = computed(() => ({
|
|
57
56
|
...inputControl.getControlAttributes(inputState.value),
|
|
58
57
|
...forwardedAttrs.value
|
|
@@ -70,6 +69,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
70
69
|
resolvedProps,
|
|
71
70
|
generatedId,
|
|
72
71
|
hasLabel,
|
|
72
|
+
hasError,
|
|
73
73
|
inputState,
|
|
74
74
|
recipe,
|
|
75
75
|
cls,
|
|
@@ -118,7 +118,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
118
118
|
}), [renderSlot(_ctx.$slots, "default")], 16)], 6)], 6);
|
|
119
119
|
}
|
|
120
120
|
var select_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/select/select.vue"]]);
|
|
121
|
-
//#endregion
|
|
122
121
|
export { select_default as default };
|
|
123
122
|
|
|
124
123
|
//# sourceMappingURL=select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["_useSlots","Label","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_normalizeProps","_mergeProps","_createSlots","_withCtx","_renderSlot","_createCommentVNode","_createElementVNode"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n inputControl,\n selectRecipe,\n type SelectSlots as SelectRecipeSlots,\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 } from \"~/utils\";\nimport { Label } from \"../label\";\nimport type { SelectOwnProps } from \"./select.types\";\n\ndefineOptions({\n name: \"HuiSelect\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SelectOwnProps\n & {\n classes?:\n | Partial<Record<SelectRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<SelectRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"select\">,\n keyof SelectOwnProps | \"children\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Select\", props, attrs);\nconst generatedId = useId();\nconst hasLabel =
|
|
1
|
+
{"version":3,"file":"select.js","names":["_useSlots","Label","_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_createBlock","_normalizeProps","_mergeProps","_createSlots","_withCtx","_renderSlot","_createCommentVNode","_createElementVNode"],"sources":["../../../src/components/select/select.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n inputControl,\n selectRecipe,\n type SelectSlots as SelectRecipeSlots,\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 { SelectOwnProps } from \"./select.types\";\n\ndefineOptions({\n name: \"HuiSelect\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SelectOwnProps\n & {\n classes?:\n | Partial<Record<SelectRecipeSlots, ClassValue | undefined>>\n | undefined;\n styles?:\n | Partial<Record<SelectRecipeSlots, StyleValue | undefined>>\n | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<\"select\">,\n keyof SelectOwnProps | \"children\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\nconst slots = defineSlots<{\n default?: () => unknown;\n label?: () => unknown;\n description?: () => unknown;\n error?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"Select\", props, attrs);\nconst generatedId = useId();\nconst hasLabel = useSlotPresence(slots, [\"label\", \"description\", \"error\"]);\nconst hasError = useSlotPresence(slots, [\"error\"]);\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 };\n});\nconst recipe = computed(() => {\n const state = inputState.value;\n\n return selectRecipe({\n error: toStrbool(state.invalid),\n });\n});\nconst cls = useHuiClasses(\n \"Select\",\n recipe,\n computed(() => props.classes ?? {}),\n);\nconst sls = useHuiStyles<\"Select\", SelectRecipeSlots>(\n \"Select\",\n computed(() => props.styles ?? {}),\n);\nconst forwardedAttrs = useHuiAttrs(resolvedProps, [\n \"id\",\n \"labelProps\",\n]);\nconst selectAttrs = 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 selectRef = useTemplateRef<HuiElementInstance<\"select\">>(\"select\");\n\ndefineExpose({\n select: selectRef,\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 <div :class=\"cls.wrapper\" :style=\"sls.wrapper\">\n <select\n ref=\"select\"\n v-bind=\"selectAttrs\"\n :class=\"cls.select\"\n :style=\"sls.select\"\n >\n <slot />\n </select>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CA,MAAM,QAAQ;EAEd,MAAM,QAAQA,SAAA;EAOd,MAAM,QAAQ,SAAS;EACvB,MAAM,gBAAgB,YAAY,UAAU,OAAO,KAAK;EACxD,MAAM,cAAc,MAAM;EAC1B,MAAM,WAAW,gBAAgB,OAAO;GAAC;GAAS;GAAe;EAAO,CAAC;EACzE,MAAM,WAAW,gBAAgB,OAAO,CAAC,OAAO,CAAC;EACjD,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;GAC3C;EACF,CAAC;EACD,MAAM,SAAS,eAAe;GAC5B,MAAM,QAAQ,WAAW;GAEzB,OAAO,aAAa,EAClB,OAAO,UAAU,MAAM,OAAO,EAChC,CAAC;EACH,CAAC;EACD,MAAM,MAAM,cACV,UACA,QACA,eAAe,MAAM,WAAW,CAAC,CAAC,CACpC;EACA,MAAM,MAAM,aACV,UACA,eAAe,MAAM,UAAU,CAAC,CAAC,CACnC;EACA,MAAM,iBAAiB,YAAY,eAAe,CAChD,MACA,YACF,CAAC;EACD,MAAM,cAAc,gBAAyC;GAC3D,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,YAAY,eAA6C,QAAQ;EAEvE,SAAa,EACX,QAAQ,UACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIC,OAAAE,UAAA,GAAAC,mBAsBM,OAAA;EAtBA,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,mBASM,OAAA;EATA,OAAKT,eAAE,OAAA,IAAI,OAAO;EAAG,OAAKC,eAAE,OAAA,IAAI,OAAO;C,IAC3CQ,mBAOS,UAPTL,WAOS,EANP,KAAI,SAAQ,GACJ,OAAA,aAAW;EAClB,OAAO,OAAA,IAAI;EACX,OAAO,OAAA,IAAI;C,KAEZG,WAAQ,KAAA,QAAA,SAAA,C"}
|
|
@@ -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 { SelectSlots } from "@hebium-ui/core";
|
|
7
|
-
//#region src/components/select/select.types.d.ts
|
|
8
7
|
type HtmlSelectProps = Omit<HuiElementProps<"select">, "children">;
|
|
9
8
|
export interface SelectOwnProps {
|
|
10
9
|
/**
|
|
@@ -16,6 +15,5 @@ export type SelectProps = HuiComponentProps<HtmlSelectProps & SelectOwnProps, Se
|
|
|
16
15
|
export interface SelectExposed {
|
|
17
16
|
readonly select: HuiElementInstance<"select"> | null;
|
|
18
17
|
}
|
|
19
|
-
//#endregion
|
|
20
18
|
export {};
|
|
21
19
|
//# sourceMappingURL=select.types.d.ts.map
|
|
@@ -3,7 +3,6 @@ import "../../types/index.js";
|
|
|
3
3
|
import { SelectOwnProps } from "./select.types.js";
|
|
4
4
|
import { ClassValue, StyleValue } from "vue";
|
|
5
5
|
import { SelectSlots } from "@hebium-ui/core";
|
|
6
|
-
//#region src/components/select/select.vue.d.ts
|
|
7
6
|
type Props = SelectOwnProps & {
|
|
8
7
|
classes?: Partial<Record<SelectSlots, ClassValue | undefined>> | undefined;
|
|
9
8
|
styles?: Partial<Record<SelectSlots, StyleValue | undefined>> | undefined;
|
|
@@ -24,6 +23,5 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
24
23
|
$slots: S;
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
//#endregion
|
|
28
26
|
export { _default as default };
|
|
29
27
|
//# sourceMappingURL=select.vue.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { skipLinkRecipe } from "@hebium-ui/core";
|
|
5
|
+
// src/components/skip-link/skip-link.vue
|
|
6
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
|
+
name: "HuiSkipLink",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "skip-link",
|
|
10
|
+
props: {
|
|
11
|
+
as: {
|
|
12
|
+
type: null,
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
class: {
|
|
16
|
+
type: [
|
|
17
|
+
Boolean,
|
|
18
|
+
null,
|
|
19
|
+
String,
|
|
20
|
+
Object,
|
|
21
|
+
Array
|
|
22
|
+
],
|
|
23
|
+
required: false,
|
|
24
|
+
skipCheck: true
|
|
25
|
+
},
|
|
26
|
+
style: {
|
|
27
|
+
type: [
|
|
28
|
+
Boolean,
|
|
29
|
+
null,
|
|
30
|
+
String,
|
|
31
|
+
Object,
|
|
32
|
+
Array
|
|
33
|
+
],
|
|
34
|
+
required: false,
|
|
35
|
+
skipCheck: true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(__props, { expose: __expose }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const attrs = useAttrs();
|
|
41
|
+
const resolvedProps = useHuiProps("SkipLink", props, attrs);
|
|
42
|
+
const component = computed(() => toRaw(resolvedProps.value.as ?? "div"));
|
|
43
|
+
const recipe = computed(() => skipLinkRecipe());
|
|
44
|
+
const cls = useHuiClasses("SkipLink", recipe, computed(() => ({ root: props.class })));
|
|
45
|
+
const sls = useHuiStyles("SkipLink", computed(() => ({ root: props.style })));
|
|
46
|
+
const rootAttrs = useHuiAttrs(resolvedProps, ["as"]);
|
|
47
|
+
const rootRef = useTemplateRef("root");
|
|
48
|
+
__expose({ root: rootRef });
|
|
49
|
+
const __returned__ = {
|
|
50
|
+
props,
|
|
51
|
+
attrs,
|
|
52
|
+
resolvedProps,
|
|
53
|
+
component,
|
|
54
|
+
recipe,
|
|
55
|
+
cls,
|
|
56
|
+
sls,
|
|
57
|
+
rootAttrs,
|
|
58
|
+
rootRef
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
61
|
+
enumerable: false,
|
|
62
|
+
value: true
|
|
63
|
+
});
|
|
64
|
+
return __returned__;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
68
|
+
return openBlock(), createBlock(resolveDynamicComponent($setup.component), mergeProps({ ref: "root" }, $setup.rootAttrs, {
|
|
69
|
+
class: $setup.cls.root,
|
|
70
|
+
style: $setup.sls.root
|
|
71
|
+
}), {
|
|
72
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
73
|
+
_: 3
|
|
74
|
+
}, 16, ["class", "style"]);
|
|
75
|
+
}
|
|
76
|
+
var skip_link_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/hebium-ui/hebium-ui/packages/vue/src/components/skip-link/skip-link.vue"]]);
|
|
77
|
+
export { skip_link_default as default };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=skip-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-link.js","names":["_openBlock","_createBlock","_resolveDynamicComponent","_mergeProps","_withCtx","_renderSlot"],"sources":["../../../src/components/skip-link/skip-link.vue"],"sourcesContent":["<script\n setup\n lang=\"ts\"\n generic=\"E extends ElementType = 'div'\"\n>\nimport { skipLinkRecipe } 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 { SkipLinkOwnProps } from \"./skip-link.types\";\n\ndefineOptions({\n name: \"HuiSkipLink\",\n inheritAttrs: false,\n});\n\ntype Props =\n & SkipLinkOwnProps\n & { as?: E | undefined }\n & {\n class?: ClassValue | undefined;\n style?: StyleValue | undefined;\n }\n & /* @vue-ignore */ Omit<\n HuiElementPropsNoInfer<E>,\n keyof SkipLinkOwnProps | \"as\" | \"class\" | \"style\"\n >;\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n default?: () => unknown;\n}>();\n\nconst attrs = useAttrs();\nconst resolvedProps = useHuiProps(\"SkipLink\", props, attrs);\nconst component = computed<E | \"div\">(() =>\n toRaw(resolvedProps.value.as ?? \"div\")\n);\nconst recipe = computed(() => skipLinkRecipe());\nconst cls = useHuiClasses(\n \"SkipLink\",\n recipe,\n computed(() => ({ root: props.class })),\n);\nconst sls = useHuiStyles(\n \"SkipLink\",\n computed(() => ({ root: props.style })),\n);\nconst rootAttrs = useHuiAttrs(resolvedProps, [\"as\"]);\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,YAAY,OAAO,KAAK;EAC1D,MAAM,YAAY,eAChB,MAAM,cAAc,MAAM,MAAM,KAAK,CACvC;EACA,MAAM,SAAS,eAAe,eAAe,CAAC;EAC9C,MAAM,MAAM,cACV,YACA,QACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,MAAM,aACV,YACA,gBAAgB,EAAE,MAAM,MAAM,MAAM,EAAE,CACxC;EACA,MAAM,YAAY,YAAY,eAAe,CAAC,IAAI,CAAC;EACnD,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,10 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance } from "../../types/element.js";
|
|
2
|
+
import { HuiPolymorphicProps } from "../../types/polymorphic.js";
|
|
3
|
+
import "../../types/index.js";
|
|
4
|
+
import { SkipLinkSlots } from "@hebium-ui/core";
|
|
5
|
+
export interface SkipLinkOwnProps {}
|
|
6
|
+
export type SkipLinkProps<E extends ElementType = "div"> = HuiPolymorphicProps<E, SkipLinkOwnProps, SkipLinkSlots>;
|
|
7
|
+
export interface SkipLinkExposed<E extends ElementType = "div"> {
|
|
8
|
+
readonly root: HuiElementInstance<E> | null;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=skip-link.types.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ElementType, HuiElementInstance, HuiElementPropsNoInfer } from "../../types/element.js";
|
|
2
|
+
import "../../types/index.js";
|
|
3
|
+
import { SkipLinkOwnProps } from "./skip-link.types.js";
|
|
4
|
+
import { ClassValue, StyleValue } from "vue";
|
|
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<{
|
|
6
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<SkipLinkOwnProps & {
|
|
7
|
+
as?: E | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
class?: ClassValue | undefined;
|
|
10
|
+
style?: StyleValue | undefined;
|
|
11
|
+
} & Omit<HuiElementPropsNoInfer<E>, "class" | "style" | "as">> & (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=skip-link.vue.d.ts.map
|