szld-libs 0.2.8 → 0.2.9

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.
@@ -5,6 +5,7 @@ import { ValueProps, ValueType } from "../CreateForm";
5
5
  export type ColumnsType<RecordType> = ColumnType<RecordType> & {
6
6
  editable?: boolean;
7
7
  rules?: Rule[];
8
+ initialValue?: any;
8
9
  type?: ValueType;
9
10
  valueProps?: ValueProps<RecordType>;
10
11
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Table, Form } from "antd";
3
+ import _ from "lodash";
3
4
  import React, { useRef, useContext } from "react";
4
5
  import { FormFields } from "../CreateForm";
5
- import _ from "lodash";
6
6
  const editableCellValueWrap = "editable-module_editableCellValueWrap_3b3d9";
7
7
  const classes = {
8
8
  editableCellValueWrap
@@ -23,6 +23,7 @@ function EditableCell(props) {
23
23
  onChange,
24
24
  type = "input",
25
25
  valueProps,
26
+ initialValue,
26
27
  ...restProps
27
28
  } = props;
28
29
  const inputRef = useRef(null);
@@ -54,7 +55,7 @@ function EditableCell(props) {
54
55
  Form.Item,
55
56
  {
56
57
  style: { margin: 0 },
57
- initialValue: _.get(record, dataIndex),
58
+ initialValue: initialValue || _.get(record, dataIndex),
58
59
  name: dataIndex,
59
60
  rules,
60
61
  children: renderItem()
package/es/index.js CHANGED
@@ -53,6 +53,7 @@ const Demo = () => {
53
53
  editable: true,
54
54
  type: "textarea",
55
55
  width: 400,
56
+ initialValue: "123444",
56
57
  valueProps: {
57
58
  placeholder: "请输入内容",
58
59
  autoSize: {
@@ -5,6 +5,7 @@ import { ValueProps, ValueType } from "../CreateForm";
5
5
  export type ColumnsType<RecordType> = ColumnType<RecordType> & {
6
6
  editable?: boolean;
7
7
  rules?: Rule[];
8
+ initialValue?: any;
8
9
  type?: ValueType;
9
10
  valueProps?: ValueProps<RecordType>;
10
11
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const antd = require("antd");
4
+ const _ = require("lodash");
4
5
  const React = require("react");
5
6
  const CreateForm = require("../CreateForm");
6
- const _ = require("lodash");
7
7
  const editableCellValueWrap = "editable-module_editableCellValueWrap_3b3d9";
8
8
  const classes = {
9
9
  editableCellValueWrap
@@ -24,6 +24,7 @@ function EditableCell(props) {
24
24
  onChange,
25
25
  type = "input",
26
26
  valueProps,
27
+ initialValue,
27
28
  ...restProps
28
29
  } = props;
29
30
  const inputRef = React.useRef(null);
@@ -55,7 +56,7 @@ function EditableCell(props) {
55
56
  antd.Form.Item,
56
57
  {
57
58
  style: { margin: 0 },
58
- initialValue: _.get(record, dataIndex),
59
+ initialValue: initialValue || _.get(record, dataIndex),
59
60
  name: dataIndex,
60
61
  rules,
61
62
  children: renderItem()
package/lib/index.js CHANGED
@@ -54,6 +54,7 @@ const Demo = () => {
54
54
  editable: true,
55
55
  type: "textarea",
56
56
  width: 400,
57
+ initialValue: "123444",
57
58
  valueProps: {
58
59
  placeholder: "请输入内容",
59
60
  autoSize: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.8",
4
+ "version": "0.2.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",