@bioturing/components 0.41.1 → 0.42.0-beta.0
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.
- package/dist/base.d.ts +1 -0
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +1 -0
- package/dist/base.js.map +1 -1
- package/dist/components/dropdown-menu/component.d.ts.map +1 -1
- package/dist/components/dropdown-menu/component.js +153 -155
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/form/FormItem/FormItemInput.d.ts +50 -0
- package/dist/components/form/FormItem/FormItemInput.d.ts.map +1 -0
- package/dist/components/form/FormItem/FormItemInput.js +137 -0
- package/dist/components/form/FormItem/FormItemInput.js.map +1 -0
- package/dist/components/form/FormItem/FormItemLabel.d.ts +48 -0
- package/dist/components/form/FormItem/FormItemLabel.d.ts.map +1 -0
- package/dist/components/form/FormItem/FormItemLabel.js +80 -0
- package/dist/components/form/FormItem/FormItemLabel.js.map +1 -0
- package/dist/components/form/FormItem/ItemHolder.d.ts +33 -0
- package/dist/components/form/FormItem/ItemHolder.d.ts.map +1 -0
- package/dist/components/form/FormItem/ItemHolder.js +168 -0
- package/dist/components/form/FormItem/ItemHolder.js.map +1 -0
- package/dist/components/form/FormItem/index.d.ts +106 -0
- package/dist/components/form/FormItem/index.d.ts.map +1 -0
- package/dist/components/form/FormItem/index.js +234 -0
- package/dist/components/form/FormItem/index.js.map +1 -0
- package/dist/components/form/component.d.ts +7 -1
- package/dist/components/form/component.d.ts.map +1 -1
- package/dist/components/form/component.js +4 -4
- package/dist/components/form/item.d.ts +27 -23
- package/dist/components/form/item.d.ts.map +1 -1
- package/dist/components/form/label.d.ts.map +1 -1
- package/dist/components/form/label.js +33 -31
- package/dist/components/form/label.js.map +1 -1
- package/dist/components/form/style.css +1 -1
- package/dist/components/toast/function.d.ts +1 -1
- package/dist/components/toast/function.d.ts.map +1 -1
- package/dist/components/utils/renderProp.d.ts +1 -1
- package/dist/components/utils/renderProp.d.ts.map +1 -1
- package/dist/components/utils/renderProp.js +16 -10
- package/dist/components/utils/renderProp.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +4 -3
- package/dist/components/form/item.js +0 -43
- package/dist/components/form/item.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bioturing/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,13 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@ant-design/cssinjs": "^1.24.0",
|
|
24
|
-
"@base-ui/react": "1.
|
|
25
|
-
"@base-ui/utils": "0.2.
|
|
24
|
+
"@base-ui/react": "1.2.0",
|
|
25
|
+
"@base-ui/utils": "0.2.5",
|
|
26
26
|
"@floating-ui/react": "^0.27.16",
|
|
27
27
|
"@tanstack/react-table": "^8.21.3",
|
|
28
28
|
"es-toolkit": "^1.37.2",
|
|
29
29
|
"merge-refs": "^2.0.0",
|
|
30
30
|
"prism-react-renderer": "^2.4.1",
|
|
31
|
+
"rc-field-form": "~2.7.1",
|
|
31
32
|
"rc-resize-observer": "^1.4.3",
|
|
32
33
|
"rc-select": "^14.16.8",
|
|
33
34
|
"rc-table": "^7.51.1",
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import q from "antd/es/form/FormItem";
|
|
4
|
-
import { FormLabel as u } from "./label.js";
|
|
5
|
-
import { isPlainObject as F } from "es-toolkit";
|
|
6
|
-
const I = ({
|
|
7
|
-
tooltip: a,
|
|
8
|
-
label: o,
|
|
9
|
-
optionalMark: p = !1,
|
|
10
|
-
requiredMark: d = !0,
|
|
11
|
-
labelRender: t,
|
|
12
|
-
required: e,
|
|
13
|
-
rules: i,
|
|
14
|
-
children: c,
|
|
15
|
-
...f
|
|
16
|
-
}) => {
|
|
17
|
-
const m = e || i?.some(
|
|
18
|
-
(r) => F(r) && "required" in r && r.required
|
|
19
|
-
), n = o ? /* @__PURE__ */ s(
|
|
20
|
-
u,
|
|
21
|
-
{
|
|
22
|
-
label: o,
|
|
23
|
-
tooltip: a,
|
|
24
|
-
optionalMark: !m && p,
|
|
25
|
-
requiredMark: m && d,
|
|
26
|
-
as: "span"
|
|
27
|
-
}
|
|
28
|
-
) : void 0;
|
|
29
|
-
return /* @__PURE__ */ s(
|
|
30
|
-
q,
|
|
31
|
-
{
|
|
32
|
-
required: e,
|
|
33
|
-
label: t ? t(n) : n,
|
|
34
|
-
rules: i,
|
|
35
|
-
...f,
|
|
36
|
-
children: c
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
I as FormItem
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../src/components/form/item.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntdFormItem,\n type FormItemProps as AntdFormItemProps,\n} from \"antd/es/form/FormItem\";\nimport { FormLabel } from \"./label\";\nimport { isPlainObject } from \"es-toolkit\";\nimport type React from \"react\";\n\nexport interface FormItemProps<Values = unknown>\n extends Omit<AntdFormItemProps<Values>, \"children\"> {\n // tooltip?: React.ReactNode | TooltipProps;\n /**\n * Whether show the optional mark. By default, optional item will not show the optional mark.\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether show the asterisk when the field is required\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n /**\n * Custom render function for the label\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n /**\n * Form item children - can be React nodes or render functions\n */\n children?: AntdFormItemProps<Values>[\"children\"];\n}\n\nexport const FormItem = <Values = unknown,>({\n tooltip,\n label,\n optionalMark = false,\n requiredMark = true,\n labelRender,\n required,\n rules,\n children,\n ...rest\n}: FormItemProps<Values>) => {\n const isRequired =\n required ||\n rules?.some(\n (rule) => isPlainObject(rule) && \"required\" in rule && rule.required\n );\n const renderedLabel = label ? (\n <FormLabel\n label={label}\n tooltip={tooltip}\n optionalMark={!isRequired && optionalMark}\n requiredMark={isRequired && requiredMark}\n as=\"span\"\n />\n ) : undefined;\n\n return (\n <AntdFormItem\n required={required}\n label={labelRender ? labelRender(renderedLabel) : renderedLabel}\n rules={rules}\n {...rest}\n >\n {children}\n </AntdFormItem>\n );\n};\n"],"names":["FormItem","tooltip","label","optionalMark","requiredMark","labelRender","required","rules","children","rest","isRequired","rule","isPlainObject","renderedLabel","jsx","FormLabel","AntdFormItem"],"mappings":";;;;;AAgCO,MAAMA,IAAW,CAAoB;AAAA,EAC1C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;AAC3B,QAAMC,IACJJ,KACAC,GAAO;AAAA,IACL,CAACI,MAASC,EAAcD,CAAI,KAAK,cAAcA,KAAQA,EAAK;AAAA,EAAA,GAE1DE,IAAgBX,IACpB,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAb;AAAA,MACA,SAAAD;AAAA,MACA,cAAc,CAACS,KAAcP;AAAA,MAC7B,cAAcO,KAAcN;AAAA,MAC5B,IAAG;AAAA,IAAA;AAAA,EAAA,IAEH;AAEJ,SACE,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAV;AAAA,MACA,OAAOD,IAAcA,EAAYQ,CAAa,IAAIA;AAAA,MAClD,OAAAN;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|