@flatbiz/antd 4.4.13 → 4.4.15
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/esm/date-range-picker-wrapper-form-item/index.js +2 -1
- package/esm/date-range-picker-wrapper-form-item/index.js.map +1 -1
- package/esm/dialog-confirm/index.js +1 -1
- package/esm/dialog-confirm/index.js.map +1 -1
- package/esm/dialog-drawer/index.js +1 -1
- package/esm/dialog-drawer/index.js.map +1 -1
- package/esm/dialog-drawer-content/index.js.map +1 -1
- package/esm/dialog-modal/index.js +1 -1
- package/esm/dialog-modal/index.js.map +1 -1
- package/esm/drag-form-list/index.css +1 -1
- package/esm/drag-form-list/index.js +4 -1
- package/esm/drag-form-list/index.js.map +1 -1
- package/esm/easy-form/index.js +2 -1
- package/esm/easy-form/index.js.map +1 -1
- package/esm/easy-table/index.js +5 -2
- package/esm/easy-table/index.js.map +1 -1
- package/esm/fba-app/index.js +1 -1
- package/esm/fba-app/index.js.map +1 -1
- package/esm/file-export/index.js +1 -1
- package/esm/file-export/index.js.map +1 -1
- package/esm/file-import/index.js.map +1 -1
- package/esm/form-item-group/index.js.map +1 -1
- package/esm/form-item-text/index.js +2 -1
- package/esm/form-item-text/index.js.map +1 -1
- package/esm/form-item-wrapper/index.css +1 -0
- package/esm/form-item-wrapper/index.js +2 -1
- package/esm/form-item-wrapper/index.js.map +1 -1
- package/esm/form-list-wrapper/index.css +1 -1
- package/esm/form-list-wrapper/index.js +4 -1
- package/esm/form-list-wrapper/index.js.map +1 -1
- package/esm/form-wrapper/index.css +1 -0
- package/esm/form-wrapper/index.js +2 -1
- package/esm/form-wrapper/index.js.map +1 -1
- package/esm/index.js +5 -4
- package/esm/modal-action/index.js.map +1 -1
- package/esm/pre-defined-class-name/index.js +1 -1
- package/esm/pre-defined-class-name/index.js.map +1 -1
- package/esm/rich-text-editor/index.js +1 -1
- package/esm/rich-text-editor/index.js.map +1 -1
- package/esm/upload-wrapper/index.js.map +1 -1
- package/index.d.ts +278 -115
- package/package.json +1 -1
package/esm/fba-app/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/fba-app/context.ts","@flatbiz/antd/src/fba-app/dialog-modal/index.tsx","@flatbiz/antd/src/fba-app/dialog-confirm/index.tsx","@flatbiz/antd/src/fba-app/dialog-alert/index.tsx","@flatbiz/antd/src/fba-app/dialog-drawer/index.tsx","@flatbiz/antd/src/fba-app/dialog-loading/index.tsx","@flatbiz/antd/src/fba-app/fba-app.tsx","@flatbiz/antd/src/fba-app/index.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { FbaAppAlertProps } from './dialog-alert';\nimport { FbaAppConfirmProps } from './dialog-confirm';\nimport { FbaAppDrawerProps } from './dialog-drawer';\nimport { FbaAppLoadingProps } from './dialog-loading';\nimport { FbaAppModalProps } from './dialog-modal';\n\nexport type FbaAppContextApi = {\n dialogDrawerOpen?: (data: FbaAppDrawerProps) => void;\n dialogDrawerClose?: (e?) => void;\n\n dialogDrawerOpen2?: (data: FbaAppDrawerProps) => void;\n dialogDrawerClose2?: (e?) => void;\n\n dialogModalOpen?: (data: FbaAppModalProps) => void;\n dialogModalClose?: () => void;\n\n dialogModalOpen2?: (data: FbaAppModalProps) => void;\n dialogModalClose2?: () => void;\n\n dialogAlertOpen?: (data: FbaAppAlertProps) => void;\n dialogAlertClose?: () => void;\n\n dialogConfirmOpen?: (data: FbaAppConfirmProps) => void;\n dialogConfirmClose?: () => void;\n\n dialogLoadingOpen?: (data?: FbaAppLoadingProps & { open?: boolean }) => void;\n dialogLoadingClose?: () => void;\n};\n\nexport const FbaAppContext = createContext<FbaAppContextApi>({});\n","import { isNull, isPromise } from '@dimjs/lang';\nimport { classNames } from '@dimjs/utils';\n\nimport { TNoopDefine } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { useSize } from 'ahooks';\nimport { Form, FormInstance, Modal, ModalProps } from 'antd';\nimport { ReactElement, useMemo } from 'react';\nimport { ButtonWrapper, ButtonWrapperProps } from '../../button-wrapper';\nimport { FlexLayout } from '../../flex-layout';\nimport { getFbaLocaleMessage } from '../../_utils/i18n';\nimport './style.less';\n\nexport type FbaAppModalProps = Omit<\n ModalProps,\n 'onOk' | 'onCancel' | 'getContainer' | 'okButtonProps' | 'cancelButtonProps' | 'footer'\n> & {\n onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onClose?: () => void;\n content: string | ReactElement | ((form: FormInstance, operate: { onClose: TNoopDefine }) => ReactElement);\n okHidden?: boolean;\n cancelHidden?: boolean;\n okButtonProps?: Omit<ButtonWrapperProps, 'hidden' | 'children' | 'onClick'>;\n cancelButtonProps?: Omit<ButtonWrapperProps, 'hidden' | 'children' | 'onClick'>;\n /**\n * 设置modal body height 为当前窗口height的百分比,例如:30\n * ```\n * 1. 最大值:80\n * 1. 设置bodyStyle.height 后,bodyHeightPercent失效\n * ```\n */\n bodyHeightPercent?: number;\n\n titleExtra?: ReactElement;\n /** null则隐藏footer */\n footer?: null | ReactElement | ReactElement[];\n};\n\nexport const FbaAppModal = (props: FbaAppModalProps) => {\n const {\n titleExtra,\n title,\n onOk,\n onCancel,\n okButtonProps,\n cancelButtonProps,\n content,\n className,\n okHidden,\n cancelHidden,\n footer,\n cancelText,\n okText,\n bodyHeightPercent,\n ...otherProps\n } = props;\n const [form] = Form.useForm();\n const size = useSize(document.querySelector('html'));\n const localMessage = getFbaLocaleMessage();\n\n const onClose = hooks.useCallbackRef(() => {\n props.onClose?.();\n });\n\n const onCancelHandle = hooks.useCallbackRef((e) => {\n if (onCancel) {\n const response = onCancel(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose();\n return Promise.resolve();\n });\n\n const onOkHandle = hooks.useCallbackRef((e) => {\n if (onOk) {\n const response = onOk(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose();\n return Promise.resolve();\n });\n\n const operateGroup = [\n <ButtonWrapper key=\"0\" {...cancelButtonProps} onClick={onCancelHandle} hidden={cancelHidden}>\n {cancelText || localMessage.FbaDialogModal?.cancelText}\n </ButtonWrapper>,\n <ButtonWrapper key=\"1\" type=\"primary\" {...okButtonProps} onClick={onOkHandle} hidden={okHidden}>\n {okText || '提交'}\n </ButtonWrapper>,\n ];\n\n const footerNew = isNull(footer) ? null : operateGroup;\n\n const height = useMemo(() => {\n if (!size?.height || !bodyHeightPercent) {\n return 'auto';\n }\n return size?.height * (bodyHeightPercent / 100);\n }, [bodyHeightPercent, size?.height]);\n\n return (\n <Modal\n maskClosable={true}\n title={\n titleExtra ? (\n <FlexLayout direction=\"horizontal\" fullIndex={0}>\n <span>{title}</span>\n {titleExtra}\n </FlexLayout>\n ) : (\n title\n )\n }\n centered={true}\n onCancel={onClose}\n destroyOnClose\n {...otherProps}\n styles={{\n body: {\n height,\n maxHeight: size?.height ? size?.height * 0.8 : 'calc(100vh - 200px)',\n ...otherProps.styles?.body,\n },\n }}\n className={classNames('fba-dialog-modal', { 'fba-dialog-modal-title-extra': !!titleExtra }, className)}\n open={props.open}\n footer={footerNew}\n >\n {typeof content === 'function' ? content(form, { onClose }) : content}\n </Modal>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { FbaAppModal, FbaAppModalProps } from '../dialog-modal';\nimport './style.less';\n\nexport type FbaAppConfirmProps = FbaAppModalProps;\n\nexport const FbaAppConfirm = (props: FbaAppConfirmProps) => {\n const className = classNames('fba-dialog-confirm', props.className);\n return (\n <FbaAppModal\n okText=\"确定\"\n width={350}\n cancelText=\"取消\"\n maskClosable={true}\n {...props}\n className={className}\n />\n );\n};\n","import { FbaAppConfirm } from '../dialog-confirm';\nimport { FbaAppModalProps } from '../dialog-modal';\n\n// export type DialogAlertProps = Omit<\n// DialogModalProps,\n// 'onOk' | 'cancelHidden' | 'cancelButtonProps' | 'onCancel' | 'onClick'\n// > & {\n// onClick?: (e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n// };\n\n// export const dialogAlert = {\n// open: (props: DialogAlertProps) => {\n// return dialogConfirm.open({\n// okText: '确定',\n// cancelHidden: true,\n// maskClosable: false,\n// ...props,\n// onOk: props.onClick,\n// } as DialogModalProps);\n// },\n// };\n\nexport type FbaAppAlertProps = Omit<\n FbaAppModalProps,\n 'onOk' | 'cancelHidden' | 'cancelButtonProps' | 'onCancel' | 'onClick'\n> & {\n onClick?: (e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n};\n\nexport const FbaAppAlert = (props: FbaAppAlertProps) => {\n return (\n <FbaAppConfirm\n okText=\"确定\"\n cancelHidden={true}\n maskClosable={false}\n {...props}\n onOk={(_form, e) => {\n return props.onClick?.(e);\n }}\n />\n );\n};\n","import { isPromise } from '@dimjs/lang';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { Drawer, DrawerProps, Form, FormInstance, Space } from 'antd';\nimport { ReactElement, ReactNode } from 'react';\nimport { ButtonWrapper, ButtonWrapperProps } from '../../button-wrapper';\nimport './style.less';\n\nexport type FbaAppDrawerProps = Omit<\n DrawerProps,\n 'onOk' | 'onCancel' | 'getContainer' | 'footer' | 'extra'\n> & {\n okText?: string | ReactElement;\n cancelText?: string | ReactElement;\n onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n content:\n | string\n | ReactElement\n | ((form: FormInstance, operate: { onClose: DrawerProps['onClose'] }) => ReactElement);\n okButtonExtraProps?: Omit<ButtonWrapperProps, 'onClick' | 'children' | 'loading'>;\n cancelButtonExtraProps?: Omit<ButtonWrapperProps, 'onClick' | 'children'>;\n operatePosition?: 'header' | 'footer';\n operateRender?: (form: FormInstance) => ReactElement;\n okHidden?: boolean;\n cancelHidden?: boolean;\n extra?: ReactNode | ((form: FormInstance) => ReactElement);\n};\n\nexport const FbaAppDrawer = (props: FbaAppDrawerProps) => {\n const {\n onOk,\n onCancel,\n content,\n okText,\n cancelText,\n okButtonExtraProps,\n cancelButtonExtraProps,\n operatePosition = 'footer',\n operateRender,\n width = 600,\n okHidden,\n cancelHidden,\n extra,\n ...otherProps\n } = props;\n const [form] = Form.useForm();\n\n const onClose = hooks.useCallbackRef((e) => {\n props.onClose?.(e);\n });\n\n const onCancelHandle = hooks.useCallbackRef((e) => {\n if (onCancel) {\n const response = onCancel(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose(e);\n return Promise.resolve();\n });\n\n const onOkHandle = hooks.useCallbackRef((e) => {\n if (onOk) {\n const response = onOk(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose(e);\n return Promise.resolve();\n });\n\n const operateGroup = (\n <Space>\n {cancelHidden || cancelButtonExtraProps?.hidden ? null : (\n <ButtonWrapper {...cancelButtonExtraProps} onClick={onCancelHandle}>\n {cancelText || '取消'}\n </ButtonWrapper>\n )}\n {okHidden || okButtonExtraProps?.hidden ? null : (\n <ButtonWrapper type=\"primary\" {...okButtonExtraProps} onClick={onOkHandle}>\n {okText || '提交'}\n </ButtonWrapper>\n )}\n </Space>\n );\n\n const operateRenderHandle = () => {\n if (operateRender) {\n return operateRender(form);\n }\n if (!okHidden || !cancelHidden) {\n return operateGroup;\n }\n return null;\n };\n\n const extraRender = typeof extra === 'function' ? extra(form) : extra;\n return (\n <Drawer\n maskClosable={true}\n destroyOnClose\n width={width}\n contentWrapperStyle={{ maxWidth: '95%' }}\n footer={operatePosition === 'footer' ? operateRenderHandle() : null}\n {...otherProps}\n className={classNames('app-dialog-drawer', otherProps.className)}\n extra={operatePosition === 'header' ? operateRenderHandle() : extraRender}\n open={props.open}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(form, { onClose }) : content}\n </Drawer>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { Modal, theme } from 'antd';\nimport { CSSProperties } from 'react';\nimport { BlockLayout } from '../../block-layout';\nimport './style.less';\n\nexport type FbaAppLoadingProps = {\n className?: string;\n message?: string;\n mask?: boolean;\n};\n\nexport const FbaAppLoading = (props: FbaAppLoadingProps & { open?: boolean }) => {\n const { className, message, mask } = props;\n const { token } = theme.useToken();\n const colorPrimary = token.colorPrimary;\n\n return (\n <Modal\n maskClosable={false}\n centered={true}\n destroyOnClose\n className={classNames('fba-dialog-loading', className)}\n open={props.open}\n footer={null}\n closable={false}\n style={{ '--fba-loading-color': colorPrimary } as CSSProperties}\n mask={mask}\n >\n <BlockLayout className={classNames('fba-dialog-loading-content')}>\n <div className=\"loader-wrapper\">\n <div className=\"loader-inner\" />\n <div className=\"loader-text\">{message || '处理中'}</div>\n </div>\n </BlockLayout>\n </Modal>\n );\n};\n","import { getUuid } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { ReactNode, useContext, useState } from 'react';\nimport { FbaAppContext, FbaAppContextApi } from './context';\nimport { FbaAppAlert, FbaAppAlertProps } from './dialog-alert';\nimport { FbaAppConfirm, FbaAppConfirmProps } from './dialog-confirm';\nimport { FbaAppDrawer, FbaAppDrawerProps } from './dialog-drawer';\nimport { FbaAppLoading, FbaAppLoadingProps } from './dialog-loading';\nimport { FbaAppModal, FbaAppModalProps } from './dialog-modal';\n\n/**\n * 不支持多个弹框,第二个弹框可使用useDialogDrawer2\n * @returns\n */\nexport const useDialogDrawer = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogDrawerClose?.();\n };\n\n return {\n appDialogDrawer: {\n open: (data: FbaAppDrawerProps) => {\n ctx.dialogDrawerOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\nexport const useDialogDrawer2 = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogDrawerClose2?.();\n };\n\n return {\n appDialogDrawer2: {\n open: (data: FbaAppDrawerProps) => {\n ctx.dialogDrawerOpen2?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框,第二个弹框可使用useDialogModal2\n * @returns\n */\nexport const useDialogModal = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogModalClose?.();\n };\n\n return {\n appDialogModal: {\n open: (data: FbaAppModalProps) => {\n ctx.dialogModalOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogModal2 = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogModalClose2?.();\n };\n\n return {\n appDialogModal2: {\n open: (data: FbaAppModalProps) => {\n ctx.dialogModalOpen2?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogAlert = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogAlertClose?.();\n };\n\n return {\n appDialogAlert: {\n open: (data: FbaAppAlertProps) => {\n ctx.dialogAlertOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogConfirm = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogConfirmClose?.();\n };\n\n return {\n appDialogConfirm: {\n open: (data: FbaAppConfirmProps) => {\n ctx.dialogConfirmOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogLoading = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogLoadingClose?.();\n };\n\n return {\n appDialogLoading: {\n open: (data?: FbaAppLoadingProps) => {\n ctx.dialogLoadingOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\nexport const FbaApp = (props: { children: ReactNode }) => {\n const [drawerProps, setDrawerProps] = useState<FbaAppDrawerProps>({} as FbaAppDrawerProps);\n const [drawerKey, setDrawerKey] = useState(getUuid());\n\n const [drawerProps2, setDrawerProps2] = useState<FbaAppDrawerProps>({} as FbaAppDrawerProps);\n const [drawerKey2, setDrawerKey2] = useState(getUuid());\n\n const [modalProps, setModalProps] = useState<FbaAppModalProps>({} as FbaAppModalProps);\n const [modalKey, setModalKey] = useState(getUuid());\n\n const [modalProps2, setModalProps2] = useState<FbaAppModalProps>({} as FbaAppModalProps);\n const [modalKey2, setModalKey2] = useState(getUuid());\n\n const [alertProps, setAlertProps] = useState<FbaAppAlertProps>({} as FbaAppAlertProps);\n const [confirmProps, setConfirmProps] = useState<FbaAppConfirmProps>({} as FbaAppConfirmProps);\n const [loadingProps, setLoadingProps] = useState<FbaAppLoadingProps>();\n\n const [alertKey, setAlertKey] = useState(getUuid());\n const [confirmKey, setConfirmKey] = useState(getUuid());\n const [loadingKey, setLoadingKey] = useState(getUuid());\n\n const dialogDrawerOpen: FbaAppContextApi['dialogDrawerOpen'] = hooks.useCallbackRef((data) => {\n setDrawerProps(data);\n });\n const dialogDrawerClose = hooks.useCallbackRef((e) => {\n setDrawerProps({ ...drawerProps, open: false } as FbaAppDrawerProps);\n drawerProps.onClose?.(e);\n setTimeout(() => {\n setDrawerKey(getUuid());\n }, 200);\n });\n\n const dialogDrawerOpen2: FbaAppContextApi['dialogDrawerOpen2'] = hooks.useCallbackRef((data) => {\n setDrawerProps2(data);\n });\n\n const dialogDrawerClose2 = hooks.useCallbackRef((e) => {\n setDrawerProps2({ ...drawerProps2, open: false } as FbaAppDrawerProps);\n drawerProps2.onClose?.(e);\n setTimeout(() => {\n setDrawerKey2(getUuid());\n }, 200);\n });\n\n const dialogModalOpen: FbaAppContextApi['dialogModalOpen'] = hooks.useCallbackRef((data) => {\n setModalProps(data);\n });\n\n const dialogModalClose = hooks.useCallbackRef(() => {\n setModalProps({ ...modalProps, open: false } as FbaAppModalProps);\n modalProps.onClose?.();\n setTimeout(() => {\n setModalKey(getUuid());\n }, 200);\n });\n\n const dialogModalOpen2: FbaAppContextApi['dialogModalOpen2'] = hooks.useCallbackRef((data) => {\n setModalProps2(data);\n });\n\n const dialogModalClose2 = hooks.useCallbackRef(() => {\n setModalProps2({ ...modalProps2, open: false } as FbaAppModalProps);\n modalProps2.onClose?.();\n setTimeout(() => {\n setModalKey2(getUuid());\n }, 200);\n });\n\n const dialogAlertOpen: FbaAppContextApi['dialogAlertOpen'] = hooks.useCallbackRef((data) => {\n setAlertProps(data);\n });\n\n const dialogAlertClose = hooks.useCallbackRef(() => {\n setAlertProps({ ...alertProps, open: false } as FbaAppAlertProps);\n alertProps.onClose?.();\n setTimeout(() => {\n setAlertKey(getUuid());\n }, 200);\n });\n\n const dialogConfirmOpen: FbaAppContextApi['dialogConfirmOpen'] = hooks.useCallbackRef((data) => {\n setConfirmProps(data);\n });\n\n const dialogConfirmClose = hooks.useCallbackRef(() => {\n setConfirmProps({ ...confirmProps, open: false } as FbaAppConfirmProps);\n confirmProps.onClose?.();\n setTimeout(() => {\n setConfirmKey(getUuid());\n }, 200);\n });\n\n const dialogLoadingOpen: FbaAppContextApi['dialogLoadingOpen'] = hooks.useCallbackRef((data) => {\n setLoadingProps(data);\n });\n\n const dialogLoadingClose = hooks.useCallbackRef(() => {\n setLoadingProps({ ...loadingProps, open: false } as FbaAppLoadingProps);\n setTimeout(() => {\n setLoadingKey(getUuid());\n }, 200);\n });\n\n return (\n <FbaAppContext.Provider\n value={{\n dialogDrawerOpen,\n dialogDrawerClose,\n dialogDrawerOpen2,\n dialogDrawerClose2,\n dialogModalOpen,\n dialogModalClose,\n dialogModalOpen2,\n dialogModalClose2,\n dialogAlertOpen,\n dialogAlertClose,\n dialogConfirmOpen,\n dialogConfirmClose,\n dialogLoadingOpen,\n dialogLoadingClose,\n }}\n >\n <FbaAppDrawer {...drawerProps} onClose={dialogDrawerClose} key={drawerKey}></FbaAppDrawer>\n <FbaAppDrawer {...drawerProps2} onClose={dialogDrawerClose2} key={drawerKey2}></FbaAppDrawer>\n <FbaAppModal {...modalProps} onClose={dialogModalClose} key={modalKey}></FbaAppModal>\n <FbaAppModal {...modalProps2} onClose={dialogModalClose2} key={modalKey2}></FbaAppModal>\n <FbaAppAlert {...alertProps} onClose={dialogAlertClose} key={alertKey}></FbaAppAlert>\n <FbaAppConfirm {...confirmProps} onClose={dialogConfirmClose} key={confirmKey}></FbaAppConfirm>\n <FbaAppLoading {...loadingProps} key={loadingKey}></FbaAppLoading>\n {props.children}\n </FbaAppContext.Provider>\n );\n};\n","import { fbaUtils } from '../fba-utils';\nimport {\n FbaApp as FbaAppInner,\n useDialogAlert,\n useDialogConfirm,\n useDialogDrawer,\n useDialogDrawer2,\n useDialogLoading,\n useDialogModal,\n useDialogModal2,\n} from './fba-app';\n\nexport const FbaApp = fbaUtils.attachPropertiesToComponent(FbaAppInner, {\n /** 不支持多次弹框,第二个弹框可使用useDialogDrawer2 */\n useDialogDrawer,\n useDialogDrawer2,\n /** 不支持多次弹框,第二个弹框可使用useDialogModal2 */\n useDialogModal,\n useDialogModal2,\n /** 不支持多次弹框 */\n useDialogConfirm,\n /** 不支持多次弹框 */\n useDialogAlert,\n /** 不支持多次弹框 */\n useDialogLoading,\n});\n"],"names":["FbaAppContext","createContext","FbaAppModal","props","_localMessage$FbaDial","_otherProps$styles","titleExtra","title","onOk","onCancel","okButtonProps","cancelButtonProps","content","className","okHidden","cancelHidden","footer","cancelText","okText","bodyHeightPercent","otherProps","_objectWithoutPropertiesLoose","_excluded","_Form$useForm","Form","useForm","form","size","useSize","document","querySelector","localMessage","getFbaLocaleMessage","onClose","_hooks","useCallbackRef","onCancelHandle","e","response","_isPromise","then","Promise","resolve","onOkHandle","operateGroup","_jsx","ButtonWrapper","_extends","onClick","hidden","children","FbaDialogModal","type","footerNew","_isNull","height","useMemo","Modal","maskClosable","_jsxs","FlexLayout","direction","fullIndex","centered","destroyOnClose","styles","body","maxHeight","_classNames","open","FbaAppConfirm","width","FbaAppAlert","_form","FbaAppDrawer","okButtonExtraProps","cancelButtonExtraProps","_props$operatePositio","operatePosition","operateRender","_props$width","extra","Space","operateRenderHandle","extraRender","Drawer","contentWrapperStyle","maxWidth","FbaAppLoading","message","mask","_theme$useToken","theme","useToken","token","colorPrimary","closable","style","BlockLayout","useDialogDrawer","ctx","useContext","dialogDrawerClose","appDialogDrawer","data","dialogDrawerOpen","close","useDialogDrawer2","dialogDrawerClose2","appDialogDrawer2","dialogDrawerOpen2","useDialogModal","dialogModalClose","appDialogModal","dialogModalOpen","useDialogModal2","dialogModalClose2","appDialogModal2","dialogModalOpen2","useDialogAlert","dialogAlertClose","appDialogAlert","dialogAlertOpen","useDialogConfirm","dialogConfirmClose","appDialogConfirm","dialogConfirmOpen","useDialogLoading","dialogLoadingClose","appDialogLoading","dialogLoadingOpen","FbaApp","_useState","useState","drawerProps","setDrawerProps","_useState2","getUuid","drawerKey","setDrawerKey","_useState3","drawerProps2","setDrawerProps2","_useState4","drawerKey2","setDrawerKey2","_useState5","modalProps","setModalProps","_useState6","modalKey","setModalKey","_useState7","modalProps2","setModalProps2","_useState8","modalKey2","setModalKey2","_useState9","alertProps","setAlertProps","_useState10","confirmProps","setConfirmProps","_useState11","loadingProps","setLoadingProps","_useState12","alertKey","setAlertKey","_useState13","confirmKey","setConfirmKey","_useState14","loadingKey","setLoadingKey","setTimeout","Provider","value","_createElement","key","fbaUtils","attachPropertiesToComponent","FbaAppInner"],"mappings":";w0CA8BO,IAAMA,EAAgBC,EAAgC,0LCStD,IAAMC,EAAc,SAAdA,EAAeC,GAA4B,IAAAC,EAAAC,EACtD,IACEC,EAeEH,EAfFG,WACAC,EAcEJ,EAdFI,MACAC,EAaEL,EAbFK,KACAC,EAYEN,EAZFM,SACAC,EAWEP,EAXFO,cACAC,EAUER,EAVFQ,kBACAC,EASET,EATFS,QACAC,EAQEV,EARFU,UACAC,EAOEX,EAPFW,SACAC,EAMEZ,EANFY,aACAC,EAKEb,EALFa,OACAC,EAIEd,EAJ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C,MAAO,CACLzE,iBAAAA,GACAH,kBAAAA,GACAQ,kBAAAA,GACAF,mBAAAA,GACAM,gBAAAA,GACAF,iBAAAA,GACAM,iBAAAA,GACAF,kBAAAA,GACAM,gBAAAA,GACAF,iBAAAA,GACAM,kBAAAA,GACAF,mBAAAA,GACAM,kBAAAA,GACAF,mBAAAA,IACA9E,UAEFiI,EAACzG,EAAY3B,KAAKuF,EAAW,CAAErG,QAASqE,GAAmB8E,IAAK1C,KAChEyC,EAACzG,EAAY3B,KAAK8F,EAAY,CAAE5G,QAAS2E,GAAoBwE,IAAKpC,KAClEmC,EAACjL,EAAW6C,KAAKoG,EAAU,CAAElH,QAAS+E,GAAkBoE,IAAK9B,KAC7D6B,EAACjL,EAAW6C,KAAK0G,EAAW,CAAExH,QAASmF,GAAmBgE,IAAKxB,KAC/DuB,EAAC3G,EAAWzB,KAAKgH,EAAU,CAAE9H,QAASuF,GAAkB4D,IAAKZ,KAC7DW,EAAC7G,EAAavB,KAAKmH,EAAY,CAAEjI,QAAS2F,GAAoBwD,IAAKT,KACnEQ,EAAC3F,EAAazC,KAAKsH,EAAY,CAAEe,IAAKN,MACrC3K,EAAM+C,WAGb,ECtRO,IAAMiF,EAASkD,EAASC,4BAA4BC,EAAa,CAEtEpF,gBAAAA,EACAQ,iBAAAA,EAEAI,eAAAA,EACAI,gBAAAA,EAEAQ,iBAAAA,EAEAJ,eAAAA,EAEAQ,iBAAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/fba-app/context.ts","@flatbiz/antd/src/fba-app/dialog-modal/index.tsx","@flatbiz/antd/src/fba-app/dialog-confirm/index.tsx","@flatbiz/antd/src/fba-app/dialog-alert/index.tsx","@flatbiz/antd/src/fba-app/dialog-drawer/index.tsx","@flatbiz/antd/src/fba-app/dialog-loading/index.tsx","@flatbiz/antd/src/fba-app/fba-app.tsx","@flatbiz/antd/src/fba-app/index.ts"],"sourcesContent":["import { createContext } from 'react';\nimport { FbaAppAlertProps } from './dialog-alert';\nimport { FbaAppConfirmProps } from './dialog-confirm';\nimport { FbaAppDrawerProps } from './dialog-drawer';\nimport { FbaAppLoadingProps } from './dialog-loading';\nimport { FbaAppModalProps } from './dialog-modal';\n\nexport type FbaAppContextApi = {\n dialogDrawerOpen?: (data: FbaAppDrawerProps) => void;\n dialogDrawerClose?: (e?) => void;\n\n dialogDrawerOpen2?: (data: FbaAppDrawerProps) => void;\n dialogDrawerClose2?: (e?) => void;\n\n dialogModalOpen?: (data: FbaAppModalProps) => void;\n dialogModalClose?: () => void;\n\n dialogModalOpen2?: (data: FbaAppModalProps) => void;\n dialogModalClose2?: () => void;\n\n dialogAlertOpen?: (data: FbaAppAlertProps) => void;\n dialogAlertClose?: () => void;\n\n dialogConfirmOpen?: (data: FbaAppConfirmProps) => void;\n dialogConfirmClose?: () => void;\n\n dialogLoadingOpen?: (data?: FbaAppLoadingProps & { open?: boolean }) => void;\n dialogLoadingClose?: () => void;\n};\n\nexport const FbaAppContext = createContext<FbaAppContextApi>({});\n","import { isNull, isPromise } from '@dimjs/lang';\nimport { classNames } from '@dimjs/utils';\n\nimport { TNoopDefine } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { useSize } from 'ahooks';\nimport { Form, FormInstance, Modal, ModalProps } from 'antd';\nimport { ReactElement, useMemo } from 'react';\nimport { ButtonWrapper, ButtonWrapperProps } from '../../button-wrapper';\nimport { fbaHooks } from '../../fba-hooks';\nimport { FlexLayout } from '../../flex-layout';\nimport { getFbaLocaleMessage } from '../../_utils/i18n';\nimport './style.less';\n\nexport type FbaAppModalProps = Omit<\n ModalProps,\n 'onOk' | 'onCancel' | 'getContainer' | 'okButtonProps' | 'cancelButtonProps' | 'footer'\n> & {\n /**\n * 内置尺寸,根据比例固定高度、宽度,默认:middle\n * ```\n * 1. 如果自定义了width、styles.body.height属性,size中的height、width将对应失效\n * 2. 可传 null 值,取消内置尺寸\n * ```\n */\n size?: 'small' | 'middle' | 'large' | null;\n onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onClose?: () => void;\n content: string | ReactElement | ((form: FormInstance, operate: { onClose: TNoopDefine }) => ReactElement);\n okHidden?: boolean;\n cancelHidden?: boolean;\n okButtonProps?: Omit<ButtonWrapperProps, 'hidden' | 'children' | 'onClick'>;\n cancelButtonProps?: Omit<ButtonWrapperProps, 'hidden' | 'children' | 'onClick'>;\n /**\n * 设置modal body height 为当前窗口height的百分比,例如:30\n * @deprecated 已失效,可通过size属性设置\n * ```\n * 1. 最大值:80\n * 1. 设置bodyStyle.height 后,bodyHeightPercent失效\n * ```\n */\n bodyHeightPercent?: number;\n\n titleExtra?: ReactElement;\n /** null则隐藏footer */\n footer?: null | ReactElement | ReactElement[];\n};\n\nexport const FbaAppModal = (props: FbaAppModalProps) => {\n const {\n titleExtra,\n title,\n onOk,\n onCancel,\n okButtonProps,\n cancelButtonProps,\n content,\n className,\n okHidden,\n cancelHidden,\n footer,\n cancelText,\n okText,\n size,\n ...otherProps\n } = props;\n const [form] = Form.useForm();\n const htmlSize = useSize(document.querySelector('html'));\n const localMessage = getFbaLocaleMessage();\n const screenType = fbaHooks.useResponsivePoint() || '';\n const sizeFt = size === null ? undefined : size === undefined ? 'middle' : size;\n\n const onClose = hooks.useCallbackRef(() => {\n props.onClose?.();\n });\n\n const onCancelHandle = hooks.useCallbackRef((e) => {\n if (onCancel) {\n const response = onCancel(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose();\n return Promise.resolve();\n });\n\n const onOkHandle = hooks.useCallbackRef((e) => {\n if (onOk) {\n const response = onOk(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose();\n return Promise.resolve();\n });\n\n const operateGroup = [\n <ButtonWrapper key=\"0\" {...cancelButtonProps} onClick={onCancelHandle} hidden={cancelHidden}>\n {cancelText || localMessage.FbaDialogModal?.cancelText}\n </ButtonWrapper>,\n <ButtonWrapper key=\"1\" type=\"primary\" {...okButtonProps} onClick={onOkHandle} hidden={okHidden}>\n {okText || '提交'}\n </ButtonWrapper>,\n ];\n\n const footerNew = isNull(footer) ? null : operateGroup;\n\n const customSize = useMemo(() => {\n if (!htmlSize?.height || !screenType) return undefined;\n if (['xs', 'sm'].includes(screenType)) {\n return {\n height: (htmlSize?.height as number) * 0.7,\n };\n }\n if (sizeFt == 'large') {\n return {\n height: (htmlSize?.height as number) * 0.7,\n width: htmlSize.width * 0.6,\n };\n }\n if (sizeFt == 'small') {\n const width = htmlSize.width * 0.3;\n return {\n height: (htmlSize?.height as number) * 0.4,\n width: width < 470 ? 470 : width,\n };\n }\n\n if (sizeFt == 'middle') {\n return {\n height: (htmlSize?.height as number) * 0.55,\n width: htmlSize.width * 0.5,\n };\n }\n return undefined;\n }, [htmlSize?.height, sizeFt, otherProps.styles?.body?.height, otherProps.width, screenType]);\n\n return (\n <Modal\n maskClosable={true}\n title={\n titleExtra ? (\n <FlexLayout direction=\"horizontal\" fullIndex={0}>\n <span>{title}</span>\n {titleExtra}\n </FlexLayout>\n ) : (\n title\n )\n }\n centered={true}\n onCancel={onClose}\n destroyOnClose\n width={customSize?.width}\n {...otherProps}\n styles={{\n ...otherProps.styles,\n body: {\n height: customSize?.height,\n maxHeight: 'calc(100vh - 200px)',\n ...otherProps.styles?.body,\n },\n }}\n className={classNames('fba-dialog-modal', { 'fba-dialog-modal-title-extra': !!titleExtra }, className)}\n open={props.open}\n footer={footerNew}\n >\n {typeof content === 'function' ? content(form, { onClose }) : content}\n </Modal>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { FbaAppModal, FbaAppModalProps } from '../dialog-modal';\nimport './style.less';\n\nexport type FbaAppConfirmProps = FbaAppModalProps;\n\nexport const FbaAppConfirm = (props: FbaAppConfirmProps) => {\n const className = classNames('fba-dialog-confirm', props.className);\n return (\n <FbaAppModal\n okText=\"确定\"\n size={null}\n width={350}\n cancelText=\"取消\"\n maskClosable={true}\n {...props}\n className={className}\n />\n );\n};\n","import { FbaAppConfirm } from '../dialog-confirm';\nimport { FbaAppModalProps } from '../dialog-modal';\n\n// export type DialogAlertProps = Omit<\n// DialogModalProps,\n// 'onOk' | 'cancelHidden' | 'cancelButtonProps' | 'onCancel' | 'onClick'\n// > & {\n// onClick?: (e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n// };\n\n// export const dialogAlert = {\n// open: (props: DialogAlertProps) => {\n// return dialogConfirm.open({\n// okText: '确定',\n// cancelHidden: true,\n// maskClosable: false,\n// ...props,\n// onOk: props.onClick,\n// } as DialogModalProps);\n// },\n// };\n\nexport type FbaAppAlertProps = Omit<\n FbaAppModalProps,\n 'onOk' | 'cancelHidden' | 'cancelButtonProps' | 'onCancel' | 'onClick'\n> & {\n onClick?: (e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n};\n\nexport const FbaAppAlert = (props: FbaAppAlertProps) => {\n return (\n <FbaAppConfirm\n okText=\"确定\"\n cancelHidden={true}\n maskClosable={false}\n {...props}\n onOk={(_form, e) => {\n return props.onClick?.(e);\n }}\n />\n );\n};\n","import { isPromise } from '@dimjs/lang';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { Drawer, DrawerProps, Form, FormInstance, Space } from 'antd';\nimport { ReactElement, ReactNode, useMemo } from 'react';\nimport { ButtonWrapper, ButtonWrapperProps } from '../../button-wrapper';\nimport { fbaHooks } from '../../fba-hooks';\nimport './style.less';\n\nexport type FbaAppDrawerProps = Omit<\n DrawerProps,\n 'onOk' | 'onCancel' | 'getContainer' | 'footer' | 'extra'\n> & {\n okText?: string | ReactElement;\n cancelText?: string | ReactElement;\n onOk?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n onCancel?: (form: FormInstance, e: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n content:\n | string\n | ReactElement\n | ((form: FormInstance, operate: { onClose: DrawerProps['onClose'] }) => ReactElement);\n okButtonExtraProps?: Omit<ButtonWrapperProps, 'onClick' | 'children' | 'loading'>;\n cancelButtonExtraProps?: Omit<ButtonWrapperProps, 'onClick' | 'children'>;\n operatePosition?: 'header' | 'footer';\n operateRender?: (form: FormInstance) => ReactElement;\n okHidden?: boolean;\n cancelHidden?: boolean;\n extra?: ReactNode | ((form: FormInstance) => ReactElement);\n};\n\nexport const FbaAppDrawer = (props: FbaAppDrawerProps) => {\n const {\n onOk,\n onCancel,\n content,\n okText,\n cancelText,\n okButtonExtraProps,\n cancelButtonExtraProps,\n operatePosition = 'footer',\n operateRender,\n width = 600,\n okHidden,\n cancelHidden,\n extra,\n ...otherProps\n } = props;\n const [form] = Form.useForm();\n const screenType = fbaHooks.useResponsivePoint() || '';\n\n const onClose = hooks.useCallbackRef((e) => {\n props.onClose?.(e);\n });\n\n const onCancelHandle = hooks.useCallbackRef((e) => {\n if (onCancel) {\n const response = onCancel(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose(e);\n return Promise.resolve();\n });\n\n const onOkHandle = hooks.useCallbackRef((e) => {\n if (onOk) {\n const response = onOk(form, e);\n if (response && isPromise(response)) {\n return response.then(onClose);\n }\n }\n onClose(e);\n return Promise.resolve();\n });\n\n const operateGroup = (\n <Space>\n {cancelHidden || cancelButtonExtraProps?.hidden ? null : (\n <ButtonWrapper {...cancelButtonExtraProps} onClick={onCancelHandle}>\n {cancelText || '取消'}\n </ButtonWrapper>\n )}\n {okHidden || okButtonExtraProps?.hidden ? null : (\n <ButtonWrapper type=\"primary\" {...okButtonExtraProps} onClick={onOkHandle}>\n {okText || '提交'}\n </ButtonWrapper>\n )}\n </Space>\n );\n\n const operateRenderHandle = () => {\n if (operateRender) {\n return operateRender(form);\n }\n if (!okHidden || !cancelHidden) {\n return operateGroup;\n }\n return null;\n };\n\n const customSize = useMemo(() => {\n if (!screenType) return undefined;\n if (['xs', 'sm'].includes(screenType)) {\n return {\n width: '90%',\n maxWidth: '90%',\n };\n }\n return { width: '40%', maxWidth: 'calc(100% - 200px)' };\n }, [screenType]);\n\n const extraRender = typeof extra === 'function' ? extra(form) : extra;\n return (\n <Drawer\n maskClosable={true}\n destroyOnClose\n width={customSize?.width}\n // 5.13.0 新增 styles.wrapper,并废弃 contentWrapperStyle drawerStyle maskStyle 属性\n contentWrapperStyle={{ maxWidth: customSize?.maxWidth }}\n footer={operatePosition === 'footer' ? operateRenderHandle() : null}\n {...otherProps}\n styles={{\n ...otherProps.styles,\n // wrapper: {\n // maxWidth: customSize?.maxWidth,\n // ...otherProps.styles?.wrapper,\n // },\n }}\n className={classNames('app-dialog-drawer', otherProps.className)}\n extra={operatePosition === 'header' ? operateRenderHandle() : extraRender}\n open={props.open}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(form, { onClose }) : content}\n </Drawer>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { Modal, theme } from 'antd';\nimport { CSSProperties } from 'react';\nimport { BlockLayout } from '../../block-layout';\nimport './style.less';\n\nexport type FbaAppLoadingProps = {\n className?: string;\n message?: string;\n mask?: boolean;\n};\n\nexport const FbaAppLoading = (props: FbaAppLoadingProps & { open?: boolean }) => {\n const { className, message, mask } = props;\n const { token } = theme.useToken();\n const colorPrimary = token.colorPrimary;\n\n return (\n <Modal\n maskClosable={false}\n centered={true}\n destroyOnClose\n className={classNames('fba-dialog-loading', className)}\n open={props.open}\n footer={null}\n closable={false}\n style={{ '--fba-loading-color': colorPrimary } as CSSProperties}\n mask={mask}\n >\n <BlockLayout className={classNames('fba-dialog-loading-content')}>\n <div className=\"loader-wrapper\">\n <div className=\"loader-inner\" />\n <div className=\"loader-text\">{message || '处理中'}</div>\n </div>\n </BlockLayout>\n </Modal>\n );\n};\n","import { getUuid } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { ReactNode, useContext, useState } from 'react';\nimport { FbaAppContext, FbaAppContextApi } from './context';\nimport { FbaAppAlert, FbaAppAlertProps } from './dialog-alert';\nimport { FbaAppConfirm, FbaAppConfirmProps } from './dialog-confirm';\nimport { FbaAppDrawer, FbaAppDrawerProps } from './dialog-drawer';\nimport { FbaAppLoading, FbaAppLoadingProps } from './dialog-loading';\nimport { FbaAppModal, FbaAppModalProps } from './dialog-modal';\n\n/**\n * 不支持多个弹框,第二个弹框可使用useDialogDrawer2\n * @returns\n */\nexport const useDialogDrawer = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogDrawerClose?.();\n };\n\n return {\n appDialogDrawer: {\n open: (data: FbaAppDrawerProps) => {\n ctx.dialogDrawerOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\nexport const useDialogDrawer2 = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogDrawerClose2?.();\n };\n\n return {\n appDialogDrawer2: {\n open: (data: FbaAppDrawerProps) => {\n ctx.dialogDrawerOpen2?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框,第二个弹框可使用useDialogModal2\n * @returns\n */\nexport const useDialogModal = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogModalClose?.();\n };\n\n return {\n appDialogModal: {\n open: (data: FbaAppModalProps) => {\n ctx.dialogModalOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogModal2 = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogModalClose2?.();\n };\n\n return {\n appDialogModal2: {\n open: (data: FbaAppModalProps) => {\n ctx.dialogModalOpen2?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogAlert = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogAlertClose?.();\n };\n\n return {\n appDialogAlert: {\n open: (data: FbaAppAlertProps) => {\n ctx.dialogAlertOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogConfirm = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogConfirmClose?.();\n };\n\n return {\n appDialogConfirm: {\n open: (data: FbaAppConfirmProps) => {\n ctx.dialogConfirmOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n/**\n * 不支持多个弹框\n * @returns\n */\nexport const useDialogLoading = () => {\n const ctx = useContext(FbaAppContext);\n\n const onClose = () => {\n ctx.dialogLoadingClose?.();\n };\n\n return {\n appDialogLoading: {\n open: (data?: FbaAppLoadingProps) => {\n ctx.dialogLoadingOpen?.({ ...data, open: true });\n return { onClose };\n },\n close: onClose,\n },\n };\n};\n\nexport const FbaApp = (props: { children: ReactNode }) => {\n const [drawerProps, setDrawerProps] = useState<FbaAppDrawerProps>({} as FbaAppDrawerProps);\n const [drawerKey, setDrawerKey] = useState(getUuid());\n\n const [drawerProps2, setDrawerProps2] = useState<FbaAppDrawerProps>({} as FbaAppDrawerProps);\n const [drawerKey2, setDrawerKey2] = useState(getUuid());\n\n const [modalProps, setModalProps] = useState<FbaAppModalProps>({} as FbaAppModalProps);\n const [modalKey, setModalKey] = useState(getUuid());\n\n const [modalProps2, setModalProps2] = useState<FbaAppModalProps>({} as FbaAppModalProps);\n const [modalKey2, setModalKey2] = useState(getUuid());\n\n const [alertProps, setAlertProps] = useState<FbaAppAlertProps>({} as FbaAppAlertProps);\n const [confirmProps, setConfirmProps] = useState<FbaAppConfirmProps>({} as FbaAppConfirmProps);\n const [loadingProps, setLoadingProps] = useState<FbaAppLoadingProps>();\n\n const [alertKey, setAlertKey] = useState(getUuid());\n const [confirmKey, setConfirmKey] = useState(getUuid());\n const [loadingKey, setLoadingKey] = useState(getUuid());\n\n const dialogDrawerOpen: FbaAppContextApi['dialogDrawerOpen'] = hooks.useCallbackRef((data) => {\n setDrawerProps(data);\n });\n const dialogDrawerClose = hooks.useCallbackRef((e) => {\n setDrawerProps({ ...drawerProps, open: false } as FbaAppDrawerProps);\n drawerProps.onClose?.(e);\n setTimeout(() => {\n setDrawerKey(getUuid());\n }, 200);\n });\n\n const dialogDrawerOpen2: FbaAppContextApi['dialogDrawerOpen2'] = hooks.useCallbackRef((data) => {\n setDrawerProps2(data);\n });\n\n const dialogDrawerClose2 = hooks.useCallbackRef((e) => {\n setDrawerProps2({ ...drawerProps2, open: false } as FbaAppDrawerProps);\n drawerProps2.onClose?.(e);\n setTimeout(() => {\n setDrawerKey2(getUuid());\n }, 200);\n });\n\n const dialogModalOpen: FbaAppContextApi['dialogModalOpen'] = hooks.useCallbackRef((data) => {\n setModalProps(data);\n });\n\n const dialogModalClose = hooks.useCallbackRef(() => {\n setModalProps({ ...modalProps, open: false } as FbaAppModalProps);\n modalProps.onClose?.();\n setTimeout(() => {\n setModalKey(getUuid());\n }, 200);\n });\n\n const dialogModalOpen2: FbaAppContextApi['dialogModalOpen2'] = hooks.useCallbackRef((data) => {\n setModalProps2(data);\n });\n\n const dialogModalClose2 = hooks.useCallbackRef(() => {\n setModalProps2({ ...modalProps2, open: false } as FbaAppModalProps);\n modalProps2.onClose?.();\n setTimeout(() => {\n setModalKey2(getUuid());\n }, 200);\n });\n\n const dialogAlertOpen: FbaAppContextApi['dialogAlertOpen'] = hooks.useCallbackRef((data) => {\n setAlertProps(data);\n });\n\n const dialogAlertClose = hooks.useCallbackRef(() => {\n setAlertProps({ ...alertProps, open: false } as FbaAppAlertProps);\n alertProps.onClose?.();\n setTimeout(() => {\n setAlertKey(getUuid());\n }, 200);\n });\n\n const dialogConfirmOpen: FbaAppContextApi['dialogConfirmOpen'] = hooks.useCallbackRef((data) => {\n setConfirmProps(data);\n });\n\n const dialogConfirmClose = hooks.useCallbackRef(() => {\n setConfirmProps({ ...confirmProps, open: false } as FbaAppConfirmProps);\n confirmProps.onClose?.();\n setTimeout(() => {\n setConfirmKey(getUuid());\n }, 200);\n });\n\n const dialogLoadingOpen: FbaAppContextApi['dialogLoadingOpen'] = hooks.useCallbackRef((data) => {\n setLoadingProps(data);\n });\n\n const dialogLoadingClose = hooks.useCallbackRef(() => {\n setLoadingProps({ ...loadingProps, open: false } as FbaAppLoadingProps);\n setTimeout(() => {\n setLoadingKey(getUuid());\n }, 200);\n });\n\n return (\n <FbaAppContext.Provider\n value={{\n dialogDrawerOpen,\n dialogDrawerClose,\n dialogDrawerOpen2,\n dialogDrawerClose2,\n dialogModalOpen,\n dialogModalClose,\n dialogModalOpen2,\n dialogModalClose2,\n dialogAlertOpen,\n dialogAlertClose,\n dialogConfirmOpen,\n dialogConfirmClose,\n dialogLoadingOpen,\n dialogLoadingClose,\n }}\n >\n <FbaAppDrawer {...drawerProps} onClose={dialogDrawerClose} key={drawerKey}></FbaAppDrawer>\n <FbaAppDrawer {...drawerProps2} onClose={dialogDrawerClose2} key={drawerKey2}></FbaAppDrawer>\n <FbaAppModal {...modalProps} onClose={dialogModalClose} key={modalKey}></FbaAppModal>\n <FbaAppModal {...modalProps2} onClose={dialogModalClose2} key={modalKey2}></FbaAppModal>\n <FbaAppAlert {...alertProps} onClose={dialogAlertClose} key={alertKey}></FbaAppAlert>\n <FbaAppConfirm {...confirmProps} onClose={dialogConfirmClose} key={confirmKey}></FbaAppConfirm>\n <FbaAppLoading {...loadingProps} key={loadingKey}></FbaAppLoading>\n {props.children}\n </FbaAppContext.Provider>\n );\n};\n","import { fbaUtils } from '../fba-utils';\nimport {\n FbaApp as FbaAppInner,\n useDialogAlert,\n useDialogConfirm,\n useDialogDrawer,\n useDialogDrawer2,\n useDialogLoading,\n useDialogModal,\n useDialogModal2,\n} from './fba-app';\n\nexport const FbaApp = fbaUtils.attachPropertiesToComponent(FbaAppInner, {\n /** 不支持多次弹框,第二个弹框可使用useDialogDrawer2 */\n useDialogDrawer,\n useDialogDrawer2,\n /** 不支持多次弹框,第二个弹框可使用useDialogModal2 */\n useDialogModal,\n useDialogModal2,\n /** 不支持多次弹框 */\n useDialogConfirm,\n /** 不支持多次弹框 */\n useDialogAlert,\n /** 不支持多次弹框 */\n useDialogLoading,\n});\n"],"names":["FbaAppContext","createContext","FbaAppModal","props","_localMessage$FbaDial","_otherProps$styles","_otherProps$styles2","titleExtra","title","onOk","onCancel","okButtonProps","cancelButtonProps","content","className","okHidden","cancelHidden","footer","cancelText","okText","size","otherProps","_objectWithoutPropertiesLoose","_excluded","_Form$useForm","Form","useForm","form","htmlSize","useSize","document","querySelector","localMessage","getFbaLocaleMessage","screenType","fbaHooks","useResponsivePoint","sizeFt","undefined","onClose","_hooks","useCallbackRef","onCancelHandle","e","response","_isPromise","then","Promise","resolve","onOkHandle","operateGroup","_jsx","ButtonWrapper","_extends","onClick","hidden","children","FbaDialogModal","type","footerNew","_isNull","customSize","useMemo","height","includes","width","styles","body","Modal","maskClosable","_jsxs","FlexLayout","direction","fullIndex","centered","destroyOnClose","maxHeight","_classNames","open","FbaAppConfirm","FbaAppAlert","_form","FbaAppDrawer","okButtonExtraProps","cancelButtonExtraProps","_props$operatePositio","operatePosition","operateRender","extra","Space","operateRenderHandle","maxWidth","extraRender","Drawer","contentWrapperStyle","FbaAppLoading","message","mask","_theme$useToken","theme","useToken","token","colorPrimary","closable","style","BlockLayout","useDialogDrawer","ctx","useContext","dialogDrawerClose","appDialogDrawer","data","dialogDrawerOpen","close","useDialogDrawer2","dialogDrawerClose2","appDialogDrawer2","dialogDrawerOpen2","useDialogModal","dialogModalClose","appDialogModal","dialogModalOpen","useDialogModal2","dialogModalClose2","appDialogModal2","dialogModalOpen2","useDialogAlert","dialogAlertClose","appDialogAlert","dialogAlertOpen","useDialogConfirm","dialogConfirmClose","appDialogConfirm","dialogConfirmOpen","useDialogLoading","dialogLoadingClose","appDialogLoading","dialogLoadingOpen","FbaApp","_useState","useState","drawerProps","setDrawerProps","_useState2","getUuid","drawerKey","setDrawerKey","_useState3","drawerProps2","setDrawerProps2","_useState4","drawerKey2","setDrawerKey2","_useState5","modalProps","setModalProps","_useState6","modalKey","setModalKey","_useState7","modalProps2","setModalProps2","_useState8","modalKey2","setModalKey2","_useState9","alertProps","setAlertProps","_useState10","confirmProps","setConfirmProps","_useState11","loadingProps","setLoadingProps","_useState12","alertKey","setAlertKey","_useState13","confirmKey","setConfirmKey","_useState14","loadingKey","setLoadingKey","setTimeout","Provider","value","_createElement","key","fbaUtils","attachPropertiesToComponent","FbaAppInner"],"mappings":";21CA8BO,IAAMA,EAAgBC,EAAgC,6KCmBtD,IAAMC,EAAc,SAAdA,EAAeC,GAA4B,IAAAC,EAAAC,EAAAC,EACtD,IACEC,EAeEJ,EAfFI,WACAC,EAcEL,EAdFK,MACAC,EAaEN,EAbFM,KACAC,EAYEP,EAZFO,SACAC,EAWER,EAXFQ,cACAC,EAUET,EAVFS,kBACAC,EASEV,EATFU,QACAC,EAQEX,EARFW,UACAC,EAOEZ,EAPFY,SACAC,EAMEb,EANFa,aACAC,EAKEd,EALFc,OACAC,EAIEf,EAJFe,WACAC,EAGEhB,EAHFgB,OACAC,EAEEjB,EAFFiB,KACGC,EAAUC,EACXnB,EAAKoB,GACT,IAAAC,EAAeC,EAAKC,UAAbC,EAAIH,EAAA,GACX,IAAMI,EAAWC,EAAQC,SAASC,cAAc,SAChD,IAAMC,EAAeC,IACrB,IAAMC,EAAaC,EAASC,sBAAwB,GACpD,IAAMC,EAASjB,IAAS,KAAOkB,UAAYlB,IAASkB,UAAY,SAAWlB,EAE3E,IAAMmB,EAAUC,EAAMC,gBAAe,WACnCtC,EAAMoC,SAAO,UAAA,EAAbpC,EAAMoC,SACR,IAEA,IAAMG,EAAiBF,EAAMC,gBAAe,SAACE,GAC3C,GAAIjC,EAAU,CACZ,IAAMkC,EAAWlC,EAASiB,EAAMgB,GAChC,GAAIC,GAAYC,EAAUD,GAAW,CACnC,OAAOA,EAASE,KAAKP,EACvB,CACF,CACAA,IACA,OAAOQ,QAAQC,SACjB,IAEA,IAAMC,EAAaT,EAAMC,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AGb,ECtRO,IAAMkF,EAASkD,EAASC,4BAA4BC,EAAa,CAEtEpF,gBAAAA,EACAQ,iBAAAA,EAEAI,eAAAA,EACAI,gBAAAA,EAEAQ,iBAAAA,EAEAJ,eAAAA,EAEAQ,iBAAAA"}
|
package/esm/file-export/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
import{_ as
|
|
4
|
+
import{_ as r}from"../_rollupPluginBabelHelpers-a0769acd.js";import{message as t}from"antd";import{Fragment as e,isValidElement as o}from"react";import{jsx as n}from"react/jsx-runtime";var i=function i(c){var u=c.action;var a=function r(){return new Promise((function(r,e){var o,n,i;var u=function(){try{return r()}catch(r){return e(r)}};var a=function(r){try{if(c.onExportError){c.onExportError(r)}else{t.error((r==null?void 0:r.message)||"文件导出失败...")}return u()}catch(r){return e(r)}};try{c.onExportPre==null?void 0:c.onExportPre();return Promise.resolve(c.onRequest()).then((function(r){try{o=r;n=document.createElement("a");i=window.URL.createObjectURL(o.data);n.style.display="none";n.href=i;n.setAttribute("download",o.fileName);document.body.appendChild(n);n.click();document.body.removeChild(n);c.onExportNext==null?void 0:c.onExportNext();return u()}catch(r){return a(r)}}),a)}catch(r){a(r)}}))};return n(e,{children:o(u)?n(u.type,r({},u.props,{onClick:a})):u==null?void 0:u({onClick:a})})};export{i as FileExport};
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/file-export/file-export.tsx"],"sourcesContent":["import { Fragment, isValidElement, ReactElement } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/file-export/file-export.tsx"],"sourcesContent":["import { message } from 'antd';\nimport { Fragment, isValidElement, ReactElement } from 'react';\n\nexport type FileExportProps = {\n /** 触发节点 */\n action: (ReactElement & { onClick?: (e) => void }) | ((data: { onClick: (e) => void }) => ReactElement);\n /**\n * 获取文件流数据\n * ```\n * 1. fileName 文件名称\n * 2. data 文件流\n * ```\n */\n onRequest: () => Promise<{ fileName: string; data: Blob }>;\n /** 导出操作前 */\n onExportPre?: () => void;\n /** 导出操作后 */\n onExportNext?: () => void;\n /** 导出操作失败,隐藏默认失败效果 */\n onExportError?: (error?: any) => void;\n};\n\n/**\n * 文件导出\n * ```\n * demo:https://fex.qa.tcshuke.com/docs/admin/main/widget?key=file-export\n * 例如:\n <FileExport\n action={<Button>下载</Button>}\n onRequest={() => {\n return serviceHandle.fileExport('/export/file', {});\n }}\n onExportNext={() => {\n message.success('导出成功...');\n }}\n />\n * ```\n */\nexport const FileExport = (props: FileExportProps) => {\n const Action = props.action;\n\n const handleOnClick = async () => {\n try {\n props.onExportPre?.();\n const respData = await props.onRequest();\n const link = document.createElement('a');\n const url = window.URL.createObjectURL(respData.data);\n link.style.display = 'none';\n link.href = url;\n link.setAttribute('download', respData.fileName);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n props.onExportNext?.();\n } catch (error: any) {\n if (props.onExportError) {\n props.onExportError(error);\n } else {\n message.error(error?.message || '文件导出失败...');\n }\n }\n };\n\n return (\n <Fragment>\n {isValidElement(Action) ? (\n <Action.type {...Action.props} onClick={handleOnClick} />\n ) : (\n Action?.({ onClick: handleOnClick })\n )}\n </Fragment>\n );\n};\n"],"names":["FileExport","props","Action","action","handleOnClick","Promise","$return","$error","respData","link","url","$Try_1_Post","$boundEx","$Try_1_Catch","error","onExportError","message","onExportPre","resolve","onRequest","then","$await_2","document","createElement","window","URL","createObjectURL","data","style","display","href","setAttribute","fileName","body","appendChild","click","removeChild","onExportNext","_jsx","Fragment","children","isValidElement","type","_extends","onClick"],"mappings":";6LAsCaA,EAAa,SAAbA,EAAcC,GACzB,IAAMC,EAASD,EAAME,OAErB,IAAMC,EAAgB,SAAhBA,IAAgB,OAAA,IAAAC,SAAA,SAAAC,EAAAC,GAAA,IAGZC,EACAC,EACAC,EA9CZ,IAAIC,aAAJ,IAAI,OAAAL,GAAK,CAAC,MAAAM,GAAW,OAAOL,EAAAK,EAAM,GAAlC,IAAIC,EAAA,SAsDSC,GAtDb,IAuDM,GAAIb,EAAMc,cAAe,CACvBd,EAAMc,cAAcD,EACtB,KAAO,CACLE,EAAQF,OAAMA,GAAAA,UAAAA,EAAAA,EAAOE,UAAW,YAClC,CA3DN,OAAOL,GAAE,CAAC,MAAAC,GAAW,OAAOL,EAAAK,EAAM,GA0C9B,IACEX,EAAMgB,aAAW,UAAA,EAAjBhB,EAAMgB,cACW,OAAAZ,QAAAa,QAAMjB,EAAMkB,aAAZC,MAAuB,SAAAC,GA5C9C,IA4CYb,EAAWa,EACXZ,EAAOa,SAASC,cAAc,KAC9Bb,EAAMc,OAAOC,IAAIC,gBAAgBlB,EAASmB,MAChDlB,EAAKmB,MAAMC,QAAU,OACrBpB,EAAKqB,KAAOpB,EACZD,EAAKsB,aAAa,WAAYvB,EAASwB,UACvCV,SAASW,KAAKC,YAAYzB,GAC1BA,EAAK0B,QACLb,SAASW,KAAKG,YAAY3B,GAC1BR,EAAMoC,cAAY,UAAA,EAAlBpC,EAAMoC,eArDZ,OAAO1B,GAAE,CAAC,MAAAC,GAAW,OAAOC,EAAAD,EAAM,CAAC,GAAAC,EAsD9B,CAAC,MAAOC,GAAYD,EAAZC,EAMT,CAAC,GACF,EAED,OACEwB,EAACC,EAAQ,CAAAC,SACNC,EAAevC,GACdoC,EAACpC,EAAOwC,KAAIC,EAAKzC,CAAAA,EAAAA,EAAOD,MAAK,CAAE2C,QAASxC,KAExCF,GAAM,UAAA,EAANA,EAAS,CAAE0C,QAASxC,KAI5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/file-import/file-import.tsx"],"sourcesContent":["import { TAny } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { Button, message, Upload, UploadProps } from 'antd';\nimport { isValidElement, ReactElement, useState } from 'react';\n\nexport type FileImportProps = {\n /** 上传文件接口返回处理 */\n onImportFinish: (data?: TAny) => void;\n buttonName?: string | ReactElement;\n children?: React.ReactNode | ((data: { loading: boolean }) => React.ReactNode);\n} & Omit<\n UploadProps,\n | 'fileList'\n | 'showUploadList'\n | 'itemRender'\n | 'listType'\n | 'multiple'\n | 'previewFile'\n | 'progress'\n | 'onChange'\n | 'onDownload'\n | 'onRemove'\n | 'onPreview'\n | 'directory'\n | 'customRequest'\n | 'defaultFileList'\n | 'iconRender'\n>;\n\n/**\n * 文件导入\n * ```\n *
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/file-import/file-import.tsx"],"sourcesContent":["import { TAny } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { Button, message, Upload, UploadProps } from 'antd';\nimport { isValidElement, ReactElement, useState } from 'react';\n\nexport type FileImportProps = {\n /** 上传文件接口返回处理 */\n onImportFinish: (data?: TAny) => void;\n buttonName?: string | ReactElement;\n children?: React.ReactNode | ((data: { loading: boolean }) => React.ReactNode);\n} & Omit<\n UploadProps,\n | 'fileList'\n | 'showUploadList'\n | 'itemRender'\n | 'listType'\n | 'multiple'\n | 'previewFile'\n | 'progress'\n | 'onChange'\n | 'onDownload'\n | 'onRemove'\n | 'onPreview'\n | 'directory'\n | 'customRequest'\n | 'defaultFileList'\n | 'iconRender'\n>;\n\n/**\n * 文件导入\n * ```\n * demo:https://fex.qa.tcshuke.com/docs/admin/main/widget?key=file-export\n * 1. accept默认值 '.xlsx,.xls',\n * 2. formData 上传key默认值 file\n * \n * 例如:\n <FileImport\n action={'https://xxx/xxx/xx'}\n onImportFinish={(data) => {\n console.log('上传接口响应数据', data);\n }}\n >\n <Button>文件上传</Button>\n </FileImport>\n * ```\n */\nexport const FileImport = (props: FileImportProps) => {\n const { onImportFinish, buttonName, ...otherProps } = props;\n\n const [loading, setLoading] = useState(false);\n\n const onChange = hooks.useCallbackRef((info) => {\n if (info.file.status === 'uploading') {\n setLoading(true);\n } else if (info.file.status === 'done') {\n setLoading(false);\n const respData = info.file.response;\n if (respData.code === '0000') {\n onImportFinish(respData.data);\n } else {\n void message.error((respData.message as string) || '文件导入异常...');\n }\n }\n });\n\n return (\n <Upload showUploadList={false} maxCount={1} {...otherProps} onChange={onChange}>\n {typeof props.children === 'function' ? (\n props.children?.({ loading })\n ) : isValidElement(props.children) ? (\n props.children\n ) : (\n <Button type=\"primary\" ghost loading={loading}>\n {buttonName || '选择文件'}\n </Button>\n )}\n </Upload>\n );\n};\n\nFileImport.defaultProps = {\n name: 'file',\n accept: '.xlsx,.xls',\n};\n"],"names":["FileImport","props","onImportFinish","buttonName","otherProps","_objectWithoutPropertiesLoose","_excluded","_useState","useState","loading","setLoading","onChange","_hooks","useCallbackRef","info","file","status","respData","response","code","data","message","error","_jsx","Upload","_extends","showUploadList","maxCount","children","isValidElement","Button","type","ghost","defaultProps","name","accept"],"mappings":";gTA+CaA,EAAa,SAAbA,EAAcC,GACzB,IAAQC,EAA8CD,EAA9CC,eAAgBC,EAA8BF,EAA9BE,WAAeC,EAAUC,EAAKJ,EAAKK,GAE3D,IAAAC,EAA8BC,EAAS,OAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GAE1B,IAAMI,EAAWC,EAAMC,gBAAe,SAACC,GACrC,GAAIA,EAAKC,KAAKC,SAAW,YAAa,CACpCN,EAAW,KACZ,MAAM,GAAII,EAAKC,KAAKC,SAAW,OAAQ,CACtCN,EAAW,OACX,IAAMO,EAAWH,EAAKC,KAAKG,SAC3B,GAAID,EAASE,OAAS,OAAQ,CAC5BjB,EAAee,EAASG,KAC1B,KAAO,MACAC,EAAQC,MAAOL,EAASI,SAAsB,YACrD,CACF,CACF,IAEA,OACEE,EAACC,EAAMC,EAAA,CAACC,eAAgB,MAAOC,SAAU,GAAOvB,EAAU,CAAEO,SAAUA,EAASiB,gBACrE3B,EAAM2B,WAAa,WACzB3B,EAAM2B,UAAQ,UAAA,EAAd3B,EAAM2B,SAAW,CAAEnB,QAAAA,IACjBoB,EAAe5B,EAAM2B,UACvB3B,EAAM2B,SAENL,EAACO,EAAM,CAACC,KAAK,UAAUC,MAAK,KAACvB,QAASA,EAAQmB,SAC3CzB,GAAc,WAKzB,EAEAH,EAAWiC,aAAe,CACxBC,KAAM,OACNC,OAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-group/card/index.tsx","@flatbiz/antd/src/form-item-group/horizontal-union/index.tsx","@flatbiz/antd/src/form-item-group/index.ts"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { CSSProperties, FC, ReactElement } from 'react';\nimport { fbaHooks } from '../../fba-hooks';\nimport './style.less';\n\nexport type FormItemCardProps = {\n title?: string | ReactElement;\n children: ReactElement | ReactElement[];\n className?: string;\n style?: CSSProperties;\n titleSign?: boolean;\n};\nexport const FormItemCard: FC<FormItemCardProps> = (props) => {\n const classNamePrefix = 'form-item-group-card';\n\n const theme = fbaHooks.useThemeToken();\n\n const style = { '--form-item-group-colorPrimary': theme.colorPrimary } as CSSProperties;\n\n return (\n <div className={classNames(classNamePrefix, props.className)} style={{ ...style, ...props.style }}>\n {props.title ? (\n <div\n className={classNames(`${classNamePrefix}-title`, {\n [`${classNamePrefix}-title-sign`]: props.titleSign === true,\n })}\n >\n {props.title}\n </div>\n ) : null}\n {props.children}\n </div>\n );\n};\n\nFormItemCard.defaultProps = {\n titleSign: true,\n};\n","import { classNames } from '@dimjs/utils';\nimport { Form } from 'antd';\nimport { cloneElement, CSSProperties, isValidElement, ReactElement, useMemo } from 'react';\nimport { FlexLayout } from '../../flex-layout';\nimport './style.less';\n\nexport type FormItemHorizontalUnionProps = {\n className?: string;\n style?: CSSProperties;\n label?: string | ReactElement;\n groupConfigList: {\n hidden?: boolean;\n before?: ReactElement | string;\n /**\n * 设置宽度\n * ```\n * 1. 自适应可设置:auto\n * 2. 可设置具体数值\n * 3. 不设置会在铺满flex剩余空间\n * 4. 多个未设置会等分铺满剩余空间\n * ```\n */\n width?: number | string;\n mainItem: ReactElement;\n after?: ReactElement | string;\n }[];\n gap?: number;\n flexLayoutStyle?: CSSProperties;\n flexLayoutClassName?: string;\n hidden?: boolean;\n required?: boolean;\n colon?: boolean;\n};\n\n/**\n * FormItem 水平布局\n * ```\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/input\n * ```\n * @param props\n * @returns\n */\nexport const FormItemHorizontalUnion = (props: FormItemHorizontalUnionProps) => {\n const groupFlexElementData = useMemo(() => {\n const fullIndex = [] as number[];\n const flexElementList = [] as Array<ReactElement>;\n const groupConfigList = props.groupConfigList.filter((item) => !item.hidden);\n groupConfigList.forEach((item) => {\n if (item.before) {\n flexElementList.push(\n isValidElement(item.before) ? (\n (item.before as ReactElement)\n ) : (\n <div className=\"union-before-text\">{item.before}</div>\n ),\n );\n }\n if (item.width) {\n flexElementList.push(\n cloneElement(item.mainItem, {\n style: { width: item.width, ...item.mainItem.props.style },\n }),\n );\n } else {\n fullIndex.push(flexElementList.length);\n flexElementList.push(item.mainItem);\n }\n if (item.after) {\n flexElementList.push(\n isValidElement(item.after) ? (\n (item.after as ReactElement)\n ) : (\n <div className=\"union-after-text\">{item.after}</div>\n ),\n );\n }\n });\n return {\n flexElementList,\n fullIndex,\n };\n }, [props.groupConfigList]);\n\n return (\n <Form.Item\n label={props.label}\n className={classNames('form-item-group-horizontal-union', props.className)}\n style={props.style}\n hidden={props.hidden}\n required={props.required}\n colon={props.colon}\n >\n <FlexLayout\n direction=\"horizontal\"\n gap={props.gap === undefined ? 15 : props.gap}\n fullIndex={groupFlexElementData.fullIndex}\n style={props.flexLayoutStyle}\n className={props.flexLayoutClassName}\n >\n {groupFlexElementData.flexElementList.map((item, index) => {\n return cloneElement(item, { key: index });\n })}\n </FlexLayout>\n </Form.Item>\n );\n};\n","import { FormItemCard } from './card';\nimport { FormItemHorizontalUnion } from './horizontal-union';\n\nexport const FormItemGroup = {\n HorizontalUnion: FormItemHorizontalUnion,\n Card: FormItemCard,\n};\n"],"names":["FormItemCard","props","_classNames2","classNamePrefix","theme","fbaHooks","useThemeToken","style","colorPrimary","_jsxs","className","_classNames","_extends","children","title","_jsx","titleSign","defaultProps","FormItemHorizontalUnion","groupFlexElementData","useMemo","fullIndex","flexElementList","groupConfigList","filter","item","hidden","forEach","before","push","isValidElement","width","cloneElement","mainItem","length","after","Form","Item","label","required","colon","FlexLayout","direction","gap","undefined","flexLayoutStyle","flexLayoutClassName","map","index","key","FormItemGroup","HorizontalUnion","Card"],"mappings":";mfAYO,IAAMA,EAAsC,SAAtCA,EAAuCC,GAAU,IAAAC,EAC5D,IAAMC,EAAkB,uBAExB,IAAMC,EAAQC,EAASC,gBAEvB,IAAMC,EAAQ,CAAE,iCAAkCH,EAAMI,cAExD,OACEC,EAAA,MAAA,CAAKC,UAAWC,EAAWR,EAAiBF,EAAMS,WAAYH,MAAKK,EAAOL,CAAAA,EAAAA,EAAUN,EAAMM,OAAQM,SAC/FZ,CAAAA,EAAMa,MACLC,EAAA,MAAA,CACEL,UAAWC,EAAcR,EAAeD,UAAAA,KAAAA,EAClCC,EAA+BF,eAAAA,EAAMe,YAAc,KAAId,IAC1DW,SAEFZ,EAAMa,QAEP,KACHb,EAAMY,WAGb,EAEAb,EAAaiB,aAAe,CAC1BD,UAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-group/card/index.tsx","@flatbiz/antd/src/form-item-group/horizontal-union/index.tsx","@flatbiz/antd/src/form-item-group/index.ts"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { CSSProperties, FC, ReactElement } from 'react';\nimport { fbaHooks } from '../../fba-hooks';\nimport './style.less';\n\nexport type FormItemCardProps = {\n title?: string | ReactElement;\n children: ReactElement | ReactElement[];\n className?: string;\n style?: CSSProperties;\n titleSign?: boolean;\n};\nexport const FormItemCard: FC<FormItemCardProps> = (props) => {\n const classNamePrefix = 'form-item-group-card';\n\n const theme = fbaHooks.useThemeToken();\n\n const style = { '--form-item-group-colorPrimary': theme.colorPrimary } as CSSProperties;\n\n return (\n <div className={classNames(classNamePrefix, props.className)} style={{ ...style, ...props.style }}>\n {props.title ? (\n <div\n className={classNames(`${classNamePrefix}-title`, {\n [`${classNamePrefix}-title-sign`]: props.titleSign === true,\n })}\n >\n {props.title}\n </div>\n ) : null}\n {props.children}\n </div>\n );\n};\n\nFormItemCard.defaultProps = {\n titleSign: true,\n};\n","import { classNames } from '@dimjs/utils';\nimport { Form } from 'antd';\nimport { cloneElement, CSSProperties, isValidElement, ReactElement, useMemo } from 'react';\nimport { FlexLayout } from '../../flex-layout';\nimport './style.less';\n\nexport type FormItemHorizontalUnionProps = {\n className?: string;\n style?: CSSProperties;\n label?: string | ReactElement;\n /** 水平布局元素 */\n groupConfigList: {\n hidden?: boolean;\n before?: ReactElement | string;\n /**\n * 设置宽度\n * ```\n * 1. 自适应可设置:auto\n * 2. 可设置具体数值\n * 3. 不设置会在铺满flex剩余空间\n * 4. 多个未设置会等分铺满剩余空间\n * ```\n */\n width?: number | string;\n mainItem: ReactElement;\n after?: ReactElement | string;\n }[];\n /** 水平布局原始之间的间距 */\n gap?: number;\n flexLayoutStyle?: CSSProperties;\n flexLayoutClassName?: string;\n hidden?: boolean;\n required?: boolean;\n colon?: boolean;\n};\n\n/**\n * FormItem 水平布局\n * ```\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/input\n * ```\n * @param props\n * @returns\n */\nexport const FormItemHorizontalUnion = (props: FormItemHorizontalUnionProps) => {\n const groupFlexElementData = useMemo(() => {\n const fullIndex = [] as number[];\n const flexElementList = [] as Array<ReactElement>;\n const groupConfigList = props.groupConfigList.filter((item) => !item.hidden);\n groupConfigList.forEach((item) => {\n if (item.before) {\n flexElementList.push(\n isValidElement(item.before) ? (\n (item.before as ReactElement)\n ) : (\n <div className=\"union-before-text\">{item.before}</div>\n ),\n );\n }\n if (item.width) {\n flexElementList.push(\n cloneElement(item.mainItem, {\n style: { width: item.width, ...item.mainItem.props.style },\n }),\n );\n } else {\n fullIndex.push(flexElementList.length);\n flexElementList.push(item.mainItem);\n }\n if (item.after) {\n flexElementList.push(\n isValidElement(item.after) ? (\n (item.after as ReactElement)\n ) : (\n <div className=\"union-after-text\">{item.after}</div>\n ),\n );\n }\n });\n return {\n flexElementList,\n fullIndex,\n };\n }, [props.groupConfigList]);\n\n return (\n <Form.Item\n label={props.label}\n className={classNames('form-item-group-horizontal-union', props.className)}\n style={props.style}\n hidden={props.hidden}\n required={props.required}\n colon={props.colon}\n >\n <FlexLayout\n direction=\"horizontal\"\n gap={props.gap === undefined ? 15 : props.gap}\n fullIndex={groupFlexElementData.fullIndex}\n style={props.flexLayoutStyle}\n className={props.flexLayoutClassName}\n >\n {groupFlexElementData.flexElementList.map((item, index) => {\n return cloneElement(item, { key: index });\n })}\n </FlexLayout>\n </Form.Item>\n );\n};\n","import { FormItemCard } from './card';\nimport { FormItemHorizontalUnion } from './horizontal-union';\n\nexport const FormItemGroup = {\n HorizontalUnion: FormItemHorizontalUnion,\n Card: FormItemCard,\n};\n"],"names":["FormItemCard","props","_classNames2","classNamePrefix","theme","fbaHooks","useThemeToken","style","colorPrimary","_jsxs","className","_classNames","_extends","children","title","_jsx","titleSign","defaultProps","FormItemHorizontalUnion","groupFlexElementData","useMemo","fullIndex","flexElementList","groupConfigList","filter","item","hidden","forEach","before","push","isValidElement","width","cloneElement","mainItem","length","after","Form","Item","label","required","colon","FlexLayout","direction","gap","undefined","flexLayoutStyle","flexLayoutClassName","map","index","key","FormItemGroup","HorizontalUnion","Card"],"mappings":";mfAYO,IAAMA,EAAsC,SAAtCA,EAAuCC,GAAU,IAAAC,EAC5D,IAAMC,EAAkB,uBAExB,IAAMC,EAAQC,EAASC,gBAEvB,IAAMC,EAAQ,CAAE,iCAAkCH,EAAMI,cAExD,OACEC,EAAA,MAAA,CAAKC,UAAWC,EAAWR,EAAiBF,EAAMS,WAAYH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MAAM3B,SAEnBE,EAAC0B,EAAU,CACTC,UAAU,aACVC,IAAK1C,EAAM0C,MAAQC,UAAY,GAAK3C,EAAM0C,IAC1CtB,UAAWF,EAAqBE,UAChCd,MAAON,EAAM4C,gBACbnC,UAAWT,EAAM6C,oBAAoBjC,SAEpCM,EAAqBG,gBAAgByB,KAAI,SAACtB,EAAMuB,GAC/C,OAAOhB,EAAaP,EAAM,CAAEwB,IAAKD,UAK3C,ECxGO,IAAME,EAAgB,CAC3BC,gBAAiBjC,EACjBkC,KAAMpD"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import './../text-css-ellipsis/index.css';
|
|
3
3
|
import './../fba-hooks/index.css';
|
|
4
4
|
import './../form-item-wrapper/index.css';
|
|
5
|
+
import './../pre-defined-class-name/index.css';
|
|
5
6
|
import './../form-item-hidden/index.css';
|
|
6
7
|
import './index.css';
|
|
7
8
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
8
|
-
import{classNames as e}from"@dimjs/utils/cjs/class-names";import{_ as r,a as n}from"../_rollupPluginBabelHelpers-a0769acd.js";import{useState as a,useMemo as i,Fragment as t}from"react";import{isUndefinedOrNull as
|
|
9
|
+
import{classNames as e}from"@dimjs/utils/cjs/class-names";import{_ as r,a as n}from"../_rollupPluginBabelHelpers-a0769acd.js";import{useState as a,useMemo as i,Fragment as t}from"react";import{isUndefinedOrNull as o,toArray as l}from"@flatbiz/utils";import{Spin as s,Form as u,message as m}from"antd";import{TextCssEllipsis as d}from"../text-css-ellipsis/index.js";import{jsx as c,jsxs as f}from"react/jsx-runtime";import{FormItemWrapper as v}from"../form-item-wrapper/index.js";import{isDeepEqual as p}from"@dimjs/lang/cjs/is-deep-equal";import{fbaHooks as h}from"../fba-hooks/index.js";import{FormItemHidden as g}from"../form-item-hidden/index.js";import"ahooks";import"../pre-defined-class-name/index.js";import"@dimjs/lang/cjs/is-array";import"@wove/react/cjs/hooks";import"../use-responsive-point-21b8c601.js";var y=function e(r){var n=function(){if(o(r.value))return r.placeholderValue;return typeof r.value==="string"?r.value:JSON.stringify(r.value)}();var a=r.wrap?n:c(d,{text:n||""});if(r.loading){return c("span",{className:"form-item-text-content fitc-loading",style:r.style,children:c(s,{spinning:r.loading,size:"small",children:c("span",{style:{textIndent:"-9999px",display:"inline-block"},children:"Loading"})})})}return c("span",{className:"form-item-text-content",style:r.style,children:r.render?r.render(r.value):a})};var x=function e(n){var t=n.serviceConfig;var s=a(false),d=s[0],c=s[1];var f=a(),v=f[0],g=f[1];var y=h.usePrevious(t==null?void 0:t.params);var x=a("init"),j=x[0],w=x[1];var P=u.useFormInstance();var V=i((function(){var e;if(!(t!=null&&t.params)||l(t==null?void 0:t.invalidParamKey).length===0){return t==null?void 0:t.params}var n=r({},t==null?void 0:t.params);t==null||(e=t.invalidParamKey)==null?void 0:e.forEach((function(e){n[e]=undefined}));return n}),[t==null?void 0:t.invalidParamKey,t==null?void 0:t.params]);var N=function e(a){return new Promise((function(e,i){var l=function(e){return function(r){try{c(false);return e&&e.call(this,r)}catch(e){return i(e)}}.bind(this)}.bind(this);var s,u,f,v,p,h;if(!t)return e();u=r({},V,a);if(t!=null&&(s=t.requiredParamsKeys)!=null&&s.length){f=t==null?void 0:t.requiredParamsKeys.find((function(e){return o(u[e])}));if(f){console.warn("FormItemText组件:参数:"+(t==null?void 0:t.requiredParamsKeys.join("、"))+"不能为空");return e()}}var y=function(){try{return e()}catch(e){return i(e)}};var x=function(e){try{console.error(e);w("error");void m.error((e==null?void 0:e.message)||"接口调用异常");return l(y)()}catch(e){return l(i)(e)}};try{if(!d)c(true);return Promise.resolve(t.onRequest(u)).then((function(e){try{v=e;p=n.name?P.getFieldValue(n.name):undefined;h=t.onResponseAdapter?t.onResponseAdapter(v,p):v;g(h);w("success");return l(y)()}catch(e){return x(e)}}),x)}catch(e){x(e)}}))};h.useEffectCustomAsync(N,[]);h.useEffectCustom((function(){if(!t)return;if(y){if(!p(t.params,y)){void N()}}}),[y,t==null?void 0:t.params]);if(!t){return undefined}return{loading:d,status:j,viewValue:v}};var j=["wrap","render","placeholderValue","serviceConfig"];var w=function a(i){var t=i.wrap,o=i.render,l=i.placeholderValue,s=i.serviceConfig,u=n(i,j);var m=x({serviceConfig:s,name:i.name});return c(v,r({},u,{name:undefined,className:e("form-item-text",i.className),children:c(y,{loading:m==null?void 0:m.loading,wrap:t,render:o,placeholderValue:l,value:m==null?void 0:m.viewValue})}))};var P=["wrap","render","placeholderValue"];var V=function a(i){var o=i.wrap,l=i.render,s=i.placeholderValue,u=n(i,P);if(i.serviceConfig){return f(t,{children:[c(g,{name:i.name}),c(w,r({},i))]})}return c(v,r({},u,{className:e("form-item-text",i.className),children:c(y,{wrap:o,render:l,placeholderValue:s})}))};v["domTypeName"]="FormItemText";export{V as FormItemText};
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-text/content.tsx","@flatbiz/antd/src/form-item-text/use-request.tsx","@flatbiz/antd/src/form-item-text/request-text.tsx","@flatbiz/antd/src/form-item-text/form-item-text.tsx"],"sourcesContent":["import { isUndefinedOrNull } from '@flatbiz/utils';\nimport { Spin } from 'antd';\nimport { type CSSProperties } from 'react';\nimport { TextCssEllipsis } from '../text-css-ellipsis';\nimport { type FormItemTextProps } from './types';\n\nexport const FormItemTextContent = (\n props: Pick<FormItemTextProps, 'render' | 'wrap' | 'placeholderValue'> & {\n value?: string;\n style?: CSSProperties;\n loading?: boolean;\n },\n) => {\n const originalValue = (function () {\n if (isUndefinedOrNull(props.value)) return props.placeholderValue;\n return typeof props.value === 'string' ? props.value : JSON.stringify(props.value);\n })();\n const valueFt = props.wrap ? originalValue : <TextCssEllipsis text={originalValue || ''} />;\n if (props.loading) {\n return (\n <span className=\"form-item-text-content fitc-loading\" style={props.style}>\n <Spin spinning={props.loading} size=\"small\">\n <span style={{ textIndent: '-9999px', display: 'inline-block' }}>Loading</span>\n </Spin>\n </span>\n );\n }\n return (\n <span className=\"form-item-text-content\" style={props.style}>\n {props.render ? props.render(props.value) : valueFt}\n </span>\n );\n};\n","import { isDeepEqual } from '@dimjs/lang';\nimport { isUndefinedOrNull, toArray, type TAny, type TPlainObject } from '@flatbiz/utils';\nimport { Form, message } from 'antd';\nimport { useMemo, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { FormItemWrapperProps } from '../form-item-wrapper';\nimport { type FormItemTextServiceConfig } from './types';\n\nexport const useRequestFormItemText = (props: {\n serviceConfig?: FormItemTextServiceConfig;\n name?: FormItemWrapperProps['name'];\n}) => {\n const serviceConfig = props.serviceConfig;\n const [loading, setLoading] = useState(false);\n const [respData, setRespData] = useState<TAny>();\n const prevParams = fbaHooks.usePrevious(serviceConfig?.params);\n const [status, setStatus] = useState<'success' | 'error' | 'init'>('init');\n const form = Form.useFormInstance();\n\n // 用于直接发起接口调用,不能用于比较\n const serviceParams = useMemo(() => {\n if (!serviceConfig?.params || toArray(serviceConfig?.invalidParamKey).length === 0) {\n return serviceConfig?.params;\n }\n const newParams = { ...serviceConfig?.params };\n serviceConfig?.invalidParamKey?.forEach((key) => {\n newParams[key] = undefined;\n });\n return newParams;\n }, [serviceConfig?.invalidParamKey, serviceConfig?.params]);\n\n const onInnerRequest = async (params?: TPlainObject) => {\n if (!serviceConfig) return;\n const mergeProps = { ...serviceParams, ...params };\n if (serviceConfig?.requiredParamsKeys?.length) {\n const target = serviceConfig?.requiredParamsKeys.find((item) => {\n return isUndefinedOrNull(mergeProps[item]);\n });\n if (target) {\n console.warn(`FormItemText组件:参数:${serviceConfig?.requiredParamsKeys.join('、')}不能为空`);\n return;\n }\n }\n try {\n if (!loading) setLoading(true);\n const respData = await serviceConfig.onRequest(mergeProps);\n const value = props.name ? form.getFieldValue(props.name) : undefined;\n const respDataFt = serviceConfig.onResponseAdapter\n ? serviceConfig.onResponseAdapter(respData, value)\n : respData;\n setRespData(respDataFt);\n setStatus('success');\n } catch (error: TAny) {\n console.error(error);\n setStatus('error');\n void message.error(error?.message || '接口调用异常');\n } finally {\n setLoading(false);\n }\n };\n\n fbaHooks.useEffectCustomAsync(onInnerRequest, []);\n\n fbaHooks.useEffectCustom(() => {\n if (!serviceConfig) return;\n if (prevParams) {\n if (!isDeepEqual(serviceConfig.params, prevParams)) {\n void onInnerRequest();\n }\n }\n }, [prevParams, serviceConfig?.params]);\n\n if (!serviceConfig) {\n return undefined;\n }\n\n return { loading, status, viewValue: respData };\n};\n","import { classNames } from '@dimjs/utils';\n\nimport { FormItemWrapper } from '../form-item-wrapper';\nimport { FormItemTextContent } from './content';\nimport { type FormItemTextProps } from './types';\nimport { useRequestFormItemText } from './use-request';\n\n/**\n * FormItem 文本显示,默认不换行,超出省略(鼠标悬浮可显示)\n * @param props\n * @returns\n */\nexport const RequestText = (props: FormItemTextProps) => {\n const { wrap, render, placeholderValue, serviceConfig, ...otherProps } = props;\n\n const requestResult = useRequestFormItemText({\n serviceConfig,\n name: props.name,\n });\n\n return (\n <FormItemWrapper\n {...otherProps}\n name={undefined}\n className={classNames('form-item-text', props.className)}\n >\n <FormItemTextContent\n loading={requestResult?.loading}\n wrap={wrap}\n render={render}\n placeholderValue={placeholderValue}\n value={requestResult?.viewValue}\n />\n </FormItemWrapper>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { Fragment } from 'react';\n\nimport { FormItemTextContent } from './content';\nimport { RequestText } from './request-text';\nimport { type FormItemTextProps } from './types';\n\nimport { FormItemHidden } from '../form-item-hidden';\nimport { FormItemWrapper } from '../form-item-wrapper';\nimport './style.less';\n/**\n * FormItem 文本显示,默认不换行,超出省略(鼠标悬浮可显示)\n * ```\n * 可通过配置 serviceConfig 通过接口获取数据,一般用于 Select 数据显示\n *\n * 例如:\n * 1. 基本数据渲染\n * <FormItemText name=\"xxx\" label=\"xxx\" />\n * 2. 对象数据渲染\n * <FormItemText\n * name=\"xxx\"\n * label=\"xxx\"\n * render={(value) => {\n * const target = [].find(\n * (item) => item.value === value,\n * );\n * return target ? (\n * <Tag color={target['color']}>{target.label}</Tag>\n * ) : null;\n * }}\n * />\n * 3. 接口数据渲染\n * <FormItemText\n * name=\"xxx\"\n * label=\"xxx\"\n * serviceConfig={{\n * onRequest: () => {\n * return serviceHandle.request('/random/api9468', {}, 'post');\n * },\n * onResponseAdapter: (dataList: TPlainObject[], value) => {\n * return dataList?.find((item) => item.value === value);\n * },\n * }}\n * render={(dataItem) => {\n * return dataItem ? (\n * <Tag style={{ margin: 0 }} color={dataItem['color']}>\n * {dataItem.label}\n * </Tag>\n * ) : null;\n * }}\n * />\n * ```\n */\nexport const FormItemText = (props: FormItemTextProps) => {\n const { wrap, render, placeholderValue, ...otherProps } = props;\n\n if (props.serviceConfig) {\n return (\n <Fragment>\n <FormItemHidden name={props.name} />\n <RequestText {...props} />\n </Fragment>\n );\n }\n\n return (\n <FormItemWrapper {...otherProps} className={classNames('form-item-text', props.className)}>\n <FormItemTextContent wrap={wrap} render={render} placeholderValue={placeholderValue} />\n </FormItemWrapper>\n );\n};\n"],"names":["FormItemTextContent","props","originalValue","isUndefinedOrNull","value","placeholderValue","JSON","stringify","valueFt","wrap","_jsx","TextCssEllipsis","text","loading","className","style","children","Spin","spinning","size","textIndent","display","render","useRequestFormItemText","serviceConfig","_useState","useState","setLoading","_useState2","respData","setRespData","prevParams","fbaHooks","usePrevious","params","_useState3","status","setStatus","form","Form","useFormInstance","serviceParams","useMemo","_serviceConfig$invali","toArray","invalidParamKey","length","newParams","_extends","forEach","key","undefined","onInnerRequest","Promise","$return","$error","$Try_1_Finally","$Try_1_Exit","$Try_1_Value","call","this","$boundEx","bind","_serviceConfig$requir","mergeProps","target","_respData","respDataFt","requiredParamsKeys","find","item","console","warn","join","$Try_1_Post","$Try_1_Catch","error","message","resolve","onRequest","then","$await_2","name","getFieldValue","onResponseAdapter","useEffectCustomAsync","useEffectCustom","_isDeepEqual","viewValue","RequestText","otherProps","_objectWithoutPropertiesLoose","_excluded","requestResult","FormItemWrapper","_classNames","F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jB,iBAAkBA,EAClBD,MAAOyF,GAAAA,UAAAA,EAAAA,EAAeL,cAI9B,iDCkBaQ,EAAe,SAAfA,EAAgB/F,GAC3B,IAAQQ,EAAkDR,EAAlDQ,KAAMa,EAA4CrB,EAA5CqB,OAAQjB,EAAoCJ,EAApCI,iBAAqBqF,EAAUC,EAAK1F,EAAK2F,GAE/D,GAAI3F,EAAMuB,cAAe,CACvB,OACEyE,EAACC,EAAQ,CAAAlF,SAAA,CACPN,EAACyF,EAAc,CAACjB,KAAMjF,EAAMiF,OAC5BxE,EAAC+E,EAAWzC,EAAA,CAAA,EAAK/C,MAGvB,CAEA,OACES,EAACoF,EAAe9C,KAAK0C,EAAU,CAAE5E,UAAWiF,EAAW,iBAAkB9F,EAAMa,WAAWE,SACxFN,EAACV,EAAmB,CAACS,KAAMA,EAAMa,OAAQA,EAAQjB,iBAAkBA,MAGzE"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-text/content.tsx","@flatbiz/antd/src/form-item-text/use-request.tsx","@flatbiz/antd/src/form-item-text/request-text.tsx","@flatbiz/antd/src/form-item-text/form-item-text.tsx"],"sourcesContent":["import { isUndefinedOrNull } from '@flatbiz/utils';\nimport { Spin } from 'antd';\nimport { type CSSProperties } from 'react';\nimport { TextCssEllipsis } from '../text-css-ellipsis';\nimport { type FormItemTextProps } from './types';\n\nexport const FormItemTextContent = (\n props: Pick<FormItemTextProps, 'render' | 'wrap' | 'placeholderValue'> & {\n value?: string;\n style?: CSSProperties;\n loading?: boolean;\n },\n) => {\n const originalValue = (function () {\n if (isUndefinedOrNull(props.value)) return props.placeholderValue;\n return typeof props.value === 'string' ? props.value : JSON.stringify(props.value);\n })();\n const valueFt = props.wrap ? originalValue : <TextCssEllipsis text={originalValue || ''} />;\n if (props.loading) {\n return (\n <span className=\"form-item-text-content fitc-loading\" style={props.style}>\n <Spin spinning={props.loading} size=\"small\">\n <span style={{ textIndent: '-9999px', display: 'inline-block' }}>Loading</span>\n </Spin>\n </span>\n );\n }\n return (\n <span className=\"form-item-text-content\" style={props.style}>\n {props.render ? props.render(props.value) : valueFt}\n </span>\n );\n};\n","import { isDeepEqual } from '@dimjs/lang';\nimport { isUndefinedOrNull, toArray, type TAny, type TPlainObject } from '@flatbiz/utils';\nimport { Form, message } from 'antd';\nimport { useMemo, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { FormItemWrapperProps } from '../form-item-wrapper';\nimport { type FormItemTextServiceConfig } from './types';\n\nexport const useRequestFormItemText = (props: {\n serviceConfig?: FormItemTextServiceConfig;\n name?: FormItemWrapperProps['name'];\n}) => {\n const serviceConfig = props.serviceConfig;\n const [loading, setLoading] = useState(false);\n const [respData, setRespData] = useState<TAny>();\n const prevParams = fbaHooks.usePrevious(serviceConfig?.params);\n const [status, setStatus] = useState<'success' | 'error' | 'init'>('init');\n const form = Form.useFormInstance();\n\n // 用于直接发起接口调用,不能用于比较\n const serviceParams = useMemo(() => {\n if (!serviceConfig?.params || toArray(serviceConfig?.invalidParamKey).length === 0) {\n return serviceConfig?.params;\n }\n const newParams = { ...serviceConfig?.params };\n serviceConfig?.invalidParamKey?.forEach((key) => {\n newParams[key] = undefined;\n });\n return newParams;\n }, [serviceConfig?.invalidParamKey, serviceConfig?.params]);\n\n const onInnerRequest = async (params?: TPlainObject) => {\n if (!serviceConfig) return;\n const mergeProps = { ...serviceParams, ...params };\n if (serviceConfig?.requiredParamsKeys?.length) {\n const target = serviceConfig?.requiredParamsKeys.find((item) => {\n return isUndefinedOrNull(mergeProps[item]);\n });\n if (target) {\n console.warn(`FormItemText组件:参数:${serviceConfig?.requiredParamsKeys.join('、')}不能为空`);\n return;\n }\n }\n try {\n if (!loading) setLoading(true);\n const respData = await serviceConfig.onRequest(mergeProps);\n const value = props.name ? form.getFieldValue(props.name) : undefined;\n const respDataFt = serviceConfig.onResponseAdapter\n ? serviceConfig.onResponseAdapter(respData, value)\n : respData;\n setRespData(respDataFt);\n setStatus('success');\n } catch (error: TAny) {\n console.error(error);\n setStatus('error');\n void message.error(error?.message || '接口调用异常');\n } finally {\n setLoading(false);\n }\n };\n\n fbaHooks.useEffectCustomAsync(onInnerRequest, []);\n\n fbaHooks.useEffectCustom(() => {\n if (!serviceConfig) return;\n if (prevParams) {\n if (!isDeepEqual(serviceConfig.params, prevParams)) {\n void onInnerRequest();\n }\n }\n }, [prevParams, serviceConfig?.params]);\n\n if (!serviceConfig) {\n return undefined;\n }\n\n return { loading, status, viewValue: respData };\n};\n","import { classNames } from '@dimjs/utils';\n\nimport { FormItemWrapper } from '../form-item-wrapper';\nimport { FormItemTextContent } from './content';\nimport { type FormItemTextProps } from './types';\nimport { useRequestFormItemText } from './use-request';\n\n/**\n * FormItem 文本显示,默认不换行,超出省略(鼠标悬浮可显示)\n * @param props\n * @returns\n */\nexport const RequestText = (props: FormItemTextProps) => {\n const { wrap, render, placeholderValue, serviceConfig, ...otherProps } = props;\n\n const requestResult = useRequestFormItemText({\n serviceConfig,\n name: props.name,\n });\n\n return (\n <FormItemWrapper\n {...otherProps}\n name={undefined}\n className={classNames('form-item-text', props.className)}\n >\n <FormItemTextContent\n loading={requestResult?.loading}\n wrap={wrap}\n render={render}\n placeholderValue={placeholderValue}\n value={requestResult?.viewValue}\n />\n </FormItemWrapper>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { Fragment } from 'react';\n\nimport { FormItemTextContent } from './content';\nimport { RequestText } from './request-text';\nimport { type FormItemTextProps } from './types';\n\nimport { FormItemHidden } from '../form-item-hidden';\nimport { FormItemWrapper } from '../form-item-wrapper';\nimport './style.less';\n/**\n * FormItem 文本显示,默认不换行,超出省略(鼠标悬浮可显示)\n * ```\n * 可通过配置 serviceConfig 通过接口获取数据,一般用于 Select 数据显示\n *\n * 例如:\n * 1. 基本数据渲染\n * <FormItemText name=\"xxx\" label=\"xxx\" />\n * 2. 对象数据渲染\n * <FormItemText\n * name=\"xxx\"\n * label=\"xxx\"\n * render={(value) => {\n * const target = [].find(\n * (item) => item.value === value,\n * );\n * return target ? (\n * <Tag color={target['color']}>{target.label}</Tag>\n * ) : null;\n * }}\n * />\n * 3. 接口数据渲染\n * <FormItemText\n * name=\"xxx\"\n * label=\"xxx\"\n * serviceConfig={{\n * onRequest: () => {\n * return serviceHandle.request('/random/api9468', {}, 'post');\n * },\n * onResponseAdapter: (dataList: TPlainObject[], value) => {\n * return dataList?.find((item) => item.value === value);\n * },\n * }}\n * render={(dataItem) => {\n * return dataItem ? (\n * <Tag style={{ margin: 0 }} color={dataItem['color']}>\n * {dataItem.label}\n * </Tag>\n * ) : null;\n * }}\n * />\n * ```\n */\nexport const FormItemText = (props: FormItemTextProps) => {\n const { wrap, render, placeholderValue, ...otherProps } = props;\n\n if (props.serviceConfig) {\n return (\n <Fragment>\n <FormItemHidden name={props.name} />\n <RequestText {...props} />\n </Fragment>\n );\n }\n\n return (\n <FormItemWrapper {...otherProps} className={classNames('form-item-text', props.className)}>\n <FormItemTextContent wrap={wrap} render={render} placeholderValue={placeholderValue} />\n </FormItemWrapper>\n );\n};\n\nFormItemWrapper['domTypeName'] = 'FormItemText';\n"],"names":["FormItemTextContent","props","originalValue","isUndefinedOrNull","value","placeholderValue","JSON","stringify","valueFt","wrap","_jsx","TextCssEllipsis","text","loading","className","style","children","Spin","spinning","size","textIndent","display","render","useRequestFormItemText","serviceConfig","_useState","useState","setLoading","_useState2","respData","setRespData","prevParams","fbaHooks","usePrevious","params","_useState3","status","setStatus","form","Form","useFormInstance","serviceParams","useMemo","_serviceConfig$invali","toArray","invalidParamKey","length","newParams","_extends","forEach","key","undefined","onInnerRequest","Promise","$return","$error","$Try_1_Finally","$Try_1_Exit","$Try_1_Value","call","this","$boundEx","bind","_serviceConfig$requir","mergeProps","target","_respData","respDataFt","requiredParamsKeys","find","item","console","warn","join","$Try_1_Post","$Try_1_Catch","error","message","resolve","onRequest","then","$await_2","name","getFieldValue","onResponseAdapter","useEffectCustomAsync","useEffectCustom","_isDeepEqual","viewValue","RequestText","otherProps","_objectWithoutPropertiesLoose","_excluded","requestResult","FormItemWrapper","_classNames","FormItemText","_jsxs","Fragment","FormItemHidden"],"mappings":";+yBAMO,IAAMA,EAAsB,SAAtBA,EACXC,GAMA,IAAMC,EAAiB,WACrB,GAAIC,EAAkBF,EAAMG,OAAQ,OAAOH,EAAMI,iBACjD,cAAcJ,EAAMG,QAAU,SAAWH,EAAMG,MAAQE,KAAKC,UAAUN,EAAMG,MAC9E,CAHuB,GAIvB,IAAMI,EAAUP,EAAMQ,KAAOP,EAAgBQ,EAACC,EAAe,CAACC,KAAMV,GAAiB,KACrF,GAAID,EAAMY,QAAS,CACjB,OACEH,EAAA,OAAA,CAAMI,UAAU,sCAAsCC,MAAOd,EAAMc,MAAMC,SACvEN,EAACO,EAAI,CAACC,SAAUjB,EAAMY,QAASM,KAAK,QAAOH,SACzCN,EAAA,OAAA,CAAMK,MAAO,CAAEK,WAAY,UAAWC,QAAS,gBAAiBL,SAAC,eAIzE,CACA,OACEN,EAAA,OAAA,CAAMI,UAAU,yBAAyBC,MAAOd,EAAMc,MAAMC,SACzDf,EAAMqB,OAASrB,EAAMqB,OAAOrB,EAAMG,OAASI,GAGlD,ECxBO,IAAMe,EAAyB,SAAzBA,EAA0BtB,GAIrC,IAAMuB,EAAgBvB,EAAMuB,cAC5B,IAAAC,EAA8BC,EAAS,OAAhCb,EAAOY,EAAA,GAAEE,EAAUF,EAAA,GAC1B,IAAAG,EAAgCF,IAAzBG,EAAQD,EAAA,GAAEE,EAAWF,EAAA,GAC5B,IAAMG,EAAaC,EAASC,YAAYT,GAAAA,UAAAA,EAAAA,EAAeU,QACvD,IAAAC,EAA4BT,EAAuC,QAA5DU,EAAMD,EAAA,GAAEE,EAASF,EAAA,GACxB,IAAMG,EAAOC,EAAKC,kBAGlB,IAAMC,EAAgBC,GAAQ,WAAM,IAAAC,EAClC,KAAKnB,GAAa,MAAbA,EAAeU,SAAUU,EAAQpB,GAAAA,UAAAA,EAAAA,EAAeqB,iBAAiBC,S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AAA,EAAAA,EAAehF,QACxBJ,KAAMA,EACNa,OAAQA,EACRjB,iBAAkBA,EAClBD,MAAOyF,GAAAA,UAAAA,EAAAA,EAAeL,cAI9B,iDCkBaQ,EAAe,SAAfA,EAAgB/F,GAC3B,IAAQQ,EAAkDR,EAAlDQ,KAAMa,EAA4CrB,EAA5CqB,OAAQjB,EAAoCJ,EAApCI,iBAAqBqF,EAAUC,EAAK1F,EAAK2F,GAE/D,GAAI3F,EAAMuB,cAAe,CACvB,OACEyE,EAACC,EAAQ,CAAAlF,SAAA,CACPN,EAACyF,EAAc,CAACjB,KAAMjF,EAAMiF,OAC5BxE,EAAC+E,EAAWzC,EAAA,CAAA,EAAK/C,MAGvB,CAEA,OACES,EAACoF,EAAe9C,KAAK0C,EAAU,CAAE5E,UAAWiF,EAAW,iBAAkB9F,EAAMa,WAAWE,SACxFN,EAACV,EAAmB,CAACS,KAAMA,EAAMa,OAAQA,EAAQjB,iBAAkBA,MAGzE,EAEAyF,EAAgB,eAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.form-item-label-70.ant-form-item .ant-form-item-label{width:70px}.form-item-label-80.ant-form-item .ant-form-item-label{width:80px}.form-item-label-90.ant-form-item .ant-form-item-label{width:90px}.form-item-label-100.ant-form-item .ant-form-item-label{width:100px}.form-item-label-110.ant-form-item .ant-form-item-label{width:110px}.form-item-label-120.ant-form-item .ant-form-item-label{width:120px}.form-item-label-130.ant-form-item .ant-form-item-label{width:130px}.form-item-label-140.ant-form-item .ant-form-item-label{width:140px}.form-item-label-150.ant-form-item .ant-form-item-label{width:150px}.form-item-label-160.ant-form-item .ant-form-item-label{width:160px}.form-item-label-170.ant-form-item .ant-form-item-label{width:170px}.form-item-label-180.ant-form-item .ant-form-item-label{width:180px}.form-item-label-190.ant-form-item .ant-form-item-label{width:190px}.form-item-label-200.ant-form-item .ant-form-item-label{width:200px}.form-item-label-auto.ant-form-item .ant-form-item-row{flex-direction:row!important}.form-item-label-auto.ant-form-item .ant-form-item-label{width:auto!important}.form-item-label-auto.ant-form-item .ant-form-item-control{flex:1!important}.form-item-label-align-left.ant-form-item .ant-form-item-label{text-align:left}.form-item-label-align-right.ant-form-item .ant-form-item-label{text-align:right}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row{flex-direction:column}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row>.ant-form-item-label{text-align:left;width:100%}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row>.ant-form-item-control{flex:initial}.form-label-70 .ant-form-item-label{width:70px}.form-label-80 .ant-form-item-label{width:80px}.form-label-90 .ant-form-item-label{width:90px}.form-label-100 .ant-form-item-label{width:100px}.form-label-110 .ant-form-item-label{width:110px}.form-label-120 .ant-form-item-label{width:120px}.form-label-130 .ant-form-item-label{width:130px}.form-label-140 .ant-form-item-label{width:140px}.form-label-150 .ant-form-item-label{width:150px}.form-label-160 .ant-form-item-label{width:160px}.form-label-170 .ant-form-item-label{width:170px}.form-label-180 .ant-form-item-label{width:180px}.form-label-190 .ant-form-item-label{width:190px}.form-label-200 .ant-form-item-label{width:200px}.form-label-auto .ant-form-item-label{width:auto}.form-label-align-left .ant-form-item-label{text-align:left}.form-label-align-right .ant-form-item-label{text-align:right}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-row{flex-direction:column}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-label{text-align:left;width:100%}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-control{flex:initial}.form-formitem-gap-15{margin-bottom:-15px}.form-formitem-gap-15 .ant-form-item{margin-bottom:15px}.form-formitem-gap-8{margin-bottom:-8px}.form-formitem-gap-8 .ant-form-item{margin-bottom:8px}.form-formitem-gap-5{margin-bottom:-5px}.form-formitem-gap-5 .ant-form-item{margin-bottom:5px}.form-formitem-gap-0,.form-formitem-gap-0 .ant-form-item{margin-bottom:0}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
+
import './../pre-defined-class-name/index.css';
|
|
2
3
|
import './index.css';
|
|
3
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
import{a as e,_ as r}from"../_rollupPluginBabelHelpers-a0769acd.js";import{
|
|
5
|
+
import{a as e,_ as r}from"../_rollupPluginBabelHelpers-a0769acd.js";import{composeProps as a}from"@flatbiz/utils";import{Form as l}from"antd";import{useMemo as i,isValidElement as t,cloneElement as n}from"react";import{preDefinedClassName as m}from"../pre-defined-class-name/index.js";import{jsx as o,jsxs as p}from"react/jsx-runtime";import"@dimjs/utils/cjs/class-names";var s=["wrapper","children","inputNormalize"],u=["wrapper","isClear","labelWidth","labelItemVertical","labelAlign","children","before","after","inputNormalize","outputNormalize","className"];var f=function r(l){var i=l.wrapper,t=l.children,m=l.inputNormalize,u=e(l,s);var f=u.hasOwnProperty("value");if(f&&m){u["value"]=m(u["value"])}var c=n(t,a(t.props,u,true));if(i){return i(c)}if(l.before||l.after){return p("div",{style:{display:"flex",alignItems:"center"},children:[l.before?o("span",{style:{marginRight:10},children:l.before}):null,o("div",{style:{flex:1},children:c}),l.after?o("span",{style:{marginLeft:10},children:l.after}):null]})}return c};var c=function a(n){var p=n.wrapper,s=n.isClear,c=n.labelWidth,d=n.labelItemVertical,b=n.labelAlign,h=n.children,v=n.before,N=n.after,g=n.inputNormalize,z=n.outputNormalize,y=n.className,I=e(n,u);var w=i((function(){return m.getFormItemLayoutClassName({labelWidth:c,labelItemVertical:d,labelAlign:b,className:y})}),[c,d,b]);if(s)return null;return o(l.Item,r({normalize:z},I,{className:w,children:t(h)?o(f,{wrapper:p,before:v,after:N,inputNormalize:g,children:h}):h}))};c["domTypeName"]="FormItemWrapper";export{c as FormItemWrapper};
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-wrapper/form-item-wrapper.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-wrapper/form-item-wrapper.tsx"],"sourcesContent":["import { composeProps, TAny } from '@flatbiz/utils';\nimport { Form, FormItemProps } from 'antd';\nimport { cloneElement, isValidElement, ReactElement, ReactNode, useMemo } from 'react';\nimport { preDefinedClassName } from '../pre-defined-class-name';\nimport { TFormItemLayoutPreClassNameProps } from '../pre-defined-class-name/form';\n\nexport type FormItemWrapperProps = FormItemProps &\n TFormItemLayoutPreClassNameProps & {\n wrapper?: (children: ReactNode) => ReactElement;\n /** 设置wrapper后,before、after失效 */\n before?: ReactNode;\n /** 设置wrapper后,before、after失效 */\n after?: ReactNode;\n /** value 序列化处理 */\n inputNormalize?: (value?: TAny) => TAny;\n /**\n * onChange 参数序列化处理\n * 如果设置 normalize 属性,outputNormalize将失效\n */\n outputNormalize?: (value?: TAny) => TAny;\n /** 是否清除 Form.Item */\n isClear?: boolean;\n /**\n * 栅格占位格数,最大值:24\n * ```\n * 1. 当 FormItemWrapper 处在 EasyForm 直接子节点中有效,即FormItemWrapper在EasyForm栅格中的占位格数;\n * ```\n */\n span?: number;\n };\n\ntype FormItemWrapperChildrenProps = Pick<\n FormItemWrapperProps,\n 'wrapper' | 'after' | 'before' | 'inputNormalize'\n> & {\n children: ReactElement;\n};\n\nconst FormItemWrapperChildren = (props: FormItemWrapperChildrenProps) => {\n const { wrapper, children, inputNormalize, ...rest } = props;\n // composeProps 合并执行 Form.Item 传的 onChange 以及组件本身的方法\n const hasValue = rest.hasOwnProperty('value');\n if (hasValue && inputNormalize) {\n rest['value'] = inputNormalize(rest['value']);\n }\n const _children = cloneElement(children, composeProps(children.props, rest, true));\n if (wrapper) {\n return wrapper(_children);\n }\n if (props.before || props.after) {\n return (\n <div style={{ display: 'flex', alignItems: 'center' }}>\n {props.before ? <span style={{ marginRight: 10 }}>{props.before}</span> : null}\n <div style={{ flex: 1 }}>{_children}</div>\n {props.after ? <span style={{ marginLeft: 10 }}>{props.after}</span> : null}\n </div>\n );\n }\n return _children;\n};\n\n/**\n * 对 Form.Item 包装处理\n * ```\n * 1. 为 children 增加 before、after\n * 2. 对输入、输出数据进行序列化处理\n * 3. 内置布局样式使用 preDefinedClassName.formItem\n * ```\n */\nexport const FormItemWrapper = (props: FormItemWrapperProps) => {\n const {\n wrapper,\n isClear,\n labelWidth,\n labelItemVertical,\n labelAlign,\n children,\n before,\n after,\n inputNormalize,\n outputNormalize,\n className,\n ...rest\n } = props;\n\n const innerClassName = useMemo(() => {\n return preDefinedClassName.getFormItemLayoutClassName({\n labelWidth,\n labelItemVertical,\n labelAlign,\n className,\n });\n }, [labelWidth, labelItemVertical, labelAlign]);\n\n if (isClear) return null;\n\n return (\n <Form.Item normalize={outputNormalize} {...rest} className={innerClassName}>\n {isValidElement(children) ? (\n <FormItemWrapperChildren\n wrapper={wrapper}\n before={before}\n after={after}\n inputNormalize={inputNormalize}\n >\n {children}\n </FormItemWrapperChildren>\n ) : (\n children\n )}\n </Form.Item>\n );\n};\n\nFormItemWrapper['domTypeName'] = 'FormItemWrapper';\n"],"names":["FormItemWrapperChildren","props","wrapper","children","inputNormalize","rest","_objectWithoutPropertiesLoose","_excluded","hasValue","hasOwnProperty","_children","cloneElement","composeProps","before","after","_jsxs","style","display","alignItems","_jsx","marginRight","flex","marginLeft","FormItemWrapper","isClear","labelWidth","labelItemVertical","labelAlign","outputNormalize","className","_excluded2","innerClassName","useMemo","preDefinedClassName","getFormItemLayoutClassName","Form","Item","_extends","normalize","isValidElement"],"mappings":";mjBAsCA,IAAMA,EAA0B,SAA1BA,EAA2BC,GAC/B,IAAQC,EAA+CD,EAA/CC,QAASC,EAAsCF,EAAtCE,SAAUC,EAA4BH,EAA5BG,eAAmBC,EAAIC,EAAKL,EAAKM,GAE5D,IAAMC,EAAWH,EAAKI,eAAe,SACrC,GAAID,GAAYJ,EAAgB,CAC9BC,EAAK,SAAWD,EAAeC,EAAK,SACtC,CACA,IAAMK,EAAYC,EAAaR,EAAUS,EAAaT,EAASF,MAA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
|
1
|
+
.form-list-wrapper{background-color:var(--block-bg-color)}.union-after-text,.union-before-text{align-self:flex-start;flex-shrink:0;line-height:32px}.union-after-element,.union-before-element{align-self:flex-start}.form-item-group-horizontal-union .v-flex-layout .ant-form-item{align-self:flex-start;margin-bottom:0}.form-item-group-horizontal-union .v-flex-layout{align-items:flex-start}
|
|
@@ -4,7 +4,10 @@ import './../config-provider-wrapper/index.css';
|
|
|
4
4
|
import './../fba-hooks/index.css';
|
|
5
5
|
import './../types/index.css';
|
|
6
6
|
import './../fba-utils/index.css';
|
|
7
|
+
import './../form-item-group/index.css';
|
|
8
|
+
import './../flex-layout/index.css';
|
|
9
|
+
import './../text-symbol-wrapper/index.css';
|
|
7
10
|
import './index.css';
|
|
8
11
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
9
|
-
import{
|
|
12
|
+
import{classNames as e}from"@dimjs/utils/cjs/class-names";import{_ as t}from"../_rollupPluginBabelHelpers-a0769acd.js";import{toArray as r,getUuid as i}from"@flatbiz/utils";import{Form as o,Empty as n}from"antd";import{useRef as l,Fragment as a}from"react";import{ButtonWrapper as s}from"../button-wrapper/index.js";import{FormItemGroup as m}from"../form-item-group/index.js";import{TextSymbolWrapper as d}from"../text-symbol-wrapper/index.js";import{jsx as p,jsxs as u}from"react/jsx-runtime";import"@ant-design/icons/es/icons/LoadingOutlined";import"@dimjs/lang/cjs/is-promise";import"@wove/react/cjs/hooks";import"../index-7f4ad045.js";import"antd/es/locale/en_US";import"antd/es/locale/zh_CN";import"dayjs";import"dayjs/locale/en";import"dayjs/locale/zh-cn";import"dayjs/plugin/advancedFormat";import"dayjs/plugin/customParseFormat";import"dayjs/plugin/localeData";import"dayjs/plugin/utc";import"dayjs/plugin/weekday";import"dayjs/plugin/weekOfYear";import"dayjs/plugin/weekYear";import"../fba-hooks/index.js";import"@dimjs/lang/cjs/is-array";import"../use-responsive-point-21b8c601.js";import"@dimjs/utils/cjs/extend";import"../fba-utils/index.js";import"../flex-layout/index.js";var c=function e(t){if(t.wrapper)return t.wrapper({children:t.children});return t.children};var f=function e(r){var i,o;return p(m.HorizontalUnion,t({},r.formListItemTitleHProps,{style:t({marginBottom:10},(i=r.formListItemTitleHProps)==null?void 0:i.style),groupConfigList:((o=r.formListItemTitleList)==null?void 0:o.map((function(e){if(e.required){return{width:e.width,mainItem:p("div",{style:{textAlign:"center"},children:p(d,{text:e.title,symbolType:"required"})})}}return{width:e.width,mainItem:p("div",{style:{textAlign:"center"},children:e.title})}})))||[]}))};var h=function m(d){var h=[].concat(d.prevCompleteName,r(d.name));var g=o.useFormInstance();var j=l([]);var y=d.uidFieldName||"uid";var v=o.useWatch(h,g);return p("div",{className:e("form-list-wrapper",d.className),style:d.style,children:p(o.List,{name:d.name,rules:d.rules,children:function e(r,l,m){var x;var w=m.errors;j.current=r;return u("div",{style:{borderRadius:"6px",border:w!=null&&w.length?"1px solid #ff4d4f":"1px solid transparent"},children:[(x=d.formListItemTitleList)!=null&&x.length?p(f,{formListItemTitleList:d.formListItemTitleList,formListItemTitleHProps:d.formListItemTitleHorizontalUnionProps}):null,!d.hiddenEmptyRender&&!(v!=null&&v.length)?p(n,{image:n.PRESENTED_IMAGE_SIMPLE,style:{margin:"15px 0"}}):null,p(c,{wrapper:d.formListChildrenWrapper,children:u(a,{children:[r.map((function(e,t){var r=[].concat(h,[e.name]);return p(a,{children:d.children({formListFieldData:e,operation:l,formStageCompleteName:r,prevCompleteName:h,index:t,getInsideFormItemName:function t(r){return[e.name,r]},getInsideFormItemData:function e(){return g.getFieldValue(r)},uidKey:y})},e.key)})),d.onCustomAddRowButton?d.onCustomAddRowButton(l):p(s,{hidden:d.hiddenAddRowButton,type:"dashed",block:true,onClick:function e(){var r;return l.add(t((r={},r[y]=i(),r),d.getAddRowDefaultValues==null?void 0:d.getAddRowDefaultValues()))},children:"添加"}),p(o.ErrorList,{errors:w.length?[p("div",{style:{color:"#ff4d4f",padding:"5px"},children:w})]:undefined})]})})]})}})})};export{h as FormListWrapper};
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-list-wrapper/form-list-wrapper.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { getUuid, toArray } from '@flatbiz/utils';\nimport { Empty, Form, type FormListFieldData } from 'antd';\nimport { Fragment, useRef, type ReactElement } from 'react';\nimport { ButtonWrapper } from '../button-wrapper';\nimport './style.less';\nimport { type FormListWrapperProps } from './types';\ntype FormListChildrenWrapperProps = {\n wrapper?: FormListWrapperProps['formListChildrenWrapper'];\n children: ReactElement;\n};\nconst FormListChildrenWrapper = (props: FormListChildrenWrapperProps) => {\n if (props.wrapper) return props.wrapper({ children: props.children });\n return props.children;\n};\n\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-list-wrapper/form-list-wrapper.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { getUuid, toArray } from '@flatbiz/utils';\nimport { Empty, Form, type FormListFieldData } from 'antd';\nimport { Fragment, useRef, type ReactElement } from 'react';\nimport { ButtonWrapper } from '../button-wrapper';\nimport { FormItemGroup } from '../form-item-group';\nimport { TextSymbolWrapper } from '../text-symbol-wrapper';\nimport './style.less';\nimport { type FormListWrapperProps } from './types';\n\ntype FormListChildrenWrapperProps = {\n wrapper?: FormListWrapperProps['formListChildrenWrapper'];\n children: ReactElement;\n};\nconst FormListChildrenWrapper = (props: FormListChildrenWrapperProps) => {\n if (props.wrapper) return props.wrapper({ children: props.children });\n return props.children;\n};\n\nconst FormListTitleRender = (props: {\n formListItemTitleList: FormListWrapperProps['formListItemTitleList'];\n formListItemTitleHProps?: FormListWrapperProps['formListItemTitleHorizontalUnionProps'];\n}) => {\n return (\n <FormItemGroup.HorizontalUnion\n {...props.formListItemTitleHProps}\n style={{ marginBottom: 10, ...props.formListItemTitleHProps?.style }}\n groupConfigList={\n props.formListItemTitleList?.map((item) => {\n if (item.required) {\n return {\n width: item.width,\n mainItem: (\n <div style={{ textAlign: 'center' }}>\n <TextSymbolWrapper text={item.title} symbolType=\"required\" />\n </div>\n ),\n };\n }\n return {\n width: item.width,\n mainItem: <div style={{ textAlign: 'center' }}>{item.title}</div>,\n };\n }) || []\n }\n />\n );\n};\n\n/**\n * Form.List 包装组件,使用更简单\n * ```\n * Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list\n * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置\n * ```\n */\nexport const FormListWrapper = (props: FormListWrapperProps) => {\n const stageCompleteName = [...props.prevCompleteName, ...toArray(props.name)] as Array<string | number>;\n const form = Form.useFormInstance();\n const formListOperationRef = useRef<FormListFieldData[]>([]);\n const uidFieldName = props.uidFieldName || 'uid';\n const formListValue = Form.useWatch(stageCompleteName, form);\n\n return (\n <div className={classNames('form-list-wrapper', props.className)} style={props.style}>\n <Form.List name={props.name} rules={props.rules}>\n {(fields, operation, { errors }) => {\n formListOperationRef.current = fields;\n return (\n <div\n style={{\n borderRadius: '6px',\n border: errors?.length ? '1px solid #ff4d4f' : '1px solid transparent',\n }}\n >\n {props.formListItemTitleList?.length ? (\n <FormListTitleRender\n formListItemTitleList={props.formListItemTitleList}\n formListItemTitleHProps={props.formListItemTitleHorizontalUnionProps}\n />\n ) : null}\n {!props.hiddenEmptyRender && !formListValue?.length ? (\n <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} style={{ margin: '15px 0' }} />\n ) : null}\n <FormListChildrenWrapper wrapper={props.formListChildrenWrapper}>\n <Fragment>\n {fields.map((field, index) => {\n const formStageCompleteName = [...stageCompleteName, field.name];\n return (\n <Fragment key={field.key}>\n {props.children({\n formListFieldData: field,\n operation: operation,\n formStageCompleteName,\n prevCompleteName: stageCompleteName,\n index,\n getInsideFormItemName: (key: string) => {\n return [field.name, key];\n },\n getInsideFormItemData: () => {\n return form.getFieldValue(formStageCompleteName);\n },\n uidKey: uidFieldName,\n })}\n </Fragment>\n );\n })}\n {props.onCustomAddRowButton ? (\n props.onCustomAddRowButton(operation)\n ) : (\n <ButtonWrapper\n hidden={props.hiddenAddRowButton}\n type=\"dashed\"\n block\n onClick={() =>\n operation.add({\n [uidFieldName]: getUuid(),\n ...props.getAddRowDefaultValues?.(),\n })\n }\n >\n 添加\n </ButtonWrapper>\n )}\n\n <Form.ErrorList\n errors={\n errors.length\n ? [\n <div\n style={{\n color: '#ff4d4f',\n padding: '5px',\n }}\n >\n {errors}\n </div>,\n ]\n : undefined\n }\n />\n </Fragment>\n </FormListChildrenWrapper>\n </div>\n );\n }}\n </Form.List>\n </div>\n );\n};\n"],"names":["FormListChildrenWrapper","props","wrapper","children","FormListTitleRender","_props$formListItemTi","_props$formListItemTi2","_jsx","FormItemGroup","HorizontalUnion","_extends","formListItemTitleHProps","style","marginBottom","groupConfigList","formListItemTitleList","map","item","required","width","mainItem","textAlign","TextSymbolWrapper","text","title","symbolType","FormListWrapper","stageCompleteName","concat","prevCompleteName","toArray","name","form","Form","useFormInstance","formListOperationRef","useRef","uidFieldName","formListValue","useWatch","className","_classNames","List","rules","fields","operation","_ref","_props$formListItemTi3","errors","current","_jsxs","borderRadius","border","length","formListItemTitleHorizontalUnionProps","hiddenEmptyRender","Empty","image","PRESENTED_IMAGE_SIMPLE","margin","formListChildrenWrapper","Fragment","field","index","formStageCompleteName","formListFieldData","getInsideFormItemName","key","getInsideFormItemData","getFieldValue","uidKey","onCustomAddRowButton","ButtonWrapper","hidden","hiddenAddRowButton","type","block","onClick","_extends2","add","getUuid","getAddRowDefaultValues","ErrorList","color","padding","undefined"],"mappings":";kqCAcA,IAAMA,EAA0B,SAA1BA,EAA2BC,GAC/B,GAAIA,EAAMC,QAAS,OAAOD,EAAMC,QAAQ,CAAEC,SAAUF,EAAME,WAC1D,OAAOF,EAAME,QACf,EAEA,IAAMC,EAAsB,SAAtBA,EAAuBH,GAGvB,IAAAI,EAAAC,EACJ,OACEC,EAACC,EAAcC,gBAAeC,EAAA,CAAA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AAyBV,EAAMqD,wCAE/B,MACFrD,EAAMsD,qBAAsBjB,SAAAA,EAAee,QAC3C9C,EAACiD,EAAK,CAACC,MAAOD,EAAME,uBAAwB9C,MAAO,CAAE+C,OAAQ,YAC3D,KACJpD,EAACP,EAAuB,CAACE,QAASD,EAAM2D,wBAAwBzD,SAC9D+C,EAACW,EAAQ,CAAA1D,SAAA,CACNyC,EAAO5B,KAAI,SAAC8C,EAAOC,GAClB,IAAMC,KAAqBpC,OAAOD,EAAmBmC,CAAAA,EAAM/B,OAC3D,OACExB,EAACsD,EAAQ,CAAA1D,SACNF,EAAME,SAAS,CACd8D,kBAAmBH,EACnBjB,UAAWA,EACXmB,sBAAAA,EACAnC,iBAAkBF,EAClBoC,MAAAA,EACAG,sBAAuB,SAAAA,EAACC,GACtB,MAAO,CAACL,EAAM/B,KAAMoC,EACrB,EACDC,sBAAuB,SAAAA,IACrB,OAAOpC,EAAKqC,cAAcL,EAC3B,EACDM,OAAQjC,KAbGyB,EAAMK,IAiBzB,IACClE,EAAMsE,qBACLtE,EAAMsE,qBAAqB1B,GAE3BtC,EAACiE,EAAa,CACZC,OAAQxE,EAAMyE,mBACdC,KAAK,SACLC,MAAK,KACLC,QAAS,SAAAA,IAAA,IAAAC,EAAA,OACPjC,EAAUkC,IAAGrE,GAAAoE,EAAA,CAAA,EAAAA,EACVzC,GAAe2C,IAASF,GACtB7E,EAAMgF,wBAAsB,UAAA,EAA5BhF,EAAMgF,0BAEZ,EAAA9E,SACF,OAKHI,EAAC0B,EAAKiD,UAAS,CACblC,OACEA,EAAOK,OACH,CACE9C,EAAA,MAAA,CACEK,MAAO,CACLuE,MAAO,UACPC,QAAS,OACTjF,SAED6C,KAGLqC,mBAOlB,KAIR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.form-item-label-70.ant-form-item .ant-form-item-label{width:70px}.form-item-label-80.ant-form-item .ant-form-item-label{width:80px}.form-item-label-90.ant-form-item .ant-form-item-label{width:90px}.form-item-label-100.ant-form-item .ant-form-item-label{width:100px}.form-item-label-110.ant-form-item .ant-form-item-label{width:110px}.form-item-label-120.ant-form-item .ant-form-item-label{width:120px}.form-item-label-130.ant-form-item .ant-form-item-label{width:130px}.form-item-label-140.ant-form-item .ant-form-item-label{width:140px}.form-item-label-150.ant-form-item .ant-form-item-label{width:150px}.form-item-label-160.ant-form-item .ant-form-item-label{width:160px}.form-item-label-170.ant-form-item .ant-form-item-label{width:170px}.form-item-label-180.ant-form-item .ant-form-item-label{width:180px}.form-item-label-190.ant-form-item .ant-form-item-label{width:190px}.form-item-label-200.ant-form-item .ant-form-item-label{width:200px}.form-item-label-auto.ant-form-item .ant-form-item-row{flex-direction:row!important}.form-item-label-auto.ant-form-item .ant-form-item-label{width:auto!important}.form-item-label-auto.ant-form-item .ant-form-item-control{flex:1!important}.form-item-label-align-left.ant-form-item .ant-form-item-label{text-align:left}.form-item-label-align-right.ant-form-item .ant-form-item-label{text-align:right}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row{flex-direction:column}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row>.ant-form-item-label{text-align:left;width:100%}.ant-form-item.form-item-label-value-vertical>.ant-form-item-row>.ant-form-item-control{flex:initial}.form-label-70 .ant-form-item-label{width:70px}.form-label-80 .ant-form-item-label{width:80px}.form-label-90 .ant-form-item-label{width:90px}.form-label-100 .ant-form-item-label{width:100px}.form-label-110 .ant-form-item-label{width:110px}.form-label-120 .ant-form-item-label{width:120px}.form-label-130 .ant-form-item-label{width:130px}.form-label-140 .ant-form-item-label{width:140px}.form-label-150 .ant-form-item-label{width:150px}.form-label-160 .ant-form-item-label{width:160px}.form-label-170 .ant-form-item-label{width:170px}.form-label-180 .ant-form-item-label{width:180px}.form-label-190 .ant-form-item-label{width:190px}.form-label-200 .ant-form-item-label{width:200px}.form-label-auto .ant-form-item-label{width:auto}.form-label-align-left .ant-form-item-label{text-align:left}.form-label-align-right .ant-form-item-label{text-align:right}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-row{flex-direction:column}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-label{text-align:left;width:100%}.form-label-value-vertical .ant-form-item:not(.form-item-label-auto) .ant-form-item-control{flex:initial}.form-formitem-gap-15{margin-bottom:-15px}.form-formitem-gap-15 .ant-form-item{margin-bottom:15px}.form-formitem-gap-8{margin-bottom:-8px}.form-formitem-gap-8 .ant-form-item{margin-bottom:8px}.form-formitem-gap-5{margin-bottom:-5px}.form-formitem-gap-5 .ant-form-item{margin-bottom:5px}.form-formitem-gap-0,.form-formitem-gap-0 .ant-form-item{margin-bottom:0}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
+
import './../pre-defined-class-name/index.css';
|
|
2
3
|
import './index.css';
|
|
3
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
import{a,_ as
|
|
5
|
+
import{a,_ as e}from"../_rollupPluginBabelHelpers-a0769acd.js";import{Form as l}from"antd";import{useMemo as r}from"react";import{preDefinedClassName as m}from"../pre-defined-class-name/index.js";import{jsx as t}from"react/jsx-runtime";import"@dimjs/utils/cjs/class-names";var s=["labelWidth","labelItemVertical","labelAlign","formItemGap","className"];var i=function i(o){var n=o.labelWidth,c=o.labelItemVertical,p=o.labelAlign,f=o.formItemGap,b=o.className,u=a(o,s);var d=r((function(){return m.getFormLayoutClassName({labelWidth:n,labelItemVertical:c,labelAlign:p,formItemGap:f,className:b})}),[n,c,p,f]);return t(l,e({},u,{className:d}))};export{i as FormWrapper};
|
|
5
6
|
//# sourceMappingURL=index.js.map
|