litos-ui 0.18.3 → 0.18.5

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 (126) hide show
  1. package/lib/button/index.js +1 -1
  2. package/lib/{button-DEm6CutF.js → button-CC5NBWtI.js} +1 -1
  3. package/lib/calendar/index.js +1 -1
  4. package/lib/carousel/index.js +1 -1
  5. package/lib/carousel/item.js +1 -1
  6. package/lib/check/checkbox.js +1 -1
  7. package/lib/check/checkbox_group.js +1 -1
  8. package/lib/check/radio.js +1 -1
  9. package/lib/check/radio_group.js +1 -1
  10. package/lib/{check-B0XraJvb.js → check-BDOpD_0-.js} +2 -2
  11. package/lib/{check-CvGaONEx.js → check-CrlZ7zVL.js} +3 -3
  12. package/lib/checkbox-D_bZGoUD.js +16 -0
  13. package/lib/collapse/index.js +1 -1
  14. package/lib/collapse/item.js +1 -1
  15. package/lib/{collapse-C3IRHLeg.js → collapse-BRxYoeJx.js} +1 -1
  16. package/lib/color_picker/index.js +1 -1
  17. package/lib/{color_picker-DYN8DCng.js → color_picker-AaFcIczZ.js} +2 -2
  18. package/lib/date_picker/index.js +1 -1
  19. package/lib/{date_picker-DQGoiN8v.js → date_picker-HjkRma9j.js} +2 -2
  20. package/lib/date_picker_ori/index.js +1 -1
  21. package/lib/{date_picker_ori-aRuSSi9D.js → date_picker_ori-1IOHZsan.js} +1 -1
  22. package/lib/description_panel/index.js +1 -1
  23. package/lib/dialog/dialog_container.js +1 -1
  24. package/lib/esm-Cir9D6cn.js +270 -0
  25. package/lib/form/form_inner.d.ts +4 -1
  26. package/lib/form/form_item.js +1 -1
  27. package/lib/form/index.d.ts +13 -2
  28. package/lib/form/index.js +1 -1
  29. package/lib/{form-CNWykMNM.js → form-BvZHaqAt.js} +49 -19
  30. package/lib/{form_inner-DR9tyB_r.js → form_inner-52DR1IPu.js} +13 -4
  31. package/lib/{form_item-Clu9QKRa.js → form_item-DtqChzc3.js} +1 -1
  32. package/lib/icon/arrow_down.js +1 -1
  33. package/lib/icon/arrow_left.js +1 -1
  34. package/lib/icon/arrow_right.js +1 -1
  35. package/lib/icon/arrow_up.js +1 -1
  36. package/lib/icon/base.js +1 -1
  37. package/lib/icon/calendar.js +1 -1
  38. package/lib/icon/caret_bottom.js +1 -1
  39. package/lib/icon/caret_top.js +1 -1
  40. package/lib/icon/close.js +1 -1
  41. package/lib/icon/close_filled.js +1 -1
  42. package/lib/icon/d_arrow_left.js +1 -1
  43. package/lib/icon/d_arrow_right.js +1 -1
  44. package/lib/icon/font_icon.js +1 -1
  45. package/lib/icon/info.js +1 -1
  46. package/lib/icon/loading.js +1 -1
  47. package/lib/icon/moon.js +1 -1
  48. package/lib/icon/more.js +1 -1
  49. package/lib/icon/reduction.js +1 -1
  50. package/lib/icon/refresh.js +1 -1
  51. package/lib/icon/refresh_left.js +1 -1
  52. package/lib/icon/refresh_right.js +1 -1
  53. package/lib/icon/search.js +1 -1
  54. package/lib/icon/select.js +1 -1
  55. package/lib/icon/sort.js +1 -1
  56. package/lib/icon/success.js +1 -1
  57. package/lib/icon/sun.js +1 -1
  58. package/lib/icon/theme_default.js +1 -1
  59. package/lib/icon/warn.js +1 -1
  60. package/lib/icon/zoom_in.js +1 -1
  61. package/lib/icon/zoom_out.js +1 -1
  62. package/lib/image/image_preview.js +1 -1
  63. package/lib/image/index.js +1 -1
  64. package/lib/{image_preview-CYEup07F.js → image_preview-BeJzfEoF.js} +1 -1
  65. package/lib/index.js +36 -36
  66. package/lib/input/index.js +3 -3
  67. package/lib/{item-DRsOV_Tc.js → item-Dq6M7lxw.js} +1 -1
  68. package/lib/list/index.js +1 -1
  69. package/lib/{list-CU7vHS6s.js → list-Dz1Ya118.js} +1 -1
  70. package/lib/loading/index.js +7 -6
  71. package/lib/mask/index.js +1 -1
  72. package/lib/md_input/index.js +1 -1
  73. package/lib/{md_input-DSQx5TMW.js → md_input-DN3ceqsw.js} +1 -1
  74. package/lib/menu/index.js +1 -1
  75. package/lib/modal/index.js +1 -1
  76. package/lib/modal/modal_box.js +3 -3
  77. package/lib/page_header/index.js +1 -1
  78. package/lib/pagination/index.js +1 -1
  79. package/lib/polygon/index.js +1 -1
  80. package/lib/qrcode/index.js +1 -1
  81. package/lib/{radio-2mNSYujz.js → radio-C7dkhgwc.js} +1 -1
  82. package/lib/select/index.d.ts +24 -15
  83. package/lib/select/index.js +1 -1
  84. package/lib/select-Cis6kRjQ.js +351 -0
  85. package/lib/select_ori/index.d.ts +5 -0
  86. package/lib/select_ori/index.js +2 -48
  87. package/lib/select_ori-DcJbNYYr.js +57 -0
  88. package/lib/space/index.js +1 -1
  89. package/lib/switch/index.js +1 -1
  90. package/lib/{switch-BaVBi5Ip.js → switch-UyhlgW7F.js} +1 -1
  91. package/lib/tabbar/index.js +1 -1
  92. package/lib/tabbar/item.js +1 -1
  93. package/lib/table/index.js +1 -1
  94. package/lib/tag/index.js +1 -1
  95. package/lib/theme/index.js +1 -1
  96. package/lib/{theme-BRTI2-Yk.js → theme-Barcq234.js} +5 -2
  97. package/lib/utils/event.js +1 -1
  98. package/lib/utils/popover.js +11 -14
  99. package/package.json +13 -10
  100. package/styles/vars.css +1 -2
  101. package/types/preact.d.ts +128 -0
  102. package/lib/checkbox-DbWsmAaL.js +0 -16
  103. package/lib/esm-sVEoAVPu.js +0 -244
  104. package/lib/select-CAgggYh7.js +0 -326
  105. /package/lib/{animation-CTt9qgA7.js → animation-DStAHzod.js} +0 -0
  106. /package/lib/{base-Dm0WS1pK.js → base-LvfO4mmL.js} +0 -0
  107. /package/lib/{calendar-GpYHNmXG.js → calendar-Clbg3qot.js} +0 -0
  108. /package/lib/{carousel-dT3FJPQo.js → carousel-Dgirxwzb.js} +0 -0
  109. /package/lib/{description_panel-BY2yljeC.js → description_panel-DaqVcA6-.js} +0 -0
  110. /package/lib/{dialog_container-DcN87wj0.js → dialog_container-CcTyfoaD.js} +0 -0
  111. /package/lib/{image-COPKk8Jm.js → image-BCUhVAFo.js} +0 -0
  112. /package/lib/{input-UfukfZIy.js → input-DUBlLEXS.js} +0 -0
  113. /package/lib/{input_inner-BKJg9n9A.js → input_inner-x4GfLGjj.js} +0 -0
  114. /package/lib/{item-B7Elh5xE.js → item-42bYhAkZ.js} +0 -0
  115. /package/lib/{item-CvoJt3wp.js → item-CX8C9X57.js} +0 -0
  116. /package/lib/{mask-CEznzwji.js → mask-BlDl9u8F.js} +0 -0
  117. /package/lib/{menu-CzV6lOlw.js → menu-BOmVa4xN.js} +0 -0
  118. /package/lib/{modal-DWyWrN-D.js → modal-cjj3Nw1B.js} +0 -0
  119. /package/lib/{page_header-BJkEstRw.js → page_header-BfuWJIdd.js} +0 -0
  120. /package/lib/{pagination-5t7AOeFV.js → pagination-DpOSOFwl.js} +0 -0
  121. /package/lib/{polygon-C4Ow2lxi.js → polygon-BY1FAACc.js} +0 -0
  122. /package/lib/{qrcode-BKG2MibP.js → qrcode-Bgr8gJzA.js} +0 -0
  123. /package/lib/{space-Bv-p0DL8.js → space-BT_dVhhv.js} +0 -0
  124. /package/lib/{tabbar-CI1xSj1G.js → tabbar-DO0kB58Y.js} +0 -0
  125. /package/lib/{table-DfL2hFqA.js → table-saZMryiV.js} +0 -0
  126. /package/lib/{tag-72DwCkvq.js → tag-BtDcKdxo.js} +0 -0
@@ -0,0 +1,128 @@
1
+ import type { HTMLAttributes } from "preact";
2
+
3
+ interface ButtonProps extends HTMLAttributes<HTMLDivElement> {
4
+ type?: "primary" | "default" | "link";
5
+ block?: boolean;
6
+ disabled?: boolean;
7
+ loading?: boolean;
8
+ "loading-text"?: string;
9
+ ghost?: boolean;
10
+ }
11
+
12
+ interface ModalProps extends HTMLAttributes<HTMLElement> {
13
+ header?: string | boolean;
14
+ show?: string | boolean;
15
+ onok?: (e: CustomEvent) => void;
16
+ oncancel?: (e: CustomEvent) => void;
17
+ footer?: boolean | string;
18
+ close?: boolean | string;
19
+ title?: string;
20
+ "destroy-on-close"?: boolean;
21
+ "vertical-align"?: string;
22
+ "mask-closable"?: string | boolean;
23
+ }
24
+
25
+ interface TagProps extends HTMLAttributes<HTMLDivElement> {
26
+ closeable?: boolean;
27
+ type?: "primary" | "info" | "success";
28
+ }
29
+
30
+ interface FormItemProps extends HTMLAttributes<HTMLDivElement> {
31
+ label?: string;
32
+ labelPosition?: "top" | "left";
33
+ required?: boolean;
34
+ prop?: string;
35
+ /** 验证失败时的提示信息 */
36
+ validity?: string;
37
+ pattern?: string;
38
+ }
39
+
40
+ interface PageHeaderProps extends HTMLAttributes<HTMLDivElement> {
41
+ /** 标题 */
42
+ "page-title"?: string;
43
+ /** 对齐方式 */
44
+ align?: "left" | "center";
45
+ onaction?: (e: CustomEvent) => void;
46
+ }
47
+
48
+ interface CheckBoxProps extends HTMLAttributes<HTMLDivElement> {
49
+ checked?: boolean;
50
+ value?: string;
51
+ label?: string;
52
+ }
53
+
54
+ interface CheckboxGroupProps extends HTMLAttributes<HTMLElement> {
55
+ gap?: string;
56
+ value?: string;
57
+ onchange?: (e: CustomEvent) => void;
58
+ }
59
+
60
+ interface MenuProps extends HTMLAttributes<HTMLElement> {
61
+ index?: string;
62
+ onselect?: (e: CustomEvent) => void;
63
+ /** 当前选中的菜单 */
64
+ "selected-index"?: string;
65
+ }
66
+
67
+ interface IconProps extends HTMLAttributes<HTMLElement> {}
68
+
69
+ interface QrcodeProps extends HTMLAttributes<HTMLElement> {
70
+ text: string;
71
+ size?: number | string;
72
+ level?: "H" | "M" | "Q" | "L";
73
+ }
74
+
75
+ type FormProps = HTMLAttributes<HTMLElement> & {
76
+ /** 表单内的输入元素是否铺满剩余宽度 */
77
+ "inner-block"?: boolean;
78
+ /** 标签的位置; 默认: left */
79
+ "label-position"?: "top" | "left" | "right";
80
+ /** 表单域标签的宽度, 可以传 auto */
81
+ "label-width"?: string;
82
+ novalidate?: boolean;
83
+ onsubmit?: (
84
+ e: CustomEvent<{
85
+ email: string;
86
+ password: string;
87
+ }>,
88
+ ) => void | Promise<void>;
89
+ };
90
+
91
+ type InputProps = HTMLAttributes<HTMLElement> & {
92
+ placeholder?: string;
93
+ value?: string;
94
+ oninput?: (e: CustomEvent) => void;
95
+ type?: string;
96
+ name?: string;
97
+ maxlength?: number;
98
+ };
99
+
100
+ // 正确扩展 Preact 的 JSX 命名空间以支持 VSCode 智能感知
101
+ declare global {
102
+ namespace preact {
103
+ namespace JSX {
104
+ // 扩展 IntrinsicElements 以支持自定义元素
105
+ interface IntrinsicElements {
106
+ "l-arrow-right-icon": IconProps;
107
+ "l-select-icon": IconProps;
108
+ "l-close-icon": IconProps;
109
+ "l-checkbox": CheckBoxProps;
110
+ "l-checkbox-group": CheckboxGroupProps;
111
+ "l-radio-group": CheckboxGroupProps;
112
+ "l-radio": CheckBoxProps;
113
+ "l-button": ButtonProps;
114
+ "l-tag": TagProps;
115
+ "l-modal": ModalProps;
116
+ "l-form-item": FormItemProps;
117
+ "l-form": FormProps;
118
+ "l-page-header": PageHeaderProps;
119
+ "l-menu": MenuProps;
120
+ "l-sub-menu": MenuProps;
121
+ "l-menu-item": MenuProps;
122
+ "l-arrow-down-icon": IconProps;
123
+ "l-qrcode": QrcodeProps;
124
+ "l-input": InputProps;
125
+ }
126
+ }
127
+ }
128
+ }
@@ -1,16 +0,0 @@
1
- import { n as e, t } from "./check-CvGaONEx.js";
2
- //#region src/components/check/checkbox.less?inline
3
- var n = ":host(.is-indeterminate) .l-check__inner{background-color:var(--l-primary-color,#722ed1)}:host(.is-indeterminate) .l-check__inner:after{content:\"\";width:calc(var(--l-check-size) * .4);border:none;border-bottom:1px solid #fff;height:1px;margin-top:0;display:block;transform:rotate(0)}.l-check__inner:after,:host(.is-checked) .l-check__inner:after{content:\"\";width:calc(var(--l-check-size) * .6);height:calc(var(--l-check-size) * .3);border-top:none;border-bottom:1px solid #0000;border-left:1px solid #0000;border-right:none;margin-top:-3px;transition:border-color .2s ease-in-out;display:block;transform:rotate(-45deg)}:host(.is-checked) .l-check__inner{background-color:var(--l-primary-color,#722ed1)}:host(.is-checked) .l-check__inner:after{border-color:#fff}:host(.is-disabled) .l-check__inner{background-color:var(--l-disabled-color,#e6e6e6);border-color:var(--l-disabled-color,#e6e6e6)}", r = class extends e {
4
- static baseName = "checkbox";
5
- constructor() {
6
- super(), this._inputType = "checkbox";
7
- }
8
- connectedCallback() {
9
- this.loadStyleText([t, n]), super.connectedCallback();
10
- }
11
- _doChangeAction() {
12
- this.getChecked() ? this.setChecked(!1) : this.setChecked(!0), this.emitChange();
13
- }
14
- };
15
- //#endregion
16
- export { r as t };
@@ -1,244 +0,0 @@
1
- //#region node_modules/.pnpm/alien-signals@3.1.2/node_modules/alien-signals/esm/system.mjs
2
- function e({ update: e, notify: t, unwatched: n }) {
3
- return {
4
- link: r,
5
- unlink: i,
6
- propagate: a,
7
- checkDirty: o,
8
- shallowPropagate: s
9
- };
10
- function r(e, t, n) {
11
- let r = t.depsTail;
12
- if (r !== void 0 && r.dep === e) return;
13
- let i = r === void 0 ? t.deps : r.nextDep;
14
- if (i !== void 0 && i.dep === e) {
15
- i.version = n, t.depsTail = i;
16
- return;
17
- }
18
- let a = e.subsTail;
19
- if (a !== void 0 && a.version === n && a.sub === t) return;
20
- let o = t.depsTail = e.subsTail = {
21
- version: n,
22
- dep: e,
23
- sub: t,
24
- prevDep: r,
25
- nextDep: i,
26
- prevSub: a,
27
- nextSub: void 0
28
- };
29
- i !== void 0 && (i.prevDep = o), r === void 0 ? t.deps = o : r.nextDep = o, a === void 0 ? e.subs = o : a.nextSub = o;
30
- }
31
- function i(e, t = e.sub) {
32
- let r = e.dep, i = e.prevDep, a = e.nextDep, o = e.nextSub, s = e.prevSub;
33
- return a === void 0 ? t.depsTail = i : a.prevDep = i, i === void 0 ? t.deps = a : i.nextDep = a, o === void 0 ? r.subsTail = s : o.prevSub = s, s === void 0 ? (r.subs = o) === void 0 && n(r) : s.nextSub = o, a;
34
- }
35
- function a(e) {
36
- let n = e.nextSub, r;
37
- top: do {
38
- let i = e.sub, a = i.flags;
39
- if (a & 60 ? a & 12 ? a & 4 ? !(a & 48) && c(e, i) ? (i.flags = a | 40, a &= 1) : a = 0 : i.flags = a & -9 | 32 : a = 0 : i.flags = a | 32, a & 2 && t(i), a & 1) {
40
- let t = i.subs;
41
- if (t !== void 0) {
42
- let i = (e = t).nextSub;
43
- i !== void 0 && (r = {
44
- value: n,
45
- prev: r
46
- }, n = i);
47
- continue;
48
- }
49
- }
50
- if ((e = n) !== void 0) {
51
- n = e.nextSub;
52
- continue;
53
- }
54
- for (; r !== void 0;) if (e = r.value, r = r.prev, e !== void 0) {
55
- n = e.nextSub;
56
- continue top;
57
- }
58
- break;
59
- } while (!0);
60
- }
61
- function o(t, n) {
62
- let r, i = 0, a = !1;
63
- top: do {
64
- let o = t.dep, c = o.flags;
65
- if (n.flags & 16) a = !0;
66
- else if ((c & 17) == 17) {
67
- if (e(o)) {
68
- let e = o.subs;
69
- e.nextSub !== void 0 && s(e), a = !0;
70
- }
71
- } else if ((c & 33) == 33) {
72
- (t.nextSub !== void 0 || t.prevSub !== void 0) && (r = {
73
- value: t,
74
- prev: r
75
- }), t = o.deps, n = o, ++i;
76
- continue;
77
- }
78
- if (!a) {
79
- let e = t.nextDep;
80
- if (e !== void 0) {
81
- t = e;
82
- continue;
83
- }
84
- }
85
- for (; i--;) {
86
- let i = n.subs, o = i.nextSub !== void 0;
87
- if (o ? (t = r.value, r = r.prev) : t = i, a) {
88
- if (e(n)) {
89
- o && s(i), n = t.sub;
90
- continue;
91
- }
92
- a = !1;
93
- } else n.flags &= -33;
94
- n = t.sub;
95
- let c = t.nextDep;
96
- if (c !== void 0) {
97
- t = c;
98
- continue top;
99
- }
100
- }
101
- return a;
102
- } while (!0);
103
- }
104
- function s(e) {
105
- do {
106
- let n = e.sub, r = n.flags;
107
- (r & 48) == 32 && (n.flags = r | 16, (r & 6) == 2 && t(n));
108
- } while ((e = e.nextSub) !== void 0);
109
- }
110
- function c(e, t) {
111
- let n = t.depsTail;
112
- for (; n !== void 0;) {
113
- if (n === e) return !0;
114
- n = n.prevDep;
115
- }
116
- return !1;
117
- }
118
- }
119
- //#endregion
120
- //#region node_modules/.pnpm/alien-signals@3.1.2/node_modules/alien-signals/esm/index.mjs
121
- var t = 0, n = 0, r = 0, i = 0, a, o = [], { link: s, unlink: c, propagate: l, checkDirty: u, shallowPropagate: d } = e({
122
- update(e) {
123
- return e.depsTail === void 0 ? g(e) : h(e);
124
- },
125
- notify(e) {
126
- let t = i, n = t;
127
- do
128
- if (o[t++] = e, e.flags &= -3, e = e.subs?.sub, e === void 0 || !(e.flags & 2)) break;
129
- while (!0);
130
- for (i = t; n < --t;) {
131
- let e = o[n];
132
- o[n++] = o[t], o[t] = e;
133
- }
134
- },
135
- unwatched(e) {
136
- e.flags & 1 ? e.depsTail !== void 0 && (e.depsTail = void 0, e.flags = 17, S(e)) : x.call(e);
137
- }
138
- });
139
- function f(e) {
140
- let t = a;
141
- return a = e, t;
142
- }
143
- function p(e) {
144
- return y.bind({
145
- currentValue: e,
146
- pendingValue: e,
147
- subs: void 0,
148
- subsTail: void 0,
149
- flags: 1
150
- });
151
- }
152
- function m(e) {
153
- let t = {
154
- fn: e,
155
- subs: void 0,
156
- subsTail: void 0,
157
- deps: void 0,
158
- depsTail: void 0,
159
- flags: 6
160
- }, n = f(t);
161
- n !== void 0 && s(t, n, 0);
162
- try {
163
- t.fn();
164
- } finally {
165
- a = n, t.flags &= -5;
166
- }
167
- return b.bind(t);
168
- }
169
- function h(e) {
170
- ++t, e.depsTail = void 0, e.flags = 5;
171
- let n = f(e);
172
- try {
173
- let t = e.value;
174
- return t !== (e.value = e.getter(t));
175
- } finally {
176
- a = n, e.flags &= -5, S(e);
177
- }
178
- }
179
- function g(e) {
180
- return e.flags = 1, e.currentValue !== (e.currentValue = e.pendingValue);
181
- }
182
- function _(e) {
183
- let n = e.flags;
184
- if (n & 16 || n & 32 && u(e.deps, e)) {
185
- ++t, e.depsTail = void 0, e.flags = 6;
186
- let n = f(e);
187
- try {
188
- e.fn();
189
- } finally {
190
- a = n, e.flags &= -5, S(e);
191
- }
192
- } else e.flags = 2;
193
- }
194
- function v() {
195
- try {
196
- for (; r < i;) {
197
- let e = o[r];
198
- o[r++] = void 0, _(e);
199
- }
200
- } finally {
201
- for (; r < i;) {
202
- let e = o[r];
203
- o[r++] = void 0, e.flags |= 10;
204
- }
205
- r = 0, i = 0;
206
- }
207
- }
208
- function y(...e) {
209
- if (e.length) {
210
- if (this.pendingValue !== (this.pendingValue = e[0])) {
211
- this.flags = 17;
212
- let e = this.subs;
213
- e !== void 0 && (l(e), n || v());
214
- }
215
- } else {
216
- if (this.flags & 16 && g(this)) {
217
- let e = this.subs;
218
- e !== void 0 && d(e);
219
- }
220
- let e = a;
221
- for (; e !== void 0;) {
222
- if (e.flags & 3) {
223
- s(this, e, t);
224
- break;
225
- }
226
- e = e.subs?.sub;
227
- }
228
- return this.currentValue;
229
- }
230
- }
231
- function b() {
232
- x.call(this);
233
- }
234
- function x() {
235
- this.depsTail = void 0, this.flags = 0, S(this);
236
- let e = this.subs;
237
- e !== void 0 && c(e);
238
- }
239
- function S(e) {
240
- let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
241
- for (; n !== void 0;) n = c(n, e);
242
- }
243
- //#endregion
244
- export { p as n, m as t };