@pisell/utils 3.0.4 → 3.0.6
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/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js +27 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js +25 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.js +14 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.js +9 -0
- package/es/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.js +11 -0
- package/es/arrayUtils.d.ts +76 -1
- package/es/arrayUtils.js +103 -24
- package/es/common/stateHelper.d.ts +22 -0
- package/es/common/stateHelper.js +23 -0
- package/es/common/types.d.ts +31 -0
- package/es/componentStorage.d.ts +38 -0
- package/es/componentStorage.js +106 -0
- package/es/constants/index.js +7 -9
- package/es/date.d.ts +6 -3
- package/es/date.js +36 -53
- package/es/document.d.ts +6 -3
- package/es/document.js +43 -67
- package/es/escPosPrinter/EscPosPrinter.js +353 -490
- package/es/escPosPrinter/index.d.ts +9 -9
- package/es/escPosPrinter/index.js +37 -52
- package/es/format.d.ts +29 -0
- package/es/format.js +90 -112
- package/es/image.d.ts +13 -10
- package/es/image.js +48 -60
- package/es/index.d.ts +39 -18
- package/es/index.js +40 -29
- package/es/jsBridge/index.d.ts +14 -106
- package/es/jsBridge/index.js +57 -40
- package/es/jsBridge/regDeviceApi.js +87 -126
- package/es/jsBridge/types.d.ts +129 -0
- package/es/locales.d.ts +11 -11
- package/es/locales.js +79 -69
- package/es/log.d.ts +11 -6
- package/es/log.js +37 -59
- package/es/miniRedux.d.ts +20 -13
- package/es/miniRedux.js +42 -71
- package/es/number-input/hooks/useNumberInputState.d.ts +29 -0
- package/es/number-input/hooks/useNumberInputState.js +72 -0
- package/es/number-input/types.d.ts +96 -0
- package/es/number-input/utils/formatter.d.ts +56 -0
- package/es/number-input/utils/formatter.js +56 -0
- package/es/number-input/utils/validation.d.ts +32 -0
- package/es/number-input/utils/validation.js +52 -0
- package/es/otherUtils.d.ts +12 -9
- package/es/otherUtils.js +71 -120
- package/es/platform.d.ts +12 -9
- package/es/platform.js +61 -85
- package/es/select/hooks/useDebouncedSearch.d.ts +23 -0
- package/es/select/hooks/useDebouncedSearch.js +41 -0
- package/es/select/hooks/useSelectState.d.ts +19 -0
- package/es/select/hooks/useSelectState.js +60 -0
- package/es/select/index.d.ts +7 -0
- package/es/select/types.d.ts +256 -0
- package/es/select/utils/filterOptions.d.ts +23 -0
- package/es/select/utils/filterOptions.js +29 -0
- package/es/select/utils/helpers.d.ts +43 -0
- package/es/select/utils/helpers.js +51 -0
- package/es/select/utils/index.d.ts +4 -0
- package/es/select/utils/sortOptions.d.ts +13 -0
- package/es/select/utils/sortOptions.js +20 -0
- package/es/select/utils/tagAggregation.d.ts +25 -0
- package/es/select/utils/tagAggregation.js +35 -0
- package/es/text-input/hooks/useTextInputState.d.ts +28 -0
- package/es/text-input/hooks/useTextInputState.js +70 -0
- package/es/text-input/types.d.ts +56 -0
- package/es/text-input/utils/validation.d.ts +28 -0
- package/es/text-input/utils/validation.js +51 -0
- package/es/typeUtils.d.ts +11 -8
- package/es/typeUtils.js +61 -84
- package/es/walletValidity.d.ts +57 -0
- package/es/walletValidity.js +404 -460
- package/es/weighing.d.ts +65 -0
- package/es/weighing.js +96 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js +27 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.js +12 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js +25 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.js +14 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.js +9 -0
- package/lib/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.js +16 -0
- package/lib/_virtual/_rolldown/runtime.js +23 -0
- package/lib/arrayUtils.d.ts +76 -1
- package/lib/arrayUtils.js +102 -37
- package/lib/common/stateHelper.d.ts +22 -0
- package/lib/common/stateHelper.js +23 -0
- package/lib/common/types.d.ts +31 -0
- package/lib/componentStorage.d.ts +38 -0
- package/lib/componentStorage.js +114 -0
- package/lib/constants/index.js +7 -36
- package/lib/date.d.ts +6 -3
- package/lib/date.js +43 -65
- package/lib/document.d.ts +6 -3
- package/lib/document.js +46 -62
- package/lib/escPosPrinter/EscPosPrinter.js +327 -403
- package/lib/escPosPrinter/index.d.ts +9 -9
- package/lib/escPosPrinter/index.js +38 -84
- package/lib/format.d.ts +29 -0
- package/lib/format.js +91 -93
- package/lib/image.d.ts +13 -10
- package/lib/image.js +48 -74
- package/lib/index.d.ts +39 -18
- package/lib/index.js +137 -68
- package/lib/jsBridge/index.d.ts +14 -106
- package/lib/jsBridge/index.js +60 -60
- package/lib/jsBridge/regDeviceApi.js +86 -133
- package/lib/jsBridge/types.d.ts +129 -0
- package/lib/locales.d.ts +11 -11
- package/lib/locales.js +79 -63
- package/lib/log.d.ts +11 -6
- package/lib/log.js +37 -61
- package/lib/miniRedux.d.ts +20 -13
- package/lib/miniRedux.js +43 -91
- package/lib/number-input/hooks/useNumberInputState.d.ts +29 -0
- package/lib/number-input/hooks/useNumberInputState.js +73 -0
- package/lib/number-input/types.d.ts +96 -0
- package/lib/number-input/utils/formatter.d.ts +56 -0
- package/lib/number-input/utils/formatter.js +58 -0
- package/lib/number-input/utils/validation.d.ts +32 -0
- package/lib/number-input/utils/validation.js +52 -0
- package/lib/otherUtils.d.ts +12 -9
- package/lib/otherUtils.js +86 -91
- package/lib/platform.d.ts +12 -9
- package/lib/platform.js +68 -123
- package/lib/select/hooks/useDebouncedSearch.d.ts +23 -0
- package/lib/select/hooks/useDebouncedSearch.js +42 -0
- package/lib/select/hooks/useSelectState.d.ts +19 -0
- package/lib/select/hooks/useSelectState.js +62 -0
- package/lib/select/index.d.ts +7 -0
- package/lib/select/types.d.ts +256 -0
- package/lib/select/utils/filterOptions.d.ts +23 -0
- package/lib/select/utils/filterOptions.js +30 -0
- package/lib/select/utils/helpers.d.ts +43 -0
- package/lib/select/utils/helpers.js +55 -0
- package/lib/select/utils/index.d.ts +4 -0
- package/lib/select/utils/sortOptions.d.ts +13 -0
- package/lib/select/utils/sortOptions.js +20 -0
- package/lib/select/utils/tagAggregation.d.ts +25 -0
- package/lib/select/utils/tagAggregation.js +35 -0
- package/lib/text-input/hooks/useTextInputState.d.ts +28 -0
- package/lib/text-input/hooks/useTextInputState.js +71 -0
- package/lib/text-input/types.d.ts +56 -0
- package/lib/text-input/utils/validation.d.ts +28 -0
- package/lib/text-input/utils/validation.js +51 -0
- package/lib/typeUtils.d.ts +11 -8
- package/lib/typeUtils.js +68 -73
- package/lib/walletValidity.d.ts +57 -0
- package/lib/walletValidity.js +420 -323
- package/lib/weighing.d.ts +65 -0
- package/lib/weighing.js +114 -0
- package/package.json +1 -1
- package/es/constants/index.d.ts +0 -7
- package/es/firebase/config/index.d.ts +0 -13
- package/es/firebase/config/index.js +0 -54
- package/es/firebase/index.d.ts +0 -28
- package/es/firebase/index.js +0 -232
- package/lib/constants/index.d.ts +0 -7
- package/lib/firebase/config/index.d.ts +0 -13
- package/lib/firebase/config/index.js +0 -79
- package/lib/firebase/index.d.ts +0 -28
- package/lib/firebase/index.js +0 -180
package/lib/index.js
CHANGED
|
@@ -1,70 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_objectSpread2 = require("./_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
|
+
const require_otherUtils = require("./otherUtils.js");
|
|
4
|
+
const require_typeUtils = require("./typeUtils.js");
|
|
5
|
+
const require_componentStorage = require("./componentStorage.js");
|
|
6
|
+
const require_document = require("./document.js");
|
|
7
|
+
const require_date = require("./date.js");
|
|
8
|
+
const require_platform = require("./platform.js");
|
|
9
|
+
const require_log = require("./log.js");
|
|
10
|
+
const require_format = require("./format.js");
|
|
11
|
+
const require_EscPosPrinter = require("./escPosPrinter/EscPosPrinter.js");
|
|
12
|
+
const require_index = require("./escPosPrinter/index.js");
|
|
13
|
+
const require_miniRedux = require("./miniRedux.js");
|
|
14
|
+
const require_index$1 = require("./jsBridge/index.js");
|
|
15
|
+
const require_image = require("./image.js");
|
|
16
|
+
const require_locales = require("./locales.js");
|
|
17
|
+
const require_arrayUtils = require("./arrayUtils.js");
|
|
18
|
+
const require_walletValidity = require("./walletValidity.js");
|
|
19
|
+
const require_weighing = require("./weighing.js");
|
|
20
|
+
const require_stateHelper = require("./common/stateHelper.js");
|
|
21
|
+
const require_validation = require("./text-input/utils/validation.js");
|
|
22
|
+
const require_useTextInputState = require("./text-input/hooks/useTextInputState.js");
|
|
23
|
+
const require_validation$1 = require("./number-input/utils/validation.js");
|
|
24
|
+
const require_useNumberInputState = require("./number-input/hooks/useNumberInputState.js");
|
|
25
|
+
const require_formatter = require("./number-input/utils/formatter.js");
|
|
26
|
+
const require_useSelectState = require("./select/hooks/useSelectState.js");
|
|
27
|
+
const require_useDebouncedSearch = require("./select/hooks/useDebouncedSearch.js");
|
|
28
|
+
const require_tagAggregation = require("./select/utils/tagAggregation.js");
|
|
29
|
+
const require_filterOptions = require("./select/utils/filterOptions.js");
|
|
30
|
+
const require_sortOptions = require("./select/utils/sortOptions.js");
|
|
31
|
+
const require_helpers = require("./select/utils/helpers.js");
|
|
32
|
+
//#region src/index.ts
|
|
33
|
+
const setPisellUtilsConfig = (config) => {
|
|
34
|
+
globalThis.pisellUtilsConfig = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, globalThis.pisellUtilsConfig || {}), config || {});
|
|
35
|
+
console.log("PisellUtilsConfig_set>>>>", config, globalThis);
|
|
8
36
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
37
|
+
const getPisellUtilsConfig = () => {
|
|
38
|
+
console.log("PisellUtilsConfig_get>>>>", globalThis);
|
|
39
|
+
return globalThis.pisellUtilsConfig || {};
|
|
16
40
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
//#endregion
|
|
42
|
+
exports.ALIGN_CENTER = require_EscPosPrinter.ALIGN_CENTER;
|
|
43
|
+
exports.ALIGN_LEFT = require_EscPosPrinter.ALIGN_LEFT;
|
|
44
|
+
exports.ALIGN_RIGHT = require_EscPosPrinter.ALIGN_RIGHT;
|
|
45
|
+
exports.EscPosPrinter = require_EscPosPrinter;
|
|
46
|
+
exports.INVALID_SCALE_READING_STATUSES = require_weighing.INVALID_SCALE_READING_STATUSES;
|
|
47
|
+
exports.MAX_RETAIL_SCALE_WEIGHT_KG = require_weighing.MAX_RETAIL_SCALE_WEIGHT_KG;
|
|
48
|
+
exports.STANDARD_WEIGHT_UNIT = require_weighing.STANDARD_WEIGHT_UNIT;
|
|
49
|
+
exports.STANDARD_WEIGHT_UNIT_SYMBOL = require_weighing.STANDARD_WEIGHT_UNIT_SYMBOL;
|
|
50
|
+
exports.UNIT_PRICE_PRECISION = require_weighing.UNIT_PRICE_PRECISION;
|
|
51
|
+
exports.WEIGHT_PRECISION = require_weighing.WEIGHT_PRECISION;
|
|
52
|
+
exports.WEIGHT_UNIT_GRAMS = require_weighing.WEIGHT_UNIT_GRAMS;
|
|
53
|
+
exports.WEIGHT_UNIT_NAMES = require_weighing.WEIGHT_UNIT_NAMES;
|
|
54
|
+
exports.WEIGHT_UNIT_SYMBOLS = require_weighing.WEIGHT_UNIT_SYMBOLS;
|
|
55
|
+
exports.addThousandsSeparator = require_formatter.addThousandsSeparator;
|
|
56
|
+
exports.calculateTagDisplay = require_tagAggregation.calculateTagDisplay;
|
|
57
|
+
exports.changeArray = require_otherUtils.changeArray;
|
|
58
|
+
exports.checkEnv = require_platform.checkEnv;
|
|
59
|
+
exports.clearColumnSettingFromLocal = require_componentStorage.clearColumnSettingFromLocal;
|
|
60
|
+
exports.clearColumnVisibilityFromLocal = require_componentStorage.clearColumnVisibilityFromLocal;
|
|
61
|
+
exports.columnWidthWithAlignment = require_EscPosPrinter.columnWidthWithAlignment;
|
|
62
|
+
exports.copyToClipboard = require_document.copyToClipboard;
|
|
63
|
+
exports.createArray = require_otherUtils.createArray;
|
|
64
|
+
exports.dataManager = require_index$1.dataManager;
|
|
65
|
+
exports.defaultFilterOption = require_filterOptions.defaultFilterOption;
|
|
66
|
+
exports.detectIncognito = require_otherUtils.detectIncognito;
|
|
67
|
+
exports.excelDateToJSDate = require_date.excelDateToJSDate;
|
|
68
|
+
exports.filterOptions = require_filterOptions.filterOptions;
|
|
69
|
+
exports.findOptionByValue = require_helpers.findOptionByValue;
|
|
70
|
+
exports.findOptionsByValues = require_helpers.findOptionsByValues;
|
|
71
|
+
exports.formatAmount = require_format.formatAmount;
|
|
72
|
+
exports.formatAmountWithOptions = require_format.formatAmountWithOptions;
|
|
73
|
+
exports.formatDate = require_date.formatDate;
|
|
74
|
+
exports.formatNumber = require_formatter.formatNumber;
|
|
75
|
+
exports.formatPrecision = require_formatter.formatPrecision;
|
|
76
|
+
exports.formatUnitPriceValue = require_weighing.formatUnitPriceValue;
|
|
77
|
+
exports.formatWeightValue = require_weighing.formatWeightValue;
|
|
78
|
+
exports.generateId = require_helpers.generateId;
|
|
79
|
+
exports.generateUniqueIdByObj = require_otherUtils.generateUniqueIdByObj;
|
|
80
|
+
exports.getByPath = require_arrayUtils.getByPath;
|
|
81
|
+
exports.getColumnSettingFromLocal = require_componentStorage.getColumnSettingFromLocal;
|
|
82
|
+
exports.getColumnVisibilityFromLocal = require_componentStorage.getColumnVisibilityFromLocal;
|
|
83
|
+
exports.getComponentStorageKey = require_componentStorage.getComponentStorageKey;
|
|
84
|
+
exports.getDisplayState = require_stateHelper.getDisplayState;
|
|
85
|
+
exports.getItemByArray = require_otherUtils.getItemByArray;
|
|
86
|
+
exports.getPisellUtilsConfig = getPisellUtilsConfig;
|
|
87
|
+
exports.getRecordBoardColumnSettingFromLocal = require_componentStorage.getRecordBoardColumnSettingFromLocal;
|
|
88
|
+
exports.getScheduleSummary = require_walletValidity.getScheduleSummary;
|
|
89
|
+
exports.getStorageKeySuffix = require_componentStorage.getStorageKeySuffix;
|
|
90
|
+
exports.getUniqueId = require_otherUtils.getUniqueId;
|
|
91
|
+
exports.getUsableScaleWeight = require_weighing.getUsableScaleWeight;
|
|
92
|
+
exports.getWalletValidityRange = require_walletValidity.getWalletValidityRange;
|
|
93
|
+
exports.getWeightUnitGrams = require_weighing.getWeightUnitGrams;
|
|
94
|
+
exports.getWeightUnitPriceConversionFactor = require_weighing.getWeightUnitPriceConversionFactor;
|
|
95
|
+
exports.getWeightUnitSymbol = require_weighing.getWeightUnitSymbol;
|
|
96
|
+
exports.groupBy = require_arrayUtils.groupBy;
|
|
97
|
+
exports.image = require_image.image;
|
|
98
|
+
exports.isAndroid = require_platform.isAndroid;
|
|
99
|
+
exports.isArr = require_typeUtils.isArr;
|
|
100
|
+
exports.isBoolean = require_typeUtils.isBoolean;
|
|
101
|
+
exports.isFunction = require_typeUtils.isFunction;
|
|
102
|
+
exports.isIOS = require_platform.isIOS;
|
|
103
|
+
exports.isInvalidScaleReadingStatus = require_weighing.isInvalidScaleReadingStatus;
|
|
104
|
+
exports.isIos = require_platform.isIos;
|
|
105
|
+
exports.isIpad = require_platform.isIpad;
|
|
106
|
+
exports.isJson = require_typeUtils.isJson;
|
|
107
|
+
exports.isMobile = require_platform.isMobile;
|
|
108
|
+
exports.isNumber = require_typeUtils.isNumber;
|
|
109
|
+
exports.isOptionSelected = require_helpers.isOptionSelected;
|
|
110
|
+
exports.isOptionSelectedInMultiple = require_helpers.isOptionSelectedInMultiple;
|
|
111
|
+
exports.isPlainObject = require_typeUtils.isPlainObject;
|
|
112
|
+
exports.isSafari = require_platform.isSafari;
|
|
113
|
+
exports.isString = require_typeUtils.isString;
|
|
114
|
+
exports.isSupportedWeightUnit = require_weighing.isSupportedWeightUnit;
|
|
115
|
+
exports.isUndefined = require_typeUtils.isUndefined;
|
|
116
|
+
exports.isWx = require_platform.isWx;
|
|
117
|
+
exports.isWxApp = require_platform.isWxApp;
|
|
118
|
+
exports.jsDateToExcelDate = require_date.jsDateToExcelDate;
|
|
119
|
+
exports.locales = require_locales.locales;
|
|
120
|
+
exports.miniRedux = require_miniRedux.miniRedux;
|
|
121
|
+
exports.normalizeWeightUnit = require_weighing.normalizeWeightUnit;
|
|
122
|
+
exports.preparing = require_index.preparing;
|
|
123
|
+
exports.resolveWeighingSnapshot = require_weighing.resolveWeighingSnapshot;
|
|
124
|
+
exports.saveColumnSettingToLocal = require_componentStorage.saveColumnSettingToLocal;
|
|
125
|
+
exports.saveColumnVisibilityToLocal = require_componentStorage.saveColumnVisibilityToLocal;
|
|
126
|
+
exports.sendWarningLog = require_log.sendWarningLog;
|
|
127
|
+
exports.setPisellUtilsConfig = setPisellUtilsConfig;
|
|
128
|
+
exports.setTheme = require_document.setTheme;
|
|
129
|
+
exports.sortOptions = require_sortOptions.sortOptions;
|
|
130
|
+
exports.uniqueByKey = require_arrayUtils.uniqueByKey;
|
|
131
|
+
exports.useDebouncedSearch = require_useDebouncedSearch.useDebouncedSearch;
|
|
132
|
+
exports.useMultipleSelectState = require_useSelectState.useMultipleSelectState;
|
|
133
|
+
exports.useNumberInputState = require_useNumberInputState.useNumberInputState;
|
|
134
|
+
exports.useSelectState = require_useSelectState.useSelectState;
|
|
135
|
+
exports.useTextInputState = require_useTextInputState.useTextInputState;
|
|
136
|
+
exports.validateNumberValue = require_validation$1.validateValue;
|
|
137
|
+
exports.validateTextValue = require_validation.validateValue;
|
|
138
|
+
exports.webPayment = require_index$1.webPayment;
|
|
139
|
+
exports.webPrint = require_index$1.webPrint;
|
package/lib/jsBridge/index.d.ts
CHANGED
|
@@ -1,118 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
zh_HK: number;
|
|
5
|
-
};
|
|
6
|
-
declare type LanguageString = {
|
|
7
|
-
en: string;
|
|
8
|
-
zh_CN: string;
|
|
9
|
-
zh_HK: string;
|
|
10
|
-
} | string;
|
|
11
|
-
/**
|
|
12
|
-
* 打印小票
|
|
13
|
-
*/
|
|
14
|
-
declare type WebPrint0 = {
|
|
15
|
-
/**
|
|
16
|
-
* 打印类型
|
|
17
|
-
* 0: 小票
|
|
18
|
-
* 1:ITS备货单/划菜单
|
|
19
|
-
* 2:手环
|
|
20
|
-
*/
|
|
21
|
-
type: "0";
|
|
22
|
-
data: {
|
|
23
|
-
/** 订单ID */
|
|
24
|
-
order_id: string;
|
|
25
|
-
};
|
|
26
|
-
/** 打印语言对应的数量 */
|
|
27
|
-
language: LanguageNumber;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* 打印ITS备货单/划菜单
|
|
31
|
-
*/
|
|
32
|
-
declare type WebPrint1 = {
|
|
33
|
-
/**
|
|
34
|
-
* 打印类型
|
|
35
|
-
* 0: 小票
|
|
36
|
-
* 1:ITS备货单/划菜单
|
|
37
|
-
* 2:手环
|
|
38
|
-
*/
|
|
39
|
-
type: "1";
|
|
40
|
-
data: {
|
|
41
|
-
/** 0:备货 1:划单 */
|
|
42
|
-
mode: "0" | "1";
|
|
43
|
-
resource: LanguageString;
|
|
44
|
-
/** 订单备注 */
|
|
45
|
-
order_note: string;
|
|
46
|
-
/** 订单时间或商品下单时间 */
|
|
47
|
-
time: string;
|
|
48
|
-
/** 订单编号 */
|
|
49
|
-
order_number?: string;
|
|
50
|
-
/** 商品 */
|
|
51
|
-
products: {
|
|
52
|
-
/** 商品名称 */
|
|
53
|
-
product_title: LanguageString;
|
|
54
|
-
/** 商品规格 */
|
|
55
|
-
product_option_string: LanguageString;
|
|
56
|
-
/** 商品备注 */
|
|
57
|
-
product_note: string;
|
|
58
|
-
/** 商品数量 */
|
|
59
|
-
product_quantity: number;
|
|
60
|
-
/** 加菜标识 待定 */
|
|
61
|
-
is_append?: boolean;
|
|
62
|
-
/** 退菜标识 待定 */
|
|
63
|
-
is_removed?: boolean;
|
|
64
|
-
}[];
|
|
65
|
-
};
|
|
66
|
-
/** 打印语言对应的数量 */
|
|
67
|
-
language: LanguageNumber;
|
|
68
|
-
};
|
|
69
|
-
declare type WebPrint2 = {
|
|
70
|
-
/**
|
|
71
|
-
* 打印类型
|
|
72
|
-
* 0: 小票
|
|
73
|
-
* 1:ITS备货单/划菜单
|
|
74
|
-
* 2:手环
|
|
75
|
-
*/
|
|
76
|
-
type: "2";
|
|
77
|
-
data: {
|
|
78
|
-
/** 0: 普通票 1:成人票 2:免费成人票 */
|
|
79
|
-
type: "0" | "1" | "2";
|
|
80
|
-
/** 发行编码 */
|
|
81
|
-
encoded: string;
|
|
82
|
-
/** 编码 */
|
|
83
|
-
code: string;
|
|
84
|
-
/** 到期时间 */
|
|
85
|
-
expire_date: string;
|
|
86
|
-
areas: {
|
|
87
|
-
/** 区域名字 */
|
|
88
|
-
area_name: string;
|
|
89
|
-
/** 区域代码 */
|
|
90
|
-
area_code: string;
|
|
91
|
-
/** 可用次数 */
|
|
92
|
-
limit_num: number;
|
|
93
|
-
/** 已用次数 */
|
|
94
|
-
used_num: number;
|
|
95
|
-
}[];
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
declare type WebPrintParams = WebPrint0 | WebPrint1 | WebPrint2;
|
|
1
|
+
import { DataManagerParams, WebPaymentParams, WebPrintParams } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/jsBridge/index.d.ts
|
|
99
4
|
/**
|
|
100
5
|
* webView页面中调用打印机打印
|
|
101
6
|
* 此api暂时只支持native app平台下ios手机
|
|
102
7
|
* @param params
|
|
103
8
|
* @param callback
|
|
104
9
|
*/
|
|
105
|
-
|
|
106
|
-
declare type DataManagerParams = {
|
|
107
|
-
module: "set" | "get";
|
|
108
|
-
key: string;
|
|
109
|
-
data?: any;
|
|
110
|
-
};
|
|
10
|
+
declare function webPrint(params: WebPrintParams, callback: (...arg: any) => void, onError?: (error: any) => void): void;
|
|
111
11
|
/**
|
|
112
12
|
* webView页面中调用APP内的数据
|
|
113
13
|
* 此api暂时只支持native app平台下ios手机
|
|
114
14
|
* @param params
|
|
115
15
|
* @param callback
|
|
116
16
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
17
|
+
declare function dataManager(params: DataManagerParams, callback: (...arg: any) => void, onError: () => void): void;
|
|
18
|
+
/**
|
|
19
|
+
* webView页面中调用APP内的支付
|
|
20
|
+
* 此api暂时只支持native app平台下ios
|
|
21
|
+
* @param params
|
|
22
|
+
* @param callback
|
|
23
|
+
*/
|
|
24
|
+
declare function webPayment(params: WebPaymentParams, callback: (...arg: any) => void, onError?: (error: any) => void): void;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { dataManager, webPayment, webPrint };
|
package/lib/jsBridge/index.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/jsBridge/index.ts
|
|
30
|
-
var jsBridge_exports = {};
|
|
31
|
-
__export(jsBridge_exports, {
|
|
32
|
-
dataManager: () => dataManager,
|
|
33
|
-
webPrint: () => webPrint
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(jsBridge_exports);
|
|
36
|
-
var import_regDeviceApi = __toESM(require("./regDeviceApi"));
|
|
37
|
-
function webPrint(params, callback) {
|
|
38
|
-
(0, import_regDeviceApi.default)().then((jsBridge) => {
|
|
39
|
-
jsBridge.callDeviceApi({
|
|
40
|
-
apiName: "webPrint",
|
|
41
|
-
params,
|
|
42
|
-
callback: (...arg) => {
|
|
43
|
-
callback && callback(...arg);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
1
|
+
const require_regDeviceApi = require("./regDeviceApi.js");
|
|
2
|
+
//#region src/jsBridge/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* webView页面中调用打印机打印
|
|
5
|
+
* 此api暂时只支持native app平台下ios手机
|
|
6
|
+
* @param params
|
|
7
|
+
* @param callback
|
|
8
|
+
*/
|
|
9
|
+
function webPrint(params, callback, onError) {
|
|
10
|
+
require_regDeviceApi.default().then((jsBridge) => {
|
|
11
|
+
jsBridge.callDeviceApi({
|
|
12
|
+
apiName: "webPrint",
|
|
13
|
+
params,
|
|
14
|
+
callback: (...arg) => {
|
|
15
|
+
callback && callback(...arg);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}).catch((err) => {
|
|
19
|
+
onError === null || onError === void 0 || onError(err);
|
|
20
|
+
console.error("webPrint", err);
|
|
21
|
+
});
|
|
47
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* webView页面中调用APP内的数据
|
|
25
|
+
* 此api暂时只支持native app平台下ios手机
|
|
26
|
+
* @param params
|
|
27
|
+
* @param callback
|
|
28
|
+
*/
|
|
48
29
|
function dataManager(params, callback, onError) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
30
|
+
require_regDeviceApi.default().then((jsBridge) => {
|
|
31
|
+
jsBridge.callDeviceApi({
|
|
32
|
+
apiName: "dataManager",
|
|
33
|
+
params,
|
|
34
|
+
callback: (...arg) => {
|
|
35
|
+
callback && callback(...arg);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}).catch(onError);
|
|
58
39
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
40
|
+
/**
|
|
41
|
+
* webView页面中调用APP内的支付
|
|
42
|
+
* 此api暂时只支持native app平台下ios
|
|
43
|
+
* @param params
|
|
44
|
+
* @param callback
|
|
45
|
+
*/
|
|
46
|
+
function webPayment(params, callback, onError) {
|
|
47
|
+
require_regDeviceApi.default().then((jsBridge) => {
|
|
48
|
+
jsBridge.callDeviceApi({
|
|
49
|
+
apiName: "webPayment",
|
|
50
|
+
params,
|
|
51
|
+
callback: (...arg) => {
|
|
52
|
+
callback && callback(...arg);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}).catch((err) => {
|
|
56
|
+
onError === null || onError === void 0 || onError(err);
|
|
57
|
+
console.error("webPayment", err);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.dataManager = dataManager;
|
|
62
|
+
exports.webPayment = webPayment;
|
|
63
|
+
exports.webPrint = webPrint;
|