tntd 3.0.40-beta.2 → 3.0.40-beta.4
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/es/table/resizableTable/index.js +12 -5
- package/es/table/resizableTable/index.js.map +1 -1
- package/lib/segmented/index.d.ts +1 -1
- package/lib/table/resizableTable/index.d.ts +1 -0
- package/lib/table/resizableTable/index.d.ts.map +1 -1
- package/lib/table/resizableTable/index.js +12 -5
- package/lib/table/resizableTable/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -63,6 +63,7 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
63
63
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
64
|
renderKey = _useState4[0],
|
|
65
65
|
setRenderKey = _useState4[1];
|
|
66
|
+
var renderKeyRef = (0, _react.useRef)(renderKey);
|
|
66
67
|
var handleResize = function handleResize(index, minWidth) {
|
|
67
68
|
return (0, _throttle2["default"])(function (e, _ref) {
|
|
68
69
|
var size = _ref.size;
|
|
@@ -81,8 +82,15 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
81
82
|
return column;
|
|
82
83
|
}
|
|
83
84
|
return Object.assign(Object.assign({}, column), {
|
|
85
|
+
render: typeof (column === null || column === void 0 ? void 0 : column.render) === 'function' ? function () {
|
|
86
|
+
var _a2;
|
|
87
|
+
var _a;
|
|
88
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
89
|
+
args[_key] = arguments[_key];
|
|
90
|
+
}
|
|
91
|
+
return (_a = column === null || column === void 0 ? void 0 : column.render) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [column].concat(args, [renderKeyRef.current]));
|
|
92
|
+
} : column === null || column === void 0 ? void 0 : column.render,
|
|
84
93
|
onHeaderCell: function onHeaderCell(column) {
|
|
85
|
-
console.log("column", column);
|
|
86
94
|
var width = column.width;
|
|
87
95
|
var minWidth = column.minWidth;
|
|
88
96
|
if (typeof width === 'string' && !width.includes('%')) {
|
|
@@ -95,7 +103,8 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
95
103
|
width: width,
|
|
96
104
|
onResize: handleResize(index, minWidth),
|
|
97
105
|
onMouseUp: function onMouseUp() {
|
|
98
|
-
|
|
106
|
+
renderKeyRef.current += 1;
|
|
107
|
+
setRenderKey(renderKeyRef.current);
|
|
99
108
|
}
|
|
100
109
|
};
|
|
101
110
|
}
|
|
@@ -111,9 +120,7 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
111
120
|
(0, _react.useEffect)(function () {
|
|
112
121
|
dataRef.current = columns;
|
|
113
122
|
}, [columns]);
|
|
114
|
-
return _react["default"].createElement(_table.Table, Object.assign({
|
|
115
|
-
key: renderKey
|
|
116
|
-
}, props, Array.isArray(props === null || props === void 0 ? void 0 : props.columns) ? {
|
|
123
|
+
return _react["default"].createElement(_table.Table, Object.assign({}, props, Array.isArray(props === null || props === void 0 ? void 0 : props.columns) ? {
|
|
117
124
|
columns: columns
|
|
118
125
|
} : {}, {
|
|
119
126
|
className: (0, _classnames["default"])('tnt-resizable-table', _defineProperty({}, props.className, props.className)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/resizableTable/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,cAAc,CAAA;AAErB,MAAM,cAAc,GAAG,CACrB,KAGC,EACD,EAAE;IACF,MAAM,EAAE,QAAQ,EAAE,KAAK,KAAmB,KAAK,EAAnB,SA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CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;oBACtC,CAAC;iBACJ,CAAA;YACL,CAAC,IACF;IACH,CAAC,CAAC,CAAA;IAEJ,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,EAAE;YACjC,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC9C,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC,CAAA;SAC7B;IACH,CAAC,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,CAAA;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;IAC3B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,oBAAC,KAAK,oBACA,KAAK,EACL,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IACtD,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAU,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,EAC7E,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,IAChD,CACH,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAC,WAAW,CAAC,CAAA","sourcesContent":["import React, { useState, forwardRef, useRef, useEffect } from 'react'\nimport cn from 'classnames'\nimport { throttle } from 'lodash'\nimport { Resizable } from 'react-resizable'\nimport { Table } from '../table'\nimport './index.less'\n\nconst ResizableTitle = (\n props: React.HTMLAttributes<any> & {\n onResize: (e: React.SyntheticEvent<Element>, data: any) => void\n width: number\n }\n) => {\n const { onResize, width, ...restProps } = props\n\n if (!width) {\n return <th {...restProps} />\n }\n\n return (\n <Resizable\n width={width}\n height={0}\n handle={\n <span\n className=\"react-resizable-handle\"\n onClick={(e) => {\n e.stopPropagation()\n }}\n />\n }\n onResize={onResize}\n draggableOpts={{ enableUserSelectHack: false }}\n >\n <th {...restProps} />\n </Resizable>\n )\n}\n\ninterface ColumnType {\n width?: any\n minWidth?: any\n render?: any\n}\n\ninterface MyComponentProps {\n columns?: ColumnType[]\n className?: string\n}\n\nconst MyComponent: React.ForwardRefRenderFunction<any, MyComponentProps> = (props, ref) => {\n const [columns, setColumns] = useState<ColumnType[]>([])\n const dataRef = useRef<ColumnType[]>([])\n const [renderKey, setRenderKey] = useState(0);\n const renderKeyRef = useRef(renderKey)\n\n const handleResize = (index: number, minWidth: number) =>\n throttle((e, { size }) => {\n const updatedColumns = dataRef.current || []\n setColumns(\n updatedColumns.map((column, idx) =>\n idx === index ? { ...column, width: Math.max(size.width, minWidth || 40) } : column\n )\n )\n }, 25)\n\n const buildColumns = (columns: ColumnType[]) =>\n columns?.map((column, index) => {\n if (typeof column?.width === 'string' && column?.width?.includes('%')) {\n return column\n }\n return {\n ...column,\n render:typeof column?.render === 'function' ?(...args: any[])=>{\n return column?.render?.(...args, renderKeyRef.current)\n }:column?.render,\n onHeaderCell: (column: ColumnType) => {\n let width = column.width\n let minWidth = column.minWidth\n if (typeof width === 'string' && !width.includes('%')) {\n width = Number(width.replace(/[^\\d]/g, ''))\n }\n\n if (minWidth && typeof minWidth === 'string' && !minWidth.includes('%')) {\n minWidth = Number(minWidth.replace(/[^\\d]/g, ''))\n }\n return {\n width,\n onResize: handleResize(index, minWidth),\n onMouseUp:()=>{\n renderKeyRef.current+=1\n setRenderKey(renderKeyRef.current)\n }\n }\n }\n }\n })\n\n useEffect(() => {\n if (Array.isArray(props?.columns)) {\n const curColumns = buildColumns(props.columns)\n setColumns(curColumns || [])\n }\n }, [props?.columns])\n\n useEffect(() => {\n dataRef.current = columns\n }, [columns]);\n\n return (\n <Table\n {...props}\n {...(Array.isArray(props?.columns) ? { columns } : {})}\n className={cn('tnt-resizable-table', { [props.className!]: props.className })}\n components={{ header: { cell: ResizableTitle } }}\n />\n )\n}\n\nexport default forwardRef(MyComponent)\n"]}
|
package/lib/segmented/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export interface SegmentedProps extends Omit<RCSegmentedProps, 'size' | 'options
|
|
|
18
18
|
block?: boolean;
|
|
19
19
|
size?: SizeType;
|
|
20
20
|
}
|
|
21
|
-
declare const Segmented: React.ForwardRefExoticComponent<Pick<SegmentedProps, "action" | "type" | "style" | "prefixCls" | "className" | "children" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "target" | "lang" | "about" | "as" | "onClick" | "download" | "href" | "hrefLang" | "media" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "list" | "step" | "size" | "shape" | "block" | "key" | "width" | "height" | "src" | "max" | "method" | "min" | "crossOrigin" | "direction" | "checked" | "options" | "open" | "multiple" | "wrap" | "start" | "acceptCharset" | "autoComplete" | "encType" | "noValidate" | "motionName" | "htmlFor" | "required" | "accept" | "alt" | "capture" | "maxLength" | "minLength" | "readOnly" | "cols" | "rows" | "
|
|
21
|
+
declare const Segmented: React.ForwardRefExoticComponent<Pick<SegmentedProps, "action" | "type" | "style" | "prefixCls" | "className" | "children" | "default" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "target" | "lang" | "about" | "as" | "onClick" | "download" | "href" | "hrefLang" | "media" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "content" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "list" | "step" | "size" | "shape" | "block" | "key" | "width" | "height" | "src" | "max" | "method" | "min" | "crossOrigin" | "direction" | "checked" | "options" | "open" | "multiple" | "wrap" | "start" | "acceptCharset" | "autoComplete" | "encType" | "noValidate" | "motionName" | "htmlFor" | "required" | "accept" | "alt" | "capture" | "maxLength" | "minLength" | "readOnly" | "cols" | "rows" | "headers" | "allowFullScreen" | "allowTransparency" | "async" | "autoPlay" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "classID" | "colSpan" | "controls" | "coords" | "dateTime" | "defer" | "frameBorder" | "high" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "mediaGroup" | "muted" | "optimum" | "playsInline" | "poster" | "preload" | "reversed" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "sizes" | "srcDoc" | "srcLang" | "srcSet" | "useMap" | "wmode" | "rootClassName"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
22
|
export default Segmented;
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/resizableTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAKtE,OAAO,cAAc,CAAA;AAkCrB,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,QAAQ,CAAC,EAAE,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/resizableTable/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAKtE,OAAO,cAAc,CAAA;AAkCrB,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,MAAM,CAAC,EAAE,GAAG,CAAA;CACb;AAED,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;;AAuED,wBAAsC"}
|
|
@@ -159,6 +159,7 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
159
159
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
160
160
|
renderKey = _useState4[0],
|
|
161
161
|
setRenderKey = _useState4[1];
|
|
162
|
+
var renderKeyRef = (0, _react.useRef)(renderKey);
|
|
162
163
|
var handleResize = function handleResize(index, minWidth) {
|
|
163
164
|
return (0, _throttle2["default"])(function (e, _ref) {
|
|
164
165
|
var size = _ref.size;
|
|
@@ -177,8 +178,15 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
177
178
|
return column;
|
|
178
179
|
}
|
|
179
180
|
return Object.assign(Object.assign({}, column), {
|
|
181
|
+
render: typeof (column === null || column === void 0 ? void 0 : column.render) === 'function' ? function () {
|
|
182
|
+
var _a2;
|
|
183
|
+
var _a;
|
|
184
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
185
|
+
args[_key] = arguments[_key];
|
|
186
|
+
}
|
|
187
|
+
return (_a = column === null || column === void 0 ? void 0 : column.render) === null || _a === void 0 ? void 0 : (_a2 = _a).call.apply(_a2, [column].concat(args, [renderKeyRef.current]));
|
|
188
|
+
} : column === null || column === void 0 ? void 0 : column.render,
|
|
180
189
|
onHeaderCell: function onHeaderCell(column) {
|
|
181
|
-
console.log("column", column);
|
|
182
190
|
var width = column.width;
|
|
183
191
|
var minWidth = column.minWidth;
|
|
184
192
|
if (typeof width === 'string' && !width.includes('%')) {
|
|
@@ -191,7 +199,8 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
191
199
|
width: width,
|
|
192
200
|
onResize: handleResize(index, minWidth),
|
|
193
201
|
onMouseUp: function onMouseUp() {
|
|
194
|
-
|
|
202
|
+
renderKeyRef.current += 1;
|
|
203
|
+
setRenderKey(renderKeyRef.current);
|
|
195
204
|
}
|
|
196
205
|
};
|
|
197
206
|
}
|
|
@@ -207,9 +216,7 @@ var MyComponent = function MyComponent(props, ref) {
|
|
|
207
216
|
(0, _react.useEffect)(function () {
|
|
208
217
|
dataRef.current = columns;
|
|
209
218
|
}, [columns]);
|
|
210
|
-
return _react["default"].createElement(_table.Table, Object.assign({
|
|
211
|
-
key: renderKey
|
|
212
|
-
}, props, Array.isArray(props === null || props === void 0 ? void 0 : props.columns) ? {
|
|
219
|
+
return _react["default"].createElement(_table.Table, Object.assign({}, props, Array.isArray(props === null || props === void 0 ? void 0 : props.columns) ? {
|
|
213
220
|
columns: columns
|
|
214
221
|
} : {}, {
|
|
215
222
|
className: (0, _classnames["default"])('tnt-resizable-table', _defineProperty({}, props.className, props.className)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/table/resizableTable/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsE;AACtE,4DAA2B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AA;wBACvB,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;oBACtC,CAAC;iBACJ,CAAA;YACL,CAAC,IACF;IACH,CAAC,CAAC,CAAA;IAEJ,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,EAAE;YACjC,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAC9C,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC,CAAA;SAC7B;IACH,CAAC,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,CAAA;IAEpB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;IAC3B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,8BAAC,aAAK,oBACA,KAAK,EACL,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IACtD,SAAS,EAAE,IAAA,oBAAE,EAAC,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAAC,SAAU,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,EAC7E,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,IAChD,CACH,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,IAAA,kBAAU,EAAC,WAAW,CAAC,CAAA","sourcesContent":["import React, { useState, forwardRef, useRef, useEffect } from 'react'\nimport cn from 'classnames'\nimport { throttle } from 'lodash'\nimport { Resizable } from 'react-resizable'\nimport { Table } from '../table'\nimport './index.less'\n\nconst ResizableTitle = (\n props: React.HTMLAttributes<any> & {\n onResize: (e: React.SyntheticEvent<Element>, data: any) => void\n width: number\n }\n) => {\n const { onResize, width, ...restProps } = props\n\n if (!width) {\n return <th {...restProps} />\n }\n\n return (\n <Resizable\n width={width}\n height={0}\n handle={\n <span\n className=\"react-resizable-handle\"\n onClick={(e) => {\n e.stopPropagation()\n }}\n />\n }\n onResize={onResize}\n draggableOpts={{ enableUserSelectHack: false }}\n >\n <th {...restProps} />\n </Resizable>\n )\n}\n\ninterface ColumnType {\n width?: any\n minWidth?: any\n render?: any\n}\n\ninterface MyComponentProps {\n columns?: ColumnType[]\n className?: string\n}\n\nconst MyComponent: React.ForwardRefRenderFunction<any, MyComponentProps> = (props, ref) => {\n const [columns, setColumns] = useState<ColumnType[]>([])\n const dataRef = useRef<ColumnType[]>([])\n const [renderKey, setRenderKey] = useState(0);\n const renderKeyRef = useRef(renderKey)\n\n const handleResize = (index: number, minWidth: number) =>\n throttle((e, { size }) => {\n const updatedColumns = dataRef.current || []\n setColumns(\n updatedColumns.map((column, idx) =>\n idx === index ? { ...column, width: Math.max(size.width, minWidth || 40) } : column\n )\n )\n }, 25)\n\n const buildColumns = (columns: ColumnType[]) =>\n columns?.map((column, index) => {\n if (typeof column?.width === 'string' && column?.width?.includes('%')) {\n return column\n }\n return {\n ...column,\n render:typeof column?.render === 'function' ?(...args: any[])=>{\n return column?.render?.(...args, renderKeyRef.current)\n }:column?.render,\n onHeaderCell: (column: ColumnType) => {\n let width = column.width\n let minWidth = column.minWidth\n if (typeof width === 'string' && !width.includes('%')) {\n width = Number(width.replace(/[^\\d]/g, ''))\n }\n\n if (minWidth && typeof minWidth === 'string' && !minWidth.includes('%')) {\n minWidth = Number(minWidth.replace(/[^\\d]/g, ''))\n }\n return {\n width,\n onResize: handleResize(index, minWidth),\n onMouseUp:()=>{\n renderKeyRef.current+=1\n setRenderKey(renderKeyRef.current)\n }\n }\n }\n }\n })\n\n useEffect(() => {\n if (Array.isArray(props?.columns)) {\n const curColumns = buildColumns(props.columns)\n setColumns(curColumns || [])\n }\n }, [props?.columns])\n\n useEffect(() => {\n dataRef.current = columns\n }, [columns]);\n\n return (\n <Table\n {...props}\n {...(Array.isArray(props?.columns) ? { columns } : {})}\n className={cn('tnt-resizable-table', { [props.className!]: props.className })}\n components={{ header: { cell: ResizableTitle } }}\n />\n )\n}\n\nexport default forwardRef(MyComponent)\n"]}
|