litos-ui 0.15.6 → 0.15.7

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.
Files changed (81) hide show
  1. package/lib/button/index.d.ts +4 -0
  2. package/lib/button/index.js +84 -57
  3. package/lib/check/checkbox.js +1 -1
  4. package/lib/check/radio.js +1 -1
  5. package/lib/{check-BlDsQQo0.js → check-A86JxUfd.js} +1 -1
  6. package/lib/collapse/index.d.ts +19 -0
  7. package/lib/collapse/index.js +88 -0
  8. package/lib/collapse/item.d.ts +15 -0
  9. package/lib/collapse/item.js +115 -0
  10. package/lib/color_picker/index.js +1 -1
  11. package/lib/date_picker/index.js +1 -1
  12. package/lib/description_panel/index.d.ts +4 -4
  13. package/lib/description_panel/index.js +59 -11
  14. package/lib/dialog/dialog_container.js +1 -1
  15. package/lib/form/form_inner.d.ts +2 -1
  16. package/lib/form/form_inner.js +16 -15
  17. package/lib/form/form_item.js +9 -9
  18. package/lib/icon/d_arrow_left.d.ts +6 -0
  19. package/lib/icon/d_arrow_left.js +13 -0
  20. package/lib/icon/d_arrow_right.d.ts +6 -0
  21. package/lib/icon/d_arrow_right.js +13 -0
  22. package/lib/icon/more.d.ts +6 -0
  23. package/lib/icon/more.js +13 -0
  24. package/lib/icon/select.d.ts +6 -0
  25. package/lib/icon/select.js +13 -0
  26. package/lib/icon/zoom_in.d.ts +6 -0
  27. package/lib/icon/zoom_in.js +13 -0
  28. package/lib/icon/zoom_out.d.ts +6 -0
  29. package/lib/icon/zoom_out.js +13 -0
  30. package/lib/image/image_preview.d.ts +24 -0
  31. package/lib/image/image_preview.js +104 -0
  32. package/lib/image/index.d.ts +50 -0
  33. package/lib/image/index.js +176 -0
  34. package/lib/index-D4II9KsF.js +4 -0
  35. package/lib/index.d.ts +36 -4
  36. package/lib/index.js +157 -120
  37. package/lib/input/index.d.ts +4 -0
  38. package/lib/input/index.js +75 -64
  39. package/lib/litos-ui.css +1 -1
  40. package/lib/mask/index.d.ts +23 -0
  41. package/lib/mask/index.js +110 -0
  42. package/lib/md_input/index.js +11 -11
  43. package/lib/modal/index.d.ts +1 -1
  44. package/lib/modal/index.js +7 -7
  45. package/lib/modal/modal_box.js +10 -10
  46. package/lib/page_header/index.d.ts +20 -0
  47. package/lib/page_header/index.js +109 -0
  48. package/lib/pagination/index.d.ts +27 -0
  49. package/lib/pagination/index.js +248 -0
  50. package/lib/qrcode/index.js +4 -4
  51. package/lib/select/index.d.ts +79 -0
  52. package/lib/select/index.js +406 -0
  53. package/lib/select_ori/index.js +1 -1
  54. package/lib/switch/index.js +4 -4
  55. package/lib/tabbar/index.js +1 -1
  56. package/lib/tabbar/item.js +1 -1
  57. package/lib/table/index.d.ts +46 -0
  58. package/lib/table/index.js +200 -0
  59. package/lib/table/types.d.ts +28 -0
  60. package/lib/table/types.js +1 -0
  61. package/lib/tabs/index.d.ts +7 -0
  62. package/lib/tabs/index.js +43 -0
  63. package/lib/tag/index.d.ts +16 -0
  64. package/lib/tag/index.js +77 -0
  65. package/lib/theme/index.js +6 -6
  66. package/lib/utils/index.d.ts +6 -28
  67. package/lib/utils/index.js +61 -86
  68. package/lib/utils/popover.d.ts +137 -0
  69. package/lib/utils/popover.js +354 -0
  70. package/lib/utils/transition.js +26 -50
  71. package/package.json +13 -13
  72. package/styles/popover.css +66 -0
  73. package/styles/reset.css +1 -1
  74. package/styles/select.css +37 -0
  75. package/styles/tabs.css +13 -0
  76. package/styles/vars.css +2 -1
  77. package/lib/index-dwS1N2uN.js +0 -4
  78. package/lib/popconfirm/index.d.ts +0 -7
  79. package/lib/popconfirm/index.js +0 -30
  80. package/lib/popover/index.d.ts +0 -34
  81. package/lib/popover/index.js +0 -150
@@ -0,0 +1,23 @@
1
+ import BaseComponent from "../base";
2
+ export default class Mask extends BaseComponent {
3
+ #private;
4
+ static baseName: string;
5
+ zIndex: number;
6
+ /** 是否可以通过点击 mask 关闭对话框 */
7
+ maskClosable: boolean;
8
+ /** 是否在打开时禁用 body 滚动 */
9
+ lockScroll: boolean;
10
+ get open(): boolean;
11
+ set open(value: boolean);
12
+ static customAttributes: string[];
13
+ static get observedAttributes(): string[];
14
+ connectedCallback(): void;
15
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
16
+ render(): DocumentFragment;
17
+ contentRender(): string | HTMLElement | DocumentFragment;
18
+ afterInit(): void;
19
+ beforeDestroy(): void;
20
+ afterOpened(): void;
21
+ afterClosed(): void;
22
+ onAction(action: string): boolean;
23
+ }
@@ -0,0 +1,110 @@
1
+ import a from "../base.js";
2
+ import { kebabToCamel as r, parseAttrValue as c } from "../utils/index.js";
3
+ import { $$ as n, addClass as d, $one as i, transition as l, hasClass as p, removeClass as h, on as f, off as m, shouldEventNext as k } from "ph-utils/dom";
4
+ const u = ":host{display:none;position:relative}:host(.open){display:block}.l-mask,.l-panel{position:fixed;inset:0;opacity:1}.l-mask{background-color:#00000080;z-index:var(--l-mask-zindex, 100)}.l-panel{z-index:calc(var(--l-mask-zindex, 100) + 1);color:#fff}";
5
+ class x extends a {
6
+ static baseName = "mask";
7
+ #t = !1;
8
+ zIndex = 100;
9
+ /** 是否可以通过点击 mask 关闭对话框 */
10
+ maskClosable = !0;
11
+ /** 是否在打开时禁用 body 滚动 */
12
+ lockScroll = !0;
13
+ #e = "";
14
+ get open() {
15
+ return this.#t;
16
+ }
17
+ set open(t) {
18
+ this.#t = t, this.rendered && this.#s();
19
+ }
20
+ static customAttributes = [];
21
+ static get observedAttributes() {
22
+ return [
23
+ "open",
24
+ "z-index",
25
+ "mask-closable",
26
+ "lock-scroll",
27
+ ...this.customAttributes
28
+ ];
29
+ }
30
+ connectedCallback() {
31
+ this.loadStyleText(u), super.connectedCallback();
32
+ }
33
+ attributeChangedCallback(t, e, s) {
34
+ t = r(t);
35
+ const o = c(
36
+ s,
37
+ this[t],
38
+ t
39
+ );
40
+ if (o !== this[t])
41
+ switch (this[t] = o, t) {
42
+ case "zIndex":
43
+ o === 100 ? this.style.removeProperty("--l-mask-zindex") : this.style.setProperty("--l-mask-zindex", o);
44
+ break;
45
+ }
46
+ }
47
+ render() {
48
+ const t = document.createDocumentFragment(), e = n("div", {
49
+ class: "l-mask",
50
+ part: "mask"
51
+ });
52
+ t.appendChild(e);
53
+ const s = n("div", {
54
+ class: "l-panel",
55
+ part: "panel"
56
+ }), o = this.contentRender();
57
+ return typeof o == "string" ? s.innerHTML = o : s.appendChild(o), t.appendChild(s), t;
58
+ }
59
+ contentRender() {
60
+ return "<slot></slot>";
61
+ }
62
+ #s() {
63
+ if (this.open) {
64
+ this.lockScroll && (this.#e = getComputedStyle(document.body).overflow, document.body.style.overflow = "hidden"), d(this, "open");
65
+ const t = i(".l-mask", this.root);
66
+ t && l(t, [["opacity", "0", "0.3s"]], "enter");
67
+ const e = i(".l-panel", this.root);
68
+ e && l(e, [["opacity", "0", "0.3s"]], "enter"), this.afterOpened();
69
+ } else if (p(this, "open")) {
70
+ this.emit("close");
71
+ const t = i(".l-panel", this.root);
72
+ t && l(t, [["opacity", "0", "0.3s"]], "leave");
73
+ const e = i(".l-mask", this.root);
74
+ e && l(e, [["opacity", "0", "0.3s"]], "leave", () => {
75
+ h(this, "open"), this.emit("closed");
76
+ }), this.lockScroll && (document.body.style.overflow = this.#e), this.afterClosed();
77
+ }
78
+ }
79
+ afterInit() {
80
+ this.#s();
81
+ const t = i(".l-panel", this.root);
82
+ t && f(t, "click", this.#o);
83
+ }
84
+ beforeDestroy() {
85
+ const t = i(".l-panel", this.root);
86
+ t && m(t, "click", this.#o);
87
+ }
88
+ #o = (t) => {
89
+ const [e, s] = k(
90
+ t,
91
+ "data-action",
92
+ t.currentTarget
93
+ );
94
+ if (!e) {
95
+ this.maskClosable && (this.open = !1);
96
+ return;
97
+ }
98
+ this.onAction(s) || this.emit("action", { detail: s });
99
+ };
100
+ afterOpened() {
101
+ }
102
+ afterClosed() {
103
+ }
104
+ onAction(t) {
105
+ return !1;
106
+ }
107
+ }
108
+ export {
109
+ x as default
110
+ };
@@ -1,8 +1,8 @@
1
- import { addClass as n, $$ as r, $one as l, on as a, off as d, removeClass as u } from "ph-utils/dom";
1
+ import { addClass as i, $$ as r, $one as l, on as a, off as d, removeClass as u } from "ph-utils/dom";
2
2
  import p from "../form/form_inner.js";
3
3
  import { initAttr as m } from "../utils/index.js";
4
- import { isBlank as s, random as h } from "ph-utils";
5
- const c = ":host{--l-input-width: 180px;position:relative;width:var(--l-input-width, 180px);height:var(--l-form-edit-height, 32px);display:inline-block}.l-md-input__inner{width:100%;height:100%;border:0;background:transparent;border-style:solid;border-color:silver;border-bottom-width:1px;box-sizing:border-box;outline:none;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color, #722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{transform:translate3d(0,-150%,0);font-size:12px}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color, #722ed1)}.l-md-input__label{display:flex;align-items:center;position:absolute;top:50%;bottom:0;left:0;transition:color .3s,transform .3s;color:#8c8c8c;cursor:text;line-height:1;transform:translate3d(0,-50%,0);font-size:13px}:host(.l-md-input-outline){--l-input-label-background: #ffffff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{padding-left:4px;padding-right:4px;background-color:#fff}";
4
+ import { isBlank as s, random as c } from "ph-utils";
5
+ const h = ":host{--l-input-width: 180px;position:relative;width:var(--l-input-width, 180px);height:var(--l-form-control-height, 32px);display:inline-block}.l-md-input__inner{width:100%;height:100%;border:0;background:transparent;border-style:solid;border-color:silver;border-bottom-width:1px;box-sizing:border-box;outline:none;transition:border-color .3s}.l-md-input__inner:focus{border-color:var(--l-primary-color, #722ed1)}:host(.l-has-value) .l-md-input__label,.l-md-input__inner:focus+.l-md-input__label{transform:translate3d(0,-150%,0);font-size:12px}.l-md-input__inner:focus+.l-md-input__label{color:var(--nt-primary-color, #722ed1)}.l-md-input__label{display:flex;align-items:center;position:absolute;top:50%;bottom:0;left:0;transition:color .3s,transform .3s;color:#8c8c8c;cursor:text;line-height:1;transform:translate3d(0,-50%,0);font-size:13px}:host(.l-md-input-outline){--l-input-label-background: #ffffff}:host(.l-md-input-outline) .l-md-input__inner{border-width:1px;border-radius:4px;padding:0 10px}:host(.l-md-input-outline) .l-md-input__label{left:10px}:host(.l-md-input-outline) .l-md-input__inner:focus{border-width:2px}:host(.l-md-input-outline) .l-md-input__inner:focus+.l-md-input__label,:host(.l-md-input-outline.l-has-value) .l-md-input__label{padding-left:4px;padding-right:4px;background-color:#fff}";
6
6
  class v extends p {
7
7
  static baseName = "md-input";
8
8
  /** 是否显示四周边框 */
@@ -14,21 +14,21 @@ class v extends p {
14
14
  return ["disabled"];
15
15
  }
16
16
  connectedCallback() {
17
- m(this), this.loadStyleText(c), super.connectedCallback(), this.#e();
17
+ m(this), this.loadStyleText(h), super.connectedCallback(), this.#e();
18
18
  }
19
19
  disconnectedCallback() {
20
- super.disconnectedCallback(), this.#i();
20
+ super.disconnectedCallback(), this.#n();
21
21
  }
22
22
  render() {
23
- s(this.value) || n(this, "l-has-value"), this.outline && n(this, "l-md-input-outline");
24
- const t = document.createDocumentFragment(), e = `l-md-input-${h(8)}`, i = r("input", {
23
+ s(this.value) || i(this, "l-has-value"), this.outline && i(this, "l-md-input-outline");
24
+ const t = document.createDocumentFragment(), e = `l-md-input-${c(8)}`, n = r("input", {
25
25
  class: "l-md-input__inner",
26
26
  type: this.htmlType,
27
27
  name: this.getName(),
28
28
  inputmode: this.inputmode,
29
29
  id: e
30
30
  });
31
- if (t.appendChild(i), this.label) {
31
+ if (t.appendChild(n), this.label) {
32
32
  const o = r("label", {
33
33
  class: "l-md-input__label",
34
34
  for: e
@@ -46,13 +46,13 @@ class v extends p {
46
46
  const t = l("input", this.root);
47
47
  t && a(t, "input", this.#t);
48
48
  }
49
- #i() {
49
+ #n() {
50
50
  const t = l("input", this.root);
51
51
  t && d(t, "input", this.#t);
52
52
  }
53
53
  #t = (t) => {
54
- const i = t.target.value;
55
- this.setValue(i), s(i) ? u(this, "l-has-value") : n(this, "l-has-value");
54
+ const n = t.target.value;
55
+ this.setValue(n), s(n) ? u(this, "l-has-value") : i(this, "l-has-value");
56
56
  };
57
57
  }
58
58
  export {
@@ -3,7 +3,7 @@ export default class Modal extends BaseComponent {
3
3
  #private;
4
4
  static baseName: string;
5
5
  /** 是否显示对话框 */
6
- open: boolean;
6
+ show: boolean;
7
7
  /** 关闭时销毁 Modal 里的子元素 */
8
8
  destroyOnClose: boolean;
9
9
  /** 点击蒙层是否允许关闭 */
@@ -1,11 +1,11 @@
1
1
  import x from "../base.js";
2
2
  import { parseAttrValue as c, initAttr as g } from "../utils/index.js";
3
3
  import { $one as i, transition as s, $$ as a, on as u, off as k, shouldEventNext as y } from "ph-utils/dom";
4
- const v = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex, 100)}.l-modal-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(var(--l-modal-zindex, 100) + 1)}.l-modal{--l-modal-translate: translate3d(0, 80px, 0);background-color:#fff;border-radius:5px;width:var(--l-modal-width, 27%);margin:auto;box-shadow:0 0 8px #0000001a;position:relative;opacity:1;transform:var(--l-modal-translate) scaleZ(1);transition:opacity .3s,transform .3s}.l-modal-header{display:block;padding:10px;font-size:16px;border-bottom:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06));font-weight:600;display:flex;align-items:center;gap:5px}.l-modal-footer{padding:10px;border-top:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06));display:flex;justify-content:flex-end;gap:10px}.l-modal-container{padding:var(--l-modal-container-padding, 15px 10px);font-size:14px}.l-btn-modal-close{--l-form-edit-height: auto;position:absolute}.l-modal-close1{right:5px;top:8px}.l-modal-close1::part(default){width:auto;height:auto;padding:5px;border:none;font-size:16px}.l-modal-close2{right:-10px;top:-10px}.l-modal-close2::part(default){width:20px;height:20px;padding:0;background-color:#fff}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translateZ(0) scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:transparent;padding:20px 10px 5px;display:flex;justify-content:center}.l-modal--mobile .l-modal-container{--l-modal-container-padding: 5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{display:flex;justify-content:stretch;align-items:stretch;padding:0;text-align:center;height:50px;gap:0}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06))}.l-modal--middle{--l-modal-translate: translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate: translate3d(0, -100%, 0);top:100%;width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}@media screen and (max-width: 768px){:host{--l-modal-width: 80%}}", C = ".l-mask{position:fixed;z-index:var(--l-mask-zindex, 100);inset:0;background-color:#0009;transition:opacity .3s;opacity:1}";
4
+ const v = ":host{display:none}:host(.open){display:block}.l-modal-mask{z-index:var(--l-modal-zindex, 100)}.l-modal-wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:calc(var(--l-modal-zindex, 100) + 1)}.l-modal{--l-modal-translate: translate3d(0, 80px, 0);background-color:#fff;border-radius:5px;width:var(--l-modal-width, 27%);margin:auto;box-shadow:0 0 8px #0000001a;position:relative;opacity:1;transform:var(--l-modal-translate) scaleZ(1);transition:opacity .3s,transform .3s}.l-modal-header{display:block;padding:10px;font-size:16px;border-bottom:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06));font-weight:600;display:flex;align-items:center;gap:5px}.l-modal-footer{padding:10px;border-top:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06));display:flex;justify-content:flex-end;gap:10px}.l-modal-container{padding:var(--l-modal-container-padding, 15px 10px);font-size:14px}.l-btn-modal-close{--l-form-control-height: auto;position:absolute}.l-modal-close1{right:5px;top:8px}.l-modal-close1::part(default){width:auto;height:auto;padding:5px;border:none;font-size:16px}.l-modal-close2{right:-10px;top:-10px}.l-modal-close2::part(default){width:20px;height:20px;padding:0;background-color:#fff}.mask-transition-enter-from,.mask-transition-leave-to{opacity:0}.modal-transition-enter-from,.modal-transition-leave-to{transform:translateZ(0) scale3d(0,0,0)}.l-modal--mobile{border-radius:10px}.l-modal--mobile .l-modal-header{text-align:center;border-bottom-color:transparent;padding:20px 10px 5px;display:flex;justify-content:center}.l-modal--mobile .l-modal-container{--l-modal-container-padding: 5px 15px 20px;text-align:center}.l-modal--mobile .l-modal-footer{display:flex;justify-content:stretch;align-items:stretch;padding:0;text-align:center;height:50px;gap:0}.l-modal--mobile .l-modal-footer-btn{flex-grow:1;height:100%}.l-modal--mobile .l-modal-footer-btn+.l-modal-footer-btn{border-left:1px solid var(--l-modal-line-color, rgba(0, 0, 0, .06))}.l-modal--middle{--l-modal-translate: translate3d(0, -50%, 0);top:50%}.l-modal--bottom{--l-modal-translate: translate3d(0, -100%, 0);top:100%;width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}@media screen and (max-width: 768px){:host{--l-modal-width: 80%}}", w = ".l-mask{position:fixed;z-index:var(--l-mask-zindex, 100);inset:0;background-color:#0009;transition:opacity .3s;opacity:1}";
5
5
  class L extends x {
6
6
  static baseName = "modal";
7
7
  /** 是否显示对话框 */
8
- open = !1;
8
+ show = !1;
9
9
  /** 关闭时销毁 Modal 里的子元素 */
10
10
  destroyOnClose = !1;
11
11
  /** 点击蒙层是否允许关闭 */
@@ -36,12 +36,12 @@ class L extends x {
36
36
  zIndex;
37
37
  #t = "";
38
38
  static get observedAttributes() {
39
- return ["open", "width", "confirm-loading"];
39
+ return ["show", "width", "confirm-loading"];
40
40
  }
41
41
  attributeChangedCallback(t, e, o) {
42
42
  if (this.rendered) {
43
- if (t === "open")
44
- this.open = c(o, !1), this.open ? this.#e() : this.#i();
43
+ if (t === "show")
44
+ this.show = c(o, !1), this.show ? this.#e() : this.#i();
45
45
  else if (t === "width")
46
46
  this.width = c(o, void 0), this.#o();
47
47
  else if (t === "confirm-loading") {
@@ -52,10 +52,10 @@ class L extends x {
52
52
  }
53
53
  }
54
54
  connectedCallback() {
55
- g(this), this.loadStyleText([C, v]), super.connectedCallback(), this.#o(), this.zIndex && this.style.setProperty("--l-modal-zindex", this.zIndex);
55
+ g(this), this.loadStyleText([w, v]), super.connectedCallback(), this.#o(), this.zIndex && this.style.setProperty("--l-modal-zindex", this.zIndex);
56
56
  }
57
57
  render() {
58
- this.open && this.#e();
58
+ this.show && this.#e();
59
59
  }
60
60
  #o() {
61
61
  this.width ? this.style.setProperty("--l-modal-width", this.width) : this.style.removeProperty("--l-modal-width");
@@ -1,9 +1,9 @@
1
1
  import c from "./index.js";
2
2
  import i from "../button/index.js";
3
- import p from "../icon/close.js";
3
+ import u from "../icon/close.js";
4
4
  import d from "../icon/info.js";
5
- import { regist as u } from "../utils/index.js";
6
- import { $$ as b, on as m, $one as h } from "ph-utils/dom";
5
+ import { regist as p } from "../utils/index.js";
6
+ import { $$ as h, on as m, $one as b } from "ph-utils/dom";
7
7
  import $ from "../form/form_item.js";
8
8
  import C from "../input/index.js";
9
9
  function f(t, e, o, l = "alert") {
@@ -18,10 +18,10 @@ function f(t, e, o, l = "alert") {
18
18
  ), n.push(
19
19
  `<l-input placeholder="${o.placeholder || ""}"></l-input>`
20
20
  ), n.push("</l-form-item>")) : n.push(`<span>${e}</span>`);
21
- let r = b("l-modal", {
21
+ let r = h("l-modal", {
22
22
  cancel: `${o.showCancel}`,
23
23
  innerHTML: n.join(""),
24
- open: !0,
24
+ show: !0,
25
25
  class: `l-modal-box l-modal-box--${l}`,
26
26
  close: `${o.close}`,
27
27
  "mask-closable": `${o.maskClosable}`
@@ -38,7 +38,7 @@ function f(t, e, o, l = "alert") {
38
38
  "ok",
39
39
  () => {
40
40
  let s = !0;
41
- l === "prompt" && (s = h(".l-modal-box l-input").value), r.removeAttribute("open"), a(s);
41
+ l === "prompt" && (s = b(".l-modal-box l-input").value), r.removeAttribute("open"), a(s);
42
42
  },
43
43
  { once: !0 }
44
44
  ), m(
@@ -52,7 +52,7 @@ function f(t, e, o, l = "alert") {
52
52
  });
53
53
  }
54
54
  function k(t, e, o) {
55
- return u([i, c, p]), new Promise((l) => {
55
+ return p([i, c, u]), new Promise((l) => {
56
56
  const a = {
57
57
  showCancel: !1,
58
58
  close: 0,
@@ -64,18 +64,18 @@ function k(t, e, o) {
64
64
  });
65
65
  }
66
66
  function v(t, e, o) {
67
- u([i, c, p, d]);
67
+ p([i, c, u, d]);
68
68
  const l = {
69
69
  showCancel: !0,
70
70
  close: 0,
71
71
  maskClosable: !0,
72
- icon: () => b("l-info-icon", { style: "color:#1890ff;" }),
72
+ icon: () => h("l-info-icon", { style: "color:#1890ff;" }),
73
73
  ...o
74
74
  };
75
75
  return f(e || "提示", t, l, "confirm");
76
76
  }
77
77
  function w(t, e, o) {
78
- u([i, c, p, d, $, C]);
78
+ p([i, c, u, d, $, C]);
79
79
  const l = {
80
80
  showCancel: !0,
81
81
  close: 0,
@@ -0,0 +1,20 @@
1
+ import BaseComponent from "../base";
2
+ export default class PageHeader extends BaseComponent {
3
+ #private;
4
+ static baseName: string;
5
+ showLeft?: boolean;
6
+ showBack: boolean;
7
+ backText: string;
8
+ pageTitle?: string;
9
+ pageSubTitle?: string;
10
+ align: "left" | "center";
11
+ showRight: boolean;
12
+ border: boolean;
13
+ height?: string;
14
+ connectedCallback(): void;
15
+ static get observedAttributes(): string[];
16
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
17
+ render(): DocumentFragment;
18
+ afterInit(): void;
19
+ beforeDestroy(): void;
20
+ }
@@ -0,0 +1,109 @@
1
+ import h from "../base.js";
2
+ import { kebabToCamel as n, parseAttrValue as d } from "../utils/index.js";
3
+ import { $$ as a, shouldEventNext as p, on as g, off as c } from "ph-utils/dom";
4
+ import { isBlank as r } from "ph-utils";
5
+ const f = ":host{display:block;box-sizing:border-box;display:flex;position:relative;align-items:center;height:var(--l-page-header-height, auto)}.l-page-header-left,.l-page-header-right{display:flex;align-items:center;flex:0 0 auto;z-index:1}.l-page-header-back{height:auto}.l-page-header-back::part(default){--l-btn-padding: 5px 0}.l-page-header-content{display:flex;align-items:center;line-height:1}.l-page-header-title{font-size:16px;font-weight:600}.l-page-header-sub-title{font-size:14px;font-weight:500;color:#999;margin-left:10px}:host(.l-page-header-align-left) .l-page-header-left{margin-right:15px}:host(.l-page-header-align-left) .l-page-header-content{flex:1 0 auto}:host(.l-page-header-align-left) .l-page-header-right{margin-left:15px}:host(.l-page-header-align-center){justify-content:space-between}:host(.l-page-header-align-center) .l-page-header-content{position:absolute;inset:0;justify-content:center}:host(.l-page-header-align-center) .l-page-header-back::part(default){--l-btn-padding: 8px 0;--l-btn-gap: 0}:host(.l-page-header-border){border-bottom:1px solid var(--l-border-color, #dedede)}";
6
+ class w extends h {
7
+ static baseName = "page-header";
8
+ showLeft = !0;
9
+ showBack = !0;
10
+ backText = "返回";
11
+ pageTitle;
12
+ pageSubTitle;
13
+ align = "left";
14
+ showRight = !0;
15
+ border = !1;
16
+ height;
17
+ connectedCallback() {
18
+ this.loadStyleText(f), this.classList.add(`l-page-header-align-${this.align}`), super.connectedCallback();
19
+ }
20
+ static get observedAttributes() {
21
+ return [
22
+ "show-left",
23
+ "show-back",
24
+ "back-text",
25
+ "page-title",
26
+ "page-sub-title",
27
+ "align",
28
+ "show-right",
29
+ "border",
30
+ "height"
31
+ ];
32
+ }
33
+ attributeChangedCallback(t, i, l) {
34
+ t = n(t);
35
+ const e = d(
36
+ l,
37
+ this[t],
38
+ t
39
+ );
40
+ switch (e !== this[t] && (this[t] = e), t) {
41
+ case "border":
42
+ e ? this.classList.add("l-page-header-border") : this.classList.remove("l-page-header-border");
43
+ break;
44
+ case "height":
45
+ e && this.style.setProperty("--l-page-header-height", e);
46
+ break;
47
+ }
48
+ }
49
+ render() {
50
+ const t = document.createDocumentFragment();
51
+ if (this.showLeft) {
52
+ const e = a("div", { class: "l-page-header-left" });
53
+ if (this.showBack) {
54
+ const o = a("l-button", {
55
+ text: !0,
56
+ class: "l-page-header-back",
57
+ "l-action": "back",
58
+ innerHTML: `<l-arrow-left-icon></l-arrow-left-icon><span>${this.backText}</span>`
59
+ });
60
+ e.appendChild(o);
61
+ }
62
+ const s = a("slot", { name: "left" });
63
+ e.appendChild(s), t.appendChild(e);
64
+ }
65
+ const i = a("div", {
66
+ class: "l-page-header-content"
67
+ });
68
+ if (!r(this.pageTitle)) {
69
+ const e = a("div", {
70
+ class: "l-page-header-title",
71
+ innerHTML: this.pageTitle
72
+ });
73
+ i.appendChild(e);
74
+ }
75
+ if (!r(this.pageSubTitle)) {
76
+ const e = a("div", {
77
+ class: "l-page-header-sub-title",
78
+ innerHTML: this.pageSubTitle
79
+ });
80
+ i.appendChild(e);
81
+ }
82
+ const l = a("slot");
83
+ if (i.appendChild(l), t.appendChild(i), this.showRight) {
84
+ const e = a("div", { class: "l-page-header-right" }), s = a("slot", { name: "right" });
85
+ e.appendChild(s), t.appendChild(e);
86
+ }
87
+ return t;
88
+ }
89
+ #e = (t) => {
90
+ const [i, l, e] = p(
91
+ t,
92
+ "l-action",
93
+ this.root
94
+ );
95
+ if (i) {
96
+ const s = e.dataset;
97
+ this.emit("action", { detail: { action: l, ...s } });
98
+ }
99
+ };
100
+ afterInit() {
101
+ g(this.root, "click", this.#e);
102
+ }
103
+ beforeDestroy() {
104
+ c(this.root, "click", this.#e);
105
+ }
106
+ }
107
+ export {
108
+ w as default
109
+ };
@@ -0,0 +1,27 @@
1
+ import BaseComponent from "../base";
2
+ export default class Pagination extends BaseComponent {
3
+ #private;
4
+ static baseName: string;
5
+ /** 数据总数 */
6
+ total?: number;
7
+ /** 总页数 */
8
+ pageCount?: number;
9
+ /** 每页显示条目个数 */
10
+ pageSize?: number;
11
+ /** 对齐方式 */
12
+ align?: "start" | "center" | "end";
13
+ /** 是否为简单分页 */
14
+ simple?: boolean;
15
+ /** 单页隐藏 */
16
+ hideOnSinglePage?: boolean;
17
+ get current(): number;
18
+ set current(current: number);
19
+ setCurrent(current: number): void;
20
+ connectedCallback(): void;
21
+ static get observedAttributes(): string[] | null | undefined;
22
+ attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
23
+ rerender(): void;
24
+ render(): string;
25
+ afterInit(): void;
26
+ beforeDestroy(): void;
27
+ }