litos-ui 0.15.6 → 0.15.8

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 (84) hide show
  1. package/lib/button/index.d.ts +4 -0
  2. package/lib/button/index.js +88 -61
  3. package/lib/check/check.js +6 -7
  4. package/lib/check/checkbox.js +1 -1
  5. package/lib/check/radio.js +10 -6
  6. package/lib/{check-BlDsQQo0.js → check-A86JxUfd.js} +1 -1
  7. package/lib/collapse/index.d.ts +19 -0
  8. package/lib/collapse/index.js +88 -0
  9. package/lib/collapse/item.d.ts +15 -0
  10. package/lib/collapse/item.js +115 -0
  11. package/lib/color_picker/index.js +1 -1
  12. package/lib/date_picker/index.js +1 -1
  13. package/lib/description_panel/index.d.ts +4 -4
  14. package/lib/description_panel/index.js +59 -11
  15. package/lib/dialog/dialog_container.js +1 -1
  16. package/lib/form/form_inner.d.ts +5 -1
  17. package/lib/form/form_inner.js +33 -27
  18. package/lib/form/form_item.js +9 -9
  19. package/lib/icon/d_arrow_left.d.ts +6 -0
  20. package/lib/icon/d_arrow_left.js +13 -0
  21. package/lib/icon/d_arrow_right.d.ts +6 -0
  22. package/lib/icon/d_arrow_right.js +13 -0
  23. package/lib/icon/more.d.ts +6 -0
  24. package/lib/icon/more.js +13 -0
  25. package/lib/icon/select.d.ts +6 -0
  26. package/lib/icon/select.js +13 -0
  27. package/lib/icon/zoom_in.d.ts +6 -0
  28. package/lib/icon/zoom_in.js +13 -0
  29. package/lib/icon/zoom_out.d.ts +6 -0
  30. package/lib/icon/zoom_out.js +13 -0
  31. package/lib/image/image_preview.d.ts +24 -0
  32. package/lib/image/image_preview.js +104 -0
  33. package/lib/image/index.d.ts +50 -0
  34. package/lib/image/index.js +176 -0
  35. package/lib/index-D4II9KsF.js +4 -0
  36. package/lib/index.d.ts +36 -4
  37. package/lib/index.js +157 -120
  38. package/lib/input/index.d.ts +5 -0
  39. package/lib/input/index.js +93 -71
  40. package/lib/litos-ui.css +1 -1
  41. package/lib/mask/index.d.ts +23 -0
  42. package/lib/mask/index.js +110 -0
  43. package/lib/md_input/index.js +11 -11
  44. package/lib/message/index.js +2 -2
  45. package/lib/modal/index.d.ts +1 -1
  46. package/lib/modal/index.js +7 -7
  47. package/lib/modal/modal_box.js +10 -10
  48. package/lib/page_header/index.d.ts +20 -0
  49. package/lib/page_header/index.js +109 -0
  50. package/lib/pagination/index.d.ts +27 -0
  51. package/lib/pagination/index.js +248 -0
  52. package/lib/qrcode/index.js +4 -4
  53. package/lib/select/index.d.ts +79 -0
  54. package/lib/select/index.js +406 -0
  55. package/lib/select_ori/index.js +1 -1
  56. package/lib/switch/index.js +4 -4
  57. package/lib/tabbar/index.d.ts +3 -1
  58. package/lib/tabbar/index.js +14 -8
  59. package/lib/tabbar/item.js +1 -1
  60. package/lib/table/index.d.ts +63 -0
  61. package/lib/table/index.js +260 -0
  62. package/lib/table/types.d.ts +36 -0
  63. package/lib/tabs/index.d.ts +7 -0
  64. package/lib/tabs/index.js +43 -0
  65. package/lib/tag/index.d.ts +16 -0
  66. package/lib/tag/index.js +80 -0
  67. package/lib/theme/index.js +6 -6
  68. package/lib/utils/index.d.ts +6 -28
  69. package/lib/utils/index.js +61 -86
  70. package/lib/utils/popover.d.ts +137 -0
  71. package/lib/utils/popover.js +354 -0
  72. package/lib/utils/transition.js +26 -50
  73. package/package.json +71 -71
  74. package/styles/popover.css +66 -0
  75. package/styles/reset.css +1 -1
  76. package/styles/select.css +37 -0
  77. package/styles/tabs.css +13 -0
  78. package/styles/vars.css +2 -1
  79. package/lib/index-dwS1N2uN.js +0 -4
  80. package/lib/popconfirm/index.d.ts +0 -7
  81. package/lib/popconfirm/index.js +0 -30
  82. package/lib/popover/index.d.ts +0 -34
  83. package/lib/popover/index.js +0 -150
  84. /package/lib/{menu/base.js → table/types.js} +0 -0
@@ -1,9 +1,9 @@
1
- import { addClass as n, removeClass as o, $one as u, on as h, formatStyle as f, off as d, $ as p, $$ as a } from "ph-utils/dom";
2
- import { initAttr as b, parseAttrValue as c } from "../utils/index.js";
1
+ import { addClass as h, removeClass as u, $one as d, on as o, formatStyle as c, off as p, $ as f, $$ as n } from "ph-utils/dom";
2
+ import { initAttr as g, parseAttrValue as a } from "../utils/index.js";
3
3
  import m from "../form/form_inner.js";
4
- import { add as g, remove as v } from "../utils/event.js";
5
- import { i as C } from "../index-dwS1N2uN.js";
6
- class y extends m {
4
+ import { add as b, remove as x } from "../utils/event.js";
5
+ import { i as v } from "../index-D4II9KsF.js";
6
+ class I extends m {
7
7
  static baseName = "input";
8
8
  /** 原生 input 的 type */
9
9
  type = "text";
@@ -18,144 +18,166 @@ class y extends m {
18
18
  /** 宽度铺满 */
19
19
  block = !1;
20
20
  error = !1;
21
+ maxlength;
22
+ minlength;
23
+ inputmode = "text";
21
24
  $inner;
22
- #e = !1;
23
- set value(e) {
24
- this.setValue(e), this.$inner && (this.$inner.value = e);
25
+ #t = !1;
26
+ set value(t) {
27
+ this.setValue(t), this.$inner && (this.$inner.value = t);
25
28
  }
26
29
  get value() {
27
30
  return this.getValue();
28
31
  }
29
32
  get clearable() {
30
- return this.#e;
33
+ return this.#t;
31
34
  }
32
- set clearable(e) {
33
- this.#e = e, e ? n(this, "l-input--clearable") : o(this, "l-input--clearable");
35
+ set clearable(t) {
36
+ this.#t = t, t ? h(this, "l-input--clearable") : u(this, "l-input--clearable");
34
37
  }
35
38
  static get observedAttributes() {
36
- return ["disabled", "error", "clearable"];
39
+ return [
40
+ "disabled",
41
+ "value",
42
+ "name",
43
+ "error",
44
+ "clearable",
45
+ "maxlength",
46
+ "inputmode"
47
+ ];
37
48
  }
38
49
  connectedCallback() {
39
- b(this), this.loadStyleText([C]), super.connectedCallback(), this.$inner = u(".l-input__inner", this.root), h(this.$inner, "input", this._input), h(this.$inner, "change", this.#s), this.style.cssText = f(this._getStyleObj()) + this.getAttr("style", ""), this.error && n(this, "is-error"), this.getName() && this.formAttrs.id && g(this.formAttrs.id, "validateChange", this._validateChange);
50
+ g(this), this.loadStyleText([v]), super.connectedCallback(), this.$inner = d(".l-input__inner", this.root), o(this.$inner, "input", this._input), o(this.$inner, "change", this.#s), this.style.cssText = c(this._getStyleObj()) + this.getAttr("style", ""), this.error && h(this, "is-error"), this.getName() && this.formAttrs.id && b(this.formAttrs.id, "validateChange", this._validateChange);
40
51
  }
41
52
  disconnectedCallback() {
42
- super.disconnectedCallback(), this.formAttrs.id && v(this.formAttrs.id, "validateChange", this._validateChange), d(this.$inner, "input", this._input);
53
+ super.disconnectedCallback(), this.formAttrs.id && x(this.formAttrs.id, "validateChange", this._validateChange), p(this.$inner, "input", this._input);
43
54
  }
44
- attributeChange(e, s, t) {
45
- if (e === "error") {
46
- const i = c(t, !1, e);
55
+ attributeChange(t, s, e) {
56
+ const r = a(
57
+ e,
58
+ this[t],
59
+ t
60
+ );
61
+ if (r !== this[t] && (this[t] = r), t === "error") {
62
+ const i = a(e, !1, t);
47
63
  i !== this.error && (this.error = i, this._updateError());
48
- } else if (e === "clearable") {
49
- const i = c(t, !1, e);
64
+ } else if (t === "clearable") {
65
+ const i = a(e, !1, t);
50
66
  i !== this.clearable && (this.clearable = i);
67
+ } else if (t === "maxlength") {
68
+ const i = a(e, this.maxlength);
69
+ i !== this.maxlength && (this.maxlength = i);
51
70
  }
52
71
  }
53
72
  render() {
54
- const e = document.createDocumentFragment();
55
- if (p('[slot="prefix"]', this).length > 0) {
56
- const r = a("slot", {
73
+ const t = document.createDocumentFragment();
74
+ if (f('[slot="prefix"]', this).length > 0) {
75
+ const i = n("slot", {
57
76
  name: "prefix"
58
- }), l = a("span", {
77
+ }), l = n("span", {
59
78
  class: "l-input__prefix",
60
79
  part: "prefix"
61
80
  });
62
- l.appendChild(r), e.appendChild(l);
81
+ l.appendChild(i), t.appendChild(l);
63
82
  }
64
- const t = a("input", {
83
+ const e = n("input", {
65
84
  class: "l-input__inner",
66
85
  value: this.value,
67
- name: this.getName(),
68
- placeholder: this.placeholder,
69
- disabled: this.isDisabled(),
86
+ name: this.getName() || "",
87
+ placeholder: this.placeholder || "",
70
88
  part: "default",
71
- type: this.type
89
+ type: this.type,
90
+ inputmode: this.inputmode
72
91
  });
73
- if (e.appendChild(t), p('[slot="suffix"]', this).length > 0) {
74
- const r = a("slot", {
92
+ if (this.isDisabled() && (e.disabled = !0), this.maxlength && e.setAttribute("maxlength", this.maxlength), this.minlength && e.setAttribute("minlength", this.minlength), t.appendChild(e), f('[slot="suffix"]', this).length > 0) {
93
+ const i = n("slot", {
75
94
  name: "suffix"
76
- }), l = a("span", {
95
+ }), l = n("span", {
77
96
  class: "l-input__suffix",
78
97
  part: "suffix"
79
98
  });
80
- l.appendChild(r), e.appendChild(l);
99
+ l.appendChild(i), t.appendChild(l);
81
100
  }
82
- return e;
101
+ return t;
83
102
  }
84
103
  /**
85
104
  * 设置自定义的输入解析器
86
105
  * @param cb
87
106
  */
88
- setParser(e) {
89
- this.parser = e;
107
+ setParser(t) {
108
+ this.parser = t;
90
109
  }
91
- _input = (e) => {
92
- const s = e.target;
93
- let t = s.value;
110
+ _input = (t) => {
111
+ const s = t.target;
112
+ let e = s.value;
94
113
  if (this.allowInput != null) {
95
- let i = this.allowInput.indexOf("."), r = i === -1 ? i : parseInt(this.allowInput.substring(i + 1));
96
- t = this._numberInputParse(t, {
114
+ let r = this.allowInput.indexOf("."), i = r === -1 ? r : parseInt(this.allowInput.substring(r + 1));
115
+ e = this._numberInputParse(e, {
97
116
  integer: this.allowInput.includes("integer"),
98
117
  negative: this.allowInput.startsWith("-"),
99
- precition: r
100
- }), t = String(t), s.value = t;
118
+ precition: i
119
+ }), e = String(e);
101
120
  }
102
- this.parser != null && (t = this.parser(t), s.value = t), this.setValue(t), this.#t();
121
+ this.parser != null && (e = this.parser(e)), s.value = e, this.setValue(e), this.#e();
103
122
  };
104
- #t() {
123
+ #e() {
105
124
  if (this.clearable) {
106
- let e = u(".l-clearable", this.root);
125
+ let t = d(".l-clearable", this.root);
107
126
  if (this.value.length > 0) {
108
- if (e == null) {
109
- e = a("span", {
127
+ if (t == null) {
128
+ t = n("span", {
110
129
  class: "l-input__suffix l-clearable"
111
130
  });
112
- const s = a("l-close-filled-icon");
113
- e.appendChild(s), this.root.appendChild(e), h(e, "click", this.#i);
131
+ const s = n("l-close-filled-icon");
132
+ t.appendChild(s), this.root.appendChild(t), o(t, "click", this.#i);
114
133
  }
115
134
  } else
116
- e && (d(e, "click", this.#i), e.remove());
135
+ t && (p(t, "click", this.#i), t.remove());
117
136
  }
118
137
  }
119
138
  #i = () => {
120
139
  this.value = "", this.dispatchEvent(
121
- new CustomEvent("input", { bubbles: !0, detail: { value: this.value } })
122
- ), this.#t();
140
+ new CustomEvent("input", {
141
+ bubbles: !0,
142
+ detail: { value: this.value }
143
+ })
144
+ ), this.#e();
123
145
  };
124
146
  disabledChange() {
125
147
  this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled());
126
148
  }
127
- _numberInputParse(e, s) {
128
- let t = e, i = s.negative ? "-?" : "";
149
+ _numberInputParse(t, s) {
150
+ let e = t, r = s.negative ? "-?" : "";
129
151
  if (s.integer) {
130
- const l = t.match(new RegExp(`^(${i}\\d*)`));
131
- return l != null ? l[1] : t.substring(0, t.length - 1);
152
+ const l = e.match(new RegExp(`^(${r}\\d*)`));
153
+ return l != null ? l[1] : e.substring(0, e.length - 1);
132
154
  }
133
- const r = t.match(
155
+ const i = e.match(
134
156
  new RegExp(
135
- `(${i}\\d+\\.\\d{0,${s.precition}})|(${i}\\d*)`
157
+ `(${r}\\d+\\.\\d{0,${s.precition}})|(${r}\\d*)`
136
158
  )
137
159
  );
138
- return r != null ? t = r[1] || r[2] : t = "", r != null ? r[1] || r[2] : "";
160
+ return i != null ? e = i[1] || i[2] : e = "", i != null ? i[1] || i[2] : "";
139
161
  }
140
162
  _getStyleObj() {
141
- const e = {};
142
- return this._isBlock() && (e["--l-input-width"] = "100%"), this.width && (e["--l-input-width"] = this.width), e;
163
+ const t = {};
164
+ return this._isBlock() && (t["--l-input-width"] = "100%"), this.width && (t["--l-input-width"] = this.width), t;
143
165
  }
144
166
  _isBlock() {
145
167
  return this.block === !0 || this.formItemAttrs.innerBlock === !0 || this.formAttrs.innerBlock === !0;
146
168
  }
147
169
  _updateError() {
148
- this.error ? n(this, "is-error") : o(this, "is-error");
170
+ this.error ? h(this, "is-error") : u(this, "is-error");
149
171
  }
150
- _validateChange = (e, s) => {
151
- const t = this.getName();
152
- if (t) {
153
- const i = e === !0 ? !1 : e[t] != null;
154
- (s == null || s === t && this.error != i) && (this.error = i, this._updateError()), Object.keys(e)[0] === t && this.focus();
172
+ _validateChange = (t, s) => {
173
+ const e = this.getName();
174
+ if (e) {
175
+ const r = t === !0 ? !1 : t[e] != null;
176
+ (s == null || s === e && this.error != r) && (this.error = r, this._updateError()), Object.keys(t)[0] === e && this.focus();
155
177
  }
156
178
  };
157
- #s = (e) => {
158
- const s = e.target;
179
+ #s = (t) => {
180
+ const s = t.target;
159
181
  this.dispatchEvent(
160
182
  new CustomEvent("change", {
161
183
  bubbles: !0,
@@ -166,5 +188,5 @@ class y extends m {
166
188
  };
167
189
  }
168
190
  export {
169
- y as default
191
+ I as default
170
192
  };
package/lib/litos-ui.css CHANGED
@@ -1 +1 @@
1
- :host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}:host{display:inline-flex;width:auto}
1
+ :host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}:host{display:inline-flex;width:auto;box-sizing:border-box}
@@ -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 {
@@ -38,7 +38,7 @@ function x(e) {
38
38
  "</div>"
39
39
  ].join(""), t;
40
40
  }
41
- const i = (e) => {
41
+ const i = ((e) => {
42
42
  m && (y([h, $, v, w]), m = !1);
43
43
  const t = c.reduce(
44
44
  (f, l) => f + l.offsetHeight + 15,
@@ -51,7 +51,7 @@ const i = (e) => {
51
51
  return o == null && (o = 3e3), o !== 0 && setTimeout(() => {
52
52
  g(s);
53
53
  }, o), s;
54
- };
54
+ });
55
55
  function a(e, t = "info") {
56
56
  const s = typeof e == "string" ? { message: e } : e;
57
57
  return s.type || (s.type = t), i(s);
@@ -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
+ }