@pisell/private-materials 3.0.96 → 3.0.97
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/eftpos/const.d.ts +38 -0
- package/es/components/eftpos/const.js +79 -0
- package/es/components/eftpos/device.d.ts +8 -0
- package/es/components/eftpos/device.js +30 -0
- package/es/components/eftpos/form/index.d.ts +16 -0
- package/es/components/eftpos/form/index.js +113 -0
- package/es/components/eftpos/index.d.ts +37 -0
- package/es/components/eftpos/index.js +274 -0
- package/es/components/eftpos/index.less +153 -0
- package/es/components/eftpos/locales.d.ts +75 -0
- package/es/components/eftpos/locales.js +98 -0
- package/es/components/eftpos/pos.d.ts +9 -0
- package/es/components/eftpos/pos.js +33 -0
- package/es/components/eftpos/surcharge/index.css +17 -0
- package/es/components/eftpos/surcharge/index.d.ts +8 -0
- package/es/components/eftpos/surcharge/index.js +111 -0
- package/es/components/eftpos/table.d.ts +17 -0
- package/es/components/eftpos/table.js +236 -0
- package/es/components/eftposPay/amount.d.ts +14 -0
- package/es/components/eftposPay/amount.js +253 -0
- package/es/components/eftposPay/component/alert/index.d.ts +6 -0
- package/es/components/eftposPay/component/alert/index.js +11 -0
- package/es/components/eftposPay/component/alert/index.less +29 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/es/components/eftposPay/component/alert/warn.js +45 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/es/components/eftposPay/component/fail/failCustom.js +95 -0
- package/es/components/eftposPay/component/fail/index.d.ts +4 -0
- package/es/components/eftposPay/component/fail/index.js +105 -0
- package/es/components/eftposPay/component/fail/network.d.ts +4 -0
- package/es/components/eftposPay/component/fail/network.js +48 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/es/components/eftposPay/component/fail/unknow.js +43 -0
- package/es/components/eftposPay/component/header/index.d.ts +9 -0
- package/es/components/eftposPay/component/header/index.js +66 -0
- package/es/components/eftposPay/component/header/index.less +44 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/es/components/eftposPay/component/header/titlebar.js +39 -0
- package/es/components/eftposPay/component/header/titlebar.less +17 -0
- package/es/components/eftposPay/component/manual/index.d.ts +5 -0
- package/es/components/eftposPay/component/manual/index.js +91 -0
- package/es/components/eftposPay/component/manual/index.less +96 -0
- package/es/components/eftposPay/component/signature/index.d.ts +4 -0
- package/es/components/eftposPay/component/signature/index.js +63 -0
- package/es/components/eftposPay/component/step/index.d.ts +12 -0
- package/es/components/eftposPay/component/step/index.js +31 -0
- package/es/components/eftposPay/component/step/step.d.ts +9 -0
- package/es/components/eftposPay/component/step/step.js +23 -0
- package/es/components/eftposPay/const.d.ts +131 -0
- package/es/components/eftposPay/const.js +48 -0
- package/es/components/eftposPay/device.d.ts +14 -0
- package/es/components/eftposPay/device.js +124 -0
- package/es/components/eftposPay/device.less +61 -0
- package/es/components/eftposPay/eftpos/config.d.ts +11 -0
- package/es/components/eftposPay/eftpos/config.js +178 -0
- package/es/components/eftposPay/eftpos/const.d.ts +10 -0
- package/es/components/eftposPay/eftpos/const.js +139 -0
- package/es/components/eftposPay/eftpos/index.d.ts +7 -0
- package/es/components/eftposPay/eftpos/index.js +35 -0
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +35 -0
- package/es/components/eftposPay/hooks.d.ts +4 -0
- package/es/components/eftposPay/hooks.js +153 -0
- package/es/components/eftposPay/index.d.ts +7 -0
- package/es/components/eftposPay/index.js +188 -0
- package/es/components/eftposPay/index.less +273 -0
- package/es/components/eftposPay/locales.d.ts +264 -0
- package/es/components/eftposPay/locales.js +384 -0
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +32 -0
- package/es/components/eftposPay/pay.d.ts +10 -0
- package/es/components/eftposPay/pay.js +108 -0
- package/es/components/eftposPay/payo/config.d.ts +11 -0
- package/es/components/eftposPay/payo/config.js +357 -0
- package/es/components/eftposPay/payo/const.d.ts +6 -0
- package/es/components/eftposPay/payo/const.js +93 -0
- package/es/components/eftposPay/payo/hooks.d.ts +5 -0
- package/es/components/eftposPay/payo/hooks.js +84 -0
- package/es/components/eftposPay/payo/index.d.ts +7 -0
- package/es/components/eftposPay/payo/index.js +35 -0
- package/es/components/eftposPay/store/index.d.ts +239 -0
- package/es/components/eftposPay/store/index.js +304 -0
- package/es/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/es/components/eftposPay/store/useThunkReducer.js +31 -0
- package/es/components/eftposPay/windcave/action.d.ts +8 -0
- package/es/components/eftposPay/windcave/action.js +104 -0
- package/es/components/eftposPay/windcave/const.d.ts +104 -0
- package/es/components/eftposPay/windcave/const.js +253 -0
- package/es/components/eftposPay/windcave/helper.d.ts +9 -0
- package/es/components/eftposPay/windcave/helper.js +314 -0
- package/es/components/eftposPay/windcave/hook.d.ts +14 -0
- package/es/components/eftposPay/windcave/hook.js +144 -0
- package/es/components/eftposPay/windcave/index.d.ts +8 -0
- package/es/components/eftposPay/windcave/index.js +49 -0
- package/es/components/eftposPay/windcave/pos.d.ts +8 -0
- package/es/components/eftposPay/windcave/pos.js +180 -0
- package/es/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/es/components/eftposPay/windcave/pwd.js +124 -0
- package/es/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/es/components/eftposPay/windcave/receipet.js +67 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/es/components/eftposPay/windcave/receiptAction.js +326 -0
- package/es/components/eftposPay/windcave/timer.d.ts +17 -0
- package/es/components/eftposPay/windcave/timer.js +181 -0
- package/es/components/eftposPay/windcave/wait.d.ts +12 -0
- package/es/components/eftposPay/windcave/wait.js +139 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/es/components/eftposPay/windcave/windcave.js +283 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/hooks/usePrefix.d.ts +1 -0
- package/es/hooks/usePrefix.js +10 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/eftpos/const.d.ts +38 -0
- package/lib/components/eftpos/const.js +108 -0
- package/lib/components/eftpos/device.d.ts +8 -0
- package/lib/components/eftpos/device.js +55 -0
- package/lib/components/eftpos/form/index.d.ts +16 -0
- package/lib/components/eftpos/form/index.js +124 -0
- package/lib/components/eftpos/index.d.ts +37 -0
- package/lib/components/eftpos/index.js +279 -0
- package/lib/components/eftpos/index.less +153 -0
- package/lib/components/eftpos/locales.d.ts +75 -0
- package/lib/components/eftpos/locales.js +116 -0
- package/lib/components/eftpos/pos.d.ts +9 -0
- package/lib/components/eftpos/pos.js +55 -0
- package/lib/components/eftpos/surcharge/index.css +17 -0
- package/lib/components/eftpos/surcharge/index.d.ts +8 -0
- package/lib/components/eftpos/surcharge/index.js +125 -0
- package/lib/components/eftpos/table.d.ts +17 -0
- package/lib/components/eftpos/table.js +235 -0
- package/lib/components/eftposPay/amount.d.ts +14 -0
- package/lib/components/eftposPay/amount.js +239 -0
- package/lib/components/eftposPay/component/alert/index.d.ts +6 -0
- package/lib/components/eftposPay/component/alert/index.js +38 -0
- package/lib/components/eftposPay/component/alert/index.less +29 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +3 -0
- package/lib/components/eftposPay/component/alert/warn.js +80 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/failCustom.js +117 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/index.js +121 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/network.js +65 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +4 -0
- package/lib/components/eftposPay/component/fail/unknow.js +72 -0
- package/lib/components/eftposPay/component/header/index.d.ts +9 -0
- package/lib/components/eftposPay/component/header/index.js +92 -0
- package/lib/components/eftposPay/component/header/index.less +44 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +13 -0
- package/lib/components/eftposPay/component/header/titlebar.js +55 -0
- package/lib/components/eftposPay/component/header/titlebar.less +17 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +5 -0
- package/lib/components/eftposPay/component/manual/index.js +101 -0
- package/lib/components/eftposPay/component/manual/index.less +96 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +4 -0
- package/lib/components/eftposPay/component/signature/index.js +80 -0
- package/lib/components/eftposPay/component/step/index.d.ts +12 -0
- package/lib/components/eftposPay/component/step/index.js +71 -0
- package/lib/components/eftposPay/component/step/step.d.ts +9 -0
- package/lib/components/eftposPay/component/step/step.js +59 -0
- package/lib/components/eftposPay/const.d.ts +131 -0
- package/lib/components/eftposPay/const.js +86 -0
- package/lib/components/eftposPay/device.d.ts +14 -0
- package/lib/components/eftposPay/device.js +127 -0
- package/lib/components/eftposPay/device.less +61 -0
- package/lib/components/eftposPay/eftpos/config.d.ts +11 -0
- package/lib/components/eftposPay/eftpos/config.js +199 -0
- package/lib/components/eftposPay/eftpos/const.d.ts +10 -0
- package/lib/components/eftposPay/eftpos/const.js +165 -0
- package/lib/components/eftposPay/eftpos/index.d.ts +7 -0
- package/lib/components/eftposPay/eftpos/index.js +66 -0
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +62 -0
- package/lib/components/eftposPay/hooks.d.ts +4 -0
- package/lib/components/eftposPay/hooks.js +237 -0
- package/lib/components/eftposPay/index.d.ts +7 -0
- package/lib/components/eftposPay/index.js +189 -0
- package/lib/components/eftposPay/index.less +273 -0
- package/lib/components/eftposPay/locales.d.ts +264 -0
- package/lib/components/eftposPay/locales.js +304 -0
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +77 -0
- package/lib/components/eftposPay/pay.d.ts +10 -0
- package/lib/components/eftposPay/pay.js +120 -0
- package/lib/components/eftposPay/payo/config.d.ts +11 -0
- package/lib/components/eftposPay/payo/config.js +377 -0
- package/lib/components/eftposPay/payo/const.d.ts +6 -0
- package/lib/components/eftposPay/payo/const.js +112 -0
- package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
- package/lib/components/eftposPay/payo/hooks.js +80 -0
- package/lib/components/eftposPay/payo/index.d.ts +7 -0
- package/lib/components/eftposPay/payo/index.js +63 -0
- package/lib/components/eftposPay/store/index.d.ts +239 -0
- package/lib/components/eftposPay/store/index.js +371 -0
- package/lib/components/eftposPay/store/useThunkReducer.d.ts +9 -0
- package/lib/components/eftposPay/store/useThunkReducer.js +53 -0
- package/lib/components/eftposPay/windcave/action.d.ts +8 -0
- package/lib/components/eftposPay/windcave/action.js +143 -0
- package/lib/components/eftposPay/windcave/const.d.ts +104 -0
- package/lib/components/eftposPay/windcave/const.js +300 -0
- package/lib/components/eftposPay/windcave/helper.d.ts +9 -0
- package/lib/components/eftposPay/windcave/helper.js +378 -0
- package/lib/components/eftposPay/windcave/hook.d.ts +14 -0
- package/lib/components/eftposPay/windcave/hook.js +139 -0
- package/lib/components/eftposPay/windcave/index.d.ts +8 -0
- package/lib/components/eftposPay/windcave/index.js +78 -0
- package/lib/components/eftposPay/windcave/pos.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pos.js +197 -0
- package/lib/components/eftposPay/windcave/pwd.d.ts +8 -0
- package/lib/components/eftposPay/windcave/pwd.js +143 -0
- package/lib/components/eftposPay/windcave/receipet.d.ts +6 -0
- package/lib/components/eftposPay/windcave/receipet.js +93 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +11 -0
- package/lib/components/eftposPay/windcave/receiptAction.js +386 -0
- package/lib/components/eftposPay/windcave/timer.d.ts +17 -0
- package/lib/components/eftposPay/windcave/timer.js +126 -0
- package/lib/components/eftposPay/windcave/wait.d.ts +12 -0
- package/lib/components/eftposPay/windcave/wait.js +163 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +6 -0
- package/lib/components/eftposPay/windcave/windcave.js +283 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/hooks/usePrefix.d.ts +1 -0
- package/lib/hooks/usePrefix.js +44 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/eftpos/meta.ts +187 -0
- package/lowcode/eftpos-pay/meta.ts +122 -0
- package/package.json +4 -3
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
var _excluded = ["key"];
|
|
2
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
/* eslint-disable no-unused-vars */
|
|
12
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
13
|
+
/* eslint-disable consistent-return */
|
|
14
|
+
import { locales } from '@pisell/utils';
|
|
15
|
+
import React, { useEffect, useRef } from 'react';
|
|
16
|
+
import Step from "../component/step";
|
|
17
|
+
import { StatusEnum } from "../const";
|
|
18
|
+
import { useFail } from "../hooks";
|
|
19
|
+
import { useContextData, useDispatch, updateComponent, updateState, updateCurrentStemItem } from "../store";
|
|
20
|
+
import { useValidate, useSuccess } from "./hook";
|
|
21
|
+
var Wait = function Wait(_ref) {
|
|
22
|
+
var api = _ref.api,
|
|
23
|
+
onChange = _ref.onChange,
|
|
24
|
+
hasBackup = _ref.hasBackup;
|
|
25
|
+
var dispatch = useDispatch();
|
|
26
|
+
var _useContextData = useContextData(),
|
|
27
|
+
steps = _useContextData.steps,
|
|
28
|
+
status = _useContextData.status,
|
|
29
|
+
custom = _useContextData.custom,
|
|
30
|
+
mode = _useContextData.mode;
|
|
31
|
+
var _steps$ = steps[4],
|
|
32
|
+
key = _steps$.key,
|
|
33
|
+
props = _objectWithoutProperties(_steps$, _excluded);
|
|
34
|
+
var _useValidate = useValidate(1000 * 60),
|
|
35
|
+
_useValidate2 = _slicedToArray(_useValidate, 1),
|
|
36
|
+
check = _useValidate2[0];
|
|
37
|
+
var fail = useFail(4, true);
|
|
38
|
+
var success = useSuccess(4);
|
|
39
|
+
var failRef = useRef(fail);
|
|
40
|
+
var successRef = useRef(success);
|
|
41
|
+
var ref = useRef(custom === null || custom === void 0 ? void 0 : custom.number);
|
|
42
|
+
var statusRef = useRef(status);
|
|
43
|
+
var backupRef = useRef(hasBackup);
|
|
44
|
+
var customRef = useRef(custom);
|
|
45
|
+
var stepStatusRef = useRef(props.status);
|
|
46
|
+
var clearRef = useRef();
|
|
47
|
+
var initRef = useRef(false);
|
|
48
|
+
var unloadRef = useRef(false);
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
customRef.current = custom;
|
|
51
|
+
}, [custom]);
|
|
52
|
+
useEffect(function () {
|
|
53
|
+
backupRef.current = hasBackup;
|
|
54
|
+
}, [hasBackup]);
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
stepStatusRef.current = props.status;
|
|
57
|
+
}, [props.status]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
ref.current = custom === null || custom === void 0 ? void 0 : custom.number;
|
|
60
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.number]);
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
statusRef.current = status;
|
|
63
|
+
}, [status]);
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
failRef.current = fail;
|
|
66
|
+
}, [fail]);
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
successRef.current = success;
|
|
69
|
+
}, [success]);
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
if (initRef.current) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
initRef.current = true;
|
|
75
|
+
if (statusRef.current === StatusEnum.Success && stepStatusRef.current === StatusEnum.Success) {
|
|
76
|
+
clearRef.current = setTimeout(function () {
|
|
77
|
+
var _customRef$current;
|
|
78
|
+
onChange('success', (_customRef$current = customRef.current) === null || _customRef$current === void 0 ? void 0 : _customRef$current.pay);
|
|
79
|
+
}, 1000);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (statusRef.current !== StatusEnum.Loading) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (stepStatusRef.current !== StatusEnum.Loading) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
console.log('wait 开始查询 ', ref.current);
|
|
89
|
+
check({
|
|
90
|
+
check: api.check,
|
|
91
|
+
number: ref.current,
|
|
92
|
+
txn_status_id: '8',
|
|
93
|
+
__start__: '7',
|
|
94
|
+
checkCondition: function checkCondition(r) {
|
|
95
|
+
return "".concat(r.txn_status_id) !== '8' || "".concat(r.status_id) !== '6';
|
|
96
|
+
}
|
|
97
|
+
}).then(function (res) {
|
|
98
|
+
if (unloadRef.current) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
successRef.current(res, backupRef.current);
|
|
102
|
+
clearRef.current = setTimeout(function () {
|
|
103
|
+
var _customRef$current2;
|
|
104
|
+
onChange('success', (_customRef$current2 = customRef.current) === null || _customRef$current2 === void 0 ? void 0 : _customRef$current2.pay);
|
|
105
|
+
}, 1000);
|
|
106
|
+
}, function (res) {
|
|
107
|
+
if (unloadRef.current) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (backupRef.current) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (res && _typeof(res) === 'object' && typeof res.txn_status_id !== 'undefined' && typeof res.status_id !== 'undefined') {
|
|
114
|
+
dispatch(updateCurrentStemItem({
|
|
115
|
+
status: 'fail'
|
|
116
|
+
}));
|
|
117
|
+
dispatch(updateState({
|
|
118
|
+
manual: {
|
|
119
|
+
title: locales.getText('page.eftpos-pay.text.timedout.title'),
|
|
120
|
+
text: locales.getText('page.eftpos-pay.text.timedout.text')(mode)
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
dispatch(updateComponent('Manual'));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
failRef.current(res);
|
|
127
|
+
});
|
|
128
|
+
}, [api.check, check, dispatch, onChange]);
|
|
129
|
+
useEffect(function () {
|
|
130
|
+
return function () {
|
|
131
|
+
unloadRef.current = true;
|
|
132
|
+
if (clearRef.current) {
|
|
133
|
+
clearTimeout(clearRef.current);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}, []);
|
|
137
|
+
return /*#__PURE__*/React.createElement(Step, props);
|
|
138
|
+
};
|
|
139
|
+
export default Wait;
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
14
|
+
/* eslint-disable no-nested-ternary */
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
16
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
17
|
+
/* eslint-disable consistent-return */
|
|
18
|
+
/* eslint-disable react/no-array-index-key */
|
|
19
|
+
/* eslint-disable array-callback-return */
|
|
20
|
+
import { locales } from '@pisell/utils';
|
|
21
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import { Decimal } from 'decimal.js';
|
|
23
|
+
import Step from "../component/step/step";
|
|
24
|
+
import { StatusEnum, ModeEnum } from "../const";
|
|
25
|
+
import { getUuid } from "../helper";
|
|
26
|
+
import { useDispatch, useContextData, updateState, updateCustom } from "../store";
|
|
27
|
+
import { StemTypeEnum, StepStatusEnum, getStepMapping } from "./const";
|
|
28
|
+
import { useFail, useValidate } from "./helper";
|
|
29
|
+
import Action, { ReceiptAction } from "./receiptAction";
|
|
30
|
+
var Minute = 1000 * 60;
|
|
31
|
+
export default (function (_ref) {
|
|
32
|
+
var api = _ref.api,
|
|
33
|
+
onChange = _ref.onChange;
|
|
34
|
+
var _useContextData = useContextData(),
|
|
35
|
+
eftpos = _useContextData.eftpos,
|
|
36
|
+
custom = _useContextData.custom,
|
|
37
|
+
device = _useContextData.device,
|
|
38
|
+
status = _useContextData.status,
|
|
39
|
+
mode = _useContextData.mode;
|
|
40
|
+
var dispatch = useDispatch();
|
|
41
|
+
var fail = useFail();
|
|
42
|
+
var failRef = useRef(fail);
|
|
43
|
+
var modeRef = useRef(mode);
|
|
44
|
+
var statusRef = useRef(status);
|
|
45
|
+
var unloadRef = useRef(false);
|
|
46
|
+
var customRef = useRef(custom);
|
|
47
|
+
var deviceRef = useRef(device);
|
|
48
|
+
var refundRef = useRef(custom === null || custom === void 0 ? void 0 : custom.refund);
|
|
49
|
+
var ref = useRef(custom === null || custom === void 0 ? void 0 : custom.number);
|
|
50
|
+
var stepRef = useRef(custom === null || custom === void 0 ? void 0 : custom.step);
|
|
51
|
+
var listRef = useRef(custom === null || custom === void 0 ? void 0 : custom.list);
|
|
52
|
+
var initRef = useRef(false);
|
|
53
|
+
var isPayRef = useRef(custom === null || custom === void 0 ? void 0 : custom.isPay);
|
|
54
|
+
var isReceiptPage = useMemo(function () {
|
|
55
|
+
return (custom === null || custom === void 0 ? void 0 : custom.step) === StepStatusEnum.Receipt;
|
|
56
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.step]);
|
|
57
|
+
var receiptPage = useMemo(function () {
|
|
58
|
+
return (custom === null || custom === void 0 ? void 0 : custom.step) !== StepStatusEnum.Receipt ? '' : (custom === null || custom === void 0 ? void 0 : custom.receiptPage) || 'receipt';
|
|
59
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.step, custom === null || custom === void 0 ? void 0 : custom.receiptPage]);
|
|
60
|
+
var _useState = useState(false),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
disabled = _useState2[0],
|
|
63
|
+
setDisabled = _useState2[1];
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
statusRef.current = status;
|
|
66
|
+
}, [status]);
|
|
67
|
+
useEffect(function () {
|
|
68
|
+
modeRef.current = mode;
|
|
69
|
+
}, [mode]);
|
|
70
|
+
useEffect(function () {
|
|
71
|
+
isPayRef.current = custom === null || custom === void 0 ? void 0 : custom.isPay;
|
|
72
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.isPay]);
|
|
73
|
+
useEffect(function () {
|
|
74
|
+
listRef.current = custom === null || custom === void 0 ? void 0 : custom.list;
|
|
75
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.list]);
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
stepRef.current = custom === null || custom === void 0 ? void 0 : custom.step;
|
|
78
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.step]);
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
refundRef.current = custom === null || custom === void 0 ? void 0 : custom.refund;
|
|
81
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.refund]);
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
customRef.current = custom;
|
|
84
|
+
}, [custom]);
|
|
85
|
+
useEffect(function () {
|
|
86
|
+
deviceRef.current = device;
|
|
87
|
+
}, [device]);
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
ref.current = custom === null || custom === void 0 ? void 0 : custom.number;
|
|
90
|
+
}, [custom === null || custom === void 0 ? void 0 : custom.number]);
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
failRef.current = fail;
|
|
93
|
+
}, [fail]);
|
|
94
|
+
var _useValidate = useValidate(api.check, Minute, function (res) {
|
|
95
|
+
dispatch(updateCustom({
|
|
96
|
+
list: listRef.current.map(function (item) {
|
|
97
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
98
|
+
status: 'resolve'
|
|
99
|
+
});
|
|
100
|
+
})
|
|
101
|
+
}));
|
|
102
|
+
dispatch(updateState({
|
|
103
|
+
status: 'success',
|
|
104
|
+
title: locales.getText('page.eftpos-pay.text.successful')(mode)
|
|
105
|
+
}));
|
|
106
|
+
setTimeout(function () {
|
|
107
|
+
if (modeRef.current === ModeEnum.Pay) {
|
|
108
|
+
var _customRef$current;
|
|
109
|
+
var obj = ((_customRef$current = customRef.current) === null || _customRef$current === void 0 ? void 0 : _customRef$current.pay) || {};
|
|
110
|
+
var cardReaderSurcharge = (res === null || res === void 0 ? void 0 : res.card_reader_surcharge) || 0;
|
|
111
|
+
// 卡手续费
|
|
112
|
+
var surCardDeci = new Decimal(Number(cardReaderSurcharge));
|
|
113
|
+
|
|
114
|
+
// 手续费-固定金额
|
|
115
|
+
var surMoneyDeci = new Decimal(Number((obj === null || obj === void 0 ? void 0 : obj.surMoney) || 0));
|
|
116
|
+
|
|
117
|
+
// 手续费-比例金额
|
|
118
|
+
var surRateMoneyDeci = new Decimal(Number(obj === null || obj === void 0 ? void 0 : obj.surRateMoney));
|
|
119
|
+
|
|
120
|
+
// 手续费-固定金额 + 卡手续费 = 固定金额总额
|
|
121
|
+
var surMoneyTotal = surMoneyDeci.add(surCardDeci);
|
|
122
|
+
|
|
123
|
+
// 手续费-固定金额 + 卡手续费 + 手续费-比例金额 = 总手续费
|
|
124
|
+
var surchargeDeci = surMoneyTotal.add(surRateMoneyDeci);
|
|
125
|
+
onChange('success', _objectSpread(_objectSpread({}, obj), {}, {
|
|
126
|
+
cardReaderSurcharge: cardReaderSurcharge,
|
|
127
|
+
surMoney: surMoneyTotal.toFixed(2, Decimal.ROUND_HALF_UP),
|
|
128
|
+
surcharge: surchargeDeci.toFixed(2, Decimal.ROUND_HALF_UP),
|
|
129
|
+
number: ref.current,
|
|
130
|
+
device: deviceRef.current
|
|
131
|
+
}));
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (modeRef.current === ModeEnum.Refund) {
|
|
135
|
+
var _obj = refundRef.current || {};
|
|
136
|
+
onChange('success', _objectSpread(_objectSpread({}, _obj), {}, {
|
|
137
|
+
number: ref.current,
|
|
138
|
+
device: deviceRef.current
|
|
139
|
+
}));
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
onChange('success', {
|
|
143
|
+
number: ref.current
|
|
144
|
+
});
|
|
145
|
+
}, 1000);
|
|
146
|
+
}),
|
|
147
|
+
_useValidate2 = _slicedToArray(_useValidate, 1),
|
|
148
|
+
run = _useValidate2[0];
|
|
149
|
+
var controllerRef = useRef();
|
|
150
|
+
useEffect(function () {
|
|
151
|
+
if (initRef.current) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
initRef.current = true;
|
|
155
|
+
var _ref2 = customRef.current,
|
|
156
|
+
pay = _ref2.pay,
|
|
157
|
+
order_id = _ref2.order_id;
|
|
158
|
+
if (stepRef.current === StepStatusEnum.Receipt) {
|
|
159
|
+
if (StatusEnum.Loading === statusRef.current) {
|
|
160
|
+
run();
|
|
161
|
+
} else {
|
|
162
|
+
run(-1);
|
|
163
|
+
}
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
controllerRef.current = new AbortController();
|
|
167
|
+
if (!ref.current) {
|
|
168
|
+
var _deviceRef$current, _refundRef$current, _deviceRef$current2;
|
|
169
|
+
console.log('modeRef.current = ', modeRef.current);
|
|
170
|
+
ref.current = getUuid();
|
|
171
|
+
dispatch(updateCustom({
|
|
172
|
+
number: ref.current
|
|
173
|
+
}));
|
|
174
|
+
var resultPromise = modeRef.current === ModeEnum.Pay ? api.pay({
|
|
175
|
+
order_id: order_id,
|
|
176
|
+
amount: pay.total,
|
|
177
|
+
card_reader_type: eftpos,
|
|
178
|
+
card_reader_id: (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.id,
|
|
179
|
+
number: ref.current
|
|
180
|
+
}, {
|
|
181
|
+
signal: controllerRef.current.signal
|
|
182
|
+
}) : api.refund({
|
|
183
|
+
order_id: order_id,
|
|
184
|
+
amount: (_refundRef$current = refundRef.current) === null || _refundRef$current === void 0 ? void 0 : _refundRef$current.total,
|
|
185
|
+
card_reader_type: eftpos,
|
|
186
|
+
card_reader_id: (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.id,
|
|
187
|
+
number: ref.current
|
|
188
|
+
}, {
|
|
189
|
+
signal: controllerRef.current.signal
|
|
190
|
+
});
|
|
191
|
+
resultPromise.then(function (res) {
|
|
192
|
+
var _customRef$current2;
|
|
193
|
+
if (unloadRef.current) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!((_customRef$current2 = customRef.current) !== null && _customRef$current2 !== void 0 && _customRef$current2.net)) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (res && (res.code === 200 || res.code === '200')) {
|
|
200
|
+
dispatch(updateCustom({
|
|
201
|
+
isPay: true
|
|
202
|
+
}));
|
|
203
|
+
run();
|
|
204
|
+
}
|
|
205
|
+
}).catch(function (res) {
|
|
206
|
+
var _customRef$current3, _failRef$current;
|
|
207
|
+
if (unloadRef.current) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (!((_customRef$current3 = customRef.current) !== null && _customRef$current3 !== void 0 && _customRef$current3.net)) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
(_failRef$current = failRef.current) === null || _failRef$current === void 0 ? void 0 : _failRef$current.call(failRef, res, stepRef.current >= 3);
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
run();
|
|
218
|
+
}, [api, run, eftpos, dispatch]);
|
|
219
|
+
var onCancel = function onCancel() {
|
|
220
|
+
setDisabled(true);
|
|
221
|
+
api.update({
|
|
222
|
+
type: 'CANCEL',
|
|
223
|
+
number: custom === null || custom === void 0 ? void 0 : custom.number
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
useEffect(function () {
|
|
227
|
+
return function () {
|
|
228
|
+
var _controllerRef$curren, _controllerRef$curren2;
|
|
229
|
+
unloadRef.current = true;
|
|
230
|
+
(_controllerRef$curren = controllerRef.current) === null || _controllerRef$curren === void 0 ? void 0 : (_controllerRef$curren2 = _controllerRef$curren.abort) === null || _controllerRef$curren2 === void 0 ? void 0 : _controllerRef$curren2.call(_controllerRef$curren);
|
|
231
|
+
};
|
|
232
|
+
}, []);
|
|
233
|
+
var onChangeReceipt = function onChangeReceipt(status) {
|
|
234
|
+
if (status) {
|
|
235
|
+
run();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
useEffect(function () {
|
|
239
|
+
if (listRef.current.length === 0) {
|
|
240
|
+
var totalUnit = '';
|
|
241
|
+
if (modeRef.current === ModeEnum.Pay) {
|
|
242
|
+
var _customRef$current4, _customRef$current4$p;
|
|
243
|
+
totalUnit = (_customRef$current4 = customRef.current) === null || _customRef$current4 === void 0 ? void 0 : (_customRef$current4$p = _customRef$current4.pay) === null || _customRef$current4$p === void 0 ? void 0 : _customRef$current4$p.totalUnit;
|
|
244
|
+
} else if (modeRef.current === ModeEnum.Refund) {
|
|
245
|
+
var _refundRef$current2;
|
|
246
|
+
totalUnit = ((_refundRef$current2 = refundRef.current) === null || _refundRef$current2 === void 0 ? void 0 : _refundRef$current2.totalUnit) || '';
|
|
247
|
+
}
|
|
248
|
+
var nextStep = getStepMapping(StepStatusEnum.Free, {
|
|
249
|
+
money: totalUnit,
|
|
250
|
+
mode: mode
|
|
251
|
+
});
|
|
252
|
+
dispatch(updateCustom({
|
|
253
|
+
list: [nextStep],
|
|
254
|
+
step: 2
|
|
255
|
+
}));
|
|
256
|
+
}
|
|
257
|
+
}, [dispatch]);
|
|
258
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
259
|
+
className: "pisell-lowcode__eft-pay-body"
|
|
260
|
+
}, receiptPage !== 'again' ? (custom === null || custom === void 0 ? void 0 : custom.list).map(function (item) {
|
|
261
|
+
return /*#__PURE__*/React.createElement(Step, {
|
|
262
|
+
key: item.index,
|
|
263
|
+
pedding: item.pedding,
|
|
264
|
+
resolve: item.resolve,
|
|
265
|
+
reject: item.reject,
|
|
266
|
+
status: item.status,
|
|
267
|
+
className: item.type === StemTypeEnum.Passive && item.status === 'pedding' ? 'pisell-lowcode__eft-pay-step-item-warn' : ''
|
|
268
|
+
});
|
|
269
|
+
}) : null, receiptPage === 'again' ? /*#__PURE__*/React.createElement("div", {
|
|
270
|
+
className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body"
|
|
271
|
+
}, locales.getText('page.eftpos-pay.text.signature.text')(mode)) : null, status === StatusEnum.Loading ? /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
273
|
+
}, locales.getText('page.eftpos-pay.text.processing')) : null, status === StatusEnum.Success ? /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
275
|
+
}, locales.getText('page.eftpos-pay.text.transaction.end')) : null), !isReceiptPage && status !== StatusEnum.Success ? /*#__PURE__*/React.createElement(Action, {
|
|
276
|
+
index: custom === null || custom === void 0 ? void 0 : custom.step,
|
|
277
|
+
onCancel: onCancel,
|
|
278
|
+
disabled: disabled
|
|
279
|
+
}) : null, isReceiptPage ? /*#__PURE__*/React.createElement(ReceiptAction, {
|
|
280
|
+
api: api,
|
|
281
|
+
onChange: onChangeReceipt
|
|
282
|
+
}) : null);
|
|
283
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,7 +68,7 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
71
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
73
72
|
state: FormState;
|
|
74
73
|
} & {
|
|
75
74
|
dispatch: (params: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function usePrefix(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import useEngineContext from "./useEngineContext";
|
|
3
|
+
export default function usePrefix() {
|
|
4
|
+
var _context$appHelper2, _context$appHelper2$c;
|
|
5
|
+
var context = useEngineContext();
|
|
6
|
+
return useMemo(function () {
|
|
7
|
+
var _context$appHelper, _context$appHelper$co;
|
|
8
|
+
return (context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$co = _context$appHelper.constants) === null || _context$appHelper$co === void 0 ? void 0 : _context$appHelper$co.staticURL) || 'https://static.pisellcdn.com';
|
|
9
|
+
}, [context === null || context === void 0 ? void 0 : (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : (_context$appHelper2$c = _context$appHelper2.constants) === null || _context$appHelper2$c === void 0 ? void 0 : _context$appHelper2$c.staticURL]);
|
|
10
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -16,3 +16,5 @@ export { default as ProductExtension } from './components/productExtension';
|
|
|
16
16
|
export { default as BookingDeposit } from './components/booking/deposit';
|
|
17
17
|
export { default as RuleSetting } from './components/ruleSetting';
|
|
18
18
|
export { default as TaxSelect } from './components/taxSelect';
|
|
19
|
+
export { default as Eftpos } from './components/eftpos';
|
|
20
|
+
export { default as EftposPay } from './components/eftposPay';
|
package/es/index.js
CHANGED
|
@@ -19,4 +19,6 @@ export { VerticalClient } from "./components/booking/info/clientVariant";
|
|
|
19
19
|
export { default as ProductExtension } from "./components/productExtension";
|
|
20
20
|
export { default as BookingDeposit } from "./components/booking/deposit";
|
|
21
21
|
export { default as RuleSetting } from "./components/ruleSetting";
|
|
22
|
-
export { default as TaxSelect } from "./components/taxSelect";
|
|
22
|
+
export { default as TaxSelect } from "./components/taxSelect";
|
|
23
|
+
export { default as Eftpos } from "./components/eftpos";
|
|
24
|
+
export { default as EftposPay } from "./components/eftposPay";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -96,7 +95,7 @@ export declare const walkInData: {
|
|
|
96
95
|
id: number;
|
|
97
96
|
nickname: string;
|
|
98
97
|
};
|
|
99
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
98
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
100
99
|
state: FormState;
|
|
101
100
|
} & {
|
|
102
101
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare enum Eftpos {
|
|
2
|
+
Payo = "payo",
|
|
3
|
+
Tyro = "tyro",
|
|
4
|
+
Windcave = "windcave",
|
|
5
|
+
Stripe = "stripe"
|
|
6
|
+
}
|
|
7
|
+
export declare enum DeviceEnum {
|
|
8
|
+
Add = "add",
|
|
9
|
+
Edit = "edit",
|
|
10
|
+
Repair = "repair"
|
|
11
|
+
}
|
|
12
|
+
export declare type DeviceStatus = `${DeviceEnum}`;
|
|
13
|
+
export interface DeviceProp {
|
|
14
|
+
id?: string | number;
|
|
15
|
+
name: string;
|
|
16
|
+
type: Eftpos.Tyro;
|
|
17
|
+
status: "unpaired" | "paired";
|
|
18
|
+
setting: {
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
} | null;
|
|
21
|
+
connection: {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
} | null;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export declare const getDefaultValue: (list: any) => any;
|
|
27
|
+
export declare function getCommByFields({ field, value, name, getComm, }: {
|
|
28
|
+
field: (string | {
|
|
29
|
+
name: string;
|
|
30
|
+
children: string[];
|
|
31
|
+
})[];
|
|
32
|
+
value?: any;
|
|
33
|
+
name?: string[];
|
|
34
|
+
getComm: (params: {
|
|
35
|
+
field: string;
|
|
36
|
+
value?: unknown;
|
|
37
|
+
}, record?: any) => any;
|
|
38
|
+
}): any;
|