@infomaximum/ui-kit 0.14.3 → 0.14.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.
- package/dist/components/ContextIsolator/ContextIsolator.d.ts +3 -0
- package/dist/components/ContextIsolator/ContextIsolator.js +20 -0
- package/dist/components/ContextIsolator/ContextIsolator.types.d.ts +4 -0
- package/dist/components/ContextIsolator/index.d.ts +1 -0
- package/dist/components/Form/components/FormItemContextIsolator/FormItemContextIsolator.d.ts +3 -0
- package/dist/components/Form/components/FormItemContextIsolator/FormItemContextIsolator.js +21 -0
- package/dist/components/Form/components/FormItemContextIsolator/FormItemContextIsolator.types.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { FormItemContextIsolator } from "../Form/components/FormItemContextIsolator/FormItemContextIsolator.js";
|
|
3
|
+
const ContextIsolatorComponent = (props) => {
|
|
4
|
+
const {
|
|
5
|
+
formItem,
|
|
6
|
+
children
|
|
7
|
+
} = props;
|
|
8
|
+
if (!children) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
11
|
+
let result = children;
|
|
12
|
+
if (formItem) {
|
|
13
|
+
result = /* @__PURE__ */ jsx(FormItemContextIsolator, { children: result });
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
const ContextIsolator = ContextIsolatorComponent;
|
|
18
|
+
export {
|
|
19
|
+
ContextIsolator
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ContextIsolator } from './ContextIsolator';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from "react";
|
|
3
|
+
import { FormItemContext } from "../FormItem/contexts/FormItemContext.js";
|
|
4
|
+
const FormItemContextIsolatorComponent = (props) => {
|
|
5
|
+
const {
|
|
6
|
+
children
|
|
7
|
+
} = props;
|
|
8
|
+
const contextValue = useContext(FormItemContext);
|
|
9
|
+
const isolatedContextValue = useMemo(() => {
|
|
10
|
+
const newContextValue = {
|
|
11
|
+
...contextValue
|
|
12
|
+
};
|
|
13
|
+
delete newContextValue.status;
|
|
14
|
+
return newContextValue;
|
|
15
|
+
}, [contextValue]);
|
|
16
|
+
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: isolatedContextValue, children });
|
|
17
|
+
};
|
|
18
|
+
const FormItemContextIsolator = FormItemContextIsolatorComponent;
|
|
19
|
+
export {
|
|
20
|
+
FormItemContextIsolator
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -47,4 +47,5 @@ export { TreeSelect } from './components/TreeSelect';
|
|
|
47
47
|
export type { TreeSelectProps } from './components/TreeSelect';
|
|
48
48
|
export { type EmptyProps, Empty } from './components/Empty';
|
|
49
49
|
export { type SegmentedProps, type SegmentedLabeledOption, Segmented, } from './components/Segmented';
|
|
50
|
+
export { ContextIsolator } from './components/ContextIsolator';
|
|
50
51
|
export * from 'react-intersection-observer/test-utils';
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ import { Popconfirm } from "./components/Popconfirm/Popconfirm.js";
|
|
|
35
35
|
import { TreeSelect } from "./components/TreeSelect/TreeSelect.js";
|
|
36
36
|
import { Empty } from "./components/Empty/Empty.js";
|
|
37
37
|
import { Segmented } from "./components/Segmented/Segmented.js";
|
|
38
|
+
import { ContextIsolator } from "./components/ContextIsolator/ContextIsolator.js";
|
|
38
39
|
export {
|
|
39
40
|
Alert,
|
|
40
41
|
Avatar,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
Button,
|
|
43
44
|
Checkbox,
|
|
44
45
|
ConfigProvider,
|
|
46
|
+
ContextIsolator,
|
|
45
47
|
DatePicker,
|
|
46
48
|
Dropdown,
|
|
47
49
|
Empty,
|