@ant-design/icons 5.5.2 → 5.6.1
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/index.umd.js +3555 -3518
- package/dist/index.umd.min.js +1 -1
- package/es/components/Context.d.ts +1 -0
- package/es/utils.d.ts +1 -1
- package/es/utils.js +6 -2
- package/lib/components/Context.d.ts +1 -0
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +6 -2
- package/package.json +1 -1
package/es/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import type { CSSProperties, MouseEventHandler, MutableRefObject, ReactNode } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export declare function warning(valid: boolean, message: string): void;
|
|
5
5
|
export declare function isIconDefinition(target: any): target is IconDefinition;
|
|
6
6
|
export declare function normalizeAttrs(attrs?: Attrs): Attrs;
|
package/es/utils.js
CHANGED
|
@@ -71,16 +71,20 @@ export var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: c
|
|
|
71
71
|
export var useInsertStyles = function useInsertStyles(eleRef) {
|
|
72
72
|
var _useContext = useContext(IconContext),
|
|
73
73
|
csp = _useContext.csp,
|
|
74
|
-
prefixCls = _useContext.prefixCls
|
|
74
|
+
prefixCls = _useContext.prefixCls,
|
|
75
|
+
layer = _useContext.layer;
|
|
75
76
|
var mergedStyleStr = iconStyles;
|
|
76
77
|
if (prefixCls) {
|
|
77
78
|
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
|
|
78
79
|
}
|
|
80
|
+
if (layer) {
|
|
81
|
+
mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
|
|
82
|
+
}
|
|
79
83
|
useEffect(function () {
|
|
80
84
|
var ele = eleRef.current;
|
|
81
85
|
var shadowRoot = getShadowRoot(ele);
|
|
82
86
|
updateCSS(mergedStyleStr, '@ant-design-icons', {
|
|
83
|
-
prepend:
|
|
87
|
+
prepend: !layer,
|
|
84
88
|
csp: csp,
|
|
85
89
|
attachTo: shadowRoot
|
|
86
90
|
});
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbstractNode, IconDefinition } from '@ant-design/icons-svg/lib/types';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import type { CSSProperties, MouseEventHandler, MutableRefObject, ReactNode } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export declare function warning(valid: boolean, message: string): void;
|
|
5
5
|
export declare function isIconDefinition(target: any): target is IconDefinition;
|
|
6
6
|
export declare function normalizeAttrs(attrs?: Attrs): Attrs;
|
package/lib/utils.js
CHANGED
|
@@ -86,16 +86,20 @@ var iconStyles = exports.iconStyles = "\n.anticon {\n display: inline-flex;\n
|
|
|
86
86
|
var useInsertStyles = exports.useInsertStyles = function useInsertStyles(eleRef) {
|
|
87
87
|
var _useContext = (0, _react.useContext)(_Context.default),
|
|
88
88
|
csp = _useContext.csp,
|
|
89
|
-
prefixCls = _useContext.prefixCls
|
|
89
|
+
prefixCls = _useContext.prefixCls,
|
|
90
|
+
layer = _useContext.layer;
|
|
90
91
|
var mergedStyleStr = iconStyles;
|
|
91
92
|
if (prefixCls) {
|
|
92
93
|
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
|
|
93
94
|
}
|
|
95
|
+
if (layer) {
|
|
96
|
+
mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
|
|
97
|
+
}
|
|
94
98
|
(0, _react.useEffect)(function () {
|
|
95
99
|
var ele = eleRef.current;
|
|
96
100
|
var shadowRoot = (0, _shadow.getShadowRoot)(ele);
|
|
97
101
|
(0, _dynamicCSS.updateCSS)(mergedStyleStr, '@ant-design-icons', {
|
|
98
|
-
prepend:
|
|
102
|
+
prepend: !layer,
|
|
99
103
|
csp: csp,
|
|
100
104
|
attachTo: shadowRoot
|
|
101
105
|
});
|