@os-design/core 1.0.184 → 1.0.185
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.
|
@@ -5,24 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
9
|
var _styles = require("@os-design/styles");
|
|
11
|
-
var _utils = require("@os-design/utils");
|
|
12
10
|
var _theming = require("@os-design/theming");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var _InputSkeleton = _interopRequireDefault(require("../InputSkeleton"));
|
|
11
|
+
var _utils = require("@os-design/utils");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _Checkbox = _interopRequireDefault(require("../Checkbox"));
|
|
14
|
+
var _CheckboxSkeleton = _interopRequireDefault(require("../CheckboxSkeleton"));
|
|
18
15
|
var _FormConfigContext = _interopRequireDefault(require("../Form/FormConfigContext"));
|
|
16
|
+
var _InputSkeleton = _interopRequireDefault(require("../InputSkeleton"));
|
|
17
|
+
var _RadioGroup = _interopRequireDefault(require("../RadioGroup"));
|
|
18
|
+
var _RadioGroupSkeleton = _interopRequireDefault(require("../RadioGroupSkeleton"));
|
|
19
19
|
var _Switch = _interopRequireDefault(require("../Switch"));
|
|
20
20
|
var _SwitchSkeleton = _interopRequireDefault(require("../SwitchSkeleton"));
|
|
21
|
-
var
|
|
21
|
+
var _TextArea = _interopRequireDefault(require("../TextArea"));
|
|
22
|
+
var _TextAreaSkeleton = _interopRequireDefault(require("../TextAreaSkeleton"));
|
|
23
|
+
var _firstChildHasType = _interopRequireDefault(require("./utils/firstChildHasType"));
|
|
24
|
+
var _excluded = ["label", "help", "error", "optional", "loading", "id", "children"];
|
|
22
25
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
27
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
26
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
30
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
31
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -36,14 +39,14 @@ var Label = _styled["default"].label(_templateObject2 || (_templateObject2 = _ta
|
|
|
36
39
|
var Optional = _styled["default"].span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n margin-left: 0.3em;\n"])), function (p) {
|
|
37
40
|
return (0, _theming.clr)(p.theme.formItemColorOptional);
|
|
38
41
|
});
|
|
39
|
-
var
|
|
40
|
-
return p.hasError && (0, _react2.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), (0, _theming.clr)(p.theme.formItemColorError));
|
|
41
|
-
};
|
|
42
|
-
var Help = (0, _styled["default"])('div', (0, _utils.omitEmotionProps)('hasError'))(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 0.1em;\n font-size: ", "em;\n color: ", ";\n ", ";\n"])), function (p) {
|
|
42
|
+
var Help = _styled["default"].div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-top: 0.1em;\n font-size: ", "em;\n color: ", ";\n"])), function (p) {
|
|
43
43
|
return p.theme.sizes.small;
|
|
44
44
|
}, function (p) {
|
|
45
45
|
return (0, _theming.clr)(p.theme.formItemColorHelp);
|
|
46
|
-
}
|
|
46
|
+
});
|
|
47
|
+
var Error = (0, _styled["default"])(Help)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n"])), function (p) {
|
|
48
|
+
return (0, _theming.clr)(p.theme.formItemColorError);
|
|
49
|
+
});
|
|
47
50
|
|
|
48
51
|
/**
|
|
49
52
|
* The wrapper of the field.
|
|
@@ -51,10 +54,9 @@ var Help = (0, _styled["default"])('div', (0, _utils.omitEmotionProps)('hasError
|
|
|
51
54
|
var FormItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
52
55
|
var label = _ref.label,
|
|
53
56
|
help = _ref.help,
|
|
57
|
+
error = _ref.error,
|
|
54
58
|
_ref$optional = _ref.optional,
|
|
55
59
|
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
56
|
-
_ref$hasError = _ref.hasError,
|
|
57
|
-
hasError = _ref$hasError === void 0 ? false : _ref$hasError,
|
|
58
60
|
_ref$loading = _ref.loading,
|
|
59
61
|
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
60
62
|
id = _ref.id,
|
|
@@ -71,13 +73,16 @@ var FormItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
71
73
|
var helpId = (0, _react.useMemo)(function () {
|
|
72
74
|
return "help-".concat(containerId);
|
|
73
75
|
}, [containerId]);
|
|
74
|
-
var
|
|
75
|
-
var c = /*#__PURE__*/_react["default"].isValidElement(children) ?
|
|
76
|
+
var input = (0, _react.useMemo)(function () {
|
|
77
|
+
var c = /*#__PURE__*/_react["default"].isValidElement(children) ?
|
|
78
|
+
/*#__PURE__*/
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
+
_react["default"].cloneElement(children, {
|
|
76
81
|
id: fieldId,
|
|
77
|
-
'aria-invalid':
|
|
82
|
+
'aria-invalid': !!error,
|
|
78
83
|
'aria-describedby': help ? helpId : undefined
|
|
79
84
|
}) : children;
|
|
80
|
-
if (!
|
|
85
|
+
if (!error) return c;
|
|
81
86
|
return /*#__PURE__*/_react["default"].createElement(_theming.ThemeOverrider, {
|
|
82
87
|
overrides: function overrides(theme) {
|
|
83
88
|
return {
|
|
@@ -85,12 +90,20 @@ var FormItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
85
90
|
};
|
|
86
91
|
}
|
|
87
92
|
}, c);
|
|
88
|
-
}, [children, fieldId, help, helpId
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
if ((0, _firstChildHasType["default"])(children, _Switch["default"])) return /*#__PURE__*/_react["default"].createElement(_SwitchSkeleton["default"], null);
|
|
92
|
-
return /*#__PURE__*/_react["default"].createElement(_InputSkeleton["default"], null);
|
|
93
|
+
}, [children, error, fieldId, help, helpId]);
|
|
94
|
+
var firstTypeIs = (0, _react.useCallback)(function (component) {
|
|
95
|
+
return (0, _firstChildHasType["default"])(children, component);
|
|
93
96
|
}, [children]);
|
|
97
|
+
var skeleton = (0, _react.useMemo)(function () {
|
|
98
|
+
if (firstTypeIs(_Checkbox["default"])) {
|
|
99
|
+
var firstChild = _react["default"].Children.toArray(children)[0];
|
|
100
|
+
return /*#__PURE__*/_react["default"].createElement(_CheckboxSkeleton["default"], null, /*#__PURE__*/_react["default"].isValidElement(firstChild) && firstChild.props.children);
|
|
101
|
+
}
|
|
102
|
+
if (firstTypeIs(_RadioGroup["default"])) return /*#__PURE__*/_react["default"].createElement(_RadioGroupSkeleton["default"], null);
|
|
103
|
+
if (firstTypeIs(_Switch["default"])) return /*#__PURE__*/_react["default"].createElement(_SwitchSkeleton["default"], null);
|
|
104
|
+
if (firstTypeIs(_TextArea["default"])) return /*#__PURE__*/_react["default"].createElement(_TextAreaSkeleton["default"], null);
|
|
105
|
+
return /*#__PURE__*/_react["default"].createElement(_InputSkeleton["default"], null);
|
|
106
|
+
}, [children, firstTypeIs]);
|
|
94
107
|
return /*#__PURE__*/_react["default"].createElement(Container, _extends({
|
|
95
108
|
role: "group",
|
|
96
109
|
id: id
|
|
@@ -98,9 +111,10 @@ var FormItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
98
111
|
ref: ref
|
|
99
112
|
}), label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
100
113
|
htmlFor: fieldId
|
|
101
|
-
}, label, optional && /*#__PURE__*/_react["default"].createElement(Optional, null, "(", optionalText, ")")), loading ?
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
}, label, optional && /*#__PURE__*/_react["default"].createElement(Optional, null, "(", optionalText, ")")), loading ? skeleton : input, error ? /*#__PURE__*/_react["default"].createElement(Error, {
|
|
115
|
+
"aria-live": "polite",
|
|
116
|
+
id: helpId
|
|
117
|
+
}, error) : help && /*#__PURE__*/_react["default"].createElement(Help, {
|
|
104
118
|
id: helpId
|
|
105
119
|
}, help));
|
|
106
120
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Container","styled","omitEmotionProps","sizeStyles","Label","label","p","theme","sizes","small","clr","colorText","Optional","span","formItemColorOptional","
|
|
1
|
+
{"version":3,"file":"index.js","names":["Container","styled","omitEmotionProps","sizeStyles","Label","label","p","theme","sizes","small","clr","colorText","Optional","span","formItemColorOptional","Help","div","formItemColorHelp","Error","formItemColorError","FormItem","forwardRef","ref","help","error","optional","loading","id","children","rest","useContext","FormConfigContext","optionalText","containerId","useMemo","Math","random","toString","slice","fieldId","helpId","input","c","React","isValidElement","cloneElement","undefined","inputColorBorder","firstTypeIs","useCallback","component","firstChildHasType","skeleton","Checkbox","firstChild","Children","toArray","props","RadioGroup","Switch","TextArea","displayName"],"sources":["../../../src/FormItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { sizeStyles, WithSize } from '@os-design/styles';\nimport { clr, ThemeOverrider } from '@os-design/theming';\nimport { omitEmotionProps } from '@os-design/utils';\nimport React, { forwardRef, useCallback, useContext, useMemo } from 'react';\nimport Checkbox from '../Checkbox';\nimport CheckboxSkeleton from '../CheckboxSkeleton';\nimport FormConfigContext from '../Form/FormConfigContext';\nimport InputSkeleton from '../InputSkeleton';\nimport RadioGroup from '../RadioGroup';\nimport RadioGroupSkeleton from '../RadioGroupSkeleton';\nimport Switch from '../Switch';\nimport SwitchSkeleton from '../SwitchSkeleton';\nimport TextArea from '../TextArea';\nimport TextAreaSkeleton from '../TextAreaSkeleton';\nimport firstChildHasType from './utils/firstChildHasType';\n\ntype JsxDivProps = Omit<JSX.IntrinsicElements['div'], 'ref'>;\nexport interface FormItemProps extends JsxDivProps, WithSize {\n /**\n * Label of the field.\n * @default undefined\n */\n label?: string;\n /**\n * The help message located at the bottom of the field.\n * @default undefined\n */\n help?: string;\n /**\n * The error message located at the bottom of the field.\n * If specified, the field has a red border.\n * @default undefined\n */\n error?: string;\n /**\n * Whether the field is optional.\n * @default false\n */\n optional?: boolean;\n /**\n * Whether the skeleton is displayed.\n * @default false\n */\n loading?: boolean;\n}\n\nconst Container = styled('div', omitEmotionProps('size'))<WithSize>`\n ${sizeStyles};\n`;\n\nconst Label = styled.label`\n display: inline-flex;\n align-items: center;\n margin-bottom: 0.4em;\n font-size: ${(p) => p.theme.sizes.small}em;\n color: ${(p) => clr(p.theme.colorText)};\n`;\n\nconst Optional = styled.span`\n color: ${(p) => clr(p.theme.formItemColorOptional)};\n margin-left: 0.3em;\n`;\n\nconst Help = styled.div`\n margin-top: 0.1em;\n font-size: ${(p) => p.theme.sizes.small}em;\n color: ${(p) => clr(p.theme.formItemColorHelp)};\n`;\n\nconst Error = styled(Help)`\n color: ${(p) => clr(p.theme.formItemColorError)};\n`;\n\n/**\n * The wrapper of the field.\n */\nconst FormItem = forwardRef<HTMLDivElement, FormItemProps>(\n (\n {\n label,\n help,\n error,\n optional = false,\n loading = false,\n id,\n children,\n ...rest\n },\n ref\n ) => {\n const { optionalText } = useContext(FormConfigContext);\n\n const containerId = useMemo(\n () => id || Math.random().toString(36).slice(2, 11),\n [id]\n );\n const fieldId = useMemo(() => `field-${containerId}`, [containerId]);\n const helpId = useMemo(() => `help-${containerId}`, [containerId]);\n\n const input = useMemo(() => {\n const c = React.isValidElement(children)\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n React.cloneElement<any>(children, {\n id: fieldId,\n 'aria-invalid': !!error,\n 'aria-describedby': help ? helpId : undefined,\n })\n : children;\n\n if (!error) return c;\n\n return (\n <ThemeOverrider\n overrides={(theme) => ({\n inputColorBorder: theme.formItemColorError,\n })}\n >\n {c}\n </ThemeOverrider>\n );\n }, [children, error, fieldId, help, helpId]);\n\n const firstTypeIs = useCallback(\n (component: React.FC) => firstChildHasType(children, component),\n [children]\n );\n\n const skeleton = useMemo(() => {\n if (firstTypeIs(Checkbox)) {\n const firstChild = React.Children.toArray(children)[0];\n return (\n <CheckboxSkeleton>\n {React.isValidElement(firstChild) && firstChild.props.children}\n </CheckboxSkeleton>\n );\n }\n if (firstTypeIs(RadioGroup)) return <RadioGroupSkeleton />;\n if (firstTypeIs(Switch)) return <SwitchSkeleton />;\n if (firstTypeIs(TextArea)) return <TextAreaSkeleton />;\n return <InputSkeleton />;\n }, [children, firstTypeIs]);\n\n return (\n <Container role='group' id={id} {...rest} ref={ref}>\n {label && (\n <Label htmlFor={fieldId}>\n {label}\n {optional && <Optional>({optionalText})</Optional>}\n </Label>\n )}\n {loading ? skeleton : input}\n {error ? (\n <Error aria-live='polite' id={helpId}>\n {error}\n </Error>\n ) : (\n help && <Help id={helpId}>{help}</Help>\n )}\n </Container>\n );\n }\n);\n\nFormItem.displayName = 'FormItem';\n\nexport default FormItem;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA0D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgC1D,IAAMA,SAAS,GAAG,IAAAC,kBAAM,EAAC,KAAK,EAAE,IAAAC,uBAAgB,EAAC,MAAM,CAAC,CAAC,iFACrDC,kBAAU,CACb;AAED,IAAMC,KAAK,GAAGH,kBAAM,CAACI,KAAK,0LAIX,UAACC,CAAC;EAAA,OAAKA,CAAC,CAACC,KAAK,CAACC,KAAK,CAACC,KAAK;AAAA,GAC9B,UAACH,CAAC;EAAA,OAAK,IAAAI,YAAG,EAACJ,CAAC,CAACC,KAAK,CAACI,SAAS,CAAC;AAAA,EACvC;AAED,IAAMC,QAAQ,GAAGX,kBAAM,CAACY,IAAI,iHACjB,UAACP,CAAC;EAA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8BAAkB,OAAG;IAC1D,IAAIV,WAAW,CAACW,kBAAM,CAAC,EAAE,oBAAO,gCAAC,0BAAc,OAAG;IAClD,IAAIX,WAAW,CAACY,oBAAQ,CAAC,EAAE,oBAAO,gCAAC,4BAAgB,OAAG;IACtD,oBAAO,gCAAC,yBAAa,OAAG;EAC1B,CAAC,EAAE,CAAChC,QAAQ,EAAEoB,WAAW,CAAC,CAAC;EAE3B,oBACE,gCAAC,SAAS;IAAC,IAAI,EAAC,OAAO;IAAC,EAAE,EAAErB;EAAG,GAAKE,IAAI;IAAE,GAAG,EAAEP;EAAI,IAChDjB,KAAK,iBACJ,gCAAC,KAAK;IAAC,OAAO,EAAEkC;EAAQ,GACrBlC,KAAK,EACLoB,QAAQ,iBAAI,gCAAC,QAAQ,aAAGO,YAAY,MAAa,CAErD,EACAN,OAAO,GAAG0B,QAAQ,GAAGX,KAAK,EAC1BjB,KAAK,gBACJ,gCAAC,KAAK;IAAC,aAAU,QAAQ;IAAC,EAAE,EAAEgB;EAAO,GAClChB,KAAK,CACA,GAERD,IAAI,iBAAI,gCAAC,IAAI;IAAC,EAAE,EAAEiB;EAAO,GAAEjB,IAAI,CAChC,CACS;AAEhB,CAAC,CACF;AAEDH,QAAQ,CAACyC,WAAW,GAAG,UAAU;AAAC,eAEnBzC,QAAQ;AAAA"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
import React, { forwardRef, useCallback, useContext, useMemo } from 'react';
|
|
3
2
|
import styled from '@emotion/styled';
|
|
4
3
|
import { sizeStyles } from '@os-design/styles';
|
|
5
|
-
import { omitEmotionProps } from '@os-design/utils';
|
|
6
4
|
import { clr, ThemeOverrider } from '@os-design/theming';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import InputSkeleton from '../InputSkeleton';
|
|
5
|
+
import { omitEmotionProps } from '@os-design/utils';
|
|
6
|
+
import React, { forwardRef, useCallback, useContext, useMemo } from 'react';
|
|
7
|
+
import Checkbox from '../Checkbox';
|
|
8
|
+
import CheckboxSkeleton from '../CheckboxSkeleton';
|
|
12
9
|
import FormConfigContext from '../Form/FormConfigContext';
|
|
10
|
+
import InputSkeleton from '../InputSkeleton';
|
|
11
|
+
import RadioGroup from '../RadioGroup';
|
|
12
|
+
import RadioGroupSkeleton from '../RadioGroupSkeleton';
|
|
13
13
|
import Switch from '../Switch';
|
|
14
14
|
import SwitchSkeleton from '../SwitchSkeleton';
|
|
15
|
+
import TextArea from '../TextArea';
|
|
16
|
+
import TextAreaSkeleton from '../TextAreaSkeleton';
|
|
17
|
+
import firstChildHasType from './utils/firstChildHasType';
|
|
15
18
|
const Container = styled('div', omitEmotionProps('size'))`
|
|
16
19
|
${sizeStyles};
|
|
17
20
|
`;
|
|
@@ -26,14 +29,13 @@ const Optional = styled.span`
|
|
|
26
29
|
color: ${p => clr(p.theme.formItemColorOptional)};
|
|
27
30
|
margin-left: 0.3em;
|
|
28
31
|
`;
|
|
29
|
-
const
|
|
30
|
-
color: ${clr(p.theme.formItemColorError)};
|
|
31
|
-
`;
|
|
32
|
-
const Help = styled('div', omitEmotionProps('hasError'))`
|
|
32
|
+
const Help = styled.div`
|
|
33
33
|
margin-top: 0.1em;
|
|
34
34
|
font-size: ${p => p.theme.sizes.small}em;
|
|
35
35
|
color: ${p => clr(p.theme.formItemColorHelp)};
|
|
36
|
-
|
|
36
|
+
`;
|
|
37
|
+
const Error = styled(Help)`
|
|
38
|
+
color: ${p => clr(p.theme.formItemColorError)};
|
|
37
39
|
`;
|
|
38
40
|
|
|
39
41
|
/**
|
|
@@ -42,8 +44,8 @@ const Help = styled('div', omitEmotionProps('hasError'))`
|
|
|
42
44
|
const FormItem = /*#__PURE__*/forwardRef(({
|
|
43
45
|
label,
|
|
44
46
|
help,
|
|
47
|
+
error,
|
|
45
48
|
optional = false,
|
|
46
|
-
hasError = false,
|
|
47
49
|
loading = false,
|
|
48
50
|
id,
|
|
49
51
|
children,
|
|
@@ -55,24 +57,33 @@ const FormItem = /*#__PURE__*/forwardRef(({
|
|
|
55
57
|
const containerId = useMemo(() => id || Math.random().toString(36).slice(2, 11), [id]);
|
|
56
58
|
const fieldId = useMemo(() => `field-${containerId}`, [containerId]);
|
|
57
59
|
const helpId = useMemo(() => `help-${containerId}`, [containerId]);
|
|
58
|
-
const
|
|
59
|
-
const c = /*#__PURE__*/React.isValidElement(children) ?
|
|
60
|
+
const input = useMemo(() => {
|
|
61
|
+
const c = /*#__PURE__*/React.isValidElement(children) ?
|
|
62
|
+
/*#__PURE__*/
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
React.cloneElement(children, {
|
|
60
65
|
id: fieldId,
|
|
61
|
-
'aria-invalid':
|
|
66
|
+
'aria-invalid': !!error,
|
|
62
67
|
'aria-describedby': help ? helpId : undefined
|
|
63
68
|
}) : children;
|
|
64
|
-
if (!
|
|
69
|
+
if (!error) return c;
|
|
65
70
|
return /*#__PURE__*/React.createElement(ThemeOverrider, {
|
|
66
71
|
overrides: theme => ({
|
|
67
72
|
inputColorBorder: theme.formItemColorError
|
|
68
73
|
})
|
|
69
74
|
}, c);
|
|
70
|
-
}, [children, fieldId, help, helpId
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
if (
|
|
75
|
+
}, [children, error, fieldId, help, helpId]);
|
|
76
|
+
const firstTypeIs = useCallback(component => firstChildHasType(children, component), [children]);
|
|
77
|
+
const skeleton = useMemo(() => {
|
|
78
|
+
if (firstTypeIs(Checkbox)) {
|
|
79
|
+
const firstChild = React.Children.toArray(children)[0];
|
|
80
|
+
return /*#__PURE__*/React.createElement(CheckboxSkeleton, null, /*#__PURE__*/React.isValidElement(firstChild) && firstChild.props.children);
|
|
81
|
+
}
|
|
82
|
+
if (firstTypeIs(RadioGroup)) return /*#__PURE__*/React.createElement(RadioGroupSkeleton, null);
|
|
83
|
+
if (firstTypeIs(Switch)) return /*#__PURE__*/React.createElement(SwitchSkeleton, null);
|
|
84
|
+
if (firstTypeIs(TextArea)) return /*#__PURE__*/React.createElement(TextAreaSkeleton, null);
|
|
74
85
|
return /*#__PURE__*/React.createElement(InputSkeleton, null);
|
|
75
|
-
}, [children]);
|
|
86
|
+
}, [children, firstTypeIs]);
|
|
76
87
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
77
88
|
role: "group",
|
|
78
89
|
id: id
|
|
@@ -80,9 +91,10 @@ const FormItem = /*#__PURE__*/forwardRef(({
|
|
|
80
91
|
ref: ref
|
|
81
92
|
}), label && /*#__PURE__*/React.createElement(Label, {
|
|
82
93
|
htmlFor: fieldId
|
|
83
|
-
}, label, optional && /*#__PURE__*/React.createElement(Optional, null, "(", optionalText, ")")), loading ?
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
}, label, optional && /*#__PURE__*/React.createElement(Optional, null, "(", optionalText, ")")), loading ? skeleton : input, error ? /*#__PURE__*/React.createElement(Error, {
|
|
95
|
+
"aria-live": "polite",
|
|
96
|
+
id: helpId
|
|
97
|
+
}, error) : help && /*#__PURE__*/React.createElement(Help, {
|
|
86
98
|
id: helpId
|
|
87
99
|
}, help));
|
|
88
100
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["styled","sizeStyles","clr","ThemeOverrider","omitEmotionProps","React","forwardRef","useCallback","useContext","useMemo","Checkbox","CheckboxSkeleton","FormConfigContext","InputSkeleton","RadioGroup","RadioGroupSkeleton","Switch","SwitchSkeleton","TextArea","TextAreaSkeleton","firstChildHasType","Container","Label","label","p","theme","sizes","small","colorText","Optional","span","formItemColorOptional","Help","div","formItemColorHelp","Error","formItemColorError","FormItem","help","error","optional","loading","id","children","rest","ref","optionalText","containerId","Math","random","toString","slice","fieldId","helpId","input","c","isValidElement","cloneElement","undefined","inputColorBorder","firstTypeIs","component","skeleton","firstChild","Children","toArray","props","displayName"],"sources":["../../../src/FormItem/index.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { sizeStyles, WithSize } from '@os-design/styles';\nimport { clr, ThemeOverrider } from '@os-design/theming';\nimport { omitEmotionProps } from '@os-design/utils';\nimport React, { forwardRef, useCallback, useContext, useMemo } from 'react';\nimport Checkbox from '../Checkbox';\nimport CheckboxSkeleton from '../CheckboxSkeleton';\nimport FormConfigContext from '../Form/FormConfigContext';\nimport InputSkeleton from '../InputSkeleton';\nimport RadioGroup from '../RadioGroup';\nimport RadioGroupSkeleton from '../RadioGroupSkeleton';\nimport Switch from '../Switch';\nimport SwitchSkeleton from '../SwitchSkeleton';\nimport TextArea from '../TextArea';\nimport TextAreaSkeleton from '../TextAreaSkeleton';\nimport firstChildHasType from './utils/firstChildHasType';\n\ntype JsxDivProps = Omit<JSX.IntrinsicElements['div'], 'ref'>;\nexport interface FormItemProps extends JsxDivProps, WithSize {\n /**\n * Label of the field.\n * @default undefined\n */\n label?: string;\n /**\n * The help message located at the bottom of the field.\n * @default undefined\n */\n help?: string;\n /**\n * The error message located at the bottom of the field.\n * If specified, the field has a red border.\n * @default undefined\n */\n error?: string;\n /**\n * Whether the field is optional.\n * @default false\n */\n optional?: boolean;\n /**\n * Whether the skeleton is displayed.\n * @default false\n */\n loading?: boolean;\n}\n\nconst Container = styled('div', omitEmotionProps('size'))<WithSize>`\n ${sizeStyles};\n`;\n\nconst Label = styled.label`\n display: inline-flex;\n align-items: center;\n margin-bottom: 0.4em;\n font-size: ${(p) => p.theme.sizes.small}em;\n color: ${(p) => clr(p.theme.colorText)};\n`;\n\nconst Optional = styled.span`\n color: ${(p) => clr(p.theme.formItemColorOptional)};\n margin-left: 0.3em;\n`;\n\nconst Help = styled.div`\n margin-top: 0.1em;\n font-size: ${(p) => p.theme.sizes.small}em;\n color: ${(p) => clr(p.theme.formItemColorHelp)};\n`;\n\nconst Error = styled(Help)`\n color: ${(p) => clr(p.theme.formItemColorError)};\n`;\n\n/**\n * The wrapper of the field.\n */\nconst FormItem = forwardRef<HTMLDivElement, FormItemProps>(\n (\n {\n label,\n help,\n error,\n optional = false,\n loading = false,\n id,\n children,\n ...rest\n },\n ref\n ) => {\n const { optionalText } = useContext(FormConfigContext);\n\n const containerId = useMemo(\n () => id || Math.random().toString(36).slice(2, 11),\n [id]\n );\n const fieldId = useMemo(() => `field-${containerId}`, [containerId]);\n const helpId = useMemo(() => `help-${containerId}`, [containerId]);\n\n const input = useMemo(() => {\n const c = React.isValidElement(children)\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n React.cloneElement<any>(children, {\n id: fieldId,\n 'aria-invalid': !!error,\n 'aria-describedby': help ? helpId : undefined,\n })\n : children;\n\n if (!error) return c;\n\n return (\n <ThemeOverrider\n overrides={(theme) => ({\n inputColorBorder: theme.formItemColorError,\n })}\n >\n {c}\n </ThemeOverrider>\n );\n }, [children, error, fieldId, help, helpId]);\n\n const firstTypeIs = useCallback(\n (component: React.FC) => firstChildHasType(children, component),\n [children]\n );\n\n const skeleton = useMemo(() => {\n if (firstTypeIs(Checkbox)) {\n const firstChild = React.Children.toArray(children)[0];\n return (\n <CheckboxSkeleton>\n {React.isValidElement(firstChild) && firstChild.props.children}\n </CheckboxSkeleton>\n );\n }\n if (firstTypeIs(RadioGroup)) return <RadioGroupSkeleton />;\n if (firstTypeIs(Switch)) return <SwitchSkeleton />;\n if (firstTypeIs(TextArea)) return <TextAreaSkeleton />;\n return <InputSkeleton />;\n }, [children, firstTypeIs]);\n\n return (\n <Container role='group' id={id} {...rest} ref={ref}>\n {label && (\n <Label htmlFor={fieldId}>\n {label}\n {optional && <Optional>({optionalText})</Optional>}\n </Label>\n )}\n {loading ? skeleton : input}\n {error ? (\n <Error aria-live='polite' id={helpId}>\n {error}\n </Error>\n ) : (\n help && <Help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;EAAI,IAChDtB,KAAK,iBACJ,oBAAC,KAAK;IAAC,OAAO,EAAE6B;EAAQ,GACrB7B,KAAK,EACLiB,QAAQ,iBAAI,oBAAC,QAAQ,aAAGM,YAAY,MAAa,CAErD,EACAL,OAAO,GAAGqB,QAAQ,GAAGR,KAAK,EAC1Bf,KAAK,gBACJ,oBAAC,KAAK;IAAC,aAAU,QAAQ;IAAC,EAAE,EAAEc;EAAO,GAClCd,KAAK,CACA,GAERD,IAAI,iBAAI,oBAAC,IAAI;IAAC,EAAE,EAAEe;EAAO,GAAEf,IAAI,CAChC,CACS;AAEhB,CAAC,CACF;AAEDD,QAAQ,CAAC8B,WAAW,GAAG,UAAU;AAEjC,eAAe9B,QAAQ"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { WithSize } from '@os-design/styles';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
type JsxDivProps = Omit<JSX.IntrinsicElements['div'], 'ref'>;
|
|
4
4
|
export interface FormItemProps extends JsxDivProps, WithSize {
|
|
5
5
|
label?: string;
|
|
6
6
|
help?: string;
|
|
7
|
+
error?: string;
|
|
7
8
|
optional?: boolean;
|
|
8
|
-
hasError?: boolean;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
}
|
|
11
11
|
declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/FormItem/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/FormItem/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAuD,MAAM,OAAO,CAAC;AAa5E,KAAK,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7D,MAAM,WAAW,aAAc,SAAQ,WAAW,EAAE,QAAQ;IAK1D,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,IAAI,CAAC,EAAE,MAAM,CAAC;IAMd,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,QAAQ,CAAC,EAAE,OAAO,CAAC;IAKnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgCD,QAAA,MAAM,QAAQ,sFAqFb,CAAC;AAIF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.185",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": ">=18",
|
|
59
59
|
"react-dom": ">=18"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "7859a613f18e75724fea40b609aae6a1ff2b3873"
|
|
62
62
|
}
|