@flatbiz/antd 4.2.31 → 4.2.32

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.
@@ -3,5 +3,5 @@ import './../fba-hooks/index.css';
3
3
  import './../flex-layout/index.css';
4
4
  import './index.css';
5
5
  /*! @flatjs/forge MIT @flatbiz/antd */
6
- import{a as e}from"../_rollupPluginBabelHelpers-1f4d8910.js";import{classNames as r}from"@dimjs/utils/cjs/class-names";import{fbaHooks as t}from"../fba-hooks/index.js";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{Form as l}from"antd";import{useMemo as a,isValidElement as n,cloneElement as s}from"react";import{F as m}from"../flex-layout-8d2b668b.js";import"@dimjs/lang/cjs/is-array";import"@wove/react/cjs/hooks";import"../use-responsive-point-21b8c601.js";import"@flatbiz/utils";var f=function l(a){var n;var s="form-item-group-card";var m=t.useThemeToken();var f={"--form-item-group-colorPrimary":m.colorPrimary};return i("div",{className:r(s,a.className),style:e({},f,a.style),children:[a.title?o("div",{className:r(s+"-title",(n={},n[s+"-title-sign"]=a.titleSign===true,n)),children:a.title}):null,a.children]})};f.defaultProps={titleSign:true};var u=function t(i){var f=a((function(){var r=[];var t=[];i.groupConfigList.forEach((function(i){if(i.before){t.push(n(i.before)?i.before:o("div",{className:"union-before-text",children:i.before}))}if(i.width){t.push(s(i.mainItem,{style:e({width:i.width},i.mainItem.props.style)}))}else{r.push(t.length);t.push(i.mainItem)}if(i.after){t.push(n(i.after)?i.after:o("div",{className:"union-after-text",children:i.after}))}}));return{flexElementList:t,fullIndex:r}}),[i.groupConfigList]);return o(l.Item,{label:i.label,className:r("form-item-group-horizontal-union",i.className),style:i.style,hidden:i.hidden,required:i.required,colon:i.colon,children:o(m,{direction:"horizontal",gap:i.gap===undefined?15:i.gap,fullIndex:f.fullIndex,style:i.flexLayoutStyle,children:f.flexElementList.map((function(e,r){return s(e,{key:r})}))})})};var c={HorizontalUnion:u,Card:f};export{c as FormItemGroup};
6
+ import{a as e}from"../_rollupPluginBabelHelpers-1f4d8910.js";import{classNames as r}from"@dimjs/utils/cjs/class-names";import{fbaHooks as t}from"../fba-hooks/index.js";import{jsxs as i,jsx as o}from"react/jsx-runtime";import{Form as l}from"antd";import{useMemo as n,isValidElement as a,cloneElement as s}from"react";import{F as m}from"../flex-layout-8d2b668b.js";import"@dimjs/lang/cjs/is-array";import"@wove/react/cjs/hooks";import"../use-responsive-point-21b8c601.js";import"@flatbiz/utils";var f=function l(n){var a;var s="form-item-group-card";var m=t.useThemeToken();var f={"--form-item-group-colorPrimary":m.colorPrimary};return i("div",{className:r(s,n.className),style:e({},f,n.style),children:[n.title?o("div",{className:r(s+"-title",(a={},a[s+"-title-sign"]=n.titleSign===true,a)),children:n.title}):null,n.children]})};f.defaultProps={titleSign:true};var u=function t(i){var f=n((function(){var r=[];var t=[];var l=i.groupConfigList.filter((function(e){return!e.hidden}));l.forEach((function(i){if(i.before){t.push(a(i.before)?i.before:o("div",{className:"union-before-text",children:i.before}))}if(i.width){t.push(s(i.mainItem,{style:e({width:i.width},i.mainItem.props.style)}))}else{r.push(t.length);t.push(i.mainItem)}if(i.after){t.push(a(i.after)?i.after:o("div",{className:"union-after-text",children:i.after}))}}));return{flexElementList:t,fullIndex:r}}),[i.groupConfigList]);return o(l.Item,{label:i.label,className:r("form-item-group-horizontal-union",i.className),style:i.style,hidden:i.hidden,required:i.required,colon:i.colon,children:o(m,{direction:"horizontal",gap:i.gap===undefined?15:i.gap,fullIndex:f.fullIndex,style:i.flexLayoutStyle,children:f.flexElementList.map((function(e,r){return s(e,{key:r})}))})})};var d={HorizontalUnion:u,Card:f};export{d as FormItemGroup};
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-group/card/index.tsx","@flatbiz/antd/src/form-item-group/horizontal-union/index.tsx","@flatbiz/antd/src/form-item-group/index.ts"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { CSSProperties, FC, ReactElement } from 'react';\nimport { fbaHooks } from '../../fba-hooks';\nimport './style.less';\n\nexport type FormItemCardProps = {\n title?: string | ReactElement;\n children: ReactElement | ReactElement[];\n className?: string;\n style?: CSSProperties;\n titleSign?: boolean;\n};\nexport const FormItemCard: FC<FormItemCardProps> = (props) => {\n const classNamePrefix = 'form-item-group-card';\n\n const theme = fbaHooks.useThemeToken();\n\n const style = { '--form-item-group-colorPrimary': theme.colorPrimary } as CSSProperties;\n\n return (\n <div className={classNames(classNamePrefix, props.className)} style={{ ...style, ...props.style }}>\n {props.title ? (\n <div\n className={classNames(`${classNamePrefix}-title`, {\n [`${classNamePrefix}-title-sign`]: props.titleSign === true,\n })}\n >\n {props.title}\n </div>\n ) : null}\n {props.children}\n </div>\n );\n};\n\nFormItemCard.defaultProps = {\n titleSign: true,\n};\n","import { classNames } from '@dimjs/utils';\nimport { Form } from 'antd';\nimport { cloneElement, CSSProperties, isValidElement, ReactElement, useMemo } from 'react';\nimport { FlexLayout } from '../../flex-layout';\nimport './style.less';\n\nexport type FormItemHorizontalUnionProps = {\n className?: string;\n style?: CSSProperties;\n label?: string | ReactElement;\n groupConfigList: {\n before?: ReactElement | string;\n width?: number | string;\n mainItem: ReactElement;\n after?: ReactElement | string;\n }[];\n gap?: number;\n flexLayoutStyle?: CSSProperties;\n hidden?: boolean;\n required?: boolean;\n colon?: boolean;\n};\n\nexport const FormItemHorizontalUnion = (props: FormItemHorizontalUnionProps) => {\n const groupFlexElementData = useMemo(() => {\n const fullIndex = [] as number[];\n const flexElementList = [] as Array<ReactElement>;\n props.groupConfigList.forEach((item) => {\n if (item.before) {\n flexElementList.push(\n isValidElement(item.before) ? (\n (item.before as ReactElement)\n ) : (\n <div className=\"union-before-text\">{item.before}</div>\n ),\n );\n }\n if (item.width) {\n flexElementList.push(\n cloneElement(item.mainItem, {\n style: { width: item.width, ...item.mainItem.props.style },\n }),\n );\n } else {\n fullIndex.push(flexElementList.length);\n flexElementList.push(item.mainItem);\n }\n if (item.after) {\n flexElementList.push(\n isValidElement(item.after) ? (\n (item.after as ReactElement)\n ) : (\n <div className=\"union-after-text\">{item.after}</div>\n ),\n );\n }\n });\n return {\n flexElementList,\n fullIndex,\n };\n }, [props.groupConfigList]);\n\n return (\n <Form.Item\n label={props.label}\n className={classNames('form-item-group-horizontal-union', props.className)}\n style={props.style}\n hidden={props.hidden}\n required={props.required}\n colon={props.colon}\n >\n <FlexLayout\n direction=\"horizontal\"\n gap={props.gap === undefined ? 15 : props.gap}\n fullIndex={groupFlexElementData.fullIndex}\n style={props.flexLayoutStyle}\n >\n {groupFlexElementData.flexElementList.map((item, index) => {\n return cloneElement(item, { key: index });\n })}\n </FlexLayout>\n </Form.Item>\n );\n};\n","import { FormItemCard } from './card';\nimport { FormItemHorizontalUnion } from './horizontal-union';\n\nexport const FormItemGroup = {\n HorizontalUnion: FormItemHorizontalUnion,\n Card: FormItemCard,\n};\n"],"names":["FormItemCard","props","_classNames2","classNamePrefix","theme","fbaHooks","useThemeToken","style","colorPrimary","_jsxs","className","_classNames","_extends","children","title","_jsx","titleSign","defaultProps","FormItemHorizontalUnion","groupFlexElementData","useMemo","fullIndex","flexElementList","groupConfigList","forEach","item","before","push","isValidElement","width","cloneElement","mainItem","length","after","Form","Item","label","hidden","required","colon","FlexLayout","direction","gap","undefined","flexLayoutStyle","map","index","key","FormItemGroup","HorizontalUnion","Card"],"mappings":";6eAYO,IAAMA,EAAsC,SAAtCA,EAAuCC,GAAU,IAAAC,EAC5D,IAAMC,EAAkB,uBAExB,IAAMC,EAAQC,EAASC,gBAEvB,IAAMC,EAAQ,CAAE,iCAAkCH,EAAMI,cAExD,OACEC,EAAA,MAAA,CAAKC,UAAWC,EAAWR,EAAiBF,EAAMS,WAAYH,MAAKK,EAAOL,CAAAA,EAAAA,EAAUN,EAAMM,OAAQM,SAC/FZ,CAAAA,EAAMa,MACLC,EAAA,MAAA,CACEL,UAAWC,EAAcR,EAAeD,UAAAA,KAAAA,EAClCC,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,GAC/C,OAAOhB,EAAaL,EAAM,CAAEsB,IAAKD,UAK3C,ECjFO,IAAME,EAAgB,CAC3BC,gBAAiB/B,EACjBgC,KAAMlD"}
1
+ {"version":3,"file":"index.js","sources":["@flatbiz/antd/src/form-item-group/card/index.tsx","@flatbiz/antd/src/form-item-group/horizontal-union/index.tsx","@flatbiz/antd/src/form-item-group/index.ts"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { CSSProperties, FC, ReactElement } from 'react';\nimport { fbaHooks } from '../../fba-hooks';\nimport './style.less';\n\nexport type FormItemCardProps = {\n title?: string | ReactElement;\n children: ReactElement | ReactElement[];\n className?: string;\n style?: CSSProperties;\n titleSign?: boolean;\n};\nexport const FormItemCard: FC<FormItemCardProps> = (props) => {\n const classNamePrefix = 'form-item-group-card';\n\n const theme = fbaHooks.useThemeToken();\n\n const style = { '--form-item-group-colorPrimary': theme.colorPrimary } as CSSProperties;\n\n return (\n <div className={classNames(classNamePrefix, props.className)} style={{ ...style, ...props.style }}>\n {props.title ? (\n <div\n className={classNames(`${classNamePrefix}-title`, {\n [`${classNamePrefix}-title-sign`]: props.titleSign === true,\n })}\n >\n {props.title}\n </div>\n ) : null}\n {props.children}\n </div>\n );\n};\n\nFormItemCard.defaultProps = {\n titleSign: true,\n};\n","import { classNames } from '@dimjs/utils';\nimport { Form } from 'antd';\nimport { cloneElement, CSSProperties, isValidElement, ReactElement, useMemo } from 'react';\nimport { FlexLayout } from '../../flex-layout';\nimport './style.less';\n\nexport type FormItemHorizontalUnionProps = {\n className?: string;\n style?: CSSProperties;\n label?: string | ReactElement;\n groupConfigList: {\n hidden?: boolean;\n before?: ReactElement | string;\n width?: number | string;\n mainItem: ReactElement;\n after?: ReactElement | string;\n }[];\n gap?: number;\n flexLayoutStyle?: CSSProperties;\n hidden?: boolean;\n required?: boolean;\n colon?: boolean;\n};\n\nexport const FormItemHorizontalUnion = (props: FormItemHorizontalUnionProps) => {\n const groupFlexElementData = useMemo(() => {\n const fullIndex = [] as number[];\n const flexElementList = [] as Array<ReactElement>;\n const groupConfigList = props.groupConfigList.filter((item) => !item.hidden);\n groupConfigList.forEach((item) => {\n if (item.before) {\n flexElementList.push(\n isValidElement(item.before) ? (\n (item.before as ReactElement)\n ) : (\n <div className=\"union-before-text\">{item.before}</div>\n ),\n );\n }\n if (item.width) {\n flexElementList.push(\n cloneElement(item.mainItem, {\n style: { width: item.width, ...item.mainItem.props.style },\n }),\n );\n } else {\n fullIndex.push(flexElementList.length);\n flexElementList.push(item.mainItem);\n }\n if (item.after) {\n flexElementList.push(\n isValidElement(item.after) ? (\n (item.after as ReactElement)\n ) : (\n <div className=\"union-after-text\">{item.after}</div>\n ),\n );\n }\n });\n return {\n flexElementList,\n fullIndex,\n };\n }, [props.groupConfigList]);\n\n return (\n <Form.Item\n label={props.label}\n className={classNames('form-item-group-horizontal-union', props.className)}\n style={props.style}\n hidden={props.hidden}\n required={props.required}\n colon={props.colon}\n >\n <FlexLayout\n direction=\"horizontal\"\n gap={props.gap === undefined ? 15 : props.gap}\n fullIndex={groupFlexElementData.fullIndex}\n style={props.flexLayoutStyle}\n >\n {groupFlexElementData.flexElementList.map((item, index) => {\n return cloneElement(item, { key: index });\n })}\n </FlexLayout>\n </Form.Item>\n );\n};\n","import { FormItemCard } from './card';\nimport { FormItemHorizontalUnion } from './horizontal-union';\n\nexport const FormItemGroup = {\n HorizontalUnion: FormItemHorizontalUnion,\n Card: FormItemCard,\n};\n"],"names":["FormItemCard","props","_classNames2","classNamePrefix","theme","fbaHooks","useThemeToken","style","colorPrimary","_jsxs","className","_classNames","_extends","children","title","_jsx","titleSign","defaultProps","FormItemHorizontalUnion","groupFlexElementData","useMemo","fullIndex","flexElementList","groupConfigList","filter","item","hidden","forEach","before","push","isValidElement","width","cloneElement","mainItem","length","after","Form","Item","label","required","colon","FlexLayout","direction","gap","undefined","flexLayoutStyle","map","index","key","FormItemGroup","HorizontalUnion","Card"],"mappings":";6eAYO,IAAMA,EAAsC,SAAtCA,E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BAEV,OACER,EAACqB,EAAKC,KAAI,CACRC,MAAOrC,EAAMqC,MACb5B,UAAWC,EAAW,mCAAoCV,EAAMS,WAChEH,MAAON,EAAMM,MACbmB,OAAQzB,EAAMyB,OACda,SAAUtC,EAAMsC,SAChBC,MAAOvC,EAAMuC,MAAM3B,SAEnBE,EAAC0B,EAAU,CACTC,UAAU,aACVC,IAAK1C,EAAM0C,MAAQC,UAAY,GAAK3C,EAAM0C,IAC1CtB,UAAWF,EAAqBE,UAChCd,MAAON,EAAM4C,gBAAgBhC,SAE5BM,EAAqBG,gBAAgBwB,KAAI,SAACrB,EAAMsB,GAC/C,OAAOf,EAAaP,EAAM,CAAEuB,IAAKD,UAK3C,ECnFO,IAAME,EAAgB,CAC3BC,gBAAiBhC,EACjBiC,KAAMnD"}
package/index.d.ts CHANGED
@@ -1274,6 +1274,7 @@ export type FormItemHorizontalUnionProps = {
1274
1274
  style?: CSSProperties;
1275
1275
  label?: string | ReactElement;
1276
1276
  groupConfigList: {
1277
+ hidden?: boolean;
1277
1278
  before?: ReactElement | string;
1278
1279
  width?: number | string;
1279
1280
  mainItem: ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/antd",
3
- "version": "4.2.31",
3
+ "version": "4.2.32",
4
4
  "description": "flat-biz ui components",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",