date-time-picker.d.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import dayjs from 'dayjs';
  2. import type { Dayjs } from 'dayjs';
  3. import { SuperComponent } from '../common/src/index';
  4. declare enum ModeItem {
  5. YEAR = "year",
  6. MONTH = "month",
  7. DATE = "date",
  8. HOUR = "hour",
  9. MINUTE = "minute"
  10. }
  11. interface ColumnItemValue {
  12. value: string | number;
  13. label: string | number;
  14. }
  15. export default class DateTimePicker extends SuperComponent {
  16. properties: import("./type").TdDateTimePickerProps;
  17. externalClasses: string[];
  18. options: {
  19. multipleSlots: boolean;
  20. };
  21. observers: {
  22. 'start, end, value': () => void;
  23. mode(m: any): void;
  24. };
  25. date: any;
  26. data: {
  27. prefix: string;
  28. classPrefix: string;
  29. columns: any[];
  30. columnsValue: any[];
  31. fullModes: any[];
  32. locale: {
  33. year: string;
  34. month: string;
  35. day: string;
  36. hour: string;
  37. minute: string;
  38. am: string;
  39. pm: string;
  40. confirm: string;
  41. cancel: string;
  42. };
  43. };
  44. controlledProps: {
  45. key: string;
  46. event: string;
  47. }[];
  48. methods: {
  49. updateColumns(): void;
  50. getParseDate(): Dayjs;
  51. getMinDate(): Dayjs;
  52. getMaxDate(): Dayjs;
  53. getMinYear(): number;
  54. getMaxYear(): number;
  55. getMinMonth(): number;
  56. getMaxMonth(): number;
  57. getMinDay(): number;
  58. getMaxDay(): number;
  59. getMinHour(): number;
  60. getMaxHour(): number;
  61. getMinMinute(): number;
  62. getMaxMinute(): number;
  63. getDate(): Dayjs;
  64. clipDate(date: Dayjs): Dayjs;
  65. setYear(date: Dayjs, year: number): Dayjs;
  66. setMonth(date: Dayjs, month: number): Dayjs;
  67. getColumnOptions(): any[];
  68. getCommonDateParams(): {
  69. date: dayjs.Dayjs;
  70. selYear: number;
  71. selMonth: number;
  72. selDate: number;
  73. selHour: number;
  74. minDateYear: any;
  75. maxDateYear: any;
  76. minDateMonth: any;
  77. maxDateMonth: any;
  78. minDateDay: any;
  79. maxDateDay: any;
  80. minDateHour: any;
  81. maxDateHour: any;
  82. minDateMinute: any;
  83. maxDateMinute: any;
  84. };
  85. getOptionByType(type: any, dateParams: any): any;
  86. getYearOptions(dateParams: any): ColumnItemValue[];
  87. getMonthOptions(dateParams: any): ColumnItemValue[];
  88. getDayOptions(dateParams: any): ColumnItemValue[];
  89. getHourOptions(dateParams: any): ColumnItemValue[];
  90. getMinuteOptions(dateParams: any): ColumnItemValue[];
  91. getValueCols(this: DateTimePicker): {
  92. columns: any;
  93. columnsValue: any;
  94. };
  95. getColumnsValue(): string[];
  96. getNewDate(value: number, type: ModeItem): Dayjs;
  97. onColumnChange(e: WechatMiniprogram.CustomEvent): void;
  98. onConfirm(): void;
  99. onCancel(): void;
  100. onVisibleChange(e: any): void;
  101. resetColumns(): void;
  102. };
  103. getFullModeArray(mode: any): any;
  104. getFullModeByModeString(modeString: any, matchModes: any): any;
  105. isTimeMode(): boolean;
  106. }
  107. export {};