@pisell/materials 6.4.8 → 6.4.10
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 +7 -7
- package/build/lowcode/preview.js +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +21 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +30 -24
- package/es/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/es/components/auto-resize-text/auto-text-size-standalone.js +258 -0
- package/es/components/auto-resize-text/index.d.ts +6 -0
- package/es/components/auto-resize-text/index.js +40 -0
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +3 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/es/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +18 -18
- package/es/components/date-picker/datePickerCpt.d.ts +1 -0
- package/es/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/es/components/filter/index.d.ts +1 -0
- package/es/components/filter/types.d.ts +1 -0
- package/es/components/iconfont/index.d.ts +8 -0
- package/es/components/keyboard/index.d.ts +22 -0
- package/es/components/keyboard/index.js +159 -0
- package/es/components/keyboard/index.less +44 -0
- package/es/components/list/index.d.ts +1 -0
- package/es/components/lowCodePage/index.d.ts +1 -0
- package/es/components/pisell-config-provider/context.d.ts +22 -0
- package/es/components/pisell-config-provider/index.d.ts +13 -0
- package/es/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/es/components/pisellAdjustPrice/index.d.ts +1 -0
- package/es/components/pisellAdjustPrice/status.d.ts +32 -0
- package/es/components/pisellAdjustPrice/type.d.ts +22 -0
- package/es/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/es/components/pisellInput/index.d.ts +1 -0
- package/es/components/pisellLoading/index.d.ts +1 -0
- package/es/components/pisellModal/components/IpadModal/index.d.ts +1 -0
- package/es/components/pisellModal/components/MobileModal/index.d.ts +1 -0
- package/es/components/pisellModal/components/index.d.ts +1 -0
- package/es/components/pisellQRScanner/index.d.ts +0 -13
- package/es/components/pisellQRScanner/index.js +0 -8
- package/es/components/pisellToast/squareToast/index.d.ts +15 -0
- package/es/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/es/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/es/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/es/components/pisellWalletPassCard/index.d.ts +1 -1
- package/es/components/pisellWalletPassCard/index.js +6 -3
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/Action/index.d.ts +3 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/es/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/es/components/productCard/components/Header/index.d.ts +1 -0
- package/es/components/productCard/components/MultiDay/index.d.ts +1 -0
- package/es/components/productCard/components/Note/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/productCard/components/Packages/components/options/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/index.d.ts +1 -0
- package/es/components/productCard/components/Packages/utils.d.ts +1 -1
- package/es/components/productCard/components/Sales/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/es/components/productCard/locales.d.ts +84 -0
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/qrcode/index.d.ts +1 -0
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
- package/es/components/table/Actions/component/Group/index.d.ts +1 -0
- package/es/components/table/Actions/index.d.ts +1 -0
- package/es/components/table/BasicTable/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
- package/es/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/es/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/date/index.d.ts +1 -0
- package/es/components/table/Table/fields/image/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/index.d.ts +2 -2
- package/es/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/link/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/number/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/es/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/Show/index.d.ts +1 -0
- package/es/components/table/Table/fields/search/index.d.ts +1 -0
- package/es/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/select/index.d.ts +1 -0
- package/es/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/es/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/table/View/index.d.ts +1 -0
- package/es/components/table/hooks/useTableSetting.js +1 -1
- package/es/components/versionSelect/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +21 -7
- package/es/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.js +44 -25
- package/es/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/es/components/virtual-keyboard/Number/index.d.ts +1 -0
- package/es/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/es/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/es/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/es/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/es/components/virtualInput/BaseVirtualInput/index.js +163 -0
- package/es/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/es/components/virtualInput/index.d.ts +24 -0
- package/es/components/virtualInput/index.js +60 -0
- package/es/components/virtualInput/index.less +42 -0
- package/es/components/walletCard/Guide/index.d.ts +3 -0
- package/es/components/walletCard/index.d.ts +67 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -1
- package/es/locales/en-US.d.ts +286 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.d.ts +281 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.d.ts +281 -0
- package/es/locales/zh-TW.js +1 -0
- package/es/utils/index.d.ts +1 -1
- package/es/utils/platform.d.ts +1 -1
- package/lib/components/auto-resize-text/auto-text-size-standalone.d.ts +20 -0
- package/lib/components/auto-resize-text/auto-text-size-standalone.js +273 -0
- package/lib/components/auto-resize-text/index.d.ts +6 -0
- package/lib/components/auto-resize-text/index.js +71 -0
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +3 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Password/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +2 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +37 -0
- package/lib/components/dataSourceComponents/fields/Upload/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +18 -18
- package/lib/components/date-picker/datePickerCpt.d.ts +1 -0
- package/lib/components/drag-sort-tree/TreeItem/index.d.ts +18 -0
- package/lib/components/filter/index.d.ts +1 -0
- package/lib/components/filter/types.d.ts +1 -0
- package/lib/components/iconfont/index.d.ts +8 -0
- package/lib/components/keyboard/index.d.ts +22 -0
- package/lib/components/keyboard/index.js +223 -0
- package/lib/components/keyboard/index.less +44 -0
- package/lib/components/list/index.d.ts +1 -0
- package/lib/components/lowCodePage/index.d.ts +1 -0
- package/lib/components/pisell-config-provider/context.d.ts +22 -0
- package/lib/components/pisell-config-provider/index.d.ts +13 -0
- package/lib/components/pisellAdjustPrice/PisellAdjustPriceInputNumber.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/index.d.ts +1 -0
- package/lib/components/pisellAdjustPrice/status.d.ts +32 -0
- package/lib/components/pisellAdjustPrice/type.d.ts +22 -0
- package/lib/components/pisellInput/components/Copy/index.d.ts +1 -0
- package/lib/components/pisellInput/index.d.ts +1 -0
- package/lib/components/pisellLoading/index.d.ts +1 -0
- package/lib/components/pisellModal/components/IpadModal/index.d.ts +1 -0
- package/lib/components/pisellModal/components/MobileModal/index.d.ts +1 -0
- package/lib/components/pisellModal/components/index.d.ts +1 -0
- package/lib/components/pisellQRScanner/index.d.ts +0 -13
- package/lib/components/pisellToast/squareToast/index.d.ts +15 -0
- package/lib/components/pisellToast/squareToast/methods.d.ts +13 -0
- package/lib/components/pisellToast/squareToast/renderImperatively.d.ts +29 -0
- package/lib/components/pisellToast/squareToast/toast.d.ts +25 -0
- package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
- package/lib/components/pisellWalletPassCard/index.js +7 -2
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +1 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/Action/index.d.ts +3 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +1 -0
- package/lib/components/productCard/components/Header/index.d.ts +1 -0
- package/lib/components/productCard/components/MultiDay/index.d.ts +1 -0
- package/lib/components/productCard/components/Note/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/index.d.ts +1 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
- package/lib/components/productCard/components/Sales/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderModal/index.d.ts +1 -0
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +1 -0
- package/lib/components/productCard/locales.d.ts +84 -0
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/qrcode/index.d.ts +1 -0
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +1 -0
- package/lib/components/table/Actions/component/Group/index.d.ts +1 -0
- package/lib/components/table/Actions/index.d.ts +1 -0
- package/lib/components/table/BasicTable/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +1 -0
- package/lib/components/table/Gallery/components/VirtualGrid/useGapSize.d.ts +2 -2
- package/lib/components/table/Table/fields/date/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/date/index.d.ts +1 -0
- package/lib/components/table/Table/fields/image/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/index.d.ts +2 -2
- package/lib/components/table/Table/fields/link/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/link/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/number/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/numberRange/index.d.ts +1 -0
- package/lib/components/table/Table/fields/oldRangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/pSwitch/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/rangePicker/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/Show/index.d.ts +1 -0
- package/lib/components/table/Table/fields/search/index.d.ts +1 -0
- package/lib/components/table/Table/fields/select/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/select/index.d.ts +1 -0
- package/lib/components/table/Table/fields/treeSelect/filterUtil/index.d.ts +1 -1
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/table/View/index.d.ts +1 -0
- package/lib/components/table/hooks/useTableSetting.js +1 -1
- package/lib/components/versionSelect/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Amount/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Amount/types.d.ts +44 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.d.ts +5 -1
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.js +19 -2
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/Presets.less +9 -5
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +4 -0
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.js +45 -27
- package/lib/components/virtual-keyboard/Keyboard/index.d.ts +21 -0
- package/lib/components/virtual-keyboard/Number/index.d.ts +1 -0
- package/lib/components/virtual-keyboard/Number/themeConfig.d.ts +32 -0
- package/lib/components/virtual-keyboard/Number/types.d.ts +26 -0
- package/lib/components/virtual-keyboard/VirtualKeyInput/index.d.ts +13 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.d.ts +40 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.js +179 -0
- package/lib/components/virtualInput/BaseVirtualInput/index.less +77 -0
- package/lib/components/virtualInput/index.d.ts +24 -0
- package/lib/components/virtualInput/index.js +102 -0
- package/lib/components/virtualInput/index.less +42 -0
- package/lib/components/walletCard/Guide/index.d.ts +3 -0
- package/lib/components/walletCard/index.d.ts +67 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +9 -0
- package/lib/locales/en-US.d.ts +286 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.d.ts +281 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.d.ts +281 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/platform.d.ts +1 -1
- package/lowcode/auto-resize-text/meta.ts +9431 -0
- package/package.json +11 -11
- 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,32 @@
|
|
|
1
|
+
export declare const amountThemeConfig: {
|
|
2
|
+
dark: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
containerBackgroundColor: string;
|
|
5
|
+
buttonBackgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
resetButtonBackgroundColor: string;
|
|
8
|
+
resetButtonTextColor: string;
|
|
9
|
+
isDoneButtonFollowTheme: boolean;
|
|
10
|
+
doneButtonBackgroundColor: string;
|
|
11
|
+
doneButtonTextColor: string;
|
|
12
|
+
keyboardBackgroundColor: string;
|
|
13
|
+
keyboardButtonBackgroundColor: string;
|
|
14
|
+
keyboardButtonTextColor: string;
|
|
15
|
+
keyboardButtonHoverColor: string;
|
|
16
|
+
};
|
|
17
|
+
light: {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
containerBackgroundColor: string;
|
|
20
|
+
buttonBackgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
resetButtonBackgroundColor: string;
|
|
23
|
+
resetButtonTextColor: string;
|
|
24
|
+
isDoneButtonFollowTheme: boolean;
|
|
25
|
+
doneButtonBackgroundColor: string;
|
|
26
|
+
doneButtonTextColor: string;
|
|
27
|
+
keyboardBackgroundColor: string;
|
|
28
|
+
keyboardButtonBackgroundColor: string;
|
|
29
|
+
keyboardButtonTextColor: string;
|
|
30
|
+
keyboardButtonHoverColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseNumberKeyboardProps } from '../BaseNumberKeyboard';
|
|
3
|
+
export interface RightItemsStyleProps {
|
|
4
|
+
buttonBackgroundColor?: string;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
resetButtonBackgroundColor?: string;
|
|
7
|
+
resetButtonTextColor?: string;
|
|
8
|
+
isDoneButtonFollowTheme?: boolean;
|
|
9
|
+
doneButtonBackgroundColor?: string;
|
|
10
|
+
doneButtonTextColor?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AmountProps {
|
|
13
|
+
max?: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
doneText?: string;
|
|
16
|
+
resetText?: string;
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
amountProps?: {
|
|
20
|
+
showCurrencySymbol: boolean;
|
|
21
|
+
useThousandsSeparator: boolean;
|
|
22
|
+
};
|
|
23
|
+
presets?: BaseNumberKeyboardProps['presets'];
|
|
24
|
+
value?: string | number;
|
|
25
|
+
onChange?: (val: string | number) => void;
|
|
26
|
+
onEnter?: (val: string | number) => void;
|
|
27
|
+
defaultSelect?: boolean;
|
|
28
|
+
inputFormat?: (_v: string) => React.ReactNode | null;
|
|
29
|
+
rightItemsStyle?: RightItemsStyleProps;
|
|
30
|
+
selectType?: 'light' | 'dark';
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
containerBackgroundColor?: string;
|
|
33
|
+
buttonBackgroundColor?: string;
|
|
34
|
+
textColor?: string;
|
|
35
|
+
resetButtonBackgroundColor?: string;
|
|
36
|
+
resetButtonTextColor?: string;
|
|
37
|
+
isDoneButtonFollowTheme?: boolean;
|
|
38
|
+
doneButtonBackgroundColor?: string;
|
|
39
|
+
doneButtonTextColor?: string;
|
|
40
|
+
keyboardBackgroundColor?: string;
|
|
41
|
+
keyboardButtonBackgroundColor?: string;
|
|
42
|
+
keyboardButtonTextColor?: string;
|
|
43
|
+
keyboardButtonHoverColor?: string;
|
|
44
|
+
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Presets.less';
|
|
2
3
|
export declare type PresetsItem = {
|
|
3
4
|
label: string;
|
|
4
5
|
value: number | string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
onClick?: (item: PresetsItem, _next: () => void) => void;
|
|
8
|
+
render?: (item: PresetsItem) => React.ReactNode;
|
|
5
9
|
};
|
|
6
10
|
export interface PresetsProps {
|
|
7
11
|
presets?: PresetsItem[];
|
|
@@ -3,20 +3,34 @@ import "./Presets.less";
|
|
|
3
3
|
var Presets = function Presets(props) {
|
|
4
4
|
var presets = props.presets,
|
|
5
5
|
onChange = props.onChange;
|
|
6
|
+
var handleItemClick = function handleItemClick(item) {
|
|
7
|
+
if (item.onClick) {
|
|
8
|
+
var _next2 = function _next2() {
|
|
9
|
+
return onChange("".concat(item.value));
|
|
10
|
+
};
|
|
11
|
+
item.onClick(item, _next2);
|
|
12
|
+
} else {
|
|
13
|
+
onChange("".concat(item.value));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
6
16
|
return useMemo(function () {
|
|
7
17
|
if (!(presets !== null && presets !== void 0 && presets.length)) {
|
|
8
18
|
return null;
|
|
9
19
|
}
|
|
10
20
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
21
|
className: "pisell-virtual-keyboard-preset"
|
|
12
|
-
}, presets.map(function (item) {
|
|
13
|
-
|
|
22
|
+
}, presets.map(function (item, index) {
|
|
23
|
+
var _item$render;
|
|
24
|
+
var itemProps = {
|
|
25
|
+
key: index,
|
|
26
|
+
className: 'pisell-virtual-keyboard-preset-item',
|
|
27
|
+
style: item.style,
|
|
14
28
|
onClick: function onClick() {
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
29
|
+
return handleItemClick(item);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
return /*#__PURE__*/React.createElement("div", itemProps, ((_item$render = item.render) === null || _item$render === void 0 ? void 0 : _item$render.call(item, item)) || item.label);
|
|
19
33
|
}));
|
|
20
|
-
}, [presets]);
|
|
34
|
+
}, [presets, onChange]);
|
|
21
35
|
};
|
|
22
36
|
export default Presets;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
.pisell-virtual-keyboard-preset {
|
|
2
|
-
display:
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(4, 1fr);
|
|
3
4
|
gap: 7px;
|
|
4
|
-
flex-wrap: wrap;
|
|
5
5
|
margin-bottom: 8px;
|
|
6
|
+
|
|
6
7
|
.pisell-virtual-keyboard-preset-item {
|
|
7
8
|
display: flex;
|
|
8
|
-
flex: 1;
|
|
9
9
|
padding: 12px 20px;
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
height:
|
|
12
|
+
height: 40px;
|
|
13
13
|
border-radius: 8px;
|
|
14
|
-
border: 1px solid var(--Gray-300, #
|
|
14
|
+
border: 1px solid var(--Gray-300, #E9D7FE);
|
|
15
15
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
16
16
|
background: var(--Primary-25, #FCFAFF);
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
color: #6941C6;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
position: relative;
|
|
17
21
|
}
|
|
18
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PresetsProps } from './Presets';
|
|
3
|
+
import { KeyboardProps } from '../Keyboard';
|
|
3
4
|
import { RightItemsStyleProps } from '../Amount';
|
|
4
5
|
import './index.less';
|
|
5
6
|
export interface BaseNumberKeyboardProps {
|
|
@@ -16,6 +17,9 @@ export interface BaseNumberKeyboardProps {
|
|
|
16
17
|
presets?: PresetsProps['presets'];
|
|
17
18
|
defaultSelect?: boolean;
|
|
18
19
|
rightItemsStyle?: RightItemsStyleProps;
|
|
20
|
+
customDisplay?: React.ReactNode | ((props: any) => React.ReactNode);
|
|
21
|
+
keyboardProps?: KeyboardProps;
|
|
22
|
+
style?: React.CSSProperties;
|
|
19
23
|
}
|
|
20
24
|
declare const BaseNumberKeyboard: (props: BaseNumberKeyboardProps) => JSX.Element;
|
|
21
25
|
export default BaseNumberKeyboard;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _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
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -93,7 +94,9 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
93
94
|
onEnter = props.onEnter,
|
|
94
95
|
presets = props.presets,
|
|
95
96
|
defaultSelect = props.defaultSelect,
|
|
96
|
-
rightItemsStyle = props.rightItemsStyle
|
|
97
|
+
rightItemsStyle = props.rightItemsStyle,
|
|
98
|
+
customDisplay = props.customDisplay,
|
|
99
|
+
style = props.style;
|
|
97
100
|
var _useControllableValue = useControllableValue(props, {
|
|
98
101
|
defaultValue: defaultValue
|
|
99
102
|
}),
|
|
@@ -173,6 +176,8 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
173
176
|
}
|
|
174
177
|
};
|
|
175
178
|
var handleChangeValue = function handleChangeValue(val) {
|
|
179
|
+
var _val;
|
|
180
|
+
val = typeof val === 'string' ? val : ((_val = val) === null || _val === void 0 || (_val = _val.target) === null || _val === void 0 ? void 0 : _val.value) || '';
|
|
176
181
|
var detail = checkValue(val);
|
|
177
182
|
if (detail) return;
|
|
178
183
|
setValue(val);
|
|
@@ -205,37 +210,51 @@ var BaseNumberKeyboard = function BaseNumberKeyboard(props) {
|
|
|
205
210
|
var handleKeyboardChange = useMemoizedFn(function (val) {
|
|
206
211
|
return (actions[val] || actions.default)(val);
|
|
207
212
|
});
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
renderInput: function renderInput(props) {
|
|
216
|
-
if (isUndefined(props.value) || props.value === '') {
|
|
217
|
-
return /*#__PURE__*/React.createElement(VirtualInput, {
|
|
218
|
-
autoFocus: true,
|
|
219
|
-
placeholder: placeholder,
|
|
220
|
-
value: props.value
|
|
213
|
+
var renderDisplayField = function renderDisplayField() {
|
|
214
|
+
if (customDisplay) {
|
|
215
|
+
if (typeof customDisplay === 'function') {
|
|
216
|
+
return customDisplay({
|
|
217
|
+
value: value,
|
|
218
|
+
onChange: handleChangeValue,
|
|
219
|
+
onValueSelect: setSelect
|
|
221
220
|
});
|
|
222
221
|
}
|
|
223
|
-
return
|
|
224
|
-
},
|
|
225
|
-
showDelete: false,
|
|
226
|
-
onValueSelect: setSelect,
|
|
227
|
-
defaultSelect: defaultSelect,
|
|
228
|
-
style: {
|
|
229
|
-
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor) || '#fff',
|
|
230
|
-
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.textColor) || '#000000'
|
|
222
|
+
return customDisplay;
|
|
231
223
|
}
|
|
232
|
-
|
|
224
|
+
return /*#__PURE__*/React.createElement(VirtualKeyInput, {
|
|
225
|
+
value: value,
|
|
226
|
+
onChange: function onChange(e) {
|
|
227
|
+
return handleChangeValue(e.target.value);
|
|
228
|
+
},
|
|
229
|
+
renderInput: function renderInput(props) {
|
|
230
|
+
if (isUndefined(props.value) || props.value === '') {
|
|
231
|
+
return /*#__PURE__*/React.createElement(VirtualInput, {
|
|
232
|
+
autoFocus: true,
|
|
233
|
+
placeholder: placeholder,
|
|
234
|
+
value: props.value
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return (format === null || format === void 0 ? void 0 : format(props.value)) || props.value;
|
|
238
|
+
},
|
|
239
|
+
showDelete: false,
|
|
240
|
+
onValueSelect: setSelect,
|
|
241
|
+
defaultSelect: defaultSelect,
|
|
242
|
+
style: {
|
|
243
|
+
backgroundColor: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.buttonBackgroundColor) || '#fff',
|
|
244
|
+
color: (rightItemsStyle === null || rightItemsStyle === void 0 ? void 0 : rightItemsStyle.textColor) || '#000000'
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
249
|
+
className: "pisell-virtual-keyboard-base",
|
|
250
|
+
style: style
|
|
251
|
+
}, renderDisplayField(), /*#__PURE__*/React.createElement(Presets, {
|
|
233
252
|
presets: presets,
|
|
234
253
|
onChange: handleChangeValue
|
|
235
|
-
}), /*#__PURE__*/React.createElement(Keyboard, {
|
|
254
|
+
}), /*#__PURE__*/React.createElement(Keyboard, _extends({
|
|
236
255
|
items: itemsWithStyle,
|
|
237
256
|
rightItems: rightItems,
|
|
238
257
|
onChange: handleKeyboardChange
|
|
239
|
-
}));
|
|
258
|
+
}, props.keyboardProps || {})));
|
|
240
259
|
};
|
|
241
260
|
export default BaseNumberKeyboard;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type ItemValue = string | number;
|
|
4
|
+
export interface Item {
|
|
5
|
+
value: ItemValue;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
type: 'text' | 'primary';
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface KeyboardProps {
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
onChange?: (value?: ItemValue) => void;
|
|
16
|
+
items?: Item[];
|
|
17
|
+
rightItems?: Item[];
|
|
18
|
+
keydown?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: React.MemoExoticComponent<(props: KeyboardProps) => JSX.Element>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const numberThemeConfig: {
|
|
2
|
+
dark: {
|
|
3
|
+
backgroundColor: string;
|
|
4
|
+
containerBackgroundColor: string;
|
|
5
|
+
buttonBackgroundColor: string;
|
|
6
|
+
textColor: string;
|
|
7
|
+
resetButtonBackgroundColor: string;
|
|
8
|
+
resetButtonTextColor: string;
|
|
9
|
+
isDoneButtonFollowTheme: boolean;
|
|
10
|
+
doneButtonBackgroundColor: string;
|
|
11
|
+
doneButtonTextColor: string;
|
|
12
|
+
keyboardBackgroundColor: string;
|
|
13
|
+
keyboardButtonBackgroundColor: string;
|
|
14
|
+
keyboardButtonTextColor: string;
|
|
15
|
+
keyboardButtonHoverColor: string;
|
|
16
|
+
};
|
|
17
|
+
light: {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
containerBackgroundColor: string;
|
|
20
|
+
buttonBackgroundColor: string;
|
|
21
|
+
textColor: string;
|
|
22
|
+
resetButtonBackgroundColor: string;
|
|
23
|
+
resetButtonTextColor: string;
|
|
24
|
+
isDoneButtonFollowTheme: boolean;
|
|
25
|
+
doneButtonBackgroundColor: string;
|
|
26
|
+
doneButtonTextColor: string;
|
|
27
|
+
keyboardBackgroundColor: string;
|
|
28
|
+
keyboardButtonBackgroundColor: string;
|
|
29
|
+
keyboardButtonTextColor: string;
|
|
30
|
+
keyboardButtonHoverColor: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface NumberProps {
|
|
2
|
+
max?: number;
|
|
3
|
+
min?: number;
|
|
4
|
+
doneText?: string;
|
|
5
|
+
resetText: string;
|
|
6
|
+
defaultValue?: string | number;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value?: string | number;
|
|
9
|
+
onChange?: (val: string | number) => void;
|
|
10
|
+
onEnter?: (val: string | number) => void;
|
|
11
|
+
defaultSelect?: boolean;
|
|
12
|
+
selectType?: 'light' | 'dark';
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
containerBackgroundColor?: string;
|
|
15
|
+
buttonBackgroundColor?: string;
|
|
16
|
+
textColor?: string;
|
|
17
|
+
resetButtonBackgroundColor?: string;
|
|
18
|
+
resetButtonTextColor?: string;
|
|
19
|
+
isDoneButtonFollowTheme?: boolean;
|
|
20
|
+
doneButtonBackgroundColor?: string;
|
|
21
|
+
doneButtonTextColor?: string;
|
|
22
|
+
keyboardBackgroundColor?: string;
|
|
23
|
+
keyboardButtonBackgroundColor?: string;
|
|
24
|
+
keyboardButtonTextColor?: string;
|
|
25
|
+
keyboardButtonHoverColor?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface VirtualKeyInputProps extends InputProps {
|
|
5
|
+
previewValue?: string;
|
|
6
|
+
renderInput?: (props: any) => any;
|
|
7
|
+
showDelete?: boolean;
|
|
8
|
+
onValueSelect?: (selected: boolean) => void;
|
|
9
|
+
defaultSelect?: boolean;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
declare const VirtualKeyInput: (props: VirtualKeyInputProps) => JSX.Element;
|
|
13
|
+
export default VirtualKeyInput;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface BaseVirtualInputProps {
|
|
4
|
+
/** 输入值 */
|
|
5
|
+
value?: string | React.ReactNode;
|
|
6
|
+
/** 占位符 */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** 是否自动聚焦 */
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
/** 是否禁用 */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** 组件高度,默认60px */
|
|
13
|
+
height?: number | string;
|
|
14
|
+
/** 字体大小,默认48px,如果不设置会根据高度自动计算 */
|
|
15
|
+
fontSize?: number | string;
|
|
16
|
+
/** 聚焦回调 */
|
|
17
|
+
onFocus?: () => void;
|
|
18
|
+
/** 失焦回调 */
|
|
19
|
+
onBlur?: () => void;
|
|
20
|
+
/** 文字位置 */
|
|
21
|
+
textAlign?: 'start' | 'center' | 'end';
|
|
22
|
+
/** 自定义样式 */
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
/** 自定义类名 */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** showCursor */
|
|
27
|
+
showCursor?: boolean;
|
|
28
|
+
/** 防止失焦的元素选择器或ref */
|
|
29
|
+
preventBlurElements?: Array<string | React.RefObject<HTMLElement>>;
|
|
30
|
+
/** 是否聚焦(受控模式) */
|
|
31
|
+
focused?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface BaseVirtualInputRef {
|
|
34
|
+
/** 手动聚焦 */
|
|
35
|
+
focus: () => void;
|
|
36
|
+
/** 手动失焦 */
|
|
37
|
+
blur: () => void;
|
|
38
|
+
}
|
|
39
|
+
declare const BaseVirtualInput: React.ForwardRefExoticComponent<BaseVirtualInputProps & React.RefAttributes<BaseVirtualInputRef>>;
|
|
40
|
+
export default BaseVirtualInput;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useState, useCallback, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
15
|
+
import AutoResizeText from "../../auto-resize-text";
|
|
16
|
+
import "./index.less";
|
|
17
|
+
var BaseVirtualInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
|
+
var _props$value = props.value,
|
|
19
|
+
value = _props$value === void 0 ? '' : _props$value,
|
|
20
|
+
_props$placeholder = props.placeholder,
|
|
21
|
+
placeholder = _props$placeholder === void 0 ? '' : _props$placeholder,
|
|
22
|
+
_props$autoFocus = props.autoFocus,
|
|
23
|
+
autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus,
|
|
24
|
+
_props$disabled = props.disabled,
|
|
25
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
26
|
+
_props$height = props.height,
|
|
27
|
+
height = _props$height === void 0 ? 60 : _props$height,
|
|
28
|
+
fontSize = props.fontSize,
|
|
29
|
+
onFocus = props.onFocus,
|
|
30
|
+
onBlur = props.onBlur,
|
|
31
|
+
style = props.style,
|
|
32
|
+
className = props.className,
|
|
33
|
+
_props$preventBlurEle = props.preventBlurElements,
|
|
34
|
+
preventBlurElements = _props$preventBlurEle === void 0 ? [] : _props$preventBlurEle,
|
|
35
|
+
focused = props.focused,
|
|
36
|
+
_props$showCursor = props.showCursor,
|
|
37
|
+
showCursor = _props$showCursor === void 0 ? true : _props$showCursor;
|
|
38
|
+
// 使用 useControllableValue 管理 focused 状态
|
|
39
|
+
var _useState = useState(focused !== null && focused !== void 0 ? focused : autoFocus),
|
|
40
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
+
localFocused = _useState2[0],
|
|
42
|
+
setLocalFocused = _useState2[1];
|
|
43
|
+
var internalFocused = 'focused' in props ? props.focused : localFocused;
|
|
44
|
+
var containerRef = useRef(null);
|
|
45
|
+
|
|
46
|
+
// 处理聚焦
|
|
47
|
+
var handleFocus = useCallback(function () {
|
|
48
|
+
if (disabled) return;
|
|
49
|
+
setLocalFocused(true);
|
|
50
|
+
onFocus === null || onFocus === void 0 || onFocus();
|
|
51
|
+
}, [disabled, onFocus]);
|
|
52
|
+
|
|
53
|
+
// 处理失焦
|
|
54
|
+
var handleBlur = useCallback(function () {
|
|
55
|
+
setLocalFocused(false);
|
|
56
|
+
onBlur === null || onBlur === void 0 || onBlur();
|
|
57
|
+
}, [onBlur]);
|
|
58
|
+
var shouldPreventBlur = useCallback(function (target) {
|
|
59
|
+
if (!target || !(target instanceof Element)) return false;
|
|
60
|
+
return preventBlurElements.some(function (element) {
|
|
61
|
+
if (typeof element === 'string') {
|
|
62
|
+
// 字符串选择器 - 查找页面中所有匹配的元素,检查是否包含目标元素
|
|
63
|
+
var matchedElements = document.querySelectorAll(element);
|
|
64
|
+
return Array.from(matchedElements).some(function (el) {
|
|
65
|
+
return el.contains(target) || el === target;
|
|
66
|
+
});
|
|
67
|
+
} else if (element && 'current' in element && element.current) {
|
|
68
|
+
// React ref
|
|
69
|
+
return element.current.contains(target);
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
});
|
|
73
|
+
}, [preventBlurElements]);
|
|
74
|
+
useEffect(function () {
|
|
75
|
+
var handleGlobalClick = function handleGlobalClick(event) {
|
|
76
|
+
if (!internalFocused) return;
|
|
77
|
+
var target = event.target;
|
|
78
|
+
if (containerRef.current && containerRef.current.contains(target)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (shouldPreventBlur(target)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
handleBlur();
|
|
85
|
+
};
|
|
86
|
+
if (internalFocused) {
|
|
87
|
+
document.addEventListener('mousedown', handleGlobalClick);
|
|
88
|
+
}
|
|
89
|
+
return function () {
|
|
90
|
+
document.removeEventListener('mousedown', handleGlobalClick);
|
|
91
|
+
};
|
|
92
|
+
}, [internalFocused, handleBlur, shouldPreventBlur]);
|
|
93
|
+
|
|
94
|
+
// 处理点击事件
|
|
95
|
+
var handleClick = useCallback(function (event) {
|
|
96
|
+
handleFocus();
|
|
97
|
+
}, [handleFocus]);
|
|
98
|
+
|
|
99
|
+
// 暴露给父组件的方法
|
|
100
|
+
useImperativeHandle(ref, function () {
|
|
101
|
+
return {
|
|
102
|
+
focus: handleFocus,
|
|
103
|
+
blur: handleBlur
|
|
104
|
+
};
|
|
105
|
+
}, [handleFocus, handleBlur]);
|
|
106
|
+
|
|
107
|
+
// 计算组件高度
|
|
108
|
+
var componentHeight = typeof height === 'number' ? "".concat(height, "px") : height;
|
|
109
|
+
|
|
110
|
+
// 获取基础字体大小
|
|
111
|
+
var getBaseFontSize = useCallback(function () {
|
|
112
|
+
if (fontSize) {
|
|
113
|
+
return typeof fontSize === 'number' ? fontSize : parseFloat(fontSize);
|
|
114
|
+
}
|
|
115
|
+
return typeof height === 'number' ? height * 0.8 : 48;
|
|
116
|
+
}, [fontSize, height]);
|
|
117
|
+
|
|
118
|
+
// 计算最小和最大字体大小
|
|
119
|
+
var baseFontSize = getBaseFontSize();
|
|
120
|
+
var minFontSize = Math.max(10, baseFontSize * 0.2);
|
|
121
|
+
var maxFontSize = baseFontSize;
|
|
122
|
+
|
|
123
|
+
// 计算光标高度(容器高度的三分之二)
|
|
124
|
+
var caretHeight = "calc(".concat(componentHeight, " * 0.67)");
|
|
125
|
+
|
|
126
|
+
// 合并样式,将高度和光标高度传递给组件
|
|
127
|
+
var mergedStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
128
|
+
'--virtual-input-height': componentHeight,
|
|
129
|
+
'--virtual-input-caret-height': caretHeight,
|
|
130
|
+
'--virtual-input-font-size': "".concat(baseFontSize, "px")
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// 是否显示占位符
|
|
134
|
+
var showPlaceholder = value === undefined || value === '';
|
|
135
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
ref: containerRef,
|
|
137
|
+
className: classNames('pisell-base-virtual-input', {
|
|
138
|
+
'pisell-base-virtual-input--focused': internalFocused,
|
|
139
|
+
'pisell-base-virtual-input--disabled': disabled
|
|
140
|
+
}, className),
|
|
141
|
+
style: mergedStyle,
|
|
142
|
+
onClick: handleClick
|
|
143
|
+
}, showPlaceholder && /*#__PURE__*/React.createElement(AutoResizeText, {
|
|
144
|
+
className: "pisell-base-virtual-input-placeholder",
|
|
145
|
+
mode: "oneline",
|
|
146
|
+
minFontSizePx: minFontSize,
|
|
147
|
+
maxFontSizePx: maxFontSize,
|
|
148
|
+
fontSizePrecisionPx: 0.5
|
|
149
|
+
}, placeholder), !!value && /*#__PURE__*/React.createElement(AutoResizeText, {
|
|
150
|
+
className: "pisell-base-virtual-input-value",
|
|
151
|
+
mode: "oneline",
|
|
152
|
+
minFontSizePx: minFontSize,
|
|
153
|
+
maxFontSizePx: maxFontSize,
|
|
154
|
+
fontSizePrecisionPx: 0.5,
|
|
155
|
+
scrollToEnd: true
|
|
156
|
+
}, value), /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: "pisell-base-virtual-input-caret-container"
|
|
158
|
+
}, internalFocused && !disabled && showCursor && /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: "pisell-base-virtual-input-caret"
|
|
160
|
+
})));
|
|
161
|
+
});
|
|
162
|
+
BaseVirtualInput.displayName = 'BaseVirtualInput';
|
|
163
|
+
export default BaseVirtualInput;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.pisell-base-virtual-input {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
transition: all 0.2s ease;
|
|
8
|
+
outline: none;
|
|
9
|
+
position: relative;
|
|
10
|
+
height: var(--virtual-input-height);
|
|
11
|
+
|
|
12
|
+
&--disabled {
|
|
13
|
+
cursor: not-allowed;
|
|
14
|
+
opacity: 0.6;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pisell-base-virtual-input-placeholder {
|
|
19
|
+
color: #98a2b3;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
user-select: none;
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 100%;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
font-size: var(--virtual-input-font-size);
|
|
30
|
+
height: var(--virtual-input-height);
|
|
31
|
+
line-height: var(--virtual-input-height);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pisell-base-virtual-input-value {
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
// width: 100%;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
overflow-y: hidden;
|
|
41
|
+
overflow-x: auto;
|
|
42
|
+
font-size: var(--virtual-input-font-size);
|
|
43
|
+
line-height: var(--virtual-input-height);
|
|
44
|
+
height: var(--virtual-input-height);
|
|
45
|
+
|
|
46
|
+
-ms-overflow-style: none; /* IE 和 Edge */
|
|
47
|
+
scrollbar-width: none; /* Firefox */
|
|
48
|
+
&::-webkit-scrollbar {
|
|
49
|
+
display: none; /* Chrome, Safari 和 Opera */
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pisell-base-virtual-input-caret-container {
|
|
54
|
+
height: 100%;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pisell-base-virtual-input-caret {
|
|
61
|
+
width: 2px;
|
|
62
|
+
height: var(--virtual-input-caret-height);
|
|
63
|
+
background-color: #1570ef;
|
|
64
|
+
border-radius: 1px;
|
|
65
|
+
animation: pisell-base-virtual-input-caret-blink 1s infinite;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes pisell-base-virtual-input-caret-blink {
|
|
69
|
+
0%,
|
|
70
|
+
50% {
|
|
71
|
+
opacity: 1;
|
|
72
|
+
}
|
|
73
|
+
51%,
|
|
74
|
+
100% {
|
|
75
|
+
opacity: 0;
|
|
76
|
+
}
|
|
77
|
+
}
|