@iress-oss/ids-components 6.4.4 → 6.4.6
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/.ai/components/icon.md
CHANGED
|
@@ -46,6 +46,10 @@ For more simpler applications, or if you need to customise the icon provider ind
|
|
|
46
46
|
|
|
47
47
|
> **Note:** If you are already using `IressProvider` or `IressShadow`, you do not need to add `IressIconProvider` separately — it is already included.
|
|
48
48
|
|
|
49
|
+
With automatic loading, icons remain hidden while their font is loading or if
|
|
50
|
+
the download fails. Their space is reserved so icon names do not appear as text
|
|
51
|
+
or overlap nearby content.
|
|
52
|
+
|
|
49
53
|
```tsx
|
|
50
54
|
const [showMoreIcons, setShowMoreIcons] = useState(false);
|
|
51
55
|
const [showEvenMore, setShowEvenMore] = useState(false);
|
|
@@ -29,16 +29,15 @@ var o = (e, t, n) => {
|
|
|
29
29
|
C,
|
|
30
30
|
h
|
|
31
31
|
]), T = n((e) => {
|
|
32
|
-
t(`[useDynamicFontSubsetting] Failed to load font "${p}" for icons: ${e.join(", ")}. Icons will
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
t(`[useDynamicFontSubsetting] Failed to load font "${p}" for icons: ${e.join(", ")}. Icons will remain hidden until the font loads.`);
|
|
33
|
+
}, [p]), E = n((e, t) => {
|
|
34
|
+
"fonts" in document && document.fonts.load(`24px "${p}"`).then((n) => {
|
|
35
|
+
n.length > 0 && w(e, t);
|
|
36
|
+
}).catch(() => T(t));
|
|
37
37
|
}, [
|
|
38
38
|
p,
|
|
39
39
|
w,
|
|
40
|
-
T
|
|
41
|
-
S
|
|
40
|
+
T
|
|
42
41
|
]);
|
|
43
42
|
return r(() => () => {
|
|
44
43
|
document.querySelectorAll(`link[data-${f}="${x.current}"]`).forEach((e) => e.parentNode?.removeChild(e));
|
|
@@ -54,22 +54,22 @@ var g = ({ children: t, displayMode: n, id: r, observerTarget: a, style: s, virt
|
|
|
54
54
|
};
|
|
55
55
|
g.displayName = "PopoverContentInner";
|
|
56
56
|
var _ = ({ container: e, ...n }) => {
|
|
57
|
-
let i = r(), { container: a } = u(), o = e === void 0 ?
|
|
57
|
+
let i = r(), { container: a } = u(), o = n.displayMode === "inline" ? void 0 : a, c = e === void 0 ? o : e, [l, f] = m();
|
|
58
58
|
return d(() => {
|
|
59
|
-
if (!
|
|
60
|
-
|
|
59
|
+
if (!c) {
|
|
60
|
+
f(void 0);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
let e = "current" in
|
|
64
|
-
|
|
65
|
-
}, [
|
|
63
|
+
let e = "current" in c ? c.current ?? void 0 : c ?? void 0;
|
|
64
|
+
f(e);
|
|
65
|
+
}, [c]), c ? /* @__PURE__ */ h(t, {
|
|
66
66
|
id: i,
|
|
67
67
|
children: /* @__PURE__ */ h(s, {
|
|
68
|
-
root:
|
|
68
|
+
root: c,
|
|
69
69
|
preserveTabOrder: !0,
|
|
70
70
|
children: /* @__PURE__ */ h(g, {
|
|
71
71
|
...n,
|
|
72
|
-
observerTarget:
|
|
72
|
+
observerTarget: l
|
|
73
73
|
})
|
|
74
74
|
})
|
|
75
75
|
}) : /* @__PURE__ */ h(t, {
|
|
@@ -11,22 +11,30 @@ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
|
11
11
|
var g = (e) => {
|
|
12
12
|
let [t, n] = f({}), r = d({}), i = c(a), o = d(null);
|
|
13
13
|
return u(() => {
|
|
14
|
-
let e = i?.hover
|
|
15
|
-
|
|
16
|
-
let t = o.current.parentElement;
|
|
17
|
-
if (t) {
|
|
14
|
+
let e = i?.hover, t = o.current?.parentElement, a = () => {
|
|
15
|
+
if (e && t) {
|
|
18
16
|
let i = t.getBoundingClientRect(), a = e.getBoundingClientRect(), o = {
|
|
19
17
|
opacity: 1,
|
|
20
18
|
left: `${a.left - i.left + t.scrollLeft}px`,
|
|
21
19
|
width: `${a.width}px`
|
|
22
20
|
};
|
|
23
21
|
n(o), r.current = o;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
22
|
+
} else n({
|
|
23
|
+
...r.current,
|
|
24
|
+
opacity: 0
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
a();
|
|
28
|
+
let s;
|
|
29
|
+
if (e && t && typeof ResizeObserver < "u") {
|
|
30
|
+
s = new ResizeObserver(a);
|
|
31
|
+
let e = s;
|
|
32
|
+
e.observe(t), t.querySelectorAll("[role=\"tab\"]").forEach((t) => e.observe(t));
|
|
33
|
+
}
|
|
34
|
+
return () => {
|
|
35
|
+
s?.disconnect();
|
|
36
|
+
};
|
|
37
|
+
}, [i?.hover, i?.layoutVersion]), /* @__PURE__ */ m("div", {
|
|
30
38
|
...e,
|
|
31
39
|
ref: o,
|
|
32
40
|
style: t
|