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.
Files changed (91) hide show
  1. package/lib/{animation-DStAHzod.js → animation-Bo4jbSGK.js} +4 -3
  2. package/lib/base.d.ts +3 -2
  3. package/lib/base.js +7 -7
  4. package/lib/button/index.d.ts +2 -2
  5. package/lib/button/index.js +152 -2
  6. package/lib/button/style.d.ts +2 -0
  7. package/lib/button/style.js +2 -0
  8. package/lib/calendar/index.d.ts +2 -2
  9. package/lib/card/index.d.ts +23 -0
  10. package/lib/card/index.js +2 -0
  11. package/lib/card-3DM-lJQV.js +63 -0
  12. package/lib/date_picker/index.d.ts +2 -2
  13. package/lib/dialog/dialog_box.d.ts +22 -0
  14. package/lib/dialog/dialog_box.js +98 -0
  15. package/lib/dialog/dialog_container.d.ts +7 -3
  16. package/lib/dialog/dialog_container.js +156 -2
  17. package/lib/dialog/dialog_container_style.d.ts +2 -0
  18. package/lib/dialog/dialog_container_style.js +2 -0
  19. package/lib/dialog/index.d.ts +33 -11
  20. package/lib/dialog/index.js +45 -47
  21. package/lib/dialog_container_style-C1s0aBf7.js +5 -0
  22. package/lib/form/form_item.d.ts +2 -2
  23. package/lib/form/form_item.js +1 -1
  24. package/lib/{form_item-CFIkfH29.js → form_item-BqPMRABd.js} +5 -5
  25. package/lib/icon/arrow_down.js +1 -1
  26. package/lib/icon/arrow_left.js +1 -1
  27. package/lib/icon/arrow_right.js +1 -1
  28. package/lib/icon/arrow_up.js +1 -1
  29. package/lib/icon/base.d.ts +3 -2
  30. package/lib/icon/base.js +63 -2
  31. package/lib/icon/calendar.js +1 -1
  32. package/lib/icon/caret_bottom.js +1 -1
  33. package/lib/icon/caret_top.js +1 -1
  34. package/lib/icon/close.js +1 -1
  35. package/lib/icon/close_filled.js +1 -1
  36. package/lib/icon/copy.d.ts +6 -0
  37. package/lib/icon/copy.js +13 -0
  38. package/lib/icon/d_arrow_left.js +1 -1
  39. package/lib/icon/d_arrow_right.js +1 -1
  40. package/lib/icon/font_icon.js +1 -1
  41. package/lib/icon/icon_style.d.ts +2 -0
  42. package/lib/icon/icon_style.js +2 -0
  43. package/lib/icon/info.js +1 -1
  44. package/lib/icon/loading.js +1 -1
  45. package/lib/icon/moon.js +1 -1
  46. package/lib/icon/more.js +1 -1
  47. package/lib/icon/reduction.js +1 -1
  48. package/lib/icon/refresh.js +1 -1
  49. package/lib/icon/refresh_left.js +1 -1
  50. package/lib/icon/refresh_right.js +1 -1
  51. package/lib/icon/search.js +1 -1
  52. package/lib/icon/select.js +1 -1
  53. package/lib/icon/sort.js +1 -1
  54. package/lib/icon/success.js +1 -1
  55. package/lib/icon/sun.js +1 -1
  56. package/lib/icon/theme_default.js +1 -1
  57. package/lib/icon/warn.js +1 -1
  58. package/lib/icon/zoom_in.js +1 -1
  59. package/lib/icon/zoom_out.js +1 -1
  60. package/lib/icon_style-J7iiDS_a.js +5 -0
  61. package/lib/index.d.ts +5 -0
  62. package/lib/index.js +74 -69
  63. package/lib/input/index.d.ts +2 -2
  64. package/lib/input_number/index.d.ts +59 -0
  65. package/lib/input_number/index.js +203 -0
  66. package/lib/input_number/style.d.ts +2 -0
  67. package/lib/input_number/style.js +2 -0
  68. package/lib/list/index.js +1 -1
  69. package/lib/{list-Dg5u5dgr.js → list-MG8PRzos.js} +2 -2
  70. package/lib/mask-Ox6CoyFB.js +5 -0
  71. package/lib/menu/index.d.ts +2 -2
  72. package/lib/modal/index.d.ts +2 -2
  73. package/lib/modal/index.js +1 -1
  74. package/lib/modal/modal_box.d.ts +22 -0
  75. package/lib/modal/modal_box.js +12 -12
  76. package/lib/{modal-iwxqmAqW.js → modal-Cwi3qlEf.js} +36 -32
  77. package/lib/pagination/index.d.ts +2 -2
  78. package/lib/qrcode/index.d.ts +2 -2
  79. package/lib/select/index.d.ts +2 -2
  80. package/lib/select_ori/index.d.ts +2 -2
  81. package/lib/style-C5wUmE2b.js +5 -0
  82. package/lib/style-gKR_qwzm.js +5 -0
  83. package/lib/styles/animation/index.d.ts +2 -0
  84. package/lib/styles/animation/index.js +2 -0
  85. package/lib/styles/mask/index.d.ts +2 -0
  86. package/lib/styles/mask/index.js +2 -0
  87. package/lib/theme/theme_color.d.ts +1 -2
  88. package/package.json +1 -1
  89. package/lib/base-Dyj1rzaK.js +0 -61
  90. package/lib/button-CDYYpQu6.js +0 -151
  91. 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 { t as p } from "./base-Dyj1rzaK.js";
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 { t as b } from "./dialog_container-Bq6HsKey.js";
12
- import x from "./loading/index.js";
13
- import S from "./tabs/index.js";
14
- import { t as C } from "./modal-iwxqmAqW.js";
15
- import w from "./icon/arrow_down.js";
16
- import T from "./icon/arrow_left.js";
17
- import E from "./icon/arrow_right.js";
18
- import D from "./icon/arrow_up.js";
19
- import O from "./icon/caret_top.js";
20
- import k from "./icon/caret_bottom.js";
21
- import A from "./icon/font_icon.js";
22
- import j from "./icon/loading.js";
23
- import M from "./icon/search.js";
24
- import N from "./icon/sun.js";
25
- import P from "./icon/moon.js";
26
- import F from "./icon/reduction.js";
27
- import I from "./icon/refresh_left.js";
28
- import L from "./icon/refresh_right.js";
29
- import R from "./icon/sort.js";
30
- import z from "./icon/theme_default.js";
31
- import B from "./icon/close.js";
32
- import V from "./icon/more.js";
33
- import H from "./icon/d_arrow_left.js";
34
- import U from "./icon/d_arrow_right.js";
35
- import W from "./icon/zoom_in.js";
36
- import G from "./icon/zoom_out.js";
37
- import K from "./icon/select.js";
38
- import q from "./icon/calendar.js";
39
- import J from "./icon/refresh.js";
40
- import { t as Y } from "./form-DJxvBiLy.js";
41
- import { t as X } from "./form_item-CFIkfH29.js";
42
- import Z from "./check/radio_group.js";
43
- import { t as Q } from "./radio-C9NPQWGI.js";
44
- import { t as $ } from "./checkbox-DhGHJXwI.js";
45
- import ee from "./check/checkbox_group.js";
46
- import { t as te } from "./button-CDYYpQu6.js";
47
- import ne from "./input/index.js";
48
- import { t as re } from "./select_ori-C7sUZxen.js";
49
- import { t as ie } from "./switch-wh2-ivty.js";
50
- import { t as ae } from "./md_input-BX3bujz8.js";
51
- import { t as oe } from "./select-BZMDj5VE.js";
52
- import { Popover as se, autoUpdate as ce, createPopoverObserver as le, getOverflowAncestors as ue, popconfirmProps as de, updatePosition as fe } from "./utils/popover.js";
53
- import { t as pe } from "./date_picker-BDN2PAz5.js";
54
- import { t as me } from "./date_picker_ori-BXFs1eET.js";
55
- import { t as he } from "./color_picker-0a-IGZY9.js";
56
- import { t as ge } from "./list-Dg5u5dgr.js";
57
- import { t as _e } from "./polygon-DhhovlrG.js";
58
- import { t as ve } from "./tabbar-CBXK-_AV.js";
59
- import { t as ye } from "./item-D_ZOPXuE.js";
60
- import { t as be } from "./theme-CLbBS-in.js";
61
- import xe from "./theme/theme_color.js";
62
- import { t as Se } from "./menu-DKscK5mw.js";
63
- import { t as Ce } from "./carousel-DvkZ1YXq.js";
64
- import { t as we } from "./item-CQ2Sknbz.js";
65
- import { t as Te } from "./qrcode-Dip8uLSA.js";
66
- import { t as Ee } from "./description_panel--AKXBzLL.js";
67
- import { t as De } from "./pagination-aRbGd3Rf.js";
68
- import { t as Oe } from "./mask-Bx-yNIJv.js";
69
- import { t as ke } from "./page_header-ujV3pncE.js";
70
- import { t as Ae } from "./tag-Di1z9PoZ.js";
71
- import { t as je } from "./collapse-B6-Rn05A.js";
72
- import { t as Me } from "./item-DI6mQXtB.js";
73
- import { t as Ne } from "./image-CVQai6NX.js";
74
- import { t as Pe } from "./image_preview-DfQAKSJH.js";
75
- import { t as Fe } from "./table-BQxMD2Ae.js";
76
- import { t as Ie } from "./space-CKuTk0YB.js";
77
- import { t as Le } from "./calendar-CvlUsN6w.js";
78
- export { w as ArrowDownIcon, T as ArrowLeftIcon, E as ArrowRightIcon, D as ArrowUpIcon, e as BaseComponent, p as BaseIcon, te as Button, Le as Calendar, q as CalendarIcon, k as CaretBottomIcon, O as CaretTopIcon, Ce as Carousel, we as CarouselItem, $ as Checkbox, ee as CheckboxGroup, m as CloseFilledIcon, B as CloseIcon, je as Collapse, Me as CollapseItem, he as ColorPicker, H as DArrowLeftIcon, U as DArrowRightIcon, pe as DatePicker, me as DatePickerOri, Ee as DescriptionPanel, y as Dialog, b as DialogContainer, A as FontIcon, Y as Form, X as FormItem, Ne as Image, Pe as ImagePreview, _ as InfoIcon, ne as Input, ge as List, x as Loading, j as LoadingIcon, Oe as Mask, ae as MdInput, Se as Menu, v as Message, C as Modal, P as MoonIcon, V as MoreIcon, ke as PageHeader, De as Pagination, _e as Polygon, se as Popover, Te as Qrcode, Q as Radio, Z as RadioGroup, F as ReductionIcon, J as RefreshIcon, I as RefreshLeftIcon, L as RefreshRightIcon, M as SearchIcon, oe as Select, K as SelectIcon, re as SelectOri, R as SortIcon, Ie as Space, h as SuccessIcon, N as SunIcon, ie as Switch, ve as Tabbar, ye as TabbarItem, Fe as Table, S as Tabs, Ae as Tag, be as Theme, xe as ThemeColor, z as ThemeDefaultIcon, g as WarnIcon, W as ZoomInIcon, G as ZoomOutIcon, f as addClickOutside, ce as autoUpdate, le as createPopoverObserver, ue as getOverflowAncestors, t as initAttr, n as kebabToCamel, r as parseAttrValue, de as popconfirmProps, i as regist, d as removeClickOutside, a as setAttrs, o as stopSignal, s as tagAttr, c as tagAttrs, l as unitNumberStr, fe as updatePosition, u as useId };
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 };
@@ -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?: string | HTMLElement | DocumentFragment;
44
- style?: string | string[];
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 };
@@ -0,0 +1,2 @@
1
+ declare const inputNumberSheet: CSSStyleSheet;
2
+ export default inputNumberSheet;
@@ -0,0 +1,2 @@
1
+ import { t as e } from "../style-C5wUmE2b.js";
2
+ export { e as default };
package/lib/list/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "../list-Dg5u5dgr.js";
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-DStAHzod.js";
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]), super.connectedCallback(), this.infinite && (this.observer = new IntersectionObserver((e) => {
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
  }
@@ -0,0 +1,5 @@
1
+ //#region src/components/styles/mask/index.css?inline
2
+ var e = ".l-mask{z-index:var(--l-mask-zindex,100);opacity:1;background-color:#0009;transition:opacity .3s;position:fixed;inset:0}", t = new CSSStyleSheet();
3
+ t.replaceSync(e);
4
+ //#endregion
5
+ export { t };
@@ -28,8 +28,8 @@ export default class Menu extends BaseComponent<MenuState> {
28
28
  afterInit(): void;
29
29
  beforeDestroy(): void;
30
30
  render_v2(): {
31
- template?: string | HTMLElement | DocumentFragment;
32
- style?: string | string[];
31
+ style: string;
32
+ template: HTMLElement;
33
33
  };
34
34
  _handleClick: (e: Event) => void;
35
35
  /**
@@ -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
- template?: string | HTMLElement | DocumentFragment;
47
- style?: string | string[];
46
+ style: string[];
47
+ styleSheets: CSSStyleSheet[];
48
48
  };
49
49
  _setZIndex(): void;
50
50
  _setWidth(): void;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../modal-iwxqmAqW.js";
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;
@@ -1,10 +1,10 @@
1
1
  import { regist as e } from "../utils/index.js";
2
2
  import t from "../icon/info.js";
3
- import { t as n } from "../modal-iwxqmAqW.js";
3
+ import n from "../button/index.js";
4
4
  import r from "../icon/close.js";
5
- import { t as i } from "../form_item-CFIkfH29.js";
6
- import { t as a } from "../button-CDYYpQu6.js";
7
- import o from "../input/index.js";
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, o) {
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
- ...o
47
+ ...a
48
48
  };
49
49
  return u(i || "提示", t, n, "alert");
50
50
  });
51
51
  }
52
- function f(i, o, c) {
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(o || "提示", i, l, "confirm");
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
- o
75
+ a
76
76
  ]);
77
77
  let d = {
78
78
  showCancel: !0,