@flatbiz/antd 4.4.24 → 4.4.25
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.
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './../fba-hooks/index.css';
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
|
-
import{_ as t}from"../_rollupPluginBabelHelpers-a0769acd.js";import{isString as
|
|
5
|
+
import{_ as t}from"../_rollupPluginBabelHelpers-a0769acd.js";import{isString as r}from"@dimjs/lang/cjs/is-string";import{useRef as e,useMemo as n,memo as i}from"react";import{classNames as a}from"@dimjs/utils/cjs/class-names";import{useSize as o}from"ahooks";import{Tooltip as l}from"antd";import{fbaHooks as s}from"../fba-hooks/index.js";import{jsxs as c,jsx as u}from"react/jsx-runtime";import"@dimjs/lang/cjs/is-array";import"@wove/react/cjs/hooks";import"@flatbiz/utils";import"../use-responsive-point-21b8c601.js";var d=function t(r){var n=e(null);var i=o(n);var d=(i==null?void 0:i.width)||0;var m=s.useMemoCustom((function(){if(n.current){var t;var r=((t=n.current.querySelector(".tow-inner-text"))==null?void 0:t.clientWidth)||0;return r}return 0}),[n.current]);var v=m>d;return c("div",{className:a("text-overflow",{"tow-trigger":r.onClick}),ref:n,children:[u("span",{className:"tow-hidden",children:u("span",{className:"tow-inner-text",children:r.text})}),u(l,{title:v?r.text:undefined,children:u("span",{className:"tow-content",children:u("span",{className:"tow-show-text",onClick:r.onClick,children:r.text})})})]})};var m=function t(r){var n=e(null);var i=o(n);var d=r.maxLength;var m=(i==null?void 0:i.width)||0;var v=r.text;var h=v.length>d;var f=s.useMemoCustom((function(){if(n.current){var t;var r=((t=n.current.querySelector(".tow-inner-text"))==null?void 0:t.clientWidth)||0;return r}return 0}),[n.current]);var x=h&&f<m;var w=m<f+1||h;var p=v.substring(0,r.maxLength);return c("div",{className:a("text-overflow",{"tow-trigger":r.onClick}),ref:n,children:[u("span",{className:"tow-hidden",children:u("span",{className:"tow-inner-text",children:p})}),u(l,{title:w?v:undefined,children:x?u("span",{className:"tow-cut-content",children:c("span",{className:"tow-show-text",onClick:r.onClick,children:[p,"..."]})}):u("span",{className:"tow-content",children:u("span",{className:"tow-show-text",onClick:r.onClick,children:v})})})]})};var v=function t(r){var i=e(null);var d=o(i);var m=(d==null?void 0:d.width)||0;var v=r.maxWidth||0;var h=s.useMemoCustom((function(){if(i.current){var t;var r=((t=i.current.querySelector(".tow-inner-text"))==null?void 0:t.clientWidth)||0;return r}return 0}),[i.current]);var f=n((function(){if(h<v)return undefined;var t=h>v?v:h;if(m>t){return t}return undefined}),[h,v,m]);var x=f||h>m;return c("div",{className:a("text-overflow",{"tow-trigger":r.onClick}),ref:i,children:[u("span",{className:"tow-hidden",children:u("span",{className:"tow-inner-text",children:r.text})}),u(l,{title:x?r.text:undefined,children:u("span",{className:"tow-content",style:{width:f},children:u("span",{className:"tow-show-text",onClick:r.onClick,children:r.text})})})]})};var h=function e(n){if(n.maxLength&&r(n.text)){return u(m,t({},n))}if(n.maxWidth){return u(v,t({},n))}return u(d,t({},n))};var f=i(h,(function(t,r){if(t.text!==r.text||t.maxLength!==r.maxLength||t.maxWidth!==t.maxWidth){return false}return true}));export{f as TextOverflow};
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/text-overflow/overflow-auto.tsx","@flatbiz/antd/src/text-overflow/overflow-length.tsx","@flatbiz/antd/src/text-overflow/overflow-width.tsx","@flatbiz/antd/src/text-overflow/text-overflow.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport './style.less';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowAuto = (props: TextOverflowProps) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const parentNodeWidth = size?.width || 0;\n\n // 文本宽度\n const textWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const textWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n return textWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showTips = textWidth > parentNodeWidth;\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{props.text}</span>\n </span>\n <Tooltip title={showTips ? props.text : undefined}>\n <span className=\"tow-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {props.text}\n </span>\n </span>\n </Tooltip>\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { subStringByBytes } from '@flatbiz/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowLength = (props: Omit<TextOverflowProps, 'maxWidth'>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const maxLength = props.maxLength as number;\n const parentNodeWidth = size?.width || 0;\n const text = props.text as string;\n\n const needCut = text.length > maxLength;\n\n // 裁切后文本宽度\n const cutedTextWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const cutContentWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n\n return cutContentWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showCustomEllipsis = needCut && cutedTextWidth < parentNodeWidth;\n\n const showTips = parentNodeWidth < cutedTextWidth + 1 || needCut;\n\n // const x =\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{subStringByBytes(text, (props.maxLength as number) * 2)}</span>\n </span>\n\n <Tooltip title={showTips ? text : undefined}>\n {showCustomEllipsis ? (\n <span className=\"tow-cut-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {subStringByBytes(text, (props.maxLength as number) * 2)}\n ...\n </span>\n </span>\n ) : (\n <span className=\"tow-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {text}\n </span>\n </span>\n )}\n </Tooltip>\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useMemo, useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowWidth = (props: Omit<TextOverflowProps, 'maxLength'>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const parentNodeWidth = size?.width || 0;\n const maxWidth = props.maxWidth || 0;\n\n // 文本宽度\n const textWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const textWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n return textWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showTextWidth = useMemo(() => {\n if (textWidth < maxWidth) return undefined;\n const textWidthBast = textWidth > maxWidth ? maxWidth : textWidth;\n if (parentNodeWidth > textWidthBast) {\n return textWidthBast;\n }\n return undefined;\n }, [textWidth, maxWidth, parentNodeWidth]);\n const showTips = showTextWidth || textWidth > parentNodeWidth;\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{props.text}</span>\n </span>\n\n <Tooltip title={showTips ? props.text : undefined}>\n <span className=\"tow-content\" style={{ width: showTextWidth }}>\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {props.text}\n </span>\n </span>\n </Tooltip>\n </div>\n );\n};\n","import { isString } from '@dimjs/lang';\nimport { memo } from 'react';\nimport { OverflowAuto } from './overflow-auto';\nimport { OverflowLength } from './overflow-length';\nimport { OverflowWidth } from './overflow-width';\nimport './style.less';\nimport { TextOverflowProps } from './types';\n\nconst InnerTextOverflow = (props: TextOverflowProps) => {\n if (props.maxLength && isString(props.text)) {\n return <OverflowLength {...props} />;\n }\n if (props.maxWidth) {\n return <OverflowWidth {...props} />;\n }\n return <OverflowAuto {...props} />;\n};\n\n/**\n * 内容溢出截取,并在尾部添加...,被截取的添加Tooltip显示完整数据\n * ```\n * 控制文本显示三种方式\n * 1. 通过 maxLength 控制超长\n * 2. 通过 maxWidth 控制超长\n * 3. 与父节点宽度比较,控制超长\n * 4. 优先级 maxLength > maxWidth\n *\n * 注意:\n * 1. 当前节点父节点需要添加 overflow-x: hidden;\n * 2. 如果父节点设置flex-shrink会有影响,可复写flex-shrink: initial;\n * 3. 与 Table columns render结合使用,需要配置ellipsis=true\n * 例如:<Table columns={[{\n ...\n render: (value) => {\n return <TextOverflow text={value} />;\n },\n ellipsis: true,\n }]} />\n 4. 与 Table columns render结合使用,如果Table配置了 scroll={{ x: 'max-content' }}后,不能与TextOverflow maxWidth结合使用\n * ```\n */\nexport const TextOverflow = memo(InnerTextOverflow, (pre, next) => {\n if (pre.text !== next.text || pre.maxLength !== next.maxLength || pre.maxWidth !== pre.maxWidth) {\n return false;\n }\n return true;\n});\n"],"names":["OverflowAuto","props","rootRef","useRef","size","useSize","parentNodeWidth","width","textWidth","fbaHooks","useMemoCustom","current","_rootRef$current$quer","querySelector","clientWidth","showTips","_jsxs","className","_classNames","onClick","ref","children","_jsx","text","Tooltip","title","undefined","OverflowLength","maxLength","needCut","length","cutedTextWidth","cutContentWidth","showCustomEllipsis","subStringByBytes","OverflowWidth","maxWidth","showTextWidth","useMemo","textWidthBast","style","InnerTextOverflow","_isString","_extends","TextOverflow","memo","pre","next"],"mappings":";kiBAQO,IAAMA,EAAe,SAAfA,EAAgBC,GAC3B,IAAMC,EAAUC,EAAuB,MACvC,IAAMC,EAAOC,EAAQH,GACrB,IAAMI,GAAkBF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,EAAMkB,UAEvBC,IAAKlB,EAAQmB,UAEbC,EAAA,OAAA,CAAML,UAAU,aAAYI,SAC1BC,EAAA,OAAA,CAAML,UAAU,iBAAgBI,SAAEpB,EAAMsB,SAG1CD,EAACE,EAAO,CAACC,MAAOV,EAAWd,EAAMsB,KAAOG,UAAUL,SAChDC,EAAA,OAAA,CAAML,UAAU,cAAcuB,MAAO,CAAEjC,MAAO8B,GAAgBhB,SAC5DC,EAAA,OAAA,CAAML,UAAU,gBAAgBE,QAASlB,EAAMkB,QAAQE,SACpDpB,EAAMsB,aAMnB,EC7CA,IAAMkB,EAAoB,SAApBA,EAAqBxC,GACzB,GAAIA,EAAM2B,WAAac,EAASzC,EAAMsB,MAAO,CAC3C,OAAOD,EAACK,EAAcgB,EAAK1C,CAAAA,EAAAA,GAC7B,CACA,GAAIA,EAAMmC,SAAU,CAClB,OAAOd,EAACa,EAAaQ,EAAK1C,CAAAA,EAAAA,GAC5B,CACA,OAAOqB,EAACtB,EAAY2C,EAAK1C,CAAAA,EAAAA,GAC3B,EAyBO,IAAM2C,EAAeC,EAAKJ,GAAmB,SAACK,EAAKC,GACxD,GAAID,EAAIvB,OAASwB,EAAKxB,MAAQuB,EAAIlB,YAAcmB,EAAKnB,WAAakB,EAAIV,WAAaU,EAAIV,SAAU,CAC/F,OAAO,KACT,CACA,OAAO,IACT"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/text-overflow/overflow-auto.tsx","@flatbiz/antd/src/text-overflow/overflow-length.tsx","@flatbiz/antd/src/text-overflow/overflow-width.tsx","@flatbiz/antd/src/text-overflow/text-overflow.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport './style.less';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowAuto = (props: TextOverflowProps) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const parentNodeWidth = size?.width || 0;\n\n // 文本宽度\n const textWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const textWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n return textWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showTips = textWidth > parentNodeWidth;\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{props.text}</span>\n </span>\n <Tooltip title={showTips ? props.text : undefined}>\n <span className=\"tow-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {props.text}\n </span>\n </span>\n </Tooltip>\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowLength = (props: Omit<TextOverflowProps, 'maxWidth'>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const maxLength = props.maxLength as number;\n const parentNodeWidth = size?.width || 0;\n const text = props.text as string;\n\n const needCut = text.length > maxLength;\n\n // 裁切后文本宽度\n const cutedTextWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const cutContentWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n\n return cutContentWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showCustomEllipsis = needCut && cutedTextWidth < parentNodeWidth;\n\n const showTips = parentNodeWidth < cutedTextWidth + 1 || needCut;\n\n const cutValue = text.substring(0, props.maxLength);\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{cutValue}</span>\n </span>\n\n <Tooltip title={showTips ? text : undefined}>\n {showCustomEllipsis ? (\n <span className=\"tow-cut-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {cutValue}...\n </span>\n </span>\n ) : (\n <span className=\"tow-content\">\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {text}\n </span>\n </span>\n )}\n </Tooltip>\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { useSize } from 'ahooks';\nimport { Tooltip } from 'antd';\nimport { useMemo, useRef } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { TextOverflowProps } from './types';\n\nexport const OverflowWidth = (props: Omit<TextOverflowProps, 'maxLength'>) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const size = useSize(rootRef);\n const parentNodeWidth = size?.width || 0;\n const maxWidth = props.maxWidth || 0;\n\n // 文本宽度\n const textWidth = fbaHooks.useMemoCustom(() => {\n if (rootRef.current) {\n // 裁切后元素宽度\n const textWidth = rootRef.current.querySelector('.tow-inner-text')?.clientWidth || 0;\n return textWidth;\n }\n return 0;\n }, [rootRef.current]);\n\n const showTextWidth = useMemo(() => {\n if (textWidth < maxWidth) return undefined;\n const textWidthBast = textWidth > maxWidth ? maxWidth : textWidth;\n if (parentNodeWidth > textWidthBast) {\n return textWidthBast;\n }\n return undefined;\n }, [textWidth, maxWidth, parentNodeWidth]);\n const showTips = showTextWidth || textWidth > parentNodeWidth;\n\n return (\n <div\n className={classNames('text-overflow', {\n 'tow-trigger': props.onClick,\n })}\n ref={rootRef}\n >\n <span className=\"tow-hidden\">\n <span className=\"tow-inner-text\">{props.text}</span>\n </span>\n\n <Tooltip title={showTips ? props.text : undefined}>\n <span className=\"tow-content\" style={{ width: showTextWidth }}>\n <span className=\"tow-show-text\" onClick={props.onClick}>\n {props.text}\n </span>\n </span>\n </Tooltip>\n </div>\n );\n};\n","import { isString } from '@dimjs/lang';\nimport { memo } from 'react';\nimport { OverflowAuto } from './overflow-auto';\nimport { OverflowLength } from './overflow-length';\nimport { OverflowWidth } from './overflow-width';\nimport './style.less';\nimport { TextOverflowProps } from './types';\n\nconst InnerTextOverflow = (props: TextOverflowProps) => {\n if (props.maxLength && isString(props.text)) {\n return <OverflowLength {...props} />;\n }\n if (props.maxWidth) {\n return <OverflowWidth {...props} />;\n }\n return <OverflowAuto {...props} />;\n};\n\n/**\n * 内容溢出截取,并在尾部添加...,被截取的添加Tooltip显示完整数据\n * ```\n * 控制文本显示三种方式\n * 1. 通过 maxLength 控制超长\n * 2. 通过 maxWidth 控制超长\n * 3. 与父节点宽度比较,控制超长\n * 4. 优先级 maxLength > maxWidth\n *\n * 注意:\n * 1. 当前节点父节点需要添加 overflow-x: hidden;\n * 2. 如果父节点设置flex-shrink会有影响,可复写flex-shrink: initial;\n * 3. 与 Table columns render结合使用,需要配置ellipsis=true\n * 例如:<Table columns={[{\n ...\n render: (value) => {\n return <TextOverflow text={value} />;\n },\n ellipsis: true,\n }]} />\n 4. 与 Table columns render结合使用,如果Table配置了 scroll={{ x: 'max-content' }}后,不能与TextOverflow maxWidth结合使用\n * ```\n */\nexport const TextOverflow = memo(InnerTextOverflow, (pre, next) => {\n if (pre.text !== next.text || pre.maxLength !== next.maxLength || pre.maxWidth !== pre.maxWidth) {\n return false;\n }\n return true;\n});\n"],"names":["OverflowAuto","props","rootRef","useRef","size","useSize","parentNodeWidth","width","textWidth","fbaHooks","useMemoCustom","current","_rootRef$current$quer","querySelector","clientWidth","showTips","_jsxs","className","_classNames","onClick","ref","children","_jsx","text","Tooltip","title","undefined","OverflowLength","maxLength","needCut","length","cutedTextWidth","cutContentWidth","showCustomEllipsis","cutValue","substring","OverflowWidth","maxWidth","showTextWidth","useMemo","textWidthBast","style","InnerTextOverflow","_isString","_extends","TextOverflow","memo","pre","next"],"mappings":";ugBAQO,IAAMA,EAAe,SAAfA,EAAgBC,GAC3B,IAAMC,EAAUC,EAAuB,MACvC,IAAMC,EAAOC,EAAQH,GACrB,IAAMI,GAAkBF,eAAAA,EAAMG,QAAS,EAGvC,IAAMC,EAAYC,EAASC,eAAc,WACvC,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SAC1BC,EAAA,OAAA,CAAML,UAAU,iBAAgBI,SAAEpB,EAAMsB,SAG1CD,EAACE,EAAO,CAACC,MAAOV,EAAWd,EAAMsB,KAAOG,UAAUL,SAChDC,EAAA,OAAA,CAAML,UAAU,cAAcwB,MAAO,CAAElC,MAAO+B,GAAgBjB,SAC5DC,EAAA,OAAA,CAAML,UAAU,gBAAgBE,QAASlB,EAAMkB,QAAQE,SACpDpB,EAAMsB,aAMnB,EC7CA,IAAMmB,EAAoB,SAApBA,EAAqBzC,GACzB,GAAIA,EAAM2B,WAAae,EAAS1C,EAAMsB,MAAO,CAC3C,OAAOD,EAACK,EAAciB,EAAK3C,CAAAA,EAAAA,GAC7B,CACA,GAAIA,EAAMoC,SAAU,CAClB,OAAOf,EAACc,EAAaQ,EAAK3C,CAAAA,EAAAA,GAC5B,CACA,OAAOqB,EAACtB,EAAY4C,EAAK3C,CAAAA,EAAAA,GAC3B,EAyBO,IAAM4C,EAAeC,EAAKJ,GAAmB,SAACK,EAAKC,GACxD,GAAID,EAAIxB,OAASyB,EAAKzB,MAAQwB,EAAInB,YAAcoB,EAAKpB,WAAamB,EAAIV,WAAaU,EAAIV,SAAU,CAC/F,OAAO,KACT,CACA,OAAO,IACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flatbiz/antd",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.25",
|
|
4
4
|
"description": "flat-biz ui components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@ant-design/icons": ">=5.0.1",
|
|
30
|
-
"@dimjs/lang": ">=1.
|
|
31
|
-
"@dimjs/model": ">=1.2.
|
|
32
|
-
"@dimjs/model-react": ">=1.2.
|
|
33
|
-
"@dimjs/utils": ">=1.
|
|
30
|
+
"@dimjs/lang": ">=1.5.0",
|
|
31
|
+
"@dimjs/model": ">=1.2.3",
|
|
32
|
+
"@dimjs/model-react": ">=1.2.3",
|
|
33
|
+
"@dimjs/utils": ">=1.5.1",
|
|
34
34
|
"@flatbiz/utils": ">=4.0.21",
|
|
35
35
|
"@wove/react": ">=1.2.23",
|
|
36
36
|
"antd": ">=5.11.0",
|
|
37
37
|
"dayjs": ">=1.11.9",
|
|
38
38
|
"react": ">=18.2.0",
|
|
39
39
|
"react-dom": ">=18.2.0",
|
|
40
|
-
"ahooks": "
|
|
40
|
+
"ahooks": ">=3.7.11"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@ant-design/icons": "^4.8.0",
|
|
44
|
-
"@dimjs/lang": "^1.
|
|
45
|
-
"@dimjs/model": "^1.2.
|
|
46
|
-
"@dimjs/model-react": "^1.2.
|
|
47
|
-
"@dimjs/utils": "^1.
|
|
44
|
+
"@dimjs/lang": "^1.5.0",
|
|
45
|
+
"@dimjs/model": "^1.2.3",
|
|
46
|
+
"@dimjs/model-react": "^1.2.3",
|
|
47
|
+
"@dimjs/utils": "^1.5.1",
|
|
48
48
|
"@flatbiz/utils": "^4.0.21",
|
|
49
49
|
"@wove/react": "^1.2.23",
|
|
50
50
|
"antd": "5.11.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dequal": "2.0.3",
|
|
53
53
|
"react": "18.2.0",
|
|
54
54
|
"react-dom": "18.2.0",
|
|
55
|
-
"ahooks": "^3.7.
|
|
55
|
+
"ahooks": "^3.7.11",
|
|
56
56
|
"react-is": "^18.2.0",
|
|
57
57
|
"react-ace": "^10.1.0",
|
|
58
58
|
"sql-formatter": "^15.0.2",
|