@pisell/utils 1.0.70 → 1.0.72
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.
- package/README.md +2 -2
- package/es/arrayUtils.d.ts +1 -1
- package/es/common/index.d.ts +5 -5
- package/es/common/index.js +2 -2
- package/es/common/stateHelper.d.ts +18 -18
- package/es/common/stateHelper.js +15 -15
- package/es/common/types.d.ts +28 -28
- package/es/componentStorage.d.ts +36 -36
- package/es/componentStorage.js +7 -7
- package/es/constants/index.d.ts +7 -7
- package/es/date.d.ts +28 -28
- package/es/date.js +22 -22
- package/es/document.d.ts +13 -13
- package/es/document.js +7 -7
- package/es/escPosPrinter/index.d.ts +9 -9
- package/es/firebase/config/index.d.ts +13 -13
- package/es/firebase/index.d.ts +28 -28
- package/es/format.js +14 -14
- package/es/image.d.ts +11 -11
- package/es/image.js +5 -5
- package/es/index.d.ts +25 -25
- package/es/jsBridge/index.js +15 -15
- package/es/jsBridge/regDeviceApi.d.ts +15 -15
- package/es/jsBridge/regDeviceApi.js +3 -3
- package/es/locales.js +15 -15
- package/es/log.d.ts +10 -10
- package/es/number-input/hooks/index.d.ts +4 -4
- package/es/number-input/hooks/index.js +2 -2
- package/es/number-input/hooks/useNumberInputState.d.ts +25 -25
- package/es/number-input/hooks/useNumberInputState.js +39 -39
- package/es/number-input/index.d.ts +14 -14
- package/es/number-input/index.js +8 -8
- package/es/number-input/types.d.ts +96 -96
- package/es/number-input/utils/formatter.d.ts +53 -53
- package/es/number-input/utils/formatter.js +37 -37
- package/es/number-input/utils/index.d.ts +7 -7
- package/es/number-input/utils/index.js +2 -2
- package/es/number-input/utils/validation.d.ts +27 -27
- package/es/number-input/utils/validation.js +24 -24
- package/es/otherUtils.d.ts +48 -48
- package/es/otherUtils.js +32 -32
- package/es/platform.d.ts +9 -9
- package/es/select/hooks/index.d.ts +5 -5
- package/es/select/hooks/index.js +2 -2
- package/es/select/hooks/useDebouncedSearch.d.ts +20 -20
- package/es/select/hooks/useDebouncedSearch.js +17 -17
- package/es/select/hooks/useSelectState.d.ts +19 -19
- package/es/select/hooks/useSelectState.js +13 -13
- package/es/select/index.d.ts +8 -8
- package/es/select/index.js +3 -3
- package/es/select/types.d.ts +256 -256
- package/es/select/utils/filterOptions.d.ts +22 -22
- package/es/select/utils/filterOptions.js +16 -16
- package/es/select/utils/helpers.d.ts +42 -42
- package/es/select/utils/helpers.js +30 -30
- package/es/select/utils/index.d.ts +7 -7
- package/es/select/utils/index.js +2 -2
- package/es/select/utils/sortOptions.d.ts +12 -12
- package/es/select/utils/sortOptions.js +8 -8
- package/es/select/utils/tagAggregation.d.ts +25 -25
- package/es/select/utils/tagAggregation.js +21 -21
- package/es/text-input/hooks/index.d.ts +4 -4
- package/es/text-input/hooks/index.js +2 -2
- package/es/text-input/hooks/useTextInputState.d.ts +24 -24
- package/es/text-input/hooks/useTextInputState.js +38 -38
- package/es/text-input/index.d.ts +14 -14
- package/es/text-input/index.js +9 -9
- package/es/text-input/types.d.ts +56 -56
- package/es/text-input/utils/index.d.ts +5 -5
- package/es/text-input/utils/index.js +2 -2
- package/es/text-input/utils/validation.d.ts +23 -23
- package/es/text-input/utils/validation.js +20 -20
- package/es/typeUtils.d.ts +42 -42
- package/es/typeUtils.js +26 -26
- package/es/walletValidity.d.ts +44 -44
- package/es/walletValidity.js +85 -85
- package/lib/arrayUtils.d.ts +1 -1
- package/lib/common/index.d.ts +5 -5
- package/lib/common/stateHelper.d.ts +18 -18
- package/lib/common/types.d.ts +28 -28
- package/lib/componentStorage.d.ts +36 -36
- package/lib/constants/index.d.ts +7 -7
- package/lib/date.d.ts +28 -28
- package/lib/document.d.ts +13 -13
- package/lib/escPosPrinter/index.d.ts +9 -9
- package/lib/firebase/config/index.d.ts +13 -13
- package/lib/firebase/index.d.ts +28 -28
- package/lib/image.d.ts +11 -11
- package/lib/index.d.ts +25 -25
- package/lib/jsBridge/regDeviceApi.d.ts +15 -15
- package/lib/log.d.ts +10 -10
- package/lib/number-input/hooks/index.d.ts +4 -4
- package/lib/number-input/hooks/useNumberInputState.d.ts +25 -25
- package/lib/number-input/index.d.ts +14 -14
- package/lib/number-input/types.d.ts +96 -96
- package/lib/number-input/utils/formatter.d.ts +53 -53
- package/lib/number-input/utils/index.d.ts +7 -7
- package/lib/number-input/utils/validation.d.ts +27 -27
- package/lib/otherUtils.d.ts +48 -48
- package/lib/platform.d.ts +9 -9
- package/lib/select/hooks/index.d.ts +5 -5
- package/lib/select/hooks/useDebouncedSearch.d.ts +20 -20
- package/lib/select/hooks/useSelectState.d.ts +19 -19
- package/lib/select/index.d.ts +8 -8
- package/lib/select/types.d.ts +256 -256
- package/lib/select/utils/filterOptions.d.ts +22 -22
- package/lib/select/utils/helpers.d.ts +42 -42
- package/lib/select/utils/index.d.ts +7 -7
- package/lib/select/utils/sortOptions.d.ts +12 -12
- package/lib/select/utils/tagAggregation.d.ts +25 -25
- package/lib/text-input/hooks/index.d.ts +4 -4
- package/lib/text-input/hooks/useTextInputState.d.ts +24 -24
- package/lib/text-input/index.d.ts +14 -14
- package/lib/text-input/types.d.ts +56 -56
- package/lib/text-input/utils/index.d.ts +5 -5
- package/lib/text-input/utils/validation.d.ts +23 -23
- package/lib/typeUtils.d.ts +42 -42
- package/lib/walletValidity.d.ts +44 -44
- package/package.json +1 -1
- package/es/format.d.ts +0 -28
- package/es/jsBridge/index.d.ts +0 -22
- package/es/jsBridge/types.d.ts +0 -149
- package/es/locales.d.ts +0 -9
- package/es/miniRedux.d.ts +0 -16
- package/lib/format.d.ts +0 -28
- package/lib/jsBridge/index.d.ts +0 -22
- package/lib/jsBridge/types.d.ts +0 -149
- package/lib/locales.d.ts +0 -9
- package/lib/miniRedux.d.ts +0 -16
package/es/walletValidity.js
CHANGED
|
@@ -100,12 +100,12 @@ var textConfig = {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
* 获取星期几的表示
|
|
105
|
-
* @param dayNumbers 星期几的数字数组 (0-6, 0代表周日)
|
|
106
|
-
* @param locale 语言设置
|
|
107
|
-
* @param separator 分隔符,可选,默认使用locale配置的分隔符
|
|
108
|
-
* @returns 格式化的星期几文案
|
|
103
|
+
/**
|
|
104
|
+
* 获取星期几的表示
|
|
105
|
+
* @param dayNumbers 星期几的数字数组 (0-6, 0代表周日)
|
|
106
|
+
* @param locale 语言设置
|
|
107
|
+
* @param separator 分隔符,可选,默认使用locale配置的分隔符
|
|
108
|
+
* @returns 格式化的星期几文案
|
|
109
109
|
*/
|
|
110
110
|
function getWeekdayText(dayNumbers, locale, separator) {
|
|
111
111
|
var config = textConfig[locale];
|
|
@@ -114,30 +114,30 @@ function getWeekdayText(dayNumbers, locale, separator) {
|
|
|
114
114
|
}).join(separator || config.separator);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* 获取指定语言的文案配置
|
|
119
|
-
* @param locale 语言设置
|
|
120
|
-
* @param key 配置项key
|
|
121
|
-
* @returns 对应语言的文案
|
|
117
|
+
/**
|
|
118
|
+
* 获取指定语言的文案配置
|
|
119
|
+
* @param locale 语言设置
|
|
120
|
+
* @param key 配置项key
|
|
121
|
+
* @returns 对应语言的文案
|
|
122
122
|
*/
|
|
123
123
|
function getText(locale, key) {
|
|
124
124
|
return textConfig[locale][key];
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* 获取指定语言的配置对象(缓存优化)
|
|
129
|
-
* @param locale 语言设置
|
|
130
|
-
* @returns 对应语言的完整配置对象
|
|
127
|
+
/**
|
|
128
|
+
* 获取指定语言的配置对象(缓存优化)
|
|
129
|
+
* @param locale 语言设置
|
|
130
|
+
* @returns 对应语言的完整配置对象
|
|
131
131
|
*/
|
|
132
132
|
function getConfig(locale) {
|
|
133
133
|
return textConfig[locale];
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/**
|
|
137
|
-
* 获取每日频率文案
|
|
138
|
-
* @param frequency 频率数字
|
|
139
|
-
* @param locale 语言设置
|
|
140
|
-
* @returns 格式化的每日频率文案
|
|
136
|
+
/**
|
|
137
|
+
* 获取每日频率文案
|
|
138
|
+
* @param frequency 频率数字
|
|
139
|
+
* @param locale 语言设置
|
|
140
|
+
* @returns 格式化的每日频率文案
|
|
141
141
|
*/
|
|
142
142
|
function getDailyFrequencyText(frequency, locale) {
|
|
143
143
|
if (frequency === 1) {
|
|
@@ -151,11 +151,11 @@ function getDailyFrequencyText(frequency, locale) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/**
|
|
155
|
-
* 获取每周频率前缀文案
|
|
156
|
-
* @param frequency 频率数字
|
|
157
|
-
* @param locale 语言设置
|
|
158
|
-
* @returns 格式化的每周频率前缀文案
|
|
154
|
+
/**
|
|
155
|
+
* 获取每周频率前缀文案
|
|
156
|
+
* @param frequency 频率数字
|
|
157
|
+
* @param locale 语言设置
|
|
158
|
+
* @returns 格式化的每周频率前缀文案
|
|
159
159
|
*/
|
|
160
160
|
function getWeeklyFrequencyPrefix(frequency, locale) {
|
|
161
161
|
if (frequency === 1) {
|
|
@@ -169,12 +169,12 @@ function getWeeklyFrequencyPrefix(frequency, locale) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
/**
|
|
173
|
-
* 格式化日期时间函数
|
|
174
|
-
* @param dateTime 日期时间字符串
|
|
175
|
-
* @param isAll 是否为全天
|
|
176
|
-
* @param locale 语言设置
|
|
177
|
-
* @returns 格式化后的日期时间字符串
|
|
172
|
+
/**
|
|
173
|
+
* 格式化日期时间函数
|
|
174
|
+
* @param dateTime 日期时间字符串
|
|
175
|
+
* @param isAll 是否为全天
|
|
176
|
+
* @param locale 语言设置
|
|
177
|
+
* @returns 格式化后的日期时间字符串
|
|
178
178
|
*/
|
|
179
179
|
function formatDateTime(dateTime) {
|
|
180
180
|
var isAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -190,24 +190,24 @@ function formatDateTime(dateTime) {
|
|
|
190
190
|
return date.format(config.dateTimeFormat);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
/**
|
|
194
|
-
* 判断是否为全天日程
|
|
195
|
-
* @param startTime 开始时间 (HH:mm格式)
|
|
196
|
-
* @param endTime 结束时间 (HH:mm格式)
|
|
197
|
-
* @returns 是否为全天日程
|
|
193
|
+
/**
|
|
194
|
+
* 判断是否为全天日程
|
|
195
|
+
* @param startTime 开始时间 (HH:mm格式)
|
|
196
|
+
* @param endTime 结束时间 (HH:mm格式)
|
|
197
|
+
* @returns 是否为全天日程
|
|
198
198
|
*/
|
|
199
199
|
function isAllDaySchedule(startTime, endTime) {
|
|
200
200
|
return startTime === CONSTANTS.ALL_DAY_START && endTime === CONSTANTS.ALL_DAY_END;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
/**
|
|
204
|
-
* 生成日期范围文案
|
|
205
|
-
* @param startDate 开始日期
|
|
206
|
-
* @param endDate 结束日期
|
|
207
|
-
* @param isStarted 是否已开始
|
|
208
|
-
* @param locale 语言设置
|
|
209
|
-
* @param isAllDay 是否为全天
|
|
210
|
-
* @returns 格式化的日期范围文案
|
|
203
|
+
/**
|
|
204
|
+
* 生成日期范围文案
|
|
205
|
+
* @param startDate 开始日期
|
|
206
|
+
* @param endDate 结束日期
|
|
207
|
+
* @param isStarted 是否已开始
|
|
208
|
+
* @param locale 语言设置
|
|
209
|
+
* @param isAllDay 是否为全天
|
|
210
|
+
* @returns 格式化的日期范围文案
|
|
211
211
|
*/
|
|
212
212
|
function formatDateRange(startDate, endDate, isStarted, locale) {
|
|
213
213
|
var isAllDay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
@@ -222,11 +222,11 @@ function formatDateRange(startDate, endDate, isStarted, locale) {
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
/**
|
|
226
|
-
* 获取schedule摘要信息
|
|
227
|
-
* @param scheduleList 日程列表
|
|
228
|
-
* @param locale 语言设置
|
|
229
|
-
* @returns 摘要文本
|
|
225
|
+
/**
|
|
226
|
+
* 获取schedule摘要信息
|
|
227
|
+
* @param scheduleList 日程列表
|
|
228
|
+
* @param locale 语言设置
|
|
229
|
+
* @returns 摘要文本
|
|
230
230
|
*/
|
|
231
231
|
export function getScheduleSummary(scheduleList) {
|
|
232
232
|
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zh-CN';
|
|
@@ -274,22 +274,22 @@ export function getScheduleSummary(scheduleList) {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
/**
|
|
278
|
-
* 判断开始时间是否在当前时间之后
|
|
279
|
-
* @param now 当前时间
|
|
280
|
-
* @param startTime 开始时间
|
|
281
|
-
* @returns 是否已开始
|
|
277
|
+
/**
|
|
278
|
+
* 判断开始时间是否在当前时间之后
|
|
279
|
+
* @param now 当前时间
|
|
280
|
+
* @param startTime 开始时间
|
|
281
|
+
* @returns 是否已开始
|
|
282
282
|
*/
|
|
283
283
|
function isTimeStarted(now, startTime) {
|
|
284
284
|
return startTime.isBefore(now);
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
/**
|
|
288
|
-
* 生成摘要文本
|
|
289
|
-
* @param schedule 日程对象
|
|
290
|
-
* @param isStarted 是否已开始
|
|
291
|
-
* @param locale 语言设置
|
|
292
|
-
* @returns 生成的摘要文本
|
|
287
|
+
/**
|
|
288
|
+
* 生成摘要文本
|
|
289
|
+
* @param schedule 日程对象
|
|
290
|
+
* @param isStarted 是否已开始
|
|
291
|
+
* @param locale 语言设置
|
|
292
|
+
* @returns 生成的摘要文本
|
|
293
293
|
*/
|
|
294
294
|
function generateSummaryText(schedule, isStarted, locale) {
|
|
295
295
|
// 1. 多天多段 (designation类型且有多个日期段)
|
|
@@ -316,12 +316,12 @@ function generateSummaryText(schedule, isStarted, locale) {
|
|
|
316
316
|
return generateSingleScheduleSummary(schedule, isStarted, locale);
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
/**
|
|
320
|
-
* 生成循环日程摘要
|
|
321
|
-
* @param schedule 日程对象
|
|
322
|
-
* @param isStarted 是否已开始
|
|
323
|
-
* @param locale 语言设置
|
|
324
|
-
* @returns 循环日程摘要文本
|
|
319
|
+
/**
|
|
320
|
+
* 生成循环日程摘要
|
|
321
|
+
* @param schedule 日程对象
|
|
322
|
+
* @param isStarted 是否已开始
|
|
323
|
+
* @param locale 语言设置
|
|
324
|
+
* @returns 循环日程摘要文本
|
|
325
325
|
*/
|
|
326
326
|
function generateRecurringSummary(schedule, isStarted, locale) {
|
|
327
327
|
var repeat_type = schedule.repeat_type,
|
|
@@ -359,15 +359,15 @@ function generateRecurringSummary(schedule, isStarted, locale) {
|
|
|
359
359
|
return '';
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
/**
|
|
363
|
-
* 生成永不结束的循环日程摘要
|
|
364
|
-
* @param schedule 日程对象
|
|
365
|
-
* @param isStarted 是否已开始
|
|
366
|
-
* @param locale 语言设置
|
|
367
|
-
* @param repeatType 循环类型
|
|
368
|
-
* @param frequency 频率
|
|
369
|
-
* @param frequencyDate 频率日期数组(用于周循环)
|
|
370
|
-
* @returns 永不结束的循环日程摘要文本
|
|
362
|
+
/**
|
|
363
|
+
* 生成永不结束的循环日程摘要
|
|
364
|
+
* @param schedule 日程对象
|
|
365
|
+
* @param isStarted 是否已开始
|
|
366
|
+
* @param locale 语言设置
|
|
367
|
+
* @param repeatType 循环类型
|
|
368
|
+
* @param frequency 频率
|
|
369
|
+
* @param frequencyDate 频率日期数组(用于周循环)
|
|
370
|
+
* @returns 永不结束的循环日程摘要文本
|
|
371
371
|
*/
|
|
372
372
|
function generateNeverEndingRecurringSummary(schedule, isStarted, locale, repeatType, frequency, frequencyDate) {
|
|
373
373
|
var config = getConfig(locale);
|
|
@@ -415,12 +415,12 @@ function generateNeverEndingRecurringSummary(schedule, isStarted, locale, repeat
|
|
|
415
415
|
return '';
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
-
/**
|
|
419
|
-
* 生成单个日程摘要
|
|
420
|
-
* @param schedule 日程对象
|
|
421
|
-
* @param isStarted 是否已开始
|
|
422
|
-
* @param locale 语言设置
|
|
423
|
-
* @returns 单个日程摘要文本
|
|
418
|
+
/**
|
|
419
|
+
* 生成单个日程摘要
|
|
420
|
+
* @param schedule 日程对象
|
|
421
|
+
* @param isStarted 是否已开始
|
|
422
|
+
* @param locale 语言设置
|
|
423
|
+
* @returns 单个日程摘要文本
|
|
424
424
|
*/
|
|
425
425
|
function generateSingleScheduleSummary(schedule, isStarted, locale) {
|
|
426
426
|
var isAllDay = schedule.is_all === 1;
|
|
@@ -458,10 +458,10 @@ function generateSingleScheduleSummary(schedule, isStarted, locale) {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
/**
|
|
462
|
-
* 获取日程结束日期
|
|
463
|
-
* @param schedule 日程对象
|
|
464
|
-
* @returns 结束日期字符串,如果无法确定则返回null
|
|
461
|
+
/**
|
|
462
|
+
* 获取日程结束日期
|
|
463
|
+
* @param schedule 日程对象
|
|
464
|
+
* @returns 结束日期字符串,如果无法确定则返回null
|
|
465
465
|
*/
|
|
466
466
|
function getScheduleEndDate(schedule) {
|
|
467
467
|
try {
|
package/lib/arrayUtils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const uniqueByKey: <T>(arr: T[], key: keyof T) => T[];
|
|
1
|
+
export declare const uniqueByKey: <T>(arr: T[], key: keyof T) => T[];
|
package/lib/common/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公共工具和类型导出
|
|
3
|
-
*/
|
|
4
|
-
export type { DisplayState, ValidationResult } from './types';
|
|
5
|
-
export { getDisplayState } from './stateHelper';
|
|
1
|
+
/**
|
|
2
|
+
* 公共工具和类型导出
|
|
3
|
+
*/
|
|
4
|
+
export type { DisplayState, ValidationResult } from './types';
|
|
5
|
+
export { getDisplayState } from './stateHelper';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type { DisplayState } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* 根据 mode 和 disabled 计算组件的显示状态
|
|
4
|
-
*
|
|
5
|
-
* 状态优先级:disabled > mode
|
|
6
|
-
* 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
|
|
7
|
-
*
|
|
8
|
-
* @param mode 状态模式('read' | 'edit')
|
|
9
|
-
* @param disabled 是否禁用
|
|
10
|
-
* @returns 显示状态('read' | 'edit' | 'disabled')
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* getDisplayState('edit', false) // 'edit'
|
|
14
|
-
* getDisplayState('read', false) // 'read'
|
|
15
|
-
* getDisplayState('edit', true) // 'disabled'
|
|
16
|
-
* getDisplayState('read', true) // 'disabled'
|
|
17
|
-
*/
|
|
18
|
-
export declare function getDisplayState(mode?: 'read' | 'edit', disabled?: boolean): DisplayState;
|
|
1
|
+
import type { DisplayState } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 根据 mode 和 disabled 计算组件的显示状态
|
|
4
|
+
*
|
|
5
|
+
* 状态优先级:disabled > mode
|
|
6
|
+
* 当 disabled=true 时,无论 mode 是什么,都显示为禁用态
|
|
7
|
+
*
|
|
8
|
+
* @param mode 状态模式('read' | 'edit')
|
|
9
|
+
* @param disabled 是否禁用
|
|
10
|
+
* @returns 显示状态('read' | 'edit' | 'disabled')
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* getDisplayState('edit', false) // 'edit'
|
|
14
|
+
* getDisplayState('read', false) // 'read'
|
|
15
|
+
* getDisplayState('edit', true) // 'disabled'
|
|
16
|
+
* getDisplayState('read', true) // 'disabled'
|
|
17
|
+
*/
|
|
18
|
+
export declare function getDisplayState(mode?: 'read' | 'edit', disabled?: boolean): DisplayState;
|
package/lib/common/types.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公共类型定义
|
|
3
|
-
* 供所有输入组件使用
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 显示状态类型
|
|
7
|
-
*
|
|
8
|
-
* 所有输入组件的三种状态:
|
|
9
|
-
* - read: 只读态,纯文本展示
|
|
10
|
-
* - edit: 编辑态,显示输入控件
|
|
11
|
-
* - disabled: 禁用态,禁用的输入控件
|
|
12
|
-
*/
|
|
13
|
-
export declare type DisplayState = 'read' | 'edit' | 'disabled';
|
|
14
|
-
/**
|
|
15
|
-
* 校验结果类型
|
|
16
|
-
*
|
|
17
|
-
* 所有输入组件的校验结果统一格式
|
|
18
|
-
*/
|
|
19
|
-
export interface ValidationResult {
|
|
20
|
-
/**
|
|
21
|
-
* 是否校验通过
|
|
22
|
-
*/
|
|
23
|
-
isValid: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* 错误信息数组
|
|
26
|
-
*/
|
|
27
|
-
errors: string[];
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 公共类型定义
|
|
3
|
+
* 供所有输入组件使用
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 显示状态类型
|
|
7
|
+
*
|
|
8
|
+
* 所有输入组件的三种状态:
|
|
9
|
+
* - read: 只读态,纯文本展示
|
|
10
|
+
* - edit: 编辑态,显示输入控件
|
|
11
|
+
* - disabled: 禁用态,禁用的输入控件
|
|
12
|
+
*/
|
|
13
|
+
export declare type DisplayState = 'read' | 'edit' | 'disabled';
|
|
14
|
+
/**
|
|
15
|
+
* 校验结果类型
|
|
16
|
+
*
|
|
17
|
+
* 所有输入组件的校验结果统一格式
|
|
18
|
+
*/
|
|
19
|
+
export interface ValidationResult {
|
|
20
|
+
/**
|
|
21
|
+
* 是否校验通过
|
|
22
|
+
*/
|
|
23
|
+
isValid: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 错误信息数组
|
|
26
|
+
*/
|
|
27
|
+
errors: string[];
|
|
28
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/** 生成存储 key 的路径后缀:pathname 或 pathname#memory_key(来自 URL memory_key 参数) */
|
|
2
|
-
export declare function getStorageKeySuffix(): string;
|
|
3
|
-
/**
|
|
4
|
-
* 生成组件实例的存储 key。
|
|
5
|
-
* @param componentId 组件实例 id(如 __id)
|
|
6
|
-
* @param prefix 前缀,如 'table-setting'、'record-board-column-visibility'
|
|
7
|
-
*/
|
|
8
|
-
export declare function getComponentStorageKey(componentId: string, prefix: string): string;
|
|
9
|
-
export interface ColumnSettingStorageItem {
|
|
10
|
-
key: string;
|
|
11
|
-
dataIndex: string;
|
|
12
|
-
title?: unknown;
|
|
13
|
-
titleString?: string;
|
|
14
|
-
isShow: boolean;
|
|
15
|
-
sortIndex?: number;
|
|
16
|
-
fixed?: 'left' | 'right' | boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare function saveColumnSettingToLocal(params: {
|
|
19
|
-
componentId: string;
|
|
20
|
-
columnSetting: ColumnSettingStorageItem[];
|
|
21
|
-
}): void;
|
|
22
|
-
export declare function getColumnSettingFromLocal(componentId?: string): ColumnSettingStorageItem[] | null;
|
|
23
|
-
export declare function clearColumnSettingFromLocal(componentId?: string): void;
|
|
24
|
-
export declare function saveColumnVisibilityToLocal(params: {
|
|
25
|
-
componentId: string;
|
|
26
|
-
columnVisibility: Record<string, boolean>;
|
|
27
|
-
/** 列 key 顺序,用于列设置弹层拖拽排序后持久化 */
|
|
28
|
-
columnOrder?: string[];
|
|
29
|
-
}): void;
|
|
30
|
-
export declare function getColumnVisibilityFromLocal(componentId?: string): Record<string, boolean> | null;
|
|
31
|
-
/** RecordBoard 列设置(显隐 + 顺序)从 localStorage 读取,用于列设置弹层拖拽排序与显隐持久化 */
|
|
32
|
-
export declare function getRecordBoardColumnSettingFromLocal(componentId?: string): {
|
|
33
|
-
columnVisibility: Record<string, boolean>;
|
|
34
|
-
columnOrder: string[] | null;
|
|
35
|
-
} | null;
|
|
36
|
-
export declare function clearColumnVisibilityFromLocal(componentId?: string): void;
|
|
1
|
+
/** 生成存储 key 的路径后缀:pathname 或 pathname#memory_key(来自 URL memory_key 参数) */
|
|
2
|
+
export declare function getStorageKeySuffix(): string;
|
|
3
|
+
/**
|
|
4
|
+
* 生成组件实例的存储 key。
|
|
5
|
+
* @param componentId 组件实例 id(如 __id)
|
|
6
|
+
* @param prefix 前缀,如 'table-setting'、'record-board-column-visibility'
|
|
7
|
+
*/
|
|
8
|
+
export declare function getComponentStorageKey(componentId: string, prefix: string): string;
|
|
9
|
+
export interface ColumnSettingStorageItem {
|
|
10
|
+
key: string;
|
|
11
|
+
dataIndex: string;
|
|
12
|
+
title?: unknown;
|
|
13
|
+
titleString?: string;
|
|
14
|
+
isShow: boolean;
|
|
15
|
+
sortIndex?: number;
|
|
16
|
+
fixed?: 'left' | 'right' | boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function saveColumnSettingToLocal(params: {
|
|
19
|
+
componentId: string;
|
|
20
|
+
columnSetting: ColumnSettingStorageItem[];
|
|
21
|
+
}): void;
|
|
22
|
+
export declare function getColumnSettingFromLocal(componentId?: string): ColumnSettingStorageItem[] | null;
|
|
23
|
+
export declare function clearColumnSettingFromLocal(componentId?: string): void;
|
|
24
|
+
export declare function saveColumnVisibilityToLocal(params: {
|
|
25
|
+
componentId: string;
|
|
26
|
+
columnVisibility: Record<string, boolean>;
|
|
27
|
+
/** 列 key 顺序,用于列设置弹层拖拽排序后持久化 */
|
|
28
|
+
columnOrder?: string[];
|
|
29
|
+
}): void;
|
|
30
|
+
export declare function getColumnVisibilityFromLocal(componentId?: string): Record<string, boolean> | null;
|
|
31
|
+
/** RecordBoard 列设置(显隐 + 顺序)从 localStorage 读取,用于列设置弹层拖拽排序与显隐持久化 */
|
|
32
|
+
export declare function getRecordBoardColumnSettingFromLocal(componentId?: string): {
|
|
33
|
+
columnVisibility: Record<string, boolean>;
|
|
34
|
+
columnOrder: string[] | null;
|
|
35
|
+
} | null;
|
|
36
|
+
export declare function clearColumnVisibilityFromLocal(componentId?: string): void;
|
package/lib/constants/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const webHookApi: {
|
|
2
|
-
warning_log: {
|
|
3
|
-
test: string;
|
|
4
|
-
prod: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export { webHookApi };
|
|
1
|
+
declare const webHookApi: {
|
|
2
|
+
warning_log: {
|
|
3
|
+
test: string;
|
|
4
|
+
prod: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export { webHookApi };
|
package/lib/date.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @title: 格式化日期
|
|
3
|
-
* @description:
|
|
4
|
-
* @param {string} date
|
|
5
|
-
* @param {string} format
|
|
6
|
-
* @return {*}
|
|
7
|
-
* @Author: zhiwei.Wang
|
|
8
|
-
* @Date: 2023-07-21 10:49
|
|
9
|
-
*/
|
|
10
|
-
export declare const formatDate: (date: string | Date, format?: string) => string;
|
|
11
|
-
/**
|
|
12
|
-
* @title: excel日期 转 js日期
|
|
13
|
-
* @description:
|
|
14
|
-
* @param {number} excelDate
|
|
15
|
-
* @return {*}
|
|
16
|
-
* @Author: zhiwei.Wang
|
|
17
|
-
* @Date: 2023-07-21 10:49
|
|
18
|
-
*/
|
|
19
|
-
export declare const excelDateToJSDate: (excelDate: number) => string;
|
|
20
|
-
/**
|
|
21
|
-
* @title: js日期 转 excel日期
|
|
22
|
-
* @description:
|
|
23
|
-
* @param {string} jsDate
|
|
24
|
-
* @return {*}
|
|
25
|
-
* @Author: zhiwei.Wang
|
|
26
|
-
* @Date: 2023-07-21 10:49
|
|
27
|
-
*/
|
|
28
|
-
export declare const jsDateToExcelDate: (jsDate: string) => number;
|
|
1
|
+
/**
|
|
2
|
+
* @title: 格式化日期
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {string} date
|
|
5
|
+
* @param {string} format
|
|
6
|
+
* @return {*}
|
|
7
|
+
* @Author: zhiwei.Wang
|
|
8
|
+
* @Date: 2023-07-21 10:49
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatDate: (date: string | Date, format?: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* @title: excel日期 转 js日期
|
|
13
|
+
* @description:
|
|
14
|
+
* @param {number} excelDate
|
|
15
|
+
* @return {*}
|
|
16
|
+
* @Author: zhiwei.Wang
|
|
17
|
+
* @Date: 2023-07-21 10:49
|
|
18
|
+
*/
|
|
19
|
+
export declare const excelDateToJSDate: (excelDate: number) => string;
|
|
20
|
+
/**
|
|
21
|
+
* @title: js日期 转 excel日期
|
|
22
|
+
* @description:
|
|
23
|
+
* @param {string} jsDate
|
|
24
|
+
* @return {*}
|
|
25
|
+
* @Author: zhiwei.Wang
|
|
26
|
+
* @Date: 2023-07-21 10:49
|
|
27
|
+
*/
|
|
28
|
+
export declare const jsDateToExcelDate: (jsDate: string) => number;
|
package/lib/document.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @Title: 设置主题
|
|
3
|
-
* @Describe: 传入字符串键值对
|
|
4
|
-
* @Author: Wzw
|
|
5
|
-
*/
|
|
6
|
-
export declare const setTheme: (themes: {
|
|
7
|
-
[key: string]: string;
|
|
8
|
-
}) => void;
|
|
9
|
-
/**
|
|
10
|
-
* 复制到剪切板
|
|
11
|
-
* @param text
|
|
12
|
-
*/
|
|
13
|
-
export declare const copyToClipboard: (text: string) => Promise<void>;
|
|
1
|
+
/**
|
|
2
|
+
* @Title: 设置主题
|
|
3
|
+
* @Describe: 传入字符串键值对
|
|
4
|
+
* @Author: Wzw
|
|
5
|
+
*/
|
|
6
|
+
export declare const setTheme: (themes: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
/**
|
|
10
|
+
* 复制到剪切板
|
|
11
|
+
* @param text
|
|
12
|
+
*/
|
|
13
|
+
export declare const copyToClipboard: (text: string) => Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const EscPosPrinter = any;
|
|
2
|
-
export declare const ALIGN_LEFT = number;
|
|
3
|
-
export declare const ALIGN_CENTER = number;
|
|
4
|
-
export declare const ALIGN_RIGHT = number;
|
|
5
|
-
export declare const columnWidthWithAlignment = (
|
|
6
|
-
width: number,
|
|
7
|
-
alignment: number
|
|
8
|
-
) => any;
|
|
9
|
-
export declare const preparing = any;
|
|
1
|
+
export declare const EscPosPrinter = any;
|
|
2
|
+
export declare const ALIGN_LEFT = number;
|
|
3
|
+
export declare const ALIGN_CENTER = number;
|
|
4
|
+
export declare const ALIGN_RIGHT = number;
|
|
5
|
+
export declare const columnWidthWithAlignment = (
|
|
6
|
+
width: number,
|
|
7
|
+
alignment: number
|
|
8
|
+
) => any;
|
|
9
|
+
export declare const preparing = any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
declare type InjectedConfigType = {
|
|
2
|
-
apiKey: string;
|
|
3
|
-
authDomain: string;
|
|
4
|
-
projectId: string;
|
|
5
|
-
storageBucket: string;
|
|
6
|
-
messagingSenderId: string;
|
|
7
|
-
appId: string;
|
|
8
|
-
databaseURL: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
11
|
-
export declare const firebaseConfig: any;
|
|
12
|
-
declare const _default: any;
|
|
13
|
-
export default _default;
|
|
1
|
+
declare type InjectedConfigType = {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
authDomain: string;
|
|
4
|
+
projectId: string;
|
|
5
|
+
storageBucket: string;
|
|
6
|
+
messagingSenderId: string;
|
|
7
|
+
appId: string;
|
|
8
|
+
databaseURL: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
11
|
+
export declare const firebaseConfig: any;
|
|
12
|
+
declare const _default: any;
|
|
13
|
+
export default _default;
|
package/lib/firebase/index.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { FirebaseApp } from 'firebase/app';
|
|
2
|
-
import { Auth } from 'firebase/auth';
|
|
3
|
-
import { ref, Database, goOnline, goOffline } from 'firebase/database';
|
|
4
|
-
declare let firebaseApp: FirebaseApp;
|
|
5
|
-
declare let auth: Auth;
|
|
6
|
-
declare let database: Database;
|
|
7
|
-
export declare const initFirebase: (config?: any) => void;
|
|
8
|
-
export { database, firebaseApp, auth, ref, goOnline, goOffline };
|
|
9
|
-
export declare const getPath: (path: string) => string;
|
|
10
|
-
export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
|
|
11
|
-
export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
12
|
-
export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
13
|
-
export declare const signOutUser: () => Promise<void>;
|
|
14
|
-
export declare const readData: (path: string) => Promise<any>;
|
|
15
|
-
export declare const writeData: (path: string, data: any) => Promise<void>;
|
|
16
|
-
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
17
|
-
export declare const onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
18
|
-
export declare const removeDataListener: (listener: any) => void;
|
|
19
|
-
declare const _default: {
|
|
20
|
-
signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
21
|
-
signOutUser: () => Promise<void>;
|
|
22
|
-
readData: (path: string) => Promise<any>;
|
|
23
|
-
writeData: (path: string, data: any) => Promise<void>;
|
|
24
|
-
onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
25
|
-
removeDataListener: (listener: any) => void;
|
|
26
|
-
onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
27
|
-
};
|
|
28
|
-
export default _default;
|
|
1
|
+
import { FirebaseApp } from 'firebase/app';
|
|
2
|
+
import { Auth } from 'firebase/auth';
|
|
3
|
+
import { ref, Database, goOnline, goOffline } from 'firebase/database';
|
|
4
|
+
declare let firebaseApp: FirebaseApp;
|
|
5
|
+
declare let auth: Auth;
|
|
6
|
+
declare let database: Database;
|
|
7
|
+
export declare const initFirebase: (config?: any) => void;
|
|
8
|
+
export { database, firebaseApp, auth, ref, goOnline, goOffline };
|
|
9
|
+
export declare const getPath: (path: string) => string;
|
|
10
|
+
export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
|
|
11
|
+
export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
12
|
+
export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
13
|
+
export declare const signOutUser: () => Promise<void>;
|
|
14
|
+
export declare const readData: (path: string) => Promise<any>;
|
|
15
|
+
export declare const writeData: (path: string, data: any) => Promise<void>;
|
|
16
|
+
export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
17
|
+
export declare const onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
18
|
+
export declare const removeDataListener: (listener: any) => void;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
|
|
21
|
+
signOutUser: () => Promise<void>;
|
|
22
|
+
readData: (path: string) => Promise<any>;
|
|
23
|
+
writeData: (path: string, data: any) => Promise<void>;
|
|
24
|
+
onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
25
|
+
removeDataListener: (listener: any) => void;
|
|
26
|
+
onDataChanged: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|