@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
|
@@ -13,7 +13,8 @@ import { DndContext, useSensor, useSensors, PointerSensor } from '@dnd-kit/core'
|
|
|
13
13
|
import { SortableContext, verticalListSortingStrategy, arrayMove } from '@dnd-kit/sortable';
|
|
14
14
|
import TreeItem from "./TreeItem";
|
|
15
15
|
import { restrictToVerticalAxis, restrictToParentElement } from '@dnd-kit/modifiers';
|
|
16
|
-
import
|
|
16
|
+
// import './index.less';
|
|
17
|
+
|
|
17
18
|
var DragSortTree = function DragSortTree(props) {
|
|
18
19
|
var value = props.value,
|
|
19
20
|
rowKey = props.rowKey,
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
var MyIcon = createFromIconfontCN({
|
|
5
|
-
scriptUrl: 'https://
|
|
5
|
+
scriptUrl: 'https://static.pisellcdn.com/pisell2iconfont.js' // 在 iconfont.cn 上生成
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
var IconFont = function IconFont(props) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnchorProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface PisellAnchorProps extends AnchorProps {
|
|
5
|
+
items: any[];
|
|
6
|
+
direction: 'horizontal' | 'vertical';
|
|
7
|
+
scrollNumber: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* PisellAnchor锚点组件
|
|
11
|
+
* @param props
|
|
12
|
+
* @constructor
|
|
13
|
+
*/
|
|
14
|
+
declare const PisellAnchor: (props: PisellAnchorProps) => React.JSX.Element;
|
|
15
|
+
export default PisellAnchor;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { Anchor, Flex, Button } from 'antd';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { useDebounceFn } from 'ahooks';
|
|
12
|
+
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
|
|
13
|
+
import "./index.less";
|
|
14
|
+
/**
|
|
15
|
+
* PisellAnchor锚点组件
|
|
16
|
+
* @param props
|
|
17
|
+
* @constructor
|
|
18
|
+
*/
|
|
19
|
+
var PisellAnchor = function PisellAnchor(props) {
|
|
20
|
+
console.log('%c [ props ]-21', 'font-size:13px; background:pink; color:#bf2c9f;', props);
|
|
21
|
+
var _useState = useState(true),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
leftDisabled = _useState2[0],
|
|
24
|
+
setLeftDisabled = _useState2[1];
|
|
25
|
+
var _useState3 = useState(false),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
rightDisabled = _useState4[0],
|
|
28
|
+
setRightDisabled = _useState4[1];
|
|
29
|
+
var _props$items = props.items,
|
|
30
|
+
items = _props$items === void 0 ? [] : _props$items,
|
|
31
|
+
direction = props.direction,
|
|
32
|
+
_props$scrollNumber = props.scrollNumber,
|
|
33
|
+
scrollNumber = _props$scrollNumber === void 0 ? 1 : _props$scrollNumber;
|
|
34
|
+
var InnerProps = {
|
|
35
|
+
onChange: function onChange(key) {
|
|
36
|
+
console.log(key);
|
|
37
|
+
},
|
|
38
|
+
getCurrentAnchor: function getCurrentAnchor() {
|
|
39
|
+
if (items.length > 0) {
|
|
40
|
+
return items[0].href;
|
|
41
|
+
}
|
|
42
|
+
return '';
|
|
43
|
+
},
|
|
44
|
+
items: items
|
|
45
|
+
};
|
|
46
|
+
var itemsWidth = 0;
|
|
47
|
+
var containerWidth = 0;
|
|
48
|
+
// useEffect(() => {
|
|
49
|
+
// document.body.id = 'body';
|
|
50
|
+
// const itemsContainer = document.querySelector('.pisell-lowcode-anchor');
|
|
51
|
+
// if (itemsContainer) {
|
|
52
|
+
// itemsWidth = itemsContainer.offsetWidth;
|
|
53
|
+
// }
|
|
54
|
+
// if (srcollContainer) {
|
|
55
|
+
// containerWidth = srcollContainer.offsetWidth;
|
|
56
|
+
// setRightDisabled(containerWidth > itemsWidth);
|
|
57
|
+
// srcollContainer.addEventListener('scroll', debouncedScroll.run);
|
|
58
|
+
// return () => {
|
|
59
|
+
// srcollContainer.removeEventListener('scroll', debouncedScroll.run);
|
|
60
|
+
// };
|
|
61
|
+
// }
|
|
62
|
+
// }, []);
|
|
63
|
+
|
|
64
|
+
var handleScroll = function handleScroll(e) {
|
|
65
|
+
var left = e.target.scrollLeft;
|
|
66
|
+
console.log('滚动位置:', left);
|
|
67
|
+
setLeftDisabled(left === 0);
|
|
68
|
+
// setRightDisabled(containerWidth + left >= itemsWidth);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var debouncedScroll = useDebounceFn(handleScroll, {
|
|
72
|
+
wait: 1000
|
|
73
|
+
});
|
|
74
|
+
var scrollToAnchor = function scrollToAnchor(_ref) {
|
|
75
|
+
var direction = _ref.direction;
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: classNames('pisell-anchor-wapper')
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Anchor, _extends({
|
|
80
|
+
direction: "horizontal"
|
|
81
|
+
}, InnerProps)), /*#__PURE__*/React.createElement(Flex, {
|
|
82
|
+
className: 'pisell-anchor-control'
|
|
83
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
84
|
+
icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
|
|
85
|
+
shape: "circle",
|
|
86
|
+
disabled: leftDisabled,
|
|
87
|
+
onClick: function onClick() {
|
|
88
|
+
return scrollToAnchor({
|
|
89
|
+
direction: 'left'
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
93
|
+
icon: /*#__PURE__*/React.createElement(RightOutlined, null),
|
|
94
|
+
shape: "circle",
|
|
95
|
+
disabled: rightDisabled,
|
|
96
|
+
onClick: function onClick() {
|
|
97
|
+
return scrollToAnchor({
|
|
98
|
+
direction: 'right'
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
})), items.map(function (item) {
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
id: "".concat(item.key),
|
|
104
|
+
className: classNames('pisell-anchor-content'),
|
|
105
|
+
style: {
|
|
106
|
+
width: '100vw',
|
|
107
|
+
height: '100vh',
|
|
108
|
+
textAlign: 'center',
|
|
109
|
+
background: 'rgba(0,255,0,0.02)'
|
|
110
|
+
}
|
|
111
|
+
}, "\u8FD9\u662F", item.title, "\u7684\u5185\u5BB9");
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
export default PisellAnchor;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// .pisell-anchor-wapper {
|
|
2
|
+
// width: 100%;
|
|
3
|
+
// overflow: hidden;
|
|
4
|
+
// .pisell-anchor-control {
|
|
5
|
+
// display: flex;
|
|
6
|
+
// position: absolute;
|
|
7
|
+
// top: 0;
|
|
8
|
+
// right: 0;
|
|
9
|
+
// z-index: 10;
|
|
10
|
+
// }
|
|
11
|
+
|
|
12
|
+
// .pisell-lowcode-anchor-wrapper {
|
|
13
|
+
// position: relative;
|
|
14
|
+
// height: 48px;
|
|
15
|
+
// width: 500px;
|
|
16
|
+
// margin: 0 auto;
|
|
17
|
+
// overflow-x: auto;
|
|
18
|
+
// scroll-snap-type: x mandatory;
|
|
19
|
+
// scroll-behavior: smooth;
|
|
20
|
+
// overflow-y: hidden;
|
|
21
|
+
|
|
22
|
+
// &::-webkit-scrollbar {
|
|
23
|
+
// display: none;
|
|
24
|
+
// }
|
|
25
|
+
// &::after {
|
|
26
|
+
// position: absolute;
|
|
27
|
+
// right: 0;
|
|
28
|
+
// top: 0;
|
|
29
|
+
// content: '';
|
|
30
|
+
// display: inline-block;
|
|
31
|
+
// width: 64px;
|
|
32
|
+
// height: 44px;
|
|
33
|
+
|
|
34
|
+
// background: linear-gradient(to right, #0000, #fff);
|
|
35
|
+
// }
|
|
36
|
+
// .pisell-lowcode-anchor {
|
|
37
|
+
// height: 44px;
|
|
38
|
+
// background-color: #fff;
|
|
39
|
+
// width: max-content;
|
|
40
|
+
// display: inline-block;
|
|
41
|
+
// .pisell-lowcode-anchor-ink-visible {
|
|
42
|
+
// display: none;
|
|
43
|
+
// }
|
|
44
|
+
// .pisell-lowcode-anchor-link {
|
|
45
|
+
// scroll-snap-align: start;
|
|
46
|
+
// max-width: 200px;
|
|
47
|
+
// // overflow: hidden;
|
|
48
|
+
// text-overflow: ellipsis;
|
|
49
|
+
// display: inline-block;
|
|
50
|
+
|
|
51
|
+
// padding: 12px 16px;
|
|
52
|
+
// height: 44px;
|
|
53
|
+
// box-sizing: border-box;
|
|
54
|
+
// align-items: center;
|
|
55
|
+
// background-color: #fff;
|
|
56
|
+
|
|
57
|
+
// .pisell-lowcode-anchor-link-title {
|
|
58
|
+
// color: var(--Gray-900, #101828);
|
|
59
|
+
|
|
60
|
+
// /* Text md/Semibold */
|
|
61
|
+
// font-family: Inter;
|
|
62
|
+
// font-size: 16px;
|
|
63
|
+
// font-style: normal;
|
|
64
|
+
// font-weight: 600;
|
|
65
|
+
// line-height: 24px; /* 150% */
|
|
66
|
+
// &:active,
|
|
67
|
+
// &:hover,
|
|
68
|
+
// &:visited,
|
|
69
|
+
// &:link {
|
|
70
|
+
// text-decoration: none;
|
|
71
|
+
// }
|
|
72
|
+
// }
|
|
73
|
+
|
|
74
|
+
// &.pisell-lowcode-anchor-link-active {
|
|
75
|
+
// border-radius: 100px;
|
|
76
|
+
// background: var(--Primary-600, #7f56d9);
|
|
77
|
+
// .pisell-lowcode-anchor-link-title {
|
|
78
|
+
// color: var(--White, #fff);
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
// // &:hover {
|
|
82
|
+
// // border-radius: 88px;
|
|
83
|
+
// // background: var(--Gray-100, #f2f4f7);
|
|
84
|
+
// // }
|
|
85
|
+
// }
|
|
86
|
+
// .pisell-lowcode-anchor-link + .pisell-lowcode-anchor-link {
|
|
87
|
+
// margin-left: 12px;
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
// .pisell-anchor-content {
|
|
92
|
+
// width: 100%;
|
|
93
|
+
// height: 300px;
|
|
94
|
+
// line-height: 300px;
|
|
95
|
+
// font-size: 30px;
|
|
96
|
+
// text-align: center;
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
@@ -11,7 +11,7 @@ import Iconfont from "../../iconfont";
|
|
|
11
11
|
import "./index.less";
|
|
12
12
|
import { getText } from "../../../locales";
|
|
13
13
|
var PisellEntryInput = function PisellEntryInput(props) {
|
|
14
|
-
var
|
|
14
|
+
var _onChange = props.onChange,
|
|
15
15
|
searchDescribe = props.searchDescribe;
|
|
16
16
|
var _useState = useState(''),
|
|
17
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -25,7 +25,13 @@ var PisellEntryInput = function PisellEntryInput(props) {
|
|
|
25
25
|
autoFocus: true,
|
|
26
26
|
value: value,
|
|
27
27
|
onChange: function onChange(e) {
|
|
28
|
-
|
|
28
|
+
setValue(e.target.value);
|
|
29
|
+
if (!e.target.value) {
|
|
30
|
+
_onChange(e.target.value);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
onPressEnter: function onPressEnter(e) {
|
|
34
|
+
_onChange(value);
|
|
29
35
|
},
|
|
30
36
|
style: {
|
|
31
37
|
flex: 1
|
|
@@ -40,7 +46,7 @@ var PisellEntryInput = function PisellEntryInput(props) {
|
|
|
40
46
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
41
47
|
size: "large",
|
|
42
48
|
onClick: function onClick() {
|
|
43
|
-
return
|
|
49
|
+
return _onChange(value);
|
|
44
50
|
},
|
|
45
51
|
disabled: !value
|
|
46
52
|
}, getText('pisell-information-entry-input-search'))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { EntryModeType } from './index';
|
|
2
2
|
export declare const entryModeTextIcon: Record<EntryModeType['type'], any>;
|
|
3
|
+
export declare const entryModeErrorTextIcon: {
|
|
4
|
+
scanner: {
|
|
5
|
+
icon: string;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
nfc: {
|
|
9
|
+
icon: string;
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
3
13
|
export declare const passiveModeType: string[];
|
|
@@ -16,6 +16,16 @@ export var entryModeTextIcon = {
|
|
|
16
16
|
text: 'NFC ready'
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
+
export var entryModeErrorTextIcon = {
|
|
20
|
+
scanner: {
|
|
21
|
+
icon: 'pisell2-a-Scanner11',
|
|
22
|
+
text: 'Scanner'
|
|
23
|
+
},
|
|
24
|
+
nfc: {
|
|
25
|
+
icon: 'pisell2-a-NFC1',
|
|
26
|
+
text: 'NFC'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
19
29
|
|
|
20
30
|
// 没有操作界面的输入模式
|
|
21
31
|
export var passiveModeType = ['scanner', 'nfc'];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare type Peripherals = {
|
|
2
|
+
scanner: 'none' | 'connected' | 'disconnect';
|
|
3
|
+
nfc: 'none' | 'connected' | 'disconnect';
|
|
4
|
+
};
|
|
5
|
+
declare const useTerminalPeripherals: (onChange?: ((val: string) => void) | undefined) => {
|
|
6
|
+
peripheralsStatus: Peripherals;
|
|
7
|
+
};
|
|
8
|
+
export default useTerminalPeripherals;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useEffect, useState } from 'react';
|
|
8
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
9
|
+
var useTerminalPeripherals = function useTerminalPeripherals(onChange) {
|
|
10
|
+
var _context$appHelper;
|
|
11
|
+
var context = useEngineContext();
|
|
12
|
+
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
13
|
+
interaction = _ref.interaction;
|
|
14
|
+
var _useState = useState({
|
|
15
|
+
scanner: 'none',
|
|
16
|
+
nfc: 'none'
|
|
17
|
+
}),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
peripheralsStatus = _useState2[0],
|
|
20
|
+
setPeripheralsStatus = _useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
var _interaction$utils, _interaction$utils$mo, _interaction$utils2, _interaction$utils2$p, _interaction$utils3, _interaction$utils3$m;
|
|
23
|
+
// 获取外部设备扫描结果
|
|
24
|
+
interaction === null || interaction === void 0 ? void 0 : (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 ? void 0 : (_interaction$utils$mo = _interaction$utils.mountFunction) === null || _interaction$utils$mo === void 0 ? void 0 : _interaction$utils$mo.call(_interaction$utils, 'global', 'peripheralsResult', function (strVal) {
|
|
25
|
+
try {
|
|
26
|
+
var _val = JSON.parse(strVal);
|
|
27
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_val.value);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.error(err);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// 主动获取设备连接状态
|
|
34
|
+
interaction === null || interaction === void 0 ? void 0 : (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 ? void 0 : (_interaction$utils2$p = _interaction$utils2.postMessageToApp) === null || _interaction$utils2$p === void 0 ? void 0 : _interaction$utils2$p.call(_interaction$utils2, {
|
|
35
|
+
module: 'global',
|
|
36
|
+
key: 'get_peripherals_status',
|
|
37
|
+
data: {}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// 设备当前连接状态返回
|
|
41
|
+
interaction === null || interaction === void 0 ? void 0 : (_interaction$utils3 = interaction.utils) === null || _interaction$utils3 === void 0 ? void 0 : (_interaction$utils3$m = _interaction$utils3.mountFunction) === null || _interaction$utils3$m === void 0 ? void 0 : _interaction$utils3$m.call(_interaction$utils3, 'global', 'peripheralsStatus', function (strPeripherals) {
|
|
42
|
+
try {
|
|
43
|
+
var peripherals = JSON.parse(strPeripherals);
|
|
44
|
+
setPeripheralsStatus(peripherals);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
console.error(err);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
return {
|
|
51
|
+
peripheralsStatus: peripheralsStatus
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export default useTerminalPeripherals;
|
|
@@ -19,11 +19,12 @@ import classNames from 'classnames';
|
|
|
19
19
|
import usePisellConfig from "../pisell-config-provider/hooks/usePisellConfig";
|
|
20
20
|
import PisellCard from "../pisellCard";
|
|
21
21
|
import Iconfont from "../iconfont";
|
|
22
|
-
import { entryModeTextIcon, passiveModeType } from "./constants";
|
|
22
|
+
import { entryModeErrorTextIcon, entryModeTextIcon, passiveModeType } from "./constants";
|
|
23
23
|
import Scan from "./Scan";
|
|
24
24
|
import Button from "../button";
|
|
25
25
|
import Input from "./Input";
|
|
26
26
|
import { hasCamera } from "./utils";
|
|
27
|
+
import useTerminalPeripherals from "./hooks/useTerminalPeripherals";
|
|
27
28
|
import "./index.less";
|
|
28
29
|
var CardButton = function CardButton(props) {
|
|
29
30
|
var icon = props.icon,
|
|
@@ -44,6 +45,8 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
|
|
|
44
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
46
|
currentType = _useState2[0],
|
|
46
47
|
setCurrentType = _useState2[1];
|
|
48
|
+
var _useTerminalPeriphera = useTerminalPeripherals(onChange),
|
|
49
|
+
peripheralsStatus = _useTerminalPeriphera.peripheralsStatus;
|
|
47
50
|
|
|
48
51
|
// 可用录入模式
|
|
49
52
|
var _useState3 = useState(entryModes),
|
|
@@ -72,11 +75,20 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
|
|
|
72
75
|
return item.type !== 'scanCode';
|
|
73
76
|
});
|
|
74
77
|
case 5:
|
|
78
|
+
available = available.filter(function (item) {
|
|
79
|
+
if (item.type === 'scanner') {
|
|
80
|
+
return peripheralsStatus.scanner !== 'none';
|
|
81
|
+
}
|
|
82
|
+
if (item.type === 'nfc') {
|
|
83
|
+
return peripheralsStatus.nfc !== 'none';
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
});
|
|
75
87
|
if (available.length === 1) {
|
|
76
88
|
setCurrentType(available[0].type);
|
|
77
89
|
}
|
|
78
90
|
setAvailableEntryModes(available);
|
|
79
|
-
case
|
|
91
|
+
case 8:
|
|
80
92
|
case "end":
|
|
81
93
|
return _context.stop();
|
|
82
94
|
}
|
|
@@ -87,7 +99,7 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
|
|
|
87
99
|
};
|
|
88
100
|
}();
|
|
89
101
|
getEntryModes();
|
|
90
|
-
}, [entryModes]);
|
|
102
|
+
}, [entryModes, peripheralsStatus]);
|
|
91
103
|
var handleChange = function handleChange(val) {
|
|
92
104
|
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
|
93
105
|
};
|
|
@@ -164,10 +176,15 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
|
|
|
164
176
|
className: "pisell-information-entry-modes"
|
|
165
177
|
}, availableEntryModes.map(function (item) {
|
|
166
178
|
var detail = entryModeTextIcon[item.type];
|
|
179
|
+
var icon = detail.icon;
|
|
180
|
+
if (['scanner', 'nfc'].includes(item.type)) {
|
|
181
|
+
var disconnect = entryModeErrorTextIcon[item.type];
|
|
182
|
+
icon = peripheralsStatus[item.type] === 'connected' ? detail.icon : disconnect.icon;
|
|
183
|
+
}
|
|
167
184
|
return /*#__PURE__*/React.createElement(CardButton, {
|
|
168
185
|
bordered: !passiveModeType.includes(item.type),
|
|
169
186
|
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
170
|
-
type:
|
|
187
|
+
type: icon,
|
|
171
188
|
className: "pisell-card-button-icon"
|
|
172
189
|
}),
|
|
173
190
|
className: classNames('pisell-information-entry-item', _defineProperty({}, 'pisell-entry-ready', passiveModeType.includes(item.type))),
|
|
@@ -13,6 +13,8 @@ export interface PisellLoadingProps extends SpinProps {
|
|
|
13
13
|
mask?: boolean | MaskType;
|
|
14
14
|
/** 是否全屏 */
|
|
15
15
|
fullscreen?: boolean;
|
|
16
|
+
/** 延迟显示加载效果的时间(防止闪烁) */
|
|
17
|
+
delay?: number;
|
|
16
18
|
}
|
|
17
19
|
declare const PisellLoading: (props: PisellLoadingProps) => React.JSX.Element;
|
|
18
20
|
export default PisellLoading;
|
|
@@ -8,7 +8,8 @@ var PisellLoading = function PisellLoading(props) {
|
|
|
8
8
|
var children = props.children,
|
|
9
9
|
fullscreen = props.fullscreen,
|
|
10
10
|
mask = props.mask,
|
|
11
|
-
loading = props.loading
|
|
11
|
+
loading = props.loading,
|
|
12
|
+
delay = props.delay;
|
|
12
13
|
var ref = useRef(null);
|
|
13
14
|
var _ref = mask || {},
|
|
14
15
|
_ref$backgroundColor = _ref.backgroundColor,
|
|
@@ -32,6 +33,7 @@ var PisellLoading = function PisellLoading(props) {
|
|
|
32
33
|
className: 'pisell-loading-wrapper'
|
|
33
34
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
34
35
|
fullscreen: fullscreen,
|
|
36
|
+
delay: delay,
|
|
35
37
|
spinning: loading,
|
|
36
38
|
indicator: /*#__PURE__*/React.createElement(IconFont, {
|
|
37
39
|
type: 'pisell2-loader2',
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
8
|
+
import { QRCode, Button, Divider } from 'antd';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import PisellModal from "./../pisellModal";
|
|
11
|
+
import "./index.less";
|
|
12
|
+
var qrcodeValue = 'https://www.baidu.com';
|
|
13
|
+
var PisellQrcode = function PisellQrcode(props) {
|
|
14
|
+
var size = props.size,
|
|
15
|
+
platform = props.platform; // 裁剪形状
|
|
16
|
+
var _useState = useState(false),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
open = _useState2[0],
|
|
19
|
+
setOpen = _useState2[1];
|
|
20
|
+
var _React$useState = React.useState(0),
|
|
21
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22
|
+
height = _React$useState2[0],
|
|
23
|
+
setHeight = _React$useState2[1];
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
document.body.id = 'body';
|
|
26
|
+
|
|
27
|
+
// if (modalRef.current) {
|
|
28
|
+
// const elementHeight = modalRef.current?.clientHeight;
|
|
29
|
+
// setHeight(elementHeight);
|
|
30
|
+
// console.log('元素真实高度:', elementHeight);
|
|
31
|
+
// }
|
|
32
|
+
}, []);
|
|
33
|
+
var modalRef = useRef(null);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
if (open) {
|
|
36
|
+
console.log('%c [ modalRef ]-22', 'font-size:13px; background:pink; color:#bf2c9f;', modalRef);
|
|
37
|
+
}
|
|
38
|
+
}, [open]);
|
|
39
|
+
var modalProps = {
|
|
40
|
+
title: 'QR code',
|
|
41
|
+
platform: platform,
|
|
42
|
+
onCancel: function onCancel() {
|
|
43
|
+
return setOpen(false);
|
|
44
|
+
},
|
|
45
|
+
open: open,
|
|
46
|
+
footer: null,
|
|
47
|
+
mobileModalHeight: 'auto',
|
|
48
|
+
className: classNames('pisell-qrcode-modal'),
|
|
49
|
+
bodyStyle: {
|
|
50
|
+
padding: 0
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
54
|
+
className: classNames('pisell-qrcode-wrapper')
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
onClick: function onClick() {
|
|
57
|
+
return setOpen(true);
|
|
58
|
+
}
|
|
59
|
+
}, /*#__PURE__*/React.createElement(QRCode, {
|
|
60
|
+
size: size,
|
|
61
|
+
value: qrcodeValue,
|
|
62
|
+
bordered: false
|
|
63
|
+
})), /*#__PURE__*/React.createElement(PisellModal, modalProps, /*#__PURE__*/React.createElement(QRCode, {
|
|
64
|
+
size: size,
|
|
65
|
+
value: qrcodeValue
|
|
66
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
67
|
+
className: classNames('pisell-qrcode-modal-value')
|
|
68
|
+
}, qrcodeValue), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement(Button, {
|
|
69
|
+
onClick: function onClick() {
|
|
70
|
+
return setOpen(false);
|
|
71
|
+
},
|
|
72
|
+
className: classNames('pisell-qrcode-modal-button')
|
|
73
|
+
}, "Done")));
|
|
74
|
+
};
|
|
75
|
+
export default PisellQrcode;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.pisell-qrcode-wrapper {
|
|
2
|
+
}
|
|
3
|
+
|
|
4
|
+
.pisell-qrcode-modal {
|
|
5
|
+
.pisell-lowcode-modal-content {
|
|
6
|
+
padding: 0;
|
|
7
|
+
.pisell-lowcode-modal-body {
|
|
8
|
+
display: flex;
|
|
9
|
+
width: 100%;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
.pisell-qrcode-modal-value {
|
|
13
|
+
color: var(--Gray-500, #667085);
|
|
14
|
+
font-family: Inter;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-weight: 400;
|
|
18
|
+
line-height: 20px;
|
|
19
|
+
margin: 20px 0 24px;
|
|
20
|
+
}
|
|
21
|
+
.pisell-lowcode-divider {
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
.pisell-qrcode-modal-button {
|
|
25
|
+
margin: 24px;
|
|
26
|
+
|
|
27
|
+
color: var(--Base-White, #fff);
|
|
28
|
+
|
|
29
|
+
font-family: Inter;
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
font-style: normal;
|
|
32
|
+
font-weight: 600;
|
|
33
|
+
line-height: 24px;
|
|
34
|
+
|
|
35
|
+
width: calc(100% - 48px);
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
background-color: var(--theme-color, #7f56d9);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface PisellStatisticProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
number?: number;
|
|
6
|
+
hint?: React.ReactNode;
|
|
7
|
+
tags?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare const pisellStatistic: (props: PisellStatisticProps) => import("react").JSX.Element;
|
|
10
|
+
export default pisellStatistic;
|