litos-ui 0.20.0 → 0.21.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/{animation-DStAHzod.js → animation-Bo4jbSGK.js} +4 -3
- package/lib/base.d.ts +3 -2
- package/lib/base.js +7 -7
- package/lib/button/index.d.ts +2 -2
- package/lib/button/index.js +152 -2
- package/lib/button/style.d.ts +2 -0
- package/lib/button/style.js +2 -0
- package/lib/calendar/index.d.ts +2 -2
- package/lib/card/index.d.ts +23 -0
- package/lib/card/index.js +2 -0
- package/lib/card-3DM-lJQV.js +63 -0
- package/lib/date_picker/index.d.ts +2 -2
- package/lib/dialog/dialog_box.d.ts +22 -0
- package/lib/dialog/dialog_box.js +98 -0
- package/lib/dialog/dialog_container.d.ts +7 -3
- package/lib/dialog/dialog_container.js +156 -2
- package/lib/dialog/dialog_container_style.d.ts +2 -0
- package/lib/dialog/dialog_container_style.js +2 -0
- package/lib/dialog/index.d.ts +33 -11
- package/lib/dialog/index.js +45 -47
- package/lib/dialog_container_style-C1s0aBf7.js +5 -0
- package/lib/form/form_item.d.ts +2 -2
- package/lib/form/form_item.js +1 -1
- package/lib/{form_item-CFIkfH29.js → form_item-BqPMRABd.js} +5 -5
- package/lib/icon/arrow_down.js +1 -1
- package/lib/icon/arrow_left.js +1 -1
- package/lib/icon/arrow_right.js +1 -1
- package/lib/icon/arrow_up.js +1 -1
- package/lib/icon/base.d.ts +3 -2
- package/lib/icon/base.js +63 -2
- package/lib/icon/calendar.js +1 -1
- package/lib/icon/caret_bottom.js +1 -1
- package/lib/icon/caret_top.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/close_filled.js +1 -1
- package/lib/icon/copy.d.ts +6 -0
- package/lib/icon/copy.js +13 -0
- package/lib/icon/d_arrow_left.js +1 -1
- package/lib/icon/d_arrow_right.js +1 -1
- package/lib/icon/font_icon.js +1 -1
- package/lib/icon/icon_style.d.ts +2 -0
- package/lib/icon/icon_style.js +2 -0
- package/lib/icon/info.js +1 -1
- package/lib/icon/loading.js +1 -1
- package/lib/icon/moon.js +1 -1
- package/lib/icon/more.js +1 -1
- package/lib/icon/reduction.js +1 -1
- package/lib/icon/refresh.js +1 -1
- package/lib/icon/refresh_left.js +1 -1
- package/lib/icon/refresh_right.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/select.js +1 -1
- package/lib/icon/sort.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/sun.js +1 -1
- package/lib/icon/theme_default.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/zoom_in.js +1 -1
- package/lib/icon/zoom_out.js +1 -1
- package/lib/icon_style-J7iiDS_a.js +5 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +74 -69
- package/lib/input/index.d.ts +2 -2
- package/lib/input_number/index.d.ts +59 -0
- package/lib/input_number/index.js +203 -0
- package/lib/input_number/style.d.ts +2 -0
- package/lib/input_number/style.js +2 -0
- package/lib/list/index.js +1 -1
- package/lib/{list-Dg5u5dgr.js → list-MG8PRzos.js} +2 -2
- package/lib/mask-Ox6CoyFB.js +5 -0
- package/lib/menu/index.d.ts +2 -2
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal_box.d.ts +22 -0
- package/lib/modal/modal_box.js +12 -12
- package/lib/{modal-iwxqmAqW.js → modal-Cwi3qlEf.js} +36 -32
- package/lib/pagination/index.d.ts +2 -2
- package/lib/qrcode/index.d.ts +2 -2
- package/lib/select/index.d.ts +2 -2
- package/lib/select_ori/index.d.ts +2 -2
- package/lib/style-C5wUmE2b.js +5 -0
- package/lib/style-gKR_qwzm.js +5 -0
- package/lib/styles/animation/index.d.ts +2 -0
- package/lib/styles/animation/index.js +2 -0
- package/lib/styles/mask/index.d.ts +2 -0
- package/lib/styles/mask/index.js +2 -0
- package/lib/theme/theme_color.d.ts +1 -2
- package/package.json +1 -1
- package/lib/base-Dyj1rzaK.js +0 -61
- package/lib/button-CDYYpQu6.js +0 -151
- package/lib/dialog_container-Bq6HsKey.js +0 -127
package/lib/index.js
CHANGED
|
@@ -1,78 +1,83 @@
|
|
|
1
1
|
import e from "./base.js";
|
|
2
2
|
import { initAttr as t, kebabToCamel as n, parseAttrValue as r, regist as i, setAttrs as a, stopSignal as o, tagAttr as s, tagAttrs as c, unitNumberStr as l, useId as u } from "./utils/index.js";
|
|
3
3
|
import { remove as d, set as f } from "./utils/clickoutside.js";
|
|
4
|
-
import
|
|
4
|
+
import p from "./icon/base.js";
|
|
5
5
|
import m from "./icon/close_filled.js";
|
|
6
6
|
import h from "./icon/success.js";
|
|
7
7
|
import g from "./icon/warn.js";
|
|
8
8
|
import _ from "./icon/info.js";
|
|
9
9
|
import v from "./message/index.js";
|
|
10
10
|
import y from "./dialog/index.js";
|
|
11
|
-
import
|
|
12
|
-
import x from "./
|
|
13
|
-
import S from "./
|
|
14
|
-
import { t as C } from "./
|
|
15
|
-
import w from "./
|
|
16
|
-
import T from "./
|
|
17
|
-
import E from "./
|
|
18
|
-
import D from "./
|
|
19
|
-
import O from "./
|
|
20
|
-
import k from "./
|
|
21
|
-
import A from "./icon/
|
|
22
|
-
import j from "./icon/
|
|
23
|
-
import M from "./icon/
|
|
24
|
-
import N from "./icon/
|
|
25
|
-
import P from "./icon/
|
|
26
|
-
import F from "./icon/
|
|
27
|
-
import I from "./icon/
|
|
28
|
-
import L from "./icon/
|
|
29
|
-
import R from "./icon/
|
|
30
|
-
import z from "./icon/
|
|
31
|
-
import B from "./icon/
|
|
32
|
-
import V from "./icon/
|
|
33
|
-
import H from "./icon/
|
|
34
|
-
import U from "./icon/
|
|
35
|
-
import W from "./icon/
|
|
36
|
-
import G from "./icon/
|
|
37
|
-
import K from "./icon/
|
|
38
|
-
import q from "./icon/
|
|
39
|
-
import J from "./icon/
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import Z from "./
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import ee from "./
|
|
46
|
-
import { t as te } from "./
|
|
47
|
-
import ne from "./
|
|
48
|
-
import { t as re } from "./
|
|
49
|
-
import { t as ie } from "./
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import {
|
|
53
|
-
import { t as
|
|
54
|
-
import { t as
|
|
55
|
-
import { t as
|
|
56
|
-
import {
|
|
57
|
-
import { t as _e } from "./
|
|
58
|
-
import { t as ve } from "./
|
|
59
|
-
import { t as ye } from "./
|
|
60
|
-
import { t as be } from "./
|
|
61
|
-
import xe from "./
|
|
62
|
-
import { t as Se } from "./
|
|
63
|
-
import { t as Ce } from "./
|
|
64
|
-
import { t as we } from "./
|
|
65
|
-
import
|
|
66
|
-
import { t as Ee } from "./
|
|
67
|
-
import { t as De } from "./
|
|
68
|
-
import { t as Oe } from "./
|
|
69
|
-
import { t as ke } from "./
|
|
70
|
-
import { t as Ae } from "./
|
|
71
|
-
import { t as je } from "./
|
|
72
|
-
import { t as Me } from "./
|
|
73
|
-
import { t as Ne } from "./
|
|
74
|
-
import { t as Pe } from "./
|
|
75
|
-
import { t as Fe } from "./
|
|
76
|
-
import { t as Ie } from "./
|
|
77
|
-
import { t as Le } from "./
|
|
78
|
-
|
|
11
|
+
import b from "./dialog/dialog_container.js";
|
|
12
|
+
import x from "./button/index.js";
|
|
13
|
+
import S from "./icon/close.js";
|
|
14
|
+
import { t as C } from "./form_item-BqPMRABd.js";
|
|
15
|
+
import w from "./input/index.js";
|
|
16
|
+
import T from "./dialog/dialog_box.js";
|
|
17
|
+
import E from "./loading/index.js";
|
|
18
|
+
import D from "./tabs/index.js";
|
|
19
|
+
import { t as O } from "./modal-Cwi3qlEf.js";
|
|
20
|
+
import k from "./modal/modal_box.js";
|
|
21
|
+
import A from "./icon/arrow_down.js";
|
|
22
|
+
import j from "./icon/arrow_left.js";
|
|
23
|
+
import M from "./icon/arrow_right.js";
|
|
24
|
+
import N from "./icon/arrow_up.js";
|
|
25
|
+
import P from "./icon/caret_top.js";
|
|
26
|
+
import F from "./icon/caret_bottom.js";
|
|
27
|
+
import I from "./icon/font_icon.js";
|
|
28
|
+
import L from "./icon/loading.js";
|
|
29
|
+
import R from "./icon/search.js";
|
|
30
|
+
import z from "./icon/sun.js";
|
|
31
|
+
import B from "./icon/moon.js";
|
|
32
|
+
import V from "./icon/reduction.js";
|
|
33
|
+
import H from "./icon/refresh_left.js";
|
|
34
|
+
import U from "./icon/refresh_right.js";
|
|
35
|
+
import W from "./icon/sort.js";
|
|
36
|
+
import G from "./icon/theme_default.js";
|
|
37
|
+
import K from "./icon/more.js";
|
|
38
|
+
import q from "./icon/d_arrow_left.js";
|
|
39
|
+
import J from "./icon/d_arrow_right.js";
|
|
40
|
+
import Y from "./icon/zoom_in.js";
|
|
41
|
+
import X from "./icon/zoom_out.js";
|
|
42
|
+
import Z from "./icon/select.js";
|
|
43
|
+
import Q from "./icon/calendar.js";
|
|
44
|
+
import $ from "./icon/refresh.js";
|
|
45
|
+
import ee from "./icon/copy.js";
|
|
46
|
+
import { t as te } from "./form-DJxvBiLy.js";
|
|
47
|
+
import ne from "./check/radio_group.js";
|
|
48
|
+
import { t as re } from "./radio-C9NPQWGI.js";
|
|
49
|
+
import { t as ie } from "./checkbox-DhGHJXwI.js";
|
|
50
|
+
import ae from "./check/checkbox_group.js";
|
|
51
|
+
import oe from "./input_number/index.js";
|
|
52
|
+
import { t as se } from "./select_ori-C7sUZxen.js";
|
|
53
|
+
import { t as ce } from "./switch-wh2-ivty.js";
|
|
54
|
+
import { t as le } from "./md_input-BX3bujz8.js";
|
|
55
|
+
import { t as ue } from "./select-BZMDj5VE.js";
|
|
56
|
+
import { Popover as de, autoUpdate as fe, createPopoverObserver as pe, getOverflowAncestors as me, popconfirmProps as he, updatePosition as ge } from "./utils/popover.js";
|
|
57
|
+
import { t as _e } from "./date_picker-BDN2PAz5.js";
|
|
58
|
+
import { t as ve } from "./date_picker_ori-BXFs1eET.js";
|
|
59
|
+
import { t as ye } from "./color_picker-0a-IGZY9.js";
|
|
60
|
+
import { t as be } from "./list-MG8PRzos.js";
|
|
61
|
+
import { t as xe } from "./polygon-DhhovlrG.js";
|
|
62
|
+
import { t as Se } from "./tabbar-CBXK-_AV.js";
|
|
63
|
+
import { t as Ce } from "./item-D_ZOPXuE.js";
|
|
64
|
+
import { t as we } from "./theme-CLbBS-in.js";
|
|
65
|
+
import Te from "./theme/theme_color.js";
|
|
66
|
+
import { t as Ee } from "./menu-DKscK5mw.js";
|
|
67
|
+
import { t as De } from "./carousel-DvkZ1YXq.js";
|
|
68
|
+
import { t as Oe } from "./item-CQ2Sknbz.js";
|
|
69
|
+
import { t as ke } from "./qrcode-Dip8uLSA.js";
|
|
70
|
+
import { t as Ae } from "./description_panel--AKXBzLL.js";
|
|
71
|
+
import { t as je } from "./pagination-aRbGd3Rf.js";
|
|
72
|
+
import { t as Me } from "./mask-Bx-yNIJv.js";
|
|
73
|
+
import { t as Ne } from "./page_header-ujV3pncE.js";
|
|
74
|
+
import { t as Pe } from "./tag-Di1z9PoZ.js";
|
|
75
|
+
import { t as Fe } from "./collapse-B6-Rn05A.js";
|
|
76
|
+
import { t as Ie } from "./item-DI6mQXtB.js";
|
|
77
|
+
import { t as Le } from "./image-CVQai6NX.js";
|
|
78
|
+
import { t as Re } from "./image_preview-DfQAKSJH.js";
|
|
79
|
+
import { t as ze } from "./table-BQxMD2Ae.js";
|
|
80
|
+
import { t as Be } from "./space-CKuTk0YB.js";
|
|
81
|
+
import { t as Ve } from "./card-3DM-lJQV.js";
|
|
82
|
+
import { t as He } from "./calendar-CvlUsN6w.js";
|
|
83
|
+
export { A as ArrowDownIcon, j as ArrowLeftIcon, M as ArrowRightIcon, N as ArrowUpIcon, e as BaseComponent, p as BaseIcon, x as Button, He as Calendar, Q as CalendarIcon, Ve as Card, F as CaretBottomIcon, P as CaretTopIcon, De as Carousel, Oe as CarouselItem, ie as Checkbox, ae as CheckboxGroup, m as CloseFilledIcon, S as CloseIcon, Fe as Collapse, Ie as CollapseItem, ye as ColorPicker, ee as CopyIcon, q as DArrowLeftIcon, J as DArrowRightIcon, _e as DatePicker, ve as DatePickerOri, Ae as DescriptionPanel, y as Dialog, T as DialogBox, b as DialogContainer, I as FontIcon, te as Form, C as FormItem, Le as Image, Re as ImagePreview, _ as InfoIcon, w as Input, oe as InputNumber, be as List, E as Loading, L as LoadingIcon, Me as Mask, le as MdInput, Ee as Menu, v as Message, O as Modal, k as ModalBox, B as MoonIcon, K as MoreIcon, Ne as PageHeader, je as Pagination, xe as Polygon, de as Popover, ke as Qrcode, re as Radio, ne as RadioGroup, V as ReductionIcon, $ as RefreshIcon, H as RefreshLeftIcon, U as RefreshRightIcon, R as SearchIcon, ue as Select, Z as SelectIcon, se as SelectOri, W as SortIcon, Be as Space, h as SuccessIcon, z as SunIcon, ce as Switch, Se as Tabbar, Ce as TabbarItem, ze as Table, D as Tabs, Pe as Tag, we as Theme, Te as ThemeColor, G as ThemeDefaultIcon, g as WarnIcon, Y as ZoomInIcon, X as ZoomOutIcon, f as addClickOutside, fe as autoUpdate, pe as createPopoverObserver, me as getOverflowAncestors, t as initAttr, n as kebabToCamel, r as parseAttrValue, he as popconfirmProps, i as regist, d as removeClickOutside, a as setAttrs, o as stopSignal, s as tagAttr, c as tagAttrs, l as unitNumberStr, ge as updatePosition, u as useId };
|
package/lib/input/index.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ export default class Input extends FormInner<InputState> {
|
|
|
40
40
|
protected updateDOM(changedProps: Set<string>): void;
|
|
41
41
|
_updateAttr(key: string, value: any): void;
|
|
42
42
|
render_v2(): {
|
|
43
|
-
template
|
|
44
|
-
style
|
|
43
|
+
template: DocumentFragment;
|
|
44
|
+
style: string[];
|
|
45
45
|
};
|
|
46
46
|
render(): DocumentFragment;
|
|
47
47
|
/**
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import FormInner from "../form/form_inner";
|
|
2
|
+
interface InputNumberState {
|
|
3
|
+
/** 最小值 */
|
|
4
|
+
min?: number;
|
|
5
|
+
/** 最大值 */
|
|
6
|
+
max?: number;
|
|
7
|
+
/** 步长 */
|
|
8
|
+
step: number;
|
|
9
|
+
/** 小数精度 */
|
|
10
|
+
precision?: number;
|
|
11
|
+
/** 占位符 */
|
|
12
|
+
placeholder: string;
|
|
13
|
+
/** 尺寸 */
|
|
14
|
+
size: "small" | "default" | "large";
|
|
15
|
+
/** 宽度 */
|
|
16
|
+
width?: string;
|
|
17
|
+
/** 是否禁用步进按钮 */
|
|
18
|
+
controlsDisabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
export default class InputNumber extends FormInner<InputNumberState> {
|
|
21
|
+
static baseName: string;
|
|
22
|
+
$input?: HTMLInputElement;
|
|
23
|
+
$minusBtn?: HTMLButtonElement;
|
|
24
|
+
$plusBtn?: HTMLButtonElement;
|
|
25
|
+
constructor();
|
|
26
|
+
static get observedAttributes(): string[];
|
|
27
|
+
protected attributeChange(name: string, _oldValue: string, newValue: string): void;
|
|
28
|
+
protected updateDOM(changedProps: Set<string>): void;
|
|
29
|
+
render_v2(): {
|
|
30
|
+
template: DocumentFragment;
|
|
31
|
+
styleSheets: CSSStyleSheet[];
|
|
32
|
+
};
|
|
33
|
+
render(): DocumentFragment;
|
|
34
|
+
afterInit(): void;
|
|
35
|
+
beforeDestroy(): void;
|
|
36
|
+
set value(value: any);
|
|
37
|
+
get value(): any;
|
|
38
|
+
disabledChange(): void;
|
|
39
|
+
focus(): void;
|
|
40
|
+
/** 将值限制在 min/max 范围内并格式化精度 */
|
|
41
|
+
private _clamp;
|
|
42
|
+
private _formatValue;
|
|
43
|
+
private _getCurrentNum;
|
|
44
|
+
private _commitValue;
|
|
45
|
+
private _handleInput;
|
|
46
|
+
private _handleChange;
|
|
47
|
+
private _handleBlur;
|
|
48
|
+
private _handleKeydown;
|
|
49
|
+
private _handleMinus;
|
|
50
|
+
private _handlePlus;
|
|
51
|
+
private _stepUp;
|
|
52
|
+
private _stepDown;
|
|
53
|
+
private _updateBtnState;
|
|
54
|
+
private _updateWidth;
|
|
55
|
+
private _updateControls;
|
|
56
|
+
protected innerBlockChange(innerBlock: boolean): void;
|
|
57
|
+
protected validResult(msg?: string): void;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { parseAttrValue as e, unitNumberStr as t } from "../utils/index.js";
|
|
2
|
+
import { t as n } from "../form_inner-Cnwb6f_Q.js";
|
|
3
|
+
import { t as r } from "../style-C5wUmE2b.js";
|
|
4
|
+
import { $$ as i, $one as a, addClass as o, off as s, on as c, removeClass as l } from "ph-utils/browser";
|
|
5
|
+
//#region src/components/input_number/index.ts
|
|
6
|
+
var u = class extends n {
|
|
7
|
+
static baseName = "input-number";
|
|
8
|
+
$input;
|
|
9
|
+
$minusBtn;
|
|
10
|
+
$plusBtn;
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.version = 2, this._state = {
|
|
13
|
+
step: 1,
|
|
14
|
+
placeholder: "",
|
|
15
|
+
size: "default",
|
|
16
|
+
controlsDisabled: !1
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get observedAttributes() {
|
|
20
|
+
return [
|
|
21
|
+
"disabled",
|
|
22
|
+
"value",
|
|
23
|
+
"name",
|
|
24
|
+
"inner-block",
|
|
25
|
+
"min",
|
|
26
|
+
"max",
|
|
27
|
+
"step",
|
|
28
|
+
"precision",
|
|
29
|
+
"placeholder",
|
|
30
|
+
"size",
|
|
31
|
+
"width",
|
|
32
|
+
"controls-disabled"
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
attributeChange(n, r, i) {
|
|
36
|
+
switch (n) {
|
|
37
|
+
case "min":
|
|
38
|
+
case "max":
|
|
39
|
+
case "precision":
|
|
40
|
+
let r = Number(i);
|
|
41
|
+
this._state[n] = Number.isFinite(r) ? r : void 0;
|
|
42
|
+
break;
|
|
43
|
+
case "step":
|
|
44
|
+
let a = Number(i);
|
|
45
|
+
this._state.step = Number.isFinite(a) ? a : 1;
|
|
46
|
+
break;
|
|
47
|
+
case "placeholder":
|
|
48
|
+
case "size":
|
|
49
|
+
this._state[n] = i.trim();
|
|
50
|
+
break;
|
|
51
|
+
case "width":
|
|
52
|
+
this._state.width = t(i);
|
|
53
|
+
break;
|
|
54
|
+
case "controls-disabled": this._state.controlsDisabled = e(i, !1, "controls-disabled");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
updateDOM(e) {
|
|
58
|
+
e.has("placeholder") && this.$input && (this.$input.placeholder = this._state.placeholder), e.has("width") && this._updateWidth(), e.has("controls-disabled") && this._updateControls(), (e.has("step") || e.has("min") || e.has("max")) && this._updateBtnState();
|
|
59
|
+
}
|
|
60
|
+
render_v2() {
|
|
61
|
+
return {
|
|
62
|
+
template: this.render(),
|
|
63
|
+
styleSheets: [r]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
let e = document.createDocumentFragment(), t = i("button", {
|
|
68
|
+
class: "l-input-number__btn l-input-number__minus",
|
|
69
|
+
type: "button",
|
|
70
|
+
part: "minus"
|
|
71
|
+
});
|
|
72
|
+
t.innerHTML = "<svg viewBox=\"0 0 1024 1024\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M128 512h768a25.6 25.6 0 1 1 0 51.2H128a25.6 25.6 0 1 1 0-51.2z\"></path></svg>", t.disabled = this.isDisabled(), e.appendChild(t);
|
|
73
|
+
let n = i("input", {
|
|
74
|
+
class: "l-input-number__inner",
|
|
75
|
+
value: this._formatValue(this.value),
|
|
76
|
+
name: this.getName(),
|
|
77
|
+
placeholder: this._state.placeholder,
|
|
78
|
+
part: "default",
|
|
79
|
+
type: "text",
|
|
80
|
+
inputmode: this._state.precision == null ? "numeric" : "decimal",
|
|
81
|
+
disabled: this.isDisabled() ? !0 : void 0
|
|
82
|
+
});
|
|
83
|
+
e.appendChild(n);
|
|
84
|
+
let r = i("button", {
|
|
85
|
+
class: "l-input-number__btn l-input-number__plus",
|
|
86
|
+
type: "button",
|
|
87
|
+
part: "plus"
|
|
88
|
+
});
|
|
89
|
+
return r.innerHTML = "<svg viewBox=\"0 0 1024 1024\" width=\"12\" height=\"12\" fill=\"currentColor\"><path d=\"M512 128a25.6 25.6 0 0 1 25.6 25.6v332.8h332.8a25.6 25.6 0 1 1 0 51.2H537.6v332.8a25.6 25.6 0 1 1-51.2 0V537.6H153.6a25.6 25.6 0 1 1 0-51.2h332.8V153.6A25.6 25.6 0 0 1 512 128z\"></path></svg>", r.disabled = this.isDisabled(), e.appendChild(r), e;
|
|
90
|
+
}
|
|
91
|
+
afterInit() {
|
|
92
|
+
this.$input = a(".l-input-number__inner", this.root), this.$minusBtn = a(".l-input-number__minus", this.root), this.$plusBtn = a(".l-input-number__plus", this.root), c(this.$input, "input", this._handleInput), c(this.$input, "change", this._handleChange), c(this.$input, "blur", this._handleBlur), c(this.$input, "keydown", this._handleKeydown), c(this.$minusBtn, "click", this._handleMinus), c(this.$plusBtn, "click", this._handlePlus), this._updateWidth(), this._updateBtnState(), this._updateControls(), this.className = `l-input-number--${this._state.size || "default"} ${this.className}`;
|
|
93
|
+
}
|
|
94
|
+
beforeDestroy() {
|
|
95
|
+
this.$input && (s(this.$input, "input", this._handleInput), s(this.$input, "change", this._handleChange), s(this.$input, "blur", this._handleBlur), s(this.$input, "keydown", this._handleKeydown)), this.$minusBtn && s(this.$minusBtn, "click", this._handleMinus), this.$plusBtn && s(this.$plusBtn, "click", this._handlePlus), this.$input = void 0, this.$minusBtn = void 0, this.$plusBtn = void 0;
|
|
96
|
+
}
|
|
97
|
+
set value(e) {
|
|
98
|
+
this.setValue(e), this.$input && (this.$input.value = this._formatValue(e)), this._updateBtnState();
|
|
99
|
+
}
|
|
100
|
+
get value() {
|
|
101
|
+
return this.getValue();
|
|
102
|
+
}
|
|
103
|
+
disabledChange() {
|
|
104
|
+
this.isDisabled() ? o(this, "is-disabled") : l(this, "is-disabled"), this.$input && (this.$input.disabled = this.isDisabled()), this.$minusBtn && (this.$minusBtn.disabled = this.isDisabled()), this.$plusBtn && (this.$plusBtn.disabled = this.isDisabled());
|
|
105
|
+
}
|
|
106
|
+
focus() {
|
|
107
|
+
this.$input?.focus();
|
|
108
|
+
}
|
|
109
|
+
_clamp(e) {
|
|
110
|
+
let { min: t, max: n, precision: r } = this._state;
|
|
111
|
+
return t != null && e < t && (e = t), n != null && e > n && (e = n), r != null && (e = parseFloat(e.toFixed(r))), e;
|
|
112
|
+
}
|
|
113
|
+
_formatValue(e) {
|
|
114
|
+
if (e == null || e === "") return "";
|
|
115
|
+
let t = Number(e);
|
|
116
|
+
if (isNaN(t)) return "";
|
|
117
|
+
let { precision: n } = this._state;
|
|
118
|
+
return n == null ? String(t) : t.toFixed(n);
|
|
119
|
+
}
|
|
120
|
+
_getCurrentNum() {
|
|
121
|
+
let e = this.$input?.value ?? this.value;
|
|
122
|
+
if (e == null || e === "") return 0;
|
|
123
|
+
let t = Number(e);
|
|
124
|
+
return isNaN(t) ? 0 : t;
|
|
125
|
+
}
|
|
126
|
+
_commitValue(e) {
|
|
127
|
+
let t = this._clamp(e);
|
|
128
|
+
this.value = t, this.$input && (this.$input.value = this._formatValue(t)), this.emit("input", {
|
|
129
|
+
bubbles: !0,
|
|
130
|
+
detail: {
|
|
131
|
+
value: t,
|
|
132
|
+
name: this.getName()
|
|
133
|
+
}
|
|
134
|
+
}), this._updateBtnState();
|
|
135
|
+
}
|
|
136
|
+
_handleInput = (e) => {
|
|
137
|
+
let t = e.target.value;
|
|
138
|
+
if (t === "-" || t === "." || t === "-.") return;
|
|
139
|
+
let n = Number(t);
|
|
140
|
+
Number.isFinite(n) && (this.setValue(n), this.emit("input", {
|
|
141
|
+
bubbles: !0,
|
|
142
|
+
detail: {
|
|
143
|
+
value: n,
|
|
144
|
+
name: this.getName()
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
};
|
|
148
|
+
_handleChange = (e) => {
|
|
149
|
+
let t = e.target, n = Number(t.value);
|
|
150
|
+
if (Number.isFinite(n)) {
|
|
151
|
+
let e = this._clamp(n);
|
|
152
|
+
this.value = e, this.$input && (this.$input.value = this._formatValue(e)), this.emit("change", { detail: {
|
|
153
|
+
value: e,
|
|
154
|
+
name: this.getName()
|
|
155
|
+
} });
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
_handleBlur = () => {
|
|
159
|
+
if (this.$input) {
|
|
160
|
+
let e = this.$input.value, t = parseFloat(e);
|
|
161
|
+
if (Number.isFinite(t)) {
|
|
162
|
+
let e = this._clamp(t);
|
|
163
|
+
this.value = e, this.$input.value = this._formatValue(e);
|
|
164
|
+
} else this.value = void 0, this.$input.value = "";
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
_handleKeydown = (e) => {
|
|
168
|
+
let t = e;
|
|
169
|
+
this.isDisabled() || (t.key === "ArrowUp" ? (t.preventDefault(), this._stepUp()) : t.key === "ArrowDown" && (t.preventDefault(), this._stepDown()));
|
|
170
|
+
};
|
|
171
|
+
_handleMinus = () => {
|
|
172
|
+
this.isDisabled() || (this._stepDown(), this.focus());
|
|
173
|
+
};
|
|
174
|
+
_handlePlus = () => {
|
|
175
|
+
this.isDisabled() || (this._stepUp(), this.focus());
|
|
176
|
+
};
|
|
177
|
+
_stepUp() {
|
|
178
|
+
let e = this._getCurrentNum();
|
|
179
|
+
this._commitValue(e + this._state.step);
|
|
180
|
+
}
|
|
181
|
+
_stepDown() {
|
|
182
|
+
let e = this._getCurrentNum();
|
|
183
|
+
this._commitValue(e - this._state.step);
|
|
184
|
+
}
|
|
185
|
+
_updateBtnState() {
|
|
186
|
+
let e = this._getCurrentNum(), { min: t, max: n } = this._state;
|
|
187
|
+
this.$minusBtn && t != null && (this.$minusBtn.disabled = this.isDisabled() || e <= t), this.$plusBtn && n != null && (this.$plusBtn.disabled = this.isDisabled() || e >= n);
|
|
188
|
+
}
|
|
189
|
+
_updateWidth() {
|
|
190
|
+
this._state.width ? this.style.setProperty("--l-input-number-width", this._state.width) : this.style.removeProperty("--l-input-number-width");
|
|
191
|
+
}
|
|
192
|
+
_updateControls() {
|
|
193
|
+
this._state.controlsDisabled ? (o(this, "l-input-number--no-controls"), this.$minusBtn && (this.$minusBtn.style.display = "none"), this.$plusBtn && (this.$plusBtn.style.display = "none")) : (l(this, "l-input-number--no-controls"), this.$minusBtn && (this.$minusBtn.style.display = ""), this.$plusBtn && (this.$plusBtn.style.display = ""));
|
|
194
|
+
}
|
|
195
|
+
innerBlockChange(e) {
|
|
196
|
+
e ? o(this, "is-block") : l(this, "is-block");
|
|
197
|
+
}
|
|
198
|
+
validResult(e) {
|
|
199
|
+
e == null ? l(this, "is-error") : o(this, "is-error");
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
//#endregion
|
|
203
|
+
export { u as default };
|
package/lib/list/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../list-
|
|
1
|
+
import { t as e } from "../list-MG8PRzos.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "./base.js";
|
|
2
2
|
import { parseAttrValue as t } from "./utils/index.js";
|
|
3
|
-
import { t as n } from "./animation-
|
|
3
|
+
import { t as n } from "./animation-Bo4jbSGK.js";
|
|
4
4
|
import { $one as r } from "ph-utils/browser";
|
|
5
5
|
//#region src/components/list/index.less?inline
|
|
6
6
|
var i = ":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)}", a = class extends e {
|
|
@@ -23,7 +23,7 @@ var i = ":host{-webkit-overflow-scrolling:touch;height:100%;display:block;positi
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
|
-
this.loadStyleText([i, n]
|
|
26
|
+
this.loadStyleText([i]), this.root.adoptedStyleSheets = [n], super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
|
|
27
27
|
e[0].isIntersecting && !this.finish && (this._page++, this.setAttribute("loading", ""), this.emit("load", { detail: { page: this._page } }));
|
|
28
28
|
}), this.$more = r(".l-list-loadmore", this.root), !this.finish && this.$more && this.observer.observe(this.$more));
|
|
29
29
|
}
|
package/lib/menu/index.d.ts
CHANGED
|
@@ -28,8 +28,8 @@ export default class Menu extends BaseComponent<MenuState> {
|
|
|
28
28
|
afterInit(): void;
|
|
29
29
|
beforeDestroy(): void;
|
|
30
30
|
render_v2(): {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
style: string;
|
|
32
|
+
template: HTMLElement;
|
|
33
33
|
};
|
|
34
34
|
_handleClick: (e: Event) => void;
|
|
35
35
|
/**
|
package/lib/modal/index.d.ts
CHANGED
|
@@ -43,8 +43,8 @@ export default class Modal extends BaseComponent<ModalState> {
|
|
|
43
43
|
protected updateDOM(changedProps: Set<string>): void;
|
|
44
44
|
afterInit(): void;
|
|
45
45
|
render_v2(): {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
style: string[];
|
|
47
|
+
styleSheets: CSSStyleSheet[];
|
|
48
48
|
};
|
|
49
49
|
_setZIndex(): void;
|
|
50
50
|
_setWidth(): void;
|
package/lib/modal/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../modal-
|
|
1
|
+
import { t as e } from "../modal-Cwi3qlEf.js";
|
|
2
2
|
export { e as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type AlertOptions = {
|
|
2
|
+
/** 是否显示取消按钮 */
|
|
3
|
+
showCancel?: boolean;
|
|
4
|
+
/** 右上角关闭按钮, 1-显示在框内,2-显示在框角, 0-不显示, 默认: 0 */
|
|
5
|
+
close?: number;
|
|
6
|
+
/** 点击蒙层是否允许关闭, 默认: false */
|
|
7
|
+
maskClosable?: boolean;
|
|
8
|
+
/** 显示图标 */
|
|
9
|
+
icon?: () => HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
type PromptOptions = AlertOptions & {
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
};
|
|
14
|
+
declare function alert(content: string, title?: string, option?: AlertOptions): Promise<boolean>;
|
|
15
|
+
declare function confirm(content: string, title?: string, option?: AlertOptions): Promise<string | boolean>;
|
|
16
|
+
declare function prompt(label: string, title?: string, option?: PromptOptions): Promise<string | boolean>;
|
|
17
|
+
declare const _default: {
|
|
18
|
+
alert: typeof alert;
|
|
19
|
+
confirm: typeof confirm;
|
|
20
|
+
prompt: typeof prompt;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
package/lib/modal/modal_box.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { regist as e } from "../utils/index.js";
|
|
2
2
|
import t from "../icon/info.js";
|
|
3
|
-
import
|
|
3
|
+
import n from "../button/index.js";
|
|
4
4
|
import r from "../icon/close.js";
|
|
5
|
-
import { t as i } from "../form_item-
|
|
6
|
-
import
|
|
7
|
-
import o from "../
|
|
5
|
+
import { t as i } from "../form_item-BqPMRABd.js";
|
|
6
|
+
import a from "../input/index.js";
|
|
7
|
+
import { t as o } from "../modal-Cwi3qlEf.js";
|
|
8
8
|
import { $$ as s, $one as c, on as l } from "ph-utils/browser";
|
|
9
9
|
//#region src/components/modal/modal_box.ts
|
|
10
10
|
function u(e, t, n, r = "alert") {
|
|
@@ -33,10 +33,10 @@ function u(e, t, n, r = "alert") {
|
|
|
33
33
|
}, { once: !0 }), document.body.appendChild(o);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function d(t, i,
|
|
36
|
+
function d(t, i, a) {
|
|
37
37
|
return e([
|
|
38
|
-
a,
|
|
39
38
|
n,
|
|
39
|
+
o,
|
|
40
40
|
r
|
|
41
41
|
]), new Promise((e) => {
|
|
42
42
|
let n = {
|
|
@@ -44,15 +44,15 @@ function d(t, i, o) {
|
|
|
44
44
|
close: 0,
|
|
45
45
|
maskClosable: !1,
|
|
46
46
|
icon: void 0,
|
|
47
|
-
...
|
|
47
|
+
...a
|
|
48
48
|
};
|
|
49
49
|
return u(i || "提示", t, n, "alert");
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function f(i,
|
|
52
|
+
function f(i, a, c) {
|
|
53
53
|
e([
|
|
54
|
-
a,
|
|
55
54
|
n,
|
|
55
|
+
o,
|
|
56
56
|
r,
|
|
57
57
|
t
|
|
58
58
|
]);
|
|
@@ -63,16 +63,16 @@ function f(i, o, c) {
|
|
|
63
63
|
icon: () => s("l-info-icon", { style: "color:#1890ff;" }),
|
|
64
64
|
...c
|
|
65
65
|
};
|
|
66
|
-
return u(
|
|
66
|
+
return u(a || "提示", i, l, "confirm");
|
|
67
67
|
}
|
|
68
68
|
function p(s, c, l) {
|
|
69
69
|
e([
|
|
70
|
-
a,
|
|
71
70
|
n,
|
|
71
|
+
o,
|
|
72
72
|
r,
|
|
73
73
|
t,
|
|
74
74
|
i,
|
|
75
|
-
|
|
75
|
+
a
|
|
76
76
|
]);
|
|
77
77
|
let d = {
|
|
78
78
|
showCancel: !0,
|