litos-ui 0.2.0 → 0.3.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.
package/lib/base.js CHANGED
@@ -15,7 +15,7 @@ const a = (s, n, e) => {
15
15
  );
16
16
  });
17
17
  };
18
- class u extends HTMLElement {
18
+ class m extends HTMLElement {
19
19
  constructor(e = !0) {
20
20
  super();
21
21
  l(this, "rendered", !1);
@@ -47,7 +47,7 @@ class u extends HTMLElement {
47
47
  loadStyle(e) {
48
48
  for (let t = 0, r = e.length; t < r; t++) {
49
49
  const o = e[t];
50
- a(/* @__PURE__ */ Object.assign({ "./button/index.less": () => import("./index-Boq1Q7q9.js"), "./form/index.less": () => import("./index-ColsUDnt.js"), "./icon/index.less": () => import("./index-DZ2ZMrk1.js"), "./input/index.less": () => import("./index-B_9rPBWp.js"), "./radio/index.less": () => import("./index-CCcVpk6U.js") }), `./${o}/index.less`, 3).then((i) => {
50
+ a(/* @__PURE__ */ Object.assign({ "./button/index.less": () => import("./index-Boq1Q7q9.js"), "./form/index.less": () => import("./index-ColsUDnt.js"), "./icon/index.less": () => import("./index-oNjb_IVt.js"), "./input/index.less": () => import("./index-B_9rPBWp.js"), "./list/index.less": () => import("./index-D-Ikkdx0.js"), "./radio/index.less": () => import("./index-CCcVpk6U.js") }), `./${o}/index.less`, 3).then((i) => {
51
51
  this.createStyle(i.default);
52
52
  });
53
53
  }
@@ -81,7 +81,7 @@ class u extends HTMLElement {
81
81
  render() {
82
82
  }
83
83
  }
84
- l(u, "baseName", "base-component");
84
+ l(m, "baseName", "base-component");
85
85
  export {
86
- u as default
86
+ m as default
87
87
  };
package/lib/browser.d.ts CHANGED
@@ -6,3 +6,4 @@ import "./icon/index.less";
6
6
  import "./input/index.less";
7
7
  import "./form/index.less";
8
8
  import "./radio/index.less";
9
+ import "./list/index.less";
@@ -0,0 +1,4 @@
1
+ const t = ":host{display:block;overflow:auto;-webkit-overflow-scrolling:touch;height:100%;position:relative}.l-list-loadmore{padding:10px;display:flex;align-items:center;justify-content:center;color:#999}.l-list-icon{font-size:24px;margin-right:10px;transform:rotate3d(0,0,1,80deg)}";
2
+ export {
3
+ t as default
4
+ };
@@ -0,0 +1,4 @@
1
+ const i = ":host{display:inline-flex}.l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}";
2
+ export {
3
+ i as default
4
+ };
package/lib/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { default as FormItem } from "./form/form_item";
12
12
  export { default as Radio } from "./radio";
13
13
  export { default as Button } from "./button";
14
14
  export { default as Input } from "./input";
15
+ export { default as List } from "./list";
15
16
 
16
17
  declare global {
17
18
  interface HTMLElementTagNameMap {
@@ -27,5 +28,6 @@ declare global {
27
28
  "l-radio": import("./radio").default
28
29
  "l-button": import("./button").default
29
30
  "l-input": import("./input").default
31
+ "l-list": import("./list").default
30
32
  }
31
33
  }
package/lib/index.js CHANGED
@@ -1,31 +1,33 @@
1
1
  import { config as r, hideTransition as e, initAttr as a, parseAttrValue as f, regist as s, tagAttr as m, useId as d } from "./util.js";
2
2
  import { default as u } from "./message/index.js";
3
3
  import { default as l } from "./icon/base.js";
4
- import { default as I } from "./icon/arrow_down.js";
5
- import { default as i } from "./icon/caret_top.js";
4
+ import { default as i } from "./icon/arrow_down.js";
5
+ import { default as c } from "./icon/caret_top.js";
6
6
  import { default as A } from "./icon/caret_bottom.js";
7
7
  import { default as F } from "./icon/font_icon.js";
8
8
  import { default as w } from "./icon/loading.js";
9
- import { default as T } from "./icon/search.js";
10
- import { default as L } from "./form/index.js";
9
+ import { default as L } from "./icon/search.js";
10
+ import { default as D } from "./form/index.js";
11
11
  import { default as R } from "./form/form_item.js";
12
12
  import { default as V } from "./radio/index.js";
13
13
  import { default as j } from "./button/index.js";
14
14
  import { default as q } from "./input/index.js";
15
+ import { default as y } from "./list/index.js";
15
16
  export {
16
- I as ArrowDownIcon,
17
+ i as ArrowDownIcon,
17
18
  l as BaseIcon,
18
19
  j as Button,
19
20
  A as CaretBottomIcon,
20
- i as CaretTopIcon,
21
+ c as CaretTopIcon,
21
22
  F as FontIcon,
22
- L as Form,
23
+ D as Form,
23
24
  R as FormItem,
24
25
  q as Input,
26
+ y as List,
25
27
  w as LoadingIcon,
26
28
  u as Message,
27
29
  V as Radio,
28
- T as SearchIcon,
30
+ L as SearchIcon,
29
31
  r as config,
30
32
  e as hideTransition,
31
33
  a as initAttr,
@@ -0,0 +1,19 @@
1
+ import BaseComponent from "../base";
2
+ export default class List extends BaseComponent {
3
+ static baseName: string;
4
+ /** 是否已经全部加载完成 */
5
+ finish: boolean;
6
+ /** 是否显示无限加载模式 */
7
+ infinite: boolean;
8
+ private observer?;
9
+ private loadMoreEmit;
10
+ private $more?;
11
+ constructor();
12
+ static get observedAttributes(): string[] | null | undefined;
13
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ render(): void;
17
+ _loadingText(): "已经到底啦!" | "加载中……";
18
+ _finishChange(): void;
19
+ }
@@ -0,0 +1,62 @@
1
+ var h = Object.defineProperty;
2
+ var a = (o, t, i) => t in o ? h(o, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : o[t] = i;
3
+ var s = (o, t, i) => a(o, typeof t != "symbol" ? t + "" : t, i);
4
+ import c from "../base.js";
5
+ import { regist as f, initAttr as m, parseAttrValue as d } from "../util.js";
6
+ import b from "../icon/loading.js";
7
+ import { $one as r } from "ph-utils/dom";
8
+ f(b);
9
+ class v extends c {
10
+ constructor() {
11
+ super();
12
+ /** 是否已经全部加载完成 */
13
+ s(this, "finish", !1);
14
+ /** 是否显示无限加载模式 */
15
+ s(this, "infinite", !0);
16
+ s(this, "observer");
17
+ s(this, "loadMoreEmit");
18
+ s(this, "$more");
19
+ m(this), this.loadMoreEmit = new CustomEvent("load-more");
20
+ }
21
+ static get observedAttributes() {
22
+ return ["finish"];
23
+ }
24
+ attributeChangedCallback(i, e, l) {
25
+ if (i === "finish") {
26
+ const n = d(l, !1, i);
27
+ this.finish !== n && (this.finish = n, this._finishChange());
28
+ }
29
+ }
30
+ connectedCallback() {
31
+ this.loadStyle(["list"]), this.loadExternalStyle(["animation"]), super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((i) => {
32
+ i[0].isIntersecting && !this.finish && this.dispatchEvent(this.loadMoreEmit);
33
+ }), this.$more = r(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
34
+ }
35
+ disconnectedCallback() {
36
+ super.disconnectedCallback(), this.observer && (this.$more && (this.observer.unobserve(this.$more), this.$more = void 0), this.observer.disconnect(), this.observer = void 0), this.loadMoreEmit = void 0;
37
+ }
38
+ render() {
39
+ const i = ["<slot></slot>"];
40
+ this.infinite && (i.push('<div class="l-list-loadmore">'), this.finish || i.push(
41
+ '<l-loading-icon class="l-list-icon l-rotate-anim"></l-loading-icon>'
42
+ ), i.push(
43
+ `<span class="l-list-loadmore-text">${this._loadingText()}</span></div>`
44
+ )), this.root.innerHTML = i.join("");
45
+ }
46
+ _loadingText() {
47
+ return this.finish ? "已经到底啦!" : "加载中……";
48
+ }
49
+ _finishChange() {
50
+ if (this.$more) {
51
+ this.observer && (this.finish ? this.observer.unobserve(this.$more) : this.observer.observe(this.$more));
52
+ const i = r(".l-list-loadmore-text", this.$more);
53
+ i && (i.textContent = this._loadingText());
54
+ let e = r(".l-list-icon", this.$more);
55
+ this.finish ? e && e.remove() : e == null && (e = document.createElement("l-loading-icon"), e.className = "l-list-icon l-rotate-anim", this.$more.prepend(e));
56
+ }
57
+ }
58
+ }
59
+ s(v, "baseName", "list");
60
+ export {
61
+ v as default
62
+ };
package/lib/litos-ui.css CHANGED
@@ -1 +1 @@
1
- html,body{height:100%}body{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;margin:0;font-size:14px;line-height:1.6}img{vertical-align:top}ul,ol{margin:0;padding:0;list-style:none}div{box-sizing:border-box}a{color:#4998f6;cursor:pointer;text-decoration:none;transition:color .3s}a:hover{color:#5ba2f7}a:active{color:#64a7f7}p{color:#333;margin:5px 0;font-size:16px;line-height:1.4}l-button:not([text])+l-button{margin-left:10px}.l-message{color:var(--l-primary-color,#722ed1);z-index:1000;background:#f0faff;border:1px solid #d4eeff;border-radius:5px;align-items:center;padding:10px;font-size:14px;transition:opacity .3s,transform .3s,top .3s;display:flex;position:fixed;top:20px;left:50%;transform:translate(-50%)}.l-message .l-message-icon{margin-right:5px}.l-message.l-message-success{color:var(--l-success-color,#52c41a);background:#edfff3;border-color:#bbf2cf}.l-message.l-message-error{color:var(--l-error-color,#f5222d);background:#ffefe6;border-color:#ffcfb8}.l-message.l-message-warn{color:var(--l-warn-color,#f90);background:#fff9e6;border-color:#ffe7a3}.l-message-container{align-items:center;display:flex}.l-message-fade-enter-from,.l-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}@media screen and (max-width:768px){.l-message{width:90%}}@keyframes l-rotate-frame{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.l-rotate-anim{animation:1.5s linear infinite l-rotate-frame}.l-btn{--l-btn-text-color:#fff;--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;cursor:pointer;box-sizing:border-box;vertical-align:middle;height:var(--l-form-edit-height,32px);color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);border-radius:3px;outline:none;justify-content:center;align-items:center;gap:5px;padding:0 15px;font-size:14px;line-height:1;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.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:not(.l-btn-loading):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-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;height:auto;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-edit-height,32px)/2)}.l-btn-circle{width:var(--l-form-edit-height,32px);border-radius:50%;padding:0}.l-btn-block{width:100%}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}.l-icon{fill:currentColor;vertical-align:middle;width:1em;height:1em;display:inline-block}:host{width:var(--l-input-width,auto);display:inline-block}.l-input{box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height,32px);border:1px solid var(--l-border-color,#dedede);text-align:inherit;vertical-align:middle;border-radius:3px;outline:none;padding:0 5px;transition:border-color .3s}.l-input.is-error{--l-border-color:var(--nt-error-color,#ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color,#722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color,#f5f7fa)}:host{display:contents}.l-form{grid-template-columns:var(--l-form-label-width,auto)1fr;row-gap:20px;display:grid}.l-form-item{display:var(--l-form-item-display,contents);grid-template-columns:1fr;font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);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;display:inline-block}.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:"*";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}.l-form--left .l-form-item__label{text-align:left}.l-form--top{grid-template-columns:1fr}.l-form--top .l-form-item{grid-template-columns:1fr;display:grid}.l-form--top .l-form-item__label{text-align:left}.l-form--top .l-form-item__label:empty{display:none}.l-form-inline{flex-flow:wrap;gap:20px;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left,.l-form-item.l-form-item--left{--l-form-label-align:left}.l-form.l-form--top,.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}:host{align-items:center;display:flex}.l-radio{--l-radio-size:16px;--l-radio-label-color:#333;--l-radio-disabled-color:#e6e6e6;--l-radio-disabled-label-color:var(--l-disabled-color,#c0c4cc);--l-radio-checked-color:var(--l-primary-color,#722ed1);--l-radio-item-margin:10px;cursor:pointer;align-items:center;display:inline-flex;position:relative}.l-radio__label{margin-left:5px;transition:color .3s ease-in-out}.l-radio__input{z-index:-1;opacity:0;width:0;height:0;position:absolute}.l-radio__inner{width:var(--l-radio-size);height:var(--l-radio-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:50%;justify-content:center;align-items:center;transition:border-color .3s ease-in-out;display:flex}.l-radio__inner:before{content:"";background-color:#0000;border-radius:50%;width:60%;height:60%;transition:background-color .3s ease-in-out;display:block}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color,#722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}
1
+ html,body{height:100%}body{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;margin:0;font-size:14px;line-height:1.6}img{vertical-align:top}ul,ol{margin:0;padding:0;list-style:none}div{box-sizing:border-box}a{color:#4998f6;cursor:pointer;text-decoration:none;transition:color .3s}a:hover{color:#5ba2f7}a:active{color:#64a7f7}p{color:#333;margin:5px 0;font-size:16px;line-height:1.4}l-button:not([text])+l-button{margin-left:10px}.l-message{color:var(--l-primary-color,#722ed1);z-index:1000;background:#f0faff;border:1px solid #d4eeff;border-radius:5px;align-items:center;padding:10px;font-size:14px;transition:opacity .3s,transform .3s,top .3s;display:flex;position:fixed;top:20px;left:50%;transform:translate(-50%)}.l-message .l-message-icon{margin-right:5px}.l-message.l-message-success{color:var(--l-success-color,#52c41a);background:#edfff3;border-color:#bbf2cf}.l-message.l-message-error{color:var(--l-error-color,#f5222d);background:#ffefe6;border-color:#ffcfb8}.l-message.l-message-warn{color:var(--l-warn-color,#f90);background:#fff9e6;border-color:#ffe7a3}.l-message-container{align-items:center;display:flex}.l-message-fade-enter-from,.l-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}@media screen and (max-width:768px){.l-message{width:90%}}@keyframes l-rotate-frame{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.l-rotate-anim{animation:1.5s linear infinite l-rotate-frame}.l-btn{--l-btn-text-color:#fff;--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;cursor:pointer;box-sizing:border-box;vertical-align:middle;height:var(--l-form-edit-height,32px);color:var(--l-btn-text-color);background:var(--l-btn-background);border:1px solid var(--l-btn-border-color);border-radius:3px;outline:none;justify-content:center;align-items:center;gap:5px;padding:0 15px;font-size:14px;line-height:1;transition:border-color .3s,background-color .3s,color .3s;display:inline-flex;position:relative}.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:not(.l-btn-loading):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-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;height:auto;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-edit-height,32px)/2)}.l-btn-circle{width:var(--l-form-edit-height,32px);border-radius:50%;padding:0}.l-btn-block{width:100%}.l-btn:not(.l-btn-text)+.l-btn{margin-left:10px}html.dark .l-btn:disabled{--l-btn-disabled-background:#ffffff14;--l-btn-disabled-color:#ffffff4d;--l-btn-disabled-border-color:#ffffff4d}.l-icon{fill:currentColor;vertical-align:middle;width:1em;height:1em;display:inline-block}:host{width:var(--l-input-width,auto);display:inline-block}.l-input{box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height,32px);border:1px solid var(--l-border-color,#dedede);text-align:inherit;vertical-align:middle;border-radius:3px;outline:none;padding:0 5px;transition:border-color .3s}.l-input.is-error{--l-border-color:var(--nt-error-color,#ed3f13)}.l-input:not(.is-error):focus{border-color:var(--l-primary-color,#722ed1)}.l-input:disabled{cursor:not-allowed;background:var(--l-disabled-color,#f5f7fa)}:host{display:contents}.l-form{grid-template-columns:var(--l-form-label-width,auto)1fr;row-gap:20px;display:grid}.l-form-item{display:var(--l-form-item-display,contents);grid-template-columns:1fr;font-size:14px}.l-form-item__label{text-align:var(--l-form-label-align,right);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;display:inline-block}.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:"*";color:var(--l-warn-color,#f56c6c);vertical-align:middle;margin-right:4px}.l-form-item__content{flex:1;align-items:center;display:flex;position:relative}.l-form-item__error{color:var(--nt-error-color,#ed3f13);padding-top:3px;font-size:12px;line-height:1;position:absolute;top:100%;left:0}.l-form--left .l-form-item__label{text-align:left}.l-form--top{grid-template-columns:1fr}.l-form--top .l-form-item{grid-template-columns:1fr;display:grid}.l-form--top .l-form-item__label{text-align:left}.l-form--top .l-form-item__label:empty{display:none}.l-form-inline{flex-flow:wrap;gap:20px;display:flex}.l-form.l-form-inline{--l-form-item-display:flex}.l-form.l-form--left,.l-form-item.l-form-item--left{--l-form-label-align:left}.l-form.l-form--top,.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}:host{align-items:center;display:flex}.l-radio{--l-radio-size:16px;--l-radio-label-color:#333;--l-radio-disabled-color:#e6e6e6;--l-radio-disabled-label-color:var(--l-disabled-color,#c0c4cc);--l-radio-checked-color:var(--l-primary-color,#722ed1);--l-radio-item-margin:10px;cursor:pointer;align-items:center;display:inline-flex;position:relative}.l-radio__label{margin-left:5px;transition:color .3s ease-in-out}.l-radio__input{z-index:-1;opacity:0;width:0;height:0;position:absolute}.l-radio__inner{width:var(--l-radio-size);height:var(--l-radio-size);box-sizing:border-box;border:1px solid #dcddd9;border-radius:50%;justify-content:center;align-items:center;transition:border-color .3s ease-in-out;display:flex}.l-radio__inner:before{content:"";background-color:#0000;border-radius:50%;width:60%;height:60%;transition:background-color .3s ease-in-out;display:block}.l-radio.is-checked .l-radio__inner{border-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__inner:before{background-color:var(--l-primary-color,#722ed1)}.l-radio.is-checked .l-radio__label{color:var(--l-primary-color,#722ed1)}.l-radio--disabled{cursor:not-allowed}.l-radio--disabledd .l-radio__inner{border-color:var(--l-radio-disabled-color)}.l-radio--disabled .l-radio__label{color:var(--l-radio-disabled-label-color)}.l-radio:not(:first-child){margin-left:var(--l-radio-item-margin)}.l-radio--button .l-radio__label{height:var(--l-form-edit-height,32px);border:1px solid #c0c4cc;border-left-width:0;justify-content:center;align-items:center;margin-left:0;padding:0 15px;display:inline-flex}.l-radio--button:not(:first-of-type){margin-left:0}.l-radio--button:first-of-type .l-radio__label{border-left-width:1px;border-top-left-radius:3px;border-bottom-left-radius:3px}.l-radio--button:last-of-type .l-radio__label{border-top-right-radius:3px;border-bottom-right-radius:3px}.is-checked.l-radio--button .l-radio__label{background-color:var(--l-radio-checked-color);color:#fff;border-color:var(--l-radio-checked-color)}:host{-webkit-overflow-scrolling:touch;height:100%;display:block;position:relative;overflow:auto}.l-list-loadmore{color:#999;justify-content:center;align-items:center;padding:10px;display:flex}.l-list-icon{margin-right:10px;font-size:24px;transform:rotate(80deg)}
@@ -1 +1 @@
1
- var jt=Object.defineProperty;var Ot=(C,v,S)=>v in C?jt(C,v,{enumerable:!0,configurable:!0,writable:!0,value:S}):C[v]=S;var l=(C,v,S)=>Ot(C,typeof v!="symbol"?v+"":v,S);(function(){"use strict";var W;const C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",v="0123456789";function S(s,i=!0){return s==null?!0:(i&&typeof s=="string"?s.trim().length:s.length)===0}function y(s){if(typeof s=="object"&&s.min!=null&&s.max!=null){const i=Math.random(),t=s.hasEnd?1:0,e=i*(s.max-s.min+t)+s.min;return s.isInteger!==!1?Math.floor(e):e}else{if(typeof s=="object"&&s.length==null)throw new Error("random_length_cannot_null");let i=typeof s=="object"?s.length:s,t=C;typeof s=="object"&&s.hasLetter===!1&&(t=v);const e=Array.from({length:i},()=>t.charAt(y({min:0,max:t.length-1,hasEnd:!0}))).join("");return typeof s=="object"&&s.firstIsZero===!1&&e.indexOf("0")===0?y(s):e}}let yt=-1,U={prefix:"l"};function f(s,i){const t=`${U.prefix}-${s.baseName}`;customElements.get(t)||customElements.define(t,s)}function Ct(){return`${U.prefix}-${++yt}`}function k(s,i,t){if(s==null)return i;switch(typeof i){case"boolean":return s===""||s==="true"||s==="1"||s===t;case"number":return Number(s);default:return s}}function M(s){const i=s.attributes;for(const t of i){const{name:e,value:r}=t;if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("$"))continue;const a=e.split("-").map((h,d)=>d===0?h:h[0].toUpperCase()+h.slice(1)).join(""),o=k(r,s[a],e);s[a]=o,e==="value"&&(s._resetValue=o)}}function _(s,i){let t=" ";return i===!0?t=` ${s}`:typeof i=="string"&&!S(i)&&(t=` ${s}="${i}"`),t}function Y(s,i){return typeof s=="string"?(i||document).querySelectorAll(s):[s]}function F(s,i){return Y(s,i)}function b(s,i){return Y(s,i)[0]}function E(s,i){s.classList.add(i)}function L(s,i){s.classList.remove(i)}function G(s,i){return s.classList.contains(i)}function P(s,i,t,e=!1){let r={eventStop:!1};typeof e=="boolean"?r.once=e:r=e,r.eventFlag!=null?(s.setAttribute(r.eventFlag,"__stop__"),s.addEventListener(i,n=>{let a=n.target,o="";do o=a.getAttribute(r.eventFlag)||"",o===""&&(a=a.parentNode);while(o==="");(o!=="__stop__"||r.eventStop)&&t(n,a,o)},r)):s.addEventListener(i,t,r)}function H(s,i,t){s.removeEventListener(i,t)}function B(s,i){for(let t=0,e=s.length;t<e&&i(s[t],t)!==!0;t++);}function q(s,i,t){const e=s.getAttribute(i);if(t==null)return e;const r=typeof t;return e==null?t:r==="bigint"||r==="number"?e===""?t:Number(e):r==="boolean"?e===""||e==="1"||e==="true"||e===i:r==="object"?e===""?t:JSON.parse(e):e}function w(s){let i="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const r=s[t];r&&(i+=`${r} `)}else for(const t in s)s[t]&&(i+=`${t} `);return i.trim()}function z(s){let i="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const r=s[t];r&&(i+=`${r};`)}else for(const t in s){const e=s[t];e&&(i+=`${t}:${e};`)}return i}function kt(s,i,t){s.style.setProperty("display","none");const e=[];for(let r=0,n=i.length;r<n;r++){const a=i[r];s.style.setProperty(a[0],a[1]),e.push(`${a[0]} ${t}`)}queueMicrotask(()=>{s.style.removeProperty("display"),queueMicrotask(()=>{for(let r=0,n=i.length;r<n;r++){const a=i[r];s.style.removeProperty(a[0])}})})}function $t(s,i,t){for(let e=0,r=i.length;e<r;e++){const n=i[e];s.style.setProperty(n[0],n[1])}s.addEventListener("transitionend",()=>{s.style.display="none";for(let e=0,r=i.length;e<r;e++){const n=i[e];s.style.removeProperty(n[0])}t!=null&&t()},{once:!0})}class x extends HTMLElement{constructor(t=!0){super();l(this,"rendered",!1);t&&this.attachShadow({mode:"open"})}static get observedAttributes(){return[]}attributeChangedCallback(t,e,r){}get shadow(){return this.shadowRoot}get root(){return this.shadowRoot||this}createStyle(t){const e=document.createElement("style");e.textContent=t.trim(),this.shadow.appendChild(e)}createLink(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,this.shadow.appendChild(e)}loadStyle(t){{let e=document.querySelector("#litos-ui-style");e?this.createLink(e.href):queueMicrotask(()=>{e=document.querySelector("#litos-ui-style"),e&&this.createLink(e.href)})}}loadExternalStyle(t){}loadStyleText(t){this.createStyle(t)}setProperty(t,e){this[t]=e}setProperties(t){for(const e in t)this.setProperty(e,t[e])}getAttr(t,e){return q(this,t,e)}connectedCallback(){this.render(),this.rendered=!0}disconnectedCallback(){}render(){}}l(x,"baseName","base-component");class g extends x{constructor(){super();l(this,"useLink");l(this,"viewBox");this.useLink=!1,this.viewBox="0 0 1024 1024"}connectedCallback(){this.loadStyle(["icon"]),this.render()}render(){const t=this.createEl("svg"),e=this.getAttr("useLink",this.useLink),r=this.getAttr("viewBox",this.viewBox);t.classList.add("l-icon"),e||t.setAttribute("viewBox",r);const n=this.renderChildren();if(typeof n=="string")if(n===""){const a=this.children,o=[];for(let h=0,d=a.length;h<d;h++){const u=a[h];o.push(u.outerHTML),t.appendChild(u)}t.innerHTML=o.join("")}else t.innerHTML=n;else t.append(n);this.shadow.appendChild(t)}renderChildren(){return""}createEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}l(g,"baseName","base-icon");let J=(W=class extends g{renderChildren(){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>'}},l(W,"baseName","loading-icon"),W);const R=2,At=.16,St=.05,wt=.05,xt=.15,It=/rgba?\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/,Z=/^#(?:([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})|([0-9A-Fa-f]{1})([0-9A-Fa-f]{1})([0-9A-Fa-f]{1}))$/;function Mt(s){return s.r!=null&&s.g!=null&&s.b!=null}function Q(s){return s.h!=null&&s.s!=null&&s.v!=null}function Et(s){let i=s.match(It);if(i!=null){const t=parseInt(i[1].trim()),e=parseInt(i[2].trim()),r=parseInt(i[3].trim());if(isNaN(t)||isNaN(e)||isNaN(r))throw new Error("Invalid RGB color.");let n=1;return i[4]!=null&&(n=parseFloat(i[4].trim()),isNaN(n)&&(n=1)),{r:t,g:e,b:r,a:n}}}function Nt(s){const i=s.match(Z);if(i!=null){const t=i[4]!==void 0,e=parseInt(t?i[4]+i[4]:i[1],16),r=parseInt(t?i[5]+i[5]:i[2],16),n=parseInt(t?i[6]+i[6]:i[3],16);return{r:e,g:r,b:n}}}function D(s){if(typeof s=="string"){let i=Nt(s);if(i==null&&(i=Et(s)),i!=null)return i;throw new Error("Invalid color string")}else{if(Mt(s))return s;if(Q(s))return Rt(s);throw new Error("Invalid color")}}function Lt(s){if(Q(s))return s;const i=D(s),t=i.r/255,e=i.g/255,r=i.b/255;let n=Math.max(t,e,r),a=Math.min(t,e,r),o=n-a,h=n,d=n===0?0:o/n,u=0;if(n===a)u=0;else switch(n){case t:u=((e-r)/o+(e<r?6:0))/6;break;case e:u=((r-t)/o+2)/6;break;case r:u=((t-e)/o+4)/6;break}return u=u*360,{h:u,s:d,v:h}}function Rt(s){let i=s.s,t=s.v;i>1&&(i/=100),t>1&&(t/=100);const e=s.h;var r=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),a=t*(1-i),o=t*(1-n*i),h=t*(1-(1-n)*i);let d=0,u=0,p=0;switch(r){case 0:d=t,u=h,p=a;break;case 1:d=o,u=t,p=a;break;case 2:d=a,u=t,p=h;break;case 3:d=a,u=o,p=t;break;case 4:d=h,u=a,p=t;break;case 5:d=t,u=a,p=o;break}return d=Math.round(d*255),u=Math.round(u*255),p=Math.round(p*255),{r:d,g:u,b:p}}function Tt(s,i,t){let e;return Math.round(s.h)>=60&&Math.round(s.h)<=240?e=t?Math.round(s.h)-R*i:Math.round(s.h)+R*i:e=t?Math.round(s.h)+R*i:Math.round(s.h)-R*i,e<0?e+=360:e>=360&&(e-=360),e}function Vt(s,i,t){if(s.h===0&&s.s===0)return s.s;let e;return t?e=s.s-At*i:e=s.s+St*i,e>1&&(e=1),e<.06&&(e=.06),Number(e.toFixed(2))}function Ft(s,i,t){let e;return t?e=s.v+wt*i:e=s.v-xt*i,e>1&&(e=1),Number(e.toFixed(2))}function X(s){const i=t=>t.toString(16).padStart(2,"0");return`#${i(s.r)}${i(s.g)}${i(s.b)}`.toUpperCase()}function Pt(s){return typeof s=="string"&&Z.test(s)?s:X(D(s))}function tt(s,i=1,t=!0){const e=Lt(s);return Pt({h:Tt(e,i,t),s:Vt(e,i,t),v:Ft(e,i,t)})}f(J);class et extends x{constructor(){super();l(this,"htmlType","button");l(this,"_handleClick",t=>{const e=t.target,r=q(e,"html-type");if(r==="reset"||r==="submit"){const n=this._getForm();n&&(r==="reset"?n.reset():r==="submit"&&n.submit())}});M(this)}static get observedAttributes(){return["loading","color"]}attributeChangedCallback(t,e,r){const n=b(".l-button",this.root);if(n){if(t==="loading")k(r,!1,t)?(E(n,"l-btn-loading"),n.disabled=!0,n.innerHTML=this.loadingBody()):(L(n,"l-btn-loading"),n.disabled=this.getAttr("disabled",!1),n.innerHTML="<slot></slot>");else if(t==="color"){const a=this.getAttr("text",!1),o=this.getAttr("ghost",!1);n.style.cssText=this.applyColor(r,a,o)}}}connectedCallback(){this.loadStyle(["button"]),this.loadExternalStyle(["animation"]),this.render(),(this.htmlType==="reset"||this.htmlType==="submit")&&P(this,"click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),(this.htmlType==="reset"||this.htmlType==="submit")&&H(this,"click",this._handleClick)}render(){const t=this.getAttr("type","normal"),e=document.createElement("button"),r=this.getAttr("loading",!1),n=this.getAttr("shape","default"),a=this.getAttr("text",!1),o=this.getAttr("ghost",!1),h=["l-btn",`l-btn-${t}`,this.getAttr("block",!1)?"l-btn-block":"",n==="round"?"l-btn-round":"",n==="circle"?"l-btn-circle":"",o?"l-btn-ghost":"",a?"l-btn-text":"",r?"l-btn-loading":""];e.className=w(h),e.disabled=this.getAttr("disabled",!1)||r,e.type=this.getAttr("html-type","button");const d=this.applyColor(this.getAttr("color"),a,o);d&&(e.style.cssText=d),r?e.innerHTML=this.loadingBody():e.innerHTML="<slot></slot>",e.setAttribute("part","default"),this.root.appendChild(e)}loadingBody(){const t=this.getAttr("loading-text",""),e=['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];return t===""?e.push("<slot></slot>"):e.push(`<span>${t}</span>`),e.join("")}applyColor(t,e=!1,r=!1){if(!t)return"";const n=tt(t,1,!0),a=tt(t,3,!1);return z({"--l-btn-border-color":e?"transparent":t,"--l-btn-text-color":r||e?t:"#ffffff","--l-btn-hover-text-color":r||e?n:"#ffffff","--l-btn-background":r||e?"transparent":t,"--l-btn-active-text-color":r||e?a:"#ffffff","--l-btn-hover-border-color":e?"transparent":n,"--l-btn-hover-background":r||e?"transparent":n,"--l-btn-active-background":r||e?"transparent":a,"--l-btn-active-border-color":e?"transparent":a})}_getForm(){let t=this.parentElement,e;for(;t!=null;){const r=t.tagName;if(r==="L-FORM"){e=t;break}if(r==="BODY")break;t=t.parentElement}return t=null,e}}l(et,"baseName","button");let c;function $(s,i,t){c==null&&(c=new Map),c.has(s)||c.set(s,new Map([[i,new Set]])),c.get(s).has(i)||c.get(s).set(i,new Set),c.get(s).get(i).add(t)}function N(s,i,t){var e,r,n,a,o,h;(r=(e=c==null?void 0:c.get(s))==null?void 0:e.get(i))==null||r.delete(t),((a=(n=c==null?void 0:c.get(s))==null?void 0:n.get(i))==null?void 0:a.size)==0&&((o=c.get(s))==null||o.delete(i)),((h=c==null?void 0:c.get(s))==null?void 0:h.size)==0&&c.delete(s),(c==null?void 0:c.size)==0&&(c=void 0)}function st(s){s==null?c!=null&&(c.clear(),c=void 0):c!=null&&(c.delete(s),c.size===0&&(c=void 0))}function m(s,i,...t){var r;const e=(r=c==null?void 0:c.get(s))==null?void 0:r.get(i);if(e!=null)for(const n of e)n(...t)}class rt extends x{constructor(t=!0){super();l(this,"disabled",!1);l(this,"name");l(this,"formAttrs",{});l(this,"formItemAttrs",{});l(this,"_value","");l(this,"_resetValue");l(this,"_firstPushValue",!0);l(this,"_reseting",!1);l(this,"_formAttributeChanged",(t,e,r)=>{r===this.formAttrs.formId?this.formAttrs[t]=e:this.formItemAttrs[t]=e,t==="disabled"&&this._changeDisabled()});l(this,"_resetFieldValue",()=>{this._reseting=!0,this.reset()});this._firstPushValue=t}set value(t){this.setValue(t)}get value(){return this.getValue()}setValue(t){this._value=t,this.pushValueChange()}getValue(){return this._value}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,r){if(t==="disabled"){const n=k(r,!1,t);n!==this.disabled&&(this._changeDisabled(),this.disabled=n)}else this.attributeChange(t,e,r)}attributeChange(t,e,r){}connectedCallback(){const t=this._getForm();this.formAttrs=t.formAttr,this.formItemAttrs=t.formItemAttr,this.formAttrs.id&&($(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),$(this.formAttrs.id,"reset",this._resetFieldValue),this._firstPushValue&&this.pushValueChange()),this.formItemAttrs.id&&$(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),this.render()}disconnectedCallback(){this.formAttrs.id&&(N(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),N(this.formAttrs.id,"reset",this._resetFieldValue)),this.formItemAttrs.id&&N(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged)}isDisabled(){return this.disabled===!0||this.formItemAttrs.disabled===!0?!0:this.formAttrs.disabled||!1}getName(){return this.name?this.name:this.formItemAttrs.name}_getForm(){let t=this.parentElement,e={},r={};for(;t!=null;){const n=t.tagName;if(n==="L-FORM"){const a=t.sharedAttrs;for(let o=0;o<a.length;o++){const h=a[o];e[h]=t[h]}break}if(n==="BODY")break;if(n==="L-FORM-ITEM"){const a=t.sharedAttrs;for(let o=0;o<a.length;o++){const h=a[o];r[h]=t[h]}}t=t.parentElement}return t=null,{formAttr:e,formItemAttr:r}}_changeDisabled(){}pushValueChange(){const t=this.getName();this.formAttrs.id&&t&&m(this.formAttrs.id,"valueChange",t,this._value,!this._reseting),this._reseting=!1}reset(){this.value=this._resetValue||""}}class it extends rt{constructor(){super();l(this,"type","text");l(this,"placeholder");l(this,"autosize",!1);l(this,"allowInput");l(this,"parser");l(this,"width");l(this,"block",!1);l(this,"error",!1);l(this,"$input");l(this,"_input",t=>{const e=t.target;let r=e.value;if(this.allowInput!=null){let n=this.allowInput.indexOf("."),a=n===-1?n:parseInt(this.allowInput.substring(n+1));r=this._numberInputParse(r,{integer:this.allowInput.includes("integer"),negative:this.allowInput.startsWith("-"),precition:a}),r=String(r),e.value=r}this.parser!=null&&(r=this.parser(r),e.value=r),this.setValue(r)});l(this,"_validateChange",(t,e)=>{const r=this.getName();if(r){const n=t===!0?!1:t[r]!=null;(e==null||e===r&&this.error!=n)&&(this.error=n,this._updateError()),Object.keys(t)[0]===r&&this.focus()}});M(this)}set value(t){this.setValue(t),this.$input!=null&&(this.$input.value=this.value)}get value(){return this.getValue()}static get observedAttributes(){return["disabled","error"]}connectedCallback(){super.connectedCallback(),this.loadStyle(["input"])}disconnectedCallback(){super.disconnectedCallback(),this.formAttrs.id&&N(this.formAttrs.id,"validateChange",this._validateChange),H(this.$input,"input",this._input),this.$input=void 0}attributeChange(t,e,r){if(t==="error"){const n=k(r,!1,t);n!==this.error&&(this.error=n,this._updateError())}}render(){let t=_("value",this.value);const e=_("placeholder",this.placeholder),r=_("disabled",this.isDisabled()),n=w({"l-input":!0,"is-autosize":this.autosize,"is-error":this.error}),a=this.getName(),o=_("name",a),h=`${t}${o}${e}${r}`;this.shadow.innerHTML=`<input part="default" type="${this.type}" class="${n}"${h}></input>`,this.$input=b("input",this.root),P(this.$input,"input",this._input),this.style.cssText=z(this._getStyleObj())+this.getAttr("style",""),a&&this.formAttrs.id&&$(this.formAttrs.id,"validateChange",this._validateChange)}setParser(t){this.parser=t}focus(){var t;(t=this.$input)==null||t.focus()}_changeDisabled(){this.$input!=null&&(this.$input.disabled=this.isDisabled())}_numberInputParse(t,e){let r=t,n=e.negative?"-?":"";if(e.integer){const o=r.match(new RegExp(`^(${n}\\d*)`));return o!=null?o[1]:r.substring(0,r.length-1)}const a=r.match(new RegExp(`(${n}\\d+\\.\\d{0,${e.precition}})|(${n}\\d*)`));return a!=null?r=a[1]||a[2]:r="",a!=null?a[1]||a[2]:""}_getStyleObj(){const t={};return this._isBlock()&&(t["--l-input-width"]="100%"),this.width&&(t["--l-input-width"]=this.width),t}_isBlock(){if(this.block===!0||this.formItemAttrs.innerBlock===!0||this.formAttrs.innerBlock===!0)return!0}_updateError(){this.$input&&(this.error?E(this.$input,"is-error"):L(this.$input,"is-error"))}}l(it,"baseName","input");class nt extends g{connectedCallback(){super.connectedCallback()}renderChildren(){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>'}}l(nt,"baseName","arrow-down-icon");class at extends g{renderChildren(){return'<path fill="currentColor" d="M512 320 192 704h639.936z"></path>'}}l(at,"baseName","caret-top-icon");class lt extends g{renderChildren(){return'<path fill="currentColor" d="m192 384 320 384 320-384z"></path>'}}l(lt,"baseName","caret-bottom-icon");class ot extends g{constructor(){super();l(this,"_t");l(this,"_start");this.useLink=!0,this._t=void 0,this._start=0}renderChildren(){return""}render(){super.render()}disconnectedCallback(){this._t!=null&&(cancelAnimationFrame(this._t),this._t=void 0)}connectedCallback(){super.connectedCallback();const t=this.getAttribute("name");this._start=Date.now(),t&&this._loadIcon(t)}_loadIcon(t){Date.now()-this._start>=1e4||(this._t=requestAnimationFrame(()=>{const r=document.querySelector(`#${t}`);if(r==null){this._loadIcon(t);return}this._t=void 0;let n=r.getAttribute("viewBox");n||(n="0 0 1024 1024");const a=this.shadow.querySelector("svg");a!=null&&(a.setAttribute("viewBox",n),a.innerHTML=r.innerHTML)}))}}l(ot,"baseName","font-icon");class ht extends g{renderChildren(){return'<path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"></path>'}}l(ht,"baseName","search-icon");class ct extends g{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){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>'}}l(ct,"baseName","mask-close-icon");class dt extends g{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m307.2 368.64L467.626667 730.453333c0 3.413333-3.413333 3.413333-3.413334 6.826667-13.653333 13.653333-37.546667 13.653333-51.2 0l-177.493333-177.493333c-13.653333-13.653333-13.653333-37.546667 0-51.2 13.653333-13.653333 37.546667-13.653333 51.2 0l150.186667 153.6 334.506666-341.333334c13.653333-13.653333 37.546667-13.653333 51.2 0 10.24 10.24 10.24 34.133333-3.413333 47.786667z m0 0"></path>'}}l(dt,"baseName","success-icon");class ut extends g{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 1024C229.234 1024 0 794.766 0 512S229.234 0 512 0s512 229.234 512 512-229.234 512-512 512z m-64.853-734.52l19.484 244.906 1.309 16.156c1.251 15.93 15.018 28.644 30.72 28.644h25.571c15.56 0 29.298-12.601 30.663-28.132l1.422-16.668 21.334-244.907c3.214-36.978-24.434-66.844-61.725-66.844h-6.627c-37.462 0-65.138 29.923-62.18 66.844zM512 801.393a66.788 66.788 0 1 0 0-133.575 66.788 66.788 0 0 0 0 133.575z"></path>'}}l(ut,"baseName","warn-icon");class ft extends g{connectedCallback(){super.connectedCallback()}renderChildren(){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>'}}l(ft,"baseName","info-icon"),f(ct),f(dt),f(ut),f(ft);const I=[],mt=[["opacity","0"],["transform","translate3d(-50%, -100%, 0)"]];function bt(s){const i=I.findIndex(n=>n.id===s);if(i===-1)return;const t=I.splice(i,1)[0];if(t==null)return;$t(t,mt,()=>{t.remove()});const e=15+t.offsetHeight,r=I.length;if(r!==0)for(let n=i;n<r;n++){const a=I[n],o=parseInt(a.style.top,10)-e;a.style.setProperty("top",`${o}px`)}}function Ht(s){const i=document.createElement("div");i.id=s.id;const t=s.type||"info";let e=`l-message l-message-${t}`;s.customClass&&(e+=" "+s.customClass),i.className=e,i.style.setProperty("top",`${s.offset}px`),i.style.setProperty("z-index",`${s.zindex||1e3}`),s.width&&i.style.setProperty("width",s.width);let r=t;return r==="error"&&(r="mask-close"),i.innerHTML=['<div class="l-message-container">',`<l-${r}-icon class="l-message-icon"></l-${r}-icon>`,`<span class="l-message-content">${s.message}</span>`,"</div>"].join(""),i}const T=s=>{const i=I.reduce((a,o)=>a+o.offsetHeight+15,15),t=Ct(),e=typeof s=="string"?{message:s}:s;e.id=t,e.offset=i;const r=Ht(e);I.push(r),document.body.appendChild(r),kt(r,mt);let n=e.duration;return n==null&&(n=3e3),n!==0&&setTimeout(()=>{bt(t)},n),t};for(const s of["info","success","error","warn","show"])T[s]=i=>{const t=typeof i=="string"?{message:i}:i;return s!=="show"?t.type=s:t.type==null&&(t.type="info"),T(t)};T.close=bt;const j={mobile:"请输入正确的手机号",same:"两次输入不一致",required:"%s为必填字段"},O="请输入正确的数据",A={same:/^same:(.+)$/i,mobile:/^1[345678]\d{9}$/,required:/^\S{1}.*/},K={same(s,i){return i===s},pattern(s,i){return i==null?!1:s.test(String(i))}};class gt extends Error{constructor(i,t,e){super(e),this.name="ValidateError",this.key=t,this.detail=i}}class Bt{constructor(i){this.rules={},this.addSchemas(i)}addSchemas(i){for(let t of i)this.rules[t.key]=this._parseSchemaRules(t)}addSchema(i){this.rules[i.key]=this._parseSchemaRules(i)}async validate(i,t=!1){return new Promise((e,r)=>{const n={};let a,o;for(let h in this.rules){let d=this._validateRule(this.rules[h],i[h],i);if(d!==""&&(d=d.replace("%s",h),n[h]=d,a=h,o=d,t))break}a==null?e(!0):r(new gt(n,a,o))})}async validateKey(i,t,e){return new Promise((r,n)=>{let a=this.rules[i];if(a==null){r({key:i,value:t});return}let o=this._validateRule(a,t,e);o!==""?(o=o.replace("%s",i),n(new gt({[i]:o},i,o))):r({key:i,value:t})})}_validateRule(i,t,e){let r="";for(let n of i)if(n.rule==="required"?(t==null||!K.pattern(A.required,t))&&(r=n.message):typeof n.rule=="function"?n.rule(t)||(r=n.message):n.sameKey!=null?e!=null&&(K.same(t,e[n.sameKey])||(r=n.message)):K.pattern(n.rule,t)||(r=n.message),r!=="")break;return r}_parseSchemaRules(i){let t=[],e=i.rules;if(i.required===!0&&t.push(...this._parseStringRule("required",i.message)),e!=null)if(typeof e=="string")t=t.concat(this._parseStringRule(e,i.message));else if(e instanceof Array)for(let r of e)typeof r=="string"?t.push(...this._parseStringRule(r,i.message)):r instanceof RegExp||typeof r=="function"?t.push({rule:r,message:i.message||O}):typeof r.rule=="string"?t.push(...this._parseStringRule(r.rule,r.message)):t.push({rule:r.rule,message:r.message||O});else t.push({rule:e,message:O});return t}_parseStringRule(i,t){let e=[],r=i.split("|");for(let n of r){let a=t,o=null,h;if(i==="required")o="required",a=a||t||j.required;else if(A.same.test(n)){if(n.match(A.same)!=null){o=A.same;let u=n.match(A.same);u!=null&&(h=u[1]),a=a||j.same}}else Object.hasOwn(A,n)&&(o=A[n],a=a||j[n]);e.push({rule:o,message:a,sameKey:h})}return e}}class pt extends x{constructor(){super();l(this,"inline",!1);l(this,"labelPosition","right");l(this,"labelWidth");l(this,"id");l(this,"disabled",!1);l(this,"sharedAttrs",["disabled","id","innerBlock"]);l(this,"validator");l(this,"innerBlock",!1);l(this,"novalidate",!1);l(this,"_data");l(this,"emit");l(this,"ruleChange",t=>{this.validator.addSchema(t)});l(this,"_valueChange",(t,e,r=!0)=>{this._data==null&&(this._data={});const n=Object.hasOwn(this._data,t);this._data[t]=e,!this.novalidate&&n&&r&&this.validator.validateKey(t,e,this._data).then(()=>{m(this.id,"validateChange",!0,t)}).catch(a=>{m(this.id,"validateChange",a.detail,t)})});M(this),this.id==null&&(this.id=`l-f${y(3)}-${y(6)}`),this.validator=new Bt([]),this.emit=new CustomEvent("submit")}static get observedAttributes(){return["disabled","label-position"]}attributeChangedCallback(t,e,r){if(t==="disabled"){const n=k(r,!1,t);n!==this.disabled&&(m(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}else if(t==="label-position"){const n=b("form",this.root);n&&(n.className=w(["l-form",this.inline?"l-form-inline":void 0,`l-form--${r}`]))}}connectedCallback(){this.loadStyle(["form"]),super.connectedCallback(),$(this.id,"ruleChange",this.ruleChange),$(this.id,"valueChange",this._valueChange)}disconnectedCallback(){st(this.id),this.validator=void 0}render(){const t=w(["l-form",this.inline?"l-form-inline":void 0,`l-form--${this.labelPosition}`]),e=z({"--l-form-label-width":this.labelWidth?this.labelWidth:""});this.shadow.innerHTML=`<form class="${t}" style="${e}"><slot></slot></form>`}validateField(t){const e=[];if(this._data!=null){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++){const a=t[r];e.push(this.validator.validateKey(a,this._data[a],this._data))}else e.push(this.validator.validateKey(t,this._data[t],this._data));Promise.allSettled(e).then(r=>{for(let n=0,a=r.length;n<a;n++){const o=r[n];o.status==="rejected"?m(this.id,"validateChange",o.reason.detail,o.reason.key):m(this.id,"validateChange",!0,o.value.key)}})}}clearValidate(){m(this.id,"validateChange",!0)}reset(){this.clearValidate(),m(this.id,"reset")}submit(){this.novalidate?this.dispatchEvent(this.emit):this.validate().then(t=>{t&&this.dispatchEvent(this.emit)})}async validate(){if(this._data!=null)try{return await this.validator.validate(this._data),m(this.id,"validateChange",!0),Promise.resolve(!0)}catch(t){return m(this.id,"validateChange",t.detail),Promise.resolve(!1)}return Promise.resolve(!0)}getData(){return{...this._data}}}l(pt,"baseName","form");class vt extends x{constructor(){super();l(this,"disabled",!1);l(this,"sharedAttrs",["disabled","id","name","innerBlock"]);l(this,"required",!1);l(this,"error");l(this,"label");l(this,"id");l(this,"verify");l(this,"validity");l(this,"pattern");l(this,"name");l(this,"innerBlock",!1);l(this,"labelPosition","right");l(this,"formId");l(this,"_validateChange",(t,e)=>{const r=t===!0?void 0:t[this.name];(e==null||e===this.name&&this.error!=r)&&(this.error=r,this._updateError())});M(this),this.id==null&&(this.id=`l-fi${y(3)}-${y(6)}`)}static get observedAttributes(){return["error","label","disabled"]}attributeChangedCallback(t,e,r){if(t==="error")r!=this.error&&(this.error=r,this._updateError());else if(t==="label")this.label=r,this._updateLabel();else if(t==="disabled"){const n=k(r,!1,t);n!==this.disabled&&(m(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}}connectedCallback(){var t;if(super.connectedCallback(),this.loadStyle(["form"]),this.formId=this._getFormId(),this.name&&this.formId){let e=((t=this.verify)==null?void 0:t.split("|"))||[];this.pattern&&e.push(new RegExp(this.pattern));const r={key:this.name,required:this.required,message:this.validity,rules:e};m(this.formId,"ruleChange",r),$(this.formId,"validateChange",this._validateChange)}}disconnectedCallback(){st(this.id),this.formId&&N(this.formId,"validateChange",this._validateChange)}setRules(t){const e={...t,key:this.name};e.required!=null&&this.required&&(e.required=!0),this.formId&&m(this.formId,"ruleChange",e)}setError(t){this.error=t}render(){const t=["l-form-item",this.required?"is-required":void 0,this.error?"is-error":void 0,`l-form-item--${this.labelPosition}`],e=this.label!=null?`<label class="l-form-item__label">${this.label}</label>`:"",r=this.error?`<div class="l-form-item__error">${this.error}</div>`:"";this.shadow.innerHTML=[`<div class="${w(t)}">${e}`,'<div class="l-form-item__content">',`<slot></slot>${r}</div></div>`].join("")}_updateError(){if(!this.rendered)return;let t=b(".l-form-item__error",this.root);if(t)this.error?t.textContent=this.error:t.remove();else if(this.error){t=document.createElement("div"),t.className="l-form-item__error",t.textContent=this.error;const r=b(".l-form-item__content",this.root);r&&r.appendChild(t)}const e=b(".l-form-item",this.root);e&&(this.error?E(e,"is-error"):L(e,"is-error"))}_updateLabel(){if(!this.rendered)return;let t=b(".l-form-item__label",this.root);if(t==null){if(this.label!=null){t=document.createElement("div"),t.className="l-form-item__label",t.textContent=this.label;const e=b(".l-form-item",this.root);e&&e.appendChild(t)}}else this.label!=null?t.textContent=this.label:t.remove()}_getFormId(){let t=this.parentElement,e;for(;t!=null;){const r=t.tagName;if(r==="L-FORM"){e=t.id;break}if(r==="BODY")break;t=t.parentElement}return t=null,e}}l(vt,"baseName","form-item");class _t extends rt{constructor(){super(!1);l(this,"type");l(this,"label");l(this,"checked",!1);l(this,"_changeEvent");l(this,"_radioChange",t=>{const e=t.target;let r=e.parentElement;for(;r!=null&&!G(r,"l-radio");)r=r.parentElement;const n=b(".is-checked",this.root);n&&L(n,"is-checked"),this.value=e.value,r&&E(r,"is-checked"),this.dispatchEvent(this._changeEvent)});M(this),this._changeEvent=new CustomEvent("change")}setItems(t){this._removeEvents(),this.root.innerHTML=this._renderItems(t),this._initEvents()}connectedCallback(){super.connectedCallback(),this.loadStyle(["radio"]),this._initEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents()}attributeChange(t,e,r){if(t==="checked"){const n=k(r,!1,t);this.checked=n,this.value=n;const a=b(".l-radio",this.root);if(a&&!G(a,"is-checked")){E(a,"is-checked");const o=b("input",a);o&&(o.checked=!0)}}}render(){this.getName()||(this.name=`la${y(3)}_${y(6)}`);const t=[],e=b('[slot="label"]',this),r=F("[radio-value]",this);e!=null||this.label?(this.value=this._isChecked(),e?t.push(this._renderItem("slot",void 0,this._isChecked(),"label")):t.push(this._renderItem(this.label,void 0,this._isChecked(),"label"))):r.length>0&&(B(r,n=>{const a=n.cloneNode(!0),o=q(n,"radio-value");t.push(this._renderItem(a.outerHTML,o,this.value===o))}),this.pushValueChange()),this.root.innerHTML=t.join("")}_renderItems(t){const e=[];for(let r=0,n=t.length;r<n;r++){const a=t[r];e.push(this._renderItem(a.label,a.value,this.value===a.value,a.labelPart))}return e.join("")}_renderItem(t,e,r=!1,n=void 0){const a=w({"l-radio":!0,"l-radio--disabled":this.isDisabled(),"l-radio--button":this.type==="button","is-checked":r}),o=_("disabled",this.isDisabled()),h=_("checked",r),d=_("value",e),p=`${_("name",this.getName())}${d}${o}${h}`,zt=_("part",n),V=[`<label class="${a}">`,`<input type="radio" class="l-radio__input"${p} />`];this.type!=="button"&&V.push('<span class="l-radio__inner"></span>');let Dt=t==="slot"?'<slot name="label"></slot>':t;return V.push(`<div class="l-radio__label"${zt}>${Dt}</div>`),V.push("</label>"),V.join("")}_isChecked(){return this.checked}_initEvents(){B(F("input",this.root),t=>{P(t,"change",this._radioChange)})}_removeEvents(){B(F("input",this.root),t=>{H(t,"change",this._radioChange)})}}l(_t,"baseName","radio"),f(_t),f(pt),f(vt),f(et),f(it),f(g),f(nt),f(at),f(lt),f(ot),f(J),f(ht),globalThis.LMessage=T;function qt(){const s=document.currentScript.src,i=s.lastIndexOf("/"),e=`${s.slice(0,i+1)}litos-ui.css`,r=document.createElement("link");r.rel="stylesheet",r.href=e,r.id="litos-ui-style",document.head.appendChild(r)}qt()})();
1
+ var Ot=Object.defineProperty;var Kt=($,v,S)=>v in $?Ot($,v,{enumerable:!0,configurable:!0,writable:!0,value:S}):$[v]=S;var a=($,v,S)=>Kt($,typeof v!="symbol"?v+"":v,S);(function(){"use strict";var U;const $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",v="0123456789";function S(s,r=!0){return s==null?!0:(r&&typeof s=="string"?s.trim().length:s.length)===0}function C(s){if(typeof s=="object"&&s.min!=null&&s.max!=null){const r=Math.random(),t=s.hasEnd?1:0,e=r*(s.max-s.min+t)+s.min;return s.isInteger!==!1?Math.floor(e):e}else{if(typeof s=="object"&&s.length==null)throw new Error("random_length_cannot_null");let r=typeof s=="object"?s.length:s,t=$;typeof s=="object"&&s.hasLetter===!1&&(t=v);const e=Array.from({length:r},()=>t.charAt(C({min:0,max:t.length-1,hasEnd:!0}))).join("");return typeof s=="object"&&s.firstIsZero===!1&&e.indexOf("0")===0?C(s):e}}let yt=-1,Y={prefix:"l"};function f(s,r){const t=`${Y.prefix}-${s.baseName}`;customElements.get(t)||customElements.define(t,s)}function $t(){return`${Y.prefix}-${++yt}`}function y(s,r,t){if(s==null)return r;switch(typeof r){case"boolean":return s===""||s==="true"||s==="1"||s===t;case"number":return Number(s);default:return s}}function w(s){const r=s.attributes;for(const t of r){const{name:e,value:i}=t;if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("_")||e.startsWith("$"))continue;const l=e.split("-").map((h,d)=>d===0?h:h[0].toUpperCase()+h.slice(1)).join(""),o=y(i,s[l],e);s[l]=o,e==="value"&&(s._resetValue=o)}}function _(s,r){let t=" ";return r===!0?t=` ${s}`:typeof r=="string"&&!S(r)&&(t=` ${s}="${r}"`),t}function G(s,r){return typeof s=="string"?(r||document).querySelectorAll(s):[s]}function F(s,r){return G(s,r)}function m(s,r){return G(s,r)[0]}function M(s,r){s.classList.add(r)}function L(s,r){s.classList.remove(r)}function J(s,r){return s.classList.contains(r)}function P(s,r,t,e=!1){let i={eventStop:!1};typeof e=="boolean"?i.once=e:i=e,i.eventFlag!=null?(s.setAttribute(i.eventFlag,"__stop__"),s.addEventListener(r,n=>{let l=n.target,o="";do o=l.getAttribute(i.eventFlag)||"",o===""&&(l=l.parentNode);while(o==="");(o!=="__stop__"||i.eventStop)&&t(n,l,o)},i)):s.addEventListener(r,t,i)}function H(s,r,t){s.removeEventListener(r,t)}function B(s,r){for(let t=0,e=s.length;t<e&&r(s[t],t)!==!0;t++);}function q(s,r,t){const e=s.getAttribute(r);if(t==null)return e;const i=typeof t;return e==null?t:i==="bigint"||i==="number"?e===""?t:Number(e):i==="boolean"?e===""||e==="1"||e==="true"||e===r:i==="object"?e===""?t:JSON.parse(e):e}function E(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i} `)}else for(const t in s)s[t]&&(r+=`${t} `);return r.trim()}function z(s){let r="";if(Array.isArray(s))for(let t=0,e=s.length;t<e;t++){const i=s[t];i&&(r+=`${i};`)}else for(const t in s){const e=s[t];e&&(r+=`${t}:${e};`)}return r}function kt(s,r,t="0.3s"){s.style.setProperty("display","none");const e=[];for(let i=0,n=r.length;i<n;i++){const l=r[i];s.style.setProperty(l[0],l[1]),e.push(`${l[0]} ${t}`)}t&&s.style.setProperty("transition",e.join(", ")),s.style.removeProperty("display"),requestAnimationFrame(()=>{for(let i=0,n=r.length;i<n;i++){const l=r[i];s.style.removeProperty(l[0])}})}function At(s,r,t){for(let e=0,i=r.length;e<i;e++){const n=r[e];s.style.setProperty(n[0],n[1])}s.addEventListener("transitionend",()=>{s.style.display="none";for(let e=0,i=r.length;e<i;e++){const n=r[e];s.style.removeProperty(n[0])}t!=null&&t()},{once:!0})}class k extends HTMLElement{constructor(t=!0){super();a(this,"rendered",!1);t&&this.attachShadow({mode:"open"})}static get observedAttributes(){return[]}attributeChangedCallback(t,e,i){}get shadow(){return this.shadowRoot}get root(){return this.shadowRoot||this}createStyle(t){const e=document.createElement("style");e.textContent=t.trim(),this.shadow.appendChild(e)}createLink(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,this.shadow.appendChild(e)}loadStyle(t){{let e=document.querySelector("#litos-ui-style");e?this.createLink(e.href):queueMicrotask(()=>{e=document.querySelector("#litos-ui-style"),e&&this.createLink(e.href)})}}loadExternalStyle(t){}loadStyleText(t){this.createStyle(t)}setProperty(t,e){this[t]=e}setProperties(t){for(const e in t)this.setProperty(e,t[e])}getAttr(t,e){return q(this,t,e)}connectedCallback(){this.render(),this.rendered=!0}disconnectedCallback(){}render(){}}a(k,"baseName","base-component");class g extends k{constructor(){super();a(this,"useLink");a(this,"viewBox");this.useLink=!1,this.viewBox="0 0 1024 1024"}connectedCallback(){this.loadStyle(["icon"]),this.render()}render(){const t=this.createEl("svg"),e=this.getAttr("useLink",this.useLink),i=this.getAttr("viewBox",this.viewBox);t.classList.add("l-icon"),e||t.setAttribute("viewBox",i);const n=this.renderChildren();if(typeof n=="string")if(n===""){const l=this.children,o=[];for(let h=0,d=l.length;h<d;h++){const u=l[h];o.push(u.outerHTML),t.appendChild(u)}t.innerHTML=o.join("")}else t.innerHTML=n;else t.append(n);this.shadow.appendChild(t)}renderChildren(){return""}createEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}a(g,"baseName","base-icon");let j=(U=class extends g{renderChildren(){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>'}},a(U,"baseName","loading-icon"),U);const T=2,xt=.16,St=.05,wt=.05,Et=.15,It=/rgba?\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*(\d*\.?\d+))?\s*\)/,Z=/^#(?:([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})|([0-9A-Fa-f]{1})([0-9A-Fa-f]{1})([0-9A-Fa-f]{1}))$/;function Mt(s){return s.r!=null&&s.g!=null&&s.b!=null}function Q(s){return s.h!=null&&s.s!=null&&s.v!=null}function Nt(s){let r=s.match(It);if(r!=null){const t=parseInt(r[1].trim()),e=parseInt(r[2].trim()),i=parseInt(r[3].trim());if(isNaN(t)||isNaN(e)||isNaN(i))throw new Error("Invalid RGB color.");let n=1;return r[4]!=null&&(n=parseFloat(r[4].trim()),isNaN(n)&&(n=1)),{r:t,g:e,b:i,a:n}}}function Lt(s){const r=s.match(Z);if(r!=null){const t=r[4]!==void 0,e=parseInt(t?r[4]+r[4]:r[1],16),i=parseInt(t?r[5]+r[5]:r[2],16),n=parseInt(t?r[6]+r[6]:r[3],16);return{r:e,g:i,b:n}}}function D(s){if(typeof s=="string"){let r=Lt(s);if(r==null&&(r=Nt(s)),r!=null)return r;throw new Error("Invalid color string")}else{if(Mt(s))return s;if(Q(s))return Rt(s);throw new Error("Invalid color")}}function Tt(s){if(Q(s))return s;const r=D(s),t=r.r/255,e=r.g/255,i=r.b/255;let n=Math.max(t,e,i),l=Math.min(t,e,i),o=n-l,h=n,d=n===0?0:o/n,u=0;if(n===l)u=0;else switch(n){case t:u=((e-i)/o+(e<i?6:0))/6;break;case e:u=((i-t)/o+2)/6;break;case i:u=((t-e)/o+4)/6;break}return u=u*360,{h:u,s:d,v:h}}function Rt(s){let r=s.s,t=s.v;r>1&&(r/=100),t>1&&(t/=100);const e=s.h;var i=Math.floor(e/60)%6,n=e/60-Math.floor(e/60),l=t*(1-r),o=t*(1-n*r),h=t*(1-(1-n)*r);let d=0,u=0,p=0;switch(i){case 0:d=t,u=h,p=l;break;case 1:d=o,u=t,p=l;break;case 2:d=l,u=t,p=h;break;case 3:d=l,u=o,p=t;break;case 4:d=h,u=l,p=t;break;case 5:d=t,u=l,p=o;break}return d=Math.round(d*255),u=Math.round(u*255),p=Math.round(p*255),{r:d,g:u,b:p}}function Vt(s,r,t){let e;return Math.round(s.h)>=60&&Math.round(s.h)<=240?e=t?Math.round(s.h)-T*r:Math.round(s.h)+T*r:e=t?Math.round(s.h)+T*r:Math.round(s.h)-T*r,e<0?e+=360:e>=360&&(e-=360),e}function Ft(s,r,t){if(s.h===0&&s.s===0)return s.s;let e;return t?e=s.s-xt*r:e=s.s+St*r,e>1&&(e=1),e<.06&&(e=.06),Number(e.toFixed(2))}function Pt(s,r,t){let e;return t?e=s.v+wt*r:e=s.v-Et*r,e>1&&(e=1),Number(e.toFixed(2))}function X(s){const r=t=>t.toString(16).padStart(2,"0");return`#${r(s.r)}${r(s.g)}${r(s.b)}`.toUpperCase()}function Ht(s){return typeof s=="string"&&Z.test(s)?s:X(D(s))}function tt(s,r=1,t=!0){const e=Tt(s);return Ht({h:Vt(e,r,t),s:Ft(e,r,t),v:Pt(e,r,t)})}f(j);class et extends k{constructor(){super();a(this,"htmlType","button");a(this,"_handleClick",t=>{const e=t.target,i=q(e,"html-type");if(i==="reset"||i==="submit"){const n=this._getForm();n&&(i==="reset"?n.reset():i==="submit"&&n.submit())}});w(this)}static get observedAttributes(){return["loading","color"]}attributeChangedCallback(t,e,i){const n=m(".l-button",this.root);if(n){if(t==="loading")y(i,!1,t)?(M(n,"l-btn-loading"),n.disabled=!0,n.innerHTML=this.loadingBody()):(L(n,"l-btn-loading"),n.disabled=this.getAttr("disabled",!1),n.innerHTML="<slot></slot>");else if(t==="color"){const l=this.getAttr("text",!1),o=this.getAttr("ghost",!1);n.style.cssText=this.applyColor(i,l,o)}}}connectedCallback(){this.loadStyle(["button"]),this.loadExternalStyle(["animation"]),this.render(),(this.htmlType==="reset"||this.htmlType==="submit")&&P(this,"click",this._handleClick)}disconnectedCallback(){super.disconnectedCallback(),(this.htmlType==="reset"||this.htmlType==="submit")&&H(this,"click",this._handleClick)}render(){const t=this.getAttr("type","normal"),e=document.createElement("button"),i=this.getAttr("loading",!1),n=this.getAttr("shape","default"),l=this.getAttr("text",!1),o=this.getAttr("ghost",!1),h=["l-btn",`l-btn-${t}`,this.getAttr("block",!1)?"l-btn-block":"",n==="round"?"l-btn-round":"",n==="circle"?"l-btn-circle":"",o?"l-btn-ghost":"",l?"l-btn-text":"",i?"l-btn-loading":""];e.className=E(h),e.disabled=this.getAttr("disabled",!1)||i,e.type=this.getAttr("html-type","button");const d=this.applyColor(this.getAttr("color"),l,o);d&&(e.style.cssText=d),i?e.innerHTML=this.loadingBody():e.innerHTML="<slot></slot>",e.setAttribute("part","default"),this.root.appendChild(e)}loadingBody(){const t=this.getAttr("loading-text",""),e=['<l-loading-icon class="l-rotate-anim"></l-loading-icon>'];return t===""?e.push("<slot></slot>"):e.push(`<span>${t}</span>`),e.join("")}applyColor(t,e=!1,i=!1){if(!t)return"";const n=tt(t,1,!0),l=tt(t,3,!1);return z({"--l-btn-border-color":e?"transparent":t,"--l-btn-text-color":i||e?t:"#ffffff","--l-btn-hover-text-color":i||e?n:"#ffffff","--l-btn-background":i||e?"transparent":t,"--l-btn-active-text-color":i||e?l:"#ffffff","--l-btn-hover-border-color":e?"transparent":n,"--l-btn-hover-background":i||e?"transparent":n,"--l-btn-active-background":i||e?"transparent":l,"--l-btn-active-border-color":e?"transparent":l})}_getForm(){let t=this.parentElement,e;for(;t!=null;){const i=t.tagName;if(i==="L-FORM"){e=t;break}if(i==="BODY")break;t=t.parentElement}return t=null,e}}a(et,"baseName","button");let c;function A(s,r,t){c==null&&(c=new Map),c.has(s)||c.set(s,new Map([[r,new Set]])),c.get(s).has(r)||c.get(s).set(r,new Set),c.get(s).get(r).add(t)}function N(s,r,t){var e,i,n,l,o,h;(i=(e=c==null?void 0:c.get(s))==null?void 0:e.get(r))==null||i.delete(t),((l=(n=c==null?void 0:c.get(s))==null?void 0:n.get(r))==null?void 0:l.size)==0&&((o=c.get(s))==null||o.delete(r)),((h=c==null?void 0:c.get(s))==null?void 0:h.size)==0&&c.delete(s),(c==null?void 0:c.size)==0&&(c=void 0)}function st(s){s==null?c!=null&&(c.clear(),c=void 0):c!=null&&(c.delete(s),c.size===0&&(c=void 0))}function b(s,r,...t){var i;const e=(i=c==null?void 0:c.get(s))==null?void 0:i.get(r);if(e!=null)for(const n of e)n(...t)}class it extends k{constructor(t=!0){super();a(this,"disabled",!1);a(this,"name");a(this,"formAttrs",{});a(this,"formItemAttrs",{});a(this,"_value","");a(this,"_resetValue");a(this,"_firstPushValue",!0);a(this,"_reseting",!1);a(this,"_formAttributeChanged",(t,e,i)=>{i===this.formAttrs.formId?this.formAttrs[t]=e:this.formItemAttrs[t]=e,t==="disabled"&&this._changeDisabled()});a(this,"_resetFieldValue",()=>{this._reseting=!0,this.reset()});this._firstPushValue=t}set value(t){this.setValue(t)}get value(){return this.getValue()}setValue(t){this._value=t,this.pushValueChange()}getValue(){return this._value}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,i){if(t==="disabled"){const n=y(i,!1,t);n!==this.disabled&&(this._changeDisabled(),this.disabled=n)}else this.attributeChange(t,e,i)}attributeChange(t,e,i){}connectedCallback(){const t=this._getForm();this.formAttrs=t.formAttr,this.formItemAttrs=t.formItemAttr,this.formAttrs.id&&(A(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),A(this.formAttrs.id,"reset",this._resetFieldValue),this._firstPushValue&&this.pushValueChange()),this.formItemAttrs.id&&A(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged),this.render()}disconnectedCallback(){this.formAttrs.id&&(N(this.formAttrs.id,"attributeChanged",this._formAttributeChanged),N(this.formAttrs.id,"reset",this._resetFieldValue)),this.formItemAttrs.id&&N(this.formItemAttrs.id,"attributeChanged",this._formAttributeChanged)}isDisabled(){return this.disabled===!0||this.formItemAttrs.disabled===!0?!0:this.formAttrs.disabled||!1}getName(){return this.name?this.name:this.formItemAttrs.name}_getForm(){let t=this.parentElement,e={},i={};for(;t!=null;){const n=t.tagName;if(n==="L-FORM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const h=l[o];e[h]=t[h]}break}if(n==="BODY")break;if(n==="L-FORM-ITEM"){const l=t.sharedAttrs;for(let o=0;o<l.length;o++){const h=l[o];i[h]=t[h]}}t=t.parentElement}return t=null,{formAttr:e,formItemAttr:i}}_changeDisabled(){}pushValueChange(){const t=this.getName();this.formAttrs.id&&t&&b(this.formAttrs.id,"valueChange",t,this._value,!this._reseting),this._reseting=!1}reset(){this.value=this._resetValue||""}}class rt extends it{constructor(){super();a(this,"type","text");a(this,"placeholder");a(this,"autosize",!1);a(this,"allowInput");a(this,"parser");a(this,"width");a(this,"block",!1);a(this,"error",!1);a(this,"$input");a(this,"_input",t=>{const e=t.target;let i=e.value;if(this.allowInput!=null){let n=this.allowInput.indexOf("."),l=n===-1?n:parseInt(this.allowInput.substring(n+1));i=this._numberInputParse(i,{integer:this.allowInput.includes("integer"),negative:this.allowInput.startsWith("-"),precition:l}),i=String(i),e.value=i}this.parser!=null&&(i=this.parser(i),e.value=i),this.setValue(i)});a(this,"_validateChange",(t,e)=>{const i=this.getName();if(i){const n=t===!0?!1:t[i]!=null;(e==null||e===i&&this.error!=n)&&(this.error=n,this._updateError()),Object.keys(t)[0]===i&&this.focus()}});w(this)}set value(t){this.setValue(t),this.$input!=null&&(this.$input.value=this.value)}get value(){return this.getValue()}static get observedAttributes(){return["disabled","error"]}connectedCallback(){super.connectedCallback(),this.loadStyle(["input"])}disconnectedCallback(){super.disconnectedCallback(),this.formAttrs.id&&N(this.formAttrs.id,"validateChange",this._validateChange),H(this.$input,"input",this._input),this.$input=void 0}attributeChange(t,e,i){if(t==="error"){const n=y(i,!1,t);n!==this.error&&(this.error=n,this._updateError())}}render(){let t=_("value",this.value);const e=_("placeholder",this.placeholder),i=_("disabled",this.isDisabled()),n=E({"l-input":!0,"is-autosize":this.autosize,"is-error":this.error}),l=this.getName(),o=_("name",l),h=`${t}${o}${e}${i}`;this.shadow.innerHTML=`<input part="default" type="${this.type}" class="${n}"${h}></input>`,this.$input=m("input",this.root),P(this.$input,"input",this._input),this.style.cssText=z(this._getStyleObj())+this.getAttr("style",""),l&&this.formAttrs.id&&A(this.formAttrs.id,"validateChange",this._validateChange)}setParser(t){this.parser=t}focus(){var t;(t=this.$input)==null||t.focus()}_changeDisabled(){this.$input!=null&&(this.$input.disabled=this.isDisabled())}_numberInputParse(t,e){let i=t,n=e.negative?"-?":"";if(e.integer){const o=i.match(new RegExp(`^(${n}\\d*)`));return o!=null?o[1]:i.substring(0,i.length-1)}const l=i.match(new RegExp(`(${n}\\d+\\.\\d{0,${e.precition}})|(${n}\\d*)`));return l!=null?i=l[1]||l[2]:i="",l!=null?l[1]||l[2]:""}_getStyleObj(){const t={};return this._isBlock()&&(t["--l-input-width"]="100%"),this.width&&(t["--l-input-width"]=this.width),t}_isBlock(){if(this.block===!0||this.formItemAttrs.innerBlock===!0||this.formAttrs.innerBlock===!0)return!0}_updateError(){this.$input&&(this.error?M(this.$input,"is-error"):L(this.$input,"is-error"))}}a(rt,"baseName","input");class nt extends g{connectedCallback(){super.connectedCallback()}renderChildren(){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>'}}a(nt,"baseName","arrow-down-icon");class lt extends g{renderChildren(){return'<path fill="currentColor" d="M512 320 192 704h639.936z"></path>'}}a(lt,"baseName","caret-top-icon");class at extends g{renderChildren(){return'<path fill="currentColor" d="m192 384 320 384 320-384z"></path>'}}a(at,"baseName","caret-bottom-icon");class ot extends g{constructor(){super();a(this,"_t");a(this,"_start");this.useLink=!0,this._t=void 0,this._start=0}renderChildren(){return""}render(){super.render()}disconnectedCallback(){this._t!=null&&(cancelAnimationFrame(this._t),this._t=void 0)}connectedCallback(){super.connectedCallback();const t=this.getAttribute("name");this._start=Date.now(),t&&this._loadIcon(t)}_loadIcon(t){Date.now()-this._start>=1e4||(this._t=requestAnimationFrame(()=>{const i=document.querySelector(`#${t}`);if(i==null){this._loadIcon(t);return}this._t=void 0;let n=i.getAttribute("viewBox");n||(n="0 0 1024 1024");const l=this.shadow.querySelector("svg");l!=null&&(l.setAttribute("viewBox",n),l.innerHTML=i.innerHTML)}))}}a(ot,"baseName","font-icon");class ht extends g{renderChildren(){return'<path fill="currentColor" d="m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"></path>'}}a(ht,"baseName","search-icon");class ct extends g{constructor(){super(),this.viewBox="0 0 24 24"}renderChildren(){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>'}}a(ct,"baseName","mask-close-icon");class dt extends g{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 0C228.693333 0 0 228.693333 0 512s228.693333 512 512 512 512-228.693333 512-512S795.306667 0 512 0z m307.2 368.64L467.626667 730.453333c0 3.413333-3.413333 3.413333-3.413334 6.826667-13.653333 13.653333-37.546667 13.653333-51.2 0l-177.493333-177.493333c-13.653333-13.653333-13.653333-37.546667 0-51.2 13.653333-13.653333 37.546667-13.653333 51.2 0l150.186667 153.6 334.506666-341.333334c13.653333-13.653333 37.546667-13.653333 51.2 0 10.24 10.24 10.24 34.133333-3.413333 47.786667z m0 0"></path>'}}a(dt,"baseName","success-icon");class ut extends g{connectedCallback(){super.connectedCallback()}renderChildren(){return'<path fill="currentColor" d="M512 1024C229.234 1024 0 794.766 0 512S229.234 0 512 0s512 229.234 512 512-229.234 512-512 512z m-64.853-734.52l19.484 244.906 1.309 16.156c1.251 15.93 15.018 28.644 30.72 28.644h25.571c15.56 0 29.298-12.601 30.663-28.132l1.422-16.668 21.334-244.907c3.214-36.978-24.434-66.844-61.725-66.844h-6.627c-37.462 0-65.138 29.923-62.18 66.844zM512 801.393a66.788 66.788 0 1 0 0-133.575 66.788 66.788 0 0 0 0 133.575z"></path>'}}a(ut,"baseName","warn-icon");class ft extends g{connectedCallback(){super.connectedCallback()}renderChildren(){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>'}}a(ft,"baseName","info-icon"),f(ct),f(dt),f(ut),f(ft);const I=[],mt=[["opacity","0"],["transform","translate3d(-50%, -100%, 0)"]];function bt(s){const r=I.findIndex(n=>n.id===s);if(r===-1)return;const t=I.splice(r,1)[0];if(t==null)return;At(t,mt,()=>{t.remove()});const e=15+t.offsetHeight,i=I.length;if(i!==0)for(let n=r;n<i;n++){const l=I[n],o=parseInt(l.style.top,10)-e;l.style.setProperty("top",`${o}px`)}}function Bt(s){const r=document.createElement("div");r.id=s.id;const t=s.type||"info";let e=`l-message l-message-${t}`;s.customClass&&(e+=" "+s.customClass),r.className=e,r.style.setProperty("top",`${s.offset}px`),r.style.setProperty("z-index",`${s.zindex||1e3}`),s.width&&r.style.setProperty("width",s.width);let i=t;return i==="error"&&(i="mask-close"),r.innerHTML=['<div class="l-message-container">',`<l-${i}-icon class="l-message-icon"></l-${i}-icon>`,`<span class="l-message-content">${s.message}</span>`,"</div>"].join(""),r}const R=s=>{const r=I.reduce((l,o)=>l+o.offsetHeight+15,15),t=$t(),e=typeof s=="string"?{message:s}:s;e.id=t,e.offset=r;const i=Bt(e);I.push(i),document.body.appendChild(i),kt(i,mt,null);let n=e.duration;return n==null&&(n=3e3),n!==0&&setTimeout(()=>{bt(t)},n),t};for(const s of["info","success","error","warn","show"])R[s]=r=>{const t=typeof r=="string"?{message:r}:r;return s!=="show"?t.type=s:t.type==null&&(t.type="info"),R(t)};R.close=bt;const O={mobile:"请输入正确的手机号",same:"两次输入不一致",required:"%s为必填字段"},K="请输入正确的数据",x={same:/^same:(.+)$/i,mobile:/^1[345678]\d{9}$/,required:/^\S{1}.*/},W={same(s,r){return r===s},pattern(s,r){return r==null?!1:s.test(String(r))}};class gt extends Error{constructor(r,t,e){super(e),this.name="ValidateError",this.key=t,this.detail=r}}class qt{constructor(r){this.rules={},this.addSchemas(r)}addSchemas(r){for(let t of r)this.rules[t.key]=this._parseSchemaRules(t)}addSchema(r){this.rules[r.key]=this._parseSchemaRules(r)}async validate(r,t=!1){return new Promise((e,i)=>{const n={};let l,o;for(let h in this.rules){let d=this._validateRule(this.rules[h],r[h],r);if(d!==""&&(d=d.replace("%s",h),n[h]=d,l=h,o=d,t))break}l==null?e(!0):i(new gt(n,l,o))})}async validateKey(r,t,e){return new Promise((i,n)=>{let l=this.rules[r];if(l==null){i({key:r,value:t});return}let o=this._validateRule(l,t,e);o!==""?(o=o.replace("%s",r),n(new gt({[r]:o},r,o))):i({key:r,value:t})})}_validateRule(r,t,e){let i="";for(let n of r)if(n.rule==="required"?(t==null||!W.pattern(x.required,t))&&(i=n.message):typeof n.rule=="function"?n.rule(t)||(i=n.message):n.sameKey!=null?e!=null&&(W.same(t,e[n.sameKey])||(i=n.message)):W.pattern(n.rule,t)||(i=n.message),i!=="")break;return i}_parseSchemaRules(r){let t=[],e=r.rules;if(r.required===!0&&t.push(...this._parseStringRule("required",r.message)),e!=null)if(typeof e=="string")t=t.concat(this._parseStringRule(e,r.message));else if(e instanceof Array)for(let i of e)typeof i=="string"?t.push(...this._parseStringRule(i,r.message)):i instanceof RegExp||typeof i=="function"?t.push({rule:i,message:r.message||K}):typeof i.rule=="string"?t.push(...this._parseStringRule(i.rule,i.message)):t.push({rule:i.rule,message:i.message||K});else t.push({rule:e,message:K});return t}_parseStringRule(r,t){let e=[],i=r.split("|");for(let n of i){let l=t,o=null,h;if(r==="required")o="required",l=l||t||O.required;else if(x.same.test(n)){if(n.match(x.same)!=null){o=x.same;let u=n.match(x.same);u!=null&&(h=u[1]),l=l||O.same}}else Object.hasOwn(x,n)&&(o=x[n],l=l||O[n]);e.push({rule:o,message:l,sameKey:h})}return e}}class pt extends k{constructor(){super();a(this,"inline",!1);a(this,"labelPosition","right");a(this,"labelWidth");a(this,"id");a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","innerBlock"]);a(this,"validator");a(this,"innerBlock",!1);a(this,"novalidate",!1);a(this,"_data");a(this,"emit");a(this,"ruleChange",t=>{this.validator.addSchema(t)});a(this,"_valueChange",(t,e,i=!0)=>{this._data==null&&(this._data={});const n=Object.hasOwn(this._data,t);this._data[t]=e,!this.novalidate&&n&&i&&this.validator.validateKey(t,e,this._data).then(()=>{b(this.id,"validateChange",!0,t)}).catch(l=>{b(this.id,"validateChange",l.detail,t)})});w(this),this.id==null&&(this.id=`l-f${C(3)}-${C(6)}`),this.validator=new qt([]),this.emit=new CustomEvent("submit")}static get observedAttributes(){return["disabled","label-position"]}attributeChangedCallback(t,e,i){if(t==="disabled"){const n=y(i,!1,t);n!==this.disabled&&(b(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}else if(t==="label-position"){const n=m("form",this.root);n&&(n.className=E(["l-form",this.inline?"l-form-inline":void 0,`l-form--${i}`]))}}connectedCallback(){this.loadStyle(["form"]),super.connectedCallback(),A(this.id,"ruleChange",this.ruleChange),A(this.id,"valueChange",this._valueChange)}disconnectedCallback(){st(this.id),this.validator=void 0}render(){const t=E(["l-form",this.inline?"l-form-inline":void 0,`l-form--${this.labelPosition}`]),e=z({"--l-form-label-width":this.labelWidth?this.labelWidth:""});this.shadow.innerHTML=`<form class="${t}" style="${e}"><slot></slot></form>`}validateField(t){const e=[];if(this._data!=null){if(Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const l=t[i];e.push(this.validator.validateKey(l,this._data[l],this._data))}else e.push(this.validator.validateKey(t,this._data[t],this._data));Promise.allSettled(e).then(i=>{for(let n=0,l=i.length;n<l;n++){const o=i[n];o.status==="rejected"?b(this.id,"validateChange",o.reason.detail,o.reason.key):b(this.id,"validateChange",!0,o.value.key)}})}}clearValidate(){b(this.id,"validateChange",!0)}reset(){this.clearValidate(),b(this.id,"reset")}submit(){this.novalidate?this.dispatchEvent(this.emit):this.validate().then(t=>{t&&this.dispatchEvent(this.emit)})}async validate(){if(this._data!=null)try{return await this.validator.validate(this._data),b(this.id,"validateChange",!0),Promise.resolve(!0)}catch(t){return b(this.id,"validateChange",t.detail),Promise.resolve(!1)}return Promise.resolve(!0)}getData(){return{...this._data}}}a(pt,"baseName","form");class vt extends k{constructor(){super();a(this,"disabled",!1);a(this,"sharedAttrs",["disabled","id","name","innerBlock"]);a(this,"required",!1);a(this,"error");a(this,"label");a(this,"id");a(this,"verify");a(this,"validity");a(this,"pattern");a(this,"name");a(this,"innerBlock",!1);a(this,"labelPosition","right");a(this,"formId");a(this,"_validateChange",(t,e)=>{const i=t===!0?void 0:t[this.name];(e==null||e===this.name&&this.error!=i)&&(this.error=i,this._updateError())});w(this),this.id==null&&(this.id=`l-fi${C(3)}-${C(6)}`)}static get observedAttributes(){return["error","label","disabled"]}attributeChangedCallback(t,e,i){if(t==="error")i!=this.error&&(this.error=i,this._updateError());else if(t==="label")this.label=i,this._updateLabel();else if(t==="disabled"){const n=y(i,!1,t);n!==this.disabled&&(b(this.id,"attributeChanged",t,n,this.id),this.disabled=n)}}connectedCallback(){var t;if(super.connectedCallback(),this.loadStyle(["form"]),this.formId=this._getFormId(),this.name&&this.formId){let e=((t=this.verify)==null?void 0:t.split("|"))||[];this.pattern&&e.push(new RegExp(this.pattern));const i={key:this.name,required:this.required,message:this.validity,rules:e};b(this.formId,"ruleChange",i),A(this.formId,"validateChange",this._validateChange)}}disconnectedCallback(){st(this.id),this.formId&&N(this.formId,"validateChange",this._validateChange)}setRules(t){const e={...t,key:this.name};e.required!=null&&this.required&&(e.required=!0),this.formId&&b(this.formId,"ruleChange",e)}setError(t){this.error=t}render(){const t=["l-form-item",this.required?"is-required":void 0,this.error?"is-error":void 0,`l-form-item--${this.labelPosition}`],e=this.label!=null?`<label class="l-form-item__label">${this.label}</label>`:"",i=this.error?`<div class="l-form-item__error">${this.error}</div>`:"";this.shadow.innerHTML=[`<div class="${E(t)}">${e}`,'<div class="l-form-item__content">',`<slot></slot>${i}</div></div>`].join("")}_updateError(){if(!this.rendered)return;let t=m(".l-form-item__error",this.root);if(t)this.error?t.textContent=this.error:t.remove();else if(this.error){t=document.createElement("div"),t.className="l-form-item__error",t.textContent=this.error;const i=m(".l-form-item__content",this.root);i&&i.appendChild(t)}const e=m(".l-form-item",this.root);e&&(this.error?M(e,"is-error"):L(e,"is-error"))}_updateLabel(){if(!this.rendered)return;let t=m(".l-form-item__label",this.root);if(t==null){if(this.label!=null){t=document.createElement("div"),t.className="l-form-item__label",t.textContent=this.label;const e=m(".l-form-item",this.root);e&&e.appendChild(t)}}else this.label!=null?t.textContent=this.label:t.remove()}_getFormId(){let t=this.parentElement,e;for(;t!=null;){const i=t.tagName;if(i==="L-FORM"){e=t.id;break}if(i==="BODY")break;t=t.parentElement}return t=null,e}}a(vt,"baseName","form-item");class _t extends it{constructor(){super(!1);a(this,"type");a(this,"label");a(this,"checked",!1);a(this,"_changeEvent");a(this,"_radioChange",t=>{const e=t.target;let i=e.parentElement;for(;i!=null&&!J(i,"l-radio");)i=i.parentElement;const n=m(".is-checked",this.root);n&&L(n,"is-checked"),this.value=e.value,i&&M(i,"is-checked"),this.dispatchEvent(this._changeEvent)});w(this),this._changeEvent=new CustomEvent("change")}setItems(t){this._removeEvents(),this.root.innerHTML=this._renderItems(t),this._initEvents()}connectedCallback(){super.connectedCallback(),this.loadStyle(["radio"]),this._initEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents()}attributeChange(t,e,i){if(t==="checked"){const n=y(i,!1,t);this.checked=n,this.value=n;const l=m(".l-radio",this.root);if(l&&!J(l,"is-checked")){M(l,"is-checked");const o=m("input",l);o&&(o.checked=!0)}}}render(){this.getName()||(this.name=`la${C(3)}_${C(6)}`);const t=[],e=m('[slot="label"]',this),i=F("[radio-value]",this);e!=null||this.label?(this.value=this._isChecked(),e?t.push(this._renderItem("slot",void 0,this._isChecked(),"label")):t.push(this._renderItem(this.label,void 0,this._isChecked(),"label"))):i.length>0&&(B(i,n=>{const l=n.cloneNode(!0),o=q(n,"radio-value");t.push(this._renderItem(l.outerHTML,o,this.value===o))}),this.pushValueChange()),this.root.innerHTML=t.join("")}_renderItems(t){const e=[];for(let i=0,n=t.length;i<n;i++){const l=t[i];e.push(this._renderItem(l.label,l.value,this.value===l.value,l.labelPart))}return e.join("")}_renderItem(t,e,i=!1,n=void 0){const l=E({"l-radio":!0,"l-radio--disabled":this.isDisabled(),"l-radio--button":this.type==="button","is-checked":i}),o=_("disabled",this.isDisabled()),h=_("checked",i),d=_("value",e),p=`${_("name",this.getName())}${d}${o}${h}`,jt=_("part",n),V=[`<label class="${l}">`,`<input type="radio" class="l-radio__input"${p} />`];this.type!=="button"&&V.push('<span class="l-radio__inner"></span>');let Dt=t==="slot"?'<slot name="label"></slot>':t;return V.push(`<div class="l-radio__label"${jt}>${Dt}</div>`),V.push("</label>"),V.join("")}_isChecked(){return this.checked}_initEvents(){B(F("input",this.root),t=>{P(t,"change",this._radioChange)})}_removeEvents(){B(F("input",this.root),t=>{H(t,"change",this._radioChange)})}}a(_t,"baseName","radio"),f(j);class Ct extends k{constructor(){super();a(this,"finish",!1);a(this,"infinite",!0);a(this,"observer");a(this,"loadMoreEmit");a(this,"$more");w(this),this.loadMoreEmit=new CustomEvent("load-more")}static get observedAttributes(){return["finish"]}attributeChangedCallback(t,e,i){if(t==="finish"){const n=y(i,!1,t);this.finish!==n&&(this.finish=n,this._finishChange())}}connectedCallback(){this.loadStyle(["list"]),this.loadExternalStyle(["animation"]),super.connectedCallback(),this.infinite&&(this.observer=new IntersectionObserver(t=>{t[0].isIntersecting&&!this.finish&&this.dispatchEvent(this.loadMoreEmit)}),this.$more=m(".l-list-loadmore",this.root),!this.finish&&this.$more&&this.observer.observe(this.$more))}disconnectedCallback(){super.disconnectedCallback(),this.observer&&(this.$more&&(this.observer.unobserve(this.$more),this.$more=void 0),this.observer.disconnect(),this.observer=void 0),this.loadMoreEmit=void 0}render(){const t=["<slot></slot>"];this.infinite&&(t.push('<div class="l-list-loadmore">'),this.finish||t.push('<l-loading-icon class="l-list-icon l-rotate-anim"></l-loading-icon>'),t.push(`<span class="l-list-loadmore-text">${this._loadingText()}</span></div>`)),this.root.innerHTML=t.join("")}_loadingText(){return this.finish?"已经到底啦!":"加载中……"}_finishChange(){if(this.$more){this.observer&&(this.finish?this.observer.unobserve(this.$more):this.observer.observe(this.$more));const t=m(".l-list-loadmore-text",this.$more);t&&(t.textContent=this._loadingText());let e=m(".l-list-icon",this.$more);this.finish?e&&e.remove():e==null&&(e=document.createElement("l-loading-icon"),e.className="l-list-icon l-rotate-anim",this.$more.prepend(e))}}}a(Ct,"baseName","list"),f(Ct),f(_t),f(pt),f(vt),f(et),f(rt),f(g),f(nt),f(lt),f(at),f(ot),f(j),f(ht),globalThis.LMessage=R;function zt(){const s=document.currentScript.src,r=s.lastIndexOf("/"),e=`${s.slice(0,r+1)}litos-ui.css`,i=document.createElement("link");i.rel="stylesheet",i.href=e,i.id="litos-ui-style",document.head.appendChild(i)}zt()})();
@@ -23,8 +23,8 @@ function d(e) {
23
23
  const i = 15 + s.offsetHeight, n = r.length;
24
24
  if (n !== 0)
25
25
  for (let o = t; o < n; o++) {
26
- const c = r[o], f = parseInt(c.style.top, 10) - i;
27
- c.style.setProperty("top", `${f}px`);
26
+ const c = r[o], l = parseInt(c.style.top, 10) - i;
27
+ c.style.setProperty("top", `${l}px`);
28
28
  }
29
29
  }
30
30
  function v(e) {
@@ -41,25 +41,25 @@ function v(e) {
41
41
  "</div>"
42
42
  ].join(""), t;
43
43
  }
44
- const l = (e) => {
44
+ const f = (e) => {
45
45
  const t = r.reduce(
46
- (c, f) => c + f.offsetHeight + 15,
46
+ (c, l) => c + l.offsetHeight + 15,
47
47
  15
48
48
  ), s = u(), i = typeof e == "string" ? { message: e } : e;
49
49
  i.id = s, i.offset = t;
50
50
  const n = v(i);
51
- r.push(n), document.body.appendChild(n), y(n, m);
51
+ r.push(n), document.body.appendChild(n), y(n, m, null);
52
52
  let o = i.duration;
53
53
  return o == null && (o = 3e3), o !== 0 && setTimeout(() => {
54
54
  d(s);
55
55
  }, o), s;
56
56
  };
57
57
  for (const e of ["info", "success", "error", "warn", "show"])
58
- l[e] = (t) => {
58
+ f[e] = (t) => {
59
59
  const s = typeof t == "string" ? { message: t } : t;
60
- return e !== "show" ? s.type = e : s.type == null && (s.type = "info"), l(s);
60
+ return e !== "show" ? s.type = e : s.type == null && (s.type = "info"), f(s);
61
61
  };
62
- l.close = d;
62
+ f.close = d;
63
63
  export {
64
- l as default
64
+ f as default
65
65
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "litos-ui",
3
3
  "description": "基于 Web Component 的 UI 组件库",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
5
  "type": "module",
6
6
  "devDependencies": {
7
7
  "@eslint/js": "^9.16.0",
@@ -12,7 +12,7 @@
12
12
  "lightningcss": "^1.28.2",
13
13
  "prettier": "^3.4.2",
14
14
  "typescript": "^5.7.2",
15
- "typescript-eslint": "^8.17.0",
15
+ "typescript-eslint": "^8.18.0",
16
16
  "vite": "^6.0.3",
17
17
  "vitepress": "^1.5.0"
18
18
  },
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "license": "MIT",
52
52
  "dependencies": {
53
- "ph-utils": "^0.11.3",
54
- "shiki": "^1.24.0"
53
+ "ph-utils": "^0.11.4",
54
+ "shiki": "^1.24.1"
55
55
  },
56
56
  "scripts": {
57
57
  "docs:dev": "vitepress dev docs",
@@ -1,4 +0,0 @@
1
- const i = ".l-icon{width:1em;height:1em;fill:currentColor;vertical-align:middle;display:inline-block}";
2
- export {
3
- i as default
4
- };