@pisell/materials 1.0.446 → 1.0.448
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/browserSelect/chevron-down.png +0 -0
- package/es/components/browserSelect/index.d.ts +15 -0
- package/es/components/browserSelect/index.js +36 -0
- package/es/components/browserSelect/index.less +18 -0
- package/es/components/button/index.js +2 -0
- package/es/components/buttonGroupEdit/index.d.ts +8 -0
- package/es/components/buttonGroupEdit/index.js +411 -0
- package/es/components/buttonGroupPreview/index.d.ts +20 -0
- package/es/components/buttonGroupPreview/index.js +81 -0
- package/es/components/cardPro/index.d.ts +4 -0
- package/es/components/cardPro/index.js +66 -0
- package/es/components/cardPro/index.less +58 -0
- package/es/components/collapse/index.d.ts +6 -0
- package/es/components/collapse/index.js +66 -0
- package/es/components/collapse/index.less +1 -0
- package/es/components/date-picker/constants.d.ts +39 -0
- package/es/components/date-picker/constants.js +76 -0
- package/es/components/date-picker/datePickerCpt.d.ts +8 -0
- package/es/components/date-picker/datePickerCpt.js +370 -0
- package/es/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/es/components/date-picker/hooks/useMediaQuery.js +28 -0
- package/es/components/date-picker/index.js +2 -2
- package/es/components/date-picker/index.less +1880 -0
- package/es/components/drag-sort-tree/index.d.ts +0 -1
- package/es/components/drag-sort-tree/index.js +2 -1
- package/es/components/iconfont/index.js +1 -1
- package/es/components/picker-view/index.d.ts +2 -0
- package/es/components/picker-view/index.js +2 -0
- package/es/components/pisellAnchor/index.d.ts +15 -0
- package/es/components/pisellAnchor/index.js +114 -0
- package/es/components/pisellAnchor/index.less +98 -0
- package/es/components/pisellInformationEntry/Input/index.js +9 -3
- package/es/components/pisellInformationEntry/constants.d.ts +10 -0
- package/es/components/pisellInformationEntry/constants.js +10 -0
- package/es/components/pisellInformationEntry/hooks/useTerminalPeripherals.d.ts +8 -0
- package/es/components/pisellInformationEntry/hooks/useTerminalPeripherals.js +54 -0
- package/es/components/pisellInformationEntry/index.js +21 -4
- package/es/components/pisellInformationEntry/index.less +1 -1
- package/es/components/pisellLoading/index.d.ts +2 -0
- package/es/components/pisellLoading/index.js +3 -1
- package/es/components/pisellQrcode/index.d.ts +4 -0
- package/es/components/pisellQrcode/index.js +75 -0
- package/es/components/pisellQrcode/index.less +41 -0
- package/es/components/pisellStatistic/index.d.ts +10 -0
- package/es/components/pisellStatistic/index.js +26 -0
- package/es/components/pisellStatistic/index.less +14 -0
- package/es/components/pisellTags/index.d.ts +13 -0
- package/es/components/pisellTags/index.js +83 -0
- package/es/components/pisellTags/index.less +17 -0
- package/es/components/pisellTags/utils.d.ts +1 -0
- package/es/components/pisellTags/utils.js +89 -0
- package/es/components/pisellUpload/index.d.ts +11 -0
- package/es/components/pisellUpload/index.js +34 -0
- package/es/components/pisellUpload/index.less +15 -0
- package/es/components/pisellUploadCrop/index.d.ts +3 -0
- package/es/components/pisellUploadCrop/index.js +73 -0
- package/es/components/pisellUploadCrop/index.less +15 -0
- package/es/components/pisellWalletCard/img/drak.png +0 -0
- package/es/components/pisellWalletCard/img/light.png +0 -0
- package/es/components/pisellWalletCard/index.d.ts +4 -0
- package/es/components/pisellWalletCard/index.js +122 -0
- package/es/components/pisellWalletCard/index.less +96 -0
- package/es/components/pisellWalletPassCard/index.d.ts +2 -0
- package/es/components/pisellWalletPassCard/index.js +16 -4
- package/es/components/pisellWalletPassCard/index.less +3 -0
- package/es/components/productCard/components/Actions/index.d.ts +4 -0
- package/es/components/productCard/components/Actions/index.js +20 -0
- package/es/components/productCard/components/Actions/index.less +14 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/components/AmountFooter/index.js +32 -0
- package/es/components/productCard/components/AmountFooter/index.less +30 -0
- package/es/components/productCard/components/Divider/index.d.ts +4 -0
- package/es/components/productCard/components/Divider/index.js +11 -0
- package/es/components/productCard/components/Divider/index.less +13 -0
- package/es/components/productCard/components/Header/index.d.ts +4 -0
- package/es/components/productCard/components/Header/index.js +69 -0
- package/es/components/productCard/components/Header/index.less +59 -0
- package/es/components/productCard/components/Holder/index.d.ts +4 -0
- package/es/components/productCard/components/Holder/index.js +11 -0
- package/es/components/productCard/components/Holder/index.less +11 -0
- package/es/components/productCard/components/Note/index.d.ts +4 -0
- package/es/components/productCard/components/Note/index.js +17 -0
- package/es/components/productCard/components/Note/index.less +20 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.js +96 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +31 -0
- package/es/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/components/options/index.js +23 -0
- package/es/components/productCard/components/Packages/components/options/index.less +28 -0
- package/es/components/productCard/components/Packages/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/index.js +22 -0
- package/es/components/productCard/components/Packages/index.less +17 -0
- package/es/components/productCard/components/Packages/utils.d.ts +20 -0
- package/es/components/productCard/components/Packages/utils.js +40 -0
- package/es/components/productCard/components/Sales/index.d.ts +4 -0
- package/es/components/productCard/components/Sales/index.js +22 -0
- package/es/components/productCard/components/Sales/index.less +18 -0
- package/es/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/es/components/productCard/components/Time/components/Like/index.js +26 -0
- package/es/components/productCard/components/Time/components/Like/index.less +6 -0
- package/es/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/es/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/es/components/productCard/components/Time/index.d.ts +4 -0
- package/es/components/productCard/components/Time/index.js +30 -0
- package/es/components/productCard/components/Time/index.less +25 -0
- package/es/components/productCard/index.d.ts +5 -0
- package/es/components/productCard/index.js +80 -0
- package/es/components/productCard/index.less +48 -0
- package/es/components/productCard/types.d.ts +10 -0
- package/es/components/productCard/types.js +1 -0
- package/es/components/productCard/utils.d.ts +162 -0
- package/es/components/productCard/utils.js +683 -0
- package/es/components/record-view/index.d.ts +3 -3
- package/es/components/record-view/index.js +23 -16
- package/es/components/section-footers/index.d.ts +8 -0
- package/es/components/section-footers/index.js +16 -0
- package/es/components/select-time/RightPanel/index.d.ts +2 -2
- package/es/components/select-time/RightPanel/index.js +7 -7
- package/es/components/table/Actions/component/ExportImport/index.js +3 -3
- package/es/components/table/BasicTable/index.js +7 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.less +1 -1
- package/es/components/table/Gallery/components/GalleryItem/index.js +10 -3
- package/es/components/table/Gallery/components/GalleryItem/index.less +1 -0
- package/es/components/table/Gallery/index.js +14 -4
- package/es/components/table/Table/index.js +2 -1
- package/es/components/table/Table/utils.d.ts +15 -3
- package/es/components/table/Table/utils.js +6 -2
- package/es/components/table/hooks/useTableSetting.js +26 -5
- package/es/components/table/hooks/useTransDataSource.d.ts +1 -0
- package/es/components/table/hooks/useTransDataSource.js +6 -4
- package/es/components/table/types.d.ts +2 -0
- package/es/components/tabs/index.d.ts +1 -0
- package/es/components/tabs/index.js +33 -11
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Keyboard/index.js +10 -2
- package/es/index.d.ts +18 -4
- package/es/index.js +20 -3
- package/es/locales/en-US.d.ts +14 -0
- package/es/locales/en-US.js +16 -1
- package/es/locales/zh-CN.d.ts +14 -0
- package/es/locales/zh-CN.js +16 -1
- package/es/locales/zh-TW.d.ts +14 -0
- package/es/locales/zh-TW.js +16 -1
- package/es/utils/index.d.ts +1 -0
- package/es/utils/index.js +4 -1
- package/lib/components/browserSelect/chevron-down.png +0 -0
- package/lib/components/browserSelect/index.d.ts +15 -0
- package/lib/components/browserSelect/index.js +59 -0
- package/lib/components/browserSelect/index.less +18 -0
- package/lib/components/button/index.js +2 -0
- package/lib/components/buttonGroupEdit/index.d.ts +8 -0
- package/lib/components/buttonGroupEdit/index.js +234 -0
- package/lib/components/buttonGroupPreview/index.d.ts +20 -0
- package/lib/components/buttonGroupPreview/index.js +65 -0
- package/lib/components/cardPro/index.d.ts +4 -0
- package/lib/components/cardPro/index.js +60 -0
- package/lib/components/cardPro/index.less +58 -0
- package/lib/components/collapse/index.d.ts +6 -0
- package/lib/components/collapse/index.js +88 -0
- package/lib/components/collapse/index.less +1 -0
- package/lib/components/date-picker/constants.d.ts +39 -0
- package/lib/components/date-picker/constants.js +78 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +8 -0
- package/lib/components/date-picker/datePickerCpt.js +403 -0
- package/lib/components/date-picker/hooks/useMediaQuery.d.ts +2 -0
- package/lib/components/date-picker/hooks/useMediaQuery.js +43 -0
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/date-picker/index.less +1880 -0
- package/lib/components/drag-sort-tree/index.d.ts +0 -1
- package/lib/components/drag-sort-tree/index.js +0 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/picker-view/index.d.ts +2 -0
- package/lib/components/picker-view/index.js +36 -0
- package/lib/components/pisellAnchor/index.d.ts +15 -0
- package/lib/components/pisellAnchor/index.js +107 -0
- package/lib/components/pisellAnchor/index.less +98 -0
- package/lib/components/pisellInformationEntry/Input/index.js +9 -1
- package/lib/components/pisellInformationEntry/constants.d.ts +10 -0
- package/lib/components/pisellInformationEntry/constants.js +12 -0
- package/lib/components/pisellInformationEntry/hooks/useTerminalPeripherals.d.ts +8 -0
- package/lib/components/pisellInformationEntry/hooks/useTerminalPeripherals.js +83 -0
- package/lib/components/pisellInformationEntry/index.js +18 -2
- package/lib/components/pisellInformationEntry/index.less +1 -1
- package/lib/components/pisellLoading/index.d.ts +2 -0
- package/lib/components/pisellLoading/index.js +2 -1
- package/lib/components/pisellQrcode/index.d.ts +4 -0
- package/lib/components/pisellQrcode/index.js +79 -0
- package/lib/components/pisellQrcode/index.less +41 -0
- package/lib/components/pisellStatistic/index.d.ts +10 -0
- package/lib/components/pisellStatistic/index.js +51 -0
- package/lib/components/pisellStatistic/index.less +14 -0
- package/lib/components/pisellTags/index.d.ts +13 -0
- package/lib/components/pisellTags/index.js +113 -0
- package/lib/components/pisellTags/index.less +17 -0
- package/lib/components/pisellTags/utils.d.ts +1 -0
- package/lib/components/pisellTags/utils.js +86 -0
- package/lib/components/pisellUpload/index.d.ts +11 -0
- package/lib/components/pisellUpload/index.js +53 -0
- package/lib/components/pisellUpload/index.less +15 -0
- package/lib/components/pisellUploadCrop/index.d.ts +3 -0
- package/lib/components/pisellUploadCrop/index.js +75 -0
- package/lib/components/pisellUploadCrop/index.less +15 -0
- package/lib/components/pisellWalletCard/img/drak.png +0 -0
- package/lib/components/pisellWalletCard/img/light.png +0 -0
- package/lib/components/pisellWalletCard/index.d.ts +4 -0
- package/lib/components/pisellWalletCard/index.js +184 -0
- package/lib/components/pisellWalletCard/index.less +96 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +2 -0
- package/lib/components/pisellWalletPassCard/index.js +8 -4
- package/lib/components/pisellWalletPassCard/index.less +3 -0
- package/lib/components/productCard/components/Actions/index.d.ts +4 -0
- package/lib/components/productCard/components/Actions/index.js +54 -0
- package/lib/components/productCard/components/Actions/index.less +14 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/components/AmountFooter/index.js +61 -0
- package/lib/components/productCard/components/AmountFooter/index.less +30 -0
- package/lib/components/productCard/components/Divider/index.d.ts +4 -0
- package/lib/components/productCard/components/Divider/index.js +50 -0
- package/lib/components/productCard/components/Divider/index.less +13 -0
- package/lib/components/productCard/components/Header/index.d.ts +4 -0
- package/lib/components/productCard/components/Header/index.js +81 -0
- package/lib/components/productCard/components/Header/index.less +59 -0
- package/lib/components/productCard/components/Holder/index.d.ts +4 -0
- package/lib/components/productCard/components/Holder/index.js +42 -0
- package/lib/components/productCard/components/Holder/index.less +11 -0
- package/lib/components/productCard/components/Note/index.d.ts +4 -0
- package/lib/components/productCard/components/Note/index.js +43 -0
- package/lib/components/productCard/components/Note/index.less +20 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.js +93 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +48 -0
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/components/options/index.js +73 -0
- package/lib/components/productCard/components/Packages/components/options/index.less +28 -0
- package/lib/components/productCard/components/Packages/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/index.js +51 -0
- package/lib/components/productCard/components/Packages/index.less +17 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +20 -0
- package/lib/components/productCard/components/Packages/utils.js +44 -0
- package/lib/components/productCard/components/Sales/index.d.ts +4 -0
- package/lib/components/productCard/components/Sales/index.js +51 -0
- package/lib/components/productCard/components/Sales/index.less +18 -0
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/lib/components/productCard/components/Time/components/Like/index.js +64 -0
- package/lib/components/productCard/components/Time/components/Like/index.less +6 -0
- package/lib/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/lib/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/lib/components/productCard/components/Time/index.d.ts +4 -0
- package/lib/components/productCard/components/Time/index.js +57 -0
- package/lib/components/productCard/components/Time/index.less +25 -0
- package/lib/components/productCard/index.d.ts +5 -0
- package/lib/components/productCard/index.js +101 -0
- package/lib/components/productCard/index.less +48 -0
- package/lib/components/productCard/types.d.ts +10 -0
- package/lib/components/productCard/types.js +17 -0
- package/lib/components/productCard/utils.d.ts +162 -0
- package/lib/components/productCard/utils.js +598 -0
- package/lib/components/record-view/index.d.ts +3 -3
- package/lib/components/record-view/index.js +19 -3
- package/lib/components/section-footers/index.d.ts +8 -0
- package/lib/components/section-footers/index.js +39 -0
- package/lib/components/select-time/RightPanel/index.d.ts +2 -2
- package/lib/components/table/Actions/component/ExportImport/index.js +3 -4
- package/lib/components/table/BasicTable/index.js +5 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.less +1 -1
- package/lib/components/table/Gallery/components/GalleryItem/index.js +18 -4
- package/lib/components/table/Gallery/components/GalleryItem/index.less +1 -0
- package/lib/components/table/Gallery/index.js +14 -3
- package/lib/components/table/Table/index.js +2 -1
- package/lib/components/table/Table/utils.d.ts +15 -3
- package/lib/components/table/Table/utils.js +7 -1
- package/lib/components/table/hooks/useTableSetting.js +23 -9
- package/lib/components/table/hooks/useTransDataSource.d.ts +1 -0
- package/lib/components/table/hooks/useTransDataSource.js +5 -4
- package/lib/components/table/types.d.ts +2 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/index.js +36 -6
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Keyboard/index.js +15 -2
- package/lib/index.d.ts +18 -4
- package/lib/index.js +76 -34
- package/lib/locales/en-US.d.ts +14 -0
- package/lib/locales/en-US.js +16 -1
- package/lib/locales/zh-CN.d.ts +14 -0
- package/lib/locales/zh-CN.js +16 -1
- package/lib/locales/zh-TW.d.ts +14 -0
- package/lib/locales/zh-TW.js +16 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +7 -2
- package/lowcode/badge/meta.ts +8 -8
- package/lowcode/collapse/meta.ts +85 -1
- package/lowcode/pisell-anchor/meta.ts +127 -0
- package/lowcode/pisell-anchor/snippets.ts +20 -0
- package/lowcode/pisell-qrcode/__screenshots__/upload-1.png +0 -0
- package/lowcode/pisell-qrcode/meta.ts +46 -0
- package/lowcode/pisell-qrcode/snippets.ts +12 -0
- package/lowcode/pisell-statistic/meta.ts +83 -0
- package/lowcode/pisell-statistic/snippets.ts +13 -0
- package/lowcode/pisell-tooltip/meta.ts +1 -1
- package/lowcode/pisell-upload/__screenshots__/upload-1.png +0 -0
- package/lowcode/pisell-upload/meta.ts +508 -0
- package/lowcode/pisell-upload/snippets.ts +20 -0
- package/lowcode/pisell-upload-crop/meta.ts +77 -0
- package/lowcode/pisell-upload-crop/snippe.ts +12 -0
- package/lowcode/pisell-wallet-card/meta.ts +141 -0
- package/lowcode/pisell-wallet-card/snippets.ts +26 -0
- package/lowcode/product-card/meta.ts +92 -0
- package/lowcode/product-card/snippets.ts +15 -0
- package/lowcode/record-view/meta.ts +12 -0
- package/lowcode/section-footers/meta.ts +47 -3
- package/lowcode/section-footers/snippe.ts +14 -1
- package/lowcode/statistic/meta.ts +1 -1
- package/lowcode/tabs/meta.ts +51 -51
- package/lowcode/tabs/snippets.ts +36 -36
- package/lowcode/tag/meta.ts +6 -0
- package/lowcode/timeline/meta.ts +12 -3
- package/lowcode/timeline/snippets.ts +2 -0
- package/lowcode/timeline.item/meta.ts +1 -1
- package/package.json +30 -25
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
|
@@ -0,0 +1,598 @@
|
|
|
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/productCard/utils.ts
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
deleteCacheParams: () => deleteCacheParams,
|
|
33
|
+
findNextDuration: () => findNextDuration,
|
|
34
|
+
findNextSlice: () => findNextSlice,
|
|
35
|
+
flexibleObj: () => flexibleObj,
|
|
36
|
+
formatProductListByCategory: () => formatProductListByCategory,
|
|
37
|
+
formatResource: () => formatResource,
|
|
38
|
+
formatTimes: () => formatTimes,
|
|
39
|
+
getCacheParams: () => getCacheParams,
|
|
40
|
+
getDiscountTime: () => getDiscountTime,
|
|
41
|
+
getDuration: () => getDuration,
|
|
42
|
+
getEndDate: () => getEndDate,
|
|
43
|
+
getErrorList: () => getErrorList,
|
|
44
|
+
getIsEdit: () => getIsEdit,
|
|
45
|
+
getLastServer: () => getLastServer,
|
|
46
|
+
getNowTime: () => getNowTime,
|
|
47
|
+
getProductTotalPrice: () => getProductTotalPrice,
|
|
48
|
+
getResourceTimeIsUsable: () => getResourceTimeIsUsable,
|
|
49
|
+
getServeStartTime: () => getServeStartTime,
|
|
50
|
+
getServerItemExtend: () => getServerItemExtend,
|
|
51
|
+
getServiceTime: () => getServiceTime,
|
|
52
|
+
getServiceTimes: () => getServiceTimes,
|
|
53
|
+
getShopOpeningHours: () => getShopOpeningHours,
|
|
54
|
+
isNowTime: () => isNowTime,
|
|
55
|
+
isWalkIn: () => isWalkIn,
|
|
56
|
+
request: () => request,
|
|
57
|
+
sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(utils_exports);
|
|
60
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
61
|
+
var import_utils = require("@pisell/utils");
|
|
62
|
+
var import_lodash = require("lodash");
|
|
63
|
+
var Request = class {
|
|
64
|
+
constructor() {
|
|
65
|
+
this.request = {};
|
|
66
|
+
}
|
|
67
|
+
setRequest(val) {
|
|
68
|
+
this.request = val;
|
|
69
|
+
}
|
|
70
|
+
getRequest() {
|
|
71
|
+
return this.request;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var request = new Request();
|
|
75
|
+
var getDiscountTime = (service_times) => {
|
|
76
|
+
if (!service_times) {
|
|
77
|
+
return "";
|
|
78
|
+
}
|
|
79
|
+
if (service_times < 60) {
|
|
80
|
+
return `${service_times} ${import_utils.locales.getText("pisell2.text.min")}`;
|
|
81
|
+
} else {
|
|
82
|
+
let str = "";
|
|
83
|
+
const hours = Math.floor(service_times / 60);
|
|
84
|
+
const minutes = service_times % 60;
|
|
85
|
+
str += `${hours}${import_utils.locales.getText("pisell2.text.h")}`;
|
|
86
|
+
if (minutes > 0) {
|
|
87
|
+
str += ` ${minutes}${import_utils.locales.getText("pisell2.text.min")}`;
|
|
88
|
+
}
|
|
89
|
+
return str;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var sliceDayIntoFiveMinutes = (config, locale) => {
|
|
93
|
+
let _locale = locale;
|
|
94
|
+
let dayjsLocale = _locale === "en-US" || _locale === "en" ? "en" : "zh-cn";
|
|
95
|
+
import_dayjs.default.locale(dayjsLocale);
|
|
96
|
+
const startTime = (0, import_dayjs.default)().startOf("day");
|
|
97
|
+
const endTime = (0, import_dayjs.default)().endOf("day");
|
|
98
|
+
const timeSlice = (config == null ? void 0 : config.value) || 5;
|
|
99
|
+
let timeSlices = [];
|
|
100
|
+
let durationSlicesBasedOnTime = [];
|
|
101
|
+
let currentTime = startTime;
|
|
102
|
+
while (currentTime.isBefore(endTime)) {
|
|
103
|
+
const timeLabel = currentTime.format("hh:mm A");
|
|
104
|
+
const timeValue = currentTime.format("HH:mm");
|
|
105
|
+
timeSlices.push({ label: timeLabel, value: timeValue });
|
|
106
|
+
const nextTime = currentTime.add(timeSlice, "minute");
|
|
107
|
+
const durationValue = nextTime.diff(startTime, "minute");
|
|
108
|
+
if (durationValue > 60) {
|
|
109
|
+
const durationLabel = getDiscountTime(durationValue);
|
|
110
|
+
durationSlicesBasedOnTime.push({
|
|
111
|
+
label: durationLabel,
|
|
112
|
+
value: durationValue
|
|
113
|
+
});
|
|
114
|
+
} else {
|
|
115
|
+
const durationLabel = `${durationValue} ${import_utils.locales.getText(
|
|
116
|
+
"pisell2.text.min"
|
|
117
|
+
)}`;
|
|
118
|
+
durationSlicesBasedOnTime.push({
|
|
119
|
+
label: durationLabel,
|
|
120
|
+
value: durationValue
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
currentTime = nextTime;
|
|
124
|
+
}
|
|
125
|
+
return { timeSlices, durationSlicesBasedOnTime };
|
|
126
|
+
};
|
|
127
|
+
var getNowTime = () => {
|
|
128
|
+
return (0, import_dayjs.default)().format("HH:mm");
|
|
129
|
+
};
|
|
130
|
+
var isNowTime = (time) => {
|
|
131
|
+
return time === "now";
|
|
132
|
+
};
|
|
133
|
+
var getServeStartTime = (start_time) => {
|
|
134
|
+
if (isNowTime(start_time)) {
|
|
135
|
+
return getNowTime();
|
|
136
|
+
}
|
|
137
|
+
return start_time;
|
|
138
|
+
};
|
|
139
|
+
var getServiceTime = (item, currentDate) => {
|
|
140
|
+
const startDate = (0, import_dayjs.default)(
|
|
141
|
+
currentDate.format("YYYY-MM-DD") + " " + getServeStartTime(item._extend.start_time)
|
|
142
|
+
);
|
|
143
|
+
const startTime = startDate.format("HH:mm");
|
|
144
|
+
const endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
145
|
+
const duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
146
|
+
return `${startTime} - ${endTime} ( ${duration} )`;
|
|
147
|
+
};
|
|
148
|
+
var findNextSlice = ({
|
|
149
|
+
timeSlices = [],
|
|
150
|
+
index = 0,
|
|
151
|
+
date = ""
|
|
152
|
+
}) => {
|
|
153
|
+
const currentTimeValue = date || (0, import_dayjs.default)().format("HH:mm");
|
|
154
|
+
for (let i = 0; i < timeSlices.length; i++) {
|
|
155
|
+
if (timeSlices[i].value !== "now") {
|
|
156
|
+
if (timeSlices[i].value >= currentTimeValue) {
|
|
157
|
+
return timeSlices[i].value;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return timeSlices[index].value;
|
|
162
|
+
};
|
|
163
|
+
var findNextDuration = (current, array, defaultValue) => {
|
|
164
|
+
for (let i = 0; i < array.length; i++) {
|
|
165
|
+
if (array[i].value == (current == null ? void 0 : current.value)) {
|
|
166
|
+
return array[i].value;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return defaultValue || array[0].value;
|
|
170
|
+
};
|
|
171
|
+
var formatProductListByCategory = (list, filterItem) => {
|
|
172
|
+
let _list = list || [];
|
|
173
|
+
if (filterItem) {
|
|
174
|
+
_list = _list.filter(filterItem);
|
|
175
|
+
}
|
|
176
|
+
let categoryObject = {};
|
|
177
|
+
for (let i = 0; i < _list.length; i++) {
|
|
178
|
+
const productItem = _list[i];
|
|
179
|
+
if ((productItem.category || []).length) {
|
|
180
|
+
for (let j = 0; j < productItem.category.length; j++) {
|
|
181
|
+
let categoryItem = productItem.category[j];
|
|
182
|
+
if (!categoryObject[categoryItem.id]) {
|
|
183
|
+
categoryObject[categoryItem.id] = {
|
|
184
|
+
...categoryItem,
|
|
185
|
+
products: []
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
categoryObject[categoryItem.id] = {
|
|
189
|
+
...categoryItem,
|
|
190
|
+
products: [...categoryObject[categoryItem.id].products, productItem]
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
if (!categoryObject["other"]) {
|
|
195
|
+
categoryObject["other"] = {
|
|
196
|
+
id: 0,
|
|
197
|
+
title: import_utils.locales.getText("pisell2.text.other"),
|
|
198
|
+
name: import_utils.locales.getText("pisell2.text.other"),
|
|
199
|
+
cover: "",
|
|
200
|
+
products: []
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
categoryObject["other"] = {
|
|
204
|
+
...categoryObject["other"],
|
|
205
|
+
products: [...categoryObject["other"].products, productItem]
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return Object.values(categoryObject).sort((a, b) => b.sort - a.sort);
|
|
210
|
+
};
|
|
211
|
+
var getResourceTimeIsUsable = (item, cacheItem) => {
|
|
212
|
+
const startDate = (0, import_dayjs.default)(
|
|
213
|
+
cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time)
|
|
214
|
+
);
|
|
215
|
+
const isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
216
|
+
let isMaxLimitRange = false;
|
|
217
|
+
let isDateRange = false;
|
|
218
|
+
let time = { ...item };
|
|
219
|
+
if (time.max_participants_limit == 0) {
|
|
220
|
+
isMaxLimitRange = true;
|
|
221
|
+
} else {
|
|
222
|
+
isMaxLimitRange = "unknown";
|
|
223
|
+
}
|
|
224
|
+
const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(
|
|
225
|
+
1,
|
|
226
|
+
"second"
|
|
227
|
+
);
|
|
228
|
+
const timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(
|
|
229
|
+
1,
|
|
230
|
+
"second"
|
|
231
|
+
);
|
|
232
|
+
let bol;
|
|
233
|
+
if (isFlexible) {
|
|
234
|
+
bol = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
|
|
235
|
+
} else {
|
|
236
|
+
let endDate = startDate.add(
|
|
237
|
+
flexibleObj.getValue(cacheItem._extend.duration),
|
|
238
|
+
"minute"
|
|
239
|
+
);
|
|
240
|
+
bol = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
|
|
241
|
+
}
|
|
242
|
+
if (bol) {
|
|
243
|
+
isDateRange = true;
|
|
244
|
+
}
|
|
245
|
+
const isUsable = isDateRange;
|
|
246
|
+
time._extend = {
|
|
247
|
+
isMaxLimitRange,
|
|
248
|
+
isDateRange,
|
|
249
|
+
isUsable
|
|
250
|
+
};
|
|
251
|
+
return time;
|
|
252
|
+
};
|
|
253
|
+
var formatTimes = (resourceItem, cacheItem) => {
|
|
254
|
+
let usableTimes = [];
|
|
255
|
+
let _resourceItem = { ...resourceItem };
|
|
256
|
+
_resourceItem.times = _resourceItem.times.map((time) => {
|
|
257
|
+
let _time2 = getResourceTimeIsUsable(time, cacheItem);
|
|
258
|
+
if (_time2 == null ? void 0 : _time2._extend.isUsable) {
|
|
259
|
+
usableTimes.push(_time2);
|
|
260
|
+
}
|
|
261
|
+
return _time2;
|
|
262
|
+
});
|
|
263
|
+
let _time = (usableTimes || []).sort((a, b) => {
|
|
264
|
+
const aEndDate = (0, import_dayjs.default)(a.end_date + " " + a.end_time).valueOf();
|
|
265
|
+
const bEndDate = (0, import_dayjs.default)(b.end_date + " " + b.end_time).valueOf();
|
|
266
|
+
return aEndDate - bEndDate;
|
|
267
|
+
})[0];
|
|
268
|
+
resourceItem._extend = {
|
|
269
|
+
...resourceItem._extend,
|
|
270
|
+
usableTime: _time
|
|
271
|
+
};
|
|
272
|
+
return resourceItem;
|
|
273
|
+
};
|
|
274
|
+
var formatResourceProducts = (resourceItem, currentItem) => {
|
|
275
|
+
var _a;
|
|
276
|
+
let usableProduct = false;
|
|
277
|
+
let _resourceItem = { ...resourceItem };
|
|
278
|
+
const type = _resourceItem.partyroom_package.type;
|
|
279
|
+
if (type === "product_all") {
|
|
280
|
+
usableProduct = true;
|
|
281
|
+
} else {
|
|
282
|
+
if (type === "product_collection") {
|
|
283
|
+
usableProduct = !!(0, import_lodash.intersectionBy)(
|
|
284
|
+
((_a = _resourceItem.partyroom_package) == null ? void 0 : _a.products.map((item) => ({
|
|
285
|
+
...item,
|
|
286
|
+
id: item.product_collection_id
|
|
287
|
+
}))) || [],
|
|
288
|
+
currentItem.collection || [],
|
|
289
|
+
"id"
|
|
290
|
+
).length;
|
|
291
|
+
} else {
|
|
292
|
+
usableProduct = _resourceItem.partyroom_package.products.some(
|
|
293
|
+
(item) => {
|
|
294
|
+
if (type === "products") {
|
|
295
|
+
if (item.product_id == currentItem.product_id) {
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
resourceItem._extend = {
|
|
304
|
+
...resourceItem._extend,
|
|
305
|
+
// 是否可用
|
|
306
|
+
usableProduct
|
|
307
|
+
};
|
|
308
|
+
return resourceItem;
|
|
309
|
+
};
|
|
310
|
+
var getShopOpeningHours = () => {
|
|
311
|
+
return localStorage.getItem("shopOpeningHours") || "23:59";
|
|
312
|
+
};
|
|
313
|
+
var flexibleObj = {
|
|
314
|
+
// 创建, 增加前缀
|
|
315
|
+
create: (num) => {
|
|
316
|
+
return `flexible_${num}`;
|
|
317
|
+
},
|
|
318
|
+
// 格式化, 去除前缀
|
|
319
|
+
getValue: (str) => {
|
|
320
|
+
if (typeof str === "string" && flexibleObj.isFlexible(str)) {
|
|
321
|
+
return Number(str.replace("flexible_", ""));
|
|
322
|
+
}
|
|
323
|
+
return str;
|
|
324
|
+
},
|
|
325
|
+
// 判断当前时长是否为灵活时长
|
|
326
|
+
isFlexible: (str) => {
|
|
327
|
+
if (typeof str !== "string") {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
return str.indexOf("flexible_") > -1;
|
|
331
|
+
},
|
|
332
|
+
add: (current, duration) => {
|
|
333
|
+
if (flexibleObj.isFlexible(current)) {
|
|
334
|
+
return flexibleObj.create(
|
|
335
|
+
flexibleObj.getValue(current) + duration
|
|
336
|
+
);
|
|
337
|
+
} else {
|
|
338
|
+
return Number(current) + duration;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
var getEndDate = (startDate, duration, endDate) => {
|
|
343
|
+
if (duration === "flexible") {
|
|
344
|
+
let openingDate = (0, import_dayjs.default)(
|
|
345
|
+
startDate.format("YYYY-MM-DD") + " " + getShopOpeningHours()
|
|
346
|
+
);
|
|
347
|
+
if ((0, import_dayjs.default)(startDate).isAfter(openingDate)) {
|
|
348
|
+
openingDate = openingDate.add(1, "day");
|
|
349
|
+
}
|
|
350
|
+
if (!endDate) {
|
|
351
|
+
return openingDate;
|
|
352
|
+
}
|
|
353
|
+
endDate = (0, import_dayjs.default)(endDate);
|
|
354
|
+
if (endDate.isAfter(openingDate)) {
|
|
355
|
+
return openingDate;
|
|
356
|
+
}
|
|
357
|
+
return endDate;
|
|
358
|
+
}
|
|
359
|
+
return startDate.add(duration, "minute");
|
|
360
|
+
};
|
|
361
|
+
var getServiceTimes = (service) => {
|
|
362
|
+
const startDate = (0, import_dayjs.default)(
|
|
363
|
+
(0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time)
|
|
364
|
+
);
|
|
365
|
+
const endDate = startDate.add(
|
|
366
|
+
flexibleObj.getValue(service._extend.duration),
|
|
367
|
+
"minute"
|
|
368
|
+
);
|
|
369
|
+
return {
|
|
370
|
+
startDate,
|
|
371
|
+
endDate
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
var getErrorList = (resource, cacheItem) => {
|
|
375
|
+
var _a, _b, _c;
|
|
376
|
+
if (!(cacheItem == null ? void 0 : cacheItem.id)) {
|
|
377
|
+
return [
|
|
378
|
+
{
|
|
379
|
+
label: import_utils.locales.getText("pisell2.text.no-product-added"),
|
|
380
|
+
type: "products"
|
|
381
|
+
}
|
|
382
|
+
];
|
|
383
|
+
}
|
|
384
|
+
if (!resource || !resource._extend || !cacheItem) {
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
let list = [];
|
|
388
|
+
if (!resource.usable) {
|
|
389
|
+
if (!((_a = resource == null ? void 0 : resource._extend) == null ? void 0 : _a.usableProduct)) {
|
|
390
|
+
list.push({
|
|
391
|
+
label: import_utils.locales.getText("pisell1.text.resource-error-message-1")(
|
|
392
|
+
resource.labelText,
|
|
393
|
+
cacheItem == null ? void 0 : cacheItem.title
|
|
394
|
+
),
|
|
395
|
+
type: "product"
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
const { startDate, endDate } = getServiceTimes(cacheItem);
|
|
399
|
+
const startText = startDate.format("hh:mm A");
|
|
400
|
+
let endText = endDate.format("hh:mm A");
|
|
401
|
+
if ((0, import_dayjs.default)(endDate).isAfter(startDate, "day")) {
|
|
402
|
+
endText = import_utils.locales.getText("pisell1.text.tomorrow") + endText;
|
|
403
|
+
}
|
|
404
|
+
if (!((_b = resource._extend) == null ? void 0 : _b.usableTime)) {
|
|
405
|
+
list.push({
|
|
406
|
+
label: import_utils.locales.getText("pisell1.text.resource-error-message-2")(
|
|
407
|
+
resource.labelText,
|
|
408
|
+
startText,
|
|
409
|
+
endText
|
|
410
|
+
),
|
|
411
|
+
type: "time"
|
|
412
|
+
});
|
|
413
|
+
} else {
|
|
414
|
+
if (!((_c = resource._extend) == null ? void 0 : _c.usableTime._extend.isMaxLimitRange)) {
|
|
415
|
+
list.push({
|
|
416
|
+
label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(
|
|
417
|
+
resource.labelText,
|
|
418
|
+
startText,
|
|
419
|
+
endText
|
|
420
|
+
),
|
|
421
|
+
type: "limit"
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return list;
|
|
427
|
+
};
|
|
428
|
+
var formatResource = (resourceItem, cacheItem, formatLabel) => {
|
|
429
|
+
let _resourceItem = { ...resourceItem };
|
|
430
|
+
_resourceItem = formatTimes(_resourceItem, cacheItem);
|
|
431
|
+
_resourceItem = formatResourceProducts(_resourceItem, cacheItem);
|
|
432
|
+
_resourceItem.labelText = _resourceItem.room_name || _resourceItem.name;
|
|
433
|
+
const usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
|
|
434
|
+
_resourceItem.usable = usable;
|
|
435
|
+
if (formatLabel) {
|
|
436
|
+
_resourceItem.label = formatLabel(_resourceItem);
|
|
437
|
+
}
|
|
438
|
+
return _resourceItem;
|
|
439
|
+
};
|
|
440
|
+
var getLastServer = (list) => {
|
|
441
|
+
return list[list.length - 1];
|
|
442
|
+
};
|
|
443
|
+
var getCacheParams = () => {
|
|
444
|
+
const sessionData = sessionStorage.getItem("pisell2.booking.serviceParams");
|
|
445
|
+
const data = sessionData ? JSON.parse(sessionData) : null;
|
|
446
|
+
return data == null ? void 0 : data.serviceParams;
|
|
447
|
+
};
|
|
448
|
+
var deleteCacheParams = () => {
|
|
449
|
+
sessionStorage.removeItem("pisell2.booking.serviceParams");
|
|
450
|
+
};
|
|
451
|
+
var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
452
|
+
var _a;
|
|
453
|
+
if (!cacheItem.new && cacheItem._extend.endDate) {
|
|
454
|
+
return cacheItem._extend;
|
|
455
|
+
}
|
|
456
|
+
let lastServer = getLastServer(state.service.value);
|
|
457
|
+
let _extend = {
|
|
458
|
+
duration: findNextDuration(
|
|
459
|
+
cacheItem.duration,
|
|
460
|
+
timeObj.durationSlicesBasedOnTime,
|
|
461
|
+
(_a = cacheItem == null ? void 0 : cacheItem.duration) == null ? void 0 : _a.value
|
|
462
|
+
)
|
|
463
|
+
};
|
|
464
|
+
if (lastServer) {
|
|
465
|
+
_extend.resource = lastServer._extend.resource;
|
|
466
|
+
let lastServerStartDate = lastServer._extend.startDate;
|
|
467
|
+
let lastServerEndDate = lastServer._extend.endDate;
|
|
468
|
+
if ((0, import_dayjs.default)(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
|
|
469
|
+
_extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
|
|
470
|
+
} else {
|
|
471
|
+
_extend.start_time = lastServerEndDate.format("HH:mm");
|
|
472
|
+
}
|
|
473
|
+
} else {
|
|
474
|
+
let findNextSliceProps = {
|
|
475
|
+
timeSlices: timeObj.timeSlices,
|
|
476
|
+
index: 0,
|
|
477
|
+
date: ""
|
|
478
|
+
};
|
|
479
|
+
const serviceParams = getCacheParams();
|
|
480
|
+
if (serviceParams) {
|
|
481
|
+
let str = serviceParams.start_date;
|
|
482
|
+
if (str) {
|
|
483
|
+
findNextSliceProps.date = (0, import_dayjs.default)(str).format("HH:mm");
|
|
484
|
+
}
|
|
485
|
+
let resourceId = Number(serviceParams.resource_id);
|
|
486
|
+
if (resourceId || resourceId === 0) {
|
|
487
|
+
_extend.resource = resourceId;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (findNextSliceProps.date && findNextSliceProps.date !== "00:00") {
|
|
491
|
+
_extend.start_time = findNextSlice(findNextSliceProps);
|
|
492
|
+
} else {
|
|
493
|
+
if (cacheItem.currentDefaultTime) {
|
|
494
|
+
_extend.start_time = cacheItem.currentDefaultTime;
|
|
495
|
+
} else {
|
|
496
|
+
_extend.start_time = (0, import_dayjs.default)().format("HH:mm");
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
_extend = {
|
|
501
|
+
..._extend,
|
|
502
|
+
...cacheItem._extend
|
|
503
|
+
};
|
|
504
|
+
return _extend;
|
|
505
|
+
};
|
|
506
|
+
var getProductTotalPrice = (item) => {
|
|
507
|
+
var _a;
|
|
508
|
+
let price = 0;
|
|
509
|
+
price += Number(item._extend.price);
|
|
510
|
+
let other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
511
|
+
if (other == null ? void 0 : other.bundle) {
|
|
512
|
+
price = other == null ? void 0 : other.bundle.reduce((accumulator, currentValue) => {
|
|
513
|
+
return accumulator + Number(currentValue.price) * Number(currentValue.num);
|
|
514
|
+
}, price);
|
|
515
|
+
}
|
|
516
|
+
price = price;
|
|
517
|
+
return price;
|
|
518
|
+
};
|
|
519
|
+
var getDuration = (duration) => {
|
|
520
|
+
if (typeof duration === "number") {
|
|
521
|
+
return duration;
|
|
522
|
+
}
|
|
523
|
+
if (typeof duration === "object") {
|
|
524
|
+
if (duration.type === "minutes") {
|
|
525
|
+
return duration.value;
|
|
526
|
+
}
|
|
527
|
+
if (duration.type === "flexible") {
|
|
528
|
+
return "flexible";
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return duration;
|
|
532
|
+
};
|
|
533
|
+
var isWalkIn = (customer_id) => {
|
|
534
|
+
if (customer_id === void 0) {
|
|
535
|
+
return true;
|
|
536
|
+
}
|
|
537
|
+
if (typeof customer_id === "string") {
|
|
538
|
+
return ["", "0", "1"].includes(customer_id);
|
|
539
|
+
}
|
|
540
|
+
return [0, 1].includes(customer_id);
|
|
541
|
+
};
|
|
542
|
+
var getIsEdit = (state) => {
|
|
543
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
544
|
+
if ((_a = state.addons) == null ? void 0 : _a.edit) {
|
|
545
|
+
return true;
|
|
546
|
+
}
|
|
547
|
+
if (!state.bookingId) {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
if ((_b = state.client) == null ? void 0 : _b.edit) {
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
if ((_c = state.date) == null ? void 0 : _c.edit) {
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
if ((_d = state.pet) == null ? void 0 : _d.edit) {
|
|
557
|
+
return true;
|
|
558
|
+
}
|
|
559
|
+
if ((_e = state.service) == null ? void 0 : _e.edit) {
|
|
560
|
+
return true;
|
|
561
|
+
}
|
|
562
|
+
if ((_f = state.notes) == null ? void 0 : _f.edit) {
|
|
563
|
+
return true;
|
|
564
|
+
}
|
|
565
|
+
if ((_g = state.contacts) == null ? void 0 : _g.edit) {
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
return false;
|
|
569
|
+
};
|
|
570
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
571
|
+
0 && (module.exports = {
|
|
572
|
+
deleteCacheParams,
|
|
573
|
+
findNextDuration,
|
|
574
|
+
findNextSlice,
|
|
575
|
+
flexibleObj,
|
|
576
|
+
formatProductListByCategory,
|
|
577
|
+
formatResource,
|
|
578
|
+
formatTimes,
|
|
579
|
+
getCacheParams,
|
|
580
|
+
getDiscountTime,
|
|
581
|
+
getDuration,
|
|
582
|
+
getEndDate,
|
|
583
|
+
getErrorList,
|
|
584
|
+
getIsEdit,
|
|
585
|
+
getLastServer,
|
|
586
|
+
getNowTime,
|
|
587
|
+
getProductTotalPrice,
|
|
588
|
+
getResourceTimeIsUsable,
|
|
589
|
+
getServeStartTime,
|
|
590
|
+
getServerItemExtend,
|
|
591
|
+
getServiceTime,
|
|
592
|
+
getServiceTimes,
|
|
593
|
+
getShopOpeningHours,
|
|
594
|
+
isNowTime,
|
|
595
|
+
isWalkIn,
|
|
596
|
+
request,
|
|
597
|
+
sliceDayIntoFiveMinutes
|
|
598
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
3
|
export interface RecordViewProps {
|
|
4
4
|
dataSource: any[];
|
|
5
5
|
header?: React.ReactNode;
|
|
@@ -15,7 +15,7 @@ export interface RecordViewProps {
|
|
|
15
15
|
pagination?: object;
|
|
16
16
|
style?: React.CSSProperties;
|
|
17
17
|
onRowClick: (item: any) => void;
|
|
18
|
-
paginationType?:
|
|
18
|
+
paginationType?: 'default' | 'scroll';
|
|
19
19
|
listGap?: number;
|
|
20
20
|
loadMoreData?: () => void;
|
|
21
21
|
listHeight?: number;
|
|
@@ -126,14 +126,15 @@ var RecordView = (props) => {
|
|
|
126
126
|
}, []);
|
|
127
127
|
const list = (0, import_react.useMemo)(() => {
|
|
128
128
|
if (paginationType === "scroll") {
|
|
129
|
-
return /* @__PURE__ */ import_react.default.createElement("div",
|
|
129
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-left-wrap` }, header && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}scroll-header-wrap` }, header), /* @__PURE__ */ import_react.default.createElement(
|
|
130
130
|
"div",
|
|
131
131
|
{
|
|
132
132
|
id: scrollListId,
|
|
133
133
|
style: {
|
|
134
134
|
height: listHeight || 400,
|
|
135
135
|
overflow: "auto"
|
|
136
|
-
}
|
|
136
|
+
},
|
|
137
|
+
className: `${prefix}scroll-content-wrap`
|
|
137
138
|
},
|
|
138
139
|
/* @__PURE__ */ import_react.default.createElement(
|
|
139
140
|
import_react_infinite_scroll_component.default,
|
|
@@ -167,7 +168,22 @@ var RecordView = (props) => {
|
|
|
167
168
|
emptyDom
|
|
168
169
|
);
|
|
169
170
|
}, [props, _renderItem, _footer]);
|
|
170
|
-
|
|
171
|
+
console.log(
|
|
172
|
+
"%c [ detail ]-209",
|
|
173
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
174
|
+
detail
|
|
175
|
+
);
|
|
176
|
+
console.log(
|
|
177
|
+
"%c [ _leftSpan ]-214",
|
|
178
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
179
|
+
_leftSpan
|
|
180
|
+
);
|
|
181
|
+
console.log(
|
|
182
|
+
"%c [ rightSpan ]-215",
|
|
183
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
184
|
+
rightSpan
|
|
185
|
+
);
|
|
186
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { gutter, style, className: `${prefix}record-view` }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: _leftSpan, className: `${prefix}record-view-left` }, list), !detailModalDisplay && /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: rightSpan }, detail), detailModalShow && detailModalDisplay && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}detail-modal-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}modal-header` }, /* @__PURE__ */ import_react.default.createElement(
|
|
171
187
|
import_icons.CloseOutlined,
|
|
172
188
|
{
|
|
173
189
|
className: `${prefix}close-icon`,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface SectionFooterProps {
|
|
3
|
+
left?: React.ReactNode;
|
|
4
|
+
middle?: React.ReactNode;
|
|
5
|
+
right?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const SectionFooters: (props: SectionFooterProps) => import("react").JSX.Element;
|
|
8
|
+
export default SectionFooters;
|
|
@@ -0,0 +1,39 @@
|
|
|
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/section-footers/index.tsx
|
|
20
|
+
var section_footers_exports = {};
|
|
21
|
+
__export(section_footers_exports, {
|
|
22
|
+
default: () => section_footers_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(section_footers_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_antd = require("antd");
|
|
27
|
+
var SectionFooters = (props) => {
|
|
28
|
+
console.log(
|
|
29
|
+
"%c [ props ]-6",
|
|
30
|
+
"font-size:13px; background:pink; color:#bf2c9f;",
|
|
31
|
+
props
|
|
32
|
+
);
|
|
33
|
+
(0, import_react.useEffect)(() => {
|
|
34
|
+
document.body.id = "body";
|
|
35
|
+
}, []);
|
|
36
|
+
const { left, middle, right } = props;
|
|
37
|
+
return /* @__PURE__ */ React.createElement(import_antd.Flex, { gap: "middle", justify: "space-between" }, left, middle, right);
|
|
38
|
+
};
|
|
39
|
+
var section_footers_default = SectionFooters;
|