@flatbiz/antd 5.0.42 → 5.0.44
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/dist/button-operate/index.js +1 -1
- package/dist/{button-operate-DprXMhOZ.js → button-operate-BIWXX7to.js} +3 -2
- package/dist/button-operate-BIWXX7to.js.map +1 -0
- package/dist/cascader-wrapper/index.d.ts +1 -1
- package/dist/cascader-wrapper/index.js +2 -2
- package/dist/{cascader-wrapper-BFCjHaa9.js → cascader-wrapper-CMYrmR6L.js} +2 -2
- package/dist/{cascader-wrapper-BFCjHaa9.js.map → cascader-wrapper-CMYrmR6L.js.map} +1 -1
- package/dist/{cell-render-Btk1xTUj.js → cell-render-1gunNiMm.js} +11 -5
- package/dist/cell-render-1gunNiMm.js.map +1 -0
- package/dist/{color-picker-BYGCHXn2.js → color-picker-D8Tiiut0.js} +2 -2
- package/dist/{color-picker-BYGCHXn2.js.map → color-picker-D8Tiiut0.js.map} +1 -1
- package/dist/color-picker-wrapper/index.js +2 -2
- package/dist/copy-BSlIwnwz.js +98 -0
- package/dist/copy-BSlIwnwz.js.map +1 -0
- package/dist/copy-wrapper/index.d.ts +20 -3
- package/dist/copy-wrapper/index.js +4 -35
- package/dist/copy-wrapper/index.js.map +1 -1
- package/dist/delete-node/index.js +2 -2
- package/dist/{delete-node-BIETvJjg.js → delete-node-BXaXf6fO.js} +2 -2
- package/dist/{delete-node-BIETvJjg.js.map → delete-node-BXaXf6fO.js.map} +1 -1
- package/dist/dialog-drag-modal/index.js +2 -2
- package/dist/{drag-Dr-jbsnU.js → drag-CGxDk1SF.js} +3 -3
- package/dist/{drag-Dr-jbsnU.js.map → drag-CGxDk1SF.js.map} +1 -1
- package/dist/{drag-xBmmIPTD.js → drag-Dxvr0bSy.js} +2 -2
- package/dist/{drag-xBmmIPTD.js.map → drag-Dxvr0bSy.js.map} +1 -1
- package/dist/drag-editable-card/index.js +4 -4
- package/dist/drag-editable-table/index.d.ts +3 -1
- package/dist/drag-editable-table/index.js +11 -8
- package/dist/drag-editable-table/index.js.map +1 -1
- package/dist/drag-editable-table-pro/index.js +2 -2
- package/dist/{drag-modal-CyiFlQrA.js → drag-modal-C3Azghu3.js} +14 -14
- package/dist/{drag-modal-CyiFlQrA.js.map → drag-modal-C3Azghu3.js.map} +1 -1
- package/dist/drag-table/index.js +2 -2
- package/dist/{drag-table-B5s0LEwN.js → drag-table-Dk8HllSn.js} +2 -2
- package/dist/{drag-table-B5s0LEwN.js.map → drag-table-Dk8HllSn.js.map} +1 -1
- package/dist/{drawer-BITwshmb.js → drawer-6Cq1mcQa.js} +2 -73
- package/dist/drawer-6Cq1mcQa.js.map +1 -0
- package/dist/easy-table/index.js +1 -1
- package/dist/editable-card/index.js +3 -3
- package/dist/{editable-card-CnYsG1xL.js → editable-card-tyOSUivy.js} +2 -2
- package/dist/{editable-card-CnYsG1xL.js.map → editable-card-tyOSUivy.js.map} +1 -1
- package/dist/{editable-card-DdXga629.js → editable-card-zY9wCgE6.js} +4 -4
- package/dist/{editable-card-DdXga629.js.map → editable-card-zY9wCgE6.js.map} +1 -1
- package/dist/editable-field/index.js +2 -2
- package/dist/{editable-field-BH6M_S9W.js → editable-field-DBiVpCRE.js} +2 -2
- package/dist/{editable-field-BH6M_S9W.js.map → editable-field-DBiVpCRE.js.map} +1 -1
- package/dist/editable-table/index.css +1 -1
- package/dist/editable-table/index.d.ts +3 -1
- package/dist/editable-table/index.js +10 -6
- package/dist/editable-table/index.js.map +1 -1
- package/dist/{editable-table-Bsch15kT.js → editable-table-Ckl_Q1fk.js} +3 -3
- package/dist/{editable-table-Bsch15kT.js.map → editable-table-Ckl_Q1fk.js.map} +1 -1
- package/dist/icon-wrapper/index.d.ts +1 -0
- package/dist/icon-wrapper/index.js +1 -1
- package/dist/{icon-wrapper-DfWj_rer.js → icon-wrapper-DE97bI14.js} +6 -2
- package/dist/icon-wrapper-DE97bI14.js.map +1 -0
- package/dist/index-DSPRsDId.js +77 -0
- package/dist/index-DSPRsDId.js.map +1 -0
- package/dist/index.d.ts +36 -24
- package/dist/index.js +30 -46
- package/dist/index.js.map +1 -1
- package/dist/request-status/index.d.ts +1 -1
- package/dist/request-status/index.js +1 -1
- package/dist/{request-status-5M9DP8-J.js → request-status-CTleOQtX.js} +12 -6
- package/dist/request-status-CTleOQtX.js.map +1 -0
- package/dist/resizable-drawer/index.js +2 -1
- package/dist/resizable-drawer/index.js.map +1 -1
- package/dist/rich-text-viewer/index.js +2 -2
- package/dist/{rich-text-viewer-CPAJ3JD1.js → rich-text-viewer-FVi2i8nv.js} +2 -2
- package/dist/{rich-text-viewer-CPAJ3JD1.js.map → rich-text-viewer-FVi2i8nv.js.map} +1 -1
- package/dist/{selector-DGXElqt2.js → selector-fu9imgsR.js} +2 -2
- package/dist/{selector-DGXElqt2.js.map → selector-fu9imgsR.js.map} +1 -1
- package/dist/selector-wrapper/index.css +1 -1
- package/dist/selector-wrapper/index.d.ts +4 -1
- package/dist/selector-wrapper/index.js +9 -3
- package/dist/selector-wrapper/index.js.map +1 -1
- package/dist/{selector-wrapper-DfaplVbz.js → selector-wrapper-l88Z-JLK.js} +113 -47
- package/dist/selector-wrapper-l88Z-JLK.js.map +1 -0
- package/dist/selector-wrapper-search/index.d.ts +5 -1
- package/dist/selector-wrapper-search/index.js +3 -3
- package/dist/{selector-wrapper-search-DG0GPWl6.js → selector-wrapper-search-BMyOMlZl.js} +26 -8
- package/dist/selector-wrapper-search-BMyOMlZl.js.map +1 -0
- package/dist/selector-wrapper-simple/index.d.ts +1 -1
- package/dist/selector-wrapper-simple/index.js +2 -2
- package/dist/{selector-wrapper-simple-BE6H7nX7.js → selector-wrapper-simple-Vbt4cYNm.js} +2 -2
- package/dist/{selector-wrapper-simple-BE6H7nX7.js.map → selector-wrapper-simple-Vbt4cYNm.js.map} +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/table-cell-render/index.d.ts +6 -1
- package/dist/table-cell-render/index.js +3 -3
- package/dist/{tag-list-B0OTlda6.js → tag-list-DrmpuEDJ.js} +8 -2
- package/dist/tag-list-DrmpuEDJ.js.map +1 -0
- package/dist/tag-list-render/index.d.ts +2 -0
- package/dist/tag-list-render/index.js +1 -1
- package/dist/tree-modal/index.d.ts +1 -1
- package/dist/tree-modal/index.js +4 -4
- package/dist/tree-modal-selector/index.d.ts +1 -1
- package/dist/tree-modal-selector/index.js +4 -4
- package/dist/tree-selector-wrapper/index.d.ts +1 -1
- package/dist/tree-selector-wrapper/index.js +2 -2
- package/dist/tree-wrapper/index.d.ts +1 -1
- package/dist/tree-wrapper/index.js +5 -5
- package/dist/tree-wrapper/index.js.map +1 -1
- package/package.json +1 -7
- package/dist/ai-search/index.css +0 -1
- package/dist/ai-search/index.d.ts +0 -25
- package/dist/ai-search/index.js +0 -39
- package/dist/ai-search/index.js.map +0 -1
- package/dist/ai-search-BuvayoCT.js +0 -161
- package/dist/ai-search-BuvayoCT.js.map +0 -1
- package/dist/button-operate-DprXMhOZ.js.map +0 -1
- package/dist/cell-render-Btk1xTUj.js.map +0 -1
- package/dist/copy-BQVsCFXm.js +0 -283
- package/dist/copy-BQVsCFXm.js.map +0 -1
- package/dist/drawer-BITwshmb.js.map +0 -1
- package/dist/icon-wrapper-DfWj_rer.js.map +0 -1
- package/dist/request-status-5M9DP8-J.js.map +0 -1
- package/dist/selector-wrapper-DfaplVbz.js.map +0 -1
- package/dist/selector-wrapper-search-DG0GPWl6.js.map +0 -1
- package/dist/tag-list-B0OTlda6.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
4
|
|
|
5
|
-
export { D as DeleteNode } from '../delete-node-
|
|
5
|
+
export { D as DeleteNode } from '../delete-node-BXaXf6fO.js';
|
|
6
6
|
import '@ant-design/icons/es/icons/CloseCircleFilled.js';
|
|
7
7
|
import '@ant-design/icons/es/icons/DeleteOutlined.js';
|
|
8
8
|
import '@wove/react/hooks';
|
|
9
9
|
import '../_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
10
10
|
import 'react';
|
|
11
|
-
import '../icon-wrapper-
|
|
11
|
+
import '../icon-wrapper-DE97bI14.js';
|
|
12
12
|
import '@dimjs/utils/class-names/class-names';
|
|
13
13
|
import '@dimjs/lang/is-undefined';
|
|
14
14
|
import 'antd';
|
|
@@ -5,7 +5,7 @@ import _DeleteOutlined from '@ant-design/icons/es/icons/DeleteOutlined.js';
|
|
|
5
5
|
import { hooks } from '@wove/react/hooks';
|
|
6
6
|
import { a as _slicedToArray } from './_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
7
7
|
import { useState, useRef, Fragment } from 'react';
|
|
8
|
-
import { I as IconWrapper } from './icon-wrapper-
|
|
8
|
+
import { I as IconWrapper } from './icon-wrapper-DE97bI14.js';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
var DeleteNode = function DeleteNode(props) {
|
|
@@ -42,4 +42,4 @@ var DeleteNode = function DeleteNode(props) {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export { DeleteNode as D };
|
|
45
|
-
//# sourceMappingURL=delete-node-
|
|
45
|
+
//# sourceMappingURL=delete-node-BXaXf6fO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-node-
|
|
1
|
+
{"version":3,"file":"delete-node-BXaXf6fO.js","sources":["@flatbiz/antd/src/delete-node/delete-node.tsx"],"sourcesContent":["import type { CSSProperties, ReactElement } from 'react';\nimport { Fragment, useRef, useState } from 'react';\nimport { CloseCircleFilled, DeleteOutlined } from '@ant-design/icons';\nimport { type TAny } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { IconWrapper } from '../icon-wrapper/icon-wrapper.jsx';\n\n/** 删除节点,点击后会显示二次确认点击 */\nexport const DeleteNode = (props: {\n onDelete: () => void;\n /** 默认图标 */\n icon?: ReactElement;\n /** 确认图标 */\n confirmIcon?: ReactElement;\n /** 是否隐藏 */\n hidden?: boolean;\n style?: CSSProperties;\n className?: string;\n}) => {\n const [status, setStatus] = useState(false);\n const timeoutRef = useRef<TAny>();\n\n const onClick = hooks.useDebounceClick((event) => {\n event.stopPropagation();\n if (!status) {\n setStatus(true);\n timeoutRef.current = setTimeout(() => {\n setStatus(false);\n }, 3000);\n } else {\n clearTimeout(timeoutRef.current);\n setStatus(false);\n props.onDelete();\n }\n }, 300);\n\n if (props.hidden) return <Fragment />;\n\n return (\n <IconWrapper\n className={props.className}\n style={props.style}\n icon={\n !status ? (\n props.icon ? (\n props.icon\n ) : (\n <DeleteOutlined />\n )\n ) : props.confirmIcon ? (\n props.confirmIcon\n ) : (\n <CloseCircleFilled style={{ color: 'red' }} />\n )\n }\n onClick={onClick}\n size=\"small\"\n />\n );\n};\n"],"names":["DeleteNode","props","_useState","useState","_useState2","_slicedToArray","status","setStatus","timeoutRef","useRef","onClick","_hooks","useDebounceClick","event","stopPropagation","current","setTimeout","clearTimeout","onDelete","hidden","_jsx","Fragment","IconWrapper","className","style","icon","_DeleteOutlined","confirmIcon","_CloseCircleFilled","color","size"],"mappings":";;;;;;;;;;IAQaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,KAU1B,EAAK;AACJ,EAAA,IAAAC,SAAA,GAA4BC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAApCI,IAAAA,MAAM,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,SAAS,GAAAH,UAAA,CAAA,CAAA,CAAA;AACxB,EAAA,IAAMI,UAAU,GAAGC,MAAM,EAAQ;EAEjC,IAAMC,OAAO,GAAGC,KAAA,CAAMC,gBAAgB,CAAC,UAACC,KAAK,EAAK;IAChDA,KAAK,CAACC,eAAe,EAAE;IACvB,IAAI,CAACR,MAAM,EAAE;MACXC,SAAS,CAAC,IAAI,CAAC;AACfC,MAAAA,UAAU,CAACO,OAAO,GAAGC,UAAU,CAAC,YAAM;QACpCT,SAAS,CAAC,KAAK,CAAC;OACjB,EAAE,IAAI,CAAC;AACV,KAAC,MAAM;AACLU,MAAAA,YAAY,CAACT,UAAU,CAACO,OAAO,CAAC;MAChCR,SAAS,CAAC,KAAK,CAAC;MAChBN,KAAK,CAACiB,QAAQ,EAAE;AAClB;GACD,EAAE,GAAG,CAAC;EAEP,IAAIjB,KAAK,CAACkB,MAAM,EAAE,oBAAOC,GAAA,CAACC,QAAQ,EAAA,EAAE,CAAC;EAErC,oBACED,GAAA,CAACE,WAAW,EAAA;IACVC,SAAS,EAAEtB,KAAK,CAACsB,SAAU;IAC3BC,KAAK,EAAEvB,KAAK,CAACuB,KAAM;AACnBC,IAAAA,IAAI,EACF,CAACnB,MAAM,GACLL,KAAK,CAACwB,IAAI,GACRxB,KAAK,CAACwB,IAAI,gBAEVL,GAAA,CAAAM,eAAA,EAAA,EAAiB,CAClB,GACCzB,KAAK,CAAC0B,WAAW,GACnB1B,KAAK,CAAC0B,WAAW,gBAEjBP,GAAA,CAAAQ,kBAAA,EAAA;AAAmBJ,MAAAA,KAAK,EAAE;AAAEK,QAAAA,KAAK,EAAE;AAAM;AAAE,KAAE,CAEhD;AACDnB,IAAAA,OAAO,EAAEA,OAAQ;AACjBoB,IAAAA,IAAI,EAAC;AAAO,GACb,CAAC;AAEN;;;;"}
|
|
@@ -3,7 +3,7 @@ import './../fba-hooks/index.css';
|
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
5
|
|
|
6
|
-
export { d as dialogDragModal } from '../drag-modal-
|
|
6
|
+
export { d as dialogDragModal } from '../drag-modal-C3Azghu3.js';
|
|
7
7
|
import '@dimjs/lang/is-string';
|
|
8
8
|
import '@ant-design/icons/es/icons/CloseOutlined.js';
|
|
9
9
|
import '@dimjs/utils/class-names/class-names';
|
|
@@ -43,6 +43,6 @@ import '../fba-utils-okhb5eSJ.js';
|
|
|
43
43
|
import '@dimjs/lang/is-array';
|
|
44
44
|
import '@dimjs/model';
|
|
45
45
|
import '../gap-5v_ndf2v.js';
|
|
46
|
-
import '../icon-wrapper-
|
|
46
|
+
import '../icon-wrapper-DE97bI14.js';
|
|
47
47
|
import '@dimjs/lang/is-undefined';
|
|
48
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -5,13 +5,13 @@ import { Form } from 'antd';
|
|
|
5
5
|
import { useSensors, useSensor, PointerSensor, DndContext } from '@dnd-kit/core';
|
|
6
6
|
import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
|
|
7
7
|
import { useSortable, SortableContext, verticalListSortingStrategy, arrayMove } from '@dnd-kit/sortable';
|
|
8
|
-
import { E as EditableTable } from './editable-table-
|
|
8
|
+
import { E as EditableTable } from './editable-table-Ckl_Q1fk.js';
|
|
9
9
|
import { createCtx } from '@wove/react/create-ctx';
|
|
10
10
|
import _DragOutlined from '@ant-design/icons/es/icons/DragOutlined.js';
|
|
11
11
|
import { createElement, Children, cloneElement } from 'react';
|
|
12
12
|
import { CSS } from '@dnd-kit/utilities';
|
|
13
13
|
import { isUndefinedOrNull, noop } from '@flatbiz/utils';
|
|
14
|
-
import { I as IconWrapper } from './icon-wrapper-
|
|
14
|
+
import { I as IconWrapper } from './icon-wrapper-DE97bI14.js';
|
|
15
15
|
import { jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
var _createCtx = createCtx(),
|
|
@@ -178,4 +178,4 @@ var DragEditableTable = function DragEditableTable(props) {
|
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
export { DragEditableTable as D };
|
|
181
|
-
//# sourceMappingURL=drag-
|
|
181
|
+
//# sourceMappingURL=drag-CGxDk1SF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-Dr-jbsnU.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 {\n Children,\n cloneElement,\n type CSSProperties,\n type ReactElement,\n} 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: 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 ReactElement).key === '__sort') {\n return cloneElement(child as 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;;;ACa1B,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,YAA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AAA,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-CGxDk1SF.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 {\n Children,\n cloneElement,\n type CSSProperties,\n type ReactElement,\n} 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: 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 ReactElement).key === '__sort') {\n return cloneElement(child as 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;;;ACa1B,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,EA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9C,sBAAA,KAAAA,MAAAA,IAAAA,CAAAA,sBAAA,GAArBA,sBAAA,CAAuB+C,UAAU,cAAA/C,sBAAA,KAAA,MAAA,GAAA,MAAA,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;;;;"}
|
|
@@ -11,7 +11,7 @@ import _DragOutlined from '@ant-design/icons/es/icons/DragOutlined.js';
|
|
|
11
11
|
import { createElement, Children, cloneElement } from 'react';
|
|
12
12
|
import { CSS } from '@dnd-kit/utilities';
|
|
13
13
|
import { isUndefinedOrNull, noop } from '@flatbiz/utils';
|
|
14
|
-
import { I as IconWrapper } from './icon-wrapper-
|
|
14
|
+
import { I as IconWrapper } from './icon-wrapper-DE97bI14.js';
|
|
15
15
|
import { jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
var _createCtx = createCtx(),
|
|
@@ -183,4 +183,4 @@ var DragEditableTablePro = function DragEditableTablePro(props) {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
export { DragEditableTablePro as D };
|
|
186
|
-
//# sourceMappingURL=drag-
|
|
186
|
+
//# sourceMappingURL=drag-Dxvr0bSy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-xBmmIPTD.js","sources":["@flatbiz/antd/src/drag-editable-table-pro/context.ts","@flatbiz/antd/src/drag-editable-table-pro/table-tr-handle.tsx","@flatbiz/antd/src/drag-editable-table-pro/row.tsx","@flatbiz/antd/src/drag-editable-table-pro/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 {\n Children,\n cloneElement,\n type CSSProperties,\n type ReactElement,\n} 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: 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 ReactElement).key === '__sort') {\n return cloneElement(child as 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 { EditableTableProProps } from '../editable-table-pro/editable-table-pro.jsx';\nimport { EditableTablePro } from '../editable-table-pro/editable-table-pro.jsx';\nimport type { EditableTableProColumnItem } from '../editable-table-pro/type.js';\nimport { CtxProvider } from './context.js';\nimport { Row } from './row.jsx';\n\nexport type DragEditableTableProProps = EditableTableProProps & {\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 * ```\n * 1. 表格数据必须有唯一值字段,通过参数 uidFieldKey 告诉组件\n * 2. Table 参数 components.body.row 被组件内部使用\n * 3. 不存在多级的情况下,可使用DragEditableTablePro组件实现拖拽排序\n * 4. 存在多级的情况下,通过上移、下移操作按钮,调用 column.render.operation.move 方法实现同一级内移动\n * ```\n */\nexport const DragEditableTablePro = (props: DragEditableTableProProps) => {\n const {\n dragIcon,\n uidFieldKey,\n onDragChange,\n disabledDrag,\n formListCompleteName,\n formListName,\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 const columns: EditableTableProColumnItem[] = disabledDrag\n ? otherProps.columns\n : [\n {\n dataIndex: '__sort',\n width: 40,\n key: '__sort',\n align: 'center',\n } as EditableTableProColumnItem,\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 <EditableTablePro\n {...otherProps}\n formListName={formListName}\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","DragEditableTablePro","_otherProps$tableProp","_otherProps$tableProp2","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","columns","dataIndex","width","align","concat","DndContext","modifiers","restrictToVerticalAxis","SortableContext","items","strategy","verticalListSortingStrategy","EditableTablePro","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;;;ACa1B,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,UAAU;IACVC,SAAS,GAAAN,YAAA,CAATM,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AA;AACpC,aAAA;AACF,WAAA;SAEJ,CAAA;OACc;KACP;AAAC,GACF,CAAC;AAElB;;;;"}
|
|
1
|
+
{"version":3,"file":"drag-Dxvr0bSy.js","sources":["@flatbiz/antd/src/drag-editable-table-pro/context.ts","@flatbiz/antd/src/drag-editable-table-pro/table-tr-handle.tsx","@flatbiz/antd/src/drag-editable-table-pro/row.tsx","@flatbiz/antd/src/drag-editable-table-pro/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 {\n Children,\n cloneElement,\n type CSSProperties,\n type ReactElement,\n} 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: 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 ReactElement).key === '__sort') {\n return cloneElement(child as 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 { EditableTableProProps } from '../editable-table-pro/editable-table-pro.jsx';\nimport { EditableTablePro } from '../editable-table-pro/editable-table-pro.jsx';\nimport type { EditableTableProColumnItem } from '../editable-table-pro/type.js';\nimport { CtxProvider } from './context.js';\nimport { Row } from './row.jsx';\n\nexport type DragEditableTableProProps = EditableTableProProps & {\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 * ```\n * 1. 表格数据必须有唯一值字段,通过参数 uidFieldKey 告诉组件\n * 2. Table 参数 components.body.row 被组件内部使用\n * 3. 不存在多级的情况下,可使用DragEditableTablePro组件实现拖拽排序\n * 4. 存在多级的情况下,通过上移、下移操作按钮,调用 column.render.operation.move 方法实现同一级内移动\n * ```\n */\nexport const DragEditableTablePro = (props: DragEditableTableProProps) => {\n const {\n dragIcon,\n uidFieldKey,\n onDragChange,\n disabledDrag,\n formListCompleteName,\n formListName,\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 const columns: EditableTableProColumnItem[] = disabledDrag\n ? otherProps.columns\n : [\n {\n dataIndex: '__sort',\n width: 40,\n key: '__sort',\n align: 'center',\n } as EditableTableProColumnItem,\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 <EditableTablePro\n {...otherProps}\n formListName={formListName}\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","DragEditableTablePro","_otherProps$tableProp","_otherProps$tableProp2","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","columns","dataIndex","width","align","concat","DndContext","modifiers","restrictToVerticalAxis","SortableContext","items","strategy","verticalListSortingStrategy","EditableTablePro","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;;;ACa1B,IAAMI,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,KAA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AA,KAArBA,MAAAA,GAAAA,MAAAA,GAAAA,qBAAA,CAAuBkD,UAAU,CAAA,EAAA,EAAA,EAAA;cACpCC,IAAI,EAAAvF,cAAA,CAAAA,cAAA,MAAAqC,sBAAA,GACCM,UAAU,CAAC0C,UAAU,MAAA,IAAA,IAAAhD,sBAAA,KAAAA,MAAAA,IAAAA,CAAAA,sBAAA,GAArBA,sBAAA,CAAuBiD,UAAU,cAAAjD,sBAAA,KAAA,MAAA,GAAA,MAAA,GAAjCA,sBAAA,CAAmCkD,IAAI,CAAA,EAAA,EAAA,EAAA;AAC1CC,gBAAAA,GAAG,EAAEhD,YAAY,GAAGiD,SAAS,GAAGxD;AAAG,eAAA;AACpC,aAAA;AACF,WAAA;SAEJ,CAAA;OACc;KACP;AAAC,GACF,CAAC;AAElB;;;;"}
|
|
@@ -5,14 +5,14 @@ import './../pre-defined-class-name/index.css';
|
|
|
5
5
|
import './index.css';
|
|
6
6
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
7
7
|
|
|
8
|
-
export { D as DragEditableCard } from '../editable-card-
|
|
8
|
+
export { D as DragEditableCard } from '../editable-card-zY9wCgE6.js';
|
|
9
9
|
import '../_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
10
10
|
import 'antd';
|
|
11
11
|
import '@dnd-kit/core';
|
|
12
12
|
import '@dnd-kit/modifiers';
|
|
13
13
|
import '@dnd-kit/sortable';
|
|
14
14
|
import '@flatbiz/utils';
|
|
15
|
-
import '../editable-card-
|
|
15
|
+
import '../editable-card-tyOSUivy.js';
|
|
16
16
|
import '@ant-design/icons/es/icons/PlusOutlined.js';
|
|
17
17
|
import '@dimjs/utils/class-names/class-names';
|
|
18
18
|
import '@wove/react/hooks';
|
|
@@ -45,10 +45,10 @@ import '../fba-utils-okhb5eSJ.js';
|
|
|
45
45
|
import '@dimjs/lang/is-array';
|
|
46
46
|
import '@dimjs/model';
|
|
47
47
|
import '../card-wrapper-C8YADYlW.js';
|
|
48
|
-
import '../delete-node-
|
|
48
|
+
import '../delete-node-BXaXf6fO.js';
|
|
49
49
|
import '@ant-design/icons/es/icons/CloseCircleFilled.js';
|
|
50
50
|
import '@ant-design/icons/es/icons/DeleteOutlined.js';
|
|
51
|
-
import '../icon-wrapper-
|
|
51
|
+
import '../icon-wrapper-DE97bI14.js';
|
|
52
52
|
import '@dimjs/lang/is-undefined';
|
|
53
53
|
import '../form-ByFljQr9.js';
|
|
54
54
|
import '../form-wrapper-DBDMN0mN.js';
|
|
@@ -87,7 +87,7 @@ export type DateRangePickerWrapperProps = Omit<RangePickerDateProps, "value" | "
|
|
|
87
87
|
string
|
|
88
88
|
] | undefined;
|
|
89
89
|
};
|
|
90
|
-
export type TRequestStatus = "request-init" | "request-progress" | "request-success" | "request-error" | "no-dependencies-params";
|
|
90
|
+
export type TRequestStatus = "request-init" | "request-progress" | "request-success" | "request-error" | "request-search-keyword-empty" | "no-dependencies-params";
|
|
91
91
|
export type TRequestStatusProps = {
|
|
92
92
|
status?: TRequestStatus;
|
|
93
93
|
errorButton?: ReactElement;
|
|
@@ -193,6 +193,8 @@ export type SelectorWrapperProps = Omit<SelectProps, "onSearch" | "notFoundConte
|
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
195
|
useCache?: boolean;
|
|
196
|
+
/** 是否显示刷新图标 */
|
|
197
|
+
showRefreshIcon?: boolean;
|
|
196
198
|
};
|
|
197
199
|
export type SwitchWrapperValue = string | number | boolean;
|
|
198
200
|
export type SwitchWrapperProps = Omit<SwitchProps, "checked" | "defaultChecked" | "onChange" | "value"> & {
|
|
@@ -9,13 +9,13 @@ import './../tag-list-render/index.css';
|
|
|
9
9
|
import './index.css';
|
|
10
10
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
11
11
|
|
|
12
|
-
export { D as DragEditableTable } from '../drag-
|
|
12
|
+
export { D as DragEditableTable } from '../drag-CGxDk1SF.js';
|
|
13
13
|
import '../_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
14
14
|
import 'antd';
|
|
15
15
|
import '@dnd-kit/core';
|
|
16
16
|
import '@dnd-kit/modifiers';
|
|
17
17
|
import '@dnd-kit/sortable';
|
|
18
|
-
import '../editable-table-
|
|
18
|
+
import '../editable-table-Ckl_Q1fk.js';
|
|
19
19
|
import '@ant-design/icons/es/icons/PlusOutlined.js';
|
|
20
20
|
import '@dimjs/utils/class-names/class-names';
|
|
21
21
|
import 'react';
|
|
@@ -49,13 +49,13 @@ import '../symbol-DcM8okBP.js';
|
|
|
49
49
|
import '../tips-wrapper-DvbgHMwl.js';
|
|
50
50
|
import '@ant-design/icons/es/icons/QuestionCircleOutlined.js';
|
|
51
51
|
import '../form-item-hidden-BtQvJEx7.js';
|
|
52
|
-
import '../cell-render-
|
|
52
|
+
import '../cell-render-1gunNiMm.js';
|
|
53
53
|
import '@dimjs/lang/is-string';
|
|
54
54
|
import '@dimjs/lang/is-object';
|
|
55
55
|
import '@dimjs/utils/get/get';
|
|
56
56
|
import '@dimjs/lang/is-plain-object';
|
|
57
57
|
import '@dimjs/lang/is-empty';
|
|
58
|
-
import '../button-operate-
|
|
58
|
+
import '../button-operate-BIWXX7to.js';
|
|
59
59
|
import '@ant-design/icons/es/icons/MoreOutlined.js';
|
|
60
60
|
import '@dimjs/lang/is-undefined';
|
|
61
61
|
import '../dropdown-menu-wrapper-BE3Liqoh.js';
|
|
@@ -66,15 +66,19 @@ import 'react-dom/client';
|
|
|
66
66
|
import 'ahooks';
|
|
67
67
|
import '../flex-layout-BGtMe7zr.js';
|
|
68
68
|
import '@wove/react/create-ctx';
|
|
69
|
-
import '../tag-list-
|
|
69
|
+
import '../tag-list-DrmpuEDJ.js';
|
|
70
70
|
import '../date-picker-wrapper-D0_g483p.js';
|
|
71
71
|
import '../time-Cv4_lLXu.js';
|
|
72
72
|
import '../date-range-picker-wrapper-BYOsf0I5.js';
|
|
73
73
|
import '../input-wrapper-hEJP2UIk.js';
|
|
74
|
-
import '../selector-wrapper-
|
|
74
|
+
import '../selector-wrapper-l88Z-JLK.js';
|
|
75
75
|
import '@ant-design/icons/es/icons/RedoOutlined.js';
|
|
76
|
-
import '../
|
|
76
|
+
import '../index-DSPRsDId.js';
|
|
77
|
+
import '../_commonjsHelpers-nJh5OW6J.js';
|
|
78
|
+
import '../request-status-CTleOQtX.js';
|
|
77
79
|
import '../text-overflow-C42UFIyh.js';
|
|
80
|
+
import '@ant-design/icons/es/icons/SyncOutlined.js';
|
|
81
|
+
import '../icon-wrapper-DE97bI14.js';
|
|
78
82
|
import '@dimjs/lang/is-deep-equal';
|
|
79
83
|
import '@dimjs/utils/json/sort';
|
|
80
84
|
import 'pubsub-js';
|
|
@@ -87,5 +91,4 @@ import 'react-dom';
|
|
|
87
91
|
import '@ant-design/icons/es/icons/DeleteOutlined.js';
|
|
88
92
|
import '@ant-design/icons/es/icons/DragOutlined.js';
|
|
89
93
|
import '@dnd-kit/utilities';
|
|
90
|
-
import '../icon-wrapper-DfWj_rer.js';
|
|
91
94
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import './../pre-defined-class-name/index.css';
|
|
|
4
4
|
import './index.css';
|
|
5
5
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
6
6
|
|
|
7
|
-
export { D as DragEditableTablePro } from '../drag-
|
|
7
|
+
export { D as DragEditableTablePro } from '../drag-Dxvr0bSy.js';
|
|
8
8
|
import '../_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
9
9
|
import 'antd';
|
|
10
10
|
import '@dnd-kit/core';
|
|
@@ -49,6 +49,6 @@ import '@ant-design/icons/es/icons/QuestionCircleOutlined.js';
|
|
|
49
49
|
import '@wove/react/create-ctx';
|
|
50
50
|
import '@ant-design/icons/es/icons/DragOutlined.js';
|
|
51
51
|
import '@dnd-kit/utilities';
|
|
52
|
-
import '../icon-wrapper-
|
|
52
|
+
import '../icon-wrapper-DE97bI14.js';
|
|
53
53
|
import '@dimjs/lang/is-undefined';
|
|
54
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ import { classNames } from '@dimjs/utils/class-names/class-names';
|
|
|
6
6
|
import { isNumber } from '@dimjs/lang/is-number';
|
|
7
7
|
import { b as _objectSpread2, i as _defineProperty, e as _inherits, f as _createClass, g as _classCallCheck, h as _callSuper, a as _slicedToArray, _ as _objectWithoutProperties } from './_rollupPluginBabelHelpers-BspM60Sw.js';
|
|
8
8
|
import { hooks } from '@wove/react/hooks';
|
|
9
|
-
import
|
|
9
|
+
import require$$0, { useState, useMemo } from 'react';
|
|
10
10
|
import { createRoot } from 'react-dom/client';
|
|
11
11
|
import { a as getAugmentedNamespace, g as getDefaultExportFromCjs } from './_commonjsHelpers-nJh5OW6J.js';
|
|
12
12
|
import 'react-is';
|
|
@@ -17,9 +17,13 @@ import { dom } from '@flatbiz/utils';
|
|
|
17
17
|
import { B as ButtonWrapper } from './button-wrapper-DezyMqPx.js';
|
|
18
18
|
import { fbaHooks } from './fba-hooks/index.js';
|
|
19
19
|
import { G as Gap } from './gap-5v_ndf2v.js';
|
|
20
|
-
import { I as IconWrapper } from './icon-wrapper-
|
|
20
|
+
import { I as IconWrapper } from './icon-wrapper-DE97bI14.js';
|
|
21
21
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
22
22
|
|
|
23
|
+
var cjs = {exports: {}};
|
|
24
|
+
|
|
25
|
+
var Draggable$1 = {};
|
|
26
|
+
|
|
23
27
|
var propTypes = {exports: {}};
|
|
24
28
|
|
|
25
29
|
/**
|
|
@@ -116,10 +120,6 @@ function requirePropTypes() {
|
|
|
116
120
|
return propTypes.exports;
|
|
117
121
|
}
|
|
118
122
|
|
|
119
|
-
var cjs = {exports: {}};
|
|
120
|
-
|
|
121
|
-
var Draggable$1 = {};
|
|
122
|
-
|
|
123
123
|
function r(e) {
|
|
124
124
|
var t,
|
|
125
125
|
f,
|
|
@@ -675,7 +675,7 @@ function requireDraggableCore() {
|
|
|
675
675
|
value: true
|
|
676
676
|
});
|
|
677
677
|
DraggableCore.default = void 0;
|
|
678
|
-
var React
|
|
678
|
+
var React = _interopRequireWildcard(require$$0);
|
|
679
679
|
var _propTypes = _interopRequireDefault(/*@__PURE__*/requirePropTypes());
|
|
680
680
|
var _reactDom = _interopRequireDefault(require$$2);
|
|
681
681
|
var _domFns = requireDomFns();
|
|
@@ -1027,7 +1027,7 @@ function requireDraggableCore() {
|
|
|
1027
1027
|
value: function render() /*: React.Element<any>*/{
|
|
1028
1028
|
// Reuse the child provided
|
|
1029
1029
|
// This makes it flexible to use whatever element is wanted (div, ul, etc)
|
|
1030
|
-
return /*#__PURE__*/React
|
|
1030
|
+
return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), {
|
|
1031
1031
|
// Note: mouseMove handler is attached to document so it will still function
|
|
1032
1032
|
// when the user drags quickly and leaves the bounds of the element.
|
|
1033
1033
|
onMouseDown: this.onMouseDown,
|
|
@@ -1039,7 +1039,7 @@ function requireDraggableCore() {
|
|
|
1039
1039
|
});
|
|
1040
1040
|
}
|
|
1041
1041
|
}]);
|
|
1042
|
-
}(React
|
|
1042
|
+
}(React.Component /*:: <DraggableCoreProps>*/);
|
|
1043
1043
|
DraggableCore.default = DraggableCore$1;
|
|
1044
1044
|
_defineProperty(DraggableCore$1, "displayName", 'DraggableCore');
|
|
1045
1045
|
_defineProperty(DraggableCore$1, "propTypes", {
|
|
@@ -1197,7 +1197,7 @@ function requireDraggable() {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
});
|
|
1199
1199
|
exports.default = void 0;
|
|
1200
|
-
var React
|
|
1200
|
+
var React = _interopRequireWildcard(require$$0);
|
|
1201
1201
|
var _propTypes = _interopRequireDefault(/*@__PURE__*/requirePropTypes());
|
|
1202
1202
|
var _reactDom = _interopRequireDefault(require$$2);
|
|
1203
1203
|
var _clsx = _interopRequireDefault(require$$3);
|
|
@@ -1503,11 +1503,11 @@ function requireDraggable() {
|
|
|
1503
1503
|
|
|
1504
1504
|
// Reuse the child provided
|
|
1505
1505
|
// This makes it flexible to use whatever element is wanted (div, ul, etc)
|
|
1506
|
-
return /*#__PURE__*/React
|
|
1506
|
+
return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, {
|
|
1507
1507
|
onStart: this.onDragStart,
|
|
1508
1508
|
onDrag: this.onDrag,
|
|
1509
1509
|
onStop: this.onDragStop
|
|
1510
|
-
}), /*#__PURE__*/React
|
|
1510
|
+
}), /*#__PURE__*/React.cloneElement(React.Children.only(children), {
|
|
1511
1511
|
className: className,
|
|
1512
1512
|
style: _objectSpread2(_objectSpread2({}, children.props.style), style),
|
|
1513
1513
|
transform: svgTransform
|
|
@@ -1536,7 +1536,7 @@ function requireDraggable() {
|
|
|
1536
1536
|
return null;
|
|
1537
1537
|
}
|
|
1538
1538
|
}]);
|
|
1539
|
-
}(React
|
|
1539
|
+
}(React.Component /*:: <DraggableProps, DraggableState>*/);
|
|
1540
1540
|
exports.default = Draggable;
|
|
1541
1541
|
_defineProperty$1(Draggable, "displayName", 'Draggable');
|
|
1542
1542
|
_defineProperty$1(Draggable, "propTypes", _objectSpread2(_objectSpread2({}, _DraggableCore.default.propTypes), {}, {
|
|
@@ -1860,4 +1860,4 @@ var dialogDragModal = {
|
|
|
1860
1860
|
};
|
|
1861
1861
|
|
|
1862
1862
|
export { dialogDragModal as d };
|
|
1863
|
-
//# sourceMappingURL=drag-modal-
|
|
1863
|
+
//# sourceMappingURL=drag-modal-C3Azghu3.js.map
|