UNPKG

@innoways/hooks

Version:

drip-form通用hooks

503 lines (320 loc) 17.9 kB
# Change Log ## 8.0.15 ### Patch Changes - Fix: fixed country state city field reset issue on change - Updated dependencies - @innoways/utils@8.0.15 ## 8.0.14 ### Patch Changes - fix checkbox field not checked issue - Updated dependencies - @innoways/utils@8.0.14 ## 8.0.13 ### Patch Changes - version 8.0.13 - Updated dependencies - @innoways/utils@8.0.13 ## 8.0.12 ### Patch Changes - 8.0.12 - Updated dependencies - @innoways/utils@8.0.12 ## 8.0.11 ### Patch Changes - Added loader for formvalue add api call - Updated dependencies - @innoways/utils@8.0.11 ## 8.0.10 ### Patch Changes - fixed title set issue version 8.1.0 - Updated dependencies - @innoways/utils@8.0.10 ## 8.0.9 ### Patch Changes - Fixed auto details fetch issue using formValue api, version 8.0.9 - Updated dependencies - @innoways/utils@8.0.9 ## 8.0.8 ### Patch Changes - Feature: added autoFormValue get and save, version 8.0.8 - Updated dependencies - @innoways/utils@8.0.8 ## 8.0.7 ### Patch Changes - fixed fieldKey default to apiKey version 8.0.7 - Updated dependencies - @innoways/utils@8.0.7 ## 8.0.6 ### Patch Changes - fixed fieldKey default to apiKey version 8.0.6 - Updated dependencies - @innoways/utils@8.0.6 ## 8.0.5 ### Patch Changes - fixed payload issues 8.0.5 - Updated dependencies - @innoways/utils@8.0.5 ## 8.0.4 ### Patch Changes - fixed null field issues 8.0.4 - Updated dependencies - @innoways/utils@8.0.4 ## 8.0.3 ### Patch Changes - fixed select field issues 8.0.3 - Updated dependencies - @innoways/utils@8.0.3 ## 8.0.2 ### Patch Changes - feature: input box view mode fix 8.0.2 - Updated dependencies - @innoways/utils@8.0.2 ## 8.0.1 ### Patch Changes - feature: date view mode format 8.0.1 - Updated dependencies - @innoways/utils@8.0.1 ## 8.0.0 ### Major Changes - console.log(showCurrentDate, 'showCurrentDate', fieldData) ### Patch Changes - Updated dependencies - @innoways/utils@8.0.0 ## 7.0.0 ### Major Changes - feature: nested api key support and data fetch and post changes 6.3.4 ### Patch Changes - Updated dependencies - @innoways/utils@7.0.0 ## 6.3.5 ### Patch Changes - feature: nested api key support and data fetch and post changes 6.3.4 - Updated dependencies - @innoways/utils@6.3.5 ## 6.3.4 ### Patch Changes - feature: place auto complete search feature added, version 6.3.3 - Updated dependencies - @innoways/utils@6.3.4 ## 6.3.3 ### Patch Changes - feature: place auto complete search feature added, version 6.3.3 - Updated dependencies - @innoways/utils@6.3.3 ## 6.3.2 ### Patch Changes - feature: Added new field component place auto complete, version 6.3.2 - Updated dependencies - @innoways/utils@6.3.2 ## 6.3.1 ### Patch Changes - Added hideOnViewMode feature version 6.3.1. - Updated dependencies - @innoways/utils@6.3.1 ## 6.3.0 ### Minor Changes - Fixed token issues added version 6.3.0 ### Patch Changes - Updated dependencies - @innoways/utils@6.3.0 ## 6.2.10 ### Patch Changes - Fixed thme issues added version 6.2.10 - Updated dependencies - @innoways/utils@6.2.10 ## 6.2.9 ### Patch Changes - Fixed thme issues added version 6.2.8 - Updated dependencies - @innoways/utils@6.2.9 ## 6.2.8 ### Patch Changes - Fixed valication errors, added version 6.2.8 - Updated dependencies - @innoways/utils@6.2.8 ## 6.2.7 ### Patch Changes - Added version 6.2.7 fixed date issue - Updated dependencies - @innoways/utils@6.2.7 ## 6.2.6 ### Patch Changes - disabled form data reset after submit - Updated dependencies - @innoways/utils@6.2.6 ## 6.2.5 ### Patch Changes - Added single checkbox feature - Updated dependencies - @innoways/utils@6.2.5 ## 6.2.4 ### Patch Changes - Added bottom button bgcolor and global bgcolor config, changed date picker to flatpickr - Updated dependencies - @innoways/utils@6.2.4 ## 6.2.3 ### Patch Changes - Fix: modified antd peer dependency - Updated dependencies - @innoways/utils@6.2.3 ## 6.2.2 ### Patch Changes - added callback on submit - Updated dependencies - @innoways/utils@6.2.2 ## 6.2.1 ### Patch Changes - modified feature to post data on submit - Updated dependencies - @innoways/utils@6.2.1 ## 6.2.0 ### Minor Changes - adde version 6.2.0 ### Patch Changes - Updated dependencies - @innoways/utils@6.2.0 ## 6.1.1 ### Patch Changes - modified tree table styles - Updated dependencies - @innoways/utils@6.1.1 ## 6.1.0 ### Minor Changes - Added tree table feature ### Patch Changes - Updated dependencies - @innoways/utils@6.1.0 ## 6.0.0 ### Major Changes - major datefix ### Patch Changes - Updated dependencies - @innoways/utils@6.0.0 ## 5.0.0 ### Major Changes - changed all jdfed imports to innoways ### Patch Changes - Updated dependencies - @innoways/utils@5.0.0 ## 4.0.0 ### Major Changes - ajv update ## 3.0.0 ### Major Changes - Initial version ## 2.0.0 ### Major Changes - Initial changelog ### Patch Changes - Updated dependencies - @jdfed/utils@2.0.0 ## 1.0.0 ### Major Changes - Initial changelog ### Patch Changes - Updated dependencies - @jdfed/utils@1.0.0 All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ### [0.8.2](https://github.com/jdfed/drip-form/compare/v0.8.1...v0.8.2) (2022-07-15) **Note:** Version bump only for package @jdfed/hooks ### [0.8.1](https://github.com/jdfed/drip-form/compare/v0.8.0...v0.8.1) (2022-06-29) **Note:** Version bump only for package @jdfed/hooks ## [0.8.0](https://github.com/jdfed/drip-form/compare/v0.7.0...v0.8.0) (2022-06-01) ### Features - **form:** array container supports sorting ([#206](https://github.com/jdfed/drip-form/issues/206)) ([7a60b0b](https://github.com/jdfed/drip-form/commit/7a60b0b3e2eb9af8d6b479356ceee659bba86947)) - **generator:** delete element automatically selects the neighboring previous element or the parent ([945196a](https://github.com/jdfed/drip-form/commit/945196ab0903b6b5276a6630df7c89d6ca8b1cb1)) ## [0.7.0](https://github.com/jdfed/drip-form/compare/v0.6.0...v0.7.0) (2022-03-14) ### Features - **generator:** datepicker add default configuration ([a238424](https://github.com/jdfed/drip-form/commit/a238424c1aed9382735d1e2de1ec60890dd851c4)) - unitedSchema JSON add requiredMode configuration ([#150](https://github.com/jdfed/drip-form/issues/150)) ([7e717ef](https://github.com/jdfed/drip-form/commit/7e717ef9431228809fd5f2d3908a274f181225ec)) - **generator:** support change fieldKey in the property configuration panel ([#144](https://github.com/jdfed/drip-form/issues/144)) ([9681f62](https://github.com/jdfed/drip-form/commit/9681f62083c8c4feba7c4b1538b3ae99838545a3)) - onValidate prop support submit type ([#143](https://github.com/jdfed/drip-form/issues/143)) ([ceae921](https://github.com/jdfed/drip-form/commit/ceae921b42ea239b1b8833d4ff2e51aef627d42a)) ### style - **generator:** update objectContainer default style ([#154](https://github.com/jdfed/drip-form/issues/154)) ([d1590df](https://github.com/jdfed/drip-form/commit/d1590df17c8fbd003f29af800b6cfde091bf081a)) ## [0.6.0](https://github.com/jdfed/drip-form/compare/v0.5.0...v0.6.0) (2022-01-24) ### Features - 表单布局支持配置外边距 ([2016881](https://github.com/jdfed/drip-form/commit/201688140cebb2403899acca0ca58000dba7aaa3)) ### Bug Fixes - 修复数组子项为空,当前项自动被删除问题 ([#128](https://github.com/jdfed/drip-form/issues/128)) ([5c8e66b](https://github.com/jdfed/drip-form/commit/5c8e66bdda52db461d76e00456d95ded5ee2883e)) - 数组容器点击删除未删除错误内容 ([ce11e27](https://github.com/jdfed/drip-form/commit/ce11e273ab35ad8538990db90bb77000a059fc1b)) ## [0.5.0](https://github.com/jdfed/drip-form/compare/v0.4.0...v0.5.0) (2022-01-13) ### Features - setError 支持配置 action.ignore ([#125](https://github.com/jdfed/drip-form/issues/125)) ([b84aa5e](https://github.com/jdfed/drip-form/commit/b84aa5eead2b3f384d70bb45ce2961fcb1afbd1d)) ## 0.4.0 (2022-01-11) ### Bug Fixes - provide a default key for dynamic children ([#53](https://github.com/jdfed/drip-form/issues/53)) ([3abe606](https://github.com/jdfed/drip-form/commit/3abe6068e20d2d567426eb7ee637e2b6a0c93af5)) - upload preview error ([#83](https://github.com/jdfed/drip-form/issues/83)) ([fab9052](https://github.com/jdfed/drip-form/commit/fab90527dbedca35cc2119bca93106f9fa58ee28)) ## 0.3.0 (2022-01-11) ### Bug Fixes - provide a default key for dynamic children ([#53](https://github.com/jdfed/drip-form/issues/53)) ([3abe606](https://github.com/jdfed/drip-form/commit/3abe6068e20d2d567426eb7ee637e2b6a0c93af5)) - upload preview error ([#83](https://github.com/jdfed/drip-form/issues/83)) ([fab9052](https://github.com/jdfed/drip-form/commit/fab90527dbedca35cc2119bca93106f9fa58ee28)) ## 0.2.0 (2022-01-07) ### Bug Fixes - provide a default key for dynamic children ([#53](https://github.com/jdfed/drip-form/issues/53)) ([3abe606](https://github.com/jdfed/drip-form/commit/3abe6068e20d2d567426eb7ee637e2b6a0c93af5)) - upload preview error ([#83](https://github.com/jdfed/drip-form/issues/83)) ([fab9052](https://github.com/jdfed/drip-form/commit/fab90527dbedca35cc2119bca93106f9fa58ee28)) **Note:** Version bump only for package @jdfed/hooks ## 0.1.0 (2021-11-24) ### Features - 表单联动升级 ([e77c5cd](https://github.com/jdfed/drip-form/commit/e77c5cda7e7f89dcab9b624f2e81a95f15412bee)) - 表单支持异步校验 ([8a50889](https://github.com/jdfed/drip-form/commit/8a50889e6ce05977308c76d2daf9f18408c4f8e3)) - 打包&文档 ([a65b57e](https://github.com/jdfed/drip-form/commit/a65b57e1fa390dc38d1bd3d9a5cb2c98f446744f)) - 迁移 babel-form 至 drip-form ([7687505](https://github.com/jdfed/drip-form/commit/768750518a8fdd9de93234fb8fbd5fc1cbd555b6)) - 嵌套表单 ([b939eed](https://github.com/jdfed/drip-form/commit/b939eed9bf23db5efa9a6c8177a24b397f4e8ba8)) - 嵌套对象必填支持&useQuery 支持 getkey ([d33a002](https://github.com/jdfed/drip-form/commit/d33a002567c7061ee28f5063738cba71c53872bf)) - 删除 Spin loading ([1a6d7df](https://github.com/jdfed/drip-form/commit/1a6d7df9e638d49bb3b938c2bbc46fb274bb6ea3)) - 升级 ajv ([1708e2c](https://github.com/jdfed/drip-form/commit/1708e2c8ad8581a78be9923f194c494e2f970a4c)) - 添加 combine & 修复 addField 类型引用错误的问题 ([cd5fb7d](https://github.com/jdfed/drip-form/commit/cd5fb7d73704739073f734dcd1ca384299ba2f67)) - 拖拽优化 ([90e2251](https://github.com/jdfed/drip-form/commit/90e22517082fe2a432bb443fc1961451da7b2ba0)) - 修改 hooks ([9072713](https://github.com/jdfed/drip-form/commit/90727133557293e4a31d43470c2549b54b0a38d2)) - 隐藏表单(未加载表单)不校验 ([d57c264](https://github.com/jdfed/drip-form/commit/d57c264eb1bab35c7269445def82169e0ee73cf7)) - 支持拖拽 ([45bba5c](https://github.com/jdfed/drip-form/commit/45bba5c4f75a268b06310105b6865bb42f3eca39)) - 支持校验文案配置 ([58adade](https://github.com/jdfed/drip-form/commit/58adadebdb12233bd961ef5a0937240893b9eb5f)) - 支持业务组件 ([eb9dc7d](https://github.com/jdfed/drip-form/commit/eb9dc7dafdd78ebb2fbbc375d73b0530b066b6e3)) - **generator:** 支持校验 ([93367c5](https://github.com/jdfed/drip-form/commit/93367c5d965007638b51653459f1faeff9d637c5)) - **generator:** 支持校验联动 ([ed519f5](https://github.com/jdfed/drip-form/commit/ed519f559ea5ceb0524787f6a8e343fbe845024b)) - 异步校验 loading 态 ([6efb51a](https://github.com/jdfed/drip-form/commit/6efb51ad5f75a4a14b41a7b460eb51438d6807f2)) - 支持 select+text 组合组件 ([1c7b3c7](https://github.com/jdfed/drip-form/commit/1c7b3c78046c7b2a4397980e7712035c6d450707)) - 支持 set、get、merge ([dc267b6](https://github.com/jdfed/drip-form/commit/dc267b6a23d7d9a8b5bf3edff303adfed7a98056)) - **schema 升级:** uiSchema 中 onChange 和 vcontrol 支持函数占位符 ([1225238](https://github.com/jdfed/drip-form/commit/122523861064dee2fa4a5e077a0d41bf5c76f1fe)) - 支持 ts ([9afcd3a](https://github.com/jdfed/drip-form/commit/9afcd3ae3d4f4407f2bd4347bc1e182bee0ccbb8)) - antd 支持 treeselect 组件 ([6348f68](https://github.com/jdfed/drip-form/commit/6348f68e4292abf91a410c839376b98cd85f05bb)) - babel-form 初始化 ([51fd2af](https://github.com/jdfed/drip-form/commit/51fd2af04a66c1d84970a8060174e20b0d859746)) - merge master ([1f5d45c](https://github.com/jdfed/drip-form/commit/1f5d45ce1cdd7b86a80cd049631eb9d46a6310e7)) - text 表单添加禁止输入字段 disabled_input ([6ea4b33](https://github.com/jdfed/drip-form/commit/6ea4b330d99b9331975fdc6a7c93dec55c39c199)) - treeselect 组件支持数据包含父级 id ([7de8fb2](https://github.com/jdfed/drip-form/commit/7de8fb2eef59175babb7aabef8fec2ba8b64d4b4)) - upload 支持 maxFileNumber 和 customUpload ([54c3611](https://github.com/jdfed/drip-form/commit/54c361148e66e65ea0ec505b2bf6cb059048eba2)) ### Bug Fixes - 必填校验失效 ([393e65a](https://github.com/jdfed/drip-form/commit/393e65a964594430a5f856e6cbba605cbe414693)) - 表单 value 为空自动删除 formdata 字段 ([b95f55f](https://github.com/jdfed/drip-form/commit/b95f55fad1260ed6ab69e62f4bd8376d89c925e2)) - 调整 useField 的判断条件,增加 fieldData 作为兜底取值,避免 e 取不到或者为 bool 的问题 ([6e5cba2](https://github.com/jdfed/drip-form/commit/6e5cba2f77f1f34e81ef2d7f96125e8c92587a86)) - 添加校验状态 ([e7ebc21](https://github.com/jdfed/drip-form/commit/e7ebc21b1805bcfb0b489bd23e1b07cba92e5672)) - 拖拽 fieldKey 会变化 ([55d84af](https://github.com/jdfed/drip-form/commit/55d84af09dad8ffa574a1e18d7db4a364e716e56)) - 修复导出包无法被 vite 或 snowpack 使用的问题 ([37f6636](https://github.com/jdfed/drip-form/commit/37f6636124ecd3223eac7152fb19a4accf2c5ca8)) - 修复每个 DripForm 无法使用独立 Ajv 校验的问题 ([d4c4988](https://github.com/jdfed/drip-form/commit/d4c4988c0eb530c285a82072272af9ba77446cfd)) - 修复图片上传不合理格式化的问题 & 所有包添加 unlink ([06f6f61](https://github.com/jdfed/drip-form/commit/06f6f61515828c7bcf1718f3d5118a72ca750a93)) - 修复未知 key ([c52556c](https://github.com/jdfed/drip-form/commit/c52556c17d71fe7f838578331d6627a9691fc230)) - 修复颜色选择器不支持透明度时 fieldData 异常问题 ([494b67c](https://github.com/jdfed/drip-form/commit/494b67ce34cc5b94476e7b1507cfc102dbace5b3)) - 修复一系列问题 ([52d3e42](https://github.com/jdfed/drip-form/commit/52d3e4258f962958189f1c8ced9b8c20dcf24653)) - 修复 exports 被删除后无法打包的问题 ([9d54151](https://github.com/jdfed/drip-form/commit/9d54151a8445fd0b7849b1ce2f806f4db8ef07a1)) - 修复 switch 组件始终为 true 的问题 ([a11e03a](https://github.com/jdfed/drip-form/commit/a11e03a2bdf588f1bd86fc4f515c4dd21f51b94f)) - 修复 typePath 没有动态更新,而是一直采用初始化状态的问题 ([c68beec](https://github.com/jdfed/drip-form/commit/c68beecdd5b1c7df3096a4dae01e2bcac560925d)) - 修复 typePath 没有动态生成的问题 ([f338118](https://github.com/jdfed/drip-form/commit/f338118011f394e74975a73d09f7168ef4e7692a)) - 修复 useAddField 丢失 cb 类型 ([da74ca4](https://github.com/jdfed/drip-form/commit/da74ca44a10ecea064aacd4cf2cef9d7f46a0e3d)) - 修复 usefield 删除校验状态异常&number 为 0 非空判断 ([242d503](https://github.com/jdfed/drip-form/commit/242d50319875eb007440e36800e08158aef8022b)) - 一系列问题 ([52f612a](https://github.com/jdfed/drip-form/commit/52f612a37c20c55ae5957365aa249e9ffff96db3)) - 移除多余 console & 调整代码结构 ([bc17f1a](https://github.com/jdfed/drip-form/commit/bc17f1aca8e9e5dfdbca23ea01d51af869dfd056)) - 异步校验 ([e373adc](https://github.com/jdfed/drip-form/commit/e373adc96638776053c33e231415029e509777d8)) - 异步校验数据获取 ([130331b](https://github.com/jdfed/drip-form/commit/130331b8f7c98bc9c5eb34057146216783df82d0)) - 组件渲染和 formData 生成的顺序问题以及 checkbox 全不选时的默认值问题 #C2020092276661 ([b2fbe15](https://github.com/jdfed/drip-form/commit/b2fbe15e5719a8c3a3de5ba7264ce5efe847a7c1)), closes [#C2020092276661](https://github.com/jdfed/drip-form/issues/C2020092276661) - loading ([a724a19](https://github.com/jdfed/drip-form/commit/a724a19b1f085d3cf5d14de2ed3d145ddada4f5c)) - radio checkbox 支持问题 ([46110f4](https://github.com/jdfed/drip-form/commit/46110f4a5ffc2149bdadbaa1c0fffb72e3a9d410)) - radio 或 checkbox 的 value 是空字符串时,formData 未拿到数据 #C2021012635832 ([8fb05fc](https://github.com/jdfed/drip-form/commit/8fb05fc62c034fb854e7b7fd32667c9d7e78c664)), closes [#C2021012635832](https://github.com/jdfed/drip-form/issues/C2021012635832) - switch,radio 单选,checkbox 问题修复 ([c19351f](https://github.com/jdfed/drip-form/commit/c19351f664386d2969bf8615befaad66ccc4eadf)) - text 默认值后续删除不自动添加 #C2020091124826 ([b447498](https://github.com/jdfed/drip-form/commit/b4474984fe79a812525ac4ec1e79d08b5b9c3e7e)), closes [#C2020091124826](https://github.com/jdfed/drip-form/issues/C2020091124826) - treeselect 三级四级地址 NaN ([d397bf7](https://github.com/jdfed/drip-form/commit/d397bf70ae5f91d886304951eb19191542171dfb)) - ts 声明 ([7800503](https://github.com/jdfed/drip-form/commit/7800503addeaf8b2a75ac8fd205934d00a0c8479)) - ts 支持 ([f75b705](https://github.com/jdfed/drip-form/commit/f75b705eaa00890bcd9c7f442c5521e770b16849)) - uiSchmea 中 onChange 函数体形式未透传 fieldKey 等相关参数 #C2021011566751 ([1256615](https://github.com/jdfed/drip-form/commit/1256615ad9e560946fa86e9ac0fe0402bb481cee)), closes [#C2021011566751](https://github.com/jdfed/drip-form/issues/C2021011566751) ### Performance Improvements - 优化右侧面板联动渲染区的逻辑 ([2233a14](https://github.com/jdfed/drip-form/commit/2233a1472d630df83da6984fcdba0f52a93ccfaa))