litos-ui 0.16.2 → 0.17.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.
@@ -1,90 +1,106 @@
1
- import { addClass as d, removeClass as p, $one as f, on as c, formatStyle as x, off as g, $ as m, $$ as a } from "ph-utils/dom";
2
- import { initAttr as C, parseAttrValue as o } from "../utils/index.js";
3
- import v from "../form/form_inner.js";
4
- import { add as $, remove as _ } from "../utils/event.js";
5
- import { i as w } from "../index-DvcllHRh.js";
6
- class j extends v {
1
+ import { $one as c, on as h, formatStyle as f, off as p, addClass as o, removeClass as u, $ as d, $$ as n } from "ph-utils/dom";
2
+ import { unitNumberStr as b, parseAttrValue as m } from "../utils/index.js";
3
+ import g from "../form/form_inner.js";
4
+ import { i as _ } from "../index-Blf4-a2-.js";
5
+ class I extends g {
7
6
  static baseName = "input";
8
- /** 原生 input 的 type */
9
- type = "text";
10
- placeholder = void 0;
11
- autosize = !1;
12
- /** 限制输入类型, number, integer */
13
- allowInput = void 0;
14
7
  /** 自定义输入解析器 */
15
8
  parser;
16
- /** 宽度 */
17
- width;
18
- /** 宽度铺满 */
19
- block = !1;
20
- error = !1;
21
- maxlength;
22
- minlength;
23
- inputmode = "text";
24
9
  $inner;
25
- #t = !1;
10
+ constructor() {
11
+ super(), this._state = {
12
+ type: "text",
13
+ placeholder: "",
14
+ autosize: !1,
15
+ allowInput: void 0,
16
+ block: !1,
17
+ clearable: !1
18
+ };
19
+ }
26
20
  set value(t) {
27
21
  this.setValue(t), this.$inner && (this.$inner.value = t);
28
22
  }
29
23
  get value() {
30
24
  return this.getValue();
31
25
  }
32
- get clearable() {
33
- return this.#t;
34
- }
35
- set clearable(t) {
36
- this.#t = t, t ? d(this, "l-input--clearable") : p(this, "l-input--clearable");
37
- }
38
26
  static get observedAttributes() {
39
- return ["disabled", "value", "name", "error", "clearable", "maxlength", "inputmode"];
27
+ return [
28
+ "disabled",
29
+ "value",
30
+ "name",
31
+ "inner-block",
32
+ "error",
33
+ "clearable",
34
+ "maxlength",
35
+ "minlength",
36
+ "inputmode",
37
+ "type",
38
+ "width",
39
+ "block"
40
+ ];
40
41
  }
41
42
  connectedCallback() {
42
- C(this), this.loadStyleText([w]), super.connectedCallback(), this.$inner = f(".l-input__inner", this.root), c(this.$inner, "input", this._input), c(this.$inner, "change", this.#s), this.style.cssText = x(this._getStyleObj()) + this.getAttr("style", ""), this.error && d(this, "is-error"), this.getName() && this.formAttrs.id && $(this.formAttrs.id, "validateChange", this._validateChange);
43
+ this.loadStyleText([_]), super.connectedCallback(), this.$inner = c(".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._updateError(this._state.error != null);
43
44
  }
44
45
  disconnectedCallback() {
45
- super.disconnectedCallback(), this.formAttrs.id && _(this.formAttrs.id, "validateChange", this._validateChange), g(this.$inner, "input", this._input);
46
- }
47
- attributeChange(t, l, e) {
48
- const s = o(e, this[t], t);
49
- if (s !== this[t] && (this[t] = s), t === "error") {
50
- const i = o(e, !1, t);
51
- i !== this.error && (this.error = i, this._updateError());
52
- } else if (t === "clearable") {
53
- const i = o(e, !1, t);
54
- i !== this.clearable && (this.clearable = i);
55
- } else if (t === "maxlength") {
56
- const i = o(e, this.maxlength);
57
- i !== this.maxlength && (this.maxlength = i);
46
+ super.disconnectedCallback(), p(this.$inner, "input", this._input);
47
+ }
48
+ attributeChange(t, s, e) {
49
+ switch (t) {
50
+ case "error":
51
+ case "maxlength":
52
+ case "minlength":
53
+ case "inputmode":
54
+ case "type":
55
+ this._state[t] = e;
56
+ break;
57
+ case "clearable":
58
+ case "block":
59
+ const a = m(e, !1, t);
60
+ this._state[t] = a;
61
+ break;
62
+ case "width":
63
+ this._state.width = b(e);
64
+ break;
58
65
  }
59
66
  }
67
+ updateDOM(t) {
68
+ t.has("clearable") && (this._state.clearable ? o(this, "l-input--clearable") : u(this, "l-input--clearable")), t.has("error") && this._updateError(this._state.error != null), t.has("maxlength") && this._updateAttr("maxlength", this._state.maxlength), t.has("minlength") && this._updateAttr("minlength", this._state.minlength), t.has("inputmode") && this._updateAttr("inputmode", this._state.inputmode), t.has("block") && this.innerBlockChange(this._state.block);
69
+ }
70
+ _updateAttr(t, s) {
71
+ this.$inner && (s ? this.$inner.setAttribute(t, s) : this.$inner.removeAttribute(t));
72
+ }
60
73
  render() {
61
74
  const t = document.createDocumentFragment();
62
- if (m('[slot="prefix"]', this).length > 0) {
63
- const i = a("slot", {
75
+ if (d('[slot="prefix"]', this).length > 0) {
76
+ const i = n("slot", {
64
77
  name: "prefix"
65
- }), r = a("span", {
78
+ }), l = n("span", {
66
79
  class: "l-input__prefix",
67
80
  part: "prefix"
68
81
  });
69
- r.appendChild(i), t.appendChild(r);
82
+ l.appendChild(i), t.appendChild(l);
70
83
  }
71
- const e = a("input", {
84
+ const e = n("input", {
72
85
  class: "l-input__inner",
73
86
  value: this.value,
74
- name: this.getName() || "",
75
- placeholder: this.placeholder || "",
87
+ name: this.getName(),
88
+ placeholder: this._state.placeholder,
76
89
  part: "default",
77
- type: this.type,
78
- inputmode: this.inputmode
90
+ type: this._state.type,
91
+ inputmode: this._state.inputmode,
92
+ maxlength: this._state.maxlength,
93
+ minlength: this._state.minlength,
94
+ disabled: this.isDisabled() ? !0 : void 0
79
95
  });
80
- if (this.isDisabled() && (e.disabled = !0), this.maxlength && e.setAttribute("maxlength", this.maxlength), this.minlength && e.setAttribute("minlength", this.minlength), t.appendChild(e), m('[slot="suffix"]', this).length > 0) {
81
- const i = a("slot", {
96
+ if (t.appendChild(e), d('[slot="suffix"]', this).length > 0) {
97
+ const i = n("slot", {
82
98
  name: "suffix"
83
- }), r = a("span", {
99
+ }), l = n("span", {
84
100
  class: "l-input__suffix",
85
101
  part: "suffix"
86
102
  });
87
- r.appendChild(i), t.appendChild(r);
103
+ l.appendChild(i), t.appendChild(l);
88
104
  }
89
105
  return t;
90
106
  }
@@ -95,94 +111,92 @@ class j extends v {
95
111
  setParser(t) {
96
112
  this.parser = t;
97
113
  }
114
+ _calcCurosorPosition(t, s) {
115
+ const e = t.selectionStart || 0, a = t.selectionEnd || 0, i = t.value;
116
+ let l = e, r = a;
117
+ s.length < i.length ? (l = Math.max(0, e - (i.length - s.length)), r = l) : s.length > i.length ? (l = Math.min(s.length, e + (s.length - i.length)), r = l) : (l = Math.min(s.length, e), r = l), t.value = s, t.setSelectionRange(l, r);
118
+ }
98
119
  _input = (t) => {
99
- const l = t.target;
100
- let e = l.value, s = "";
101
- if (this.allowInput != null) {
102
- let u = this.allowInput.indexOf("."), b = u === -1 ? u : parseInt(this.allowInput.substring(u + 1));
103
- s = this._numberInputParse(e, {
104
- integer: this.allowInput.includes("integer"),
105
- negative: this.allowInput.startsWith("-"),
106
- precision: b
107
- }), s = String(s);
120
+ const s = t.target;
121
+ let e = s.value, a = e;
122
+ if (this._state.allowInput != null) {
123
+ let i = this._state.allowInput.indexOf("."), l = i === -1 ? i : parseInt(this._state.allowInput.substring(i + 1));
124
+ a = this._numberInputParse(e, {
125
+ integer: this._state.allowInput.includes("integer"),
126
+ negative: this._state.allowInput.startsWith("-"),
127
+ precision: l
128
+ }), a = String(a);
108
129
  }
109
- this.parser != null && (s = this.parser(s));
110
- const i = l.selectionStart || 0, r = l.selectionEnd;
111
- let n = i, h = r;
112
- s.length < e.length ? (n = Math.max(0, i - (e.length - s.length)), h = n) : s.length > e.length ? (n = Math.min(s.length, i + (s.length - e.length)), h = n) : (n = Math.min(s.length, i), h = n), l.value = s, l.setSelectionRange(n, h), this.setValue(s), this.#e();
130
+ this.parser != null && (a = this.parser(a)), this._calcCurosorPosition(s, a), this.setValue(a), this.#t();
113
131
  };
114
- #e() {
115
- if (this.clearable) {
116
- let t = f(".l-clearable", this.root);
132
+ #t() {
133
+ if (this._state.clearable) {
134
+ let t = c(".l-clearable", this.root);
117
135
  if (this.value.length > 0) {
118
136
  if (t == null) {
119
- t = a("span", {
137
+ t = n("span", {
120
138
  class: "l-input__suffix l-clearable"
121
139
  });
122
- const l = a("l-close-filled-icon");
123
- t.appendChild(l), this.root.appendChild(t), c(t, "click", this.#i);
140
+ const s = n("l-close-filled-icon");
141
+ t.appendChild(s), this.root.appendChild(t), h(t, "click", this.#e);
124
142
  }
125
143
  } else
126
- t && (g(t, "click", this.#i), t.remove());
144
+ t && (p(t, "click", this.#e), t.remove());
127
145
  }
128
146
  }
129
- #i = () => {
147
+ #e = () => {
130
148
  this.value = "", this.dispatchEvent(
131
149
  new CustomEvent("input", {
132
150
  bubbles: !0,
133
151
  detail: { value: this.value }
134
152
  })
135
- ), this.#e();
153
+ ), this.#t();
136
154
  };
137
155
  disabledChange() {
138
156
  this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled());
139
157
  }
140
- _numberInputParse(t, l) {
158
+ _numberInputParse(t, s) {
141
159
  let e = t.trim();
142
160
  if (e === "") return "";
143
- let s = e.startsWith("-");
144
- if (s && (l.negative || (e = e.slice(1), s = !1)), l.integer)
161
+ let a = e.startsWith("-");
162
+ if (a && (s.negative || (e = e.slice(1), a = !1)), s.integer)
145
163
  e = e.replace(/[^\d]/g, "");
146
164
  else {
147
165
  const i = e.split(".");
148
166
  if (i.length > 2)
149
- e = i[0] + "." + i.slice(1).join("").substring(0, l.precision);
167
+ e = i[0] + "." + i.slice(1).join("").substring(0, s.precision);
150
168
  else if (i.length === 2) {
151
- const r = i[0].replace(/[^\d]/g, ""), n = i[1].replace(/[^\d]/g, "").substring(0, l.precision);
152
- e = `${r}.${n}`;
169
+ const l = i[0].replace(/[^\d]/g, ""), r = i[1].replace(/[^\d]/g, "").substring(0, s.precision);
170
+ e = `${l}.${r}`;
153
171
  } else
154
172
  e = e.replace(/[^\d]/g, "");
155
173
  }
156
- return e.length > 1 && (e = e.replace(/^0+(\d)/, "$1")), s ? "-" + e : e;
174
+ return e.length > 1 && (e = e.replace(/^0+(\d)/, "$1")), a ? "-" + e : e;
175
+ }
176
+ innerBlockChange(t) {
177
+ t ? o(this, "is-block") : u(this, "is-block");
157
178
  }
158
179
  _getStyleObj() {
159
180
  const t = {};
160
- return this._isBlock() && (t["--l-input-width"] = "100%"), this.width && (t["--l-input-width"] = this.width), t;
181
+ return this._state.width && (t["--l-input-width"] = this._state.width), t;
161
182
  }
162
- _isBlock() {
163
- return this.block === !0 || this.formItemAttrs.innerBlock === !0 || this.formAttrs.innerBlock === !0;
183
+ _updateError(t = !1) {
184
+ t ? o(this, "is-error") : u(this, "is-error");
164
185
  }
165
- _updateError() {
166
- this.error ? d(this, "is-error") : p(this, "is-error");
186
+ validResult(t) {
187
+ this._updateError(t != null);
167
188
  }
168
- _validateChange = (t, l) => {
169
- const e = this.getName();
170
- if (e) {
171
- const s = t === !0 ? !1 : t[e] != null;
172
- (l == null || l === e && this.error != s) && (this.error = s, this._updateError()), Object.keys(t)[0] === e && this.focus();
173
- }
174
- };
175
189
  #s = (t) => {
176
- const l = t.target;
190
+ const s = t.target;
177
191
  this.dispatchEvent(
178
192
  new CustomEvent("change", {
179
193
  bubbles: !0,
180
194
  composed: !0,
181
- detail: { value: l.value }
195
+ detail: { value: s.value, name: this.getName() }
182
196
  })
183
197
  );
184
198
  };
185
199
  }
186
200
  export {
187
- j as default
201
+ I as default
188
202
  };
@@ -89,7 +89,7 @@ class S extends x {
89
89
  class: "l-modal-container",
90
90
  part: "container"
91
91
  }), b = a("slot");
92
- if (f.appendChild(b), e.appendChild(f), this.getAttr("footer", !1)) {
92
+ if (f.appendChild(b), e.appendChild(f), this.getAttr("footer", !0)) {
93
93
  const d = a("footer", {
94
94
  class: "l-modal-footer",
95
95
  part: "footer"
@@ -1,7 +1,7 @@
1
1
  import a from "../form/form_inner.js";
2
2
  import { tagAttrs as c } from "../utils/index.js";
3
3
  import { $one as r, on as h, off as o } from "ph-utils/dom";
4
- import { i as d } from "../index-DvcllHRh.js";
4
+ import { i as d } from "../index-Blf4-a2-.js";
5
5
  class v extends a {
6
6
  static baseName = "select-ori";
7
7
  $select;
@@ -0,0 +1,9 @@
1
+ import BaseComponent from "../base";
2
+ export default class ContextProvide<T, V> extends BaseComponent<V> {
3
+ context: Signal<T>;
4
+ contextEventName: string;
5
+ constructor();
6
+ connectedCallback(): void;
7
+ disconnectedCallback(): void;
8
+ private contextProvideHandler;
9
+ }
@@ -0,0 +1,22 @@
1
+ import o from "../base.js";
2
+ import { on as c, off as a } from "ph-utils/dom";
3
+ class d extends o {
4
+ context;
5
+ contextEventName;
6
+ constructor() {
7
+ super(), this.contextEventName = "context-request";
8
+ }
9
+ connectedCallback() {
10
+ super.connectedCallback(), c(this, this.contextEventName, this.contextProvideHandler);
11
+ }
12
+ disconnectedCallback() {
13
+ super.disconnectedCallback(), a(this, this.contextEventName, this.contextProvideHandler);
14
+ }
15
+ contextProvideHandler(t) {
16
+ const { context: e, callback: n } = t.detail;
17
+ e === this.contextEventName && n(this.context);
18
+ }
19
+ }
20
+ export {
21
+ d as default
22
+ };
@@ -34,3 +34,5 @@ export declare function setAttrs(el: HTMLElement, attrs: [string, string | undef
34
34
  * @returns
35
35
  */
36
36
  export declare function kebabToCamel(attr: string): string;
37
+ export declare function stopSignal(fn?: SignalStop): undefined;
38
+ export declare function unitNumberStr(value?: string, unit?: string): string | undefined;
@@ -1,60 +1,68 @@
1
- import { isBlank as u } from "ph-utils";
2
- let m = -1;
3
- function b(t, e) {
4
- const s = Array.isArray(t) ? t : [t];
5
- for (const n of s) {
6
- const r = e || `l-${n.baseName}`;
7
- customElements.get(r) || customElements.define(r, n);
1
+ import { isNumeric as m, isBlank as a } from "ph-utils";
2
+ let p = -1;
3
+ function y(t, e) {
4
+ const n = Array.isArray(t) ? t : [t];
5
+ for (const r of n) {
6
+ const s = e || `l-${r.baseName}`;
7
+ customElements.get(s) || customElements.define(s, r);
8
8
  }
9
9
  }
10
- function y() {
11
- return `l-${++m}`;
10
+ function $() {
11
+ return `l-${++p}`;
12
12
  }
13
- function l(t, e, s) {
13
+ function l(t, e, n) {
14
14
  if (t == null) return e;
15
15
  switch (typeof e) {
16
16
  case "boolean":
17
- return ["", "true", "1", "on", s].includes(t);
17
+ return ["", "true", "1", "on", n].includes(t);
18
18
  case "number":
19
19
  return Number(t);
20
20
  default:
21
21
  return t;
22
22
  }
23
23
  }
24
- function $(t) {
24
+ function h(t) {
25
25
  const e = t.attributes;
26
- for (const s of e) {
27
- const { name: n, value: r } = s;
28
- if (n.startsWith("data-") || n.startsWith("aria-") || n.startsWith("_") || n.startsWith("$") || ["id", "class", "style"].includes(n))
26
+ for (const n of e) {
27
+ const { name: r, value: s } = n;
28
+ if (r.startsWith("data-") || r.startsWith("aria-") || r.startsWith("_") || r.startsWith("$") || ["id", "class", "style"].includes(r))
29
29
  continue;
30
- const i = n.split("-").map((c, f) => f === 0 ? c : c[0].toUpperCase() + c.slice(1)).join(""), o = l(r, t[i], n), a = Object.getOwnPropertyNames(t);
31
- (t._ignoreInitAttrs || []).includes(i) || (n === "value" ? (t[i] = o, t._resetValue = o) : (a.includes(i) || a.includes(`_${i}`)) && (t[i] = o));
30
+ const i = r.split("-").map((c, f) => f === 0 ? c : c[0].toUpperCase() + c.slice(1)).join(""), o = l(s, t[i], r), u = Object.getOwnPropertyNames(t);
31
+ (t._ignoreInitAttrs || []).includes(i) || (r === "value" ? (t[i] = o, t._resetValue = o) : (u.includes(i) || u.includes(`_${i}`)) && (t[i] = o));
32
32
  }
33
33
  }
34
- function p(t, e) {
35
- let s = "";
36
- return e === !0 ? s = ` ${t}` : typeof e == "string" && !u(e) && (s = ` ${t}="${e}"`), s;
34
+ function g(t, e) {
35
+ let n = "";
36
+ return e === !0 ? n = ` ${t}` : typeof e == "string" && !a(e) && (n = ` ${t}="${e}"`), n;
37
37
  }
38
- function h(t) {
39
- const e = t.map((s) => p(s[0], s[1]));
38
+ function N(t) {
39
+ const e = t.map((n) => g(n[0], n[1]));
40
40
  return e.length > 0 ? ` ${e.join("")}` : "";
41
41
  }
42
42
  function I(t, e) {
43
- for (const s of e) {
44
- const n = s[1], r = s[0];
45
- n === !0 ? t.setAttribute(r, "") : typeof n == "string" && !u(n) && t.setAttribute(r, n);
43
+ for (const n of e) {
44
+ const r = n[1], s = n[0];
45
+ r === !0 ? t.setAttribute(s, "") : typeof r == "string" && !a(r) && t.setAttribute(s, r);
46
46
  }
47
47
  }
48
- function N(t) {
49
- return t.replace(/-(\w)/g, (e, s) => s.toUpperCase());
48
+ function W(t) {
49
+ return t.replace(/-(\w)/g, (e, n) => n.toUpperCase());
50
+ }
51
+ function _(t) {
52
+ t && t();
53
+ }
54
+ function j(t, e = "px") {
55
+ return t && (m(t) ? `${t}${e}` : t);
50
56
  }
51
57
  export {
52
- $ as initAttr,
53
- N as kebabToCamel,
58
+ h as initAttr,
59
+ W as kebabToCamel,
54
60
  l as parseAttrValue,
55
- b as regist,
61
+ y as regist,
56
62
  I as setAttrs,
57
- p as tagAttr,
58
- h as tagAttrs,
59
- y as useId
63
+ _ as stopSignal,
64
+ g as tagAttr,
65
+ N as tagAttrs,
66
+ j as unitNumberStr,
67
+ $ as useId
60
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litos-ui",
3
- "version": "0.16.2",
3
+ "version": "0.17.0",
4
4
  "description": "基于 Web Component 的 UI 组件库",
5
5
  "keywords": [
6
6
  "component library",
@@ -42,26 +42,26 @@
42
42
  "docs:dev": "vitepress dev docs --force --host 0.0.0.0",
43
43
  "docs:build": "vitepress build docs",
44
44
  "docs:preview": "vitepress preview docs",
45
- "inspect:eslint": "eslint --inspect-config",
46
45
  "create": "node scripts/index.js create",
47
46
  "dts:build": "tsc -p tsconfig.build.json && node scripts/dts.js",
48
47
  "lib:build": "pnpm build && pnpm dts:build"
49
48
  },
50
49
  "dependencies": {
50
+ "alien-signals": "^3.1.2",
51
51
  "iconify-icon": "^3.0.2",
52
- "ph-utils": "^0.16.5",
52
+ "ph-utils": "^0.17.2",
53
53
  "qrcode-generator-es": "^2.1.2",
54
- "shiki": "^3.21.0"
54
+ "shiki": "^3.23.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@types/node": "^25.0.10",
57
+ "@types/node": "^25.3.1",
58
58
  "less": "^4.5.1",
59
59
  "lightningcss": "^1.31.1",
60
- "oxfmt": "^0.27.0",
61
- "oxlint": "^1.42.0",
60
+ "oxfmt": "^0.35.0",
61
+ "oxlint": "^1.50.0",
62
62
  "typescript": "^5.9.3",
63
63
  "vite": "^7.3.1",
64
64
  "vite-plugin-dts": "^4.5.4",
65
65
  "vitepress": "^1.6.4"
66
66
  }
67
- }
67
+ }
@@ -1,4 +0,0 @@
1
- const r = ":host{--l-check-size: 14px;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, 14px);height:var(--l-check-size, 14px);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;flex-shrink:0}.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,4 +0,0 @@
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
- };
@@ -1,30 +0,0 @@
1
- /**
2
- * 添加表单事件监听器。
3
- * @param formId - 表单的唯一标识符。
4
- * @param event - 要监听的事件类型
5
- * @param cb - 当事件触发时调用的回调函数,接收两个参数:属性名和属性值。
6
- * 该函数用于将回调函数添加到指定表单ID的事件监听器集合中。
7
- */
8
- export declare function add(channel: string, event: string, cb: (...param: any) => void): void;
9
- /**
10
- * 移除指定表单的事件监听器。
11
- * @param formId - 表单的唯一标识符。
12
- * @param event - 要移除的事件类型,可以是 'attributeChanged' 或 'formSubmitted'。
13
- * @param cb - 要移除的事件回调函数,该函数接收两个参数:属性名和属性值。
14
- * 该函数会从事件存储中移除指定的回调函数,如果某个事件类型下没有更多的回调函数,则删除该事件类型;
15
- * 如果表单下没有更多的事件类型,则删除该表单;如果事件存储为空,则重置事件存储。
16
- */
17
- export declare function remove(channel: string, event: string, cb: (...params: any) => void): void;
18
- /**
19
- * 清除事件存储。如果提供了ID,则删除特定ID的事件;如果没有提供ID,则清除所有事件。
20
- * 当事件存储为空时,将其设置为undefined。
21
- * @param id 可选参数,指定要删除的事件ID。
22
- */
23
- export declare function clear(channel?: string): void;
24
- /**
25
- * 触发指定表单的事件,并执行所有注册的回调函数。
26
- * @param id - 表单的唯一标识符。
27
- * @param event - 要触发的事件名称。
28
- * @param params - 要传递给回调函数的参数列表。
29
- */
30
- export declare function emit(channel: string, event: string, ...params: any): void;