litos-ui 0.12.1 → 0.13.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.d.ts +9 -1
- package/lib/base.js +15 -3
- package/lib/color_picker/index.js +1 -1
- package/lib/form/form_inner.js +1 -1
- package/lib/icon/{mask_close.js → close_filled.js} +1 -1
- package/lib/index-dwS1N2uN.js +4 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +53 -51
- package/lib/input/index.d.ts +5 -3
- package/lib/input/index.js +103 -52
- package/lib/message/index.js +1 -1
- package/lib/select_ori/index.js +1 -1
- package/package.json +8 -8
- package/styles/vars.css +1 -1
- package/lib/index-391POYEJ.js +0 -4
- /package/lib/icon/{mask_close.d.ts → close_filled.d.ts} +0 -0
package/lib/base.d.ts
CHANGED
|
@@ -2,12 +2,13 @@ export default class BaseComponent extends HTMLElement {
|
|
|
2
2
|
static baseName: string;
|
|
3
3
|
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
4
4
|
rendered: boolean;
|
|
5
|
-
constructor(shadow?: boolean);
|
|
5
|
+
constructor(shadow?: boolean, init?: Partial<ShadowRootInit>);
|
|
6
6
|
/**
|
|
7
7
|
* 返回一个数组,表示观察的属性列表
|
|
8
8
|
*/
|
|
9
9
|
static get observedAttributes(): string[] | undefined | null;
|
|
10
10
|
attributeChangedCallback(_name: string, _oldValue: string, _newValue: string): void;
|
|
11
|
+
/** @deprecated */
|
|
11
12
|
get shadow(): ShadowRoot;
|
|
12
13
|
get root(): ShadowRoot | HTMLElement;
|
|
13
14
|
createStyle(text: string): void;
|
|
@@ -44,4 +45,11 @@ export default class BaseComponent extends HTMLElement {
|
|
|
44
45
|
*/
|
|
45
46
|
removeEvents(): void;
|
|
46
47
|
beforeDestroy(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 触发自定义事件
|
|
50
|
+
* @param name 事件名称
|
|
51
|
+
* @param eventOption 自定义事件配置选项, 默认: bubbles: true
|
|
52
|
+
* @returns 是否成功触发事件
|
|
53
|
+
*/
|
|
54
|
+
emit(name: string, eventOption: Partial<CustomEventInit>): boolean;
|
|
47
55
|
}
|
package/lib/base.js
CHANGED
|
@@ -3,8 +3,8 @@ class i extends HTMLElement {
|
|
|
3
3
|
static baseName = "base-component";
|
|
4
4
|
/** 组件是否渲染完成, 是否已经调用 connectedCallback */
|
|
5
5
|
rendered = !1;
|
|
6
|
-
constructor(t = !0) {
|
|
7
|
-
super(), t && this.attachShadow({ mode: "open" });
|
|
6
|
+
constructor(t = !0, e = {}) {
|
|
7
|
+
super(), t && this.attachShadow({ mode: "open", ...e });
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* 返回一个数组,表示观察的属性列表
|
|
@@ -13,8 +13,9 @@ class i extends HTMLElement {
|
|
|
13
13
|
return [];
|
|
14
14
|
}
|
|
15
15
|
// 当属性发生变化时调用的回调函数
|
|
16
|
-
attributeChangedCallback(t, e,
|
|
16
|
+
attributeChangedCallback(t, e, o) {
|
|
17
17
|
}
|
|
18
|
+
/** @deprecated */
|
|
18
19
|
get shadow() {
|
|
19
20
|
return this.shadowRoot;
|
|
20
21
|
}
|
|
@@ -68,6 +69,17 @@ class i extends HTMLElement {
|
|
|
68
69
|
}
|
|
69
70
|
beforeDestroy() {
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* 触发自定义事件
|
|
74
|
+
* @param name 事件名称
|
|
75
|
+
* @param eventOption 自定义事件配置选项, 默认: bubbles: true
|
|
76
|
+
* @returns 是否成功触发事件
|
|
77
|
+
*/
|
|
78
|
+
emit(t, e) {
|
|
79
|
+
return this.dispatchEvent(
|
|
80
|
+
new CustomEvent(t, { bubbles: !0, composed: !1, ...e })
|
|
81
|
+
);
|
|
82
|
+
}
|
|
71
83
|
}
|
|
72
84
|
export {
|
|
73
85
|
i as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $one as i, on as s, off as a } from "ph-utils/dom";
|
|
2
2
|
import c from "../form/form_inner.js";
|
|
3
3
|
import { initAttr as r, setAttrs as n } from "../utils/index.js";
|
|
4
|
-
import { i as l } from "../index-
|
|
4
|
+
import { i as l } from "../index-dwS1N2uN.js";
|
|
5
5
|
const o = ":host{--l-input-width: 60px}";
|
|
6
6
|
class m extends c {
|
|
7
7
|
static baseName = "color-picker";
|
package/lib/form/form_inner.js
CHANGED
|
@@ -15,7 +15,7 @@ class A extends n {
|
|
|
15
15
|
* @param firstPushValue 是否第一次赋值 value 时, 推送数据到 Form, 默认: true
|
|
16
16
|
*/
|
|
17
17
|
constructor(t = !0) {
|
|
18
|
-
super(), this._firstPushValue = t;
|
|
18
|
+
super(!0, { delegatesFocus: !0 }), this._firstPushValue = t;
|
|
19
19
|
}
|
|
20
20
|
set value(t) {
|
|
21
21
|
this.setValue(t);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const r = ":host{--l-input-border-color: var(--l-border-color, #dedede);display:inline-flex;width:var(--l-input-width, 170px);height:var(--l-form-edit-height, 32px);align-items:center;padding:0 7px;border:1px solid var(--l-input-border-color, #dedede);transition:border-color .3s;border-radius:4px;vertical-align:middle}:host(:focus){--l-input-border-color: var(--l-primary-color, #722ed1)}:host(.is-disabled){background-color:var(--l-disabled-color, #f5f7fa)}:host(.is-error){--l-input-border-color: #ed3f13}.l-input__prefix,.l-input__suffix{color:#a8abb2;font-size:14px;display:inline-flex;flex-shrink:0}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer}.l-clearable:hover{color:#999}.l-input__inner{outline:none;border:none;box-sizing:border-box;width:100%;max-width:100%;height:100%;flex-grow:1;text-align:inherit}.l-input__inner:disabled{background-color:transparent}";
|
|
2
|
+
export {
|
|
3
|
+
r as i
|
|
4
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { default as CloseIcon } from "./icon/close";
|
|
|
29
29
|
export { default as InfoIcon } from "./icon/info";
|
|
30
30
|
export { default as SuccessIcon } from "./icon/success";
|
|
31
31
|
export { default as WarnIcon } from "./icon/warn";
|
|
32
|
+
export { default as CloseFilledIcon } from "./icon/close_filled";
|
|
32
33
|
export { default as Form } from "./form";
|
|
33
34
|
export { default as FormItem } from "./form/form_item";
|
|
34
35
|
export { default as Radio } from "./radio";
|
|
@@ -79,6 +80,7 @@ declare global {
|
|
|
79
80
|
"l-info-icon": import("./icon/info").default
|
|
80
81
|
"l-success-icon": import("./icon/success").default
|
|
81
82
|
"l-warn-icon": import("./icon/warn").default
|
|
83
|
+
"l-close-filled-icon": import("./icon/close_filled").default
|
|
82
84
|
"l-form": import("./form").default
|
|
83
85
|
"l-form-item": import("./form/form_item").default
|
|
84
86
|
"l-radio": import("./radio").default
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createTransition as t, getPopoverOffsetX as r, getPopoverOffsetY as a, impactDetect as f, initAttr as s, parseAttrValue as
|
|
1
|
+
import { createTransition as t, getPopoverOffsetX as r, getPopoverOffsetY as a, impactDetect as f, initAttr as s, parseAttrValue as l, regist as m, setAttrs as u, tagAttr as p, tagAttrs as d, useId as x } from "./utils/index.js";
|
|
2
2
|
import { set as c, remove as I } from "./utils/clickoutside.js";
|
|
3
3
|
import { default as g } from "./base.js";
|
|
4
|
-
import { default as
|
|
4
|
+
import { default as h } from "./message/index.js";
|
|
5
5
|
import { default as M } from "./popover/index.js";
|
|
6
6
|
import { default as S } from "./popconfirm/index.js";
|
|
7
7
|
import { default as D } from "./dialog/index.js";
|
|
@@ -22,32 +22,33 @@ import { default as $ } from "./icon/sun.js";
|
|
|
22
22
|
import { default as eo } from "./icon/moon.js";
|
|
23
23
|
import { default as ro } from "./icon/reduction.js";
|
|
24
24
|
import { default as fo } from "./icon/refresh_left.js";
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
25
|
+
import { default as lo } from "./icon/refresh_right.js";
|
|
26
|
+
import { default as uo } from "./icon/sort.js";
|
|
27
27
|
import { default as xo } from "./icon/theme_default.js";
|
|
28
28
|
import { default as co } from "./icon/close.js";
|
|
29
29
|
import { default as io } from "./icon/info.js";
|
|
30
|
-
import { default as
|
|
30
|
+
import { default as Co } from "./icon/success.js";
|
|
31
31
|
import { default as Ao } from "./icon/warn.js";
|
|
32
|
-
import { default as Po } from "./
|
|
33
|
-
import { default as wo } from "./form/
|
|
34
|
-
import { default as Ro } from "./
|
|
35
|
-
import { default as ko } from "./
|
|
36
|
-
import { default as Lo } from "./
|
|
37
|
-
import { default as bo } from "./
|
|
38
|
-
import { default as Fo } from "./
|
|
39
|
-
import { default as Uo } from "./
|
|
40
|
-
import { default as Wo } from "./
|
|
41
|
-
import { default as Yo } from "./
|
|
42
|
-
import { default as qo } from "./
|
|
43
|
-
import { default as Eo } from "./
|
|
44
|
-
import { default as Ho } from "./
|
|
45
|
-
import { default as Ko } from "./
|
|
46
|
-
import { default as Qo } from "./theme/
|
|
47
|
-
import { default as _o } from "./
|
|
48
|
-
import { default as oe } from "./
|
|
49
|
-
import { default as te } from "./menu/
|
|
50
|
-
import { default as ae } from "./menu/
|
|
32
|
+
import { default as Po } from "./icon/close_filled.js";
|
|
33
|
+
import { default as wo } from "./form/index.js";
|
|
34
|
+
import { default as Ro } from "./form/form_item.js";
|
|
35
|
+
import { default as ko } from "./radio/index.js";
|
|
36
|
+
import { default as Lo } from "./checkbox/index.js";
|
|
37
|
+
import { default as bo } from "./button/index.js";
|
|
38
|
+
import { default as Fo } from "./input/index.js";
|
|
39
|
+
import { default as Uo } from "./select_ori/index.js";
|
|
40
|
+
import { default as Wo } from "./switch/index.js";
|
|
41
|
+
import { default as Yo } from "./md_input/index.js";
|
|
42
|
+
import { default as qo } from "./list/index.js";
|
|
43
|
+
import { default as Eo } from "./polygon/index.js";
|
|
44
|
+
import { default as Ho } from "./color_picker/index.js";
|
|
45
|
+
import { default as Ko } from "./tabbar/index.js";
|
|
46
|
+
import { default as Qo } from "./theme/index.js";
|
|
47
|
+
import { default as _o } from "./theme/theme_color.js";
|
|
48
|
+
import { default as oe } from "./date_picker/index.js";
|
|
49
|
+
import { default as te } from "./menu/index.js";
|
|
50
|
+
import { default as ae } from "./menu/menu_item.js";
|
|
51
|
+
import { default as se } from "./menu/sub_menu.js";
|
|
51
52
|
export {
|
|
52
53
|
y as ArrowDownIcon,
|
|
53
54
|
V as ArrowLeftIcon,
|
|
@@ -55,46 +56,47 @@ export {
|
|
|
55
56
|
j as ArrowUpIcon,
|
|
56
57
|
g as BaseComponent,
|
|
57
58
|
B as BaseIcon,
|
|
58
|
-
|
|
59
|
+
bo as Button,
|
|
59
60
|
G as CaretBottomIcon,
|
|
60
61
|
z as CaretTopIcon,
|
|
61
|
-
|
|
62
|
+
Lo as Checkbox,
|
|
63
|
+
Po as CloseFilledIcon,
|
|
62
64
|
co as CloseIcon,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
Ho as ColorPicker,
|
|
66
|
+
oe as DatePicker,
|
|
65
67
|
D as Dialog,
|
|
66
68
|
T as DialogContainer,
|
|
67
69
|
J as FontIcon,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
wo as Form,
|
|
71
|
+
Ro as FormItem,
|
|
70
72
|
io as InfoIcon,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
Fo as Input,
|
|
74
|
+
qo as List,
|
|
73
75
|
v as Loading,
|
|
74
76
|
N as LoadingIcon,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
Yo as MdInput,
|
|
78
|
+
te as Menu,
|
|
79
|
+
ae as MenuItem,
|
|
80
|
+
h as Message,
|
|
79
81
|
O as Modal,
|
|
80
82
|
eo as MoonIcon,
|
|
81
|
-
|
|
83
|
+
Eo as Polygon,
|
|
82
84
|
S as Popconfirm,
|
|
83
85
|
M as Popover,
|
|
84
|
-
|
|
86
|
+
ko as Radio,
|
|
85
87
|
ro as ReductionIcon,
|
|
86
88
|
fo as RefreshLeftIcon,
|
|
87
|
-
|
|
89
|
+
lo as RefreshRightIcon,
|
|
88
90
|
Z as SearchIcon,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
Uo as SelectOri,
|
|
92
|
+
uo as SortIcon,
|
|
93
|
+
se as SubMenu,
|
|
94
|
+
Co as SuccessIcon,
|
|
93
95
|
$ as SunIcon,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
Wo as Switch,
|
|
97
|
+
Ko as Tabbar,
|
|
98
|
+
Qo as Theme,
|
|
99
|
+
_o as ThemeColor,
|
|
98
100
|
xo as ThemeDefaultIcon,
|
|
99
101
|
Ao as WarnIcon,
|
|
100
102
|
c as addClickOutside,
|
|
@@ -103,11 +105,11 @@ export {
|
|
|
103
105
|
a as getPopoverOffsetY,
|
|
104
106
|
f as impactDetect,
|
|
105
107
|
s as initAttr,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
l as parseAttrValue,
|
|
109
|
+
m as regist,
|
|
108
110
|
I as removeClickOutside,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
u as setAttrs,
|
|
112
|
+
p as tagAttr,
|
|
111
113
|
d as tagAttrs,
|
|
112
114
|
x as useId
|
|
113
115
|
};
|
package/lib/input/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import FormInner from "../form/form_inner";
|
|
|
13
13
|
* @method focus - 输入框获取焦点
|
|
14
14
|
*/
|
|
15
15
|
export default class Input extends FormInner {
|
|
16
|
+
#private;
|
|
16
17
|
static baseName: string;
|
|
17
18
|
/** 原生 input 的 type */
|
|
18
19
|
type: string;
|
|
@@ -27,20 +28,21 @@ export default class Input extends FormInner {
|
|
|
27
28
|
/** 宽度铺满 */
|
|
28
29
|
block: boolean;
|
|
29
30
|
error: boolean;
|
|
30
|
-
|
|
31
|
+
/** clearable */
|
|
32
|
+
clearable: boolean;
|
|
33
|
+
$inner?: HTMLInputElement;
|
|
31
34
|
set value(value: any);
|
|
32
35
|
get value(): any;
|
|
33
36
|
static get observedAttributes(): string[];
|
|
34
37
|
connectedCallback(): void;
|
|
35
38
|
disconnectedCallback(): void;
|
|
36
39
|
protected attributeChange(name: string, oldValue: string, newValue: string): void;
|
|
37
|
-
render():
|
|
40
|
+
render(): DocumentFragment;
|
|
38
41
|
/**
|
|
39
42
|
* 设置自定义的输入解析器
|
|
40
43
|
* @param cb
|
|
41
44
|
*/
|
|
42
45
|
setParser(cb: (value: string) => string): void;
|
|
43
|
-
focus(): void;
|
|
44
46
|
_input: (e: Event) => void;
|
|
45
47
|
disabledChange(): void;
|
|
46
48
|
private _numberInputParse;
|
package/lib/input/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { initAttr as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
class
|
|
1
|
+
import { $one as h, on as a, formatStyle as d, addClass as p, off as o, $ as u, $$ as n, toggleClass as f } from "ph-utils/dom";
|
|
2
|
+
import { initAttr as c, parseAttrValue as m } from "../utils/index.js";
|
|
3
|
+
import g from "../form/form_inner.js";
|
|
4
|
+
import { add as b, remove as v } from "../utils/event.js";
|
|
5
|
+
import { i as C } from "../index-dwS1N2uN.js";
|
|
6
|
+
class y extends g {
|
|
7
7
|
static baseName = "input";
|
|
8
8
|
/** 原生 input 的 type */
|
|
9
9
|
type = "text";
|
|
@@ -18,9 +18,11 @@ class S extends v {
|
|
|
18
18
|
/** 宽度铺满 */
|
|
19
19
|
block = !1;
|
|
20
20
|
error = !1;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/** clearable */
|
|
22
|
+
clearable = !1;
|
|
23
|
+
$inner;
|
|
24
|
+
set value(t) {
|
|
25
|
+
this.setValue(t), this.$inner && (this.$inner.value = t);
|
|
24
26
|
}
|
|
25
27
|
get value() {
|
|
26
28
|
return this.getValue();
|
|
@@ -29,83 +31,132 @@ class S extends v {
|
|
|
29
31
|
return ["disabled", "error"];
|
|
30
32
|
}
|
|
31
33
|
connectedCallback() {
|
|
32
|
-
|
|
34
|
+
c(this), this.loadStyleText([C]), super.connectedCallback(), this.$inner = h(".l-input__inner", this.root), a(this.$inner, "input", this._input), a(this.$inner, "change", this.#i), this.style.cssText = d(this._getStyleObj()) + this.getAttr("style", ""), this.error && p(this, "is-error"), this.getName() && this.formAttrs.id && b(this.formAttrs.id, "validateChange", this._validateChange);
|
|
33
35
|
}
|
|
34
36
|
disconnectedCallback() {
|
|
35
|
-
super.disconnectedCallback(), this.formAttrs.id &&
|
|
37
|
+
super.disconnectedCallback(), this.formAttrs.id && v(this.formAttrs.id, "validateChange", this._validateChange), o(this.$inner, "input", this._input);
|
|
36
38
|
}
|
|
37
|
-
attributeChange(
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
attributeChange(t, i, e) {
|
|
40
|
+
if (t === "error") {
|
|
41
|
+
const s = m(e, !1, t);
|
|
42
|
+
s !== this.error && (this.error = s, this._updateError());
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
render() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const t = document.createDocumentFragment();
|
|
47
|
+
if (u('[slot="prefix"]', this).length > 0) {
|
|
48
|
+
const r = n("slot", {
|
|
49
|
+
name: "prefix"
|
|
50
|
+
}), l = n("span", {
|
|
51
|
+
class: "l-input__prefix",
|
|
52
|
+
part: "prefix"
|
|
53
|
+
});
|
|
54
|
+
l.appendChild(r), t.appendChild(l);
|
|
55
|
+
}
|
|
56
|
+
const e = n("input", {
|
|
57
|
+
class: "l-input__inner",
|
|
58
|
+
value: this.value,
|
|
59
|
+
name: this.getName(),
|
|
60
|
+
placeholder: this.placeholder,
|
|
61
|
+
disabled: this.isDisabled(),
|
|
62
|
+
part: "default",
|
|
63
|
+
type: this.type
|
|
64
|
+
});
|
|
65
|
+
if (t.appendChild(e), u('[slot="suffix"]', this).length > 0) {
|
|
66
|
+
const r = n("slot", {
|
|
67
|
+
name: "suffix"
|
|
68
|
+
}), l = n("span", {
|
|
69
|
+
class: "l-input__suffix",
|
|
70
|
+
part: "suffix"
|
|
71
|
+
});
|
|
72
|
+
l.appendChild(r), t.appendChild(l);
|
|
73
|
+
}
|
|
74
|
+
return t;
|
|
51
75
|
}
|
|
52
76
|
/**
|
|
53
77
|
* 设置自定义的输入解析器
|
|
54
78
|
* @param cb
|
|
55
79
|
*/
|
|
56
|
-
setParser(
|
|
57
|
-
this.parser =
|
|
80
|
+
setParser(t) {
|
|
81
|
+
this.parser = t;
|
|
58
82
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
_input = (e) => {
|
|
63
|
-
const s = e.target;
|
|
64
|
-
let t = s.value;
|
|
83
|
+
_input = (t) => {
|
|
84
|
+
const i = t.target;
|
|
85
|
+
let e = i.value;
|
|
65
86
|
if (this.allowInput != null) {
|
|
66
|
-
let
|
|
67
|
-
|
|
87
|
+
let s = this.allowInput.indexOf("."), r = s === -1 ? s : parseInt(this.allowInput.substring(s + 1));
|
|
88
|
+
e = this._numberInputParse(e, {
|
|
68
89
|
integer: this.allowInput.includes("integer"),
|
|
69
90
|
negative: this.allowInput.startsWith("-"),
|
|
70
91
|
precition: r
|
|
71
|
-
}),
|
|
92
|
+
}), e = String(e), i.value = e;
|
|
93
|
+
}
|
|
94
|
+
this.parser != null && (e = this.parser(e), i.value = e), this.setValue(e), this.#t();
|
|
95
|
+
};
|
|
96
|
+
#t() {
|
|
97
|
+
if (this.clearable) {
|
|
98
|
+
let t = h(".l-clearable", this.root);
|
|
99
|
+
if (this.value.length > 0) {
|
|
100
|
+
if (t == null) {
|
|
101
|
+
t = n("span", {
|
|
102
|
+
class: "l-input__suffix l-clearable"
|
|
103
|
+
});
|
|
104
|
+
const i = n("l-close-filled-icon");
|
|
105
|
+
t.appendChild(i), this.root.appendChild(t), a(t, "click", this.#e);
|
|
106
|
+
}
|
|
107
|
+
} else
|
|
108
|
+
t && (o(t, "click", this.#e), t.remove());
|
|
72
109
|
}
|
|
73
|
-
|
|
110
|
+
}
|
|
111
|
+
#e = () => {
|
|
112
|
+
this.value = "", this.dispatchEvent(
|
|
113
|
+
new CustomEvent("input", { bubbles: !0, detail: { value: this.value } })
|
|
114
|
+
), this.#t();
|
|
74
115
|
};
|
|
75
116
|
disabledChange() {
|
|
76
|
-
this
|
|
117
|
+
this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled());
|
|
77
118
|
}
|
|
78
|
-
_numberInputParse(
|
|
79
|
-
let
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
return
|
|
119
|
+
_numberInputParse(t, i) {
|
|
120
|
+
let e = t, s = i.negative ? "-?" : "";
|
|
121
|
+
if (i.integer) {
|
|
122
|
+
const l = e.match(new RegExp(`^(${s}\\d*)`));
|
|
123
|
+
return l != null ? l[1] : e.substring(0, e.length - 1);
|
|
83
124
|
}
|
|
84
|
-
const r =
|
|
125
|
+
const r = e.match(
|
|
85
126
|
new RegExp(
|
|
86
|
-
`(${
|
|
127
|
+
`(${s}\\d+\\.\\d{0,${i.precition}})|(${s}\\d*)`
|
|
87
128
|
)
|
|
88
129
|
);
|
|
89
|
-
return r != null ?
|
|
130
|
+
return r != null ? e = r[1] || r[2] : e = "", r != null ? r[1] || r[2] : "";
|
|
90
131
|
}
|
|
91
132
|
_getStyleObj() {
|
|
92
|
-
const
|
|
93
|
-
return this._isBlock() && (
|
|
133
|
+
const t = {};
|
|
134
|
+
return this._isBlock() && (t["--l-input-width"] = "100%"), this.width && (t["--l-input-width"] = this.width), t;
|
|
94
135
|
}
|
|
95
136
|
_isBlock() {
|
|
96
137
|
return this.block === !0 || this.formItemAttrs.innerBlock === !0 || this.formAttrs.innerBlock === !0;
|
|
97
138
|
}
|
|
98
139
|
_updateError() {
|
|
99
|
-
|
|
140
|
+
f(this, "is-error");
|
|
100
141
|
}
|
|
101
|
-
_validateChange = (
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
105
|
-
(
|
|
142
|
+
_validateChange = (t, i) => {
|
|
143
|
+
const e = this.getName();
|
|
144
|
+
if (e) {
|
|
145
|
+
const s = t === !0 ? !1 : t[e] != null;
|
|
146
|
+
(i == null || i === e && this.error != s) && (this.error = s, this._updateError()), Object.keys(t)[0] === e && this.focus();
|
|
106
147
|
}
|
|
107
148
|
};
|
|
149
|
+
#i = (t) => {
|
|
150
|
+
const i = t.target;
|
|
151
|
+
this.dispatchEvent(
|
|
152
|
+
new CustomEvent("change", {
|
|
153
|
+
bubbles: !0,
|
|
154
|
+
composed: !0,
|
|
155
|
+
detail: { value: i.value }
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
};
|
|
108
159
|
}
|
|
109
160
|
export {
|
|
110
|
-
|
|
161
|
+
y as default
|
|
111
162
|
};
|
package/lib/message/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { regist as y, useId as p } from "../utils/index.js";
|
|
2
2
|
import { transition as d } from "ph-utils/dom";
|
|
3
|
-
import h from "../icon/
|
|
3
|
+
import h from "../icon/close_filled.js";
|
|
4
4
|
import $ from "../icon/success.js";
|
|
5
5
|
import v from "../icon/warn.js";
|
|
6
6
|
import w from "../icon/info.js";
|
package/lib/select_ori/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import n from "../form/form_inner.js";
|
|
2
2
|
import { initAttr as c, tagAttrs as r } from "../utils/index.js";
|
|
3
3
|
import { $one as h, on as o, off as d } from "ph-utils/dom";
|
|
4
|
-
import { i as u } from "../index-
|
|
4
|
+
import { i as u } from "../index-dwS1N2uN.js";
|
|
5
5
|
class g extends n {
|
|
6
6
|
static baseName = "select-ori";
|
|
7
7
|
$select;
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "litos-ui",
|
|
3
3
|
"description": "基于 Web Component 的 UI 组件库",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@eslint/js": "^9.
|
|
8
|
-
"@eslint/markdown": "^6.
|
|
9
|
-
"@types/node": "^22.14.
|
|
10
|
-
"eslint": "^9.
|
|
7
|
+
"@eslint/js": "^9.25.0",
|
|
8
|
+
"@eslint/markdown": "^6.4.0",
|
|
9
|
+
"@types/node": "^22.14.1",
|
|
10
|
+
"eslint": "^9.25.0",
|
|
11
11
|
"globals": "^16.0.0",
|
|
12
12
|
"less": "^4.3.0",
|
|
13
13
|
"lightningcss": "^1.29.3",
|
|
14
14
|
"prettier": "^3.5.3",
|
|
15
15
|
"typescript": "^5.8.3",
|
|
16
|
-
"typescript-eslint": "^8.
|
|
17
|
-
"vite": "^6.2
|
|
16
|
+
"typescript-eslint": "^8.30.1",
|
|
17
|
+
"vite": "^6.3.2",
|
|
18
18
|
"vite-plugin-dts": "^4.5.3",
|
|
19
19
|
"vitepress": "^1.6.3"
|
|
20
20
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"iconify-icon": "^2.3.0",
|
|
56
56
|
"ph-utils": "^0.15.4",
|
|
57
|
-
"shiki": "^3.2.
|
|
57
|
+
"shiki": "^3.2.2"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"dev": "vite dev",
|
package/styles/vars.css
CHANGED
package/lib/index-391POYEJ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const r = ":host{display:inline-block;width:var(--l-input-width, auto)}.l-input{outline:none;box-sizing:border-box;width:100%;max-width:100%;height:var(--l-form-edit-height, 32px);border:1px solid var(--l-border-color, #dedede);transition:border-color .3s;text-align:inherit;padding:0 5px;border-radius:3px;vertical-align:middle}.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)}";
|
|
2
|
-
export {
|
|
3
|
-
r as i
|
|
4
|
-
};
|
|
File without changes
|