@pisell/private-materials 6.8.86 → 6.8.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +9 -9
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/booking/components/customiseItemModal/index.js +4 -7
  12. package/es/components/booking/components/footer/index.d.ts +0 -1
  13. package/es/components/booking/deposit/index.d.ts +0 -1
  14. package/es/components/booking/info/index.d.ts +0 -1
  15. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  16. package/es/components/booking/utils.d.ts +2 -2
  17. package/es/components/eftposPay/amount.d.ts +1 -1
  18. package/es/components/eftposPay/app.d.ts +1 -1
  19. package/es/components/eftposPay/device.d.ts +1 -1
  20. package/es/components/eftposPay/hooks.d.ts +1 -1
  21. package/es/components/eftposPay/store/index.d.ts +4 -4
  22. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
  23. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  24. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  25. package/es/components/ticketBooking/index.d.ts +0 -1
  26. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  27. package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  28. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  29. package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  30. package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  31. package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  32. package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  33. package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  34. package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  35. package/es/plus/saasLogin/utils.d.ts +5 -5
  36. package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -1
  37. package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
  38. package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -1
  39. package/es/plus/skuOptionsSelection/components/VariantCard/index.d.ts +0 -1
  40. package/es/plus/skuOptionsSelection/utils/transformBundleGroup.js +5 -0
  41. package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +1 -0
  42. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  43. package/es/pro/NumericStepper/index.d.ts +21 -1
  44. package/es/pro/NumericStepper/index.js +74 -66
  45. package/es/pro/NumericStepper/index.less +289 -136
  46. package/es/pro/Selector/demo.d.ts +0 -1
  47. package/es/pro/Selector/hooks/usePresetProps.js +2 -1
  48. package/es/pro/keyboards/index.d.ts +2 -0
  49. package/es/pro/keyboards/index.js +1 -0
  50. package/es/pro/keyboards/locales.d.ts +24 -0
  51. package/es/pro/keyboards/locales.js +35 -0
  52. package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  53. package/es/pro/keyboards/numberKeyboard/index.js +524 -0
  54. package/es/pro/keyboards/numberKeyboard/index.less +59 -0
  55. package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  56. package/es/pro/keyboards/numberKeyboard/types.js +1 -0
  57. package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +2 -1
  58. package/es/pro/priceKeyboard/components/discountKeyboard/index.js +2 -1
  59. package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +0 -1
  60. package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +6 -3
  61. package/es/pro/skuDetailModal/index.js +6 -8
  62. package/es/pro/skuDetailModal/index.less +4 -4
  63. package/lib/components/booking/components/customiseItemModal/index.js +4 -5
  64. package/lib/components/booking/components/footer/index.d.ts +0 -1
  65. package/lib/components/booking/deposit/index.d.ts +0 -1
  66. package/lib/components/booking/info/index.d.ts +0 -1
  67. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  68. package/lib/components/booking/utils.d.ts +2 -2
  69. package/lib/components/eftposPay/amount.d.ts +1 -1
  70. package/lib/components/eftposPay/app.d.ts +1 -1
  71. package/lib/components/eftposPay/device.d.ts +1 -1
  72. package/lib/components/eftposPay/hooks.d.ts +1 -1
  73. package/lib/components/eftposPay/store/index.d.ts +4 -4
  74. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
  75. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  76. package/lib/components/ticketBooking/index.d.ts +0 -1
  77. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  78. package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  79. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
  80. package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  81. package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
  82. package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  83. package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
  84. package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  85. package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
  86. package/lib/plus/saasLogin/utils.d.ts +5 -5
  87. package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +0 -1
  88. package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
  89. package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +0 -1
  90. package/lib/plus/skuOptionsSelection/components/VariantCard/index.d.ts +0 -1
  91. package/lib/plus/skuOptionsSelection/utils/transformBundleGroup.js +5 -0
  92. package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +1 -0
  93. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  94. package/lib/pro/NumericStepper/index.d.ts +21 -1
  95. package/lib/pro/NumericStepper/index.js +67 -69
  96. package/lib/pro/NumericStepper/index.less +289 -136
  97. package/lib/pro/Selector/demo.d.ts +0 -1
  98. package/lib/pro/Selector/hooks/usePresetProps.js +2 -1
  99. package/lib/pro/keyboards/index.d.ts +2 -0
  100. package/lib/pro/keyboards/index.js +39 -0
  101. package/lib/pro/keyboards/locales.d.ts +24 -0
  102. package/lib/pro/keyboards/locales.js +47 -0
  103. package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
  104. package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
  105. package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
  106. package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
  107. package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
  108. package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +2 -1
  109. package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +2 -1
  110. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +0 -1
  111. package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +6 -3
  112. package/lib/pro/skuDetailModal/index.js +94 -41
  113. package/lib/pro/skuDetailModal/index.less +4 -4
  114. package/package.json +1 -1
  115. package/es/pro/pisellNumberSelector/example.d.ts +0 -3
  116. package/es/pro/pisellNumberSelector/example.js +0 -68
  117. package/lib/pro/pisellNumberSelector/example.d.ts +0 -3
  118. package/lib/pro/pisellNumberSelector/example.js +0 -93
@@ -6,11 +6,9 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState, useEffect, useRef } from 'react';
8
8
  import { Modal, Input, Checkbox, Button } from 'antd';
9
- // import { X } from '@pisell/icon';
10
9
  import { locales } from '@pisell/utils';
11
10
  import { useToast } from '@pisell/materials';
12
- // import PisellPriceRadio from '../../../../pro/pisellPriceRadio';
13
- import PisellNumberSelector from "../../../../pro/pisellNumberSelector";
11
+ import NumericStepper from "../../../../pro/NumericStepper";
14
12
  import PisellPriceKeyboardModal from "../../../../pro/pisellPriceKeyboardModal";
15
13
  import useEngineContext from "../../../../hooks/useEngineContext";
16
14
  import "./index.less";
@@ -262,7 +260,8 @@ var CustomiseItemModal = function CustomiseItemModal(_ref) {
262
260
  className: "customise-item-save-btn"
263
261
  }, locales.getText('pisell2.customise-item.save'))))), /*#__PURE__*/React.createElement("div", {
264
262
  className: "customise-item-quantity-selector-fixed"
265
- }, /*#__PURE__*/React.createElement(PisellNumberSelector, {
263
+ }, /*#__PURE__*/React.createElement(NumericStepper, {
264
+ variant: "capsule",
266
265
  value: quantity,
267
266
  min: 1,
268
267
  max: 999,
@@ -274,9 +273,7 @@ var CustomiseItemModal = function CustomiseItemModal(_ref) {
274
273
  } else {
275
274
  setQuantity(value);
276
275
  }
277
- },
278
- size: "middle",
279
- enablePriceAdjust: true
276
+ }
280
277
  }))), /*#__PURE__*/React.createElement(PisellPriceKeyboardModal, {
281
278
  visible: showPriceKeyboard,
282
279
  value: priceType === 'sell' ? sellPrice : deductionPrice,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  /**
4
3
  * @title: 底部
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Deposit: (props: any) => JSX.Element;
3
2
  export default Deposit;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoProps } from './main';
3
2
  declare const APP: (props: InfoProps) => JSX.Element;
4
3
  export default APP;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AddTimeModal: () => JSX.Element;
4
3
  export default AddTimeModal;
@@ -173,10 +173,10 @@ export declare const getProductTotalPrice: (item: any) => number;
173
173
  export declare const getDuration: (duration: number | {
174
174
  type: string;
175
175
  value: number;
176
- }) => number | {
176
+ }) => number | "flexible" | {
177
177
  type: string;
178
178
  value: number;
179
- } | "flexible";
179
+ };
180
180
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
181
181
  export declare const getIsEdit: (state: any) => boolean;
182
182
  export {};
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "success" | "fail" | "page" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PosProps, RouteType } from './const';
3
- declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
3
+ declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "mode" | "type" | "getApi"> & {
4
4
  action: RouteType;
5
5
  device_number: string | number;
6
6
  api: ReturnType<PosProps['getApi']>;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "success" | "fail" | "page" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,7 +15,7 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "fail" | "init" | "warn" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
@@ -178,7 +178,7 @@ export declare const updateCustom: (payload: {
178
178
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
179
179
  type: EActionTypes;
180
180
  payload: {
181
- status: "loading" | "success" | "fail" | "warn" | "question";
181
+ status: "loading" | "success" | "warn" | "fail" | "question";
182
182
  };
183
183
  };
184
184
  /**
@@ -299,10 +299,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
299
299
  name?: string | undefined;
300
300
  symbol?: string | undefined;
301
301
  amount?: string | number | undefined;
302
- mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
302
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
303
303
  order_id?: string | number | undefined;
304
304
  eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | "huifu" | undefined;
305
- action?: "amount" | "deviceList" | "pay" | undefined;
305
+ action?: "pay" | "amount" | "deviceList" | undefined;
306
306
  key?: number | undefined;
307
307
  step?: number | undefined;
308
308
  title?: string | undefined;
@@ -312,7 +312,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
312
312
  net?: boolean | undefined;
313
313
  component?: string | undefined;
314
314
  form?: string | undefined;
315
- status?: "loading" | "success" | "fail" | "init" | "warn" | "pedding" | "resove" | "reject" | "question" | undefined;
315
+ status?: "loading" | "success" | "warn" | "init" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
316
316
  warn?: string | undefined;
317
317
  steps?: {
318
318
  /** 用于重置当前步骤 */
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter';
3
2
  import './index.less';
4
3
  interface AddServiceProps {
@@ -1015,7 +1015,7 @@ var AddSerivce = function AddSerivce(props) {
1015
1015
  }
1016
1016
  // 如果是完全的普通商品
1017
1017
  // 或者非 sessions 商品但有 sku 规格商品
1018
- if (isNormalProductByDurationSchedule(item) || (!isSession && isEject)) {
1018
+ if (isNormalProductByDurationSchedule(item)) {
1019
1019
  const openNormalService = getOpenNormalServiceHandler();
1020
1020
  if (openNormalService) {
1021
1021
  openNormalService({
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  import { ProductDisplayConfig, ProductDisplayPresetKey } from '../ProductDisplayAdapter/types';
4
3
  export declare const _formatBookingDetail: (data: any, modalState: any) => any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ProductDisplayConfig, ProductDisplayPresetKey } from './components/ProductDisplayAdapter/types';
3
2
  import './index.less';
4
3
  interface TicketBookingProps {
@@ -47,7 +47,7 @@ declare type ScanData = {
47
47
  };
48
48
  };
49
49
  export declare const formatScanCustomer: (data: ScanData) => {
50
- searchType: "wallet" | "walletPass" | "product" | "customer" | "local_product";
50
+ searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
51
51
  data: any;
52
52
  scanCode: string;
53
53
  } | null;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Capacity: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
5
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
6
6
  export default Capacity;
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const CardMask: ({ props }: {
5
5
  props: SkuStatusOverlayConfig;
6
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
6
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
7
7
  export default CardMask;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const Countdown: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
6
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
7
7
  export default Countdown;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Duration: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
5
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
6
6
  export default Duration;
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
3
3
  import './index.less';
4
4
  declare const MemberPrice: ({ props }: {
5
5
  props: ProductCardConfig;
6
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
6
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
7
7
  export default MemberPrice;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Resource: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
5
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
6
6
  export default Resource;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Stock: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
5
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
6
6
  export default Stock;
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ProductCardConfig } from '../../type';
3
3
  declare const Time: ({ props }: {
4
4
  props: ProductCardConfig;
5
- }) => string | number | true | JSX.Element | React.ReactFragment | null;
5
+ }) => string | number | true | React.ReactFragment | JSX.Element | null;
6
6
  export default Time;
@@ -5,13 +5,13 @@ export declare const mergeData: (locales: any, props: SaasLoginProps) => {
5
5
  width?: number | undefined;
6
6
  height?: number | undefined;
7
7
  };
8
- logoPosition: "center" | "left" | "right";
8
+ logoPosition: "left" | "right" | "center";
9
9
  welcomeMessage: any;
10
- welcomeMessageAlign: "center" | "left" | "right";
10
+ welcomeMessageAlign: "left" | "right" | "center";
11
11
  title: any;
12
- titleAlign: "center" | "left" | "right";
12
+ titleAlign: "left" | "right" | "center";
13
13
  subtitle: any;
14
- subtitleAlign: "center" | "left" | "right";
14
+ subtitleAlign: "left" | "right" | "center";
15
15
  emailLabel: any;
16
16
  emailPlaceholder: any;
17
17
  passwordLabel: any;
@@ -19,7 +19,7 @@ export declare const mergeData: (locales: any, props: SaasLoginProps) => {
19
19
  buttonText: any;
20
20
  registerText: any;
21
21
  registerLinkText: any;
22
- registerAlign: "center" | "left" | "right";
22
+ registerAlign: "left" | "right" | "center";
23
23
  showLogo?: boolean | undefined;
24
24
  showWelcomeMessage?: boolean | undefined;
25
25
  showTitle?: boolean | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const OptionItemCard: (props: any) => JSX.Element;
4
3
  export default OptionItemCard;
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * 单规格商品卡片,点击后需要拉起弹窗展示具体的规格信息
3
3
  */
4
- /// <reference types="react" />
5
4
  import { RenderItemProps } from '../../../../pro/Selector/types';
6
5
  import './index.less';
7
6
  declare const OptionsCard: (props: RenderItemProps & {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface OptionsModalProps {
3
2
  parentDataSource: any;
4
3
  dataSource: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const VariantCard: (props: any) => JSX.Element;
4
3
  export default VariantCard;
@@ -69,6 +69,11 @@ export var transformBundleGroup = function transformBundleGroup(bundleGroup) {
69
69
  },
70
70
  stepperProps: {
71
71
  horizontalPadding: '8px'
72
+ },
73
+ layout: {
74
+ type: 'antdGrid',
75
+ columns: 2,
76
+ gutter: [16, 16]
72
77
  }
73
78
  };
74
79
 
@@ -184,6 +184,7 @@ var createBundleValue = function createBundleValue(v, dataSource) {
184
184
  });
185
185
  _createdValue.data._data = _data;
186
186
  }
187
+ _createdValue.data.num = (v1 === null || v1 === void 0 ? void 0 : v1.num) || 1;
187
188
  _createdValue.quantity = (_createdValue.quantity || 0) + ((v1 === null || v1 === void 0 ? void 0 : v1.quantity) || 0);
188
189
  var _pricePrefix = ((_findedBundleItem2 = findedBundleItem) === null || _findedBundleItem2 === void 0 ? void 0 : _findedBundleItem2.price_type) === 'markdown' ? -1 : 1;
189
190
  _createdValue.totalPrice = new Decimal(_createdValue.totalPrice || 0).plus(new Decimal((v1 === null || v1 === void 0 ? void 0 : v1.price) || 0).times((v1 === null || v1 === void 0 ? void 0 : v1.quantity) || 1).times(_pricePrefix)).toNumber();
@@ -3,6 +3,6 @@ export interface ImageUploadProps {
3
3
  value?: string;
4
4
  onChange?: (val: string) => void;
5
5
  }
6
- export declare const getBaseTime: (size: number) => 1000 | 2000 | 4000 | 8000;
6
+ export declare const getBaseTime: (size: number) => 2000 | 1000 | 4000 | 8000;
7
7
  declare const ImageUpload: React.FC<ImageUploadProps>;
8
8
  export default ImageUpload;
@@ -7,6 +7,12 @@ declare global {
7
7
  }
8
8
  }
9
9
  }
10
+ /**
11
+ * 样式变体类型
12
+ * - separated: 分离式,按钮独立显示(默认)
13
+ * - capsule: 胶囊式,按钮和数字在一个圆角容器内
14
+ */
15
+ export declare type NumericStepperVariant = 'separated' | 'capsule';
10
16
  export interface NumericStepperProps {
11
17
  /** 当前值 */
12
18
  value?: number;
@@ -31,12 +37,26 @@ export interface NumericStepperProps {
31
37
  horizontalPadding?: number | string;
32
38
  /** 尺寸 */
33
39
  size?: 'small' | 'middle' | 'large';
34
- /** 按钮形状 */
40
+ /** 按钮形状(仅在 variant='separated' 时生效) */
35
41
  shape?: 'round' | 'square';
36
42
  /** 减号按钮的自定义内容 */
37
43
  minusIcon?: React.ReactNode;
38
44
  /** 加号按钮的自定义内容 */
39
45
  plusIcon?: React.ReactNode;
46
+ /**
47
+ * 样式变体
48
+ * - separated: 分离式,按钮独立显示(默认)
49
+ * - capsule: 胶囊式,按钮和数字在一个圆角容器内
50
+ * @default 'separated'
51
+ */
52
+ variant?: NumericStepperVariant;
53
+ /**
54
+ * 是否启用输入功能(点击数字弹出键盘)
55
+ * - 开启时:展示区域 cursor 为 pointer,点击弹出键盘
56
+ * - 关闭后:展示区域无边框,点击不会弹出键盘
57
+ * @default true
58
+ */
59
+ enableInput?: boolean;
40
60
  }
41
61
  declare const NumericStepper: React.FC<NumericStepperProps>;
42
62
  export default NumericStepper;
@@ -1,3 +1,7 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ 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; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
5
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
6
  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."); }
3
7
  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); }
@@ -7,10 +11,16 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
11
  import * as React from 'react';
8
12
  import { useMemo, useState, useCallback, useEffect } from 'react';
9
13
  import classNames from 'classnames';
10
- import { Popover, PisellModal } from '@pisell/materials';
11
14
  import { isMobile } from '@pisell/utils';
12
- import NumberKeyboard from "../numberKeyboard";
15
+ import { NumberKeyboard } from "../keyboards";
13
16
  import "./index.less";
17
+
18
+ /**
19
+ * 样式变体类型
20
+ * - separated: 分离式,按钮独立显示(默认)
21
+ * - capsule: 胶囊式,按钮和数字在一个圆角容器内
22
+ */
23
+
14
24
  var NumericStepper = function NumericStepper(_ref) {
15
25
  var value = _ref.value,
16
26
  _ref$defaultValue = _ref.defaultValue,
@@ -33,7 +43,11 @@ var NumericStepper = function NumericStepper(_ref) {
33
43
  minusIcon = _ref.minusIcon,
34
44
  plusIcon = _ref.plusIcon,
35
45
  _ref$horizontalPaddin = _ref.horizontalPadding,
36
- horizontalPadding = _ref$horizontalPaddin === void 0 ? 0 : _ref$horizontalPaddin;
46
+ horizontalPadding = _ref$horizontalPaddin === void 0 ? 0 : _ref$horizontalPaddin,
47
+ _ref$variant = _ref.variant,
48
+ variant = _ref$variant === void 0 ? 'separated' : _ref$variant,
49
+ _ref$enableInput = _ref.enableInput,
50
+ enableInput = _ref$enableInput === void 0 ? true : _ref$enableInput;
37
51
  var _useState = useState(false),
38
52
  _useState2 = _slicedToArray(_useState, 2),
39
53
  open = _useState2[0],
@@ -116,7 +130,8 @@ var NumericStepper = function NumericStepper(_ref) {
116
130
 
117
131
  // 点击数字的处理
118
132
  var handleNumberClick = function handleNumberClick() {
119
- if (disabled) return;
133
+ // 禁用或关闭输入功能时不响应点击
134
+ if (disabled || !enableInput) return;
120
135
  // Popover 会自动处理打开,我们只需要设置初始值
121
136
  setTempValue(currentValue.toString()); // 设置临时值为当前值
122
137
  if (_isMobile) {
@@ -147,12 +162,7 @@ var NumericStepper = function NumericStepper(_ref) {
147
162
  var isIncreaseDisabled = disabled || currentValue >= max;
148
163
  var isPlusOnly = currentValue === 0 || currentValue === undefined;
149
164
  var outOfRange = currentValue < min || currentValue > max;
150
- var stepperClasses = classNames('numeric-stepper', "numeric-stepper-".concat(size), "numeric-stepper-".concat(shape), {
151
- 'numeric-stepper-disabled': disabled,
152
- 'numeric-stepper-simple': currentValue === 0 || currentValue === undefined,
153
- 'numeric-stepper-out-of-range': outOfRange,
154
- 'numeric-stepper-plus-only': isPlusOnly
155
- }, className);
165
+ var stepperClasses = classNames('numeric-stepper', "numeric-stepper-".concat(size), "numeric-stepper-".concat(variant), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "numeric-stepper-".concat(shape), variant === 'separated'), 'numeric-stepper-disabled', disabled), 'numeric-stepper-simple', currentValue === 0 || currentValue === undefined), 'numeric-stepper-out-of-range', outOfRange), 'numeric-stepper-plus-only', isPlusOnly), 'numeric-stepper-input-disabled', !enableInput), className);
156
166
  var _minus = !isPlusOnly && /*#__PURE__*/React.createElement("div", {
157
167
  className: "numeric-stepper-button-wrapper numeric-stepper-minus-button-wrapper",
158
168
  onClick: handleDecrease,
@@ -180,46 +190,49 @@ var NumericStepper = function NumericStepper(_ref) {
180
190
  if (isPlusOnly) {
181
191
  return null;
182
192
  }
183
- if (_isMobile) {
184
- return /*#__PURE__*/React.createElement("span", {
185
- className: "numeric-stepper-display-wrapper",
186
- onClick: handleNumberClick
187
- }, /*#__PURE__*/React.createElement("span", {
188
- className: classNames('numeric-stepper-display')
189
- }, currentValue));
190
- }
191
- return /*#__PURE__*/React.createElement(Popover, {
192
- open: open,
193
- trigger: ['click'] // 恢复点击触发
194
- ,
195
- overlayInnerStyle: {
196
- padding: 0
197
- },
198
- destroyTooltipOnHide: true,
199
- arrow: false,
200
- align: {
201
- offset: [0, 0]
202
- },
203
- overlayClassName: "pisell-number-selector-popover",
204
- onOpenChange: handleOpenChange,
205
- content: /*#__PURE__*/React.createElement(NumberKeyboard, {
206
- max: max,
207
- value: tempValue,
208
- onChange: handleChange,
209
- onOk: function onOk() {
210
- var newValue = parseInt(tempValue) || 0;
211
- var clampedValue = Math.max(min, Math.min(max, newValue));
212
- onChange === null || onChange === void 0 || onChange(clampedValue);
213
- setOpen(false);
214
- }
215
- })
216
- }, /*#__PURE__*/React.createElement("span", {
193
+
194
+ // 纯展示模式(enableInput 为 false)
195
+ var displayElement = /*#__PURE__*/React.createElement("span", {
217
196
  className: "numeric-stepper-display-wrapper",
218
197
  onClick: handleNumberClick
219
198
  }, /*#__PURE__*/React.createElement("span", {
220
199
  className: classNames('numeric-stepper-display')
221
- }, currentValue)));
222
- }, [_isMobile, open, isPlusOnly, currentValue, handleNumberClick, handleOpenChange, handleChange, max, min, onChange, tempValue]);
200
+ }, currentValue));
201
+
202
+ // 关闭输入功能时,只展示数字,不包装键盘
203
+ if (!enableInput) {
204
+ return displayElement;
205
+ }
206
+ if (_isMobile) {
207
+ return displayElement;
208
+ }
209
+ return /*#__PURE__*/React.createElement(NumberKeyboard, {
210
+ max: max,
211
+ min: min,
212
+ originalValue: currentValue.toString(),
213
+ defaultValue: currentValue.toString(),
214
+ onEnter: function onEnter(newValue) {
215
+ handleValueChange === null || handleValueChange === void 0 || handleValueChange(Number(newValue));
216
+ setOpen(false);
217
+ },
218
+ containerProps: {
219
+ className: 'numeric-stepper-keyboard-popover',
220
+ renderType: 'popover',
221
+ open: open,
222
+ onOpenChange: handleOpenChange,
223
+ content: /*#__PURE__*/React.createElement(NumberKeyboard, {
224
+ max: max,
225
+ min: min,
226
+ originalValue: currentValue.toString(),
227
+ defaultValue: currentValue.toString(),
228
+ onEnter: function onEnter(newValue) {
229
+ handleValueChange === null || handleValueChange === void 0 || handleValueChange(Number(newValue));
230
+ setOpen(false);
231
+ }
232
+ })
233
+ }
234
+ }, displayElement);
235
+ }, [_isMobile, open, isPlusOnly, currentValue, handleNumberClick, handleOpenChange, handleChange, max, min, onChange, tempValue, enableInput]);
223
236
  var _plus = /*#__PURE__*/React.createElement("div", {
224
237
  className: "numeric-stepper-button-wrapper numeric-stepper-plus-button-wrapper",
225
238
  onClick: handleIncrease,
@@ -250,28 +263,23 @@ var NumericStepper = function NumericStepper(_ref) {
250
263
  onClick: function onClick(e) {
251
264
  return e.stopPropagation();
252
265
  }
253
- }, _minus, _display, _plus, _isMobile && open && /*#__PURE__*/React.createElement(PisellModal, {
254
- open: true,
255
- platform: 'pc',
256
- width: "unset",
257
- header: null,
258
- footer: false,
259
- maskClosable: true,
260
- closeIcon: null,
261
- className: "numeric-stepper-keyboard-modal",
262
- onCancel: function onCancel() {
263
- return setOpen(false);
264
- }
265
- }, /*#__PURE__*/React.createElement(NumberKeyboard, {
266
+ }, _minus, _display, _plus, _isMobile && /*#__PURE__*/React.createElement(NumberKeyboard, {
267
+ containerProps: {
268
+ className: 'numeric-stepper-keyboard-modal',
269
+ renderType: 'modal',
270
+ open: open,
271
+ onCancel: function onCancel() {
272
+ setOpen(false);
273
+ }
274
+ },
266
275
  max: max,
267
- value: tempValue,
268
- onChange: handleChange,
269
- onOk: function onOk() {
270
- var newValue = parseInt(tempValue) || 0;
271
- var clampedValue = Math.max(min, Math.min(max, newValue));
272
- onChange === null || onChange === void 0 || onChange(clampedValue);
276
+ min: min,
277
+ defaultValue: currentValue.toString(),
278
+ originalValue: currentValue.toString(),
279
+ onEnter: function onEnter(newValue) {
280
+ handleValueChange === null || handleValueChange === void 0 || handleValueChange(Number(newValue));
273
281
  setOpen(false);
274
282
  }
275
- })));
283
+ }));
276
284
  };
277
285
  export default NumericStepper;