badge.d.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  2. import "../../../utils/index.js";
  3. import * as vue from "vue";
  4. import { ExtractPublicPropTypes, StyleValue } from "vue";
  5. //#region ../../packages/components/badge/src/badge.d.ts
  6. interface BadgeProps {
  7. /**
  8. * @description display value.
  9. */
  10. value?: string | number;
  11. /**
  12. * @description maximum value, shows `{max}+` when exceeded. Only works if value is a number.
  13. */
  14. max?: number;
  15. /**
  16. * @description if a little dot is displayed.
  17. */
  18. isDot?: boolean;
  19. /**
  20. * @description hidden badge.
  21. */
  22. hidden?: boolean;
  23. /**
  24. * @description badge type.
  25. */
  26. type?: 'primary' | 'success' | 'warning' | 'info' | 'danger';
  27. /**
  28. * @description whether to show badge when value is zero.
  29. */
  30. showZero?: boolean;
  31. /**
  32. * @description customize dot background color
  33. */
  34. color?: string;
  35. /**
  36. * @description CSS style of badge
  37. */
  38. badgeStyle?: StyleValue;
  39. /**
  40. * @description set offset of the badge
  41. */
  42. offset?: [number, number];
  43. /**
  44. * @description custom class name of badge
  45. */
  46. badgeClass?: string;
  47. }
  48. /**
  49. * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
  50. */
  51. declare const badgeProps: {
  52. readonly value: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
  53. readonly max: EpPropFinalized<NumberConstructor, unknown, unknown, 99, boolean>;
  54. readonly isDot: BooleanConstructor;
  55. readonly hidden: BooleanConstructor;
  56. readonly type: EpPropFinalized<StringConstructor, "info" | "primary" | "success" | "warning" | "danger", unknown, "danger", boolean>;
  57. readonly showZero: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
  58. readonly color: StringConstructor;
  59. readonly badgeStyle: {
  60. readonly type: vue.PropType<EpPropMergeType<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | ((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue))[], unknown, unknown>>;
  61. readonly required: false;
  62. readonly validator: ((val: unknown) => boolean) | undefined;
  63. __epPropKey: true;
  64. };
  65. readonly offset: EpPropFinalized<(new (...args: any[]) => [number, number]) | (() => [number, number]) | ((new (...args: any[]) => [number, number]) | (() => [number, number]))[], unknown, unknown, () => number[], boolean>;
  66. readonly badgeClass: {
  67. readonly type: vue.PropType<string>;
  68. readonly required: false;
  69. readonly validator: ((val: unknown) => boolean) | undefined;
  70. __epPropKey: true;
  71. };
  72. };
  73. /**
  74. * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
  75. */
  76. type BadgePropsPublic = ExtractPublicPropTypes<typeof badgeProps>;
  77. //#endregion
  78. export { BadgeProps, BadgePropsPublic, badgeProps };