@flatbiz/antd 5.0.1 → 5.0.3

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.
Files changed (55) hide show
  1. package/README.md +1 -1
  2. package/dist/bootstrap/index.js +2 -2
  3. package/dist/{bootstrap-ClsrYKOY.js → bootstrap-BuSXzgal.js} +2 -2
  4. package/dist/{bootstrap-ClsrYKOY.js.map → bootstrap-BuSXzgal.js.map} +1 -1
  5. package/dist/button-operate/index.js +4 -4
  6. package/dist/{button-operate-CWu3PARq.js → button-operate-BDJArgIt.js} +2 -2
  7. package/dist/{button-operate-CWu3PARq.js.map → button-operate-BDJArgIt.js.map} +1 -1
  8. package/dist/{cell-render-pwSRW4nx.js → cell-render-D78pj8ON.js} +2 -2
  9. package/dist/{cell-render-pwSRW4nx.js.map → cell-render-D78pj8ON.js.map} +1 -1
  10. package/dist/dialog-alert/index.js +3 -3
  11. package/dist/{dialog-alert-CaXcXgGX.js → dialog-alert-Dx5zORPd.js} +2 -2
  12. package/dist/{dialog-alert-CaXcXgGX.js.map → dialog-alert-Dx5zORPd.js.map} +1 -1
  13. package/dist/dialog-confirm/index.js +2 -2
  14. package/dist/{dialog-confirm-DQdfsMXv.js → dialog-confirm-CrNU6BCC.js} +2 -2
  15. package/dist/{dialog-confirm-DQdfsMXv.js.map → dialog-confirm-CrNU6BCC.js.map} +1 -1
  16. package/dist/dialog-modal/index.js +1 -1
  17. package/dist/{dialog-modal-DbTrsUc2.js → dialog-modal-CswobYJZ.js} +2 -2
  18. package/dist/dialog-modal-CswobYJZ.js.map +1 -0
  19. package/dist/{drag-DVV-pdrI.js → drag-CmsvsrRy.js} +2 -2
  20. package/dist/{drag-DVV-pdrI.js.map → drag-CmsvsrRy.js.map} +1 -1
  21. package/dist/drag-editable-card/index.d.ts +6 -3
  22. package/dist/drag-editable-card/index.js +17 -231
  23. package/dist/drag-editable-card/index.js.map +1 -1
  24. package/dist/drag-editable-table/index.js +7 -7
  25. package/dist/dropdown-menu-wrapper/index.js +3 -3
  26. package/dist/{dropdown-menu-wrapper-F5A3o-Jt.js → dropdown-menu-wrapper-BiX-W1eB.js} +2 -2
  27. package/dist/{dropdown-menu-wrapper-F5A3o-Jt.js.map → dropdown-menu-wrapper-BiX-W1eB.js.map} +1 -1
  28. package/dist/easy-table/index.css +1 -1
  29. package/dist/editable-card/index.d.ts +10 -8
  30. package/dist/editable-card/index.js +1 -1
  31. package/dist/editable-card-B5CLgiDY.js +231 -0
  32. package/dist/editable-card-B5CLgiDY.js.map +1 -0
  33. package/dist/{editable-card-C2W7M00M.js → editable-card-C_wwMtSy.js} +18 -14
  34. package/dist/editable-card-C_wwMtSy.js.map +1 -0
  35. package/dist/editable-table/index.js +6 -6
  36. package/dist/{editable-table-Ch7M44bV.js → editable-table-BoHT2BFh.js} +2 -2
  37. package/dist/{editable-table-Ch7M44bV.js.map → editable-table-BoHT2BFh.js.map} +1 -1
  38. package/dist/fba-app/index.js +1 -1
  39. package/dist/{fba-app-Dwk_sT5R.js → fba-app-BFVKzJvB.js} +2 -2
  40. package/dist/fba-app-BFVKzJvB.js.map +1 -0
  41. package/dist/index.d.ts +384 -101
  42. package/dist/index.js +19 -11
  43. package/dist/index.js.map +1 -1
  44. package/dist/number-range-B_WHzUn5.js +133 -0
  45. package/dist/number-range-B_WHzUn5.js.map +1 -0
  46. package/dist/number-range-form-item/index.css +1 -0
  47. package/dist/number-range-form-item/index.d.ts +73 -0
  48. package/dist/number-range-form-item/index.js +17 -0
  49. package/dist/number-range-form-item/index.js.map +1 -0
  50. package/dist/table-cell-render/index.js +5 -5
  51. package/dist/tree-wrapper/index.js +4 -4
  52. package/package.json +37 -5
  53. package/dist/dialog-modal-DbTrsUc2.js.map +0 -1
  54. package/dist/editable-card-C2W7M00M.js.map +0 -1
  55. package/dist/fba-app-Dwk_sT5R.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"drag-DVV-pdrI.js","sources":["@flatbiz/antd/src/drag-editable-table/context.ts","@flatbiz/antd/src/drag-editable-table/table-tr-handle.tsx","@flatbiz/antd/src/drag-editable-table/row.tsx","@flatbiz/antd/src/drag-editable-table/drag.tsx"],"sourcesContent":["import { type ReactElement } from 'react';\nimport { createCtx } from '@wove/react';\n\nexport const [getCtx, CtxProvider] = createCtx<{\n dragIcon?: ReactElement;\n uidFieldKey: string;\n}>();\n","import { Children, cloneElement, type ReactElement } from 'react';\nimport { type RowProps } from 'antd';\nimport { DragOutlined } from '@ant-design/icons';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { isUndefinedOrNull, noop } from '@flatbiz/utils';\nimport { IconWrapper } from '../icon-wrapper/icon-wrapper.jsx';\n\ntype TableTrHandleProps = RowProps & {\n dragIcon?: ReactElement;\n};\nexport const TableTrHandle = (props: TableTrHandleProps) => {\n const { dragIcon, ...innerProps } = props;\n const rowId = innerProps['data-row-key'] as number;\n\n const {\n setActivatorNodeRef,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id: rowId,\n });\n\n if (isUndefinedOrNull(rowId)) {\n return <tr {...innerProps} />;\n }\n const style: React.CSSProperties = {\n ...innerProps.style,\n transform: CSS.Transform.toString(transform && { ...transform, scaleY: 1 }),\n transition,\n cursor: 'move',\n ...(isDragging\n ? {\n position: 'relative',\n zIndex: 9999,\n boxShadow: ' 0px 0px 12px 4px rgba(34, 33, 81, 0.1)',\n backgroundColor: 'var(--block-bg-color)',\n }\n : {}),\n };\n const iconElement = dragIcon || <DragOutlined />;\n return (\n <tr {...innerProps} ref={setNodeRef} style={style} key={rowId}>\n {Children.map(props.children, (child) => {\n if ((child as React.ReactElement).key === '__sort') {\n return cloneElement(child as React.ReactElement, {\n children: (\n <span\n ref={setActivatorNodeRef}\n style={{\n touchAction: 'none',\n cursor: 'move',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n {...listeners}\n >\n <IconWrapper\n style={{\n touchAction: 'none',\n cursor: 'move',\n padding: '1px 0px',\n margin: 0,\n justifyContent: 'center',\n color: '#787878',\n }}\n icon={iconElement}\n onClick={noop}\n size=\"small\"\n />\n </span>\n ),\n });\n }\n return child;\n })}\n </tr>\n );\n};\n","import { getCtx } from './context.js';\nimport { TableTrHandle } from './table-tr-handle.jsx';\n\nexport const Row = (props) => {\n const ctx = getCtx();\n return <TableTrHandle {...props} dragIcon={ctx.dragIcon} />;\n};\n","import { type ReactElement } from 'react';\nimport { Form } from 'antd';\nimport {\n DndContext,\n type DragEndEvent,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { restrictToVerticalAxis } from '@dnd-kit/modifiers';\nimport {\n arrayMove,\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport { type TPlainObject } from '@flatbiz/utils';\nimport type {\n EditableTableColumn,\n EditableTableProps,\n} from '../editable-table/editable-table.jsx';\nimport { EditableTable } from '../editable-table/editable-table.jsx';\nimport { CtxProvider } from './context.js';\nimport { Row } from './row.jsx';\n\nexport type DragEditableTableProps = EditableTableProps & {\n /**\n * 拖拽图标自定义,默认使用 DragOutlined 图标\n */\n dragIcon?: ReactElement;\n\n /** 禁用拖拽 */\n disabledDrag?: boolean;\n /**\n * 表格数据唯一值字段Key\n * ```\n * ```\n */\n uidFieldKey: string;\n /**\n * 拖拽结束事件\n * ```\n * dataSource: 拖拽完成后的数据源\n * dragData\n * 1. activeId 拖拽ID\n * 2. activeIndex 拖拽起始表格数组索引值\n * 3. overIndex 拖拽结束表格数组索引值\n * ```\n */\n onDragChange?: (\n dataSource: TPlainObject[],\n dragData: {\n activeId: string | number;\n overId?: string | number;\n activeIndex: number;\n overIndex: number;\n }\n ) => void;\n};\n\n/**\n * 可拖拽编辑表格\n * @deprecated 已过期,请使用 DragEditableTablePro组件\n * ```\n * 1. 表格数据必须要有唯一值字段,通过参数 uidFieldKey 告诉组件\n * 2. Table 参数 components.body.row 被组件内部使用\n * ```\n */\nexport const DragEditableTable = (props: DragEditableTableProps) => {\n const { dragIcon, uidFieldKey, onDragChange, disabledDrag, ...otherProps } =\n props;\n const form = Form.useFormInstance();\n const dataList = Form.useWatch(\n props.completeName ? props.completeName : props.name,\n form\n );\n\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n // 当拖拽触发区域有其他点击事件时,需要延迟触发拖拽动作\n delay: 0,\n tolerance: 0,\n },\n })\n );\n\n const onDragEnd = ({ active, over }: DragEndEvent) => {\n if (active.id !== over?.id) {\n const activeIndex = dataList.findIndex(\n (i) => i[uidFieldKey] === active.id\n );\n const overIndex = dataList.findIndex((i) => i[uidFieldKey] === over?.id);\n const dataListNew = arrayMove(dataList, activeIndex, overIndex);\n form.setFields([\n {\n name: props.completeName ? props.completeName : props.name,\n value: dataListNew,\n },\n ]);\n onDragChange?.(dataListNew as TPlainObject[], {\n activeId: active.id,\n overId: over?.id,\n activeIndex,\n overIndex,\n });\n }\n };\n\n const columns: EditableTableColumn[] = disabledDrag\n ? otherProps.columns\n : [\n {\n dataIndex: '__sort',\n width: 40,\n key: '__sort',\n align: 'center',\n } as EditableTableColumn,\n ].concat(otherProps.columns || []);\n\n return (\n <CtxProvider\n value={{\n dragIcon,\n uidFieldKey,\n }}\n >\n <DndContext\n sensors={sensors}\n modifiers={[restrictToVerticalAxis]}\n onDragEnd={onDragEnd}\n >\n <SortableContext\n items={dataList?.map((i) => i[uidFieldKey]) || []}\n strategy={verticalListSortingStrategy}\n >\n <EditableTable\n {...otherProps}\n uidFieldKey={uidFieldKey}\n columns={columns}\n tableProps={{\n ...otherProps.tableProps,\n components: {\n ...otherProps.tableProps?.components,\n body: {\n ...otherProps.tableProps?.components?.body,\n row: disabledDrag ? undefined : Row,\n },\n },\n }}\n />\n </SortableContext>\n </DndContext>\n </CtxProvider>\n );\n};\n"],"names":["_createCtx","_createCtx3","_createCtx2","_slicedToArray","getCtx","CtxProvider","TableTrHandle","props","dragIcon","innerProps","_objectWithoutProperties","_excluded","rowId","_useSortable","useSortable","id","setActivatorNodeRef","listeners","setNodeRef","transform","transition","isDragging","isUndefinedOrNull","_jsx","_objectSpread","style","CSS","Transform","toString","scaleY","cursor","position","zIndex","boxShadow","backgroundColor","iconElement","_DragOutlined","_createElement","ref","key","Children","map","children","child","cloneElement","touchAction","display","alignItems","justifyContent","IconWrapper","padding","margin","color","icon","onClick","noop","size","Row","ctx","DragEditableTable","_otherProps$tableProp","_otherProps$tableProp2","uidFieldKey","onDragChange","disabledDrag","otherProps","form","Form","useFormInstance","dataList","useWatch","completeName","name","sensors","useSensors","useSensor","PointerSensor","activationConstraint","delay","tolerance","onDragEnd","_ref","active","over","activeIndex","findIndex","i","overIndex","dataListNew","arrayMove","setFields","value","activeId","overId","columns","dataIndex","width","align","concat","DndContext","modifiers","restrictToVerticalAxis","SortableContext","items","strategy","verticalListSortingStrategy","EditableTable","tableProps","components","body","row","undefined"],"mappings":";;;;;;;;;;;;;;;;AAGO,IAAAA,UAAA,GAA8BC,SAAA,EAGjC;EAAAC,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAHUI,EAAAA,MAAM,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,EAAAA,WAAW,GAAAH,WAAA,CAAA,CAAA,CAAA;;;ACQ1B,IAAMI,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,KAAyB,EAAK;AAC1D,EAAA,IAAQC,QAAQ,GAAoBD,KAAK,CAAjCC,QAAQ;AAAKC,IAAAA,UAAU,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,WAAA,CAAA;AACzC,EAAA,IAAMC,KAAK,GAAGH,UAAU,CAAC,cAAc,CAAW;EAElD,IAAAI,YAAA,GAOIC,WAAW,CAAC;AACdC,MAAAA,EAAE,EAAEH;AACN,KAAC,CAAC;IARAI,mBAAmB,GAAAH,YAAA,CAAnBG,mBAAmB;IACnBC,SAAS,GAAAJ,YAAA,CAATI,SAAS;IACTC,UAAU,GAAAL,YAAA,CAAVK,UA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A,EAAA,EAAA,EAAA;AAC1CC,gBAAAA,GAAG,EAAE9C,YAAY,GAAG+C,SAAS,GAAGtD;AAAG,eAAA;AACpC,aAAA;AACF,WAAA;SAEJ,CAAA;OACc;KACP;AAAC,GACF,CAAC;AAElB;;;;"}
1
+ {"version":3,"file":"drag-CmsvsrRy.js","sources":["@flatbiz/antd/src/drag-editable-table/context.ts","@flatbiz/antd/src/drag-editable-table/table-tr-handle.tsx","@flatbiz/antd/src/drag-editable-table/row.tsx","@flatbiz/antd/src/drag-editable-table/drag.tsx"],"sourcesContent":["import { type ReactElement } from 'react';\nimport { createCtx } from '@wove/react';\n\nexport const [getCtx, CtxProvider] = createCtx<{\n dragIcon?: ReactElement;\n uidFieldKey: string;\n}>();\n","import { Children, cloneElement, type ReactElement } from 'react';\nimport { type RowProps } from 'antd';\nimport { DragOutlined } from '@ant-design/icons';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { isUndefinedOrNull, noop } from '@flatbiz/utils';\nimport { IconWrapper } from '../icon-wrapper/icon-wrapper.jsx';\n\ntype TableTrHandleProps = RowProps & {\n dragIcon?: ReactElement;\n};\nexport const TableTrHandle = (props: TableTrHandleProps) => {\n const { dragIcon, ...innerProps } = props;\n const rowId = innerProps['data-row-key'] as number;\n\n const {\n setActivatorNodeRef,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id: rowId,\n });\n\n if (isUndefinedOrNull(rowId)) {\n return <tr {...innerProps} />;\n }\n const style: React.CSSProperties = {\n ...innerProps.style,\n transform: CSS.Transform.toString(transform && { ...transform, scaleY: 1 }),\n transition,\n cursor: 'move',\n ...(isDragging\n ? {\n position: 'relative',\n zIndex: 9999,\n boxShadow: ' 0px 0px 12px 4px rgba(34, 33, 81, 0.1)',\n backgroundColor: 'var(--block-bg-color)',\n }\n : {}),\n };\n const iconElement = dragIcon || <DragOutlined />;\n return (\n <tr {...innerProps} ref={setNodeRef} style={style} key={rowId}>\n {Children.map(props.children, (child) => {\n if ((child as React.ReactElement).key === '__sort') {\n return cloneElement(child as React.ReactElement, {\n children: (\n <span\n ref={setActivatorNodeRef}\n style={{\n touchAction: 'none',\n cursor: 'move',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n {...listeners}\n >\n <IconWrapper\n style={{\n touchAction: 'none',\n cursor: 'move',\n padding: '1px 0px',\n margin: 0,\n justifyContent: 'center',\n color: '#787878',\n }}\n icon={iconElement}\n onClick={noop}\n size=\"small\"\n />\n </span>\n ),\n });\n }\n return child;\n })}\n </tr>\n );\n};\n","import { getCtx } from './context.js';\nimport { TableTrHandle } from './table-tr-handle.jsx';\n\nexport const Row = (props) => {\n const ctx = getCtx();\n return <TableTrHandle {...props} dragIcon={ctx.dragIcon} />;\n};\n","import { type ReactElement } from 'react';\nimport { Form } from 'antd';\nimport {\n DndContext,\n type DragEndEvent,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { restrictToVerticalAxis } from '@dnd-kit/modifiers';\nimport {\n arrayMove,\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport { type TPlainObject } from '@flatbiz/utils';\nimport type {\n EditableTableColumn,\n EditableTableProps,\n} from '../editable-table/editable-table.jsx';\nimport { EditableTable } from '../editable-table/editable-table.jsx';\nimport { CtxProvider } from './context.js';\nimport { Row } from './row.jsx';\n\nexport type DragEditableTableProps = EditableTableProps & {\n /**\n * 拖拽图标自定义,默认使用 DragOutlined 图标\n */\n dragIcon?: ReactElement;\n\n /** 禁用拖拽 */\n disabledDrag?: boolean;\n /**\n * 表格数据唯一值字段Key\n * ```\n * ```\n */\n uidFieldKey: string;\n /**\n * 拖拽结束事件\n * ```\n * dataSource: 拖拽完成后的数据源\n * dragData\n * 1. activeId 拖拽ID\n * 2. activeIndex 拖拽起始表格数组索引值\n * 3. overIndex 拖拽结束表格数组索引值\n * ```\n */\n onDragChange?: (\n dataSource: TPlainObject[],\n dragData: {\n activeId: string | number;\n overId?: string | number;\n activeIndex: number;\n overIndex: number;\n }\n ) => void;\n};\n\n/**\n * 可拖拽编辑表格\n * @deprecated 已过期,请使用 DragEditableTablePro组件\n * ```\n * 1. 表格数据必须要有唯一值字段,通过参数 uidFieldKey 告诉组件\n * 2. Table 参数 components.body.row 被组件内部使用\n * ```\n */\nexport const DragEditableTable = (props: DragEditableTableProps) => {\n const { dragIcon, uidFieldKey, onDragChange, disabledDrag, ...otherProps } =\n props;\n const form = Form.useFormInstance();\n const dataList = Form.useWatch(\n props.completeName ? props.completeName : props.name,\n form\n );\n\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n // 当拖拽触发区域有其他点击事件时,需要延迟触发拖拽动作\n delay: 0,\n tolerance: 0,\n },\n })\n );\n\n const onDragEnd = ({ active, over }: DragEndEvent) => {\n if (active.id !== over?.id) {\n const activeIndex = dataList.findIndex(\n (i) => i[uidFieldKey] === active.id\n );\n const overIndex = dataList.findIndex((i) => i[uidFieldKey] === over?.id);\n const dataListNew = arrayMove(dataList, activeIndex, overIndex);\n form.setFields([\n {\n name: props.completeName ? props.completeName : props.name,\n value: dataListNew,\n },\n ]);\n onDragChange?.(dataListNew as TPlainObject[], {\n activeId: active.id,\n overId: over?.id,\n activeIndex,\n overIndex,\n });\n }\n };\n\n const columns: EditableTableColumn[] = disabledDrag\n ? otherProps.columns\n : [\n {\n dataIndex: '__sort',\n width: 40,\n key: '__sort',\n align: 'center',\n } as EditableTableColumn,\n ].concat(otherProps.columns || []);\n\n return (\n <CtxProvider\n value={{\n dragIcon,\n uidFieldKey,\n }}\n >\n <DndContext\n sensors={sensors}\n modifiers={[restrictToVerticalAxis]}\n onDragEnd={onDragEnd}\n >\n <SortableContext\n items={dataList?.map((i) => i[uidFieldKey]) || []}\n strategy={verticalListSortingStrategy}\n >\n <EditableTable\n {...otherProps}\n uidFieldKey={uidFieldKey}\n columns={columns}\n tableProps={{\n ...otherProps.tableProps,\n components: {\n ...otherProps.tableProps?.components,\n body: {\n ...otherProps.tableProps?.components?.body,\n row: disabledDrag ? undefined : Row,\n },\n },\n }}\n />\n </SortableContext>\n </DndContext>\n </CtxProvider>\n );\n};\n"],"names":["_createCtx","_createCtx3","_createCtx2","_slicedToArray","getCtx","CtxProvider","TableTrHandle","props","dragIcon","innerProps","_objectWithoutProperties","_excluded","rowId","_useSortable","useSortable","id","setActivatorNodeRef","listeners","setNodeRef","transform","transition","isDragging","isUndefinedOrNull","_jsx","_objectSpread","style","CSS","Transform","toString","scaleY","cursor","position","zIndex","boxShadow","backgroundColor","iconElement","_DragOutlined","_createElement","ref","key","Children","map","children","child","cloneElement","touchAction","display","alignItems","justifyContent","IconWrapper","padding","margin","color","icon","onClick","noop","size","Row","ctx","DragEditableTable","_otherProps$tableProp","_otherProps$tableProp2","uidFieldKey","onDragChange","disabledDrag","otherProps","form","Form","useFormInstance","dataList","useWatch","completeName","name","sensors","useSensors","useSensor","PointerSensor","activationConstraint","delay","tolerance","onDragEnd","_ref","active","over","activeIndex","findIndex","i","overIndex","dataListNew","arrayMove","setFields","value","activeId","overId","columns","dataIndex","width","align","concat","DndContext","modifiers","restrictToVerticalAxis","SortableContext","items","strategy","verticalListSortingStrategy","EditableTable","tableProps","components","body","row","undefined"],"mappings":";;;;;;;;;;;;;;;;AAGO,IAAAA,UAAA,GAA8BC,SAAA,EAGjC;EAAAC,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAHUI,EAAAA,MAAM,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,EAAAA,WAAW,GAAAH,WAAA,CAAA,CAAA,CAAA;;;ACQ1B,IAAMI,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,KAAyB,EAAK;AAC1D,EAAA,IAAQC,QAAQ,GAAoBD,KAAK,CAAjCC,QAAQ;AAAKC,IAAAA,UAAU,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,WAAA,CAAA;AACzC,EAAA,IAAMC,KAAK,G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,MAAAqC,sBAAA,GACCI,UAAU,CAAC0C,UAAU,MAAA,IAAA,IAAA9C,sBAAA,KAAAA,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAArBA,sBAAA,CAAuB+C,UAAU,cAAA/C,sBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjCA,sBAAA,CAAmCgD,IAAI,CAAA,EAAA,EAAA,EAAA;AAC1CC,gBAAAA,GAAG,EAAE9C,YAAY,GAAG+C,SAAS,GAAGtD;AAAG,eAAA;AACpC,aAAA;AACF,WAAA;SAEJ,CAAA;OACc;KACP;AAAC,GACF,CAAC;AAElB;;;;"}
@@ -190,7 +190,7 @@ export type EditableCardColumnItem = {
190
190
  */
191
191
  dataIndex: EditableCardDataIndex;
192
192
  /** 是否可编辑 */
193
- editable: boolean | ((record: TPlainObject, index: number) => boolean);
193
+ editable: boolean | ((operation: Pick<EditableCardOperation, "index" | "getCurrentRowData">, index: number) => boolean);
194
194
  /**
195
195
  * 布局占用网格数目(最大数值24)
196
196
  * ```
@@ -246,10 +246,12 @@ export type EditableCardColumnItem = {
246
246
  /**
247
247
  * 隐藏域设置
248
248
  * ```
249
- * 如果是动态隐藏,并且在逻辑切换后无效果,可尝试执行 render.operation.forceUpdate()
249
+ * 如果是动态隐藏,并且在逻辑切换后无效果,可尝试执行 operation.forceUpdate()
250
250
  * ```
251
251
  */
252
- hidden?: (record: TPlainObject, index: number) => boolean;
252
+ hidden?: (operation: EditableCardOperation, index: number) => boolean;
253
+ /** 直接移除,不再执行render,优先级高于 hidden */
254
+ remove?: (operation: EditableCardOperation, index: number) => boolean;
253
255
  };
254
256
  export type EditableCardProps = {
255
257
  className?: string;
@@ -286,6 +288,7 @@ export type EditableCardProps = {
286
288
  addRowDefaultValues?: () => TPlainObject;
287
289
  /** 隐藏底部`新增`按钮 */
288
290
  hiddenFooterBtn?: boolean;
291
+ addRowBtnName?: string;
289
292
  /** 顶部区域渲染 */
290
293
  contentBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
291
294
  /** 底部区域渲染 */
@@ -5,19 +5,14 @@ import './../pre-defined-class-name/index.css';
5
5
  import './index.css';
6
6
  /*! @flatjs/forge MIT @flatbiz/antd */
7
7
 
8
- import { _ as _objectWithoutProperties, b as _objectSpread2, c as _toConsumableArray } from '../_rollupPluginBabelHelpers-BYm17lo8.js';
9
- import { Space, Form } from 'antd';
10
- import { useSensors, useSensor, PointerSensor, DndContext } from '@dnd-kit/core';
11
- import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
12
- import { useSortable, SortableContext, verticalListSortingStrategy, arrayMove } from '@dnd-kit/sortable';
13
- import { noop, toArray } from '@flatbiz/utils';
14
- import { E as EditableCard } from '../editable-card-C2W7M00M.js';
15
- import _DragOutlined from '@ant-design/icons/es/icons/DragOutlined.js';
16
- import { CSS } from '@dnd-kit/utilities';
17
- import { C as CardWrapper } from '../card-wrapper-w-JbDJNk.js';
18
- import { D as DeleteNode } from '../delete-node-CwCgmlIq.js';
19
- import { I as IconWrapper } from '../icon-wrapper-CR3akisG.js';
20
- import { jsx, jsxs } from 'react/jsx-runtime';
8
+ export { D as DragEditableCard } from '../editable-card-B5CLgiDY.js';
9
+ import '../_rollupPluginBabelHelpers-BYm17lo8.js';
10
+ import 'antd';
11
+ import '@dnd-kit/core';
12
+ import '@dnd-kit/modifiers';
13
+ import '@dnd-kit/sortable';
14
+ import '@flatbiz/utils';
15
+ import '../editable-card-C_wwMtSy.js';
21
16
  import '@ant-design/icons/es/icons/PlusOutlined.js';
22
17
  import '@dimjs/utils/class-names/class-names';
23
18
  import '@wove/react/hooks';
@@ -41,9 +36,16 @@ import '../fba-hooks/index.js';
41
36
  import '../use-responsive-point-Bp3D3lZT.js';
42
37
  import 'dayjs/locale/en.js';
43
38
  import 'dayjs/locale/zh-cn.js';
39
+ import 'react/jsx-runtime';
44
40
  import '../fba-utils-Dfbczn1S.js';
45
41
  import '@dimjs/lang/is-array';
46
42
  import '@dimjs/model';
43
+ import '../card-wrapper-w-JbDJNk.js';
44
+ import '../delete-node-CwCgmlIq.js';
45
+ import '@ant-design/icons/es/icons/CloseCircleFilled.js';
46
+ import '@ant-design/icons/es/icons/DeleteOutlined.js';
47
+ import '../icon-wrapper-CR3akisG.js';
48
+ import '@dimjs/lang/is-undefined';
47
49
  import '../form-Bz0Gi7wm.js';
48
50
  import '../box-grid/index.js';
49
51
  import '@dimjs/lang/is-number';
@@ -54,222 +56,6 @@ import '../form-item-hidden-B9afZdSe.js';
54
56
  import '../form-item-wrapper-CwXh7JxL.js';
55
57
  import '../tips-wrapper-Bf9nfZq3.js';
56
58
  import '@ant-design/icons/es/icons/QuestionCircleOutlined.js';
57
- import '@ant-design/icons/es/icons/CloseCircleFilled.js';
58
- import '@ant-design/icons/es/icons/DeleteOutlined.js';
59
- import '@dimjs/lang/is-undefined';
60
-
61
- var _excluded$1 = ["dragIcon", "rowId", "dragTriggerPosition"];
62
- var Handle = function Handle(props) {
63
- var dragIcon = props.dragIcon,
64
- rowId = props.rowId,
65
- dragTriggerPosition = props.dragTriggerPosition,
66
- innerProps = _objectWithoutProperties(props, _excluded$1);
67
- var dragTriggerPositionFt = dragTriggerPosition || 'left';
68
- var _useSortable = useSortable({
69
- id: rowId
70
- }),
71
- setActivatorNodeRef = _useSortable.setActivatorNodeRef,
72
- listeners = _useSortable.listeners,
73
- setNodeRef = _useSortable.setNodeRef,
74
- transform = _useSortable.transform,
75
- transition = _useSortable.transition,
76
- isDragging = _useSortable.isDragging;
77
- var style = _objectSpread2(_objectSpread2({}, innerProps.style), {}, {
78
- transform: CSS.Transform.toString(transform && _objectSpread2(_objectSpread2({}, transform), {}, {
79
- scaleY: 1
80
- })),
81
- transition: transition,
82
- cursor: 'move'
83
- }, isDragging ? {
84
- position: 'relative',
85
- zIndex: 9999,
86
- boxShadow: ' 0px 0px 12px 4px rgba(34, 33, 81, 0.1)',
87
- backgroundColor: 'var(--block-bg-color)'
88
- } : {});
89
- var iconElement = dragIcon || /*#__PURE__*/jsx(_DragOutlined, {});
90
- return /*#__PURE__*/jsx("div", {
91
- ref: setNodeRef,
92
- style: style,
93
- children: /*#__PURE__*/jsx(CardWrapper, {
94
- size: "small",
95
- style: {
96
- marginBottom: 10
97
- },
98
- extra: /*#__PURE__*/jsxs(Space, {
99
- size: 10,
100
- children: [/*#__PURE__*/jsx(DeleteNode, {
101
- style: {
102
- color: 'red'
103
- },
104
- hidden: props.extraData.required && props.extraData.fields.length === 1,
105
- onDelete: function onDelete() {
106
- props.extraData.operation.remove(props.extraData.index);
107
- }
108
- }), dragTriggerPositionFt === 'right' ? /*#__PURE__*/jsx("span", _objectSpread2(_objectSpread2({
109
- ref: setActivatorNodeRef,
110
- style: {
111
- touchAction: 'none',
112
- cursor: 'move'
113
- }
114
- }, listeners), {}, {
115
- children: /*#__PURE__*/jsx(IconWrapper, {
116
- style: {
117
- touchAction: 'none',
118
- cursor: 'move',
119
- padding: '3px',
120
- margin: 0,
121
- justifyContent: 'center',
122
- color: '#787878'
123
- },
124
- icon: iconElement,
125
- onClick: noop,
126
- size: "small"
127
- })
128
- })) : null]
129
- }),
130
- title: /*#__PURE__*/jsxs(Space, {
131
- size: 5,
132
- children: [dragTriggerPositionFt === 'left' ? /*#__PURE__*/jsx("span", _objectSpread2(_objectSpread2({
133
- ref: setActivatorNodeRef,
134
- style: {
135
- touchAction: 'none',
136
- cursor: 'move',
137
- display: 'flex',
138
- alignItems: 'center',
139
- justifyContent: 'center'
140
- }
141
- }, listeners), {}, {
142
- children: /*#__PURE__*/jsx(IconWrapper, {
143
- style: {
144
- touchAction: 'none',
145
- cursor: 'move',
146
- padding: '3px',
147
- margin: 0,
148
- justifyContent: 'center',
149
- color: '#787878'
150
- },
151
- icon: iconElement,
152
- onClick: noop,
153
- size: "small"
154
- })
155
- })) : null, /*#__PURE__*/jsxs("span", {
156
- children: ["\u7B2C", props.extraData.index + 1, "\u884C"]
157
- })]
158
- }),
159
- children: props.children
160
- })
161
- }, rowId);
162
- };
163
-
164
- var Handle2 = function Handle2(props) {
165
- return /*#__PURE__*/jsx(CardWrapper, {
166
- size: "small",
167
- style: {
168
- marginBottom: 10
169
- },
170
- extra: /*#__PURE__*/jsx(DeleteNode, {
171
- style: {
172
- color: 'red'
173
- },
174
- hidden: props.extraData.required && props.extraData.fields.length === 1,
175
- onDelete: function onDelete() {
176
- props.extraData.operation.remove(props.extraData.index);
177
- }
178
- }),
179
- title: "\u7B2C".concat(props.extraData.index + 1, "\u884C"),
180
- children: props.children
181
- });
182
- };
183
-
184
- var _excluded = ["dragIcon", "uidFieldKey", "onDragChange", "disabledDrag", "formListCompleteName", "formListName", "dragTriggerPosition"];
185
- /**
186
- * 可拖拽编辑卡片
187
- * ```
188
- * 1. 卡片数组必须有唯一值字段,通过参数 uidFieldKey 告诉组件
189
- * ```
190
- */
191
- var DragEditableCard = function DragEditableCard(props) {
192
- var dragIcon = props.dragIcon,
193
- uidFieldKey = props.uidFieldKey,
194
- onDragChange = props.onDragChange,
195
- disabledDrag = props.disabledDrag,
196
- formListCompleteName = props.formListCompleteName,
197
- formListName = props.formListName,
198
- dragTriggerPosition = props.dragTriggerPosition,
199
- otherProps = _objectWithoutProperties(props, _excluded);
200
- var formListCompleteNameFt = formListCompleteName || formListName;
201
- var form = Form.useFormInstance();
202
- var dataList = Form.useWatch(formListCompleteNameFt, form);
203
- var sensors = useSensors(useSensor(PointerSensor, {
204
- activationConstraint: {
205
- // 当拖拽触发区域有其他点击事件时,需要延迟触发拖拽动作
206
- delay: 0,
207
- tolerance: 0
208
- }
209
- }));
210
- var onDragEnd = function onDragEnd(_ref) {
211
- var active = _ref.active,
212
- over = _ref.over;
213
- if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
214
- var activeIndex = dataList.findIndex(function (i) {
215
- return i[uidFieldKey] === active.id;
216
- });
217
- var overIndex = dataList.findIndex(function (i) {
218
- return i[uidFieldKey] === (over === null || over === void 0 ? void 0 : over.id);
219
- });
220
- var dataListNew = arrayMove(dataList, activeIndex, overIndex);
221
- form.setFields([{
222
- name: formListCompleteNameFt,
223
- value: dataListNew
224
- }]);
225
- onDragChange === null || onDragChange === void 0 || onDragChange(dataListNew, {
226
- activeId: active.id,
227
- overId: over === null || over === void 0 ? void 0 : over.id,
228
- activeIndex: activeIndex,
229
- overIndex: overIndex
230
- });
231
- }
232
- };
233
- return /*#__PURE__*/jsx(DndContext, {
234
- sensors: sensors,
235
- modifiers: [restrictToVerticalAxis],
236
- onDragEnd: onDragEnd,
237
- children: /*#__PURE__*/jsx(SortableContext, {
238
- items: (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (i) {
239
- return i[uidFieldKey];
240
- })) || [],
241
- strategy: verticalListSortingStrategy,
242
- children: /*#__PURE__*/jsx(EditableCard, _objectSpread2(_objectSpread2({
243
- formListName: formListName,
244
- formListCompleteName: formListCompleteName
245
- }, otherProps), {}, {
246
- onCustomWrapper: function onCustomWrapper(children, extraData) {
247
- if (disabledDrag) {
248
- return /*#__PURE__*/jsx(Handle2, {
249
- extraData: extraData,
250
- children: children
251
- }, extraData.key);
252
- }
253
- var target = form.getFieldValue([].concat(_toConsumableArray(toArray(formListCompleteNameFt)), [extraData.fieldItem.name]));
254
- if (!(target !== null && target !== void 0 && target[uidFieldKey])) {
255
- console.error("\u552F\u4E00\u503C\u5B57\u6BB5\u3010".concat(uidFieldKey, "\u3011\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F"), target);
256
- return /*#__PURE__*/jsx(Handle2, {
257
- extraData: extraData,
258
- children: children
259
- }, extraData.key);
260
- }
261
- return /*#__PURE__*/jsx(Handle, {
262
- dragIcon: dragIcon,
263
- rowId: target === null || target === void 0 ? void 0 : target[uidFieldKey],
264
- extraData: extraData,
265
- dragTriggerPosition: dragTriggerPosition,
266
- children: children
267
- }, extraData.key);
268
- }
269
- }))
270
- })
271
- });
272
- };
273
-
274
- export { DragEditableCard };
59
+ import '@ant-design/icons/es/icons/DragOutlined.js';
60
+ import '@dnd-kit/utilities';
275
61
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["@flatbiz/antd/src/drag-editable-card/handle.tsx","@flatbiz/antd/src/drag-editable-card/handle2.tsx","@flatbiz/antd/src/drag-editable-card/editable-card.tsx"],"sourcesContent":["import { type ReactElement } from 'react';\nimport type { FormListFieldData, FormListOperation } from 'antd';\nimport { type RowProps, Space } from 'antd';\nimport { DragOutlined } from '@ant-design/icons';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { noop } from '@flatbiz/utils';\nimport { CardWrapper } from '../card-wrapper/card-wrapper.jsx';\nimport { DeleteNode } from '../delete-node/delete-node.jsx';\nimport { IconWrapper } from '../icon-wrapper/icon-wrapper.jsx';\n\ntype HandleProps = RowProps & {\n dragIcon?: ReactElement;\n rowId: string;\n children: ReactElement;\n extraData: {\n operation: FormListOperation;\n fields: FormListFieldData[];\n index: number;\n required?: boolean;\n };\n dragTriggerPosition?: 'left' | 'right';\n};\nexport const Handle = (props: HandleProps) => {\n const { dragIcon, rowId, dragTriggerPosition, ...innerProps } = props;\n\n const dragTriggerPositionFt = dragTriggerPosition || 'left';\n const {\n setActivatorNodeRef,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({\n id: rowId,\n });\n\n const style: React.CSSProperties = {\n ...innerProps.style,\n transform: CSS.Transform.toString(transform && { ...transform, scaleY: 1 }),\n transition,\n cursor: 'move',\n ...(isDragging\n ? {\n position: 'relative',\n zIndex: 9999,\n boxShadow: ' 0px 0px 12px 4px rgba(34, 33, 81, 0.1)',\n backgroundColor: 'var(--block-bg-color)',\n }\n : {}),\n };\n const iconElement = dragIcon || <DragOutlined />;\n return (\n <div ref={setNodeRef} key={rowId} style={style}>\n <CardWrapper\n size=\"small\"\n style={{ marginBottom: 10 }}\n extra={\n <Space size={10}>\n <DeleteNode\n style={{ color: 'red' }}\n hidden={\n props.extraData.required && props.extraData.fields.length === 1\n }\n onDelete={() => {\n props.extraData.operation.remove(props.extraData.index);\n }}\n />\n {dragTriggerPositionFt === 'right' ? (\n <span\n ref={setActivatorNodeRef}\n style={{\n touchAction: 'none',\n cursor: 'move',\n }}\n {...listeners}\n >\n <IconWrapper\n style={{\n touchAction: 'none',\n cursor: 'move',\n padding: '3px',\n margin: 0,\n justifyContent: 'center',\n color: '#787878',\n }}\n icon={iconElement}\n onClick={noop}\n size=\"small\"\n />\n </span>\n ) : null}\n </Space>\n }\n title={\n <Space size={5}>\n {dragTriggerPositionFt === 'left' ? (\n <span\n ref={setActivatorNodeRef}\n style={{\n touchAction: 'none',\n cursor: 'move',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n {...listeners}\n >\n <IconWrapper\n style={{\n touchAction: 'none',\n cursor: 'move',\n padding: '3px',\n margin: 0,\n justifyContent: 'center',\n color: '#787878',\n }}\n icon={iconElement}\n onClick={noop}\n size=\"small\"\n />\n </span>\n ) : null}\n <span>第{props.extraData.index + 1}行</span>\n </Space>\n }\n >\n {props.children}\n </CardWrapper>\n </div>\n );\n};\n","import { type ReactElement } from 'react';\nimport type { FormListFieldData, FormListOperation } from 'antd';\nimport { type RowProps } from 'antd';\nimport { CardWrapper } from '../card-wrapper/card-wrapper.jsx';\nimport { DeleteNode } from '../delete-node/delete-node.jsx';\n\ntype Handle2Props = RowProps & {\n children: ReactElement;\n extraData: {\n operation: FormListOperation;\n fields: FormListFieldData[];\n index: number;\n required?: boolean;\n };\n};\nexport const Handle2 = (props: Handle2Props) => {\n return (\n <CardWrapper\n size=\"small\"\n style={{ marginBottom: 10 }}\n extra={\n <DeleteNode\n style={{ color: 'red' }}\n hidden={\n props.extraData.required && props.extraData.fields.length === 1\n }\n onDelete={() => {\n props.extraData.operation.remove(props.extraData.index);\n }}\n />\n }\n title={`第${props.extraData.index + 1}行`}\n >\n {props.children}\n </CardWrapper>\n );\n};\n","import { type ReactElement } from 'react';\nimport { Form } from 'antd';\nimport {\n DndContext,\n type DragEndEvent,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport { restrictToVerticalAxis } from '@dnd-kit/modifiers';\nimport {\n arrayMove,\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport { toArray, type TPlainObject } from '@flatbiz/utils';\nimport { EditableCard } from '../editable-card/editable-card.jsx';\nimport type { EditableCardProps } from '../editable-card/type.js';\nimport { Handle } from './handle.jsx';\nimport { Handle2 } from './handle2.jsx';\n\nexport type DragEditableCardProps = Omit<\n EditableCardProps,\n 'onCustomWrapper'\n> & {\n /**\n * 拖拽图标自定义,默认使用 DragOutlined 图标\n */\n dragIcon?: ReactElement;\n\n /** 禁用拖拽 */\n disabledDrag?: boolean;\n /**\n * 表格数据唯一值字段Key\n * ```\n * ```\n */\n uidFieldKey: string;\n /**\n * 拖拽结束事件\n * ```\n * dataSource: 拖拽完成后的数据源\n * dragData\n * 1. activeId 拖拽ID\n * 2. activeIndex 拖拽起始表格数组索引值\n * 3. overIndex 拖拽结束表格数组索引值\n * ```\n */\n onDragChange?: (\n dataSource: TPlainObject[],\n dragData: {\n activeId: string | number;\n overId?: string | number;\n activeIndex: number;\n overIndex: number;\n }\n ) => void;\n /**\n * 拖拽触发位置,默认在左侧\n */\n dragTriggerPosition?: 'left' | 'right';\n};\n\n/**\n * 可拖拽编辑卡片\n * ```\n * 1. 卡片数组必须有唯一值字段,通过参数 uidFieldKey 告诉组件\n * ```\n */\nexport const DragEditableCard = (props: DragEditableCardProps) => {\n const {\n dragIcon,\n uidFieldKey,\n onDragChange,\n disabledDrag,\n formListCompleteName,\n formListName,\n dragTriggerPosition,\n ...otherProps\n } = props;\n\n const formListCompleteNameFt = formListCompleteName || formListName;\n\n const form = Form.useFormInstance();\n const dataList = Form.useWatch(formListCompleteNameFt, form);\n\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n // 当拖拽触发区域有其他点击事件时,需要延迟触发拖拽动作\n delay: 0,\n tolerance: 0,\n },\n })\n );\n\n const onDragEnd = ({ active, over }: DragEndEvent) => {\n if (active.id !== over?.id) {\n const activeIndex = dataList.findIndex(\n (i) => i[uidFieldKey] === active.id\n );\n const overIndex = dataList.findIndex((i) => i[uidFieldKey] === over?.id);\n const dataListNew = arrayMove(dataList, activeIndex, overIndex);\n form.setFields([\n {\n name: formListCompleteNameFt,\n value: dataListNew,\n },\n ]);\n onDragChange?.(dataListNew as TPlainObject[], {\n activeId: active.id,\n overId: over?.id,\n activeIndex,\n overIndex,\n });\n }\n };\n\n return (\n <DndContext\n sensors={sensors}\n modifiers={[restrictToVerticalAxis]}\n onDragEnd={onDragEnd}\n >\n <SortableContext\n items={dataList?.map((i) => i[uidFieldKey]) || []}\n strategy={verticalListSortingStrategy}\n >\n <EditableCard\n formListName={formListName}\n formListCompleteName={formListCompleteName}\n {...otherProps}\n onCustomWrapper={(children, extraData) => {\n if (disabledDrag) {\n return (\n <Handle2 key={extraData.key} extraData={extraData}>\n {children}\n </Handle2>\n );\n }\n\n const target = form.getFieldValue([\n ...toArray(formListCompleteNameFt),\n extraData.fieldItem.name,\n ]);\n\n if (!target?.[uidFieldKey]) {\n console.error(\n `唯一值字段【${uidFieldKey}】为空,无法进行拖拽排序`,\n target\n );\n return (\n <Handle2 key={extraData.key} extraData={extraData}>\n {children}\n </Handle2>\n );\n }\n return (\n <Handle\n key={extraData.key}\n dragIcon={dragIcon}\n rowId={target?.[uidFieldKey]}\n extraData={extraData}\n dragTriggerPosition={dragTriggerPosition}\n >\n {children}\n </Handle>\n );\n }}\n />\n </SortableContext>\n </DndContext>\n );\n};\n"],"names":["Handle","props","dragIcon","rowId","dragTriggerPosition","innerProps","_objectWithoutProperties","_excluded","dragTriggerPositionFt","_useSortable","useSortable","id","setActivatorNodeRef","listeners","setNodeRef","transform","transition","isDragging","style","_objectSpread","CSS","Transform","toString","scaleY","cursor","position","zIndex","boxShadow","backgroundColor","iconElement","_jsx","_DragOutlined","ref","children","CardWrapper","size","marginBottom","extra","_jsxs","Space","DeleteNode","color","hidden","extraData","required","fields","length","onDelete","operation","remove","index","touchAction","IconWrapper","padding","margin","justifyContent","icon","onClick","noop","title","display","alignItems","Handle2","concat","DragEditableCard","uidFieldKey","onDragChange","disabledDrag","formListCompleteName","formListName","otherProps","formListCompleteNameFt","form","Form","useFormInstance","dataList","useWatch","sensors","useSensors","useSensor","PointerSensor","activationConstraint","delay","tolerance","onDragEnd","_ref","active","over","activeIndex","findIndex","i","overIndex","dataListNew","arrayMove","setFields","name","value","activeId","overId","DndContext","modifiers","restrictToVerticalAxis","SortableContext","items","map","strategy","verticalListSortingStrategy","EditableCard","onCustomWrapper","key","target","getFieldValue","_toConsumableArray","toArray","fieldItem","console","error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAMA,MAAM,GAAG,SAATA,MAAMA,CAAIC,KAAkB,EAAK;AAC5C,EAAA,IAAQC,QAAQ,GAAgDD,KAAK,CAA7DC,QAAQ;IAAEC,KAAK,GAAyCF,KAAK,CAAnDE,KAAK;IAAEC,mBAAmB,GAAoBH,KAAK,CAA5CG,mBAAmB;AAAKC,IAAAA,UAAU,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,WAAA,CAAA;AAErE,EAAA,IAAMC,qBAAqB,GAAGJ,mBAAmB,IAAI,MAAM;EAC3D,IAAAK,YAAA,GAOIC,WAAW,CAAC;AACdC,MAAAA,EAAE,EAAER;AACN,KAAC,CAAC;IARAS,mBAAmB,GAAAH,YAAA,CAAnBG,mBAAmB;IACnBC,SAAS,GAAAJ,YAAA,CAATI,SAAS;IACTC,UAAU,GAAAL,YAAA,CAAVK,UAAU;IACVC,SAAS,GAAAN,YAAA,CAATM,SAAS;IACTC,UAAU,GAAAP,YAAA,CAAVO,UAAU;IACVC,UAAU,GAAAR,YAAA,CAAVQ,UAAU;EAKZ,IAAMC,KAA0B,GAAAC,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,EAAEA,SAAU;AAAAV,cAAAA,QAAA,EAC/CA;aADWU,EAAAA,SAAS,CAACkE,GAEf,CAAC;AAEd;UACA,oBACE/E,GAAA,CAAC9B,MAAM,EAAA;AAELE,YAAAA,QAAQ,EAAEA,QAAS;YACnBC,KAAK,EAAE2G,MAAM,KAANA,IAAAA,IAAAA,MAAM,uBAANA,MAAM,CAAG7C,WAAW,CAAE;AAC7BtB,YAAAA,SAAS,EAAEA,SAAU;AACrBvC,YAAAA,mBAAmB,EAAEA,mBAAoB;AAAA6B,YAAAA,QAAA,EAExCA;WANIU,EAAAA,SAAS,CAACkE,GAOT,CAAC;AAEb;OACD,CAAA;KACc;AAAC,GACR,CAAC;AAEjB;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,13 +8,13 @@ import './../tag-list-render/index.css';
8
8
  import './index.css';
9
9
  /*! @flatjs/forge MIT @flatbiz/antd */
10
10
 
11
- export { D as DragEditableTable } from '../drag-DVV-pdrI.js';
11
+ export { D as DragEditableTable } from '../drag-CmsvsrRy.js';
12
12
  import '../_rollupPluginBabelHelpers-BYm17lo8.js';
13
13
  import 'antd';
14
14
  import '@dnd-kit/core';
15
15
  import '@dnd-kit/modifiers';
16
16
  import '@dnd-kit/sortable';
17
- import '../editable-table-Ch7M44bV.js';
17
+ import '../editable-table-BoHT2BFh.js';
18
18
  import '@ant-design/icons/es/icons/PlusOutlined.js';
19
19
  import '@dimjs/utils/class-names/class-names';
20
20
  import 'react';
@@ -47,19 +47,19 @@ import '../symbol-CX0y_DJ4.js';
47
47
  import '../tips-wrapper-Bf9nfZq3.js';
48
48
  import '@ant-design/icons/es/icons/QuestionCircleOutlined.js';
49
49
  import '../form-item-hidden-B9afZdSe.js';
50
- import '../cell-render-pwSRW4nx.js';
50
+ import '../cell-render-D78pj8ON.js';
51
51
  import '@dimjs/lang/is-string';
52
52
  import '@dimjs/lang/is-object';
53
53
  import '@dimjs/utils/get/get';
54
54
  import '@dimjs/lang/is-plain-object';
55
55
  import '@dimjs/lang/is-empty';
56
- import '../button-operate-CWu3PARq.js';
56
+ import '../button-operate-BDJArgIt.js';
57
57
  import '@ant-design/icons/es/icons/MoreOutlined.js';
58
58
  import '@dimjs/lang/is-undefined';
59
- import '../dropdown-menu-wrapper-F5A3o-Jt.js';
59
+ import '../dropdown-menu-wrapper-BiX-W1eB.js';
60
60
  import '@ant-design/icons/es/icons/ExclamationCircleFilled.js';
61
- import '../dialog-confirm-DQdfsMXv.js';
62
- import '../dialog-modal-DbTrsUc2.js';
61
+ import '../dialog-confirm-CrNU6BCC.js';
62
+ import '../dialog-modal-CswobYJZ.js';
63
63
  import 'react-dom/client';
64
64
  import 'ahooks';
65
65
  import '../flex-layout-BaDncU_Z.js';
@@ -5,7 +5,7 @@ import './../fba-utils/index.css';
5
5
  import './index.css';
6
6
  /*! @flatjs/forge MIT @flatbiz/antd */
7
7
 
8
- export { D as DropdownMenuWrapper } from '../dropdown-menu-wrapper-F5A3o-Jt.js';
8
+ export { D as DropdownMenuWrapper } from '../dropdown-menu-wrapper-BiX-W1eB.js';
9
9
  import '@dimjs/utils/class-names/class-names';
10
10
  import '@ant-design/icons/es/icons/ExclamationCircleFilled.js';
11
11
  import '../_rollupPluginBabelHelpers-BYm17lo8.js';
@@ -36,8 +36,8 @@ import 'react/jsx-runtime';
36
36
  import '../fba-utils-Dfbczn1S.js';
37
37
  import '@dimjs/lang/is-array';
38
38
  import '@dimjs/model';
39
- import '../dialog-confirm-DQdfsMXv.js';
40
- import '../dialog-modal-DbTrsUc2.js';
39
+ import '../dialog-confirm-CrNU6BCC.js';
40
+ import '../dialog-modal-CswobYJZ.js';
41
41
  import '@dimjs/lang/is-string';
42
42
  import 'react-dom/client';
43
43
  import 'ahooks';
@@ -7,7 +7,7 @@ import { hooks } from '@wove/react/hooks';
7
7
  import { Fragment, useMemo, createElement } from 'react';
8
8
  import { Dropdown } from 'antd';
9
9
  import { B as ButtonWrapper } from './button-wrapper-l9FUsrWl.js';
10
- import { d as dialogConfirm } from './dialog-confirm-DQdfsMXv.js';
10
+ import { d as dialogConfirm } from './dialog-confirm-CrNU6BCC.js';
11
11
  import { f as fbaUtils } from './fba-utils-Dfbczn1S.js';
12
12
  import { F as FlexLayout } from './flex-layout-BaDncU_Z.js';
13
13
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -153,4 +153,4 @@ var DropdownMenuWrapper = function DropdownMenuWrapper(props) {
153
153
  };
154
154
 
155
155
  export { DropdownMenuWrapper as D };
156
- //# sourceMappingURL=dropdown-menu-wrapper-F5A3o-Jt.js.map
156
+ //# sourceMappingURL=dropdown-menu-wrapper-BiX-W1eB.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu-wrapper-F5A3o-Jt.js","sources":["@flatbiz/antd/src/dropdown-menu-wrapper/utils.ts","@flatbiz/antd/src/dropdown-menu-wrapper/dropdown-menu-wrapper.tsx"],"sourcesContent":["export function parentsHasSticky(node: Element) {\n let condition = true;\n let result = false;\n while (condition) {\n if (node.tagName === 'HTML' || node.tagName === 'BODY') {\n condition = false;\n result = false;\n } else {\n const { position } = window.getComputedStyle(node);\n if (position === 'sticky') {\n result = true;\n condition = false;\n } else {\n if (!node || !node.parentNode) {\n condition = false;\n } else {\n node = node.parentNode as Element;\n }\n }\n }\n }\n return result;\n}\n","import type { ReactElement } from 'react';\nimport { Fragment, useMemo } from 'react';\nimport type { ButtonProps, DropdownProps } from 'antd';\nimport { Dropdown } from 'antd';\nimport { type ItemType } from 'antd/es/menu/interface.js';\nimport { ExclamationCircleFilled } from '@ant-design/icons';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { ButtonWrapper } from '../button-wrapper/button-wrapper.jsx';\nimport { dialogConfirm } from '../dialog-confirm/index.js';\nimport type { DialogModalProps } from '../dialog-modal/index.js';\nimport { fbaUtils } from '../fba-utils/index.js';\nimport { FlexLayout } from '../flex-layout/flex-layout.jsx';\nimport { parentsHasSticky } from './utils.js';\nimport './style.less';\n\nexport interface DropdownMenuItem extends Omit<ButtonProps, 'color'> {\n text?: string | ReactElement;\n color?: string;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n permission?: string;\n needConfirm?: boolean;\n confirmMessage?: string;\n hidden?: boolean;\n confirmModalProps?: DialogModalProps;\n stopPropagation?: boolean;\n}\n\nexport interface DropdownMenuWrapperProps extends Omit<DropdownProps, 'menu'> {\n menuList: Array<DropdownMenuItem | null>;\n /** dropdown 设置弹框根节点在body下 */\n isFixed?: boolean;\n}\n\n/**\n * DropdownMenuWrapper\n * 升级 antd 5.5.1 后,Dropdown 中 Popconfirm弹框使用存在问题,所以在 @flatbiz/antd@4.2.49版本修改为使用dialogConfirm组件实现二次弹框确认功能\n * @param props\n * @returns\n * ```\n * 1. Dropdown默认弹框根节点在组件内部,通过isFixed=true可设置弹框根节点在body下\n * ```\n */\nexport const DropdownMenuWrapper = (props: DropdownMenuWrapperProps) => {\n const { menuList, ...dropdownOtherProps } = props;\n const clsName = hooks.useId(undefined, 'DropdownMenuWrapper');\n\n const onClick = hooks.useCallbackRef((item: DropdownMenuItem, event) => {\n if (item.needConfirm) {\n dialogConfirm.open({\n title: (\n <FlexLayout direction=\"horizontal\" fullIndex={1} gap={8}>\n <ExclamationCircleFilled style={{ color: '#faad14' }} />\n <span>{item.title}</span>\n </FlexLayout>\n ),\n content: <Fragment>{item.confirmMessage}</Fragment>,\n onOk: item.onClick?.bind(null, event),\n okButtonProps: {\n loadingPosition: 'center',\n },\n ...item.confirmModalProps,\n });\n return Promise.resolve();\n }\n event.stopPropagation();\n return item.onClick?.(event);\n });\n\n const target = document.querySelector(`.${clsName}`);\n const container = useMemo(() => {\n if (props.isFixed || (target && parentsHasSticky(target))) {\n return undefined;\n }\n return target;\n }, [props.isFixed, target]);\n\n const menuItems = useMemo(() => {\n const menuItemsNew: ItemType[] = [];\n menuList.filter(Boolean).forEach((item, index) => {\n if (!item) return;\n const {\n text,\n permission,\n needConfirm,\n confirmMessage,\n hidden,\n type,\n confirmModalProps,\n ...otherProps\n } = item;\n if (hidden) return;\n if (permission && !fbaUtils.hasPermission(permission)) return;\n const buttonType = type || 'link';\n const danger = otherProps.color ? false : needConfirm;\n menuItemsNew.push({\n key: index,\n label: (\n <ButtonWrapper\n loadingPosition=\"center\"\n size=\"small\"\n danger={danger}\n {...otherProps}\n style={{ ...otherProps.style }}\n className={classNames('dmw-item-button', otherProps.className)}\n type={buttonType}\n key={index}\n onClick={onClick.bind(null, {\n ...item,\n needConfirm,\n confirmMessage,\n confirmModalProps,\n })}\n >\n {text}\n </ButtonWrapper>\n ),\n });\n });\n return menuItemsNew;\n }, [menuList, onClick]);\n\n return (\n <div\n className={classNames('dropdown-menu-wrapper', clsName)}\n style={{ position: 'relative' }}\n >\n <Dropdown\n trigger={dropdownOtherProps?.trigger || ['hover']}\n getPopupContainer={container ? () => target as HTMLElement : undefined}\n arrow={{ pointAtCenter: true }}\n {...dropdownOtherProps}\n overlayStyle={{ zIndex: 9, ...dropdownOtherProps.overlayStyle }}\n menu={{ items: menuItems }}\n rootClassName=\"dropdown-menu-wrapper-popup\"\n >\n {props.children}\n </Dropdown>\n </div>\n );\n};\n"],"names":["parentsHasSticky","node","condition","result","tagName","_window$getComputedSt","window","getComputedStyle","position","parentNode","DropdownMenuWrapper","props","menuList","dropdownOtherProps","_objectWithoutProperties","_excluded","clsName","_hooks","useId","undefined","onClick","useCallbackRef","item","event","_item$onClick2","needConfirm","_item$onClick","dialogConfirm","open","_objectSpread","title","_jsxs","FlexLayout","direction","fullIndex","gap","children","_jsx","_ExclamationCircleFilled","style","color","content","Fragment","confirmMessage","onOk","bind","okButtonProps","loadingPosition","confirmModalProps","Promise","resolve","stopPropagation","call","target","document","querySelector","concat","container","useMemo","isFixed","menuItems","menuItemsNew","filter","Boolean","forEach","index","text","permission","hidden","type","otherProps","_excluded2","fbaUtils","hasPermission","buttonType","danger","push","key","label","_createElement","ButtonWrapper","size","className","_classNames","Dropdown","trigger","getPopupContainer","arrow","pointAtCenter","overlayStyle","zIndex","menu","items","rootClassName"],"mappings":";;;;;;;;;;;;;;AAAO,SAASA,gBAAgBA,CAACC,IAAa,EAAE;EAC9C,IAAIC,SAAS,GAAG,IAAI;EACpB,IAAIC,MAAM,GAAG,KAAK;AAClB,EAAA,OAAOD,SAAS,EAAE;IAChB,IAAID,IAAI,CAACG,OAAO,KAAK,MAAM,IAAIH,IAAI,CAACG,OAAO,KAAK,MAAM,EAAE;AACtDF,MAAAA,SAAS,GAAG,KAAK;AACjBC,MAAAA,MAAM,GAAG,KAAK;AAChB,KAAC,MAAM;AACL,MAAA,IAAAE,qBAAA,GAAqBC,MAAM,CAACC,gBAAgB,CAACN,IAAI,CAAC;QAA1CO,QAAQ,GAAAH,qBAAA,CAARG,QAAQ;MAChB,IAAIA,QAAQ,KAAK,QAAQ,EAAE;AACzBL,QAAAA,MAAM,GAAG,IAAI;AACbD,QAAAA,SAAS,GAAG,KAAK;AACnB,OAAC,MAAM;AACL,QAAA,IAAI,CAACD,IAAI,IAAI,CAACA,IAAI,CAACQ,UAAU,EAAE;AAC7BP,UAAAA,SAAS,GAAG,KAAK;AACnB,SAAC,MAAM;UACLD,IAAI,GAAGA,IAAI,CAACQ,UAAqB;AACnC;AACF;AACF;AACF;AACA,EAAA,OAAON,MAAM;AACf;;;;ACYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaO,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAA+B,EAAK;AACtE,EAAA,IAAQC,QAAQ,GAA4BD,KAAK,CAAzCC,QAAQ;AAAKC,IAAAA,kBAAkB,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,SAAA,CAAA;EACjD,IAAMC,OAAO,GAAGC,KAAA,CAAMC,KAAK,CAACC,SAAS,EAAE,qBAAqB,CAAC;EAE7D,IAAMC,OAAO,GA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GAAlBA,kBAAkB,CAAEwE,OAAO,KAAI,CAAC,OAAO,CAAE;MAClDC,iBAAiB,EAAE7B,SAAS,GAAG,YAAA;AAAA,QAAA,OAAMJ,MAAM;AAAA,OAAe,GAAGlC,SAAU;AACvEoE,MAAAA,KAAK,EAAE;AAAEC,QAAAA,aAAa,EAAE;AAAK;AAAE,KAAA,EAC3B3E,kBAAkB,CAAA,EAAA,EAAA,EAAA;AACtB4E,MAAAA,YAAY,EAAA5D,cAAA,CAAA;AAAI6D,QAAAA,MAAM,EAAE;OAAM7E,EAAAA,kBAAkB,CAAC4E,YAAY,CAAG;AAChEE,MAAAA,IAAI,EAAE;AAAEC,QAAAA,KAAK,EAAEhC;OAAY;AAC3BiC,MAAAA,aAAa,EAAC,6BAA6B;MAAAzD,QAAA,EAE1CzB,KAAK,CAACyB;KACC,CAAA;AAAC,GACR,CAAC;AAEV;;;;"}
1
+ {"version":3,"file":"dropdown-menu-wrapper-BiX-W1eB.js","sources":["@flatbiz/antd/src/dropdown-menu-wrapper/utils.ts","@flatbiz/antd/src/dropdown-menu-wrapper/dropdown-menu-wrapper.tsx"],"sourcesContent":["export function parentsHasSticky(node: Element) {\n let condition = true;\n let result = false;\n while (condition) {\n if (node.tagName === 'HTML' || node.tagName === 'BODY') {\n condition = false;\n result = false;\n } else {\n const { position } = window.getComputedStyle(node);\n if (position === 'sticky') {\n result = true;\n condition = false;\n } else {\n if (!node || !node.parentNode) {\n condition = false;\n } else {\n node = node.parentNode as Element;\n }\n }\n }\n }\n return result;\n}\n","import type { ReactElement } from 'react';\nimport { Fragment, useMemo } from 'react';\nimport type { ButtonProps, DropdownProps } from 'antd';\nimport { Dropdown } from 'antd';\nimport { type ItemType } from 'antd/es/menu/interface.js';\nimport { ExclamationCircleFilled } from '@ant-design/icons';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { ButtonWrapper } from '../button-wrapper/button-wrapper.jsx';\nimport { dialogConfirm } from '../dialog-confirm/index.js';\nimport type { DialogModalProps } from '../dialog-modal/index.js';\nimport { fbaUtils } from '../fba-utils/index.js';\nimport { FlexLayout } from '../flex-layout/flex-layout.jsx';\nimport { parentsHasSticky } from './utils.js';\nimport './style.less';\n\nexport interface DropdownMenuItem extends Omit<ButtonProps, 'color'> {\n text?: string | ReactElement;\n color?: string;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void | Promise<void>;\n permission?: string;\n needConfirm?: boolean;\n confirmMessage?: string;\n hidden?: boolean;\n confirmModalProps?: DialogModalProps;\n stopPropagation?: boolean;\n}\n\nexport interface DropdownMenuWrapperProps extends Omit<DropdownProps, 'menu'> {\n menuList: Array<DropdownMenuItem | null>;\n /** dropdown 设置弹框根节点在body下 */\n isFixed?: boolean;\n}\n\n/**\n * DropdownMenuWrapper\n * 升级 antd 5.5.1 后,Dropdown 中 Popconfirm弹框使用存在问题,所以在 @flatbiz/antd@4.2.49版本修改为使用dialogConfirm组件实现二次弹框确认功能\n * @param props\n * @returns\n * ```\n * 1. Dropdown默认弹框根节点在组件内部,通过isFixed=true可设置弹框根节点在body下\n * ```\n */\nexport const DropdownMenuWrapper = (props: DropdownMenuWrapperProps) => {\n const { menuList, ...dropdownOtherProps } = props;\n const clsName = hooks.useId(undefined, 'DropdownMenuWrapper');\n\n const onClick = hooks.useCallbackRef((item: DropdownMenuItem, event) => {\n if (item.needConfirm) {\n dialogConfirm.open({\n title: (\n <FlexLayout direction=\"horizontal\" fullIndex={1} gap={8}>\n <ExclamationCircleFilled style={{ color: '#faad14' }} />\n <span>{item.title}</span>\n </FlexLayout>\n ),\n content: <Fragment>{item.confirmMessage}</Fragment>,\n onOk: item.onClick?.bind(null, event),\n okButtonProps: {\n loadingPosition: 'center',\n },\n ...item.confirmModalProps,\n });\n return Promise.resolve();\n }\n event.stopPropagation();\n return item.onClick?.(event);\n });\n\n const target = document.querySelector(`.${clsName}`);\n const container = useMemo(() => {\n if (props.isFixed || (target && parentsHasSticky(target))) {\n return undefined;\n }\n return target;\n }, [props.isFixed, target]);\n\n const menuItems = useMemo(() => {\n const menuItemsNew: ItemType[] = [];\n menuList.filter(Boolean).forEach((item, index) => {\n if (!item) return;\n const {\n text,\n permission,\n needConfirm,\n confirmMessage,\n hidden,\n type,\n confirmModalProps,\n ...otherProps\n } = item;\n if (hidden) return;\n if (permission && !fbaUtils.hasPermission(permission)) return;\n const buttonType = type || 'link';\n const danger = otherProps.color ? false : needConfirm;\n menuItemsNew.push({\n key: index,\n label: (\n <ButtonWrapper\n loadingPosition=\"center\"\n size=\"small\"\n danger={danger}\n {...otherProps}\n style={{ ...otherProps.style }}\n className={classNames('dmw-item-button', otherProps.className)}\n type={buttonType}\n key={index}\n onClick={onClick.bind(null, {\n ...item,\n needConfirm,\n confirmMessage,\n confirmModalProps,\n })}\n >\n {text}\n </ButtonWrapper>\n ),\n });\n });\n return menuItemsNew;\n }, [menuList, onClick]);\n\n return (\n <div\n className={classNames('dropdown-menu-wrapper', clsName)}\n style={{ position: 'relative' }}\n >\n <Dropdown\n trigger={dropdownOtherProps?.trigger || ['hover']}\n getPopupContainer={container ? () => target as HTMLElement : undefined}\n arrow={{ pointAtCenter: true }}\n {...dropdownOtherProps}\n overlayStyle={{ zIndex: 9, ...dropdownOtherProps.overlayStyle }}\n menu={{ items: menuItems }}\n rootClassName=\"dropdown-menu-wrapper-popup\"\n >\n {props.children}\n </Dropdown>\n </div>\n );\n};\n"],"names":["parentsHasSticky","node","condition","result","tagName","_window$getComputedSt","window","getComputedStyle","position","parentNode","DropdownMenuWrapper","props","menuList","dropdownOtherProps","_objectWithoutProperties","_excluded","clsName","_hooks","useId","undefined","onClick","useCallbackRef","item","event","_item$onClick2","needConfirm","_item$onClick","dialogConfirm","open","_objectSpread","title","_jsxs","FlexLayout","direction","fullIndex","gap","children","_jsx","_ExclamationCircleFilled","style","color","content","Fragment","confirmMessage","onOk","bind","okButtonProps","loadingPosition","confirmModalProps","Promise","resolve","stopPropagation","call","target","document","querySelector","concat","container","useMemo","isFixed","menuItems","menuItemsNew","filter","Boolean","forEach","index","text","permission","hidden","type","otherProps","_excluded2","fbaUtils","hasPermission","buttonType","danger","push","key","label","_createElement","ButtonWrapper","size","className","_classNames","Dropdown","trigger","getPopupContainer","arrow","pointAtCenter","overlayStyle","zIndex","menu","items","rootClassName"],"mappings":";;;;;;;;;;;;;;AAAO,SAASA,gBAAgBA,CAACC,IAAa,EAAE;EAC9C,IAAIC,SAAS,GAAG,IAAI;EACpB,IAAIC,MAAM,GAAG,KAAK;AAClB,EAAA,OAAOD,SAAS,EAAE;IAChB,IAAID,IAAI,CAACG,OAAO,KAAK,MAAM,IAAIH,IAAI,CAACG,OAAO,KAAK,MAAM,EAAE;AACtDF,MAAAA,SAAS,GAAG,KAAK;AACjBC,MAAAA,MAAM,GAAG,KAAK;AAChB,KAAC,MAAM;AACL,MAAA,IAAAE,qBAAA,GAAqBC,MAAM,CAACC,gBAAgB,CAACN,IAAI,CAAC;QAA1CO,QAAQ,GAAAH,qBAAA,CAARG,QAAQ;MAChB,IAAIA,QAAQ,KAAK,QAAQ,EAAE;AACzBL,QAAAA,MAAM,GAAG,IAAI;AACbD,QAAAA,SAAS,GAAG,KAAK;AACnB,OAAC,MAAM;AACL,QAAA,IAAI,CAACD,IAAI,IAAI,CAACA,IAAI,CAACQ,UAAU,EAAE;AAC7BP,UAAAA,SAAS,GAAG,KAAK;AACnB,SAAC,MAAM;UACLD,IAAI,GAAGA,IAAI,CAACQ,UAAqB;AACnC;AACF;AACF;AACF;AACA,EAAA,OAAON,MAAM;AACf;;;;ACYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaO,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAA+B,EAAK;AACtE,EAAA,IAAQC,QAAQ,GAA4BD,KAAK,CAAzCC,QAAQ;AAAKC,IAAAA,kBAAkB,GAAAC,wBAAA,CAAKH,KAAK,EAAAI,SAAA,CAAA;EACjD,IAAMC,OAAO,GAAGC,KAAA,CAAMC,KAAK,CAAC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AAlBA,kBAAkB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAlBA,kBAAkB,CAAEwE,OAAO,KAAI,CAAC,OAAO,CAAE;MAClDC,iBAAiB,EAAE7B,SAAS,GAAG,YAAA;AAAA,QAAA,OAAMJ,MAAM;AAAA,OAAe,GAAGlC,SAAU;AACvEoE,MAAAA,KAAK,EAAE;AAAEC,QAAAA,aAAa,EAAE;AAAK;AAAE,KAAA,EAC3B3E,kBAAkB,CAAA,EAAA,EAAA,EAAA;AACtB4E,MAAAA,YAAY,EAAA5D,cAAA,CAAA;AAAI6D,QAAAA,MAAM,EAAE;OAAM7E,EAAAA,kBAAkB,CAAC4E,YAAY,CAAG;AAChEE,MAAAA,IAAI,EAAE;AAAEC,QAAAA,KAAK,EAAEhC;OAAY;AAC3BiC,MAAAA,aAAa,EAAC,6BAA6B;MAAAzD,QAAA,EAE1CzB,KAAK,CAACyB;KACC,CAAA;AAAC,GACR,CAAC;AAEV;;;;"}
@@ -1 +1 @@
1
- .block-layout{background-color:var(--block-bg-color)}.light-theme .block-layout{color:rgba(0,0,0,.88)}.dark-theme .block-layout{color:hsla(0,0%,100%,.85)}.bw-center-loading{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-btn.button-remove-gap{height:auto;line-height:normal;margin:0;min-height:auto;padding:0}.easy-form:not(".easy-form-pure"){background-color:var(--block-bg-color)}.easy-form-anchor{height:0;width:0}.easy-table-table{border-radius:6px}.fba-easy-table-filter-fixed,.fba-easy-table-full,.fba-easy-table-pagination-fixed{display:flex;flex-direction:column;height:100%}.fba-easy-table-filter-fixed .easy-table-table,.fba-easy-table-full .easy-table-table,.fba-easy-table-pagination-fixed .easy-table-table{flex:1}.fba-easy-table-filter-fixed{overflow:hidden}.fba-easy-table-filter-fixed .easy-table-table{overflow-y:auto}.fba-easy-table-wrapper{display:flex;flex-direction:column;height:100%;overflow-x:hidden}.fba-easy-table-wrapper .fba-easy-table{flex:1;height:unset;overflow-y:auto}.fba-easy-table-pagination{background-color:var(--block-bg-color);box-shadow:0 0 17px rgba(0,0,0,.06);padding:15px 15px 20px;position:relative;text-align:right;z-index:2}.fba-easy-table-wrapper-inline .easy-table-table{margin:0;padding:0}.fba-easy-table-wrapper-inline .easy-table-filter{margin:0;padding:0 0 15px}.easy-table-table{padding:10px 15px}.easy-table-filter{border-radius:6px;margin-bottom:10px;padding:10px 15px}.ett-empty-show-small .ant-table-placeholder .ant-empty{align-items:center;display:flex;justify-content:center;margin:0}.ett-empty-show-small .ant-table-placeholder .ant-empty-image{height:25px;margin:0;width:50px}.fold-operate-popiver.ant-popover .ant-popover-title{min-width:100px}.v-flex-layout{display:flex}.v-flex-vertical{flex-direction:column}.icon-wrapper{align-items:center;border-radius:6px;display:inline-flex;margin:0 -6px;padding:6px}.icon-wrapper .anticon+.icon-wrapper-text{margin-left:3px}.icon-wrapper-tigger{cursor:pointer}.icon-wrapper-tigger:hover{background-color:rgba(0,0,0,.06);position:relative;transform:scale(1.1);transition:all .1s ease-in}.icon-wrapper-small{border-radius:3px;font-size:14px;margin:0 -3px;padding:3px}.icon-wrapper-middle{font-size:16px}.icon-wrapper-large{font-size:20px}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor{margin:0;padding:0}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor:hover{background-color:transparent}.http-svg-view{display:inline-block;line-height:normal;overflow:hidden}.hsv-content{transform:translateX(-200px)}.hsv-content,.hsv-content img{height:100%;width:100%}.scrollbar-main{height:0;position:relative;width:0}.scrollbar-box{background:transparent;height:9px;overflow-x:auto;overflow-y:hidden;position:absolute}.scrollbar-box::-webkit-scrollbar{height:9px;width:9px}.scrollbar-box::-webkit-scrollbar-thumb{background:#ccc;border-radius:8px}.scrollbar-box::-webkit-scrollbar-thumb:hover{background:#666}.scrollbar-box::-webkit-scrollbar-track{background:transparent}.tips-wrapper{align-items:center;display:inline-flex}.tips-wrapper-icon{flex-shrink:0;opacity:.8}.tips-wrapper-text{flex:1;overflow:hidden}
1
+ .block-layout{background-color:var(--block-bg-color)}.light-theme .block-layout{color:rgba(0,0,0,.88)}.dark-theme .block-layout{color:hsla(0,0%,100%,.85)}.bw-center-loading{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-btn.button-remove-gap{height:auto;line-height:normal;margin:0;min-height:auto;padding:0}.easy-form:not(".easy-form-pure"){background-color:var(--block-bg-color)}.easy-form-anchor{height:0;width:0}.easy-table-table{border-radius:6px}.fba-easy-table-filter-fixed,.fba-easy-table-full,.fba-easy-table-pagination-fixed{display:flex;flex-direction:column;height:100%}.fba-easy-table-filter-fixed .easy-table-table,.fba-easy-table-full .easy-table-table,.fba-easy-table-pagination-fixed .easy-table-table{flex:1}.fba-easy-table-filter-fixed{overflow:hidden}.fba-easy-table-filter-fixed .easy-table-table{overflow-y:auto}.fba-easy-table-wrapper{display:flex;flex-direction:column;height:100%;overflow-x:hidden}.fba-easy-table-wrapper .fba-easy-table{flex:1;height:unset;overflow-y:auto}.fba-easy-table-pagination{background-color:var(--block-bg-color);box-shadow:0 0 17px rgba(0,0,0,.06);padding:15px 15px 20px;position:relative;z-index:2}.fba-easy-table-pagination .ant-pagination{justify-content:right}.fba-easy-table-wrapper-inline .easy-table-table{margin:0;padding:0}.fba-easy-table-wrapper-inline .easy-table-filter{margin:0;padding:0 0 15px}.easy-table-table{padding:10px 15px}.easy-table-filter{border-radius:6px;margin-bottom:10px;padding:10px 15px}.ett-empty-show-small .ant-table-placeholder .ant-empty{align-items:center;display:flex;justify-content:center;margin:0}.ett-empty-show-small .ant-table-placeholder .ant-empty-image{height:25px;margin:0;width:50px}.fold-operate-popiver.ant-popover .ant-popover-title{min-width:100px}.v-flex-layout{display:flex}.v-flex-vertical{flex-direction:column}.icon-wrapper{align-items:center;border-radius:6px;display:inline-flex;margin:0 -6px;padding:6px}.icon-wrapper .anticon+.icon-wrapper-text{margin-left:3px}.icon-wrapper-tigger{cursor:pointer}.icon-wrapper-tigger:hover{background-color:rgba(0,0,0,.06);position:relative;transform:scale(1.1);transition:all .1s ease-in}.icon-wrapper-small{border-radius:3px;font-size:14px;margin:0 -3px;padding:3px}.icon-wrapper-middle{font-size:16px}.icon-wrapper-large{font-size:20px}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor{margin:0;padding:0}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor:hover{background-color:transparent}.http-svg-view{display:inline-block;line-height:normal;overflow:hidden}.hsv-content{transform:translateX(-200px)}.hsv-content,.hsv-content img{height:100%;width:100%}.scrollbar-main{height:0;position:relative;width:0}.scrollbar-box{background:transparent;height:9px;overflow-x:auto;overflow-y:hidden;position:absolute}.scrollbar-box::-webkit-scrollbar{height:9px;width:9px}.scrollbar-box::-webkit-scrollbar-thumb{background:#ccc;border-radius:8px}.scrollbar-box::-webkit-scrollbar-thumb:hover{background:#666}.scrollbar-box::-webkit-scrollbar-track{background:transparent}.tips-wrapper{align-items:center;display:inline-flex}.tips-wrapper-icon{flex-shrink:0;opacity:.8}.tips-wrapper-text{flex:1;overflow:hidden}
@@ -190,7 +190,7 @@ export type EditableCardColumnItem = {
190
190
  */
191
191
  dataIndex: EditableCardDataIndex;
192
192
  /** 是否可编辑 */
193
- editable: boolean | ((record: TPlainObject, index: number) => boolean);
193
+ editable: boolean | ((operation: Pick<EditableCardOperation, "index" | "getCurrentRowData">, index: number) => boolean);
194
194
  /**
195
195
  * 布局占用网格数目(最大数值24)
196
196
  * ```
@@ -246,10 +246,12 @@ export type EditableCardColumnItem = {
246
246
  /**
247
247
  * 隐藏域设置
248
248
  * ```
249
- * 如果是动态隐藏,并且在逻辑切换后无效果,可尝试执行 render.operation.forceUpdate()
249
+ * 如果是动态隐藏,并且在逻辑切换后无效果,可尝试执行 operation.forceUpdate()
250
250
  * ```
251
251
  */
252
- hidden?: (record: TPlainObject, index: number) => boolean;
252
+ hidden?: (operation: EditableCardOperation, index: number) => boolean;
253
+ /** 直接移除,不再执行render,优先级高于 hidden */
254
+ remove?: (operation: EditableCardOperation, index: number) => boolean;
253
255
  };
254
256
  export type EditableCardProps = {
255
257
  className?: string;
@@ -286,6 +288,7 @@ export type EditableCardProps = {
286
288
  addRowDefaultValues?: () => TPlainObject;
287
289
  /** 隐藏底部`新增`按钮 */
288
290
  hiddenFooterBtn?: boolean;
291
+ addRowBtnName?: string;
289
292
  /** 顶部区域渲染 */
290
293
  contentBeforeRender?: (formListOperation: FormListOperation, nextRowIndex: number) => ReactElement | null;
291
294
  /** 底部区域渲染 */
@@ -345,11 +348,10 @@ export type EditableCardProps = {
345
348
  /**
346
349
  * 使用FormList实现可编辑卡片
347
350
  * ```
348
- * 1. EditableCard有两种模式,正常 & 禁用
349
- * 2. 必须在外部包裹Form组件
350
- * 3. 行内需要联动逻辑可使用 column.render.operation.setCurrentRowField 方法
351
- * 4. 可使用DragEditableCard组件实现拖拽排序
352
- * 5. 设置EditableCard disabled后,通过 LabelValueRender 组件展示数据,可通过 disabledRenderProps 配置布局
351
+ * 1. 必须在外部包裹Form组件
352
+ * 2. 行内需要联动逻辑可使用 column.render.operation.setCurrentRowField 方法
353
+ * 3. 可使用DragEditableCard组件实现拖拽排序
354
+ * 4. 设置EditableCard disabled后,通过 LabelValueRender 组件展示数据,可通过 disabledRenderProps 配置布局
353
355
  *
354
356
  * demo
355
357
  * https://fex.qa.tcshuke.com/docs/admin/main/form/grid