@pisell/private-materials 6.1.23 → 6.1.24

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.
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
165
  export declare const getDuration: (duration: number | {
166
166
  type: string;
167
167
  value: number;
168
- }) => number | {
168
+ }) => number | "flexible" | {
169
169
  type: string;
170
170
  value: number;
171
- } | "flexible";
171
+ };
172
172
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
173
  export declare const getIsEdit: (state: any) => boolean;
174
174
  export {};
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -295,7 +295,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "fullPay" | "pay" | "refund" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
@@ -303,7 +303,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
305
305
  subTitle?: string | undefined;
306
- type?: "unset" | "step" | undefined;
306
+ type?: "step" | "unset" | undefined;
307
307
  render?: boolean | undefined;
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
@@ -29,7 +29,7 @@ import localeTexts from "./locales";
29
29
  import "./index.less";
30
30
  import classNames from 'classnames';
31
31
  // 导入所有类型
32
- import { WalletCardItem, DEFAULT_CARD_CONFIG } from "./types";
32
+ import { DEFAULT_CARD_CONFIG } from "./types";
33
33
 
34
34
  // 添加 localStorage 相关的操作函数
35
35
  var STORAGE_KEY = 'pisell_wallet_list_data';
@@ -74,8 +74,6 @@ var getFromLocalStorage = function getFromLocalStorage(key) {
74
74
 
75
75
  // @ts-ignore
76
76
 
77
- // @ts-ignore
78
-
79
77
  // 定义轮播图配置
80
78
  var CAROUSEL_CONFIG = {
81
79
  className: 'pisell-lowcode__walletList',
@@ -1,10 +1,3 @@
1
- declare type IEngineContext = {
2
- appHelper: any;
3
- engine: any;
4
- blockContext: any;
5
- components: any;
6
- pageContext: any;
7
- };
8
- declare const useEngineContext: () => IEngineContext;
1
+ declare const useEngineContext: () => any;
9
2
  export declare const usePisellOS: () => any;
10
3
  export default useEngineContext;
@@ -2,11 +2,14 @@ import { createContext, useContext } from "react";
2
2
  var defaultContext = /*#__PURE__*/createContext({});
3
3
  var useEngineContext = function useEngineContext() {
4
4
  var context = useContext(window.__appContext || defaultContext);
5
+ if (!Object.keys(context).length) {
6
+ return window.__injectedContext;
7
+ }
5
8
  return context || {};
6
9
  };
7
10
  export var usePisellOS = function usePisellOS() {
8
11
  var _context$appHelper;
9
- var context = useContext(window.__appContext || defaultContext);
12
+ var context = useEngineContext();
10
13
  var _ref = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
11
14
  pisellos = _ref.pisellos;
12
15
  return pisellos;
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
165
165
  export declare const getDuration: (duration: number | {
166
166
  type: string;
167
167
  value: number;
168
- }) => number | {
168
+ }) => number | "flexible" | {
169
169
  type: string;
170
170
  value: number;
171
- } | "flexible";
171
+ };
172
172
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
173
173
  export declare const getIsEdit: (state: any) => boolean;
174
174
  export {};
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -295,7 +295,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "fullPay" | "pay" | "refund" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
300
  eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
@@ -303,7 +303,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
305
305
  subTitle?: string | undefined;
306
- type?: "unset" | "step" | undefined;
306
+ type?: "step" | "unset" | undefined;
307
307
  render?: boolean | undefined;
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
@@ -1,10 +1,3 @@
1
- declare type IEngineContext = {
2
- appHelper: any;
3
- engine: any;
4
- blockContext: any;
5
- components: any;
6
- pageContext: any;
7
- };
8
- declare const useEngineContext: () => IEngineContext;
1
+ declare const useEngineContext: () => any;
9
2
  export declare const usePisellOS: () => any;
10
3
  export default useEngineContext;
@@ -29,13 +29,14 @@ var useEngineContext = () => {
29
29
  const context = (0, import_react.useContext)(
30
30
  window.__appContext || defaultContext
31
31
  );
32
+ if (!Object.keys(context).length) {
33
+ return window.__injectedContext;
34
+ }
32
35
  return context || {};
33
36
  };
34
37
  var usePisellOS = () => {
35
38
  var _a;
36
- const context = (0, import_react.useContext)(
37
- window.__appContext || defaultContext
38
- );
39
+ const context = useEngineContext();
39
40
  const { pisellos } = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
40
41
  return pisellos;
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.1.23",
3
+ "version": "6.1.24",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "react-resizable": "^3.0.5",
61
61
  "styled-components": "^6.0.0-rc.3",
62
- "@pisell/date-picker": "3.0.4",
63
- "@pisell/icon": "0.0.11",
64
62
  "@pisell/utils": "3.0.0",
65
- "@pisell/materials": "6.1.8"
63
+ "@pisell/materials": "6.1.8",
64
+ "@pisell/icon": "0.0.11",
65
+ "@pisell/date-picker": "3.0.4"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",