rate.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { ElementUIComponent } from './component'
  2. interface Option {
  3. value: string,
  4. excluded?: boolean
  5. }
  6. interface Options {
  7. [threshold: number]: string | Option
  8. }
  9. export type RateColors = Options
  10. export type RateIconClasses = Options
  11. /** Rate Component */
  12. export declare class ElRate extends ElementUIComponent {
  13. /** Max rating score */
  14. max: number
  15. /** Whether Rate is read-only */
  16. disabled: boolean
  17. /** Whether picking half start is allowed */
  18. allowHalf: boolean
  19. /** Threshold value between low and medium level. The value itself will be included in low level */
  20. lowThreshold: number
  21. /** Threshold value between medium and high level. The value itself will be included in high level */
  22. highThreshold: number
  23. /** Colors for icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding color */
  24. colors: string[] | RateColors
  25. /** Color of unselected icons */
  26. voidColor: string
  27. /** Color of unselected read-only icons */
  28. disabledVoidColor: string
  29. /** Class names of icons. If array, it should have 3 elements, each of which corresponds with a score level, else if object, the key should be threshold value between two levels, and the value should be corresponding class name */
  30. iconClasses: string[] | RateIconClasses
  31. /** Class name of unselected icons */
  32. voidIconClass: string
  33. /** Class name of unselected read-only icons */
  34. disabledVoidIconClass: string
  35. /** Whether to display texts */
  36. showText: boolean
  37. /** Whether to display current score. show-score and show-text cannot be true at the same time */
  38. showScore: boolean
  39. /** Color of texts */
  40. textColor: string
  41. /** Text array */
  42. texts: string[]
  43. /** Text template when the component is read-only */
  44. scoreTemplate: string
  45. }