InputIcon.mjs 884 B

1234567891011121314151617181920212223242526272829303132
  1. import { createVNode as _createVNode } from "vue";
  2. // Components
  3. import { VIcon } from "../VIcon/index.mjs"; // Composables
  4. import { useLocale } from "../../composables/locale.mjs"; // Types
  5. export function useInputIcon(props) {
  6. const {
  7. t
  8. } = useLocale();
  9. function InputIcon(_ref) {
  10. let {
  11. name
  12. } = _ref;
  13. const localeKey = {
  14. prepend: 'prependAction',
  15. prependInner: 'prependAction',
  16. append: 'appendAction',
  17. appendInner: 'appendAction',
  18. clear: 'clear'
  19. }[name];
  20. const listener = props[`onClick:${name}`];
  21. const label = listener && localeKey ? t(`$vuetify.input.${localeKey}`, props.label ?? '') : undefined;
  22. return _createVNode(VIcon, {
  23. "icon": props[`${name}Icon`],
  24. "aria-label": label,
  25. "onClick": listener
  26. }, null);
  27. }
  28. return {
  29. InputIcon
  30. };
  31. }
  32. //# sourceMappingURL=InputIcon.mjs.map