@zykj2024/much-library 1.2.0-beta.1 → 1.2.1

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.
@@ -466,6 +466,9 @@ var ContainerPanel = function ContainerPanel(props, ref) {
466
466
  onChange: tableChange
467
467
  }, tableProps), {}, {
468
468
  loading: false,
469
+ rowSelection: tableProps !== null && tableProps !== void 0 && tableProps.rowSelection ? _objectSpread({
470
+ fixed: 'left'
471
+ }, tableProps.rowSelection) : undefined,
469
472
  pagination: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.pagination) === false ? false : _objectSpread({
470
473
  className: 'mc-container__pagination',
471
474
  style: {
@@ -6,7 +6,8 @@ import { Input } from 'antd';
6
6
  import { forwardRef, useEffect, useState } from 'react';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  var McTextArea = /*#__PURE__*/forwardRef(function (props, ref) {
9
- var isTrim = props.isTrim,
9
+ var _props$isTrim = props.isTrim,
10
+ isTrim = _props$isTrim === void 0 ? true : _props$isTrim,
10
11
  value = props.value,
11
12
  _onChange = props.onChange,
12
13
  className = props.className,
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import '../index.less';
3
3
  export type BaseValueType = string | number;
4
4
  export interface Option {
@@ -108,6 +108,10 @@ export interface McListSelectPanelProps {
108
108
  * - 'sortable': 每项独占一行且可排序
109
109
  */
110
110
  selectedLayout?: 'block' | 'inline' | 'sortable';
111
+ /**
112
+ * 已选数量自定义渲染
113
+ */
114
+ selectedNumRender?: (selectedNum: number) => ReactNode;
111
115
  /**
112
116
  * 当前选中的值
113
117
  */
@@ -44,6 +44,7 @@ var ListSelectPanel = /*#__PURE__*/forwardRef(function (props, ref) {
44
44
  inexistent = _props$inexistent === void 0 ? false : _props$inexistent,
45
45
  _props$selectedLayout = props.selectedLayout,
46
46
  selectedLayout = _props$selectedLayout === void 0 ? 'block' : _props$selectedLayout,
47
+ selectedNumRender = props.selectedNumRender,
47
48
  value = props.value,
48
49
  onChange = props.onChange,
49
50
  style = props.style,
@@ -74,6 +75,9 @@ var ListSelectPanel = /*#__PURE__*/forwardRef(function (props, ref) {
74
75
  setInexistentValueMap = _useState8[1];
75
76
  var optionsRef = useRef();
76
77
  var initFlag = useRef(false);
78
+ var selectedNum = useMemo(function () {
79
+ return selected.length;
80
+ }, [selected]);
77
81
 
78
82
  /* 备选列表搜索方法 */
79
83
  var _useAsync = useAsync( /*#__PURE__*/function () {
@@ -389,15 +393,15 @@ var ListSelectPanel = /*#__PURE__*/forwardRef(function (props, ref) {
389
393
  className: "mc-list-select-panel__card mc-list-select-panel__card__right",
390
394
  children: [/*#__PURE__*/_jsxs("div", {
391
395
  className: "mc-list-select-panel__card__header",
392
- children: [/*#__PURE__*/_jsxs("span", {
393
- children: ["\u5DF2\u9009", selected.length, "\u9879"]
396
+ children: [selectedNumRender ? selectedNumRender(selectedNum) : /*#__PURE__*/_jsxs("span", {
397
+ children: ["\u5DF2\u9009", selectedNum, "\u9879"]
394
398
  }), allowClear && /*#__PURE__*/_jsx(Button, {
395
399
  style: {
396
400
  height: 'auto',
397
401
  padding: 0
398
402
  },
399
403
  type: "link",
400
- disabled: disabled || !selected.length,
404
+ disabled: disabled || !selectedNum,
401
405
  onClick: function onClick() {
402
406
  return changeHandle(reserved ? selected.filter(function (i) {
403
407
  return !valueMap[i];
@@ -405,7 +409,7 @@ var ListSelectPanel = /*#__PURE__*/forwardRef(function (props, ref) {
405
409
  },
406
410
  children: "\u6E05\u7A7A"
407
411
  })]
408
- }), !!selected.length ? /*#__PURE__*/_jsx(DndContext, {
412
+ }), !!selectedNum ? /*#__PURE__*/_jsx(DndContext, {
409
413
  onDragEnd: dragEnd,
410
414
  children: /*#__PURE__*/_jsx(SortableContext, {
411
415
  items: selected,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zykj2024/much-library",
3
- "version": "1.2.0-beta.1",
3
+ "version": "1.2.1",
4
4
  "description": "react library",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",