@carefrees/form-utils-react-taro 0.0.4

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.
Files changed (100) hide show
  1. package/README.md +9 -0
  2. package/esm/formItem/index.d.ts +11 -0
  3. package/esm/formItem/index.js +70 -0
  4. package/esm/formList/index.d.ts +27 -0
  5. package/esm/formList/index.js +40 -0
  6. package/esm/hooks/attr/attr.FormItem.d.ts +48 -0
  7. package/esm/hooks/attr/attr.FormItem.js +61 -0
  8. package/esm/hooks/register/register.FormHideItem.d.ts +9 -0
  9. package/esm/hooks/register/register.FormHideItem.js +31 -0
  10. package/esm/hooks/register/register.FormItem.d.ts +23 -0
  11. package/esm/hooks/register/register.FormItem.js +42 -0
  12. package/esm/hooks/register/register.FormList.d.ts +9 -0
  13. package/esm/hooks/register/register.FormList.js +31 -0
  14. package/esm/hooks/register/register.form.d.ts +3 -0
  15. package/esm/hooks/register/register.form.js +17 -0
  16. package/esm/hooks/useAttrs.d.ts +25 -0
  17. package/esm/hooks/useAttrs.js +10 -0
  18. package/esm/hooks/useForm.d.ts +7 -0
  19. package/esm/hooks/useForm.js +13 -0
  20. package/esm/hooks/useFormItem.d.ts +7 -0
  21. package/esm/hooks/useFormItem.js +11 -0
  22. package/esm/hooks/useFormItemParentName.d.ts +30 -0
  23. package/esm/hooks/useFormItemParentName.js +61 -0
  24. package/esm/hooks/useFormList.d.ts +7 -0
  25. package/esm/hooks/useFormList.js +11 -0
  26. package/esm/hooks/useHtmlFor.d.ts +1 -0
  27. package/esm/hooks/useHtmlFor.js +10 -0
  28. package/esm/hooks/useMultipleForm.d.ts +13 -0
  29. package/esm/hooks/useMultipleForm.js +19 -0
  30. package/esm/hooks/useUpdate.d.ts +2 -0
  31. package/esm/hooks/useUpdate.js +10 -0
  32. package/esm/hooks/useWatch.d.ts +19 -0
  33. package/esm/hooks/useWatch.js +41 -0
  34. package/esm/index.d.ts +46 -0
  35. package/esm/index.js +61 -0
  36. package/esm/layout/index.d.ts +35 -0
  37. package/esm/layout/index.js +99 -0
  38. package/esm/layout/layout.formItem.d.ts +44 -0
  39. package/esm/layout/layout.formItem.js +113 -0
  40. package/esm/styles/index.css +200 -0
  41. package/lib/formItem/index.d.ts +11 -0
  42. package/lib/formItem/index.js +107 -0
  43. package/lib/formList/index.d.ts +27 -0
  44. package/lib/formList/index.js +77 -0
  45. package/lib/hooks/attr/attr.FormItem.d.ts +48 -0
  46. package/lib/hooks/attr/attr.FormItem.js +95 -0
  47. package/lib/hooks/register/register.FormHideItem.d.ts +9 -0
  48. package/lib/hooks/register/register.FormHideItem.js +65 -0
  49. package/lib/hooks/register/register.FormItem.d.ts +23 -0
  50. package/lib/hooks/register/register.FormItem.js +76 -0
  51. package/lib/hooks/register/register.FormList.d.ts +9 -0
  52. package/lib/hooks/register/register.FormList.js +65 -0
  53. package/lib/hooks/register/register.form.d.ts +3 -0
  54. package/lib/hooks/register/register.form.js +51 -0
  55. package/lib/hooks/useAttrs.d.ts +25 -0
  56. package/lib/hooks/useAttrs.js +47 -0
  57. package/lib/hooks/useForm.d.ts +7 -0
  58. package/lib/hooks/useForm.js +53 -0
  59. package/lib/hooks/useFormItem.d.ts +7 -0
  60. package/lib/hooks/useFormItem.js +51 -0
  61. package/lib/hooks/useFormItemParentName.d.ts +30 -0
  62. package/lib/hooks/useFormItemParentName.js +101 -0
  63. package/lib/hooks/useFormList.d.ts +7 -0
  64. package/lib/hooks/useFormList.js +51 -0
  65. package/lib/hooks/useHtmlFor.d.ts +1 -0
  66. package/lib/hooks/useHtmlFor.js +44 -0
  67. package/lib/hooks/useMultipleForm.d.ts +13 -0
  68. package/lib/hooks/useMultipleForm.js +62 -0
  69. package/lib/hooks/useUpdate.d.ts +2 -0
  70. package/lib/hooks/useUpdate.js +44 -0
  71. package/lib/hooks/useWatch.d.ts +19 -0
  72. package/lib/hooks/useWatch.js +78 -0
  73. package/lib/index.d.ts +46 -0
  74. package/lib/index.js +317 -0
  75. package/lib/layout/index.d.ts +35 -0
  76. package/lib/layout/index.js +146 -0
  77. package/lib/layout/layout.formItem.d.ts +44 -0
  78. package/lib/layout/layout.formItem.js +157 -0
  79. package/lib/styles/index.css +200 -0
  80. package/package.json +32 -0
  81. package/src/formItem/index.tsx +103 -0
  82. package/src/formList/index.tsx +59 -0
  83. package/src/hooks/attr/attr.FormItem.tsx +131 -0
  84. package/src/hooks/register/register.FormHideItem.ts +29 -0
  85. package/src/hooks/register/register.FormItem.ts +52 -0
  86. package/src/hooks/register/register.FormList.ts +31 -0
  87. package/src/hooks/register/register.form.ts +18 -0
  88. package/src/hooks/useAttrs.ts +35 -0
  89. package/src/hooks/useForm.ts +23 -0
  90. package/src/hooks/useFormItem.ts +21 -0
  91. package/src/hooks/useFormItemParentName.ts +49 -0
  92. package/src/hooks/useFormList.ts +21 -0
  93. package/src/hooks/useHtmlFor.ts +9 -0
  94. package/src/hooks/useMultipleForm.ts +36 -0
  95. package/src/hooks/useUpdate.ts +12 -0
  96. package/src/hooks/useWatch.ts +61 -0
  97. package/src/index.tsx +102 -0
  98. package/src/layout/index.tsx +152 -0
  99. package/src/layout/layout.formItem.tsx +152 -0
  100. package/src/styles/index.css +208 -0
package/src/index.tsx ADDED
@@ -0,0 +1,102 @@
1
+ import React, { useMemo, useEffect } from 'react';
2
+ import { FormInstanceBase, ValidateErrorEntity } from '@carefrees/form-utils';
3
+ import clx from 'classnames';
4
+ import { FormLayout, FormLayoutProps } from './layout';
5
+ import { useForm, FormInstanceContext } from './hooks/useForm';
6
+ import { useRegisterForm } from './hooks/register/register.form';
7
+ import { Form as TaroForm } from '@tarojs/components';
8
+ import type { CommonEventFunction, FormProps as TaroFormProps } from '@tarojs/components';
9
+ import './styles/index.css';
10
+ export * from './formItem';
11
+ export * from './formList';
12
+ export * from './layout';
13
+ export * from './layout/layout.formItem';
14
+ export * from './hooks/useAttrs';
15
+ export * from './hooks/useForm';
16
+ export * from './hooks/useFormItem';
17
+ export * from './hooks/useFormItemParentName';
18
+ export * from './hooks/useFormList';
19
+ export * from './hooks/useHtmlFor';
20
+ export * from './hooks/useMultipleForm';
21
+ export * from './hooks/useWatch';
22
+ export * from './hooks/attr/attr.FormItem';
23
+ export * from './hooks/register/register.FormHideItem';
24
+ export * from './hooks/register/register.FormItem';
25
+ export * from './hooks/register/register.FormList';
26
+ export * from './hooks/register/register.form';
27
+
28
+ export interface FormProps<T = any> extends FormLayoutProps {
29
+ children?: React.ReactNode;
30
+ form?: FormInstanceBase;
31
+ style?: React.CSSProperties;
32
+ className?: string;
33
+ layoutClassName?: string;
34
+ layoutStyle?: React.CSSProperties;
35
+ /**表单数据*/
36
+ formData?: any;
37
+ /**值更新触发*/
38
+ onValuesChange?: (changedValues: Partial<T>, values: T) => void;
39
+ /**提交保存 验证成功*/
40
+ onFinish?: (values: T) => void;
41
+ /**提交保存 验证失败*/
42
+ onFinishFailed?: (errorInfo: ValidateErrorEntity<T>) => void;
43
+ /**隐藏表单项初始值*/
44
+ hideData?: Record<string, boolean>;
45
+ /**表单名称*/
46
+ name?: string;
47
+ /**隐藏规则校验*/
48
+ hideRuleData?: Record<string, boolean>;
49
+ /**自动重置更新formData数据*/
50
+ isAutoUpdatedFormData?: boolean;
51
+ }
52
+
53
+ export function Form<T = any>(props: FormProps<T>) {
54
+ const {
55
+ children,
56
+ form,
57
+ style,
58
+ className,
59
+ formData,
60
+ hideData,
61
+ hideRuleData,
62
+ isAutoUpdatedFormData = false,
63
+ name,
64
+ onFinish,
65
+ onFinishFailed,
66
+ onValuesChange,
67
+ layoutStyle,
68
+ layoutClassName,
69
+ ...rest
70
+ } = props;
71
+
72
+ const formInstance = useForm(form);
73
+ useRegisterForm(formInstance, name);
74
+ const cls = useMemo(() => clx('carefrees-form', className), []);
75
+ useMemo(() => formInstance.ctor(formData, hideData, hideRuleData), []);
76
+
77
+ formInstance.onFinish = onFinish;
78
+ formInstance.onValuesChange = onValuesChange;
79
+ formInstance.onFinishFailed = onFinishFailed;
80
+
81
+ useEffect(() => {
82
+ if (isAutoUpdatedFormData) {
83
+ formInstance.resetFieldValue(formData);
84
+ }
85
+ }, [isAutoUpdatedFormData, formData]);
86
+
87
+ const onSubmit: CommonEventFunction<TaroFormProps.onSubmitEventDetail> = (event) => {
88
+ event?.preventDefault?.();
89
+ event?.stopPropagation?.();
90
+ formInstance.submit();
91
+ };
92
+
93
+ return (
94
+ <FormInstanceContext.Provider value={formInstance}>
95
+ <TaroForm className={cls} style={style} onSubmit={onSubmit}>
96
+ <FormLayout {...rest} className={layoutClassName} style={layoutStyle}>
97
+ {children}
98
+ </FormLayout>
99
+ </TaroForm>
100
+ </FormInstanceContext.Provider>
101
+ );
102
+ }
@@ -0,0 +1,152 @@
1
+ import React, { Fragment, useMemo, useRef, memo } from 'react';
2
+ import { View, ViewProps } from '@tarojs/components';
3
+ import clx from 'classnames';
4
+ import { AttrsOptions, AttrsContext, useAttrs } from '../hooks/useAttrs';
5
+ export interface FormLayoutProps extends AttrsOptions {
6
+ /**标题*/
7
+ title?: React.ReactNode;
8
+ /**额外内容*/
9
+ extra?: React.ReactNode;
10
+ /**内容*/
11
+ children?: React.ReactNode;
12
+ /**是否占据整行*/
13
+ isAllColSpan?: boolean;
14
+ className?: string;
15
+ /**头部ClassName*/
16
+ headerClassName?: string;
17
+ /**内容ClassName*/
18
+ bodyClassName?: string;
19
+ style?: React.CSSProperties;
20
+ /**头部样式*/
21
+ headerStyle?: React.CSSProperties;
22
+ /**内容样式*/
23
+ bodyStyle?: React.CSSProperties;
24
+ /**是否添加边框*/
25
+ bordered?: boolean;
26
+ /**列数据*/
27
+ colCount?: number;
28
+ /**
29
+ * @description gap 属性是用来设置网格行与列之间的间隙,该属性是row-gap and column-gap的简写形式。
30
+ */
31
+ gap?: string | number;
32
+ }
33
+
34
+ const preCls = 'carefrees-form-layout';
35
+
36
+ /**布局组件*/
37
+ export const FormLayout = memo((props: FormLayoutProps) => {
38
+ const {
39
+ colCount: p_colCount = 4,
40
+ errorLayout: p_errorLayout = 'left-bottom',
41
+ labelMode: p_labelMode = 'left',
42
+ showColon: p_showColon = true,
43
+ formItemClassName: p_formItemClassName,
44
+ formItemStyle: p_formItemStyle,
45
+ formItemLabelClassName: p_formItemLabelClassName,
46
+ formItemLabelStyle: p_formItemLabelStyle,
47
+ } = useAttrs();
48
+ const {
49
+ colCount = p_colCount,
50
+ title,
51
+ extra,
52
+ children,
53
+ isAllColSpan,
54
+ className,
55
+ headerClassName,
56
+ bodyClassName,
57
+ style,
58
+ headerStyle,
59
+ bodyStyle,
60
+ errorLayout = p_errorLayout,
61
+ labelMode = p_labelMode,
62
+ showColon = p_showColon,
63
+ formItemClassName = p_formItemClassName,
64
+ formItemStyle = p_formItemStyle,
65
+ formItemLabelClassName = p_formItemLabelClassName,
66
+ formItemLabelStyle = p_formItemLabelStyle,
67
+ bordered = false,
68
+ gap,
69
+ } = props;
70
+ const propsRef = useRef(props);
71
+ propsRef.current = props;
72
+
73
+ const cls = useMemo(
74
+ () =>
75
+ clx(preCls, className, {
76
+ 'all-colspan': isAllColSpan,
77
+ bordered: bordered,
78
+ }),
79
+ [className],
80
+ );
81
+
82
+ const bodyCls = useMemo(() => clx(`${preCls}-body`, bodyClassName), [bodyClassName]);
83
+ const headerCls = useMemo(() => clx(`${preCls}-header`, headerClassName), [headerClassName]);
84
+ const headerTitleCls = useMemo(() => clx(`${preCls}-header-title`), []);
85
+ const headerExtraCls = useMemo(() => clx(`${preCls}-header-extra`), []);
86
+
87
+ const value = useMemo(() => {
88
+ return {
89
+ colCount,
90
+ errorLayout,
91
+ labelMode,
92
+ showColon,
93
+ formItemClassName,
94
+ formItemStyle,
95
+ formItemLabelClassName,
96
+ formItemLabelStyle,
97
+ };
98
+ }, [
99
+ colCount,
100
+ errorLayout,
101
+ labelMode,
102
+ showColon,
103
+ formItemClassName,
104
+ formItemStyle,
105
+ formItemLabelClassName,
106
+ formItemLabelStyle,
107
+ ]);
108
+ const styleBase = useMemo(() => {
109
+ const css: React.CSSProperties = {};
110
+ if (typeof gap === 'string') {
111
+ css.gap = gap;
112
+ }
113
+ if (typeof gap === 'number') {
114
+ css.gap = `${gap}px`;
115
+ }
116
+ if (colCount) {
117
+ css.gridTemplateColumns = `repeat(${colCount}, auto)`;
118
+ }
119
+ return css;
120
+ }, [colCount, gap]);
121
+
122
+ return (
123
+ <AttrsContext.Provider value={value}>
124
+ <View style={style} className={cls}>
125
+ {title || extra ? (
126
+ <View style={headerStyle} className={headerCls}>
127
+ <View className={headerTitleCls}>{title}</View>
128
+ <View className={headerExtraCls}>{extra}</View>
129
+ </View>
130
+ ) : (
131
+ <Fragment />
132
+ )}
133
+ <View style={{ ...styleBase, ...bodyStyle }} className={bodyCls}>
134
+ {children}
135
+ </View>
136
+ </View>
137
+ </AttrsContext.Provider>
138
+ );
139
+ });
140
+
141
+ /**布局组件 占据一整行*/
142
+ export const FormLayoutRows = (props: ViewProps) => {
143
+ const { className } = props;
144
+ const cls = useMemo(
145
+ () =>
146
+ clx(preCls, className, {
147
+ 'all-colspan': true,
148
+ }),
149
+ [className],
150
+ );
151
+ return <View {...props} className={cls} />;
152
+ };
@@ -0,0 +1,152 @@
1
+ import { View, Label } from '@tarojs/components';
2
+ import React, { Fragment, useMemo, memo } from 'react';
3
+ import clx from 'classnames';
4
+ import { useAttrs } from '../hooks/useAttrs';
5
+
6
+ export interface LayoutFormItemProps {
7
+ /**规则校验失败错误提示位置*/
8
+ errorLayout?: 'left-bottom' | 'right-bottom' | 'top-right' | 'top-left';
9
+ /**必填样式*/
10
+ required?: boolean;
11
+ /**label显示模式*/
12
+ labelMode?: 'left' | 'top' | 'between' | 'hide';
13
+ /**内容*/
14
+ children?: React.ReactNode;
15
+ /**只进行规则样式*/
16
+ onlyRuleStyle?: boolean;
17
+ label?: React.ReactNode;
18
+ /**底部提示内容*/
19
+ helpText?: React.ReactNode;
20
+ /**额外内容*/
21
+ extra?: React.ReactNode;
22
+ /**是否显示label后的冒号*/
23
+ showColon?: boolean;
24
+ /**
25
+ * 表单项占据列数
26
+ * @default 1
27
+ */
28
+ colSpan?: number;
29
+ /**
30
+ * 表单项占据行数
31
+ * @default 1
32
+ */
33
+ rowSpan?: number;
34
+
35
+ htmlFor?: string;
36
+ /**规则验证结果*/
37
+ validateResult?: {
38
+ tip: string | (string | undefined)[];
39
+ isInvalid: boolean;
40
+ };
41
+ // 样式部分
42
+ style?: React.CSSProperties;
43
+ className?: string;
44
+ labelStyle?: React.CSSProperties;
45
+ labelClassName?: string;
46
+ /**底部边框*/
47
+ inputBordered?: boolean;
48
+ }
49
+
50
+ const preCls = 'carefrees-form-item';
51
+ /**布局组件 表单项*/
52
+ export const LayoutFormItem = memo((props: LayoutFormItemProps) => {
53
+ const {
54
+ formItemClassName,
55
+ formItemLabelClassName,
56
+ formItemLabelStyle,
57
+ formItemStyle,
58
+ labelMode: p_labelMode = 'top',
59
+ errorLayout: p_errorLayout = 'left-bottom',
60
+ showColon: p_showColon = true,
61
+ colCount = 1,
62
+ inputBordered: p_inputBordered = true,
63
+ } = useAttrs();
64
+
65
+ const {
66
+ children,
67
+ labelMode = p_labelMode,
68
+ onlyRuleStyle,
69
+ label,
70
+ helpText,
71
+ extra,
72
+ showColon = p_showColon,
73
+ colSpan = 1,
74
+ rowSpan = 1,
75
+ validateResult,
76
+ htmlFor,
77
+ required,
78
+ errorLayout = p_errorLayout,
79
+ style,
80
+ className,
81
+ labelClassName,
82
+ labelStyle,
83
+ inputBordered = p_inputBordered,
84
+ } = props;
85
+ const tip = validateResult?.tip;
86
+ const isInvalid = !!validateResult?.isInvalid;
87
+ const _errorLayout = labelMode === 'between' ? 'right-bottom' : errorLayout;
88
+
89
+ const cls = useMemo(() => clx(preCls, className, formItemClassName, { 'dx-invalid': isInvalid }), [isInvalid]);
90
+ const containerCls = useMemo(() => clx(`${preCls}-container`, { [`${labelMode}`]: !!labelMode }), [labelMode]);
91
+ const labelCls = useMemo(
92
+ () =>
93
+ clx(`${preCls}-label`, {
94
+ required: required,
95
+ 'show-colon': showColon && (labelMode === 'left' || labelMode === 'between'),
96
+ }),
97
+ [labelMode, required, showColon],
98
+ );
99
+
100
+ const labelWarpCls = useMemo(
101
+ () => clx(`${preCls}-label-warp`, labelClassName, formItemLabelClassName),
102
+ [labelClassName, formItemLabelClassName],
103
+ );
104
+
105
+ const inputCls = useMemo(
106
+ () =>
107
+ clx(`${preCls}-body-input`, {
108
+ 'input-bordered': inputBordered,
109
+ }),
110
+ [inputBordered],
111
+ );
112
+
113
+ const errorCls = useMemo(() => clx(`${preCls}-body-error`, { [_errorLayout]: !!_errorLayout }), [_errorLayout]);
114
+ const _isLabel = useMemo(() => label && labelMode !== 'hide', [label, labelMode]);
115
+
116
+ const styleBase = useMemo(() => {
117
+ const css: React.CSSProperties = {};
118
+ if (onlyRuleStyle) {
119
+ css.padding = '0px';
120
+ }
121
+ if (colSpan) {
122
+ const end = colCount > colSpan ? colSpan : colCount;
123
+ css.gridColumnEnd = `span ${end}`;
124
+ }
125
+ if (rowSpan) {
126
+ css.gridRowEnd = `span ${rowSpan}`;
127
+ }
128
+ return css;
129
+ }, [onlyRuleStyle, colSpan, rowSpan, colCount]);
130
+
131
+ return (
132
+ <View style={{ ...formItemStyle, ...styleBase, ...style }} className={cls}>
133
+ <View className={containerCls}>
134
+ {_isLabel ? (
135
+ <View style={{ ...formItemLabelStyle, ...labelStyle }} className={labelWarpCls}>
136
+ <Label for={htmlFor} className={labelCls}>
137
+ {label}
138
+ </Label>
139
+ </View>
140
+ ) : (
141
+ <Fragment />
142
+ )}
143
+ <View className={`${preCls}-body`}>
144
+ <View className={inputCls}>{children}</View>
145
+ {helpText ? <View className={`${preCls}-body-help`}>{helpText}</View> : <Fragment />}
146
+ {isInvalid ? <View className={errorCls}>{tip}</View> : <Fragment />}
147
+ </View>
148
+ </View>
149
+ {extra ? <View className={`${preCls}-extra`}>{extra}</View> : <Fragment />}
150
+ </View>
151
+ );
152
+ });
@@ -0,0 +1,208 @@
1
+ /* 表单 */
2
+ .carefrees-form {
3
+ box-sizing: border-box;
4
+ background-color: #fff;
5
+ font-size: 14px;
6
+ }
7
+
8
+ /* 布局 */
9
+ .carefrees-form-layout {
10
+ width: 100%;
11
+ box-sizing: border-box;
12
+ border-radius: 4px;
13
+ padding-bottom: 8px;
14
+ position: relative;
15
+ }
16
+
17
+ .carefrees-form-layout.all-colspan {
18
+ grid-column: 1 / -1;
19
+ }
20
+
21
+ .carefrees-form-layout.bordered {
22
+ border: 1px solid #e0e0e0;
23
+ }
24
+ .carefrees-form-layout.bordered .carefrees-form-layout-header {
25
+ padding-inline-start: 8px;
26
+ padding-inline-end: 8px;
27
+ }
28
+
29
+ .carefrees-form-layout-header {
30
+ display: flex;
31
+ justify-content: space-between;
32
+ align-items: center;
33
+ flex-direction: row;
34
+ border-bottom: 1px solid #e0e0e0;
35
+ padding-top: 5px;
36
+ padding-bottom: 5px;
37
+ margin-block-end: 4px;
38
+ padding-inline-start: 2px;
39
+ padding-inline-end: 2px;
40
+ box-sizing: border-box;
41
+ }
42
+
43
+ .carefrees-form-layout-header-title {
44
+ font-size: 14px;
45
+ font-weight: 600;
46
+ color: #1d2129;
47
+ box-sizing: border-box;
48
+ }
49
+ .carefrees-form-layout-header-extra {
50
+ font-size: 14px;
51
+ font-weight: 500;
52
+ color: #1d2129;
53
+ box-sizing: border-box;
54
+ }
55
+
56
+ .carefrees-form-layout-body {
57
+ width: 100%;
58
+ display: grid;
59
+ grid-template-columns: repeat(1, auto);
60
+ gap: 2px;
61
+ padding-left: 2px;
62
+ padding-right: 2px;
63
+ box-sizing: border-box;
64
+ }
65
+
66
+ /* 表单项 */
67
+ .carefrees-form-item {
68
+ font-size: 14px;
69
+ display: flex;
70
+ flex-direction: row;
71
+ align-items: flex-start;
72
+ padding: 8px;
73
+ box-sizing: border-box;
74
+ color: rgba(0, 0, 0, 0.88);
75
+ }
76
+
77
+ .carefrees-form-item-container {
78
+ flex: 1;
79
+ height: 100%;
80
+ display: flex;
81
+ flex-direction: column;
82
+ gap: 4px;
83
+ box-sizing: border-box;
84
+ }
85
+ .carefrees-form-item-container.left {
86
+ flex-direction: row;
87
+ gap: 8px;
88
+ text-align: left;
89
+ }
90
+ .carefrees-form-item-container.left .carefrees-form-item-label {
91
+ justify-content: flex-end;
92
+ }
93
+ .carefrees-form-item-container.between {
94
+ gap: 8px;
95
+ text-align: left;
96
+ flex-direction: row;
97
+ justify-content: space-between;
98
+ }
99
+
100
+ .carefrees-form-item-container.between .carefrees-form-item-body,
101
+ .carefrees-form-item-container.between .carefrees-form-item-body-input {
102
+ justify-content: flex-end;
103
+ text-align: right;
104
+ }
105
+
106
+ .carefrees-form-item-label-warp {
107
+ box-sizing: border-box;
108
+ }
109
+
110
+ .carefrees-form-item-label {
111
+ box-sizing: border-box;
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: flex-start;
115
+ position: relative;
116
+ font-size: 14px;
117
+ color: rgba(0, 0, 0, 0.88);
118
+ min-height: 1.4rem;
119
+ }
120
+
121
+ .carefrees-form-item-label.show-colon::after {
122
+ content: ':';
123
+ display: inline-block;
124
+ text-align: center;
125
+ margin: 0;
126
+ margin-inline-end: 2px;
127
+ margin-inline-start: 2px;
128
+ box-sizing: border-box;
129
+ }
130
+
131
+ .carefrees-form-item-label.required::before {
132
+ content: '*';
133
+ color: red;
134
+ display: inline-block;
135
+ margin-inline-end: 4px;
136
+ box-sizing: border-box;
137
+ }
138
+
139
+ .carefrees-form-item-body {
140
+ position: relative;
141
+ display: flex;
142
+ flex-direction: column;
143
+ align-items: flex-start;
144
+ justify-content: flex-start;
145
+ box-sizing: border-box;
146
+ gap: 4px;
147
+ flex: 1;
148
+ }
149
+ .carefrees-form-item-body-input {
150
+ box-sizing: border-box;
151
+ width: 100%;
152
+ flex: 1;
153
+ display: flex;
154
+ justify-content: flex-start;
155
+ align-items: center;
156
+ flex-direction: row;
157
+ }
158
+
159
+ .carefrees-form-item-body-input.input-bordered {
160
+ border-bottom: 1px solid #e0e0e0;
161
+ }
162
+
163
+ .carefrees-form-item-body-help {
164
+ width: 100%;
165
+ box-sizing: border-box;
166
+ }
167
+
168
+ .carefrees-form-item-body-error {
169
+ position: absolute;
170
+ width: 100%;
171
+ color: red;
172
+ top: auto;
173
+ left: 0;
174
+ right: 0;
175
+ bottom: -16px;
176
+ padding-top: 2px;
177
+ font-size: 12px;
178
+ box-sizing: border-box;
179
+ z-index: 10;
180
+ pointer-events: none;
181
+ display: flex;
182
+ flex-direction: row;
183
+ justify-content: start;
184
+ }
185
+ .carefrees-form-item-body-error.right-bottom {
186
+ justify-content: flex-end;
187
+ top: auto;
188
+ left: 0;
189
+ right: 0;
190
+ bottom: -16px;
191
+ }
192
+ .carefrees-form-item-body-error.top-left {
193
+ justify-content: start;
194
+ top: -16px;
195
+ left: 0px;
196
+ right: 0px;
197
+ bottom: auto;
198
+ }
199
+ .carefrees-form-item-body-error.top-right {
200
+ justify-content: flex-end;
201
+ top: -16px;
202
+ left: 0px;
203
+ right: 0px;
204
+ bottom: auto;
205
+ }
206
+ .carefrees-form-item-extra {
207
+ box-sizing: border-box;
208
+ }