litos-ui 0.15.7 → 0.16.0

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 (44) hide show
  1. package/lib/button/index.d.ts +4 -0
  2. package/lib/button/index.js +24 -16
  3. package/lib/check/check.js +6 -7
  4. package/lib/check/checkbox.js +1 -1
  5. package/lib/check/index.d.ts +2 -1
  6. package/lib/check/index.js +25 -12
  7. package/lib/check/radio.js +10 -6
  8. package/lib/check-C7YSuH60.js +4 -0
  9. package/lib/color_picker/index.js +1 -1
  10. package/lib/description_panel/index.js +4 -9
  11. package/lib/dialog/dialog_container.js +4 -6
  12. package/lib/form/form_inner.d.ts +3 -0
  13. package/lib/form/form_inner.js +28 -23
  14. package/lib/image/image_preview.js +3 -3
  15. package/lib/index-DvcllHRh.js +4 -0
  16. package/lib/index.d.ts +2 -0
  17. package/lib/index.js +163 -164
  18. package/lib/input/index.d.ts +2 -1
  19. package/lib/input/index.js +37 -26
  20. package/lib/mask/index.js +1 -6
  21. package/lib/message/index.d.ts +11 -12
  22. package/lib/message/index.js +39 -40
  23. package/lib/modal/index.js +1 -1
  24. package/lib/select/index.js +1 -6
  25. package/lib/select_ori/index.js +1 -1
  26. package/lib/space/index.d.ts +8 -0
  27. package/lib/space/index.js +35 -0
  28. package/lib/tabbar/index.d.ts +3 -1
  29. package/lib/tabbar/index.js +13 -7
  30. package/lib/table/index.d.ts +27 -10
  31. package/lib/table/index.js +165 -96
  32. package/lib/table/types.d.ts +9 -1
  33. package/lib/tag/index.js +4 -1
  34. package/lib/utils/index.d.ts +0 -25
  35. package/lib/utils/index.js +40 -87
  36. package/lib/utils/popover.js +24 -17
  37. package/package.json +41 -40
  38. package/styles/container.css +1 -0
  39. package/styles/dark.css +13 -0
  40. package/styles/reset.css +3 -5
  41. package/styles/vars.css +10 -12
  42. package/lib/check-A86JxUfd.js +0 -4
  43. package/lib/index-D4II9KsF.js +0 -4
  44. package/lib/menu/base.js +0 -1
@@ -6,10 +6,14 @@ export default class Button extends BaseComponent {
6
6
  loadingText: string;
7
7
  _height?: string | number;
8
8
  _disabled: boolean;
9
+ _loading: boolean;
9
10
  get height(): string | number | undefined;
10
11
  set height(height: string | number | undefined);
11
12
  get disabled(): boolean;
12
13
  set disabled(value: boolean);
14
+ get loading(): boolean;
15
+ set loading(value: boolean);
16
+ setLoading(value: boolean): void;
13
17
  setDisabled(value: boolean): void;
14
18
  static get observedAttributes(): string[];
15
19
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
@@ -1,16 +1,17 @@
1
1
  import { parseAttrValue as i, initAttr as c } from "../utils/index.js";
2
2
  import h from "../base.js";
3
- import { $one as s, addClass as g, removeClass as p, on as f, off as v, formatClass as u, formatStyle as m, getAttr as k } from "ph-utils/dom";
3
+ import { $one as b, addClass as g, removeClass as f, on as p, off as v, formatClass as u, formatStyle as m, getAttr as k } from "ph-utils/dom";
4
4
  import { adjust as d } from "ph-utils/color";
5
5
  import { a as x } from "../animation-DttknHkX.js";
6
6
  const y = ":host{--l-btn-padding: 0 15px;--l-btn-text-color: #ffffff;--l-btn-hover-text-color: var(--l-btn-text-color);--l-btn-active-text-color: var(--l-btn-text-color);--l-btn-border-color: var(--l-primary-color, #722ed1);--l-btn-background: var(--l-btn-border-color);--l-btn-hover-border-color: var(--l-primary-color-light1, #9254de);--l-btn-hover-background: var(--l-btn-hover-border-color);--l-btn-active-border-color: var(--l-primary-color-dark1, #531dab);--l-btn-active-background: var(--l-btn-active-border-color);--l-btn-disabled-color: #c9c9c9;--l-btn-disabled-background: #fbfbfb;--l-btn-disabled-border-color: #e6e6e6;--l-btn-height: var(--l-form-control-height, 32px);display:inline-flex;width:auto;height:var(--l-btn-height);text-indent:0;box-sizing:border-box;border-radius:var(--l-border-radius, 3px)}:host([block]){width:100%}.l-btn{width:100%;display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:none;box-sizing:border-box;vertical-align:middle;padding:var(--l-btn-padding);line-height:1;height:100%;border-radius:inherit;color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);position:relative;gap:var(--l-btn-gap, 5px);font-size:inherit;transition:border-color .3s,background-color .3s,color .3s}.l-btn:hover{border-color:var(--l-btn-hover-border-color, var(--l-btn-hover-background));color:var(--l-btn-hover-text-color);background:var(--l-btn-hover-background)}.l-btn:active{border-color:var(--l-btn-active-border-color, var(--l-btn-active-background));color:var(--l-btn-active-text-color);background:var(--l-btn-active-background)}.l-btn-normal{--l-btn-text-color: auto;--l-btn-background: transparent;--l-btn-border-color: #d9d9d9;--l-btn-hover-text-color: var(--l-primary-color-light1, #9254de);--l-btn-active-text-color: var(--l-primary-color-dark1, #531dab);--l-btn-hover-background: #fff;--l-btn-active-background: #fff;--l-btn-hover-border-color: var(--l-btn-hover-text-color);--l-btn-active-border-color: var(--l-btn-active-text-color)}.l-btn-primary{--l-btn-background: var(--l-primary-color, #722ed1);--l-btn-hover-background: var(--l-primary-color-light1, #9254de);--l-btn-active-background: var(--l-primary-color-dark1, #531dab);--l-btn-disabled-border-color: var(--l-primary-color-light2, #b37feb);--l-btn-disabled-background: var(--l-primary-color-light2, #b37feb);--l-btn-disabled-color: #ffffff}.l-btn:disabled{border-color:var(--l-btn-disabled-border-color);background:var(--l-btn-disabled-background);color:var(--l-btn-disabled-color);cursor:not-allowed;opacity:1}.l-btn.l-btn-loading{cursor:default}.l-btn-text{--l-btn-background: transparent;--l-btn-border-color: transparent;--l-btn-hover-border-color: transparent;--l-btn-active-border-color: transparent;--l-btn-disabled-background: transparent;--l-btn-disabled-border-color: transparent;--l-btn-hover-background: transparent;--l-btn-active-background: transparent;--l-btn-padding: 5px}.l-btn-primary.l-btn-text{--l-btn-text-color: var(--l-primary-color, #722ed1);--l-btn-hover-text-color: var(--l-primary-color-light1, #9254de);--l-btn-active-text-color: var(--l-primary-color-dark1, #531dab)}.l-btn-ghost{--l-btn-text-color: var(--l-btn-border-color);--l-btn-background: transparent;--l-btn-hover-background: transparent;--l-btn-active-background: transparent;--l-btn-hover-text-color: var(--l-btn-hover-border-color);--l-btn-active-text-color: var(--l-btn-active-border-color)}.l-btn-round{border-radius:calc(var(--l-form-control-height, 32px) / 2)}.l-btn-circle{border-radius:50%;width:var(--l-form-control-height, 32px);padding:0}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background: rgba(255, 255, 255, .08);--l-btn-disabled-color: rgba(255, 255, 255, .3);--l-btn-disabled-border-color: rgba(255, 255, 255, .3)}";
7
- class B extends h {
7
+ class H extends h {
8
8
  static baseName = "button";
9
9
  htmlType = "button";
10
10
  /** 加载中文本 */
11
11
  loadingText = "";
12
12
  _height;
13
13
  _disabled = !1;
14
+ _loading = !1;
14
15
  get height() {
15
16
  return this._height;
16
17
  }
@@ -23,9 +24,20 @@ class B extends h {
23
24
  set disabled(t) {
24
25
  this.setDisabled(t);
25
26
  }
27
+ get loading() {
28
+ return this._loading;
29
+ }
30
+ set loading(t) {
31
+ this.setLoading(t);
32
+ }
33
+ setLoading(t) {
34
+ this._loading = t;
35
+ const r = b(".l-btn", this.root);
36
+ r && (t ? (g(r, "l-btn-loading"), r.disabled = !0, r.innerHTML = this.loadingBody()) : (f(r, "l-btn-loading"), r.disabled = this.disabled, r.innerHTML = "<slot></slot>"));
37
+ }
26
38
  setDisabled(t) {
27
39
  this._disabled = t;
28
- const r = s(".l-btn", this.root);
40
+ const r = b(".l-btn", this.root);
29
41
  r && (r.disabled = t);
30
42
  }
31
43
  // 初始化属性观察器
@@ -34,10 +46,11 @@ class B extends h {
34
46
  }
35
47
  // 当属性发生变化时调用的回调函数
36
48
  attributeChangedCallback(t, r, o) {
37
- const e = s(".l-btn", this.root);
49
+ const e = b(".l-btn", this.root);
38
50
  if (e) {
39
51
  if (t === "loading") {
40
- i(o, !1, t) ? (g(e, "l-btn-loading"), e.disabled = !0, e.innerHTML = this.loadingBody()) : (p(e, "l-btn-loading"), e.disabled = this.disabled, e.innerHTML = "<slot></slot>");
52
+ const n = i(o, !1, t);
53
+ this.setLoading(n);
41
54
  return;
42
55
  } else if (t === "color") {
43
56
  const n = this.getAttr("text", !1), a = this.getAttr("ghost", !1);
@@ -54,15 +67,10 @@ class B extends h {
54
67
  this[t],
55
68
  t
56
69
  );
57
- if (l !== this[t])
58
- switch (this[t] = l, t) {
59
- case "height":
60
- this.rendered && this._updateHeight();
61
- break;
62
- }
70
+ l !== this[t] && (this[t] = l, t === "height" && this.rendered && this._updateHeight());
63
71
  }
64
72
  connectedCallback() {
65
- c(this), this.loadStyleText([x, y]), this.render(), (this.htmlType === "reset" || this.htmlType === "submit") && f(this, "click", this._handleClick), this._updateHeight();
73
+ c(this), this.loadStyleText([x, y]), this.render(), (this.htmlType === "reset" || this.htmlType === "submit") && p(this, "click", this._handleClick), this._updateHeight();
66
74
  }
67
75
  disconnectedCallback() {
68
76
  super.disconnectedCallback(), (this.htmlType === "reset" || this.htmlType === "submit") && v(this, "click", this._handleClick);
@@ -77,9 +85,9 @@ class B extends h {
77
85
  l ? "l-btn-text" : "",
78
86
  o ? "l-btn-loading" : ""
79
87
  ];
80
- r.className = u(a), r.disabled = this.disabled || o, r.type = this.getAttr("html-type", "button");
81
- const b = this.applyColor(this.getAttr("color"), l, n);
82
- b && (r.style.cssText = b), o ? r.innerHTML = this.loadingBody() : r.innerHTML = "<slot></slot>", r.setAttribute("part", "default"), this.root.appendChild(r);
88
+ r.className = u(a), (this.disabled || o) && (r.disabled = !0), r.type = this.getAttr("html-type", "button");
89
+ const s = this.applyColor(this.getAttr("color"), l, n);
90
+ s && (r.style.cssText = s), o ? r.innerHTML = this.loadingBody() : r.innerHTML = "<slot></slot>", r.setAttribute("part", "default"), this.root.appendChild(r);
83
91
  }
84
92
  loadingBody() {
85
93
  const t = this.getAttr("loading-text", ""), r = ['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];
@@ -128,5 +136,5 @@ class B extends h {
128
136
  }
129
137
  }
130
138
  export {
131
- B as default
139
+ H as default
132
140
  };
@@ -1,6 +1,6 @@
1
1
  import d from "../form/form_inner.js";
2
2
  import { initAttr as n, parseAttrValue as l } from "../utils/index.js";
3
- import { addClass as c, on as r, off as o, $$ as i, removeClass as k, $one as u, toggleClass as p } from "ph-utils/dom";
3
+ import { addClass as h, on as r, off as o, $$ as i, removeClass as k, $one as u, toggleClass as p } from "ph-utils/dom";
4
4
  class m extends d {
5
5
  /** 是否选中 */
6
6
  _checked = !1;
@@ -27,7 +27,7 @@ class m extends d {
27
27
  return ["disabled", "checked"];
28
28
  }
29
29
  connectedCallback() {
30
- n(this), super.connectedCallback(), this.getChecked() && c(this, "is-checked"), this.isDisabled() && c(this, "is-disabled");
30
+ n(this), super.connectedCallback(), this.getChecked() && h(this, "is-checked"), this.isDisabled() && h(this, "is-disabled");
31
31
  }
32
32
  afterInit() {
33
33
  r(this, "click", this.#e);
@@ -36,15 +36,14 @@ class m extends d {
36
36
  o(this, "click", this.#e);
37
37
  }
38
38
  render() {
39
- const e = document.createDocumentFragment(), h = i("input", {
39
+ const e = document.createDocumentFragment(), c = i("input", {
40
40
  type: this._inputType,
41
41
  class: "l-check__input",
42
42
  name: this.getName(),
43
43
  value: this.value,
44
- disabled: this.isDisabled(),
45
44
  checked: this.getChecked()
46
45
  });
47
- if (e.appendChild(h), !this.button) {
46
+ if (this.isDisabled() && (c.disabled = !0), e.appendChild(c), !this.button) {
48
47
  const a = i("span", { class: "l-check__inner" });
49
48
  e.appendChild(a);
50
49
  }
@@ -56,14 +55,14 @@ class m extends d {
56
55
  });
57
56
  return t.appendChild(s), e.appendChild(t), e;
58
57
  }
59
- attributeChange(e, h, t) {
58
+ attributeChange(e, c, t) {
60
59
  if (e === "checked") {
61
60
  const s = l(t, !1, "checked");
62
61
  s !== this.getChecked() && this.setChecked(s);
63
62
  }
64
63
  }
65
64
  checkedChange() {
66
- this.getChecked() ? c(this, "is-checked") : k(this, "is-checked");
65
+ this.getChecked() ? h(this, "is-checked") : k(this, "is-checked");
67
66
  const e = u("input", this.root);
68
67
  e && (e.checked = this._checked);
69
68
  }
@@ -1,5 +1,5 @@
1
1
  import e from "./check.js";
2
- import { c as r } from "../check-A86JxUfd.js";
2
+ import { c as r } from "../check-C7YSuH60.js";
3
3
  const o = '.l-check__inner:after{content:"";width:calc(var(--l-check-size) * .6);height:calc(var(--l-check-size) * .3);display:block;border:solid 1px transparent;border-right:none;border-top:none;transform:rotate(-45deg);transition:border-color .2s ease-in-out;margin-top:-3px}:host([indeterminate]) .l-check__inner{background-color:var(--l-primary-color, #722ed1)}:host([indeterminate]) .l-check__inner:after{content:"";width:calc(var(--l-check-size) * .4);height:1px;display:block;border:1px solid #fff;border-right:none;border-top:none;border-left:none;transform:rotate(0);margin-top:0}:host(.is-checked) .l-check__inner{background-color:var(--l-primary-color, #722ed1)}:host(.is-checked) .l-check__inner:after{border-color:#fff}:host(.is-disabled) .l-check__inner{background-color:var(--l-disabled-color, #e6e6e6);border-color:var(--l-disabled-color, #e6e6e6)}';
4
4
  class a extends e {
5
5
  static baseName = "checkbox";
@@ -1,9 +1,10 @@
1
1
  import FormInner from "../form/form_inner";
2
2
  export default class CheckGroup extends FormInner {
3
3
  #private;
4
- button: boolean;
5
4
  checkedValues: string[];
6
5
  constructor();
6
+ static get observedAttributes(): string[];
7
+ attributeChange(name: string, oldValue: any, newValue: any): void;
7
8
  connectedCallback(): void;
8
9
  afterInit(): void;
9
10
  beforeDestroy(): void;
@@ -1,25 +1,38 @@
1
- import t from "../form/form_inner.js";
2
- import { on as s, off as a, $$ as o } from "ph-utils/dom";
3
- import { initAttr as r } from "../utils/index.js";
4
- const l = ":host{display:flex;align-items:center}";
5
- class u extends t {
6
- button = !1;
7
- // 是否为按钮样式
1
+ import r from "../form/form_inner.js";
2
+ import { on as o, off as l, $$ as c } from "ph-utils/dom";
3
+ import { parseAttrValue as i, initAttr as h } from "../utils/index.js";
4
+ import { isNumeric as n } from "ph-utils";
5
+ const p = ":host{display:flex;align-items:center;gap:var(--l-check-gap, 0px)}";
6
+ class v extends r {
8
7
  checkedValues;
9
8
  constructor() {
10
9
  super(!1), this.checkedValues = [];
11
10
  }
11
+ static get observedAttributes() {
12
+ return ["gap", "value"];
13
+ }
14
+ attributeChange(e, g, a) {
15
+ if (console.log(e), e === "gap") {
16
+ const t = i(a, void 0);
17
+ if (t) {
18
+ const s = n(t) ? `${t}px` : t;
19
+ this.style.setProperty("--l-check-gap", s);
20
+ } else
21
+ this.style.removeProperty("--l-check-gap");
22
+ return;
23
+ }
24
+ }
12
25
  connectedCallback() {
13
- r(this), this.loadStyleText([l]), super.connectedCallback();
26
+ h(this), this.loadStyleText([p]), super.connectedCallback();
14
27
  }
15
28
  afterInit() {
16
- s(this.root, "change", this.#e);
29
+ o(this.root, "change", this.#e);
17
30
  }
18
31
  beforeDestroy() {
19
- a(this.root, "change", this.#e), this.checkedValues = [];
32
+ l(this.root, "change", this.#e), this.checkedValues = [];
20
33
  }
21
34
  render() {
22
- return o("slot");
35
+ return c("slot");
23
36
  }
24
37
  #e = (e) => {
25
38
  this.valueChange(e.detail.value), e.stopPropagation(), this.emit("change", {
@@ -31,5 +44,5 @@ class u extends t {
31
44
  }
32
45
  }
33
46
  export {
34
- u as default
47
+ v as default
35
48
  };
@@ -1,19 +1,23 @@
1
1
  import e from "./check.js";
2
- import { c as o } from "../check-A86JxUfd.js";
3
- import { $one as r } from "ph-utils/dom";
2
+ import { c as o } from "../check-C7YSuH60.js";
3
+ import { $one as c } from "ph-utils/dom";
4
4
  const t = '.l-check__inner{border-radius:50%}.l-check__inner:after{content:"";display:block;width:60%;height:60%;background-color:transparent;border-radius:50%;transition:background-color .3s ease-in-out}:host(.is-checked) .l-check__inner:after{background-color:var(--l-primary-color, #722ed1)}:host(.is-disabled) .l-check__inner{border-color:var(--l-disabled-color, #e6e6e6)}:host(.is-disabled) .l-check__inner:after{background-color:var(--l-disabled-color, #e6e6e6)}';
5
- class d extends e {
5
+ class n extends e {
6
6
  static baseName = "radio";
7
7
  connectedCallback() {
8
8
  this.loadStyleText([o, t]), super.connectedCallback();
9
9
  }
10
10
  _doChangeAction() {
11
- r("input", this.root).checked || (this.setAttribute("checked", ""), this.emit("change", {
12
- detail: { value: this.value, name: this.getName() },
11
+ c("input", this.root).checked || (this.setAttribute("checked", ""), this.emit("change", {
12
+ detail: {
13
+ value: this.value,
14
+ name: this.getName(),
15
+ checked: this.getChecked()
16
+ },
13
17
  composed: !0
14
18
  }));
15
19
  }
16
20
  }
17
21
  export {
18
- d as default
22
+ n as default
19
23
  };
@@ -0,0 +1,4 @@
1
+ const r = ":host{--l-check-size: 16px;display:inline-flex;align-items:center;position:relative;cursor:pointer;width:auto;transition:color .3s,border-color .3s,background-color .3s}.l-check__input{margin:0;position:absolute;z-index:-1;width:0;height:0;opacity:0}.l-check__inner{width:var(--l-check-size);height:var(--l-check-size);display:flex;justify-content:center;align-items:center;border-radius:3px;border:1px solid #dcddd9;box-sizing:border-box;transition:border-color .3s ease-in-out;position:relative;margin-right:5px}.l-check__label{transition:color .3s;cursor:inherit;line-height:1}:host(.is-checked){color:var(--l-primary-color, #722ed1)}:host(.is-checked) .l-check__inner{border-color:var(--l-primary-color, #722ed1)}:host(.is-disabled){cursor:not-allowed}:host(.is-disabled) .l-check__label{color:var(--l-disabled-color, #e6e6e6)}:host([button]){height:var(--l-form-control-height, 32px);justify-content:center;padding:0 15px;border:1px solid #c0c4cc;border-left-width:0;margin-left:0;border-radius:inherit}:host([button]:first-child){border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}:host([button]:last-child){border-top-right-radius:3px;border-bottom-right-radius:3px}:host([button].is-checked){background-color:var(--l-primary-color, #722ed1);color:#fff;border-color:var(--l-primary-color, #722ed1);border-right-color:#fff}:host([button].is-checked:last-child){border-right-color:var(--l-primary-color, #722ed1)}";
2
+ export {
3
+ r as c
4
+ };
@@ -1,7 +1,7 @@
1
1
  import { $one as i, on as s, off as a } from "ph-utils/dom";
2
2
  import r from "../form/form_inner.js";
3
3
  import { initAttr as c, setAttrs as n } from "../utils/index.js";
4
- import { i as l } from "../index-D4II9KsF.js";
4
+ import { i as l } from "../index-DvcllHRh.js";
5
5
  const o = ":host{--l-input-width: 60px}";
6
6
  class m extends r {
7
7
  static baseName = "color-picker";
@@ -12,15 +12,10 @@ class y extends i {
12
12
  attributeChangedCallback(e, t, a) {
13
13
  e = r(e);
14
14
  const o = c(a, this[e]);
15
- if (o !== this[e])
16
- switch (this[e] = o, e) {
17
- case "collapseHeight":
18
- this.collapseHeight !== 100 ? this.style.setProperty(
19
- "--l-desc-panel-min-height",
20
- `${this.collapseHeight}px`
21
- ) : this.style.removeProperty("--l-desc-panel-min-height");
22
- break;
23
- }
15
+ o !== this[e] && (this[e] = o, e === "collapseHeight" && (this.collapseHeight !== 100 ? this.style.setProperty(
16
+ "--l-desc-panel-min-height",
17
+ `${this.collapseHeight}px`
18
+ ) : this.style.removeProperty("--l-desc-panel-min-height")));
24
19
  }
25
20
  connectedCallback() {
26
21
  this.loadStyleText(b), super.connectedCallback();
@@ -49,12 +49,10 @@ class k extends p {
49
49
  return ["show-close"];
50
50
  }
51
51
  attributeChangedCallback(t, o, i) {
52
- switch (t) {
53
- case "show-close":
54
- this.showClose = Number(i), this.showClose === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
55
- let s = f(".l-btn-dialog-close", this.root);
56
- this.showClose === 0 && s ? (h(s, "click", this.#t), s.remove()) : s ? s.className = this.#o() : (s = this.#e(), r(s, "click", this.#t), this.root.appendChild(s));
57
- break;
52
+ if (t === "show-close") {
53
+ this.showClose = Number(i), this.showClose === 2 ? this.classList.add("l-container-close-outside") : this.classList.remove("l-container-close-outside");
54
+ let s = f(".l-btn-dialog-close", this.root);
55
+ this.showClose === 0 && s ? (h(s, "click", this.#t), s.remove()) : s ? s.className = this.#o() : (s = this.#e(), r(s, "click", this.#t), this.root.appendChild(s));
58
56
  }
59
57
  }
60
58
  #o() {
@@ -7,12 +7,15 @@ export default class FormInner extends BaseComponent {
7
7
  _resetValue?: any;
8
8
  protected _firstPushValue: boolean;
9
9
  private _reseting;
10
+ private _name?;
10
11
  /**
11
12
  *
12
13
  * @param firstPushValue 是否第一次赋值 value 时, 推送数据到 Form, 默认: true
13
14
  * @param delegatesFocus 是否委托焦点, 默认: true
14
15
  */
15
16
  constructor(firstPushValue?: boolean, delegatesFocus?: boolean);
17
+ get name(): string | undefined;
18
+ set name(value: string | undefined);
16
19
  get value(): any;
17
20
  set value(value: any);
18
21
  setValue(value: any): void;
@@ -1,8 +1,7 @@
1
- import o from "../base.js";
2
- import { parseAttrValue as d } from "../utils/index.js";
3
- import { add as l, remove as u, emit as f } from "../utils/event.js";
4
- import { getAttr as m } from "ph-utils/dom";
5
- class c extends o {
1
+ import n from "../base.js";
2
+ import { parseAttrValue as m } from "../utils/index.js";
3
+ import { add as l, remove as u, emit as d } from "../utils/event.js";
4
+ class b extends n {
6
5
  disabled = !1;
7
6
  formAttrs = {};
8
7
  formItemAttrs = {};
@@ -10,6 +9,7 @@ class c extends o {
10
9
  _resetValue;
11
10
  _firstPushValue = !0;
12
11
  _reseting = !1;
12
+ _name;
13
13
  /**
14
14
  *
15
15
  * @param firstPushValue 是否第一次赋值 value 时, 推送数据到 Form, 默认: true
@@ -18,6 +18,12 @@ class c extends o {
18
18
  constructor(t = !0, e = !0) {
19
19
  super(!0, { delegatesFocus: e }), this._firstPushValue = t;
20
20
  }
21
+ get name() {
22
+ return this._name;
23
+ }
24
+ set name(t) {
25
+ this._name = t;
26
+ }
21
27
  get value() {
22
28
  return this._value;
23
29
  }
@@ -31,15 +37,15 @@ class c extends o {
31
37
  return this._value;
32
38
  }
33
39
  static get observedAttributes() {
34
- return ["disabled", "value"];
40
+ return ["disabled", "value", "name"];
35
41
  }
36
- attributeChangedCallback(t, e, r) {
42
+ attributeChangedCallback(t, e, s) {
37
43
  if (t === "disabled") {
38
- const i = d(r, !1, t);
44
+ const i = m(s, !1, t);
39
45
  i !== this.disabled && (this.disabled = i, this.disabledChange());
40
- } else t === "value" ? this.value = r : this.attributeChange(t, e, r);
46
+ } else t === "value" || t === "name" ? this.value = s : this.attributeChange(t, e, s);
41
47
  }
42
- attributeChange(t, e, r) {
48
+ attributeChange(t, e, s) {
43
49
  }
44
50
  connectedCallback() {
45
51
  const t = this._getForm();
@@ -60,17 +66,16 @@ class c extends o {
60
66
  return this.disabled === !0 || this.formItemAttrs.disabled === !0 ? !0 : this.formAttrs.disabled || !1;
61
67
  }
62
68
  getName() {
63
- const t = m(this, "name");
64
- return t || this.formItemAttrs.name;
69
+ return this.name ? this.name : this.formItemAttrs.name;
65
70
  }
66
71
  _getForm() {
67
- let t = this.parentElement, e = {}, r = {};
72
+ let t = this.parentElement, e = {}, s = {};
68
73
  for (; t != null; ) {
69
74
  const i = t.tagName;
70
75
  if (i === "L-FORM") {
71
76
  const a = t.sharedAttrs;
72
- for (let s = 0; s < a.length; s++) {
73
- const h = a[s];
77
+ for (let r = 0; r < a.length; r++) {
78
+ const h = a[r];
74
79
  e[h] = t[h];
75
80
  }
76
81
  break;
@@ -78,26 +83,26 @@ class c extends o {
78
83
  if (i === "BODY") break;
79
84
  if (i === "L-FORM-ITEM") {
80
85
  const a = t.sharedAttrs;
81
- for (let s = 0; s < a.length; s++) {
82
- const h = a[s];
83
- r[h] = t[h];
86
+ for (let r = 0; r < a.length; r++) {
87
+ const h = a[r];
88
+ s[h] = t[h];
84
89
  }
85
90
  }
86
91
  t = t.parentElement;
87
92
  }
88
93
  return t = null, {
89
94
  formAttr: e,
90
- formItemAttr: r
95
+ formItemAttr: s
91
96
  };
92
97
  }
93
- _formAttributeChanged = (t, e, r) => {
94
- r === this.formAttrs.formId ? this.formAttrs[t] = e : this.formItemAttrs[t] = e, t === "disabled" && this.disabledChange();
98
+ _formAttributeChanged = (t, e, s) => {
99
+ s === this.formAttrs.formId ? this.formAttrs[t] = e : this.formItemAttrs[t] = e, t === "disabled" && this.disabledChange();
95
100
  };
96
101
  disabledChange() {
97
102
  }
98
103
  pushValueChange() {
99
104
  const t = this.getName();
100
- this.formAttrs.id && t && f(
105
+ this.formAttrs.id && t && d(
101
106
  this.formAttrs.id,
102
107
  "valueChange",
103
108
  t,
@@ -113,5 +118,5 @@ class c extends o {
113
118
  }
114
119
  }
115
120
  export {
116
- c as default
121
+ b as default
117
122
  };
@@ -1,7 +1,7 @@
1
1
  import s from "../mask/index.js";
2
2
  import { $$ as n, $one as r, on as a, off as o } from "ph-utils/dom";
3
3
  const l = ".l-image-preview--container{position:relative;width:100%;height:100%;display:flex;justify-content:center;align-items:center}.l-image-preview__btn,.l-image-preview-operations{display:flex;justify-content:center;align-items:center;background-color:#606666}.l-image-preview__btn{z-index:1;position:absolute;border-radius:50%;opacity:.8;cursor:pointer;background-color:#606666;color:#fff;width:40px;height:40px;font-size:20px;display:flex;justify-content:center;align-items:center;transition:color .3s ease-in-out;outline:none;border:none}.l-image-preview__btn:hover{color:var(--l-primary-color, #4998f6)}.l-image-preview__close{right:30px;top:30px}.l-image-preview__prev,.l-image-preview__next{top:50%;transform:translateY(-50%)}.l-image-preview__prev{left:30px}.l-image-preview__next{right:30px}.l-image-preview-footer{position:absolute;bottom:30px;left:50%;transform:translate(-50%);display:flex;align-items:center;flex-direction:column;z-index:1}.l-image-preview-progress{color:#fff;margin-bottom:10px}.l-image-preview-operations{cursor:default;padding:0 25px;border-radius:20px}.l-image-preview-operations .l-image-preview__btn{position:static;width:40px}.l-image-preview-img{max-width:calc(100vw - 40px);max-height:calc(100vh - 200px);vertical-align:middle;transform-origin:center center;transition:transform .25s;user-select:none;z-index:0}";
4
- class g extends s {
4
+ class p extends s {
5
5
  static baseName = "image-preview";
6
6
  urlList = [];
7
7
  currentIndex = 0;
@@ -87,7 +87,7 @@ class g extends s {
87
87
  return !0;
88
88
  }
89
89
  _handleWhell = (e) => {
90
- e.preventDefault(), e.deltaY > 0 ? this._transformScale("out") : this._transformScale("in");
90
+ e.deltaY > 0 ? this._transformScale("out") : this._transformScale("in");
91
91
  };
92
92
  afterOpened() {
93
93
  a(document, "wheel", this._handleWhell, { passive: !0 });
@@ -100,5 +100,5 @@ class g extends s {
100
100
  }
101
101
  }
102
102
  export {
103
- g as default
103
+ p as default
104
104
  };
@@ -0,0 +1,4 @@
1
+ const r = ":host{--l-input-border-color: var(--l-border-color, #dedede);display:inline-flex;width:var(--l-input-width, 170px);height:var(--l-form-control-height, 32px);align-items:center;padding:0 7px;border:1px solid var(--l-input-border-color, #dedede);transition:border-color .3s;border-radius:var(--l-border-radius, 3px);vertical-align:middle;box-sizing:border-box;background-color:transparent}:host(:focus){--l-input-border-color: var(--l-primary-color, #722ed1)}:host(.is-disabled){background-color:var(--l-disabled-color, #f5f7fa)}:host(.is-error){--l-input-border-color: #ed3f13}.l-input__prefix,.l-input__suffix{color:#a8abb2;font-size:14px;display:inline-flex;flex-shrink:0}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer}.l-clearable:hover{color:#999}.l-input__inner{outline:none;border:none;box-sizing:border-box;width:100%;max-width:100%;height:100%;flex-grow:1;text-align:inherit;font-size:inherit}.l-input__inner:disabled{background-color:transparent}";
2
+ export {
3
+ r as i
4
+ };
package/lib/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export { default as ImagePreview } from "./image/image_preview";
73
73
  export * from "./utils/popover";
74
74
  export { default as Table } from "./table";
75
75
  export type { Column } from "./table/types";
76
+ export { default as Space } from "./space";
76
77
 
77
78
  declare global {
78
79
  interface HTMLElementTagNameMap {
@@ -146,5 +147,6 @@ declare global {
146
147
  "l-image": import("./image").default
147
148
  "l-image-preview": import("./image/image_preview").default
148
149
  "l-table": import("./table").default
150
+ "l-space": import("./space").default
149
151
  }
150
152
  }