@flatbiz/antd 4.2.80 → 4.2.82
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/button-wrapper/index.css +1 -1
- package/esm/button-wrapper/index.js +1 -1
- package/esm/button-wrapper/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 +1 -1
- package/esm/dialog-drawer-content/index.js.map +1 -1
- package/esm/drag-collapse-form-list/index.js +1 -1
- package/esm/drag-collapse-form-list/index.js.map +1 -1
- package/esm/drag-form-list/index.css +1 -0
- package/esm/drag-form-list/index.js +5 -0
- package/esm/drag-form-list/index.js.map +1 -0
- package/esm/easy-table/index.js +2 -1
- package/esm/easy-table/index.js.map +1 -1
- package/esm/editable-table/index.js +1 -1
- package/esm/editable-table/index.js.map +1 -1
- package/esm/form-grid/index.js.map +1 -1
- package/esm/form-item-group/index.js.map +1 -1
- package/esm/form-list-wrapper/index.css +1 -0
- package/esm/form-list-wrapper/index.js +5 -0
- package/esm/form-list-wrapper/index.js.map +1 -0
- package/esm/index.js +4 -1
- package/esm/label-value-layout/index.js +1 -1
- package/esm/label-value-layout/index.js.map +1 -1
- package/esm/pre-defined-class-name/index.css +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/simple-layout/index.css +1 -1
- package/esm/switch-confirm-wrapper/index.js +1 -1
- package/esm/switch-confirm-wrapper/index.js.map +1 -1
- package/esm/table-title-tooltip/index.js.map +1 -1
- package/esm/text-overflow-render/index.js +1 -1
- package/esm/text-overflow-render/index.js.map +1 -1
- package/esm/tips-wrapper/index.css +0 -0
- package/esm/tips-wrapper/index.js +5 -0
- package/esm/tips-wrapper/index.js.map +1 -0
- package/esm/use-responsive-point-21b8c601.js.map +1 -1
- package/index.d.ts +259 -27
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-grid/form-col.tsx","@flatbiz/antd/src/form-grid/form-operate-col.tsx","@flatbiz/antd/src/form-grid/utils.ts","@flatbiz/antd/src/form-grid/form-row.tsx","@flatbiz/antd/src/form-grid/index.ts"],"sourcesContent":["import { Col } from 'antd';\nimport { ReactNode } from 'react';\nconst forceAloneRowGrid = { xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 };\nexport type FormColProps = {\n /** 栅格占位格数,替换lg、xl、xxl默认数据 */\n span?: number;\n /** 屏幕 < 576px */\n xs?: number;\n /** 屏幕 ≥ 576px */\n sm?: number;\n /** 屏幕 ≥ 768px */\n md?: number;\n /** 屏幕 ≥ 992px */\n lg?: number;\n /** 屏幕 ≥ 1200px */\n xl?: number;\n /** 屏幕 ≥ 1600px */\n xxl?: number;\n /** 强制单独一行 */\n forceAloneRow?: boolean;\n children?: ReactNode | ReactNode[];\n hidden?: boolean;\n};\n\n/**\n * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }\n *```\n * 1. 设置 span 栅格占位格数,替换lg、xl、xxl默认数据\n * 2. grid 自定义响应式网格布局\n * xs: 屏幕 < 576px\n * sm: 屏幕 ≥ 576px\n * md: 屏幕 ≥ 768px\n * lg: 屏幕 ≥ 992px\n * xl: 屏幕 ≥ 1200px\n * xxl: 屏幕 ≥ 1600px\n * ```\n */\nexport const FormCol = (props: FormColProps) => {\n const { forceAloneRow, hidden, ...otherProps } = props;\n const forceGrid = forceAloneRow ? forceAloneRowGrid : otherProps;\n if (hidden) return null;\n return <Col {...forceGrid}>{props.children}</Col>;\n};\n\nFormCol['domTypeName'] = 'FormCol';\n","import { classNames } from '@dimjs/utils';\nimport { Col, Form, Row, RowProps, Space, SpaceProps } from 'antd';\nimport { ReactElement, useMemo } from 'react';\n\nconst fullGrid = { xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 };\nexport type FormOperateColProps = {\n className?: string;\n leftList?: Array<ReactElement | null>;\n rightList?: Array<ReactElement | null>;\n // left、right 对齐方式,优先级最高\n justify?: RowProps['justify'];\n /** 强制单独一行 */\n forceAloneRow?: boolean;\n hidden?: boolean;\n leftSpaceProps?: SpaceProps;\n rightSpaceProps?: SpaceProps;\n};\n\n/**\n * FormOperateCol 布局说明\n * ```\n * 1. 网格数以及位置为动态计算,不支持 xs、sm、md等\n * 2. 如果FormRow只有一行col,则OperateCol会在当前行剩余网格内居左对齐\n * 3. 如果同时设置 leftList、rightList,则此cell会强制独占一行,并左右布局\n * 4. 如果只设置 leftList、rightList其中一个,则会在最后一行剩余网格内居右对齐\n * ```\n */\nexport const FormOperateCol = (props: FormOperateColProps) => {\n const {\n leftList,\n rightList,\n rowColTotal,\n justify,\n forceAloneRow,\n hidden,\n leftSpaceProps,\n rightSpaceProps,\n ...otherProps\n } = props as FormOperateColProps & {\n rowColTotal: number;\n };\n const _leftList = (leftList || []).filter(Boolean);\n const _rightList = (rightList || []).filter(Boolean);\n const hasAll = _leftList.length > 0 && _rightList.length > 0;\n const forceGrid = forceAloneRow || hasAll ? fullGrid : {};\n\n const colJustify = useMemo(() => {\n if (justify) return justify;\n if (hasAll) return 'space-between';\n if (forceAloneRow) return 'end';\n if (rowColTotal === 1) return 'start';\n return 'end';\n }, [forceAloneRow, hasAll, justify, rowColTotal]);\n\n const className = classNames(props.className, 'v-form-col-operate');\n\n if (hidden) return null;\n\n return (\n <Col {...otherProps} {...forceGrid} className={className}>\n <Form.Item>\n <Row justify={colJustify} wrap={false}>\n <Space {...leftSpaceProps}>{_leftList.map((item) => item)}</Space>\n <Space {...rightSpaceProps} style={{ overflowX: 'auto', ...rightSpaceProps?.style }}>\n {_rightList?.map((item) => item)}\n </Space>\n </Row>\n </Form.Item>\n </Col>\n );\n};\n\nFormOperateCol['domTypeName'] = 'FormOperateCol';\n","/**\n * 用于计算 operateCol 所占用网格数\n * ```\n * col网格数据 [8,8,8,12,24,0,8] => [[8,8,8],[12],[24],[0,8]],分组后计算operateCol所在行中剩余网格数\n * ```\n * @returns\n */\nexport const calculateOperateGrid = (gridList: number[], operateColIndex: number) => {\n try {\n const groupList = [] as { index: number; value: number }[][];\n const getGroupItem = function (index) {\n const value = gridList[index];\n return { index, value: value > 24 ? 24 : value };\n };\n let condition = true;\n let groupItemList = [] as { index: number; value: number }[];\n let currentIndex = 0;\n let total = 0;\n while (condition) {\n const currentValue = gridList[currentIndex];\n groupItemList.push(getGroupItem(currentIndex));\n if (currentValue >= 24) {\n groupList.push(groupItemList);\n groupItemList = [];\n total = 0;\n } else if (currentIndex === gridList.length - 1) {\n groupList.push(groupItemList);\n } else {\n total += currentValue;\n if (total >= 24) {\n groupList.push(groupItemList);\n groupItemList = [];\n total = 0;\n }\n }\n currentIndex = currentIndex + 1;\n if (currentIndex >= gridList.length) {\n condition = false;\n }\n }\n const hasOperateList =\n groupList.find((item) => !!item.find((temp) => temp.index === operateColIndex)) || [];\n let hasOperateTotal = 0;\n let hasOperateIndex = 0;\n hasOperateList.forEach((item, index) => {\n if (item.index === operateColIndex) hasOperateIndex = index;\n if (item.index < operateColIndex) {\n hasOperateTotal = hasOperateTotal + item.value;\n }\n });\n if (hasOperateTotal === 24 || hasOperateTotal === 0) {\n hasOperateList[hasOperateIndex].value = 24;\n } else {\n hasOperateList[hasOperateIndex].value = 24 - hasOperateTotal;\n }\n\n return {\n gridList: groupList.reduce((a, b) => a.concat(b)).map((temp) => temp.value),\n gridGroupList: groupList,\n };\n } catch (error) {\n return {\n gridList,\n gridGroupList: [],\n };\n }\n};\n","import { toArray, valueIsEqual } from '@flatbiz/utils';\nimport { Row, RowProps } from 'antd';\nimport { cloneElement, isValidElement, ReactElement, ReactNode, useMemo } from 'react';\nimport { useResponsivePoint } from '../fba-hooks/use-responsive-point';\nimport { calculateOperateGrid } from './utils';\n\nexport type FormRowProps = RowProps & {\n children?: ReactNode | ReactNode[];\n /**\n * default = { xs: 24, sm: 12, md: 8, lg: 8, xl: 8, xxl: 6 };\n * small = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };\n */\n gridSize?: 'default' | 'small';\n};\nconst defaultGrid = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };\nconst defaultSmallGrid = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };\n\n/**\n * FormItem网格响应式布局\n *```\n * 1. 应用场景:Form条件布局\n * 2. 子元素只能是 FormGrid.Col、FormGrid.OperateCol,其他会被忽略\n * 3. 所有子元素中只能存在一个 FormGrid.OperateCol\n */\nexport const FormRow = (props: FormRowProps) => {\n const { gridSize, ...otherProps } = props;\n const screenType = useResponsivePoint() || 'md';\n\n const childrenList = toArray<ReactElement>(props.children).filter((item) => {\n if (!item || !isValidElement(item)) return false;\n return valueIsEqual(item.type['domTypeName'], ['FormOperateCol', 'FormCol']);\n });\n const defaultGridSize = gridSize === 'small' ? defaultSmallGrid : defaultGrid;\n console.log('screenType', screenType, defaultGridSize[screenType]);\n\n const { gridList, gridGroupList } = useMemo(() => {\n const operateColIndex = childrenList.findIndex((item) => {\n return item.type['domTypeName'] === 'FormOperateCol';\n });\n if (screenType === undefined) {\n return { gridList: [] as number[], gridGroupList: [] };\n }\n const _currentGridList = childrenList.map((temp, index) => {\n if (index === operateColIndex) return 0;\n if (['md', 'sm', 'xs'].includes(screenType)) {\n return temp.props?.[screenType] || defaultGridSize[screenType];\n }\n const span = temp.props?.span as number;\n return temp.props?.[screenType] || span || defaultGridSize[screenType];\n });\n if (operateColIndex < 0) {\n return { gridList: _currentGridList, gridGroupList: [] };\n }\n return calculateOperateGrid(_currentGridList, operateColIndex);\n }, [childrenList, defaultGridSize, screenType]);\n\n // if (!screenType) return <Fragment>{props.children}</Fragment>;\n return (\n <Row {...otherProps}>\n {childrenList.map((item, index) => {\n const itemProps = { ...defaultGridSize, ...item.props };\n const newProps = {\n key: index,\n ...itemProps,\n [screenType]: gridList[index] || itemProps[screenType],\n };\n if (item.type['domTypeName'] === 'FormOperateCol') {\n newProps['rowColTotal'] = gridGroupList.length;\n }\n return cloneElement(item, newProps);\n })}\n </Row>\n );\n};\n","import { FormCol } from './form-col';\nimport { FormOperateCol } from './form-operate-col';\nimport { FormRow } from './form-row';\n\nexport const FormGrid = {\n /**\n * FormItem网格响应式布局\n *```\n * 1. 应用场景:Form条件布局\n * 2. 子元素只能是 FormCol、FormOperateCol,其他会被忽略\n * 3. 所有子元素中只能存在一个 FormOperateCol\n */\n Row: FormRow,\n /**\n * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }\n *```\n * 1. 设置 span 栅格占位格数,不考虑响应式\n * 2. grid 自定义响应式网格布局\n * xs: 屏幕 < 576px\n * sm: 屏幕 ≥ 576px\n * md: 屏幕 ≥ 768px\n * lg: 屏幕 ≥ 992px\n * xl: 屏幕 ≥ 1200px\n * xxl: 屏幕 ≥ 1600px\n * ```\n */\n Col: FormCol,\n /**\n * FormOperateCol 布局说明\n * ```\n * 1. 网格数以及位置为动态计算,不支持 xs、sm、md等\n * 2. 如果FormRow只有一行col,则OperateCol会在当前行剩余网格内居左对齐\n * 3. 如果同时设置 leftList、rightList,则此cell会强制独占一行,并左右布局\n * 4. 如果只设置 leftList、rightList其中一个,则会在最后一行剩余网格内居右对齐\n * ```\n */\n OperateCol: FormOperateCol,\n};\n"],"names":["forceAloneRowGrid","xs","sm","md","lg","xl","xxl","FormCol","props","forceAloneRow","hidden","otherProps","_objectWithoutPropertiesLoose","_excluded","forceGrid","_jsx","Col","_extends","children","fullGrid","FormOperateCol","_ref","leftList","rightList","rowColTotal","justify","leftSpaceProps","rightSpaceProps","_leftList","filter","Boolean","_rightList","hasAll","length","colJustify","useMemo","className","_classNames","Form","Item","_jsxs","Row","wrap","Space","map","item","style","overflowX","calculateOperateGrid","gridList","operateColIndex","groupList","getGroupItem","index","value","condition","groupItemList","currentIndex","total","currentValue","push","hasOperateList","find","temp","hasOperateTotal","hasOperateIndex","forEach","reduce","a","b","concat","gridGroupList","error","defaultGrid","defaultSmallGrid","FormRow","gridSize","screenType","useResponsivePoint","childrenList","toArray","isValidElement","valueIsEqual","type","defaultGridSize","console","log","_useMemo","findIndex","undefined","_currentGridList","_temp$props2","_temp$props3","includes","_temp$props","span","_extends2","itemProps","newProps","key","cloneElement","FormGrid","OperateCol"],"mappings":";mcAEA,IAAMA,EAAoB,CAAEC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,IAAK,IAmClE,IAAMC,EAAU,SAAVA,EAAWC,GACtB,IAAQC,EAAyCD,EAAzCC,cAAeC,EAA0BF,EAA1BE,OAAWC,EAAUC,EAAKJ,EAAKK,GACtD,IAAMC,EAAYL,EAAgBT,EAAoBW,EACtD,GAAID,EAAQ,OAAO,KACnB,OAAOK,EAACC,EAAGC,KAAKH,EAAS,CAAAI,SAAGV,EAAMU,WACpC,EAEAX,EAAQ,eAAiB,6HCxCzB,IAAMY,EAAW,CAAElB,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,IAAK,IAuBzD,IAAMc,EAAiB,SAAjBA,EAAkBZ,GAC7B,IAAAa,EAUIb,EATFc,EAAQD,EAARC,SACAC,EAASF,EAATE,UACAC,EAAWH,EAAXG,YACAC,EAAOJ,EAAPI,QACAhB,EAAaY,EAAbZ,cACAC,EAAMW,EAANX,OACAgB,EAAcL,EAAdK,eACAC,EAAeN,EAAfM,gBACGhB,EAAUC,EAAAS,EAAAR,GAIf,IAAMe,GAAaN,GAAY,IAAIO,OAAOC,SAC1C,IAAMC,GAAcR,GAAa,IAAIM,OAAOC,SAC5C,IAAME,EAASJ,EAAUK,OAAS,GAAKF,EAAWE,OAAS,EAC3D,IAAMnB,EAAYL,GAAiBuB,EAASb,EAAW,CAAA,EAEvD,IAAMe,EAAaC,GAAQ,WACzB,GAAIV,EAAS,OAAOA,EACpB,GAAIO,EAAQ,MAAO,gBACnB,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AK,iBAAmB,iBAAkB,CACjDe,EAAS,eAAiB3B,EAActC,MAC1C,CACA,OAAOmE,EAAavD,EAAMqD,QAIlC,ECrEO,IAAMG,EAAW,CAQtB5D,IAAKkC,EAcL3D,IAAKT,EAUL+F,WAAYlF"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-grid/form-col.tsx","@flatbiz/antd/src/form-grid/form-operate-col.tsx","@flatbiz/antd/src/form-grid/utils.ts","@flatbiz/antd/src/form-grid/form-row.tsx","@flatbiz/antd/src/form-grid/index.ts"],"sourcesContent":["import { Col } from 'antd';\nimport { ReactNode } from 'react';\nconst forceAloneRowGrid = { xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 };\nexport type FormColProps = {\n /** 栅格占位格数,替换lg、xl、xxl默认数据 */\n span?: number;\n /** 屏幕 < 576px */\n xs?: number;\n /** 屏幕 ≥ 576px */\n sm?: number;\n /** 屏幕 ≥ 768px */\n md?: number;\n /** 屏幕 ≥ 992px */\n lg?: number;\n /** 屏幕 ≥ 1200px */\n xl?: number;\n /** 屏幕 ≥ 1600px */\n xxl?: number;\n /** 强制单独一行 */\n forceAloneRow?: boolean;\n children?: ReactNode | ReactNode[];\n hidden?: boolean;\n};\n\n/**\n * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }\n *```\n * 1. 设置 span 栅格占位格数,替换lg、xl、xxl默认数据,不替换xs、sm布局数据\n * 2. grid 自定义响应式网格布局\n * xs: 屏幕 < 576px\n * sm: 屏幕 ≥ 576px\n * md: 屏幕 ≥ 768px\n * lg: 屏幕 ≥ 992px\n * xl: 屏幕 ≥ 1200px\n * xxl: 屏幕 ≥ 1600px\n * ```\n */\nexport const FormCol = (props: FormColProps) => {\n const { forceAloneRow, hidden, ...otherProps } = props;\n const forceGrid = forceAloneRow ? forceAloneRowGrid : otherProps;\n if (hidden) return null;\n return <Col {...forceGrid}>{props.children}</Col>;\n};\n\nFormCol['domTypeName'] = 'FormCol';\n","import { classNames } from '@dimjs/utils';\nimport { Col, Form, Row, RowProps, Space, SpaceProps } from 'antd';\nimport { ReactElement, useMemo } from 'react';\n\nconst fullGrid = { xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 };\nexport type FormOperateColProps = {\n className?: string;\n leftList?: Array<ReactElement | null>;\n rightList?: Array<ReactElement | null>;\n // left、right 对齐方式,优先级最高\n justify?: RowProps['justify'];\n /** 强制单独一行 */\n forceAloneRow?: boolean;\n hidden?: boolean;\n leftSpaceProps?: SpaceProps;\n rightSpaceProps?: SpaceProps;\n};\n\n/**\n * FormOperateCol 布局说明\n * ```\n * 1. 网格数以及位置为动态计算,不支持 xs、sm、md等\n * 2. 如果FormRow只有一行col,则OperateCol会在当前行剩余网格内居左对齐\n * 3. 如果同时设置 leftList、rightList,则此cell会强制独占一行,并左右布局\n * 4. 如果只设置 leftList、rightList其中一个,则会在最后一行剩余网格内居右对齐\n * ```\n */\nexport const FormOperateCol = (props: FormOperateColProps) => {\n const {\n leftList,\n rightList,\n rowColTotal,\n justify,\n forceAloneRow,\n hidden,\n leftSpaceProps,\n rightSpaceProps,\n ...otherProps\n } = props as FormOperateColProps & {\n rowColTotal: number;\n };\n const _leftList = (leftList || []).filter(Boolean);\n const _rightList = (rightList || []).filter(Boolean);\n const hasAll = _leftList.length > 0 && _rightList.length > 0;\n const forceGrid = forceAloneRow || hasAll ? fullGrid : {};\n\n const colJustify = useMemo(() => {\n if (justify) return justify;\n if (hasAll) return 'space-between';\n if (forceAloneRow) return 'end';\n if (rowColTotal === 1) return 'start';\n return 'end';\n }, [forceAloneRow, hasAll, justify, rowColTotal]);\n\n const className = classNames(props.className, 'v-form-col-operate');\n\n if (hidden) return null;\n\n return (\n <Col {...otherProps} {...forceGrid} className={className}>\n <Form.Item>\n <Row justify={colJustify} wrap={false}>\n <Space {...leftSpaceProps}>{_leftList.map((item) => item)}</Space>\n <Space {...rightSpaceProps} style={{ overflowX: 'auto', ...rightSpaceProps?.style }}>\n {_rightList?.map((item) => item)}\n </Space>\n </Row>\n </Form.Item>\n </Col>\n );\n};\n\nFormOperateCol['domTypeName'] = 'FormOperateCol';\n","/**\n * 用于计算 operateCol 所占用网格数\n * ```\n * col网格数据 [8,8,8,12,24,0,8] => [[8,8,8],[12],[24],[0,8]],分组后计算operateCol所在行中剩余网格数\n * ```\n * @returns\n */\nexport const calculateOperateGrid = (gridList: number[], operateColIndex: number) => {\n try {\n const groupList = [] as { index: number; value: number }[][];\n const getGroupItem = function (index) {\n const value = gridList[index];\n return { index, value: value > 24 ? 24 : value };\n };\n let condition = true;\n let groupItemList = [] as { index: number; value: number }[];\n let currentIndex = 0;\n let total = 0;\n while (condition) {\n const currentValue = gridList[currentIndex];\n groupItemList.push(getGroupItem(currentIndex));\n if (currentValue >= 24) {\n groupList.push(groupItemList);\n groupItemList = [];\n total = 0;\n } else if (currentIndex === gridList.length - 1) {\n groupList.push(groupItemList);\n } else {\n total += currentValue;\n if (total >= 24) {\n groupList.push(groupItemList);\n groupItemList = [];\n total = 0;\n }\n }\n currentIndex = currentIndex + 1;\n if (currentIndex >= gridList.length) {\n condition = false;\n }\n }\n const hasOperateList =\n groupList.find((item) => !!item.find((temp) => temp.index === operateColIndex)) || [];\n let hasOperateTotal = 0;\n let hasOperateIndex = 0;\n hasOperateList.forEach((item, index) => {\n if (item.index === operateColIndex) hasOperateIndex = index;\n if (item.index < operateColIndex) {\n hasOperateTotal = hasOperateTotal + item.value;\n }\n });\n if (hasOperateTotal === 24 || hasOperateTotal === 0) {\n hasOperateList[hasOperateIndex].value = 24;\n } else {\n hasOperateList[hasOperateIndex].value = 24 - hasOperateTotal;\n }\n\n return {\n gridList: groupList.reduce((a, b) => a.concat(b)).map((temp) => temp.value),\n gridGroupList: groupList,\n };\n } catch (error) {\n return {\n gridList,\n gridGroupList: [],\n };\n }\n};\n","import { toArray, valueIsEqual } from '@flatbiz/utils';\nimport { Row, RowProps } from 'antd';\nimport { cloneElement, isValidElement, ReactElement, ReactNode, useMemo } from 'react';\nimport { useResponsivePoint } from '../fba-hooks/use-responsive-point';\nimport { calculateOperateGrid } from './utils';\n\nexport type FormRowProps = RowProps & {\n children?: ReactNode | ReactNode[];\n /**\n * default = { xs: 24, sm: 12, md: 8, lg: 8, xl: 8, xxl: 6 };\n * small = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };\n */\n gridSize?: 'default' | 'small';\n};\nconst defaultGrid = { xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 };\nconst defaultSmallGrid = { xs: 24, sm: 12, md: 8, lg: 6, xl: 6, xxl: 6 };\n\n/**\n * FormItem网格响应式布局\n *```\n * 1. 应用场景:Form条件布局\n * 2. 子元素只能是 FormGrid.Col、FormGrid.OperateCol,其他会被忽略\n * 3. 所有子元素中只能存在一个 FormGrid.OperateCol\n */\nexport const FormRow = (props: FormRowProps) => {\n const { gridSize, ...otherProps } = props;\n const screenType = useResponsivePoint() || 'md';\n\n const childrenList = toArray<ReactElement>(props.children).filter((item) => {\n if (!item || !isValidElement(item)) return false;\n return valueIsEqual(item.type['domTypeName'], ['FormOperateCol', 'FormCol']);\n });\n const defaultGridSize = gridSize === 'small' ? defaultSmallGrid : defaultGrid;\n console.log('screenType', screenType, defaultGridSize[screenType]);\n\n const { gridList, gridGroupList } = useMemo(() => {\n const operateColIndex = childrenList.findIndex((item) => {\n return item.type['domTypeName'] === 'FormOperateCol';\n });\n if (screenType === undefined) {\n return { gridList: [] as number[], gridGroupList: [] };\n }\n const _currentGridList = childrenList.map((temp, index) => {\n if (index === operateColIndex) return 0;\n if (['md', 'sm', 'xs'].includes(screenType)) {\n return temp.props?.[screenType] || defaultGridSize[screenType];\n }\n const span = temp.props?.span as number;\n return temp.props?.[screenType] || span || defaultGridSize[screenType];\n });\n if (operateColIndex < 0) {\n return { gridList: _currentGridList, gridGroupList: [] };\n }\n return calculateOperateGrid(_currentGridList, operateColIndex);\n }, [childrenList, defaultGridSize, screenType]);\n\n // if (!screenType) return <Fragment>{props.children}</Fragment>;\n return (\n <Row {...otherProps}>\n {childrenList.map((item, index) => {\n const itemProps = { ...defaultGridSize, ...item.props };\n const newProps = {\n key: index,\n ...itemProps,\n [screenType]: gridList[index] || itemProps[screenType],\n };\n if (item.type['domTypeName'] === 'FormOperateCol') {\n newProps['rowColTotal'] = gridGroupList.length;\n }\n return cloneElement(item, newProps);\n })}\n </Row>\n );\n};\n","import { FormCol } from './form-col';\nimport { FormOperateCol } from './form-operate-col';\nimport { FormRow } from './form-row';\n\nexport const FormGrid = {\n /**\n * FormItem网格响应式布局\n *```\n * 1. 应用场景:Form条件布局\n * 2. 子元素只能是 FormGrid.Col、FormGrid.OperateCol,其他会被忽略\n * 3. 所有子元素中只能存在一个 FormGrid.OperateCol\n */\n Row: FormRow,\n /**\n * 网格响应式布局,默认值:{ xs: 24, sm: 12, md: 12, lg: 8, xl: 8, xxl: 6 }\n *```\n * 1. 设置 span 栅格占位格数,替换lg、xl、xxl默认数据,不替换xs、sm布局数据\n * 2. grid 自定义响应式网格布局\n * xs: 屏幕 < 576px\n * sm: 屏幕 ≥ 576px\n * md: 屏幕 ≥ 768px\n * lg: 屏幕 ≥ 992px\n * xl: 屏幕 ≥ 1200px\n * xxl: 屏幕 ≥ 1600px\n * ```\n */\n Col: FormCol,\n /**\n * FormOperateCol 布局说明\n * ```\n * 1. 网格数以及位置为动态计算,不支持 xs、sm、md等\n * 2. 如果FormRow只有一行col,则OperateCol会在当前行剩余网格内居左对齐\n * 3. 如果同时设置 leftList、rightList,则此cell会强制独占一行,并左右布局\n * 4. 如果只设置 leftList、rightList其中一个,则会在最后一行剩余网格内居右对齐\n * ```\n */\n OperateCol: FormOperateCol,\n};\n"],"names":["forceAloneRowGrid","xs","sm","md","lg","xl","xxl","FormCol","props","forceAloneRow","hidden","otherProps","_objectWithoutPropertiesLoose","_excluded","forceGrid","_jsx","Col","_extends","children","fullGrid","FormOperateCol","_ref","leftList","rightList","rowColTotal","justify","leftSpaceProps","rightSpaceProps","_leftList","filter","Boolean","_rightList","hasAll","length","colJustify","useMemo","className","_classNames","Form","Item","_jsxs","Row","wrap","Space","map","item","style","overflowX","calculateOperateGrid","gridList","operateColIndex","groupList","getGroupItem","index","value","condition","groupItemList","currentIndex","total","currentValue","push","hasOperateList","find","temp","hasOperateTotal","hasOperateIndex","forEach","reduce","a","b","concat","gridGroupList","error","defaultGrid","defaultSmallGrid","FormRow","gridSize","screenType","useResponsivePoint","childrenList","toArray","isValidElement","valueIsEqual","type","defaultGridSize","console","log","_useMemo","findIndex","undefined","_currentGridList","_temp$props2","_temp$props3","includes","_temp$props","span","_extends2","itemProps","newProps","key","cloneElement","FormGrid","OperateCol"],"mappings":";mcAEA,IAAMA,EAAoB,CAAEC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,IAAK,IAmClE,IAAMC,EAAU,SAAVA,EAAWC,GACtB,IAAQC,EAAyCD,EAAzCC,cAAeC,EAA0BF,EAA1BE,OAAWC,EAAUC,EAAKJ,EAAKK,GACtD,IAAMC,EAAYL,EAAgBT,EAAoBW,EACtD,GAAID,EAAQ,OAAO,KACnB,OAAOK,EAACC,EAAGC,KAAKH,EAAS,CAAAI,SAAGV,EAAMU,WACpC,EAEAX,EAAQ,eAAiB,6HCxCzB,IAAMY,EAAW,CAAElB,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,GAAI,GAAIC,IAAK,IAuBzD,IAAMc,EAAiB,SAAjBA,EAAkBZ,GAC7B,IAAAa,EAUIb,EATFc,EAAQD,EAARC,SACAC,EAASF,EAATE,UACAC,EAAWH,EAAXG,YACAC,EAAOJ,EAAPI,QACAhB,EAAaY,EAAbZ,cACAC,EAAMW,EAANX,OACAgB,EAAcL,EAAdK,eACAC,EAAeN,EAAfM,gBACGhB,EAAUC,EAAAS,EAAAR,GAIf,IAAMe,GAAaN,GAAY,IAAIO,OAAOC,SAC1C,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AAI,SAACC,EAAMQ,GAAU,IAAA2C,EACjC,IAAMC,EAAShF,EAAA,CAAA,EAAQmE,EAAoBvC,EAAKrC,OAChD,IAAM0F,EAAQjF,EAAA,CACZkF,IAAK9C,GACF4C,GAASD,KAAAA,EACXnB,GAAa5B,EAASI,IAAU4C,EAAUpB,GAAWmB,IAExD,GAAInD,EAAKsC,KAAK,iBAAmB,iBAAkB,CACjDe,EAAS,eAAiB3B,EAActC,MAC1C,CACA,OAAOmE,EAAavD,EAAMqD,QAIlC,ECrEO,IAAMG,EAAW,CAQtB5D,IAAKkC,EAcL3D,IAAKT,EAUL+F,WAAYlF"}
|
|
@@ -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 width?: number | string;\n mainItem: ReactElement;\n after?: ReactElement | string;\n }[];\n gap?: number;\n flexLayoutStyle?: CSSProperties;\n hidden?: boolean;\n required?: boolean;\n colon?: boolean;\n};\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 >\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","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 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 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 >\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","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,IAC1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AAI,SAACrB,EAAMsB,GAC/C,OAAOf,EAAaP,EAAM,CAAEuB,IAAKD,UAK3C,ECpGO,IAAME,EAAgB,CAC3BC,gBAAiBhC,EACjBiC,KAAMnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.form-list-wrapper{background-color:#fff}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import './index.css';
|
|
3
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
+
import{_ as e}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{classNames as r}from"@dimjs/utils/cjs/class-names";import{ButtonWrapper as t}from"@flatbiz/antd";import{toArray as n,getUuid as a}from"@flatbiz/utils";import{Form as i,Empty as o}from"antd";import{useRef as l,Fragment as m}from"react";import{jsxs as d,jsx as u}from"react/jsx-runtime";var c=function e(r){if(r.wrapper)return r.wrapper({children:r.children});return r.children};var s=function s(p){var f=[].concat(p.prevCompleteName,n(p.name));var h=i.useFormInstance();var v=l([]);var g=p.uidFieldName||"uid";var w=i.useWatch(f,h);return d("div",{className:r("form-list-wrapper",p.className),style:p.style,children:[!p.hiddenEmptyRender&&!(w!=null&&w.length)?u(o,{image:o.PRESENTED_IMAGE_SIMPLE,style:{margin:"15px 0"}}):null,u(i.List,{name:p.name,children:function r(n,i){v.current=n;return u(c,{wrapper:p.formListChildrenWrapper,children:d(m,{children:[n.map((function(e,r){var t=[].concat(f,[e.name]);return u(m,{children:p.children({formListFieldData:e,operation:i,formStageCompleteName:t,prevCompleteName:f,index:r,getInsideFormItemName:function r(t){return[e.name,t]},getInsideFormItemData:function e(){return h.getFieldValue(t)},uidKey:g})},e.key)})),p.onCustomAddRowButton?p.onCustomAddRowButton(i):u(t,{hidden:p.hiddenAddRowButton,type:"dashed",block:true,onClick:function r(){var t;return i.add(e((t={},t[g]=a(),t),p.getAddRowDefaultValues==null?void 0:p.getAddRowDefaultValues()))},children:"添加"})]})})}})]})};export{s as FormListWrapper};
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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 { ButtonWrapper } from '@flatbiz/antd';\nimport { getUuid, toArray } from '@flatbiz/utils';\nimport { Empty, Form, type FormListFieldData } from 'antd';\nimport { Fragment, useRef, type ReactElement } from 'react';\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/**\n * FormList\n * ```\n * 1. FormList数组中必须要有唯一值字段,默认值字段名称uid,可通过uidFieldName自定义设置\n * 2. Demo: https://fex.qa.tcshuke.com/docs/admin/main/form/list\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 {!props.hiddenEmptyRender && !formListValue?.length ? (\n <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} style={{ margin: '15px 0' }} />\n ) : null}\n <Form.List name={props.name}>\n {(fields, operation) => {\n formListOperationRef.current = fields;\n return (\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({ [uidFieldName]: getUuid(), ...props.getAddRowDefaultValues?.() })\n }\n >\n 添加\n </ButtonWrapper>\n )}\n </Fragment>\n </FormListChildrenWrapper>\n );\n }}\n </Form.List>\n </div>\n );\n};\n"],"names":["FormListChildrenWrapper","props","wrapper","children","FormListWrapper","stageCompleteName","concat","prevCompleteName","toArray","name","form","Form","useFormInstance","formListOperationRef","useRef","uidFieldName","formListValue","useWatch","_jsxs","className","_classNames","style","hiddenEmptyRender","length","_jsx","Empty","image","PRESENTED_IMAGE_SIMPLE","margin","List","fields","operation","current","formListChildrenWrapper","Fragment","map","field","index","formStageCompleteName","formListFieldData","getInsideFormItemName","key","getInsideFormItemData","getFieldValue","uidKey","onCustomAddRowButton","ButtonWrapper","hidden","hiddenAddRowButton","type","block","onClick","_extends2","add","_extends","getUuid","getAddRowDefaultValues"],"mappings":";iWAWA,IAAMA,EAA0B,SAA1BA,EAA2BC,GAC/B,GAAIA,EAAMC,QAAS,OAAOD,EAAMC,QAAQ,CAAEC,SAAUF,EAAME,WAC1D,OAAOF,EAAME,QACf,MASaC,EAAkB,SAAlBA,EAAmBH,GAC9B,IAAMI,EAAiB,GAAAC,OAAOL,EAAMM,iBAAqBC,EAAQP,EAAMQ,OACvE,IAAMC,EAAOC,EAAKC,kBAClB,IAAMC,EAAuBC,EAA4B,IACzD,IAAMC,EAAed,EAAMc,cAAgB,MAC3C,IAAMC,EAAgBL,EAAKM,SAASZ,EAAmBK,GAEvD,OACEQ,EAAA,MAAA,CAAKC,UAAWC,EAAW,oBAAqBnB,EAAMkB,WAAYE,MAAOpB,EAAMoB,MAAMlB,SAClF,EAACF,EAAMqB,qBAAsBN,GAAa,MAAbA,EAAeO,QAC3CC,EAACC,EAAK,CAACC,MAAOD,EAAME,uBAAwBN,MAAO,CAAEO,OAAQ,YAC3D,KACJJ,EAACb,EAAKkB,KAAI,CAACpB,KAAMR,EAAMQ,KAAKN,SACzB,SAAAA,EAAC2B,EAAQC,GACRlB,EAAqBmB,QAAUF,EAC/B,OACEN,EAACxB,EAAuB,CAACE,QAASD,EAAMgC,wBAAwB9B,SAC9De,EAACgB,EAAQ,CAAA/B,SAAA,CACN2B,EAAOK,KAAI,SAACC,EAAOC,GAClB,IAAMC,KAAqBhC,OAAOD,EAAmB+B,CAAAA,EAAM3B,OAC3D,OACEe,EAACU,EAAQ,CAAA/B,SACNF,EAAME,SAAS,CACdoC,kBAAmBH,EACnBL,UAAWA,EACXO,sBAAAA,EACA/B,iBAAkBF,EAClBgC,MAAAA,EACAG,sBAAuB,SAAAA,EAACC,GACtB,MAAO,CAACL,EAAM3B,KAAMgC,EACrB,EACDC,sBAAuB,SAAAA,IACrB,OAAOhC,EAAKiC,cAAcL,EAC3B,EACDM,OAAQ7B,KAbGqB,EAAMK,IAiBzB,IACCxC,EAAM4C,qBACL5C,EAAM4C,qBAAqBd,GAE3BP,EAACsB,EAAa,CACZC,OAAQ9C,EAAM+C,mBACdC,KAAK,SACLC,MAAK,KACLC,QAAS,SAAAA,IAAA,IAAAC,EAAA,OACPrB,EAAUsB,IAAGC,GAAAF,EAAA,CAAA,EAAAA,EAAIrC,GAAewC,IAASH,GAAKnD,EAAMuD,wBAAsB,UAAA,EAA5BvD,EAAMuD,0BACrD,EAAArD,SACF,WAOX,MAIR"}
|
package/esm/index.js
CHANGED
|
@@ -31,6 +31,7 @@ import './dialog-drawer-content/index.css';
|
|
|
31
31
|
import './dialog-loading/index.css';
|
|
32
32
|
import './drag-collapse/index.css';
|
|
33
33
|
import './drag-collapse-form-list/index.css';
|
|
34
|
+
import './drag-form-list/index.css';
|
|
34
35
|
import './drawer-wrapper/index.css';
|
|
35
36
|
import './dynamic-node/index.css';
|
|
36
37
|
import './easy-table/index.css';
|
|
@@ -39,6 +40,7 @@ import './form-grid/index.css';
|
|
|
39
40
|
import './simple-layout/index.css';
|
|
40
41
|
import './table-scrollbar/index.css';
|
|
41
42
|
import './table-title-tooltip/index.css';
|
|
43
|
+
import './tips-wrapper/index.css';
|
|
42
44
|
import './editable-field/index.css';
|
|
43
45
|
import './icon-wrapper/index.css';
|
|
44
46
|
import './editable-field-provider/index.css';
|
|
@@ -54,6 +56,7 @@ import './file-select/index.css';
|
|
|
54
56
|
import './form-item-group/index.css';
|
|
55
57
|
import './form-item-hidden/index.css';
|
|
56
58
|
import './form-item-wrapper/index.css';
|
|
59
|
+
import './form-list-wrapper/index.css';
|
|
57
60
|
import './input-search-wrapper/index.css';
|
|
58
61
|
import './label-value-layout/index.css';
|
|
59
62
|
import './local-loading/index.css';
|
|
@@ -91,5 +94,5 @@ import './tree-selector-wrapper/index.css';
|
|
|
91
94
|
import './tree-wrapper/index.css';
|
|
92
95
|
import './index.css';
|
|
93
96
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
94
|
-
export{AmountFenInput}from"./amount-fen-input/index.js";export{AmountFenInputFormItem}from"./amount-fen-input-form-item/index.js";export{AnchorSteps}from"./anchor-steps/index.js";export{ButtonOperate,ButtonOperateItemContent}from"./button-operate/index.js";export{ButtonWrapper}from"./button-wrapper/index.js";export{CascaderWrapper}from"./cascader-wrapper/index.js";export{CheckList}from"./check-list/index.js";export{CheckboxWrapper}from"./checkbox-wrapper/index.js";export{ColorPickerWrapper}from"./color-picker-wrapper/index.js";export{ConfigProviderWrapper}from"./config-provider-wrapper/index.js";export{createDrawerWrapperModel}from"./create-drawer-wrapper-model/index.js";export{createModalWrapperModel}from"./create-modal-wrapper-model/index.js";export{CssNodeHover}from"./css-node-hover/index.js";export{DataRender}from"./data-render/index.js";export{DatePickerWrapper}from"./date-picker-wrapper/index.js";export{DateRangePickerWrapper}from"./date-range-picker-wrapper/index.js";export{DateRangePickerWrapperFormItem}from"./date-range-picker-wrapper-form-item/index.js";export{dialogAlert}from"./dialog-alert/index.js";export{dialogConfirm}from"./dialog-confirm/index.js";export{dialogDrawer}from"./dialog-drawer/index.js";export{DialogDrawerContent}from"./dialog-drawer-content/index.js";export{dialogLoading}from"./dialog-loading/index.js";export{dialogModal}from"./dialog-modal/index.js";export{DragCollapse}from"./drag-collapse/index.js";export{DragCollapseFormList}from"./drag-collapse-form-list/index.js";export{DrawerWrapper}from"./drawer-wrapper/index.js";export{DropdownMenuWrapper}from"./dropdown-menu-wrapper/index.js";export{dynamicNode}from"./dynamic-node/index.js";export{EasyTable}from"./easy-table/index.js";export{EditableField}from"./editable-field/index.js";export{EditableFieldProvider}from"./editable-field-provider/index.js";export{EditableTable}from"./editable-table/index.js";export{EditorWrapper}from"./editor-wrapper/index.js";export{FbaApp}from"./fba-app/index.js";export{fbaHooks}from"./fba-hooks/index.js";export{fbaUtils}from"./fba-utils/index.js";export{FileImport}from"./file-import/index.js";export{FileSelect}from"./file-select/index.js";export{FlexLayout}from"./flex-layout/index.js";export{FormGrid}from"./form-grid/index.js";export{FormItemGroup}from"./form-item-group/index.js";export{FormItemHidden}from"./form-item-hidden/index.js";export{FormItemWrapper}from"./form-item-wrapper/index.js";export{Gap}from"./gap/index.js";export{IconWrapper}from"./icon-wrapper/index.js";export{InputSearchWrapper}from"./input-search-wrapper/index.js";export{InputTextAreaWrapper}from"./input-text-area-wrapper/index.js";export{InputWrapper}from"./input-wrapper/index.js";export{LabelValueLayout}from"./label-value-layout/index.js";export{LocalLoading}from"./local-loading/index.js";export{ModalAction}from"./modal-action/index.js";export{ModalWrapper}from"./modal-wrapper/index.js";export{PageFixedFooter}from"./page-fixed-footer/index.js";export{Page404}from"./page404/index.js";export{P as PaginationWrapper}from"./index-e98b9352.js";export{Permission}from"./permission/index.js";export{preDefinedClassName}from"./pre-defined-class-name/index.js";export{RadioGroupWrapper}from"./radio-group-wrapper/index.js";export{RelationTree}from"./relation-tree/index.js";export{RequestStatus}from"./request-status/index.js";export{RichTextEditor}from"./rich-text-editor/index.js";export{RichTextViewer}from"./rich-text-viewer/index.js";export{RollLocationCenter}from"./roll-location-center/index.js";export{RollLocationInView}from"./roll-location-in-view/index.js";export{RuleDescribe}from"./rule-describe/index.js";export{SelectorWrapper}from"./selector-wrapper/index.js";export{SelectorWrapperSearch}from"./selector-wrapper-search/index.js";export{SelectorWrapperSimple}from"./selector-wrapper-simple/index.js";export{SimpleLayout}from"./simple-layout/index.js";export{SmsCountDown}from"./sms-count-down/index.js";export{styles}from"./styles/index.js";export{SwitchConfirmWrapper}from"./switch-confirm-wrapper/index.js";export{SwitchWrapper}from"./switch-wrapper/index.js";export{tableCellRender}from"./table-cell-render/index.js";export{TableScrollbar}from"./table-scrollbar/index.js";export{TableTitleTooltip}from"./table-title-tooltip/index.js";export{TabsWrapper}from"./tabs-wrapper/index.js";export{TagGroup}from"./tag-group/index.js";export{TagListSelect}from"./tag-list-select/index.js";export{TagWrapper}from"./tag-wrapper/index.js";export{TextCssEllipsis}from"./text-css-ellipsis/index.js";export{TextOverflowRender}from"./text-overflow-render/index.js";export{TimePickerWrapper}from"./time-picker-wrapper/index.js";export{TimeRangePickerWrapper}from"./time-range-picker-wrapper/index.js";export{TimeRangePickerWrapperFormItem}from"./time-range-picker-wrapper-form-item/index.js";export{TipsTitle}from"./tips-title/index.js";export{TreeSelectorWrapper}from"./tree-selector-wrapper/index.js";export{TreeWrapper}from"./tree-wrapper/index.js";export{UploadWrapper}from"./upload-wrapper/index.js";import"./_rollupPluginBabelHelpers-fc015ef2.js";import"@flatbiz/utils";import"antd";import"react/jsx-runtime";import"@dimjs/utils/cjs/class-names";import"react";import"@ant-design/icons/es/icons/MoreOutlined";import"@dimjs/lang/cjs/is-undefined";import"@dimjs/lang/cjs/is-plain-object";import"@dimjs/lang/cjs/is-string";import"@dimjs/lang/cjs/is-promise";import"@wove/react/cjs/hooks";import"@ant-design/icons/es/icons/LoadingOutlined";import"@ant-design/icons/es/icons/RedoOutlined";import"@dimjs/utils/cjs/extend";import"@dimjs/model";import"@dimjs/model-react";import"@wove/react/cjs/create-ctx";import"@ant-design/icons/es/icons/CloseCircleOutlined";import"@flatbiz/antd";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"./time-53b3f55f.js";import"@dimjs/lang/cjs/is-array";import"react-dom/client";import"./dom-4d04aa64.js";import"./context-1f2093c6.js";import"ahooks";import"@dimjs/utils/cjs/array";import"@dnd-kit/core";import"@dnd-kit/sortable";import"@ant-design/icons/es/icons/DragOutlined";import"@dnd-kit/utilities";import"@ant-design/icons/es/icons/SaveOutlined";import"@ant-design/icons/es/icons/ExclamationCircleFilled";import"@ant-design/icons/es/icons/DownOutlined";import"@ant-design/icons/es/icons/UpOutlined";import"react-is";import"@ant-design/icons/es/icons/CloseOutlined";import"@ant-design/icons/es/icons/CheckOutlined";import"@dimjs/lang/cjs/is-number";import"@ant-design/icons/es/icons/EditOutlined";import"./context-25d0b686.js";import"@ant-design/icons/es/icons/PlusOutlined";import"@dimjs/lang/cjs/is-boolean";import"@ant-design/icons/es/icons/DeleteOutlined";import"@wove/react/cjs/editor";import"./use-responsive-point-21b8c601.js";import"@dimjs/lang/cjs/is-deep-equal";import"@tinymce/tinymce-react";import"@ant-design/icons/es/icons/PlusCircleOutlined";import"@ant-design/icons/es/icons/FullscreenOutlined";import"@dimjs/utils/cjs/get";import"@dimjs/utils/cjs/json";import"pubsub-js";import"@dimjs/lang/cjs/is-object";import"@dimjs/lang/cjs/is-empty";import"@ant-design/icons/es/icons/QuestionCircleOutlined";import"dayjs/plugin/isSameOrAfter";import"dayjs/plugin/isSameOrBefore";import"@ant-design/icons/es/icons/CaretDownFilled";import"dequal";import"@dimjs/utils/cjs/tree";import"react-dom";
|
|
97
|
+
export{AmountFenInput}from"./amount-fen-input/index.js";export{AmountFenInputFormItem}from"./amount-fen-input-form-item/index.js";export{AnchorSteps}from"./anchor-steps/index.js";export{ButtonOperate,ButtonOperateItemContent}from"./button-operate/index.js";export{ButtonWrapper}from"./button-wrapper/index.js";export{CascaderWrapper}from"./cascader-wrapper/index.js";export{CheckList}from"./check-list/index.js";export{CheckboxWrapper}from"./checkbox-wrapper/index.js";export{ColorPickerWrapper}from"./color-picker-wrapper/index.js";export{ConfigProviderWrapper}from"./config-provider-wrapper/index.js";export{createDrawerWrapperModel}from"./create-drawer-wrapper-model/index.js";export{createModalWrapperModel}from"./create-modal-wrapper-model/index.js";export{CssNodeHover}from"./css-node-hover/index.js";export{DataRender}from"./data-render/index.js";export{DatePickerWrapper}from"./date-picker-wrapper/index.js";export{DateRangePickerWrapper}from"./date-range-picker-wrapper/index.js";export{DateRangePickerWrapperFormItem}from"./date-range-picker-wrapper-form-item/index.js";export{dialogAlert}from"./dialog-alert/index.js";export{dialogConfirm}from"./dialog-confirm/index.js";export{dialogDrawer}from"./dialog-drawer/index.js";export{DialogDrawerContent}from"./dialog-drawer-content/index.js";export{dialogLoading}from"./dialog-loading/index.js";export{dialogModal}from"./dialog-modal/index.js";export{DragCollapse}from"./drag-collapse/index.js";export{DragCollapseFormList}from"./drag-collapse-form-list/index.js";export{DragFormList}from"./drag-form-list/index.js";export{DrawerWrapper}from"./drawer-wrapper/index.js";export{DropdownMenuWrapper}from"./dropdown-menu-wrapper/index.js";export{dynamicNode}from"./dynamic-node/index.js";export{EasyTable}from"./easy-table/index.js";export{EditableField}from"./editable-field/index.js";export{EditableFieldProvider}from"./editable-field-provider/index.js";export{EditableTable}from"./editable-table/index.js";export{EditorWrapper}from"./editor-wrapper/index.js";export{FbaApp}from"./fba-app/index.js";export{fbaHooks}from"./fba-hooks/index.js";export{fbaUtils}from"./fba-utils/index.js";export{FileImport}from"./file-import/index.js";export{FileSelect}from"./file-select/index.js";export{FlexLayout}from"./flex-layout/index.js";export{FormGrid}from"./form-grid/index.js";export{FormItemGroup}from"./form-item-group/index.js";export{FormItemHidden}from"./form-item-hidden/index.js";export{FormItemWrapper}from"./form-item-wrapper/index.js";export{FormListWrapper}from"./form-list-wrapper/index.js";export{Gap}from"./gap/index.js";export{IconWrapper}from"./icon-wrapper/index.js";export{InputSearchWrapper}from"./input-search-wrapper/index.js";export{InputTextAreaWrapper}from"./input-text-area-wrapper/index.js";export{InputWrapper}from"./input-wrapper/index.js";export{LabelValueLayout}from"./label-value-layout/index.js";export{LocalLoading}from"./local-loading/index.js";export{ModalAction}from"./modal-action/index.js";export{ModalWrapper}from"./modal-wrapper/index.js";export{PageFixedFooter}from"./page-fixed-footer/index.js";export{Page404}from"./page404/index.js";export{P as PaginationWrapper}from"./index-e98b9352.js";export{Permission}from"./permission/index.js";export{preDefinedClassName}from"./pre-defined-class-name/index.js";export{RadioGroupWrapper}from"./radio-group-wrapper/index.js";export{RelationTree}from"./relation-tree/index.js";export{RequestStatus}from"./request-status/index.js";export{RichTextEditor}from"./rich-text-editor/index.js";export{RichTextViewer}from"./rich-text-viewer/index.js";export{RollLocationCenter}from"./roll-location-center/index.js";export{RollLocationInView}from"./roll-location-in-view/index.js";export{RuleDescribe}from"./rule-describe/index.js";export{SelectorWrapper}from"./selector-wrapper/index.js";export{SelectorWrapperSearch}from"./selector-wrapper-search/index.js";export{SelectorWrapperSimple}from"./selector-wrapper-simple/index.js";export{SimpleLayout}from"./simple-layout/index.js";export{SmsCountDown}from"./sms-count-down/index.js";export{styles}from"./styles/index.js";export{SwitchConfirmWrapper}from"./switch-confirm-wrapper/index.js";export{SwitchWrapper}from"./switch-wrapper/index.js";export{tableCellRender}from"./table-cell-render/index.js";export{TableScrollbar}from"./table-scrollbar/index.js";export{TableTitleTooltip}from"./table-title-tooltip/index.js";export{TabsWrapper}from"./tabs-wrapper/index.js";export{TagGroup}from"./tag-group/index.js";export{TagListSelect}from"./tag-list-select/index.js";export{TagWrapper}from"./tag-wrapper/index.js";export{TextCssEllipsis}from"./text-css-ellipsis/index.js";export{TextOverflowRender}from"./text-overflow-render/index.js";export{TimePickerWrapper}from"./time-picker-wrapper/index.js";export{TimeRangePickerWrapper}from"./time-range-picker-wrapper/index.js";export{TimeRangePickerWrapperFormItem}from"./time-range-picker-wrapper-form-item/index.js";export{TipsTitle}from"./tips-title/index.js";export{TipsWrapper}from"./tips-wrapper/index.js";export{TreeSelectorWrapper}from"./tree-selector-wrapper/index.js";export{TreeWrapper}from"./tree-wrapper/index.js";export{UploadWrapper}from"./upload-wrapper/index.js";import"./_rollupPluginBabelHelpers-fc015ef2.js";import"@flatbiz/utils";import"antd";import"react/jsx-runtime";import"@dimjs/utils/cjs/class-names";import"react";import"@ant-design/icons/es/icons/MoreOutlined";import"@dimjs/lang/cjs/is-undefined";import"@dimjs/lang/cjs/is-plain-object";import"@dimjs/lang/cjs/is-string";import"@dimjs/lang/cjs/is-promise";import"@wove/react/cjs/hooks";import"@ant-design/icons/es/icons/LoadingOutlined";import"@ant-design/icons/es/icons/RedoOutlined";import"@dimjs/utils/cjs/extend";import"@dimjs/model";import"@dimjs/model-react";import"@wove/react/cjs/create-ctx";import"@ant-design/icons/es/icons/CloseCircleOutlined";import"@flatbiz/antd";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"./time-53b3f55f.js";import"@dimjs/lang/cjs/is-array";import"react-dom/client";import"./dom-4d04aa64.js";import"./context-1f2093c6.js";import"ahooks";import"@dimjs/utils/cjs/array";import"@dnd-kit/core";import"@dnd-kit/sortable";import"@ant-design/icons/es/icons/DragOutlined";import"@dnd-kit/utilities";import"@ant-design/icons/es/icons/SaveOutlined";import"@ant-design/icons/es/icons/ExclamationCircleFilled";import"@ant-design/icons/es/icons/DownOutlined";import"@ant-design/icons/es/icons/UpOutlined";import"react-is";import"@ant-design/icons/es/icons/CloseOutlined";import"@ant-design/icons/es/icons/CheckOutlined";import"@dimjs/lang/cjs/is-number";import"@ant-design/icons/es/icons/EditOutlined";import"./context-25d0b686.js";import"@ant-design/icons/es/icons/PlusOutlined";import"@dimjs/lang/cjs/is-boolean";import"@ant-design/icons/es/icons/DeleteOutlined";import"@wove/react/cjs/editor";import"./use-responsive-point-21b8c601.js";import"@dimjs/lang/cjs/is-deep-equal";import"@tinymce/tinymce-react";import"@ant-design/icons/es/icons/PlusCircleOutlined";import"@ant-design/icons/es/icons/FullscreenOutlined";import"@dimjs/utils/cjs/get";import"@dimjs/utils/cjs/json";import"pubsub-js";import"@dimjs/lang/cjs/is-object";import"@dimjs/lang/cjs/is-empty";import"@ant-design/icons/es/icons/QuestionCircleOutlined";import"dayjs/plugin/isSameOrAfter";import"dayjs/plugin/isSameOrBefore";import"@ant-design/icons/es/icons/CaretDownFilled";import"dequal";import"@dimjs/utils/cjs/tree";import"react-dom";
|
|
95
98
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
import{
|
|
4
|
+
import{classNames as r}from"@dimjs/utils/cjs/class-names";import{_ as e}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{getUuid as l}from"@flatbiz/utils";import{Descriptions as t}from"antd";import{useMemo as a}from"react";import{jsx as o}from"react/jsx-runtime";var n=function n(i){var u=i.labelWidth==="auto"?"auto":(i.labelWidth||120)+"px";var m=e({"--v-label-value-layout-lWidth":u},i.style);var s=r("v-label-value-layout",i.className);var p=a((function(){return i.options.filter((function(r){return!r.hidden}))}),[i.options]);p=p.map((function(r){return e({key:l()},r)}));return o(t,{column:i.column||1,bordered:i.bordered,size:"small",className:s,style:m,children:p.map((function(r){return o(t.Item,{label:r.label,span:r.span,children:r.value},r.key)}))})};export{n as LabelValueLayout};
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/label-value-layout/label-value-layout.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { getUuid } from '@flatbiz/utils';\nimport { Descriptions } from 'antd';\nimport { CSSProperties, ReactElement, useMemo } from 'react';\nimport './style.less';\n\nexport type LabelValueLayoutProps = {\n options: {\n key?: string | number;\n label: string | ReactElement;\n value?: string | number | ReactElement;\n span?: number;\n hidden?: boolean;\n }[];\n labelWidth?: number | 'auto';\n // 一行占几组,默认1\n column?: number;\n bordered?: boolean;\n className?: string;\n};\n\n/**\n * options[].span 是 Description.Item 的数量。 span={2} 会占用两个 DescriptionItem 的宽度\n * options[].hidden 是否隐藏 Description.Item\n */\nexport const LabelValueLayout = (props: LabelValueLayoutProps) => {\n const labelWidth = props.labelWidth === 'auto' ? 'auto' : `${props.labelWidth || 120}px`;\n const style = { '--v-label-value-layout-lWidth': labelWidth } as CSSProperties;\n const className = classNames('v-label-value-layout', props.className);\n\n let options = useMemo(() => {\n return props.options.filter((item) => !item.hidden);\n }, [props.options]);\n\n options = options.map((item) => {\n return { key: getUuid(), ...item };\n });\n\n return (\n <Descriptions\n column={props.column || 1}\n bordered={props.bordered}\n size=\"small\"\n className={className}\n style={style}\n >\n {options.map((item) => {\n return (\n <Descriptions.Item key={item.key} label={item.label} span={item.span}>\n {item.value}\n </Descriptions.Item>\n );\n })}\n </Descriptions>\n );\n};\n"],"names":["LabelValueLayout","props","labelWidth","style","className","_classNames","options","useMemo","filter","item","hidden","map","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/label-value-layout/label-value-layout.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { getUuid } from '@flatbiz/utils';\nimport { Descriptions } from 'antd';\nimport { CSSProperties, ReactElement, useMemo } from 'react';\nimport './style.less';\n\nexport type LabelValueLayoutProps = {\n options: {\n key?: string | number;\n label: string | ReactElement;\n value?: string | number | ReactElement;\n span?: number;\n hidden?: boolean;\n }[];\n labelWidth?: number | 'auto';\n // 一行占几组,默认1\n column?: number;\n bordered?: boolean;\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * options[].span 是 Description.Item 的数量。 span={2} 会占用两个 DescriptionItem 的宽度\n * options[].hidden 是否隐藏 Description.Item\n */\nexport const LabelValueLayout = (props: LabelValueLayoutProps) => {\n const labelWidth = props.labelWidth === 'auto' ? 'auto' : `${props.labelWidth || 120}px`;\n const style = { '--v-label-value-layout-lWidth': labelWidth, ...props.style } as CSSProperties;\n const className = classNames('v-label-value-layout', props.className);\n\n let options = useMemo(() => {\n return props.options.filter((item) => !item.hidden);\n }, [props.options]);\n\n options = options.map((item) => {\n return { key: getUuid(), ...item };\n });\n\n return (\n <Descriptions\n column={props.column || 1}\n bordered={props.bordered}\n size=\"small\"\n className={className}\n style={style}\n >\n {options.map((item) => {\n return (\n <Descriptions.Item key={item.key} label={item.label} span={item.span}>\n {item.value}\n </Descriptions.Item>\n );\n })}\n </Descriptions>\n );\n};\n"],"names":["LabelValueLayout","props","labelWidth","style","_extends","className","_classNames","options","useMemo","filter","item","hidden","map","key","getUuid","_jsx","Descriptions","column","bordered","size","children","Item","label","span","value"],"mappings":";gRA0BaA,EAAmB,SAAnBA,EAAoBC,GAC/B,IAAMC,EAAaD,EAAMC,aAAe,OAAS,QAAYD,EAAMC,YAAc,KAAO,KACxF,IAAMC,EAAKC,EAAA,CAAK,gCAAiCF,GAAeD,EAAME,OACtE,IAAME,EAAYC,EAAW,uBAAwBL,EAAMI,WAE3D,IAAIE,EAAUC,GAAQ,WACpB,OAAOP,EAAMM,QAAQE,QAAO,SAACC,GAAI,OAAMA,EAAKC,SAC9C,GAAG,CAACV,EAAMM,UAEVA,EAAUA,EAAQK,KAAI,SAACF,GACrB,OAAAN,EAAA,CAASS,IAAKC,KAAcJ,EAC9B,IAEA,OACEK,EAACC,EAAY,CACXC,OAAQhB,EAAMgB,QAAU,EACxBC,SAAUjB,EAAMiB,SAChBC,KAAK,QACLd,UAAWA,EACXF,MAAOA,EAAMiB,SAEZb,EAAQK,KAAI,SAACF,GACZ,OACEK,EAACC,EAAaK,KAAI,CAAgBC,MAAOZ,EAAKY,MAAOC,KAAMb,EAAKa,KAAKH,SAClEV,EAAKc,OADgBd,EAAKG,SAOvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-item-label-70.ant-form-item .ant-form-item-label{width:70px!important}.form-item-label-80.ant-form-item .ant-form-item-label{width:80px!important}.form-item-label-90.ant-form-item .ant-form-item-label{width:90px!important}.form-item-label-100.ant-form-item .ant-form-item-label{width:100px!important}.form-item-label-110.ant-form-item .ant-form-item-label{width:110px!important}.form-item-label-120.ant-form-item .ant-form-item-label{width:120px!important}.form-item-label-130.ant-form-item .ant-form-item-label{width:130px!important}.form-item-label-140.ant-form-item .ant-form-item-label{width:140px!important}.form-item-label-150.ant-form-item .ant-form-item-label{width:150px!important}.form-item-label-160.ant-form-item .ant-form-item-label{width:160px!important}.form-item-label-170.ant-form-item .ant-form-item-label{width:170px!important}.form-item-label-180.ant-form-item .ant-form-item-label{width:180px!important}.form-item-label-190.ant-form-item .ant-form-item-label{width:190px!important}.form-item-label-200.ant-form-item .ant-form-item-label{width:200px!important}.form-item-label-auto.ant-form-item .ant-form-item-label{width:auto!important}.form-item-label-align-left .ant-form-item-label{text-align:left}.form-item-label-align-right .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%!important}.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!important}.form-label-80 .ant-form-item-label{width:80px!important}.form-label-90 .ant-form-item-label{width:90px!important}.form-label-100 .ant-form-item-label{width:100px!important}.form-label-110 .ant-form-item-label{width:110px!important}.form-label-120 .ant-form-item-label{width:120px!important}.form-label-130 .ant-form-item-label{width:130px!important}.form-label-140 .ant-form-item-label{width:140px!important}.form-label-150 .ant-form-item-label{width:150px!important}.form-label-160 .ant-form-item-label{width:160px!important}.form-label-170 .ant-form-item-label{width:170px!important}.form-label-180 .ant-form-item-label{width:180px!important}.form-label-190 .ant-form-item-label{width:190px!important}.form-label-200 .ant-form-item-label{width:200px!important}.form-label-auto .ant-form-item-label{width:auto!important}.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 .ant-form-item-row{flex-direction:column}.form-label-value-vertical .ant-form-item .ant-form-item-label{text-align:left;width:100%}.form-label-value-vertical .ant-form-item .ant-form-item-control{flex:initial}.form-formitem-gap-15{margin-bottom:-15px}.form-formitem-gap-15 .ant-form-item{margin:0 0 15px}.form-formitem-gap-8{margin-bottom:-8px}.form-formitem-gap-8 .ant-form-item{margin:0 0 8px}
|
|
1
|
+
.form-item-label-70.ant-form-item .ant-form-item-label{width:70px!important}.form-item-label-80.ant-form-item .ant-form-item-label{width:80px!important}.form-item-label-90.ant-form-item .ant-form-item-label{width:90px!important}.form-item-label-100.ant-form-item .ant-form-item-label{width:100px!important}.form-item-label-110.ant-form-item .ant-form-item-label{width:110px!important}.form-item-label-120.ant-form-item .ant-form-item-label{width:120px!important}.form-item-label-130.ant-form-item .ant-form-item-label{width:130px!important}.form-item-label-140.ant-form-item .ant-form-item-label{width:140px!important}.form-item-label-150.ant-form-item .ant-form-item-label{width:150px!important}.form-item-label-160.ant-form-item .ant-form-item-label{width:160px!important}.form-item-label-170.ant-form-item .ant-form-item-label{width:170px!important}.form-item-label-180.ant-form-item .ant-form-item-label{width:180px!important}.form-item-label-190.ant-form-item .ant-form-item-label{width:190px!important}.form-item-label-200.ant-form-item .ant-form-item-label{width:200px!important}.form-item-label-auto.ant-form-item .ant-form-item-label{width:auto!important}.form-item-label-align-left .ant-form-item-label{text-align:left}.form-item-label-align-right .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%!important}.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!important}.form-label-80 .ant-form-item-label{width:80px!important}.form-label-90 .ant-form-item-label{width:90px!important}.form-label-100 .ant-form-item-label{width:100px!important}.form-label-110 .ant-form-item-label{width:110px!important}.form-label-120 .ant-form-item-label{width:120px!important}.form-label-130 .ant-form-item-label{width:130px!important}.form-label-140 .ant-form-item-label{width:140px!important}.form-label-150 .ant-form-item-label{width:150px!important}.form-label-160 .ant-form-item-label{width:160px!important}.form-label-170 .ant-form-item-label{width:170px!important}.form-label-180 .ant-form-item-label{width:180px!important}.form-label-190 .ant-form-item-label{width:190px!important}.form-label-200 .ant-form-item-label{width:200px!important}.form-label-auto .ant-form-item-label{width:auto!important}.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 .ant-form-item-row{flex-direction:column}.form-label-value-vertical .ant-form-item .ant-form-item-label{text-align:left;width:100%}.form-label-value-vertical .ant-form-item .ant-form-item-control{flex:initial}.form-formitem-gap-15{margin-bottom:-15px}.form-formitem-gap-15 .ant-form-item{margin:0 0 15px}.form-formitem-gap-8{margin-bottom:-8px}.form-formitem-gap-8 .ant-form-item{margin:0 0 8px}.form-formitem-gap-5{margin-bottom:-5px}.form-formitem-gap-5 .ant-form-item{margin:0 0 5px}.form-formitem-gap-0{margin-bottom:0}.form-formitem-gap-0 .ant-form-item{margin:0}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
var l={label_width_70:"form-label-70",label_width_80:"form-label-80",label_width_90:"form-label-90",label_width_100:"form-label-100",label_width_110:"form-label-110",label_width_120:"form-label-120",label_width_130:"form-label-130",label_width_140:"form-label-140",label_width_150:"form-label-150",label_width_160:"form-label-160",label_width_170:"form-label-170",label_width_180:"form-label-180",label_width_190:"form-label-190",label_width_200:"form-label-200",label_width_auto:"form-label-auto",label_align_left:"form-label-align-left",label_align_right:"form-label-align-right",label_value_vertical:"form-label-value-vertical",formItemGap15:"form-formitem-gap-15",formItemGap8:"form-formitem-gap-8"};var e={label_width_70:"form-item-label-70",label_width_80:"form-item-label-80",label_width_90:"form-item-label-90",label_width_100:"form-item-label-100",label_width_110:"form-item-label-110",label_width_120:"form-item-label-120",label_width_130:"form-item-label-130",label_width_140:"form-item-label-140",label_width_150:"form-item-label-150",label_width_160:"form-item-label-160",label_width_170:"form-item-label-170",label_width_180:"form-item-label-180",label_width_190:"form-item-label-190",label_width_200:"form-item-label-200",label_width_auto:"form-item-label-auto",label_align_left:"form-item-label-align-left",label_align_right:"form-item-label-align-right",label_value_vertical:"form-item-label-value-vertical"};var a={form:l,formItem:e};export{a as preDefinedClassName};
|
|
4
|
+
var l={label_width_70:"form-label-70",label_width_80:"form-label-80",label_width_90:"form-label-90",label_width_100:"form-label-100",label_width_110:"form-label-110",label_width_120:"form-label-120",label_width_130:"form-label-130",label_width_140:"form-label-140",label_width_150:"form-label-150",label_width_160:"form-label-160",label_width_170:"form-label-170",label_width_180:"form-label-180",label_width_190:"form-label-190",label_width_200:"form-label-200",label_width_auto:"form-label-auto",label_align_left:"form-label-align-left",label_align_right:"form-label-align-right",label_value_vertical:"form-label-value-vertical",formItemGap15:"form-formitem-gap-15",formItemGap8:"form-formitem-gap-8",formItemGap5:"form-formitem-gap-5",formItemGap0:"form-formitem-gap-0"};var e={label_width_70:"form-item-label-70",label_width_80:"form-item-label-80",label_width_90:"form-item-label-90",label_width_100:"form-item-label-100",label_width_110:"form-item-label-110",label_width_120:"form-item-label-120",label_width_130:"form-item-label-130",label_width_140:"form-item-label-140",label_width_150:"form-item-label-150",label_width_160:"form-item-label-160",label_width_170:"form-item-label-170",label_width_180:"form-item-label-180",label_width_190:"form-item-label-190",label_width_200:"form-item-label-200",label_width_auto:"form-item-label-auto",label_align_left:"form-item-label-align-left",label_align_right:"form-item-label-align-right",label_value_vertical:"form-item-label-value-vertical"};var a={form:l,formItem:e};export{a as preDefinedClassName};
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/pre-defined-class-name/form/index.tsx","@flatbiz/antd/src/pre-defined-class-name/index.ts"],"sourcesContent":["import './style.less';\n/**\n * 使用在Form组件上,预定义form-item label宽度\n */\nexport const formClassName = {\n label_width_70: 'form-label-70',\n label_width_80: 'form-label-80',\n label_width_90: 'form-label-90',\n label_width_100: 'form-label-100',\n label_width_110: 'form-label-110',\n label_width_120: 'form-label-120',\n label_width_130: 'form-label-130',\n label_width_140: 'form-label-140',\n label_width_150: 'form-label-150',\n label_width_160: 'form-label-160',\n label_width_170: 'form-label-170',\n label_width_180: 'form-label-180',\n label_width_190: 'form-label-190',\n label_width_200: 'form-label-200',\n label_width_auto: 'form-label-auto',\n label_align_left: 'form-label-align-left',\n label_align_right: 'form-label-align-right',\n label_value_vertical: 'form-label-value-vertical',\n /** formItem之间的垂直间距为15 */\n formItemGap15: 'form-formitem-gap-15',\n /** formItem之间的垂直间距为8 */\n formItemGap8: 'form-formitem-gap-8',\n};\n/**\n * 使用在Form.Item组件上,预定义form-item label宽度\n */\nexport const formItemClassName = {\n label_width_70: 'form-item-label-70',\n label_width_80: 'form-item-label-80',\n label_width_90: 'form-item-label-90',\n label_width_100: 'form-item-label-100',\n label_width_110: 'form-item-label-110',\n label_width_120: 'form-item-label-120',\n label_width_130: 'form-item-label-130',\n label_width_140: 'form-item-label-140',\n label_width_150: 'form-item-label-150',\n label_width_160: 'form-item-label-160',\n label_width_170: 'form-item-label-170',\n label_width_180: 'form-item-label-180',\n label_width_190: 'form-item-label-190',\n label_width_200: 'form-item-label-200',\n label_width_auto: 'form-item-label-auto',\n label_align_left: 'form-item-label-align-left',\n label_align_right: 'form-item-label-align-right',\n label_value_vertical: 'form-item-label-value-vertical',\n};\n","import { formClassName, formItemClassName } from './form';\n\n/**\n * 预定义className\n * ```\n * form: 使用在Form组件上,设置form-item label宽度\n * formItem: 使用在Form.Item组件上,设置form-item label宽度\n * ```\n */\nexport const preDefinedClassName = {\n form: formClassName,\n formItem: formItemClassName,\n};\n"],"names":["formClassName","label_width_70","label_width_80","label_width_90","label_width_100","label_width_110","label_width_120","label_width_130","label_width_140","label_width_150","label_width_160","label_width_170","label_width_180","label_width_190","label_width_200","label_width_auto","label_align_left","label_align_right","label_value_vertical","formItemGap15","formItemGap8","formItemClassName","preDefinedClassName","form","formItem"],"mappings":";AAIO,IAAMA,EAAgB,CAC3BC,eAAgB,gBAChBC,eAAgB,gBAChBC,eAAgB,gBAChBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,iBAAkB,kBAClBC,iBAAkB,wBAClBC,kBAAmB,yBACnBC,qBAAsB,4BAEtBC,cAAe,uBAEfC,aAAc,uBAKT,IAAMC,EAAoB,CAC/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/pre-defined-class-name/form/index.tsx","@flatbiz/antd/src/pre-defined-class-name/index.ts"],"sourcesContent":["import './style.less';\n/**\n * 使用在Form组件上,预定义form-item label宽度\n */\nexport const formClassName = {\n label_width_70: 'form-label-70',\n label_width_80: 'form-label-80',\n label_width_90: 'form-label-90',\n label_width_100: 'form-label-100',\n label_width_110: 'form-label-110',\n label_width_120: 'form-label-120',\n label_width_130: 'form-label-130',\n label_width_140: 'form-label-140',\n label_width_150: 'form-label-150',\n label_width_160: 'form-label-160',\n label_width_170: 'form-label-170',\n label_width_180: 'form-label-180',\n label_width_190: 'form-label-190',\n label_width_200: 'form-label-200',\n label_width_auto: 'form-label-auto',\n label_align_left: 'form-label-align-left',\n label_align_right: 'form-label-align-right',\n label_value_vertical: 'form-label-value-vertical',\n /** formItem之间的垂直间距为15 */\n formItemGap15: 'form-formitem-gap-15',\n /** formItem之间的垂直间距为8 */\n formItemGap8: 'form-formitem-gap-8',\n /** formItem之间的垂直间距为8 */\n formItemGap5: 'form-formitem-gap-5',\n /** formItem之间的垂直间距为0 */\n formItemGap0: 'form-formitem-gap-0',\n};\n/**\n * 使用在Form.Item组件上,预定义form-item label宽度\n */\nexport const formItemClassName = {\n label_width_70: 'form-item-label-70',\n label_width_80: 'form-item-label-80',\n label_width_90: 'form-item-label-90',\n label_width_100: 'form-item-label-100',\n label_width_110: 'form-item-label-110',\n label_width_120: 'form-item-label-120',\n label_width_130: 'form-item-label-130',\n label_width_140: 'form-item-label-140',\n label_width_150: 'form-item-label-150',\n label_width_160: 'form-item-label-160',\n label_width_170: 'form-item-label-170',\n label_width_180: 'form-item-label-180',\n label_width_190: 'form-item-label-190',\n label_width_200: 'form-item-label-200',\n label_width_auto: 'form-item-label-auto',\n label_align_left: 'form-item-label-align-left',\n label_align_right: 'form-item-label-align-right',\n label_value_vertical: 'form-item-label-value-vertical',\n};\n","import { formClassName, formItemClassName } from './form';\n\n/**\n * 预定义className\n * ```\n * form: 使用在Form组件上,设置form-item label宽度\n * formItem: 使用在Form.Item组件上,设置form-item label宽度\n * ```\n */\nexport const preDefinedClassName = {\n form: formClassName,\n formItem: formItemClassName,\n};\n"],"names":["formClassName","label_width_70","label_width_80","label_width_90","label_width_100","label_width_110","label_width_120","label_width_130","label_width_140","label_width_150","label_width_160","label_width_170","label_width_180","label_width_190","label_width_200","label_width_auto","label_align_left","label_align_right","label_value_vertical","formItemGap15","formItemGap8","formItemGap5","formItemGap0","formItemClassName","preDefinedClassName","form","formItem"],"mappings":";AAIO,IAAMA,EAAgB,CAC3BC,eAAgB,gBAChBC,eAAgB,gBAChBC,eAAgB,gBAChBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,gBAAiB,iBACjBC,iBAAkB,kBAClBC,iBAAkB,wBAClBC,kBAAmB,yBACnBC,qBAAsB,4BAEtBC,cAAe,uBAEfC,aAAc,sBAEdC,aAAc,sBAEdC,aAAc,uBAKT,IAAMC,EAAoB,CAC/BtB,eAAgB,qBAChBC,eAAgB,qBAChBC,eAAgB,qBAChBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,gBAAiB,sBACjBC,iBAAkB,uBAClBC,iBAAkB,6BAClBC,kBAAmB,8BACnBC,qBAAsB,kCC5CjB,IAAMM,EAAsB,CACjCC,KAAMzB,EACN0B,SAAUH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.simple-layout{background-color:#fff;border-radius:6px;padding:15px}.simple-layout
|
|
1
|
+
.simple-layout{background-color:#fff;border-radius:6px;padding:15px}.simple-layout>.ant-form{margin-bottom:-15px}.simple-layout>.ant-form .ant-form-item{margin:0 0 15px}.simple-layout>.ant-form .ant-form-item-label{width:82px}.simple-layout>.ant-form .ant-form-item-label.ant-col-auto{width:auto}.simple-layout .ant-table-thead>tr>th{background:#f6f6f6}.simple-layout .ant-descriptions-item{padding-bottom:10px}.simple-layout .ant-descriptions-item-label{color:#999}.simple-layout .ant-table-pagination.ant-pagination{margin:16px 0 0}.simple-layout .simple-layout-content{position:relative}.simple-layout .simple-layout-content>.ant-row:last-child{margin-bottom:0}.simple-layout .simple-layout-content>.ant-row:last-child .ant-upload-list{padding-bottom:15px}.simple-layout .simple-layout-content>.ant-descriptions:not(.ant-descriptions-bordered):last-child{margin-bottom:-10px}.simple-layout .v-tree-wrapper-tree{padding:5px 0 0}.simple-layout-title-sign{padding-left:10px;position:relative}.simple-layout-title-sign:before{background:var(--simple-layout-colorPrimary);border-radius:3px;content:"";height:14px;left:0;margin-top:-7px;position:absolute;top:50%;width:3px}.simple-layout-title{color:rgba(0,0,0,.85);font-size:16px;font-weight:500;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.simple-layout-title+.simple-layout-content,.simple-layout-title-sign+.simple-layout-content{margin-top:10px}.simple-layout-desc{color:rgba(0,0,0,.55);font-size:12px}.simple-layout+.simple-layout,.simple-layout-desc+.simple-layout-content{margin-top:10px}.simple-layout+.ant-divider{margin:0 0 15px}.simple-layout-formlabel-left .ant-form-item-label{text-align:left}.simple-layout-tight.simple-layout{margin-top:0;padding:0}.simple-layout-title-extra-space{justify-content:space-between;width:100%}.simple-layout-title-fixed{display:flex;flex-direction:column;height:100%;overflow:hidden}.simple-layout-title-fixed>.simple-layout-content{flex:1;overflow-y:auto}.simple-layout-small.simple-layout{padding:8px 15px}.simple-layout-small.simple-layout>.ant-form{margin-bottom:-8px}.simple-layout-small.simple-layout>.ant-form .ant-form-item{margin:0 0 8px}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './../fba-hooks/index.css';
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
|
-
import{a as e,_ as r}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{hooks as n}from"@wove/react/cjs/hooks";import{message as o,Popconfirm as t,Switch as i}from"antd";import{
|
|
5
|
+
import{a as e,_ as r}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{hooks as n}from"@wove/react/cjs/hooks";import{message as o,Popconfirm as t,Switch as i}from"antd";import{useMemo as u,useState as s}from"react";import{fbaHooks as l}from"../fba-hooks/index.js";import{jsx as a}from"react/jsx-runtime";import"@dimjs/lang/cjs/is-array";import"../use-responsive-point-21b8c601.js";var c=["popConfirmProps","needConfirm","checkedValue","unCheckedValue","onChange","value","serviceConfig","noMessage"];var f=function f(d){var v=d.popConfirmProps,m=d.needConfirm,h=d.checkedValue,p=d.unCheckedValue,g=d.onChange,C=d.value,k=d.serviceConfig,b=d.noMessage,j=e(d,c);var y=u((function(){if(typeof v==="function"){return v(C===h)}return v}),[h,v,C]);var P=s(false),V=P[0],x=P[1];var R=s(false),q=R[0],w=R[1];l.useEffectCustom((function(){x(C===h)}),[d.value]);var B=u((function(){return m==="close"&&V||m==="open"&&!V||!m||m==="all"}),[V,m]);var E=n.useCallbackRef((function(){return new Promise((function(e,r){var n,t,i;n=!V?h:p;if(k!=null&&k.onRequest){var u=function(e){return function(n){try{w(false);return e&&e.call(this,n)}catch(e){return r(e)}}.bind(this)}.bind(this);var s=function(){try{return a.call(this)}catch(e){return r(e)}}.bind(this);var l=function(e){try{if(!b){void o.error((e==null?void 0:e.message)||(k==null||(i=k.message)==null?void 0:i.defaultError)||"状态修改失败!")}return u(s)()}catch(e){return u(r)(e)}};try{w(true);return Promise.resolve(k.onRequest(n)).then((function(e){try{x(!V);g==null?void 0:g(n);if(!b){void o.success((k==null||(t=k.message)==null?void 0:t.success)||"状态修改成功!")}return u(s)()}catch(e){return l(e)}}),l)}catch(e){l(e)}}else{x(!V);g==null?void 0:g(n);return a.call(this)}function a(){return e()}}))}));if(B){return a(t,{disabled:y==null?void 0:y.disabled,okButtonProps:{loading:q},title:y==null?void 0:y.title,description:y==null?void 0:y.description,onConfirm:E,children:a(i,r({checked:V},j))})}return a(i,r({checked:V,loading:q},j,{onChange:E}))};export{f as SwitchConfirmWrapper};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/switch-confirm-wrapper/switch-confirm-wrapper.tsx"],"sourcesContent":["import { TAny } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { message, Popconfirm, PopconfirmProps, Switch, SwitchProps } from 'antd';\nimport { useMemo, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\n\nexport type SwitchConfirmWrapperValue = string | number | boolean;\nexport type SwitchConfirmWrapperProps = Omit<SwitchProps, 'defaultChecked' | 'onChange'> & {\n value?: SwitchConfirmWrapperValue;\n checkedValue: SwitchConfirmWrapperValue;\n unCheckedValue: SwitchConfirmWrapperValue;\n needConfirm?: 'close' | 'open' | 'all' | 'none';\n noMessage?: boolean;\n onChange?: (value: SwitchConfirmWrapperValue) => void;\n popConfirmProps?: Pick<PopconfirmProps, 'disabled' | 'title' | 'description'
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/switch-confirm-wrapper/switch-confirm-wrapper.tsx"],"sourcesContent":["import { TAny } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { message, Popconfirm, PopconfirmProps, Switch, SwitchProps } from 'antd';\nimport { useMemo, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\n\nexport type SwitchConfirmWrapperValue = string | number | boolean;\nexport type SwitchConfirmWrapperProps = Omit<SwitchProps, 'defaultChecked' | 'onChange'> & {\n value?: SwitchConfirmWrapperValue;\n checkedValue: SwitchConfirmWrapperValue;\n unCheckedValue: SwitchConfirmWrapperValue;\n needConfirm?: 'close' | 'open' | 'all' | 'none';\n noMessage?: boolean;\n onChange?: (value: SwitchConfirmWrapperValue) => void;\n popConfirmProps?:\n | Pick<PopconfirmProps, 'disabled' | 'title' | 'description'>\n | ((checked?: boolean) => Pick<PopconfirmProps, 'disabled' | 'title' | 'description'>);\n serviceConfig?: {\n onRequest: (value: SwitchConfirmWrapperValue) => TAny;\n message?: {\n success?: string;\n defaultError?: string;\n };\n };\n};\n\n/**\n *\n * @description switch 切换时做二次pop提醒, 非可控组件【内部控制】\n * @param props\n * @param value\n * @param checkedValue:选中状态值\n * @param unCheckedValue:非选中状态值\n * @param needConfirm:二次pop拦截时机 可不传\n * close:switch 由开启转换成关闭时pop弹出\n * open:switch 由开启转换成开启时pop弹出\n * all:switch 一直pop\n * none:switch 不弹出\n * @param noMessage:不采用内置message提示\n * @param onChange:switch 有效切换回掉\n * @param popConfirmProps:popConfirm中参数 disabled title description\n * @param serviceConfig onRequest\n * @field onRequest 请求函数\n * @field message message配置 success defaultError\n * ```\n * 1. 单独使用\n * <SwitchConfirmWrapper\n * value={value}\n * checkedValue={'1'}\n * unCheckedValue={'2'}\n * serviceConfig={{\n * onRequest: async () => {\n * await sleep(2000);\n * },\n * }}\n * needConfirm={'all'}\n * popConfirmProps={{\n * title: '确定要开启吗?',\n * }}\n * onChange={(value) => {\n * setValue(value as string);\n * }}\n * />\n *\n * 2. 与Form.Item结合使用\n * <Form.Item name=\"open\">\n * <SwitchConfirmWrapper\n * checkedValue={'1'}\n * unCheckedValue={'2'}\n * serviceConfig={{\n * onRequest: async () => {\n * await sleep(2000);\n * },\n * }}\n * needConfirm={'all'}\n * popConfirmProps={{\n * title: '确定要开启吗?',\n * }}\n * />\n * </Form.Item>\n * ```\n */\nexport const SwitchConfirmWrapper = (props: SwitchConfirmWrapperProps) => {\n const {\n popConfirmProps,\n needConfirm,\n checkedValue,\n unCheckedValue,\n onChange,\n value,\n serviceConfig,\n noMessage,\n ...otherProps\n } = props;\n const popConfirmPropsFt = useMemo(() => {\n if (typeof popConfirmProps === 'function') {\n return popConfirmProps(value === checkedValue);\n }\n return popConfirmProps;\n }, [checkedValue, popConfirmProps, value]);\n const [isCheked, setIsCheked] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(false);\n\n fbaHooks.useEffectCustom(() => {\n setIsCheked(value === checkedValue);\n }, [props.value]);\n\n const showConfirm = useMemo(() => {\n return (\n (needConfirm === 'close' && isCheked) ||\n (needConfirm === 'open' && !isCheked) ||\n !needConfirm ||\n needConfirm === 'all'\n );\n }, [isCheked, needConfirm]);\n\n const onHandleChange = hooks.useCallbackRef(async () => {\n const changeValue = !isCheked ? checkedValue : unCheckedValue;\n if (serviceConfig?.onRequest) {\n try {\n setLoading(true);\n await serviceConfig.onRequest(changeValue);\n setIsCheked(!isCheked);\n onChange?.(changeValue);\n if (!noMessage) {\n void message.success(serviceConfig?.message?.success || '状态修改成功!');\n }\n } catch (error) {\n if (!noMessage) {\n void message.error(error?.message || serviceConfig?.message?.defaultError || '状态修改失败!');\n }\n } finally {\n setLoading(false);\n }\n } else {\n setIsCheked(!isCheked);\n onChange?.(changeValue);\n }\n });\n if (showConfirm) {\n return (\n <Popconfirm\n disabled={popConfirmPropsFt?.disabled}\n okButtonProps={{ loading: loading }}\n title={popConfirmPropsFt?.title}\n description={popConfirmPropsFt?.description}\n onConfirm={onHandleChange}\n >\n <Switch checked={isCheked} {...otherProps} />\n </Popconfirm>\n );\n }\n return <Switch checked={isCheked} loading={loading} {...otherProps} onChange={onHandleChange} />;\n};\n"],"names":["SwitchConfirmWrapper","props","popConfirmProps","needConfirm","checkedValue","unCheckedValue","onChange","value","serviceConfig","noMessage","otherProps","_objectWithoutPropertiesLoose","_excluded","popConfirmPropsFt","useMemo","_useState","useState","isCheked","setIsCheked","_useState2","loading","setLoading","fbaHooks","useEffectCustom","showConfirm","onHandleChange","_hooks","useCallbackRef","Promise","$return","$error","changeValue","_serviceConfig$messag","_serviceConfig$messag2","onRequest","$Try_1_Finally","$Try_1_Exit","$Try_1_Value","call","this","$boundEx","bind","$Try_1_Post","$If_2","$Try_1_Catch","error","message","defaultError","resolve","then","$await_3","success","_jsx","Popconfirm","disabled","okButtonProps","title","description","onConfirm","children","Switch","_extends","checked"],"mappings":";4fAkFaA,EAAuB,SAAvBA,EAAwBC,GACnC,IACEC,EASED,EATFC,gBACAC,EAQEF,EARFE,YACAC,EAOE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bzB,EAAesC,UAAO,UAAA,EAAtBb,EAAwBc,eAAgB,UAC/E,CAlIR,OAAOZ,EAAAO,EAAAP,EAAE,CAAC,MAAAK,GAAW,OAAOL,EAAAL,EAAAK,CAAAK,EAAM,GAuH5B,IACEnB,EAAW,MACX,OAAAO,QAAAoB,QAAMxC,EAAc0B,UAAUH,IAA9BkB,eAA0CC,GAzHlD,IA0HQhC,GAAaD,GACbX,GAAAA,UAAAA,EAAAA,EAAWyB,GACX,IAAKtB,EAAW,MACTqC,EAAQK,SAAQ3C,UAAawB,EAAbxB,EAAesC,UAAfd,UAAAA,EAAAA,EAAwBmB,UAAW,UAC1D,CA9HR,OAAOhB,EAAAO,EAAAP,EAAE,CAAC,MAAAK,GAAW,OAAOI,EAAAJ,EAAM,CAAC,GAAAI,EA+H5B,CAAC,MAAOC,GAAOD,EAAPC,EAIT,CAGF,KAAO,CACL3B,GAAaD,GACbX,GAAAA,UAAAA,EAAAA,EAAWyB,GAAa,OAxI9BY,EAAGL,KAAIC,KAyIH,CAAC,SAAAI,IAAA,OAAAd,GAAA,CAAA,OAEH,GAAIL,EAAa,CACf,OACE4B,EAACC,EAAU,CACTC,SAAUzC,GAAAA,UAAAA,EAAAA,EAAmByC,SAC7BC,cAAe,CAAEnC,QAASA,GAC1BoC,MAAO3C,GAAAA,UAAAA,EAAAA,EAAmB2C,MAC1BC,YAAa5C,GAAAA,UAAAA,EAAAA,EAAmB4C,YAChCC,UAAWjC,EAAekC,SAE1BP,EAACQ,EAAMC,EAAA,CAACC,QAAS7C,GAAcP,KAGrC,CACA,OAAO0C,EAACQ,EAAMC,EAAA,CAACC,QAAS7C,EAAUG,QAASA,GAAaV,EAAU,CAAEJ,SAAUmB,IAChF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/table-title-tooltip/title-render.tsx"],"sourcesContent":["import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { isUndefinedOrNull } from '@flatbiz/utils';\nimport { Space, Tooltip } from 'antd';\nimport { CSSProperties, ReactElement } from 'react';\n\nexport type TableTitleTooltipProps = {\n title: string | ReactElement;\n tooltip: string | { icon?: ReactElement; content
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/table-title-tooltip/title-render.tsx"],"sourcesContent":["import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { isUndefinedOrNull } from '@flatbiz/utils';\nimport { Space, Tooltip } from 'antd';\nimport { CSSProperties, ReactElement } from 'react';\n\nexport type TableTitleTooltipProps = {\n title: string | ReactElement;\n tooltip: string | { icon?: ReactElement; content: string; hoverArea?: 'icon' | 'all' };\n // 间隙,默认值:3\n gap?: number;\n className?: string;\n style?: CSSProperties;\n};\n\n/**\n * title + tooltip\n * @deprecated 已过期,请使用 TipsWrapper 组件\n */\nexport const TableTitleTooltip = (props: TableTitleTooltipProps) => {\n const tooltip = props.tooltip;\n const gap = isUndefinedOrNull(props.gap) ? 3 : props.gap;\n if (typeof tooltip === 'string') {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.title}</span>\n <Tooltip title={tooltip}>\n <span style={{ opacity: 0.7 }}>\n <QuestionCircleOutlined />\n </span>\n </Tooltip>\n </Space>\n );\n }\n const hoverArea = isUndefinedOrNull(tooltip.hoverArea) ? 'icon' : tooltip.hoverArea;\n if (hoverArea === 'icon') {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.title}</span>\n <Tooltip title={tooltip.content}>\n <span>{tooltip.icon || <QuestionCircleOutlined />}</span>\n </Tooltip>\n </Space>\n );\n }\n return (\n <Tooltip title={tooltip.content}>\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.title}</span>\n <span>{tooltip.icon || <QuestionCircleOutlined />}</span>\n </Space>\n </Tooltip>\n );\n};\n"],"names":["TableTitleTooltip","props","tooltip","gap","isUndefinedOrNull","_jsxs","Space","size","className","style","children","_jsx","title","Tooltip","opacity","_QuestionCircleOutlined","hoverArea","content","icon"],"mappings":";oNAkBaA,EAAoB,SAApBA,EAAqBC,GAChC,IAAMC,EAAUD,EAAMC,QACtB,IAAMC,EAAMC,EAAkBH,EAAME,KAAO,EAAIF,EAAME,IACrD,UAAWD,IAAY,SAAU,CAC/B,OACEG,EAACC,EAAK,CAACC,KAAMJ,EAAKK,UAAWP,EAAMO,UAAWC,MAAOR,EAAMQ,MAAMC,UAC/DC,EAAA,OAAA,CAAAD,SAAOT,EAAMW,QACbD,EAACE,EAAO,CAACD,MAAOV,EAAQQ,SACtBC,EAAA,OAAA,CAAMF,MAAO,CAAEK,QAAS,IAAMJ,SAC5BC,EAAAI,EAAyB,UAKnC,CACA,IAAMC,EAAYZ,EAAkBF,EAAQc,WAAa,OAASd,EAAQc,UAC1E,GAAIA,IAAc,OAAQ,CACxB,OACEX,EAACC,EAAK,CAACC,KAAMJ,EAAKK,UAAWP,EAAMO,UAAWC,MAAOR,EAAMQ,MAAMC,UAC/DC,EAAA,OAAA,CAAAD,SAAOT,EAAMW,QACbD,EAACE,EAAO,CAACD,MAAOV,EAAQe,QAAQP,SAC9BC,EAAA,OAAA,CAAAD,SAAOR,EAAQgB,MAAQP,EAAAI,EAAyB,CAAA,SAIxD,CACA,OACEJ,EAACE,EAAO,CAACD,MAAOV,EAAQe,QAAQP,SAC9BL,EAACC,EAAK,CAACC,KAAMJ,EAAKK,UAAWP,EAAMO,UAAWC,MAAOR,EAAMQ,MAAMC,UAC/DC,EAAA,OAAA,CAAAD,SAAOT,EAAMW,QACbD,EAAA,OAAA,CAAAD,SAAOR,EAAQgB,MAAQP,EAAAI,EAAyB,CAAA,SAIxD"}
|
|
@@ -6,5 +6,5 @@ import './../fba-utils/index.css';
|
|
|
6
6
|
import './../text-css-ellipsis/index.css';
|
|
7
7
|
import './index.css';
|
|
8
8
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
9
|
-
import{isEmpty as i}from"@dimjs/lang/cjs/is-empty";import{a as r,_ as e}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{getStrByteLen as t,cutString as n}from"@flatbiz/utils";import{Tooltip as l}from"antd";import{Fragment as o}from"react";import{ButtonWrapper as a}from"../button-wrapper/index.js";import{TextCssEllipsis as
|
|
9
|
+
import{isEmpty as i}from"@dimjs/lang/cjs/is-empty";import{a as r,_ as e}from"../_rollupPluginBabelHelpers-fc015ef2.js";import{getStrByteLen as t,cutString as n}from"@flatbiz/utils";import{Tooltip as l}from"antd";import{Fragment as o}from"react";import{ButtonWrapper as a}from"../button-wrapper/index.js";import{TextCssEllipsis as s}from"../text-css-ellipsis/index.js";import{jsx as p,jsxs as m}from"react/jsx-runtime";import"@ant-design/icons/es/icons/LoadingOutlined";import"@dimjs/lang/cjs/is-promise";import"@wove/react/cjs/hooks";import"@dimjs/utils/cjs/class-names";import"../config-provider-wrapper/index.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"../fba-utils/index.js";var d=["onClick","children","prefix"];var c=function i(t){var n=t.onClick,l=t.children,o=t.prefix,s=r(t,d);if(!!n){return m(a,e({type:"link",onClick:n,style:{padding:0,height:"initial",display:"inline-flex",alignItems:"center"}},s,{children:[o?p("span",{style:{marginRight:5},children:o}):null,l]}))}return m("span",e({},s,{style:e({display:"inline-flex"},s["style"]),children:[o?p("span",{style:{marginRight:5},children:o}):null,l]}))};var f=function r(e){var a=e.text,m=e.maxLength,d=e.placeholder,f=e.onClick,u=e.prefix;if(!a||i(a)||a==="")return p(o,{children:d});if(!!m){var j=t(a);if(j<=m*2){return p(c,{onClick:f,prefix:u,children:a})}else{var h=n(a,m*2);return p(l,{placement:"topLeft",title:a,children:p(c,{onClick:f,prefix:u,children:h})})}}if(e.width){return p(c,{onClick:f,prefix:u,children:p(s,{text:a,width:e.width})})}return p(c,{onClick:f,prefix:u,children:e.text})};export{f as TextOverflowRender};
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/text-overflow-render/text-overflow-render.tsx"],"sourcesContent":["import { isEmpty } from '@dimjs/lang';\nimport { cutString, getStrByteLen } from '@flatbiz/utils';\nimport { Tooltip } from 'antd';\nimport { Fragment, ReactElement } from 'react';\nimport { ButtonWrapper } from '../button-wrapper';\nimport { TextCssEllipsis } from '../text-css-ellipsis';\n\nconst LinkRender = (props: {\n onClick?: (e) => void;\n children?: ReactElement | string;\n prefix?: string | ReactElement;\n}) => {\n const { onClick, children, prefix, ...otherProps } = props;\n if (!!onClick) {\n return (\n <ButtonWrapper\n type=\"link\"\n onClick={onClick}\n style={{ padding: 0, height: 'initial', display: 'inline-flex', alignItems: 'center' }}\n {...otherProps}\n >\n {prefix ? <span style={{ marginRight: 5 }}>{prefix}</span> : null}\n {children}\n </ButtonWrapper>\n );\n }\n return (\n <span {...otherProps} style={{ display: 'inline-flex', ...otherProps['style'] }}>\n {prefix ? <span style={{ marginRight: 5 }}>{prefix}</span> : null}\n {children}\n </span>\n );\n};\n\nexport type TextOverflowRenderProps = {\n /** width 宽度控制超长 */\n width?: number;\n /** maxLength 数字控制超长 */\n maxLength?: number;\n /** 完整文本 */\n text?: string;\n /** 文本前缀显示 */\n prefix?: string | ReactElement;\n /** 数据不存在时,占位符 */\n placeholder?: ReactElement | string;\n onClick?: (e) => void;\n};\n\n/**\n * 文本显示超出截取,被截取的添加Tooltip显示完整数据\n * ```\n * 控制文本显示两种方式\n * 1. 通过 maxLength 控制超长\n * 2. 通过 width 控制超长\n *\n * 3. maxLength 与 width 互斥,优先级:maxLength > width\n * ```\n * @param props\n * @returns\n */\nexport const TextOverflowRender = (props: TextOverflowRenderProps) => {\n const { text, maxLength, placeholder, onClick, prefix } = props;\n\n if (!text || isEmpty(text) || text === '') return <Fragment>{placeholder}</Fragment>;\n if (!!maxLength) {\n const strByteLen = getStrByteLen(text);\n if (strByteLen <= maxLength * 2) {\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n {text}\n </LinkRender>\n );\n } else {\n const resultTitle = cutString(text, maxLength * 2);\n return (\n <Tooltip placement=\"topLeft\" title={text}>\n <LinkRender onClick={onClick} prefix={prefix}>\n {resultTitle}\n </LinkRender>\n </Tooltip>\n );\n }\n }\n if (props.width) {\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n <TextCssEllipsis text={text} width={props.width} />\n </LinkRender>\n );\n }\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n {props.text}\n </LinkRender>\n );\n};\n"],"names":["LinkRender","props","onClick","children","prefix","otherProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","ButtonWrapper","_extends","type","style","padding","height","display","alignItems","_jsx","marginRight","TextOverflowRender","text","maxLength","placeholder","_isEmpty","Fragment","strByteLen","getStrByteLen","resultTitle","cutString","Tooltip","placement","title","width","TextCssEllipsis"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/text-overflow-render/text-overflow-render.tsx"],"sourcesContent":["import { isEmpty } from '@dimjs/lang';\nimport { cutString, getStrByteLen } from '@flatbiz/utils';\nimport { Tooltip } from 'antd';\nimport { Fragment, ReactElement } from 'react';\nimport { ButtonWrapper } from '../button-wrapper';\nimport { TextCssEllipsis } from '../text-css-ellipsis';\n\nconst LinkRender = (props: {\n onClick?: (e) => void;\n children?: ReactElement | string;\n prefix?: string | ReactElement;\n}) => {\n const { onClick, children, prefix, ...otherProps } = props;\n if (!!onClick) {\n return (\n <ButtonWrapper\n type=\"link\"\n onClick={onClick}\n style={{ padding: 0, height: 'initial', display: 'inline-flex', alignItems: 'center' }}\n {...otherProps}\n >\n {prefix ? <span style={{ marginRight: 5 }}>{prefix}</span> : null}\n {children}\n </ButtonWrapper>\n );\n }\n return (\n <span {...otherProps} style={{ display: 'inline-flex', ...otherProps['style'] }}>\n {prefix ? <span style={{ marginRight: 5 }}>{prefix}</span> : null}\n {children}\n </span>\n );\n};\n\nexport type TextOverflowRenderProps = {\n /** width 宽度控制超长 */\n width?: number;\n /** maxLength 数字控制超长 */\n maxLength?: number;\n /** 完整文本 */\n text?: string;\n /** 文本前缀显示 */\n prefix?: string | ReactElement;\n /** 数据不存在时,占位符 */\n placeholder?: ReactElement | string;\n onClick?: (e) => void;\n};\n\n/**\n * 文本显示超出截取,被截取的添加Tooltip显示完整数据\n * ```\n * 控制文本显示两种方式\n * 1. 通过 maxLength 控制超长\n * 2. 通过 width 控制超长\n *\n * 3. maxLength 与 width 互斥,优先级:maxLength > width\n * ```\n * @param props\n * @returns\n */\nexport const TextOverflowRender = (props: TextOverflowRenderProps) => {\n const { text, maxLength, placeholder, onClick, prefix } = props;\n\n if (!text || isEmpty(text) || text === '') return <Fragment>{placeholder}</Fragment>;\n if (!!maxLength) {\n const strByteLen = getStrByteLen(text);\n if (strByteLen <= maxLength * 2) {\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n {text}\n </LinkRender>\n );\n } else {\n const resultTitle = cutString(text, maxLength * 2);\n return (\n <Tooltip placement=\"topLeft\" title={text}>\n <LinkRender onClick={onClick} prefix={prefix}>\n {resultTitle}\n </LinkRender>\n </Tooltip>\n );\n }\n }\n if (props.width) {\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n <TextCssEllipsis text={text} width={props.width} />\n </LinkRender>\n );\n }\n return (\n <LinkRender onClick={onClick} prefix={prefix}>\n {props.text}\n </LinkRender>\n );\n};\n"],"names":["LinkRender","props","onClick","children","prefix","otherProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","ButtonWrapper","_extends","type","style","padding","height","display","alignItems","_jsx","marginRight","TextOverflowRender","text","maxLength","placeholder","_isEmpty","Fragment","strByteLen","getStrByteLen","resultTitle","cutString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B,MAAO,CACf,OACEf,EAACjB,EAAU,CAACE,QAASA,EAASE,OAAQA,EAAOD,SAC3Cc,EAACgB,EAAe,CAACb,KAAMA,EAAMY,MAAO/B,EAAM+B,SAGhD,CACA,OACEf,EAACjB,EAAU,CAACE,QAASA,EAASE,OAAQA,EAAOD,SAC1CF,EAAMmB,MAGb"}
|
|
File without changes
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import './index.css';
|
|
3
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
+
import{_ as e}from"../_rollupPluginBabelHelpers-fc015ef2.js";import i from"@ant-design/icons/es/icons/QuestionCircleOutlined";import{isUndefinedOrNull as l}from"@flatbiz/utils";import{Space as r,Tooltip as s,Popover as n}from"antd";import{Fragment as c}from"react";import{jsx as a,jsxs as t}from"react/jsx-runtime";var o=function o(p){var d=p.icon||a(i,{});var h=p.trigger||"icon";var y=l(p.gap)?3:p.gap;if(p.tipType==="tooltip"&&h==="icon"){return t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a(s,e({},p.tooltipProps,{children:a("span",{style:{opacity:.7},children:d})}))]})}if(p.tipType==="tooltip"&&h==="all"){return a(s,e({},p.tooltipProps,{children:t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a("span",{children:d})]})}))}if(p.tipType==="popover"&&h==="icon"){return t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a(n,e({},p.popoverProps,{children:a("span",{style:{opacity:.8},children:d})}))]})}if(p.tipType==="popover"&&h==="all"){return a(n,e({},p.popoverProps,{children:t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a("span",{style:{opacity:.8},children:d})]})}))}if(p.onClick&&h==="icon"){return t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a("span",{onClick:p.onClick,style:{opacity:.8},children:d})]})}if(p.onClick&&h==="all"){return t(r,{size:y,className:p.className,style:p.style,onClick:p.onClick,children:[a("span",{children:p.children}),a("span",{style:{opacity:.8},children:d})]})}if(p.icon){return t(r,{size:y,className:p.className,style:p.style,children:[a("span",{children:p.children}),a("span",{style:{opacity:.8},children:p.icon})]})}return a(c,{children:p.children})};export{o as TipsWrapper};
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/tips-wrapper/tips-wrapper.tsx"],"sourcesContent":["import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { isUndefinedOrNull } from '@flatbiz/utils';\nimport { Popover, PopoverProps, Space, Tooltip, TooltipProps } from 'antd';\nimport { Fragment, ReactNode, type CSSProperties, type ReactElement } from 'react';\n\nexport type TipsWrapperProps = {\n // 间隙,默认值:3\n gap?: number;\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n icon?: ReactElement;\n /** Icon添加点击事件,设置hoverTips后失效 */\n onClick?: (event) => void;\n /**\n * 提示效果类型\n * ```\n * 1. popover 气泡卡片,内容通过popoverProps设置\n * 2. tooltip 文字提示,内容通过tooltipProps设置\n * ```\n */\n tipType?: 'popover' | 'tooltip';\n popoverProps?: PopoverProps;\n tooltipProps?: TooltipProps;\n trigger?: 'icon' | 'all';\n};\n\n/**\n * 为目标元素右侧添加Icon\n * ```\n * Icon有两种交互行为\n * 1. 鼠标悬浮显示提示效果;\n * 2. 为Icon添加点击事件\n *\n * 例如:\n * 1.\n * <TipsWrapper tipType=\"tooltip\" tooltipProps={{ title:'说明文案' }}>ABC</TipsWrapper>\n * 2.\n * <TipsWrapper tipType=\"popover\" popoverProps={{ title:'说明标题', content:'说明内容' }}>ABC</TipsWrapper>\n * 3.\n * <TipsWrapper onClick={noop}>ABC</TipsWrapper>\n * ```\n */\nexport const TipsWrapper = (props: TipsWrapperProps) => {\n const icon = props.icon || <QuestionCircleOutlined />;\n const trigger = props.trigger || 'icon';\n const gap = isUndefinedOrNull(props.gap) ? 3 : props.gap;\n if (props.tipType === 'tooltip' && trigger === 'icon') {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <Tooltip {...props.tooltipProps}>\n <span style={{ opacity: 0.7 }}>{icon}</span>\n </Tooltip>\n </Space>\n );\n }\n if (props.tipType === 'tooltip' && trigger === 'all') {\n return (\n <Tooltip {...props.tooltipProps}>\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <span>{icon}</span>\n </Space>\n </Tooltip>\n );\n }\n\n if (props.tipType === 'popover' && trigger === 'icon') {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <Popover {...props.popoverProps}>\n <span style={{ opacity: 0.8 }}>{icon}</span>\n </Popover>\n </Space>\n );\n }\n if (props.tipType === 'popover' && trigger === 'all') {\n return (\n <Popover {...props.popoverProps}>\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <span style={{ opacity: 0.8 }}>{icon}</span>\n </Space>\n </Popover>\n );\n }\n\n if (props.onClick && trigger === 'icon') {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <span onClick={props.onClick} style={{ opacity: 0.8 }}>\n {icon}\n </span>\n </Space>\n );\n }\n if (props.onClick && trigger === 'all') {\n return (\n <Space size={gap} className={props.className} style={props.style} onClick={props.onClick}>\n <span>{props.children}</span>\n <span style={{ opacity: 0.8 }}>{icon}</span>\n </Space>\n );\n }\n if (props.icon) {\n return (\n <Space size={gap} className={props.className} style={props.style}>\n <span>{props.children}</span>\n <span style={{ opacity: 0.8 }}>{props.icon}</span>\n </Space>\n );\n }\n return <Fragment>{props.children}</Fragment>;\n};\n"],"names":["TipsWrapper","props","icon","_jsx","_QuestionCircleOutlined","trigger","gap","isUndefinedOrNull","tipType","_jsxs","Space","size","className","style","children","Tooltip","_extends","tooltipProps","opacity","Popover","popoverProps","onClick","Fragment"],"mappings":";+TA2CaA,EAAc,SAAdA,EAAeC,GAC1B,IAAMC,EAAOD,EAAMC,M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AAW,SAAOb,EAAMa,WACbX,EAAA,OAAA,CAAMU,MAAO,CAAEK,QAAS,IAAMJ,SAAEZ,SAIxC,CAEA,GAAID,EAAMoB,SAAWhB,IAAY,OAAQ,CACvC,OACEI,EAACC,EAAK,CAACC,KAAML,EAAKM,UAAWX,EAAMW,UAAWC,MAAOZ,EAAMY,MAAMC,UAC/DX,EAAA,OAAA,CAAAW,SAAOb,EAAMa,WACbX,EAAA,OAAA,CAAMkB,QAASpB,EAAMoB,QAASR,MAAO,CAAEK,QAAS,IAAMJ,SACnDZ,MAIT,CACA,GAAID,EAAMoB,SAAWhB,IAAY,MAAO,CACtC,OACEI,EAACC,EAAK,CAACC,KAAML,EAAKM,UAAWX,EAAMW,UAAWC,MAAOZ,EAAMY,MAAOQ,QAASpB,EAAMoB,QAAQP,UACvFX,EAAA,OAAA,CAAAW,SAAOb,EAAMa,WACbX,EAAA,OAAA,CAAMU,MAAO,CAAEK,QAAS,IAAMJ,SAAEZ,MAGtC,CACA,GAAID,EAAMC,KAAM,CACd,OACEO,EAACC,EAAK,CAACC,KAAML,EAAKM,UAAWX,EAAMW,UAAWC,MAAOZ,EAAMY,MAAMC,UAC/DX,EAAA,OAAA,CAAAW,SAAOb,EAAMa,WACbX,EAAA,OAAA,CAAMU,MAAO,CAAEK,QAAS,IAAMJ,SAAEb,EAAMC,SAG5C,CACA,OAAOC,EAACmB,EAAQ,CAAAR,SAAEb,EAAMa,UAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-responsive-point-21b8c601.js","sources":["@flatbiz/antd/src/fba-hooks/use-responsive-point.ts"],"sourcesContent":["import { Grid } from 'antd';\nimport { useMemo } from 'react';\n\n/**\n * 获取响应式节点\n */\nexport const useResponsivePoint = () => {\n const screens = Grid.useBreakpoint();\n return useMemo(() => {\n const filter = Object.keys(screens).filter((key) => {\n return screens[key] === true;\n });\n const order = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\n const targetIndex = order.findIndex((key) => filter.includes(key));\n return order[targetIndex] as string | undefined;\n }, [screens]);\n};\n"],"names":["useResponsivePoint","screens","Grid","useBreakpoint","useMemo","filter","Object","keys","key","order","targetIndex","findIndex","includes"],"mappings":";
|
|
1
|
+
{"version":3,"file":"use-responsive-point-21b8c601.js","sources":["@flatbiz/antd/src/fba-hooks/use-responsive-point.ts"],"sourcesContent":["import { Grid } from 'antd';\nimport { useMemo } from 'react';\n\n/**\n * 获取响应式节点\n * xs < 576px\n * sm ≥ 576px\n * md ≥ 768px\n * lg ≥ 992px\n * xl ≥ 1200px\n * xxl ≥ 1600px\n */\nexport const useResponsivePoint = () => {\n const screens = Grid.useBreakpoint();\n return useMemo(() => {\n const filter = Object.keys(screens).filter((key) => {\n return screens[key] === true;\n });\n const order = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];\n const targetIndex = order.findIndex((key) => filter.includes(key));\n return order[targetIndex] as string | undefined;\n }, [screens]);\n};\n"],"names":["useResponsivePoint","screens","Grid","useBreakpoint","useMemo","filter","Object","keys","key","order","targetIndex","findIndex","includes"],"mappings":";gEAYaA,EAAqB,SAArBA,IACX,IAAMC,EAAUC,EAAKC,gBACrB,OAAOC,GAAQ,WACb,IAAMC,EAASC,OAAOC,KAAKN,GAASI,QAAO,SAACG,GAC1C,OAAOP,EAAQO,KAAS,IAC1B,IACA,IAAMC,EAAQ,CAAC,MAAO,KAAM,KAAM,KAAM,KAAM,MAC9C,IAAMC,EAAcD,EAAME,WAAU,SAACH,GAAG,OAAKH,EAAOO,SAASJ,MAC7D,OAAOC,EAAMC,EACf,GAAG,CAACT,GACN"}
|