litos-ui 0.17.5 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/animation-CTt9qgA7.js +4 -0
- package/lib/base-Dm0WS1pK.js +62 -0
- package/lib/base.js +111 -147
- package/lib/button/index.d.ts +8 -3
- package/lib/button/index.js +2 -137
- package/lib/button-CC5PmAb1.js +146 -0
- package/lib/calendar/index.d.ts +10 -5
- package/lib/calendar/index.js +2 -123
- package/lib/calendar-GpYHNmXG.js +149 -0
- package/lib/carousel/index.js +2 -280
- package/lib/carousel/item.js +2 -15
- package/lib/carousel-dT3FJPQo.js +272 -0
- package/lib/check/checkbox.js +2 -18
- package/lib/check/checkbox_group.js +6 -6
- package/lib/check/radio.js +2 -15
- package/lib/check/radio_group.js +9 -9
- package/lib/check-B0XraJvb.js +73 -0
- package/lib/check-CvGaONEx.js +117 -0
- package/lib/checkbox-DbWsmAaL.js +16 -0
- package/lib/collapse/index.d.ts +18 -11
- package/lib/collapse/index.js +2 -88
- package/lib/collapse/item.d.ts +28 -9
- package/lib/collapse/item.js +2 -115
- package/lib/collapse/types.d.ts +7 -0
- package/lib/collapse-C3IRHLeg.js +104 -0
- package/lib/color_picker/index.js +2 -42
- package/lib/color_picker-D0brKFm-.js +41 -0
- package/lib/date_picker/index.d.ts +23 -0
- package/lib/date_picker/index.js +3 -0
- package/lib/date_picker-DQGoiN8v.js +103 -0
- package/lib/date_picker_ori/index.js +2 -129
- package/lib/date_picker_ori-aRuSSi9D.js +122 -0
- package/lib/description_panel/index.js +2 -66
- package/lib/description_panel-BY2yljeC.js +57 -0
- package/lib/dialog/dialog_container.js +2 -131
- package/lib/dialog/index.js +67 -85
- package/lib/dialog_container-DcN87wj0.js +126 -0
- package/lib/esm-sVEoAVPu.js +244 -0
- package/lib/form/form_item.d.ts +1 -0
- package/lib/form/form_item.js +2 -136
- package/lib/form/index.js +2 -147
- package/lib/form-DdU0yK0k.js +154 -0
- package/lib/form_inner-DR9tyB_r.js +117 -0
- package/lib/form_item-Bv-YafZK.js +137 -0
- package/lib/icon/arrow_down.js +12 -12
- package/lib/icon/arrow_left.js +9 -9
- package/lib/icon/arrow_right.js +9 -9
- package/lib/icon/arrow_up.js +12 -12
- package/lib/icon/base.d.ts +16 -2
- package/lib/icon/base.js +2 -38
- package/lib/icon/calendar.d.ts +5 -0
- package/lib/icon/calendar.js +10 -0
- package/lib/icon/caret_bottom.js +9 -9
- package/lib/icon/caret_top.js +9 -9
- package/lib/icon/close.js +9 -9
- package/lib/icon/close_filled.js +12 -12
- package/lib/icon/d_arrow_left.js +12 -12
- package/lib/icon/d_arrow_right.js +12 -12
- package/lib/icon/font_icon.d.ts +2 -3
- package/lib/icon/font_icon.js +35 -39
- package/lib/icon/info.js +12 -12
- package/lib/icon/loading.js +9 -9
- package/lib/icon/moon.js +12 -12
- package/lib/icon/more.js +12 -12
- package/lib/icon/reduction.js +12 -12
- package/lib/icon/refresh.d.ts +5 -0
- package/lib/icon/refresh.js +10 -0
- package/lib/icon/refresh_left.js +12 -12
- package/lib/icon/refresh_right.js +9 -9
- package/lib/icon/search.js +9 -9
- package/lib/icon/select.js +12 -12
- package/lib/icon/sort.js +9 -9
- package/lib/icon/success.js +12 -12
- package/lib/icon/sun.js +12 -12
- package/lib/icon/theme_default.js +12 -12
- package/lib/icon/warn.js +12 -12
- package/lib/icon/zoom_in.js +12 -12
- package/lib/icon/zoom_out.js +12 -12
- package/lib/image/image_preview.js +2 -104
- package/lib/image/index.js +2 -176
- package/lib/image-COPKk8Jm.js +162 -0
- package/lib/image_preview-CYEup07F.js +92 -0
- package/lib/index.d.ts +5 -81
- package/lib/index.js +78 -169
- package/lib/input/index.d.ts +6 -2
- package/lib/input/index.js +188 -203
- package/lib/input-DjKxcxry.js +4 -0
- package/lib/input_inner-BKJg9n9A.js +4 -0
- package/lib/item-B7Elh5xE.js +14 -0
- package/lib/item-CvoJt3wp.js +60 -0
- package/lib/item-DRsOV_Tc.js +119 -0
- package/lib/list/index.js +2 -58
- package/lib/list-CU7vHS6s.js +51 -0
- package/lib/loading/index.d.ts +3 -2
- package/lib/loading/index.js +109 -127
- package/lib/mask/index.js +2 -105
- package/lib/mask-CEznzwji.js +112 -0
- package/lib/md_input/index.js +2 -60
- package/lib/md_input-DSQx5TMW.js +58 -0
- package/lib/menu/index.d.ts +30 -13
- package/lib/menu/index.js +2 -105
- package/lib/menu/types.d.ts +6 -0
- package/lib/menu/types.js +0 -0
- package/lib/menu-CzV6lOlw.js +224 -0
- package/lib/message/index.js +67 -60
- package/lib/modal/index.js +2 -196
- package/lib/modal/modal_box.js +87 -86
- package/lib/modal-DWyWrN-D.js +192 -0
- package/lib/page_header/index.js +2 -109
- package/lib/page_header-BJkEstRw.js +101 -0
- package/lib/pagination/index.js +2 -248
- package/lib/pagination-5t7AOeFV.js +210 -0
- package/lib/polygon/index.js +2 -27
- package/lib/polygon-C4Ow2lxi.js +20 -0
- package/lib/qrcode/index.d.ts +13 -4
- package/lib/qrcode/index.js +2 -57
- package/lib/qrcode-BKG2MibP.js +64 -0
- package/lib/radio-2mNSYujz.js +13 -0
- package/lib/select/index.js +3 -401
- package/lib/select-CAgggYh7.js +326 -0
- package/lib/select_ori/index.js +47 -50
- package/lib/space/index.js +2 -35
- package/lib/space-Bv-p0DL8.js +38 -0
- package/lib/switch/index.js +2 -50
- package/lib/switch-BaVBi5Ip.js +48 -0
- package/lib/tabbar/index.js +2 -109
- package/lib/tabbar/item.js +2 -58
- package/lib/tabbar-CI1xSj1G.js +96 -0
- package/lib/table/index.js +2 -269
- package/lib/table-DfL2hFqA.js +234 -0
- package/lib/tabs/index.js +38 -42
- package/lib/tag/index.js +2 -72
- package/lib/tag-72DwCkvq.js +76 -0
- package/lib/theme/index.js +2 -89
- package/lib/theme/theme_color.js +22 -26
- package/lib/theme-BRTI2-Yk.js +83 -0
- package/lib/utils/clickoutside.js +18 -18
- package/lib/utils/context_provide.js +21 -21
- package/lib/utils/event.js +13 -18
- package/lib/utils/index.js +55 -58
- package/lib/utils/popover.d.ts +4 -1
- package/lib/utils/popover.js +276 -352
- package/lib/utils/transition.js +33 -31
- package/package.json +14 -14
- package/styles/container.css +4 -0
- package/styles/datepicker.css +55 -0
- package/styles/popover.css +14 -1
- package/lib/animation-DttknHkX.js +0 -4
- package/lib/calendar/langs.js +0 -8
- package/lib/carousel/timer.js +0 -19
- package/lib/check/check.js +0 -118
- package/lib/check/index.js +0 -68
- package/lib/check-CksURvTv.js +0 -4
- package/lib/form/form_inner.js +0 -125
- package/lib/form/types.js +0 -1
- package/lib/index-CrMiSe0x.js +0 -249
- package/lib/index-DY6m9Wbe.js +0 -4
- package/lib/litos-ui.css +0 -1
- package/lib/menu/menu_item.d.ts +0 -6
- package/lib/menu/menu_item.js +0 -21
- package/lib/menu/sub_menu.d.ts +0 -15
- package/lib/menu/sub_menu.js +0 -83
- package/lib/table/types.js +0 -1
package/lib/input/index.js
CHANGED
|
@@ -1,204 +1,189 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
validResult(t) {
|
|
189
|
-
this._updateError(t != null);
|
|
190
|
-
}
|
|
191
|
-
#s = (t) => {
|
|
192
|
-
const s = t.target;
|
|
193
|
-
this.dispatchEvent(
|
|
194
|
-
new CustomEvent("change", {
|
|
195
|
-
bubbles: !0,
|
|
196
|
-
composed: !0,
|
|
197
|
-
detail: { value: s.value, name: this.getName() }
|
|
198
|
-
})
|
|
199
|
-
);
|
|
200
|
-
};
|
|
201
|
-
}
|
|
202
|
-
export {
|
|
203
|
-
I as default
|
|
1
|
+
import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
|
|
2
|
+
import { t as n } from "../form_inner-DR9tyB_r.js";
|
|
3
|
+
import { t as r } from "../input-DjKxcxry.js";
|
|
4
|
+
import { t as i } from "../input_inner-BKJg9n9A.js";
|
|
5
|
+
import { $ as a, $$ as o, $one as s, addClass as c, formatStyle as l, off as u, on as d, removeClass as f } from "ph-utils/dom";
|
|
6
|
+
//#region src/components/input/index.ts
|
|
7
|
+
var p = class extends n {
|
|
8
|
+
static baseName = "input";
|
|
9
|
+
parser;
|
|
10
|
+
$inner;
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.version = 2, this._state = {
|
|
13
|
+
type: "text",
|
|
14
|
+
placeholder: "",
|
|
15
|
+
autosize: !1,
|
|
16
|
+
allowInput: void 0,
|
|
17
|
+
block: !1,
|
|
18
|
+
clearable: !1
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
set value(e) {
|
|
22
|
+
this.setValue(e), this.$inner && (this.$inner.value = e);
|
|
23
|
+
}
|
|
24
|
+
get value() {
|
|
25
|
+
return this.getValue();
|
|
26
|
+
}
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
return [
|
|
29
|
+
"disabled",
|
|
30
|
+
"value",
|
|
31
|
+
"name",
|
|
32
|
+
"inner-block",
|
|
33
|
+
"error",
|
|
34
|
+
"clearable",
|
|
35
|
+
"maxlength",
|
|
36
|
+
"minlength",
|
|
37
|
+
"inputmode",
|
|
38
|
+
"type",
|
|
39
|
+
"placeholder",
|
|
40
|
+
"width",
|
|
41
|
+
"block"
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
afterInit() {
|
|
45
|
+
this.$inner = s(".l-input__inner", this.root), d(this.$inner, "input", this._input), d(this.$inner, "change", this.#n), this.style.cssText = l(this._getStyleObj()) + this.getAttr("style", ""), this._updateError(this._state.error != null);
|
|
46
|
+
}
|
|
47
|
+
beforeDestroy() {
|
|
48
|
+
u(this.$inner, "input", this._input);
|
|
49
|
+
}
|
|
50
|
+
attributeChange(n, r, i) {
|
|
51
|
+
switch (n) {
|
|
52
|
+
case "error":
|
|
53
|
+
case "maxlength":
|
|
54
|
+
case "minlength":
|
|
55
|
+
case "inputmode":
|
|
56
|
+
case "placeholder":
|
|
57
|
+
case "type":
|
|
58
|
+
this._state[n] = i;
|
|
59
|
+
break;
|
|
60
|
+
case "clearable":
|
|
61
|
+
case "block":
|
|
62
|
+
let r = e(i, !1, n);
|
|
63
|
+
this._state[n] = r;
|
|
64
|
+
break;
|
|
65
|
+
case "width":
|
|
66
|
+
this._state.width = t(i);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
updateDOM(e) {
|
|
71
|
+
e.has("clearable") && (this._state.clearable ? c(this, "l-input--clearable") : f(this, "l-input--clearable")), e.has("error") && this._updateError(this._state.error != null), e.has("maxlength") && this._updateAttr("maxlength", this._state.maxlength), e.has("minlength") && this._updateAttr("minlength", this._state.minlength), e.has("inputmode") && this._updateAttr("inputmode", this._state.inputmode), e.has("block") && this.innerBlockChange(this._state.block);
|
|
72
|
+
}
|
|
73
|
+
_updateAttr(e, t) {
|
|
74
|
+
this.$inner && (t ? this.$inner.setAttribute(e, t) : this.$inner.removeAttribute(e));
|
|
75
|
+
}
|
|
76
|
+
render_v2() {
|
|
77
|
+
return {
|
|
78
|
+
template: this.render(),
|
|
79
|
+
style: [r, i]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
let e = document.createDocumentFragment();
|
|
84
|
+
if (a("[slot=\"prefix\"]", this).length > 0) {
|
|
85
|
+
let t = o("slot", { name: "prefix" }), n = o("span", {
|
|
86
|
+
class: "l-input__prefix",
|
|
87
|
+
part: "prefix"
|
|
88
|
+
});
|
|
89
|
+
n.appendChild(t), e.appendChild(n);
|
|
90
|
+
}
|
|
91
|
+
let t = o("input", {
|
|
92
|
+
class: "l-input__inner",
|
|
93
|
+
value: this.value,
|
|
94
|
+
name: this.getName(),
|
|
95
|
+
placeholder: this._state.placeholder,
|
|
96
|
+
part: "default",
|
|
97
|
+
type: this._state.type,
|
|
98
|
+
inputmode: this._state.inputmode,
|
|
99
|
+
maxlength: this._state.maxlength,
|
|
100
|
+
minlength: this._state.minlength,
|
|
101
|
+
disabled: this.isDisabled() ? !0 : void 0
|
|
102
|
+
});
|
|
103
|
+
if (e.appendChild(t), a("[slot=\"suffix\"]", this).length > 0) {
|
|
104
|
+
let t = o("slot", { name: "suffix" }), n = o("span", {
|
|
105
|
+
class: "l-input__suffix",
|
|
106
|
+
part: "suffix"
|
|
107
|
+
});
|
|
108
|
+
n.appendChild(t), e.appendChild(n);
|
|
109
|
+
}
|
|
110
|
+
return e;
|
|
111
|
+
}
|
|
112
|
+
setParser(e) {
|
|
113
|
+
this.parser = e;
|
|
114
|
+
}
|
|
115
|
+
_calcCurosorPosition(e, t) {
|
|
116
|
+
let n = e.selectionStart || 0, r = e.selectionEnd || 0, i = e.value, a = n, o = r;
|
|
117
|
+
t.length < i.length ? (a = Math.max(0, n - (i.length - t.length)), o = a) : t.length > i.length ? (a = Math.min(t.length, n + (t.length - i.length)), o = a) : (a = Math.min(t.length, n), o = a), e.value = t, e.setSelectionRange(a, o);
|
|
118
|
+
}
|
|
119
|
+
_input = (e) => {
|
|
120
|
+
let t = e.target, n = t.value, r = n;
|
|
121
|
+
if (this._state.allowInput != null) {
|
|
122
|
+
let e = this._state.allowInput.indexOf("."), t = e === -1 ? e : parseInt(this._state.allowInput.substring(e + 1));
|
|
123
|
+
r = this._numberInputParse(n, {
|
|
124
|
+
integer: this._state.allowInput.includes("integer"),
|
|
125
|
+
negative: this._state.allowInput.startsWith("-"),
|
|
126
|
+
precision: t
|
|
127
|
+
}), r = String(r);
|
|
128
|
+
}
|
|
129
|
+
this.parser != null && (r = this.parser(r)), this._calcCurosorPosition(t, r), this.setValue(r), this.#e();
|
|
130
|
+
};
|
|
131
|
+
#e() {
|
|
132
|
+
if (this._state.clearable) {
|
|
133
|
+
let e = s(".l-clearable", this.root);
|
|
134
|
+
if (this.value.length > 0) {
|
|
135
|
+
if (e == null) {
|
|
136
|
+
e = o("span", { class: "l-input__suffix l-clearable" });
|
|
137
|
+
let t = o("l-close-filled-icon");
|
|
138
|
+
e.appendChild(t), this.root.appendChild(e), d(e, "click", this.#t);
|
|
139
|
+
}
|
|
140
|
+
} else e && (u(e, "click", this.#t), e.remove());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
#t = () => {
|
|
144
|
+
this.value = "", this.dispatchEvent(new CustomEvent("input", {
|
|
145
|
+
bubbles: !0,
|
|
146
|
+
detail: { value: this.value }
|
|
147
|
+
})), this.#e();
|
|
148
|
+
};
|
|
149
|
+
disabledChange() {
|
|
150
|
+
this.isDisabled() ? this.classList.add("is-disabled") : this.classList.remove("is-disabled"), this.$inner && (this.$inner.disabled = this.isDisabled());
|
|
151
|
+
}
|
|
152
|
+
_numberInputParse(e, t) {
|
|
153
|
+
let n = e.trim();
|
|
154
|
+
if (n === "") return "";
|
|
155
|
+
let r = n.startsWith("-");
|
|
156
|
+
if (r && (t.negative || (n = n.slice(1), r = !1)), t.integer) n = n.replace(/[^\d]/g, "");
|
|
157
|
+
else {
|
|
158
|
+
let e = n.split(".");
|
|
159
|
+
n = e.length > 2 ? e[0] + "." + e.slice(1).join("").substring(0, t.precision) : e.length === 2 ? `${e[0].replace(/[^\d]/g, "")}.${e[1].replace(/[^\d]/g, "").substring(0, t.precision)}` : n.replace(/[^\d]/g, "");
|
|
160
|
+
}
|
|
161
|
+
return n.length > 1 && (n = n.replace(/^0+(\d)/, "$1")), r ? "-" + n : n;
|
|
162
|
+
}
|
|
163
|
+
innerBlockChange(e) {
|
|
164
|
+
e ? c(this, "is-block") : f(this, "is-block");
|
|
165
|
+
}
|
|
166
|
+
_getStyleObj() {
|
|
167
|
+
let e = {};
|
|
168
|
+
return this._state.width && (e["--l-input-width"] = this._state.width), e;
|
|
169
|
+
}
|
|
170
|
+
_updateError(e = !1) {
|
|
171
|
+
e ? c(this, "is-error") : f(this, "is-error");
|
|
172
|
+
}
|
|
173
|
+
validResult(e) {
|
|
174
|
+
this._updateError(e != null);
|
|
175
|
+
}
|
|
176
|
+
#n = (e) => {
|
|
177
|
+
let t = e.target;
|
|
178
|
+
this.dispatchEvent(new CustomEvent("change", {
|
|
179
|
+
bubbles: !0,
|
|
180
|
+
composed: !0,
|
|
181
|
+
detail: {
|
|
182
|
+
value: t.value,
|
|
183
|
+
name: this.getName()
|
|
184
|
+
}
|
|
185
|
+
}));
|
|
186
|
+
};
|
|
204
187
|
};
|
|
188
|
+
//#endregion
|
|
189
|
+
export { p as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/input/index.less?inline
|
|
2
|
+
var e = ":host{--l-input-border-color:var(--l-border-color,#dedede);width:var(--l-input-width,170px);height:var(--l-form-control-height,32px);border:1px solid var(--l-input-border-color,#dedede);border-radius:var(--l-border-radius,3px);vertical-align:middle;box-sizing:border-box;background-color:#0000;align-items:center;padding:0 7px;transition:border-color .3s;display:inline-flex}:host(:focus){--l-input-border-color:var(--l-primary-color,#722ed1)}:host(.is-block){width:100%}: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;flex-shrink:0;font-size:14px;display:inline-flex}.l-input__prefix{margin-right:5px}.l-input__suffix{margin-left:5px}.l-clearable{cursor:pointer}.l-clearable:hover{color:#999}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as t };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/components/input/input_inner.less?inline
|
|
2
|
+
var e = ".l-input__inner{box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:inherit;font-size:inherit;background-color:#0000;border:none;outline:none;flex-grow:1}.l-input__inner:disabled{background-color:#0000}";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "./base.js";
|
|
2
|
+
import { $$ as t } from "ph-utils/dom";
|
|
3
|
+
//#region src/components/carousel/item.less?inline
|
|
4
|
+
var n = ":host{width:var(--carousel-width,100%);box-sizing:border-box;height:100%;display:block}:host(.active){display:block}", r = class extends e {
|
|
5
|
+
static baseName = "carousel-item";
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
this.loadStyleText(n), super.connectedCallback();
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return t("slot");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import e from "./base.js";
|
|
2
|
+
import { parseAttrValue as t } from "./utils/index.js";
|
|
3
|
+
import { $$ as n, $one as r, addClass as i, removeClass as a } from "ph-utils/dom";
|
|
4
|
+
//#region src/components/tabbar/item.less?inline
|
|
5
|
+
var o = ":host{color:#666;cursor:pointer;flex-direction:column;flex-grow:var(--l-tabbar-item-grow,0);box-sizing:border-box;justify-content:center;align-items:center;line-height:1;transition:all .3s ease-in-out;display:inline-flex}:host(:hover){color:var(--l-tabbar-hover-color)}:host(.active){color:var(--l-tabbar-active-color)}.icon-wrapper{justify-content:center;align-items:center;margin-bottom:3px;font-size:18px;display:flex}.icon-wrapper.only{margin-bottom:0;font-size:24px}:host(.l-item--card){background:#f5f7fa;border:1px solid #f0f0f0;padding:0 15px}:host(.l-item--card:first-child){border-top-left-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card:last-child){border-top-right-radius:var(--l-tabbar-card-border-radius)}:host(.l-item--card.active){background:#fff}:host(.l-item--gap){border-top-left-radius:var(--l-tabbar-card-border-radius);border-top-right-radius:var(--l-tabbar-card-border-radius)}", s = class extends e {
|
|
6
|
+
static baseName = "tabbar-item";
|
|
7
|
+
name;
|
|
8
|
+
icon;
|
|
9
|
+
onlyIcon;
|
|
10
|
+
static get observedAttributes() {
|
|
11
|
+
return [
|
|
12
|
+
"name",
|
|
13
|
+
"label",
|
|
14
|
+
"icon",
|
|
15
|
+
"only-icon"
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.loadStyleText(o);
|
|
20
|
+
let e = this.parentElement;
|
|
21
|
+
e.gap && i(this, "l-item--gap"), e.type === "card" && i(this, "l-item--card"), super.connectedCallback();
|
|
22
|
+
}
|
|
23
|
+
attributeChangedCallback(e, n, r) {
|
|
24
|
+
if (e === "icon" || e === "only-icon") {
|
|
25
|
+
let n = t(r, !1, "icon");
|
|
26
|
+
this[e] = n, this.#e();
|
|
27
|
+
} else this[e] = r;
|
|
28
|
+
}
|
|
29
|
+
#e() {
|
|
30
|
+
if (!this.rendered) return;
|
|
31
|
+
let e = r(".icon-wrapper", this.root);
|
|
32
|
+
this.icon ? e ? this.onlyIcon ? i(e, "only") : a(e, "only") : (e = n("div", {
|
|
33
|
+
class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
|
|
34
|
+
innerHTML: "<slot name='icon'></slot>"
|
|
35
|
+
}), this.root.prepend(e)) : e && e.remove();
|
|
36
|
+
let t = r("slot:not([name])", this.root);
|
|
37
|
+
if (this.onlyIcon) t && t.remove();
|
|
38
|
+
else if (!t) {
|
|
39
|
+
let e = n("slot");
|
|
40
|
+
this.root.appendChild(e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
let e = document.createDocumentFragment();
|
|
45
|
+
if (this.icon) {
|
|
46
|
+
let t = n("div", {
|
|
47
|
+
class: ["icon-wrapper", this.onlyIcon ? "only" : ""],
|
|
48
|
+
innerHTML: "<slot name='icon'></slot>"
|
|
49
|
+
});
|
|
50
|
+
e.appendChild(t);
|
|
51
|
+
}
|
|
52
|
+
if (!this.onlyIcon) {
|
|
53
|
+
let t = n("slot");
|
|
54
|
+
e.appendChild(t);
|
|
55
|
+
}
|
|
56
|
+
return e;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { s as t };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import e from "./base.js";
|
|
2
|
+
import { kebabToCamel as t, parseAttrValue as n, stopSignal as r } from "./utils/index.js";
|
|
3
|
+
import { t as i } from "./esm-sVEoAVPu.js";
|
|
4
|
+
import { $$ as a, $one as o, off as s, on as c, queryHideNodeSize as l } from "ph-utils/dom";
|
|
5
|
+
//#region src/components/collapse/item.less?inline
|
|
6
|
+
var u = ":host{box-sizing:border-box;border-bottom:1px solid var(--l-collapse-border-color);color:#333;font-size:14px;display:block}.l-collapse-item__header{cursor:pointer;justify-content:flex-start;align-items:center;gap:5px;padding:10px 0;display:flex}.l-collapse-item__header.arrow-right{flex-direction:row-reverse;justify-content:flex-end}.l-collapse-item__header.space-between{justify-content:space-between}.l-collapse-arrow-icon{transition:transform .3s;transform:rotate(0)}.l-collapse-content{box-sizing:border-box;transition:height .3s;overflow-y:hidden}.l-collapse-content-box{padding-bottom:15px}:host(.l-collapse-expand) .l-collapse-arrow-icon{transform:rotate(90deg)}:host(.background){border-left:1px solid var(--l-collapse-border-color);border-right:1px solid var(--l-collapse-border-color);background-color:#00000005}:host(.background:first-child),:host(.background.space){border-top:1px solid var(--l-collapse-border-color)}:host(.background) .l-collapse-item__header{padding:10px 15px}:host(.background) .l-collapse-content{border-top:1px solid var(--l-collapse-border-color);background:#fff}:host(.background) .l-collapse-content-box{padding:15px}:host(:first-child){border-top-left-radius:var(--l-collapse-border-radius,0px);border-top-right-radius:var(--l-collapse-border-radius,0px)}:host(:last-child){border-bottom-left-radius:var(--l-collapse-border-radius,0px);border-bottom-right-radius:var(--l-collapse-border-radius,0px)}:host(.space){border-radius:var(--l-collapse-border-radius,0px)}", d = class extends e {
|
|
7
|
+
static baseName = "collapse-item";
|
|
8
|
+
$header;
|
|
9
|
+
context;
|
|
10
|
+
_ctxStop;
|
|
11
|
+
_expandStop;
|
|
12
|
+
expands;
|
|
13
|
+
constructor() {
|
|
14
|
+
super(), this.version = 2, this._state = {
|
|
15
|
+
prop: "",
|
|
16
|
+
headerText: "",
|
|
17
|
+
expand: !1
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
updateDOM(e) {
|
|
21
|
+
e.has("expand") && (this._setStyleAndClass(), this._handleExpand());
|
|
22
|
+
}
|
|
23
|
+
_setStyleAndClass() {
|
|
24
|
+
this._state.expand ? this.classList.add("l-collapse-expand") : this.classList.remove("l-collapse-expand");
|
|
25
|
+
}
|
|
26
|
+
static get observedAttributes() {
|
|
27
|
+
return [
|
|
28
|
+
"prop",
|
|
29
|
+
"header-text",
|
|
30
|
+
"expand"
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
attributeChanged(e, r, i) {
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "prop":
|
|
36
|
+
case "header-text":
|
|
37
|
+
this._state[t(e)] = i;
|
|
38
|
+
break;
|
|
39
|
+
case "expand":
|
|
40
|
+
let r = n(i, !1, "expand");
|
|
41
|
+
r !== this._state.expand && (this._state.expand = r);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
render_v2() {
|
|
46
|
+
this._state.expand && this._emitChange();
|
|
47
|
+
let e = document.createDocumentFragment(), t = a("div", {
|
|
48
|
+
class: "l-collapse-item__header",
|
|
49
|
+
part: "header"
|
|
50
|
+
}), n = a("l-arrow-right-icon", { class: "l-collapse-arrow-icon" });
|
|
51
|
+
if (t.appendChild(n), this._state.headerText) {
|
|
52
|
+
let e = a("span", {
|
|
53
|
+
part: "header-text",
|
|
54
|
+
textContent: `${this._state.headerText}`
|
|
55
|
+
});
|
|
56
|
+
t.appendChild(e);
|
|
57
|
+
} else t.appendChild(a("slot", { name: "header-text" }));
|
|
58
|
+
return e.appendChild(t), this._state.expand && e.appendChild(this._createContentElement(!1)), {
|
|
59
|
+
template: e,
|
|
60
|
+
style: u
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
afterInit() {
|
|
64
|
+
this._setStyleAndClass(), this.$header = o(".l-collapse-item__header", this.root), this.emitInject("collapse-context-request", this.contextInject), this._ctxStop = i(this._updateLayout), this._expandStop = i(this._handleExpandsChange), this.$header && c(this.$header, "click", this._handleHeaderTap);
|
|
65
|
+
}
|
|
66
|
+
beforeDestroy() {
|
|
67
|
+
this._ctxStop = r(this._ctxStop), this._expandStop = r(this._expandStop), this.$header && s(this.$header, "click", this._handleHeaderTap), this.$header = void 0;
|
|
68
|
+
}
|
|
69
|
+
_handleExpandsChange = () => {
|
|
70
|
+
this.expands && this.expands().includes(this._state.prop) !== this._state.expand && this._handleHeaderTap();
|
|
71
|
+
};
|
|
72
|
+
_handleHeaderTap = () => {
|
|
73
|
+
this._state.expand = !this._state.expand, this._setStyleAndClass(), this._handleExpand();
|
|
74
|
+
};
|
|
75
|
+
_updateLayout = () => {
|
|
76
|
+
if (!this.context) return;
|
|
77
|
+
let e = this.context();
|
|
78
|
+
this.$header && (e.arrowPlacement === "right" ? this.$header.classList.add("arrow-right") : this.$header.classList.remove("arrow-right"), e.headerJustify === "space-between" ? this.$header.classList.add("space-between") : this.$header.classList.remove("space-between")), e.background ? this.classList.add("background") : this.classList.remove("background"), e.gap ? this.classList.add("space") : this.classList.remove("space");
|
|
79
|
+
};
|
|
80
|
+
contextInject = (e, t) => {
|
|
81
|
+
this.context = e, this.expands = t;
|
|
82
|
+
};
|
|
83
|
+
_handleExpand() {
|
|
84
|
+
if (!this.rendered) return;
|
|
85
|
+
let e = o(".l-collapse-content", this.root), t = 0;
|
|
86
|
+
if (this._state.expand) {
|
|
87
|
+
this.classList.add("l-collapse-expand"), e || (e = this._createContentElement(!0), this.root.appendChild(e));
|
|
88
|
+
let n = l(e, null);
|
|
89
|
+
e.style.height = `${n.height}px`, e.style.display = "block", t = n.height;
|
|
90
|
+
} else this.classList.remove("l-collapse-expand"), e && (t = e.getBoundingClientRect().height);
|
|
91
|
+
if (e) {
|
|
92
|
+
let n = [{ height: "0px" }, { height: `${t}px` }];
|
|
93
|
+
this._state.expand || n.reverse();
|
|
94
|
+
let r = e.animate(n, { duration: 150 });
|
|
95
|
+
r.onfinish = () => {
|
|
96
|
+
this._state.expand || (e.style.display = "none"), r.onfinish = null, r = null;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
this._emitChange();
|
|
100
|
+
}
|
|
101
|
+
_emitChange = () => {
|
|
102
|
+
this.emit("expand-change", { detail: {
|
|
103
|
+
prop: this._state.prop,
|
|
104
|
+
expand: this._state.expand
|
|
105
|
+
} });
|
|
106
|
+
};
|
|
107
|
+
_createContentElement(e = !0) {
|
|
108
|
+
let t = a("div", {
|
|
109
|
+
class: "l-collapse-content",
|
|
110
|
+
style: e ? "display: none;" : ""
|
|
111
|
+
});
|
|
112
|
+
return a("div", {
|
|
113
|
+
class: "l-collapse-content-box",
|
|
114
|
+
innerHTML: "<slot></slot>"
|
|
115
|
+
}, t), t;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
//#endregion
|
|
119
|
+
export { d as t };
|