This is page 2 of 52. Use http://codebase.md/alibaba/formily?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .all-contributorsrc ├── .codecov.yml ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .github │ ├── CONTRIBUTING.md │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE │ │ └── config.yml │ ├── PULL_REQUEST_TEMPLATE.md │ └── workflows │ ├── check-pr-title.yml │ ├── ci.yml │ ├── commitlint.yml │ ├── issue-open-check.yml │ ├── package-size.yml │ └── pr-welcome.yml ├── .gitignore ├── .prettierrc.js ├── .umirc.js ├── .vscode │ └── cspell.json ├── .yarnrc ├── CHANGELOG.md ├── commitlint.config.js ├── devtools │ ├── .eslintrc │ └── chrome-extension │ ├── .npmignore │ ├── assets │ │ └── img │ │ ├── loading.svg │ │ └── logo │ │ ├── 128x128.png │ │ ├── 16x16.png │ │ ├── 38x38.png │ │ ├── 48x48.png │ │ ├── error.png │ │ ├── gray.png │ │ └── scalable.png │ ├── config │ │ ├── webpack.base.ts │ │ ├── webpack.dev.ts │ │ └── webpack.prod.ts │ ├── LICENSE.md │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── components │ │ │ │ ├── FieldTree.tsx │ │ │ │ ├── filter.ts │ │ │ │ ├── LeftPanel.tsx │ │ │ │ ├── RightPanel.tsx │ │ │ │ ├── SearchBox.tsx │ │ │ │ └── Tabs.tsx │ │ │ ├── demo.tsx │ │ │ └── index.tsx │ │ └── extension │ │ ├── backend.ts │ │ ├── background.ts │ │ ├── content.ts │ │ ├── devpanel.tsx │ │ ├── devtools.tsx │ │ ├── inject.ts │ │ ├── manifest.json │ │ ├── popup.tsx │ │ └── views │ │ ├── devpanel.ejs │ │ ├── devtools.ejs │ │ └── popup.ejs │ ├── tsconfig.build.json │ └── tsconfig.json ├── docs │ ├── functions │ │ ├── contributors.ts │ │ └── npm-search.ts │ ├── guide │ │ ├── advanced │ │ │ ├── async.md │ │ │ ├── async.zh-CN.md │ │ │ ├── build.md │ │ │ ├── build.zh-CN.md │ │ │ ├── business-logic.md │ │ │ ├── business-logic.zh-CN.md │ │ │ ├── calculator.md │ │ │ ├── calculator.zh-CN.md │ │ │ ├── controlled.md │ │ │ ├── controlled.zh-CN.md │ │ │ ├── custom.md │ │ │ ├── custom.zh-CN.md │ │ │ ├── destructor.md │ │ │ ├── destructor.zh-CN.md │ │ │ ├── input.less │ │ │ ├── layout.md │ │ │ ├── layout.zh-CN.md │ │ │ ├── linkages.md │ │ │ ├── linkages.zh-CN.md │ │ │ ├── validate.md │ │ │ └── validate.zh-CN.md │ │ ├── contribution.md │ │ ├── contribution.zh-CN.md │ │ ├── form-builder.md │ │ ├── form-builder.zh-CN.md │ │ ├── index.md │ │ ├── index.zh-CN.md │ │ ├── issue-helper.md │ │ ├── issue-helper.zh-CN.md │ │ ├── learn-formily.md │ │ ├── learn-formily.zh-CN.md │ │ ├── quick-start.md │ │ ├── quick-start.zh-CN.md │ │ ├── scenes │ │ │ ├── dialog-drawer.md │ │ │ ├── dialog-drawer.zh-CN.md │ │ │ ├── edit-detail.md │ │ │ ├── edit-detail.zh-CN.md │ │ │ ├── index.less │ │ │ ├── login-register.md │ │ │ ├── login-register.zh-CN.md │ │ │ ├── more.md │ │ │ ├── more.zh-CN.md │ │ │ ├── query-list.md │ │ │ ├── query-list.zh-CN.md │ │ │ ├── step-form.md │ │ │ ├── step-form.zh-CN.md │ │ │ ├── tab-form.md │ │ │ ├── tab-form.zh-CN.md │ │ │ └── VerifyCode.tsx │ │ ├── upgrade.md │ │ └── upgrade.zh-CN.md │ ├── index.md │ ├── index.zh-CN.md │ └── site │ ├── Contributors.less │ ├── Contributors.tsx │ ├── QrCode.less │ ├── QrCode.tsx │ ├── Section.less │ ├── Section.tsx │ └── styles.less ├── global.config.ts ├── jest.config.js ├── lerna.json ├── LICENSE.md ├── package.json ├── packages │ ├── .eslintrc │ ├── antd │ │ ├── __tests__ │ │ │ ├── moment.spec.ts │ │ │ └── sideEffects.spec.ts │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── build-style.ts │ │ ├── create-style.ts │ │ ├── docs │ │ │ ├── components │ │ │ │ ├── ArrayCards.md │ │ │ │ ├── ArrayCards.zh-CN.md │ │ │ │ ├── ArrayCollapse.md │ │ │ │ ├── ArrayCollapse.zh-CN.md │ │ │ │ ├── ArrayItems.md │ │ │ │ ├── ArrayItems.zh-CN.md │ │ │ │ ├── ArrayTable.md │ │ │ │ ├── ArrayTable.zh-CN.md │ │ │ │ ├── ArrayTabs.md │ │ │ │ ├── ArrayTabs.zh-CN.md │ │ │ │ ├── Cascader.md │ │ │ │ ├── Cascader.zh-CN.md │ │ │ │ ├── Checkbox.md │ │ │ │ ├── Checkbox.zh-CN.md │ │ │ │ ├── DatePicker.md │ │ │ │ ├── DatePicker.zh-CN.md │ │ │ │ ├── Editable.md │ │ │ │ ├── Editable.zh-CN.md │ │ │ │ ├── Form.md │ │ │ │ ├── Form.zh-CN.md │ │ │ │ ├── FormButtonGroup.md │ │ │ │ ├── FormButtonGroup.zh-CN.md │ │ │ │ ├── FormCollapse.md │ │ │ │ ├── FormCollapse.zh-CN.md │ │ │ │ ├── FormDialog.md │ │ │ │ ├── FormDialog.zh-CN.md │ │ │ │ ├── FormDrawer.md │ │ │ │ ├── FormDrawer.zh-CN.md │ │ │ │ ├── FormGrid.md │ │ │ │ ├── FormGrid.zh-CN.md │ │ │ │ ├── FormItem.md │ │ │ │ ├── FormItem.zh-CN.md │ │ │ │ ├── FormLayout.md │ │ │ │ ├── FormLayout.zh-CN.md │ │ │ │ ├── FormStep.md │ │ │ │ ├── FormStep.zh-CN.md │ │ │ │ ├── FormTab.md │ │ │ │ ├── FormTab.zh-CN.md │ │ │ │ ├── index.md │ │ │ │ ├── index.zh-CN.md │ │ │ │ ├── Input.md │ │ │ │ ├── Input.zh-CN.md │ │ │ │ ├── NumberPicker.md │ │ │ │ ├── NumberPicker.zh-CN.md │ │ │ │ ├── Password.md │ │ │ │ ├── Password.zh-CN.md │ │ │ │ ├── PreviewText.md │ │ │ │ ├── PreviewText.zh-CN.md │ │ │ │ ├── Radio.md │ │ │ │ ├── Radio.zh-CN.md │ │ │ │ ├── Reset.md │ │ │ │ ├── Reset.zh-CN.md │ │ │ │ ├── Select.md │ │ │ │ ├── Select.zh-CN.md │ │ │ │ ├── SelectTable.md │ │ │ │ ├── SelectTable.zh-CN.md │ │ │ │ ├── Space.md │ │ │ │ ├── Space.zh-CN.md │ │ │ │ ├── Submit.md │ │ │ │ ├── Submit.zh-CN.md │ │ │ │ ├── Switch.md │ │ │ │ ├── Switch.zh-CN.md │ │ │ │ ├── TimePicker.md │ │ │ │ ├── TimePicker.zh-CN.md │ │ │ │ ├── Transfer.md │ │ │ │ ├── Transfer.zh-CN.md │ │ │ │ ├── TreeSelect.md │ │ │ │ ├── TreeSelect.zh-CN.md │ │ │ │ ├── Upload.md │ │ │ │ └── Upload.zh-CN.md │ │ │ ├── index.md │ │ │ └── index.zh-CN.md │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __builtins__ │ │ │ │ ├── hooks │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── useClickAway.ts │ │ │ │ │ └── usePrefixCls.ts │ │ │ │ ├── index.ts │ │ │ │ ├── loading.ts │ │ │ │ ├── moment.ts │ │ │ │ ├── pickDataProps.ts │ │ │ │ ├── portal.tsx │ │ │ │ ├── render.ts │ │ │ │ └── sort.tsx │ │ │ ├── array-base │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── array-cards │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── array-collapse │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── array-items │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── array-table │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── array-tabs │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── cascader │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── checkbox │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── date-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── editable │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── form │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── form-button-group │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── form-collapse │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-dialog │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-drawer │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-grid │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── form-item │ │ │ │ ├── animation.less │ │ │ │ ├── grid.less │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── form-layout │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ ├── style.ts │ │ │ │ └── useResponsiveFormLayout.ts │ │ │ ├── form-step │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-tab │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── index.ts │ │ │ ├── input │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── number-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── password │ │ │ │ ├── index.tsx │ │ │ │ ├── PasswordStrength.tsx │ │ │ │ └── style.ts │ │ │ ├── preview-text │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── radio │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ └── style.ts │ │ │ ├── reset │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── select │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── select-table │ │ │ │ ├── index.tsx │ │ │ │ ├── style.less │ │ │ │ ├── style.ts │ │ │ │ ├── useCheckSlackly.tsx │ │ │ │ ├── useFilterOptions.tsx │ │ │ │ ├── useFlatOptions.tsx │ │ │ │ ├── useSize.tsx │ │ │ │ ├── useTitleAddon.tsx │ │ │ │ └── utils.ts │ │ │ ├── space │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── style.less │ │ │ ├── style.ts │ │ │ ├── submit │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── switch │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── time-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── transfer │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── tree-select │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ └── upload │ │ │ ├── index.tsx │ │ │ ├── placeholder.ts │ │ │ └── style.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── benchmark │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── src │ │ │ └── index.tsx │ │ ├── template.ejs │ │ ├── tsconfig.build.json │ │ ├── tsconfig.json │ │ ├── webpack.base.ts │ │ ├── webpack.dev.ts │ │ └── webpack.prod.ts │ ├── core │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── docs │ │ │ ├── api │ │ │ │ ├── entry │ │ │ │ │ ├── ActionResponse.less │ │ │ │ │ ├── ActionResponse.tsx │ │ │ │ │ ├── createForm.md │ │ │ │ │ ├── createForm.zh-CN.md │ │ │ │ │ ├── FieldEffectHooks.md │ │ │ │ │ ├── FieldEffectHooks.zh-CN.md │ │ │ │ │ ├── FormChecker.md │ │ │ │ │ ├── FormChecker.zh-CN.md │ │ │ │ │ ├── FormEffectHooks.md │ │ │ │ │ ├── FormEffectHooks.zh-CN.md │ │ │ │ │ ├── FormHooksAPI.md │ │ │ │ │ ├── FormHooksAPI.zh-CN.md │ │ │ │ │ ├── FormPath.md │ │ │ │ │ ├── FormPath.zh-CN.md │ │ │ │ │ ├── FormValidatorRegistry.md │ │ │ │ │ └── FormValidatorRegistry.zh-CN.md │ │ │ │ └── models │ │ │ │ ├── ArrayField.md │ │ │ │ ├── ArrayField.zh-CN.md │ │ │ │ ├── Field.md │ │ │ │ ├── Field.zh-CN.md │ │ │ │ ├── Form.md │ │ │ │ ├── Form.zh-CN.md │ │ │ │ ├── ObjectField.md │ │ │ │ ├── ObjectField.zh-CN.md │ │ │ │ ├── Query.md │ │ │ │ ├── Query.zh-CN.md │ │ │ │ ├── VoidField.md │ │ │ │ └── VoidField.zh-CN.md │ │ │ ├── guide │ │ │ │ ├── architecture.md │ │ │ │ ├── architecture.zh-CN.md │ │ │ │ ├── field.md │ │ │ │ ├── field.zh-CN.md │ │ │ │ ├── form.md │ │ │ │ ├── form.zh-CN.md │ │ │ │ ├── index.md │ │ │ │ ├── index.zh-CN.md │ │ │ │ ├── mvvm.md │ │ │ │ ├── mvvm.zh-CN.md │ │ │ │ ├── values.md │ │ │ │ └── values.zh-CN.md │ │ │ ├── index.md │ │ │ └── index.zh-CN.md │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── array.spec.ts │ │ │ │ ├── effects.spec.ts │ │ │ │ ├── externals.spec.ts │ │ │ │ ├── field.spec.ts │ │ │ │ ├── form.spec.ts │ │ │ │ ├── graph.spec.ts │ │ │ │ ├── heart.spec.ts │ │ │ │ ├── internals.spec.ts │ │ │ │ ├── lifecycle.spec.ts │ │ │ │ ├── object.spec.ts │ │ │ │ ├── shared.ts │ │ │ │ └── void.spec.ts │ │ │ ├── effects │ │ │ │ ├── index.ts │ │ │ │ ├── onFieldEffects.ts │ │ │ │ └── onFormEffects.ts │ │ │ ├── global.d.ts │ │ │ ├── index.ts │ │ │ ├── models │ │ │ │ ├── ArrayField.ts │ │ │ │ ├── BaseField.ts │ │ │ │ ├── Field.ts │ │ │ │ ├── Form.ts │ │ │ │ ├── Graph.ts │ │ │ │ ├── Heart.ts │ │ │ │ ├── index.ts │ │ │ │ ├── LifeCycle.ts │ │ │ │ ├── ObjectField.ts │ │ │ │ ├── Query.ts │ │ │ │ ├── types.ts │ │ │ │ └── VoidField.ts │ │ │ ├── shared │ │ │ │ ├── checkers.ts │ │ │ │ ├── constants.ts │ │ │ │ ├── effective.ts │ │ │ │ ├── externals.ts │ │ │ │ └── internals.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── element │ │ ├── .npmignore │ │ ├── build-style.ts │ │ ├── create-style.ts │ │ ├── docs │ │ │ ├── .vuepress │ │ │ │ ├── components │ │ │ │ │ ├── createCodeSandBox.js │ │ │ │ │ ├── dumi-previewer.vue │ │ │ │ │ └── highlight.js │ │ │ │ ├── config.js │ │ │ │ ├── enhanceApp.js │ │ │ │ ├── styles │ │ │ │ │ └── index.styl │ │ │ │ └── util.js │ │ │ ├── demos │ │ │ │ ├── guide │ │ │ │ │ ├── array-cards │ │ │ │ │ │ ├── effects-json-schema.vue │ │ │ │ │ │ ├── effects-markup-schema.vue │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── array-collapse │ │ │ │ │ │ ├── effects-json-schema.vue │ │ │ │ │ │ ├── effects-markup-schema.vue │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── array-items │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── array-table │ │ │ │ │ │ ├── effects-json-schema.vue │ │ │ │ │ │ ├── effects-markup-schema.vue │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── array-tabs │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── cascader │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── checkbox │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── date-picker │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── editable │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── form-button-group.vue │ │ │ │ │ ├── form-collapse │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── form-dialog │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── form-drawer │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── form-grid │ │ │ │ │ │ ├── form.vue │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── native.vue │ │ │ │ │ ├── form-item │ │ │ │ │ │ ├── bordered-none.vue │ │ │ │ │ │ ├── common.vue │ │ │ │ │ │ ├── feedback.vue │ │ │ │ │ │ ├── inset.vue │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ ├── size.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── form-layout │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── form-step │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── form-tab │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ └── markup-schema.vue │ │ │ │ │ ├── form.vue │ │ │ │ │ ├── input │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── input-number │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── password │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── preview-text │ │ │ │ │ │ ├── base.vue │ │ │ │ │ │ └── extend.vue │ │ │ │ │ ├── radio │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── reset │ │ │ │ │ │ ├── base.vue │ │ │ │ │ │ ├── force.vue │ │ │ │ │ │ └── validate.vue │ │ │ │ │ ├── select │ │ │ │ │ │ ├── json-schema-async.vue │ │ │ │ │ │ ├── json-schema-sync.vue │ │ │ │ │ │ ├── markup-schema-async-search.vue │ │ │ │ │ │ ├── markup-schema-async.vue │ │ │ │ │ │ ├── markup-schema-sync.vue │ │ │ │ │ │ ├── template-async.vue │ │ │ │ │ │ └── template-sync.vue │ │ │ │ │ ├── space │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── submit │ │ │ │ │ │ ├── base.vue │ │ │ │ │ │ └── loading.vue │ │ │ │ │ ├── switch │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── time-picker │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ ├── transfer │ │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ │ └── template.vue │ │ │ │ │ └── upload │ │ │ │ │ ├── json-schema.vue │ │ │ │ │ ├── markup-schema.vue │ │ │ │ │ └── template.vue │ │ │ │ └── index.vue │ │ │ ├── guide │ │ │ │ ├── array-cards.md │ │ │ │ ├── array-collapse.md │ │ │ │ ├── array-items.md │ │ │ │ ├── array-table.md │ │ │ │ ├── array-tabs.md │ │ │ │ ├── cascader.md │ │ │ │ ├── checkbox.md │ │ │ │ ├── date-picker.md │ │ │ │ ├── editable.md │ │ │ │ ├── form-button-group.md │ │ │ │ ├── form-collapse.md │ │ │ │ ├── form-dialog.md │ │ │ │ ├── form-drawer.md │ │ │ │ ├── form-grid.md │ │ │ │ ├── form-item.md │ │ │ │ ├── form-layout.md │ │ │ │ ├── form-step.md │ │ │ │ ├── form-tab.md │ │ │ │ ├── form.md │ │ │ │ ├── index.md │ │ │ │ ├── input-number.md │ │ │ │ ├── input.md │ │ │ │ ├── password.md │ │ │ │ ├── preview-text.md │ │ │ │ ├── radio.md │ │ │ │ ├── reset.md │ │ │ │ ├── select.md │ │ │ │ ├── space.md │ │ │ │ ├── submit.md │ │ │ │ ├── switch.md │ │ │ │ ├── time-picker.md │ │ │ │ ├── transfer.md │ │ │ │ └── upload.md │ │ │ └── README.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __builtins__ │ │ │ │ ├── configs │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── shared │ │ │ │ │ ├── create-context.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── loading.ts │ │ │ │ │ ├── portal.ts │ │ │ │ │ ├── resolve-component.ts │ │ │ │ │ ├── transform-component.ts │ │ │ │ │ ├── types.ts │ │ │ │ │ └── utils.ts │ │ │ │ └── styles │ │ │ │ └── common.scss │ │ │ ├── array-base │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── array-cards │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── array-collapse │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── array-items │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── array-table │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── array-tabs │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── cascader │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── checkbox │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── date-picker │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── editable │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── el-form │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── el-form-item │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── form │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── form-button-group │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── form-collapse │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── form-dialog │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── form-drawer │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── form-grid │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── form-item │ │ │ │ ├── animation.scss │ │ │ │ ├── grid.scss │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ ├── style.ts │ │ │ │ └── var.scss │ │ │ ├── form-layout │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ ├── style.ts │ │ │ │ └── useResponsiveFormLayout.ts │ │ │ ├── form-step │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── form-tab │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── index.ts │ │ │ ├── input │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── input-number │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── password │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── preview-text │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── radio │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── reset │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── select │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── space │ │ │ │ ├── index.ts │ │ │ │ ├── style.scss │ │ │ │ └── style.ts │ │ │ ├── style.ts │ │ │ ├── submit │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── switch │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── time-picker │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ ├── transfer │ │ │ │ ├── index.ts │ │ │ │ └── style.ts │ │ │ └── upload │ │ │ ├── index.ts │ │ │ └── style.ts │ │ ├── transformer.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── grid │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── index.ts │ │ │ └── observer.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── json-schema │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── schema.spec.ts.snap │ │ │ │ ├── compiler.spec.ts │ │ │ │ ├── patches.spec.ts │ │ │ │ ├── schema.spec.ts │ │ │ │ ├── server-validate.spec.ts │ │ │ │ ├── shared.spec.ts │ │ │ │ ├── transformer.spec.ts │ │ │ │ └── traverse.spec.ts │ │ │ ├── compiler.ts │ │ │ ├── global.d.ts │ │ │ ├── index.ts │ │ │ ├── patches.ts │ │ │ ├── polyfills │ │ │ │ ├── index.ts │ │ │ │ └── SPECIFICATION_1_0.ts │ │ │ ├── schema.ts │ │ │ ├── shared.ts │ │ │ ├── transformer.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── next │ │ ├── __tests__ │ │ │ ├── moment.spec.ts │ │ │ └── sideEffects.spec.ts │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── build-style.ts │ │ ├── create-style.ts │ │ ├── docs │ │ │ ├── components │ │ │ │ ├── ArrayCards.md │ │ │ │ ├── ArrayCards.zh-CN.md │ │ │ │ ├── ArrayCollapse.md │ │ │ │ ├── ArrayCollapse.zh-CN.md │ │ │ │ ├── ArrayItems.md │ │ │ │ ├── ArrayItems.zh-CN.md │ │ │ │ ├── ArrayTable.md │ │ │ │ ├── ArrayTable.zh-CN.md │ │ │ │ ├── Cascader.md │ │ │ │ ├── Cascader.zh-CN.md │ │ │ │ ├── Checkbox.md │ │ │ │ ├── Checkbox.zh-CN.md │ │ │ │ ├── DatePicker.md │ │ │ │ ├── DatePicker.zh-CN.md │ │ │ │ ├── DatePicker2.md │ │ │ │ ├── DatePicker2.zh-CN.md │ │ │ │ ├── Editable.md │ │ │ │ ├── Editable.zh-CN.md │ │ │ │ ├── Form.md │ │ │ │ ├── Form.zh-CN.md │ │ │ │ ├── FormButtonGroup.md │ │ │ │ ├── FormButtonGroup.zh-CN.md │ │ │ │ ├── FormCollapse.md │ │ │ │ ├── FormCollapse.zh-CN.md │ │ │ │ ├── FormDialog.md │ │ │ │ ├── FormDialog.zh-CN.md │ │ │ │ ├── FormDrawer.md │ │ │ │ ├── FormDrawer.zh-CN.md │ │ │ │ ├── FormGrid.md │ │ │ │ ├── FormGrid.zh-CN.md │ │ │ │ ├── FormItem.md │ │ │ │ ├── FormItem.zh-CN.md │ │ │ │ ├── FormLayout.md │ │ │ │ ├── FormLayout.zh-CN.md │ │ │ │ ├── FormStep.md │ │ │ │ ├── FormStep.zh-CN.md │ │ │ │ ├── FormTab.md │ │ │ │ ├── FormTab.zh-CN.md │ │ │ │ ├── index.md │ │ │ │ ├── index.zh-CN.md │ │ │ │ ├── Input.md │ │ │ │ ├── Input.zh-CN.md │ │ │ │ ├── NumberPicker.md │ │ │ │ ├── NumberPicker.zh-CN.md │ │ │ │ ├── Password.md │ │ │ │ ├── Password.zh-CN.md │ │ │ │ ├── PreviewText.md │ │ │ │ ├── PreviewText.zh-CN.md │ │ │ │ ├── Radio.md │ │ │ │ ├── Radio.zh-CN.md │ │ │ │ ├── Reset.md │ │ │ │ ├── Reset.zh-CN.md │ │ │ │ ├── Select.md │ │ │ │ ├── Select.zh-CN.md │ │ │ │ ├── SelectTable.md │ │ │ │ ├── SelectTable.zh-CN.md │ │ │ │ ├── Space.md │ │ │ │ ├── Space.zh-CN.md │ │ │ │ ├── Submit.md │ │ │ │ ├── Submit.zh-CN.md │ │ │ │ ├── Switch.md │ │ │ │ ├── Switch.zh-CN.md │ │ │ │ ├── TimePicker.md │ │ │ │ ├── TimePicker.zh-CN.md │ │ │ │ ├── TimePicker2.md │ │ │ │ ├── TimePicker2.zh-CN.md │ │ │ │ ├── Transfer.md │ │ │ │ ├── Transfer.zh-CN.md │ │ │ │ ├── TreeSelect.md │ │ │ │ ├── TreeSelect.zh-CN.md │ │ │ │ ├── Upload.md │ │ │ │ └── Upload.zh-CN.md │ │ │ ├── index.md │ │ │ └── index.zh-CN.md │ │ ├── LESENCE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __builtins__ │ │ │ │ ├── empty.tsx │ │ │ │ ├── hooks │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── useClickAway.ts │ │ │ │ │ └── usePrefixCls.ts │ │ │ │ ├── icons.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── loading.ts │ │ │ │ ├── mapSize.ts │ │ │ │ ├── mapStatus.ts │ │ │ │ ├── moment.ts │ │ │ │ ├── pickDataProps.ts │ │ │ │ ├── portal.tsx │ │ │ │ ├── render.ts │ │ │ │ └── toArray.ts │ │ │ ├── array-base │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── array-cards │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── array-collapse │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── array-items │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── array-table │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── cascader │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── checkbox │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── date-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── date-picker2 │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── editable │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── form │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── form-button-group │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── form-collapse │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-dialog │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-drawer │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-grid │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── form-item │ │ │ │ ├── animation.scss │ │ │ │ ├── grid.scss │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ ├── scss │ │ │ │ │ └── variable.scss │ │ │ │ └── style.ts │ │ │ ├── form-layout │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ ├── style.ts │ │ │ │ └── useResponsiveFormLayout.ts │ │ │ ├── form-step │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── form-tab │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── index.ts │ │ │ ├── input │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── main.scss │ │ │ ├── number-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── password │ │ │ │ ├── index.tsx │ │ │ │ ├── PasswordStrength.tsx │ │ │ │ └── style.ts │ │ │ ├── preview-text │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── radio │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── reset │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── select │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── select-table │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ ├── style.ts │ │ │ │ ├── useCheckSlackly.tsx │ │ │ │ ├── useFilterOptions.tsx │ │ │ │ ├── useFlatOptions.tsx │ │ │ │ ├── useSize.tsx │ │ │ │ ├── useTitleAddon.tsx │ │ │ │ └── utils.ts │ │ │ ├── space │ │ │ │ ├── index.tsx │ │ │ │ ├── main.scss │ │ │ │ └── style.ts │ │ │ ├── style.ts │ │ │ ├── submit │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── switch │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── time-picker │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── time-picker2 │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── transfer │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ ├── tree-select │ │ │ │ ├── index.tsx │ │ │ │ └── style.ts │ │ │ └── upload │ │ │ ├── index.tsx │ │ │ ├── main.scss │ │ │ ├── placeholder.ts │ │ │ └── style.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── path │ │ ├── .npmignore │ │ ├── benchmark.ts │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── accessor.spec.ts │ │ │ │ ├── basic.spec.ts │ │ │ │ ├── match.spec.ts │ │ │ │ ├── parser.spec.ts │ │ │ │ └── share.spec.ts │ │ │ ├── contexts.ts │ │ │ ├── destructor.ts │ │ │ ├── index.ts │ │ │ ├── matcher.ts │ │ │ ├── parser.ts │ │ │ ├── shared.ts │ │ │ ├── tokenizer.ts │ │ │ ├── tokens.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── react │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── docs │ │ │ ├── api │ │ │ │ ├── components │ │ │ │ │ ├── ArrayField.md │ │ │ │ │ ├── ArrayField.zh-CN.md │ │ │ │ │ ├── ExpressionScope.md │ │ │ │ │ ├── ExpressionScope.zh-CN.md │ │ │ │ │ ├── Field.md │ │ │ │ │ ├── Field.zh-CN.md │ │ │ │ │ ├── FormConsumer.md │ │ │ │ │ ├── FormConsumer.zh-CN.md │ │ │ │ │ ├── FormProvider.md │ │ │ │ │ ├── FormProvider.zh-CN.md │ │ │ │ │ ├── ObjectField.md │ │ │ │ │ ├── ObjectField.zh-CN.md │ │ │ │ │ ├── RecordScope.md │ │ │ │ │ ├── RecordScope.zh-CN.md │ │ │ │ │ ├── RecordsScope.md │ │ │ │ │ ├── RecordsScope.zh-CN.md │ │ │ │ │ ├── RecursionField.md │ │ │ │ │ ├── RecursionField.zh-CN.md │ │ │ │ │ ├── SchemaField.md │ │ │ │ │ ├── SchemaField.zh-CN.md │ │ │ │ │ ├── VoidField.md │ │ │ │ │ └── VoidField.zh-CN.md │ │ │ │ ├── hooks │ │ │ │ │ ├── useExpressionScope.md │ │ │ │ │ ├── useExpressionScope.zh-CN.md │ │ │ │ │ ├── useField.md │ │ │ │ │ ├── useField.zh-CN.md │ │ │ │ │ ├── useFieldSchema.md │ │ │ │ │ ├── useFieldSchema.zh-CN.md │ │ │ │ │ ├── useForm.md │ │ │ │ │ ├── useForm.zh-CN.md │ │ │ │ │ ├── useFormEffects.md │ │ │ │ │ ├── useFormEffects.zh-CN.md │ │ │ │ │ ├── useParentForm.md │ │ │ │ │ └── useParentForm.zh-CN.md │ │ │ │ └── shared │ │ │ │ ├── connect.md │ │ │ │ ├── connect.zh-CN.md │ │ │ │ ├── context.md │ │ │ │ ├── context.zh-CN.md │ │ │ │ ├── mapProps.md │ │ │ │ ├── mapProps.zh-CN.md │ │ │ │ ├── mapReadPretty.md │ │ │ │ ├── mapReadPretty.zh-CN.md │ │ │ │ ├── observer.md │ │ │ │ ├── observer.zh-CN.md │ │ │ │ ├── Schema.md │ │ │ │ └── Schema.zh-CN.md │ │ │ ├── guide │ │ │ │ ├── architecture.md │ │ │ │ ├── architecture.zh-CN.md │ │ │ │ ├── concept.md │ │ │ │ ├── concept.zh-CN.md │ │ │ │ ├── index.md │ │ │ │ └── index.zh-CN.md │ │ │ ├── index.md │ │ │ └── index.zh-CN.md │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── expression.spec.tsx │ │ │ │ ├── field.spec.tsx │ │ │ │ ├── form.spec.tsx │ │ │ │ ├── schema.json.spec.tsx │ │ │ │ ├── schema.markup.spec.tsx │ │ │ │ └── shared.tsx │ │ │ ├── components │ │ │ │ ├── ArrayField.tsx │ │ │ │ ├── ExpressionScope.tsx │ │ │ │ ├── Field.tsx │ │ │ │ ├── FormConsumer.tsx │ │ │ │ ├── FormProvider.tsx │ │ │ │ ├── index.ts │ │ │ │ ├── ObjectField.tsx │ │ │ │ ├── ReactiveField.tsx │ │ │ │ ├── RecordScope.tsx │ │ │ │ ├── RecordsScope.tsx │ │ │ │ ├── RecursionField.tsx │ │ │ │ ├── SchemaField.tsx │ │ │ │ └── VoidField.tsx │ │ │ ├── global.d.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ ├── useAttach.ts │ │ │ │ ├── useExpressionScope.ts │ │ │ │ ├── useField.ts │ │ │ │ ├── useFieldSchema.ts │ │ │ │ ├── useForm.ts │ │ │ │ ├── useFormEffects.ts │ │ │ │ └── useParentForm.ts │ │ │ ├── index.ts │ │ │ ├── shared │ │ │ │ ├── connect.ts │ │ │ │ ├── context.ts │ │ │ │ ├── index.ts │ │ │ │ └── render.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── reactive │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── benchmark.ts │ │ ├── docs │ │ │ ├── api │ │ │ │ ├── action.md │ │ │ │ ├── action.zh-CN.md │ │ │ │ ├── autorun.md │ │ │ │ ├── autorun.zh-CN.md │ │ │ │ ├── batch.md │ │ │ │ ├── batch.zh-CN.md │ │ │ │ ├── define.md │ │ │ │ ├── define.zh-CN.md │ │ │ │ ├── hasCollected.md │ │ │ │ ├── hasCollected.zh-CN.md │ │ │ │ ├── markObservable.md │ │ │ │ ├── markObservable.zh-CN.md │ │ │ │ ├── markRaw.md │ │ │ │ ├── markRaw.zh-CN.md │ │ │ │ ├── model.md │ │ │ │ ├── model.zh-CN.md │ │ │ │ ├── observable.md │ │ │ │ ├── observable.zh-CN.md │ │ │ │ ├── observe.md │ │ │ │ ├── observe.zh-CN.md │ │ │ │ ├── raw.md │ │ │ │ ├── raw.zh-CN.md │ │ │ │ ├── react │ │ │ │ │ ├── observer.md │ │ │ │ │ └── observer.zh-CN.md │ │ │ │ ├── reaction.md │ │ │ │ ├── reaction.zh-CN.md │ │ │ │ ├── toJS.md │ │ │ │ ├── toJS.zh-CN.md │ │ │ │ ├── tracker.md │ │ │ │ ├── tracker.zh-CN.md │ │ │ │ ├── typeChecker.md │ │ │ │ ├── typeChecker.zh-CN.md │ │ │ │ ├── untracked.md │ │ │ │ ├── untracked.zh-CN.md │ │ │ │ └── vue │ │ │ │ ├── observer.md │ │ │ │ └── observer.zh-CN.md │ │ │ ├── guide │ │ │ │ ├── best-practice.md │ │ │ │ ├── best-practice.zh-CN.md │ │ │ │ ├── concept.md │ │ │ │ ├── concept.zh-CN.md │ │ │ │ ├── index.md │ │ │ │ └── index.zh-CN.md │ │ │ ├── index.md │ │ │ └── index.zh-CN.md │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── action.spec.ts │ │ │ │ ├── annotations.spec.ts │ │ │ │ ├── array.spec.ts │ │ │ │ ├── autorun.spec.ts │ │ │ │ ├── batch.spec.ts │ │ │ │ ├── collections-map.spec.ts │ │ │ │ ├── collections-set.spec.ts │ │ │ │ ├── collections-weakmap.spec.ts │ │ │ │ ├── collections-weakset.spec.ts │ │ │ │ ├── define.spec.ts │ │ │ │ ├── externals.spec.ts │ │ │ │ ├── hasCollected.spec.ts │ │ │ │ ├── observable.spec.ts │ │ │ │ ├── observe.spec.ts │ │ │ │ ├── tracker.spec.ts │ │ │ │ └── untracked.spec.ts │ │ │ ├── action.ts │ │ │ ├── annotations │ │ │ │ ├── box.ts │ │ │ │ ├── computed.ts │ │ │ │ ├── index.ts │ │ │ │ ├── observable.ts │ │ │ │ ├── ref.ts │ │ │ │ └── shallow.ts │ │ │ ├── array.ts │ │ │ ├── autorun.ts │ │ │ ├── batch.ts │ │ │ ├── checkers.ts │ │ │ ├── environment.ts │ │ │ ├── externals.ts │ │ │ ├── global.d.ts │ │ │ ├── handlers.ts │ │ │ ├── index.ts │ │ │ ├── internals.ts │ │ │ ├── model.ts │ │ │ ├── observable.ts │ │ │ ├── observe.ts │ │ │ ├── reaction.ts │ │ │ ├── tracker.ts │ │ │ ├── tree.ts │ │ │ ├── types.ts │ │ │ └── untracked.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── reactive-react │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ ├── useCompatEffect.ts │ │ │ │ ├── useCompatFactory.ts │ │ │ │ ├── useDidUpdate.ts │ │ │ │ ├── useForceUpdate.ts │ │ │ │ ├── useLayoutEffect.ts │ │ │ │ └── useObserver.ts │ │ │ ├── index.ts │ │ │ ├── observer.ts │ │ │ ├── shared │ │ │ │ ├── gc.ts │ │ │ │ ├── global.ts │ │ │ │ ├── immediate.ts │ │ │ │ └── index.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── reactive-test-cases-for-react18 │ │ ├── .npmignore │ │ ├── .umirc.js │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── src │ │ │ ├── index.js │ │ │ └── MySlowList.js │ │ ├── template.ejs │ │ ├── tsconfig.build.json │ │ ├── tsconfig.json │ │ ├── webpack.base.ts │ │ ├── webpack.dev.ts │ │ └── webpack.prod.ts │ ├── reactive-vue │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ └── observer.spec.ts │ │ │ ├── hooks │ │ │ │ ├── index.ts │ │ │ │ └── useObserver.ts │ │ │ ├── index.ts │ │ │ ├── observer │ │ │ │ ├── collectData.ts │ │ │ │ ├── index.ts │ │ │ │ ├── observerInVue2.ts │ │ │ │ └── observerInVue3.ts │ │ │ └── types.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── shared │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ └── index.spec.ts │ │ │ ├── array.ts │ │ │ ├── case.ts │ │ │ ├── checkers.ts │ │ │ ├── clone.ts │ │ │ ├── compare.ts │ │ │ ├── defaults.ts │ │ │ ├── deprecate.ts │ │ │ ├── global.ts │ │ │ ├── index.ts │ │ │ ├── instanceof.ts │ │ │ ├── isEmpty.ts │ │ │ ├── merge.ts │ │ │ ├── middleware.ts │ │ │ ├── path.ts │ │ │ ├── string.ts │ │ │ ├── subscribable.ts │ │ │ └── uid.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ ├── validator │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── README.md │ │ ├── rollup.config.js │ │ ├── src │ │ │ ├── __tests__ │ │ │ │ ├── parser.spec.ts │ │ │ │ ├── registry.spec.ts │ │ │ │ └── validator.spec.ts │ │ │ ├── formats.ts │ │ │ ├── index.ts │ │ │ ├── locale.ts │ │ │ ├── parser.ts │ │ │ ├── registry.ts │ │ │ ├── rules.ts │ │ │ ├── template.ts │ │ │ ├── types.ts │ │ │ └── validator.ts │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ └── vue │ ├── .npmignore │ ├── bin │ │ ├── formily-vue-fix.js │ │ └── formily-vue-switch.js │ ├── docs │ │ ├── .vuepress │ │ │ ├── components │ │ │ │ ├── createCodeSandBox.js │ │ │ │ ├── dumi-previewer.vue │ │ │ │ └── highlight.js │ │ │ ├── config.js │ │ │ ├── enhanceApp.js │ │ │ └── styles │ │ │ └── index.styl │ │ ├── api │ │ │ ├── components │ │ │ │ ├── array-field.md │ │ │ │ ├── expression-scope.md │ │ │ │ ├── field.md │ │ │ │ ├── form-consumer.md │ │ │ │ ├── form-provider.md │ │ │ │ ├── object-field.md │ │ │ │ ├── recursion-field-with-component.md │ │ │ │ ├── recursion-field.md │ │ │ │ ├── schema-field-with-schema.md │ │ │ │ ├── schema-field.md │ │ │ │ └── void-field.md │ │ │ ├── hooks │ │ │ │ ├── use-field-schema.md │ │ │ │ ├── use-field.md │ │ │ │ ├── use-form-effects.md │ │ │ │ ├── use-form.md │ │ │ │ └── use-parent-form.md │ │ │ └── shared │ │ │ ├── connect.md │ │ │ ├── injections.md │ │ │ ├── map-props.md │ │ │ ├── map-read-pretty.md │ │ │ ├── observer.md │ │ │ └── schema.md │ │ ├── demos │ │ │ ├── api │ │ │ │ ├── components │ │ │ │ │ ├── array-field.vue │ │ │ │ │ ├── expression-scope.vue │ │ │ │ │ ├── field.vue │ │ │ │ │ ├── form-consumer.vue │ │ │ │ │ ├── form-provider.vue │ │ │ │ │ ├── object-field.vue │ │ │ │ │ ├── recursion-field-with-component.vue │ │ │ │ │ ├── recursion-field.vue │ │ │ │ │ ├── schema-field-with-schema.vue │ │ │ │ │ ├── schema-field.vue │ │ │ │ │ └── void-field.vue │ │ │ │ ├── hooks │ │ │ │ │ ├── use-field-schema.vue │ │ │ │ │ ├── use-field.vue │ │ │ │ │ ├── use-form-effects.vue │ │ │ │ │ ├── use-form.vue │ │ │ │ │ └── use-parent-form.vue │ │ │ │ └── shared │ │ │ │ ├── connect.vue │ │ │ │ ├── map-props.vue │ │ │ │ ├── map-read-pretty.vue │ │ │ │ └── observer.vue │ │ │ ├── index.vue │ │ │ └── questions │ │ │ ├── default-slot.vue │ │ │ ├── events.vue │ │ │ ├── named-slot.vue │ │ │ └── scoped-slot.vue │ │ ├── guide │ │ │ ├── architecture.md │ │ │ ├── concept.md │ │ │ └── README.md │ │ ├── questions │ │ │ └── README.md │ │ └── README.md │ ├── package.json │ ├── README.md │ ├── rollup.config.js │ ├── scripts │ │ ├── postinstall.js │ │ ├── switch-cli.js │ │ └── utils.js │ ├── src │ │ ├── __tests__ │ │ │ ├── expression.scope.spec.ts │ │ │ ├── field.spec.ts │ │ │ ├── form.spec.ts │ │ │ ├── schema.json.spec.ts │ │ │ ├── schema.markup.spec.ts │ │ │ ├── shared.spec.ts │ │ │ └── utils.spec.ts │ │ ├── components │ │ │ ├── ArrayField.ts │ │ │ ├── ExpressionScope.ts │ │ │ ├── Field.ts │ │ │ ├── FormConsumer.ts │ │ │ ├── FormProvider.ts │ │ │ ├── index.ts │ │ │ ├── ObjectField.ts │ │ │ ├── ReactiveField.ts │ │ │ ├── RecursionField.ts │ │ │ ├── SchemaField.ts │ │ │ └── VoidField.ts │ │ ├── global.d.ts │ │ ├── hooks │ │ │ ├── index.ts │ │ │ ├── useAttach.ts │ │ │ ├── useField.ts │ │ │ ├── useFieldSchema.ts │ │ │ ├── useForm.ts │ │ │ ├── useFormEffects.ts │ │ │ ├── useInjectionCleaner.ts │ │ │ └── useParentForm.ts │ │ ├── index.ts │ │ ├── shared │ │ │ ├── connect.ts │ │ │ ├── context.ts │ │ │ ├── createForm.ts │ │ │ ├── fragment.ts │ │ │ ├── h.ts │ │ │ └── index.ts │ │ ├── types │ │ │ └── index.ts │ │ ├── utils │ │ │ ├── formatVNodeData.ts │ │ │ ├── getFieldProps.ts │ │ │ ├── getRawComponent.ts │ │ │ └── resolveSchemaProps.ts │ │ └── vue2-components.ts │ ├── tsconfig.build.json │ ├── tsconfig.json │ └── tsconfig.types.json ├── README.md ├── README.zh-cn.md ├── scripts │ ├── build-style │ │ ├── buildAllStyles.ts │ │ ├── copy.ts │ │ ├── helper.ts │ │ └── index.ts │ └── rollup.base.js ├── tsconfig.build.json ├── tsconfig.jest.json ├── tsconfig.json └── yarn.lock ``` # Files -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- ```markdown 1 | # Contributing Guide 2 | 3 | Hi! I’m really excited that you are interested in contributing to Formily. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. 4 | 5 | - [Contributing Guide](#contributing-guide) 6 | - [Issue Reporting Guidelines](#issue-reporting-guidelines) 7 | - [Pull Request Guidelines](#pull-request-guidelines) 8 | - [Git Commit Specific](#git-commit-specific) 9 | 10 | ## Issue Reporting Guidelines 11 | 12 | - The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately. 13 | 14 | - For simple beginner questions, you can get quick answers from 15 | 16 | - For more complicated questions, you can use Google or StackOverflow. Make sure to provide enough information when asking your questions - this makes it easier for others to help you! 17 | 18 | - Try to search for your issue, it may have already been answered or even fixed in the development branch. 19 | 20 | - Check if the issue is reproducible with the latest stable version of Formily. If you are using a pre-release, please indicate the specific version you are using. 21 | 22 | - It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed. 23 | 24 | - For bugs that involves build setups, you can create a reproduction repository with steps in the README. 25 | 26 | - If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it. 27 | 28 | ## Pull Request Guidelines 29 | 30 | - Only code that's ready for release should be committed to the master branch. All development should be done in dedicated branches. 31 | - Checkout a **new** topic branch from master branch, and merge back against master branch. 32 | - Work in the `src` folder and **DO NOT** checkin `dist` in the commits. 33 | - Make sure `npm test` passes. 34 | - If adding new feature: 35 | - Add accompanying test case. 36 | - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. 37 | - If fixing a bug: 38 | - If you are resolving a special issue, add `(fix #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`. 39 | - Provide detailed description of the bug in the PR. Live demo preferred. 40 | - Add appropriate test coverage if applicable. 41 | 42 | ## Git Commit Specific 43 | 44 | - Your commits message must follow our [git commit specific](https://github.com/alibaba/formily/blob/master/.github/GIT_COMMIT_SPECIFIC.md). 45 | - We will check your commit message, if it does not conform to the specification, the commit will be automatically refused, make sure you have read the specification above. 46 | - You could use `git cz` with a CLI interface to replace `git commit` command, it will help you to build a proper commit-message, see [commitizen](https://github.com/commitizen/cz-cli). 47 | - It's OK to have multiple small commits as you work on your branch - we will let GitHub automatically squash it before merging. 48 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-layout/style.less: -------------------------------------------------------------------------------- ``` 1 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form/style.less: -------------------------------------------------------------------------------- ``` 1 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-button-group/style.scss: -------------------------------------------------------------------------------- ```scss 1 | ``` -------------------------------------------------------------------------------- /packages/element/src/form/style.scss: -------------------------------------------------------------------------------- ```scss 1 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-layout/main.scss: -------------------------------------------------------------------------------- ```scss 1 | ``` -------------------------------------------------------------------------------- /packages/next/src/form/main.scss: -------------------------------------------------------------------------------- ```scss 1 | ``` -------------------------------------------------------------------------------- /packages/core/docs/guide/values.md: -------------------------------------------------------------------------------- ```markdown 1 | # Data Model 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-layout/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // @ts-ignore 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // @ts-ignore 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-layout/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // @ts-ignore 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // @ts-ignore 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-grid/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './main.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-grid/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.less' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-grid/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-layout/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/space/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/src/hooks/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './useObserver' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-dialog/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/modal/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-step/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/steps/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/input/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/input/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/password/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/input/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/space/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/space/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/json-schema/src/polyfills/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './SPECIFICATION_1_0' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-step/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/step/style' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-drawer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/drawer/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/reset/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/button/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/select/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/select/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/submit/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/button/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/switch/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/switch/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/upload/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/upload/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/input/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/input/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/password/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/input/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/radio/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/radio/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-dialog/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/dialog/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-drawer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/drawer/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/reset/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/select/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/select/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/submit/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/switch/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/switch/style' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/cascader/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/cascader/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/checkbox/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/checkbox/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/transfer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/transfer/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/cascader/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/cascader/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/checkbox/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/checkbox/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/transfer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/transfer/style' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/date-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/date-picker/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/time-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/time-picker/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/tree-select/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/tree-select/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/number-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/input-number/style/index' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/date-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/date-picker/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/time-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/time-picker/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/tree-select/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/tree-select/style' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/time-picker2/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/time-picker2/style' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/configs/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export const stylePrefix = 'formily-element' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/number-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/number-picker/style' 2 | ``` -------------------------------------------------------------------------------- /packages/json-schema/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './schema' 2 | export * from './types' 3 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/shared/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './gc' 2 | export * from './immediate' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './configs' 2 | export * from './shared' 3 | ``` -------------------------------------------------------------------------------- /packages/react/src/shared/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './context' 2 | export * from './connect' 3 | ``` -------------------------------------------------------------------------------- /docs/guide/advanced/input.less: -------------------------------------------------------------------------------- ``` 1 | input { 2 | background-color: transparent !important; 3 | } 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/el-form/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/form.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/preview-text/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/tag/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/preview-text/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/tag/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/space/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/box/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-button-group/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/form/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/reset/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/button.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/submit/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/button.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/element/src/switch/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/switch.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-button-group/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/form/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-item/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/form/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/radio/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/radio/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/select-table/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/radio/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-items/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | 3 | // 依赖 4 | import '../array-base/style' 5 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-base/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/button/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-items/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/button/style/index' 2 | import './style.less' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/transfer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/transfer.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/next/src/array-base/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/array-items/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/select-table/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/select/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/upload/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/upload/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/el-form-item/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/form-item.scss' 2 | ``` -------------------------------------------------------------------------------- /packages/antd/src/__builtins__/hooks/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './useClickAway' 2 | export * from './usePrefixCls' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/hooks/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './useClickAway' 2 | export * from './usePrefixCls' 3 | ``` -------------------------------------------------------------------------------- /packages/core/src/effects/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './onFormEffects' 2 | export * from './onFieldEffects' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/date-picker2/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/date-picker2/style' 2 | import './main.scss' 3 | ``` -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- ```javascript 1 | module.exports = { extends: ['@commitlint/config-conventional'] } 2 | ``` -------------------------------------------------------------------------------- /packages/vue/bin/formily-vue-switch.js: -------------------------------------------------------------------------------- ```javascript 1 | #!/usr/bin/env node 2 | 'use strict' 3 | require('../scripts/switch-cli') 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/form/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // 依赖 2 | import '../preview-text/style' 3 | import '../form-layout/style' 4 | ``` -------------------------------------------------------------------------------- /packages/vue/bin/formily-vue-fix.js: -------------------------------------------------------------------------------- ```javascript 1 | #!/usr/bin/env node 2 | 'use strict' 3 | require('../scripts/postinstall') 4 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-tabs/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/tabs/style/index' 2 | import 'antd/lib/badge/style/index' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-tab/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/tabs/style/index' 2 | import 'antd/lib/badge/style/index' 3 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-tab/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/tab/style' 2 | import '@alifd/next/lib/badge/style' 3 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/collapse/style/index' 2 | import 'antd/lib/badge/style/index' 3 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './observer' 2 | export * from './hooks' 3 | export * from './types' 4 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './observer' 2 | export * from './hooks' 3 | export * from './types' 4 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/collapse/style' 2 | import '@alifd/next/lib/badge/style' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-base/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/button.scss' 2 | import './style.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-item/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/tooltip.scss' 2 | import './style.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-button-group/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | 3 | // 依赖 4 | import '../form-item/style' 5 | import '../space/style' 6 | ``` -------------------------------------------------------------------------------- /packages/antd/src/radio/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/input/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/input.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/element/src/password/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/input.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/element/src/select/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/select.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/next/src/array-cards/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | import '@alifd/next/lib/card/style' 3 | import './main.scss' 4 | ``` -------------------------------------------------------------------------------- /packages/next/src/editable/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/form/style' 2 | import '@alifd/next/lib/balloon/style' 3 | import './main.scss' 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/cascader/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/cascader.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/next/src/array-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/collapse/style' 2 | import '@alifd/next/lib/card/style' 3 | import './main.scss' 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-grid/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-form-grid { 4 | display: grid; 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/src/types.ts: -------------------------------------------------------------------------------- ```typescript 1 | export interface IObserverOptions { 2 | name?: string 3 | scheduler?: (updater: () => void) => void 4 | } 5 | ``` -------------------------------------------------------------------------------- /packages/element/src/date-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/date-picker.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/element/src/time-picker/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/time-picker.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/element/docs/.vuepress/util.js: -------------------------------------------------------------------------------- ```javascript 1 | const fs = require('fs') 2 | 3 | module.exports = { 4 | getFiles(dir) { 5 | return fs.readdirSync(dir) 6 | }, 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/element/src/input-number/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/input-number.scss' 2 | 3 | // 依赖 4 | import '../preview-text/style' 5 | ``` -------------------------------------------------------------------------------- /packages/validator/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './validator' 2 | export * from './parser' 3 | export * from './registry' 4 | export * from './types' 5 | ``` -------------------------------------------------------------------------------- /packages/vue/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base' 2 | 3 | export default baseConfig('formily.vue', 'Formily.Vue') 4 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/global.d.ts: -------------------------------------------------------------------------------- ```typescript 1 | import * as Types from './types' 2 | 3 | declare global { 4 | namespace Formily.Reactive { 5 | export { Types } 6 | } 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-step/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/steps.scss' 2 | import 'element-ui/packages/theme-chalk/src/step.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/core/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.core', 'Formily.Core') 4 | ``` -------------------------------------------------------------------------------- /packages/grid/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.grid', 'Formily.Grid') 4 | ``` -------------------------------------------------------------------------------- /packages/path/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.path', 'Formily.Path') 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/upload/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/upload.scss' 2 | import 'element-ui/packages/theme-chalk/src/button.scss' 3 | ``` -------------------------------------------------------------------------------- /packages/element/src/editable/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/popover.scss' 3 | 4 | // 依赖 5 | import '../form-item/style' 6 | ``` -------------------------------------------------------------------------------- /packages/react/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.react', 'Formily.React') 4 | ``` -------------------------------------------------------------------------------- /packages/shared/src/path.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Path as FormPath, Pattern as FormPathPattern } from '@formily/path' 2 | 3 | export { FormPath, FormPathPattern } 4 | ``` -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './shared/externals' 2 | export * from './models/types' 3 | export * from './effects' 4 | export * from './types' 5 | ``` -------------------------------------------------------------------------------- /packages/next/src/date-picker2/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | 3 | .#{$css-prefix}date-picker2 { 4 | & > * { 5 | width: 100%; 6 | } 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/shared/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.shared', 'Formily.Shared') 4 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-layout/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-form-inline { 4 | display: flex; 5 | flex-wrap: wrap; 6 | } 7 | ``` -------------------------------------------------------------------------------- /packages/reactive/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.reactive', 'Formily.Reactive') 4 | ``` -------------------------------------------------------------------------------- /packages/validator/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.validator', 'Formily.Validator') 4 | ``` -------------------------------------------------------------------------------- /packages/json-schema/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.json-schema', 'Formily.JSONSchema') 4 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/annotations/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './observable' 2 | export * from './box' 3 | export * from './ref' 4 | export * from './shallow' 5 | export * from './computed' 6 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.reactive-vue', 'Formily.ReactiveVue') 4 | ``` -------------------------------------------------------------------------------- /packages/vue/src/shared/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './context' 2 | export * from './connect' 3 | export * from './h' 4 | export * from './fragment' 5 | export * from './createForm' 6 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-cards/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/card/style/index' 2 | import 'antd/lib/empty/style/index' 3 | import 'antd/lib/button/style/index' 4 | import './style.less' 5 | ``` -------------------------------------------------------------------------------- /packages/antd/src/editable/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/form/style/index' 2 | import 'antd/lib/space/style/index' 3 | import 'antd/lib/popover/style/index' 4 | import './style.less' 5 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig from '../../scripts/rollup.base.js' 2 | 3 | export default baseConfig('formily.reactive-react', 'Formily.ReactiveReact') 4 | ``` -------------------------------------------------------------------------------- /devtools/chrome-extension/src/extension/popup.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | 4 | ReactDOM.render(<div>hello world</div>, document.getElementById('root')) 5 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-item/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/form/style/index' 2 | import 'antd/lib/tooltip/style/index' 3 | import 'antd/lib/popover/style/index' 4 | import './style.less' 5 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-tab/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-form-tab-errors-badge { 4 | line-height: 1; 5 | vertical-align: initial; 6 | } 7 | ``` -------------------------------------------------------------------------------- /packages/react/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from '@formily/json-schema' 2 | export * from './components' 3 | export * from './shared' 4 | export * from './hooks' 5 | export * from './types' 6 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-collapse/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-form-collapse-errors-badge { 4 | line-height: 1; 5 | vertical-align: initial; 6 | } 7 | ``` -------------------------------------------------------------------------------- /packages/antd/build-style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { build } from '../../scripts/build-style' 2 | 3 | build({ 4 | esStr: 'antd/es/', 5 | libStr: 'antd/lib/', 6 | allStylesOutputFile: 'dist/antd.css', 7 | }) 8 | ``` -------------------------------------------------------------------------------- /packages/json-schema/src/global.d.ts: -------------------------------------------------------------------------------- ```typescript 1 | /// <reference types="@formily/core" /> 2 | import * as Types from './types' 3 | declare global { 4 | namespace Formily.Schema { 5 | export { Types } 6 | } 7 | } 8 | ``` -------------------------------------------------------------------------------- /devtools/chrome-extension/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/json-schema/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/path/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/reactive/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/validator/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 5 | } 6 | ``` -------------------------------------------------------------------------------- /packages/core/src/global.d.ts: -------------------------------------------------------------------------------- ```typescript 1 | import * as Types from './types' 2 | import * as Models from './models' 3 | 4 | declare global { 5 | namespace Formily.Core { 6 | export { Types, Models } 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/next/src/upload/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | 3 | $upload-prefix-cls: '#{$css-prefix}upload'; 4 | 5 | .#{$upload-prefix-cls}-list { 6 | margin-top: 4px; 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './useForm' 2 | export * from './useField' 3 | export * from './useFormEffects' 4 | export * from './useFieldSchema' 5 | export * from './useParentForm' 6 | ``` -------------------------------------------------------------------------------- /packages/antd/src/__builtins__/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './moment' 2 | export * from './hooks' 3 | export * from './portal' 4 | export * from './loading' 5 | export * from './pickDataProps' 6 | export * from './sort' 7 | ``` -------------------------------------------------------------------------------- /packages/element/build-style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { build } from '../../scripts/build-style' 2 | 3 | build({ 4 | esStr: 'element/es/', 5 | libStr: 'element/lib/', 6 | allStylesOutputFile: 'dist/element.css', 7 | }) 8 | ``` -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "compilerOptions": { 3 | "esModuleInterop": true, 4 | "moduleResolution": "node", 5 | "allowJs": true, 6 | "module": "commonjs", 7 | "target": "es5", 8 | } 9 | } ``` -------------------------------------------------------------------------------- /packages/next/build-style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { build } from '../../scripts/build-style' 2 | 3 | build({ 4 | esStr: '@alifd/next/es/', 5 | libStr: '@alifd/next/lib/', 6 | allStylesOutputFile: 'dist/next.css', 7 | }) 8 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-grid/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | 3 | $form-grid-prefix-cls: '#{$css-prefix}formily-grid'; 4 | 5 | .#{$form-grid-prefix-cls}-layout { 6 | display: grid; 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/shared/types.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Component, VNode } from 'vue' 2 | 3 | export type SlotTypes = 4 | | Component 5 | | string 6 | | number 7 | | ((props: Record<string, any>) => VNode[] | VNode) 8 | | VNode 9 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/useFieldSchema.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { inject, ref } from 'vue-demi' 2 | import { SchemaSymbol } from '../shared/context' 3 | 4 | export const useFieldSchema = () => { 5 | return inject(SchemaSymbol, ref()) 6 | } 7 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/hooks/useLayoutEffect.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useEffect, useLayoutEffect as _useLayoutEffect } from 'react' 2 | 3 | export const useLayoutEffect = 4 | typeof document !== 'undefined' ? _useLayoutEffect : useEffect 5 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/collapse/style/index' 2 | import 'antd/lib/empty/style/index' 3 | import 'antd/lib/button/style/index' 4 | import 'antd/lib/badge/style/index' 5 | import './style.less' 6 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-dialog/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/dialog.scss' 2 | import 'element-ui/packages/theme-chalk/src/button.scss' 3 | import 'element-ui/packages/theme-chalk/src/loading.scss' 4 | ``` -------------------------------------------------------------------------------- /packages/reactive-test-cases-for-react18/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "allowJs": true 5 | }, 6 | "include": ["./src/**/*.js"], 7 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 8 | } 9 | ``` -------------------------------------------------------------------------------- /devtools/chrome-extension/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/antd/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/benchmark/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/element/src/radio/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/radio.scss' 2 | import 'element-ui/packages/theme-chalk/src/radio-group.scss' 3 | import 'element-ui/packages/theme-chalk/src/radio-button.scss' 4 | ``` -------------------------------------------------------------------------------- /packages/element/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/grid/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/json-schema/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/next/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/path/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/react/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/reactive-test-cases-for-react18/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/reactive/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/shared/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/validator/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useExpressionScope.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useContext } from 'react' 2 | import { SchemaExpressionScopeContext } from '../shared/context' 3 | 4 | export const useExpressionScope = () => useContext(SchemaExpressionScopeContext) 5 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/untracked.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { createBoundaryFunction } from './internals' 2 | import { untrackStart, untrackEnd } from './reaction' 3 | 4 | export const untracked = createBoundaryFunction(untrackStart, untrackEnd) 5 | ``` -------------------------------------------------------------------------------- /packages/vue/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": false 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './useForm' 2 | export * from './useField' 3 | export * from './useParentForm' 4 | export * from './useFieldSchema' 5 | export * from './useFormEffects' 6 | export * from './useExpressionScope' 7 | ``` -------------------------------------------------------------------------------- /packages/vue/src/global.d.ts: -------------------------------------------------------------------------------- ```typescript 1 | /// <reference types="@formily/core" /> 2 | /// <reference types="@formily/json-schema" /> 3 | import * as Types from './types' 4 | declare global { 5 | namespace Formily.Vue { 6 | export { Types } 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/vue/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from '@formily/json-schema' 2 | export * from './components' 3 | export * from './shared' 4 | export * from './hooks' 5 | export * from './types' 6 | export * as Vue2Components from './vue2-components' 7 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-tab/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/tabs.scss' 3 | import 'element-ui/packages/theme-chalk/src/tab-pane.scss' 4 | import 'element-ui/packages/theme-chalk/src/badge.scss' 5 | ``` -------------------------------------------------------------------------------- /packages/react/src/global.d.ts: -------------------------------------------------------------------------------- ```typescript 1 | /// <reference types="@formily/core" /> 2 | /// <reference types="@formily/json-schema" /> 3 | import * as Types from './types' 4 | declare global { 5 | namespace Formily.React { 6 | export { Types } 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-grid/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @form-grid-prefix-cls: ~'@{ant-prefix}-formily-grid'; 5 | 6 | .@{form-grid-prefix-cls}-layout { 7 | display: grid; 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-drawer/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/drawer.scss' 3 | import 'element-ui/packages/theme-chalk/src/button.scss' 4 | import 'element-ui/packages/theme-chalk/src/loading.scss' 5 | ``` -------------------------------------------------------------------------------- /packages/vue/docs/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- ```javascript 1 | import pageComponents from '@internal/page-components' 2 | 3 | export default ({ Vue }) => { 4 | for (const [name, component] of Object.entries(pageComponents)) { 5 | Vue.component(name, component) 6 | } 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/pickDataProps.ts: -------------------------------------------------------------------------------- ```typescript 1 | export const pickDataProps = (props: any = {}) => { 2 | return Object.keys(props).reduce((buf, key) => { 3 | if (key.includes('data-')) { 4 | buf[key] = props[key] 5 | } 6 | return buf 7 | }, {}) 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/core/tsconfig.build.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true, 9 | "types": [] 10 | } 11 | } 12 | ``` -------------------------------------------------------------------------------- /docs/guide/scenes/step-form.md: -------------------------------------------------------------------------------- ```markdown 1 | # Step-by-Step Form 2 | 3 | Mainly use the [FormStep](https://antd.formilyjs.org/components/form-step) component in [@formily/antd](https://antd.formilyjs.org) or [@formily/next](ttps://next.formilyjs.org) 4 | ``` -------------------------------------------------------------------------------- /packages/next/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/antd/src/__builtins__/pickDataProps.ts: -------------------------------------------------------------------------------- ```typescript 1 | export const pickDataProps = (props: any = {}) => { 2 | const results = {} 3 | 4 | for (let key in props) { 5 | if (key.indexOf('data-') > -1) { 6 | results[key] = props[key] 7 | } 8 | } 9 | 10 | return results 11 | } 12 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 7 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/vue/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "skipLibCheck": true 5 | }, 6 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 7 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"] 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/collapse.scss' 3 | import 'element-ui/packages/theme-chalk/src/collapse-item.scss' 4 | import 'element-ui/packages/theme-chalk/src/badge.scss' 5 | ``` -------------------------------------------------------------------------------- /packages/antd/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/benchmark/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/grid/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/react/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/shared/src/uid.ts: -------------------------------------------------------------------------------- ```typescript 1 | let IDX = 36, 2 | HEX = '' 3 | while (IDX--) HEX += IDX.toString(36) 4 | 5 | export function uid(len?: number) { 6 | let str = '', 7 | num = len || 11 8 | while (num--) str += HEX[(Math.random() * 36) | 0] 9 | return str 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/shared/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"] 7 | } 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/antd/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig, { 2 | removeImportStyleFromInputFilePlugin, 3 | } from '../../scripts/rollup.base.js' 4 | 5 | export default baseConfig( 6 | 'formily.antd', 7 | 'Formily.Antd', 8 | removeImportStyleFromInputFilePlugin() 9 | ) 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/shared/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './transform-component' 2 | export * from './resolve-component' 3 | export * from './create-context' 4 | export * from './utils' 5 | export * from './portal' 6 | export * from './loading' 7 | export * from './types' 8 | ``` -------------------------------------------------------------------------------- /packages/next/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig, { 2 | removeImportStyleFromInputFilePlugin, 3 | } from '../../scripts/rollup.base.js' 4 | 5 | export default baseConfig( 6 | 'formily.next', 7 | 'Formily.Next', 8 | removeImportStyleFromInputFilePlugin() 9 | ) 10 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/useInjectionCleaner.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { InjectionKey, provide, Ref, ref } from 'vue-demi' 2 | 3 | export const useInjectionCleaner = ( 4 | injectionKeys: InjectionKey<Ref<unknown>>[] 5 | ) => { 6 | injectionKeys.forEach((key) => provide(key, ref())) 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useFieldSchema.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useContext } from 'react' 2 | import { SchemaContext } from '../shared' 3 | import { Schema } from '@formily/json-schema' 4 | 5 | export const useFieldSchema = (): Schema => { 6 | return useContext(SchemaContext) 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/vue/src/__tests__/shared.spec.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { createForm } from '../' 2 | import { isRaw } from '@vue/composition-api' 3 | 4 | test('createForm returns an un reactive form instance.', () => { 5 | const form = createForm() 6 | expect(isRaw(form)).toBeTruthy() 7 | }) 8 | ``` -------------------------------------------------------------------------------- /.github/workflows/pr-welcome.yml: -------------------------------------------------------------------------------- ```yaml 1 | name: PR Welcome 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened] 6 | 7 | jobs: 8 | welcome: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions-cool/[email protected] 12 | with: 13 | pr-emoji: '+1, heart' 14 | ``` -------------------------------------------------------------------------------- /docs/site/Section.less: -------------------------------------------------------------------------------- ``` 1 | .site-section { 2 | &-title { 3 | font-size: 50px; 4 | text-align: center; 5 | padding-bottom: 200px; 6 | position: relative; 7 | color: #45124e; 8 | 9 | @media (max-width: 480px) { 10 | font-size: 30px; 11 | } 12 | } 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/element/rollup.config.js: -------------------------------------------------------------------------------- ```javascript 1 | import baseConfig, { 2 | removeImportStyleFromInputFilePlugin, 3 | } from '../../scripts/rollup.base.js' 4 | 5 | export default baseConfig( 6 | 'formily.element', 7 | 'Formily.Element', 8 | removeImportStyleFromInputFilePlugin() 9 | ) 10 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useForm.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useContext } from 'react' 2 | import { Form } from '@formily/core' 3 | import { FormContext } from '../shared' 4 | 5 | export const useForm = <T extends object = any>(): Form<T> => { 6 | return useContext(FormContext) 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/next/src/array-table/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import '@alifd/next/lib/button/style' 2 | import '@alifd/next/lib/badge/style' 3 | import '@alifd/next/lib/pagination/style' 4 | import '@alifd/next/lib/select/style' 5 | import '@alifd/next/lib/table/style' 6 | import './main.scss' 7 | ``` -------------------------------------------------------------------------------- /packages/next/src/space/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | @import '~@alifd/next/lib/form/scss/variable.scss'; 3 | 4 | $space-prefix-cls: '#{$css-prefix}space'; 5 | 6 | .#{$space-prefix-cls}-item:empty { 7 | display: none !important; 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useField.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useContext } from 'react' 2 | import { GeneralField } from '@formily/core' 3 | import { FieldContext } from '../shared' 4 | 5 | export const useField = <T = GeneralField>(): T => { 6 | return useContext(FieldContext) as any 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 4 | "exclude": ["./src/__tests__/*", "./esm/*", "./lib/*"], 5 | "compilerOptions": { 6 | "lib": ["ESNext", "DOM"], 7 | "types": [] 8 | } 9 | } 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/preview-text/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/tag.scss' 2 | 3 | // 依赖 4 | import '../input/style' 5 | import '../select/style' 6 | import '../cascader/style' 7 | import '../time-picker/style' 8 | import '../date-picker/style' 9 | import '../space/style' 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-cards/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/card.scss' 3 | import 'element-ui/packages/theme-chalk/src/empty.scss' 4 | import 'element-ui/packages/theme-chalk/src/row.scss' 5 | 6 | // 依赖 7 | import '../array-base/style' 8 | ``` -------------------------------------------------------------------------------- /packages/next/src/transfer/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapProps } from '@formily/react' 2 | import { Transfer as NextTransfer } from '@alifd/next' 3 | 4 | export const Transfer = connect( 5 | NextTransfer, 6 | mapProps({ 7 | dataSource: true, 8 | }) 9 | ) 10 | 11 | export default Transfer 12 | ``` -------------------------------------------------------------------------------- /packages/core/src/__tests__/shared.ts: -------------------------------------------------------------------------------- ```typescript 1 | export const attach = <T extends { onMount: () => void }>(target: T): T => { 2 | target.onMount() 3 | return target 4 | } 5 | 6 | export const sleep = (duration = 100) => 7 | new Promise((resolve) => { 8 | setTimeout(resolve, duration) 9 | }) 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/checkbox/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'element-ui/packages/theme-chalk/src/checkbox.scss' 2 | import 'element-ui/packages/theme-chalk/src/checkbox-group.scss' 3 | import 'element-ui/packages/theme-chalk/src/checkbox-button.scss' 4 | // 依赖 5 | import '../preview-text/style' 6 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/useForm.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { inject, Ref, ref } from 'vue-demi' 2 | import { Form } from '@formily/core' 3 | import { FormSymbol } from '../shared/context' 4 | 5 | export const useForm = (): Ref<Form> => { 6 | const form = inject(FormSymbol, ref()) 7 | return form 8 | } 9 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-collapse/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @array-collapse-prefix-cls: ~'@{ant-prefix}-formily-array-collapse'; 5 | 6 | .@{array-collapse-prefix-cls}-item { 7 | margin-bottom: 10px !important; 8 | } 9 | ``` -------------------------------------------------------------------------------- /docs/guide/scenes/dialog-drawer.md: -------------------------------------------------------------------------------- ```markdown 1 | # Dialog and Drawers 2 | 3 | Mainly use the [FormDialog](https://antd.formilyjs.org/components/form-dialog) function and [FormDrawer]() function in [@formily/antd](https://antd.formilyjs.org) or [@formily/next](https://fusion.formilyjs.org) 4 | ``` -------------------------------------------------------------------------------- /packages/core/src/models/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './Heart' 2 | export * from './LifeCycle' 3 | export * from './Graph' 4 | export * from './Query' 5 | export * from './Form' 6 | export * from './Field' 7 | export * from './ArrayField' 8 | export * from './ObjectField' 9 | export * from './VoidField' 10 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/shared/immediate.ts: -------------------------------------------------------------------------------- ```typescript 1 | export const immediate = (callback?: () => void) => { 2 | let disposed = false 3 | Promise.resolve(0).then(() => { 4 | if (disposed) { 5 | disposed = false 6 | return 7 | } 8 | callback() 9 | }) 10 | return () => { 11 | disposed = true 12 | } 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/useField.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { inject, Ref, ref } from 'vue-demi' 2 | import { GeneralField } from '@formily/core' 3 | import { FieldSymbol } from '../shared/context' 4 | 5 | export const useField = <T = GeneralField>(): Ref<T> => { 6 | return inject(FieldSymbol, ref()) as any 7 | } 8 | ``` -------------------------------------------------------------------------------- /packages/vue/tsconfig.types.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./type-artefacts", 5 | "paths": { 6 | "@formily/*": ["packages/*", "devtools/*"] 7 | }, 8 | "declaration": true, 9 | "sourceMap": false, 10 | "inlineSources": false 11 | } 12 | } 13 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-table/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import 'antd/lib/table/style/index' 2 | import 'antd/lib/button/style/index' 3 | import 'antd/lib/select/style/index' 4 | import 'antd/lib/space/style/index' 5 | import 'antd/lib/badge/style/index' 6 | import 'antd/lib/pagination/style/index' 7 | import './style.less' 8 | ``` -------------------------------------------------------------------------------- /packages/vue/src/shared/createForm.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { createForm } from '@formily/core' 2 | import { markRaw } from 'vue-demi' 3 | 4 | const createRawForm = (...args: Parameters<typeof createForm>) => { 5 | const form = createForm(...args) 6 | return markRaw(form) 7 | } 8 | 9 | export { createRawForm as createForm } 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-tabs/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/tabs.scss' 3 | import 'element-ui/packages/theme-chalk/src/tab-pane.scss' 4 | import 'element-ui/packages/theme-chalk/src/badge.scss' 5 | import 'element-ui/packages/theme-chalk/src/button.scss' 6 | ``` -------------------------------------------------------------------------------- /packages/antd/src/select-table/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @select-table-prefix-cls: ~'@{ant-prefix}-formily-select-table'; 5 | 6 | .@{select-table-prefix-cls} { 7 | .@{select-table-prefix-cls}-search { 8 | margin-bottom: 8px; 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/element/transformer.ts: -------------------------------------------------------------------------------- ```typescript 1 | import createTransformer from 'ts-import-plugin' 2 | 3 | const transformer = createTransformer({ 4 | libraryName: 'element-ui', 5 | libraryDirectory: 'lib', 6 | camel2DashComponentName: true, 7 | style: false, 8 | }) 9 | 10 | export default function () { 11 | return transformer 12 | } 13 | ``` -------------------------------------------------------------------------------- /docs/site/styles.less: -------------------------------------------------------------------------------- ``` 1 | .site-section { 2 | .codesandbox { 3 | width: 100%; 4 | height: 500px; 5 | border: 0; 6 | border-radius: 4px; 7 | overflow: hidden; 8 | box-shadow: 0 10px 30px #555; 9 | } 10 | 11 | img { 12 | width: 100%; 13 | border-radius: 4px; 14 | } 15 | } 16 | 17 | #root { 18 | overflow: hidden; 19 | } 20 | ``` -------------------------------------------------------------------------------- /devtools/chrome-extension/src/extension/content.ts: -------------------------------------------------------------------------------- ```typescript 1 | window.addEventListener( 2 | 'message', 3 | (event) => { 4 | const { source, ...payload } = event.data 5 | if (source === '@formily-devtools-inject-script') { 6 | chrome.runtime.sendMessage({ 7 | source, 8 | ...payload, 9 | }) 10 | } 11 | }, 12 | false 13 | ) 14 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './moment' 2 | export * from './hooks' 3 | export * from './toArray' 4 | export * from './mapStatus' 5 | export * from './mapSize' 6 | export * from './empty' 7 | export * from './loading' 8 | export * from './portal' 9 | export * from './pickDataProps' 10 | export * from './icons' 11 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './batch' 2 | export * from './action' 3 | export * from './untracked' 4 | export * from './observable' 5 | export * from './model' 6 | export * from './autorun' 7 | export * from './tracker' 8 | export * from './observe' 9 | export * from './externals' 10 | export * from './types' 11 | ``` -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "version": "2.3.7", 3 | "npmClient": "yarn", 4 | "useWorkspaces": true, 5 | "npmClientArgs": [ 6 | "--ignore-engines" 7 | ], 8 | "command": { 9 | "version": { 10 | "forcePublish": true, 11 | "exact": true, 12 | "message": "chore(release): 😊 publish %s" 13 | } 14 | } 15 | } 16 | ``` -------------------------------------------------------------------------------- /packages/antd/src/number-picker/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapReadPretty } from '@formily/react' 2 | import { InputNumber } from 'antd' 3 | import { PreviewText } from '../preview-text' 4 | 5 | export const NumberPicker = connect( 6 | InputNumber, 7 | mapReadPretty(PreviewText.NumberPicker) 8 | ) 9 | 10 | export default NumberPicker 11 | ``` -------------------------------------------------------------------------------- /packages/shared/src/case.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { camelCase } from 'camel-case' 2 | import { pascalCase } from 'pascal-case' 3 | import { lowerCase } from 'lower-case' 4 | import { upperCase } from 'upper-case' 5 | import { paramCase } from 'param-case' 6 | 7 | export { lowerCase, upperCase, camelCase, pascalCase, paramCase } 8 | ``` -------------------------------------------------------------------------------- /packages/vue/scripts/postinstall.js: -------------------------------------------------------------------------------- ```javascript 1 | const { switchVersion, loadModule } = require('./utils.js') 2 | 3 | const Vue = loadModule('vue') 4 | 5 | try { 6 | if (Vue.version.startsWith('2.')) { 7 | switchVersion(2) 8 | } else if (Vue.version.startsWith('3.')) { 9 | switchVersion(3) 10 | } 11 | } catch (err) { 12 | // nothing to do 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/antd/src/preview-text/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @form-text-prefix-cls: ~'@{ant-prefix}-form-text'; 5 | 6 | .@{form-text-prefix-cls} { 7 | font-size: 14px; 8 | font-weight: 500; 9 | 10 | .@{ant-prefix}-tag:last-child { 11 | margin-right: 0; 12 | } 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/next/src/select-table/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | @import '~@alifd/next/lib/form/scss/variable.scss'; 3 | 4 | $select-table-prefix-cls: '#{$css-prefix}formily-select-table'; 5 | 6 | .#{$select-table-prefix-cls} { 7 | .#{$select-table-prefix-cls}-search { 8 | margin-bottom: 8px; 9 | } 10 | } 11 | ``` -------------------------------------------------------------------------------- /docs/guide/scenes/more.md: -------------------------------------------------------------------------------- ```markdown 1 | # More Scenes 2 | 3 | Because Formily is a very complete solution at the form level, and it is also very flexible. It supports a lot of scenarios, but we can't list them all. 4 | 5 | Therefore, I still hope that the community can help Formily improve more scenarios! We would be very grateful!😀 6 | ``` -------------------------------------------------------------------------------- /docs/guide/scenes/tab-form.md: -------------------------------------------------------------------------------- ```markdown 1 | # Tab/Accordion Form 2 | 3 | Mainly use the [FormTab](https://antd.formilyjs.org/components/form-tab) component and [FormCollapse](https://antd.formilyjs.org/components/form-collapse) component in [@formily/antd](https://antd.formilyjs.org) or [@formily/next](https://fusion.formilyjs.org) 4 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/hooks/usePrefixCls.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { ConfigProvider } from '@alifd/next' 2 | 3 | export const usePrefixCls = ( 4 | tag?: string, 5 | props?: { 6 | prefix?: string 7 | } 8 | ) => { 9 | const getContext = ConfigProvider['getContext'] 10 | const prefix = props?.prefix ?? getContext()?.prefix ?? 'next-' 11 | return `${prefix}${tag ?? ''}` 12 | } 13 | ``` -------------------------------------------------------------------------------- /packages/element/src/switch/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapProps } from '@formily/vue' 2 | 3 | import type { Switch as ElSwitchProps } from 'element-ui' 4 | import { Switch as ElSwitch } from 'element-ui' 5 | 6 | export type SwitchProps = ElSwitchProps 7 | 8 | export const Switch = connect(ElSwitch, mapProps({ readOnly: 'readonly' })) 9 | 10 | export default Switch 11 | ``` -------------------------------------------------------------------------------- /docs/guide/scenes/index.less: -------------------------------------------------------------------------------- ``` 1 | .array-items-item { 2 | border: 1px solid rgb(238, 238, 238); 3 | margin-bottom: 10px; 4 | padding: 3px 6px; 5 | display: flex; 6 | justify-content: space-around; 7 | transition: all 0.25s; 8 | .ant-formily-item { 9 | margin-bottom: 0 !important; 10 | } 11 | 12 | &:hover { 13 | border: 1px solid rgb(170, 170, 170); 14 | } 15 | } 16 | ``` -------------------------------------------------------------------------------- /packages/element/docs/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- ```javascript 1 | import pageComponents from '@internal/page-components' 2 | import Element from 'element-ui' 3 | import '@formily/element/style.ts' 4 | 5 | export default ({ Vue }) => { 6 | for (const [name, component] of Object.entries(pageComponents)) { 7 | Vue.component(name, component) 8 | } 9 | Vue.use(Element, { size: 'small' }) 10 | } 11 | ``` -------------------------------------------------------------------------------- /packages/next/src/switch/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { Switch as NextSwitch } from '@alifd/next' 2 | import { connect, mapProps } from '@formily/react' 3 | import { mapSize, mapStatus } from '../__builtins__' 4 | export const Switch = connect( 5 | NextSwitch, 6 | mapProps( 7 | { 8 | value: 'checked', 9 | }, 10 | mapSize, 11 | mapStatus 12 | ) 13 | ) 14 | 15 | export default Switch 16 | ``` -------------------------------------------------------------------------------- /packages/next/src/form-button-group/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | 3 | $btn-group-prefix-cls: '#{$css-prefix}formily-button-group'; 4 | 5 | .#{$btn-group-prefix-cls}-sticky { 6 | padding: 10px 0; 7 | border-top: 1px solid #eee; 8 | z-index: 999; 9 | 10 | &-inner { 11 | display: flex; 12 | 13 | .#{$css-prefix}formily-item { 14 | flex: 2; 15 | } 16 | } 17 | } 18 | ``` -------------------------------------------------------------------------------- /packages/element/src/transfer/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapProps } from '@formily/vue' 2 | 3 | import type { Transfer as ElTransferProps } from 'element-ui' 4 | import { Transfer as ElTransfer } from 'element-ui' 5 | 6 | export type TransferProps = ElTransferProps 7 | 8 | export const Transfer = connect(ElTransfer, mapProps({ dataSource: 'data' })) 9 | 10 | export default Transfer 11 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/hooks/useDidUpdate.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useRef } from 'react' 2 | import { useLayoutEffect } from './useLayoutEffect' 3 | import { immediate } from '../shared' 4 | 5 | export const useDidUpdate = (callback?: () => void) => { 6 | const request = useRef(null) 7 | request.current = immediate(callback) 8 | useLayoutEffect(() => { 9 | request.current() 10 | callback() 11 | }) 12 | } 13 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/__tests__/hasCollected.spec.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { observable, hasCollected, autorun } from '../' 2 | 3 | test('hasCollected', () => { 4 | const obs = observable({ value: '' }) 5 | autorun(() => { 6 | expect( 7 | hasCollected(() => { 8 | obs.value 9 | }) 10 | ).toBe(true) 11 | expect(hasCollected(() => {})).toBe(false) 12 | expect(hasCollected()).toBe(false) 13 | }) 14 | }) 15 | ``` -------------------------------------------------------------------------------- /packages/shared/src/instanceof.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { globalThisPolyfill } from './global' 2 | import { isStr, isFn } from './checkers' 3 | export const instOf = (value: any, cls: any) => { 4 | if (isFn(cls)) return value instanceof cls 5 | if (isStr(cls)) { 6 | return globalThisPolyfill[cls] 7 | ? value instanceof globalThisPolyfill[cls] 8 | : false 9 | } 10 | return false 11 | } 12 | ``` -------------------------------------------------------------------------------- /packages/path/src/__tests__/basic.spec.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Path } from '../' 2 | 3 | const { isPathPattern, match } = Path 4 | 5 | test('isPathPattern', () => { 6 | expect(isPathPattern('obj')).toBeTruthy() 7 | expect(isPathPattern(['obj', 'aa'])).toBeTruthy() 8 | expect(isPathPattern(/^obj/)).toBeTruthy() 9 | 10 | const matcher = match('obj.aa') 11 | expect(isPathPattern(matcher)).toBeTruthy() 12 | }) 13 | ``` -------------------------------------------------------------------------------- /.github/workflows/package-size.yml: -------------------------------------------------------------------------------- ```yaml 1 | name: Compressed Size 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: actions/setup-node@v3 12 | with: 13 | node-version: 16 14 | - uses: preactjs/compressed-size-action@v2 15 | with: 16 | repo-token: '${{ secrets.GITHUB_TOKEN }}' 17 | ``` -------------------------------------------------------------------------------- /global.config.ts: -------------------------------------------------------------------------------- ```typescript 1 | import prettyFormat from 'pretty-format' 2 | 3 | global['prettyFormat'] = prettyFormat 4 | 5 | global['sleep'] = (time: number) => { 6 | return new Promise((resolve) => setTimeout(resolve, time)) 7 | } 8 | 9 | global['requestAnimationFrame'] = (fn: () => void) => setTimeout(fn, 0) 10 | 11 | global['document'].documentElement.style['grid-column-gap'] = true 12 | ``` -------------------------------------------------------------------------------- /packages/antd/src/select-table/useFlatOptions.tsx: -------------------------------------------------------------------------------- ```typescript 1 | const useFlatOptions = (tree: any[]) => { 2 | const flatData = (data) => { 3 | let list = [] 4 | data?.forEach((item) => { 5 | list = [...list, item] 6 | if (item?.children?.length) { 7 | list = [...list, ...flatData(item.children)] 8 | } 9 | }) 10 | return list 11 | } 12 | return flatData(tree) 13 | } 14 | 15 | export { useFlatOptions } 16 | ``` -------------------------------------------------------------------------------- /packages/next/src/select-table/useFlatOptions.tsx: -------------------------------------------------------------------------------- ```typescript 1 | const useFlatOptions = (tree: any[]) => { 2 | const flatData = (data) => { 3 | let list = [] 4 | data?.forEach((item) => { 5 | list = [...list, item] 6 | if (item?.children?.length) { 7 | list = [...list, ...flatData(item.children)] 8 | } 9 | }) 10 | return list 11 | } 12 | return flatData(tree) 13 | } 14 | 15 | export { useFlatOptions } 16 | ``` -------------------------------------------------------------------------------- /tsconfig.jest.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "react", 5 | "esModuleInterop": true, 6 | "moduleResolution": "node", 7 | "allowJs": true, 8 | "module": "commonjs", 9 | "target": "es5", 10 | "paths": { 11 | "@formily/*": ["./packages/*/src"] 12 | } 13 | }, 14 | "exclude": ["./packages/*/esm", "./packages/*/lib"] 15 | } 16 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/loading.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Message } from '@alifd/next' 2 | 3 | export const loading = async ( 4 | title: React.ReactNode = 'Loading...', 5 | processor: () => Promise<any> 6 | ) => { 7 | let loading = setTimeout(() => { 8 | Message.loading(title as any) 9 | }, 100) 10 | try { 11 | return await processor() 12 | } finally { 13 | Message.hide() 14 | clearTimeout(loading) 15 | } 16 | } 17 | ``` -------------------------------------------------------------------------------- /packages/react/src/components/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './FormProvider' 2 | export * from './FormConsumer' 3 | export * from './ArrayField' 4 | export * from './ObjectField' 5 | export * from './VoidField' 6 | export * from './RecursionField' 7 | export * from './ExpressionScope' 8 | export * from './RecordsScope' 9 | export * from './RecordScope' 10 | export * from './SchemaField' 11 | export * from './Field' 12 | ``` -------------------------------------------------------------------------------- /packages/antd/src/__builtins__/loading.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { message } from 'antd' 2 | 3 | export const loading = async ( 4 | title: React.ReactNode = 'Loading...', 5 | processor: () => Promise<any> 6 | ) => { 7 | let hide = null 8 | let loading = setTimeout(() => { 9 | hide = message.loading(title) 10 | }, 100) 11 | try { 12 | return await processor() 13 | } finally { 14 | hide?.() 15 | clearTimeout(loading) 16 | } 17 | } 18 | ``` -------------------------------------------------------------------------------- /packages/next/src/__builtins__/mapSize.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useFormLayout, useFormShallowLayout } from '../form-layout' 2 | 3 | export const mapSize = (props: any) => { 4 | const layout = { ...useFormShallowLayout(), ...useFormLayout() } 5 | const takeSize = () => { 6 | return layout.size === 'default' ? 'medium' : layout.size 7 | } 8 | return { 9 | ...props, 10 | size: props.size || takeSize(), 11 | } 12 | } 13 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useAttach.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { unstable_useCompatEffect } from '@formily/reactive-react' 2 | interface IRecycleTarget { 3 | onMount: () => void 4 | onUnmount: () => void 5 | } 6 | 7 | export const useAttach = <T extends IRecycleTarget>(target: T): T => { 8 | unstable_useCompatEffect(() => { 9 | target.onMount() 10 | return () => target.onUnmount() 11 | }, [target]) 12 | return target 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-tabs/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | $array-table-prefix-cls: '#{$formily-prefix}-array-tabs'; 4 | 5 | .#{$array-table-prefix-cls} { 6 | .#{$formily-prefix}-array-tabs-addition { 7 | position: absolute; 8 | right: -56px; 9 | top: -1px; 10 | } 11 | 12 | .#{$array-table-prefix-cls}-errors-badge { 13 | line-height: 1; 14 | vertical-align: initial; 15 | } 16 | } 17 | ``` -------------------------------------------------------------------------------- /packages/antd/src/form-button-group/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @btn-group-prefix-cls: ~'@{ant-prefix}-formily-button-group'; 5 | 6 | .@{btn-group-prefix-cls}-sticky { 7 | padding: 10px 0; 8 | border-top: 1px solid @border-color-split; 9 | z-index: 999; 10 | &-inner { 11 | display: flex; 12 | .@{ant-prefix}-formily-item { 13 | flex: 2; 14 | } 15 | } 16 | } 17 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/switch.md: -------------------------------------------------------------------------------- ```markdown 1 | # Switch 2 | 3 | > 开关组件 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/switch/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/switch/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/switch/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/switch](https://element.eleme.io/#/zh-CN/component/switch) 20 | ``` -------------------------------------------------------------------------------- /packages/reactive/src/__tests__/untracked.spec.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { untracked, observable, autorun } from '../' 2 | 3 | test('basic untracked', () => { 4 | const obs = observable<any>({}) 5 | const fn = jest.fn() 6 | autorun(() => { 7 | untracked(() => { 8 | fn(obs.value) 9 | }) 10 | }) 11 | 12 | expect(fn).toBeCalledTimes(1) 13 | obs.value = 123 14 | expect(fn).toBeCalledTimes(1) 15 | }) 16 | 17 | test('no params untracked', () => { 18 | untracked() 19 | }) 20 | ``` -------------------------------------------------------------------------------- /packages/vue/src/utils/resolveSchemaProps.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { paramCase } from '@formily/shared' 2 | 3 | export const resolveSchemaProps = (props: Record<string, any>) => { 4 | const newProps = {} 5 | Object.keys(props).forEach((key) => { 6 | if (key.indexOf('x') === 0 && key.indexOf('x-') === -1) { 7 | newProps[paramCase(key)] = props[key] 8 | } else { 9 | newProps[key] = props[key] 10 | } 11 | }) 12 | return newProps 13 | } 14 | ``` -------------------------------------------------------------------------------- /packages/antd/src/array-cards/style.less: -------------------------------------------------------------------------------- ``` 1 | @root-entry-name: 'default'; 2 | @import (reference) '~antd/es/style/themes/index.less'; 3 | 4 | @array-base-prefix-cls: ~'@{ant-prefix}-formily-array-base'; 5 | @array-cards-prefix-cls: ~'@{ant-prefix}-formily-array-cards'; 6 | 7 | .@{array-cards-prefix-cls}-item { 8 | margin-bottom: 10px !important; 9 | } 10 | 11 | .ant-card-extra { 12 | .@{array-base-prefix-cls}-copy { 13 | margin-left: 6px; 14 | } 15 | } 16 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/transfer.md: -------------------------------------------------------------------------------- ```markdown 1 | # Transfer 2 | 3 | > 穿梭框 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/transfer/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/transfer/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/transfer/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/transfer](https://element.eleme.io/#/zh-CN/component/transfer) 20 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/styles/common.scss: -------------------------------------------------------------------------------- ```scss 1 | $formily-prefix: 'formily-element'; 2 | $namespace: 'el'; 3 | @import '~element-ui/packages/theme-chalk/src/common/var.scss'; 4 | 5 | @mixin active { 6 | border-color: $--color-primary; 7 | outline: 0; 8 | border-right-width: $--border-width-base !important; 9 | } 10 | 11 | @mixin hover { 12 | border-color: $--border-color-hover; 13 | outline: 0; 14 | border-right-width: $--border-width-base !important; 15 | } 16 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/cascader.md: -------------------------------------------------------------------------------- ```markdown 1 | # Cascader 2 | 3 | > 级联选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/cascader/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/cascader/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/cascader/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/cascader](https://element.eleme.io/#/zh-CN/component/cascader) 20 | ``` -------------------------------------------------------------------------------- /packages/antd/src/space/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | import { Space as AntdSpace, SpaceProps } from 'antd' 3 | import { useFormLayout } from '../form-layout' 4 | 5 | export const Space: React.FC<React.PropsWithChildren<SpaceProps>> = (props) => { 6 | const layout = useFormLayout() 7 | return React.createElement(AntdSpace, { 8 | size: props.size ?? layout?.spaceGap, 9 | ...props, 10 | }) 11 | } 12 | 13 | export default Space 14 | ``` -------------------------------------------------------------------------------- /packages/core/src/models/types.ts: -------------------------------------------------------------------------------- ```typescript 1 | export type { Form } from './Form' 2 | export type { Field } from './Field' 3 | export type { Query } from './Query' 4 | export type { Heart } from './Heart' 5 | export type { Graph } from './Graph' 6 | export type { LifeCycle } from './LifeCycle' 7 | export type { ArrayField } from './ArrayField' 8 | export type { ObjectField } from './ObjectField' 9 | export type { VoidField } from './VoidField' 10 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-table/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | 3 | import 'element-ui/packages/theme-chalk/src/table.scss' 4 | import 'element-ui/packages/theme-chalk/src/table-column.scss' 5 | import 'element-ui/packages/theme-chalk/src/button.scss' 6 | import 'element-ui/packages/theme-chalk/src/select.scss' 7 | import 'element-ui/packages/theme-chalk/src/badge.scss' 8 | 9 | // 依赖 10 | import '../array-base/style' 11 | import '../space/style' 12 | ``` -------------------------------------------------------------------------------- /.github/workflows/check-pr-title.yml: -------------------------------------------------------------------------------- ```yaml 1 | name: Check PR title 2 | on: 3 | pull_request_target: 4 | types: 5 | - opened 6 | - reopened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | lint: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: aslafy-z/[email protected] 15 | with: 16 | preset: conventional-changelog-angular@^5.0.6 17 | env: 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 19 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-drawer/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-form-drawer { 4 | .el-drawer__body { 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | 9 | &-body { 10 | flex: 1; 11 | overflow: auto; 12 | padding: $--dialog-padding-primary; 13 | } 14 | 15 | &-footer { 16 | padding: $--dialog-padding-primary; 17 | display: flex; 18 | justify-content: flex-end; 19 | align-items: center; 20 | } 21 | } 22 | ``` -------------------------------------------------------------------------------- /packages/next/src/number-picker/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapProps, mapReadPretty } from '@formily/react' 2 | import { NumberPicker as InputNumber } from '@alifd/next' 3 | import { PreviewText } from '../preview-text' 4 | import { mapSize, mapStatus } from '../__builtins__' 5 | export const NumberPicker = connect( 6 | InputNumber, 7 | mapProps(mapSize, mapStatus), 8 | mapReadPretty(PreviewText.NumberPicker) 9 | ) 10 | 11 | export default NumberPicker 12 | ``` -------------------------------------------------------------------------------- /packages/element/tsconfig.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./lib", 5 | "skipLibCheck": true, 6 | "paths": { 7 | "@formily/*": ["../../packages/*", "../../devtools/*"] 8 | }, 9 | "plugins": [{ "transform": "./transformer.ts", "after": true }], 10 | "lib": ["ESNext", "DOM"] 11 | }, 12 | "include": ["./src/**/*.ts", "./src/**/*.tsx"], 13 | "exclude": ["./esm/*", "./lib/*"] 14 | } 15 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/date-picker.md: -------------------------------------------------------------------------------- ```markdown 1 | # DatePicker 2 | 3 | > 日期选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/date-picker/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/date-picker/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/date-picker/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/date-picker](https://element.eleme.io/#/zh-CN/component/date-picker) 20 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/time-picker.md: -------------------------------------------------------------------------------- ```markdown 1 | # TimePicker 2 | 3 | > 时间选择器 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/time-picker/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/time-picker/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/time-picker/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/time-picker](https://element.eleme.io/#/zh-CN/component/time-picker) 20 | ``` -------------------------------------------------------------------------------- /.vscode/cspell.json: -------------------------------------------------------------------------------- ```json 1 | { 2 | "version": "0.1", 3 | "language": "en", 4 | "ignoreWords": [ 5 | "autorun", 6 | "mutators", 7 | "Formily", 8 | "formily", 9 | "untrack", 10 | "untracker", 11 | "untracked", 12 | "Untracking", 13 | "Unmount", 14 | "octokit", 15 | "repos", 16 | "alibaba", 17 | "Lifecycles", 18 | "antd", 19 | "Antd", 20 | "alifd", 21 | "Mixins", 22 | "builtins", 23 | "cascader", 24 | "Cascader", 25 | "middlewares" 26 | ] 27 | } 28 | ``` -------------------------------------------------------------------------------- /scripts/build-style/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { runCopy, CopyBaseOptions } from './copy' 2 | import { buildAllStyles } from './buildAllStyles' 3 | 4 | // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types 5 | export function build({ 6 | allStylesOutputFile, 7 | ...opts 8 | }: CopyBaseOptions & { allStylesOutputFile: string }) { 9 | return Promise.all([buildAllStyles(allStylesOutputFile), runCopy(opts)]) 10 | } 11 | 12 | export { runCopy } 13 | ``` -------------------------------------------------------------------------------- /packages/element/docs/guide/input-number.md: -------------------------------------------------------------------------------- ```markdown 1 | # InputNumber 2 | 3 | > 数字输入框 4 | 5 | ## Markup Schema 案例 6 | 7 | <dumi-previewer demoPath="guide/input-number/markup-schema" /> 8 | 9 | ## JSON Schema 案例 10 | 11 | <dumi-previewer demoPath="guide/input-number/json-schema" /> 12 | 13 | ## Template 案例 14 | 15 | <dumi-previewer demoPath="guide/input-number/template" /> 16 | 17 | ## API 18 | 19 | 参考 [https://element.eleme.io/#/zh-CN/component/input-number](https://element.eleme.io/#/zh-CN/component/input-number) 20 | ``` -------------------------------------------------------------------------------- /packages/next/src/preview-text/main.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '~@alifd/next/lib/core/index-noreset.scss'; 2 | 3 | $form-preview-prefix-cls: '#{$css-prefix}form-preview'; 4 | 5 | .#{$form-preview-prefix-cls} { 6 | font-weight: 400; 7 | word-break: break-all; 8 | 9 | .#{$css-prefix}tag { 10 | margin-right: 4px; 11 | } 12 | 13 | .#{$css-prefix}tag:last-child { 14 | margin-right: 0; 15 | } 16 | } 17 | 18 | p.#{$form-preview-prefix-cls} { 19 | margin: 0; 20 | font-size: inherit; 21 | line-height: inherit; 22 | } 23 | ``` -------------------------------------------------------------------------------- /packages/react/src/components/RecordsScope.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | import { ExpressionScope } from './ExpressionScope' 3 | import { ReactFC, IRecordsScopeProps } from '../types' 4 | 5 | export const RecordsScope: ReactFC<IRecordsScopeProps> = (props) => { 6 | return ( 7 | <ExpressionScope 8 | value={{ 9 | get $records() { 10 | return props.getRecords?.() ?? [] 11 | }, 12 | }} 13 | > 14 | {props.children} 15 | </ExpressionScope> 16 | ) 17 | } 18 | ``` -------------------------------------------------------------------------------- /packages/element/src/array-collapse/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import './style.scss' 2 | import 'element-ui/packages/theme-chalk/src/empty.scss' 3 | import 'element-ui/packages/theme-chalk/src/row.scss' 4 | import 'element-ui/packages/theme-chalk/src/collapse.scss' 5 | import 'element-ui/packages/theme-chalk/src/collapse-item.scss' 6 | import 'element-ui/packages/theme-chalk/src/card.scss' 7 | import 'element-ui/packages/theme-chalk/src/badge.scss' 8 | 9 | // 依赖 10 | import '../array-base/style' 11 | ``` -------------------------------------------------------------------------------- /packages/element/src/space/style.scss: -------------------------------------------------------------------------------- ```scss 1 | @import '../__builtins__/styles/common.scss'; 2 | 3 | .#{$formily-prefix}-space { 4 | display: inline-flex; 5 | &-vertical { 6 | flex-direction: column; 7 | } 8 | 9 | &-align { 10 | &-center { 11 | align-items: center; 12 | } 13 | &-start { 14 | align-items: flex-start; 15 | } 16 | &-end { 17 | align-items: flex-end; 18 | } 19 | &-baseline { 20 | align-items: baseline; 21 | } 22 | } 23 | 24 | &-item { 25 | display: contents; 26 | } 27 | } 28 | ``` -------------------------------------------------------------------------------- /packages/element/create-style.ts: -------------------------------------------------------------------------------- ```typescript 1 | import glob from 'glob' 2 | import path from 'path' 3 | import fs from 'fs-extra' 4 | 5 | glob( 6 | './*/style.scss', 7 | { cwd: path.resolve(__dirname, './src') }, 8 | (err, files) => { 9 | if (err) return console.error(err) 10 | fs.writeFile( 11 | path.resolve(__dirname, './src/style.ts'), 12 | `// auto generated code 13 | ${files 14 | .map((path) => { 15 | return `import '${path}'\n` 16 | }) 17 | .join('')}`, 18 | 'utf8' 19 | ) 20 | } 21 | ) 22 | ``` -------------------------------------------------------------------------------- /packages/next/src/cascader/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapReadPretty, mapProps } from '@formily/react' 2 | import { CascaderSelect } from '@alifd/next' 3 | import { PreviewText } from '../preview-text' 4 | import { mapSize, mapStatus } from '../__builtins__' 5 | export const Cascader = connect( 6 | CascaderSelect, 7 | mapProps( 8 | { 9 | dataSource: true, 10 | }, 11 | mapSize, 12 | mapStatus 13 | ), 14 | mapReadPretty(PreviewText.Cascader) 15 | ) 16 | 17 | export default Cascader 18 | ``` -------------------------------------------------------------------------------- /packages/shared/src/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export * from './array' 2 | export * from './compare' 3 | export * from './checkers' 4 | export * from './clone' 5 | export * from './isEmpty' 6 | export * from './case' 7 | export * from './string' 8 | export * from './global' 9 | export * from './path' 10 | export * from './deprecate' 11 | export * from './subscribable' 12 | export * from './middleware' 13 | export * from './merge' 14 | export * from './instanceof' 15 | export * from './defaults' 16 | export * from './uid' 17 | ``` -------------------------------------------------------------------------------- /packages/shared/src/global.ts: -------------------------------------------------------------------------------- ```typescript 1 | /* istanbul ignore next */ 2 | function globalSelf() { 3 | try { 4 | if (typeof self !== 'undefined') { 5 | return self 6 | } 7 | } catch (e) {} 8 | try { 9 | if (typeof window !== 'undefined') { 10 | return window 11 | } 12 | } catch (e) {} 13 | try { 14 | if (typeof global !== 'undefined') { 15 | return global 16 | } 17 | } catch (e) {} 18 | return Function('return this')() 19 | } 20 | export const globalThisPolyfill: Window = globalSelf() 21 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/shared/global.ts: -------------------------------------------------------------------------------- ```typescript 1 | /* istanbul ignore next */ 2 | function globalSelf() { 3 | try { 4 | if (typeof self !== 'undefined') { 5 | return self 6 | } 7 | } catch (e) {} 8 | try { 9 | if (typeof window !== 'undefined') { 10 | return window 11 | } 12 | } catch (e) {} 13 | try { 14 | if (typeof global !== 'undefined') { 15 | return global 16 | } 17 | } catch (e) {} 18 | return Function('return this')() 19 | } 20 | 21 | export const globalThisPolyfill: Window = globalSelf() 22 | ``` -------------------------------------------------------------------------------- /packages/element/src/cascader/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapProps, mapReadPretty } from '@formily/vue' 2 | import { Cascader as ELCascader } from 'element-ui' 3 | 4 | import type { Cascader as ElCascaderProps } from 'element-ui' 5 | import { PreviewText } from '../preview-text' 6 | 7 | export type CascaderProps = ElCascaderProps 8 | 9 | export const Cascader = connect( 10 | ELCascader, 11 | mapProps({ dataSource: 'options' }), 12 | mapReadPretty(PreviewText.Cascader) 13 | ) 14 | 15 | export default Cascader 16 | ``` -------------------------------------------------------------------------------- /packages/element/src/form-item/var.scss: -------------------------------------------------------------------------------- ```scss 1 | $form-item-prefix: '#{$formily-prefix}-form-item'; 2 | 3 | $--form-font-size: $--font-size-base !default; 4 | 5 | $--form-label-font-size: $--form-font-size !default; 6 | 7 | $--form-item-large-line-height: 40px; 8 | 9 | $--form-item-medium-line-height: 32px; 10 | 11 | $--form-item-small-line-height: 24px; 12 | 13 | $--form-item-label-top-line-height: 40px; 14 | 15 | $--form-error-line-height: 22px !default; 16 | 17 | $--form-item-margin-bottom: $--form-error-line-height !default; 18 | ``` -------------------------------------------------------------------------------- /packages/antd/src/__builtins__/hooks/usePrefixCls.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { useContext } from 'react' 2 | import { ConfigProvider } from 'antd' 3 | 4 | export const usePrefixCls = ( 5 | tag?: string, 6 | props?: { 7 | prefixCls?: string 8 | } 9 | ) => { 10 | if ('ConfigContext' in ConfigProvider) { 11 | const { getPrefixCls } = useContext(ConfigProvider.ConfigContext) 12 | return getPrefixCls(tag, props?.prefixCls) 13 | } else { 14 | const prefix = props?.prefixCls ?? 'ant-' 15 | return `${prefix}${tag ?? ''}` 16 | } 17 | } 18 | ``` -------------------------------------------------------------------------------- /packages/antd/src/switch/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { Switch as AntdSwitch } from 'antd' 2 | import { connect, mapProps } from '@formily/react' 3 | 4 | export const Switch = connect( 5 | AntdSwitch, 6 | mapProps( 7 | { 8 | value: 'checked', 9 | }, 10 | (props) => { 11 | const onChange = props.onChange 12 | delete props['value'] 13 | return { 14 | ...props, 15 | onChange(checked) { 16 | onChange?.(checked, null) 17 | }, 18 | } 19 | } 20 | ) 21 | ) 22 | 23 | export default Switch 24 | ``` -------------------------------------------------------------------------------- /packages/next/src/tree-select/index.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import { connect, mapReadPretty, mapProps } from '@formily/react' 2 | import { TreeSelect as NextTreeSelect } from '@alifd/next' 3 | import { PreviewText } from '../preview-text' 4 | import { mapSize, mapStatus } from '../__builtins__' 5 | 6 | export const TreeSelect = connect( 7 | NextTreeSelect, 8 | mapProps( 9 | { 10 | dataSource: true, 11 | }, 12 | mapSize, 13 | mapStatus 14 | ), 15 | mapReadPretty(PreviewText.TreeSelect) 16 | ) 17 | 18 | export default TreeSelect 19 | ``` -------------------------------------------------------------------------------- /packages/element/src/__builtins__/shared/loading.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Loading } from 'element-ui' 2 | 3 | export const loading = async ( 4 | loadingText = 'Loading...', 5 | processor: () => Promise<any> 6 | ) => { 7 | let loadingInstance = null 8 | let loading = setTimeout(() => { 9 | loadingInstance = Loading.service({ 10 | text: loadingText, 11 | background: 'transparent', 12 | }) 13 | }, 100) 14 | try { 15 | return await processor() 16 | } finally { 17 | loadingInstance?.close() 18 | clearTimeout(loading) 19 | } 20 | } 21 | ``` -------------------------------------------------------------------------------- /packages/vue/scripts/utils.js: -------------------------------------------------------------------------------- ```javascript 1 | const fs = require('fs-extra') 2 | const path = require('path') 3 | 4 | const dir = path.resolve(__dirname, '..', 'type-artefacts') 5 | 6 | function switchVersion(version) { 7 | fs.emptyDirSync(`${dir}/cur`) 8 | fs.copySync(`${dir}/v${version}`, `${dir}/cur`) 9 | } 10 | 11 | function loadModule(name) { 12 | try { 13 | return require(name) 14 | } catch (e) { 15 | return undefined 16 | } 17 | } 18 | 19 | module.exports.loadModule = loadModule 20 | module.exports.switchVersion = switchVersion 21 | ``` -------------------------------------------------------------------------------- /packages/element/src/password/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { Input } from '../input' 2 | import { connect, mapProps, mapReadPretty } from '@formily/vue' 3 | import { PreviewText } from '../preview-text' 4 | import type { Input as ElInputProps } from 'element-ui' 5 | 6 | export type PasswordProps = ElInputProps 7 | 8 | export const Password = connect( 9 | Input, 10 | mapProps((props) => { 11 | return { 12 | ...props, 13 | showPassword: true, 14 | } 15 | }), 16 | mapReadPretty(PreviewText.Input) 17 | ) 18 | 19 | export default Password 20 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/src/observer/observerInVue3.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { IObserverOptions } from '../types' 2 | import { useObserver } from '../hooks/useObserver' 3 | 4 | /* istanbul ignore next */ 5 | export const observer = function (opts: any, options?: IObserverOptions): any { 6 | const name = options?.name || opts.name || 'ObservableComponent' 7 | 8 | return { 9 | name, 10 | ...opts, 11 | setup(props: Record<string, any>, context: any) { 12 | useObserver(options) 13 | return opts?.setup?.(props, context) 14 | }, 15 | } 16 | } 17 | ``` -------------------------------------------------------------------------------- /packages/vue/docs/demos/api/components/form-provider.vue: -------------------------------------------------------------------------------- ```vue 1 | <template> 2 | <FormProvider :form="form"> 3 | <Field name="input" :component="[Input]" /> 4 | </FormProvider> 5 | </template> 6 | 7 | <script> 8 | import { Input } from 'ant-design-vue' 9 | import { createForm } from '@formily/core' 10 | import { FormProvider, Field } from '@formily/vue' 11 | import 'ant-design-vue/dist/antd.css' 12 | 13 | export default { 14 | components: { FormProvider, Field }, 15 | data() { 16 | return { 17 | Input, 18 | form: createForm(), 19 | } 20 | }, 21 | } 22 | </script> 23 | ``` -------------------------------------------------------------------------------- /docs/site/QrCode.less: -------------------------------------------------------------------------------- ``` 1 | .qrcode-group { 2 | display: flex; 3 | justify-content: center; 4 | .qrcode { 5 | width: 400px; 6 | margin: 20px; 7 | display: flex; 8 | flex-direction: column; 9 | justify-content: center; 10 | align-items: center; 11 | 12 | &-title { 13 | font-size: 20px; 14 | position: relative; 15 | 16 | &-content { 17 | position: absolute; 18 | left: 50%; 19 | bottom: 0; 20 | white-space: nowrap; 21 | transform: translateX(-50%); 22 | } 23 | } 24 | } 25 | } 26 | ``` -------------------------------------------------------------------------------- /packages/core/docs/api/entry/ActionResponse.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | import './ActionResponse.less' 3 | 4 | type ActionResponseProps = { 5 | response?: React.ReactNode 6 | } 7 | 8 | export const ActionResponse: React.FC< 9 | React.PropsWithChildren<ActionResponseProps> 10 | > = (props) => { 11 | return ( 12 | <div className="as-wrapper"> 13 | <div className="as-actions">{props.children}</div> 14 | {props.response && ( 15 | <div className="as-response">Response:{props.response}</div> 16 | )} 17 | </div> 18 | ) 19 | } 20 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useFormEffects.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { unstable_useCompatFactory } from '@formily/reactive-react' 2 | import { Form } from '@formily/core' 3 | import { uid } from '@formily/shared' 4 | import { useForm } from './useForm' 5 | 6 | export const useFormEffects = (effects?: (form: Form) => void) => { 7 | const form = useForm() 8 | unstable_useCompatFactory(() => { 9 | const id = uid() 10 | form.addEffects(id, effects) 11 | return { 12 | dispose() { 13 | form.removeEffects(id) 14 | }, 15 | } 16 | }) 17 | } 18 | ``` -------------------------------------------------------------------------------- /packages/react/src/components/FormConsumer.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React, { Fragment } from 'react' 2 | import { isFn } from '@formily/shared' 3 | import { observer } from '@formily/reactive-react' 4 | import { useForm } from '../hooks' 5 | import { IFormSpyProps, ReactFC } from '../types' 6 | 7 | export const FormConsumer: ReactFC<IFormSpyProps> = observer((props) => { 8 | const children = isFn(props.children) ? props.children(useForm()) : null 9 | return <Fragment>{children}</Fragment> 10 | }) 11 | 12 | FormConsumer.displayName = 'FormConsumer' 13 | ``` -------------------------------------------------------------------------------- /packages/reactive-react/src/types.ts: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | 3 | export interface IObserverOptions { 4 | forwardRef?: boolean 5 | scheduler?: (updater: () => void) => void 6 | displayName?: string 7 | } 8 | 9 | export interface IObserverProps { 10 | children?: (() => React.ReactElement) | React.ReactNode 11 | } 12 | 13 | export type Modify<T, R> = Omit<T, keyof R> & R 14 | 15 | export type ReactPropsWithChildren<P> = Modify< 16 | { children?: React.ReactNode | undefined }, 17 | P 18 | > 19 | 20 | export type ReactFC<P = {}> = React.FC<ReactPropsWithChildren<P>> 21 | ``` -------------------------------------------------------------------------------- /packages/vue/docs/demos/api/components/field.vue: -------------------------------------------------------------------------------- ```vue 1 | <template> 2 | <FormProvider :form="form"> 3 | <Field name="input" :component="[Input, { placeholder: '请输入' }]" /> 4 | </FormProvider> 5 | </template> 6 | 7 | <script> 8 | import { Input } from 'ant-design-vue' 9 | import { createForm } from '@formily/core' 10 | import { FormProvider, Field } from '@formily/vue' 11 | import 'ant-design-vue/dist/antd.css' 12 | 13 | export default { 14 | components: { FormProvider, Field }, 15 | data() { 16 | return { 17 | Input, 18 | form: createForm(), 19 | } 20 | }, 21 | } 22 | </script> 23 | ``` -------------------------------------------------------------------------------- /packages/react/src/components/FormProvider.tsx: -------------------------------------------------------------------------------- ```typescript 1 | import React from 'react' 2 | import { useAttach } from '../hooks/useAttach' 3 | import { FormContext, ContextCleaner } from '../shared' 4 | import { IProviderProps, ReactFC } from '../types' 5 | 6 | export const FormProvider: ReactFC<IProviderProps> = (props) => { 7 | const form = useAttach(props.form) 8 | return ( 9 | <ContextCleaner> 10 | <FormContext.Provider value={form}>{props.children}</FormContext.Provider> 11 | </ContextCleaner> 12 | ) 13 | } 14 | 15 | FormProvider.displayName = 'FormProvider' 16 | ``` -------------------------------------------------------------------------------- /packages/react/src/hooks/useParentForm.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { isObjectField, GeneralField, Form, ObjectField } from '@formily/core' 2 | import { useField } from './useField' 3 | import { useForm } from './useForm' 4 | 5 | export const useParentForm = (): Form | ObjectField => { 6 | const field = useField() 7 | const form = useForm() 8 | const findObjectParent = (field: GeneralField) => { 9 | if (!field) return form 10 | if (isObjectField(field)) return field 11 | return findObjectParent(field?.parent) 12 | } 13 | return findObjectParent(field) 14 | } 15 | ``` -------------------------------------------------------------------------------- /packages/path/src/contexts.ts: -------------------------------------------------------------------------------- ```typescript 1 | export type Context = { 2 | flag: string 3 | [key: string]: any 4 | } 5 | 6 | const ContextType = (flag: string, props?: any): Context => { 7 | return { 8 | flag, 9 | ...props, 10 | } 11 | } 12 | 13 | export const bracketContext = ContextType('[]') 14 | 15 | export const bracketArrayContext = ContextType('[\\d]') 16 | 17 | export const bracketDContext = ContextType('[[]]') 18 | 19 | export const parenContext = ContextType('()') 20 | 21 | export const braceContext = ContextType('{}') 22 | 23 | export const destructorContext = ContextType('{x}') 24 | ``` -------------------------------------------------------------------------------- /packages/reactive/docs/api/untracked.md: -------------------------------------------------------------------------------- ```markdown 1 | # untracked 2 | 3 | ## Description 4 | 5 | Usage is similar to batch, and will never be collected by dependencies within a given untracker function 6 | 7 | ## Signature 8 | 9 | ```ts 10 | interface untracked<T extends () => any> { 11 | (untracker?: T): ReturnType<T> 12 | } 13 | ``` 14 | 15 | ## Example 16 | 17 | ```ts 18 | import { observable, autorun, untracked } from '@formily/reactive' 19 | 20 | const obs = observable({ 21 | aa: 11, 22 | }) 23 | 24 | autorun(() => { 25 | console.log(untracked(() => obs.aa)) // will not trigger when changes 26 | }) 27 | 28 | obs.aa = 22 29 | ``` 30 | ``` -------------------------------------------------------------------------------- /packages/vue/src/components/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | export { default as FormProvider } from './FormProvider' 2 | export { default as FormConsumer } from './FormConsumer' 3 | export { default as ArrayField } from './ArrayField' 4 | export { default as ObjectField } from './ObjectField' 5 | export { default as VoidField } from './VoidField' 6 | export { default as RecursionField } from './RecursionField' 7 | export { default as Field } from './Field' 8 | export { createSchemaField } from './SchemaField' 9 | export { ExpressionScope } from './ExpressionScope' 10 | ``` -------------------------------------------------------------------------------- /docs/site/Contributors.less: -------------------------------------------------------------------------------- ``` 1 | .contri-list { 2 | display: flex; 3 | flex-wrap: wrap; 4 | 5 | .contri-user { 6 | display: flex; 7 | flex-direction: column; 8 | width: 120px; 9 | height: 120px; 10 | align-items: center; 11 | justify-content: center; 12 | 13 | &-avatar { 14 | display: block; 15 | width: 60px; 16 | height: 60px; 17 | border-radius: 60px; 18 | overflow: hidden; 19 | transition: all 0.15s ease-in-out; 20 | 21 | &:hover { 22 | opacity: 0.8; 23 | } 24 | } 25 | 26 | &-info { 27 | text-align: center; 28 | } 29 | } 30 | } 31 | ``` -------------------------------------------------------------------------------- /packages/reactive/docs/api/raw.md: -------------------------------------------------------------------------------- ```markdown 1 | # raw 2 | 3 | ## Description 4 | 5 | Obtain the source data from the observable object. Generally, this API is not recommended 6 | 7 | <Alert> 8 | Note: Only the source data of the current object can be obtained, excluding deep object properties 9 | </Alert> 10 | 11 | ## Signature 12 | 13 | ```ts 14 | interface raw<T extends object> { 15 | (target: T): T 16 | } 17 | ``` 18 | 19 | ## Example 20 | 21 | ```ts 22 | import { raw, observable } from '@formily/reactive' 23 | 24 | const obs = observable({}) 25 | 26 | obs.aa = { bb: 123 } 27 | 28 | console.log(raw(obs)) 29 | console.log(raw(obs.aa)) 30 | ``` 31 | ``` -------------------------------------------------------------------------------- /packages/core/docs/api/entry/ActionResponse.less: -------------------------------------------------------------------------------- ``` 1 | .as-wrapper { 2 | .as-actions { 3 | & button { 4 | margin-right: 5px; 5 | background-color: #fff; 6 | border: 2px solid #d4bbbb; 7 | border-radius: 6px; 8 | outline: none; 9 | padding: 8px 20px; 10 | cursor: pointer; 11 | transition: all 0.15s ease-in-out; 12 | &:hover { 13 | border: 2px solid #9db8f3; 14 | } 15 | } 16 | } 17 | 18 | .as-response { 19 | border: 2px dashed #f0bdbd; 20 | font-size: 14px; 21 | border-radius: 6px; 22 | padding: 8px 20px; 23 | margin-top: 10px; 24 | } 25 | } 26 | ``` -------------------------------------------------------------------------------- /packages/vue/src/hooks/useFormEffects.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { onBeforeUnmount, watchEffect } from 'vue-demi' 2 | import { Form } from '@formily/core' 3 | import { uid } from '@formily/shared' 4 | import { useForm } from './useForm' 5 | 6 | export const useFormEffects = (effects?: (form: Form) => void): void => { 7 | const formRef = useForm() 8 | 9 | const stop = watchEffect((onCleanup) => { 10 | const id = uid() 11 | formRef.value.addEffects(id, effects) 12 | 13 | onCleanup(() => { 14 | formRef.value.removeEffects(id) 15 | }) 16 | }) 17 | 18 | onBeforeUnmount(() => stop()) 19 | } 20 | ``` -------------------------------------------------------------------------------- /packages/antd/src/style.ts: -------------------------------------------------------------------------------- ```typescript 1 | // auto generated code 2 | import './array-base/style.less' 3 | import './array-cards/style.less' 4 | import './array-collapse/style.less' 5 | import './array-items/style.less' 6 | import './array-table/style.less' 7 | import './editable/style.less' 8 | import './form-button-group/style.less' 9 | import './form-grid/style.less' 10 | import './form-item/style.less' 11 | import './form-layout/style.less' 12 | import './form/style.less' 13 | import './preview-text/style.less' 14 | import './radio/style.less' 15 | import './select-table/style.less' 16 | ``` -------------------------------------------------------------------------------- /packages/reactive-vue/src/observer/index.ts: -------------------------------------------------------------------------------- ```typescript 1 | import { isVue2 } from 'vue-demi' 2 | import { observer as observerV2 } from './observerInVue2' 3 | import { observer as observerV3 } from './observerInVue3' 4 | import collectData from './collectData' 5 | import { IObserverOptions } from '../types' 6 | 7 | export function observer<C>(baseComponent: C, options?: IObserverOptions): C { 8 | /* istanbul ignore else */ 9 | if (isVue2) { 10 | return observerV2(baseComponent, options) 11 | } else { 12 | return observerV3(baseComponent, options) 13 | } 14 | } 15 | 16 | export { collectData } 17 | ```