litos-ui 0.15.8 → 0.16.1

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.
@@ -1,20 +1,17 @@
1
1
  import BaseComponent from "../base";
2
2
  export default class Button extends BaseComponent {
3
3
  static baseName: string;
4
- htmlType: "submit" | "reset" | "button";
5
- /** 加载中文本 */
6
- loadingText: string;
7
- _height?: string | number;
8
4
  _disabled: boolean;
9
- get height(): string | number | undefined;
10
- set height(height: string | number | undefined);
11
5
  get disabled(): boolean;
12
6
  set disabled(value: boolean);
7
+ setLoading(loading: boolean): void;
13
8
  setDisabled(value: boolean): void;
14
9
  static get observedAttributes(): string[];
15
10
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
16
11
  connectedCallback(): void;
17
12
  disconnectedCallback(): void;
13
+ isFormButton(): boolean;
14
+ getHtmlType(): "submit" | "reset" | "button";
18
15
  render(): void;
19
16
  loadingBody(): string;
20
17
  applyColor(color: string, text?: boolean, ghost?: boolean): string;
@@ -1,31 +1,26 @@
1
- import { parseAttrValue as i, initAttr as c } from "../utils/index.js";
1
+ import { initAttr as c, parseAttrValue as s } from "../utils/index.js";
2
2
  import h from "../base.js";
3
- import { $one as s, 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";
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
- htmlType = "button";
10
- /** 加载中文本 */
11
- loadingText = "";
12
- _height;
9
+ // public htmlType: "submit" | "reset" | "button" = "button";
13
10
  _disabled = !1;
14
- get height() {
15
- return this._height;
16
- }
17
- set height(t) {
18
- this._height = t, this.rendered && this._updateHeight();
19
- }
20
11
  get disabled() {
21
12
  return this._disabled;
22
13
  }
23
14
  set disabled(t) {
24
15
  this.setDisabled(t);
25
16
  }
17
+ setLoading(t) {
18
+ const r = b(".l-btn", this.root);
19
+ 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>"));
20
+ }
26
21
  setDisabled(t) {
27
22
  this._disabled = t;
28
- const r = s(".l-btn", this.root);
23
+ const r = b(".l-btn", this.root);
29
24
  r && (r.disabled = t);
30
25
  }
31
26
  // 初始化属性观察器
@@ -33,100 +28,98 @@ class B extends h {
33
28
  return ["loading", "color", "disabled", "height"];
34
29
  }
35
30
  // 当属性发生变化时调用的回调函数
36
- attributeChangedCallback(t, r, e) {
37
- const o = s(".l-btn", this.root);
38
- if (o) {
31
+ attributeChangedCallback(t, r, o) {
32
+ const e = b(".l-btn", this.root);
33
+ if (e) {
39
34
  if (t === "loading") {
40
- i(e, !1, t) ? (g(o, "l-btn-loading"), o.disabled = !0, o.innerHTML = this.loadingBody()) : (f(o, "l-btn-loading"), o.disabled = this.disabled, o.innerHTML = "<slot></slot>");
35
+ const l = s(o, !1, t);
36
+ this.setLoading(l);
41
37
  return;
42
38
  } else if (t === "color") {
43
- const n = this.getAttr("text", !1), a = this.getAttr("ghost", !1);
44
- o.style.cssText = this.applyColor(e, n, a);
39
+ const l = this.getAttr("text", !1), a = this.getAttr("ghost", !1);
40
+ e.style.cssText = this.applyColor(o, l, a);
45
41
  return;
46
42
  } else if (t === "disabled") {
47
- const n = i(e, !1, "disabled");
48
- this.setDisabled(n);
43
+ const l = s(o, !1, "disabled");
44
+ this.setDisabled(l);
49
45
  return;
50
46
  }
51
47
  }
52
- const l = i(
53
- e,
54
- this[t],
55
- t
56
- );
57
- if (l !== this[t])
58
- switch (this[t] = l, t) {
59
- case "height":
60
- this.rendered && this._updateHeight();
61
- break;
62
- }
48
+ if (!this.rendered) return;
49
+ const n = o.trim();
50
+ t === "height" && this._updateHeight(n);
63
51
  }
64
52
  connectedCallback() {
65
- c(this), this.loadStyleText([x, y]), this.render(), (this.htmlType === "reset" || this.htmlType === "submit") && p(this, "click", this._handleClick), this._updateHeight();
53
+ c(this), this.loadStyleText([x, y]), this.render(), this.isFormButton() && p(this, "click", this._handleClick), this._updateHeight(this.getAttr("height"));
66
54
  }
67
55
  disconnectedCallback() {
68
- super.disconnectedCallback(), (this.htmlType === "reset" || this.htmlType === "submit") && v(this, "click", this._handleClick);
56
+ super.disconnectedCallback(), this.isFormButton() && v(this, "click", this._handleClick);
57
+ }
58
+ isFormButton() {
59
+ const t = this.getHtmlType();
60
+ return t === "submit" || t === "reset";
61
+ }
62
+ getHtmlType() {
63
+ return this.getAttr("html-type", "button");
69
64
  }
70
65
  render() {
71
- const t = this.getAttr("type", "normal"), r = document.createElement("button"), e = this.getAttr("loading", !1), o = this.getAttr("shape", "default"), l = this.getAttr("text", !1), n = this.getAttr("ghost", !1), a = [
66
+ const t = this.getAttr("type", "normal"), r = document.createElement("button"), o = this.getAttr("loading", !1), e = this.getAttr("shape", "default"), n = this.getAttr("text", !1), l = this.getAttr("ghost", !1), a = [
72
67
  "l-btn",
73
68
  `l-btn-${t}`,
74
- o === "round" ? "l-btn-round" : "",
75
- o === "circle" ? "l-btn-circle" : "",
76
- n ? "l-btn-ghost" : "",
77
- l ? "l-btn-text" : "",
78
- e ? "l-btn-loading" : ""
69
+ e === "round" ? "l-btn-round" : "",
70
+ e === "circle" ? "l-btn-circle" : "",
71
+ l ? "l-btn-ghost" : "",
72
+ n ? "l-btn-text" : "",
73
+ o ? "l-btn-loading" : ""
79
74
  ];
80
- r.className = u(a), (this.disabled || e) && (r.disabled = !0), r.type = this.getAttr("html-type", "button");
81
- const b = this.applyColor(this.getAttr("color"), l, n);
82
- b && (r.style.cssText = b), e ? r.innerHTML = this.loadingBody() : r.innerHTML = "<slot></slot>", r.setAttribute("part", "default"), this.root.appendChild(r);
75
+ r.className = u(a), (this.disabled || o) && (r.disabled = !0), r.type = this.getAttr("html-type", "button");
76
+ const i = this.applyColor(this.getAttr("color"), n, l);
77
+ i && (r.style.cssText = i), o ? r.innerHTML = this.loadingBody() : r.innerHTML = "<slot></slot>", r.setAttribute("part", "default"), this.root.appendChild(r);
83
78
  }
84
79
  loadingBody() {
85
- const t = this.getAttr("loading-text", ""), r = ['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];
80
+ const t = this.getAttr("loading-text", "加载中……"), r = ['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];
81
+ console.log(t);
86
82
  return t ? r.push(`<span>${t}</span>`) : r.push("<slot></slot>"), r.join("");
87
83
  }
88
- applyColor(t, r = !1, e = !1) {
84
+ applyColor(t, r = !1, o = !1) {
89
85
  if (!t) return "";
90
- const o = d(t, 1, !0), l = d(t, 3, !1);
86
+ const e = d(t, 1, !0), n = d(t, 3, !1);
91
87
  return m({
92
88
  "--l-btn-border-color": r ? "transparent" : t,
93
- "--l-btn-text-color": e || r ? t : "#ffffff",
94
- "--l-btn-hover-text-color": e || r ? o : "#ffffff",
95
- "--l-btn-background": e || r ? "transparent" : t,
96
- "--l-btn-active-text-color": e || r ? l : "#ffffff",
97
- "--l-btn-hover-border-color": r ? "transparent" : o,
98
- "--l-btn-hover-background": e || r ? "transparent" : o,
99
- "--l-btn-active-background": e || r ? "transparent" : l,
100
- "--l-btn-active-border-color": r ? "transparent" : l
89
+ "--l-btn-text-color": o || r ? t : "#ffffff",
90
+ "--l-btn-hover-text-color": o || r ? e : "#ffffff",
91
+ "--l-btn-background": o || r ? "transparent" : t,
92
+ "--l-btn-active-text-color": o || r ? n : "#ffffff",
93
+ "--l-btn-hover-border-color": r ? "transparent" : e,
94
+ "--l-btn-hover-background": o || r ? "transparent" : e,
95
+ "--l-btn-active-background": o || r ? "transparent" : n,
96
+ "--l-btn-active-border-color": r ? "transparent" : n
101
97
  });
102
98
  }
103
- _updateHeight() {
104
- if (this.height) {
105
- let t = this.height;
106
- typeof t == "number" && (t = `${t}px`), this.style.setProperty("--l-btn-height", t);
107
- }
99
+ _updateHeight(t) {
100
+ t && (typeof t == "number" && (t = `${t}px`), this.style.setProperty("--l-btn-height", t));
108
101
  }
109
102
  _handleClick = (t) => {
110
- const r = t.target, e = k(r, "html-type");
111
- if (e === "reset" || e === "submit") {
112
- const o = this._getForm();
113
- o && (e === "reset" ? o.reset() : e === "submit" && o.submit());
103
+ const r = t.target, o = k(r, "html-type");
104
+ if (o === "reset" || o === "submit") {
105
+ const e = this._getForm();
106
+ e && (o === "reset" ? e.reset() : o === "submit" && e.submit());
114
107
  }
115
108
  };
116
109
  _getForm() {
117
110
  let t = this.parentElement, r;
118
111
  for (; t != null; ) {
119
- const e = t.tagName;
120
- if (e === "L-FORM") {
112
+ const o = t.tagName;
113
+ if (o === "L-FORM") {
121
114
  r = t;
122
115
  break;
123
116
  }
124
- if (e === "BODY") break;
117
+ if (o === "BODY") break;
125
118
  t = t.parentElement;
126
119
  }
127
120
  return t = null, r;
128
121
  }
129
122
  }
130
123
  export {
131
- B as default
124
+ H as default
132
125
  };
@@ -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 { initAttr as i, parseAttrValue 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 = h(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
+ i(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,5 +1,5 @@
1
1
  import e from "./check.js";
2
- import { c as o } from "../check-A86JxUfd.js";
2
+ import { c as o } from "../check-C7YSuH60.js";
3
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
5
  class n extends e {
@@ -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() {
@@ -1,5 +1,5 @@
1
1
  import { $$ as i, $one as o, addClass as n, removeClass as d } from "ph-utils/dom";
2
- import { parseAttrValue as h, initAttr as m } from "../utils/index.js";
2
+ import { initAttr as h, parseAttrValue as m } from "../utils/index.js";
3
3
  import f from "../base.js";
4
4
  import { emit as s, add as c, clear as p, remove as b } from "../utils/event.js";
5
5
  import { random as a } from "ph-utils";
@@ -38,12 +38,12 @@ class I extends f {
38
38
  else if (e === "label")
39
39
  this.label = r, this._updateLabel();
40
40
  else if (e === "disabled") {
41
- const l = h(r, !1, e);
41
+ const l = m(r, !1, e);
42
42
  l !== this.disabled && (s(this.id, "attributeChanged", e, l, this.id), this.disabled = l);
43
43
  }
44
44
  }
45
45
  connectedCallback() {
46
- if (m(this), this.id == null && (this.id = `l-fi${a(3)}-${a(6)}`), this.loadStyleText([u]), super.connectedCallback(), this.formId = this._getFormId(), this.name && this.formId) {
46
+ if (h(this), this.id == null && (this.id = `l-fi${a(3)}-${a(6)}`), this.loadStyleText([u]), super.connectedCallback(), this.formId = this._getFormId(), this.name && this.formId) {
47
47
  let e = this.verify?.split("|") || [];
48
48
  this.pattern && e.push(new RegExp(this.pattern));
49
49
  const t = {
package/lib/form/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { $one as n, formatClass as o, formatStyle as f } from "ph-utils/dom";
2
2
  import m from "../base.js";
3
- import { parseAttrValue as c, initAttr as u } from "../utils/index.js";
3
+ import { initAttr as c, parseAttrValue as u } from "../utils/index.js";
4
4
  import { random as d } from "ph-utils";
5
5
  import { emit as l, add as h, clear as v } from "../utils/event.js";
6
6
  import p from "ph-utils/validator";
@@ -25,7 +25,7 @@ class $ extends m {
25
25
  }
26
26
  attributeChangedCallback(t, e, i) {
27
27
  if (t === "disabled") {
28
- const a = c(i, !1, t);
28
+ const a = u(i, !1, t);
29
29
  a !== this.disabled && (l(this.id, "attributeChanged", t, a, this.id), this.disabled = a);
30
30
  } else if (t === "label-position") {
31
31
  const a = n("form", this.root);
@@ -37,7 +37,7 @@ class $ extends m {
37
37
  }
38
38
  }
39
39
  connectedCallback() {
40
- u(this), this.id || (this.id = `l-f${d(3)}-${d(6)}`), this.loadStyleText([b]), super.connectedCallback(), h(this.id, "ruleChange", this.ruleChange), h(this.id, "valueChange", this._valueChange);
40
+ c(this), this.id || (this.id = `l-f${d(3)}-${d(6)}`), this.loadStyleText([b]), super.connectedCallback(), h(this.id, "ruleChange", this.ruleChange), h(this.id, "valueChange", this._valueChange);
41
41
  }
42
42
  disconnectedCallback() {
43
43
  v(this.id), this.validator = void 0;
@@ -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
  }