color-picker.d.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import { SuperComponent } from '../common/src/index';
  2. import type { Coordinate } from './interfaces';
  3. import { Color } from './utils';
  4. export default class ColorPicker extends SuperComponent {
  5. options: {
  6. multipleSlots: boolean;
  7. };
  8. properties: import("./type").TdColorPickerProps;
  9. observers: {
  10. format(): void;
  11. swatchColors(value: any): void;
  12. type(value: any): void;
  13. 'usePopup, visible'(usePopup: boolean, visible: boolean): void;
  14. value(v: string): void;
  15. };
  16. color: Color;
  17. data: {
  18. prefix: string;
  19. classPrefix: string;
  20. panelRect: {
  21. width: number;
  22. height: number;
  23. };
  24. sliderRect: {
  25. width: number;
  26. left: number;
  27. };
  28. saturationInfo: {
  29. saturation: number;
  30. value: number;
  31. };
  32. saturationThumbStyle: {
  33. left: number;
  34. top: number;
  35. };
  36. sliderInfo: {
  37. value: number;
  38. };
  39. hueSliderStyle: {
  40. left: number;
  41. };
  42. alphaSliderStyle: {
  43. left: number;
  44. };
  45. innerValue: string;
  46. showPrimaryColorPreview: boolean;
  47. previewColor: string;
  48. formatList: any[];
  49. innerSwatchList: any;
  50. isMultiple: boolean;
  51. defaultOverlayProps: {};
  52. };
  53. lifetimes: {
  54. ready(): void;
  55. attached(): void;
  56. detached(): void;
  57. };
  58. methods: {
  59. init(): void;
  60. updateEleRect(e: WechatMiniprogram.TouchEvent): void;
  61. getEleReact(): void;
  62. clickSwatch(e: any): void;
  63. setCoreStyle(): void;
  64. emitColorChange(trigger: any): void;
  65. defaultEmptyColor(): string;
  66. updateColor(): void;
  67. getSaturationAndValueByCoordinate(coordinate: Coordinate): {
  68. saturation: number;
  69. value: number;
  70. };
  71. getSaturationThumbStyle({ saturation, value }: {
  72. saturation: any;
  73. value: any;
  74. }): {
  75. color: any;
  76. left: string;
  77. top: string;
  78. };
  79. getSliderThumbStyle({ value, maxValue }: {
  80. value: any;
  81. maxValue: any;
  82. }): {
  83. left: string;
  84. color: any;
  85. };
  86. onChangeSaturation({ saturation, value }: {
  87. saturation: any;
  88. value: any;
  89. }): void;
  90. formatValue(): any;
  91. onChangeSlider({ value, isAlpha }: {
  92. value: any;
  93. isAlpha: any;
  94. }): void;
  95. handleSaturationDrag(e: any): void;
  96. handleSliderDrag(e: any, isAlpha?: boolean): void;
  97. handleDiffDrag(e: any): void;
  98. onTouchStart(e: any): void;
  99. onTouchMove(e: any): void;
  100. onTouchEnd(e: any): void;
  101. close(trigger: string): void;
  102. onVisibleChange(): void;
  103. };
  104. }