@unicom-cloud/ui 0.8.54 → 0.8.55

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/Modal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as t } from "./chunk/qSJXQ1qu.js";
1
+ import { E as t } from "./chunk/CZ8iz63Z.js";
2
2
  export {
3
3
  t as default
4
4
  };
package/Typography.js CHANGED
@@ -53,7 +53,7 @@ import "./Link.js";
53
53
  import "./List.js";
54
54
  import "./Mentions.js";
55
55
  import "./chunk/BC0PujUD.js";
56
- import "./chunk/qSJXQ1qu.js";
56
+ import "./chunk/CZ8iz63Z.js";
57
57
  import "./PageHeader.js";
58
58
  import "./chunk/DG7VgAhL.js";
59
59
  import "./Popconfirm.js";
@@ -1,4 +1,4 @@
1
- import { jsx as i, jsxs as L, Fragment as en } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as L, Fragment as en } from "react/jsx-runtime";
2
2
  import nn from "@unicom-cloud/icons/IconUiClose";
3
3
  import Me from "lodash/isFunction";
4
4
  import tn, { forwardRef as De, useState as D, useImperativeHandle as on, useRef as b, useContext as rn, useCallback as U, useEffect as oe } from "react";
@@ -32,23 +32,23 @@ import Pe from "@unicom-cloud/icons/IconUiExclamationCircleFill";
32
32
  import wn from "@unicom-cloud/icons/IconUiInfoCircleFill";
33
33
  function Tn(n) {
34
34
  const { prefixCls: l, simple: c } = sn();
35
- return /* @__PURE__ */ i(y, { prefixCls: l, simple: c, ...n, children: n.content });
35
+ return /* @__PURE__ */ s(y, { prefixCls: l, simple: c, ...n, children: n.content });
36
36
  }
37
37
  const V = (n) => {
38
38
  let l = n.icon;
39
- if (!l && l !== null && (l = /* @__PURE__ */ i(Pe, {}), n.isNotice))
39
+ if (!l && l !== null && (l = /* @__PURE__ */ s(Pe, {}), n.isNotice))
40
40
  switch (n.noticeType) {
41
41
  case "info":
42
- l = /* @__PURE__ */ i(wn, {});
42
+ l = /* @__PURE__ */ s(wn, {});
43
43
  break;
44
44
  case "success":
45
- l = /* @__PURE__ */ i(En, {});
45
+ l = /* @__PURE__ */ s(En, {});
46
46
  break;
47
47
  case "warning":
48
- l = /* @__PURE__ */ i(Pe, {});
48
+ l = /* @__PURE__ */ s(Pe, {});
49
49
  break;
50
50
  case "error":
51
- l = /* @__PURE__ */ i(Mn, {});
51
+ l = /* @__PURE__ */ s(Mn, {});
52
52
  break;
53
53
  }
54
54
  return n.noticeType === "show" && (l = n.icon), n.isNotice && (n.hideCancel = !0), n.title = l === null && n.title === null ? null : /* @__PURE__ */ L("span", { children: [
@@ -58,12 +58,12 @@ const V = (n) => {
58
58
  };
59
59
  function le(n, l) {
60
60
  let c;
61
- const s = document.createElement("div");
62
- document.body.appendChild(s);
61
+ const i = document.createElement("div");
62
+ document.body.appendChild(i);
63
63
  const f = ln();
64
64
  function g(a) {
65
- const C = /* @__PURE__ */ i($e, { ...f, children: /* @__PURE__ */ i(Tn, { ...a, onCancel: h }) });
66
- c ? c.render(C) : c = xn(C, s);
65
+ const C = /* @__PURE__ */ s($e, { ...f, children: /* @__PURE__ */ s(Tn, { ...a, onCancel: h }) });
66
+ c ? c.render(C) : c = xn(C, i);
67
67
  }
68
68
  const o = g;
69
69
  let r = {
@@ -84,7 +84,7 @@ function le(n, l) {
84
84
  };
85
85
  r.onOk = u, r = V(r), r.visible = !0, o(r);
86
86
  function x() {
87
- c = c == null ? void 0 : c._unmount(), s.parentNode && s.parentNode.removeChild(s);
87
+ c = c == null ? void 0 : c._unmount(), i.parentNode && i.parentNode.removeChild(i);
88
88
  for (let a = 0; a < T.length; a++)
89
89
  if (T[a] === v) {
90
90
  T.splice(a, 1);
@@ -115,13 +115,13 @@ function le(n, l) {
115
115
  };
116
116
  }
117
117
  function Nn(n, l) {
118
- const [c, s] = D(!0), [f, g] = D(n);
118
+ const [c, i] = D(!0), [f, g] = D(n);
119
119
  on(l, () => ({
120
120
  update: (u) => {
121
121
  g(u);
122
122
  },
123
123
  close: () => {
124
- s(!1);
124
+ i(!1);
125
125
  }
126
126
  }));
127
127
  function o() {
@@ -132,7 +132,7 @@ function Nn(n, l) {
132
132
  confirmLoading: !0
133
133
  })), u.then(
134
134
  () => {
135
- s(!1);
135
+ i(!1);
136
136
  },
137
137
  (h) => {
138
138
  console.error(h), g((M) => ({
@@ -140,13 +140,13 @@ function Nn(n, l) {
140
140
  confirmLoading: !1
141
141
  }));
142
142
  }
143
- )), u || s(!1);
143
+ )), u || i(!1);
144
144
  }
145
145
  function r() {
146
146
  var u;
147
- (u = f.onCancel) == null || u.call(f), s(!1);
147
+ (u = f.onCancel) == null || u.call(f), i(!1);
148
148
  }
149
- return /* @__PURE__ */ i(
149
+ return /* @__PURE__ */ s(
150
150
  y,
151
151
  {
152
152
  unmountOnExit: !0,
@@ -161,9 +161,9 @@ function Nn(n, l) {
161
161
  }
162
162
  const Pn = De(Nn);
163
163
  function Dn() {
164
- const n = b(), l = /* @__PURE__ */ i(an, { ref: n });
164
+ const n = b(), l = /* @__PURE__ */ s(an, { ref: n });
165
165
  let c = 0;
166
- function s(o) {
166
+ function i(o) {
167
167
  var C;
168
168
  c += 1;
169
169
  let r, u = { ...o };
@@ -171,7 +171,7 @@ function Dn() {
171
171
  var p;
172
172
  (p = o.afterClose) == null || p.call(o), M();
173
173
  }
174
- const h = /* @__PURE__ */ i(
174
+ const h = /* @__PURE__ */ s(
175
175
  Pn,
176
176
  {
177
177
  ref: (p) => {
@@ -202,7 +202,7 @@ function Dn() {
202
202
  };
203
203
  }
204
204
  function f(o) {
205
- return s({
205
+ return i({
206
206
  ...o
207
207
  });
208
208
  }
@@ -212,7 +212,7 @@ function Dn() {
212
212
  // 潘启宝添加于 2023年10月18日 星期三 10时31分58秒 CST
213
213
  };
214
214
  return ["info", "success", "warning", "error"].forEach((o) => {
215
- g[o] = (r) => s({
215
+ g[o] = (r) => i({
216
216
  ...r,
217
217
  isNotice: !0,
218
218
  noticeType: o
@@ -243,7 +243,7 @@ const In = {
243
243
  function On(n, l) {
244
244
  var Ee;
245
245
  l || (l = b());
246
- const c = rn(un), s = bn(
246
+ const c = rn(un), i = bn(
247
247
  n,
248
248
  In,
249
249
  (Ee = c.componentConfig) == null ? void 0 : Ee.Modal
@@ -270,30 +270,30 @@ function On(n, l) {
270
270
  maskClosable: Re,
271
271
  mask: S,
272
272
  alignCenter: Le,
273
- getChildrenPopupContainer: se,
273
+ getChildrenPopupContainer: ie,
274
274
  wrapClassName: He,
275
275
  escToExit: j,
276
- modalRender: ie,
276
+ modalRender: se,
277
277
  maskStyle: Se,
278
278
  wrapStyle: Xe,
279
279
  closeIcon: ae,
280
280
  fullscreenable: Rn,
281
281
  ...ce
282
- } = s, $ = b(null), ue = b(null), k = b(null), [de, me] = D(), [fe, Ye] = D(), X = b(null), I = b(!1), [Be, pe] = D(""), [Ce, he] = D(""), A = b(!0);
282
+ } = i, $ = b(null), ue = b(null), k = b(null), [de, me] = D(), [fe, Ye] = D(), X = b(null), I = b(!1), [Be, pe] = D(""), [Ce, he] = D(""), A = b(!0);
283
283
  o && A.current && (A.current = !1);
284
284
  const Y = b();
285
285
  Y.current || (Y.current = $n++);
286
286
  const [Fe, K] = mn(!1, {
287
287
  defaultValue: !1,
288
288
  value: Ie
289
- }), d = c.getPrefixCls("modal", s.prefixCls), { locale: G, rtl: be } = c, Ue = !r || ce.noticeType === "show", Ve = "closable" in s ? s.closable : Ue, ze = U(() => vn(p()), [p]);
289
+ }), d = c.getPrefixCls("modal", i.prefixCls), { locale: G, rtl: be } = c, Ue = !r || ce.noticeType === "show", Ve = "closable" in i ? i.closable : Ue, ze = U(() => vn(p()), [p]);
290
290
  gn(ze, { hidden: o && S });
291
291
  function J(e) {
292
292
  e.stopPropagation(), Q();
293
293
  }
294
294
  function Q() {
295
295
  var e;
296
- (e = s.onCancel) == null || e.call(s);
296
+ (e = i.onCancel) == null || e.call(i);
297
297
  }
298
298
  const qe = (e) => {
299
299
  j && o && e.key === fn.key && (e.stopPropagation(), Q());
@@ -303,7 +303,7 @@ function On(n, l) {
303
303
  }, 100));
304
304
  }, Ze = (e) => {
305
305
  var m;
306
- const t = (m = s.onOk ?? s.onConfirm) == null ? void 0 : m(e);
306
+ const t = (m = i.onOk ?? i.onConfirm) == null ? void 0 : m(e);
307
307
  t != null && t.then && (K(!0), t.then(
308
308
  () => {
309
309
  K(!1);
@@ -314,16 +314,17 @@ function On(n, l) {
314
314
  ));
315
315
  };
316
316
  hn(() => {
317
- if (!s.hidePreviousModal || !(l != null && l.current))
317
+ if (!(l != null && l.current))
318
318
  return;
319
319
  const e = w.indexOf(l.current);
320
320
  if (e !== -1 && w.splice(e, 1), o) {
321
- for (const m of w)
322
- m instanceof HTMLElement && m.style instanceof CSSStyleDeclaration && m.style.setProperty("display", "none");
321
+ if (i.hidePreviousModal)
322
+ for (const m of w)
323
+ m instanceof HTMLElement && m.style instanceof CSSStyleDeclaration && m.style.setProperty("display", "none");
323
324
  w.push(l.current);
324
325
  }
325
- const t = w.at(w.length - 1);
326
- return t instanceof HTMLElement && t.style instanceof CSSStyleDeclaration && t.style.removeProperty("display"), () => {
326
+ const t = w[w.length - 1];
327
+ return t && t instanceof HTMLElement && t.style instanceof CSSStyleDeclaration && t.style.removeProperty("display"), () => {
327
328
  };
328
329
  }, [o, l == null ? void 0 : l.current]), oe(() => {
329
330
  let e = null;
@@ -342,7 +343,7 @@ function On(n, l) {
342
343
  }
343
344
  }, Ae = () => {
344
345
  if (H === null) return;
345
- const e = /* @__PURE__ */ i(we, { onClick: J, ...C, children: M || G.Modal.cancelText }), t = /* @__PURE__ */ i(
346
+ const e = /* @__PURE__ */ s(we, { onClick: J, ...C, children: M || G.Modal.cancelText }), t = /* @__PURE__ */ s(
346
347
  we,
347
348
  {
348
349
  loading: Fe,
@@ -355,7 +356,7 @@ function On(n, l) {
355
356
  !Oe && e,
356
357
  t
357
358
  ] });
358
- return /* @__PURE__ */ i("div", { className: `${d}-footer`, children: m });
359
+ return /* @__PURE__ */ s("div", { className: `${d}-footer`, children: m });
359
360
  }, ee = b(
360
361
  ve()
361
362
  ), Ke = U((e) => {
@@ -416,13 +417,13 @@ function On(n, l) {
416
417
  $e,
417
418
  {
418
419
  ...c,
419
- prefixCls: s.prefixCls || c.prefixCls,
420
+ prefixCls: i.prefixCls || c.prefixCls,
420
421
  locale: G,
421
422
  zIndex: fe || 1050,
422
- getPopupContainer: (e) => typeof se == "function" ? se(e) : ue.current,
423
+ getPopupContainer: (e) => typeof ie == "function" ? ie(e) : ue.current,
423
424
  children: [
424
425
  (!!u || !!x) && /* @__PURE__ */ L("div", { className: `${d}-header`, children: [
425
- !!u && /* @__PURE__ */ i(
426
+ !!u && /* @__PURE__ */ s(
426
427
  "div",
427
428
  {
428
429
  className: `${d}-title`,
@@ -430,11 +431,11 @@ function On(n, l) {
430
431
  children: u
431
432
  }
432
433
  ),
433
- !!x && /* @__PURE__ */ i("div", { className: `${d}-subtitle`, children: x })
434
+ !!x && /* @__PURE__ */ s("div", { className: `${d}-subtitle`, children: x })
434
435
  ] }),
435
- /* @__PURE__ */ i("div", { ref: ue, className: `${d}-content`, children: h }),
436
+ /* @__PURE__ */ s("div", { ref: ue, className: `${d}-content`, children: h }),
436
437
  Ae(),
437
- !s.fullscreenable && s.draggable !== !1 && /* @__PURE__ */ i(
438
+ !i.fullscreenable && i.draggable !== !1 && /* @__PURE__ */ s(
438
439
  "div",
439
440
  {
440
441
  className: `${d}-drag-icon`,
@@ -442,14 +443,14 @@ function On(n, l) {
442
443
  onDoubleClick: ne
443
444
  }
444
445
  ),
445
- (Ve || !!s.fullscreenable) && (ae !== void 0 ? /* @__PURE__ */ i(
446
+ (Ve || !!i.fullscreenable) && (ae !== void 0 ? /* @__PURE__ */ s(
446
447
  "span",
447
448
  {
448
449
  className: `${d}-close-icon`,
449
450
  onClick: J,
450
451
  children: ae
451
452
  }
452
- ) : /* @__PURE__ */ i(
453
+ ) : /* @__PURE__ */ s(
453
454
  dn,
454
455
  {
455
456
  tabIndex: -1,
@@ -457,12 +458,12 @@ function On(n, l) {
457
458
  onClick: J,
458
459
  role: "button",
459
460
  "aria-label": "Close",
460
- children: /* @__PURE__ */ i(nn, {})
461
+ children: /* @__PURE__ */ s(nn, {})
461
462
  }
462
463
  ))
463
464
  ]
464
465
  }
465
- ), Qe = u ? { "aria-labelledby": `pqb-dialog-${Y.current}` } : {}, ke = /* @__PURE__ */ i(
466
+ ), Qe = u ? { "aria-labelledby": `pqb-dialog-${Y.current}` } : {}, ke = /* @__PURE__ */ s(
466
467
  "div",
467
468
  {
468
469
  role: "dialog",
@@ -473,7 +474,7 @@ function On(n, l) {
473
474
  {
474
475
  [`${d}-simple`]: r,
475
476
  [`${d}-rtl`]: be,
476
- [`${d}-fullscreenable`]: s.fullscreenable
477
+ [`${d}-fullscreenable`]: i.fullscreenable
477
478
  },
478
479
  f
479
480
  ),
@@ -495,7 +496,7 @@ function On(n, l) {
495
496
  }
496
497
  he(t);
497
498
  }, ye = A.current ? !q : !!k.current;
498
- return o || ye ? /* @__PURE__ */ i(
499
+ return o || ye ? /* @__PURE__ */ s(
499
500
  kn,
500
501
  {
501
502
  visible: o,
@@ -507,7 +508,7 @@ function On(n, l) {
507
508
  ref: l,
508
509
  className: `${d}-container`,
509
510
  children: [
510
- S ? /* @__PURE__ */ i(
511
+ S ? /* @__PURE__ */ s(
511
512
  Te,
512
513
  {
513
514
  in: o,
@@ -522,7 +523,7 @@ function On(n, l) {
522
523
  onExited: (e) => {
523
524
  e && (e.style.display = "none");
524
525
  },
525
- children: /* @__PURE__ */ i(
526
+ children: /* @__PURE__ */ s(
526
527
  "div",
527
528
  {
528
529
  "aria-hidden": !0,
@@ -532,7 +533,7 @@ function On(n, l) {
532
533
  )
533
534
  }
534
535
  ) : null,
535
- /* @__PURE__ */ i(
536
+ /* @__PURE__ */ s(
536
537
  "div",
537
538
  {
538
539
  ...yn(ce, [
@@ -571,7 +572,7 @@ function On(n, l) {
571
572
  I.current = e.target === e.currentTarget;
572
573
  },
573
574
  onClick: We,
574
- children: /* @__PURE__ */ i(
575
+ children: /* @__PURE__ */ s(
575
576
  Te,
576
577
  {
577
578
  in: o,
@@ -593,7 +594,7 @@ function On(n, l) {
593
594
  e && (me(!1), te(e), z == null || z(), _.current = !1, W && (k.current = null));
594
595
  },
595
596
  children: tn.cloneElement(
596
- Me(ie) ? ie(ke) : ke,
597
+ Me(se) ? se(ke) : ke,
597
598
  {
598
599
  onMouseDown: () => {
599
600
  I.current = !1;
package/index.js CHANGED
@@ -160,7 +160,7 @@ import { default as Cs } from "./Link.js";
160
160
  import { default as Ts } from "./List.js";
161
161
  import { default as Ms } from "./Mentions.js";
162
162
  import { M as Es } from "./chunk/BC0PujUD.js";
163
- import { E as hs } from "./chunk/qSJXQ1qu.js";
163
+ import { E as hs } from "./chunk/CZ8iz63Z.js";
164
164
  import { default as Is } from "./PageHeader.js";
165
165
  import { P as ks } from "./chunk/DG7VgAhL.js";
166
166
  import { default as Ds } from "./Popconfirm.js";
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.54","dependencies":{"@unicom-cloud/icons":"latest","@unicom-cloud/utils":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"main":"index.js","module":"index.js","type":"module","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui","version":"0.8.55","dependencies":{"@unicom-cloud/icons":"latest","@unicom-cloud/utils":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"main":"index.js","module":"index.js","type":"module","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
@@ -8,4 +8,4 @@ export type ModalConfigType = {
8
8
  export declare const setModalConfig: (config: ModalConfigType) => void;
9
9
  export declare const getModalConfig: () => ModalConfigType;
10
10
  export declare const destroyList: Array<Function>;
11
- export declare const showList: Array<Element>;
11
+ export declare const showList: Array<HTMLElement>;