@pisell/private-materials 6.6.59 → 6.6.61
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 +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/components/footer/utils.js +79 -75
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
- package/es/components/pisellCashCounting/PisellCashCounting.js +121 -0
- package/es/components/pisellCashCounting/PisellCashCounting.less +263 -0
- package/es/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
- package/es/components/pisellCashCounting/components/CashCountingModal/index.js +250 -0
- package/es/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
- package/es/components/pisellCashCounting/hooks.d.ts +21 -0
- package/es/components/pisellCashCounting/hooks.js +193 -0
- package/es/components/pisellCashCounting/index.d.ts +2 -0
- package/es/components/pisellCashCounting/index.js +1 -0
- package/es/components/pisellCashCounting/locales.d.ts +118 -0
- package/es/components/pisellCashCounting/locales.js +117 -0
- package/es/components/pisellCashCounting/types.d.ts +85 -0
- package/es/components/pisellCashCounting/types.js +1 -0
- package/es/components/pisellCashCounting/utils.d.ts +10 -0
- package/es/components/pisellCashCounting/utils.js +40 -0
- package/es/hooks/useResponsive.d.ts +8 -0
- package/es/hooks/useResponsive.js +43 -0
- package/es/hooks/useThemeTokens.d.ts +7 -0
- package/es/hooks/useThemeTokens.js +20 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/pro/NumericStepper/index.d.ts +75 -0
- package/es/pro/NumericStepper/index.js +301 -0
- package/es/pro/NumericStepper/index.less +364 -0
- package/es/pro/keyboards/index.d.ts +2 -0
- package/es/pro/keyboards/index.js +1 -0
- package/es/pro/keyboards/locales.d.ts +38 -0
- package/es/pro/keyboards/locales.js +57 -0
- package/es/pro/keyboards/numberKeyboard/index.d.ts +16 -0
- package/es/pro/keyboards/numberKeyboard/index.js +523 -0
- package/es/pro/keyboards/numberKeyboard/index.less +59 -0
- package/es/pro/keyboards/numberKeyboard/types.d.ts +63 -0
- package/es/pro/keyboards/numberKeyboard/types.js +1 -0
- package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
- package/es/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
- package/lib/components/booking/components/footer/utils.js +6 -3
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/pisellCashCounting/PisellCashCounting.d.ts +5 -0
- package/lib/components/pisellCashCounting/PisellCashCounting.js +168 -0
- package/lib/components/pisellCashCounting/PisellCashCounting.less +263 -0
- package/lib/components/pisellCashCounting/components/CashCountingModal/index.d.ts +20 -0
- package/lib/components/pisellCashCounting/components/CashCountingModal/index.js +171 -0
- package/lib/components/pisellCashCounting/components/CashCountingModal/index.less +279 -0
- package/lib/components/pisellCashCounting/hooks.d.ts +21 -0
- package/lib/components/pisellCashCounting/hooks.js +189 -0
- package/lib/components/pisellCashCounting/index.d.ts +2 -0
- package/lib/components/pisellCashCounting/index.js +35 -0
- package/lib/components/pisellCashCounting/locales.d.ts +118 -0
- package/lib/components/pisellCashCounting/locales.js +141 -0
- package/lib/components/pisellCashCounting/types.d.ts +85 -0
- package/lib/components/pisellCashCounting/types.js +17 -0
- package/lib/components/pisellCashCounting/utils.d.ts +10 -0
- package/lib/components/pisellCashCounting/utils.js +59 -0
- package/lib/hooks/useResponsive.d.ts +8 -0
- package/lib/hooks/useResponsive.js +48 -0
- package/lib/hooks/useThemeTokens.d.ts +7 -0
- package/lib/hooks/useThemeTokens.js +40 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/pro/NumericStepper/index.d.ts +75 -0
- package/lib/pro/NumericStepper/index.js +338 -0
- package/lib/pro/NumericStepper/index.less +364 -0
- package/lib/pro/keyboards/index.d.ts +2 -0
- package/lib/pro/keyboards/index.js +39 -0
- package/lib/pro/keyboards/locales.d.ts +38 -0
- package/lib/pro/keyboards/locales.js +61 -0
- package/lib/pro/keyboards/numberKeyboard/index.d.ts +16 -0
- package/lib/pro/keyboards/numberKeyboard/index.js +400 -0
- package/lib/pro/keyboards/numberKeyboard/index.less +59 -0
- package/lib/pro/keyboards/numberKeyboard/types.d.ts +63 -0
- package/lib/pro/keyboards/numberKeyboard/types.js +17 -0
- package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.js +3 -1
- package/lib/pro/pisellPriceKeyboardModal/types.d.ts +2 -0
- package/lowcode/pisell-cash-counting/meta.ts +167 -0
- package/lowcode/pisell-cash-counting/snippets.ts +13 -0
- package/package.json +4 -4
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
en: {
|
|
3
|
+
'pisell-cash-counting.countCash': 'Count cash',
|
|
4
|
+
'pisell-cash-counting.subtitle': 'Enter the quantity for each denomination. The total will be calculated automatically.',
|
|
5
|
+
'pisell-cash-counting.currency': 'Currency',
|
|
6
|
+
'pisell-cash-counting.bills': 'Bills',
|
|
7
|
+
'pisell-cash-counting.coins': 'Coins',
|
|
8
|
+
'pisell-cash-counting.billsSubtotal': 'Bills subtotal',
|
|
9
|
+
'pisell-cash-counting.coinsSubtotal': 'Coins subtotal',
|
|
10
|
+
'pisell-cash-counting.subtotal': 'Subtotal',
|
|
11
|
+
'pisell-cash-counting.total': 'Total',
|
|
12
|
+
'pisell-cash-counting.clearAll': 'Clear all',
|
|
13
|
+
'pisell-cash-counting.cancel': 'Cancel',
|
|
14
|
+
'pisell-cash-counting.confirm': 'Confirm',
|
|
15
|
+
'pisell-cash-counting.placeholder': 'Please enter',
|
|
16
|
+
'pisell-cash-counting.empty': 'No denomination config for this currency.',
|
|
17
|
+
'pisell-cash-counting.no-country-config': 'No denomination data is configured for this region. Please contact your system administrator.',
|
|
18
|
+
'pisell-cash-counting.manual-vs-count-message-title': 'Tip',
|
|
19
|
+
'pisell-cash-counting.manual-vs-count-message': 'The actual amount was edited manually and no longer matches the cash count details.',
|
|
20
|
+
'pisell-cash-counting.use-count-total': 'Use counted total',
|
|
21
|
+
'pisell-cash-counting.keep-manual-amount': 'Keep manual amount',
|
|
22
|
+
'pisell2.customise-item.save': 'Save',
|
|
23
|
+
'pisell2.booking.info.text.clear': 'Clear'
|
|
24
|
+
},
|
|
25
|
+
'zh-CN': {
|
|
26
|
+
'pisell-cash-counting.countCash': '数钱',
|
|
27
|
+
'pisell-cash-counting.subtitle': '请输入每个面额的数量,系统将自动计算现金总额。',
|
|
28
|
+
'pisell-cash-counting.currency': '币种',
|
|
29
|
+
'pisell-cash-counting.bills': '纸币',
|
|
30
|
+
'pisell-cash-counting.coins': '硬币',
|
|
31
|
+
'pisell-cash-counting.billsSubtotal': '纸币小计',
|
|
32
|
+
'pisell-cash-counting.coinsSubtotal': '硬币小计',
|
|
33
|
+
'pisell-cash-counting.subtotal': '小计',
|
|
34
|
+
'pisell-cash-counting.total': '合计',
|
|
35
|
+
'pisell-cash-counting.clearAll': '清空',
|
|
36
|
+
'pisell-cash-counting.cancel': '取消',
|
|
37
|
+
'pisell-cash-counting.confirm': '确认',
|
|
38
|
+
'pisell-cash-counting.placeholder': '请输入',
|
|
39
|
+
'pisell-cash-counting.empty': '当前币种暂无面额配置。',
|
|
40
|
+
'pisell-cash-counting.no-country-config': '该国家未配置数据,请联系系统人员',
|
|
41
|
+
'pisell-cash-counting.manual-vs-count-message-title': '提示',
|
|
42
|
+
'pisell-cash-counting.manual-vs-count-message': '实际金额已被手动修改,当前金额与数钱明细不一致。',
|
|
43
|
+
'pisell-cash-counting.use-count-total': '使用数钱金额',
|
|
44
|
+
'pisell-cash-counting.keep-manual-amount': '保留手动金额',
|
|
45
|
+
'pisell2.customise-item.save': '保存',
|
|
46
|
+
'pisell2.booking.info.text.clear': '清空'
|
|
47
|
+
},
|
|
48
|
+
'zh-HK': {
|
|
49
|
+
'pisell-cash-counting.countCash': '數錢',
|
|
50
|
+
'pisell-cash-counting.subtitle': '請輸入每個面額的數量,系統會自動計算現金總額。',
|
|
51
|
+
'pisell-cash-counting.currency': '幣種',
|
|
52
|
+
'pisell-cash-counting.bills': '紙幣',
|
|
53
|
+
'pisell-cash-counting.coins': '硬幣',
|
|
54
|
+
'pisell-cash-counting.billsSubtotal': '紙幣小計',
|
|
55
|
+
'pisell-cash-counting.coinsSubtotal': '硬幣小計',
|
|
56
|
+
'pisell-cash-counting.subtotal': '小計',
|
|
57
|
+
'pisell-cash-counting.total': '合計',
|
|
58
|
+
'pisell-cash-counting.clearAll': '清空',
|
|
59
|
+
'pisell-cash-counting.cancel': '取消',
|
|
60
|
+
'pisell-cash-counting.confirm': '確認',
|
|
61
|
+
'pisell-cash-counting.placeholder': '請輸入',
|
|
62
|
+
'pisell-cash-counting.empty': '目前幣種暫無面額配置。',
|
|
63
|
+
'pisell-cash-counting.no-country-config': '該國家未配置數據,請聯繫系統人員',
|
|
64
|
+
'pisell-cash-counting.manual-vs-count-message-title': '提示',
|
|
65
|
+
'pisell-cash-counting.manual-vs-count-message': '實際金額已被手動修改,當前金額與數錢明細不一致。',
|
|
66
|
+
'pisell-cash-counting.use-count-total': '使用數錢金額',
|
|
67
|
+
'pisell-cash-counting.keep-manual-amount': '保留手動金額',
|
|
68
|
+
'pisell2.customise-item.save': '保存',
|
|
69
|
+
'pisell2.booking.info.text.clear': '清空'
|
|
70
|
+
},
|
|
71
|
+
ja: {
|
|
72
|
+
'pisell-cash-counting.countCash': '現金を数える',
|
|
73
|
+
'pisell-cash-counting.subtitle': '各金種の数量を入力すると、合計金額が自動計算されます。',
|
|
74
|
+
'pisell-cash-counting.currency': '通貨',
|
|
75
|
+
'pisell-cash-counting.bills': '紙幣',
|
|
76
|
+
'pisell-cash-counting.coins': '硬貨',
|
|
77
|
+
'pisell-cash-counting.billsSubtotal': '紙幣小計',
|
|
78
|
+
'pisell-cash-counting.coinsSubtotal': '硬貨小計',
|
|
79
|
+
'pisell-cash-counting.subtotal': '小計',
|
|
80
|
+
'pisell-cash-counting.total': '合計',
|
|
81
|
+
'pisell-cash-counting.clearAll': 'クリア',
|
|
82
|
+
'pisell-cash-counting.cancel': 'キャンセル',
|
|
83
|
+
'pisell-cash-counting.confirm': '確認',
|
|
84
|
+
'pisell-cash-counting.placeholder': '入力してください',
|
|
85
|
+
'pisell-cash-counting.empty': 'この通貨の金種設定がありません。',
|
|
86
|
+
'pisell-cash-counting.no-country-config': 'この国・地域の金種データが設定されていません。システム管理者にお問い合わせください。',
|
|
87
|
+
'pisell-cash-counting.manual-vs-count-message-title': 'ヒント',
|
|
88
|
+
'pisell-cash-counting.manual-vs-count-message': '実際の金額が手入力で変更され、現在の金額が現金集計の内訳と一致しません。',
|
|
89
|
+
'pisell-cash-counting.use-count-total': '集計金額を使う',
|
|
90
|
+
'pisell-cash-counting.keep-manual-amount': '手入力の金額を残す',
|
|
91
|
+
'pisell2.customise-item.save': '保存',
|
|
92
|
+
'pisell2.booking.info.text.clear': '清空'
|
|
93
|
+
},
|
|
94
|
+
pt: {
|
|
95
|
+
'pisell-cash-counting.countCash': 'Contar dinheiro',
|
|
96
|
+
'pisell-cash-counting.subtitle': 'Insira a quantidade de cada denominação. O total será calculado automaticamente.',
|
|
97
|
+
'pisell-cash-counting.currency': 'Moeda',
|
|
98
|
+
'pisell-cash-counting.bills': 'Notas',
|
|
99
|
+
'pisell-cash-counting.coins': 'Moedas',
|
|
100
|
+
'pisell-cash-counting.billsSubtotal': 'Subtotal de notas',
|
|
101
|
+
'pisell-cash-counting.coinsSubtotal': 'Subtotal de moedas',
|
|
102
|
+
'pisell-cash-counting.subtotal': 'Subtotal',
|
|
103
|
+
'pisell-cash-counting.total': 'Total',
|
|
104
|
+
'pisell-cash-counting.clearAll': 'Limpar',
|
|
105
|
+
'pisell-cash-counting.cancel': 'Cancelar',
|
|
106
|
+
'pisell-cash-counting.confirm': 'Confirmar',
|
|
107
|
+
'pisell-cash-counting.placeholder': 'Insira',
|
|
108
|
+
'pisell-cash-counting.empty': 'Nenhuma configuração de denominação para esta moeda.',
|
|
109
|
+
'pisell-cash-counting.no-country-config': 'Não há dados de denominação configurados para esta região. Contacte o administrador do sistema.',
|
|
110
|
+
'pisell-cash-counting.manual-vs-count-message-title': 'Dica',
|
|
111
|
+
'pisell-cash-counting.manual-vs-count-message': 'O valor real foi editado manualmente e já não coincide com os detalhes da contagem de numerário.',
|
|
112
|
+
'pisell-cash-counting.use-count-total': 'Usar total contado',
|
|
113
|
+
'pisell-cash-counting.keep-manual-amount': 'Manter valor manual',
|
|
114
|
+
'pisell2.customise-item.save': 'Salvar',
|
|
115
|
+
'pisell2.booking.info.text.clear': 'Limpar'
|
|
116
|
+
}
|
|
117
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps, InputNumberProps } from 'antd';
|
|
3
|
+
export declare type CashDenominationType = 'bill' | 'coin';
|
|
4
|
+
/** 金额输入与数钱按钮的排列:`vertical` 上下,`horizontal` 左右 */
|
|
5
|
+
export declare type PisellCashCountingLayout = 'vertical' | 'horizontal';
|
|
6
|
+
export interface CurrencyDenominationConfig {
|
|
7
|
+
/** 币种编码,例如 AUD、JPY、USD */
|
|
8
|
+
currency_code: string;
|
|
9
|
+
/** 面额数值 */
|
|
10
|
+
denomination_value: number;
|
|
11
|
+
/** 展示文案,例如 $100、¥10,000、50¢ */
|
|
12
|
+
denomination_label: string;
|
|
13
|
+
/** 面额类型:纸币或硬币 */
|
|
14
|
+
denomination_type: CashDenominationType;
|
|
15
|
+
/** 展示顺序 */
|
|
16
|
+
sort_order: number;
|
|
17
|
+
/** 金额小数位,JPY 为 0,AUD 为 2 */
|
|
18
|
+
decimal_places: number;
|
|
19
|
+
/** 是否启用 */
|
|
20
|
+
is_enabled: boolean;
|
|
21
|
+
/** 国家/地区,可选扩展字段 */
|
|
22
|
+
country_region?: string;
|
|
23
|
+
/** 当前是否生效,可选扩展字段 */
|
|
24
|
+
effective_status?: boolean | 'active' | 'inactive';
|
|
25
|
+
}
|
|
26
|
+
export interface CashCountingDetail {
|
|
27
|
+
denomination: CurrencyDenominationConfig;
|
|
28
|
+
quantity: number;
|
|
29
|
+
amount: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CashCountingConfirmPayload {
|
|
32
|
+
amount: number | string;
|
|
33
|
+
currencyCode: string;
|
|
34
|
+
decimalPlaces: number;
|
|
35
|
+
billSubtotal: number | string;
|
|
36
|
+
coinSubtotal: number | string;
|
|
37
|
+
details: CashCountingDetail[];
|
|
38
|
+
quantities: Record<string, number>;
|
|
39
|
+
}
|
|
40
|
+
export interface PisellCashCountingProps {
|
|
41
|
+
/** 当前金额,受控模式 */
|
|
42
|
+
value?: number;
|
|
43
|
+
/** 默认金额,非受控模式 */
|
|
44
|
+
defaultValue?: number | string;
|
|
45
|
+
/** 币种编码 */
|
|
46
|
+
currencyCode?: string;
|
|
47
|
+
/** 货币符号,不传时按币种默认推断 */
|
|
48
|
+
currencySymbol?: string;
|
|
49
|
+
/** 金额小数位,不传时按面额配置推断 */
|
|
50
|
+
amountPrecision?: number;
|
|
51
|
+
/** 可扩展的币种面额 JSON 配置 */
|
|
52
|
+
denominations?: CurrencyDenominationConfig[];
|
|
53
|
+
/** 禁用整体输入 */
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
/** 禁用数钱按钮 */
|
|
56
|
+
countDisabled?: boolean;
|
|
57
|
+
/** 金额输入占位 */
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
/** 输入框与数钱按钮的布局,默认上下排列 */
|
|
60
|
+
layout?: PisellCashCountingLayout;
|
|
61
|
+
/** 数钱按钮文案 */
|
|
62
|
+
countCashButtonText?: React.ReactNode;
|
|
63
|
+
/** 弹窗宽度 */
|
|
64
|
+
modalWidth?: number | string;
|
|
65
|
+
/** 价格键盘是否显示货币符号 */
|
|
66
|
+
showCurrencySymbol?: boolean;
|
|
67
|
+
/** 价格键盘是否使用千分位 */
|
|
68
|
+
useThousandsSeparator?: boolean;
|
|
69
|
+
/** 输入框透传属性 */
|
|
70
|
+
inputNumberProps?: Omit<InputNumberProps, 'value' | 'defaultValue' | 'onChange'>;
|
|
71
|
+
/** 数钱按钮透传属性 */
|
|
72
|
+
buttonProps?: ButtonProps;
|
|
73
|
+
/** 自定义类名 */
|
|
74
|
+
className?: string;
|
|
75
|
+
/** 自定义样式 */
|
|
76
|
+
style?: React.CSSProperties;
|
|
77
|
+
/** 金额变化 */
|
|
78
|
+
onChange?: (value: number | string, meta?: {
|
|
79
|
+
source: 'manual' | 'count';
|
|
80
|
+
}) => void;
|
|
81
|
+
/** 点钞确认 */
|
|
82
|
+
onCountConfirm?: (payload: CashCountingConfirmPayload) => void;
|
|
83
|
+
/** 取消点钞 */
|
|
84
|
+
onCountCancel?: () => void;
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CurrencyDenominationConfig } from './types';
|
|
2
|
+
/** 面额配置唯一键,用于数量映射 */
|
|
3
|
+
export declare const getDenominationId: (item: CurrencyDenominationConfig) => string;
|
|
4
|
+
/** 按小数位规范化金额,避免浮点误差 */
|
|
5
|
+
export declare const normalizeAmount: (value: string | number | null | undefined, precision: number) => number;
|
|
6
|
+
/** 业务规则:是否可作为有效面额参与点钞 */
|
|
7
|
+
export declare const isEffectiveDenomination: (item: CurrencyDenominationConfig) => boolean;
|
|
8
|
+
/** 当前币种下已启用且排序后的面额列表 */
|
|
9
|
+
export declare const getEffectiveDenominationsForCurrency: (denominations: CurrencyDenominationConfig[], currencyCode: string) => CurrencyDenominationConfig[];
|
|
10
|
+
export declare const buildEmptyQuantities: (items: CurrencyDenominationConfig[]) => Record<string, number>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** 面额配置唯一键,用于数量映射 */
|
|
2
|
+
export var getDenominationId = function getDenominationId(item) {
|
|
3
|
+
return "".concat(item.currency_code, "-").concat(item.denomination_type, "-").concat(item.denomination_value);
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
/** 按小数位规范化金额,避免浮点误差 */
|
|
7
|
+
export var normalizeAmount = function normalizeAmount(value, precision) {
|
|
8
|
+
var numberValue = Number(String(value !== null && value !== void 0 ? value : 0).replace(/,/g, ''));
|
|
9
|
+
if (!Number.isFinite(numberValue)) {
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
var factor = Math.pow(10, precision);
|
|
13
|
+
return Math.round(numberValue * factor) / factor;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** 业务规则:是否可作为有效面额参与点钞 */
|
|
17
|
+
export var isEffectiveDenomination = function isEffectiveDenomination(item) {
|
|
18
|
+
if (item.is_enabled === false) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (item.effective_status === false || item.effective_status === 'inactive') {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** 当前币种下已启用且排序后的面额列表 */
|
|
28
|
+
export var getEffectiveDenominationsForCurrency = function getEffectiveDenominationsForCurrency(denominations, currencyCode) {
|
|
29
|
+
return denominations.filter(function (item) {
|
|
30
|
+
return item.currency_code === currencyCode && isEffectiveDenomination(item);
|
|
31
|
+
}).sort(function (a, b) {
|
|
32
|
+
return a.sort_order - b.sort_order;
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export var buildEmptyQuantities = function buildEmptyQuantities(items) {
|
|
36
|
+
return items.reduce(function (acc, item) {
|
|
37
|
+
acc[getDenominationId(item)] = 0;
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 响应式监听 Hook
|
|
11
|
+
* 监听窗口大小变化,返回当前是否为移动端
|
|
12
|
+
*
|
|
13
|
+
* @param breakpoint - 断点宽度(默认 768px)
|
|
14
|
+
* @returns 是否为移动端
|
|
15
|
+
*/
|
|
16
|
+
export function useResponsive() {
|
|
17
|
+
var breakpoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 768;
|
|
18
|
+
var _useState = useState(typeof window !== 'undefined' ? window.innerWidth < breakpoint : false),
|
|
19
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
+
isMobile = _useState2[0],
|
|
21
|
+
setIsMobile = _useState2[1];
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
// 服务端渲染时不执行
|
|
24
|
+
if (typeof window === 'undefined') {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
var handleResize = function handleResize() {
|
|
28
|
+
setIsMobile(window.innerWidth < breakpoint);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// 添加监听器
|
|
32
|
+
window.addEventListener('resize', handleResize);
|
|
33
|
+
|
|
34
|
+
// 初始化检查
|
|
35
|
+
handleResize();
|
|
36
|
+
|
|
37
|
+
// 清理监听器
|
|
38
|
+
return function () {
|
|
39
|
+
window.removeEventListener('resize', handleResize);
|
|
40
|
+
};
|
|
41
|
+
}, [breakpoint]);
|
|
42
|
+
return isMobile;
|
|
43
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { theme } from 'antd';
|
|
2
|
+
var themeTokenCache = new Map();
|
|
3
|
+
var useThemeTokens = function useThemeTokens(themeInput) {
|
|
4
|
+
var _themeInput$token;
|
|
5
|
+
var useToken = theme.useToken,
|
|
6
|
+
getDesignToken = theme.getDesignToken;
|
|
7
|
+
var _useToken = useToken(),
|
|
8
|
+
antdToken = _useToken.token;
|
|
9
|
+
var overrideColorPrimary = (themeInput === null || themeInput === void 0 || (_themeInput$token = themeInput.token) === null || _themeInput$token === void 0 ? void 0 : _themeInput$token.colorPrimary) || antdToken.colorPrimary;
|
|
10
|
+
var cached = themeTokenCache.get(overrideColorPrimary);
|
|
11
|
+
if (cached) return cached;
|
|
12
|
+
var computed = getDesignToken({
|
|
13
|
+
token: {
|
|
14
|
+
colorPrimary: overrideColorPrimary
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
themeTokenCache.set(overrideColorPrimary, computed);
|
|
18
|
+
return computed;
|
|
19
|
+
};
|
|
20
|
+
export default useThemeTokens;
|
package/es/index.d.ts
CHANGED
|
@@ -77,3 +77,4 @@ export { default as SaasRole } from './plus/saasRole';
|
|
|
77
77
|
export { default as SaasTeamMembers } from './plus/saasTeamMembers';
|
|
78
78
|
export type { SaasTeamMembersProps } from './plus/saasTeamMembers/type';
|
|
79
79
|
export { default as SaasAttendance } from './plus/saasAttendance';
|
|
80
|
+
export { default as PisellCashCounting } from './components/pisellCashCounting';
|
package/es/index.js
CHANGED
|
@@ -78,4 +78,5 @@ export { default as HolderList } from "./plus/selectHolder/components/HolderList
|
|
|
78
78
|
export { default as SettingsRegistry } from "./components/systemSettings/registry";
|
|
79
79
|
export { default as SaasRole } from "./plus/saasRole";
|
|
80
80
|
export { default as SaasTeamMembers } from "./plus/saasTeamMembers";
|
|
81
|
-
export { default as SaasAttendance } from "./plus/saasAttendance";
|
|
81
|
+
export { default as SaasAttendance } from "./plus/saasAttendance";
|
|
82
|
+
export { default as PisellCashCounting } from "./components/pisellCashCounting";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
[elemName: string]: any;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 样式变体类型
|
|
12
|
+
* - separated: 分离式,按钮独立显示(默认)
|
|
13
|
+
* - capsule: 胶囊式,按钮和数字在一个圆角容器内
|
|
14
|
+
*/
|
|
15
|
+
export declare type NumericStepperVariant = 'separated' | 'capsule';
|
|
16
|
+
export interface NumericStepperProps {
|
|
17
|
+
/** 当前值 */
|
|
18
|
+
value?: number;
|
|
19
|
+
/** 默认值 */
|
|
20
|
+
defaultValue?: number;
|
|
21
|
+
/** 最小值 */
|
|
22
|
+
min?: number;
|
|
23
|
+
/** 最大值 */
|
|
24
|
+
max?: number;
|
|
25
|
+
/** 步长 */
|
|
26
|
+
step?: number;
|
|
27
|
+
/** 是否禁用 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** 值变化回调 */
|
|
30
|
+
onChange?: (value: number) => void;
|
|
31
|
+
/** 自定义类名 */
|
|
32
|
+
className?: string;
|
|
33
|
+
theme?: {
|
|
34
|
+
token?: {
|
|
35
|
+
colorPrimary?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/** 自定义样式 */
|
|
39
|
+
styles?: {
|
|
40
|
+
container?: React.CSSProperties;
|
|
41
|
+
};
|
|
42
|
+
/** 值为 0 时是否折叠为仅展示加号(隐藏减号与中间数字) */
|
|
43
|
+
plusOnlyAtZero?: boolean;
|
|
44
|
+
horizontalPadding?: number | string;
|
|
45
|
+
/** 尺寸 */
|
|
46
|
+
size?: 'small' | 'middle' | 'large';
|
|
47
|
+
/** 按钮形状(仅在 variant='separated' 时生效) */
|
|
48
|
+
shape?: 'round' | 'square';
|
|
49
|
+
/** 减号按钮的自定义内容 */
|
|
50
|
+
minusIcon?: React.ReactNode;
|
|
51
|
+
/** 加号按钮的自定义内容 */
|
|
52
|
+
plusIcon?: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* 样式变体
|
|
55
|
+
* - separated: 分离式,按钮独立显示(默认)
|
|
56
|
+
* - capsule: 胶囊式,按钮和数字在一个圆角容器内
|
|
57
|
+
* @default 'separated'
|
|
58
|
+
*/
|
|
59
|
+
variant?: NumericStepperVariant;
|
|
60
|
+
/**
|
|
61
|
+
* 是否启用输入功能(点击数字弹出键盘)
|
|
62
|
+
* - 开启时:展示区域 cursor 为 pointer,点击弹出键盘
|
|
63
|
+
* - 关闭后:展示区域无边框,点击不会弹出键盘
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
enableInput?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* 展示区域最大宽度(仅胶囊模式生效)
|
|
69
|
+
* - 设置后:展示区域最大宽度受限,超出部分截断
|
|
70
|
+
* - 不设置:展示区域宽度随内容自适应
|
|
71
|
+
*/
|
|
72
|
+
displayMaxWidth?: number | string;
|
|
73
|
+
}
|
|
74
|
+
declare const NumericStepper: React.FC<NumericStepperProps>;
|
|
75
|
+
export default NumericStepper;
|