@pisell/materials 1.0.934 → 1.0.935

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +164 -148
  7. package/build/lowcode/render/default/view.js +30 -15
  8. package/build/lowcode/view.js +41 -26
  9. package/es/components/appVersionControl/index.d.ts +4 -0
  10. package/es/components/batch-editor/index.d.ts +0 -1
  11. package/es/components/cardPro/index.d.ts +3 -0
  12. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
  13. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
  14. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
  15. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
  16. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
  17. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
  18. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
  19. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +85 -0
  20. package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
  21. package/es/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +16 -0
  22. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
  23. package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +25 -0
  24. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  25. package/es/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  26. package/es/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
  27. package/es/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
  28. package/es/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  29. package/es/components/dataSourceComponents/fields/index.d.ts +11 -12
  30. package/es/components/drag-sort-tree/index.d.ts +3 -0
  31. package/es/components/filter/types.d.ts +45 -0
  32. package/es/components/hardwareErrorTip/demo.d.ts +3 -0
  33. package/es/components/hardwareErrorTip/errorCard/index.d.ts +28 -0
  34. package/es/components/hardwareErrorTip/errorTipStatistics/index.d.ts +12 -0
  35. package/es/components/hardwareErrorTip/index.d.ts +19 -0
  36. package/es/components/hardwareErrorTip/logCard/index.d.ts +27 -0
  37. package/es/components/hardwareErrorTip/types.d.ts +28 -0
  38. package/es/components/iconfont/index.d.ts +8 -0
  39. package/es/components/keyboard/index.d.ts +22 -0
  40. package/es/components/list/index.d.ts +0 -1
  41. package/es/components/login-and-register/index.d.ts +82 -0
  42. package/es/components/pisell-config-provider/index.d.ts +13 -0
  43. package/es/components/pisell-config-provider/index.js +0 -1
  44. package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
  45. package/es/components/pisellCamera/index.d.ts +4 -0
  46. package/es/components/pisellCardList/index.d.ts +4 -0
  47. package/es/components/pisellCardList/index.js +5 -1
  48. package/es/components/pisellEmpty/index.d.ts +19 -0
  49. package/es/components/pisellText/components/Editable/index.d.ts +29 -0
  50. package/es/components/pisellText/index.d.ts +9 -0
  51. package/es/components/pisellWalletPassCard/index.d.ts +140 -0
  52. package/es/components/pisellWalletPassCard/index.js +17 -4
  53. package/es/components/pisellWalletPassCard/utils.d.ts +44 -0
  54. package/es/components/pisellWalletPassCard/utils.js +499 -0
  55. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  56. package/es/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  57. package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
  58. package/es/components/productCard/components/Header/Actions/index.d.ts +3 -0
  59. package/es/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
  60. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  61. package/es/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
  62. package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
  63. package/es/components/productCard/components/Time/index.d.ts +3 -0
  64. package/es/components/select/index.d.ts +9 -0
  65. package/es/components/sortableList/index.d.ts +11 -0
  66. package/es/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  67. package/es/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
  68. package/es/components/table/Gallery/index.d.ts +5 -0
  69. package/es/components/table/Table/SelectField/index.d.ts +0 -1
  70. package/es/components/table/Table/fields/index.d.ts +2 -3
  71. package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
  72. package/es/components/table/Table/fields/text/index.d.ts +0 -1
  73. package/es/components/table/Table/index.d.ts +4 -0
  74. package/es/components/table/Table/utils.d.ts +167 -0
  75. package/es/components/table/hooks/useTableSetting.d.ts +21 -0
  76. package/es/components/table/hooks/useTableSetting.js +1 -1
  77. package/es/components/table/hooks/useTransDataSource.d.ts +12 -0
  78. package/es/components/table/index.d.ts +4 -0
  79. package/es/components/table/types.d.ts +270 -0
  80. package/es/components/translation/index.d.ts +15 -0
  81. package/es/components/versionModal/index.d.ts +24 -0
  82. package/es/components/virtual-keyboard/Number/index.d.ts +0 -1
  83. package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  84. package/es/components/walletCard/index.d.ts +71 -0
  85. package/es/index.d.ts +145 -0
  86. package/es/locales/en-US.d.ts +342 -0
  87. package/es/locales/en-US.js +1 -0
  88. package/es/locales/zh-CN.d.ts +337 -0
  89. package/es/locales/zh-CN.js +1 -0
  90. package/es/locales/zh-TW.d.ts +337 -0
  91. package/es/locales/zh-TW.js +16 -8
  92. package/es/utils/platform.d.ts +1 -1
  93. package/lib/components/appVersionControl/index.d.ts +4 -0
  94. package/lib/components/batch-editor/index.d.ts +0 -1
  95. package/lib/components/cardPro/index.d.ts +3 -0
  96. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +56 -0
  97. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
  98. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +27 -0
  99. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
  100. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +98 -0
  101. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
  102. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +33 -0
  103. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +85 -0
  104. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
  105. package/lib/components/dataSourceComponents/fields/Input.Mobile/WithMode.d.ts +16 -0
  106. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +16 -0
  107. package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +25 -0
  108. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  109. package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.d.ts +5 -0
  110. package/lib/components/dataSourceComponents/fields/Upload/CameraPopover.d.ts +5 -0
  111. package/lib/components/dataSourceComponents/fields/Upload/index.d.ts +3 -0
  112. package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +38 -0
  113. package/lib/components/dataSourceComponents/fields/index.d.ts +11 -12
  114. package/lib/components/drag-sort-tree/index.d.ts +3 -0
  115. package/lib/components/filter/types.d.ts +45 -0
  116. package/lib/components/hardwareErrorTip/demo.d.ts +3 -0
  117. package/lib/components/hardwareErrorTip/errorCard/index.d.ts +28 -0
  118. package/lib/components/hardwareErrorTip/errorTipStatistics/index.d.ts +12 -0
  119. package/lib/components/hardwareErrorTip/index.d.ts +19 -0
  120. package/lib/components/hardwareErrorTip/logCard/index.d.ts +27 -0
  121. package/lib/components/hardwareErrorTip/types.d.ts +28 -0
  122. package/lib/components/iconfont/index.d.ts +8 -0
  123. package/lib/components/keyboard/index.d.ts +22 -0
  124. package/lib/components/list/index.d.ts +0 -1
  125. package/lib/components/login-and-register/index.d.ts +82 -0
  126. package/lib/components/pisell-config-provider/index.d.ts +13 -0
  127. package/lib/components/pisell-config-provider/index.js +0 -1
  128. package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +0 -1
  129. package/lib/components/pisellCamera/index.d.ts +4 -0
  130. package/lib/components/pisellCardList/index.d.ts +4 -0
  131. package/lib/components/pisellCardList/index.js +5 -1
  132. package/lib/components/pisellEmpty/index.d.ts +19 -0
  133. package/lib/components/pisellText/components/Editable/index.d.ts +29 -0
  134. package/lib/components/pisellText/index.d.ts +9 -0
  135. package/lib/components/pisellWalletPassCard/index.d.ts +140 -0
  136. package/lib/components/pisellWalletPassCard/index.js +12 -2
  137. package/lib/components/pisellWalletPassCard/utils.d.ts +44 -0
  138. package/lib/components/pisellWalletPassCard/utils.js +349 -0
  139. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  140. package/lib/components/productCard/cartSkuCard/components/swipeAction/index.d.ts +46 -0
  141. package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
  142. package/lib/components/productCard/components/Header/Actions/index.d.ts +3 -0
  143. package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +3 -0
  144. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  145. package/lib/components/productCard/components/Time/components/SelectHolder/index.d.ts +3 -0
  146. package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +18 -0
  147. package/lib/components/productCard/components/Time/index.d.ts +3 -0
  148. package/lib/components/select/index.d.ts +9 -0
  149. package/lib/components/sortableList/index.d.ts +11 -0
  150. package/lib/components/table/Actions/component/ExportImport/index.d.ts +7 -0
  151. package/lib/components/table/Gallery/components/GalleryItem/index.d.ts +14 -0
  152. package/lib/components/table/Gallery/index.d.ts +5 -0
  153. package/lib/components/table/Table/SelectField/index.d.ts +0 -1
  154. package/lib/components/table/Table/fields/index.d.ts +2 -3
  155. package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
  156. package/lib/components/table/Table/fields/text/index.d.ts +0 -1
  157. package/lib/components/table/Table/index.d.ts +4 -0
  158. package/lib/components/table/Table/utils.d.ts +167 -0
  159. package/lib/components/table/hooks/useTableSetting.d.ts +21 -0
  160. package/lib/components/table/hooks/useTableSetting.js +1 -1
  161. package/lib/components/table/hooks/useTransDataSource.d.ts +12 -0
  162. package/lib/components/table/index.d.ts +4 -0
  163. package/lib/components/table/types.d.ts +270 -0
  164. package/lib/components/translation/index.d.ts +15 -0
  165. package/lib/components/versionModal/index.d.ts +24 -0
  166. package/lib/components/virtual-keyboard/Number/index.d.ts +0 -1
  167. package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
  168. package/lib/components/walletCard/index.d.ts +71 -0
  169. package/lib/index.d.ts +145 -0
  170. package/lib/locales/en-US.d.ts +342 -0
  171. package/lib/locales/en-US.js +1 -0
  172. package/lib/locales/zh-CN.d.ts +337 -0
  173. package/lib/locales/zh-CN.js +1 -0
  174. package/lib/locales/zh-TW.d.ts +337 -0
  175. package/lib/locales/zh-TW.js +1 -4
  176. package/lib/utils/platform.d.ts +1 -1
  177. package/package.json +3 -3
@@ -0,0 +1,499 @@
1
+ import dayjs from 'dayjs';
2
+
3
+ // 文案配置类型定义
4
+
5
+ // 常量定义
6
+ var CONSTANTS = {
7
+ ALL_DAY_START: '00:00',
8
+ ALL_DAY_END: '23:59',
9
+ DEFAULT_FUTURE_YEARS: 10,
10
+ SECONDS_SUFFIX: ':59'
11
+ };
12
+
13
+ // 日程项接口定义
14
+
15
+ // 多语言文案配置
16
+ var textConfig = {
17
+ 'zh-HK': {
18
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
19
+ separator: '、',
20
+ timeSeparator: '–',
21
+ rangeSeparator: ' 至 ',
22
+ periodSeparator: ';',
23
+ timeSlotSeparator: ',',
24
+ every: '每',
25
+ day: '天',
26
+ week: '周',
27
+ month: '月',
28
+ year: '年',
29
+ available: '可用',
30
+ unlimited: '无限期',
31
+ multipleRules: '多規則,點詳情',
32
+ multipleSlots: ',多時段',
33
+ until: '至',
34
+ daily: '每天',
35
+ days: '天',
36
+ weeks: '周',
37
+ everyPrefix: '每',
38
+ weekPrefix: '周',
39
+ dateFormat: 'YYYY-MM-DD',
40
+ dateTimeFormat: 'YYYY-MM-DD HH:mm',
41
+ longTermValidFrom: '自',
42
+ noExpiry: '起長期有效',
43
+ on: ''
44
+ },
45
+ 'zh-CN': {
46
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
47
+ separator: '、',
48
+ timeSeparator: '–',
49
+ rangeSeparator: ' 至 ',
50
+ periodSeparator: ';',
51
+ timeSlotSeparator: ',',
52
+ every: '每',
53
+ day: '天',
54
+ week: '周',
55
+ month: '月',
56
+ year: '年',
57
+ available: '可用',
58
+ unlimited: '无限期',
59
+ multipleRules: '多规则,点详情',
60
+ multipleSlots: ',多时段',
61
+ until: '至',
62
+ daily: '每天',
63
+ days: '天',
64
+ weeks: '周',
65
+ everyPrefix: '每',
66
+ weekPrefix: '周',
67
+ dateFormat: 'YYYY-MM-DD',
68
+ dateTimeFormat: 'YYYY-MM-DD HH:mm',
69
+ longTermValidFrom: '自',
70
+ noExpiry: '起长期有效',
71
+ on: ''
72
+ },
73
+ 'en': {
74
+ weekdays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
75
+ separator: ', ',
76
+ timeSeparator: '–',
77
+ rangeSeparator: ' - ',
78
+ periodSeparator: '; ',
79
+ timeSlotSeparator: ', ',
80
+ every: 'every ',
81
+ day: 'day',
82
+ week: 'week',
83
+ month: 'month',
84
+ year: 'year',
85
+ available: 'available',
86
+ unlimited: 'unlimited',
87
+ multipleRules: 'Multiple rules, see details',
88
+ multipleSlots: ', multiple slots',
89
+ until: 'Until ',
90
+ daily: 'daily',
91
+ days: 'days',
92
+ weeks: 'weeks',
93
+ everyPrefix: 'every ',
94
+ weekPrefix: '',
95
+ dateFormat: 'DD MMM YYYY',
96
+ dateTimeFormat: 'DD MMM YYYY h:mm A',
97
+ longTermValidFrom: 'from ',
98
+ noExpiry: ', no expiry',
99
+ on: 'on '
100
+ }
101
+ };
102
+
103
+ /**
104
+ * 获取星期几的表示
105
+ * @param dayNumbers 星期几的数字数组 (0-6, 0代表周日)
106
+ * @param locale 语言设置
107
+ * @param separator 分隔符,可选,默认使用locale配置的分隔符
108
+ * @returns 格式化的星期几文案
109
+ */
110
+ function getWeekdayText(dayNumbers, locale, separator) {
111
+ var config = textConfig[locale];
112
+ return dayNumbers.map(function (day) {
113
+ return config.weekdays[day];
114
+ }).join(separator || config.separator);
115
+ }
116
+
117
+ /**
118
+ * 获取指定语言的文案配置
119
+ * @param locale 语言设置
120
+ * @param key 配置项key
121
+ * @returns 对应语言的文案
122
+ */
123
+ function getText(locale, key) {
124
+ return textConfig[locale][key];
125
+ }
126
+
127
+ /**
128
+ * 获取指定语言的配置对象(缓存优化)
129
+ * @param locale 语言设置
130
+ * @returns 对应语言的完整配置对象
131
+ */
132
+ function getConfig(locale) {
133
+ return textConfig[locale];
134
+ }
135
+
136
+ /**
137
+ * 获取每日频率文案
138
+ * @param frequency 频率数字
139
+ * @param locale 语言设置
140
+ * @returns 格式化的每日频率文案
141
+ */
142
+ function getDailyFrequencyText(frequency, locale) {
143
+ if (frequency === 1) {
144
+ return getText(locale, 'daily');
145
+ }
146
+ var config = textConfig[locale];
147
+ if (locale === 'en') {
148
+ return "".concat(config.everyPrefix).concat(frequency, " ").concat(config.days);
149
+ } else {
150
+ return "".concat(config.everyPrefix).concat(frequency).concat(config.days);
151
+ }
152
+ }
153
+
154
+ /**
155
+ * 获取每周频率前缀文案
156
+ * @param frequency 频率数字
157
+ * @param locale 语言设置
158
+ * @returns 格式化的每周频率前缀文案
159
+ */
160
+ function getWeeklyFrequencyPrefix(frequency, locale) {
161
+ if (frequency === 1) {
162
+ return '';
163
+ }
164
+ var config = textConfig[locale];
165
+ if (locale === 'en') {
166
+ return "".concat(config.everyPrefix).concat(frequency, " ").concat(config.weeks, ", ");
167
+ } else {
168
+ return "".concat(config.everyPrefix).concat(frequency).concat(config.weeks, " ");
169
+ }
170
+ }
171
+
172
+ /**
173
+ * 格式化日期时间函数
174
+ * @param dateTime 日期时间字符串
175
+ * @param isAll 是否为全天
176
+ * @param locale 语言设置
177
+ * @returns 格式化后的日期时间字符串
178
+ */
179
+ function formatDateTime(dateTime) {
180
+ var isAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
181
+ var locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'zh-CN';
182
+ var date = dayjs(dateTime);
183
+ var config = getConfig(locale);
184
+ if (isAll) {
185
+ // 全天情况下的日期格式
186
+ return date.format(config.dateFormat);
187
+ }
188
+
189
+ // 非全天情况下的日期时间格式
190
+ return date.format(config.dateTimeFormat);
191
+ }
192
+
193
+ /**
194
+ * 判断是否为全天日程
195
+ * @param startTime 开始时间 (HH:mm格式)
196
+ * @param endTime 结束时间 (HH:mm格式)
197
+ * @returns 是否为全天日程
198
+ */
199
+ function isAllDaySchedule(startTime, endTime) {
200
+ return startTime === CONSTANTS.ALL_DAY_START && endTime === CONSTANTS.ALL_DAY_END;
201
+ }
202
+
203
+ /**
204
+ * 生成日期范围文案
205
+ * @param startDate 开始日期
206
+ * @param endDate 结束日期
207
+ * @param isStarted 是否已开始
208
+ * @param locale 语言设置
209
+ * @param isAllDay 是否为全天
210
+ * @returns 格式化的日期范围文案
211
+ */
212
+ function formatDateRange(startDate, endDate, isStarted, locale) {
213
+ var isAllDay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
214
+ var config = getConfig(locale);
215
+ if (isStarted) {
216
+ var endDateStr = formatDateTime(endDate, isAllDay, locale);
217
+ return "".concat(config.until).concat(endDateStr);
218
+ } else {
219
+ var startDateStr = formatDateTime(startDate, isAllDay, locale);
220
+ var _endDateStr = formatDateTime(endDate, isAllDay, locale);
221
+ return "".concat(startDateStr).concat(config.rangeSeparator).concat(_endDateStr);
222
+ }
223
+ }
224
+
225
+ /**
226
+ * 获取schedule摘要信息
227
+ * @param scheduleList 日程列表
228
+ * @param locale 语言设置
229
+ * @returns 摘要文本
230
+ */
231
+ export function getScheduleSummary(scheduleList) {
232
+ var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zh-CN';
233
+ try {
234
+ // 输入验证
235
+ if (!scheduleList || !Array.isArray(scheduleList)) {
236
+ return '';
237
+ }
238
+
239
+ // 如果是多个日程,直接返回多规则提示
240
+ if (scheduleList.length > 1) {
241
+ return getText(locale, 'multipleRules');
242
+ }
243
+
244
+ // 如果没有日程,返回空字符串
245
+ if (scheduleList.length === 0) {
246
+ return '';
247
+ }
248
+ var schedule = scheduleList[0];
249
+ if (!schedule) {
250
+ return '';
251
+ }
252
+ var now = dayjs();
253
+
254
+ // 获取日程开始时间
255
+ var startTime = null;
256
+ if (schedule.start_time) {
257
+ startTime = dayjs(schedule.start_time);
258
+ } else if (schedule.designation && schedule.designation.length > 0) {
259
+ // designation类型,取第一个日期作为开始时间
260
+ var firstDesignation = schedule.designation[0];
261
+ if (firstDesignation && firstDesignation.start_date && firstDesignation.start_time) {
262
+ startTime = dayjs("".concat(firstDesignation.start_date, " ").concat(firstDesignation.start_time));
263
+ }
264
+ }
265
+
266
+ // 判断开始时间是否在当前时间之后
267
+ var isStarted = startTime ? isTimeStarted(now, startTime) : false;
268
+
269
+ // 根据不同类型和状态返回摘要
270
+ return generateSummaryText(schedule, isStarted, locale);
271
+ } catch (error) {
272
+ console.warn('Error in getScheduleSummary:', error);
273
+ return '';
274
+ }
275
+ }
276
+
277
+ /**
278
+ * 判断开始时间是否在当前时间之后
279
+ * @param now 当前时间
280
+ * @param startTime 开始时间
281
+ * @returns 是否已开始
282
+ */
283
+ function isTimeStarted(now, startTime) {
284
+ return startTime.isBefore(now);
285
+ }
286
+
287
+ /**
288
+ * 生成摘要文本
289
+ * @param schedule 日程对象
290
+ * @param isStarted 是否已开始
291
+ * @param locale 语言设置
292
+ * @returns 生成的摘要文本
293
+ */
294
+ function generateSummaryText(schedule, isStarted, locale) {
295
+ // 1. 多天多段 (designation类型且有多个日期段)
296
+ if (schedule.type === 'designation' && schedule.designation && schedule.designation.length > 1) {
297
+ return getText(locale, 'multipleRules');
298
+ }
299
+
300
+ // 2. 单日多段 (time-slots类型)
301
+ if (schedule.type === 'time-slots') {
302
+ var endDate = getScheduleEndDate(schedule);
303
+ if (!endDate) return '';
304
+ var endDateStr = formatDateTime(endDate, true, locale);
305
+ var prefix = '';
306
+ var suffix = getText(locale, 'multipleSlots');
307
+ return "".concat(prefix).concat(endDateStr).concat(suffix);
308
+ }
309
+
310
+ // 3. 循环日程
311
+ if (schedule.repeat_type !== 'none' && schedule.repeat_rule) {
312
+ return generateRecurringSummary(schedule, isStarted, locale);
313
+ }
314
+
315
+ // 4. 单个日程(包括designation类型的单个日期段)
316
+ return generateSingleScheduleSummary(schedule, isStarted, locale);
317
+ }
318
+
319
+ /**
320
+ * 生成循环日程摘要
321
+ * @param schedule 日程对象
322
+ * @param isStarted 是否已开始
323
+ * @param locale 语言设置
324
+ * @returns 循环日程摘要文本
325
+ */
326
+ function generateRecurringSummary(schedule, isStarted, locale) {
327
+ var repeat_type = schedule.repeat_type,
328
+ repeat_rule = schedule.repeat_rule;
329
+ if (!repeat_rule) return '';
330
+ var frequency = repeat_rule.frequency,
331
+ frequency_date = repeat_rule.frequency_date,
332
+ end = repeat_rule.end;
333
+
334
+ // 特殊处理:当 end.type === 'never' 时的格式
335
+ if (end.type === 'never') {
336
+ return generateNeverEndingRecurringSummary(schedule, isStarted, locale, repeat_type, frequency, frequency_date);
337
+ }
338
+
339
+ // 原有逻辑:有结束时间的循环日程
340
+ var endDate = getScheduleEndDate(schedule);
341
+ if (!endDate) return '';
342
+ var endDateStr = formatDateTime(endDate, true, locale);
343
+
344
+ // 按天循环
345
+ if (repeat_type === 'daily') {
346
+ var frequencyText = getDailyFrequencyText(frequency, locale);
347
+ var dateRange = formatDateRange(schedule.start_time, endDate, isStarted, locale, true);
348
+ return "".concat(dateRange, "\uFF0C").concat(frequencyText);
349
+ }
350
+
351
+ // 按周循环
352
+ if (repeat_type === 'weekly') {
353
+ var weekdaysText = getWeekdayText(frequency_date, locale, '/');
354
+ var frequencyPrefix = getWeeklyFrequencyPrefix(frequency, locale);
355
+ var config = getConfig(locale);
356
+ var _dateRange = formatDateRange(schedule.start_time, endDate, isStarted, locale, true);
357
+ return "".concat(_dateRange, "\uFF0C").concat(frequencyPrefix).concat(config.weekPrefix).concat(weekdaysText);
358
+ }
359
+ return '';
360
+ }
361
+
362
+ /**
363
+ * 生成永不结束的循环日程摘要
364
+ * @param schedule 日程对象
365
+ * @param isStarted 是否已开始
366
+ * @param locale 语言设置
367
+ * @param repeatType 循环类型
368
+ * @param frequency 频率
369
+ * @param frequencyDate 频率日期数组(用于周循环)
370
+ * @returns 永不结束的循环日程摘要文本
371
+ */
372
+ function generateNeverEndingRecurringSummary(schedule, isStarted, locale, repeatType, frequency, frequencyDate) {
373
+ var config = getConfig(locale);
374
+
375
+ // 按天循环
376
+ if (repeatType === 'daily') {
377
+ if (frequency === 1) {
378
+ // 频率=1:中文"自 YYYY-MM-DD 起长期有效",英文"Valid from DD MMM YYYY, no expiry"
379
+ if (schedule.start_time) {
380
+ var startDateStr = formatDateTime(schedule.start_time, true, locale);
381
+ return "".concat(config.longTermValidFrom).concat(startDateStr).concat(config.noExpiry);
382
+ }
383
+ return '';
384
+ } else {
385
+ // 频率>1:中文"每2天可用",英文"Every 2 days"
386
+ var frequencyText = getDailyFrequencyText(frequency, locale);
387
+ if (locale === 'en') {
388
+ return "".concat(frequencyText);
389
+ } else {
390
+ return "".concat(frequencyText).concat(config.available);
391
+ }
392
+ }
393
+ }
394
+
395
+ // 按周循环
396
+ if (repeatType === 'weekly') {
397
+ var weekdaysText = getWeekdayText(frequencyDate, locale, locale === 'en' ? ' & ' : '/');
398
+ if (frequency === 1) {
399
+ // 频率=1:中文"每周三/五可用",英文"on Wed & Fri"
400
+ if (locale === 'en') {
401
+ return "".concat(config.on).concat(weekdaysText);
402
+ } else {
403
+ return "".concat(config.everyPrefix).concat(config.weekPrefix).concat(weekdaysText).concat(config.available);
404
+ }
405
+ } else {
406
+ // 频率>1:中文"每2周 周三/五",英文"Every 2 weeks, on Wed & Fri"
407
+ var frequencyPrefix = getWeeklyFrequencyPrefix(frequency, locale);
408
+ if (locale === 'en') {
409
+ return "".concat(frequencyPrefix).concat(config.on).concat(weekdaysText);
410
+ } else {
411
+ return "".concat(frequencyPrefix).concat(config.weekPrefix).concat(weekdaysText);
412
+ }
413
+ }
414
+ }
415
+ return '';
416
+ }
417
+
418
+ /**
419
+ * 生成单个日程摘要
420
+ * @param schedule 日程对象
421
+ * @param isStarted 是否已开始
422
+ * @param locale 语言设置
423
+ * @returns 单个日程摘要文本
424
+ */
425
+ function generateSingleScheduleSummary(schedule, isStarted, locale) {
426
+ var isAllDay = schedule.is_all === 1;
427
+
428
+ // 处理designation类型的单个日期段
429
+ if (schedule.type === 'designation' && schedule.designation && schedule.designation.length === 1) {
430
+ var designation = schedule.designation[0];
431
+ var startDate = designation.start_date;
432
+ var endDate = designation.end_date;
433
+ var startTime = designation.start_time;
434
+ var endTime = designation.end_time;
435
+
436
+ // 判断是否为全天
437
+ var isDesignationAllDay = isAllDaySchedule(startTime, endTime);
438
+ if (isDesignationAllDay || isAllDay) {
439
+ // 全天日程
440
+ return formatDateRange(startDate, endDate, isStarted, locale, true);
441
+ } else {
442
+ // 非全天日程
443
+ var startDateTime = "".concat(startDate, " ").concat(startTime).concat(CONSTANTS.SECONDS_SUFFIX);
444
+ var endDateTime = "".concat(endDate, " ").concat(endTime).concat(CONSTANTS.SECONDS_SUFFIX);
445
+ return formatDateRange(startDateTime, endDateTime, isStarted, locale, false);
446
+ }
447
+ }
448
+
449
+ // 标准日程处理
450
+ if (isAllDay) {
451
+ // 全天日程
452
+ var _endDate = getScheduleEndDate(schedule);
453
+ if (!_endDate) return '';
454
+ return formatDateRange(schedule.start_time, _endDate, isStarted, locale, true);
455
+ } else {
456
+ // 非全天日程
457
+ return formatDateRange(schedule.start_time, schedule.end_time, isStarted, locale, false);
458
+ }
459
+ }
460
+
461
+ /**
462
+ * 获取日程结束日期
463
+ * @param schedule 日程对象
464
+ * @returns 结束日期字符串,如果无法确定则返回null
465
+ */
466
+ function getScheduleEndDate(schedule) {
467
+ try {
468
+ // 循环日程
469
+ if (schedule.repeat_rule) {
470
+ if (schedule.repeat_rule.end.type === 'never') {
471
+ // 无限期的情况,返回一个合理的未来日期作为显示
472
+ var futureDate = dayjs().add(CONSTANTS.DEFAULT_FUTURE_YEARS, 'year');
473
+ return "".concat(futureDate.format('YYYY-MM-DD'), " ").concat(CONSTANTS.ALL_DAY_END).concat(CONSTANTS.SECONDS_SUFFIX);
474
+ } else if (schedule.repeat_rule.end.end_date) {
475
+ return "".concat(schedule.repeat_rule.end.end_date, " ").concat(CONSTANTS.ALL_DAY_END).concat(CONSTANTS.SECONDS_SUFFIX);
476
+ }
477
+ }
478
+
479
+ // designation类型
480
+ if (schedule.designation && schedule.designation.length > 0) {
481
+ var lastDesignation = schedule.designation[schedule.designation.length - 1];
482
+ return "".concat(lastDesignation.end_date, " ").concat(lastDesignation.end_time).concat(CONSTANTS.SECONDS_SUFFIX);
483
+ }
484
+
485
+ // 标准日程
486
+ if (schedule.end_time) {
487
+ return schedule.end_time;
488
+ }
489
+
490
+ // time-slots类型
491
+ if (schedule.start_time) {
492
+ return schedule.start_time;
493
+ }
494
+ return null;
495
+ } catch (error) {
496
+ console.warn('Error in getScheduleEndDate:', error);
497
+ return null;
498
+ }
499
+ }
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
@@ -0,0 +1,46 @@
1
+ import type { ReactNode } from 'react';
2
+ import React from 'react';
3
+ declare type NativeProps<S extends string = never> = {
4
+ className?: string;
5
+ style?: React.CSSProperties & Partial<Record<S, string>>;
6
+ };
7
+ declare type PropagationEvent = 'click';
8
+ import './index.less';
9
+ declare type SideType = 'left' | 'right';
10
+ export declare type SwipeActionRef = {
11
+ close: () => void;
12
+ show: (side?: SideType) => void;
13
+ };
14
+ declare type ActionColor = 'light' | 'weak' | 'primary' | 'success' | 'warning' | 'danger';
15
+ export declare type Action = {
16
+ key: string | number;
17
+ text: ReactNode;
18
+ color?: ActionColor | string;
19
+ onClick?: (e: React.MouseEvent) => void;
20
+ style?: React.CSSProperties;
21
+ };
22
+ export declare type SwipeActionProps = {
23
+ rightActions?: Action[];
24
+ leftActions?: Action[];
25
+ onAction?: (action: Action, e: React.MouseEvent) => void;
26
+ closeOnTouchOutside?: boolean;
27
+ closeOnAction?: boolean;
28
+ children: ReactNode;
29
+ stopPropagation?: PropagationEvent[];
30
+ onActionsReveal?: (side: SideType) => void;
31
+ onClose?: () => void;
32
+ escapeDom?: string;
33
+ } & NativeProps<'--background'>;
34
+ export declare const SwipeAction: React.ForwardRefExoticComponent<{
35
+ rightActions?: Action[] | undefined;
36
+ leftActions?: Action[] | undefined;
37
+ onAction?: ((action: Action, e: React.MouseEvent) => void) | undefined;
38
+ closeOnTouchOutside?: boolean | undefined;
39
+ closeOnAction?: boolean | undefined;
40
+ children: ReactNode;
41
+ stopPropagation?: "click"[] | undefined;
42
+ onActionsReveal?: ((side: SideType) => void) | undefined;
43
+ onClose?: (() => void) | undefined;
44
+ escapeDom?: string | undefined;
45
+ } & NativeProps<"--background"> & React.RefAttributes<SwipeActionRef>>;
46
+ export {};
@@ -0,0 +1,10 @@
1
+ import './index.less';
2
+ import { ProductCardTypes } from '../types';
3
+ interface ISKUCardProps extends ProductCardTypes {
4
+ type: 'a2' | 'a5';
5
+ rightActions: any[];
6
+ escapeDom?: string;
7
+ }
8
+ export declare const PREFIX = "pisell-cart-sku-card";
9
+ declare const CartSkuCard: (props: ISKUCardProps) => JSX.Element;
10
+ export default CartSkuCard;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Actions: ({ children, style }: any) => JSX.Element | null;
3
+ export default Actions;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const DeleteButton: ({ onDelete, type }: any) => JSX.Element;
3
+ export default DeleteButton;
@@ -17,4 +17,4 @@ export declare const minusSign: (item: any, type?: string) => "" | "-";
17
17
  * @Author: WangHan
18
18
  * @Date: 2024-11-22 10:58
19
19
  */
20
- export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => any;
20
+ export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const SelectHolder: ({ lists, value, onChange, holderMode, isShowAddHolderButton, onAddHolder, addHolderButtonText, onClearHolder, isErrorHolder, allowClear, holderMaxCount, }: any) => JSX.Element;
3
+ export default SelectHolder;
@@ -0,0 +1,18 @@
1
+ import './index.less';
2
+ interface ResourceItem {
3
+ id: string | number;
4
+ label: string;
5
+ isError?: boolean;
6
+ [key: string]: any;
7
+ }
8
+ interface SelectResourceProps {
9
+ lists: ResourceItem[];
10
+ value: any;
11
+ onChange: (val: any) => void;
12
+ resourceMode?: 'multiple' | 'tags' | undefined;
13
+ maxLength?: number;
14
+ isParallelResource?: boolean;
15
+ [key: string]: any;
16
+ }
17
+ declare const SelectResource: ({ lists, value, onChange, resourceMode, allowClear, onClearResource, maxLength, isErrorResource, resourceErrorText, ...props }: SelectResourceProps) => JSX.Element;
18
+ export default SelectResource;
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Time: ({ item, isShowHolder, onLike, isShowChangeResource, changeResource, changeHolder, isShowChangeHolder, holderMode, onAddHolder, isShowAddHolderButton, onClearHolder, onClearResource, }: any) => JSX.Element | null;
3
+ export default Time;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Select as OriginalSelect } from 'antd';
3
+ import type { SelectProps } from 'antd';
4
+ import './index.less';
5
+ interface CompoundedComponent extends React.ForwardRefExoticComponent<SelectProps> {
6
+ Option: typeof OriginalSelect.Option;
7
+ }
8
+ declare const Select: CompoundedComponent;
9
+ export default Select;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { Props } from "../DragSortList";
3
+ export interface SortableListProps<T> {
4
+ dataSource: Props<T>["list"];
5
+ onChange: Props<T>["onChange"];
6
+ rowKey: Props<T>["rowKey"];
7
+ renderItem?: (item: T, index: number) => React.ReactNode;
8
+ activationConstraint?: Props<T>["activationConstraint"];
9
+ }
10
+ declare const SortableList: React.FC<SortableListProps<any>>;
11
+ export default SortableList;
@@ -0,0 +1,7 @@
1
+ import { ExportImportType } from '../../../types';
2
+ import './index.less';
3
+ declare type ExportImportProps = {
4
+ exportImport: ExportImportType;
5
+ };
6
+ declare const ExportImport: ({ exportImport }: ExportImportProps) => JSX.Element;
7
+ export default ExportImport;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { GallerySettingType, GallerySettingValueType } from "../../../types";
3
+ import "./index.less";
4
+ declare type GalleryItemProps = {
5
+ record: Record<string, any>;
6
+ gallery: GallerySettingType;
7
+ columnsMap: Map<string, Record<string, any>>;
8
+ index: number;
9
+ gallerySetting: GallerySettingValueType;
10
+ columns: Record<string, any>[];
11
+ onClick: React.MouseEventHandler<HTMLDivElement>;
12
+ };
13
+ declare const GalleryItem: (props: GalleryItemProps) => JSX.Element;
14
+ export default GalleryItem;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { GalleryProps } from './types';
3
+ import './index.less';
4
+ declare const _default: React.MemoExoticComponent<(props: GalleryProps) => JSX.Element>;
5
+ export default _default;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const SelectField: () => JSX.Element;
3
2
  export default SelectField;