@pisell/materials 2.2.13 → 2.2.14
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 +13 -13
- package/build/lowcode/assets-dev.json +4 -4
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +29 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +22 -20
- package/es/components/button/index.d.ts +4 -3
- package/es/components/button/index.js +14 -3
- package/es/components/iconfont/index.d.ts +2 -1
- package/es/components/iconfont/index.js +1 -1
- package/es/components/page/index.css +0 -0
- package/es/components/page/index.d.ts +2 -2
- package/es/components/page/index.js +226 -186
- package/es/components/pisell-config-provider/context.d.ts +20 -0
- package/es/components/pisell-config-provider/context.js +36 -0
- package/es/components/pisell-config-provider/hooks/usePisellConfig.d.ts +5 -0
- package/es/components/pisell-config-provider/hooks/usePisellConfig.js +11 -0
- package/es/components/pisell-config-provider/index.d.ts +12 -0
- package/es/components/pisell-config-provider/index.js +36 -0
- package/es/components/pisellAlert/index.d.ts +22 -0
- package/es/components/pisellAlert/index.js +73 -0
- package/es/components/pisellAlert/index.less +149 -0
- package/es/components/pisellCard/index.d.ts +12 -0
- package/es/components/pisellCard/index.js +16 -0
- package/es/components/pisellCard/index.less +9 -0
- package/es/components/pisellCardList/index.d.ts +43 -0
- package/es/components/pisellCardList/index.js +72 -0
- package/es/components/pisellCardList/index.less +75 -0
- package/es/components/pisellCheckboxGroup/index.d.ts +34 -0
- package/es/components/pisellCheckboxGroup/index.js +173 -0
- package/es/components/pisellCheckboxGroup/index.less +36 -0
- package/es/components/pisellCheckboxGroup/mock.d.ts +4 -0
- package/es/components/pisellCheckboxGroup/mock.js +16 -0
- package/es/components/pisellContainer/components/Portal/index.d.ts +10 -0
- package/es/components/pisellContainer/components/Portal/index.js +7 -0
- package/es/components/pisellContainer/containers.d.ts +1 -0
- package/es/components/pisellContainer/containers.js +8 -0
- package/es/components/pisellContainer/index.d.ts +22 -0
- package/es/components/pisellContainer/index.js +19 -0
- package/es/components/pisellCountdown/index.d.ts +24 -0
- package/es/components/pisellCountdown/index.js +44 -0
- package/es/components/pisellCountdown/utils.d.ts +7 -0
- package/es/components/pisellCountdown/utils.js +50 -0
- package/es/components/pisellDatePicker/datePickerCpt.d.ts +22 -0
- package/es/components/pisellDatePicker/datePickerCpt.js +191 -0
- package/es/components/pisellDatePicker/detePickerCpt.less +22 -0
- package/es/components/pisellDatePicker/index.d.ts +3 -0
- package/es/components/pisellDatePicker/index.js +17 -0
- package/es/components/pisellEmpty/index.d.ts +16 -0
- package/es/components/pisellEmpty/index.js +38 -0
- package/es/components/pisellEmpty/index.less +34 -0
- package/es/components/pisellInformationEntry/Input/index.d.ts +8 -0
- package/es/components/pisellInformationEntry/Input/index.js +50 -0
- package/es/components/pisellInformationEntry/Input/index.less +14 -0
- package/es/components/pisellInformationEntry/Scan/index.d.ts +8 -0
- package/es/components/pisellInformationEntry/Scan/index.js +25 -0
- package/es/components/pisellInformationEntry/Scan/index.less +8 -0
- package/es/components/pisellInformationEntry/constants.d.ts +3 -0
- package/es/components/pisellInformationEntry/constants.js +21 -0
- package/es/components/pisellInformationEntry/index.d.ts +31 -0
- package/es/components/pisellInformationEntry/index.js +188 -0
- package/es/components/pisellInformationEntry/index.less +40 -0
- package/es/components/pisellInformationEntry/utils.d.ts +4 -0
- package/es/components/pisellInformationEntry/utils.js +38 -0
- package/es/components/pisellInput/components/BankCard/cardPng/AMEX.png +0 -0
- package/es/components/pisellInput/components/BankCard/cardPng/Discover.png +0 -0
- package/es/components/pisellInput/components/BankCard/cardPng/JCB.png +0 -0
- package/es/components/pisellInput/components/BankCard/cardPng/MasterCard.png +0 -0
- package/es/components/pisellInput/components/BankCard/cardPng/UnionPay.png +0 -0
- package/es/components/pisellInput/components/BankCard/cardPng/VISA.png +0 -0
- package/es/components/pisellInput/components/BankCard/index.d.ts +11 -0
- package/es/components/pisellInput/components/BankCard/index.js +82 -0
- package/es/components/pisellInput/components/BankCard/index.less +4 -0
- package/es/components/pisellInput/components/BankCard/utils.d.ts +11 -0
- package/es/components/pisellInput/components/BankCard/utils.js +65 -0
- package/es/components/pisellInput/components/Copy/index.d.ts +11 -0
- package/es/components/pisellInput/components/Copy/index.js +53 -0
- package/es/components/pisellInput/components/SecurityCode/card.png +0 -0
- package/es/components/pisellInput/components/SecurityCode/index.d.ts +12 -0
- package/es/components/pisellInput/components/SecurityCode/index.js +46 -0
- package/es/components/pisellInput/components/SecurityCode/index.less +4 -0
- package/es/components/pisellInput/index.d.ts +13 -0
- package/es/components/pisellInput/index.js +15 -0
- package/es/components/pisellLoading/index.d.ts +18 -0
- package/es/components/pisellLoading/index.js +45 -0
- package/es/components/pisellLoading/index.less +35 -0
- package/es/components/pisellMessage/index.d.ts +4 -0
- package/es/components/pisellMessage/index.js +5 -0
- package/es/components/pisellModal/components/Information/index.d.ts +21 -0
- package/es/components/pisellModal/components/Information/index.js +25 -0
- package/es/components/pisellModal/components/Information/index.less +16 -0
- package/es/components/pisellModal/components/IpadModal/index.d.ts +6 -0
- package/es/components/pisellModal/components/IpadModal/index.js +6 -0
- package/es/components/pisellModal/components/MobileModal/index.d.ts +9 -0
- package/es/components/pisellModal/components/MobileModal/index.js +27 -0
- package/es/components/pisellModal/components/MobileModal/index.less +60 -0
- package/es/components/pisellModal/components/PcModal/index.d.ts +30 -0
- package/es/components/pisellModal/components/PcModal/index.js +129 -0
- package/es/components/pisellModal/components/PcModal/index.less +105 -0
- package/es/components/pisellModal/components/functions/index.d.ts +12 -0
- package/es/components/pisellModal/components/functions/index.js +44 -0
- package/es/components/pisellModal/components/functions/index.less +25 -0
- package/es/components/pisellModal/components/index.d.ts +10 -0
- package/es/components/pisellModal/components/index.js +9 -0
- package/es/components/pisellModal/constants.d.ts +6 -0
- package/es/components/pisellModal/constants.js +6 -0
- package/es/components/pisellModal/index.d.ts +43 -0
- package/es/components/pisellModal/index.js +30 -0
- package/es/components/pisellRow/index.d.ts +22 -0
- package/es/components/pisellRow/index.js +67 -0
- package/es/components/pisellRow/index.less +13 -0
- package/es/components/pisellScan/index.d.ts +21 -0
- package/es/components/pisellScan/index.js +80 -0
- package/es/components/pisellScan/index.less +12 -0
- package/es/components/pisellText/components/Amount/index.d.ts +18 -0
- package/es/components/pisellText/components/Amount/index.js +25 -0
- package/es/components/pisellText/index.d.ts +8 -0
- package/es/components/pisellText/index.js +7 -0
- package/es/components/pisellToast/index.d.ts +16 -0
- package/es/components/pisellToast/index.js +32 -0
- package/es/components/pisellToast/index.less +26 -0
- package/es/components/pisellTooltip/index.d.ts +10 -0
- package/es/components/pisellTooltip/index.js +15 -0
- package/es/components/pisellTooltip/index.less +5 -0
- package/es/components/pisellWalletPassCard/bg.jpeg +0 -0
- package/es/components/pisellWalletPassCard/index.d.ts +54 -0
- package/es/components/pisellWalletPassCard/index.js +93 -0
- package/es/components/pisellWalletPassCard/index.less +100 -0
- package/es/hooks/useCssVariables.d.ts +8 -0
- package/es/hooks/useCssVariables.js +21 -0
- package/es/index.d.ts +23 -0
- package/es/index.js +26 -1
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/en-US.js +13 -1
- package/es/locales/index.js +3 -1
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +13 -1
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/locales/zh-TW.js +13 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +15 -1
- package/es/utils/locale.js +2 -1
- package/lib/components/button/index.d.ts +4 -3
- package/lib/components/button/index.js +13 -9
- package/lib/components/iconfont/index.d.ts +2 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/page/index.css +0 -0
- package/lib/components/page/index.d.ts +2 -2
- package/lib/components/page/index.js +201 -161
- package/lib/components/pisell-config-provider/context.d.ts +20 -0
- package/lib/components/pisell-config-provider/context.js +49 -0
- package/lib/components/pisell-config-provider/hooks/usePisellConfig.d.ts +5 -0
- package/lib/components/pisell-config-provider/hooks/usePisellConfig.js +31 -0
- package/lib/components/pisell-config-provider/index.d.ts +12 -0
- package/lib/components/pisell-config-provider/index.js +69 -0
- package/lib/components/pisellAlert/index.d.ts +22 -0
- package/lib/components/pisellAlert/index.js +95 -0
- package/lib/components/pisellAlert/index.less +149 -0
- package/lib/components/pisellCard/index.d.ts +12 -0
- package/lib/components/pisellCard/index.js +48 -0
- package/lib/components/pisellCard/index.less +9 -0
- package/lib/components/pisellCardList/index.d.ts +43 -0
- package/lib/components/pisellCardList/index.js +108 -0
- package/lib/components/pisellCardList/index.less +75 -0
- package/lib/components/pisellCheckboxGroup/index.d.ts +34 -0
- package/lib/components/pisellCheckboxGroup/index.js +150 -0
- package/lib/components/pisellCheckboxGroup/index.less +36 -0
- package/lib/components/pisellCheckboxGroup/mock.d.ts +4 -0
- package/lib/components/pisellCheckboxGroup/mock.js +35 -0
- package/lib/components/pisellContainer/components/Portal/index.d.ts +10 -0
- package/lib/components/pisellContainer/components/Portal/index.js +40 -0
- package/lib/components/pisellContainer/containers.d.ts +1 -0
- package/lib/components/pisellContainer/containers.js +46 -0
- package/lib/components/pisellContainer/index.d.ts +22 -0
- package/lib/components/pisellContainer/index.js +49 -0
- package/lib/components/pisellCountdown/index.d.ts +24 -0
- package/lib/components/pisellCountdown/index.js +63 -0
- package/lib/components/pisellCountdown/utils.d.ts +7 -0
- package/lib/components/pisellCountdown/utils.js +60 -0
- package/lib/components/pisellDatePicker/datePickerCpt.d.ts +22 -0
- package/lib/components/pisellDatePicker/datePickerCpt.js +157 -0
- package/lib/components/pisellDatePicker/detePickerCpt.less +22 -0
- package/lib/components/pisellDatePicker/index.d.ts +3 -0
- package/lib/components/pisellDatePicker/index.js +48 -0
- package/lib/components/pisellEmpty/index.d.ts +16 -0
- package/lib/components/pisellEmpty/index.js +61 -0
- package/lib/components/pisellEmpty/index.less +34 -0
- package/lib/components/pisellInformationEntry/Input/index.d.ts +8 -0
- package/lib/components/pisellInformationEntry/Input/index.js +56 -0
- package/lib/components/pisellInformationEntry/Input/index.less +14 -0
- package/lib/components/pisellInformationEntry/Scan/index.d.ts +8 -0
- package/lib/components/pisellInformationEntry/Scan/index.js +64 -0
- package/lib/components/pisellInformationEntry/Scan/index.less +8 -0
- package/lib/components/pisellInformationEntry/constants.d.ts +3 -0
- package/lib/components/pisellInformationEntry/constants.js +49 -0
- package/lib/components/pisellInformationEntry/index.d.ts +31 -0
- package/lib/components/pisellInformationEntry/index.js +162 -0
- package/lib/components/pisellInformationEntry/index.less +40 -0
- package/lib/components/pisellInformationEntry/utils.d.ts +4 -0
- package/lib/components/pisellInformationEntry/utils.js +40 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/AMEX.png +0 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/Discover.png +0 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/JCB.png +0 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/MasterCard.png +0 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/UnionPay.png +0 -0
- package/lib/components/pisellInput/components/BankCard/cardPng/VISA.png +0 -0
- package/lib/components/pisellInput/components/BankCard/index.d.ts +11 -0
- package/lib/components/pisellInput/components/BankCard/index.js +98 -0
- package/lib/components/pisellInput/components/BankCard/index.less +4 -0
- package/lib/components/pisellInput/components/BankCard/utils.d.ts +11 -0
- package/lib/components/pisellInput/components/BankCard/utils.js +103 -0
- package/lib/components/pisellInput/components/Copy/index.d.ts +11 -0
- package/lib/components/pisellInput/components/Copy/index.js +61 -0
- package/lib/components/pisellInput/components/SecurityCode/card.png +0 -0
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +12 -0
- package/lib/components/pisellInput/components/SecurityCode/index.js +74 -0
- package/lib/components/pisellInput/components/SecurityCode/index.less +4 -0
- package/lib/components/pisellInput/index.d.ts +13 -0
- package/lib/components/pisellInput/index.js +46 -0
- package/lib/components/pisellLoading/index.d.ts +18 -0
- package/lib/components/pisellLoading/index.js +69 -0
- package/lib/components/pisellLoading/index.less +35 -0
- package/lib/components/pisellMessage/index.d.ts +4 -0
- package/lib/components/pisellMessage/index.js +34 -0
- package/lib/components/pisellModal/components/Information/index.d.ts +21 -0
- package/lib/components/pisellModal/components/Information/index.js +54 -0
- package/lib/components/pisellModal/components/Information/index.less +16 -0
- package/lib/components/pisellModal/components/IpadModal/index.d.ts +6 -0
- package/lib/components/pisellModal/components/IpadModal/index.js +40 -0
- package/lib/components/pisellModal/components/MobileModal/index.d.ts +9 -0
- package/lib/components/pisellModal/components/MobileModal/index.js +67 -0
- package/lib/components/pisellModal/components/MobileModal/index.less +60 -0
- package/lib/components/pisellModal/components/PcModal/index.d.ts +30 -0
- package/lib/components/pisellModal/components/PcModal/index.js +143 -0
- package/lib/components/pisellModal/components/PcModal/index.less +105 -0
- package/lib/components/pisellModal/components/functions/index.d.ts +12 -0
- package/lib/components/pisellModal/components/functions/index.js +90 -0
- package/lib/components/pisellModal/components/functions/index.less +25 -0
- package/lib/components/pisellModal/components/index.d.ts +10 -0
- package/lib/components/pisellModal/components/index.js +52 -0
- package/lib/components/pisellModal/constants.d.ts +6 -0
- package/lib/components/pisellModal/constants.js +33 -0
- package/lib/components/pisellModal/index.d.ts +43 -0
- package/lib/components/pisellModal/index.js +63 -0
- package/lib/components/pisellRow/index.d.ts +22 -0
- package/lib/components/pisellRow/index.js +82 -0
- package/lib/components/pisellRow/index.less +13 -0
- package/lib/components/pisellScan/index.d.ts +21 -0
- package/lib/components/pisellScan/index.js +100 -0
- package/lib/components/pisellScan/index.less +12 -0
- package/lib/components/pisellText/components/Amount/index.d.ts +18 -0
- package/lib/components/pisellText/components/Amount/index.js +64 -0
- package/lib/components/pisellText/index.d.ts +8 -0
- package/lib/components/pisellText/index.js +41 -0
- package/lib/components/pisellToast/index.d.ts +16 -0
- package/lib/components/pisellToast/index.js +59 -0
- package/lib/components/pisellToast/index.less +26 -0
- package/lib/components/pisellTooltip/index.d.ts +10 -0
- package/lib/components/pisellTooltip/index.js +53 -0
- package/lib/components/pisellTooltip/index.less +5 -0
- package/lib/components/pisellWalletPassCard/bg.jpeg +0 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +54 -0
- package/lib/components/pisellWalletPassCard/index.js +101 -0
- package/lib/components/pisellWalletPassCard/index.less +100 -0
- package/lib/hooks/useCssVariables.d.ts +8 -0
- package/lib/hooks/useCssVariables.js +36 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.js +71 -0
- package/lib/locales/en-US.d.ts +9 -0
- package/lib/locales/en-US.js +13 -1
- package/lib/locales/index.js +3 -1
- package/lib/locales/zh-CN.d.ts +9 -0
- package/lib/locales/zh-CN.js +13 -1
- package/lib/locales/zh-TW.d.ts +9 -0
- package/lib/locales/zh-TW.js +13 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +16 -0
- package/lib/utils/locale.js +2 -1
- package/lowcode/_utils/transform-meta.ts +31 -10
- package/lowcode/button/__screenshots__/pisell-modal-information.png +0 -0
- package/lowcode/button/meta.ts +30 -0
- package/lowcode/button/snippets.ts +28 -0
- package/lowcode/information-modal/meta.ts +1931 -0
- package/lowcode/modal/meta.ts +1 -1
- package/lowcode/page/meta.ts +8 -1
- package/lowcode/pisell-alert/meta.ts +117 -0
- package/lowcode/pisell-alert/snippets.ts +50 -0
- package/lowcode/pisell-card/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-card/meta.ts +100 -0
- package/lowcode/pisell-card/snippets.ts +10 -0
- package/lowcode/pisell-card-list/meta.ts +145 -0
- package/lowcode/pisell-card-list/snippets.ts +9 -0
- package/lowcode/pisell-checkbox-group/meta.ts +112 -0
- package/lowcode/pisell-checkbox-group/snippets.ts +13 -0
- package/lowcode/pisell-container/meta.ts +71 -0
- package/lowcode/pisell-container/snippets.ts +14 -0
- package/lowcode/pisell-countdown/meta.ts +71 -0
- package/lowcode/pisell-countdown/snippets.ts +12 -0
- package/lowcode/pisell-date-picker/meta.ts +76 -0
- package/lowcode/pisell-date-picker/snippets.ts +9 -0
- package/lowcode/pisell-empty/__screenshots__/empty-1.png +0 -0
- package/lowcode/pisell-empty/meta.ts +85 -0
- package/lowcode/pisell-empty/snippets.ts +10 -0
- package/lowcode/pisell-information-entry/meta.ts +131 -0
- package/lowcode/pisell-information-entry/snippets.ts +17 -0
- package/lowcode/pisell-input/__screenshots__/input-1.png +0 -0
- package/lowcode/pisell-input/meta.ts +193 -0
- package/lowcode/pisell-input/snippets.ts +11 -0
- package/lowcode/pisell-input.bank-card-input/__screenshots__/pisell-input.bank-card-input.png +0 -0
- package/lowcode/pisell-input.bank-card-input/meta.ts +62 -0
- package/lowcode/pisell-input.bank-card-input/snippets.ts +11 -0
- package/lowcode/pisell-input.copy/meta.ts +73 -0
- package/lowcode/pisell-input.copy/snippets.ts +10 -0
- package/lowcode/pisell-input.security-code/__screenshots__/pisell-input.security-code.png +0 -0
- package/lowcode/pisell-input.security-code/meta.ts +92 -0
- package/lowcode/pisell-input.security-code/snippets.ts +11 -0
- package/lowcode/pisell-loading/meta.ts +98 -0
- package/lowcode/pisell-loading/snippets.ts +11 -0
- package/lowcode/pisell-modal/__screenshots__/modal-1.png +0 -0
- package/lowcode/pisell-modal/__screenshots__/modal-2.png +0 -0
- package/lowcode/pisell-modal/meta.ts +200 -0
- package/lowcode/pisell-modal/snippets.ts +38 -0
- package/lowcode/pisell-modal.information/__screenshots__/pisell-modal.information.png +0 -0
- package/lowcode/pisell-modal.information/meta.ts +116 -0
- package/lowcode/pisell-modal.information/snippets.ts +17 -0
- package/lowcode/pisell-row/meta.ts +127 -0
- package/lowcode/pisell-row/snippets.ts +24 -0
- package/lowcode/pisell-scan/meta.ts +53 -0
- package/lowcode/pisell-scan/snippets.ts +13 -0
- package/lowcode/pisell-text/meta.ts +8117 -0
- package/lowcode/pisell-text.amount/meta.ts +61 -0
- package/lowcode/pisell-text.amount/snippets.ts +15 -0
- package/lowcode/pisell-tooltip/__screenshots__/tooltip-1.jpg +0 -0
- package/lowcode/pisell-tooltip/meta.ts +306 -0
- package/lowcode/pisell-tooltip/snippets.ts +12 -0
- package/lowcode/pisell-wallet-pass-card/meta.ts +189 -0
- package/lowcode/pisell-wallet-pass-card/snippets.ts +20 -0
- package/package.json +4 -3
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellInformationEntry/index.tsx
|
|
30
|
+
var pisellInformationEntry_exports = {};
|
|
31
|
+
__export(pisellInformationEntry_exports, {
|
|
32
|
+
default: () => pisellInformationEntry_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellInformationEntry_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_usePisellConfig = __toESM(require("../pisell-config-provider/hooks/usePisellConfig"));
|
|
38
|
+
var import_pisellCard = __toESM(require("../pisellCard"));
|
|
39
|
+
var import_iconfont = __toESM(require("../iconfont"));
|
|
40
|
+
var import_constants = require("./constants");
|
|
41
|
+
var import_Scan = __toESM(require("./Scan"));
|
|
42
|
+
var import_button = __toESM(require("../button"));
|
|
43
|
+
var import_Input = __toESM(require("./Input"));
|
|
44
|
+
var import_utils = require("./utils");
|
|
45
|
+
var import_index = require("./index.less");
|
|
46
|
+
var CardButton = (props) => {
|
|
47
|
+
const { icon, children, ...others } = props;
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(import_pisellCard.default, { ...others }, /* @__PURE__ */ import_react.default.createElement("div", null, icon), /* @__PURE__ */ import_react.default.createElement("div", null, children));
|
|
49
|
+
};
|
|
50
|
+
var PisellInformationEntry = (props) => {
|
|
51
|
+
const {
|
|
52
|
+
platform: propsPlatform,
|
|
53
|
+
title,
|
|
54
|
+
entryModes = [],
|
|
55
|
+
searchDescribe,
|
|
56
|
+
onChange
|
|
57
|
+
} = props;
|
|
58
|
+
const config = (0, import_usePisellConfig.default)();
|
|
59
|
+
const { platform } = config;
|
|
60
|
+
const [currentType, setCurrentType] = (0, import_react.useState)(
|
|
61
|
+
null
|
|
62
|
+
);
|
|
63
|
+
const [availableEntryModes, setAvailableEntryModes] = (0, import_react.useState)(entryModes);
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
document.body.id = "body";
|
|
66
|
+
}, []);
|
|
67
|
+
(0, import_react.useEffect)(() => {
|
|
68
|
+
const getEntryModes = async () => {
|
|
69
|
+
let available = entryModes;
|
|
70
|
+
if (!await (0, import_utils.hasCamera)()) {
|
|
71
|
+
available = entryModes.filter((item) => item.type !== "scanCode");
|
|
72
|
+
}
|
|
73
|
+
if (available.length === 1) {
|
|
74
|
+
setCurrentType(available[0].type);
|
|
75
|
+
}
|
|
76
|
+
setAvailableEntryModes(available);
|
|
77
|
+
};
|
|
78
|
+
getEntryModes();
|
|
79
|
+
}, [entryModes]);
|
|
80
|
+
const handleChange = (val) => {
|
|
81
|
+
onChange == null ? void 0 : onChange(val);
|
|
82
|
+
};
|
|
83
|
+
const handleEntryClick = (type) => {
|
|
84
|
+
if (import_constants.passiveModeType.includes(type)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setCurrentType(type);
|
|
88
|
+
};
|
|
89
|
+
const { isHasInput, isHasNfc, isHasScanner, isHasScanCode } = (0, import_react.useMemo)(() => {
|
|
90
|
+
let isHasScanCode2 = false;
|
|
91
|
+
let isHasInput2 = false;
|
|
92
|
+
let isHasScanner2 = false;
|
|
93
|
+
let isHasNfc2 = false;
|
|
94
|
+
availableEntryModes.forEach((item) => {
|
|
95
|
+
if (item.type === "scanCode") {
|
|
96
|
+
isHasScanCode2 = true;
|
|
97
|
+
}
|
|
98
|
+
if (item.type === "input") {
|
|
99
|
+
isHasInput2 = true;
|
|
100
|
+
}
|
|
101
|
+
if (item.type === "scanner") {
|
|
102
|
+
isHasScanner2 = true;
|
|
103
|
+
}
|
|
104
|
+
if (item.type === "nfc") {
|
|
105
|
+
isHasNfc2 = true;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
isHasScanCode: isHasScanCode2,
|
|
110
|
+
isHasInput: isHasInput2,
|
|
111
|
+
isHasScanner: isHasScanner2,
|
|
112
|
+
isHasNfc: isHasNfc2
|
|
113
|
+
};
|
|
114
|
+
}, [availableEntryModes]);
|
|
115
|
+
const isShowEntryModes = (0, import_react.useMemo)(() => {
|
|
116
|
+
if (!currentType) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
if (availableEntryModes.length === 1 && import_constants.passiveModeType.includes(availableEntryModes[0].type)) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
}, [currentType, availableEntryModes]);
|
|
124
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-information-entry-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-information-entry-title" }, /* @__PURE__ */ import_react.default.createElement("span", null, title), currentType && isHasScanCode && isHasInput && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-information-entry-title-action-wrap" }, isHasScanCode && /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
import_button.default,
|
|
126
|
+
{
|
|
127
|
+
size: "large",
|
|
128
|
+
type: currentType === "scanCode" ? "primary" : "default",
|
|
129
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: import_constants.entryModeTextIcon["scanCode"].icon }),
|
|
130
|
+
onClick: () => handleEntryClick("scanCode")
|
|
131
|
+
}
|
|
132
|
+
), isHasInput && /* @__PURE__ */ import_react.default.createElement(
|
|
133
|
+
import_button.default,
|
|
134
|
+
{
|
|
135
|
+
size: "large",
|
|
136
|
+
type: currentType === "input" ? "primary" : "default",
|
|
137
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: import_constants.entryModeTextIcon["input"].icon }),
|
|
138
|
+
onClick: () => handleEntryClick("input")
|
|
139
|
+
}
|
|
140
|
+
))), isShowEntryModes && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-information-entry-modes" }, availableEntryModes.map((item) => {
|
|
141
|
+
const detail = import_constants.entryModeTextIcon[item.type];
|
|
142
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
143
|
+
CardButton,
|
|
144
|
+
{
|
|
145
|
+
bordered: !import_constants.passiveModeType.includes(item.type),
|
|
146
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
147
|
+
import_iconfont.default,
|
|
148
|
+
{
|
|
149
|
+
type: detail.icon,
|
|
150
|
+
className: "pisell-card-button-icon"
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
className: (0, import_classnames.default)("pisell-information-entry-item", {
|
|
154
|
+
["pisell-entry-ready"]: import_constants.passiveModeType.includes(item.type)
|
|
155
|
+
}),
|
|
156
|
+
onClick: () => handleEntryClick(item.type)
|
|
157
|
+
},
|
|
158
|
+
item.name || detail.text
|
|
159
|
+
);
|
|
160
|
+
})), /* @__PURE__ */ import_react.default.createElement("div", null, currentType === "scanCode" && /* @__PURE__ */ import_react.default.createElement(import_Scan.default, { onChange: handleChange, onCancel: () => setCurrentType(null) }), currentType === "input" && /* @__PURE__ */ import_react.default.createElement(import_Input.default, { onChange: handleChange, searchDescribe })));
|
|
161
|
+
};
|
|
162
|
+
var pisellInformationEntry_default = PisellInformationEntry;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.pisell-information-entry-wrap {
|
|
2
|
+
.pisell-information-entry-title {
|
|
3
|
+
color: var(--Gray-900, #101828);
|
|
4
|
+
font-size: 18px;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-weight: 600;
|
|
7
|
+
line-height: 28px; /* 155.556% */
|
|
8
|
+
margin-bottom: 10px;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: 20px;
|
|
13
|
+
.pisell-information-entry-title-action-wrap {
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: 10px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.pisell-information-entry-modes {
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: 10px;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
.pisell-information-entry-item {
|
|
23
|
+
flex: 1;
|
|
24
|
+
text-align: center;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
min-width: 165px;
|
|
27
|
+
.pisell-card-button-icon {
|
|
28
|
+
height: 48px;
|
|
29
|
+
font-size: 36px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.pisell-entry-ready {
|
|
33
|
+
background: var(--Gray-50, #f9fafb);
|
|
34
|
+
cursor: inherit;
|
|
35
|
+
.pisell-card-button-icon {
|
|
36
|
+
font-size: 60px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellInformationEntry/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
hasCamera: () => hasCamera
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var hasCamera = async () => {
|
|
26
|
+
try {
|
|
27
|
+
const devices = await navigator.mediaDevices.enumerateDevices();
|
|
28
|
+
const hasVideoInput = devices.some(
|
|
29
|
+
(device) => device.kind === "videoinput"
|
|
30
|
+
);
|
|
31
|
+
return hasVideoInput;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error("Error accessing media devices:", error);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
hasCamera
|
|
40
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import { PisellContextType } from "../../../pisell-config-provider/context";
|
|
4
|
+
import './index.less';
|
|
5
|
+
export declare type BankCardProps = InputProps & {
|
|
6
|
+
/** 平台 */
|
|
7
|
+
platform?: PisellContextType['platform'];
|
|
8
|
+
onChange?: (val: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const BankCard: (props: BankCardProps) => React.JSX.Element;
|
|
11
|
+
export default BankCard;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellInput/components/BankCard/index.tsx
|
|
30
|
+
var BankCard_exports = {};
|
|
31
|
+
__export(BankCard_exports, {
|
|
32
|
+
default: () => BankCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(BankCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_input = __toESM(require("../../../input"));
|
|
37
|
+
var import_utils = require("./utils");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var bankCardMaxLength = (str) => {
|
|
40
|
+
return str.slice(0, 19);
|
|
41
|
+
};
|
|
42
|
+
var BankCard = (props) => {
|
|
43
|
+
const { onChange, value: propsValue, ...others } = props;
|
|
44
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
45
|
+
const [_value, setValue] = (0, import_react.useState)(propsValue || "");
|
|
46
|
+
const [currentBankType, setCurrentBankType] = (0, import_react.useState)();
|
|
47
|
+
(0, import_react.useEffect)(() => {
|
|
48
|
+
document.body.id = "body";
|
|
49
|
+
}, []);
|
|
50
|
+
(0, import_react.useEffect)(() => {
|
|
51
|
+
setValue(bankCardMaxLength(formatBankCardNumber(`${propsValue || ""}`)));
|
|
52
|
+
}, [propsValue]);
|
|
53
|
+
const formatBankCardNumber = (value) => {
|
|
54
|
+
const cleanValue = value.replace(/\D/g, "");
|
|
55
|
+
const formattedValue = cleanValue.replace(/(.{4})/g, "$1 ").trim();
|
|
56
|
+
return formattedValue;
|
|
57
|
+
};
|
|
58
|
+
const handleChange = (e) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
const { value } = e.target;
|
|
61
|
+
setCurrentBankType((0, import_utils.getCardType)(value));
|
|
62
|
+
const formattedValue = formatBankCardNumber(value);
|
|
63
|
+
let start = ((_b = (_a = inputRef.current) == null ? void 0 : _a.input) == null ? void 0 : _b.selectionStart) || 0;
|
|
64
|
+
const val = bankCardMaxLength(formattedValue);
|
|
65
|
+
setValue(val);
|
|
66
|
+
onChange == null ? void 0 : onChange(val.replace(/\s/g, ""));
|
|
67
|
+
if (formattedValue.length > 19 || formattedValue.length < _value.length) {
|
|
68
|
+
if ([4, 9, 14, 19].includes(start)) {
|
|
69
|
+
start = start + 1;
|
|
70
|
+
}
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
var _a2;
|
|
73
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.setSelectionRange(start, start);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
78
|
+
import_input.default,
|
|
79
|
+
{
|
|
80
|
+
...others,
|
|
81
|
+
suffix: currentBankType ? /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
+
"img",
|
|
83
|
+
{
|
|
84
|
+
className: "pisell-input-bank-card-suffix",
|
|
85
|
+
src: import_utils.bankTypeMap[currentBankType],
|
|
86
|
+
alt: currentBankType
|
|
87
|
+
}
|
|
88
|
+
) : /* @__PURE__ */ import_react.default.createElement("span", null),
|
|
89
|
+
type: "tel",
|
|
90
|
+
placeholder: "1234 1234 1234 1234",
|
|
91
|
+
size: "large",
|
|
92
|
+
ref: inputRef,
|
|
93
|
+
value: _value,
|
|
94
|
+
onChange: handleChange
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
var BankCard_default = BankCard;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getCardType: (str: string) => "jcb" | "amex" | "visa" | "masterCard" | "unionPay" | "discover" | undefined;
|
|
2
|
+
export declare const bankTypeMap: {
|
|
3
|
+
jcb: any;
|
|
4
|
+
amex: any;
|
|
5
|
+
masterCard: any;
|
|
6
|
+
visa: any;
|
|
7
|
+
unionPay: any;
|
|
8
|
+
discover: any;
|
|
9
|
+
};
|
|
10
|
+
export declare const getCardImgByType: (type: keyof typeof bankTypeMap) => any;
|
|
11
|
+
export declare const getBankCardTypeImg: (val: number | string) => any;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellInput/components/BankCard/utils.ts
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
bankTypeMap: () => bankTypeMap,
|
|
33
|
+
getBankCardTypeImg: () => getBankCardTypeImg,
|
|
34
|
+
getCardImgByType: () => getCardImgByType,
|
|
35
|
+
getCardType: () => getCardType
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(utils_exports);
|
|
38
|
+
var import_JCB = __toESM(require("./cardPng/JCB.png"));
|
|
39
|
+
var import_AMEX = __toESM(require("./cardPng/AMEX.png"));
|
|
40
|
+
var import_MasterCard = __toESM(require("./cardPng/MasterCard.png"));
|
|
41
|
+
var import_VISA = __toESM(require("./cardPng/VISA.png"));
|
|
42
|
+
var import_UnionPay = __toESM(require("./cardPng/UnionPay.png"));
|
|
43
|
+
var import_Discover = __toESM(require("./cardPng/Discover.png"));
|
|
44
|
+
var isJcb = (str) => {
|
|
45
|
+
return str.startsWith("35");
|
|
46
|
+
};
|
|
47
|
+
var isAmex = (str) => {
|
|
48
|
+
return str.startsWith("34") || str.startsWith("37");
|
|
49
|
+
};
|
|
50
|
+
var isMasterCard = (str) => {
|
|
51
|
+
return str.startsWith("51") || str.startsWith("52") || str.startsWith("53") || str.startsWith("54") || str.startsWith("55") || str.startsWith("22") || str.startsWith("23") || str.startsWith("24") || str.startsWith("25") || str.startsWith("26") || str.startsWith("27");
|
|
52
|
+
};
|
|
53
|
+
var isVisa = (str) => {
|
|
54
|
+
return str.startsWith("4");
|
|
55
|
+
};
|
|
56
|
+
var isUnionPay = (str) => {
|
|
57
|
+
return str.startsWith("62") || str.startsWith("81");
|
|
58
|
+
};
|
|
59
|
+
var isDiscover = (str) => {
|
|
60
|
+
return str.startsWith("60") || str.startsWith("64") || str.startsWith("65");
|
|
61
|
+
};
|
|
62
|
+
var getCardType = (str) => {
|
|
63
|
+
if (isJcb(str)) {
|
|
64
|
+
return "jcb";
|
|
65
|
+
}
|
|
66
|
+
if (isAmex(str)) {
|
|
67
|
+
return "amex";
|
|
68
|
+
}
|
|
69
|
+
if (isVisa(str)) {
|
|
70
|
+
return "visa";
|
|
71
|
+
}
|
|
72
|
+
if (isMasterCard(str)) {
|
|
73
|
+
return "masterCard";
|
|
74
|
+
}
|
|
75
|
+
if (isUnionPay(str)) {
|
|
76
|
+
return "unionPay";
|
|
77
|
+
}
|
|
78
|
+
if (isDiscover(str)) {
|
|
79
|
+
return "discover";
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var bankTypeMap = {
|
|
83
|
+
jcb: import_JCB.default,
|
|
84
|
+
amex: import_AMEX.default,
|
|
85
|
+
masterCard: import_MasterCard.default,
|
|
86
|
+
visa: import_VISA.default,
|
|
87
|
+
unionPay: import_UnionPay.default,
|
|
88
|
+
discover: import_Discover.default
|
|
89
|
+
};
|
|
90
|
+
var getCardImgByType = (type) => {
|
|
91
|
+
return bankTypeMap[type] || "";
|
|
92
|
+
};
|
|
93
|
+
var getBankCardTypeImg = (val) => {
|
|
94
|
+
const type = getCardType(`${val || ""}`);
|
|
95
|
+
return type ? bankTypeMap[type] : null;
|
|
96
|
+
};
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
bankTypeMap,
|
|
100
|
+
getBankCardTypeImg,
|
|
101
|
+
getCardImgByType,
|
|
102
|
+
getCardType
|
|
103
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps, ButtonProps } from 'antd';
|
|
3
|
+
import { PisellContextType } from "../../../pisell-config-provider/context";
|
|
4
|
+
export interface CopyProps extends InputProps {
|
|
5
|
+
/** 平台 */
|
|
6
|
+
platform?: PisellContextType['platform'];
|
|
7
|
+
/** 后缀button的透传配置 */
|
|
8
|
+
buttonProps?: ButtonProps;
|
|
9
|
+
}
|
|
10
|
+
declare const Copy: (props: CopyProps) => React.JSX.Element;
|
|
11
|
+
export default Copy;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellInput/components/Copy/index.tsx
|
|
30
|
+
var Copy_exports = {};
|
|
31
|
+
__export(Copy_exports, {
|
|
32
|
+
default: () => Copy_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Copy_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_input = __toESM(require("../../../input"));
|
|
39
|
+
var import_icon = __toESM(require("../../../icon"));
|
|
40
|
+
var import_locales = require("../../../../locales");
|
|
41
|
+
var Copy = (props) => {
|
|
42
|
+
const { buttonProps } = props;
|
|
43
|
+
const inputRef = (0, import_react.useRef)(null);
|
|
44
|
+
const handleCopyClick = async (e) => {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
(_a = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);
|
|
47
|
+
await (0, import_utils.copyToClipboard)(((_c = (_b = inputRef.current) == null ? void 0 : _b.input) == null ? void 0 : _c.value) || "");
|
|
48
|
+
import_antd.message.success((0, import_locales.getText)("pisell-input-copy-success"));
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space.Compact, { block: true }, /* @__PURE__ */ import_react.default.createElement(import_input.default, { ...props, ref: inputRef, disabled: props.disabled ?? true, size: "large" }), /* @__PURE__ */ import_react.default.createElement(
|
|
51
|
+
import_antd.Button,
|
|
52
|
+
{
|
|
53
|
+
size: "large",
|
|
54
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-copy-03" }),
|
|
55
|
+
...buttonProps,
|
|
56
|
+
onClick: handleCopyClick,
|
|
57
|
+
children: (buttonProps == null ? void 0 : buttonProps.children) || (0, import_locales.getText)("pisell-input-copy")
|
|
58
|
+
}
|
|
59
|
+
));
|
|
60
|
+
};
|
|
61
|
+
var Copy_default = Copy;
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
import { PisellContextType } from "../../../pisell-config-provider/context";
|
|
5
|
+
export interface SecurityCodeProps extends Omit<InputProps, 'onChange'> {
|
|
6
|
+
/** 平台 */
|
|
7
|
+
platform?: PisellContextType['platform'];
|
|
8
|
+
onChange?: (val: string) => void;
|
|
9
|
+
showCVCIcon?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const SecurityCode: (props: SecurityCodeProps) => React.JSX.Element;
|
|
12
|
+
export default SecurityCode;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellInput/components/SecurityCode/index.tsx
|
|
30
|
+
var SecurityCode_exports = {};
|
|
31
|
+
__export(SecurityCode_exports, {
|
|
32
|
+
default: () => SecurityCode_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SecurityCode_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_input = __toESM(require("../../../input"));
|
|
38
|
+
var import_card = __toESM(require("./card.png"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var SecurityCode = (props) => {
|
|
41
|
+
const { maxLength, showCVCIcon = true } = props;
|
|
42
|
+
const [state, setState] = (0, import_ahooks.useControllableValue)(props, {
|
|
43
|
+
defaultValue: ""
|
|
44
|
+
});
|
|
45
|
+
const handleChange = (e) => {
|
|
46
|
+
const { value } = e.target;
|
|
47
|
+
let numberValue = value.replace(/\D/g, "");
|
|
48
|
+
if (maxLength) {
|
|
49
|
+
numberValue = numberValue.slice(0, maxLength);
|
|
50
|
+
}
|
|
51
|
+
setState == null ? void 0 : setState(numberValue);
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
import_input.default,
|
|
55
|
+
{
|
|
56
|
+
...props,
|
|
57
|
+
value: state,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
maxLength,
|
|
60
|
+
size: "large",
|
|
61
|
+
placeholder: "CVC",
|
|
62
|
+
type: "number",
|
|
63
|
+
suffix: showCVCIcon && /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
"img",
|
|
65
|
+
{
|
|
66
|
+
className: "pisell-security-code-suffix",
|
|
67
|
+
src: import_card.default,
|
|
68
|
+
alt: "security code img"
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
var SecurityCode_default = SecurityCode;
|