Skip to content

Commit

Permalink
refactor: 💡 rm pro-editable, re shadow-form, pro-array-table
Browse files Browse the repository at this point in the history
  • Loading branch information
charlzyx committed Jan 23, 2024
1 parent b2f8a11 commit 85da4ec
Show file tree
Hide file tree
Showing 45 changed files with 1,350 additions and 1,228 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/components/demos/ProArrayTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { FormProvider, ISchema, createSchemaField } from "@formily/react";
import { Button, ConfigProvider, Divider, Space } from "antd";
import "antd/dist/antd.css";
// import "antd/dist/antd.css";

import zhCN from "antd/lib/locale/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { faker } from "@faker-js/faker";
import { Editable, FormGrid, FormItem, FormLayout, Input } from "@formily/antd";
import { createForm } from "@formily/core";
import { FormProvider, ISchema, createSchemaField } from "@formily/react";
import { Button, ConfigProvider } from "antd";
import "antd/dist/antd.css";
// import "antd/dist/antd.css";

import zhCN from "antd/lib/locale/zh_CN";
import moment from "moment";
import "moment/locale/zh-cn";
moment.locale("zh-cn");

import { ProArrayTable, ShadowForm } from "@pro.formily/antd";
import { useProArrayTableContext } from "src/pro-array-table/mixin";

const form = createForm({
initialValues: {
Expand Down Expand Up @@ -81,11 +79,12 @@ const schema: ISchema = {
"x-component": "ProArrayTable",
items: row.items,
properties: {
// ↓ 不填写 act 属性的话, 就读这个 modal 字段
modal: {
type: "void",
"x-decorator": "ShadowForm",
"x-decorator-props": {
act: "modal",
"x-component": "ProArrayTable.ShadowModal",
"x-component-props": {
// act: "modal", // 这里不填写的话, 就读取上面
schema: {
type: "void",
properties: {
Expand Down Expand Up @@ -113,15 +112,14 @@ const schema: ISchema = {
},
},
},
"x-component": "ProArrayTable.ShadowModal",
},
add: {
type: "void",
"x-component": "ProArrayTable.ProAddition",
"x-component-props": {
onOk: (
data: any,
ctx: ReturnType<typeof useProArrayTableContext>,
ctx: ReturnType<typeof ProArrayTable.useProArrayTableContext>,
) => {
// 如果添加数据后将超过当前页,则自动切换到下一页
const total = ctx?.array.field?.value.length || 0;
Expand Down
98 changes: 0 additions & 98 deletions docs/components/demos/ProEditable.tsx

This file was deleted.

237 changes: 0 additions & 237 deletions docs/components/demos/ProEditableWithArray.tsx

This file was deleted.

Loading

0 comments on commit 85da4ec

Please sign in to comment.