|
| 1 | +export default { |
| 2 | + mode: ['pc'], |
| 3 | + apis: [ |
| 4 | + { |
| 5 | + name: 'date-panel', |
| 6 | + type: 'component', |
| 7 | + props: [ |
| 8 | + { |
| 9 | + name: 'disabled-date', |
| 10 | + type: 'function', |
| 11 | + defaultValue: '', |
| 12 | + desc: { |
| 13 | + 'zh-CN': '配置部分禁用', |
| 14 | + 'en-US': 'Configuration section disabled.' |
| 15 | + }, |
| 16 | + mode: ['pc'], |
| 17 | + pcDemo: 'disabled-date' |
| 18 | + }, |
| 19 | + { |
| 20 | + name: 'format', |
| 21 | + type: 'string', |
| 22 | + defaultValue: "'yyyy-MM-dd'", |
| 23 | + desc: { |
| 24 | + 'zh-CN': '面板选中日期格式', |
| 25 | + 'en-US': 'Select date format on the panel.' |
| 26 | + }, |
| 27 | + mode: ['pc'], |
| 28 | + pcDemo: 'format' |
| 29 | + }, |
| 30 | + { |
| 31 | + name: 'v-model/modelValue', |
| 32 | + type: 'date | string | number', |
| 33 | + defaultValue: '', |
| 34 | + desc: { |
| 35 | + 'zh-CN': '绑定值', |
| 36 | + 'en-US': 'Set the initial value of the calendar component. ;Bound Value.' |
| 37 | + }, |
| 38 | + mode: ['pc'], |
| 39 | + pcDemo: 'basic-usage' |
| 40 | + }, |
| 41 | + { |
| 42 | + name: 'popper-class', |
| 43 | + type: 'string', |
| 44 | + defaultValue: '', |
| 45 | + desc: { |
| 46 | + 'zh-CN': '为 DatePicker 面板添加的 class 类名', |
| 47 | + 'en-US': 'Class name added for DatePanel.' |
| 48 | + }, |
| 49 | + mode: ['pc'], |
| 50 | + pcDemo: 'custom-suffix-icon' |
| 51 | + }, |
| 52 | + { |
| 53 | + name: 'readonly', |
| 54 | + type: 'boolean', |
| 55 | + defaultValue: 'false', |
| 56 | + desc: { |
| 57 | + 'zh-CN': '设置日历组件是否只读', |
| 58 | + 'en-US': 'Set panel component is read-only.' |
| 59 | + }, |
| 60 | + mode: ['pc'], |
| 61 | + pcDemo: 'readonly' |
| 62 | + }, |
| 63 | + { |
| 64 | + name: 'show-week-number', |
| 65 | + type: 'boolean', |
| 66 | + defaultValue: 'false', |
| 67 | + desc: { |
| 68 | + 'zh-CN': '是否展示周次序号', |
| 69 | + 'en-US': 'Display week number.' |
| 70 | + }, |
| 71 | + mode: ['pc'], |
| 72 | + pcDemo: 'custom-weeks' |
| 73 | + }, |
| 74 | + { |
| 75 | + name: 'format-weeks', |
| 76 | + type: '(customWeeks: number, weekFirstDays: string[]) => string', |
| 77 | + defaultValue: '', |
| 78 | + desc: { |
| 79 | + 'zh-CN': |
| 80 | + '格式化周次序号,该回调函数有两个参数,customWeeks 用来获取自定义周次的序号,weekFirstDays 用来获取每周次中的首个日期', |
| 81 | + 'en-US': |
| 82 | + 'Format the week number, this callback function has two parameters: customWeeks is used to obtain the custom week number, and weekFirstDays is used to obtain the first date in the week number' |
| 83 | + }, |
| 84 | + mode: ['pc'], |
| 85 | + pcDemo: 'custom-weeks' |
| 86 | + }, |
| 87 | + { |
| 88 | + name: 'first-day-of-week', |
| 89 | + type: 'number', |
| 90 | + defaultValue: '7', |
| 91 | + desc: { |
| 92 | + 'zh-CN': '设置每周的第一天是星期几,默认值是7,也就是星期天', |
| 93 | + 'en-US': |
| 94 | + 'Set the first day of each week as the day of the week, with a default value of 7, which is Sunday.' |
| 95 | + }, |
| 96 | + mode: ['pc'], |
| 97 | + pcDemo: 'custom-weeks' |
| 98 | + } |
| 99 | + ], |
| 100 | + events: [ |
| 101 | + { |
| 102 | + name: 'select-change', |
| 103 | + type: '(value: string) => void', |
| 104 | + desc: { |
| 105 | + 'zh-CN': '用户确认选定的值时触发', |
| 106 | + 'en-US': 'This event is triggered when the user confirms the selected value.' |
| 107 | + }, |
| 108 | + mode: ['pc'], |
| 109 | + pcDemo: 'event' |
| 110 | + } |
| 111 | + ], |
| 112 | + format: [ |
| 113 | + { |
| 114 | + name: 'a', |
| 115 | + desc: { |
| 116 | + 'zh-CN': 'am/pm', |
| 117 | + 'en-US': '' |
| 118 | + }, |
| 119 | + mode: ['pc'], |
| 120 | + pcDemo: '' |
| 121 | + }, |
| 122 | + { |
| 123 | + name: 'A', |
| 124 | + desc: { |
| 125 | + 'zh-CN': 'AM/PM', |
| 126 | + 'en-US': '' |
| 127 | + }, |
| 128 | + mode: ['pc'], |
| 129 | + pcDemo: '' |
| 130 | + }, |
| 131 | + { |
| 132 | + name: 'd', |
| 133 | + desc: { |
| 134 | + 'zh-CN': '日,不补0', |
| 135 | + 'en-US': '' |
| 136 | + }, |
| 137 | + mode: ['pc'] |
| 138 | + }, |
| 139 | + { |
| 140 | + name: 'dd', |
| 141 | + desc: { |
| 142 | + 'zh-CN': '日', |
| 143 | + 'en-US': '' |
| 144 | + }, |
| 145 | + mode: ['pc'] |
| 146 | + }, |
| 147 | + { |
| 148 | + name: 'M', |
| 149 | + desc: { |
| 150 | + 'zh-CN': '月,不补0', |
| 151 | + 'en-US': '' |
| 152 | + }, |
| 153 | + mode: ['pc'] |
| 154 | + }, |
| 155 | + { |
| 156 | + name: 'MM', |
| 157 | + desc: { |
| 158 | + 'zh-CN': '月', |
| 159 | + 'en-US': '' |
| 160 | + }, |
| 161 | + mode: ['pc'] |
| 162 | + }, |
| 163 | + { |
| 164 | + name: 'W', |
| 165 | + desc: { |
| 166 | + 'zh-CN': '周,不补0', |
| 167 | + 'en-US': '' |
| 168 | + }, |
| 169 | + mode: ['pc'] |
| 170 | + }, |
| 171 | + { |
| 172 | + name: 'WW', |
| 173 | + desc: { |
| 174 | + 'zh-CN': '周', |
| 175 | + 'en-US': '' |
| 176 | + }, |
| 177 | + mode: ['pc'] |
| 178 | + }, |
| 179 | + { |
| 180 | + name: 'yyyy', |
| 181 | + desc: { |
| 182 | + 'zh-CN': '年', |
| 183 | + 'en-US': '' |
| 184 | + }, |
| 185 | + mode: ['pc'] |
| 186 | + } |
| 187 | + ] |
| 188 | + } |
| 189 | + ], |
| 190 | + types: [ |
| 191 | + { |
| 192 | + name: 'IPickerOptions', |
| 193 | + type: 'interface', |
| 194 | + code: ` |
| 195 | +interface IPickerOptions { |
| 196 | + // 每周的第一天是星期几,默认值是7,也就是星期天 |
| 197 | + firstDayOfWeek: number |
| 198 | + // 实现部分禁用,此时只能选择一部分日期 |
| 199 | + disabledDate: (time: Date) => boolean |
| 200 | + // 选中日期后执行的回调,需要与 daterange 或 datetimerange 类型配合使用才生效 |
| 201 | + onPick: (range: { minDate: Date, maxDate: Date }) => void |
| 202 | + // 快捷选项 |
| 203 | + shortcuts: { |
| 204 | + text: string |
| 205 | + onClick: (picker: { $emit: (type: string, date: Date) => void }) => void |
| 206 | + type: 'startFrom' | 'EndAt' |
| 207 | + startDate: Date |
| 208 | + endDate: Date |
| 209 | + }[] |
| 210 | +} |
| 211 | + ` |
| 212 | + }, |
| 213 | + { |
| 214 | + name: 'IType', |
| 215 | + type: 'type', |
| 216 | + code: ` |
| 217 | +type IType = 'date' | 'dates' | 'daterange' | 'datetime' | 'datetimerange' | 'week' | 'month' | 'monthrange' | 'quarter' | 'year' | 'years' | 'yearrange' |
| 218 | + ` |
| 219 | + } |
| 220 | + ] |
| 221 | +} |
0 commit comments