litos-ui 0.7.0 → 0.9.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 (81) hide show
  1. package/lib/{animation-QfX4RtqD.js → animation-DttknHkX.js} +2 -2
  2. package/lib/base.d.ts +1 -3
  3. package/lib/base.js +26 -58
  4. package/lib/button/index.js +58 -62
  5. package/lib/color_picker/index.js +18 -20
  6. package/lib/form/form_events.js +15 -17
  7. package/lib/form/form_inner.js +43 -47
  8. package/lib/form/form_item.d.ts +1 -1
  9. package/lib/form/form_item.js +49 -53
  10. package/lib/form/index.d.ts +1 -1
  11. package/lib/form/index.js +58 -61
  12. package/lib/icon/arrow_down.js +4 -7
  13. package/lib/icon/arrow_left.js +4 -7
  14. package/lib/icon/arrow_right.js +4 -7
  15. package/lib/icon/arrow_up.js +4 -7
  16. package/lib/icon/base.js +21 -24
  17. package/lib/icon/caret_bottom.js +4 -7
  18. package/lib/icon/caret_top.js +4 -7
  19. package/lib/icon/font_icon.js +13 -17
  20. package/lib/icon/info.js +4 -7
  21. package/lib/icon/loading.js +4 -7
  22. package/lib/icon/mask_close.js +4 -7
  23. package/lib/icon/moon.js +4 -7
  24. package/lib/icon/reduction.js +4 -7
  25. package/lib/icon/refresh_left.js +4 -7
  26. package/lib/icon/refresh_right.js +4 -7
  27. package/lib/icon/search.js +4 -7
  28. package/lib/icon/sort.js +4 -7
  29. package/lib/icon/success.js +4 -7
  30. package/lib/icon/sun.js +4 -7
  31. package/lib/icon/theme_default.js +4 -7
  32. package/lib/icon/warn.js +4 -7
  33. package/lib/{index-B_9rPBWp.js → index-391POYEJ.js} +1 -1
  34. package/lib/index.d.ts +2 -10
  35. package/lib/index.js +62 -70
  36. package/lib/input/index.d.ts +1 -1
  37. package/lib/input/index.js +66 -70
  38. package/lib/list/index.d.ts +1 -1
  39. package/lib/list/index.js +26 -30
  40. package/lib/litos-ui.css +1 -1
  41. package/lib/litos-ui.min.js +1 -1
  42. package/lib/message/index.js +35 -33
  43. package/lib/polygon/index.d.ts +1 -1
  44. package/lib/polygon/index.js +14 -17
  45. package/lib/popconfirm/index.js +11 -17
  46. package/lib/popover/index.js +115 -120
  47. package/lib/radio/index.d.ts +2 -2
  48. package/lib/radio/index.js +65 -68
  49. package/lib/select_ori/index.d.ts +1 -1
  50. package/lib/select_ori/index.js +25 -29
  51. package/lib/switch/index.js +39 -48
  52. package/lib/tabbar/index.js +115 -123
  53. package/lib/theme/index.js +71 -74
  54. package/lib/theme/theme_color.js +17 -27
  55. package/lib/utils/event.js +16 -18
  56. package/lib/utils/index.js +48 -51
  57. package/lib/utils/transition.js +24 -34
  58. package/package.json +4 -1
  59. package/lib/browser.d.ts +0 -17
  60. package/lib/button/regist.d.ts +0 -2
  61. package/lib/button/regist.js +0 -7
  62. package/lib/form/types.js +0 -1
  63. package/lib/index-116dRdDj.js +0 -4
  64. package/lib/index-BUyxD_nH.js +0 -4
  65. package/lib/index-BeOxuMd4.js +0 -4
  66. package/lib/index-Bl8lRTJd.js +0 -4
  67. package/lib/index-BxlGVrX3.js +0 -4
  68. package/lib/index-C2D4YsFw.js +0 -4
  69. package/lib/index-C98Kx857.js +0 -4
  70. package/lib/index-CCcVpk6U.js +0 -4
  71. package/lib/index-CMz7GCCH.js +0 -4
  72. package/lib/index-D-Ikkdx0.js +0 -4
  73. package/lib/index-DJ70Xyma.js +0 -4
  74. package/lib/index-DKvzJmsR.js +0 -4
  75. package/lib/index-oNjb_IVt.js +0 -4
  76. package/lib/popconfirm/regist.d.ts +0 -2
  77. package/lib/popconfirm/regist.js +0 -7
  78. package/lib/popover/regist.d.ts +0 -2
  79. package/lib/popover/regist.js +0 -7
  80. package/lib/tabbar/regist.d.ts +0 -2
  81. package/lib/tabbar/regist.js +0 -7
@@ -1,37 +1,31 @@
1
- var h = Object.defineProperty;
2
- var m = (l, s, e) => s in l ? h(l, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[s] = e;
3
- var i = (l, s, e) => m(l, typeof s != "symbol" ? s + "" : s, e);
4
- import { formatClass as f, $one as o, addClass as c, removeClass as u } from "ph-utils/dom";
5
- import { initAttr as b, parseAttrValue as p } from "../utils/index.js";
6
- import v from "../base.js";
7
- import { emit as d, add as _, clear as C, remove as g } from "./form_events.js";
8
- import { random as n } from "ph-utils";
9
- class $ extends v {
1
+ import { formatClass as a, $one as i, addClass as n, removeClass as m } from "ph-utils/dom";
2
+ import { initAttr as d, parseAttrValue as f } from "../utils/index.js";
3
+ import h from "../base.js";
4
+ import { emit as o, add as c, clear as p, remove as b } from "./form_events.js";
5
+ import { random as s } from "ph-utils";
6
+ const u = ':host{display:contents}.l-form-item{display:var(--l-form-item-display, contents);font-size:14px;grid-template-columns:1fr}.l-form-item__label{text-align:var(--l-form-label-align, right);display:inline-block;width:var(--l-form-label-width, auto);height:var(--l-form-edit-height, 32px);line-height:var(--l-form-edit-height, 32px);color:#606266;padding:0 10px 0 0}.l-form-item__label:empty{display:var(--l-form-label-empty-display, inline-block)}.l-form-item.is-required .l-form-item__label:before{content:"*";margin-right:4px;color:var(--l-warn-color, #f56c6c);vertical-align:middle}.l-form-item__content{flex:1;position:relative;display:flex;align-items:center}.l-form-item__error{font-size:12px;line-height:1;position:absolute;top:100%;left:0;color:var(--nt-error-color, #ed3f13);padding-top:3px}.l-form-item.l-form-item--left{--l-form-label-align: left}.l-form-item.l-form-item--top{--l-form-item-display: grid;--l-form-label-align: left;--l-form-label-empty-display: none;grid-template-columns:1fr}';
7
+ class $ extends h {
8
+ static baseName = "form-item";
9
+ disabled = !1;
10
+ sharedAttrs = ["disabled", "id", "name", "innerBlock"];
11
+ /** 是否必须 */
12
+ required = !1;
13
+ error;
14
+ /** 标签文本 */
15
+ label;
16
+ id;
17
+ /** 内置验证规则: required - 必填, same:password - 一般用于验证确认密码和密码, phone - 验证电话号码 */
18
+ verify;
19
+ /** 验证失败错误信息 */
20
+ validity;
21
+ /** 自定义验证的正则 */
22
+ pattern;
23
+ name;
24
+ innerBlock = !1;
25
+ labelPosition = "right";
26
+ formId;
10
27
  constructor() {
11
- super();
12
- i(this, "disabled", !1);
13
- i(this, "sharedAttrs", ["disabled", "id", "name", "innerBlock"]);
14
- /** 是否必须 */
15
- i(this, "required", !1);
16
- i(this, "error");
17
- /** 标签文本 */
18
- i(this, "label");
19
- i(this, "id");
20
- /** 内置验证规则: required - 必填, same:password - 一般用于验证确认密码和密码, phone - 验证电话号码 */
21
- i(this, "verify");
22
- /** 验证失败错误信息 */
23
- i(this, "validity");
24
- /** 自定义验证的正则 */
25
- i(this, "pattern");
26
- i(this, "name");
27
- i(this, "innerBlock", !1);
28
- i(this, "labelPosition", "right");
29
- i(this, "formId");
30
- i(this, "_validateChange", (e, t) => {
31
- const r = e === !0 ? void 0 : e[this.name];
32
- (t == null || t === this.name && this.error != r) && (this.error = r, this._updateError());
33
- });
34
- b(this), this.id == null && (this.id = `l-fi${n(3)}-${n(6)}`);
28
+ super(), d(this), this.id == null && (this.id = `l-fi${s(3)}-${s(6)}`);
35
29
  }
36
30
  static get observedAttributes() {
37
31
  return ["error", "label", "disabled"];
@@ -42,30 +36,29 @@ class $ extends v {
42
36
  else if (e === "label")
43
37
  this.label = r, this._updateLabel();
44
38
  else if (e === "disabled") {
45
- const a = p(r, !1, e);
46
- a !== this.disabled && (d(this.id, "attributeChanged", e, a, this.id), this.disabled = a);
39
+ const l = f(r, !1, e);
40
+ l !== this.disabled && (o(this.id, "attributeChanged", e, l, this.id), this.disabled = l);
47
41
  }
48
42
  }
49
43
  connectedCallback() {
50
- var e;
51
- if (super.connectedCallback(), this.loadStyle(["form"]), this.formId = this._getFormId(), this.name && this.formId) {
52
- let t = ((e = this.verify) == null ? void 0 : e.split("|")) || [];
53
- this.pattern && t.push(new RegExp(this.pattern));
54
- const r = {
44
+ if (super.connectedCallback(), this.loadStyleText([u]), this.formId = this._getFormId(), this.name && this.formId) {
45
+ let e = this.verify?.split("|") || [];
46
+ this.pattern && e.push(new RegExp(this.pattern));
47
+ const t = {
55
48
  key: this.name,
56
49
  required: this.required,
57
50
  message: this.validity,
58
- rules: t
51
+ rules: e
59
52
  };
60
- d(this.formId, "ruleChange", r), _(this.formId, "validateChange", this._validateChange);
53
+ o(this.formId, "ruleChange", t), c(this.formId, "validateChange", this._validateChange);
61
54
  }
62
55
  }
63
56
  disconnectedCallback() {
64
- C(this.id), this.formId && g(this.formId, "validateChange", this._validateChange);
57
+ p(this.id), this.formId && b(this.formId, "validateChange", this._validateChange);
65
58
  }
66
59
  setRules(e) {
67
60
  const t = { ...e, key: this.name };
68
- t.required != null && this.required && (t.required = !0), this.formId && d(this.formId, "ruleChange", t);
61
+ t.required != null && this.required && (t.required = !0), this.formId && o(this.formId, "ruleChange", t);
69
62
  }
70
63
  setError(e) {
71
64
  this.error = e;
@@ -77,32 +70,36 @@ class $ extends v {
77
70
  this.error ? "is-error" : void 0,
78
71
  `l-form-item--${this.labelPosition}`
79
72
  ], t = this.label != null ? `<label class="l-form-item__label">${this.label}</label>` : "", r = this.error ? `<div class="l-form-item__error">${this.error}</div>` : "";
80
- this.shadow.innerHTML = [
81
- `<div class="${f(e)}">${t}`,
73
+ return [
74
+ `<div class="${a(e)}">${t}`,
82
75
  '<div class="l-form-item__content">',
83
76
  `<slot></slot>${r}</div></div>`
84
77
  ].join("");
85
78
  }
79
+ _validateChange = (e, t) => {
80
+ const r = e === !0 ? void 0 : e[this.name];
81
+ (t == null || t === this.name && this.error != r) && (this.error = r, this._updateError());
82
+ };
86
83
  _updateError() {
87
84
  if (!this.rendered) return;
88
- let e = o(".l-form-item__error", this.root);
85
+ let e = i(".l-form-item__error", this.root);
89
86
  if (e)
90
87
  this.error ? e.textContent = this.error : e.remove();
91
88
  else if (this.error) {
92
89
  e = document.createElement("div"), e.className = "l-form-item__error", e.textContent = this.error;
93
- const r = o(".l-form-item__content", this.root);
90
+ const r = i(".l-form-item__content", this.root);
94
91
  r && r.appendChild(e);
95
92
  }
96
- const t = o(".l-form-item", this.root);
97
- t && (this.error ? c(t, "is-error") : u(t, "is-error"));
93
+ const t = i(".l-form-item", this.root);
94
+ t && (this.error ? n(t, "is-error") : m(t, "is-error"));
98
95
  }
99
96
  _updateLabel() {
100
97
  if (!this.rendered) return;
101
- let e = o(".l-form-item__label", this.root);
98
+ let e = i(".l-form-item__label", this.root);
102
99
  if (e == null) {
103
100
  if (this.label != null) {
104
101
  e = document.createElement("div"), e.className = "l-form-item__label", e.textContent = this.label;
105
- const t = o(".l-form-item", this.root);
102
+ const t = i(".l-form-item", this.root);
106
103
  t && t.appendChild(e);
107
104
  }
108
105
  } else
@@ -122,7 +119,6 @@ class $ extends v {
122
119
  return e = null, t;
123
120
  }
124
121
  }
125
- i($, "baseName", "form-item");
126
122
  export {
127
123
  $ as default
128
124
  };
@@ -20,7 +20,7 @@ export default class Form extends BaseComponent {
20
20
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
21
21
  connectedCallback(): void;
22
22
  disconnectedCallback(): void;
23
- render(): void;
23
+ render(): string;
24
24
  ruleChange: (schema: SchemaType) => void;
25
25
  _valueChange: (name: string, value: any, valid?: boolean) => void;
26
26
  validateField(field: string | string[]): void;
package/lib/form/index.js CHANGED
@@ -1,94 +1,92 @@
1
- var v = Object.defineProperty;
2
- var m = (d, r, t) => r in d ? v(d, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[r] = t;
3
- var i = (d, r, t) => m(d, typeof r != "symbol" ? r + "" : r, t);
4
- import { $one as u, formatClass as n, formatStyle as b } from "ph-utils/dom";
5
- import C from "../base.js";
6
- import { initAttr as g, parseAttrValue as p } from "../utils/index.js";
7
- import { random as c } from "ph-utils";
8
- import { emit as l, add as f, clear as _ } from "./form_events.js";
9
- import y from "ph-utils/validator";
10
- class k extends C {
1
+ import { $one as n, formatClass as o, formatStyle as f } from "ph-utils/dom";
2
+ import m from "../base.js";
3
+ import { initAttr as c, parseAttrValue as u } from "../utils/index.js";
4
+ import { random as d } from "ph-utils";
5
+ import { emit as l, add as h, clear as v } from "./form_events.js";
6
+ import p from "ph-utils/validator";
7
+ const b = ":host{display:block}.l-form{display:grid;grid-template-columns:var(--l-form-label-width, auto) 1fr;row-gap:20px}.l-form-inline{display:flex;gap:20px;flex-flow:row wrap}.l-form.l-form-inline{--l-form-item-display: flex}.l-form.l-form--left{--l-form-label-align: left}.l-form.l-form--top{--l-form-item-display: grid;--l-form-label-align: left;--l-form-label-empty-display: none;grid-template-columns:1fr}";
8
+ class $ extends m {
9
+ static baseName = "form";
10
+ /** 是否行内表单 */
11
+ inline = !1;
12
+ labelPosition = "right";
13
+ labelWidth;
14
+ id;
15
+ disabled = !1;
16
+ sharedAttrs = ["disabled", "id", "innerBlock"];
17
+ validator;
18
+ innerBlock = !1;
19
+ novalidate = !1;
20
+ _data;
21
+ emit;
11
22
  constructor() {
12
- super();
13
- /** 是否行内表单 */
14
- i(this, "inline", !1);
15
- i(this, "labelPosition", "right");
16
- i(this, "labelWidth");
17
- i(this, "id");
18
- i(this, "disabled", !1);
19
- i(this, "sharedAttrs", ["disabled", "id", "innerBlock"]);
20
- i(this, "validator");
21
- i(this, "innerBlock", !1);
22
- i(this, "novalidate", !1);
23
- i(this, "_data");
24
- i(this, "emit");
25
- i(this, "ruleChange", (t) => {
26
- this.validator.addSchema(t);
27
- });
28
- i(this, "_valueChange", (t, s, e = !0) => {
29
- this._data == null && (this._data = {});
30
- const a = Object.hasOwn(this._data, t);
31
- this._data[t] = s, !this.novalidate && a && e && this.validator.validateKey(t, s, this._data).then(() => {
32
- l(this.id, "validateChange", !0, t);
33
- }).catch((h) => {
34
- l(this.id, "validateChange", h.detail, t);
35
- });
36
- });
37
- g(this), this.id == null && (this.id = `l-f${c(3)}-${c(6)}`), this.validator = new y([]), this.emit = new CustomEvent("submit");
23
+ super(), c(this), this.id == null && (this.id = `l-f${d(3)}-${d(6)}`), this.validator = new p([]), this.emit = new CustomEvent("submit");
38
24
  }
39
25
  static get observedAttributes() {
40
26
  return ["disabled", "label-position"];
41
27
  }
42
- attributeChangedCallback(t, s, e) {
28
+ attributeChangedCallback(t, e, a) {
43
29
  if (t === "disabled") {
44
- const a = p(e, !1, t);
45
- a !== this.disabled && (l(this.id, "attributeChanged", t, a, this.id), this.disabled = a);
30
+ const i = u(a, !1, t);
31
+ i !== this.disabled && (l(this.id, "attributeChanged", t, i, this.id), this.disabled = i);
46
32
  } else if (t === "label-position") {
47
- const a = u("form", this.root);
48
- a && (a.className = n([
33
+ const i = n("form", this.root);
34
+ i && (i.className = o([
49
35
  "l-form",
50
36
  this.inline ? "l-form-inline" : void 0,
51
- `l-form--${e}`
37
+ `l-form--${a}`
52
38
  ]));
53
39
  }
54
40
  }
55
41
  connectedCallback() {
56
- this.loadStyle(["form"]), super.connectedCallback(), f(this.id, "ruleChange", this.ruleChange), f(this.id, "valueChange", this._valueChange);
42
+ this.loadStyleText([b]), super.connectedCallback(), h(this.id, "ruleChange", this.ruleChange), h(this.id, "valueChange", this._valueChange);
57
43
  }
58
44
  disconnectedCallback() {
59
- _(this.id), this.validator = void 0;
45
+ v(this.id), this.validator = void 0;
60
46
  }
61
47
  render() {
62
- const t = n([
48
+ const t = o([
63
49
  "l-form",
64
50
  this.inline ? "l-form-inline" : void 0,
65
51
  `l-form--${this.labelPosition}`
66
- ]), s = b({
52
+ ]), e = f({
67
53
  "--l-form-label-width": this.labelWidth ? this.labelWidth : ""
68
54
  });
69
- this.shadow.innerHTML = `<form class="${t}" style="${s}"><slot></slot></form>`;
55
+ return `<form class="${t}" style="${e}"><slot></slot></form>`;
70
56
  }
57
+ ruleChange = (t) => {
58
+ this.validator.addSchema(t);
59
+ };
60
+ _valueChange = (t, e, a = !0) => {
61
+ this._data == null && (this._data = {});
62
+ const i = Object.hasOwn(this._data, t);
63
+ this._data[t] = e, !this.novalidate && i && a && this.validator.validateKey(t, e, this._data).then(() => {
64
+ l(this.id, "validateChange", !0, t);
65
+ }).catch((s) => {
66
+ l(this.id, "validateChange", s.detail, t);
67
+ });
68
+ };
71
69
  validateField(t) {
72
- const s = [];
70
+ const e = [];
73
71
  if (this._data != null) {
74
72
  if (Array.isArray(t))
75
- for (let e = 0, a = t.length; e < a; e++) {
76
- const h = t[e];
77
- s.push(this.validator.validateKey(h, this._data[h], this._data));
73
+ for (let a = 0, i = t.length; a < i; a++) {
74
+ const s = t[a];
75
+ e.push(this.validator.validateKey(s, this._data[s], this._data));
78
76
  }
79
77
  else
80
- s.push(
78
+ e.push(
81
79
  this.validator.validateKey(t, this._data[t], this._data)
82
80
  );
83
- Promise.allSettled(s).then((e) => {
84
- for (let a = 0, h = e.length; a < h; a++) {
85
- const o = e[a];
86
- o.status === "rejected" ? l(
81
+ Promise.allSettled(e).then((a) => {
82
+ for (let i = 0, s = a.length; i < s; i++) {
83
+ const r = a[i];
84
+ r.status === "rejected" ? l(
87
85
  this.id,
88
86
  "validateChange",
89
- o.reason.detail,
90
- o.reason.key
91
- ) : l(this.id, "validateChange", !0, o.value.key);
87
+ r.reason.detail,
88
+ r.reason.key
89
+ ) : l(this.id, "validateChange", !0, r.value.key);
92
90
  }
93
91
  });
94
92
  }
@@ -120,7 +118,6 @@ class k extends C {
120
118
  return { ...this._data };
121
119
  }
122
120
  }
123
- i(k, "baseName", "form");
124
121
  export {
125
- k as default
122
+ $ as default
126
123
  };
@@ -1,8 +1,6 @@
1
- var t = Object.defineProperty;
2
- var c = (e, a, r) => a in e ? t(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
3
- var n = (e, a, r) => c(e, typeof a != "symbol" ? a + "" : a, r);
4
- import l from "./base.js";
5
- class o extends l {
1
+ import a from "./base.js";
2
+ class n extends a {
3
+ static baseName = "arrow-down-icon";
6
4
  connectedCallback() {
7
5
  super.connectedCallback();
8
6
  }
@@ -10,7 +8,6 @@ class o extends l {
10
8
  return '<path fill="currentColor" d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path>';
11
9
  }
12
10
  }
13
- n(o, "baseName", "arrow-down-icon");
14
11
  export {
15
- o as default
12
+ n as default
16
13
  };
@@ -1,13 +1,10 @@
1
- var l = Object.defineProperty;
2
- var o = (e, a, r) => a in e ? l(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
3
- var t = (e, a, r) => o(e, typeof a != "symbol" ? a + "" : a, r);
4
- import n from "./base.js";
5
- class s extends n {
1
+ import r from "./base.js";
2
+ class t extends r {
3
+ static baseName = "arrow-left-icon";
6
4
  renderChildren() {
7
5
  return '<path fill="currentColor" d="M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"></path>';
8
6
  }
9
7
  }
10
- t(s, "baseName", "arrow-left-icon");
11
8
  export {
12
- s as default
9
+ t as default
13
10
  };
@@ -1,13 +1,10 @@
1
- var o = Object.defineProperty;
2
- var n = (r, a, e) => a in r ? o(r, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[a] = e;
3
- var t = (r, a, e) => n(r, typeof a != "symbol" ? a + "" : a, e);
4
- import s from "./base.js";
5
- class i extends s {
1
+ import r from "./base.js";
2
+ class t extends r {
3
+ static baseName = "arrow-right-icon";
6
4
  renderChildren() {
7
5
  return '<path fill="currentColor" d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"></path>';
8
6
  }
9
7
  }
10
- t(i, "baseName", "arrow-right-icon");
11
8
  export {
12
- i as default
9
+ t as default
13
10
  };
@@ -1,8 +1,6 @@
1
- var t = Object.defineProperty;
2
- var c = (e, a, r) => a in e ? t(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
3
- var l = (e, a, r) => c(e, typeof a != "symbol" ? a + "" : a, r);
4
- import n from "./base.js";
5
- class o extends n {
1
+ import a from "./base.js";
2
+ class l extends a {
3
+ static baseName = "arrow-up-icon";
6
4
  connectedCallback() {
7
5
  super.connectedCallback();
8
6
  }
@@ -10,7 +8,6 @@ class o extends n {
10
8
  return '<path fill="currentColor" d="m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"></path>';
11
9
  }
12
10
  }
13
- l(o, "baseName", "arrow-up-icon");
14
11
  export {
15
- o as default
12
+ l as default
16
13
  };
package/lib/icon/base.js CHANGED
@@ -1,33 +1,31 @@
1
- var u = Object.defineProperty;
2
- var p = (s, t, e) => t in s ? u(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var n = (s, t, e) => p(s, typeof t != "symbol" ? t + "" : t, e);
4
- import w from "../base.js";
5
- class v extends w {
1
+ import d from "../base.js";
2
+ const h = ":host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}";
3
+ class p extends d {
4
+ static baseName = "base-icon";
5
+ useLink;
6
+ viewBox;
6
7
  constructor() {
7
- super();
8
- n(this, "useLink");
9
- n(this, "viewBox");
10
- this.useLink = !1, this.viewBox = "0 0 1024 1024";
8
+ super(), this.useLink = !1, this.viewBox = "0 0 1024 1024";
11
9
  }
12
10
  connectedCallback() {
13
- this.loadStyle(["icon"]), this.render(), this.rendered = !0;
11
+ this.loadStyleText([h]), this.render(), this.rendered = !0;
14
12
  }
15
13
  render() {
16
- const e = this.createEl("svg"), h = this.getAttr("useLink", this.useLink), l = this.getAttr("viewBox", this.viewBox);
17
- e.classList.add("l-icon"), h || e.setAttribute("viewBox", l);
18
- const i = this.renderChildren();
19
- if (typeof i == "string")
20
- if (i === "") {
21
- const o = this.children, c = [];
22
- for (let r = 0, d = o.length; r < d; r++) {
23
- const a = o[r];
24
- c.push(a.outerHTML);
14
+ const e = this.createEl("svg"), r = this.getAttr("useLink", this.useLink), l = this.getAttr("viewBox", this.viewBox);
15
+ e.classList.add("l-icon"), r || e.setAttribute("viewBox", l);
16
+ const t = this.renderChildren();
17
+ if (typeof t == "string")
18
+ if (t === "") {
19
+ const s = this.children, n = [];
20
+ for (let i = 0, o = s.length; i < o; i++) {
21
+ const c = s[i];
22
+ n.push(c.outerHTML);
25
23
  }
26
- e.innerHTML = c.join("");
24
+ e.innerHTML = n.join("");
27
25
  } else
28
- e.innerHTML = i;
26
+ e.innerHTML = t;
29
27
  else
30
- e.append(i);
28
+ e.append(t);
31
29
  this.shadow.appendChild(e);
32
30
  }
33
31
  renderChildren() {
@@ -37,7 +35,6 @@ class v extends w {
37
35
  return document.createElementNS("http://www.w3.org/2000/svg", e);
38
36
  }
39
37
  }
40
- n(v, "baseName", "base-icon");
41
38
  export {
42
- v as default
39
+ p as default
43
40
  };
@@ -1,13 +1,10 @@
1
- var o = Object.defineProperty;
2
- var n = (t, e, r) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var a = (t, e, r) => n(t, typeof e != "symbol" ? e + "" : e, r);
4
- import s from "./base.js";
5
- class c extends s {
1
+ import t from "./base.js";
2
+ class a extends t {
3
+ static baseName = "caret-bottom-icon";
6
4
  renderChildren() {
7
5
  return '<path fill="currentColor" d="m192 384 320 384 320-384z"></path>';
8
6
  }
9
7
  }
10
- a(c, "baseName", "caret-bottom-icon");
11
8
  export {
12
- c as default
9
+ a as default
13
10
  };
@@ -1,13 +1,10 @@
1
- var o = Object.defineProperty;
2
- var n = (r, e, t) => e in r ? o(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var a = (r, e, t) => n(r, typeof e != "symbol" ? e + "" : e, t);
4
- import s from "./base.js";
5
- class c extends s {
1
+ import e from "./base.js";
2
+ class a extends e {
3
+ static baseName = "caret-top-icon";
6
4
  renderChildren() {
7
5
  return '<path fill="currentColor" d="M512 320 192 704h639.936z"></path>';
8
6
  }
9
7
  }
10
- a(c, "baseName", "caret-top-icon");
11
8
  export {
12
- c as default
9
+ a as default
13
10
  };
@@ -1,13 +1,10 @@
1
- var a = Object.defineProperty;
2
- var c = (n, e, t) => e in n ? a(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var r = (n, e, t) => c(n, typeof e != "symbol" ? e + "" : e, t);
4
- import l from "./base.js";
5
- class u extends l {
1
+ import i from "./base.js";
2
+ class a extends i {
3
+ static baseName = "font-icon";
4
+ _t;
5
+ _start;
6
6
  constructor() {
7
- super();
8
- r(this, "_t");
9
- r(this, "_start");
10
- this.useLink = !0, this._t = void 0, this._start = 0;
7
+ super(), this.useLink = !0, this._t = void 0, this._start = 0;
11
8
  }
12
9
  renderChildren() {
13
10
  return "";
@@ -25,20 +22,19 @@ class u extends l {
25
22
  }
26
23
  _loadIcon(t) {
27
24
  Date.now() - this._start >= 1e4 || (this._t = requestAnimationFrame(() => {
28
- const i = document.querySelector(`#${t}`);
29
- if (i == null) {
25
+ const e = document.querySelector(`#${t}`);
26
+ if (e == null) {
30
27
  this._loadIcon(t);
31
28
  return;
32
29
  }
33
30
  this._t = void 0;
34
- let s = i.getAttribute("viewBox");
35
- s || (s = "0 0 1024 1024");
36
- const o = this.shadow.querySelector("svg");
37
- o != null && (o.setAttribute("viewBox", s), o.innerHTML = i.innerHTML);
31
+ let n = e.getAttribute("viewBox");
32
+ n || (n = "0 0 1024 1024");
33
+ const r = this.shadow.querySelector("svg");
34
+ r != null && (r.setAttribute("viewBox", n), r.innerHTML = e.innerHTML);
38
35
  }));
39
36
  }
40
37
  }
41
- r(u, "baseName", "font-icon");
42
38
  export {
43
- u as default
39
+ a as default
44
40
  };
package/lib/icon/info.js CHANGED
@@ -1,8 +1,6 @@
1
- var n = Object.defineProperty;
2
- var r = (e, c, a) => c in e ? n(e, c, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[c] = a;
3
- var l = (e, c, a) => r(e, typeof c != "symbol" ? c + "" : c, a);
4
- import t from "./base.js";
5
- class o extends t {
1
+ import c from "./base.js";
2
+ class l extends c {
3
+ static baseName = "info-icon";
6
4
  connectedCallback() {
7
5
  super.connectedCallback();
8
6
  }
@@ -10,7 +8,6 @@ class o extends t {
10
8
  return '<path fill="currentColor" d="M512 64a448 448 0 110 896.064A448 448 0 01512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 01-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 017.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"></path>';
11
9
  }
12
10
  }
13
- l(o, "baseName", "info-icon");
14
11
  export {
15
- o as default
12
+ l as default
16
13
  };
@@ -1,13 +1,10 @@
1
- var t = Object.defineProperty;
2
- var s = (a, e, r) => e in a ? t(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
3
- var c = (a, e, r) => s(a, typeof e != "symbol" ? e + "" : e, r);
4
- import n from "./base.js";
5
- class o extends n {
1
+ import e from "./base.js";
2
+ class s extends e {
3
+ static baseName = "loading-icon";
6
4
  renderChildren() {
7
5
  return '<path d="M520.665 64.564a29.244 29.244 0 0 0-7.071-.894c-16.211 0-29.35 13.14-29.35 29.35 0 15.83 12.538 28.696 28.223 29.293v.073c.375 0 .751-.014 1.127-.014 216.493 0 389.629 173.942 389.629 390.433 0 216.496-173.136 388.827-389.63 388.827s-389.63-172.333-389.63-388.829c0-.27.01-.536.01-.804h-.01c0-16.209-13.141-29.35-29.35-29.35s-29.35 13.139-29.35 29.35c0 .055.007.11.007.164-.001.214-.007.425-.007.64 0 247.609 200.722 448.331 448.33 448.331 247.607 0 448.33-200.722 448.33-448.33-.002-245.242-196.917-444.456-441.258-448.24z" fill="currentColor"></path>';
8
6
  }
9
7
  }
10
- c(o, "baseName", "loading-icon");
11
8
  export {
12
- o as default
9
+ s as default
13
10
  };
@@ -1,8 +1,6 @@
1
- var a = Object.defineProperty;
2
- var o = (r, e, t) => e in r ? a(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var s = (r, e, t) => o(r, typeof e != "symbol" ? e + "" : e, t);
4
- import l from "./base.js";
5
- class c extends l {
1
+ import e from "./base.js";
2
+ class t extends e {
3
+ static baseName = "mask-close-icon";
6
4
  constructor() {
7
5
  super(), this.viewBox = "0 0 24 24";
8
6
  }
@@ -10,7 +8,6 @@ class c extends l {
10
8
  return '<path fill="currentColor" d="M12 23a11 11 0 100-22 11 11 0 000 22zM8.82 7.4L12 10.6l3.18-3.19 1.42 1.42L13.4 12l3.19 3.18-1.42 1.42L12 13.4 8.82 16.6 7.4 15.18 10.6 12 7.4 8.82 8.82 7.4z"></path>';
11
9
  }
12
10
  }
13
- s(c, "baseName", "mask-close-icon");
14
11
  export {
15
- c as default
12
+ t as default
16
13
  };