zy-react-library 1.2.22 → 1.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cascader as e}from"antd";import{useMemo as n,useEffect as a}from"react";import{processTreeDataByLevel as t}from"../../../utils/index.js";import{jsx as o}from"react/jsx-runtime";function l(l){const{onGetData:s,onChange:d,onGetNodePaths:r,onGetNodePathsIsIncludeOneself:c,getNodePathsIsIncludeOneself:i=!0,placeholder:h="",data:m=[],nameKey:f="name",idKey:u="id",childrenKey:p="children",level:I,...N}=l;void 0!==c&&console.warn("【BasicCascader】 onGetNodePathsIsIncludeOneself 参数已弃用,请使用 getNodePathsIsIncludeOneself 参数");const v=void 0!==c?c:i,y=n(()=>I?t({data:m,level:I,childrenKey:p,currentLevel:1}):m,[m,I,p]);return a(()=>{s?.(m,y)},[m,y]),o(e,{options:y,placeholder:`请选择${h}`,onChange:(e,n)=>{if(n&&r){const e=(e=>{let n=e;return!v&&e&&(n=e.slice(0,-1)),n||[]})(n);r?.(e)}d?.(e,n)},fieldNames:{label:f,value:u,children:p},...N})}l.displayName="BasicCascader";export{l as default};
|
|
1
|
+
import{Cascader as e}from"antd";import{useMemo as n,useEffect as a}from"react";import{processTreeDataByLevel as t}from"../../../utils/index.js";import{jsx as o}from"react/jsx-runtime";function l(l){const{onGetData:s,onChange:d,onGetNodePaths:r,onGetNodePathsIsIncludeOneself:c,getNodePathsIsIncludeOneself:i=!0,placeholder:h="",data:m=[],nameKey:f="name",idKey:u="id",childrenKey:p="children",level:I,...N}=l;void 0!==c&&console.warn("【BasicCascader】 onGetNodePathsIsIncludeOneself 参数已弃用,请使用 getNodePathsIsIncludeOneself 参数");const v=void 0!==c?c:i,y=n(()=>I?t({data:m,level:I,childrenKey:p,currentLevel:1}):m,[m,I,p]);return a(()=>{s?.(m,y)},[m,y]),o(e,{options:y,placeholder:`请选择${h}`,onChange:(e,n)=>{if(n&&r){const e=(e=>{let n=e;return!v&&e&&(n=e.slice(0,-1)),n||[]})(n);r?.(e)}d?.(e,n)},onClear:()=>{r?.([])},fieldNames:{label:f,value:u,children:p},...N})}l.displayName="BasicCascader";export{l as default};
|